Show the mesh contour in the slice viewers. More...
#include <MeshProjection.h>
Public Slots | |
virtual camitk::Action::ApplyStatus | apply () |
this method is automatically called when the action is triggered. More... | |
void | hide () |
remove the contour from the viewers if the mesh is closed / destroyed More... | |
void | updateCuttingPlane () |
this slots is called when the user changes the selected slice to update the contour More... | |
Public Slots inherited from camitk::Action | |
virtual camitk::Action::ApplyStatus | apply ()=0 |
This method is called when the action has to be applied on the target list (get the target lists using getTargets()) It calls the algorithm of your action on the target list of components. More... | |
camitk::Action::ApplyStatus | applyAndRegister () |
This method is called whenever the action has to be applied on the target list (like the apply()) method AND registered within the application history of actions. More... | |
camitk::Action::ApplyStatus | trigger (QWidget *parent=nullptr) |
This method triggers the action. More... | |
Public Member Functions | |
virtual bool | event (QEvent *e) |
manage property modification immediatly More... | |
virtual QWidget * | getWidget () |
method called when the action when the action is triggered (i.e. started) More... | |
MeshProjection (camitk::ActionExtension *) | |
Default Constructor. More... | |
virtual | ~MeshProjection () |
Default Destructor. More... | |
Public Member Functions inherited from camitk::Action | |
Action (ActionExtension *) | |
Default Constructor: the ActionExtension is needed. More... | |
~Action () override | |
Destructor. More... | |
virtual QAction * | getQAction (Component *target=nullptr) |
Get the corresponding QAction. More... | |
QString | getName () const |
get the name of the action More... | |
QString | getDescription () const |
the description of the action More... | |
QString | getComponent () const |
the name of the component class that can be used by this action More... | |
QString | getFamily () const |
the name of the family in which this action is associated More... | |
QString | getExtensionName () const |
the name of the extension in the family in which this action is associated More... | |
QStringList | getTag () const |
the name of the tag called this action More... | |
bool | getEmbedded () const |
argument use to know if the widget is embedded or not More... | |
virtual QPixmap | getIcon () |
the icon to personalize the action (no icon by default) More... | |
const ComponentList | getTargets () const |
the currently selected and valid (regarding the component property) components, for which this action is called More... | |
void | updateTargets () |
update the target list using the currently selected components More... | |
bool | getAutoUpdateProperties () const |
void | setAutoUpdateProperties (bool) |
are the properties to be udpated every time the user makes a change in the widget (default is false)? More... | |
virtual Q_INVOKABLE camitk::Property * | getProperty (QString name) |
Get a Property given its name. More... | |
virtual bool | addParameter (Property *) |
Add a new parameter to the action, using the CamiTK property class. More... | |
void | applyTargetPosition (Component *input, Component *target) |
Change the target frame according to the default frame policy regarding the input's one. More... | |
void | applyTargetPosition (Component *input, Component *target, Application::TargetPositionningPolicy policy) |
Change the target frame according to a given frame policy regarding the input's one. More... | |
ApplyStatus | applyInPipeline () |
This method encapsulates the apply() method. More... | |
void | setInputComponents (ComponentList inputs) |
Specify the input Component(s) Only applyInPipeline() should be called with this method (maybe apply), but not trigger() as its first intruction is to clear the target components list !!! More... | |
void | setInputComponent (Component *input) |
Specify the input Components in case of only one Component. More... | |
ComponentList | getOutputComponents () |
Returns the output Component(s) More... | |
Component * | getOutputComponent () |
Returns the output Components in case of only one Component. More... | |
Private Member Functions | |
vtkSmartPointer< vtkActor > | getNewActor (camitk::Slice::SliceOrientation) |
create an actor for the contour. The color of the new actor depends on the current orientation More... | |
vtkSmartPointer< vtkPlane > | getNewPlane (camitk::Slice::SliceOrientation) |
create a plane for a given orientation More... | |
int | getOrientationIndex (camitk::Slice::SliceOrientation) |
get the dimension index corresponding to the current orientation 0 is the index for sagittal dimension, 1 for the coronal orientation and 2 is for the axial orientation More... | |
camitk::InteractiveViewer * | getViewer (camitk::Slice::SliceOrientation) |
get the slice viewer corresponding to the orientation More... | |
double | getVoxelSize (camitk::Slice::SliceOrientation) |
get the voxel slice in the correct orientation More... | |
void | updateComponents (camitk::MeshComponent *) |
update the managed mesh and check the change in the image component using the corresponding property More... | |
void | updateContourLineWidth () |
update the contour line width using the corresponding property value More... | |
void | updateCuttingPlane (camitk::Slice::SliceOrientation) |
update the cutting plane position depending on the current slice and the given orientation More... | |
void | updateVisibility () |
show/hide the contour in a viewer More... | |
Private Attributes | |
QMap< camitk::Slice::SliceOrientation, vtkSmartPointer< vtkActor > > | contourActorIn2DViewerMap |
the mesh contours in the 2D views (with the proper transform that makes it appear in the slice viewer) More... | |
QMap< camitk::Slice::SliceOrientation, vtkSmartPointer< vtkActor > > | contourActorMap |
the mesh contours in the 3D view (where the mesh actually is), one for each orientation More... | |
QMap< camitk::Slice::SliceOrientation, vtkSmartPointer< vtkPolyDataMapper > > | cutterMapperMap |
the contour mappers (input for both 3D and 2D actors) More... | |
QMap< camitk::Slice::SliceOrientation, vtkSmartPointer< vtkPlane > > | cuttingPlaneMap |
the cutting planes: the contour is the intersection between these planes and the mesh More... | |
QList< camitk::ImageComponent * > | imageComponentList |
camitk::MeshComponent * | meshToProject |
current mesh component More... | |
camitk::ImageComponent * | targetImage |
current image component to project onto More... | |
Additional Inherited Members | |
Public Types inherited from camitk::Action | |
enum | ApplyStatus { SUCCESS, ERROR, WARNING, ABORTED, TRIGGERED } |
Static Public Member Functions inherited from camitk::Action | |
static QString | getStatusAsString (ApplyStatus) |
Protected Member Functions inherited from camitk::Action | |
void | setName (QString name) |
void | setDescription (QString description) |
the description of the action More... | |
void | setComponent (QString component) |
the name of the component class that can be used by this action More... | |
void | setFamily (QString family) |
the name of the family in which this action is associated More... | |
void | addTag (QString tag) |
add a tag to the tags list of this action More... | |
void | setEmbedded (bool isEmbedded) |
set the embedded property (an action is embedded by default, unless specified otherwise by explicitly calling this method with false) More... | |
void | setIcon (QPixmap) |
set the Pixmap More... | |
Protected Attributes inherited from camitk::Action | |
QWidget * | actionWidget |
the action widget More... | |
Show the mesh contour in the slice viewers.
This action needs two input components: a mesh component and an image component.
The projection of a mesh is displayed as contour onto an image on each slice viewer (sagittal, coronal and axial) in respectively red, green and blue color.
MeshProjection::MeshProjection | ( | camitk::ActionExtension * | extension | ) |
Default Constructor.
References camitk::Action::addParameter(), camitk::Action::addTag(), meshToProject, camitk::Property::setAttribute(), camitk::Action::setAutoUpdateProperties(), camitk::Action::setComponent(), camitk::Action::setDescription(), camitk::Property::setEnumTypeName(), camitk::Action::setFamily(), camitk::Action::setName(), and targetImage.
|
virtual |
Default Destructor.
|
virtualslot |
this method is automatically called when the action is triggered.
Call getTargets() method to get the list of components to use.
References camitk::refresh(), and camitk::Action::SUCCESS.
|
virtual |
manage property modification immediatly
References meshToProject, camitk::refresh(), updateComponents(), and updateVisibility().
|
private |
create an actor for the contour. The color of the new actor depends on the current orientation
References cutterMapperMap, and getOrientationIndex().
Referenced by updateVisibility().
|
private |
create a plane for a given orientation
References camitk::ImageComponent::getArbitrarySlices(), camitk::ArbitrarySingleImageComponent::getImageCenterAndTranslationVectorInParent(), getOrientationIndex(), camitk::Component::getTransformFromWorld(), and targetImage.
Referenced by updateVisibility().
|
private |
get the dimension index corresponding to the current orientation 0 is the index for sagittal dimension, 1 for the coronal orientation and 2 is for the axial orientation
Referenced by getNewActor(), getNewPlane(), getVoxelSize(), updateCuttingPlane(), and updateVisibility().
|
private |
get the slice viewer corresponding to the orientation
Referenced by updateVisibility().
|
private |
get the voxel slice in the correct orientation
References camitk::ImageComponent::getImageData(), getOrientationIndex(), and targetImage.
Referenced by updateCuttingPlane(), and updateVisibility().
|
virtual |
method called when the action when the action is triggered (i.e. started)
Reimplemented from camitk::Action.
References CAMITK_WARNING, camitk::Component::getName(), camitk::Action::getProperty(), camitk::Action::getTargets(), imageComponentList, camitk::Property::setAttribute(), and updateComponents().
|
slot |
remove the contour from the viewers if the mesh is closed / destroyed
Referenced by updateComponents().
|
private |
update the managed mesh and check the change in the image component using the corresponding property
References hide(), imageComponentList, meshToProject, and targetImage.
Referenced by event(), and getWidget().
|
private |
update the contour line width using the corresponding property value
References contourActorIn2DViewerMap, and contourActorMap.
|
slot |
this slots is called when the user changes the selected slice to update the contour
Referenced by updateVisibility().
|
private |
update the cutting plane position depending on the current slice and the given orientation
References contourActorIn2DViewerMap, cuttingPlaneMap, camitk::ImageComponent::getArbitrarySlices(), camitk::ImageComponent::getAxialSlices(), camitk::ImageComponent::getCoronalSlices(), camitk::ArbitrarySingleImageComponent::getImageCenterInParent(), getOrientationIndex(), camitk::ImageComponent::getSagittalSlices(), camitk::Component::getSlice(), camitk::Component::getTransformFromWorld(), getVoxelSize(), and targetImage.
|
private |
show/hide the contour in a viewer
References CAMITK_WARNING, contourActorIn2DViewerMap, contourActorMap, cutterMapperMap, cuttingPlaneMap, camitk::ImageComponent::getArbitrarySlices(), getNewActor(), getNewPlane(), getOrientationIndex(), camitk::InterfaceGeometry::getPointSet(), camitk::InteractiveViewer::getRendererWidget(), camitk::Component::getTransformFromWorld(), getViewer(), getVoxelSize(), meshToProject, targetImage, and updateCuttingPlane().
Referenced by event().
|
private |
the mesh contours in the 2D views (with the proper transform that makes it appear in the slice viewer)
Referenced by updateContourLineWidth(), updateCuttingPlane(), and updateVisibility().
|
private |
the mesh contours in the 3D view (where the mesh actually is), one for each orientation
Referenced by updateContourLineWidth(), and updateVisibility().
|
private |
the contour mappers (input for both 3D and 2D actors)
Referenced by getNewActor(), and updateVisibility().
|
private |
the cutting planes: the contour is the intersection between these planes and the mesh
Referenced by updateCuttingPlane(), and updateVisibility().
|
private |
Referenced by getWidget(), and updateComponents().
|
private |
current mesh component
Referenced by event(), MeshProjection(), updateComponents(), and updateVisibility().
|
private |
current image component to project onto
Referenced by getNewPlane(), getVoxelSize(), MeshProjection(), updateComponents(), updateCuttingPlane(), and updateVisibility().