Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkSlicerSegmentEditorLogic Class Reference

Helper segment editor logic for qMRMLSegmentEditorWidget and its associated effects. More...

#include <Modules/Loadable/Segmentations/Logic/vtkSlicerSegmentEditorLogic.h>

Inheritance diagram for vtkSlicerSegmentEditorLogic:
Collaboration diagram for vtkSlicerSegmentEditorLogic:

Public Types

enum  Events { SegmentationHistoryChangedEvent = vtkCommand::UserEvent + 1 , PauseRenderEvent , ResumeRenderEvent }
 
enum  ModificationMode { ModificationModeSet , ModificationModeAdd , ModificationModeRemove , ModificationModeRemoveAll }
 
typedef vtkMRMLAbstractLogic Superclass
 
- Public Types inherited from vtkMRMLAbstractLogic
typedef vtkObject Superclass
 
typedef void(vtkMRMLAbstractLogic::* TaskFunctionPointer) (void *clientdata)
 

Public Member Functions

std::string AddEmptySegment (const std::string &segmentId="", int segmentStatus=0) const
 
bool CanAddSegments () const
 
bool CanRedo () const
 
bool CanRemoveSegments () const
 
bool CanTriviallyConvertSourceRepresentationToBinaryLabelMap () const
 
bool CanUndo () const
 
void ClearUndoState () const
 Clears the Undo/Redo history.
 
bool ContainsClosedSurfaceRepresentation () const
 true if the current segmentation is valid and contains a closed surface representation
 
void CreateAndSetBlankSourceVolumeFromSegmentationGeometry () const
 Creates a blank source volume matching the segmentation geometry. Usually called when no source volume is currently set.
 
void CreateAndSetBlankSourceVolumeIfNeeded () const
 If no source volume is selected but a valid geometry is specified then create and store a blank source volume.
 
void ExportSegmentationToColorTableNode () const
 Export the current segmentation to a new color table node.
 
vtkOrientedImageDataGetAlignedSourceVolume () const
 Current aligned source volume.
 
virtual const char * GetClassName ()
 
std::string GetCurrentSegmentID () const
 
int GetCurrentSegmentIndex () const
 Returns the current segmentation segment index. -1 if invalid.
 
std::string GetDefaultTerminologyEntry () const
 Returns the terminology entry value used as default when adding empty segments.
 
vtkOrientedImageDataGetMaskLabelmap () const
 Returns the current mask labelmap.
 
int GetMaximumNumberOfUndoStates () const
 Get maximum number of saved undo/redo states.
 
vtkOrientedImageDataGetModifierLabelmap () const
 Returns the current modifier label map.
 
std::string GetNextSegmentID (int offset, bool visibleOnly) const
 Returns the segment ID at given offset.
 
vtkOrientedImageDataGetReferenceGeometryImage () const
 Returns the current reference geometry image.
 
std::string GetReferenceImageGeometryString () const
 Returns the current reference geometry string.
 
vtkSegmentationGetSegmentation () const
 Current segmentation associated with the segmentation node.
 
bool GetSegmentationIJKToRAS (vtkMatrix4x4 *ijkToRas) const
 
vtkMRMLSegmentationNodeGetSegmentationNode () const
 Get currently selected segmentation MRML node.
 
vtkMRMLSegmentEditorNodeGetSegmentEditorNode () const
 Get the segment editor parameter set node.
 
std::vector< std::string > GetSegmentIDs () const
 Return all the segment IDS present in the segmentation. Empty if invalid or no segment.
 
vtkSegmentGetSelectedSegment () const
 Get the current segment. nullptr if invalid or no selection.
 
vtkOrientedImageDataGetSelectedSegmentLabelmap () const
 Get the current segments labelmap.
 
double GetSliceSpacing (vtkMRMLSliceNode *sliceNode) const
 Return the slice spacing matching the input slice node.
 
vtkMRMLScalarVolumeNodeGetSourceVolumeNode () const
 Get the current volume node.
 
bool GetVerbose () const
 Returns warning verbosity.
 
std::vector< std::string > GetVisibleSegmentIDs () const
 Return all segment currently visible in any view.
 
virtual int IsA (const char *type)
 
bool IsSegmentationDisplayableInView (vtkMRMLAbstractViewNode *viewNode) const
 Return true if the current segmentation is displayed in the input view node. False if invalid segmentation or view node.
 
bool IsSegmentationNodeValid () const
 Return true if the current segmentation node is valid.
 
bool IsSegmentIdValid (const std::string &segmentId) const
 Return true when Segment ID is defined and present in the current segmentation.
 
bool IsSegmentIdVisible (const std::string &segmentID) const
 Return true if the segment ID is visible in any view. False if not visible or invalid.
 
bool IsSelectedSegmentVisible () const
 Return true if the current segment is visible in any view.
 
void ModifySegmentByLabelmap (vtkMRMLSegmentationNode *segmentationNode, const char *segmentID, vtkOrientedImageData *modifierLabelmap, ModificationMode modificationMode, bool isPerSegment, bool bypassMasking)
 
void ModifySegmentByLabelmap (vtkMRMLSegmentationNode *segmentationNode, const char *segmentID, vtkOrientedImageData *modifierLabelmap, ModificationMode modificationMode, const int modificationExtent[6], bool isPerSegment, bool bypassMasking)
 
void PauseRender ()
 Trigger the PauseRenderEvent.
 
void Redo () const
 Restores next saved state of the segmentation.
 
std::string RemoveSelectedSegment () const
 Remove the current segment and return the following segment in the list if any valid.
 
bool ResetModifierLabelmapToDefault () const
 
void ResumeRender ()
 Trigger the ResumeRenderEvent.
 
bool SaveStateForUndo () const
 
void SelectFirstSegment (bool visibleOnly) const
 Selects the first segment in the current segmentation.
 
void SelectNextSegment (bool visibleOnly) const
 Selects the next segment in the current segmentation.
 
void SelectPreviousSegment (bool visibleOnly) const
 Selects the previous segment in the current segmentation.
 
void SelectSegmentAtOffset (int offset, bool visibleOnly) const
 
void SetCurrentSegmentID (const std::string &segmentID) const
 Set selected segment by its ID.
 
void SetDefaultTerminologyEntry (const std::string &entry)
 Set the default terminology to use when adding new segments.
 
void SetMaximumNumberOfUndoStates (int) const
 Set maximum number of saved undo/redo states.
 
void SetSegmentationHistory (const vtkSmartPointer< vtkSegmentationHistory > &segmentationHistory)
 
void SetSegmentationNode (vtkMRMLNode *node) const
 Set segmentation MRML node.
 
void SetSegmentationNodeID (const std::string &nodeID) const
 Set segmentation MRML node by its ID.
 
void SetSegmentEditorNode (vtkMRMLSegmentEditorNode *newSegmentEditorNode)
 Set the segment editor parameter set node.
 
bool SetSourceRepresentationToBinaryLabelMap () const
 
void SetSourceVolumeNode (vtkMRMLNode *node) const
 
void SetSourceVolumeNodeID (const std::string &nodeID) const
 Set source volume MRML node by its ID.
 
void SetVerbose (bool isVerbose)
 
void ToggleSegmentationSurfaceRepresentation (bool isSurfaceRepresentationOn) const
 Create/remove closed surface model for the segmentation that is automatically updated when editing.
 
void ToggleSourceVolumeIntensityMask () const
 Toggle the intensity mask currently set on the segmentation.
 
bool TrivialSetSourceRepresentationToBinaryLabelmap () const
 
void Undo () const
 Restores previous saved state of the segmentation.
 
bool UpdateAlignedSourceVolume ()
 Updates a resampled source volume in a geometry aligned with default modifierLabelmap.
 
bool UpdateMaskLabelmap () const
 
bool UpdateReferenceGeometryImage () const
 Update the reference geometry image to the current segmentation.
 
bool UpdateSelectedSegmentLabelmap () const
 Updates selected segment labelmap in a geometry aligned with default modifierLabelmap.
 
void UpdateVolume (void *volumeToUpdate, bool &success)
 
- Public Member Functions inherited from vtkMRMLAbstractLogic
virtual vtkMRMLApplicationLogicGetMRMLApplicationLogic () const
 Get access to overall application state.
 
vtkMRMLSceneGetMRMLScene () const
 Return a reference to the current MRML scene.
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
virtual void SetMRMLApplicationLogic (vtkMRMLApplicationLogic *logic)
 
void SetMRMLScene (vtkMRMLScene *newScene)
 Set and observe the MRMLScene.
 

Static Public Member Functions

static void AppendImage (vtkOrientedImageData *inputImage, vtkOrientedImageData *appendedImage)
 Append image onto image. Resamples appended image and saves result in input image.
 
static void AppendPolyMask (vtkOrientedImageData *input, vtkPolyData *polyData, vtkMRMLSliceNode *sliceNode, vtkMRMLSegmentationNode *segmentationNode=nullptr)
 Rasterize a poly data onto the input image into the slice view.
 
static void CreateMaskImageFromPolyData (vtkPolyData *polyData, vtkOrientedImageData *outputMask, vtkMRMLSliceNode *sliceNode)
 Create a slice view screen space (2D) mask image for the given polydata.
 
static std::string GetReferenceImageGeometryStringFromSegmentation (vtkSegmentation *segmentation)
 Returns the reference geometry string matching the input segmentation.
 
static double GetSliceSpacing (vtkMRMLSliceNode *sliceNode, vtkMRMLSliceLogic *sliceLogic)
 
static void ImageToWorldMatrix (vtkMRMLVolumeNode *node, vtkMatrix4x4 *ijkToRas)
 
static void ImageToWorldMatrix (vtkOrientedImageData *image, vtkMRMLSegmentationNode *node, vtkMatrix4x4 *ijkToRas)
 
static bool IsSegmentIdInList (const std::string &segmentID, const std::vector< std::string > &visibleSegmentIDs)
 Return true if the segment ID is present in the input list.
 
