Commit c830616f authored by Emmanuel Promayon's avatar Emmanuel Promayon

FIXED plane now always visible + code optimization/simplification

The picked plane is now always visible in all kind of orientations.
All unnecessary attributes were removed to simplify and optimize the code.
The picked plane and pixel actors are not re-instanciated at every picking,
their position us just updated.
parent fbfcc3b5
This diff is collapsed.
......@@ -253,18 +253,11 @@ protected:
/** Smart pointer to the original volume to reslice (input of the vtk pipeline) */
vtkSmartPointer<vtkImageData> originalVolume;
/// Table containing first and last indices of the image in each direction
/// 0 & 1 -> x; 2 and 3 -> y; 4 & 5 -> z
int extent[6];
/** Keep track of the slice number */
int currentSliceIndex;
/// Common lookup table
vtkSmartPointer<vtkWindowLevelLookupTable> lut;
/** Original volume dimensions in number of voxels (x, y and z) */
int originalDimensions[3];
vtkSmartPointer<vtkWindowLevelLookupTable> lut;
/** Voxel size of the original image volume. Used to compute point coordinates between real world and index world.*/
double originalSpacing[3];
......@@ -272,9 +265,6 @@ protected:
/** Real size (originalDimension * originalSpacing in x, y and z) of the original image */
double originalSize[3];
/// To be able to extract a slice
vtkSmartPointer<vtkImageMapToColors> imgToMapFilter;
/// 3D actor
vtkSmartPointer<vtkImageActor> image3DActor;
......@@ -308,19 +298,13 @@ protected:
/// update the pixel actor to the middle of the current slice
void updatePixelActor();
/** 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').
*/
vtkSmartPointer<vtkPlaneSource> pickPlane;
/** Mapper of the the pickPlane. */
vtkSmartPointer<vtkPolyDataMapper> pickPlaneMapper;
/** Actor representing the pickPlane. */
vtkSmartPointer<vtkActor> pickPlaneActor;
/// the pick plane actor unstructured grid
vtkSmartPointer<vtkUnstructuredGrid> pickPlaneActorPointSet;
/** Actor representing a pixel, displayed over the image. */
vtkSmartPointer<vtkActor> pixelActor;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment