Computer Assited Medical Intervention Tool Kit  version 4.1
List of all members
camitk::Slice Class Reference

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...
 

Detailed Description

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   |
*                                                                        |_________________________|          |__________________|
*
*
*
* 

Member Enumeration Documentation

◆ SliceOrientation

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 

Constructor & Destructor Documentation

◆ Slice()

camitk::Slice::Slice ( vtkSmartPointer< vtkImageData >  volume,
SliceOrientation  AXIAL_ORIENTATION,
vtkSmartPointer< vtkWindowLevelLookupTable >  lookupTable = nullptr 
)

Constructor.

◆ ~Slice()

camitk::Slice::~Slice ( )
override

virtual destructor

Member Function Documentation

◆ addProp()

bool camitk::Slice::addProp ( const QString &  name,
vtkSmartPointer< vtkProp >  prop 
)
overridevirtual

insert an additional prop, defining it by its name (default visibility = false)

Returns
true if the additional prop was added (i.e. another additional prop of the same name does not exist)

Implements camitk::InterfaceBitMap.

◆ get2DAxesActor()

vtkSmartPointer< vtkAxesActor > camitk::Slice::get2DAxesActor ( )
virtual

Return 2D Axes at the proper slice origin.

◆ get2DImageActor()

vtkSmartPointer< vtkImageActor > camitk::Slice::get2DImageActor ( ) const
overridevirtual

Return the vtkImageActor (vtkProp) representing a slice to be displayed in the 2D viewers.

Implements camitk::InterfaceBitMap.

◆ get3DImageActor()

vtkSmartPointer< vtkImageActor > camitk::Slice::get3DImageActor ( ) const
overridevirtual

Return the vtkImageActor (vtkProp) representing a slice to be displayed in the 3D viewers.

Implements camitk::InterfaceBitMap.

◆ getImageData()

vtkSmartPointer< vtkImageData > camitk::Slice::getImageData ( ) const
overridevirtual

get the current image data

Implements camitk::InterfaceBitMap.

◆ getNumberOfColors()

int camitk::Slice::getNumberOfColors ( ) const
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.

◆ getNumberOfProp()

unsigned int camitk::Slice::getNumberOfProp ( ) const
overridevirtual

return the number of additional prop

Implements camitk::InterfaceBitMap.

◆ getNumberOfSlices()

int camitk::Slice::getNumberOfSlices ( ) const
overridevirtual

Return the number of slices in the image data set.

Implements camitk::InterfaceBitMap.

◆ getPickPlaneActor()

vtkSmartPointer< vtkActor > camitk::Slice::getPickPlaneActor ( ) const
overridevirtual

Return the vtkActor used to pick pixels in the slices.

Implements camitk::InterfaceBitMap.

◆ getPixelActor()

vtkSmartPointer< vtkActor > camitk::Slice::getPixelActor ( )
overridevirtual

Return the vtkActor used to pick pixels in the slices.

Implements camitk::InterfaceBitMap.

◆ getProp() [1/2]

vtkSmartPointer< vtkProp > camitk::Slice::getProp ( const QString &  name)
overridevirtual

Return the vtkProp (actors, volumes and annotations) corresponding to the given name.

Implements camitk::InterfaceBitMap.

◆ getProp() [2/2]

vtkSmartPointer< vtkProp > camitk::Slice::getProp ( unsigned int  index)
overridevirtual

return an additional prop by its index

Implements camitk::InterfaceBitMap.

◆ getSlice()

int camitk::Slice::getSlice ( ) const
overridevirtual

Return the index of the current displayed slice.

Implements camitk::InterfaceBitMap.

◆ init()

void camitk::Slice::init ( )
protectedvirtual

Initialize Attributes.

◆ init2DAxesActor()

void camitk::Slice::init2DAxesActor ( )
protected

◆ initActors()

void camitk::Slice::initActors ( )
protectedvirtual

Initialize actors and everything they need.

◆ initPixelActor()

void camitk::Slice::initPixelActor ( )
protected

Init the pixel actor for pixel picking.

◆ pixelPicked()

void camitk::Slice::pixelPicked ( double  x,
double  y,
double  z 
)
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.

◆ removeProp()

bool camitk::Slice::removeProp ( const QString &  name)
overridevirtual

remove a given additional prop.

Returns
true if effictively done

Implements camitk::InterfaceBitMap.

◆ reslicedToVolumeCoords()

void camitk::Slice::reslicedToVolumeCoords ( const double *  ijk,
double *  xyz 
)

