 |
Computer Assited Medical Intervention Tool Kit
version 4.1
|
Go to the documentation of this file.
26 #ifndef IMAGE_COMPONENT_H
27 #define IMAGE_COMPONENT_H
35 #include <vtkPolyData.h>
36 #include <vtkSmartPointer.h>
37 #include <vtkImageData.h>
38 #include <vtkTransform.h>
39 #include <vtkImageFlip.h>
40 #include <vtkWindowLevelLookupTable.h>
41 #include <vtkMatrix4x4.h>
49 class QStandardItemModel;
79 ImageComponent(
const QString& file);
94 ~ImageComponent()
override;
97 void setSelected(
const bool b,
const bool recursive =
false)
override;
100 QString getImageName()
const;
101 void setImageName(
const QString&);
104 vtkSmartPointer<vtkImageData> getImageData()
const {
105 return originalImageData;
113 vtkSmartPointer<vtkImageData> getImageDataWithFrameTransform();
117 return initialOrientation;
124 void pixelPicked(
double x,
double y,
double z, SingleImageComponent* whoIsAsking);
128 void getLastPixelPicked(
int* x,
int* y,
int* z);
132 void getLastPointPickedImageCoords(
double* x,
double* y,
double* z);
136 void getLastPointPickedWorldCoords(
double* x,
double* y,
double* z);
143 int getNumberOfColors()
const override;
146 double getMinColor()
const;
149 double getMaxColor()
const;
154 int getActualNumberOfColors()
const;
157 double getActualMinColor()
const;
160 double getActualMaxColor()
const;
163 int getNumberOfSlices()
const override;
166 virtual void setLut(vtkSmartPointer<vtkWindowLevelLookupTable> lookupTable);
169 virtual vtkSmartPointer<vtkWindowLevelLookupTable> getLut();
176 SingleImageComponent* getAxialSlices();
178 SingleImageComponent* getCoronalSlices();
180 SingleImageComponent* getSagittalSlices();
182 SingleImageComponent* getArbitrarySlices();
184 MeshComponent* getVolumeRenderingChild();
197 void updateProperty(QString, QVariant)
override;
202 unsigned int getNumberOfPropertyWidget()
override;
205 QWidget* getPropertyWidgetAt(
unsigned int i)
override;
208 const vtkSmartPointer<vtkMatrix4x4> getRotationMatrix() {
209 return rotationMatrix;
222 virtual void setImageData(vtkSmartPointer<vtkImageData> anImageData,
225 vtkSmartPointer<vtkMatrix4x4> initialTransformMatrix =
nullptr);
249 virtual void initImageProperties();
252 void initRepresentation() {}
255 void initLookupTable();
258 void buildImageComponents();
261 void updateImageComponents();
268 void update3DViewer();
272 vtkSmartPointer<vtkPolyData> getBoundingBox();
275 vtkSmartPointer<vtkImageData> originalImageData;
278 SingleImageComponent* axialSlices;
281 SingleImageComponent* sagittalSlices;
284 SingleImageComponent* coronalSlices;
287 SingleImageComponent* arbitrarySlices;
291 MeshComponent* volumeRenderingChild;
294 vtkSmartPointer<vtkWindowLevelLookupTable> lut;
297 double currentPixelPicked[3];
303 QTableView* selectionView;
306 QStandardItemModel* model;
314 vtkSmartPointer<vtkTransform> initialImageDataTransform;
320 vtkSmartPointer<vtkTransform> initialFrameTransform;
324 vtkSmartPointer<vtkMatrix4x4> rotationMatrix;
329 #endif //IMAGE_COMPONENT_H
SingleImageComponent * getCoronalSlices()
Returns the coronal slice.
Definition: ImageComponent.cpp:473
virtual void replaceImageData(vtkSmartPointer< vtkImageData > anImageData, bool copy=false, ImageOrientationHelper::PossibleImageOrientations initialOrientation=ImageOrientationHelper::RAI)
Replaces the current image volume by the one given in parameters.
Definition: ImageComponent.cpp:428
setRenderingModes
Definition: sdk/libraries/core/component/Component.h:631
const vtkSmartPointer< vtkTransform > getTransform() const override
Get the transformation with respect to the parent frame.
Definition: sdk/libraries/core/component/Component.cpp:665
virtual void initImageProperties()
Update the Properties displayed in the PropertyExplorer It should be called by setImageData to update...
Definition: ImageComponent.cpp:179
void setParentFrame(InterfaceFrame *frame, bool keepTransform=true) override
Set the parent frame and update or not its transform during the parent transition.
Definition: sdk/libraries/core/component/Component.cpp:637
void initLookupTable()
Definition: ImageComponent.cpp:402
vtkSmartPointer< vtkMatrix4x4 > rotationMatrix
The rotation matrix, that might have been altered by the user Will be saved in header file informatio...
Definition: ImageComponent.h:323
SingleImageComponent * coronalSlices
the coronal slices representation (all intelligence is delegated to a Slice class instance)
Definition: ImageComponent.h:283
ComponentList childrenComponent
The explorer sub items.
Definition: sdk/libraries/core/component/Component.h:775
setOriginalVolume
Definition: sdk/libraries/core/component/Component.h:676
double getActualMaxColor() const
Max gray level found in the image given its data type.
Definition: ImageComponent.cpp:733
virtual void refresh() const
refresh all the viewer that are currently displaying this Component
Definition: sdk/libraries/core/component/Component.cpp:298
void removeChild(InterfaceNode *) override
remove from the the sub item vector.
Definition: sdk/libraries/core/component/Component.cpp:582
double getMaxColor() const
Max possible gray level of the image given its data type.
Definition: ImageComponent.cpp:716
void getLastPointPickedImageCoords(double *x, double *y, double *z)
Get the last point picked using CTRL + LEFT/RIGHT CLICK in image real coordinates (this takes into ac...
Definition: ImageComponent.cpp:777
void pixelPicked(double x, double y, double z, SingleImageComponent *whoIsAsking)
Method called when a pixel has been picked in the 3D view.
Definition: ImageComponent.cpp:663
double getActualMinColor() const
Min gray level found in the image given its data type.
Definition: ImageComponent.cpp:728
int getNumberOfColors() const override
Number of colors: number of possible gray levels in the image computed from the min and the max of th...
Definition: ImageComponent.cpp:703
SingleImageComponent * axialSlices
the axial slices representation (all intelligence is delegated to a Slice class instance)
Definition: ImageComponent.h:277
static InteractiveViewer * get3DViewer()
get the 3D viewer default InteractiveViewer (provided for convenience, equivalent to getViewer("3DVie...
Definition: InteractiveViewer.cpp:181
ImageOrientationHelper::PossibleImageOrientations initialOrientation
Initial image orientation.
Definition: ImageComponent.h:308
vtkSmartPointer< vtkImageData > getImageDataWithFrameTransform()
Compute a copy of the original image data on which the frame transform has been applied.
Definition: ImageComponent.cpp:342
void updateImageComponents()
update the image components vtkImageData of all the available SingleImageComponent
Definition: ImageComponent.cpp:643
QString getImageName() const
getter/setter for the property
Definition: ImageComponent.cpp:526
virtual void setLut(vtkSmartPointer< vtkWindowLevelLookupTable > lookupTable)
Update the lookup table of the image viewer (see InterfaceBitMap).
Definition: ImageComponent.cpp:743
void setIndexOfPropertyExplorerTab(unsigned int index)
Set the index of the tab in the ProperlyExplorer to select for display.
Definition: sdk/libraries/core/component/Component.h:461
void getLastPixelPicked(int *x, int *y, int *z)
Get the last pixel picked using CTRL + LEFT/RIGHT CLICK in voxel index (i, j, k) indicates the voxel ...
Definition: ImageComponent.cpp:767
vtkSmartPointer< vtkWindowLevelLookupTable > lut
the current lookup table
Definition: ImageComponent.h:293
virtual void setSingleImageComponents(SingleImageComponent *axialSlices, SingleImageComponent *sagittalSlices, SingleImageComponent *coronalSlices, SingleImageComponent *arbitrarySlices)
Set all single images.
Definition: ImageComponent.cpp:488
~ImageComponent() override
Destructor.
Definition: ImageComponent.cpp:107
void setViewSliceIn3D(bool viewSliceIn3D)
set the visibility in 3D and refresh the 3D viewers
Definition: SingleImageComponent.cpp:102
SingleImageComponent * getAxialSlices()
Returns the axial slice.
Definition: ImageComponent.cpp:468
QWidget * getPropertyWidgetAt(unsigned int i) override
get the property widget (to view as tabs in the property explorer): the default property widget and t...
Definition: ImageComponent.cpp:842
This class describes a property that can be used in components and actions or any class that needs to...
Definition: Property.h:312
This Component manages a set of images, destined to be seen in a single orientation only (axial OR sa...
Definition: SingleImageComponent.h:55
virtual vtkSmartPointer< vtkWindowLevelLookupTable > getLut()
get the current lookup table
Definition: ImageComponent.cpp:748
QTableView * selectionView
Tab displaying data selected point in the property explorer.
Definition: ImageComponent.h:302
void updateProperty(QString, QVariant) override
Definition: ImageComponent.cpp:222
virtual void setVisibility(Viewer *, bool)
set the visibility for a viewer
Definition: sdk/libraries/core/component/Component.cpp:275
virtual void setSelected(const bool b, const bool recursive=true)
Update the selection flag.
Definition: sdk/libraries/core/component/Component.cpp:557
QString getName() const override
get the name to be displayed
Definition: sdk/libraries/core/component/Component.h:848
SingleImageComponent * getSagittalSlices()
Returns the sagittal slice.
Definition: ImageComponent.cpp:478
ImageComponent(const QString &file)
constructor This method may throw an AbortException if a problem occurs.
Definition: ImageComponent.cpp:95
const vtkSmartPointer< vtkTransform > getTransformFromWorld() const override
Transforms accessors / Modifyers.
Definition: sdk/libraries/core/component/Component.cpp:656
Direct Orientations X: Right to Left, Y: Anterior to Posterior, Z: Inferior to Superiror.
Definition: ImageOrientationHelper.h:55
vtkSmartPointer< vtkPolyData > getBoundingBox()
internal method used to put a mesh in volumeRenderingChild and accessoiry display the bounding box
Definition: ImageComponent.cpp:803
double getMinColor() const
Min possible gray level of the image given its data type.
Definition: ImageComponent.cpp:711
vtkSmartPointer< vtkImageData > vtkSmartPointer< vtkImageActor > vtkSmartPointer< vtkActor > updatePickPlane setSlice
Definition: sdk/libraries/core/component/Component.h:694
void setSelected(const bool b, const bool recursive=false) override
set selected will select all the Image components (axial, sagittal and coronal).
Definition: ImageComponent.cpp:753
double currentPixelPicked[3]
Store the last pixel selected, in original slices ref.
Definition: ImageComponent.h:296
const ComponentList & getChildren() override
get the list of the InterfaceNode children (sub items in the hierarchy)
Definition: sdk/libraries/core/component/Component.h:843
A component is something that composed something and could also be a part of something.
Definition: modeling/libraries/pml/Component.h:47
SingleImageComponent * sagittalSlices
the sagittal slices representation (all intelligence is delegated to a Slice class instance)
Definition: ImageComponent.h:280
void refresh() const override
force refresh of all interactive viewers that are displayng sub-components as ImageComponent is not i...
Definition: ImageComponent.cpp:796
void singleImageSelected(const bool)
new method used to call the Component set selected
Definition: SingleImageComponent.cpp:92
SingleImageComponent * arbitrarySlices
the arbitrary slices representation (all intelligence is delegated to a Slice class instance)
Definition: ImageComponent.h:286
void update3DViewer()
Update visibility in the 3D viewer.
Definition: ImageComponent.cpp:531
the wireframe is visible
Definition: InterfaceGeometry.h:67
void setReadOnly(bool)
set this property as read-only
Definition: Property.cpp:81
unsigned int getNumberOfPropertyWidget() override
return number of tabs in property explorer: there is more than one widget
Definition: ImageComponent.cpp:837
MeshComponent * getVolumeRenderingChild()
Returns the MeshComponent which will contain the volume rendering actor.
Definition: ImageComponent.cpp:515
SingleImageComponent * getArbitrarySlices()
Returns the arbitrary slice.
Definition: ImageComponent.cpp:483
void setName(const QString &) override
set the name to be displayed
Definition: sdk/libraries/core/component/Component.h:873
Basic component to manage any kind of mesh.
Definition: MeshComponent.h:52
void updateProperty(QString name, QVariant value) override
update property: if you this method, do not forget to call the superclass method for the property not...
Definition: sdk/libraries/core/component/Component.cpp:209
void refresh()
refresh the display
vtkSmartPointer< vtkImageData > originalImageData
the core Image Volume that is managed here
Definition: ImageComponent.h:274
virtual void setImageData(vtkSmartPointer< vtkImageData > anImageData, bool copy, ImageOrientationHelper::PossibleImageOrientations initialOrientation=ImageOrientationHelper::RAI, vtkSmartPointer< vtkMatrix4x4 > initialTransformMatrix=nullptr)
Set the image data of the volumic images with the given orientation options.
Definition: ImageComponent.cpp:243
MeshComponent * volumeRenderingChild
When an action computes volume rendering for an image, it stores the corresponding actor as a prop of...
Definition: ImageComponent.h:290
virtual void setTransform(vtkSmartPointer< vtkTransform > transform)=0
Set the current input frame position (according to its parent Frame)
void getLastPointPickedWorldCoords(double *x, double *y, double *z)
Get Get the last point picked using CTRL + LEFT/RIGHT CLICK in world coordinates This takes into acco...
Definition: ImageComponent.cpp:784
int getActualNumberOfColors() const
Actual Number of colors: difference betweent the maximun and the minimum gray levels found in the ima...
Definition: ImageComponent.cpp:722
virtual void refreshInterfaceNode()
Asks all viewers that are currently displaying this Component to rebuild the representation of the In...
Definition: sdk/libraries/core/component/Component.cpp:307
virtual void init()
initialize pointers to NULL and other attributes
Definition: ImageComponent.cpp:120
bool addProperty(Property *) override
Add a new CamiTK property to the component.
Definition: sdk/libraries/core/component/Component.cpp:220
int getNumberOfSlices() const override
Number of axial slices (i.e.
Definition: ImageComponent.cpp:738
vtkSmartPointer< vtkTransform > initialImageDataTransform
The initial transform to the vtkImageData.
Definition: ImageComponent.h:313
void buildImageComponents()
build the SingleImageComponent (one for each image plane);
Definition: ImageComponent.cpp:581
vtkSmartPointer< vtkTransform > initialFrameTransform
The initial frame of the image at opening.
Definition: ImageComponent.h:319
static QString getOrientationAsQString(PossibleImageOrientations orientation)
Returns the Possible Medical Image orientation in QString format from a PossibleImageOrientation enum...
Definition: ImageOrientationHelper.cpp:61
PossibleImageOrientations
For each axis (x, y or z), 6 possibilities:
Definition: ImageOrientationHelper.h:52
QStandardItemModel * model
Model to display data.
Definition: ImageComponent.h:305
void setImageName(const QString &)
Definition: ImageComponent.cpp:520
static vtkSmartPointer< vtkMatrix4x4 > getTransformToRAI(PossibleImageOrientations orientation, double dimX, double dimY, double dimZ)
Given a possible Dicom Image Orientation, this method returns the transform matrix to express the ima...
Definition: ImageOrientationHelper.cpp:216
A Component represents something that could be included in the explorer view, the interactive 3D view...
Definition: sdk/libraries/core/component/Component.h:297
#define CAMITK_API
Definition: CamiTKAPI.h:48
Definition: Action.cpp:36
virtual InterfaceFrame * getFrame()
get the associated frame
Definition: sdk/libraries/core/component/Component.h:858