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

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

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

Inheritance diagram for vtkSegmentEditorLogic:
Collaboration diagram for vtkSegmentEditorLogic:

Public Types

enum  Events { SegmentationHistoryChangedEvent = vtkCommand::UserEvent + 1 , PauseRenderEvent , ResumeRenderEvent }
 
enum  ModificationMode { ModificationModeSet , ModificationModeAdd , ModificationModeRemove , ModificationModeRemoveAll }
 
typedef vtkObject Superclass
 

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.
 
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 SetApplicationLogic (vtkMRMLApplicationLogic *applicationLogic)
 Set the current MRML application logic.
 
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 SetScene (vtkMRMLScene *newScene)
 Set the MRML scene associated with the widget.
 
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 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)
 

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 vtkSegmentEditorLogicNew ()
 
static std::array< int, 2 > RasToXy (double ras[3], vtkMRMLSliceNode *sliceNode)
 Convert RAS position to XY in-slice position.
 
static vtkSegmentEditorLogicSafeDownCast (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)
 

Protected Member Functions

 vtkSegmentEditorLogic ()
 
 ~vtkSegmentEditorLogic () override
 

Detailed Description

Helper segment editor logic for qMRMLSegmentEditorWidget and its associated effects.

Provides common logic to access and modify the segmentation.

Definition at line 63 of file vtkSegmentEditorLogic.h.

Member Typedef Documentation

◆ Superclass

Definition at line 67 of file vtkSegmentEditorLogic.h.

Member Enumeration Documentation

◆ Events

Enumerator
SegmentationHistoryChangedEvent 
PauseRenderEvent 
ResumeRenderEvent 

Definition at line 77 of file vtkSegmentEditorLogic.h.

◆ ModificationMode

Enumerator
ModificationModeSet 
ModificationModeAdd 
ModificationModeRemove 
ModificationModeRemoveAll 

Definition at line 69 of file vtkSegmentEditorLogic.h.

Constructor & Destructor Documentation

◆ vtkSegmentEditorLogic()

vtkSegmentEditorLogic::vtkSegmentEditorLogic ( )
protected

◆ ~vtkSegmentEditorLogic()

vtkSegmentEditorLogic::~vtkSegmentEditorLogic ( )
overrideprotected

Member Function Documentation

◆ AddEmptySegment()

std::string vtkSegmentEditorLogic::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 vtkSegmentEditorLogic::AppendImage ( vtkOrientedImageData * inputImage,
vtkOrientedImageData * appendedImage )
static

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

◆ AppendPolyMask()

static void vtkSegmentEditorLogic::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 vtkSegmentEditorLogic::CanAddSegments ( ) const
Returns
true if volume, segmentation and reference geometry are defined

◆ CanRedo()

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

◆ CanRemoveSegments()

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

◆ CanTriviallyConvertSourceRepresentationToBinaryLabelMap()

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

◆ CanUndo()

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

◆ ClearUndoState()

void vtkSegmentEditorLogic::ClearUndoState ( ) const

Clears the Undo/Redo history.

◆ ContainsClosedSurfaceRepresentation()

bool vtkSegmentEditorLogic::ContainsClosedSurfaceRepresentation ( ) const

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

◆ CreateAndSetBlankSourceVolumeFromSegmentationGeometry()

void vtkSegmentEditorLogic::CreateAndSetBlankSourceVolumeFromSegmentationGeometry ( ) const

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

◆ CreateAndSetBlankSourceVolumeIfNeeded()

void vtkSegmentEditorLogic::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 vtkSegmentEditorLogic::CreateMaskImageFromPolyData ( vtkPolyData * polyData,
vtkOrientedImageData * outputMask,
vtkMRMLSliceNode * sliceNode )
static

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

◆ ExportSegmentationToColorTableNode()

void vtkSegmentEditorLogic::ExportSegmentationToColorTableNode ( ) const

Export the current segmentation to a new color table node.

◆ GetAlignedSourceVolume()

vtkOrientedImageData * vtkSegmentEditorLogic::GetAlignedSourceVolume ( ) const

Current aligned source volume.

◆ GetClassName()

virtual const char * vtkSegmentEditorLogic::GetClassName ( )
virtual

◆ GetCurrentSegmentID()

std::string vtkSegmentEditorLogic::GetCurrentSegmentID ( ) const

Get segment ID of selected segment

See also
GetSelectedSegmentID