static int IsTypeOf (const char *type)
 
static vtkSlicerSegmentEditorLogicNew ()
 
static std::array< int, 2 > RasToXy (double ras[3], vtkMRMLSliceNode *sliceNode)
 Convert RAS position to XY in-slice position.
 
static vtkSlicerSegmentEditorLogicSafeDownCast (vtkObject *o)
 
static void XyToIjk (double xy[2], int outputIjk[3], vtkMRMLSliceNode *sliceNode, vtkOrientedImageData *image, vtkMRMLTransformNode *parentTransform=nullptr)
 Convert XY in-slice position to image IJK position.
 
static void XyToIjk (int xy[2], int outputIjk[3], vtkMRMLSliceNode *sliceNode, vtkOrientedImageData *image, vtkMRMLTransformNode *parentTransform=nullptr)
 Convert XY in-slice position to image IJK position.
 
static std::array< int, 3 > XyToIjk (int xy[2], vtkMRMLSliceNode *sliceNode, vtkOrientedImageData *image, vtkMRMLTransformNode *parentTransform=nullptr)
 Convert XY in-slice position to image IJK position, python accessor method.
 
static void XyToRas (double xy[2], double outputRas[3], vtkMRMLSliceNode *sliceNode)
 Convert XY in-slice position to RAS position.
 
static void XyToRas (int xy[2], double outputRas[3], vtkMRMLSliceNode *sliceNode)
 Convert XY in-slice position to RAS position.
 
static std::array< double, 3 > XyToRas (int xy[2], vtkMRMLSliceNode *sliceNode)
 Convert XY in-slice position to RAS position, python accessor method.
 
static void XyzToIjk (double inputXyz[3], int outputIjk[3], vtkMRMLSliceNode *sliceNode, vtkOrientedImageData *image, vtkMRMLTransformNode *parentTransform=nullptr)
 Convert XYZ slice view position to image IJK position,.
 
static std::array< int, 3 > XyzToIjk (double inputXyz[3], vtkMRMLSliceNode *sliceNode, vtkOrientedImageData *image, vtkMRMLTransformNode *parentTransform=nullptr)
 Convert XYZ slice view position to image IJK position, python accessor method,.
 
static void XyzToRas (double inputXyz[3], double outputRas[3], vtkMRMLSliceNode *sliceNode)
 
static std::array< double, 3 > XyzToRas (double inputXyz[3], vtkMRMLSliceNode *sliceNode)
 
- Static Public Member Functions inherited from vtkMRMLAbstractLogic
static int IsTypeOf (const char *type)
 
static vtkMRMLAbstractLogicNew ()
 
static vtkMRMLAbstractLogicSafeDownCast (vtkObject *o)
 

Protected Member Functions

void ProcessMRMLNodesEvents (vtkObject *caller, unsigned long event, void *callData) override
 Update segment editor node, segmentation node and segment history observers.
 
 vtkSlicerSegmentEditorLogic ()
 
 ~vtkSlicerSegmentEditorLogic () override
 
- Protected Member Functions inherited from vtkMRMLAbstractLogic
int EndModify (bool wasModifying)
 
virtual bool EnterMRMLLogicsCallback () const
 
virtual bool EnterMRMLNodesCallback () const
 
virtual bool EnterMRMLSceneCallback () const
 
bool GetDisableModifiedEvent () const
 
int GetInMRMLLogicsCallbackFlag () const
 
int GetInMRMLNodesCallbackFlag () const
 
int GetInMRMLSceneCallbackFlag () const
 
vtkCallbackCommand * GetMRMLLogicsCallbackCommand ()
 
vtkObserverManagerGetMRMLLogicsObserverManager () const
 
vtkCallbackCommand * GetMRMLNodesCallbackCommand ()
 
vtkObserverManagerGetMRMLNodesObserverManager () const
 
vtkCallbackCommand * GetMRMLSceneCallbackCommand ()
 
vtkObserverManagerGetMRMLSceneObserverManager () const
 
int GetPendingModifiedEventCount () const
 
int GetProcessingMRMLSceneEvent () const
 Return the event id currently processed or 0 if any.
 
int InvokePendingModifiedEvent ()
 
void Modified () override
 
virtual void ObserveMRMLScene ()
 
virtual void OnMRMLNodeModified (vtkMRMLNode *)
 
virtual void OnMRMLSceneEndBatchProcess ()
 
virtual void OnMRMLSceneEndClose ()
 
virtual void OnMRMLSceneEndImport ()
 
virtual void OnMRMLSceneEndRestore ()
 
virtual void OnMRMLSceneNew ()
 
virtual void OnMRMLSceneNodeAdded (vtkMRMLNode *)
 
virtual void OnMRMLSceneNodeRemoved (vtkMRMLNode *)
 
virtual void OnMRMLSceneStartBatchProcess ()
 
virtual void OnMRMLSceneStartClose ()
 
virtual void OnMRMLSceneStartImport ()
 
virtual void OnMRMLSceneStartRestore ()
 
