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>
42#include <vtkUnstructuredGrid.h>
51class QStandardItemModel;
56class SingleImageComponent;
57class ArbitrarySingleImageComponent;
111 void setSelected(
const bool b,
const bool recursive =
false)
override;
114 virtual void setVisibility(QString,
bool)
override;
118 return originalImageData;
130 return initialOrientation;
137 void pixelPicked(
double x,
double y,
double z)
override;
142 virtual vtkSmartPointer<vtkActor> get3DCursor()
override;
146 void getLastPixelPicked(
int* x,
int* y,
int* z);
150 void getLastPointPickedDataFrame(
double* x,
double* y,
double* z);
154 void getLastPointPickedWorldFrame(
double* x,
double* y,
double* z);
157 void setLastPointPickedFromPixel(
int x,
int y,
int z);
163 int getNumberOfColors()
const override;
166 double getMinColor()
const;
169 double getMaxColor()
const;
174 int getActualNumberOfColors()
const;
177 double getActualMinColor()
const;
180 double getActualMaxColor()
const;
183 int getNumberOfSlices()
const override;
186 virtual void setLut(vtkSmartPointer<vtkWindowLevelLookupTable> lookupTable);
189 virtual vtkSmartPointer<vtkWindowLevelLookupTable> getLut();
192 virtual const vtkSmartPointer<vtkWindowLevelLookupTable> getLut()
const;
196 void refresh()
override;
222 void propertyValueChanged(QString)
override;
225 unsigned int getNumberOfPropertyWidget()
override;
228 QWidget* getPropertyWidgetAt(
unsigned int i)
override;
232 return rotationMatrix;
241 virtual void setFramesAndTransformation(
const std::shared_ptr<FrameOfReference>& mainFrame,
const std::shared_ptr<FrameOfReference>& dataFrame,
const std::shared_ptr<Transformation>& mainTransformation);
245 return dataFrame.get();
254 virtual void setFrame(
const std::shared_ptr<FrameOfReference>& frame)
override;
264 virtual void resetFrame()
override;
268 return additionalFrames;
273 additionalFrames.push_back(fr);
278 std::erase_if(additionalFrames, [fr](
auto & f) {
279 return f.get() == fr;
285 return additionalTransformations;
290 additionalTransformations.push_back(tr);
295 std::erase_if(additionalTransformations, [tr](
auto t) {
296 return t.get() == tr;
303 virtual QMultiMap<const FrameOfReference*, Component*> getAllFrames(
bool includeChildrenFrames =
true)
override;
308 virtual QMultiMap<const Transformation*, Component*> getAllTransformations(
bool includeChildrenTransformations =
true)
override;
312 return mainTransformation.get();
316 virtual void updateMainTransformation(vtkSmartPointer<vtkMatrix4x4>);
325 virtual QVariant toVariant()
const override;
328 virtual void fromVariant(
const QVariant&)
override;
340 void setImageData(vtkSmartPointer<vtkImageData> anImageData,
343 vtkSmartPointer<vtkMatrix4x4> initialTransformMatrix =
nullptr);
358 bool setMainTransformation(
const std::shared_ptr<Transformation>& tr);
371 void initImageProperties();
374 void initRepresentation()
override {}
377 void initLookupTable();
386 void buildImageComponents();
389 void updateImageComponents();
396 void update3DViewer();
400 vtkSmartPointer<vtkPolyData> getBoundingBox();
403 vtkSmartPointer<vtkImageData> originalImageData;
406 SingleImageComponent* axialSlices;
409 SingleImageComponent* sagittalSlices;
412 SingleImageComponent* coronalSlices;
415 ArbitrarySingleImageComponent* arbitrarySlices;
419 MeshComponent* volumeRenderingChild;
422 vtkSmartPointer<vtkWindowLevelLookupTable> lut;
425 double currentPixelPicked[3];
428 vtkSmartPointer<vtkActor> cursorActor;
431 vtkSmartPointer<vtkUnstructuredGrid> cursorActorPointSet;
437 QTableView* selectionView;
440 QStandardItemModel* model;
443 ImageOrientationHelper::PossibleImageOrientations initialOrientation;
448 vtkSmartPointer<vtkTransform> initialImageDataTransform;
454 vtkSmartPointer<vtkTransform> initialFrameTransform;
458 vtkSmartPointer<vtkMatrix4x4> rotationMatrix;
461 std::shared_ptr<FrameOfReference> dataFrame =
nullptr;
462 std::shared_ptr<Transformation> mainTransformation =
nullptr;
463 std::vector<std::shared_ptr<FrameOfReference>> additionalFrames;
464 std::vector<std::shared_ptr<Transformation>> additionalTransformations;
#define CAMITK_API
Definition CamiTKAPI.h:66
This Component manages the specific case of arbitrary orientation of a sub-component of the image com...
Definition ArbitrarySingleImageComponent.h:89
A Component represents something that could be included in the explorer view, the interactive 3D view...
Definition sdk/libraries/core/component/Component.h:304
FrameOfReference is only a label for an abstract coordinate system.
Definition FrameOfReference.h:71
The manager of the Image Volume data.
Definition ImageComponent.h:76
virtual void removeAdditionalTransformation(const Transformation *tr)
Remove an additional Transformation from the Component.
Definition ImageComponent.h:294
vtkSmartPointer< vtkImageData > getImageDataWithFrameTransform()
Compute a copy of the original image data on which the frame transform has been applied.
const FrameOfReference * getDataFrame() const
get the data FrameOfReference (i.e., the vtkImageData frame)
Definition ImageComponent.h:244
virtual const std::vector< std::shared_ptr< Transformation > > & getAdditionalTransformations() const
get the additional Transformations
Definition ImageComponent.h:284
vtkSmartPointer< vtkImageData > getImageData() const override
get the image volume managed by this Component
Definition ImageComponent.h:117
const vtkSmartPointer< vtkMatrix4x4 > getRotationMatrix()
Definition ImageComponent.h:231
ImageOrientationHelper::PossibleImageOrientations getInitialOrientation() const
Get the initial image orientation.
Definition ImageComponent.h:129
virtual const std::vector< std::shared_ptr< FrameOfReference > > & getAdditionalFrames() const
get the other frames (neither data nor main)
Definition ImageComponent.h:267
virtual void addAdditionalFrame(const std::shared_ptr< FrameOfReference > &fr)
add an additional frame (neither data nor main)
Definition ImageComponent.h:272
virtual Transformation * getMainTransformation() const
Get main Transformation (data -> main)
Definition ImageComponent.h:311
virtual void removeAdditionalFrame(const FrameOfReference *fr)
remove an additional frame
Definition ImageComponent.h:277
virtual void addAdditionalTransformation(const std::shared_ptr< Transformation > tr)
add an additional Transformation
Definition ImageComponent.h:289
PossibleImageOrientations
For each axis (x, y or z), 6 possibilities:
Definition ImageOrientationHelper.h:52
This class describes the methods to implement in order to manage a Component position in space.
Definition InterfaceFrame.h:51
Basic component to manage any kind of mesh.
Definition MeshComponent.h:53
This Component manages sub-component of the image component seen as a single orientation only (axial ...
Definition SingleImageComponent.h:62