 |
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;
97 void setSelected(
const bool b,
const bool recursive =
false)
override;
100 QString getImageName()
const;
101 void setImageName(
const QString&);
105 return originalImageData;
113 vtkSmartPointer<vtkImageData> getImageDataWithFrameTransform();
117 return initialOrientation;
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();
197 void updateProperty(QString, QVariant)
override;
202 unsigned int getNumberOfPropertyWidget()
override;
205 QWidget* getPropertyWidgetAt(
unsigned int i)
override;
209 return rotationMatrix;
222 virtual void setImageData(vtkSmartPointer<vtkImageData> anImageData,
225 vtkSmartPointer<vtkMatrix4x4> initialTransformMatrix =
nullptr);
249 virtual void initImageProperties();
255 void initLookupTable();
258 void buildImageComponents();
261 void updateImageComponents();
268 void update3DViewer();
272 vtkSmartPointer<vtkPolyData> getBoundingBox();
294 vtkSmartPointer<vtkWindowLevelLookupTable>
lut;
297 double currentPixelPicked[3];
329 #endif //IMAGE_COMPONENT_H
SingleImageComponent * getCoronalSlices()
Returns the coronal slice.
Definition: ImageComponent.cpp:474
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:429
setRenderingModes
Definition: sdk/libraries/core/component/Component.h:632
const vtkSmartPointer< vtkTransform > getTransform() const override
Get the transformation with respect to the parent frame.
Definition: sdk/libraries/core/component/Component.cpp:666
virtual void initImageProperties()
Update the Properties displayed in the PropertyExplorer It should be called by setImageData to update...
Definition: ImageComponent.cpp:180
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:638
void initLookupTable()
Definition: ImageComponent.cpp:403
vtkSmartPointer< vtkMatrix4x4 > rotationMatrix
The rotation matrix, that might have been altered by the user Will be saved in header file informatio...
Definition: ImageComponent.h:324
SingleImageComponent * coronalSlices
the coronal slices representation (all intelligence is delegated to a Slice class instance)
Definition: ImageComponent.h:284
ComponentList childrenComponent
The explorer sub items.
Definition: sdk/libraries/core/component/Component.h:776
setOriginalVolume
Definition: sdk/libraries/core/component/Component.h:677
void initRepresentation()
the concrete building of the 3D objects (Slice/Geometry): none in this case!
Definition: ImageComponent.h:252
double getActualMaxColor() const
Max gray level found in the image given its data type.
Definition: ImageComponent.cpp:734
virtual void refresh() const
refresh all the viewer that are currently displaying this Component
Definition: sdk/libraries/core/component/Component.cpp:299
void removeChild(InterfaceNode *) override
remove from the the sub item vector.
Definition: sdk/libraries/core/component/Component.cpp:583
double getMaxColor() const
Max possible gray level of the image given its data type.
Definition: ImageComponent.cpp:717
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:778
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:664
double getActualMinColor() const
Min gray level found in the image given its data type.
Definition: ImageComponent.cpp:729
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:704
SingleImageComponent * axialSlices
the axial slices representation (all intelligence is delegated to a Slice class instance)
Definition: ImageComponent.h:278
static InteractiveViewer * get3DViewer()
get the 3D viewer default InteractiveViewer (provided for convenience, equivalent to getViewer("3DVie...
Definition: InteractiveViewer.cpp:182
ImageOrientationHelper::PossibleImageOrientations getInitialOrientation() const
Get the initial image orientation.
Definition: ImageComponent.h:116
ImageOrientationHelper::PossibleImageOrientations initialOrientation
Initial image orientation.
Definition: ImageComponent.h:309
vtkSmartPointer< vtkImageData > getImageDataWithFrameTransform()
Compute a copy of the original image data on which the frame transform has been applied.
Definition: ImageComponent.cpp:343
@ AXIAL
Definition: Slice.h:179
The manager of the Image Volume data. An image volume data has no concrete 3D representation,...
Definition: ImageComponent.h:73
void updateImageComponents()
update the image components vtkImageData of all the available SingleImageComponent
Definition: ImageComponent.cpp:644
QString getImageName() const
getter/setter for the property
Definition: ImageComponent.cpp:527
virtual void setLut(vtkSmartPointer< vtkWindowLevelLookupTable > lookupTable)
Update the lookup table of the image viewer (see InterfaceBitMap).
Definition: ImageComponent.cpp:744
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:462
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:768
vtkSmartPointer< vtkWindowLevelLookupTable > lut
the current lookup table
Definition: ImageComponent.h:294
virtual void setSingleImageComponents(SingleImageComponent *axialSlices, SingleImageComponent *sagittalSlices, SingleImageComponent *coronalSlices, SingleImageComponent *arbitrarySlices)
Set all single images.
Definition: ImageComponent.cpp:489
~ImageComponent() override
Destructor.
Definition: ImageComponent.cpp:108
void setViewSliceIn3D(bool viewSliceIn3D)
set the visibility in 3D and refresh the 3D viewers
Definition: SingleImageComponent.cpp:104
SingleImageComponent * getAxialSlices()
Returns the axial slice.
Definition: ImageComponent.cpp:469
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:843
This class describes a property that can be used in components and actions or any class that needs to...
Definition: Property.h:314
This Component manages a set of images, destined to be seen in a single orientation only (axial OR sa...
Definition: SingleImageComponent.h:56
virtual vtkSmartPointer< vtkWindowLevelLookupTable > getLut()
get the current lookup table
Definition: ImageComponent.cpp:749
QTableView * selectionView
Tab displaying data selected point in the property explorer.
Definition: ImageComponent.h:303
void updateProperty(QString, QVariant) override
Definition: ImageComponent.cpp:223
virtual void setVisibility(Viewer *, bool)
set the visibility for a viewer
Definition: sdk/libraries/core/component/Component.cpp:276
virtual void setSelected(const bool b, const bool recursive=true)
Update the selection flag.
Definition: sdk/libraries/core/component/Component.cpp:558
const vtkSmartPointer< vtkMatrix4x4 > getRotationMatrix()
Definition: ImageComponent.h:208
QString getName() const override
get the name to be displayed
Definition: sdk/libraries/core/component/Component.h:849
SingleImageComponent * getSagittalSlices()
Returns the sagittal slice.
Definition: ImageComponent.cpp:479
ImageComponent(const QString &file)
constructor This method may throw an AbortException if a problem occurs.
Definition: ImageComponent.cpp:96
const vtkSmartPointer< vtkTransform > getTransformFromWorld() const override
Transforms accessors / Modifyers.
Definition: sdk/libraries/core/component/Component.cpp:657
@ CORONAL
Definition: Slice.h:180
@ 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:804
double getMinColor() const
Min possible gray level of the image given its data type.
Definition: ImageComponent.cpp:712
vtkSmartPointer< vtkImageData > vtkSmartPointer< vtkImageActor > vtkSmartPointer< vtkActor > updatePickPlane setSlice
Definition: sdk/libraries/core/component/Component.h:695
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:754
double currentPixelPicked[3]
Store the last pixel selected, in original slices ref.
Definition: ImageComponent.h:297
const ComponentList & getChildren() override
get the list of the InterfaceNode children (sub items in the hierarchy)
Definition: sdk/libraries/core/component/Component.h:844
vtkSmartPointer< vtkImageData > getImageData() const
get the image volume managed by this Component
Definition: ImageComponent.h:104
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:281
@ SAGITTAL
Definition: Slice.h:181
void refresh() const override
force refresh of all interactive viewers that are displayng sub-components as ImageComponent is not i...
Definition: ImageComponent.cpp:797
void singleImageSelected(const bool)
new method used to call the Component set selected
Definition: SingleImageComponent.cpp:94
SingleImageComponent * arbitrarySlices
the arbitrary slices representation (all intelligence is delegated to a Slice class instance)
Definition: ImageComponent.h:287
void update3DViewer()
Update visibility in the 3D viewer.
Definition: ImageComponent.cpp:532
@ Wireframe
the wireframe is visible
Definition: InterfaceGeometry.h:68
void setReadOnly(bool)
set this property as read-only
Definition: Property.cpp:83
unsigned int getNumberOfPropertyWidget() override
return number of tabs in property explorer: there is more than one widget
Definition: ImageComponent.cpp:838
MeshComponent * getVolumeRenderingChild()
Returns the MeshComponent which will contain the volume rendering actor.
Definition: ImageComponent.cpp:516
SingleImageComponent * getArbitrarySlices()
Returns the arbitrary slice.
Definition: ImageComponent.cpp:484
void setName(const QString &) override
set the name to be displayed
Definition: sdk/libraries/core/component/Component.h:874
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:210
void refresh()
refresh the display
vtkSmartPointer< vtkImageData > originalImageData
the core Image Volume that is managed here
Definition: ImageComponent.h:275
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:244
MeshComponent * volumeRenderingChild
When an action computes volume rendering for an image, it stores the corresponding actor as a prop of...
Definition: ImageComponent.h:291
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:785
int getActualNumberOfColors() const
Actual Number of colors: difference betweent the maximun and the minimum gray levels found in the ima...
Definition: ImageComponent.cpp:723
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:308
virtual void init()
initialize pointers to NULL and other attributes
Definition: ImageComponent.cpp:121
bool addProperty(Property *) override
Add a new CamiTK property to the component.
Definition: sdk/libraries/core/component/Component.cpp:221
int getNumberOfSlices() const override
Number of axial slices (i.e.
Definition: ImageComponent.cpp:739
vtkSmartPointer< vtkTransform > initialImageDataTransform
The initial transform to the vtkImageData.
Definition: ImageComponent.h:314
void buildImageComponents()
build the SingleImageComponent (one for each image plane);
Definition: ImageComponent.cpp:582
vtkSmartPointer< vtkTransform > initialFrameTransform
The initial frame of the image at opening.
Definition: ImageComponent.h:320
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:306
void setImageName(const QString &)
Definition: ImageComponent.cpp:521
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:298
#define CAMITK_API
Definition: CamiTKAPI.h:49
Definition: Action.cpp:36
virtual InterfaceFrame * getFrame()
get the associated frame
Definition: sdk/libraries/core/component/Component.h:859