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 {
123
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
288
290 vtkSmartPointer<vtkImageData> originalVolume;
291
294
296 vtkSmartPointer<vtkWindowLevelLookupTable> lut;
297
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
QMap< QString, vtkSmartPointer< vtkProp > > extraProp
The additional map for prop.
Definition Slice.h:363
double originalSpacing[3]
Voxel size of the original image volume.
Definition Slice.h:299
vtkSmartPointer< vtkUnstructuredGrid > pixelActorPointSet
the pixel actor unstructured grid
Definition Slice.h:355
double originalSize[3]
Real size (originalDimension * originalSpacing in x, y and z) of the original image.
Definition Slice.h:302
SliceOrientation sliceOrientation
Direction of the reslice.
Definition Slice.h:287
vtkSmartPointer< vtkActor > pixelActor
Actor representing a pixel, displayed over the image.
Definition Slice.h:352
void updatePixelActor(double x, double y, double z)
Update the pixel actor position according to the specified pixel picked by the user i....
Definition Slice.cpp:526
int currentSliceIndex
Keep track of the slice number.
Definition Slice.h:293
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
@ ARBITRARY
Definition Slice.h:154
vtkSmartPointer< vtkUnstructuredGrid > pickPlaneActorPointSet
the pick plane actor unstructured grid
Definition Slice.h:349
vtkSmartPointer< vtkWindowLevelLookupTable > lut
Common lookup table.
Definition Slice.h:296
void initPixelActor()
Init the pixel actor for pixel picking.
Definition Slice.cpp:414
vtkSmartPointer< vtkActor > pickPlaneActor
Actor representing the pickPlane.
Definition Slice.h:346
void initPickPlaneActor()
init the pick plane actor
Definition Slice.cpp:328
vtkSmartPointer< vtkImageActor > image3DActor
3D actor
Definition Slice.h:305
vtkSmartPointer< vtkImageData > originalVolume
Smart pointer to the original volume to reslice (input of the vtk pipeline).
Definition Slice.h:290
vtkSmartPointer< vtkImageActor > image2DActor
2D actor
Definition Slice.h:308
vtkSmartPointer< vtkImageReslice > image2DReslicer
The image reslicer computes the arbitrary slice pixels.
Definition Slice.h:315
Slice(vtkSmartPointer< vtkImageData > volume, SliceOrientation AXIAL_ORIENTATION, vtkSmartPointer< vtkWindowLevelLookupTable > lookupTable=nullptr)
Definition Slice.cpp:47
Definition Action.cpp:40