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;