![]() |
Computer Assited Medical Intervention Tool Kit
|
Display a slice (i.e. More...
#include <Slice.h>
Public Member Functions | |
Constructors / Destructors | |
Slice (vtkSmartPointer< vtkImageData > volume, PossibleOrientation AXIAL_ORIENTATION, vtkSmartPointer< vtkWindowLevelLookupTable > lookupTable=NULL) | |
Constructor. | |
virtual | ~Slice () |
virtual destructor | |
![]() | |
virtual | ~InterfaceBitMap () |
virtual destructor |
Protected Member Functions | |
Protected utility methods | |
void | setTransformOrientation (double xCosines[3], double yCosines[3], double zCosines[3]) |
Sets the given rotation transformation to the reslicer without checking anything. | |
void | setTransformOrigin (double resliceOrigin[3]) |
Sets the given origin to the reslicer without checking anything. | |
void | initActors () |
Initialize actors and everything they need. | |
void | setInitialSlicerTransformation () |
Set transformation for axial, sagittal and coronal (axial as default for arbitrary) | |
void | updateLocalTransformation () |
Update the coordsTransform attribute (to do when either slicer transformation or slice number has changed). | |
void | computeReslicedDimensions () |
Computes local coordiantes from original coordinates and slicer transformation. | |
void | setSliceOrientation (PossibleOrientation orientation) |
Set the orientation (and the transform matrix) of the slice. |
Private Member Functions | |
void | initPixelActor () |
Init the pixel actor for pixel picking. | |
void | updatePixelActorPosition (double x, double y, double z) |
Update the pixel actor position according to the specified pixel picked by the user i.e. |
Private Attributes | |
int | currentSliceIndex |
Keep track of the slice number. | |
vtkSmartPointer< vtkImageActor > | image3DActor |
3D actor | |
vtkSmartPointer < vtkImageMapToColors > | imgToMapFilter |
To be able to extract a slice. | |
vtkSmartPointer < vtkWindowLevelLookupTable > | lut |
Common lookup table. | |
vtkSmartPointer< vtkActor > | pixelActor |
Actor representing a pixel, displayed over the image. | |
Use to reslice 2D | |
int | originalDimensions [3] |
Original volume dimensions. | |
int | reslicedDimensions [3] |
Resliced Volume dimensions. | |
double | originalSpacing [3] |
Voxel size of the ORIGINAL image volume. | |
double | resliceSpacing [3] |
Voxel size of the RESLICED image volume. | |
double | currentXAngle |
Angle apply to the arbitrary slice. | |
double | currentYAngle |
double | currentZAngle |
vtkSmartPointer< vtkMatrix4x4 > | coordsTransform |
Transform matrix between resliced and original coords. | |
vtkSmartPointer< vtkMatrix4x4 > | sliceCoordsTransform |
Transform matrix between resliced and original coords taking the slice number into account. | |
vtkSmartPointer< vtkTransform > | transformReslice2Volume |
Transformation between the reslice volume and the original volume. | |
For 2D actor | |
vtkSmartPointer< vtkImageReslice > | image2DReslicer |
Reslicer: cut the volume at the right plane and displays it facing the 2D camera. | |
vtkSmartPointer < vtkImageChangeInformation > | image2DChangeInfo |
To put the origin of the reslicer at (0, 0, 0) (mandatory to visualize 2D actor (axial, coronal or sagittal) properly in a 2D window) | |
vtkSmartPointer< vtkImageActor > | image2DActor |
2D actor itself | |
Uses for picking | |
vtkSmartPointer< vtkPlaneSource > | pickPlane |
A plane used for picking. | |
vtkSmartPointer < vtkPolyDataMapper > | pickPlaneMapper |
Mapper of the the pickPlane. | |
vtkSmartPointer< vtkActor > | pickPlaneActor |
Actor representing the pickPlane. |
InterfaceBitMap implementation | |
QMap< QString, vtkSmartPointer < vtkProp > > | extraProp |
The additional map for prop (include at least "label" and "glyph". | |
virtual vtkSmartPointer < vtkImageData > | getImageData () const |
Return the displayed images as a vtkImageData. | |
virtual void | setOriginalVolume (vtkSmartPointer< vtkImageData > img) |
set the original volume image data (the source vtkImageData before any reslice) and refresh the vtk pipeline | |
virtual vtkSmartPointer < vtkImageActor > | get2DImageActor () const |
Return the vtkImageActor (vtkProp) representing a slice to be displayed in 2D. | |
virtual vtkSmartPointer < vtkImageActor > | get3DImageActor () const |
Return the vtkImageActor (vtkProp) representing a slice to be displayed in 2D. | |
virtual vtkSmartPointer< vtkActor > | getPickPlaneActor () const |
Return the vtkActor used to pick pixels in the slices. | |
virtual vtkSmartPointer< vtkActor > | getPixelActor () |
Return the vtkActor used to pick pixels in the slices. | |
virtual void | pixelPicked (double, double, double) |
This method is called when the associated plane has been picked in the InteractiveViewer, the given coordinates is position where the plane was picked. | |
void | reslicedToVolumeCoords (const double ijk[3], double xyz[3]) |
Compute the volume coordinates (xyz) from the resliced coordinates (ijk) | |
void | volumeToReslicedCoords (const double xyz[3], double ijk[3]) |
Todo, idem... | |
virtual void | updatePickPlane () |
virtual int | getNumberOfSlices () const |
Return the number of slices in the image data set. | |
virtual int | getSlice () const |
Return the index of the current displayed slice. | |
virtual void | setSlice (int s) |
Set the current slice index. | |
virtual void | setSlice (double x, double y, double z) |
Set the slice corresponding to the given world coordinates. | |
virtual double | getRotationX () const |
Return the current angle applied to the arbitrary slice. | |
virtual double | getRotationY () const |
virtual double | getRotationZ () const |
virtual void | setRotationX (double angle) |
Set the current angle to the arbitrary slice. | |
virtual void | setRotationY (double angle) |
virtual void | setRotationZ (double angle) |
void | applyRotation () |
virtual int | getNumberOfColors () const |
Return the number of colors in the images. | |
virtual void | setPixelRealPosition (double, double, double) |
move the pixel selection green indicator (pixelActor) to the given real position | |
virtual vtkSmartPointer< vtkProp > | getProp (const QString &) |
Return the vtkProp (actors, volumes and annotations) corresponding to the given name. | |
virtual unsigned int | getNumberOfProp () const |
return the number of additional prop | |
virtual vtkSmartPointer< vtkProp > | getProp (unsigned int) |
return an additional prop by its index | |
virtual bool | addProp (const QString &, vtkSmartPointer< vtkProp >) |
insert an additional prop, defining it by its name (default visibility = false) | |
virtual bool | removeProp (const QString &) |
remove a given additional prop. |
Attributes / Members of the class | |
PossibleOrientation | sliceOrientation |
Direction of the reslice. | |
vtkSmartPointer< vtkImageData > | originalVolume |
Smart pointer to the original volume to reslice (input of the vtk pipeline) | |
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. | |
void | init () |
Initialize / Creates members. |
Additional Inherited Members | |
![]() | |
enum | PossibleOrientation { AXIAL_ORIENTATION, CORONAL_ORIENTATION, SAGITTAL_ORIENTATION, ARBITRARY_ORIENTATION } |
Common slices orientation: axial, sagittal, coronal or anything else. More... | |
![]() | |
QMap< QString, vtkSmartPointer < vtkProp > > | extraProp |
The additional map for prop (include at least "label" and "glyph". |
Display a slice (i.e.
an image or BitMap)
Uses vtkImageActor::SetDisplayExtent for 3D Axial, Coronal and Sagittal representaiton. Uses vtkImageReslice for 2D actors (for them to be facing the camera).
* 3D Volume 2D Slice * ________ /|\ * /| /| | _______ * /______ / | _|_slice ===> / / Displayed in * | |____|_/| | number /______ / the window * | / |// * |/______|/ * * ________________ * | vtkLookUpTable | * ---| | * | | lut | * | |________________| * setOriginalVolume(..) | __________________ * | | setLookUpTable | vtkImageActor | * | setInput | /------------------------------------------\|(setDisplayExtent)| * | ________________ _______v____________ / /-----------------------------------------/| | * | | vtkImageData | | vtkImageMapToColor |/ / | image3DActor | * |_\| |----\| | / _________________________ |__________________| * /| originalVolume |----/| imgToMapFilter |\ \ |vtkImageChangeInformation| * |________________| |____________________| \ \---\| | * \----/| image2DChangeInfo | * |_________________________| * \ \ _______________ _______________ * \ \ |vtkImageReslice| | vtkImageActor | * \ \----\| |-----\| | * -----/|image2DReslicer|-----/| image2DActor | * |_______________|\ |_______________| * \ * v * getImageData() * * * * * * * *
camitk::Slice::Slice | ( | vtkSmartPointer< vtkImageData > | volume, |
PossibleOrientation | AXIAL_ORIENTATION, | ||
vtkSmartPointer< vtkWindowLevelLookupTable > | lookupTable = NULL |
||
) |
Constructor.
|
inlinevirtual |
virtual destructor
|
virtual |
insert an additional prop, defining it by its name (default visibility = false)
Implements camitk::InterfaceBitMap.
void camitk::Slice::applyRotation | ( | ) |
|
protected |
Computes local coordiantes from original coordinates and slicer transformation.
|
virtual |
Return the vtkImageActor (vtkProp) representing a slice to be displayed in 2D.
Implements camitk::InterfaceBitMap.
|
virtual |
Return the vtkImageActor (vtkProp) representing a slice to be displayed in 2D.
Implements camitk::InterfaceBitMap.
|
virtual |
Return the displayed images as a vtkImageData.
Implements camitk::InterfaceBitMap.
|
virtual |
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.
|
virtual |
return the number of additional prop
Implements camitk::InterfaceBitMap.
|
virtual |
Return the number of slices in the image data set.
Implements camitk::InterfaceBitMap.
|
virtual |
Return the vtkActor used to pick pixels in the slices.
Implements camitk::InterfaceBitMap.
|
virtual |
Return the vtkActor used to pick pixels in the slices.
Implements camitk::InterfaceBitMap.
|
virtual |
Return the vtkProp (actors, volumes and annotations) corresponding to the given name.
Implements camitk::InterfaceBitMap.
|
virtual |
return an additional prop by its index
Implements camitk::InterfaceBitMap.
|
inlinevirtual |
Return the current angle applied to the arbitrary slice.
Implements camitk::InterfaceBitMap.
|
inlinevirtual |
Implements camitk::InterfaceBitMap.
|
inlinevirtual |
Implements camitk::InterfaceBitMap.
|
virtual |
Return the index of the current displayed slice.
Implements camitk::InterfaceBitMap.
|
private |
Initialize / Creates members.
|
protected |
Initialize actors and everything they need.
|
private |
Init the pixel actor for pixel picking.
|
virtual |
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.
|
virtual |
void camitk::Slice::reslicedToVolumeCoords | ( | const double | ijk[3], |
double | xyz[3] | ||
) |
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 computed from the inputTodo: put this method in abstract slice |
|
protected |
Set transformation for axial, sagittal and coronal (axial as default for arbitrary)
|
virtual |
set the original volume image data (the source vtkImageData before any reslice) and refresh the vtk pipeline
Implements camitk::InterfaceBitMap.
|
virtual |
move the pixel selection green indicator (pixelActor) to the given real position
Implements camitk::InterfaceBitMap.
|
virtual |
Set the current angle to the arbitrary slice.
Implements camitk::InterfaceBitMap.
|
virtual |
Implements camitk::InterfaceBitMap.
|
virtual |
Implements camitk::InterfaceBitMap.
|
virtual |
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.
|
virtual |
Set the slice corresponding to the given world coordinates.
Implements camitk::InterfaceBitMap.
|
protected |
Set the orientation (and the transform matrix) of the slice.
|
protected |
Sets the given rotation transformation to the reslicer without checking anything.
|
protected |
Sets the given origin to the reslicer without checking anything.
Warning, if the origin is not at (0,0,s) or any combination, the pickPlane may not be correctly placed.
|
protected |
Update the coordsTransform attribute (to do when either slicer transformation or slice number has changed).
|
virtual |
Implements camitk::InterfaceBitMap.
|
private |
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[3], |
double | ijk[3] | ||
) |
Todo, idem...
|
private |
Transform matrix between resliced and original coords.
|
private |
Keep track of the slice number.
|
private |
Angle apply to the arbitrary slice.
|
private |
|
private |
|
private |
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".
|
private |
2D actor itself
|
private |
To put the origin of the reslicer at (0, 0, 0) (mandatory to visualize 2D actor (axial, coronal or sagittal) properly in a 2D window)
|
private |
Reslicer: cut the volume at the right plane and displays it facing the 2D camera.
|
private |
3D actor
|
private |
To be able to extract a slice.
|
private |
Common lookup table.
|
private |
Original volume dimensions.
|
private |
Voxel size of the ORIGINAL image volume.
Used to compute point coordinates between real world and index world.
|
private |
Smart pointer to the original volume to reslice (input of the vtk pipeline)
|
private |
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').
|
private |
Actor representing the pickPlane.
|
private |
Mapper of the the pickPlane.
|
private |
Actor representing a pixel, displayed over the image.
|
private |
Resliced Volume dimensions.
|
private |
Voxel size of the RESLICED image volume.
Used to compute point coordinates between real world and index world.
|
private |
Transform matrix between resliced and original coords taking the slice number into account.
|
private |
Direction of the reslice.
|
private |
Transformation between the reslice volume and the original volume.