virtual void ProcessMRMLLogicsEvents (vtkObject *caller, unsigned long event, void *callData)
 
virtual void ProcessMRMLSceneEvents (vtkObject *caller, unsigned long event, void *callData)
 
virtual void RegisterNodes ()
 
void SetAndObserveMRMLSceneEventsInternal (vtkMRMLScene *newScene, vtkIntArray *events, vtkFloatArray *priorities=nullptr)
 
void SetDisableModifiedEvent (bool onOff)
 
void SetInMRMLLogicsCallbackFlag (int flag)
 
void SetInMRMLNodesCallbackFlag (int flag)
 
void SetInMRMLSceneCallbackFlag (int flag)
 
virtual void SetMRMLSceneInternal (vtkMRMLScene *newScene)
 
void SetProcessingMRMLSceneEvent (int event)
 
bool StartModify ()
 
virtual void UnobserveMRMLScene ()
 
virtual void UpdateFromMRMLScene ()
 
 vtkMRMLAbstractLogic ()
 
 ~vtkMRMLAbstractLogic () override
 

Additional Inherited Members

- Static Protected Member Functions inherited from vtkMRMLAbstractLogic
static void MRMLLogicsCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData)
 MRMLLogicCallback is a static function to relay modified events from the logics.
 
static void MRMLNodesCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData)
 MRMLNodesCallback is a static function to relay modified events from the nodes.
 
static void MRMLSceneCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData)
 

Detailed Description

Helper segment editor logic for qMRMLSegmentEditorWidget and its associated effects.

Provides common logic to access and modify the segmentation.

Definition at line 62 of file vtkSlicerSegmentEditorLogic.h.

Member Typedef Documentation

◆ Superclass

Member Enumeration Documentation

◆ Events

Enumerator
SegmentationHistoryChangedEvent 
PauseRenderEvent 
ResumeRenderEvent 

Definition at line 76 of file vtkSlicerSegmentEditorLogic.h.

◆ ModificationMode

Enumerator
ModificationModeSet 
ModificationModeAdd 
ModificationModeRemove 
ModificationModeRemoveAll 

Definition at line 68 of file vtkSlicerSegmentEditorLogic.h.

Constructor & Destructor Documentation

◆ vtkSlicerSegmentEditorLogic()

vtkSlicerSegmentEditorLogic::vtkSlicerSegmentEditorLogic ( )
protected

◆ ~vtkSlicerSegmentEditorLogic()

vtkSlicerSegmentEditorLogic::~vtkSlicerSegmentEditorLogic ( )
overrideprotected

Member Function Documentation

◆ AddEmptySegment()

std::string vtkSlicerSegmentEditorLogic::AddEmptySegment ( const std::string & segmentId = "",
int segmentStatus = 0 ) const

Add empty segment in the current segmentation node

Parameters
segmentIdID of added segment. If empty then a default unique ID will be generated.
segmentStatusStatus of added segment from
See also
vtkSlicerSegmentationsModuleLogic::SegmentStatus. Default: NotStarted
Returns
ID of the added segment if successful. Empty string otherwise.

◆ AppendImage()

static void vtkSlicerSegmentEditorLogic::AppendImage ( vtkOrientedImageData * inputImage,
vtkOrientedImageData * appendedImage )
static

Append image onto image. Resamples appended image and saves result in input image.

◆ AppendPolyMask()

static void vtkSlicerSegmentEditorLogic::AppendPolyMask ( vtkOrientedImageData * input,
vtkPolyData * polyData,
vtkMRMLSliceNode * sliceNode,
vtkMRMLSegmentationNode * segmentationNode = nullptr )
static

Rasterize a poly data onto the input image into the slice view.

◆ CanAddSegments()

bool vtkSlicerSegmentEditorLogic::CanAddSegments ( ) const
Returns
true if volume, segmentation and reference geometry are defined

◆ CanRedo()

bool vtkSlicerSegmentEditorLogic::CanRedo ( ) const
Returns
true if segmentation history has at least one state to redo

◆ CanRemoveSegments()

bool vtkSlicerSegmentEditorLogic::CanRemoveSegments ( ) const
Returns
true if current selected segment ID is valid
See also
IsSegmentIDValid

◆ CanTriviallyConvertSourceRepresentationToBinaryLabelMap()

bool vtkSlicerSegmentEditorLogic::CanTriviallyConvertSourceRepresentationToBinaryLabelMap ( ) const
Returns
true if the current segmentation is empty or is already set to binary label map

◆ CanUndo()

bool vtkSlicerSegmentEditorLogic::CanUndo ( ) const
Returns
true if the segmentation history has at least one state

◆ ClearUndoState()

void vtkSlicerSegmentEditorLogic::ClearUndoState ( ) const

Clears the Undo/Redo history.

◆ ContainsClosedSurfaceRepresentation()

bool vtkSlicerSegmentEditorLogic::ContainsClosedSurfaceRepresentation ( ) const

true if the current segmentation is valid and contains a closed surface representation

◆ CreateAndSetBlankSourceVolumeFromSegmentationGeometry()

void vtkSlicerSegmentEditorLogic::CreateAndSetBlankSourceVolumeFromSegmentationGeometry ( ) const

Creates a blank source volume matching the segmentation geometry. Usually called when no source volume is currently set.

◆ CreateAndSetBlankSourceVolumeIfNeeded()

void vtkSlicerSegmentEditorLogic::CreateAndSetBlankSourceVolumeIfNeeded ( ) const

If no source volume is selected but a valid geometry is specified then create and store a blank source volume.

◆ CreateMaskImageFromPolyData()

static void vtkSlicerSegmentEditorLogic::CreateMaskImageFromPolyData ( vtkPolyData * polyData,
vtkOrientedImageData * outputMask,
vtkMRMLSliceNode * sliceNode )
static

Create a slice view screen space (2D) mask image for the given polydata.

◆ ExportSegmentationToColorTableNode()

void vtkSlicerSegmentEditorLogic::ExportSegmentationToColorTableNode ( ) const

Export the current segmentation to a new color table node.

◆ GetAlignedSourceVolume()

vtkOrientedImageData * vtkSlicerSegmentEditorLogic::GetAlignedSourceVolume ( ) const

Current aligned source volume.

◆ GetClassName()

virtual const char * vtkSlicerSegmentEditorLogic::GetClassName ( )
virtual

Reimplemented from vtkMRMLAbstractLogic.

◆ GetCurrentSegmentID()

std::string vtkSlicerSegmentEditorLogic::GetCurrentSegmentID ( ) const

Get segment ID of selected segment

See also
GetSelectedSegmentID

◆ GetCurrentSegmentIndex()

int vtkSlicerSegmentEditorLogic::GetCurrentSegmentIndex ( ) const

Returns the current segmentation segment index. -1 if invalid.

◆ GetDefaultTerminologyEntry()

std::string vtkSlicerSegmentEditorLogic::GetDefaultTerminologyEntry ( ) const

Returns the terminology entry value used as default when adding empty segments.

◆ GetMaskLabelmap()

vtkOrientedImageData * vtkSlicerSegmentEditorLogic::GetMaskLabelmap ( ) const

Returns the current mask labelmap.

◆ GetMaximumNumberOfUndoStates()

int vtkSlicerSegmentEditorLogic::GetMaximumNumberOfUndoStates ( ) const

Get maximum number of saved undo/redo states.

◆ GetModifierLabelmap()

vtkOrientedImageData * vtkSlicerSegmentEditorLogic::GetModifierLabelmap ( ) const

Returns the current modifier label map.

◆ GetNextSegmentID()

std::string vtkSlicerSegmentEditorLogic::GetNextSegmentID ( int offset,
bool visibleOnly ) const

Returns the segment ID at given offset.

Parameters
offsetEither a positive or negative offset value
visibleOnlyif true, offset will represent the number of visible segments skipped.
Returns
Segment ID or empty string if segmentation is invalid or offset out of range.

◆ GetReferenceGeometryImage()

vtkOrientedImageData * vtkSlicerSegmentEditorLogic::GetReferenceGeometryImage ( ) const

Returns the current reference geometry image.

◆ GetReferenceImageGeometryString()

std::string vtkSlicerSegmentEditorLogic::GetReferenceImageGeometryString ( ) const

Returns the current reference geometry string.

◆ GetReferenceImageGeometryStringFromSegmentation()

static std::string vtkSlicerSegmentEditorLogic::GetReferenceImageGeometryStringFromSegmentation ( vtkSegmentation * segmentation)
static

Returns the reference geometry string matching the input segmentation.

◆ GetSegmentation()

vtkSegmentation * vtkSlicerSegmentEditorLogic::GetSegmentation ( ) const

Current segmentation associated with the segmentation node.

See also
GetSegmentationNode

◆ GetSegmentationIJKToRAS()

bool vtkSlicerSegmentEditorLogic::GetSegmentationIJKToRAS ( vtkMatrix4x4 * ijkToRas) const

Return segmentation node's internal labelmap IJK to renderer world coordinate transform. If cannot be retrieved (segmentation is not defined, non-linearly transformed, etc.) then false is returned;

◆ GetSegmentationNode()

vtkMRMLSegmentationNode * vtkSlicerSegmentEditorLogic::GetSegmentationNode ( ) const

Get currently selected segmentation MRML node.

◆ GetSegmentEditorNode()

vtkMRMLSegmentEditorNode * vtkSlicerSegmentEditorLogic::GetSegmentEditorNode ( ) const

Get the segment editor parameter set node.

◆ GetSegmentIDs()

std::vector< std::string > vtkSlicerSegmentEditorLogic::GetSegmentIDs ( ) const

Return all the segment IDS present in the segmentation. Empty if invalid or no segment.

◆ GetSelectedSegment()

vtkSegment * vtkSlicerSegmentEditorLogic::GetSelectedSegment ( ) const

Get the current segment. nullptr if invalid or no selection.

◆ GetSelectedSegmentLabelmap()

vtkOrientedImageData * vtkSlicerSegmentEditorLogic::GetSelectedSegmentLabelmap ( ) const

Get the current segments labelmap.

◆ GetSliceSpacing() [1/2]

double vtkSlicerSegmentEditorLogic::GetSliceSpacing ( vtkMRMLSliceNode * sliceNode) const

Return the slice spacing matching the input slice node.

◆ GetSliceSpacing() [2/2]

static double vtkSlicerSegmentEditorLogic::GetSliceSpacing ( vtkMRMLSliceNode * sliceNode,
vtkMRMLSliceLogic * sliceLogic )
static

◆ GetSourceVolumeNode()

vtkMRMLScalarVolumeNode * vtkSlicerSegmentEditorLogic::GetSourceVolumeNode ( ) const

Get the current volume node.

◆ GetVerbose()

bool vtkSlicerSegmentEditorLogic::GetVerbose ( ) const

Returns warning verbosity.

◆ GetVisibleSegmentIDs()

std::vector< std::string > vtkSlicerSegmentEditorLogic::GetVisibleSegmentIDs ( ) const

Return all segment currently visible in any view.

◆ ImageToWorldMatrix() [1/2]

static void vtkSlicerSegmentEditorLogic::ImageToWorldMatrix ( vtkMRMLVolumeNode * node,
vtkMatrix4x4 * ijkToRas )
static

Return matrix for volume node that takes into account the IJKToRAS and any linear transforms that have been applied

◆ ImageToWorldMatrix() [2/2]

static void vtkSlicerSegmentEditorLogic::ImageToWorldMatrix ( vtkOrientedImageData * image,
vtkMRMLSegmentationNode * node,
vtkMatrix4x4 * ijkToRas )
static

Return matrix for oriented image data that takes into account the image to world and any linear transforms that have been applied on the given segmentation

◆ IsA()

virtual int vtkSlicerSegmentEditorLogic::IsA ( const char * type)
virtual

Reimplemented from vtkMRMLAbstractLogic.

◆ IsSegmentationDisplayableInView()

bool vtkSlicerSegmentEditorLogic::IsSegmentationDisplayableInView ( vtkMRMLAbstractViewNode * viewNode) const

Return true if the current segmentation is displayed in the input view node. False if invalid segmentation or view node.

◆ IsSegmentationNodeValid()

bool vtkSlicerSegmentEditorLogic::IsSegmentationNodeValid ( ) const

Return true if the current segmentation node is valid.

◆ IsSegmentIdInList()

static bool vtkSlicerSegmentEditorLogic::IsSegmentIdInList ( const std::string & segmentID,
const std::vector< std::string > & visibleSegmentIDs )
static

Return true if the segment ID is present in the input list.

◆ IsSegmentIdValid()

bool vtkSlicerSegmentEditorLogic::IsSegmentIdValid ( const std::string & segmentId) const

Return true when Segment ID is defined and present in the current segmentation.

◆ IsSegmentIdVisible()

bool vtkSlicerSegmentEditorLogic::IsSegmentIdVisible ( const std::string & segmentID) const

Return true if the segment ID is visible in any view. False if not visible or invalid.

◆ IsSelectedSegmentVisible()

bool vtkSlicerSegmentEditorLogic::IsSelectedSegmentVisible ( ) const

Return true if the current segment is visible in any view.

◆ IsTypeOf()

static int vtkSlicerSegmentEditorLogic::IsTypeOf ( const char * type)
static

◆ ModifySegmentByLabelmap() [1/2]

void vtkSlicerSegmentEditorLogic::ModifySegmentByLabelmap ( vtkMRMLSegmentationNode * segmentationNode,
const char * segmentID,
vtkOrientedImageData * modifierLabelmap,
ModificationMode modificationMode,
bool isPerSegment,
bool bypassMasking )

◆ ModifySegmentByLabelmap() [2/2]

void vtkSlicerSegmentEditorLogic::ModifySegmentByLabelmap ( vtkMRMLSegmentationNode * segmentationNode,
const char * segmentID,
vtkOrientedImageData * modifierLabelmap,
ModificationMode modificationMode,
const int modificationExtent[6],
bool isPerSegment,
bool bypassMasking )

◆ New()

static vtkSlicerSegmentEditorLogic * vtkSlicerSegmentEditorLogic::New ( )
static

◆ PauseRender()

void vtkSlicerSegmentEditorLogic::PauseRender ( )

Trigger the PauseRenderEvent.

◆ ProcessMRMLNodesEvents()

void vtkSlicerSegmentEditorLogic::ProcessMRMLNodesEvents ( vtkObject * caller,
unsigned long event,
void * callData )
overrideprotectedvirtual

Update segment editor node, segmentation node and segment history observers.

Reimplemented from vtkMRMLAbstractLogic.

◆ RasToXy()

static std::array< int, 2 > vtkSlicerSegmentEditorLogic::RasToXy ( double ras[3],
vtkMRMLSliceNode * sliceNode )
static

Convert RAS position to XY in-slice position.

◆ Redo()

