Skip to main content

CziReader

Struct CziReader 

Source
pub struct CziReader(/* private fields */);
Expand description

CZI-reader object.

Implementations§

Source§

impl CziReader

Source

pub fn create() -> Result<Self, Error>

Create a new CZI-reader object.

\param [out] reader_object If the operation is successful, a handle to the newly created reader object is put here.

\returns An error-code indicating success or failure of the operation.

Source

pub fn open(&self, open_info: ReaderOpenInfo) -> Result<(), Error>

Instruct the specified reader-object to open a CZI-document. The ‘open_info’ parameter contains a handle to a stream-object which is used to read the document.

\param reader_object A handle representing the reader-object. \param open_info Parameters controlling the operation.

\returns An error-code indicating success or failure of the operation.

Source

pub fn get_file_header_info(&self) -> Result<FileHeaderInfo, Error>

Get information about the file-header of the CZI document. The information is put into the ‘file_header_info_interop’ structure. This file_header_info_interop structure contains the GUID of the CZI document and the version levels of CZI.

\param reader_object The reader object. \param [out] file_header_info_interop If successful, the retrieved information is put here.

\returns An error-code indicating success or failure of the operation.

Source

pub fn read_sub_block(&self, index: i32) -> Result<SubBlock, Error>

Reads the sub-block identified by the specified index. If there is no sub-block present (for the specified index) then the function returns ‘LibCZIApi_ErrorCode_OK’, but the ‘sub_block_object’ is set to ‘kInvalidObjectHandle’.

\param reader_object The reader object. \param index Index of the sub-block. \param [out] sub_block_object If successful, a handle to the sub-block object is put here; otherwise ‘kInvalidObjectHandle’.

\returns An error-code indicating success or failure of the operation.

Source

pub fn get_statistics_simple(&self) -> Result<SubBlockStatistics, Error>

Get statistics about the sub-blocks in the CZI-document. This function provides a simple version of the statistics, the information retrieved does not include the per-scene statistics.

\param reader_object The reader object. \param [out] statistics If non-null, the simple statistics will be put here.

\returns An error-code indicating success or failure of the operation.

Source

pub fn get_statistics_ex( &self, number_of_per_channel_bounding_boxes: i32, ) -> Result<(SubBlockStatisticsEx, i32), Error>

Get extended statistics about the sub-blocks in the CZI-document. This function provides a more detailed version of the statistics, including the per-scene statistics. Note that the statistics is of variable size, and the semantic is as follows:

  • On input, the argument ‘number_of_per_channel_bounding_boxes’ must point to an integer which describes the size of the argument ‘statistics’. This number gives how many elements the array ‘per_scenes_bounding_boxes’ in ‘SubBlockStatisticsInteropEx’ can hold. Only that number of per-scene information elements will be put into the ‘statistics’ structure at most, in any case.
  • On output, the argument ‘number_of_per_channel_bounding_boxes’ will be set to the number of per-channel bounding boxes that were actually available.
  • In the returned ‘SubBlockStatisticsInteropEx’ structure, the ‘number_of_per_scenes_bounding_boxes’ field will be set to the number of per-scene information that is put into this struct (which may be less than number of scenes that are available).

So, the caller is expected to check the returned ‘number_of_per_channel_bounding_boxes’ to see how many per-channel bounding boxes are available. If this number is greater than the number of elements (given with the ‘number_of_per_scenes_bounding_boxes’ value in the ‘statistics’ structure), then the caller should allocate a larger ‘statistics’ structure and call this function again (with an increased ‘number_of_per_scenes_bounding_boxes’).

\param reader_object The reader object. \param [out] statistics If non-null, the statistics will be put here. \param [in,out] number_of_per_channel_bounding_boxes On input, it gives the number of elements that can be put into the ‘per_scenes_bounding_boxes’ array. On output, it gives the number of elements which are available.

\returns An error-code indicating success or failure of the operation.

Source

pub fn get_pyramid_statistics(&self) -> Result<String, Error>

Get "pyramid-statistics" about the CZI-document. This function provides a JSON-formatted string which contains information about the pyramid. The JSON-schema is as follows: \code { "scenePyramidStatistics": { <sceneIndex>: [ { "layerInfo": { "minificationFactor": <number>, "pyramidLayerNo" : <number> }, "count" : <number> } ]} } \endcode It resembles the corresponding C++-structure ‘PyramidStatistics’ in the libCZI-library.

\param reader_object The reader object. \param [out] pyramid_statistics_as_json If successful, a pointer to a JSON-formatted string is placed here. The caller is responsible for freeing this memory (by calling libCZI_Free).

\returns An error-code indicating success or failure of the operation.

Source

pub fn get_metadata_segment(&self) -> Result<MetadataSegment, Error>

Create a metadata-segment object from the reader-object. The metadata-segment object can be used to retrieve the XML-metadata of the CZI-document.

\param reader_object The reader object. \param [out] metadata_segment_object If successful, a handle to the metadata-segment object is put here.

\returns An error-code indicating success or failure of the operation.

Source

pub fn get_attachment_count(&self) -> Result<i32, Error>

Get the number of attachments available.

\param reader_object The reader object. \param [out] count The number of available attachments is put here. \returns An error-code indicating success or failure of the operation.

Source

pub fn get_attachment_info_from_directory( &self, index: i32, ) -> Result<AttachmentInfo, Error>

Get information about the attachment at the specified index. The information is put into the ‘attachment_info_interop’ structure. If the index is not valid, then the function returns ‘LibCZIApi_ErrorCode_IndexOutOfRange’.

\param reader_object The reader object. \param index The index of the attachment to query information for. \param [out] attachment_info_interop If successful, the retrieved information is put here.

\returns An error-code indicating success or failure of the operation.

Source

pub fn read_attachment(&self, index: i32) -> Result<Attachment, Error>

Read the attachment with the specified index and create an attachment object representing it. If the specified index is invalid, then the returned attachment-object handle will have the value ‘kInvalidObjectHandle’. \param reader_object The reader object. \param index The index of the attachment to get. \param [out] attachment_object If successful and index is valid, a handle representing the attachment object is put here. If the index is invalid, then the handle will have the value ‘kInvalidObjectHandle’. \returns An error-code indicating success or failure of the operation.

Source

pub fn release(&self) -> Result<(), Error>

Release the specified reader-object. After this function is called, the handle is no longer valid.

\param reader_object The reader object.

\returns An error-code indicating success or failure of the operation.

Source

pub fn try_get_sub_block_info_for_index( &self, index: i32, ) -> Result<SubBlockInfo, Error>

Get information about the sub-block with the specified index. The information is put into the ‘sub_block_info_interop’ structure. If the index is not valid, then the function returns ‘LibCZIApi_ErrorCode_IndexOutOfRange’.

\param reader_object The reader object. \param index The index of the attachment to query information for. \param [out] sub_block_info_interop If successful, the retrieved information is put here.

\returns An error-code indicating success or failure of the operation.

Source

pub fn create_single_channel_tile_accessor( &self, ) -> Result<SingleChannelScalingTileAccessor, Error>

Create a single channel scaling tile accessor.

\param reader_object A handle representing the reader-object. \param accessor_object [out] If the operation is successful, a handle to the newly created single-channel-scaling-tile-accessor is put here.

\returns An error-code indicating success or failure of the operation.

Trait Implementations§

Source§

impl Clone for CziReader

Source§

fn clone(&self) -> CziReader

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CziReader

Source§

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

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

impl Deref for CziReader

Source§

type Target = i64

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl Drop for CziReader

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.