Computer Assisted Medical Intervention Tool Kit  version 5.2
MeshProjection.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2024 Univ. Grenoble Alpes, CNRS, Grenoble INP - UGA, 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 
27 #ifndef MESHPROJECTION_H
28 #define MESHPROJECTION_H
29 
30 #include <Action.h>
31 
32 #include <MeshComponent.h>
33 #include <ImageComponent.h>
34 #include <Slice.h>
35 #include <InteractiveViewer.h>
36 
37 //--vtk
38 // disable warning generated by clang about the surrounded headers
39 #include <CamiTKDisableWarnings>
40 #include <vtkPolyDataMapper.h>
41 #include <CamiTKReEnableWarnings>
42 
43 #include <vtkPlane.h>
44 
54  Q_OBJECT
55 
56 public:
57 
60 
62  virtual ~MeshProjection();
63 
65  virtual bool event(QEvent* e);
66 
68  virtual QWidget* getWidget();
69 
70 public slots:
77 
79  void updateCuttingPlane();
80 
82  void hide();
83 
84 private:
86  camitk::MeshComponent* meshToProject;
87 
89  camitk::ImageComponent* targetImage;
90 
92  void updateComponents(camitk::MeshComponent*);
93 
94  // used to map item id with component for the "Component List" property
95  QList<camitk::ImageComponent*> imageComponentList;
96 
98  void updateVisibility();
99 
101  QMap<camitk::Slice::SliceOrientation, vtkSmartPointer<vtkPolyDataMapper>> cutterMapperMap;
102 
104  QMap<camitk::Slice::SliceOrientation, vtkSmartPointer<vtkActor>> contourActorMap;
105 
107  QMap<camitk::Slice::SliceOrientation, vtkSmartPointer<vtkActor>> contourActorIn2DViewerMap;
108 
110  QMap<camitk::Slice::SliceOrientation, vtkSmartPointer<vtkPlane>> cuttingPlaneMap;
111 
114  int getOrientationIndex(camitk::Slice::SliceOrientation);
115 
117  double getVoxelSize(camitk::Slice::SliceOrientation);
118 
121 
123  vtkSmartPointer<vtkActor> getNewActor(camitk::Slice::SliceOrientation);
124 
126  vtkSmartPointer<vtkPlane> getNewPlane(camitk::Slice::SliceOrientation);
127 
130 
132  void updateContourLineWidth();
133 };
134 
135 #endif // MESHPROJECTION_H
136 
Show the mesh contour in the slice viewers.
Definition: MeshProjection.h:53
void updateCuttingPlane()
this slots is called when the user changes the selected slice to update the contour
Definition: MeshProjection.cpp:488
virtual bool event(QEvent *e)
manage property modification immediatly
Definition: MeshProjection.cpp:152
void hide()
remove the contour from the viewers if the mesh is closed / destroyed
Definition: MeshProjection.cpp:499
virtual ~MeshProjection()
Default Destructor.
Definition: MeshProjection.cpp:103
virtual camitk::Action::ApplyStatus apply()
this method is automatically called when the action is triggered.
Definition: MeshProjection.cpp:146
MeshProjection(camitk::ActionExtension *)
Default Constructor.
Definition: MeshProjection.cpp:60
virtual QWidget * getWidget()
method called when the action when the action is triggered (i.e. started)
Definition: MeshProjection.cpp:108
This class describes what is a generic Action extension.
Definition: ActionExtension.h:57
Action class is an abstract class that enables you to build a action (generally on a component).
Definition: Action.h:209
ApplyStatus
describes what happened during the application of an algorithm (i.e. results of the apply method)
Definition: Action.h:225
The manager of the Image Volume data.
Definition: ImageComponent.h:77
InteractiveViewer is used to view 3D objects and slices (anything that provides either a InterfaceBit...
Definition: InteractiveViewer.h:112
Basic component to manage any kind of mesh.
Definition: MeshComponent.h:53
SliceOrientation
Common slices orientation: axial, sagittal, coronal axial_neuro.
Definition: Slice.h:151