nornir_volumecontroller API

nornir_volumecontroller.CreateVolumeController(vol_model)[source]

Given a volume model create a controller for the model

class nornir_volumecontroller.Volume(volumeModel=None)[source]

Bases: VolumeInterface

Concrete volume controller wrapping a Volume model.

Lazily builds per-section transform maps and channel lists on first access so loading a large volume does not incur upfront I/O costs.

property Bounds

Bounding box of the entire volume :return: (minZ, minY, minX, maxZ, maxY, maxX)

Calculate2DBoundingBox()[source]
property Channels

List of all channels in the volume

GetData(region, resolution, channel_names)[source]

Return data for the specified region :param ndarray region: (minZ, minY, minX, maxZ, maxY, maxX) :param float resolution: resolution of output data :param list channels: channels to include in output :returns: list of ndarray images

GetHighestResolution(region=None, channel_names=None)[source]

Return the highest resolution of data within the bounding box

property Name
property transform_path_map
nornir_volumecontroller.base_objects.GetChannels(channelmap, channelnames)[source]
class nornir_volumecontroller.base_objects.Scale(scale_model=None)[source]

Bases: object

Physical scale of a volume channel on each spatial axis (units per pixel).

Wraps the volumemodel Scale object so callers can read X, Y, and Z units-per-pixel as plain floats rather than navigating the model hierarchy.

classmethod MinAxisScales(scale_model_A, scale_model_B)[source]

Given two scale models, return a scale object describing the highest resolution available for each axis

property X
property Y
property Z
class nornir_volumecontroller.base_objects.Volume(volumeModel=None)[source]

Bases: VolumeInterface

Concrete volume controller wrapping a Volume model.

Lazily builds per-section transform maps and channel lists on first access so loading a large volume does not incur upfront I/O costs.

property Bounds

Bounding box of the entire volume :return: (minZ, minY, minX, maxZ, maxY, maxX)

Calculate2DBoundingBox()[source]
property Channels

List of all channels in the volume

GetData(region, resolution, channel_names)[source]

Return data for the specified region :param ndarray region: (minZ, minY, minX, maxZ, maxY, maxX) :param float resolution: resolution of output data :param list channels: channels to include in output :returns: list of ndarray images

GetHighestResolution(region=None, channel_names=None)[source]

Return the highest resolution of data within the bounding box

property Name
property transform_path_map
class nornir_volumecontroller.base_objects.VolumeInterface[source]

Bases: object

Abstract interface for any volume controller.

Concrete subclasses (e.g. Volume) must implement Bounds, Channels, and GetData().

property Bounds

Bounding box of the entire volume

property Channels

List of all channels available in the volume

GetData(region, resolution, channels)[source]

Get the raw data inside the boundaries :param box region: Data within the region is returned :param ndarray resolution: The resolution to return data in :param list channels: List of channels to assign to the output array :returns: 4D Matrix with Channel,Z,Y,X axes :rtype: ndarray

class nornir_volumecontroller.base_objects.VolumeRegisteredChannel(channelModel=None)[source]

Bases: object

Wraps a single imaging channel together with its channel-to-volume registration transform.

Provides convenient access to the channel’s Name, Scale, and tile-pyramid file paths at a given downsample level.

GetTilesPath(filtername, level)[source]
property Name
property Scale
property Transform

Created on Apr 10, 2014

@author: u0490822

nornir_volumecontroller.factory.CreateVolumeController(vol_model)[source]

Given a volume model create a controller for the model

nornir_volumecontroller.spatial.BuildSectionChannelMap(section)[source]

Build a mapping from channel name to VolumeRegisteredChannel for one section.

Only channels that have a ChannelToVolume transform are included.

Parameters:

section – A Section model object.

Returns:

{channel_name: VolumeRegisteredChannel}

Return type:

dict

nornir_volumecontroller.spatial.BuildVolumeTransformMap(volume)[source]

Build a two-level map from section number → channel name → VolumeRegisteredChannel.

Only sections that contain at least one channel with a ChannelToVolume transform are included.

Parameters:

volume – A Volume model object.

Returns:

{section_number: {channel_name: VolumeRegisteredChannel}}

Return type:

dict

nornir_volumecontroller.spatial.SectionsInBoundingBox(boundingbox)[source]

Yield every integer section number whose Z-coordinate falls within boundingbox.

Parameters:

boundingbox – A bounding-box object with a BoundingBox attribute indexed by nornir_imageregistration.iBox constants.

Yields:

int — section numbers from MinZ to MaxZ inclusive.