[][src]Struct n5::DatasetAttributes

pub struct DatasetAttributes { /* fields omitted */ }

Attributes of a tensor dataset.

Implementations

impl DatasetAttributes[src]

pub fn coord_iter(&self) -> impl Iterator<Item = Vec<u64>> + ExactSizeIterator[src]

pub fn bounded_coord_iter(
    &self,
    bbox: &BoundingBox
) -> impl Iterator<Item = Vec<u64>> + ExactSizeIterator
[src]

pub fn get_bounds(&self) -> BoundingBox[src]

pub fn get_block_bounds(&self, coord: &GridCoord) -> BoundingBox[src]

impl DatasetAttributes[src]

pub fn new(
    dimensions: GridCoord,
    block_size: BlockCoord,
    data_type: DataType,
    compression: CompressionType
) -> DatasetAttributes
[src]

pub fn get_dimensions(&self) -> &[u64][src]

pub fn get_block_size(&self) -> &[u32][src]

pub fn get_data_type(&self) -> &DataType[src]

pub fn get_compression(&self) -> &CompressionType[src]

pub fn get_ndim(&self) -> usize[src]

pub fn get_num_elements(&self) -> usize[src]

Get the total number of elements possible given the dimensions.

pub fn get_block_num_elements(&self) -> usize[src]

Get the total number of elements possible in a block.

pub fn get_grid_extent(&self) -> GridCoord[src]

Get the upper bound extent of grid coordinates.

pub fn get_num_blocks(&self) -> u64[src]

Get the total number of blocks.

use n5::prelude::*;
use n5::smallvec::smallvec;
let attrs = DatasetAttributes::new(
    smallvec![50, 40, 30],
    smallvec![11, 10, 10],
    DataType::UINT8,
    n5::compression::CompressionType::default(),
);
assert_eq!(attrs.get_num_blocks(), 60);

pub fn in_bounds(&self, grid_position: &GridCoord) -> bool[src]

Check whether a block grid position is in the bounds of this dataset.

use n5::prelude::*;
use n5::smallvec::smallvec;
let attrs = DatasetAttributes::new(
    smallvec![50, 40, 30],
    smallvec![11, 10, 10],
    DataType::UINT8,
    n5::compression::CompressionType::default(),
);
assert!(attrs.in_bounds(&smallvec![4, 3, 2]));
assert!(!attrs.in_bounds(&smallvec![5, 3, 2]));

Trait Implementations

impl Clone for DatasetAttributes[src]

impl Debug for DatasetAttributes[src]

impl<'de> Deserialize<'de> for DatasetAttributes[src]

impl PartialEq<DatasetAttributes> for DatasetAttributes[src]

impl Serialize for DatasetAttributes[src]

impl StructuralPartialEq for DatasetAttributes[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.