open_iA  2020.01
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 | Protected Member Functions | Protected Attributes | List of all members
iASlicer Class Reference

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

#include <iASlicer.h>

Inheritance diagram for iASlicer:
Collaboration diagram for iASlicer:

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)
 
void saveAsImage ()
 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 ()
 Save a movie of a full slice-through of the specimen from top to bottom. More...
 
bool setArbitraryProfile (int pointInd, double *Pos, bool doClamp=false)
 Sets coordinates for line profile. More...
 
void setArbitraryProfileOn (bool isOn)
 Toggle the possibility to move start and end point of the profile. More...
 
void setSlabCompositeMode (int compositeMode)
 
void setSlabThickness (int thickness)
 
void setSliceNumber (int sliceNumber)
 
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 ()
 

Signals

void addedPoint (double x, double y, double z)
 
void altMouseWheel (int angle)
 
void arbitraryProfileChanged (int pointInd, double *Pos)
 
void clicked ()
 
void clicked (int x, int y, int z)
 
void ctrlMouseWheel (int angle)
 
void dblClicked ()
 
void deletedSnakeLine ()
 
void deselectedPoint ()
 
void movedPoint (size_t selectedPointIndex, double xPos, double yPos, double zPos)
 
void msg (QString s)
 
void oslicerPos (int x, int y, int z, int mode)
 triggered on mouse move More...
 
void pick ()
 
void progress (int)
 
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 sliceRangeChanged (int minIdx, int maxIdx)
 
void sliceRotated ()
 triggered when slice was rotated More...
 
void switchedMode (int mode)
 
void updateSignal ()
 
void userInteraction ()
 

Public Member Functions

void addImageActor (vtkSmartPointer< vtkImageActor > imgActor)
 
void blend (vtkAlgorithmOutput *data1, vtkAlgorithmOutput *data2, double opacity, double *range)
 Blend two images. Should probably be implemented in terms of two channels? More...
 
vtkCamera * camera ()
 Access to the slicer's main renderer's camera. More...
 
void disableInteractor ()
 
void enableInteractor ()
 
void execute (vtkObject *caller, unsigned long eventId, void *callData)
 
 iASlicer (QWidget *parent, const iASlicerMode mode, bool decorations=true, bool magicLensAvailable=true, vtkAbstractTransform *transform=nullptr, vtkPoints *snakeSlicerPoints=nullptr)
 Creates a new slicer widget. More...
 
vtkRenderWindowInteractor * interactor ()
 Access to the interactor of this slicer's render window. More...
 
iASlicerMode mode () const
 Get the slice mode (which axis-aligned slice-plane is used for slicing). More...
 
QCursor mouseCursor ()
 
void removeImageActor (vtkSmartPointer< vtkImageActor > imgActor)
 
vtkRenderer * renderer ()
 Access to the slicer's main renderer. More...
 
vtkGenericOpenGLRenderWindow * renderWindow ()
 Access to the slicer's render window. More...
 
void resetCamera ()
 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)
 Sets the background color of the slicer. More...
 
void setCamera (vtkCamera *camera, bool camOwner=true)
 Set the camera for the slicer's main renderer. More...
 
void setDefaultInteractor ()
 
void setIndex (int x, int y, int z)
 
void setLinkedMdiChild (MdiChild *mdiChild)
 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)
 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)
 Set the position of the position marker (in slicer coordinates). More...
 
void setResliceAxesOrigin (double x, double y, double z)
 
void setRightButtonDragZoomEnabled (bool enabled)
 
void setScalarBarTF (vtkScalarsToColors *ctf)
 
void setShowText (bool isVisible)
 Enable/disable the tooltip text. More...
 
void setStatisticalExtent (int statExt)
 
void setTransform (vtkAbstractTransform *tr)
 
void setup (iASingleSlicerSettings const &settings)
 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
 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 ()
 
virtual ~iASlicer ()
 
void setMagicLensEnabled (bool isEnabled)
 Magic Lens methods. More...
 
void setMagicLensSize (int newSize)
 
int magicLensSize () const
 
void setMagicLensFrameWidth (int newWidth)
 
void setMagicLensCount (int count)
 
void setMagicLensInput (uint id)
 
uint magicLensInput () const
 
void setMagicLensOpacity (double opacity)
 
double magicLensOpacity () const
 
void updateMagicLensColors ()
 
void updateMagicLens ()
 
iAMagicLensmagicLens ()
 
void addChannel (uint id, iAChannelData const &chData, bool enable)
 management of channels - each channel represents one "layer" More...
 
void removeChannel (uint id)
 
void updateChannel (uint id, iAChannelData const &chData)
 
iAChannelSlicerDatachannel (uint id)
 
void setChannelOpacity (uint id, double opacity)
 
void enableChannel (uint id, bool enabled)
 
bool hasChannel (uint id) const
 
void setROIVisible (bool isVisible)
 ROI rectangle. More...
 
void updateROI (int const roi[6])
 
void setContours (int numberOfContours, double contourMin, double contourMax)
 set contour line parameters. More...
 
void setContours (int numberOfContours, double const *contourValues)
 

Protected Member Functions

void contextMenuEvent (QContextMenuEvent *event) override
 
void defaultOutput ()
 
void executeKeyPressEvent ()
 
void keyPressEvent (QKeyEvent *event) override
 
void mouseDoubleClickEvent (QMouseEvent *event) override
 
void mouseMoveEvent (QMouseEvent *event) override
 
void mousePressEvent (QMouseEvent *event) override
 
void mouseReleaseEvent (QMouseEvent *event) override
 
void printVoxelInformation ()
 
void resizeEvent (QResizeEvent *event) override
 
void updateBackground ()
 
void wheelEvent (QWheelEvent *) override
 

Protected Attributes

iAArbitraryProfileOnSlicerm_arbProfile
 implements drawing the start and end point of the "arbitrary" profile More...
 
QMenu * m_contextMenuMagicLens
 context menu for when magic lens is shown More...
 
QMenu * m_contextMenuSnakeSlicer
 context menu for when in snake slice edit mode More...
 
InteractionMode m_interactionMode
 current edit mode More...
 
bool m_isArbProfEnabled
 if arbitrary profile mode is enabled More...
 
bool m_isSliceProfEnabled
 if slice profile mode is enabled More...
 
iASlicerProfilem_sliceProfile
 implements the raw slice profile More...
 
iASnakeSplinem_snakeSpline
 holds the visualization data for the points of the snake splicer More...
 
vtkPoints * m_worldSnakePoints
 points of the snake slicer (owned by mdichild, not by this slicer) More...
 
int m_xInd
 
int m_yInd
 
int m_zInd
 current position More...
 

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

◆ iASlicer()

iASlicer::iASlicer ( 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).

◆ ~iASlicer()

iASlicer::~iASlicer ( )
virtual

Member Function Documentation

◆ addChannel()

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

management of channels - each channel represents one "layer"

◆ addedPoint

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

◆ addImageActor()

void iASlicer::addImageActor ( vtkSmartPointer< vtkImageActor >  imgActor)

◆ addPoint

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

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

◆ altMouseWheel

void iASlicer::altMouseWheel ( int  angle)
signal

◆ arbitraryProfileChanged

void iASlicer::arbitraryProfileChanged ( int  pointInd,
double *  Pos 
)
signal

◆ blend()

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

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

◆ camera()

vtkCamera * iASlicer::camera ( )

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

◆ channel()

iAChannelSlicerData * iASlicer::channel ( uint  id)

◆ clicked [1/2]

void iASlicer::clicked ( )
signal

◆ clicked [2/2]

void iASlicer::clicked ( int  x,
int  y,
int  z 
)
signal

◆ contextMenuEvent()

void iASlicer::contextMenuEvent ( QContextMenuEvent *  event)
overrideprotected

◆ ctrlMouseWheel

void iASlicer::ctrlMouseWheel ( int  angle)
signal

◆ dblClicked

void iASlicer::dblClicked ( )
signal

◆ defaultOutput()

void iASlicer::defaultOutput ( )
protected

◆ deletedSnakeLine

void iASlicer::deletedSnakeLine ( )
signal

◆ deleteSnakeLine

void iASlicer::deleteSnakeLine ( )
slot

Deletes the current spline curve.

◆ deselectedPoint

void iASlicer::deselectedPoint ( )
signal

◆ deselectPoint

void iASlicer::deselectPoint ( )
slot

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

◆ disableInteractor()

void iASlicer::disableInteractor ( )

◆ enableChannel()

void iASlicer::enableChannel ( uint  id,
bool  enabled 
)

◆ enableInteractor()

void iASlicer::enableInteractor ( )

◆ execute()

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

◆ executeKeyPressEvent()

void iASlicer::executeKeyPressEvent ( )
protected

◆ hasChannel()

bool iASlicer::hasChannel ( uint  id) const

◆ interactor()

vtkRenderWindowInteractor * iASlicer::interactor ( )

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

◆ keyPressEvent()

void iASlicer::keyPressEvent ( QKeyEvent *  event)
overrideprotected

◆ magicLens()

iAMagicLens * iASlicer::magicLens ( )

◆ magicLensInput()

uint iASlicer::magicLensInput ( ) const

◆ magicLensOpacity()

double iASlicer::magicLensOpacity ( ) const

◆ magicLensSize()

int iASlicer::magicLensSize ( ) const

◆ menuDeleteSnakeLine

void iASlicer::menuDeleteSnakeLine ( )
slot

Called when the delete snake line menu is clicked.

◆ mode()

iASlicerMode iASlicer::mode ( ) const

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

◆ mouseCursor()

QCursor iASlicer::mouseCursor ( )

◆ mouseDoubleClickEvent()

void iASlicer::mouseDoubleClickEvent ( QMouseEvent *  event)
overrideprotected

◆ mouseMoveEvent()

void iASlicer::mouseMoveEvent ( QMouseEvent *  event)
overrideprotected

◆ mousePressEvent()

void iASlicer::mousePressEvent ( QMouseEvent *  event)
overrideprotected

◆ mouseReleaseEvent()

void iASlicer::mouseReleaseEvent ( QMouseEvent *  event)
overrideprotected

◆ movedPoint

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

◆ movePoint

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

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

◆ msg

void iASlicer::msg ( QString  s)
signal

◆ oslicerPos

void iASlicer::oslicerPos ( int  x,
int  y,
int  z,
int  mode 
)
signal

triggered on mouse move

◆ pick

void iASlicer::pick ( )
signal

◆ printVoxelInformation()

void iASlicer::printVoxelInformation ( )
protected

◆ progress

void iASlicer::progress ( int  )
signal

◆ released

void iASlicer::released ( int  x,
int  y,
int  z 
)
signal

◆ removeChannel()

void iASlicer::removeChannel ( uint  id)

◆ removeImageActor()

void iASlicer::removeImageActor ( vtkSmartPointer< vtkImageActor >  imgActor)

◆ renderer()

vtkRenderer * iASlicer::renderer ( )

Access to the slicer's main renderer.

◆ renderWindow()

vtkGenericOpenGLRenderWindow * iASlicer::renderWindow ( )

Access to the slicer's render window.

◆ resetCamera()

void iASlicer::resetCamera ( )

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

◆ resizeEvent()

void iASlicer::resizeEvent ( QResizeEvent *  event)
overrideprotected

◆ rightClicked

void iASlicer::rightClicked ( int  x,
int  y,
int  z 
)
signal

◆ rotateSlice

void iASlicer::rotateSlice ( double  angle)
slot

◆ saveAsImage

void iASlicer::saveAsImage ( )
slot

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

◆ saveImageStack

void iASlicer::saveImageStack ( )
slot

Save an image stack of the current view.

◆ saveMovie

void iASlicer::saveMovie ( )
slot

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

◆ saveSliceMovie()

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

◆ setArbitraryProfile

bool iASlicer::setArbitraryProfile ( int  pointInd,
double *  Pos,
bool  doClamp = false 
)
slot

Sets coordinates for line profile.

◆ setArbitraryProfileOn

void iASlicer::setArbitraryProfileOn ( bool  isOn)
slot

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

◆ setBackground()

void iASlicer::setBackground ( double  r,
double  g,
double  b 
)

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)

◆ setCamera()

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

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

◆ setChannelOpacity()

void iASlicer::setChannelOpacity ( uint  id,
double  opacity 
)

◆ setContours() [1/2]

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

◆ setContours() [2/2]

void iASlicer::setContours ( int  numberOfContours,
double  contourMin,
double  contourMax 
)

set contour line parameters.

◆ setDefaultInteractor()

void iASlicer::setDefaultInteractor ( )

◆ setIndex()

void iASlicer::setIndex ( int  x,
int  y,
int  z 
)

◆ setLinkedMdiChild()

void iASlicer::setLinkedMdiChild ( MdiChild mdiChild)

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

◆ setMagicLensCount()

void iASlicer::setMagicLensCount ( int  count)

◆ setMagicLensEnabled()

void iASlicer::setMagicLensEnabled ( bool  isEnabled)

Magic Lens methods.

◆ setMagicLensFrameWidth()

void iASlicer::setMagicLensFrameWidth ( int  newWidth)

◆ setMagicLensInput()

void iASlicer::setMagicLensInput ( uint  id)

◆ setMagicLensOpacity()

void iASlicer::setMagicLensOpacity ( double  opacity)

◆ setMagicLensSize()

void iASlicer::setMagicLensSize ( int  newSize)

◆ setMode()

void iASlicer::setMode ( const iASlicerMode  mode)

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

◆ setMouseCursor()

void iASlicer::setMouseCursor ( QString const &  s)

◆ setPositionMarkerCenter()

void iASlicer::setPositionMarkerCenter ( double  x,
double  y 
)

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

◆ setResliceAxesOrigin()

void iASlicer::setResliceAxesOrigin ( double  x,
double  y,
double  z 
)

◆ setRightButtonDragZoomEnabled()

void iASlicer::setRightButtonDragZoomEnabled ( bool  enabled)

◆ setROIVisible()

void iASlicer::setROIVisible ( bool  isVisible)

ROI rectangle.

◆ setScalarBarTF()

void iASlicer::setScalarBarTF ( vtkScalarsToColors *  ctf)

◆ setShowText()

void iASlicer::setShowText ( bool  isVisible)

Enable/disable the tooltip text.

◆ setSlabCompositeMode

void iASlicer::setSlabCompositeMode ( int  compositeMode)
slot

◆ setSlabThickness

void iASlicer::setSlabThickness ( int  thickness)
slot

◆ setSliceNumber

void iASlicer::setSliceNumber ( int  sliceNumber)
slot

◆ setSliceProfileOn

void iASlicer::setSliceProfileOn ( bool  isOn)
slot

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

◆ setStatisticalExtent()

void iASlicer::setStatisticalExtent ( int  statExt)

◆ setTransform()

void iASlicer::setTransform ( vtkAbstractTransform *  tr)

◆ setup()

void iASlicer::setup ( iASingleSlicerSettings const &  settings)

Sets up the slicer with the given settings.

◆ shiftMouseWheel

void iASlicer::shiftMouseWheel ( int  angle)
signal

◆ showIsolines()

void iASlicer::showIsolines ( bool  s)

Enable/disable contour lines.

◆ showPosition()

void iASlicer::showPosition ( bool  s)

◆ sliceNumber()

int iASlicer::sliceNumber ( ) const

Get current slice number.

◆ sliceNumberChanged

void iASlicer::sliceNumberChanged ( int  mode,
int  sliceNumber 
)
signal

triggered when slice number changed.

Parameters
modeslicer mode (=plane)
sliceNumbernumber of the slice that was switched to

◆ sliceRangeChanged

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

◆ sliceRotated

void iASlicer::sliceRotated ( )
signal

triggered when slice was rotated

◆ switchedMode

void iASlicer::switchedMode ( int  mode)
signal

◆ switchInteractionMode

void iASlicer::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 iASlicer::toggleInteractorState ( )
slot

Toggle interactor state of this slicer between enabled/disabled.

◆ triggerSliceRangeChange()

void iASlicer::triggerSliceRangeChange ( )

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

◆ update

void iASlicer::update ( )
slot

◆ updateBackground()

void iASlicer::updateBackground ( )
protected

◆ updateChannel()

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

◆ updateChannelMappers()

void iASlicer::updateChannelMappers ( )

◆ updateMagicLens()

void iASlicer::updateMagicLens ( )

◆ updateMagicLensColors()

void iASlicer::updateMagicLensColors ( )

◆ updateROI()

void iASlicer::updateROI ( int const  roi[6])

◆ updateSignal

void iASlicer::updateSignal ( )
signal

◆ userInteraction

void iASlicer::userInteraction ( )
signal

◆ wheelEvent()

void iASlicer::wheelEvent ( QWheelEvent *  event)
overrideprotected

Member Data Documentation

◆ m_arbProfile

iAArbitraryProfileOnSlicer* iASlicer::m_arbProfile
protected

implements drawing the start and end point of the "arbitrary" profile

◆ m_contextMenuMagicLens

QMenu* iASlicer::m_contextMenuMagicLens
protected

context menu for when magic lens is shown

◆ m_contextMenuSnakeSlicer

QMenu* iASlicer::m_contextMenuSnakeSlicer
protected

context menu for when in snake slice edit mode

◆ m_interactionMode

InteractionMode iASlicer::m_interactionMode
protected

current edit mode

◆ m_isArbProfEnabled

bool iASlicer::m_isArbProfEnabled
protected

if arbitrary profile mode is enabled

◆ m_isSliceProfEnabled

bool iASlicer::m_isSliceProfEnabled
protected

if slice profile mode is enabled

◆ m_sliceProfile

iASlicerProfile* iASlicer::m_sliceProfile
protected

implements the raw slice profile

◆ m_snakeSpline

iASnakeSpline* iASlicer::m_snakeSpline
protected

holds the visualization data for the points of the snake splicer

◆ m_worldSnakePoints

vtkPoints* iASlicer::m_worldSnakePoints
protected

points of the snake slicer (owned by mdichild, not by this slicer)

◆ m_xInd

int iASlicer::m_xInd
protected

◆ m_yInd

int iASlicer::m_yInd
protected

◆ m_zInd

int iASlicer::m_zInd
protected

current position


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