IOLink C# 1.11.0
Loading...
Searching...
No Matches
IOLink.ImageViewFactory Class Reference

This factory is aimed at creating dataset views. More...

Inheritance diagram for IOLink.ImageViewFactory:

Public Member Functions

 ImageViewFactory (global::System.IntPtr cPtr, bool cMemoryOwn)
 
void Dispose ()
 

Static Public Member Functions

static global::System.Runtime.InteropServices.HandleRef getCPtr (ImageViewFactory obj)
 
static global::System.Runtime.InteropServices.HandleRef swigRelease (ImageViewFactory obj)
 
static ImageView ReinterpretAxes (ImageView image, params ImageDimension[] values)
 
static ImageView Allocate (VectorXu64 shape, DataType type, ImageProperties properties, MetadataNode metadata)
 Creates a memory image with the given shape and type.
 
static ImageView Allocate (VectorXu64 shape, DataType type)
 Creates a memory image with the given shape and type.
 
static ImageView CopyInMemory (ImageView image)
 Copy given image in memory.
 
static ImageView CreateOnDisk (string dirPath, VectorXu64 shape, DataType type, ImageProperties properties, MetadataNode metadata)
 Create an image with the data stored into a temporary file (in given folder) on disk in raw.
 
static ImageView CreateOnDisk (string dirPath, VectorXu64 shape, DataType type)
 Create an image with the data stored into a temporary file (in given folder) on disk in raw.
 
static ImageView CreateOnDisk (VectorXu64 shape, DataType type, ImageProperties properties, MetadataNode metadata)
 Create an image with the data stored into a temporary file on disk in raw.
 
static ImageView CreateOnDisk (VectorXu64 shape, DataType type)
 Create an image with the data stored into a temporary file on disk in raw.
 
static ImageView CopyOnDisk (ImageView image)
 Load an image data into a temporary raw file on disk.
 
static ImageView CopyOnDisk (ImageView image, string dirPath)
 Load an image data into a temporary raw file on disk.
 
static unsafe ImageView FromBuffer (VectorXu64 shape, DataType type, byte[] buffer, uint bufferSize, ImageProperties properties, MetadataNode metadata)
 Creates an image from existing buffer.
 
static unsafe ImageView FromBuffer (VectorXu64 shape, DataType type, byte[] buffer, uint bufferSize)
 Creates an image from existing buffer.
 
static ImageView FromRandomAccess (RandomAccess accessor, MemoryLayout layout, VectorXu64 shape, DataType type, ImageProperties properties, ReadonlyMetadataNode metadata)
 Create an image from a RandomAccess.
 
static ImageView FromRandomAccess (RandomAccess accessor, MemoryLayout layout, VectorXu64 shape, DataType type)
 Create an image from a RandomAccess.
 
static ImageView FromRandomAccess (RandomAccess accessor, VectorXu64 shape, DataType type, ImageProperties properties, ReadonlyMetadataNode metadata)
 Create an image from a given RandomAccess.
 
static ImageView FromRandomAccess (RandomAccess accessor, VectorXu64 shape, DataType type)
 Create an image from a given RandomAccess.
 
static ImageView FromImageView (ImageView view, ReadonlyImageProperties properties, ReadonlyMetadataNode metadata)
 Allows to apply specific properties and metadata to a ImageView without impact on originals.
 
static ImageView Uniform (VectorXu64 shape, DataType type, System.Object value, ImageProperties properties, ReadonlyMetadataNode metadata)
 Create an image with uniform value.
 
static ImageView Uniform (VectorXu64 shape, DataType type, System.Object value)
 Create an image with uniform value.
 
static ImageView AdaptDynamicRange (ImageView view, DataType type, Vector2d inputRange, Vector2d outputRange)
 Creates an ImageView from another view with given type by mapping dynamic range.
 
static ImageView AdaptDataType (ImageView view, DataType type)
 Creates an ImageView from another view with given type.
 
static ImageView ExtractChannel (ImageView view, uint idxChannel)
 Returns an ImageView from another view containing only given channel Index (useful when channel is not clearly identified).
 
static ImageView ExtractRegion (ImageView view, RegionXu64 region)
 Creates an ImageView of given region from given view.
 
static ImageView ExtractAdjustedRegion (ImageView view, RegionXu64 region)
 Creates an ImageView of given region from given view, packing flat dimensions.
 
static ImageView Stack (MultiImageView view, ImageDimension newDimension)
 Creates an ImageView from a multiImageView by agglomerating frames into a new given dimension.
 
static ImageView Stack (MultiImageView view)
 Creates an ImageView from a multiImageView by agglomerating frames into a new unidentified dimension.
 
static ImageView Stack (MultiImageView view, ImageDimension newDimension, uint threadCount)
 Creates an ImageView from a multiImageView by agglomerating frames into a new given dimension.
 
