ImageDev

Image Data

This section introduces the ImageDev helpers for interacting with ImageView meta data.

These methods help to handle ImageView objects that are described more precisely in the Image Data section.

These methods are deprecated, they will be removed in ImageDev 2024.2. You can directly use methods of ImageView instead.

Syntax

Method Description
iolink::ImageInterpretation getImageInterpretation( std::shared_ptr < iolink::ImageView > image ) Gets the image intensity interpretation (binary, label, or other values).
  • image: The input IOLink image
This method is deprecated, it will be removed in ImageDev 2024.2. You can directly use imageInterpretation method of ImageView instead.
void setImageInterpretation( std::shared_ptr < iolink::ImageView > image, const iolink::ImageInterpretation interpretation ) Sets the image intensity interpretation (binary, label, or other values).
  • image: The input IOLink image
  • interpretation: The interpretation value
This method is deprecated, it will be removed in ImageDev 2024.2. You can directly use setImageInterpretation method of ImageView instead.
iolink::ImageType getDimensionalInterpretation( std::shared_ptr < iolink::ImageView > image ) Gets the image dimensional interpretation for an image having more than 2 dimensions (volume, sequence, multi-channel).
  • image: The input IOLink image
This method is deprecated, it will be removed in ImageDev 2024.2. You can directly use axesInterpretation method of ImageView instead.
void setDimensionalInterpretation( std::shared_ptr < iolink::ImageView > image, const iolink::ImageType& imageType ) Sets the image dimensional interpretation for an image having more than 2 dimensions (volume, sequence, multi-channel).
  • image: The input IOLink image
  • imageType: The imageType value
This method is deprecated, it will be removed in ImageDev 2024.2. You can directly use setAxesInterpretation method of ImageView instead.
iolink::Vector3d getCalibrationOrigin( std::shared_ptr <iolink::ImageView > image ) Gets the calibration origin from an IOLink image.
  • image: The IOLink image
This method is deprecated, it will be removed in ImageDev 2024.2. You can directly use spatialOrigin method of ImageView instead.
void setCalibrationOrigin( std::shared_ptr <iolink::ImageView > image, const iolink::Vector3d& origin ) Sets the calibration origin of an IOLink image.
  • image: The input IOLink image
  • origin: The calibration origin value to give to the input image.
This method is deprecated, it will be removed in ImageDev 2024.2. You can directly use setSpatialOrigin method of ImageView instead.
iolink::Vector3d getCalibrationSpacing( std::shared_ptr < iolink::ImageView > image ) Gets the calibration spacing from an IOLink image.
  • image: The IOLink image
This method is deprecated, it will be removed in ImageDev 2024.2. You can directly use spatialSpacing method of ImageView instead.
void setCalibrationSpacing( std::shared_ptr < iolink::ImageView > image, const iolink::Vector3d& spacing ) Sets the calibration spacing of an IOLink image.
  • image: The input IOLink image
  • spacing: The calibration spacing value to give to the input image.
This method is deprecated, it will be removed in ImageDev 2024.2. You can directly use setSpatialSpacing method of ImageView instead.
void setCalibrationUnit( std::shared_ptr< iolink::ImageView > image, const std::string& unit ) Sets the calibration unit of an IOLink image.
  • image: The input IOLink image
  • unit: the new calibration unit
This method is deprecated, it will be removed in ImageDev 2024.2. You can directly use setSpatialUnit method of ImageView instead.
std::string getCalibrationUnit( std::shared_ptr< iolink::ImageView > image ) Gets the calibration unit from an IOLink image. The unit is returned as a string.
  • image: The input IOLink image
This method is deprecated, it will be removed in ImageDev 2024.2. You can directly use spatialUnit method of ImageView instead.

// Create demo image
std::shared_ptr < iolink::ImageView > image =
            iolink::ImageViewFactory::allocate( { 5, 6 }, iolink::DataTypeId::UINT8 );
