Struct MCD

Source
pub struct MCD<R> { /* private fields */ }
Expand description

Represents a imaging mass cytometry (*.mcd) file.

Implementations§

Source§

impl MCD<File>

Source

pub fn from_path<P: AsRef<Path>>(path: P) -> Result<MCD<File>>

Open an .mcd file from the specified path.

Source

pub fn location(&self) -> Option<&Path>

Returns the location (path) of the .mcd file

Source

pub fn set_location<P: AsRef<Path>>(&mut self, location: P)

Returns the location (path) of the .mcd file

Source

pub fn with_dcm(self) -> Result<Self>

Use a temporary file for faster access to channel images.

If this file does not already exist, then it is created.

Data is stored in the .mcd file spectrum-wise which means to load a single image, the entire acquired acquisition must be loaded first. This method creates a temporary file (.dcm) in the same location as the *.mcd file (if it doesn’t already exist) which has the channel data stored image-wise. If this file is present and loaded, then Mcd will choose the fastest method to use to return the requested data.

§Errors

If the location is not set either automatically via MCD::from_path or manually via MCD::set_location then a MCDError::LocationNotSpecified will occur.

Source§

impl<R: Read + Seek> MCD<R>

Source

pub fn parse(reader: R) -> Result<Self>

Parse *.mcd format

Source

pub fn xml(&self) -> Result<String>

Returns the raw XML metadata stored in the .mcd file

Source§

impl<R> MCD<R>

Source

pub fn slide_ids(&self) -> Vec<u16>

Returns a copy of the slide IDs, sorted by ID number

Source

pub fn slide(&self, id: u16) -> Option<&Slide<R>>

Returns slide with a given ID number, or None if no such slide exists

Source

pub fn slides(&self) -> Vec<&Slide<R>>

Returns a vector of references to slides sorted by ID number. This allocates a new vector on each call.

Source

pub fn acquisitions(&self) -> Vec<&Acquisition<R>>

Return a vector of references to all acquisitions in the .mcd file (iterates over all slides and all panoramas).

Source

pub fn acquisition<A: Into<AcquisitionIdentifier>>( &self, identifier: A, ) -> Option<&Acquisition<R>>

Return an acquisition which matches the supplied AcquisitionIdentifier or None if no match found

Source

pub fn acquisitions_in(&self, region: &BoundingBox<f64>) -> Vec<&Acquisition<R>>

Returns a list of acquisitions which are at least partially contained within the specified bounding box.

Source

pub fn channels(&self) -> Vec<&AcquisitionChannel>

Returns a vector of all channels present within any acquisition performed on the slide, sorted by channel order number.

Source

pub fn channels_excluding( &self, exclusion_list: Vec<&str>, ) -> Vec<&AcquisitionChannel>

Returns a vector of all channels, excluding those from the acquisitions with names matching those specified

Source

pub fn calibration_final(&self, id: u16) -> Option<&CalibrationFinal>

Returns an instance of CalibrationFinal with the specified ID, or None if none exists (this is always the case in version 1 of the Schema)

Source

pub fn calibration_params(&self, id: u16) -> Option<&CalibrationParams>

Returns an instance of CalibrationParams with the specified ID, or None if none exists (this is always the case in version 1 of the Schema)

Source

pub fn calibration_channels(&self, id: u16) -> Option<&CalibrationChannel>

Returns an instance of CalibrationChannel with the specified ID, or None if none exists (this is always the case in version 1 of the Schema)

Source

pub fn calibration(&self, id: u16) -> Option<&Calibration>

Returns an instance of Calibration with the specified ID, or None if none exists (this is always the case in version 1 of the Schema)

Source

pub fn slide_fiducal_marks(&self, id: u16) -> Option<&SlideFiducialMarks>

Returns an instance of SlideFiducialMarks with the specified ID, or None if none exists (this is always the case in version 1 of the Schema)

Source

pub fn slide_profile(&self, id: u16) -> Option<&SlideProfile>

Returns an instance of SlideProfile with the specified ID, or None if none exists (this is always the case in version 1 of the Schema)

Trait Implementations§

Source§

impl<R: Debug> Debug for MCD<R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<R> Display for MCD<R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<R> Print for MCD<R>

Source§

fn print<W: Write + ?Sized>(&self, writer: &mut W, indent: usize) -> Result

Formats and prints to writer

Auto Trait Implementations§

§

impl<R> Freeze for MCD<R>

§

impl<R> RefUnwindSafe for MCD<R>

§

impl<R> Send for MCD<R>
where R: Send,

§

impl<R> Sync for MCD<R>
where R: Send,

§

impl<R> Unpin for MCD<R>

§

impl<R> UnwindSafe for MCD<R>

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.