pub struct RegionMask {
pub name: String,
pub voxels: Vec<bool>,
}Expand description
Named voxel mask in grid order (i + nx*j + nx*ny*k).
Fields§
§name: String§voxels: Vec<bool>Implementations§
Source§impl RegionMask
impl RegionMask
Sourcepub fn included_voxel_count(&self) -> usize
pub fn included_voxel_count(&self) -> usize
Number of voxels included in the mask.
Sourcepub fn subtract(
&self,
other: &RegionMask,
name: impl Into<String>,
) -> Result<RegionMask, ValidationError>
pub fn subtract( &self, other: &RegionMask, name: impl Into<String>, ) -> Result<RegionMask, ValidationError>
self minus other, under name.
Both masks must describe the same voxel count — masks do not carry their grid, so the caller binds them to a shared case geometry. The result must select at least one voxel.
Sourcepub fn union(
&self,
other: &RegionMask,
name: impl Into<String>,
) -> Result<RegionMask, ValidationError>
pub fn union( &self, other: &RegionMask, name: impl Into<String>, ) -> Result<RegionMask, ValidationError>
Union of self and other, under name.
Sourcepub fn intersection(
&self,
other: &RegionMask,
name: impl Into<String>,
) -> Result<RegionMask, ValidationError>
pub fn intersection( &self, other: &RegionMask, name: impl Into<String>, ) -> Result<RegionMask, ValidationError>
Intersection of self and other, under name.
Sourcepub fn summarize(
&self,
values: &[f64],
) -> Result<MaskDoseSummary, ValidationError>
pub fn summarize( &self, values: &[f64], ) -> Result<MaskDoseSummary, ValidationError>
Mean and maximum of a per-voxel quantity inside this mask.
values must be laid out on the same voxel count as the mask.
Sourcepub fn centroid_lps_mm(
&self,
geometry: &GridGeometry,
) -> Result<[f64; 3], ValidationError>
pub fn centroid_lps_mm( &self, geometry: &GridGeometry, ) -> Result<[f64; 3], ValidationError>
Centroid of the included voxels’ centers in LPS millimetres.
geometry must describe the grid this mask indexes; the mask must
select at least one voxel.
Trait Implementations§
Source§impl Clone for RegionMask
impl Clone for RegionMask
Source§fn clone(&self) -> RegionMask
fn clone(&self) -> RegionMask
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 RegionMask
impl Debug for RegionMask
Source§impl<'de> Deserialize<'de> for RegionMask
impl<'de> Deserialize<'de> for RegionMask
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
impl Eq for RegionMask
Source§impl PartialEq for RegionMask
impl PartialEq for RegionMask
Source§impl Serialize for RegionMask
impl Serialize for RegionMask
impl StructuralPartialEq for RegionMask
Auto Trait Implementations§
impl Freeze for RegionMask
impl RefUnwindSafe for RegionMask
impl Send for RegionMask
impl Sync for RegionMask
impl Unpin for RegionMask
impl UnsafeUnpin for RegionMask
impl UnwindSafe for RegionMask
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