|
Computer Assited Medical Intervention Tool Kit
version 5.0
|
|
Go to the documentation of this file.
26 #ifndef IMAGE_COMPONENT_H
27 #define IMAGE_COMPONENT_H
31 #include "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;
56 class SingleImageComponent;
57 class ArbitrarySingleImageComponent;
101 void setSelected(
const bool b,
const bool recursive =
false)
override;
111 CAMITK_API_DEPRECATED(
"Please use setVisibility(QString viewerName, bool) instead")
virtual void setVisibility(
Viewer*,
bool)
override;
116 virtual void setVisibility(QString,
bool)
override;
119 QString getImageName()
const;
120 void setImageName(
const QString&);
124 return originalImageData;
132 vtkSmartPointer<vtkImageData> getImageDataWithFrameTransform();
136 return initialOrientation;
143 void pixelPicked(
double x,
double y,
double z)
override;
147 void getLastPixelPicked(
int* x,
int* y,
int* z);
151 void getLastPointPickedImageCoords(
double* x,
double* y,
double* z);
155 void getLastPointPickedWorldCoords(
double* x,
double* y,
double* z);
162 int getNumberOfColors()
const override;
165 double getMinColor()
const;
168 double getMaxColor()
const;
173 int getActualNumberOfColors()
const;
176 double getActualMinColor()
const;
179 double getActualMaxColor()
const;
182 int getNumberOfSlices()
const override;
185 virtual void setLut(vtkSmartPointer<vtkWindowLevelLookupTable> lookupTable);
188 virtual vtkSmartPointer<vtkWindowLevelLookupTable> getLut();
216 void updateProperty(QString, QVariant)
override;
221 unsigned int getNumberOfPropertyWidget()
override;
224 QWidget* getPropertyWidgetAt(
unsigned int i)
override;
228 return rotationMatrix;
241 void setImageData(vtkSmartPointer<vtkImageData> anImageData,
244 vtkSmartPointer<vtkMatrix4x4> initialTransformMatrix =
nullptr);
268 void initImageProperties();
274 void initLookupTable();
277 void buildImageComponents();
280 void updateImageComponents();
287 void update3DViewer();
291 vtkSmartPointer<vtkPolyData> getBoundingBox();
313 vtkSmartPointer<vtkWindowLevelLookupTable>
lut;
316 double currentPixelPicked[3];
348 #endif //IMAGE_COMPONENT_H
ArbitrarySingleImageComponent * arbitrarySlices
the arbitrary slices representation (all intelligence is delegated to a Slice class instance)
Definition: ImageComponent.h:306
void pixelPicked(double x, double y, double z) override
Method called when a pixel has been picked in the 3D view.
Definition: ImageComponent.cpp:657
SingleImageComponent * getCoronalSlices()
Returns the coronal slice.
Definition: ImageComponent.cpp:477
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:436
setRenderingModes
Definition: sdk/libraries/core/component/Component.h:671
const vtkSmartPointer< vtkTransform > getTransform() const override
Get the transformation with respect to the parent frame.
Definition: sdk/libraries/core/component/Component.cpp:824
#define CAMITK_WARNING(MSG)
Log for warning verbosity (the most common one) Will appear by default.
Definition: Log.h:266
void initImageProperties()
Update the Properties displayed in the PropertyExplorer It should be called by setImageData to update...
Definition: ImageComponent.cpp:187
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:792
void initLookupTable()
Definition: ImageComponent.cpp:412
vtkSmartPointer< vtkMatrix4x4 > rotationMatrix
The rotation matrix, that might have been altered by the user Will be saved in header file informatio...
Definition: ImageComponent.h:343
SingleImageComponent * coronalSlices
the coronal slices representation (all intelligence is delegated to a Slice class instance)
Definition: ImageComponent.h:303
ComponentList childrenComponent
The explorer sub items.
Definition: sdk/libraries/core/component/Component.h:836
setOriginalVolume
Definition: sdk/libraries/core/component/Component.h:724
if(${CMAKE_VERSION} VERSION_GREATER "3.3" OR ${CMAKE_VERSION} VERSION_EQUAL "3.3") option(CAMITK_INCLUDE_WHAT_YOU_USE "Enable the header analysis on you code
double getActualMaxColor() const
Max gray level found in the image given its data type.
Definition: ImageComponent.cpp:727
setActorColor
Definition: sdk/libraries/core/component/Component.h:690
void removeChild(InterfaceNode *) override
remove a child node.
Definition: sdk/libraries/core/component/Component.cpp:550
double getMaxColor() const
Max possible gray level of the image given its data type.
Definition: ImageComponent.cpp:710
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:783
void setIndexOfPropertyExplorerTab(unsigned int index) override final
Set the index of the tab in the ProperlyExplorer to select for display.
Definition: sdk/libraries/core/component/Component.h:492
double getActualMinColor() const
Min gray level found in the image given its data type.
Definition: ImageComponent.cpp:722
This Component manages the specific case of arbitrary orientation of a sub-component of the image com...
Definition: ArbitrarySingleImageComponent.h:88
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:697
SingleImageComponent * axialSlices
the axial slices representation (all intelligence is delegated to a Slice class instance)
Definition: ImageComponent.h:297
ImageOrientationHelper::PossibleImageOrientations getInitialOrientation() const
Get the initial image orientation.
Definition: ImageComponent.h:135
ImageOrientationHelper::PossibleImageOrientations initialOrientation
Initial image orientation.
Definition: ImageComponent.h:328
vtkSmartPointer< vtkImageData > getImageDataWithFrameTransform()
Compute a copy of the original image data on which the frame transform has been applied.
Definition: ImageComponent.cpp:352
@ AXIAL
Definition: Slice.h:221
The manager of the Image Volume data. An image volume data has no concrete 3D representation,...
Definition: ImageComponent.h:77
void updateImageComponents()
update the image components vtkImageData of all the available SingleImageComponent
Definition: ImageComponent.cpp:637
void setSingleImageComponents(SingleImageComponent *axialSlices, SingleImageComponent *sagittalSlices, SingleImageComponent *coronalSlices, ArbitrarySingleImageComponent *arbitrarySlices)
Set all single images.
Definition: ImageComponent.cpp:492
QString getImageName() const
getter/setter for the property
Definition: ImageComponent.cpp:530
virtual void setLut(vtkSmartPointer< vtkWindowLevelLookupTable > lookupTable)
Update the lookup table of the image viewer (see InterfaceBitMap).
Definition: ImageComponent.cpp:737
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:773
vtkSmartPointer< vtkWindowLevelLookupTable > lut
the current lookup table
Definition: ImageComponent.h:313
~ImageComponent() override
Destructor.
Definition: ImageComponent.cpp:114
SingleImageComponent * getAxialSlices()
Returns the axial slice.
Definition: ImageComponent.cpp:472
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:847
This class describes a property that can be used in components and actions or any class that needs to...
Definition: Property.h:303
This Component manages sub-component of the image component seen as a single orientation only (axial ...
Definition: SingleImageComponent.h:61
virtual vtkSmartPointer< vtkWindowLevelLookupTable > getLut()
get the current lookup table
Definition: ImageComponent.cpp:742
QString getName() const
get the name of the viewer
Definition: Viewer.h:200
QTableView * selectionView
Tab displaying data selected point in the property explorer.
Definition: ImageComponent.h:322
void updateProperty(QString, QVariant) override
Definition: ImageComponent.cpp:231
virtual void setSelected(const bool b, const bool recursive=true)
Update the selection flag.
Definition: sdk/libraries/core/component/Component.cpp:445
const vtkSmartPointer< vtkMatrix4x4 > getRotationMatrix()
Definition: ImageComponent.h:227
void initRepresentation() override
the concrete building of the 3D objects (Slice/Geometry): none in this case!
Definition: ImageComponent.h:271
QString getName() const override
get the name to be displayed
Definition: sdk/libraries/core/component/Component.h:907
SingleImageComponent * getSagittalSlices()
Returns the sagittal slice.
Definition: ImageComponent.cpp:482
ImageComponent(const QString &file)
constructor This method may throw an AbortException if a problem occurs.
Definition: ImageComponent.cpp:102
const vtkSmartPointer< vtkTransform > getTransformFromWorld() const override
Transforms accessors / Modifyers.
Definition: sdk/libraries/core/component/Component.cpp:814
@ CORONAL
Definition: Slice.h:222
@ RAI
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:808
void refresh() override
force refresh of all interactive viewers that are displaying sub-components as ImageComponent is not ...
Definition: ImageComponent.cpp:801
double getMinColor() const
Min possible gray level of the image given its data type.
Definition: ImageComponent.cpp:705
virtual void setVisibility(QString, bool)
set the visibility inside the viewer of the given name (the viewer needs to be a registered viewer)
Definition: sdk/libraries/core/component/Component.cpp:224
vtkSmartPointer< vtkImageData > vtkSmartPointer< vtkImageActor > vtkSmartPointer< vtkActor > updatePickPlane setSlice
Definition: sdk/libraries/core/component/Component.h:740
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:747
double currentPixelPicked[3]
Store the last pixel selected, in original slices ref.
Definition: ImageComponent.h:316
const ComponentList & getChildren() override
get the list of the InterfaceNode children (sub items in the hierarchy)
Definition: sdk/libraries/core/component/Component.h:902
A component is something that composed something and could also be a part of something.
Definition: modeling/libraries/pml/Component.h:48
SingleImageComponent * sagittalSlices
the sagittal slices representation (all intelligence is delegated to a Slice class instance)
Definition: ImageComponent.h:300
Viewer is an abstract class that is the base class for all viewers.
Definition: Viewer.h:180
vtkSmartPointer< vtkImageData > getImageData() const override
get the image volume managed by this Component
Definition: ImageComponent.h:123
@ SAGITTAL
Definition: Slice.h:223
virtual void singleImageSelected(const bool)
new method used to call the Component set selected
Definition: SingleImageComponent.cpp:92
void update3DViewer()
Update visibility in the 3D viewer.
Definition: ImageComponent.cpp:561
@ Wireframe
the wireframe is visible
Definition: InterfaceGeometry.h:68
void setReadOnly(bool)
set this property as read-only
Definition: Property.cpp:82
unsigned int getNumberOfPropertyWidget() override
return number of tabs in property explorer: there is more than one widget
Definition: ImageComponent.cpp:842
MeshComponent * getVolumeRenderingChild()
Returns the MeshComponent which will contain the volume rendering actor.
Definition: ImageComponent.cpp:519
void setName(const QString &) override
set the name to be displayed
Definition: sdk/libraries/core/component/Component.h:932
Basic component to manage any kind of mesh.
Definition: MeshComponent.h:53
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:506
void refresh()
refresh the display
vtkSmartPointer< vtkImageData > originalImageData
the core Image Volume that is managed here
Definition: ImageComponent.h:294
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:251
MeshComponent * volumeRenderingChild
When an action computes volume rendering for an image, it stores the corresponding actor as a prop of...
Definition: ImageComponent.h:310
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:790
ArbitrarySingleImageComponent * getArbitrarySlices()
Returns the arbitrary slice.
Definition: ImageComponent.cpp:487
int getActualNumberOfColors() const
Actual Number of colors: difference betweent the maximun and the minimum gray levels found in the ima...
Definition: ImageComponent.cpp:716
virtual void refresh()
refresh all the viewer that are currently displaying this Component At the end the InterfaceNode modi...
Definition: sdk/libraries/core/component/Component.cpp:286
void init()
initialize pointers to NULL and other attributes
Definition: ImageComponent.cpp:128
bool addProperty(Property *) override
Add a new CamiTK property to the component.
Definition: sdk/libraries/core/component/Component.cpp:517
int getNumberOfSlices() const override
Number of axial slices (i.e.
Definition: ImageComponent.cpp:732
vtkSmartPointer< vtkTransform > initialImageDataTransform
The initial transform to the vtkImageData.
Definition: ImageComponent.h:333
void buildImageComponents()
build the SingleImageComponent (one for each image plane);
Definition: ImageComponent.cpp:580
vtkSmartPointer< vtkTransform > initialFrameTransform
The initial frame of the image at opening.
Definition: ImageComponent.h:339
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:325
vtkSmartPointer< vtkImageData > vtkSmartPointer< vtkImageActor > vtkSmartPointer< vtkActor > updatePickPlane double double vtkSmartPointer< vtkTransform > int getNumberOfSlices() const override
see Component.cpp
Definition: sdk/libraries/core/component/Component.cpp:739
void setImageName(const QString &)
Definition: ImageComponent.cpp:524
#define CAMITK_API_DEPRECATED(X)
Definition: CamiTKAPI.h:94
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
virtual void setVisibility(QString, bool) override
set the visibility inside the viewer of the given name (override required to manage the specific case...
Definition: ImageComponent.cpp:535
A Component represents something that could be included in the explorer view, the interactive 3D view...
Definition: sdk/libraries/core/component/Component.h:302
#define CAMITK_API
Definition: CamiTKAPI.h:49
Definition: Action.cpp:35
InterfaceFrame * getFrame()
get the associated frame
Definition: sdk/libraries/core/component/Component.h:917