MeVisLab Toolbox Reference
SoSFMLImage Class Reference

The SoSFMLImage field is the interface used by Inventor Nodes to access image data (in the current implementation from the ML - MeVis Image Processing Library) More...

#include <SoSFMLImage.h>

Inheritance diagram for SoSFMLImage:

Public Member Functions

virtual void setValue ()
 Required by Inventor but not used. More...
 
SbBool readValue (SoInput *in) override
 Required by Inventor but not used. More...
 
void writeValue (SoOutput *out) const override
 Required by Inventor but not used. More...
 
bool isValid ()
 Checks whether there is a valid image available. More...
 
void getSize (XVImageSize &size)
 Gets the size of the image. More...
 
void getSize (int &x, int &y, int &z, int &c, int &t, int &u)
 Gets the size of the image. More...
 
void getSize (int &x, int &y, int &z, int &c, int &t)
 Gets the size of the image. More...
 
void getSize (int &x, int &y, int &z, int &c)
 Gets the size of the image. More...
 
void getSize (int &x, int &y, int &z)
 Gets the size of the image. More...
 
void getSize (int &x, int &y)
 Gets the size of the image. More...
 
void getSize (MLint &x, MLint &y, MLint &z, MLint &c, MLint &t, MLint &u)
 Gets the size of the image. More...
 
void getSize (MLint &x, MLint &y, MLint &z, MLint &c, MLint &t)
 Gets the size of the image. More...
 
void getSize (MLint &x, MLint &y, MLint &z, MLint &c)
 Gets the size of the image. More...
 
void getSize (MLint &x, MLint &y, MLint &z)
 Gets the size of the image. More...
 
void getSize (MLint &x, MLint &y)
 Gets the size of the image. More...
 
void getPageSize (XVImageSize &size)
 Gets the ML page size of the image. More...
 
MLint getChannels ()
 Returns the number of color channels. More...
 
bool isChannelName (MLint n, const char *name)
 Check whether the name of the n-th channel is the given name. More...
 
MLint getTimePoints ()
 Returns the number of time points. More...
 
void getType (MLDataType &dtype, size_t &dsize)
 Gets the type of the Image: number of channels, data type as defined in mlDataTypes.h, and data size (size of one voxel value). More...
 
void getType (MLDataType &dtype)
 Gets the type of the Image: number of channels, data type as defined in mlDataTypes.h. More...
 
void getVoxelSize (float &x, float &y, float &z)
 Gets the voxel size in floats. More...
 
void getVoxelSize (double &x, double &y, double &z)
 Gets the voxel size in doubles. More...
 
void getVoxelSize (float &x, float &y)
 Gets the voxel size in floats. More...
 
void getVoxelSize (double &x, double &y)
 Gets the voxel size in doubles. More...
 
double getVoxelVolumeInCubicMillimeters ()
 Returns the volume of a single voxel in cubic millimeters (mm^3). More...
 
double getVoxelVolumeInMilliliters ()
 Returns the volume of a single voxel in milliliters (ml). More...
 
void touch () override
 Forces a notification of a changed image. More...
 
unsigned int getSerialNumber ()
 Returns serial number of current image. More...
 
double getMinValue ()
 Returns the statistical minimum value of the image. More...
 
double getMaxValue ()
 Returns the statistical maximum value of the image. More...
 
const ml::ImagePropertyExtensiongetImagePropertyExtensionByType (const char *imagePropertyTypeClassName)
 Returns a pointer to a constant image property extension, or NULL if not available. More...
 
void connectFromML (void *connector)
 Connects to an ML output connector field. More...
 
void disconnectFromML ()
 Disconnects from an ML output connector field. More...
 
void * getConnector ()
 Returns current ML connector or NULL if not connected. More...
 
ml::PagedImagegetPagedImage ()
 Returns access to the underlying ml::PagedImage. More...
 
bool getTile3D (void *usrMem, MLDataType type, MLint x, MLint y, MLint z, MLint nx, MLint ny, MLint nz)
 Returns the 3D Tile in the specified user memory with format type. More...
 
bool getScaledTile3D (void *usrMem, MLDataType type, MLint x, MLint y, MLint z, MLint nx, MLint ny, MLint nz, double srcMin, double srcMax, double dstMin, double dstMax)
 Returns the 3D Tile in the specified user memory with format type. More...
 
