Computer Assited Medical Intervention Tool Kit
version 4.1
|
Display a slice (i.e. More...
#include <Slice.h>
Inherits camitk::InterfaceBitMap.
Protected Member Functions | |
Protected utility methods | |
virtual void | init () |
Initialize Attributes. More... | |
virtual void | initActors () |
Initialize actors and everything they need. More... | |
Protected Attributes | |
Attributes / Members of the class | |
SliceOrientation | sliceOrientation |
Direction of the reslice. More... | |
vtkSmartPointer< vtkImageData > | originalVolume |
Smart pointer to the original volume to reslice (input of the vtk pipeline) More... | |
int | extent [6] |
Table containing first and last indices of the image in each direction 0 & 1 -> x; 2 and 3 -> y; 4 & 5 -> z. More... | |
int | currentSliceIndex |
Keep track of the slice number. More... | |
vtkSmartPointer< vtkWindowLevelLookupTable > | lut |
Common lookup table. More... | |
int | originalDimensions [3] |
Original volume dimensions in number of voxels (x, y and z) More... | |
double | originalSpacing [3] |
Voxel size of the original image volume. More... | |
double | originalSize [3] |
Real size (originalDimension * originalSpacing in x, y and z) of the original image. More... | |
vtkSmartPointer< vtkImageMapToColors > | imgToMapFilter |
To be able to extract a slice. More... | |
vtkSmartPointer< vtkImageActor > | image3DActor |
3D actor More... | |
vtkSmartPointer< vtkImageActor > | image2DActor |
2D actor More... | |
Constructors / Destructors | |
enum | SliceOrientation { AXIAL, CORONAL, SAGITTAL, AXIAL_NEURO, ARBITRARY } |
Common slices orientation: axial, sagittal, coronal axial_neuro. More... | |
Slice (vtkSmartPointer< vtkImageData > volume, SliceOrientation AXIAL_ORIENTATION, vtkSmartPointer< vtkWindowLevelLookupTable > lookupTable=nullptr) | |
Constructor. More... | |
~Slice () override | |
virtual destructor More... | |
InterfaceBitMap implementation | |
QMap< QString, vtkSmartPointer< vtkProp > > | extraProp |
The additional map for prop (include at least "label" and "glyph") More... | |
void | setOriginalVolume (vtkSmartPointer< vtkImageData > img) override |
set the original volume image data (the source vtkImageData before any reslice) and refresh the vtk pipeline More... | |
void | setImageWorldTransform (vtkSmartPointer< vtkTransform >) override |
set the transformation for 3D image representation More... | |
vtkSmartPointer< vtkImageActor > | get2DImageActor () const override |
Return the vtkImageActor (vtkProp) representing a slice to be displayed in the 2D viewers. More... | |
vtkSmartPointer< vtkImageActor > | get3DImageActor () const override |
Return the vtkImageActor (vtkProp) representing a slice to be displayed in the 3D viewers. More... | |
vtkSmartPointer< vtkActor > | getPickPlaneActor () const override |
Return the vtkActor used to pick pixels in the slices. More... | |
vtkSmartPointer< vtkActor > | getPixelActor () override |
Return the vtkActor used to pick pixels in the slices. More... | |
virtual vtkSmartPointer< vtkAxesActor > | get2DAxesActor () |
Return 2D Axes at the proper slice origin. More... | |
void | pixelPicked (double, double, double) override |
This method is called when the associated plane has been picked in the InteractiveViewer, the given coordinates is position where the plane was picked. More... | |
void | reslicedToVolumeCoords (const double *ijk, double *xyz) |
Compute the volume coordinates (xyz) from the resliced coordinates (ijk) More... | |
void | volumeToReslicedCoords (const double *xyz, double *ijk) |
Todo, idem... More... | |
void | updatePickPlane () override |
int | getNumberOfSlices () const override |
Return the number of slices in the image data set. More... | |
int | getSlice () const override |
Return the index of the current displayed slice. More... | |
void | setSlice (int s) override |
Set the current slice index. More... | |
void | setSlice (double x, double y, double z) override |
Set the slice corresponding to the given real image (RAI) coordinates. More... | |
int | getNumberOfColors () const override |
Return the number of colors in the images. More... | |
void | setPixelRealPosition (double, double, double) override |
move the pixel selection green indicator (pixelActor) to the given real position More... | |
vtkSmartPointer< vtkImageData > | getImageData () const override |
get the current image data More... | |
vtkSmartPointer< vtkProp > | getProp (const QString &) override |
Return the vtkProp (actors, volumes and annotations) corresponding to the given name. More... | |
unsigned int | getNumberOfProp () const override |
return the number of additional prop More... | |
vtkSmartPointer< vtkProp > | getProp (unsigned int) override |
return an additional prop by its index More... | |
bool | addProp (const QString &, vtkSmartPointer< vtkProp >) override |
insert an additional prop, defining it by its name (default visibility = false) More... | |
bool | removeProp (const QString &) override |
remove a given additional prop. More... | |
Uses for picking | |
vtkSmartPointer< vtkPlaneSource > | pickPlane |
A plane used for picking. More... | |
vtkSmartPointer< vtkPolyDataMapper > | pickPlaneMapper |
Mapper of the the pickPlane. More... | |
vtkSmartPointer< vtkActor > | pickPlaneActor |
Actor representing the pickPlane. More... | |
vtkSmartPointer< vtkActor > | pixelActor |
Actor representing a pixel, displayed over the image. More... | |
vtkSmartPointer< vtkAxesActor > | axes2DActor |
void | initPixelActor () |
Init the pixel actor for pixel picking. More... | |
void | updatePixelActorPosition (double x, double y, double z) |
Update the pixel actor position according to the specified pixel picked by the user i.e. More... | |
void | update2DAxesActorPosition () |
void | init2DAxesActor () |
Additional Inherited Members | |
Public Member Functions inherited from camitk::InterfaceBitMap | |
virtual | ~InterfaceBitMap ()=default |
virtual destructor More... | |
Public Attributes inherited from camitk::InterfaceBitMap | |
QMap< QString, vtkSmartPointer< vtkProp > > | extraProp |
The additional map for prop (include at least "label" and "glyph". More... | |
Display a slice (i.e.
an image or BitMap) of an ImageComponent
Uses vtkImageActor::SetDisplayExtent for 3D and 2D Axial, Coronal and Sagittal representaiton. Re-position the camera for the 2D views.
* 3D Volume 2D Slice * ________ /|\ * /| /| | _______ * /______ / | _|_slice ===> / / Displayed in * | |____|_/| | number /______ / the window * | / |// * |/______|/ * * ________________ * | vtkLookUpTable | * ---| | * | | lut | * | |________________| * setOriginalVolume(..) | * | | setLookUpTable * | setInput | __________________ * | ________________ _______v____________ | vtkImageActor | * | | vtkImageData | | vtkImageMapToColor | |(setDisplayExtent)| * |_\| |----\| |-------------------\ | | * /| originalVolume |----/| imgToMapFilter |-------------------/ | image2DActor | * |________________| |____________________| | | |__________________| * | | * | | _________________________ __________________ * | | | vtkTransformFilter | | vtkImageActor | * | -----------\ |(setWorldTransformation) | --------\|(setDisplayExtent)| * -------------/ | | --------/| | * | | | image3DActor | * |_________________________| |__________________| * * * *
Common slices orientation: axial, sagittal, coronal axial_neuro.
Axial, Sagittal and Coronal orientation are given in Radiologist point of view. The neurologist point of view is displayed in axial_neuro.
The ImageComponent is supposed to be given in RAI orientation ! (see Image Reorientation Action Documentation). AXIAL: from feet to head of the patient CORONAL: from the front to back of the patient SAGITTAL: from the right to left of the patient AXIAL_NEURO: from head to feet (other side of AXIAL)
ARBITRARY: any arbitrary orientation.
Enumerator | |
---|---|
AXIAL | |
CORONAL | |
SAGITTAL | |
AXIAL_NEURO | |
ARBITRARY |
camitk::Slice::Slice | ( | vtkSmartPointer< vtkImageData > | volume, |
SliceOrientation | AXIAL_ORIENTATION, | ||
vtkSmartPointer< vtkWindowLevelLookupTable > | lookupTable = nullptr |
||
) |
Constructor.
|
override |
virtual destructor
|
overridevirtual |
insert an additional prop, defining it by its name (default visibility = false)
Implements camitk::InterfaceBitMap.
|
virtual |
Return 2D Axes at the proper slice origin.
|
overridevirtual |
Return the vtkImageActor (vtkProp) representing a slice to be displayed in the 2D viewers.
Implements camitk::InterfaceBitMap.
|
overridevirtual |
Return the vtkImageActor (vtkProp) representing a slice to be displayed in the 3D viewers.
Implements camitk::InterfaceBitMap.
|
overridevirtual |
get the current image data
Implements camitk::InterfaceBitMap.
|
overridevirtual |
Return the number of colors in the images.
If color is coded on 1 byte, the images are on 256 grey level. If color is coded on 2 bytes, the images are on 4096 grey level (not 65536).
Implements camitk::InterfaceBitMap.
|
overridevirtual |
return the number of additional prop
Implements camitk::InterfaceBitMap.
|
overridevirtual |
Return the number of slices in the image data set.
Implements camitk::InterfaceBitMap.
|
overridevirtual |
Return the vtkActor used to pick pixels in the slices.
Implements camitk::InterfaceBitMap.
|
overridevirtual |
Return the vtkActor used to pick pixels in the slices.
Implements camitk::InterfaceBitMap.
|
overridevirtual |
Return the vtkProp (actors, volumes and annotations) corresponding to the given name.
Implements camitk::InterfaceBitMap.
|
overridevirtual |
return an additional prop by its index
Implements camitk::InterfaceBitMap.
|
overridevirtual |
Return the index of the current displayed slice.
Implements camitk::InterfaceBitMap.
|
protectedvirtual |
Initialize Attributes.
|
protected |
|
protectedvirtual |
Initialize actors and everything they need.
|
protected |
Init the pixel actor for pixel picking.
|
overridevirtual |
This method is called when the associated plane has been picked in the InteractiveViewer, the given coordinates is position where the plane was picked.
Implements camitk::InterfaceBitMap.
|
overridevirtual |
void camitk::Slice::reslicedToVolumeCoords | ( | const double * | ijk, |
double * | xyz | ||
) |
Compute the volume coordinates (xyz) from the resliced coordinates (ijk)
ijk | given resliced coordiantes (generally from a pixel picked in the pickPlane) |
xyz | output (should be allocated before calling this function) volume coordinates (with image at the origin in RAI convention) computed from the inputTodo: put this method in abstract slice |
|
overridevirtual |
set the transformation for 3D image representation
Implements camitk::InterfaceBitMap.
|
overridevirtual |
set the original volume image data (the source vtkImageData before any reslice) and refresh the vtk pipeline
Implements camitk::InterfaceBitMap.
|
overridevirtual |
move the pixel selection green indicator (pixelActor) to the given real position
Implements camitk::InterfaceBitMap.
|
overridevirtual |
Set the current slice index.
If the slice index is less than the first slice index, the first slice is displayed. If the slice index is more than the last slice index, the last slice is displayed.
s | the index of the slice to display (base 0). |
Implements camitk::InterfaceBitMap.
|
overridevirtual |
Set the slice corresponding to the given real image (RAI) coordinates.
Implements camitk::InterfaceBitMap.
|
protected |
|
overridevirtual |
Implements camitk::InterfaceBitMap.
|
protected |
Update the pixel actor position according to the specified pixel picked by the user i.e.
Compute and draw the bounding box around the selected pixel.
x | The absciss value of the selected pixel |
y | The ordinate value of the selected pixel |
z | The depth value of the selected pixel. In the plane, it's always +/- 0.01 in order to the pixel actor to be visible over the slice. |
void camitk::Slice::volumeToReslicedCoords | ( | const double * | xyz, |
double * | ijk | ||
) |
Todo, idem...
|
protected |
|
protected |
Keep track of the slice number.
|
protected |
Table containing first and last indices of the image in each direction 0 & 1 -> x; 2 and 3 -> y; 4 & 5 -> z.
QMap<QString, vtkSmartPointer<vtkProp> > camitk::Slice::extraProp |
The additional map for prop (include at least "label" and "glyph")
|
protected |
2D actor
|
protected |
3D actor
|
protected |
To be able to extract a slice.
|
protected |
Common lookup table.
|
protected |
Original volume dimensions in number of voxels (x, y and z)
|
protected |
Real size (originalDimension * originalSpacing in x, y and z) of the original image.
|
protected |
Voxel size of the original image volume.
Used to compute point coordinates between real world and index world.
|
protected |
Smart pointer to the original volume to reslice (input of the vtk pipeline)
|
protected |
A plane used for picking.
This plane has the same size and position as the displayed slice. However, it is a real vtkActor that can be easily picked (using 'p' ot 'Ctrl+left click').
|
protected |
Actor representing the pickPlane.
|
protected |
Mapper of the the pickPlane.
|
protected |
Actor representing a pixel, displayed over the image.
|
protected |
Direction of the reslice.