| IOLink C# 1.11.0

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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
| ) |  |
| inline static

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

  view | The source image
  type | The target datatype

Exceptions

  InvalidArgument | If the view is null
  InvalidArgument | If properties of input ImageView are not valid
  InvalidArgument | If type cardinality is different of original type
  InvalidArgument | If given type is not numeric
  Error | if Input view does not support READ or WRITE capability

## ◆ AdaptDynamicRange()

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

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

  view | Input view
  type | Requested data type
  inputRange | Range of data in input view
  outputRange | Requested output range

Exceptions

  InvalidArgument | If the view is null
  InvalidArgument | If properties of input ImageView are not valid
  InvalidArgument | If type cardinality is different of original type
  InvalidArgument | If given type is not numeric
  Error | if Input view does not support READ or WRITE capability

Examples
  GradientFloatToInt.cs.

## ◆ Allocate() [1/2]

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

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

    shape | The shape of the image (its dimension and sizes in all dimensions)
    type | The type of data contained in that view.

## ◆ Allocate() [2/2]

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

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

    shape | The shape of the image (its dimension and sizes in all dimensions)
    type | The type of data contained in that view.
    properties | Properties to set to the allocated ImageView. If null, default properties are generated.
    metadata | Metadata to set to the allocated ImageView

  Exceptions

    Error | If 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 | ) |
| inline static

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

  image | The source ImageView

Exceptions

  InvalidArgument | If the image is null
  InvalidArgument | If properties of input ImageView are not valid
  Error | If original ImageView does not support READ capability

## ◆ CopyInMemory()

static ImageView IOLink.ImageViewFactory.CopyInMemory | ( | ImageView | image | ) |
| inline static

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

  image | Image to load

Exceptions

  InvalidArgument | If the source is null
  Error | If the input ImageView does not support READ capability
  InvalidArgument | If properties of input ImageView are not valid

## ◆ CopyOnDisk() [1/2]

static ImageView IOLink.ImageViewFactory.CopyOnDisk | ( | ImageView | image | ) |
| inline static

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

  image | ImageView to load on disk

Exceptions

  InvalidArgument | If the image is null
  InvalidArgument | If properties of input ImageView are not valid

Returns
  ImageView on disk

## ◆ CopyOnDisk() [2/2]

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

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

  image | ImageView to load on disk
  dirPath | path where temporary file is created (must exist)

Exceptions

  InvalidArgument | If the image is null
  InvalidArgument | if given directory path does not exist
  InvalidArgument | If 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
| ) |  |
| inline static

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

  dirPath | the path to the folder where the temporary file will be created
  shape | The shape of the image (its dimension and sizes in all dimensions)
  type | The type of data contained in that view.

Exceptions

  InvalidArgument | if given directory path does not exist

## ◆ CreateOnDisk() [2/4]

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

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

  dirPath | the path to the folder where the temporary file will be created
  shape | The shape of the image (its dimension and sizes in all dimensions)
  type | The type of data contained in that view.
  properties | Properties to set to the allocated ImageView
  metadata | Metadata to set to the allocated ImageView

Exceptions

  Error | if given properties are not compatible with given shape and type
  InvalidArgument | if given directory path does not exist

Examples
  DiskImageView.cs.

## ◆ CreateOnDisk() [3/4]

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

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

  shape | The shape of the image (its dimension and sizes in all dimensions)
  type | The type of data contained in that view.

## ◆ CreateOnDisk() [4/4]

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

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

  shape | The shape of the image (its dimension and sizes in all dimensions)
  type | The type of data contained in that view.
  properties | Properties to set to the allocated ImageView
  metadata | Metadata to set to the allocated ImageView

Exceptions

  Error | if given properties are not compatible with given shape and type

## ◆ DisassembleChannels()

static ImageView IOLink.ImageViewFactory.DisassembleChannels | ( | ImageView | image | ) |
| inline static

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

  image | The source ImageView

Exceptions

  InvalidArgument | If the image is null
  InvalidArgument | If view already contains a CHANNEL dimension
  InvalidArgument | If properties of input ImageView are not valid
  Error | If original ImageView does not support READ capability

## ◆ ExtractAdjustedRegion()

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

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

    view | Original view on which we want to create a sub-region view
    region | Region of the original view that we want to isolate to create a new view

  Exceptions

    InvalidArgument | If the view is null
    Error | If input ImageView has nor READ or WRITE capability
    InvalidArgument | If properties of input ImageView are not valid
    InvalidArgument | If required region is empty

## ◆ ExtractChannel()

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

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

    view | Original view on which we want to isolate given channel
    idxChannel | Channel index between 0 and dataType dimension - 1

  Exceptions

    InvalidArgument | If the view is null
    InvalidArgument | If requested channel index does not exist
    InvalidArgument | If properties of input ImageView are not valid
    Error | If input image does not support READ or WRITE capability

## ◆ ExtractRegion()

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

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

    view | Original view on which we want to create a sub-region view
    region | Region of the original view that we want to isolate to create a new view

  Exceptions

    InvalidArgument | If the view is null
    Error | If input ImageView has nor READ or WRITE capability
    InvalidArgument | If properties of input ImageView are not valid
    InvalidArgument | if required region is empty

## ◆ Flip() [1/2]

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

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

    image | ImageView to flip
    dimension | ImageDimension used for flipping

  Returns
    a ImageView flipped following given dimension
  Exceptions

    InvalidArgument | If the image is null
    Error | If input image does not support READ capability
    InvalidArgument | If image type is not known
    InvalidArgument | If properties of input ImageView are not valid
    InvalidArgument | If image does not contain given dimension

## ◆ Flip() [2/2]

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

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

    image | ImageView to flip
    dimensionIndex | Dimension index used for flipping

  Returns
    a ImageView flipped following given dimension
  Exceptions

    InvalidArgument | If the image is null
    Error | If input image does not support READ capability
    InvalidArgument | If properties of input ImageView are not valid
    InvalidArgument | if 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
| ) |  |
| inline static

Creates an image from existing buffer.

No memory is allocated by this operation.

Returned ImageView has following capabilities (see #ImageCapability):

- READ
- WRITE
- BUFFER
  Parameters

    shape | Shape of image
    type | Type of image
    buffer | User 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.
    bufferSize | Size 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
| ) |  |
| inline static

Creates an image from existing buffer.

No memory is allocated by this operation.

Returned ImageView has following capabilities (see #ImageCapability):

- READ
- WRITE
- BUFFER
  Parameters

    shape | Shape of image
    type | Type of image
    buffer | User 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.
    bufferSize | Size of the buffer in bytes.
    properties | Properties of image. If null, image will build a default set of properties.
    metadata | Metadata of image.

  Exceptions

    InvalidArgument |
    Error | If given properties are not compatible with given shape and type

## ◆ FromImageView()

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

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

  view | Input view
  properties | The new properties used by the returned image view. If null, the returned image view uses a clone of the input view properties.
  metadata | The new metadata used by the returned image view (can be null).

Exceptions

  InvalidArgument | If the view is null
  Error | if 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
| ) |  |
| inline static

Create an image from a RandomAccess.

No memory is allocated by this operation.

