pub struct GridGeometry {
pub shape: [u32; 3],
pub spacing_mm: [f64; 3],
pub origin_mm: [f64; 3],
pub direction: [f64; 9],
}Expand description
A regular patient-coordinate voxel grid.
direction is row-major and maps voxel axes into the patient coordinate
frame. Geometry importers must preserve the original DICOM frame of
reference outside this numerical representation.
Fields§
§shape: [u32; 3]§spacing_mm: [f64; 3]§origin_mm: [f64; 3]§direction: [f64; 9]Implementations§
Source§impl GridGeometry
impl GridGeometry
pub fn voxel_count(&self) -> Result<usize, ValidationError>
Sourcepub fn voxel_center_lps_mm(
&self,
voxel: [u32; 3],
) -> Result<[f64; 3], ValidationError>
pub fn voxel_center_lps_mm( &self, voxel: [u32; 3], ) -> Result<[f64; 3], ValidationError>
Return the patient-coordinate center of a voxel in millimetres.
Sourcepub fn bounding_box_lps_mm(
&self,
) -> Result<([f64; 3], [f64; 3]), ValidationError>
pub fn bounding_box_lps_mm( &self, ) -> Result<([f64; 3], [f64; 3]), ValidationError>
World-axis-aligned bounding box (minimum, maximum) of the grid’s
voxel extents in LPS millimetres. origin_mm is voxel index
[0,0,0]’s center, so each face sits half a spacing beyond the
extreme centers along the (possibly rotated) voxel axes.
Trait Implementations§
Source§impl Clone for GridGeometry
impl Clone for GridGeometry
Source§fn clone(&self) -> GridGeometry
fn clone(&self) -> GridGeometry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GridGeometry
impl Debug for GridGeometry
Source§impl<'de> Deserialize<'de> for GridGeometry
impl<'de> Deserialize<'de> for GridGeometry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for GridGeometry
impl PartialEq for GridGeometry
Source§impl Serialize for GridGeometry
impl Serialize for GridGeometry
impl StructuralPartialEq for GridGeometry
Auto Trait Implementations§
impl Freeze for GridGeometry
impl RefUnwindSafe for GridGeometry
impl Send for GridGeometry
impl Sync for GridGeometry
impl Unpin for GridGeometry
impl UnsafeUnpin for GridGeometry
impl UnwindSafe for GridGeometry
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