bool getTile6D (void *usrMem, MLDataType type, XVImageSize &pos, XVImageSize &size)
 Returns the 6D Tile in the specified user memory with format type. More...
 
bool getScaledTile6D (void *usrMem, MLDataType type, XVImageSize &pos, XVImageSize &size, double srcMin, double srcMax, double dstMin, double dstMax)
 Returns the 6D Tile in the specified user memory with format type. More...
 
void getVoxelToWorldMatrix (float mat[16])
 Gets the VoxelToWorldMatrix as a float array (according to ML conventions). More...
 
void getVoxelToWorldMatrix (double mat[16])
 Gets the VoxelToWorldMatrix as a double array (according to ML conventions). More...
 
void getVoxelToWorldMatrix (SbMatrix &matrix)
 Gets the VoxelToWorldMatrix as an Inventor float matrix (transposed w.r.t. ML). More...
 
void getVoxelToWorldMatrix (SbMatrixd &matrix)
 Gets the VoxelToWorldMatrix as an Inventor double matrix (transposed w.r.t. ML). More...
 
void getWorldToVoxelMatrix (float mat[16])
 Gets the WorldToVoxelMatrix as a float array (according to ML conventions). More...
 
void getWorldToVoxelMatrix (double mat[16])
 Gets the WorldToVoxelMatrix as a double array (according to ML conventions). More...
 
void getWorldToVoxelMatrix (SbMatrix &matrix)
 Gets the WorldToVoxelMatrix as an Inventor float matrix (transposed w.r.t. ML). More...
 
void getWorldToVoxelMatrix (SbMatrixd &matrix)
 Gets the WorldToVoxelMatrix as an Inventor double matrix (transposed w.r.t. ML). More...
 
void mapVoxelToWorld (const SbVec3f &src, SbVec3f &dst)
 Maps from voxel to world coordinate in float vectors. More...
 
void mapVoxelToWorld (const SbVec3d &src, SbVec3d &dst)
 Maps from voxel to world coordinate in double vectors. More...
 
void mapWorldToVoxel (const SbVec3f &src, SbVec3f &dst)
 Maps from world to voxel coordinate in float vectors. More...
 
void mapWorldToVoxel (const SbVec3d &src, SbVec3d &dst)
 Maps from world to voxel coordinate in double vectors. More...
 
void mapVoxelToWorld (float voxelX, float voxelY, float voxelZ, float &worldX, float &worldY, float &worldZ)
 Maps from voxel to world coordinate in float values. More...
 
void mapVoxelToWorld (double voxelX, double voxelY, double voxelZ, double &worldX, double &worldY, double &worldZ)
 Maps from voxel to world coordinate in double values. More...
 
void mapWorldToVoxel (float worldX, float worldY, float worldZ, float &voxelX, float &voxelY, float &voxelZ)
 Maps from world to voxel coordinate in float values. More...
 
void mapWorldToVoxel (double worldX, double worldY, double worldZ, double &voxelX, double &voxelY, double &voxelZ)
 Maps from world to voxel coordinate in double values. More...
 
bool isVoxelInsideImage (double voxelX, double voxelY, double voxelZ)
 Checks whether the voxel coordinate (in doubles) is inside of the image extend. More...
 
bool isVoxelInsideImage (const SbVec3f &voxelCoord)
 Checks whether the voxel coordinate is inside of the image extend. More...
 
bool isVoxelInsideImage (const SbVec3d &voxelCoord)
 Checks whether the voxel coordinate is inside of the image extend. More...
 

Static Public Member Functions

static void initClass ()
 Initializes field class, setting up runtime type info. More...
 

Protected Attributes

SoSFMLImagePrivate * _p
 Private data of the SoSFMLImage. More...
 

Detailed Description

The SoSFMLImage field is the interface used by Inventor Nodes to access image data (in the current implementation from the ML - MeVis Image Processing Library)

Through the methods of this class, image data can be accessed without knowing who provides the data. If the input data changes, the SoSFMLImage field is touched with the touch() method. The data source can be set as an ML OutputConnector (connectFromML()) The SoSFMLImage is then attached to the OutputConnector via a ML FieldSensor, so that the SoSFMLImage is touched on any input change and can be watched by a SoFieldSensor to get notified of a changed input image.

Definition at line 70 of file SoSFMLImage.h.

Member Function Documentation

◆ connectFromML()

void SoSFMLImage::connectFromML ( void *  connector)

Connects to an ML output connector field.

◆ disconnectFromML()

void SoSFMLImage::disconnectFromML ( )

Disconnects from an ML output connector field.

◆ getChannels()

MLint SoSFMLImage::getChannels ( )

Returns the number of color channels.

◆ getConnector()

void* SoSFMLImage::getConnector ( )

Returns current ML connector or NULL if not connected.

◆ getImagePropertyExtensionByType()

const ml::ImagePropertyExtension* SoSFMLImage::getImagePropertyExtensionByType ( const char *  imagePropertyTypeClassName)

Returns a pointer to a constant image property extension, or NULL if not available.

imagePropertyTypeClassName contains the name of the ML_UTILS_NAMESPACE::RuntimeType representing the image property extension.

◆ getMaxValue()

double SoSFMLImage::getMaxValue ( )

Returns the statistical maximum value of the image.

◆ getMinValue()

double SoSFMLImage::getMinValue ( )

Returns the statistical minimum value of the image.

◆ getPagedImage()

ml::PagedImage* SoSFMLImage::getPagedImage ( )

Returns access to the underlying ml::PagedImage.

Returns NULL if no image is connected. The properties of the paged image are updated before returning the pointer.

◆ getPageSize()

void SoSFMLImage::getPageSize ( XVImageSize size)

Gets the ML page size of the image.

◆ getScaledTile3D()

bool SoSFMLImage::getScaledTile3D ( void *  usrMem,
MLDataType  type,
MLint  x,
MLint  y,
MLint  z,
MLint  nx,
MLint  ny,
MLint  nz,
double  srcMin,
double  srcMax,
double  dstMin,
double  dstMax 
)

Returns the 3D Tile in the specified user memory with format type.

This also scales the data from srcMin/srcMax to dstMin/dstMax.

◆ getScaledTile6D()

bool SoSFMLImage::getScaledTile6D ( void *  usrMem,
MLDataType  type,
XVImageSize pos,
XVImageSize size,
double  srcMin,
double  srcMax,
double  dstMin,
double  dstMax 
)

Returns the 6D Tile in the specified user memory with format type.

This also scales the data from srcMin/srcMax to dstMin/dstMax.

◆ getSerialNumber()

unsigned int SoSFMLImage::getSerialNumber ( )

Returns serial number of current image.

The serial number is never equal to 0. The serial number is increased with each image change and can be used to determine whether the image has changed by storing a previous serial number and comparing it to the current one. It is recommended to use a SoFieldSensor on this field instead of using the serial number.

◆ getSize() [1/11]

void SoSFMLImage::getSize ( int &  x,
int &  y 
)

Gets the size of the image.

◆ getSize() [2/11]

void SoSFMLImage::getSize ( int &  x,
int &  y,
int &  z 
)

Gets the size of the image.

◆ getSize() [3/11]

void SoSFMLImage::getSize ( int &  x,
int &  y,
int &  z,
int &  c 
)

Gets the size of the image.

◆ getSize() [4/11]

void SoSFMLImage::getSize ( int &  x,
int &  y,
int &  z,
int &  c,
int &  t 
)

Gets the size of the image.

◆ getSize() [5/11]

void SoSFMLImage::getSize ( int &  x,
int &  y,
int &  z,
int &  c,
int &  t,
int &  u 
)

Gets the size of the image.

◆ getSize() [6/11]

void SoSFMLImage::getSize ( MLint x,
MLint y 
)

Gets the size of the image.

◆ getSize() [7/11]

void SoSFMLImage::getSize ( MLint x,
MLint y,
MLint z 
)

Gets the size of the image.

◆ getSize() [8/11]

void SoSFMLImage::getSize ( MLint x,
MLint y,
MLint z,
MLint c 
)

Gets the size of the image.

◆ getSize() [9/11]

void SoSFMLImage::getSize ( MLint x,
MLint y,
MLint z,
MLint c,
MLint t 
)

