|
Computer Assited Medical Intervention Tool Kit
version 5.0
|
|
Go to the documentation of this file.
26 #ifndef CANONICAL_SLICE_H
27 #define CANONICAL_SLICE_H
35 #include <CamiTKDisableWarnings>
36 #include <vtkWindowLevelLookupTable.h>
38 #include <vtkImageActor.h>
39 #include <CamiTKReEnableWarnings>
41 #include <vtkImageData.h>
42 #include <vtkTransform.h>
43 #include <vtkUnstructuredGrid.h>
44 #include <vtkImageReslice.h>
126 class CAMITK_API Slice :
public InterfaceBitMap {
151 enum SliceOrientation {
162 Slice(vtkSmartPointer<vtkImageData> volume, SliceOrientation AXIAL_ORIENTATION, vtkSmartPointer<vtkWindowLevelLookupTable> lookupTable =
nullptr);
172 void setOriginalVolume(vtkSmartPointer<vtkImageData> img)
override final;
177 void setImageWorldTransform(vtkSmartPointer<vtkTransform>)
override;
180 vtkSmartPointer<vtkImageActor> get2DImageActor()
const override;
183 vtkSmartPointer<vtkImageActor> get3DImageActor()
const override;
186 vtkSmartPointer<vtkActor> getPickPlaneActor()
const override;
189 vtkSmartPointer<vtkActor> getPixelActor()
override;
194 void pixelPicked(
double,
double,
double)
override;
197 void updatePickPlane() override final;
200 int getNumberOfSlices() const override final;
203 int getSlice() const override;
209 void setSlice(
int s) override final;
212 void setSlice(
double x,
double y,
double z) override;
217 int getNumberOfColors() const override;
220 void setPixelRealPosition(
double,
double,
double) override;
228 virtual
void setArbitraryTransform(vtkSmartPointer<vtkTransform>) override;
231 vtkSmartPointer<vtkImageData> getImageData() const override;
246 vtkSmartPointer<vtkProp> getProp(const QString&) override;
249 unsigned int getNumberOfProp() const override;
252 vtkSmartPointer<vtkProp> getProp(
unsigned int) override;
257 bool addProp(const QString&, vtkSmartPointer<vtkProp>) override;
282 void reslicedToVolumeCoords(const
double* ijk,
double* xyz);
287 void volumeToReslicedCoords(const
double* xyz,
double* ijk);
297 vtkSmartPointer<vtkImageData> originalVolume;
300 int currentSliceIndex;
303 vtkSmartPointer<vtkWindowLevelLookupTable> lut;
306 double originalSpacing[3];
309 double originalSize[3];
312 vtkSmartPointer<vtkImageActor> image3DActor;
315 vtkSmartPointer<vtkImageActor> image2DActor;
322 vtkSmartPointer<vtkImageReslice> image2DReslicer;
330 void initPickPlaneActor();
335 void initPixelActor();
347 void updatePixelActor(
double x,
double y,
double z);
350 void updatePixelActor();
353 vtkSmartPointer<vtkActor> pickPlaneActor;
356 vtkSmartPointer<vtkUnstructuredGrid> pickPlaneActorPointSet;
359 vtkSmartPointer<vtkActor> pixelActor;
362 vtkSmartPointer<vtkUnstructuredGrid> pixelActorPointSet;
370 QMap<QString, vtkSmartPointer<vtkProp> > extraProp;
377 #endif // CANONICAL_SLICE_H
int getNumberOfColors() const override
Return the number of colors in the images.
Definition: Slice.cpp:273
void reslicedToVolumeCoords(const double *ijk, double *xyz)
Compute the volume coordinates (xyz) from the resliced coordinates (ijk)
Definition: Slice.cpp:154
void setSlice(int s) override final
Set the current slice index.
Definition: Slice.cpp:200
int getSlice() const override
Return the index of the current displayed slice.
Definition: Slice.cpp:195
void pixelPicked(double, double, double) override
This method is called when the associated plane has been picked in the InteractiveViewer,...
Definition: Slice.cpp:149
vtkSmartPointer< vtkUnstructuredGrid > pixelActorPointSet
the pixel actor unstructured grid
Definition: Slice.h:408
void volumeToReslicedCoords(const double *xyz, double *ijk)
Compute the resliced coordinates (ijk) from the volume coordinates (xyz)
Definition: Slice.cpp:161
@ AXIAL
Definition: Slice.h:221
void init()
Initialize Attributes.
Definition: Slice.cpp:87
vtkSmartPointer< vtkActor > pixelActor
Actor representing a pixel, displayed over the image.
Definition: Slice.h:405
void setPixelRealPosition(double, double, double) override
move the pixel selection green indicator (pixelActor) to the given real position
Definition: Slice.cpp:278
vtkSmartPointer< vtkImageActor > get3DImageActor() const override
Return the vtkImageActor (vtkProp) representing a slice to be displayed in the 3D viewers.
Definition: Slice.cpp:290
~Slice() override
virtual destructor
Definition: Slice.cpp:81
bool addProp(const QString &, vtkSmartPointer< vtkProp >) override
insert an additional prop, defining it by its name (default visibility = false)
Definition: Slice.cpp:676
vtkSmartPointer< vtkActor > getPickPlaneActor() const override
Return the vtkActor visualizing the plane of the slices.
Definition: Slice.cpp:300
vtkSmartPointer< vtkActor > pickPlaneActor
Actor representing the pickPlane.
Definition: Slice.h:399
void initActors()
Initialize actors and everything they need.
Definition: Slice.cpp:305
vtkSmartPointer< vtkImageReslice > image2DReslicer
The image reslicer computes the arbitrary slice pixels.
Definition: Slice.h:368
SliceOrientation sliceOrientation
Direction of the reslice.
Definition: Slice.h:340
void initPickPlaneActor()
init the pick plane actor
Definition: Slice.cpp:348
double originalSpacing[3]
Voxel size of the original image volume.
Definition: Slice.h:352
virtual void setArbitraryTransform(vtkSmartPointer< vtkTransform >) override
Set the pointer to the arbitrary slice transformation.
Definition: Slice.cpp:143
vtkSmartPointer< vtkWindowLevelLookupTable > lut
Common lookup table.
Definition: Slice.h:349
vtkSmartPointer< vtkImageData > getImageData() const override
get the current image data
Definition: Slice.cpp:105
void updatePixelActor()
update the pixel actor to the middle of the current slice
Definition: Slice.cpp:580
int currentSliceIndex
Keep track of the slice number.
Definition: Slice.h:346
vtkSmartPointer< vtkUnstructuredGrid > pickPlaneActorPointSet
the pick plane actor unstructured grid
Definition: Slice.h:402
vtkSmartPointer< vtkTransform > transform
Definition: RendererWidget.cpp:372
@ CORONAL
Definition: Slice.h:222
int getNumberOfSlices() const override final
Return the number of slices in the image data set.
Definition: Slice.cpp:168
@ ARBITRARY
Definition: Slice.h:225
void updatePickPlane() override final
update the position of the plane surrounding the currently selected slice
Definition: Slice.cpp:506
vtkSmartPointer< vtkImageData > originalVolume
Smart pointer to the original volume to reslice (input of the vtk pipeline)
Definition: Slice.h:343
unsigned int getNumberOfProp() const override
return the number of additional prop
Definition: Slice.cpp:697
vtkSmartPointer< vtkProp > getProp(const QString &) override
Return the vtkProp (actors, volumes and annotations) corresponding to the given name.
Definition: Slice.cpp:687
void removeProp(vtkSmartPointer< vtkProp > p, bool refresh=false)
remove the given vtkProp (e.g.
vtkSmartPointer< vtkImageActor > get2DImageActor() const override
Return the vtkImageActor (vtkProp) representing a slice to be displayed in the 2D viewers.
Definition: Slice.cpp:285
@ SAGITTAL
Definition: Slice.h:223
void setImageWorldTransform(vtkSmartPointer< vtkTransform >) override
set the transformation for 3D image representation This is the transformation relative to the world.
Definition: Slice.cpp:137
void setOriginalVolume(vtkSmartPointer< vtkImageData > img) override final
set the original volume image data (the source vtkImageData before any reslice) and refresh the vtk p...
Definition: Slice.cpp:110
vtkSmartPointer< vtkActor > getPixelActor() override
Return the vtkActor visualizing the picked pixels in the slices.
Definition: Slice.cpp:295
@ AXIAL_NEURO
Definition: Slice.h:224
QMap< QString, vtkSmartPointer< vtkProp > > extraProp
The additional map for prop.
Definition: Slice.h:416
SliceOrientation
Common slices orientation: axial, sagittal, coronal axial_neuro.
Definition: Slice.h:197
vtkSmartPointer< vtkImageActor > image3DActor
3D actor
Definition: Slice.h:358
bool removeProp(const QString &) override
remove a given additional prop.
Definition: Slice.cpp:707
vtkSmartPointer< vtkImageActor > image2DActor
2D actor
Definition: Slice.h:361
void initPixelActor()
Init the pixel actor for pixel picking.
Definition: Slice.cpp:434
Slice(vtkSmartPointer< vtkImageData > volume, SliceOrientation AXIAL_ORIENTATION, vtkSmartPointer< vtkWindowLevelLookupTable > lookupTable=nullptr)
Definition: Slice.cpp:72
#define CAMITK_API
Definition: CamiTKAPI.h:49
Definition: Action.cpp:35
double originalSize[3]
Real size (originalDimension * originalSpacing in x, y and z) of the original image.
Definition: Slice.h:355