Returned ImageView has following capabilities (see #ImageCapability):

- READ
- WRITE
  Parameters

    accessor | The RandomAccess from which reading data
    layout | The memory layout to use
    shape | The shape of the image to create
    type | The data type of the image

  Exceptions

    InvalidArgument | if accessor is null

## ◆ FromRandomAccess() [2/4]

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

Create an image from a RandomAccess.

No memory is allocated by this operation.

Returned ImageView has following capabilities (see #ImageCapability):

- READ
- WRITE
  Parameters

    accessor | The RandomAccess from which reading data
    layout | The memory layout to use
    shape | The shape of the image to create
    type | The data type of the image
    properties | The properties to attach to the image. If null, default properties are generated.
    metadata | A set of metadata to attach to the image

  Exceptions

    InvalidArgument | if accessor is null
    InvalidArgument | if accessor size is not compatible with given shape and type
    Error | If given properties are not compatible with given shape and type

## ◆ FromRandomAccess() [3/4]

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

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

  accessor | The RandomAccess from which reading data
  shape | The shape of the image to create
  type | The data type of the image

Exceptions

  InvalidArgument | if accessor is null
  Error | if 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
| ) |  |
| inline static

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

  accessor | The RandomAccess from which reading data
  shape | The shape of the image to create
  type | The data type of the image
  properties | The properties to attach to the image. If null, default properties are generated.
  metadata | A set of metadata to attach to the image

Exceptions

  InvalidArgument | if accessor is null
  Error | if the storage cannot contain a raw image with given shape and datatype
  Error | if given properties are not compatible with given shape and type

## ◆ Interlace() [1/2]

static ImageView IOLink.ImageViewFactory.Interlace | ( | MultiImageView | multiView | ) |
| inline static

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

  multiView | MultiImageView which contains ImageViews to interlace

Exceptions

  InvalidArgument | If the image is null
  InvalidArgument | If multiImageView contains incompatible ImageViews (different shape or datatypes)
  InvalidArgument | If one frame from multiImageView contains a CHANNEL dimension
  InvalidArgument | If type of at least one frame is not scalar

## ◆ Interlace() [2/2]

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

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

  multiView | MultiImageView which contains ImageViews to interlace
  newInterpretation | interpretation to set for the interlaced ImageView (default is UNKNOWN)
  hasAlpha | indicates if the interlaced ImageView contains an Alpha channel (default is FALSE)

Exceptions

  InvalidArgument | If the image is null
  InvalidArgument | If multiImageView contains incompatible ImageViews (different shape or datatypes)
  InvalidArgument | If one frame from multiImageView contains a CHANNEL dimension
  InvalidArgument | If type of at least one frame is not scalar

## ◆ MakeThreadSafe()

static ImageView IOLink.ImageViewFactory.MakeThreadSafe | ( | ImageView | image | ) |
| inline static

Make an ImageView threadsafe.

No memory is allocated by this operation.

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

Parameters

  image | ImageView to make threadsafe

Returns
  an ImageView protected for multi-thread accesses.

Exceptions

  InvalidArgument | If the image is null

## ◆ Reinterpret()

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

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

  InvalidArgument | If the image is null
  Error | If ImageType is incompatible with ImageView dimension

Parameters

  image | ImageView whose interpretation must be changed
  newImageType | Image interpretation to apply to image

Returns
  a ImageView with new properties to match new image interpretation

Exceptions

  InvalidArgument | If the image is null
  InvalidArgument | If properties of input ImageView are not valid
  Error | If new imageType is not comparible with given ImageView

## ◆ ReinterpretAxes()

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

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

    image | ImageView to reinterpret
    dimensionsList | Ordered list of dimensions to affect to ImageView
    count | Number of elements in the given list

  Returns
    a ImageView where dimensions are potentially reordered to match canonical order and with a new ImageTypeId
  Exceptions

    InvalidArgument | If the image is null
    Error | If dimensionsList size does not match with image dimension.
    InvalidArgument | If properties of input ImageView are not valid

## ◆ Stack() [1/3]

static ImageView IOLink.ImageViewFactory.Stack | ( | MultiImageView | view | ) |
| inline static

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

  view | MultiImage view which contains frames of same format and shape

Exceptions

  InvalidArgument | If the view is null
  InvalidArgument | if all frames don't have same shape and datatype

## ◆ Stack() [2/3]

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

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

  view | MultiImage view which contains frames of same format and shape
  newDimension | interpretation of the new dimension to create

Exceptions

  InvalidArgument | If the view is null
  InvalidArgument | if all frames don't have same shape and datatype
  InvalidArgument | if given new dimension already exist in given frames
  InvalidArgument | if 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
| ) |  |
| inline static

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

  view | MultiImage view which contains frames of same format and shape
  newDimension | interpretation of the new dimension to create
  threadCount | Number of threads to use for DataAccess

Exceptions

  InvalidArgument | If the view is null
  InvalidArgument | if all frames don't have same shape and datatype
  InvalidArgument | if given new dimension already exist in given frames
  InvalidArgument | if all frames don't have the same interpretation of axes

## ◆ SubSample()

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

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

    image | ImageView to sub-sample
    step | level 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

  InvalidArgument | If the image is null
  InvalidArgument | If properties of input ImageView are not valid
  InvalidArgument | If step is 0 or not compatible with ImageView shape
  Error | If input image does not support READ capability

## ◆ Uniform() [1/2]

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

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

  shape | The shape of the image (its dimension and sizes in all dimensions)
  type | The type of data contained in that view.
  value | Buffer 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
| ) |  |
| inline static

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

  shape | The shape of the image (its dimension and sizes in all dimensions)
  type | The type of data contained in that view.
  value | Buffer should correspond to given DataType. If null is given, image is filled with zeros.
  properties | Optional properties. If null, default properties are generated.
  metadata | Optional metadata. If null, no metadata are generated.

Exceptions

  InvalidArgument | If given properties are not compatible with given shape and type

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

- Release/net/generated/ImageViewFactory.cs