◆ GetCurrentSegmentIndex()

int vtkSegmentEditorLogic::GetCurrentSegmentIndex ( ) const

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

◆ GetDefaultTerminologyEntry()

std::string vtkSegmentEditorLogic::GetDefaultTerminologyEntry ( ) const

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

◆ GetMaskLabelmap()

vtkOrientedImageData * vtkSegmentEditorLogic::GetMaskLabelmap ( ) const

Returns the current mask labelmap.

◆ GetMaximumNumberOfUndoStates()

int vtkSegmentEditorLogic::GetMaximumNumberOfUndoStates ( ) const

Get maximum number of saved undo/redo states.

◆ GetModifierLabelmap()

vtkOrientedImageData * vtkSegmentEditorLogic::GetModifierLabelmap ( ) const

Returns the current modifier label map.

◆ GetNextSegmentID()

std::string vtkSegmentEditorLogic::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 * vtkSegmentEditorLogic::GetReferenceGeometryImage ( ) const

Returns the current reference geometry image.

◆ GetReferenceImageGeometryString()

std::string vtkSegmentEditorLogic::GetReferenceImageGeometryString ( ) const

Returns the current reference geometry string.

◆ GetReferenceImageGeometryStringFromSegmentation()

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

Returns the reference geometry string matching the input segmentation.

◆ GetSegmentation()

vtkSegmentation * vtkSegmentEditorLogic::GetSegmentation ( ) const

Current segmentation associated with the segmentation node.

See also
GetSegmentationNode

◆ GetSegmentationIJKToRAS()

bool vtkSegmentEditorLogic::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 * vtkSegmentEditorLogic::GetSegmentationNode ( ) const

Get currently selected segmentation MRML node.

◆ GetSegmentEditorNode()

vtkMRMLSegmentEditorNode * vtkSegmentEditorLogic::GetSegmentEditorNode ( ) const

Get the segment editor parameter set node.

◆ GetSegmentIDs()

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

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

◆ GetSelectedSegment()

vtkSegment * vtkSegmentEditorLogic::GetSelectedSegment ( ) const

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

◆ GetSelectedSegmentLabelmap()

vtkOrientedImageData * vtkSegmentEditorLogic::GetSelectedSegmentLabelmap ( ) const

Get the current segments labelmap.

◆ GetSliceSpacing() [1/2]

double vtkSegmentEditorLogic::GetSliceSpacing ( vtkMRMLSliceNode * sliceNode) const

Return the slice spacing matching the input slice node.

◆ GetSliceSpacing() [2/2]

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

◆ GetSourceVolumeNode()

vtkMRMLScalarVolumeNode * vtkSegmentEditorLogic::GetSourceVolumeNode ( ) const

Get the current volume node.

◆ GetVisibleSegmentIDs()

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

Return all segment currently visible in any view.

◆ ImageToWorldMatrix() [1/2]

static void vtkSegmentEditorLogic::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 vtkSegmentEditorLogic::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 vtkSegmentEditorLogic::IsA ( const char * type)
virtual

◆ IsSegmentationDisplayableInView()

bool vtkSegmentEditorLogic::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 vtkSegmentEditorLogic::IsSegmentationNodeValid ( ) const

Return true if the current segmentation node is valid.

◆ IsSegmentIdInList()

static bool vtkSegmentEditorLogic::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 vtkSegmentEditorLogic::IsSegmentIdValid ( const std::string & segmentId) const

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

◆ IsSegmentIdVisible()

bool vtkSegmentEditorLogic::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 vtkSegmentEditorLogic::IsSelectedSegmentVisible ( ) const

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

◆ IsTypeOf()

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

◆ ModifySegmentByLabelmap() [1/2]

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

◆ ModifySegmentByLabelmap() [2/2]

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

◆ New()

static vtkSegmentEditorLogic * vtkSegmentEditorLogic::New ( )
static

◆ PauseRender()

void vtkSegmentEditorLogic::PauseRender ( )

Trigger the PauseRenderEvent.

◆ RasToXy()

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

Convert RAS position to XY in-slice position.

◆ Redo()

void vtkSegmentEditorLogic::Redo ( ) const

Restores next saved state of the segmentation.

◆ RemoveSelectedSegment()

std::string vtkSegmentEditorLogic::RemoveSelectedSegment ( ) const

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

◆ ResetModifierLabelmapToDefault()

bool vtkSegmentEditorLogic::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 vtkSegmentEditorLogic::ResumeRender ( )

Trigger the ResumeRenderEvent.

◆ SafeDownCast()

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

◆ SaveStateForUndo()

bool vtkSegmentEditorLogic::SaveStateForUndo ( ) const

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

◆ SelectFirstSegment()

void vtkSegmentEditorLogic::SelectFirstSegment ( bool visibleOnly) const

Selects the first segment in the current segmentation.

◆ SelectNextSegment()

void vtkSegmentEditorLogic::SelectNextSegment ( bool visibleOnly) const

Selects the next segment in the current segmentation.

◆ SelectPreviousSegment()

void vtkSegmentEditorLogic::SelectPreviousSegment ( bool visibleOnly) const

Selects the previous segment in the current segmentation.

◆ SelectSegmentAtOffset()

void vtkSegmentEditorLogic::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

◆ SetApplicationLogic()

void vtkSegmentEditorLogic::SetApplicationLogic ( vtkMRMLApplicationLogic * applicationLogic)

Set the current MRML application logic.

◆ SetCurrentSegmentID()

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

Set selected segment by its ID.

◆ SetDefaultTerminologyEntry()

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

Set the default terminology to use when adding new segments.

◆ SetMaximumNumberOfUndoStates()

void vtkSegmentEditorLogic::SetMaximumNumberOfUndoStates ( int ) const

Set maximum number of saved undo/redo states.

◆ SetScene()

void vtkSegmentEditorLogic::SetScene ( vtkMRMLScene * newScene)

Set the MRML scene associated with the widget.

◆ SetSegmentationHistory()

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

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

◆ SetSegmentationNode()

void vtkSegmentEditorLogic::SetSegmentationNode ( vtkMRMLNode * node) const

Set segmentation MRML node.

◆ SetSegmentationNodeID()

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

Set segmentation MRML node by its ID.

◆ SetSegmentEditorNode()

void vtkSegmentEditorLogic::SetSegmentEditorNode ( vtkMRMLSegmentEditorNode * newSegmentEditorNode)

Set the segment editor parameter set node.

◆ SetSourceRepresentationToBinaryLabelMap()

bool vtkSegmentEditorLogic::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 vtkSegmentEditorLogic::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 vtkSegmentEditorLogic::SetSourceVolumeNodeID ( const std::string & nodeID) const

Set source volume MRML node by its ID.

◆ ToggleSegmentationSurfaceRepresentation()

void vtkSegmentEditorLogic::ToggleSegmentationSurfaceRepresentation ( bool isSurfaceRepresentationOn) const

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

◆ ToggleSourceVolumeIntensityMask()

void vtkSegmentEditorLogic::ToggleSourceVolumeIntensityMask ( ) const

Toggle the intensity mask currently set on the segmentation.

◆ TrivialSetSourceRepresentationToBinaryLabelmap()

bool vtkSegmentEditorLogic::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 vtkSegmentEditorLogic::Undo ( ) const

Restores previous saved state of the segmentation.

◆ UpdateAlignedSourceVolume()

bool vtkSegmentEditorLogic::UpdateAlignedSourceVolume ( )

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

◆ UpdateMaskLabelmap()

bool vtkSegmentEditorLogic::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 vtkSegmentEditorLogic::UpdateReferenceGeometryImage ( ) const

Update the reference geometry image to the current segmentation.

◆ UpdateSelectedSegmentLabelmap()

bool vtkSegmentEditorLogic::UpdateSelectedSegmentLabelmap ( ) const

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

◆ UpdateVolume()

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

◆ XyToIjk() [1/3]

static void vtkSegmentEditorLogic::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 vtkSegmentEditorLogic::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 > vtkSegmentEditorLogic::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 vtkSegmentEditorLogic::XyToRas ( double xy[2],
double outputRas[3],
vtkMRMLSliceNode * sliceNode )
static

Convert XY in-slice position to RAS position.

◆ XyToRas() [2/3]

static void vtkSegmentEditorLogic::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 > vtkSegmentEditorLogic::XyToRas ( int xy[2],
vtkMRMLSliceNode * sliceNode )
static

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

◆ XyzToIjk() [1/2]

static void vtkSegmentEditorLogic::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 > vtkSegmentEditorLogic::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 vtkSegmentEditorLogic::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 > vtkSegmentEditorLogic::XyzToRas ( double inputXyz[3],
vtkMRMLSliceNode * sliceNode )
static

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