static ImageView AssembleChannels (ImageView image)
 Adapt a N dimensions scalar ImageView into a N-1 dimensions vectorial one.
 
static ImageView DisassembleChannels (ImageView image)
 Adapt a N dimensions vectorial ImageView into a N+1 dimensions scalar one.
 
static ImageView Interlace (MultiImageView multiView, ImageInterpretation newInterpretation, bool hasAlpha)
 Interlace frames of a MultiImageView into an ImageView.
 
static ImageView Interlace (MultiImageView multiView)
 Interlace frames of a MultiImageView into an ImageView.
 
static ImageView Reinterpret (ImageView image, ImageType newImageType)
 Reinterpret an ImageView with a new ImageTypeId.
 
static ImageView ReinterpretAxes (ImageView image, ImageDimension[] dimensionsList, uint count)
 Reinterpret an ImageView by identifying each dimension (axis).
 
static ImageView SubSample (ImageView image, uint step)
 Create a sub-sampled imageView from original.
 
static ImageView Flip (ImageView image, ImageDimension dimension)
 Flip an ImageView following the given dimension.
 
static ImageView Flip (ImageView image, uint dimensionIndex)
 Flip an ImageView following the given dimension.
 
static ImageView MakeThreadSafe (ImageView image)
 Make an ImageView threadsafe.
 

Protected Member Functions

virtual void Dispose (bool disposing)
 

Protected Attributes

bool swigCMemOwn
 

Detailed Description

This factory is aimed at creating dataset views.

By default, ImageViews returned by this factory are not thread safe. Only #makeThreadSafe method allows to apply threadsafety guarantee on an ImageView.

[READ]: READ

Examples
CheckerBoard.cs, CheckerBoardFast.cs, ColorWheel.cs, CopyImageView.cs, DiskImageView.cs, GradientFloatImage.cs, GradientFloatToInt.cs, GrayscaleSphere.cs, MetadataTree.cs, and VolumeFromStack.cs.

Member Function Documentation

◆ AdaptDataType()

static ImageView IOLink.ImageViewFactory.AdaptDataType ( ImageView  view,
DataType  type 
)
inlinestatic

Creates an ImageView from another view with given type.

No memory is allocated by this operation.

