IOLink Python 1.11.0
Loading...
Searching...
No Matches
iolink.iolink.ImageView Class Reference
Inheritance diagram for iolink.iolink.ImageView:
iolink.iolink.View

Public Member Functions

 __init__ (self, *args, **kwargs)
 
 get_dimension_count (self)
 
 support (self, flags)
 
 get_capabilities (self)
 
 get_shape (self)
 
 get_data_type (self)
 
 to_string (self)
 
 get_axes_interpretation (self)
 
 get_spatial_origin (self)
 
 get_spatial_spacing (self)
 
 get_spatial_unit (self)
 
 get_spatial_directions (self)
 
 get_bit_depth (self)
 
 get_has_alpha (self)
 
 get_value_range (self)
 
 set_properties (self, properties)
 
 set_metadata (self, metadata)
 
 set_image_interpretation (self, interpretation)
 
 set_axes_interpretation (self, type)
 
 set_spatial_origin (self, origin)
 
 set_spatial_spacing (self, spacing)
 
 set_spatial_unit (self, unit)
 
 set_spatial_directions (self, directions)
 
 set_bit_depth (self, bitDepth)
 
 set_alpha (self, value)
 
 set_value_range (self, range)
 
 reshape (self, shape, dataType)
 
 tiling_info (self)
 
 parallel_access (self)
 
 to_pointer (self)
 
 __repr__ (self)
 
 write (self, index, src)
 
 write_region (self, region, src)
 
 read (self, index, dst=None)
 
 read_region (self, region, dst=None)
 
 __getitem__ (self, key)
 
 get_properties (self)
 
 get_metadata (self)
 
 get_image_interpretation (self)
 

Static Public Member Functions

 create_from_pointer (imagePtr)
 

Static Public Attributes

 dst_dtype = type_code_from_data_type(self.data_type)
 
 src_dtype = src.dtype if isinstance(src, numpy.ndarray) else src.typecode
 
 dst_count = region.element_count * self.data_type.element_count
 
 src_count = src.size if isinstance(src, numpy.ndarray) else len(src)
 
 sizeDataToWrite = region.element_count * self.data_type.element_count
 
 arrayIn = create_array_from_datatype(self.data_type, src)
 
 data = self.read(index)
 
 arrayOut = data
 
 arr = create_array_from_datatype(self.data_type,data)
 
 sizeDataToRead = region.element_count * self.data_type.element_count
 
 origin = VectorXu64.create_uniform(self.dimension_count, 0)
 
 size = VectorXu64.create_uniform(self.dimension_count, 0)
 
 shape = self.shape
 
 region = RegionXu64(origin, size)
 

Protected Member Functions

 _get_image_interpretation (self)
 

Properties

 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
 
 capabilities = property(get_capabilities, doc=get_capabilities.__doc__)
 
 dimension_count = property(get_dimension_count, doc=get_dimension_count.__doc__)
 
 data_type = property(get_data_type, doc=get_data_type.__doc__)
 
 properties = property(get_properties, set_properties, doc=get_properties.__doc__)
 
 metadata = property(get_metadata, set_metadata, doc=get_metadata.__doc__)
 
 image_interpretation = property(get_image_interpretation, set_image_interpretation, doc=_get_image_interpretation.__doc__)
 
 axes_interpretation = property(get_axes_interpretation, set_axes_interpretation, doc=get_axes_interpretation.__doc__)
 
 spatial_origin = property(get_spatial_origin, set_spatial_origin, doc=get_spatial_origin.__doc__)
 
 spatial_spacing = property(get_spatial_spacing, set_spatial_spacing, doc=get_spatial_spacing.__doc__)
 
 spatial_unit = property(get_spatial_unit, set_spatial_unit, doc=get_spatial_unit.__doc__)
 
 spatial_directions = property(get_spatial_directions, set_spatial_directions, doc=get_spatial_directions.__doc__)
 
 bit_depth = property(get_bit_depth, set_bit_depth, doc=get_bit_depth.__doc__)
 
 has_alpha = property(get_has_alpha, set_alpha, doc=get_has_alpha.__doc__)
 
 value_range = property(get_value_range, set_value_range, doc=get_value_range.__doc__)
 

Detailed Description

Interface representing an N dimensional image

This class can handle multidimensional image, for example:
- A 2D image has 2 dimensions.
- A 3D Volume has 3 dimensions.
- A 2D time series has 3 dimensions, where 3rd one represent time.

