Computer Assisted Medical Intervention Tool Kit version 6.0
 
Loading...
Searching...
No Matches
Slice.h
Go to the documentation of this file.
1/*****************************************************************************
2 * $CAMITK_LICENCE_BEGIN$
3 *
4 * CamiTK - Computer Assisted Medical Intervention ToolKit
5 * (c) 2001-2025 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#ifndef CANONICAL_SLICE_H
27#define CANONICAL_SLICE_H
28
29// -- Core stuff
30#include "CamiTKAPI.h"
31#include "InterfaceBitMap.h"
32
33// -- vtk stuff
34// disable warning generated by clang about the surrounded headers
35#include "CamiTKDisableWarnings"
36#include <vtkWindowLevelLookupTable.h>
37#include <vtkActor.h>
38#include <vtkImageActor.h>
39#include "CamiTKReEnableWarnings"
40
41#include <vtkImageData.h>
42#include <vtkTransform.h>
43#include <vtkUnstructuredGrid.h>
44#include <vtkImageReslice.h>
45
46namespace camitk {
125public:
156
160 Slice(vtkSmartPointer<vtkImageData> volume, SliceOrientation AXIAL_ORIENTATION, vtkSmartPointer<vtkWindowLevelLookupTable> lookupTable = nullptr);
161
163 ~Slice() override;
165
168
170 void setOriginalVolume(vtkSmartPointer<vtkImageData> img) override final;
171
173 vtkSmartPointer<vtkImageActor> get2DImageActor() const override;
174
176 vtkSmartPointer<vtkImageActor> get3DImageActor() const override;
177
179 vtkSmartPointer<vtkActor> getPickPlaneActor() const override;
180
182 vtkSmartPointer<vtkActor> getPixelActor() override;
183
187 void pixelPicked(double, double, double) override;
188
190 void updatePickPlane() override final;
191
193 int getNumberOfSlices() const override final;
194
196 int getSlice() const override;
197
202 void setSlice(int s) override final;
203
205 void setSlice(double x, double y, double z) override;
206
210 int getNumberOfColors() const override;
211
213 void setPixelRealPosition(double, double, double) override;
214
221 virtual void setArbitraryTransform(vtkSmartPointer<vtkTransform>) override;
222
224 vtkSmartPointer<vtkImageData> getImageData() const override;
225
226 // @}
227
237
239 vtkSmartPointer<vtkProp> getProp(const QString&) override;
240
242 unsigned int getNumberOfProp() const override;
243
245 vtkSmartPointer<vtkProp> getProp(unsigned int) override;
246
250 bool addProp(const QString&, vtkSmartPointer<vtkProp>) override;
251
255 bool removeProp(const QString&) override;
256
258
259
260protected:
261
264
266 void init();
267
269 void initActors();
270
275 void reslicedToVolumeCoords(const double* ijk, double* xyz);
276
280 void volumeToReslicedCoords(const double* xyz, double* ijk);
282
285
287 SliceOrientation sliceOrientation;
288
290 vtkSmartPointer<vtkImageData> originalVolume;
291
293 int currentSliceIndex;
294
296 vtkSmartPointer<vtkWindowLevelLookupTable> lut;
297
299 double originalSpacing[3];
300
302 double originalSize[3];
303
305 vtkSmartPointer<vtkImageActor> image3DActor;
306
308 vtkSmartPointer<vtkImageActor> image2DActor;
310
313
315 vtkSmartPointer<vtkImageReslice> image2DReslicer;
316
318
321
323 void initPickPlaneActor();
324
328 void initPixelActor();
329
340 void updatePixelActor(double x, double y, double z);
341
343 void updatePixelActor();
344
346 vtkSmartPointer<vtkActor> pickPlaneActor;
347
349 vtkSmartPointer<vtkUnstructuredGrid> pickPlaneActorPointSet;
350
352 vtkSmartPointer<vtkActor> pixelActor;
353
355 vtkSmartPointer<vtkUnstructuredGrid> pixelActorPointSet;
357
361
363 QMap<QString, vtkSmartPointer<vtkProp> > extraProp;
364
366};
367
368}
369
370#endif // CANONICAL_SLICE_H
371
#define CAMITK_API
Definition CamiTKAPI.h:66
This class describes what are the methods to implement for a BitMap.
Definition InterfaceBitMap.h:68
Display a slice (i.e.
Definition Slice.h:124
SliceOrientation
Common slices orientation: axial, sagittal, coronal axial_neuro.
Definition Slice.h:149
@ AXIAL
Definition Slice.h:150
@ AXIAL_NEURO
Definition Slice.h:153
@ CORONAL
Definition Slice.h:151
@ SAGITTAL
Definition Slice.h:152
Definition Action.cpp:40