pub struct SliceStack {
pub slice_positions: Vec<f64>,
pub pixel_spacing: [f64; 2],
pub matrix_size: [usize; 2],
}Expand description
Stack geometry descriptor for a series of parallel DICOM slices.
Fields§
§slice_positions: Vec<f64>Ordered list of image-position patient z-coordinates (mm) for each slice in the series.
pixel_spacing: [f64; 2]Common pixel spacing [row, col] (mm).
matrix_size: [usize; 2]In-plane matrix size [rows, cols].
Implementations§
Source§impl SliceStack
impl SliceStack
Sourcepub fn new(
slice_positions: Vec<f64>,
pixel_spacing: [f64; 2],
matrix_size: [usize; 2],
) -> Self
pub fn new( slice_positions: Vec<f64>, pixel_spacing: [f64; 2], matrix_size: [usize; 2], ) -> Self
Build a slice stack from a vector of z-positions and common geometry.
Sourcepub fn slice_count(&self) -> usize
pub fn slice_count(&self) -> usize
Number of slices.
Sourcepub fn mean_slice_spacing(&self) -> Option<f64>
pub fn mean_slice_spacing(&self) -> Option<f64>
Mean inter-slice spacing (mm). Returns None for fewer than 2
slices.
Sourcepub fn slab_thickness(&self) -> f64
pub fn slab_thickness(&self) -> f64
Slab thickness covered by the whole series (mm).
Sourcepub fn field_of_view(&self) -> [f64; 2]
pub fn field_of_view(&self) -> [f64; 2]
Field of view in mm: [row FOV, col FOV].
Sourcepub fn voxel_volume_mm3(&self) -> Option<f64>
pub fn voxel_volume_mm3(&self) -> Option<f64>
Voxel volume in mm³ (pixel_spacing[0] × pixel_spacing[1] × mean slice_spacing).
Trait Implementations§
Source§impl Clone for SliceStack
impl Clone for SliceStack
Source§fn clone(&self) -> SliceStack
fn clone(&self) -> SliceStack
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 SliceStack
impl RefUnwindSafe for SliceStack
impl Send for SliceStack
impl Sync for SliceStack
impl Unpin for SliceStack
impl UnsafeUnpin for SliceStack
impl UnwindSafe for SliceStack
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.