This interface capabilities are indicated by the ImageCapabilitySet
returned by the method ImageView::capabilities. Each capability enable
the use of a specific set of methods. When one of those methods is
called, if its corresponding capability is not supported, a NotImplemented
exception will be thrown.

An ImageView is composed of the following parts:
 - A shape, that describes the size of the dataset along each of its axes.
 - A data type, giving info on what is stored on each element of the dataset.
 - Properties, giving generic info on the image, such as its spatial calibration,
   the semantic of its dimensions, and detailed information on its elements.
 - Metadata, hierarchical tree of key/value pair, describing arbitrary information.
 - Image's data itself.

See also: ImageCapability

Constructor & Destructor Documentation

◆ __init__()

iolink.iolink.ImageView.__init__ (   self,
args,
**  kwargs 
)

Reimplemented from iolink.iolink.View.

Member Function Documentation

◆ __repr__()

iolink.iolink.ImageView.__repr__ (   self)

Reimplemented from iolink.iolink.View.

◆ _get_image_interpretation()

iolink.iolink.ImageView._get_image_interpretation (   self)
protected
    Shortcut to access Image interpretation from image properties

    :rtype: int
    :return: interpretation of the image

◆ create_from_pointer()

iolink.iolink.ImageView.create_from_pointer (   imagePtr)
static
    Create a new Python ImageView instance from a C++ pointer.

    :type imagePtr: int
    :param imagePtr: a pointer to an ImageView shared pointer as an int.
    :rtype: PyObject
    :return: the python instance created from the C++ pointer.

◆ get_axes_interpretation()

iolink.iolink.ImageView.get_axes_interpretation (   self)
    Shortcut to access axes interpretation from image properties

    :rtype: :py:class:`ImageType`
    :return: axes interpretation of the image

◆ get_bit_depth()

iolink.iolink.ImageView.get_bit_depth (   self)
    Shortcut to access the sample bitdepth from image properties

    :rtype: int
    :return: bitdepth of the image

◆ get_capabilities()

iolink.iolink.ImageView.get_capabilities (   self)
Return the capabilities of this image.

◆ get_data_type()

iolink.iolink.ImageView.get_data_type (   self)
Return the data type of the samples of this image.

◆ get_dimension_count()

iolink.iolink.ImageView.get_dimension_count (   self)
Returns the dimension of the View.

◆ get_has_alpha()

iolink.iolink.ImageView.get_has_alpha (   self)
    Shortcut to access hasAlpha status from image properties

    :rtype: boolean
    :return: TRUE if image has an alpha channel, FALSE otherwise

◆ get_shape()

iolink.iolink.ImageView.get_shape (   self)
    Return the shape of the image, each component containing the size in this dimension.

    Example:
     - A 2D image will return a vector with two dimension, the first being the number
       of columns, and the second being the number of rows.

     - A 3D image will return a vector with two dimension, the first being the number
       of columns, the second being the number of rows, and the third being the number
       of slices.

◆ get_spatial_directions()

iolink.iolink.ImageView.get_spatial_directions (   self)
    Shortcut to access spatial directions from image properties

    :rtype: :py:class:`SpatialDirections`
    :return: spatial directions of the image

◆ get_spatial_origin()

iolink.iolink.ImageView.get_spatial_origin (   self)
    Shortcut to access spatial origin from image properties

    :rtype: :py:class:`Vector3d`
    :return: spatial origin of the image

◆ get_spatial_spacing()

iolink.iolink.ImageView.get_spatial_spacing (   self)
    Shortcut to access spatial spacing from image properties

    :rtype: :py:class:`Vector3d`
    :return: spatial spacing of the image

◆ get_spatial_unit()

iolink.iolink.ImageView.get_spatial_unit (   self)
    Shortcut to access the spatial unit from image properties

    :rtype: string
    :return: spatial unit of the image

◆ get_value_range()

iolink.iolink.ImageView.get_value_range (   self)
    Shortcut to access the sample value range from image properties

    :rtype: :py:class:`Vector2d`
    :return: value range for the image samples

◆ parallel_access()

iolink.iolink.ImageView.parallel_access (   self)
Shortcut to retrieve ParallelAccess extension

◆ read()

