MLABImageField Class Reference
[Fields]

A field containing an image. More...

Inherits MLABField.

List of all members.

Public Slots

Scripting access
void clear ()
void clearMemImg ()
void clearPages ()
const char * dataType ()
bool isValid ()
QVariantList mapVoxelToWorld (const QVariantList &vector)
QVariantList mapWorldToVoxel (const QVariantList &vector)
double maxValue ()
double minValue ()
QVariantList pageSize6D ()
virtual void setStringValue (const QString &)
QVariantList size3D ()
QVariantList size6D ()
int sizeC ()
int sizeT ()
int sizeU ()
int sizeX ()
int sizeY ()
int sizeZ ()
quint64 usedMemImg ()
quint64 usedPages ()
QVariantList voxelSize ()
double voxelSizeX ()
double voxelSizeY ()
double voxelSizeZ ()
QVariantList voxelToWorldMatrix ()
QVariantList worldToVoxelMatrix ()
Dicom Tag access
QMap< QString, QVariant > getDicomTagByKey (const QString &name)
QMap< QString, QVariant > getDicomTagByName (const QString &name)
QString getDicomTagValueByKey (const QString &name)
QString getDicomTagValueByName (const QString &name)
MLABDicomTreegetDicomTree ()
MLABDicomTaggetFrameSpecificDicomTag (const QString &name, int z, int t=0, int u=0)
MLABDicomTaggetFrameSpecificDicomTagById (int group, int element, int z, int t=0, int u=0)
MLPagedImageWrapperimage ()
QObject * object ()

Public Member Functions

virtual void touch ()


Detailed Description

A field containing an image.

This field offers various methods to access the image size, type, voxelsize and to map between world and voxel coordinates.

Internally this field contains a ML Input/OutputConnector or SoSFMLImage. Is can also be a proxy field, which forwards all calls to the internal image fields of a MacroModule and does some special things in connect and disconnect (connecting ML to Inventor Fields via multiple proxies etc.)


Member Function Documentation

void MLABImageField::clear (  )  [slot]

clears ML memory

void MLABImageField::clearMemImg (  )  [slot]

clears ML memory

void MLABImageField::clearPages (  )  [slot]

clears ML memory

const char* MLABImageField::dataType (  )  [slot]

get datatype as string (as in mlDataTypes.h MLNameFromDataType()), undefined if image invalid

QMap<QString, QVariant> MLABImageField::getDicomTagByKey ( const QString &  name  )  [slot]

returns a map that contains information on the tag (see getDicomTagByName()) for details)

QMap<QString, QVariant> MLABImageField::getDicomTagByName ( const QString &  name  )  [slot]

returns a map that contains information on the tag

The tag is returned as a dictionary with the following keys: If the "valid" key is set to "1", the tag was found and the following keys are set:

  • valid = (0 or 1, depending if tag was set)
  • vr = Value Representation (two uppercase letters)
  • stringValue = the string value of the tag
  • isString = if the tag is a string tag
  • isNumeric = if the tag is numeric (then values will be set)
  • isInteger = if the tag has integer values
  • value = contains the first numeric value of the tag, if isNumeric is true, the stringValue otherwise
  • values = contains the numeric values of the tag, if isNumeric is true, not set otherwise

Example:

    var f = ctx.field("somemodule.output0");
    var tag = f.getDicomTagValueByName("PatientsName")
    if (tag.valid) {
      MLAB.log(tag.stringValue); 
    }
    // numeric tags
    var tag = f.getDicomTagByName("SliceThickness");
    if (tag.valid) {
      MLAB.log("SliceThickness is " + tag.value);
    }
    // multi value tag
    var tag = f.getDicomTagByName("ImagePositionPatient");
    if (tag.valid) {
      MLAB.log("ImagePositionPatient is " + tag.values);
    }

QString MLABImageField::getDicomTagValueByKey ( const QString &  name  )  [slot]

returns string value of dicom tag, name is given as key (group,element) (AT naming convention)

Example:

    var f = ctx.field("somemodule.output0");
    var value = f.getDicomTagValueByKey("(0008,0081)")

QString MLABImageField::getDicomTagValueByName ( const QString &  name  )  [slot]

returns string value of dicom tag

Example:

    var f = ctx.field("somemodule.output0");
    var value = f.getDicomTagValueByKey("PatientsName")

MLABDicomTree* MLABImageField::getDicomTree (  )  [slot]

Returns the DICOM tree of the current image (or NULL, if not existing).

MLABDicomTag* MLABImageField::getFrameSpecificDicomTag ( const QString &  name,
int  z,
int  t = 0,
int  u = 0 
) [slot]

Returns the DICOM tag specific for the given slice (by name).

MLABDicomTag* MLABImageField::getFrameSpecificDicomTagById ( int  group,
int  element,
int  z,
int  t = 0,
int  u = 0 
) [slot]

Returns the DICOM tag specific for the given slice (by group and element ID).

MLPagedImageWrapper* MLABImageField::image (  )  [slot]

Get access to the extended ML image API (the returned object is either a MLPagedImageWrapper or NULL).

This method only returns an image if the underlying ML image is a valid image (in case of handleInput() redirection, this might also be a DummyImage, you can detect this with isGlobalDummyImage(). NOTE: The returned object is automatically set to NULL when the input image changes, thus you should not keep a reference to it in Python, instead ask this field for image() whenever you need access to the image.

bool MLABImageField::isValid (  )  [slot]

check if there is a valid image available

QVariantList MLABImageField::mapVoxelToWorld ( const QVariantList &  vector  )  [slot]

maps the vector from voxel to world coordinates of the current image

Parameters:
vector is set as an array with three double values
Returns:
is an array with three double values

QVariantList MLABImageField::mapWorldToVoxel ( const QVariantList &  vector  )  [slot]

maps the vector from world to voxel coordinates of the current image

Parameters:
vector is set as an array with three double values
result is an array with three double values
Scripting example:
      var vector = ctx.field("input0").size3D();
      var result = ctx.field("input0").mapVoxelToWorld(vector);
      var i;
      for (i = 0; i<3; i++)
        MLAB.log(i + ":" + result[i]);

double MLABImageField::maxValue (  )  [slot]

get max value of image (may not be the real min value of the data)

double MLABImageField::minValue (  )  [slot]

get min value of image (may not be the real min value of the data)

QObject* MLABImageField::object (  )  [inline, slot]

see image().

QVariantList MLABImageField::pageSize6D (  )  [slot]

get the page size

virtual void MLABImageField::setStringValue ( const QString &   )  [inline, virtual, slot]

reimp

Reimplemented from MLABField.

QVariantList MLABImageField::size3D (  )  [slot]

get size as array with 3 int values

Scripting example:

      var size = ctx.field("input0").size3D();
      MLAB.log("x " + size[0] + " y " + size[1] + " z " + size[2]);

QVariantList MLABImageField::size6D (  )  [slot]

get size as array with 6 int values

Scripting example:

      var size = ctx.field("input0").size6D();
      var i;
      for (i = 0; i<6; i++)
        MLAB.log(i + ":" + size[i]);

int MLABImageField::sizeC (  )  [slot]

get c size in voxels

int MLABImageField::sizeT (  )  [slot]

get t size in voxels

int MLABImageField::sizeU (  )  [slot]

get u size in voxels

int MLABImageField::sizeX (  )  [slot]

get x size in voxels

int MLABImageField::sizeY (  )  [slot]

get y size in voxels

int MLABImageField::sizeZ (  )  [slot]

get z size in voxels

virtual void MLABImageField::touch (  )  [virtual]

force a notify to all observers without changing value of field

Reimplemented from MLABField.

quint64 MLABImageField::usedMemImg (  )  [slot]

get used page/memimg memory

quint64 MLABImageField::usedPages (  )  [slot]

get used page/memimg memory

QVariantList MLABImageField::voxelSize (  )  [slot]

get voxel size as array with 3 double values

Scripting example:

      var vsize = ctx.field("input0").voxelSize();
      var i;
      for (i = 0; i<3; i++)
        MLAB.log(i + ":" + vsize[i]);

double MLABImageField::voxelSizeX (  )  [slot]

get x voxel size

double MLABImageField::voxelSizeY (  )  [slot]

get y voxel size

double MLABImageField::voxelSizeZ (  )  [slot]

get z voxel size

QVariantList MLABImageField::voxelToWorldMatrix (  )  [slot]

get the voxel to world matrix (as [][] array)

QVariantList MLABImageField::worldToVoxelMatrix (  )  [slot]

get the world to voxel matrix (as [][] array)


Generated on Sat Sep 3 18:38:02 2011 for MeVisLab Scripting Reference by  doxygen 1.5.8