![]() |
IOLink Python 1.11.0
|
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) | |
Public Member Functions inherited from iolink.iolink.View | |
| view_origin (self) | |
| extension (self, extension_id) | |
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) | |
Protected Member Functions inherited from iolink.iolink.View | |
| _extension (self, id) | |
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__) | |
Properties inherited from iolink.iolink.View | |
| thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") | |
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
| iolink.iolink.ImageView.__init__ | ( | self, | |
| * | args, | ||
| ** | kwargs | ||
| ) |
Reimplemented from iolink.iolink.View.
| iolink.iolink.ImageView.__repr__ | ( | self | ) |
Reimplemented from iolink.iolink.View.
|
protected |
Shortcut to access Image interpretation from image properties
:rtype: int
:return: interpretation of the image
|
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.
| 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
| iolink.iolink.ImageView.get_bit_depth | ( | self | ) |
Shortcut to access the sample bitdepth from image properties
:rtype: int
:return: bitdepth of the image
| iolink.iolink.ImageView.get_capabilities | ( | self | ) |
Return the capabilities of this image.
| iolink.iolink.ImageView.get_data_type | ( | self | ) |
Return the data type of the samples of this image.
| iolink.iolink.ImageView.get_dimension_count | ( | self | ) |
Returns the dimension of the View.
| 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
| 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.
| 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
| 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
| 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
| iolink.iolink.ImageView.get_spatial_unit | ( | self | ) |
Shortcut to access the spatial unit from image properties
:rtype: string
:return: spatial unit of the image
| 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
| iolink.iolink.ImageView.parallel_access | ( | self | ) |
Shortcut to retrieve ParallelAccess extension
| 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
| 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
| 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.
| 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
| 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
| iolink.iolink.ImageView.set_bit_depth | ( | self, | |
| bitDepth | |||
| ) |
Shortcut to set sample bitdepth into image properties
:type bitDepth: int
:param bitDepth: bitDepth to set
| 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
| 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.
| 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.
| 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
| 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
| 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
| 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
| 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
| iolink.iolink.ImageView.support | ( | self, | |
| flags | |||
| ) |
Checks if the ImageView supports the given capabilities.
| iolink.iolink.ImageView.tiling_info | ( | self | ) |
Shortcut to retrieve TilingInfo extension.
| iolink.iolink.ImageView.to_pointer | ( | self | ) |
Get the internal C++ pointer as an integer.
| iolink.iolink.ImageView.to_string | ( | self | ) |
Return a string representation
| 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)
| 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)