iolink.iolink.ImageView.read (   self,
  index,
  dst = None 
)
Read a value from the ImageView.
:param index The index to read
:param dst  Mutable sequence where read data are written
:return an Array with read data if dst is None, otherwise nothing

◆ read_region()

iolink.iolink.ImageView.read_region (   self,
  region,
  dst = None 
)
Read a region from the ImageView.
:param region  The region to read
:param dst  Mutable sequence where read data are written
:return an Array with read data if dst is None, otherwise nothing

◆ reshape()

iolink.iolink.ImageView.reshape (   self,
  shape,
  dataType 
)
    Change the shape and sample data type of the image.

    Available when the ImageView has the RESHAPE capability.

    All the image's data is invalidated after this operation.

    :type shape: :py:class:`VectorXu64`
    :param shape: The new shape.
    :type dataType: :py:class:`DataType`
    :param dataType: The new sample data type.

    :raises: NotImplemented If the implementation does not support reshaping.

◆ set_alpha()

iolink.iolink.ImageView.set_alpha (   self,
  value 
)
    Shortcut to indicate the presence of an alpha channel into image properties

    :type value: boolean
    :param value: TRUE if image has an alpha channel, FALSE otherwise

◆ set_axes_interpretation()

iolink.iolink.ImageView.set_axes_interpretation (   self,
  type 
)
    Shortcut to set axes interpretation into image properties

    :type type: :py:class:`ImageType`
    :param type: Axes interpretation to set

◆ set_bit_depth()

iolink.iolink.ImageView.set_bit_depth (   self,
  bitDepth 
)
    Shortcut to set sample bitdepth into image properties

    :type bitDepth: int
    :param bitDepth: bitDepth to set

◆ set_image_interpretation()

iolink.iolink.ImageView.set_image_interpretation (   self,
  interpretation 
)
    Shortcut to set Image interpretation into image properties

    :type interpretation: int
    :param interpretation: Image interpretation to set

◆ set_metadata()

iolink.iolink.ImageView.set_metadata (   self,
  metadata 
)
    Attach a new metadata node to the image.

    Available when the ImageView has the WRITE capability.

    :raises: NotImplemented If the implementation does not support writing.

◆ set_properties()

iolink.iolink.ImageView.set_properties (   self,
  properties 
)
    Update the image's properties.

    Available when the ImageView has the WRITE capability.

    :raises: NotImplemented If the implementation does not support writing.

◆ set_spatial_directions()

iolink.iolink.ImageView.set_spatial_directions (   self,
  directions 
)
    Shortcut to set spatial direcitons into image properties

    :type directions: :py:class:`SpatialDirections`
    :param directions: spatial directions to set

◆ set_spatial_origin()

iolink.iolink.ImageView.set_spatial_origin (   self,
  origin 
)
    Shortcut to set spatial origin into image properties

    :type origin: :py:class:`Vector3d`
    :param origin: spatial origin to set

◆ set_spatial_spacing()

iolink.iolink.ImageView.set_spatial_spacing (   self,
  spacing 
)
    Shortcut to set spatial spacing into image properties

    :type spacing: :py:class:`Vector3d`
    :param spacing: spatial spacing to set

◆ set_spatial_unit()

iolink.iolink.ImageView.set_spatial_unit (   self,
  unit 
)
    Shortcut to set spatial unit into image properties

    :type unit: string
    :param unit: spatial unit to set

◆ set_value_range()

iolink.iolink.ImageView.set_value_range (   self,
  range 
)
    Shortcut to set sample value range into image properties

    :type range: :py:class:`Vector2d`
    :param range: value range to set

◆ support()

iolink.iolink.ImageView.support (   self,
  flags 
)
Checks if the ImageView supports the given capabilities.

◆ tiling_info()

iolink.iolink.ImageView.tiling_info (   self)
Shortcut to retrieve TilingInfo extension.

◆ to_pointer()

iolink.iolink.ImageView.to_pointer (   self)
Get the internal C++ pointer as an integer.

◆ to_string()

iolink.iolink.ImageView.to_string (   self)
Return a string representation

◆ write()

iolink.iolink.ImageView.write (   self,
  index,
  src 
)
Write a value into the ImageView at given position
:param index The position where to write
:param src input data to write (bytearray or any Sequence object)

◆ write_region()

iolink.iolink.ImageView.write_region (   self,
  region,
  src 
)
Write a region into the ImageView.
:param region The region to write
:param src input data to write (bytearray or any Sequence object)

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