void vtkSlicerSegmentEditorLogic::Redo ( ) const

Restores next saved state of the segmentation.

◆ RemoveSelectedSegment()

std::string vtkSlicerSegmentEditorLogic::RemoveSelectedSegment ( ) const

Remove the current segment and return the following segment in the list if any valid.

◆ ResetModifierLabelmapToDefault()

bool vtkSlicerSegmentEditorLogic::ResetModifierLabelmapToDefault ( ) const

Updates default modifier labelmap based on reference geometry (to set origin, spacing, and directions) and existing segments (to set extents). If reference geometry conversion parameter is empty then existing segments are used for determining origin, spacing, and directions and the resulting geometry is written to reference geometry conversion parameter.

◆ ResumeRender()

void vtkSlicerSegmentEditorLogic::ResumeRender ( )

Trigger the ResumeRenderEvent.

◆ SafeDownCast()

static vtkSlicerSegmentEditorLogic * vtkSlicerSegmentEditorLogic::SafeDownCast ( vtkObject * o)
static

◆ SaveStateForUndo()

bool vtkSlicerSegmentEditorLogic::SaveStateForUndo ( ) const

Save current segmentation before performing an edit operation to allow reverting to the current state by using undo

◆ SelectFirstSegment()

void vtkSlicerSegmentEditorLogic::SelectFirstSegment ( bool visibleOnly) const

Selects the first segment in the current segmentation.

◆ SelectNextSegment()

void vtkSlicerSegmentEditorLogic::SelectNextSegment ( bool visibleOnly) const

Selects the next segment in the current segmentation.

◆ SelectPreviousSegment()

void vtkSlicerSegmentEditorLogic::SelectPreviousSegment ( bool visibleOnly) const

Selects the previous segment in the current segmentation.

◆ SelectSegmentAtOffset()

void vtkSlicerSegmentEditorLogic::SelectSegmentAtOffset ( int offset,
bool visibleOnly ) const

Select the segment offset from the currently selected one Positive offset will move down the segmentation list Negative offset will move up the segmentation list

◆ SetCurrentSegmentID()

void vtkSlicerSegmentEditorLogic::SetCurrentSegmentID ( const std::string & segmentID) const

Set selected segment by its ID.

◆ SetDefaultTerminologyEntry()

void vtkSlicerSegmentEditorLogic::SetDefaultTerminologyEntry ( const std::string & entry)

Set the default terminology to use when adding new segments.

◆ SetMaximumNumberOfUndoStates()

void vtkSlicerSegmentEditorLogic::SetMaximumNumberOfUndoStates ( int ) const

Set maximum number of saved undo/redo states.

◆ SetSegmentationHistory()

void vtkSlicerSegmentEditorLogic::SetSegmentationHistory ( const vtkSmartPointer< vtkSegmentationHistory > & segmentationHistory)

Set the segmentation history By default, the logic creates and uses an empty segmentation history at creation.

◆ SetSegmentationNode()

void vtkSlicerSegmentEditorLogic::SetSegmentationNode ( vtkMRMLNode * node) const

Set segmentation MRML node.

◆ SetSegmentationNodeID()

void vtkSlicerSegmentEditorLogic::SetSegmentationNodeID ( const std::string & nodeID) const

Set segmentation MRML node by its ID.

◆ SetSegmentEditorNode()

void vtkSlicerSegmentEditorLogic::SetSegmentEditorNode ( vtkMRMLSegmentEditorNode * newSegmentEditorNode)

Set the segment editor parameter set node.

◆ SetSourceRepresentationToBinaryLabelMap()

bool vtkSlicerSegmentEditorLogic::SetSourceRepresentationToBinaryLabelMap ( ) const

Sets the source representation to binary labelmap. This method will convert any representation currently stored in the segmentation. User confirmation should be requested before this operation.

See also
CanTriviallyConvertSourceRepresentationToBinaryLabelMap
TrivialSetSourceRepresentationToBinaryLabelmap

◆ SetSourceVolumeNode()

void vtkSlicerSegmentEditorLogic::SetSourceVolumeNode ( vtkMRMLNode * node) const

Set source volume MRML node. If source volume has multiple scalar components then only the first scalar component is used.

◆ SetSourceVolumeNodeID()

void vtkSlicerSegmentEditorLogic::SetSourceVolumeNodeID ( const std::string & nodeID) const

Set source volume MRML node by its ID.

◆ SetVerbose()

void vtkSlicerSegmentEditorLogic::SetVerbose ( bool isVerbose)

Sets the warning verbosity. If verbose = False instance methods don't emit vtkWarnings. Default: Verbose = False.

◆ ToggleSegmentationSurfaceRepresentation()

void vtkSlicerSegmentEditorLogic::ToggleSegmentationSurfaceRepresentation ( bool isSurfaceRepresentationOn) const

Create/remove closed surface model for the segmentation that is automatically updated when editing.

◆ ToggleSourceVolumeIntensityMask()

void vtkSlicerSegmentEditorLogic::ToggleSourceVolumeIntensityMask ( ) const