Capabilities of returned ImageView will depend on original ImageView, and will be restricted to (see #ImageCapability):

  • READ
  • WRITE

One or many adapters will be added if necessary to convert from input view type to output View type. Data will be mapped to full output type range. For example, if given view is 16 bits with valueRange [1000, 2000] and type is uint8, input range [1000, 2000] will be mapped to output range [0, 255].

Input data range are read from view properties. Output range is specified type standard range. It can be retrieved with DataType::standardRange(type).

Parameters
viewThe source image
typeThe target datatype
Exceptions
InvalidArgumentIf the view is null
InvalidArgumentIf properties of input ImageView are not valid
InvalidArgumentIf type cardinality is different of original type
InvalidArgumentIf given type is not numeric
Errorif Input view does not support READ or WRITE capability

◆ AdaptDynamicRange()

static ImageView IOLink.ImageViewFactory.AdaptDynamicRange ( ImageView  view,
DataType  type,
Vector2d  inputRange,
Vector2d  outputRange 
)
inlinestatic

Creates an ImageView from another view with given type by mapping dynamic range.

No memory is allocated by this operation.

Capabilities of returned ImageView will depend on original ImageView, and will be restricted to (see #ImageCapability):

  • READ
  • WRITE

This method will map [inputRange[0], inputRange[1]] -> [outputRange[0], outputRange[1]]

One or many adapters will be added if necessary to convert from input view type to output View type. Data will be mapped to full output type range. For example, if given view is 16 bits with valueRange [1000, 2000] and type is uint8 with input range [20, 50], input range [1000, 2000] will be mapped to output range [20, 50].

If input image contains value outside of given inputRange, these values will be linearly mapped outside of outputRange. For example, with [0, 1]->[0, 2], a value of -1 will be mapped to -2.

No clamp are done for values outside of type admissible values. Invalid ranges may lead to overflow issues.

Parameters
viewInput view
typeRequested data type
inputRangeRange of data in input view
outputRangeRequested output range
Exceptions
InvalidArgumentIf the view is null
InvalidArgumentIf properties of input ImageView are not valid
InvalidArgumentIf type cardinality is different of original type
InvalidArgumentIf given type is not numeric
Errorif Input view does not support READ or WRITE capability
Examples
GradientFloatToInt.cs.

◆ Allocate() [1/2]

static ImageView IOLink.ImageViewFactory.Allocate ( VectorXu64  shape,
DataType  type 
)
inlinestatic

Creates a memory image with the given shape and type.

Memory is allocated by this operation.

Returned ImageView has following capabilities (see #ImageCapability):

  • READ
  • WRITE
  • BUFFER
  • RESHAPE
    Parameters
    shapeThe shape of the image (its dimension and sizes in all dimensions)
    typeThe type of data contained in that view.

◆ Allocate() [2/2]

static ImageView IOLink.ImageViewFactory.Allocate ( VectorXu64  shape,
DataType  type,
ImageProperties  properties,
MetadataNode  metadata 
)
inlinestatic

Creates a memory image with the given shape and type.

Memory is allocated by this operation.

Returned ImageView has following capabilities (see #ImageCapability):

  • READ
  • WRITE
  • BUFFER
  • RESHAPE
    Parameters
    shapeThe shape of the image (its dimension and sizes in all dimensions)
    typeThe type of data contained in that view.
    propertiesProperties to set to the allocated ImageView. If null, default properties are generated.
    metadataMetadata to set to the allocated ImageView
    Exceptions
    ErrorIf given properties are not compatible with given shape and type
Examples
CheckerBoard.cs, CheckerBoardFast.cs, ColorWheel.cs, CopyImageView.cs, GradientFloatImage.cs, GradientFloatToInt.cs, GrayscaleSphere.cs, MetadataTree.cs, and VolumeFromStack.cs.

◆ AssembleChannels()

static ImageView IOLink.ImageViewFactory.AssembleChannels ( ImageView  image)
inlinestatic

Adapt a N dimensions scalar ImageView into a N-1 dimensions vectorial one.

No memory is allocated by this operation.

Capabilities of returned ImageView will be restricted to (see #ImageCapability):

  • READ

It packs the values of CHANNEL dimension (or the last dimension if does not exist) into one sample vector. The dimension of this vector will be the size of the last dimension of the source ImageView.

Parameters
imageThe source ImageView
Exceptions
InvalidArgumentIf the image is null
InvalidArgumentIf properties of input ImageView are not valid
ErrorIf original ImageView does not support READ capability

◆ CopyInMemory()

static ImageView IOLink.ImageViewFactory.CopyInMemory ( ImageView  image)
inlinestatic

Copy given image in memory.

Memory is allocated by this operation. Data from original ImageView (if not in memory) are duplicated.

Returned ImageView has following capabilities (see #ImageCapability):

  • READ
  • WRITE
  • BUFFER
  • RESHAPE

If the input image already is in memory, return it (no copy are done).

Parameters
imageImage to load
Exceptions
InvalidArgumentIf the source is null
ErrorIf the input ImageView does not support READ capability
InvalidArgumentIf properties of input ImageView are not valid

◆ CopyOnDisk() [1/2]

static ImageView IOLink.ImageViewFactory.CopyOnDisk ( ImageView  image)
inlinestatic

Load an image data into a temporary raw file on disk.

The file is created in usual temporary directory and will be automatically deleted from disk when the instance of the returned ImageView is deleted.

Samples are copied chunk by chunk to optimize memory consumption. Maximum chunk size is 1MB.

No memory is allocated by this operation, only disk space is used.

Returned ImageView has following capabilities (see #ImageCapability):

  • READ
  • WRITE
  • RESHAPE

Original ImageView data are duplicated. Data from the returned ImageView are not linked to original ImageView.

If given image is already on disk, a copy will be created in spite of all.

Parameters
imageImageView to load on disk
Exceptions
InvalidArgumentIf the image is null
InvalidArgumentIf properties of input ImageView are not valid
Returns
ImageView on disk

◆ CopyOnDisk() [2/2]

static ImageView IOLink.ImageViewFactory.CopyOnDisk ( ImageView  image,
string  dirPath 
)
inlinestatic

Load an image data into a temporary raw file on disk.

The file will be removed from disk when the instance of the returned ImageView is deleted.

Samples are copied chunk by chunk to optimize memory consumption. Maximum chunk size is 1MB.

No memory is allocated by this operation, only disk space is used.

Returned ImageView has following capabilities (see #ImageCapability):

  • READ
  • WRITE
  • RESHAPE

Original ImageView data are duplicated. Data from the returned ImageView are not linked to original ImageView.

If given image is already on disk, a copy will be created in spite of all.

Parameters
imageImageView to load on disk
dirPathpath where temporary file is created (must exist)
Exceptions
InvalidArgumentIf the image is null
InvalidArgumentif given directory path does not exist
InvalidArgumentIf properties of input ImageView are not valid
Returns
ImageView on disk

◆ CreateOnDisk() [1/4]

static ImageView IOLink.ImageViewFactory.CreateOnDisk ( string  dirPath,
VectorXu64  shape,
DataType  type 
)
inlinestatic

Create an image with the data stored into a temporary file (in given folder) on disk in raw.

No memory is allocated by this operation, only disk space is used.

Returned ImageView has following capabilities (see #ImageCapability):

  • READ
  • WRITE
  • RESHAPE

The created file is automatically deleted when destroying the image.

Parameters
dirPaththe path to the folder where the temporary file will be created
shapeThe shape of the image (its dimension and sizes in all dimensions)
typeThe type of data contained in that view.
Exceptions
InvalidArgumentif given directory path does not exist

◆ CreateOnDisk() [2/4]

static ImageView IOLink.ImageViewFactory.CreateOnDisk ( string  dirPath,
VectorXu64  shape,
DataType  type,
ImageProperties  properties,
MetadataNode  metadata 
)
inlinestatic

Create an image with the data stored into a temporary file (in given folder) on disk in raw.

No memory is allocated by this operation, only disk space is used.

Returned ImageView has following capabilities (see #ImageCapability):

  • READ
  • WRITE
  • RESHAPE

The created file is automatically deleted when destroying the image.

Parameters
dirPaththe path to the folder where the temporary file will be created
shapeThe shape of the image (its dimension and sizes in all dimensions)
typeThe type of data contained in that view.
propertiesProperties to set to the allocated ImageView
metadataMetadata to set to the allocated ImageView
Exceptions
Errorif given properties are not compatible with given shape and type
InvalidArgumentif given directory path does not exist
Examples
DiskImageView.cs.

◆ CreateOnDisk() [3/4]

static ImageView IOLink.ImageViewFactory.CreateOnDisk ( VectorXu64  shape,
DataType  type 
)
inlinestatic

Create an image with the data stored into a temporary file on disk in raw.

No memory is allocated by this operation, only disk space is used.

Returned ImageView has following capabilities (see #ImageCapability):

  • READ
  • WRITE
  • RESHAPE

The file is created in usual temporary directory and automatically deleted when destroying the image.

Parameters
shapeThe shape of the image (its dimension and sizes in all dimensions)
typeThe type of data contained in that view.

◆ CreateOnDisk() [4/4]

static ImageView IOLink.ImageViewFactory.CreateOnDisk ( VectorXu64  shape,
DataType  type,
ImageProperties  properties,
MetadataNode  metadata 
)
inlinestatic

Create an image with the data stored into a temporary file on disk in raw.

No memory is allocated by this operation, only disk space is used.

Returned ImageView has following capabilities (see #ImageCapability):

  • READ
  • WRITE
  • RESHAPE

The file is created in usual temporary directory and automatically deleted when destroying the image.

Parameters
shapeThe shape of the image (its dimension and sizes in all dimensions)
typeThe type of data contained in that view.
propertiesProperties to set to the allocated ImageView
metadataMetadata to set to the allocated ImageView
Exceptions
Errorif given properties are not compatible with given shape and type

◆ DisassembleChannels()

static ImageView IOLink.ImageViewFactory.DisassembleChannels ( ImageView  image)
inlinestatic

Adapt a N dimensions vectorial ImageView into a N+1 dimensions scalar one.

No memory is allocated by this operation.

Capabilities of returned ImageView will be resctriced to (see #ImageCapability):

  • READ

It unpacks samples to generate a CHANNEL dimension for each component. This new dimension will have the size of the original sample size. (e.g. disassemble a RGBA 2D ImageView will result into a 3D ImageView with CHANNEL dimension size = 4)

Parameters
imageThe source ImageView
Exceptions
InvalidArgumentIf the image is null
InvalidArgumentIf view already contains a CHANNEL dimension
InvalidArgumentIf properties of input ImageView are not valid
ErrorIf original ImageView does not support READ capability

◆ ExtractAdjustedRegion()

static ImageView IOLink.ImageViewFactory.ExtractAdjustedRegion ( ImageView  view,
RegionXu64  region 
)
inlinestatic

Creates an ImageView of given region from given view, packing flat dimensions.

Returned ImageView can potentially have a dimension count lesser than original one. It will depend on the required region. If one (or more) dimension of this region has its size equal to 1, this dimension will be skipped in returned ImageView.

No memory is allocated by this operation.

Capabilities of returned ImageView will depend on original ImageView, and will be restricted to (see #ImageCapability):

  • READ
  • WRITE
    Parameters
    viewOriginal view on which we want to create a sub-region view
    regionRegion of the original view that we want to isolate to create a new view
    Exceptions
    InvalidArgumentIf the view is null
    ErrorIf input ImageView has nor READ or WRITE capability
    InvalidArgumentIf properties of input ImageView are not valid
    InvalidArgumentIf required region is empty

◆ ExtractChannel()

static ImageView IOLink.ImageViewFactory.ExtractChannel ( ImageView  view,
uint  idxChannel 
)
inlinestatic

Returns an ImageView from another view containing only given channel Index (useful when channel is not clearly identified).

No memory is allocated by this operation.

Capabilities of returned ImageView will depend on original ImageView, and will be restricted to (see #ImageCapability):

  • READ
  • WRITE
    Parameters
    viewOriginal view on which we want to isolate given channel
    idxChannelChannel index between 0 and dataType dimension - 1
    Exceptions
    InvalidArgumentIf the view is null
    InvalidArgumentIf requested channel index does not exist
    InvalidArgumentIf properties of input ImageView are not valid
    ErrorIf input image does not support READ or WRITE capability

◆ ExtractRegion()

static ImageView IOLink.ImageViewFactory.ExtractRegion ( ImageView  view,
RegionXu64  region 
)
inlinestatic

Creates an ImageView of given region from given view.

No memory is allocated by this operation.

Capabilities of returned ImageView will depend on original ImageView, and will be restricted to (see #ImageCapability):

  • READ
  • WRITE
    Parameters
    viewOriginal view on which we want to create a sub-region view
    regionRegion of the original view that we want to isolate to create a new view
    Exceptions
    InvalidArgumentIf the view is null
    ErrorIf input ImageView has nor READ or WRITE capability
    InvalidArgumentIf properties of input ImageView are not valid
    InvalidArgumentif required region is empty

◆ Flip() [1/2]

static ImageView IOLink.ImageViewFactory.Flip ( ImageView  image,
ImageDimension  dimension 
)
inlinestatic

Flip an ImageView following the given dimension.

No memory is allocated by this operation.

Capabilities of returned ImageView will be resctriced to (see #ImageCapability):

  • READ
    Parameters
    imageImageView to flip
    dimensionImageDimension used for flipping
    Returns
    a ImageView flipped following given dimension
    Exceptions
    InvalidArgumentIf the image is null
    ErrorIf input image does not support READ capability
    InvalidArgumentIf image type is not known
    InvalidArgumentIf properties of input ImageView are not valid
    InvalidArgumentIf image does not contain given dimension

◆ Flip() [2/2]

static ImageView IOLink.ImageViewFactory.Flip ( ImageView  image,
uint  dimensionIndex 
)
inlinestatic

Flip an ImageView following the given dimension.

No memory is allocated by this operation.

Capabilities of returned ImageView will be resctriced to (see #ImageCapability):

  • READ
    Parameters
    imageImageView to flip
    dimensionIndexDimension index used for flipping
    Returns
    a ImageView flipped following given dimension
    Exceptions
    InvalidArgumentIf the image is null
    ErrorIf input image does not support READ capability
    InvalidArgumentIf properties of input ImageView are not valid
    InvalidArgumentif dimension count of given image is lesser than given dimension index

◆ FromBuffer() [1/2]

static unsafe ImageView IOLink.ImageViewFactory.FromBuffer ( VectorXu64  shape,
DataType  type,
byte[]  buffer,
uint  bufferSize 
)
inlinestatic

Creates an image from existing buffer.

No memory is allocated by this operation.

Returned ImageView has following capabilities (see #ImageCapability):

  • READ
  • WRITE
  • BUFFER
    Parameters
    shapeShape of image
    typeType of image
    bufferUser buffer. Should have at least a size of shape[0]*shape[1]*...*dataType.byteCount() buffer is not handled by this view and the user should carefully manage buffer and view lifetime.
    bufferSizeSize of the buffer in bytes.

◆ FromBuffer() [2/2]

static unsafe ImageView IOLink.ImageViewFactory.FromBuffer ( VectorXu64  shape,
DataType  type,
byte[]  buffer,
uint  bufferSize,
ImageProperties  properties,
MetadataNode  metadata 
)
inlinestatic

Creates an image from existing buffer.

No memory is allocated by this operation.

Returned ImageView has following capabilities (see #ImageCapability):

  • READ
  • WRITE
  • BUFFER
    Parameters
    shapeShape of image
    typeType of image
    bufferUser buffer. Should have at least a size of shape[0]*shape[1]*...*dataType.byteCount() buffer is not handled by this view and the user should carefully manage buffer and view lifetime.
    bufferSizeSize of the buffer in bytes.
    propertiesProperties of image. If null, image will build a default set of properties.
    metadataMetadata of image.
    Exceptions
    InvalidArgument
    ErrorIf given properties are not compatible with given shape and type

◆ FromImageView()

static ImageView IOLink.ImageViewFactory.FromImageView ( ImageView  view,
ReadonlyImageProperties  properties,
ReadonlyMetadataNode  metadata 
)
inlinestatic

Allows to apply specific properties and metadata to a ImageView without impact on originals.

No memory is allocated by this operation.

Returned ImageView has the same capabilities than original ImageView.

Parameters
viewInput view
propertiesThe new properties used by the returned image view. If null, the returned image view uses a clone of the input view properties.
metadataThe new metadata used by the returned image view (can be null).
Exceptions
InvalidArgumentIf the view is null
Errorif given properties are not compatible with given shape and type

◆ FromRandomAccess() [1/4]

static ImageView IOLink.ImageViewFactory.FromRandomAccess ( RandomAccess  accessor,
MemoryLayout  layout,
VectorXu64  shape,
DataType  type 
)
inlinestatic

Create an image from a RandomAccess.

No memory is allocated by this operation.

Returned ImageView has following capabilities (see #ImageCapability):

  • READ
  • WRITE
    Parameters
    accessorThe RandomAccess from which reading data
    layoutThe memory layout to use
    shapeThe shape of the image to create
    typeThe data type of the image
    Exceptions
    InvalidArgumentif accessor is null

◆ FromRandomAccess() [2/4]

static ImageView IOLink.ImageViewFactory.FromRandomAccess ( RandomAccess  accessor,
MemoryLayout  layout,
VectorXu64  shape,
DataType  type,
ImageProperties  properties,
ReadonlyMetadataNode  metadata 
)
inlinestatic

Create an image from a RandomAccess.

No memory is allocated by this operation.

Returned ImageView has following capabilities (see #ImageCapability):

  • READ
  • WRITE
    Parameters
    accessorThe RandomAccess from which reading data
    layoutThe memory layout to use
    shapeThe shape of the image to create
    typeThe data type of the image
    propertiesThe properties to attach to the image. If null, default properties are generated.
    metadataA set of metadata to attach to the image
    Exceptions
    InvalidArgumentif accessor is null
    InvalidArgumentif accessor size is not compatible with given shape and type
    ErrorIf given properties are not compatible with given shape and type

◆ FromRandomAccess() [3/4]

static ImageView IOLink.ImageViewFactory.FromRandomAccess ( RandomAccess  accessor,
VectorXu64  shape,
DataType  type 
)
inlinestatic

Create an image from a given RandomAccess.

No memory is allocated by this operation.

Returned ImageView has following capabilities (see #ImageCapability):

  • READ
  • WRITE

Here the Memory layout is defaulted to Fortan.

Parameters
accessorThe RandomAccess from which reading data
shapeThe shape of the image to create
typeThe data type of the image
Exceptions
InvalidArgumentif accessor is null
Errorif the storage cannot contain a raw image with given shape and datatype

◆ FromRandomAccess() [4/4]

static ImageView IOLink.ImageViewFactory.FromRandomAccess ( RandomAccess  accessor,
VectorXu64  shape,
DataType  type,
ImageProperties  properties,
ReadonlyMetadataNode  metadata 
)
inlinestatic

Create an image from a given RandomAccess.

No memory is allocated by this operation.

Returned ImageView has following capabilities (see #ImageCapability):

  • READ
  • WRITE

Here the Memory layout is defaulted to Fortan.

Parameters
accessorThe RandomAccess from which reading data
shapeThe shape of the image to create
typeThe data type of the image
propertiesThe properties to attach to the image. If null, default properties are generated.
metadataA set of metadata to attach to the image
Exceptions
InvalidArgumentif accessor is null
Errorif the storage cannot contain a raw image with given shape and datatype
Errorif given properties are not compatible with given shape and type

◆ Interlace() [1/2]

static ImageView IOLink.ImageViewFactory.Interlace ( MultiImageView  multiView)
inlinestatic

Interlace frames of a MultiImageView into an ImageView.

No memory is allocated by this operation.

Capabilities of returned ImageView will depend on capabilities of ImageViews contained in the multiImageView, and be resctriced to (see #ImageCapability):

  • READ
  • WRITE

Frames contained in MultiImageViews are assembled to create an ImageView whose samples are the concatenation of samples from original ImageViews. i.e. 3 grayscale ImageViews with UINT16 datatype contained in a multiImageView First ImageView contains ABCDEFG..... values Second ImageView contains abcdefg... values Third ImageView contains 123456.... values Interlace operation gives an ImageViews with VEC3UINT16 datatype whose content is: Aa1 Bb2 Cc3 Dd4 Ee5 Ff6 Gg7.....

Final interlaced ImageView will have Write access only if all original ImageViews (in multiImageView) have Write access

Parameters
multiViewMultiImageView which contains ImageViews to interlace
Exceptions
InvalidArgumentIf the image is null
InvalidArgumentIf multiImageView contains incompatible ImageViews (different shape or datatypes)
InvalidArgumentIf one frame from multiImageView contains a CHANNEL dimension
InvalidArgumentIf type of at least one frame is not scalar

◆ Interlace() [2/2]

static ImageView IOLink.ImageViewFactory.Interlace ( MultiImageView  multiView,
ImageInterpretation  newInterpretation,
bool  hasAlpha 
)
inlinestatic

Interlace frames of a MultiImageView into an ImageView.

No memory is allocated by this operation.

Capabilities of returned ImageView will depend on capabilities of ImageViews contained in the multiImageView, and be resctriced to (see #ImageCapability):

  • READ
  • WRITE

Frames contained in MultiImageViews are assembled to create an ImageView whose samples are the concatenation of samples from original ImageViews. i.e. 3 grayscale ImageViews with UINT16 datatype contained in a multiImageView First ImageView contains ABCDEFG..... values Second ImageView contains abcdefg... values Third ImageView contains 123456.... values Interlace operation gives an ImageViews with VEC3UINT16 datatype whose content is: Aa1 Bb2 Cc3 Dd4 Ee5 Ff6 Gg7.....

Final interlaced ImageView will have Write access only if all original ImageViews (in multiImageView) have Write access

Parameters
multiViewMultiImageView which contains ImageViews to interlace
newInterpretationinterpretation to set for the interlaced ImageView (default is UNKNOWN)
hasAlphaindicates if the interlaced ImageView contains an Alpha channel (default is FALSE)
Exceptions
InvalidArgumentIf the image is null
InvalidArgumentIf multiImageView contains incompatible ImageViews (different shape or datatypes)
InvalidArgumentIf one frame from multiImageView contains a CHANNEL dimension
InvalidArgumentIf type of at least one frame is not scalar

◆ MakeThreadSafe()

static ImageView IOLink.ImageViewFactory.MakeThreadSafe ( ImageView  image)
inlinestatic

Make an ImageView threadsafe.

No memory is allocated by this operation.

Capabilities of returned ImageView will be the same than original image's.

Parameters
imageImageView to make threadsafe
Returns
an ImageView protected for multi-thread accesses.
Exceptions
InvalidArgumentIf the image is null

◆ Reinterpret()

static ImageView IOLink.ImageViewFactory.Reinterpret ( ImageView  image,
ImageType  newImageType 
)
inlinestatic

Reinterpret an ImageView with a new ImageTypeId.

No memory is allocated by this operation.

Capabilities of returned ImageView will depend on capabilities of input ImageView and be resctriced to (see #ImageCapability):

  • READ
  • WRITE

It allows to modify the interpretation (VOLUME, IMAGE SEQUENCE, ...) of an any-dimension image. It does not change samples data reading, only image properties. When new interpretation is given, a quick check is done to verify compatibility with given ImageView. (number of dimensions should match with new interpretation)

Specific case: ImageType::UNKNOWN can be set for any given ImageView without error

Exceptions
InvalidArgumentIf the image is null
ErrorIf ImageType is incompatible with ImageView dimension
Parameters
imageImageView whose interpretation must be changed
newImageTypeImage interpretation to apply to image
Returns
a ImageView with new properties to match new image interpretation
Exceptions
InvalidArgumentIf the image is null
InvalidArgumentIf properties of input ImageView are not valid
ErrorIf new imageType is not comparible with given ImageView

◆ ReinterpretAxes()

static ImageView IOLink.ImageViewFactory.ReinterpretAxes ( ImageView  image,
ImageDimension[]  dimensionsList,
uint  count 
)
inlinestatic

Reinterpret an ImageView by identifying each dimension (axis).

No memory is allocated by this operation.

Capabilities of returned ImageView will depend on capabilities of input ImageView and be resctriced to (see #ImageCapability):

  • READ
  • WRITE
    Parameters
    imageImageView to reinterpret
    dimensionsListOrdered list of dimensions to affect to ImageView
    countNumber of elements in the given list
    Returns
    a ImageView where dimensions are potentially reordered to match canonical order and with a new ImageTypeId
    Exceptions
    InvalidArgumentIf the image is null
    ErrorIf dimensionsList size does not match with image dimension.
    InvalidArgumentIf properties of input ImageView are not valid

◆ Stack() [1/3]

static ImageView IOLink.ImageViewFactory.Stack ( MultiImageView  view)
inlinestatic

Creates an ImageView from a multiImageView by agglomerating frames into a new unidentified dimension.

No memory is allocated by this operation.

Capabilities of returned ImageView will depend on original ImageViews contained in MultiImageView, and will be restricted to (see #ImageCapability):

  • READ
  • WRITE

(i.e. a given multiImageView containing 2D ImageViews will give as result 3D ImageView - containing all the images) Concatenation of frames is possible only if their shapes and datatypes are equal. New dimension is always created in last position. e.g.: 3 frames with shapes (5, 6) will be stacked into an 3D Image with shape (5, 6, 3)

This method can be used with frames whose ImageType is not UNKNOWN, but as the new dimension is not given, the ImageType will be lost (UNKNOWN) in output ImageView.

Underlying adapter use multithreading to accelerate the data access. To configure or deactivate it, use prototype with threadCount as argument.

Parameters
viewMultiImage view which contains frames of same format and shape
Exceptions
InvalidArgumentIf the view is null
InvalidArgumentif all frames don't have same shape and datatype

◆ Stack() [2/3]

static ImageView IOLink.ImageViewFactory.Stack ( MultiImageView  view,
ImageDimension  newDimension 
)
inlinestatic

Creates an ImageView from a multiImageView by agglomerating frames into a new given dimension.

No memory is allocated by this operation.

Capabilities of returned ImageView will depend on original ImageViews contained in MultiImageView, and will be restricted to (see #ImageCapability):

  • READ
  • WRITE

(i.e. a given multiImageView containing 2D frames (with Imagetype = IMAGE) and a given dimension equal to SEQUENCE will give as result a IMAGE_SEQUENCE - video - containing all the images) Concatenation of frames is possible only if their shapes, datatypes and ImageTypes are equal.

A warning will be raised if given frames have an ImageType = UNKNOWN, because the given ImageDimension is ignored in this case, but the stack is still applied, and output ImageType will be UNKNOWN

If the given dimension is CHANNEL, and more than one frame is stacked, ImageInterpretation will become UNKNOWN.

Underlying adapter use multithreading to accelerate the data access. To configure or deactivate it, use prototype with threadCount as argument.

Parameters
viewMultiImage view which contains frames of same format and shape
newDimensioninterpretation of the new dimension to create
Exceptions
InvalidArgumentIf the view is null
InvalidArgumentif all frames don't have same shape and datatype
InvalidArgumentif given new dimension already exist in given frames
InvalidArgumentif all frames don't have the same interpretation of axes
Examples
VolumeFromStack.cs.

◆ Stack() [3/3]

static ImageView IOLink.ImageViewFactory.Stack ( MultiImageView  view,
ImageDimension  newDimension,
uint  threadCount 
)
inlinestatic

Creates an ImageView from a multiImageView by agglomerating frames into a new given dimension.

No memory is allocated by this operation.

Capabilities of returned ImageView will depend on original ImageViews contained in MultiImageView, and will be restricted to (see #ImageCapability):

  • READ
  • WRITE

(i.e. a given multiImageView containing 2D frames (with Imagetype = IMAGE) and a given dimension equal to SEQUENCE will give as result a IMAGE_SEQUENCE - video - containing all the images) Concatenation of frames is possible only if their shapes, datatypes and ImageTypes are equal.

A warning will be raised if given frames have an ImageType = UNKNOWN, because the given ImageDimension is ignored in this case, but the stack is still applied, and output ImageType will be UNKNOWN

If the given dimension is CHANNEL, and more than one frame is stacked, ImageInterpretation will become UNKNOWN.

Underlying adapter can use multithreading to accelerate the data access. By default (0), the thread count is automatically determined, but you can also force the thread count to use (value greater than 1). Setting a thread count to 1 will deactivate multithreading.

Parameters
viewMultiImage view which contains frames of same format and shape
newDimensioninterpretation of the new dimension to create
threadCountNumber of threads to use for DataAccess
Exceptions
InvalidArgumentIf the view is null
InvalidArgumentif all frames don't have same shape and datatype
InvalidArgumentif given new dimension already exist in given frames
InvalidArgumentif all frames don't have the same interpretation of axes

◆ SubSample()

static ImageView IOLink.ImageViewFactory.SubSample ( ImageView  image,
uint  step 
)
inlinestatic

Create a sub-sampled imageView from original.

No memory is allocated by this operation.

Capabilities of returned ImageView will be resctriced to (see #ImageCapability):

  • READ
    Parameters
    imageImageView to sub-sample
    steplevel of sub-sampling to apply

New ImageView is created by picking one sample for every step samples of original ImageView. A step of 1 will give the same Image as the original

Returns
a Sub-Sampled ImageView from original ImageView
Exceptions
InvalidArgumentIf the image is null
InvalidArgumentIf properties of input ImageView are not valid
InvalidArgumentIf step is 0 or not compatible with ImageView shape
ErrorIf input image does not support READ capability

◆ Uniform() [1/2]

static ImageView IOLink.ImageViewFactory.Uniform ( VectorXu64  shape,
DataType  type,
System::Object  value 
)
inlinestatic

Create an image with uniform value.

No memory is allocated by this operation.

Returned ImageView has following capabilities (see #ImageCapability):

  • READ

This image doesn't consume memory, so you can create an image as big as you want.

Parameters
shapeThe shape of the image (its dimension and sizes in all dimensions)
typeThe type of data contained in that view.
valueBuffer should correspond to given DataType. If null is given, image is filled with zeros.

◆ Uniform() [2/2]

static ImageView IOLink.ImageViewFactory.Uniform ( VectorXu64  shape,
DataType  type,
System::Object  value,
ImageProperties  properties,
ReadonlyMetadataNode  metadata 
)
inlinestatic

Create an image with uniform value.

No memory is allocated by this operation.

Returned ImageView has following capabilities (see #ImageCapability):

  • READ

This image doesn't consume memory, so you can create an image as big as you want.

Parameters
shapeThe shape of the image (its dimension and sizes in all dimensions)
typeThe type of data contained in that view.
valueBuffer should correspond to given DataType. If null is given, image is filled with zeros.
propertiesOptional properties. If null, default properties are generated.
metadataOptional metadata. If null, no metadata are generated.
Exceptions
InvalidArgumentIf given properties are not compatible with given shape and type

The documentation for this class was generated from the following file: