NorMIT-nav  22.09
An IGT application
cx::Image Class Reference

A volumetric data set. More...

#include <cxImage.h>

Inheritance diagram for cx::Image:
cx::Data cx::NavigatedVideoImage cx::UnsignedDerivedImage

Classes

struct  ShadingStruct
 

Signals

void vtkImageDataChanged (QString uid=QString())
 emitted when the vktimagedata are invalidated and must be retrieved anew. More...
 
void transferFunctionsChanged ()
 emitted when image transfer functions in 2D or 3D are changed. More...
 
void cropBoxChanged ()
 
- Signals inherited from cx::Data
void transformChanged ()
 emitted when transform is changed More...
 
void propertiesChanged ()
 emitted when one of the metadata properties (uid, name etc) changes More...
 
void clipPlanesChanged ()
 

Public Member Functions

ImagePtr copy ()
 
virtual ~Image ()
 
 Image (const QString &uid, const vtkImageDataPtr &data, const QString &name="")
 
virtual void intitializeFromParentImage (ImagePtr parentImage)
 
virtual void setVtkImageData (const vtkImageDataPtr &data, bool resetTransferFunctions=true)
 
virtual vtkImageDataPtr getBaseVtkImageData ()
 
virtual vtkImageDataPtr getGrayScaleVtkImageData ()
 as getBaseVtkImageData(), but constrained to 1 component if multicolor. More...
 
virtual vtkImageDataPtr get8bitGrayScaleVtkImageData ()
 Have never been used or tested. Create a test for it. More...
 
virtual ImagePtr getUnsigned (ImagePtr self)
 
virtual IMAGE_MODALITY getModality () const
 
virtual void setModality (const IMAGE_MODALITY &val)
 
virtual IMAGE_SUBTYPE getImageType () const
 
virtual void setImageType (const IMAGE_SUBTYPE &val)
 
virtual ImageTF3DPtr getTransferFunctions3D ()
 
virtual void setTransferFunctions3D (ImageTF3DPtr transferFuntion)
 
virtual ImageLUT2DPtr getLookupTable2D ()
 
virtual void setLookupTable2D (ImageLUT2DPtr imageLookupTable2D)
 
virtual void setInitialWindowLevel (double width, double level)
 
double getInitialWindowLevel () const
 
double getInitialWindowWidth () const
 
virtual DoubleBoundingBox3D boundingBox () const
 bounding box in image space More...
 
virtual Eigen::Array3d getSpacing () const
 
virtual vtkImageAccumulatePtr getHistogram ()
 
virtual int getMax ()
 
virtual int getMin ()
 
virtual int getRange ()
 For convenience: getMax() - getMin() More...
 
virtual int getMaxAlphaValue ()
 Max alpha value (probably 255) More...
 
virtual void setShadingOn (bool on)
 
virtual bool getShadingOn () const
 
virtual void setShadingAmbient (double ambient)
 Set shading ambient parmeter. More...
 
virtual void setShadingDiffuse (double diffuse)
 Set shading diffuse parmeter. More...
 
virtual void setShadingSpecular (double specular)
 Set shading specular parmeter. More...
 
virtual void setShadingSpecularPower (double specularPower)
 Set shading specular power parmeter. More...
 
virtual double getShadingAmbient ()
 Get shading ambient parmeter. More...
 
virtual double getShadingDiffuse ()
 Get shading diffuse parmeter. More...
 
virtual double getShadingSpecular ()
 Get shading specular parmeter. More...
 
virtual double getShadingSpecularPower ()
 Get shading specular power parmeter. More...
 
virtual Image::ShadingStruct getShading ()
 
virtual void setShading (Image::ShadingStruct shading)
 
void addXml (QDomNode &dataNode)
 adds xml information about the image and its variabels More...
 
virtual void parseXml (QDomNode &dataNode)
 Use a XML node to load data. More...
 
virtual bool load (QString path, FileManagerServicePtr filemanager)
 
virtual QString getType () const
 
virtual QIcon getIcon ()
 
virtual void setCropping (bool on)
 
virtual bool getCropping () const
 
virtual void setCroppingBox (const DoubleBoundingBox3D &bb_d)
 
virtual DoubleBoundingBox3D getCroppingBox () const
 
void mergevtkSettingsIntosscTransform ()
 
void resetTransferFunctions (bool _2D=true, bool _3D=true)
 Resets the transfer functions and creates new default values. More...
 
void moveThisAndChildrenToThread (QThread *thread)
 Move this and all children to thread. Use the thread is generated in a worker thread and the result is to be used in the main thread. More...
 
void setInterpolationType (int val)
 
int getInterpolationType () const
 
vtkImageDataPtr resample (long maxVoxels)
 
virtual void save (const QString &basePath, FileManagerServicePtr filemanager)
 
void startThresholdPreview (const Eigen::Vector2d &threshold)
 
void stopThresholdPreview ()
 
double getVTKMinValue ()
 
double getVTKMaxValue ()
 
bool is2D ()
 
- Public Member Functions inherited from cx::Data
 Data (const QString &uid, const QString &name="")
 
virtual ~Data ()
 
void setUid (const QString &uid)
 
void setName (const QString &name)
 
void setAcquisitionTime (QDateTime time)
 
void setSoftwareAcquisitionTime (QDateTime time)
 
void setOriginalAcquisitionTime (QDateTime time)
 
virtual RegistrationHistoryPtr get_rMd_History ()
 
LandmarksPtr getLandmarks ()
 
virtual QString getUid () const
 
virtual QString getName () const
 
virtual Transform3D get_rMd () const
 
virtual QDateTime getAcquisitionTime () const
 
virtual TimeInfo getAdvancedTimeInfo () const
 
virtual bool isEqual (DataPtr metric)
 
virtual QString getFilename () const
 
virtual void setFilename (QString val)
 
virtual QString getSpace ()
 
virtual QString getParentSpace ()
 
virtual std::vector< Vector3DgetPointCloud () const
 
virtual CoordinateSystem getCoordinateSystem ()
 
virtual void addPersistentClipPlane (vtkPlanePtr plane)
 
virtual std::vector< vtkPlanePtrgetAllClipPlanes ()
 
virtual void clearPersistentClipPlanes ()
 
virtual void setInteractiveClipPlane (vtkPlanePtr plane)
 set a plane that is not saved More...
 
void addInteractiveClipPlane (vtkPlanePtr plane)
 
void removeInteractiveClipPlane (vtkPlanePtr plane)
 

Static Public Member Functions

static ImagePtr create (const QString &uid, const QString &name)
 
static QString getTypeName ()
 
static vtkImageDataPtr createDummyImageData (int axisSize, int maxVoxelValue)
 Create a moc object of vtkImageData. More...
 

Protected Slots

virtual void transformChangedSlot ()
 
- Protected Slots inherited from cx::Data
virtual void transformChangedSlot ()
 

Protected Attributes

vtkImageDataPtr mBaseImageData
 image data in data space More...
 
vtkImageDataPtr mBaseGrayScaleImageData
 image data in data space More...
 
vtkImageAccumulatePtr mHistogramPtr
 Histogram. More...
 
ImagePtr mUnsigned
 version of this containing unsigned data. More...
 
ShadingStruct mShading
 
bool mUseCropping
 image should be cropped using mCroppingBox More...
 
DoubleBoundingBox3D mCroppingBox_d
 box defining the cropping size. More...
 
IMAGE_MODALITY mModality
 modality of the image, defined as DICOM tag (0008,0060), Section 3, C.7.3.1.1.1 More...
 
IMAGE_SUBTYPE mImageType
 type of the image, defined as DICOM tag (0008,0008) (mainly value 3, but might be a merge of value 4), Section 3, C.7.6.1.1.2 More...
 
double mMaxRGBIntensity
 
int mInterpolationType
 mirror the interpolationType in vtkVolumeProperty More...
 
- Protected Attributes inherited from cx::Data
QString mUid
 
QString mName
 
QString mFilename
 
TimeInfo mTimeInfo
 
LandmarksPtr mLandmarks
 
REGISTRATION_STATUS mRegistrationStatus
 
RegistrationHistoryPtr m_rMd_History
 
std::vector< vtkPlanePtrmPersistentClipPlanes
 
std::vector< vtkPlanePtrmInteractiveClipPlanes
 
vtkPlanePtr mInteractiveClipPlane
 

Detailed Description

A volumetric data set.

One volumetric data set, represented as a vtkImageData, along with auxiliary data.

Definition at line 45 of file cxImage.h.

Constructor & Destructor Documentation

◆ ~Image()

cx::Image::~Image ( )
virtual

Definition at line 102 of file cxImage.cpp.

◆ Image()

cx::Image::Image ( const QString &  uid,
const vtkImageDataPtr data,
const QString &  name = "" 
)

Definition at line 106 of file cxImage.cpp.

Member Function Documentation

◆ addXml()

void cx::Image::addXml ( QDomNode &  dataNode)
virtual

adds xml information about the image and its variabels

Parameters
dataNodeData node in the XML tree
Returns
The created subnode

Reimplemented from cx::Data.

Definition at line 503 of file cxImage.cpp.

◆ boundingBox()

DoubleBoundingBox3D cx::Image::boundingBox ( ) const
virtual

bounding box in image space

Implements cx::Data.

Reimplemented in cx::UnsignedDerivedImage.

Definition at line 340 of file cxImage.cpp.

◆ copy()

ImagePtr cx::Image::copy ( )

Definition at line 123 of file cxImage.cpp.

◆ create()

ImagePtr cx::Image::create ( const QString &  uid,
const QString &  name 
)
static

Definition at line 97 of file cxImage.cpp.

◆ createDummyImageData()

vtkImageDataPtr cx::Image::createDummyImageData ( int  axisSize,
int  maxVoxelValue 
)
static

Create a moc object of vtkImageData.

Definition at line 817 of file cxImage.cpp.

◆ cropBoxChanged

void cx::Image::cropBoxChanged ( )
signal

◆ get8bitGrayScaleVtkImageData()

vtkImageDataPtr cx::Image::get8bitGrayScaleVtkImageData ( )
virtual

Have never been used or tested. Create a test for it.

Definition at line 279 of file cxImage.cpp.

◆ getBaseVtkImageData()

vtkImageDataPtr cx::Image::getBaseVtkImageData ( )
virtual
Returns
the vtkimagedata in the data coordinate space

Definition at line 335 of file cxImage.cpp.

◆ getCropping()

bool cx::Image::getCropping ( ) const
virtual

Definition at line 735 of file cxImage.cpp.

◆ getCroppingBox()

DoubleBoundingBox3D cx::Image::getCroppingBox ( ) const
virtual

Definition at line 748 of file cxImage.cpp.

◆ getGrayScaleVtkImageData()

vtkImageDataPtr cx::Image::getGrayScaleVtkImageData ( )
virtual

as getBaseVtkImageData(), but constrained to 1 component if multicolor.

Definition at line 286 of file cxImage.cpp.

◆ getHistogram()

vtkImageAccumulatePtr cx::Image::getHistogram ( )
virtual
Returns
The histogram for the image

Definition at line 352 of file cxImage.cpp.

◆ getIcon()

virtual QIcon cx::Image::getIcon ( )
inlinevirtual

Reimplemented from cx::Data.

Definition at line 130 of file cxImage.h.

◆ getImageType()

IMAGE_SUBTYPE cx::Image::getImageType ( ) const
virtual

Reimplemented in cx::UnsignedDerivedImage.

Definition at line 806 of file cxImage.cpp.

◆ getInitialWindowLevel()

double cx::Image::getInitialWindowLevel ( ) const
inline

Definition at line 96 of file cxImage.h.

◆ getInitialWindowWidth()

double cx::Image::getInitialWindowWidth ( ) const
inline

Definition at line 97 of file cxImage.h.

◆ getInterpolationType()

int cx::Image::getInterpolationType ( ) const

Definition at line 865 of file cxImage.cpp.

◆ getLookupTable2D()

ImageLUT2DPtr cx::Image::getLookupTable2D ( )
virtual

Definition at line 316 of file cxImage.cpp.

◆ getMax()

int cx::Image::getMax ( )
virtual
Returns
Return highest used value in the image

Definition at line 394 of file cxImage.cpp.

◆ getMaxAlphaValue()

int cx::Image::getMaxAlphaValue ( )
virtual

Max alpha value (probably 255)

Definition at line 443 of file cxImage.cpp.

◆ getMin()

int cx::Image::getMin ( )
virtual
Returns
Return lowest used value in the image

Definition at line 429 of file cxImage.cpp.

◆ getModality()

IMAGE_MODALITY cx::Image::getModality ( ) const
virtual

Reimplemented in cx::UnsignedDerivedImage.

Definition at line 795 of file cxImage.cpp.

◆ getRange()

int cx::Image::getRange ( )
virtual

For convenience: getMax() - getMin()

Definition at line 438 of file cxImage.cpp.

◆ getShading()

Image::ShadingStruct cx::Image::getShading ( )
virtual

Definition at line 712 of file cxImage.cpp.

◆ getShadingAmbient()

double cx::Image::getShadingAmbient ( )
virtual

Get shading ambient parmeter.

Definition at line 692 of file cxImage.cpp.

◆ getShadingDiffuse()

double cx::Image::getShadingDiffuse ( )
virtual

Get shading diffuse parmeter.

Definition at line 697 of file cxImage.cpp.

◆ getShadingOn()

bool cx::Image::getShadingOn ( ) const
virtual

Definition at line 661 of file cxImage.cpp.

◆ getShadingSpecular()

double cx::Image::getShadingSpecular ( )
virtual

Get shading specular parmeter.

Definition at line 702 of file cxImage.cpp.

◆ getShadingSpecularPower()

double cx::Image::getShadingSpecularPower ( )
virtual

Get shading specular power parmeter.

Definition at line 707 of file cxImage.cpp.

◆ getSpacing()

Eigen::Array3d cx::Image::getSpacing ( ) const
virtual

Definition at line 347 of file cxImage.cpp.

◆ getTransferFunctions3D()

ImageTF3DPtr cx::Image::getTransferFunctions3D ( )
virtual

Definition at line 297 of file cxImage.cpp.

◆ getType()

virtual QString cx::Image::getType ( ) const
inlinevirtual

Reimplemented from cx::Data.

Reimplemented in cx::UnsignedDerivedImage.

Definition at line 122 of file cxImage.h.

◆ getTypeName()

static QString cx::Image::getTypeName ( )
inlinestatic

Definition at line 126 of file cxImage.h.

◆ getUnsigned()

ImagePtr cx::Image::getUnsigned ( ImagePtr  self)
virtual

Return a version of this, containing image data and transfer functions converted to unsigned. This is used for the 3D texture slicer that doesnt handle signed data.

Definition at line 171 of file cxImage.cpp.

◆ getVTKMaxValue()

double cx::Image::getVTKMaxValue ( )

Definition at line 473 of file cxImage.cpp.

◆ getVTKMinValue()

double cx::Image::getVTKMinValue ( )

Definition at line 448 of file cxImage.cpp.

◆ intitializeFromParentImage()

void cx::Image::intitializeFromParentImage ( ImagePtr  parentImage)
virtual

Initialize image with properties from parent image, but with separate vtkImageData and name.

Definition at line 151 of file cxImage.cpp.

◆ is2D()

bool cx::Image::is2D ( )

Definition at line 498 of file cxImage.cpp.

◆ load()

bool cx::Image::load ( QString  path,
FileManagerServicePtr  filemanager 
)
virtual

Implements cx::Data.

Definition at line 570 of file cxImage.cpp.

◆ mergevtkSettingsIntosscTransform()

void cx::Image::mergevtkSettingsIntosscTransform ( )

Do the following operations on mBaseVtkImageData:

  • Reset the origin to zero.
  • Reset the extent to have its lower-left corner in zero. The shift introduced by these two operations are inserted as a translation into the matrix rMd.

This operation is needed because Image dont support vtkImageData with a nonzero origin or nonzero extent. These must be removed during creation.

Use this method only when you, by using some vtk algorithm, have created a vtkImageData that in nonconform with the Image spec.

Definition at line 767 of file cxImage.cpp.

◆ moveThisAndChildrenToThread()

void cx::Image::moveThisAndChildrenToThread ( QThread *  thread)

Move this and all children to thread. Use the thread is generated in a worker thread and the result is to be used in the main thread.

Definition at line 259 of file cxImage.cpp.

◆ parseXml()

void cx::Image::parseXml ( QDomNode &  dataNode)
virtual

Use a XML node to load data.

Parameters
dataNodeA XML data representation of this object.

Reimplemented from cx::Data.

Definition at line 577 of file cxImage.cpp.

◆ resample()

vtkImageDataPtr cx::Image::resample ( long  maxVoxels)

Definition at line 872 of file cxImage.cpp.

◆ resetTransferFunctions()

void cx::Image::resetTransferFunctions ( bool  _2D = true,
bool  _3D = true 
)

Resets the transfer functions and creates new default values.

Definition at line 189 of file cxImage.cpp.

◆ save()

void cx::Image::save ( const QString &  basePath,
FileManagerServicePtr  filemanager 
)
virtual

Implements cx::Data.

Definition at line 920 of file cxImage.cpp.

◆ setCropping()

void cx::Image::setCropping ( bool  on)
virtual

Definition at line 724 of file cxImage.cpp.

◆ setCroppingBox()

void cx::Image::setCroppingBox ( const DoubleBoundingBox3D bb_d)
virtual

Definition at line 740 of file cxImage.cpp.

◆ setImageType()

void cx::Image::setImageType ( const IMAGE_SUBTYPE &  val)
virtual

Definition at line 811 of file cxImage.cpp.

◆ setInitialWindowLevel()

void cx::Image::setInitialWindowLevel ( double  width,
double  level 
)
virtual

Definition at line 649 of file cxImage.cpp.

◆ setInterpolationType()

void cx::Image::setInterpolationType ( int  val)

Definition at line 856 of file cxImage.cpp.

◆ setLookupTable2D()

void cx::Image::setLookupTable2D ( ImageLUT2DPtr  imageLookupTable2D)
virtual

Definition at line 330 of file cxImage.cpp.

◆ setModality()

void cx::Image::setModality ( const IMAGE_MODALITY &  val)
virtual

Definition at line 800 of file cxImage.cpp.

◆ setShading()

void cx::Image::setShading ( Image::ShadingStruct  shading)
virtual

Definition at line 717 of file cxImage.cpp.

◆ setShadingAmbient()

void cx::Image::setShadingAmbient ( double  ambient)
virtual

Set shading ambient parmeter.

Definition at line 668 of file cxImage.cpp.

◆ setShadingDiffuse()

void cx::Image::setShadingDiffuse ( double  diffuse)
virtual

Set shading diffuse parmeter.

Definition at line 674 of file cxImage.cpp.

◆ setShadingOn()

void cx::Image::setShadingOn ( bool  on)
virtual

Definition at line 655 of file cxImage.cpp.

◆ setShadingSpecular()

void cx::Image::setShadingSpecular ( double  specular)
virtual

Set shading specular parmeter.

Definition at line 680 of file cxImage.cpp.

◆ setShadingSpecularPower()

void cx::Image::setShadingSpecularPower ( double  specularPower)
virtual

Set shading specular power parmeter.

Definition at line 686 of file cxImage.cpp.

◆ setTransferFunctions3D()

void cx::Image::setTransferFunctions3D ( ImageTF3DPtr  transferFuntion)
virtual

Definition at line 311 of file cxImage.cpp.

◆ setVtkImageData()

void cx::Image::setVtkImageData ( const vtkImageDataPtr data,
bool  resetTransferFunctions = true 
)
virtual

Definition at line 268 of file cxImage.cpp.

◆ startThresholdPreview()

void cx::Image::startThresholdPreview ( const Eigen::Vector2d &  threshold)

Definition at line 929 of file cxImage.cpp.

◆ stopThresholdPreview()

void cx::Image::stopThresholdPreview ( )

Definition at line 983 of file cxImage.cpp.

◆ transferFunctionsChanged

void cx::Image::transferFunctionsChanged ( )
signal

emitted when image transfer functions in 2D or 3D are changed.

◆ transformChangedSlot

void cx::Image::transformChangedSlot ( )
protectedvirtualslot

Definition at line 255 of file cxImage.cpp.

◆ vtkImageDataChanged

void cx::Image::vtkImageDataChanged ( QString  uid = QString())
signal

emitted when the vktimagedata are invalidated and must be retrieved anew.

Member Data Documentation

◆ mBaseGrayScaleImageData

vtkImageDataPtr cx::Image::mBaseGrayScaleImageData
protected

image data in data space

Definition at line 171 of file cxImage.h.

◆ mBaseImageData

vtkImageDataPtr cx::Image::mBaseImageData
protected

image data in data space

Definition at line 170 of file cxImage.h.

◆ mCroppingBox_d

DoubleBoundingBox3D cx::Image::mCroppingBox_d
protected

box defining the cropping size.

Definition at line 183 of file cxImage.h.

◆ mHistogramPtr

vtkImageAccumulatePtr cx::Image::mHistogramPtr
protected

Histogram.

Definition at line 175 of file cxImage.h.

◆ mImageType

IMAGE_SUBTYPE cx::Image::mImageType
protected

type of the image, defined as DICOM tag (0008,0008) (mainly value 3, but might be a merge of value 4), Section 3, C.7.6.1.1.2

Definition at line 186 of file cxImage.h.

◆ mInterpolationType

int cx::Image::mInterpolationType
protected

mirror the interpolationType in vtkVolumeProperty

Definition at line 188 of file cxImage.h.

◆ mMaxRGBIntensity

double cx::Image::mMaxRGBIntensity
protected

Definition at line 187 of file cxImage.h.

◆ mModality

IMAGE_MODALITY cx::Image::mModality
protected

modality of the image, defined as DICOM tag (0008,0060), Section 3, C.7.3.1.1.1

Definition at line 185 of file cxImage.h.

◆ mShading

ShadingStruct cx::Image::mShading
protected

Definition at line 180 of file cxImage.h.

◆ mUnsigned

ImagePtr cx::Image::mUnsigned
protected

version of this containing unsigned data.

Definition at line 176 of file cxImage.h.

◆ mUseCropping

bool cx::Image::mUseCropping
protected

image should be cropped using mCroppingBox

Definition at line 182 of file cxImage.h.


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