pub struct CheckerboardComplex {
pub dims: [usize; 2],
pub data: Vec<bool>,
}Expand description
Cubical complex for image topology (checkerboard-like).
Represents a binary image as a cubical complex and computes its topological features.
Fields§
§dims: [usize; 2]Grid dimensions [nx, ny]
data: Vec<bool>Binary image data (true = filled voxel)
Implementations§
Source§impl CheckerboardComplex
impl CheckerboardComplex
Sourcepub fn new(dims: [usize; 2], data: Vec<bool>) -> Self
pub fn new(dims: [usize; 2], data: Vec<bool>) -> Self
Creates a cubical complex from a binary grid.
§Arguments
dims- Grid dimensions [nx, ny]data- Binary values row-major
Sourcepub fn filled_disk(size: usize, radius: f64) -> Self
pub fn filled_disk(size: usize, radius: f64) -> Self
Creates a filled disk of given radius in a grid.
Sourcepub fn annulus(size: usize, r_inner: f64, r_outer: f64) -> Self
pub fn annulus(size: usize, r_inner: f64, r_outer: f64) -> Self
Creates an annulus (ring) in a grid.
Sourcepub fn euler_characteristic_2d(&self) -> i64
pub fn euler_characteristic_2d(&self) -> i64
Computes the Euler characteristic via the cubical formula.
χ = V - E + F for 2D cubical complex
Trait Implementations§
Source§impl Clone for CheckerboardComplex
impl Clone for CheckerboardComplex
Source§fn clone(&self) -> CheckerboardComplex
fn clone(&self) -> CheckerboardComplex
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CheckerboardComplex
impl RefUnwindSafe for CheckerboardComplex
impl Send for CheckerboardComplex
impl Sync for CheckerboardComplex
impl Unpin for CheckerboardComplex
impl UnsafeUnpin for CheckerboardComplex
impl UnwindSafe for CheckerboardComplex
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.