open_iA 2021.08
A tool for the visual analysis and processing of volumetric datasets, with a focus on industrial computed tomography.
Public Types | Public Slots | Signals | Public Member Functions | List of all members
iASlicerImpl Class Reference

vtk-based slicer widget. "Channels" (i.e. image layers) are inserted via the addChannel method More...

#include <iASlicerImpl.h>

Inheritance diagram for iASlicerImpl:
[legend]
Collaboration diagram for iASlicerImpl:
[legend]

Public Types

enum  InteractionMode { Normal , SnakeEdit , SnakeShow }
 

Public Slots

void addPoint (double x, double y, double z)
 Adds a new spline point to the end of the spline curve. More...
 
void deleteSnakeLine ()
 Deletes the current spline curve. More...
 
void deselectPoint ()
 Function to deselect points in snake slicer (necessary to avoid endless loops with signals and slots). More...
 
void menuDeleteSnakeLine ()
 Called when the delete snake line menu is clicked. More...
 
void movePoint (size_t selectedPointIndex, double xPos, double yPos, double zPos)
 Moves a point of the snake slicer to a new position. More...
 
void rotateSlice (double angle) override
 
void saveAsImage () override
 Save an image of the image viewer native resolution or the current view. More...
 
void saveImageStack ()
 Save an image stack of the current view. More...
 
void saveMovie () override
 Save a movie of a full slice-through of the specimen from top to bottom. More...
 
void setProfileHandlesOn (bool isOn)
 Toggle the possibility to move start and end point of the profile. More...
 
bool setProfilePoint (int pointInd, double *Pos)
 Sets coordinates for line profile. More...
 
void setSlabCompositeMode (int compositeMode)
 
void setSlabThickness (int thickness)
 
void setSliceNumber (int sliceNumber) override
 
void setSliceProfileOn (bool isOn)
 Toggle the "raw" profile mode, i.e. whether the profile is shown on top of the slicer image. More...
 
void switchInteractionMode (int mode)
 Switches between interaction modi (normal, snake slicer view or editing) More...
 
void toggleInteractorState ()
 Toggle interactor state of this slicer between enabled/disabled. More...
 
void update () override
 
- Public Slots inherited from iASlicer
virtual void rotateSlice (double angle)=0
 
virtual void saveAsImage ()=0
 Save an image of the image viewer native resolution or the current view. More...
 
virtual void saveMovie ()=0
 Save a movie of a full slice-through of the specimen from top to bottom. More...
 
virtual void setSliceNumber (int sliceNumber)=0
 
virtual void update ()=0
 

Signals

void addedPoint (double x, double y, double z)
 
void deletedSnakeLine ()
 
void deselectedPoint ()
 
void movedPoint (size_t selectedPointIndex, double xPos, double yPos, double zPos)
 
void profilePointChanged (int pointInd, double *Pos)
 
void sliceRangeChanged (int minIdx, int maxIdx)
 
void sliceRotated ()
 triggered when slice was rotated More...
 
void switchedMode (int mode)
 
- Signals inherited from iASlicer
void altMouseWheel (int angle)
 
void clicked ()
 
void ctrlMouseWheel (int angle)
 
void dblClicked ()
 
void leftClicked (int x, int y, int z)
 
void leftDragged (int x, int y, int z)
 
void magicLensToggled (bool enabled)
 
void oslicerPos (int x, int y, int z, int mode)
 triggered on mouse move More...
 
void pick ()
 
void released (int x, int y, int z)
 
void rightClicked (int x, int y, int z)
 
void shiftMouseWheel (int angle)
 
void sliceNumberChanged (int mode, int sliceNumber)
 triggered when slice number changed. More...
 
void updateSignal ()
 
void userInteraction ()
 

Public Member Functions

 iASlicerImpl (QWidget *parent, const iASlicerMode mode, bool decorations=true, bool magicLensAvailable=true, vtkAbstractTransform *transform=nullptr, vtkPoints *snakeSlicerPoints=nullptr)
 Creates a new slicer widget. More...
 
virtual ~iASlicerImpl ()
 
void addImageActor (vtkSmartPointer< vtkImageActor > imgActor) override
 
void blend (vtkAlgorithmOutput *data1, vtkAlgorithmOutput *data2, double opacity, double *range) override
 Blend two images. Should probably be implemented in terms of two channels? More...
 
vtkCamera * camera () override
 Access to the slicer's main renderer's camera. More...
 
void disableInteractor () override
 
void enableInteractor () override
 
void execute (vtkObject *caller, unsigned long eventId, void *callData) override
 
vtkRenderWindowInteractor * interactor () override
 Access to the interactor of this slicer's render window. More...
 
iASlicerMode mode () const override
 Get the slice mode (which axis-aligned slice-plane is used for slicing). More...
 
QCursor mouseCursor ()
 
void removeImageActor (vtkSmartPointer< vtkImageActor > imgActor) override
 
vtkRenderer * renderer () override
 Access to the slicer's main renderer. More...
 
vtkGenericOpenGLRenderWindow * renderWindow () override
 Access to the slicer's render window. More...
 
void resetCamera () override
 Resets the slicer's main renderer's camera such that all channels in it are visible. More...
 
void saveSliceMovie (QString const &fileName, int qual=2)
 
void setBackground (double r, double g, double b) override
 Sets the background color of the slicer. More...
 
void setCamera (vtkCamera *camera, bool camOwner=true) override
 Set the camera for the slicer's main renderer. More...
 
void setDefaultInteractor () override
 
void setIndex (int x, int y, int z) override
 
void setLinkedMdiChild (iAMdiChild *mdiChild) override
 in case the "linked mdi" feature is used, use this to set the mdi child this slicer is linked to. More...
 
void setMode (const iASlicerMode mode) override
 Sets the slice mode (which axis-aligned slice-plane to use for slicing). More...
 
void setMouseCursor (QString const &s)
 
void setPositionMarkerCenter (double x, double y, double z)
 Set the position of the position marker (in slicer coordinates). More...
 
void setResliceAxesOrigin (double x, double y, double z) override
 
void setRightButtonDragZoomEnabled (bool enabled)
 
void setScalarBarTF (vtkScalarsToColors *ctf) override
 
void setShowText (bool isVisible) override
 Enable/disable the tooltip text. More...
 
void setStatisticalExtent (int statExt)
 
void setTransform (vtkAbstractTransform *tr)
 
void setup (iASingleSlicerSettings const &settings) override
 Sets up the slicer with the given settings. More...
 
void showIsolines (bool s)
 Enable/disable contour lines. More...
 
void showPosition (bool s)
 
int sliceNumber () const override
 Get current slice number. More...
 
void triggerSliceRangeChange ()
 call if the dimension of the input in direction of the slice axis has changed. More...
 
void updateChannelMappers () override
 
void setMagicLensEnabled (bool isEnabled) override
 Magic Lens methods. More...
 
void setMagicLensSize (int newSize)
 
int magicLensSize () const
 
void setMagicLensFrameWidth (int newWidth)
 
void setMagicLensCount (int count) override
 
void setMagicLensInput (uint id) override
 
uint magicLensInput () const override
 
void setMagicLensOpacity (double opacity) override
 
double magicLensOpacity () const override
 
void updateMagicLensColors () override
 
void updateMagicLens () override
 
iAMagicLensmagicLens () override
 
void addChannel (uint id, iAChannelData const &chData, bool enable) override
 management of channels - each channel represents one "layer" More...
 
void removeChannel (uint id) override
 
void updateChannel (uint id, iAChannelData const &chData) override
 
iAChannelSlicerDatachannel (uint id) override
 
void setChannelOpacity (uint id, double opacity) override
 
void enableChannel (uint id, bool enabled) override
 
bool hasChannel (uint id) const override
 
void setROIVisible (bool isVisible) override
 ROI rectangle. More...
 
void updateROI (int const roi[6]) override
 
void setContours (int numberOfContours, double contourMin, double contourMax) override
 set contour line parameters. More...
 
void setContours (int numberOfContours, double const *contourValues) override
 
- Public Member Functions inherited from iASlicer
 iASlicer (QWidget *parent)
 
virtual ~iASlicer ()
 

Detailed Description

vtk-based slicer widget. "Channels" (i.e. image layers) are inserted via the addChannel method

Member Enumeration Documentation

◆ InteractionMode

Enumerator
Normal 
SnakeEdit 
SnakeShow 

Constructor & Destructor Documentation

◆ iASlicerImpl()

iASlicerImpl::iASlicerImpl ( QWidget *  parent,
const iASlicerMode  mode,
bool  decorations = true,
bool  magicLensAvailable = true,
vtkAbstractTransform *  transform = nullptr,
vtkPoints *  snakeSlicerPoints = nullptr 
)

Creates a new slicer widget.

Parameters
parentthe parent widget; can be nullptr for no current parent.
modedetermines which axis-aligned slice-plane is used for slicing.
decorationswhether to show the scalar bar widget, the measure bar, the logo and the tooltip.
magicLensAvailablewhether a magic lens should be available.
transformthe basic transform the reslicers inside the channels of this slicer (should probably be removed here).
snakeSlicerPointsthe array of points in the snake slicer (leave at default nullptr if you don't require snake slicer).

◆ ~iASlicerImpl()

iASlicerImpl::~iASlicerImpl ( )
virtual

Member Function Documentation

◆ addChannel()

void iASlicerImpl::addChannel ( uint  id,
iAChannelData const &  chData,
bool  enable 
)
overridevirtual

management of channels - each channel represents one "layer"

Implements iASlicer.

◆ addedPoint

void iASlicerImpl::addedPoint ( double  x,
double  y,
double  z 
)
signal

◆ addImageActor()

void iASlicerImpl::addImageActor ( vtkSmartPointer< vtkImageActor >  imgActor)
overridevirtual

Implements iASlicer.

◆ addPoint

void iASlicerImpl::addPoint ( double  x,
double  y,
double  z 
)
slot

Adds a new spline point to the end of the spline curve.

◆ blend()

void iASlicerImpl::blend ( vtkAlgorithmOutput *  data1,
vtkAlgorithmOutput *  data2,
double  opacity,
double *  range 
)
overridevirtual

Blend two images. Should probably be implemented in terms of two channels?

Implements iASlicer.

◆ camera()

vtkCamera * iASlicerImpl::camera ( )
overridevirtual

Access to the slicer's main renderer's camera.

Implements iASlicer.

◆ channel()

iAChannelSlicerData * iASlicerImpl::channel ( uint  id)
overridevirtual

Implements iASlicer.

◆ deletedSnakeLine

void iASlicerImpl::deletedSnakeLine ( )
signal

◆ deleteSnakeLine

void iASlicerImpl::deleteSnakeLine ( )
slot

Deletes the current spline curve.

◆ deselectedPoint

void iASlicerImpl::deselectedPoint ( )
signal

◆ deselectPoint

void iASlicerImpl::deselectPoint ( )
slot

Function to deselect points in snake slicer (necessary to avoid endless loops with signals and slots).

◆ disableInteractor()

void iASlicerImpl::disableInteractor ( )
overridevirtual

Implements iASlicer.

◆ enableChannel()

void iASlicerImpl::enableChannel ( uint  id,
bool  enabled 
)
overridevirtual

Implements iASlicer.

◆ enableInteractor()

void iASlicerImpl::enableInteractor ( )
overridevirtual

Implements iASlicer.

◆ execute()

void iASlicerImpl::execute ( vtkObject *  caller,
unsigned long  eventId,
void *  callData 
)
overridevirtual

Implements iASlicer.

◆ hasChannel()

bool iASlicerImpl::hasChannel ( uint  id) const
overridevirtual

Implements iASlicer.

◆ interactor()

vtkRenderWindowInteractor * iASlicerImpl::interactor ( )
overridevirtual

Access to the interactor of this slicer's render window.

Implements iASlicer.

◆ magicLens()

iAMagicLens * iASlicerImpl::magicLens ( )
overridevirtual

Implements iASlicer.

◆ magicLensInput()

uint iASlicerImpl::magicLensInput ( ) const
overridevirtual

Implements iASlicer.

◆ magicLensOpacity()

double iASlicerImpl::magicLensOpacity ( ) const
overridevirtual

Implements iASlicer.

◆ magicLensSize()

int iASlicerImpl::magicLensSize ( ) const

◆ menuDeleteSnakeLine

void iASlicerImpl::menuDeleteSnakeLine ( )
slot

Called when the delete snake line menu is clicked.

◆ mode()

iASlicerMode iASlicerImpl::mode ( ) const
overridevirtual

Get the slice mode (which axis-aligned slice-plane is used for slicing).

Implements iASlicer.

◆ mouseCursor()

QCursor iASlicerImpl::mouseCursor ( )

◆ movedPoint

void iASlicerImpl::movedPoint ( size_t  selectedPointIndex,
double  xPos,
double  yPos,
double  zPos 
)
signal

◆ movePoint

void iASlicerImpl::movePoint ( size_t  selectedPointIndex,
double  xPos,
double  yPos,
double  zPos 
)
slot

Moves a point of the snake slicer to a new position.

◆ profilePointChanged

void iASlicerImpl::profilePointChanged ( int  pointInd,
double *  Pos 
)
signal

◆ removeChannel()

void iASlicerImpl::removeChannel ( uint  id)
overridevirtual

Implements iASlicer.

◆ removeImageActor()

void iASlicerImpl::removeImageActor ( vtkSmartPointer< vtkImageActor >  imgActor)
overridevirtual

Implements iASlicer.

◆ renderer()

vtkRenderer * iASlicerImpl::renderer ( )
overridevirtual

Access to the slicer's main renderer.

Implements iASlicer.

◆ renderWindow()

vtkGenericOpenGLRenderWindow * iASlicerImpl::renderWindow ( )
overridevirtual

Access to the slicer's render window.

Implements iASlicer.

◆ resetCamera()

void iASlicerImpl::resetCamera ( )
overridevirtual

Resets the slicer's main renderer's camera such that all channels in it are visible.

Implements iASlicer.

◆ rotateSlice

void iASlicerImpl::rotateSlice ( double  angle)
overrideslot

◆ saveAsImage

void iASlicerImpl::saveAsImage ( )
overrideslot

Save an image of the image viewer native resolution or the current view.

◆ saveImageStack

void iASlicerImpl::saveImageStack ( )
slot

Save an image stack of the current view.

◆ saveMovie

void iASlicerImpl::saveMovie ( )
overrideslot

Save a movie of a full slice-through of the specimen from top to bottom.

◆ saveSliceMovie()

void iASlicerImpl::saveSliceMovie ( QString const &  fileName,
int  qual = 2 
)

◆ setBackground()

void iASlicerImpl::setBackground ( double  r,
double  g,
double  b 
)
overridevirtual

Sets the background color of the slicer.

By default, background color is auto-determined via the slicer mode. If set manually via this method, it will keep the given color indefinitely

Parameters
rred color part (0..1)
ggreen color part (0..1)
bblue color part (0..1)

Implements iASlicer.

◆ setCamera()

void iASlicerImpl::setCamera ( vtkCamera *  camera,
bool  camOwner = true 
)
overridevirtual

Set the camera for the slicer's main renderer.

Use this if you want share the camera between multiple views (i.e. synchronize their viewing parameters)

Parameters
camerathe new camera to assing
camOwnerwhether the slicer should assume ownership of the camera. If true, Delete() will be called on it in the destructor

Implements iASlicer.

◆ setChannelOpacity()

void iASlicerImpl::setChannelOpacity ( uint  id,
double  opacity 
)
overridevirtual

Implements iASlicer.

◆ setContours() [1/2]

void iASlicerImpl::setContours ( int  numberOfContours,
double const *  contourValues 
)
overridevirtual

Implements iASlicer.

◆ setContours() [2/2]

void iASlicerImpl::setContours ( int  numberOfContours,
double  contourMin,
double  contourMax 
)
overridevirtual

set contour line parameters.

Implements iASlicer.

◆ setDefaultInteractor()

void iASlicerImpl::setDefaultInteractor ( )
overridevirtual

Implements iASlicer.

◆ setIndex()

void iASlicerImpl::setIndex ( int  x,
int  y,
int  z 
)
overridevirtual

Implements iASlicer.

◆ setLinkedMdiChild()

void iASlicerImpl::setLinkedMdiChild ( iAMdiChild mdiChild)
overridevirtual

in case the "linked mdi" feature is used, use this to set the mdi child this slicer is linked to.

Implements iASlicer.

◆ setMagicLensCount()

void iASlicerImpl::setMagicLensCount ( int  count)
overridevirtual

Implements iASlicer.

◆ setMagicLensEnabled()

void iASlicerImpl::setMagicLensEnabled ( bool  isEnabled)
overridevirtual

Magic Lens methods.

Implements iASlicer.

◆ setMagicLensFrameWidth()

void iASlicerImpl::setMagicLensFrameWidth ( int  newWidth)

◆ setMagicLensInput()

void iASlicerImpl::setMagicLensInput ( uint  id)
overridevirtual

Implements iASlicer.

◆ setMagicLensOpacity()

void iASlicerImpl::setMagicLensOpacity ( double  opacity)
overridevirtual

Implements iASlicer.

◆ setMagicLensSize()

void iASlicerImpl::setMagicLensSize ( int  newSize)

◆ setMode()

void iASlicerImpl::setMode ( const iASlicerMode  mode)
overridevirtual

Sets the slice mode (which axis-aligned slice-plane to use for slicing).

Implements iASlicer.

◆ setMouseCursor()

void iASlicerImpl::setMouseCursor ( QString const &  s)

◆ setPositionMarkerCenter()

void iASlicerImpl::setPositionMarkerCenter ( double  x,
double  y,
double  z 
)

Set the position of the position marker (in slicer coordinates).

◆ setProfileHandlesOn

void iASlicerImpl::setProfileHandlesOn ( bool  isOn)
slot

Toggle the possibility to move start and end point of the profile.

◆ setProfilePoint

bool iASlicerImpl::setProfilePoint ( int  pointInd,
double *  Pos 
)
slot

Sets coordinates for line profile.

◆ setResliceAxesOrigin()

void iASlicerImpl::setResliceAxesOrigin ( double  x,
double  y,
double  z 
)
overridevirtual

Implements iASlicer.

◆ setRightButtonDragZoomEnabled()

void iASlicerImpl::setRightButtonDragZoomEnabled ( bool  enabled)

◆ setROIVisible()

void iASlicerImpl::setROIVisible ( bool  isVisible)
overridevirtual

ROI rectangle.

Implements iASlicer.

◆ setScalarBarTF()

void iASlicerImpl::setScalarBarTF ( vtkScalarsToColors *  ctf)
overridevirtual

Implements iASlicer.

◆ setShowText()

void iASlicerImpl::setShowText ( bool  isVisible)
overridevirtual

Enable/disable the tooltip text.

Implements iASlicer.

◆ setSlabCompositeMode

void iASlicerImpl::setSlabCompositeMode ( int  compositeMode)
slot

◆ setSlabThickness

void iASlicerImpl::setSlabThickness ( int  thickness)
slot

◆ setSliceNumber

void iASlicerImpl::setSliceNumber ( int  sliceNumber)
overrideslot

◆ setSliceProfileOn

void iASlicerImpl::setSliceProfileOn ( bool  isOn)
slot

Toggle the "raw" profile mode, i.e. whether the profile is shown on top of the slicer image.

◆ setStatisticalExtent()

void iASlicerImpl::setStatisticalExtent ( int  statExt)

◆ setTransform()

void iASlicerImpl::setTransform ( vtkAbstractTransform *  tr)

◆ setup()

void iASlicerImpl::setup ( iASingleSlicerSettings const &  settings)
overridevirtual

Sets up the slicer with the given settings.

Implements iASlicer.

◆ showIsolines()

void iASlicerImpl::showIsolines ( bool  s)

Enable/disable contour lines.

◆ showPosition()

void iASlicerImpl::showPosition ( bool  s)

◆ sliceNumber()

int iASlicerImpl::sliceNumber ( ) const
overridevirtual

Get current slice number.

Implements iASlicer.

◆ sliceRangeChanged

void iASlicerImpl::sliceRangeChanged ( int  minIdx,
int  maxIdx 
)
signal

◆ sliceRotated

void iASlicerImpl::sliceRotated ( )
signal

triggered when slice was rotated

◆ switchedMode

void iASlicerImpl::switchedMode ( int  mode)
signal

◆ switchInteractionMode

void iASlicerImpl::switchInteractionMode ( int  mode)
slot

Switches between interaction modi (normal, snake slicer view or editing)

Parameters
modemode which should be switched to (see InteractionMode enum)

◆ toggleInteractorState

void iASlicerImpl::toggleInteractorState ( )
slot

Toggle interactor state of this slicer between enabled/disabled.

◆ triggerSliceRangeChange()

void iASlicerImpl::triggerSliceRangeChange ( )

call if the dimension of the input in direction of the slice axis has changed.

◆ update

void iASlicerImpl::update ( )
overrideslot

◆ updateChannel()

void iASlicerImpl::updateChannel ( uint  id,
iAChannelData const &  chData 
)
overridevirtual

Implements iASlicer.

◆ updateChannelMappers()

void iASlicerImpl::updateChannelMappers ( )
overridevirtual

Implements iASlicer.

◆ updateMagicLens()

void iASlicerImpl::updateMagicLens ( )
overridevirtual

Implements iASlicer.

◆ updateMagicLensColors()

void iASlicerImpl::updateMagicLensColors ( )
overridevirtual

Implements iASlicer.

◆ updateROI()

void iASlicerImpl::updateROI ( int const  roi[6])
overridevirtual

Implements iASlicer.


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