Skip to main content

Nd2File

Struct Nd2File 

Source
pub struct Nd2File { /* private fields */ }
Expand description

Main reader for ND2 files

Implementations§

Source§

impl Nd2File

Source

pub fn open<P: AsRef<Path>>(path: P) -> Result<Self>

Open an ND2 file for reading

Source

pub fn version(&self) -> (u32, u32)

Get the file format version (major, minor)

Source

pub fn attributes(&mut self) -> Result<&Attributes>

Get image attributes

Source

pub fn experiment(&mut self) -> Result<&Vec<ExpLoop>>

Get experiment loop definitions

Source

pub fn text_info(&mut self) -> Result<&TextInfo>

Get text info (descriptions, author, date, etc.)

Source

pub fn chunk_names(&self) -> Vec<String>

List all chunk names in the file

Source

pub fn read_raw_chunk(&mut self, name: &[u8]) -> Result<Vec<u8>>

Read raw chunk data by name

Source

pub fn sizes(&mut self) -> Result<HashMap<String, usize>>

Dimensions (P,T,C,Z,Y,X) derived from attributes + experiment. When experiment is empty, infers minimal structure from sequence_count.

Source

pub fn loop_indices(&mut self) -> Result<Vec<HashMap<String, usize>>>

Loop indices for each sequence chunk: seq_index -> axis name -> index. Channel is omitted when stored in-pixel instead of as separate chunks.

Source

pub fn read_frame(&mut self, index: usize) -> Result<Vec<u16>>

Read one frame by sequence index. Returns pixels as (C, Y, X) u16 data.

Source

pub fn read_frame_2d( &mut self, p: usize, t: usize, c: usize, z: usize, ) -> Result<Vec<u16>>

Read 2D Y×X frame at (p,t,c,z). Returns the Y×X pixels for the requested channel.

Trait Implementations§

Source§

impl Drop for Nd2File

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.