// Similar to image->imageInterpretation(); iolink::ImageInterpretation originalInterpretation = imagedev::getImageInterpretation( image ); if( originalInterpretation == iolink::ImageInterpretation::UNKNOWN ) std::cout << "Interpretation is UNKNOWN." << std::endl;
// Similar to image->setImageInterpretation(iolink::ImageInterpretation::BINARY); imagedev::setImageInterpretation( image, iolink::ImageInterpretation::BINARY ); if( imagedev::getImageInterpretation( image ) == iolink::ImageInterpretation::BINARY ) std::cout << "Interpretation is BINARY." << std::endl;

// Similar to image->axesInterpretation(); iolink::ImageType originalImageType = imagedev::getDimensionalInterpretation( image ); if( originalImageType == iolink::ImageTypeId::UNKNOWN ) std::cout << "ImageType is UNKNOWN." << std::endl;
// Similar to image->setAxesInterpretation(iolink::ImageTypeId::VOLUME); imagedev::setDimensionalInterpretation( image, iolink::ImageTypeId::VOLUME ); if( imagedev::getDimensionalInterpretation( image ) == iolink::ImageTypeId::VOLUME ) std::cout << "ImageType is VOLUME." << std::endl;

// Similar to image->spatialOrigin (); iolink::Vector3d originalOrigin = imagedev::getCalibrationOrigin( image ); if( originalOrigin == imagedev::getCalibrationOrigin( image ) ) std::cout << "Calibration origin is" << originalOrigin << std::endl;
// Similar to image->setSpatialOrigin( { 1, 2, 3 } ); imagedev::setCalibrationOrigin( image, { 1, 2, 3 } ); if ( imagedev::getCalibrationOrigin( image ) == iolink::Vector3d( { 1, 2, 3 } ) ) std::cout << "Calibration origin is" << originalOrigin << std::endl;
// Similar to image->spatialSpacing(); iolink::Vector3d originalSpacing = imagedev::getCalibrationSpacing( image ); if( originalSpacing == imagedev::getCalibrationSpacing( image ) ) std::cout << "Calibration spacing is" << originalSpacing << std::endl;
// Similar to image->setSpatialSpacing({ 2, 3, 4 }); imagedev::setCalibrationSpacing( image, { 2, 3, 4 } ); if ( imagedev::getCalibrationSpacing( image ) == iolink::Vector3d( { 2, 3, 4 } ) ) std::cout << "Calibration spacing is" << originalSpacing << std::endl;
Method Description
get_image_interpretation(image) Gets the image intensity interpretation (binary, label, or other values).
  • image: The input IOLink image
This method is deprecated, it will be removed in ImageDev 2024.2. You can directly use image_interpretation property of ImageView instead.
set_image_interpretation(image, interpretation) Sets the image intensity interpretation (binary, label, or other values).
  • image: The input IOLink image
  • interpretation: The interpretation value
This method is deprecated, it will be removed in ImageDev 2024.2. You can directly use image_interpretation property of ImageView instead.
get_dimensional_interpretation(image) Gets the image dimensional interpretation for an image having more than 2 dimensions (volume, sequence, multi-channel).
  • image: The input IOLink image
This method is deprecated, it will be removed in ImageDev 2024.2. You can directly use axes_interpretation property of ImageView instead.
set_dimensional_interpretation(image, imageType) Sets the image dimensional interpretation for an image having more than 2 dimensions (volume, sequence, multi-channel).
  • image: The input IOLink image
  • imageType: The imageType value
This method is deprecated, it will be removed in ImageDev 2024.2. You can directly use axes_interpretation property of ImageView instead.
get_calibration_origin(image) Gets the calibration origin from an IOLink image.
  • image: The IOLink image
This method is deprecated, it will be removed in ImageDev 2024.2. You can directly use spatial_origin property of ImageView instead.
set_calibration_origin(image, origin) Sets the calibration origin of an IOLink image.
  • image: The input IOLink image
  • origin: The calibration origin value to give to the input image.
This method is deprecated, it will be removed in ImageDev 2024.2. You can directly use spatial_origin property of ImageView instead.
get_calibration_spacing(image) Gets the calibration spacing from an IOLink image.
  • image: The IOLink image
This method is deprecated, it will be removed in ImageDev 2024.2. You can directly use spatial_spacing property of ImageView instead.
set_calibration_spacing(image, spacing) Sets the calibration spacing of an IOLink image.
  • image: The input IOLink image
  • spacing: The calibration spacing value to give to the input image.
This method is deprecated, it will be removed in ImageDev 2024.2. You can directly use spatial_spacing property of ImageView instead.
set_calibration_unit(image, unit) Sets the calibration unit of an IOLink image.
  • image: The input IOLink image
  • unit: the new calibration unit
This method is deprecated, it will be removed in ImageDev 2024.2. You can directly use spatial_unit property of ImageView instead.
get_calibration_unit(image) Gets the calibration unit from an IOLink image. The unit is returned as a string.
  • image: The input IOLink image
This method is deprecated, it will be removed in ImageDev 2024.2. You can directly use spatial_unit property of ImageView instead.
# Create demo image
image = iolink.ImageViewFactory.allocate(iolink.VectorXu64(5, 6, 7), iolink.DataTypeId_UINT8)
# Similar to image.image_interpretation originalInterpretation = imagedev.get_image_interpretation(image) if (originalInterpretation == iolink.ImageInterpretation_UNKNOWN): print("Interpretation is UNKNOWN.")
imagedev.data.set_image_interpretation(image, iolink.ImageInterpretation_BINARY) if (imagedev.data.get_image_interpretation(image) == iolink.ImageInterpretation_BINARY): print("Interpretation is BINARY.")
# Similar to image.axes_interpretation originalImageType = imagedev.get_dimensional_interpretation(image) if (originalImageType == iolink.ImageTypeId.UNKNOWN): print("ImageType is UNKNOWN.")
imagedev.data.set_dimensional_interpretation(image,iolink.ImageTypeId.VOLUME) if (imagedev.data.get_dimensional_interpretation(image) == image,iolink.ImageTypeId.VOLUME): print("ImageType is VOLUME.")
# Similar to images.patial_origin originalOrigin = imagedev.data.get_calibration_origin(image) if (originalOrigin == imagedev.data.get_calibration_origin(image)): print("Calibration origin is", originalOrigin)
imagedev.data.set_calibration_origin(image, iolink.Vector3d(1, 2, 3)) if (imagedev.data.get_calibration_origin(image) == iolink.Vector3d(1, 2, 3)): print("Calibration origin is", iolink.Vector3d(1, 2, 3))
# Similar to image.spatial_spacing originalSpacing = imagedev.data.get_calibration_spacing(image) if (originalSpacing == imagedev.data.get_calibration_spacing(image)): print("Calibration spacing is", originalSpacing)
imagedev.data.set_calibration_spacing(image, iolink.Vector3d(2, 3, 4)) if (imagedev.data.get_calibration_spacing(image) == iolink.Vector3d(2, 3, 4)): print("Calibration spacing is", iolink.Vector3d(2, 3, 4))
Method Description
public static ImageInterpretation GetImageInterpretation(ImageView image) Gets the image intensity interpretation (binary, label, or other values).
  • image: The input IOLink image
This method is deprecated, it will be removed in ImageDev 2024.2. You can directly use ImageInterpretation property of ImageView instead.
public static void SetImageInterpretation(ImageView image, ImageInterpretation interpretation) Sets the image intensity interpretation (binary, label, or other values).
  • image: The input IOLink image
  • interpretation: The interpretation value
This method is deprecated, it will be removed in ImageDev 2024.2. You can directly use ImageInterpretation property of ImageView instead.
public static ImageType GetDimensionalInterpretation(ImageView image) Gets the image dimensional interpretation for an image having more than 2 dimensions (volume, sequence, multi-channel).
  • image: The input IOLink image
This method is deprecated, it will be removed in ImageDev 2024.2. You can directly use AxesInterpretation property of ImageView instead.
public static void SetDimensionalInterpretation(ImageView image, ImageType imageType) Sets the image dimensional interpretation for an image having more than 2 dimensions (volume, sequence, multi-channel).
  • image: The input IOLink image
  • imageType: The imageType value