Gets the size of the image.

◆ getSize() [10/11]

void SoSFMLImage::getSize ( MLint x,
MLint y,
MLint z,
MLint c,
MLint t,
MLint u 
)

Gets the size of the image.

◆ getSize() [11/11]

void SoSFMLImage::getSize ( XVImageSize size)

Gets the size of the image.

◆ getTile3D()

bool SoSFMLImage::getTile3D ( void *  usrMem,
MLDataType  type,
MLint  x,
MLint  y,
MLint  z,
MLint  nx,
MLint  ny,
MLint  nz 
)

Returns the 3D Tile in the specified user memory with format type.

◆ getTile6D()

bool SoSFMLImage::getTile6D ( void *  usrMem,
MLDataType  type,
XVImageSize pos,
XVImageSize size 
)

Returns the 6D Tile in the specified user memory with format type.

◆ getTimePoints()

MLint SoSFMLImage::getTimePoints ( )

Returns the number of time points.

◆ getType() [1/2]

void SoSFMLImage::getType ( MLDataType dtype)

Gets the type of the Image: number of channels, data type as defined in mlDataTypes.h.

◆ getType() [2/2]

void SoSFMLImage::getType ( MLDataType dtype,
size_t &  dsize 
)

Gets the type of the Image: number of channels, data type as defined in mlDataTypes.h, and data size (size of one voxel value).

◆ getVoxelSize() [1/4]

void SoSFMLImage::getVoxelSize ( double &  x,
double &  y 
)

Gets the voxel size in doubles.

◆ getVoxelSize() [2/4]

void SoSFMLImage::getVoxelSize ( double &  x,
double &  y,
double &  z 
)

Gets the voxel size in doubles.

◆ getVoxelSize() [3/4]

void SoSFMLImage::getVoxelSize ( float &  x,
float &  y 
)

Gets the voxel size in floats.

◆ getVoxelSize() [4/4]

void SoSFMLImage::getVoxelSize ( float &  x,
float &  y,
float &  z 
)

Gets the voxel size in floats.

◆ getVoxelToWorldMatrix() [1/4]

void SoSFMLImage::getVoxelToWorldMatrix ( double  mat[16])

Gets the VoxelToWorldMatrix as a double array (according to ML conventions).

◆ getVoxelToWorldMatrix() [2/4]

void SoSFMLImage::getVoxelToWorldMatrix ( float  mat[16])

Gets the VoxelToWorldMatrix as a float array (according to ML conventions).

◆ getVoxelToWorldMatrix() [3/4]

void SoSFMLImage::getVoxelToWorldMatrix ( SbMatrix &  matrix)

Gets the VoxelToWorldMatrix as an Inventor float matrix (transposed w.r.t. ML).

◆ getVoxelToWorldMatrix() [4/4]

void SoSFMLImage::getVoxelToWorldMatrix ( SbMatrixd &  matrix)

Gets the VoxelToWorldMatrix as an Inventor double matrix (transposed w.r.t. ML).

◆ getVoxelVolumeInCubicMillimeters()

double SoSFMLImage::getVoxelVolumeInCubicMillimeters ( )

Returns the volume of a single voxel in cubic millimeters (mm^3).

This returns the correct volume for sheared datasets and calculates fabs( inImg->getVoxelToWorldMatrix().det() ).

◆ getVoxelVolumeInMilliliters()

double SoSFMLImage::getVoxelVolumeInMilliliters ( )

Returns the volume of a single voxel in milliliters (ml).

This returns the correct volume for sheared datasets and calculates fabs( inImg->getVoxelToWorldMatrix().det() ) / 1000.

◆ getWorldToVoxelMatrix() [1/4]

void SoSFMLImage::getWorldToVoxelMatrix ( double  mat[16])

Gets the WorldToVoxelMatrix as a double array (according to ML conventions).

◆ getWorldToVoxelMatrix() [2/4]

void SoSFMLImage::getWorldToVoxelMatrix ( float  mat[16])

Gets the WorldToVoxelMatrix as a float array (according to ML conventions).

◆ getWorldToVoxelMatrix() [3/4]

void SoSFMLImage::getWorldToVoxelMatrix ( SbMatrix &  matrix)

Gets the WorldToVoxelMatrix as an Inventor float matrix (transposed w.r.t. ML).

◆ getWorldToVoxelMatrix() [4/4]

void SoSFMLImage::getWorldToVoxelMatrix ( SbMatrixd &  matrix)

Gets the WorldToVoxelMatrix as an Inventor double matrix (transposed w.r.t. ML).

◆ initClass()

static void SoSFMLImage::initClass ( )
static

Initializes field class, setting up runtime type info.

◆ isChannelName()

bool SoSFMLImage::isChannelName ( MLint  n,
const char *  name 
)

Check whether the name of the n-th channel is the given name.

◆ isValid()

bool SoSFMLImage::isValid ( )

Checks whether there is a valid image available.

◆ isVoxelInsideImage() [1/3]

bool SoSFMLImage::isVoxelInsideImage ( const SbVec3d &  voxelCoord)

Checks whether the voxel coordinate is inside of the image extend.

◆ isVoxelInsideImage() [2/3]

bool SoSFMLImage::isVoxelInsideImage ( const SbVec3f &  voxelCoord)

Checks whether the voxel coordinate is inside of the image extend.

◆ isVoxelInsideImage() [3/3]

bool SoSFMLImage::isVoxelInsideImage ( double  voxelX,
double  voxelY,
double  voxelZ 
)

Checks whether the voxel coordinate (in doubles) is inside of the image extend.

◆ mapVoxelToWorld() [1/4]

void SoSFMLImage::mapVoxelToWorld ( const SbVec3d &  src,
SbVec3d &  dst 
)

Maps from voxel to world coordinate in double vectors.

◆ mapVoxelToWorld() [2/4]

void SoSFMLImage::mapVoxelToWorld ( const SbVec3f &  src,
SbVec3f &  dst 
)

Maps from voxel to world coordinate in float vectors.

◆ mapVoxelToWorld() [3/4]

void SoSFMLImage::mapVoxelToWorld ( double  voxelX,
double  voxelY,
double  voxelZ,
double &  worldX,
double &  worldY,
double &  worldZ 
)

Maps from voxel to world coordinate in double values.

◆ mapVoxelToWorld() [4/4]

void SoSFMLImage::mapVoxelToWorld ( float  voxelX,
float  voxelY,
float  voxelZ,
float &  worldX,
float &  worldY,
float &  worldZ 
)

Maps from voxel to world coordinate in float values.

◆ mapWorldToVoxel() [1/4]

void SoSFMLImage::mapWorldToVoxel ( const SbVec3d &  src,
SbVec3d &  dst 
)

Maps from world to voxel coordinate in double vectors.

◆ mapWorldToVoxel() [2/4]

void SoSFMLImage::mapWorldToVoxel ( const SbVec3f &  src,
SbVec3f &  dst 
)

Maps from world to voxel coordinate in float vectors.

◆ mapWorldToVoxel() [3/4]

void SoSFMLImage::mapWorldToVoxel ( double  worldX,
double  worldY,
double  worldZ,
double &  voxelX,
double &  voxelY,
double &  voxelZ 
)

Maps from world to voxel coordinate in double values.

◆ mapWorldToVoxel() [4/4]

void SoSFMLImage::mapWorldToVoxel ( float  worldX,
float  worldY,
float  worldZ,
float &  voxelX,
float &  voxelY,
float &  voxelZ 
)

Maps from world to voxel coordinate in float values.

◆ readValue()

SbBool SoSFMLImage::readValue ( SoInput *  in)
override

Required by Inventor but not used.

◆ setValue()

virtual void SoSFMLImage::setValue ( )
virtual

Required by Inventor but not used.

◆ touch()

void SoSFMLImage::touch ( )
override

Forces a notification of a changed image.

This can be received by a field sensor. Typically, this is called implicitly when the internal ML field sensor is activated.

◆ writeValue()

void SoSFMLImage::writeValue ( SoOutput *  out) const
override

Required by Inventor but not used.

Member Data Documentation

◆ _p

SoSFMLImagePrivate* SoSFMLImage::_p
protected

Private data of the SoSFMLImage.

Definition at line 254 of file SoSFMLImage.h.


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