Computer Assited Medical Intervention Tool Kit  version 5.0
ReorientImage.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2021 Univ. Grenoble Alpes, CNRS, Grenoble INP, TIMC, 38000 Grenoble, France
6  *
7  * Visit http://camitk.imag.fr for more information
8  *
9  * This file is part of CamiTK.
10  *
11  * CamiTK is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * CamiTK is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License version 3 for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22  *
23  * $CAMITK_LICENCE_END$
24  ****************************************************************************/
25 
26 #ifndef REORIENTIMAGE_H
27 #define REORIENTIMAGE_H
28 
29 // Include Action.h to be able to inherit from Action
30 #include <Action.h>
31 // Include ui_ReorientImage.h to be able to declare an instance of Ui::ReorientImage
32 #include "ui_ReorientImage.h"
33 
35 
36 class vtkTransform;
37 class vtkAnnotatedCubeActor;
38 namespace camitk {
39 class Geometry;
40 class ImageComponent;
41 }
42 
43 class ReorientImage : public camitk::Action {
44  Q_OBJECT
45 
46 public:
49 
51  virtual ~ReorientImage();
52 
54  virtual QWidget* getWidget();
55 
56  void showApplyButton(bool show);
57 
58 public slots:
61 
62  virtual void rcsChanged(const QString index);
63 
64  virtual void modelChanged(bool displayMaleModel);
65 
66 private:
68  void initDialog();
69 
71  void buildGeometries();
72 
73  void buildAxes();
74  void buildCube();
75  void buildTransforms();
76 
77  void initInternalViewer();
78 
79  void setAxesOrientation(const QString orientation);
80 
82 
85 
87  Ui::ReorientImage ui;
88 
90  QFrame* dialog;
91 
93  vtkSmartPointer<vtkAxesActor> axes;
94 
96  vtkSmartPointer<vtkAnnotatedCubeActor> annotatedCube;
97 
98  vtkSmartPointer<vtkTransform> orientationTransform;
99  // The cube should not rotate, just translate...
100  vtkSmartPointer<vtkTransform> orientationCubeTransform;
101 
102  vtkSmartPointer<vtkTransform> cubeTransform;
103  vtkSmartPointer<vtkTransform> axesTransform;
104 
108 
109  QMap<QChar, QString> lettersMeaning;
110 
111 };
112 
113 #endif // REORIENTIMAGE_H
camitk::ImageOrientationHelper::RIP
@ RIP
X: Right to Left, Y: Inferior to Superiror, Z: Posterior to Anterior.
Definition: ImageOrientationHelper.h:59
camitk::ImageOrientationHelper::IRA
@ IRA
Definition: ImageOrientationHelper.h:73
IMeaning
static const QString IMeaning
Definition: ReorientImage.cpp:72
camitk::ImageComponent::replaceImageData
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
camitk::Action::setFamily
void setFamily(QString family)
the name of the family in which this action is associated
Definition: Action.cpp:136
camitk::Component::getTransform
const vtkSmartPointer< vtkTransform > getTransform() const override
Get the transformation with respect to the parent frame.
Definition: sdk/libraries/core/component/Component.cpp:824
ReorientImage::getWidget
virtual QWidget * getWidget()
this method creates and returns the widget containing the user interface for the action
Definition: ReorientImage.cpp:242
ReorientImage::modelBoundingBox
camitk::Geometry * modelBoundingBox
Definition: ReorientImage.h:105
CAMITK_WARNING
#define CAMITK_WARNING(MSG)
Log for warning verbosity (the most common one) Will appear by default.
Definition: Log.h:266
camitk::Component::setParentFrame
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
camitk::ImageOrientationHelper::PIL
@ PIL
Definition: ImageOrientationHelper.h:71
camitk::Geometry
A 3D representation of a vtkPointSet to be displayed in a InteractiveViewer, this class implements th...
Definition: Geometry.h:126
LMeaning
static const QString LMeaning
Definition: ReorientImage.cpp:69
camitk::ImageOrientationHelper::SPL
@ SPL
Definition: ImageOrientationHelper.h:80
InteractiveGeometryViewer.h
camitk::Action::SUCCESS
@ SUCCESS
everything went according to plan
Definition: Action.h:248
ReorientImage::rcsChanged
virtual void rcsChanged(const QString index)
Definition: ReorientImage.cpp:211
camitk::Action::ABORTED
@ ABORTED
the action was aborted before completion
Definition: Action.h:251
camitk::Action::ApplyStatus
ApplyStatus
Definition: Action.h:247
camitk::Action::setName
void setName(QString name)
Definition: Action.cpp:120
InteractiveGeometryViewer
Interactive 3D viewer.
Definition: InteractiveGeometryViewer.h:56
ReorientImage::apply
virtual camitk::Action::ApplyStatus apply()
method called when the action is applied
Definition: ReorientImage.cpp:253
camitk::Action::setComponent
void setComponent(QString component)
the name of the component class that can be used by this action
Definition: Action.cpp:131
camitk::ImageOrientationHelper::LPI
@ LPI
Definition: ImageOrientationHelper.h:63
ReorientImage::buildCube
void buildCube()
Definition: ReorientImage.cpp:410
camitk::ImageOrientationHelper::IAL
@ IAL
Definition: ImageOrientationHelper.h:75
camitk::ImageComponent
The manager of the Image Volume data. An image volume data has no concrete 3D representation,...
Definition: ImageComponent.h:77
camitk::Action::getTargets
const ComponentList getTargets() const
the currently selected and valid (regarding the component property) components, for which this action...
Definition: Action.cpp:166
camitk::InteractiveViewer::getRendererWidget
RendererWidget * getRendererWidget()
return interactiveViewer RendererWidget
Definition: InteractiveViewer.h:237
Action.h
camitk::ImageOrientationHelper::SRP
@ SRP
Definition: ImageOrientationHelper.h:77
camitk::InterfaceFrame::setFrameVisibility
virtual void setFrameVisibility(QString, bool)=0
Set the Component Frame visible for a given viewer.
camitk::ImageOrientationHelper::ILP
@ ILP
Definition: ImageOrientationHelper.h:74
ReorientImage::process
ApplyStatus process(camitk::ImageComponent *image)
Actually perform the image transformation.
Definition: ReorientImage.cpp:266
ReorientImage::femaleModel
camitk::Geometry * femaleModel
Definition: ReorientImage.h:107
ReorientImage::lettersMeaning
QMap< QChar, QString > lettersMeaning
Definition: ReorientImage.h:109
camitk::Viewer::setEmbedder
bool setEmbedder(QLayout *)
If the viewer type is EMBEDDED, embed the viewer widget in the given layout (do nothing if the type i...
Definition: Viewer.cpp:181
ReorientImage::cubeTransform
vtkSmartPointer< vtkTransform > cubeTransform
Definition: ReorientImage.h:102
ReorientImage::ReorientImage
ReorientImage(camitk::ActionExtension *)
the constructor
Definition: ReorientImage.cpp:76
camitk::Property
This class describes a property that can be used in components and actions or any class that needs to...
Definition: Property.h:303
ReorientImage::modelChanged
virtual void modelChanged(bool displayMaleModel)
Definition: ReorientImage.cpp:224
camitk::Action::addTag
void addTag(QString tag)
add a tag to the tags list of this action
Definition: Action.cpp:141
camitk::Geometry::getActor
vtkSmartPointer< vtkActor > getActor(const RenderingModes) override
Return the actor representing this representation mode (returns nullptr if hightlight mode is Hidden)...
Definition: Geometry.cpp:269
Log.h
ReorientImage::maleModel
camitk::Geometry * maleModel
Definition: ReorientImage.h:106
ReorientImage::axes
vtkSmartPointer< vtkAxesActor > axes
axes actor
Definition: ReorientImage.h:93
MeshComponent.h
camitk::ImageOrientationHelper::PSR
@ PSR
Definition: ImageOrientationHelper.h:72
camitk::Action
Action class is an abstract class that enables you to build a action (generally on a component)....
Definition: Action.h:231
ReorientImage::~ReorientImage
virtual ~ReorientImage()
Destructor.
Definition: ReorientImage.cpp:123
camitk::ImageOrientationHelper::ARS
@ ARS
Definition: ImageOrientationHelper.h:65
camitk::ImageOrientationHelper::RSA
@ RSA
etc.
Definition: ImageOrientationHelper.h:61
camitk::Geometry::setColor
void setColor(const double, const double, const double) override
Set an (r,g,b) color to all representation modes, without changing the opacity.
Definition: Geometry.cpp:590
Property.h
ReorientImage::initDialog
void initDialog()
initialize the dialog
Definition: ReorientImage.cpp:135
SMeaning
static const QString SMeaning
Definition: ReorientImage.cpp:73
camitk::axeYTextProp
vtkSmartPointer< vtkTextProperty > axeYTextProp
Definition: RendererWidget.cpp:340
camitk::ImageOrientationHelper::SLA
@ SLA
Definition: ImageOrientationHelper.h:78
camitk::InteractiveViewer::refresh
void refresh(Viewer *whoIsAsking=nullptr) override
Definition: InteractiveViewer.cpp:416
VtkMeshUtil::vtkToGeometry
static camitk::Geometry * vtkToGeometry(std::string vtkFileName)
Static method that could be used from anywhere to translate a vtk file to a Geometry instance.
Definition: VtkMeshUtil.cpp:50
camitk::acProp
vtkSmartPointer< vtkProperty > acProp
Definition: RendererWidget.cpp:377
ReorientImage
Definition: ReorientImage.h:43
camitk::ImageOrientationHelper::SAR
@ SAR
Definition: ImageOrientationHelper.h:79
camitk::Geometry::setRenderingModes
void setRenderingModes(const RenderingModes rMode) override
Set the actor associated to a rendering mode visible or not.
Definition: Geometry.h:249
VtkMeshUtil.h
camitk::Action::setDescription
void setDescription(QString description)
the description of the action
Definition: Action.cpp:126
camitk::ImageOrientationHelper::LAS
@ LAS
Definition: ImageOrientationHelper.h:62
camitk::axeZTextProp
vtkSmartPointer< vtkTextProperty > axeZTextProp
Definition: RendererWidget.cpp:347
camitk::ImageOrientationHelper::RPS
@ RPS
X: Right to Left, Y: Posterior to Anterior, Z: Superior to Inferior.
Definition: ImageOrientationHelper.h:57
ReorientImage::dialog
QFrame * dialog
the dialog
Definition: ReorientImage.h:90
camitk::transform
vtkSmartPointer< vtkTransform > transform
Definition: RendererWidget.cpp:372
ReorientImage::axesTransform
vtkSmartPointer< vtkTransform > axesTransform
Definition: ReorientImage.h:103
camitk::InterfaceFrame::getParentFrame
virtual InterfaceFrame * getParentFrame() const =0
Get the parent frame.
camitk::ImageOrientationHelper::RAI
@ RAI
Direct Orientations X: Right to Left, Y: Anterior to Posterior, Z: Inferior to Superiror.
Definition: ImageOrientationHelper.h:55
AMeaning
static const QString AMeaning
Definition: ReorientImage.cpp:70
ReorientImage.h
camitk::Action::addParameter
virtual bool addParameter(Property *)
Add a new parameter to the action, using the CamiTK property class.
Definition: Action.cpp:440
PMeaning
static const QString PMeaning
Definition: ReorientImage.cpp:71
camitk::ActionExtension
This class describes what is a generic Action extension. To add a ActionExtension to CamiTK core,...
Definition: ActionExtension.h:80
camitk::axeXTextProp
vtkSmartPointer< vtkTextProperty > axeXTextProp
Definition: RendererWidget.cpp:326
camitk::RIGHT_DOWN
@ RIGHT_DOWN
World axes are seen so that x points to the right, y points downward.
Definition: RendererWidget.h:131
camitk::ImageOrientationHelper::LIA
@ LIA
Definition: ImageOrientationHelper.h:64
camitk::ImageComponent::getImageData
vtkSmartPointer< vtkImageData > getImageData() const override
get the image volume managed by this Component
Definition: ImageComponent.h:123
ImageOrientationHelper.h
camitk::ImageOrientationHelper::IPR
@ IPR
Definition: ImageOrientationHelper.h:76
ReorientImage::orientationCubeTransform
vtkSmartPointer< vtkTransform > orientationCubeTransform
Definition: ReorientImage.h:100
ReorientImage::buildTransforms
void buildTransforms()
Definition: ReorientImage.cpp:489
ReorientImage::setAxesOrientation
void setAxesOrientation(const QString orientation)
Definition: ReorientImage.cpp:512
camitk::InteractiveViewer::setHighlightMode
virtual void setHighlightMode()
Set the current highlighting mode from the current value of the property.
Definition: InteractiveViewer.cpp:1915
ReorientImage::internalViewer
InteractiveGeometryViewer * internalViewer
Definition: ReorientImage.h:81
camitk::refresh
void refresh()
refresh the display
camitk::InterfaceFrame::setTransform
virtual void setTransform(vtkSmartPointer< vtkTransform > transform)=0
Set the current input frame position (according to its parent Frame)
Core.h
ReorientImage::orientationTransform
vtkSmartPointer< vtkTransform > orientationTransform
Definition: ReorientImage.h:98
ReorientImage::buildAxes
void buildAxes()
Definition: ReorientImage.cpp:372
RMeaning
static const QString RMeaning
Definition: ReorientImage.cpp:68
camitk::ImageOrientationHelper::AIR
@ AIR
Definition: ImageOrientationHelper.h:67
camitk::ImageOrientationHelper::ALI
@ ALI
Definition: ImageOrientationHelper.h:66
camitk::ImageOrientationHelper::PRI
@ PRI
Definition: ImageOrientationHelper.h:69
camitk::ImageOrientationHelper::PLS
@ PLS
Definition: ImageOrientationHelper.h:70
ReorientImage::showApplyButton
void showApplyButton(bool show)
Definition: ReorientImage.cpp:181
ReorientImage::initInternalViewer
void initInternalViewer()
Definition: ReorientImage.cpp:186
camitk::ImageOrientationHelper::PossibleImageOrientations
PossibleImageOrientations
For each axis (x, y or z), 6 possibilities:
Definition: ImageOrientationHelper.h:52
ImageComponent.h
ReorientImage::buildGeometries
void buildGeometries()
Build Geometries.
Definition: ReorientImage.cpp:455
ReorientImage::annotatedCube
vtkSmartPointer< vtkAnnotatedCubeActor > annotatedCube
annotated cube actor
Definition: ReorientImage.h:96
camitk
Definition: Action.cpp:35
ReorientImage::ui
Ui::ReorientImage ui
the Qt Gui
Definition: ReorientImage.h:87
camitk::ImageOrientationHelper::ASL
@ ASL
Definition: ImageOrientationHelper.h:68