This method is deprecated, it will be removed in ImageDev 2024.2. You can directly use AxesInterpretation property of ImageView instead.
public static Vector3d GetCalibrationOrigin(ImageView image) Gets the calibration origin from an IOLink image.
  • image: The IOLink image
This method is deprecated, it will be removed in ImageDev 2024.2. You can directly use SpatialOrigin property of ImageView instead.
public static void SetCalibrationOrigin(ImageView image, Vector3d origin) Sets the calibration origin of an IOLink image.
  • image: The input IOLink image
  • origin: The calibration origin value to give to the input image.
This method is deprecated, it will be removed in ImageDev 2024.2. You can directly use SpatialOrigin property of ImageView instead.
public static Vector3d GetCalibrationSpacing(ImageView image) Gets the calibration spacing from an IOLink image.
  • image: The IOLink image
This method is deprecated, it will be removed in ImageDev 2024.2. You can directly use SpatialSpacing property of ImageView instead.
public static void SetCalibrationSpacing(ImageView image, Vector3d spacing) Sets the calibration spacing of an IOLink image.
  • image: The input IOLink image
  • spacing: The calibration spacing value to give to the input image.
This method is deprecated, it will be removed in ImageDev 2024.2. You can directly use SpatialSpacing property of ImageView instead.
public static void SetCalibrationUnit(ImageView image, String unit) Sets the calibration unit of an IOLink image.
  • image: The input IOLink image
  • unit: the new calibration unit
This method is deprecated, it will be removed in ImageDev 2024.2. You can directly use SpatialUnit property of ImageView instead.
public string void GetCalibrationUnit(ImageView image) Gets the calibration unit from an IOLink image. The unit is returned as a string.
  • image: The input IOLink image
This method is deprecated, it will be removed in ImageDev 2024.2. You can directly use SpatialUnit property of ImageView instead.
// Create demo image
var image = IOLink.ImageViewFactory.Allocate(new VectorXu64(5, 6, 7), IOLink.DataTypeId.VEC3_UINT8);
// Similar to image.ImageInterpretation var originalInterpretation = Data.GetImageInterpretation(image); if (originalInterpretation == ImageInterpretation.UNKNOWN) { Utilities.WriteInfoMsg("Interpretation is UNKNOWN."); }
Data.SetImageInterpretation(image, ImageInterpretation.BINARY); if (Data.GetImageInterpretation(image) == ImageInterpretation.BINARY) { Utilities.WriteInfoMsg("Interpretation is BINARY."); }
// Similar to image.AxesInterpretation var originalImageType = Data.GetDimensionalInterpretation(image); if (originalImageType == ImageTypeId.UNKNOWN) { Utilities.WriteInfoMsg("ImageType is UNKNOWN."); }
Data.SetDimensionalInterpretation(image, ImageTypeId.VOLUME); if (Data.GetDimensionalInterpretation(image) == ImageTypeId.VOLUME) { Utilities.WriteInfoMsg("ImageType is VOLUME."); }
// Similar to image.SpatialOrigin var originalOrigin = Data.GetCalibrationOrigin(image); if (originalOrigin == new Vector3d(0, 0, 0)) { Utilities.WriteInfoMsg("Calibration origin is (0, 0, 0)."); }
Data.SetCalibrationOrigin(image, new Vector3d(1, 2, 3)); if (Data.GetCalibrationOrigin(image) == new Vector3d(1, 2, 3)) { Utilities.WriteInfoMsg("Calibration origin is (1, 2, 3)."); }
// Similar to image.SpatialSpacing var originalSpacing = Data.GetCalibrationSpacing(image); if (originalSpacing == new Vector3d(1, 1, 1)) { Utilities.WriteInfoMsg("Calibration spacing is (1, 1, 1)."); }
Data.SetCalibrationSpacing(image, new Vector3d(2, 3, 4)); if (Data.GetCalibrationSpacing(image) == new Vector3d(2, 3, 4)) { Utilities.WriteInfoMsg("Calibration spacing is (2, 3, 4)."); }