Struct bader::voxel_map::VoxelMap

source ·
pub struct VoxelMap {
    pub voxel_map: Vec<isize>,
    pub weight_map: Vec<Box<[f64]>>,
    pub grid: Grid,
}
Expand description

A VoxelMap for if the maxima stored are atomic indices.

Fields§

§voxel_map: Vec<isize>

The vector mapping the voxel to a maxima.

§weight_map: Vec<Box<[f64]>>

The vector containing the weights for boundary voxels.

§grid: Grid

The Grid used to navigate the VoxelMap.

Implementations§

source§

impl VoxelMap

source

pub fn new( voxel_map: Vec<isize>, weight_map: Vec<Box<[f64]>>, grid: Grid ) -> Self

Create a new VoxelMap

source

pub fn from_blocking_voxel_map(voxel_map: BlockingVoxelMap) -> Self

Create a new VoxelMap from a BlockingVoxelMap.

source

pub fn weight_iter(&self) -> Iter<'_, Box<[f64]>>

Produce an Iter over the boundary voxels.

source

pub fn weight_len(&self) -> usize

Get the length of the weight_map.

source

pub fn grid_get(&self) -> &Grid

Get a refernce to the grid used by the VoxelMap.

source

pub fn maxima_to_atom(&self, maxima: usize) -> usize

Returns the atom associated with the point.

source

pub fn maxima_to_voxel(&self, maxima: isize) -> Voxel<'_>

Retrieval of the state of the voxel, p.

source

pub fn maxima_to_weight(&self, maxima: isize) -> &[f64]

Return a reference to the weights from the given maxima, Note: maxima here must be < -1.

source

pub fn maxima_iter(&self) -> Iter<'_, isize>

Return an Iter over the maxima stored in the VoxelMap.

source

pub fn maxima_len(&self) -> usize

Get the length of the voxel_map.

source

pub fn maxima_chunks(&self, chunk_size: usize) -> Chunks<'_, isize>

Return a Chunk over the maxima stored in the VoxelMap.

source

pub fn voxel_get(&self, p: isize) -> Voxel<'_>

Retrieval of the state of the voxel, p.

source

pub fn maxima_get(&self, p: isize) -> isize

Return the stored maxima at point p.

source

pub fn volume_map(&self, volume_number: isize) -> Vec<Option<f64>>

Produce a mask for a specific volume number.

source

pub fn multi_volume_map( &self, volume_numbers: &FxHashSet<isize> ) -> Vec<Option<f64>>

Produce a mask for a collection volume numbers.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.