Toggle the intensity mask currently set on the segmentation.

◆ TrivialSetSourceRepresentationToBinaryLabelmap()

bool vtkSlicerSegmentEditorLogic::TrivialSetSourceRepresentationToBinaryLabelmap ( ) const

Set source representation to binary label map. Should be called only when

See also
CanTriviallyConvertSourceRepresentationToBinaryLabelMap is true. This method will not update any close surface representation or display if they already exist.
SetSourceRepresentationToBinaryLabelMap

◆ Undo()

void vtkSlicerSegmentEditorLogic::Undo ( ) const

Restores previous saved state of the segmentation.

◆ UpdateAlignedSourceVolume()

bool vtkSlicerSegmentEditorLogic::UpdateAlignedSourceVolume ( )

Updates a resampled source volume in a geometry aligned with default modifierLabelmap.

◆ UpdateMaskLabelmap()

bool vtkSlicerSegmentEditorLogic::UpdateMaskLabelmap ( ) const

Updates mask labelmap. Geometry of mask will be the same as current modifierLabelmap. This mask only considers segment-based regions (and ignores masking based on source volume intensity).

◆ UpdateReferenceGeometryImage()

bool vtkSlicerSegmentEditorLogic::UpdateReferenceGeometryImage ( ) const

Update the reference geometry image to the current segmentation.

◆ UpdateSelectedSegmentLabelmap()

bool vtkSlicerSegmentEditorLogic::UpdateSelectedSegmentLabelmap ( ) const

Updates selected segment labelmap in a geometry aligned with default modifierLabelmap.

◆ UpdateVolume()

void vtkSlicerSegmentEditorLogic::UpdateVolume ( void * volumeToUpdate,
bool & success )

◆ XyToIjk() [1/3]

static void vtkSlicerSegmentEditorLogic::XyToIjk ( double xy[2],
int outputIjk[3],
vtkMRMLSliceNode * sliceNode,
vtkOrientedImageData * image,
vtkMRMLTransformNode * parentTransform = nullptr )
static

Convert XY in-slice position to image IJK position.

◆ XyToIjk() [2/3]

static void vtkSlicerSegmentEditorLogic::XyToIjk ( int xy[2],
int outputIjk[3],
vtkMRMLSliceNode * sliceNode,
vtkOrientedImageData * image,
vtkMRMLTransformNode * parentTransform = nullptr )
static

Convert XY in-slice position to image IJK position.

◆ XyToIjk() [3/3]

static std::array< int, 3 > vtkSlicerSegmentEditorLogic::XyToIjk ( int xy[2],
vtkMRMLSliceNode * sliceNode,
vtkOrientedImageData * image,
vtkMRMLTransformNode * parentTransform = nullptr )
static

Convert XY in-slice position to image IJK position, python accessor method.

◆ XyToRas() [1/3]

static void vtkSlicerSegmentEditorLogic::XyToRas ( double xy[2],
double outputRas[3],
vtkMRMLSliceNode * sliceNode )
static

Convert XY in-slice position to RAS position.

◆ XyToRas() [2/3]

static void vtkSlicerSegmentEditorLogic::XyToRas ( int xy[2],
double outputRas[3],
vtkMRMLSliceNode * sliceNode )
static

Convert XY in-slice position to RAS position.

◆ XyToRas() [3/3]

static std::array< double, 3 > vtkSlicerSegmentEditorLogic::XyToRas ( int xy[2],
vtkMRMLSliceNode * sliceNode )
static

Convert XY in-slice position to RAS position, python accessor method.

◆ XyzToIjk() [1/2]

static void vtkSlicerSegmentEditorLogic::XyzToIjk ( double inputXyz[3],
int outputIjk[3],
vtkMRMLSliceNode * sliceNode,
vtkOrientedImageData * image,
vtkMRMLTransformNode * parentTransform = nullptr )
static

Convert XYZ slice view position to image IJK position,.

See also
xyzToRas

◆ XyzToIjk() [2/2]

static std::array< int, 3 > vtkSlicerSegmentEditorLogic::XyzToIjk ( double inputXyz[3],
vtkMRMLSliceNode * sliceNode,
vtkOrientedImageData * image,
vtkMRMLTransformNode * parentTransform = nullptr )
static

Convert XYZ slice view position to image IJK position, python accessor method,.

See also
xyzToRas

◆ XyzToRas() [1/2]

static void vtkSlicerSegmentEditorLogic::XyzToRas ( double inputXyz[3],
double outputRas[3],
vtkMRMLSliceNode * sliceNode )
static

Convert XYZ slice view position to RAS position: x,y uses slice (canvas) coordinate system and actually has a 3rd z component (index into the slice you're looking at), hence xyToRAS is really performing xyzToRAS. RAS is patient world coordinate system. Note the 1 is because the transform uses homogeneous coordinates.

◆ XyzToRas() [2/2]

static std::array< double, 3 > vtkSlicerSegmentEditorLogic::XyzToRas ( double inputXyz[3],
vtkMRMLSliceNode * sliceNode )
static

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