Compute the volume coordinates (xyz) from the resliced coordinates (ijk)

Parameters
ijkgiven resliced coordiantes (generally from a pixel picked in the pickPlane)
xyzoutput (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

◆ setImageWorldTransform()

void camitk::Slice::setImageWorldTransform ( vtkSmartPointer< vtkTransform >  transform)
overridevirtual

set the transformation for 3D image representation

Implements camitk::InterfaceBitMap.

◆ setOriginalVolume()

void camitk::Slice::setOriginalVolume ( vtkSmartPointer< vtkImageData >  img)
overridevirtual

set the original volume image data (the source vtkImageData before any reslice) and refresh the vtk pipeline

Implements camitk::InterfaceBitMap.

◆ setPixelRealPosition()

void camitk::Slice::setPixelRealPosition ( double  x,
double  y,
double  z 
)
overridevirtual

move the pixel selection green indicator (pixelActor) to the given real position

Implements camitk::InterfaceBitMap.

◆ setSlice() [1/2]

void camitk::Slice::setSlice ( int  s)
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.

Parameters
sthe index of the slice to display (base 0).

Implements camitk::InterfaceBitMap.

◆ setSlice() [2/2]

void camitk::Slice::setSlice ( double  x,
double  y,
double  z 
)
overridevirtual

Set the slice corresponding to the given real image (RAI) coordinates.

Implements camitk::InterfaceBitMap.

◆ update2DAxesActorPosition()

void camitk::Slice::update2DAxesActorPosition ( )
protected

◆ updatePickPlane()

void camitk::Slice::updatePickPlane ( )
overridevirtual

◆ updatePixelActorPosition()

void camitk::Slice::updatePixelActorPosition ( double  x,
double  y,
double  z 
)
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.

Parameters
xThe absciss value of the selected pixel
yThe ordinate value of the selected pixel
zThe 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.

◆ volumeToReslicedCoords()

void camitk::Slice::volumeToReslicedCoords ( const double *  xyz,
double *  ijk 
)

Todo, idem...

Member Data Documentation

◆ axes2DActor

vtkSmartPointer<vtkAxesActor> camitk::Slice::axes2DActor
protected

◆ currentSliceIndex

int camitk::Slice::currentSliceIndex
protected

Keep track of the slice number.

◆ extent

int camitk::Slice::extent[6]
protected

Table containing first and last indices of the image in each direction 0 & 1 -> x; 2 and 3 -> y; 4 & 5 -> z.

◆ extraProp

QMap<QString, vtkSmartPointer<vtkProp> > camitk::Slice::extraProp

The additional map for prop (include at least "label" and "glyph")

◆ image2DActor

vtkSmartPointer<vtkImageActor> camitk::Slice::image2DActor
protected

2D actor

◆ image3DActor

vtkSmartPointer<vtkImageActor> camitk::Slice::image3DActor
protected

3D actor

◆ imgToMapFilter

vtkSmartPointer<vtkImageMapToColors> camitk::Slice::imgToMapFilter
protected

To be able to extract a slice.

◆ lut

vtkSmartPointer<vtkWindowLevelLookupTable> camitk::Slice::lut
protected

Common lookup table.

◆ originalDimensions

int camitk::Slice::originalDimensions[3]
protected

Original volume dimensions in number of voxels (x, y and z)

◆ originalSize

double camitk::Slice::originalSize[3]
protected

Real size (originalDimension * originalSpacing in x, y and z) of the original image.

◆ originalSpacing

double camitk::Slice::originalSpacing[3]
protected

Voxel size of the original image volume.

Used to compute point coordinates between real world and index world.

◆ originalVolume

vtkSmartPointer<vtkImageData> camitk::Slice::originalVolume
protected

Smart pointer to the original volume to reslice (input of the vtk pipeline)

◆ pickPlane

vtkSmartPointer<vtkPlaneSource> camitk::Slice::pickPlane
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').

◆ pickPlaneActor

vtkSmartPointer<vtkActor> camitk::Slice::pickPlaneActor
protected

Actor representing the pickPlane.

◆ pickPlaneMapper

vtkSmartPointer<vtkPolyDataMapper> camitk::Slice::pickPlaneMapper
protected

Mapper of the the pickPlane.

◆ pixelActor

vtkSmartPointer<vtkActor> camitk::Slice::pixelActor
protected

Actor representing a pixel, displayed over the image.

◆ sliceOrientation

SliceOrientation camitk::Slice::sliceOrientation
protected

Direction of the reslice.


The documentation for this class was generated from the following files: