Slicer
4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
|
#include <Modules/Loadable/Segmentations/Logic/vtkSlicerSegmentationsModuleLogic.h>
Public Types | |
enum | { MODE_REPLACE = 0, MODE_MERGE_MAX, MODE_MERGE_MIN } |
typedef vtkSlicerModuleLogic | Superclass |
Public Types inherited from vtkSlicerModuleLogic | |
typedef vtkMRMLAbstractLogic | Superclass |
Public Types inherited from vtkMRMLAbstractLogic | |
typedef vtkObject | Superclass |
typedef void(vtkMRMLAbstractLogic::* | TaskFunctionPointer) (void *clientdata) |
Public Member Functions | |
virtual const char * | GetClassName () |
vtkMRMLSegmentationNode * | GetDefaultSegmentationNode () |
Get default segmentation node. All new segmentation nodes are initialized to the content of this node. More... | |
bool | GetDefaultSurfaceSmoothingEnabled () |
Get/Set default closed surface smoothing enabled flag for new segmentation nodes. More... | |
bool | ImportLabelmapToSegmentationNodeWithTerminology (vtkMRMLLabelMapVolumeNode *labelmapNode, vtkMRMLSegmentationNode *segmentationNode, std::string terminologyContextName, std::string insertBeforeSegmentId="") |
virtual int | IsA (const char *type) |
vtkMRMLSegmentationNode * | LoadSegmentationFromFile (const char *filename, bool autoOpacities=true) |
void | PrintSelf (ostream &os, vtkIndent indent) VTK_OVERRIDE |
void | SetDefaultSurfaceSmoothingEnabled (bool enabled) |
void | SetTerminologiesLogic (vtkSlicerTerminologiesModuleLogic *terminologiesLogic) |
Set Terminologies module logic. More... | |
bool | SetTerminologyToSegmentationFromLabelmapNode (vtkMRMLSegmentationNode *segmentationNode, vtkMRMLLabelMapVolumeNode *labelmapNode, std::string terminologyContextName) |
Public Member Functions inherited from vtkSlicerModuleLogic | |
virtual vtkSlicerApplicationLogic * | GetApplicationLogic () |
Get access to overall application state. More... | |
std::string | GetModuleShareDirectory () const |
void | PrintSelf (ostream &os, vtkIndent indent) VTK_OVERRIDE |
void | SetModuleShareDirectory (const std::string &shareDirectory) |
Public Member Functions inherited from vtkMRMLAbstractLogic | |
virtual vtkMRMLApplicationLogic * | GetMRMLApplicationLogic () const |
Get access to overall application state. More... | |
vtkMRMLScene * | GetMRMLScene () const |
Return a reference to the current MRML scene. More... | |
void | PrintSelf (ostream &os, vtkIndent indent) VTK_OVERRIDE |
virtual void | SetMRMLApplicationLogic (vtkMRMLApplicationLogic *logic) |
void | SetMRMLScene (vtkMRMLScene *newScene) |
Set and observe the MRMLScene. More... | |
Static Public Member Functions | |
static bool | ApplyParentTransformToOrientedImageData (vtkMRMLTransformableNode *transformableNode, vtkOrientedImageData *orientedImageData, bool linearInterpolation=false, double backgroundColor[4]=NULL) |
static bool | ApplyParentTransformToPolyData (vtkMRMLTransformableNode *transformableNode, vtkPolyData *polyData) |
static bool | CopyOrientedImageDataToVolumeNode (vtkOrientedImageData *orientedImageData, vtkMRMLVolumeNode *volumeNode, bool shallowCopy=true, bool shiftImageDataExtentToZeroStart=true) |
static bool | CreateLabelmapVolumeFromOrientedImageData (vtkOrientedImageData *orientedImageData, vtkMRMLLabelMapVolumeNode *labelmapVolumeNode) |
static vtkOrientedImageData * | CreateOrientedImageDataFromVolumeNode (vtkMRMLScalarVolumeNode *volumeNode, vtkMRMLTransformNode *outputParentTransformNode=NULL) |
static vtkDataObject * | CreateRepresentationForOneSegment (vtkSegmentation *segmentation, std::string segmentID, std::string representationName) |
static vtkSegment * | CreateSegmentFromLabelmapVolumeNode (vtkMRMLLabelMapVolumeNode *labelmapVolumeNode, vtkMRMLSegmentationNode *segmentationNode=NULL) |
static vtkSegment * | CreateSegmentFromModelNode (vtkMRMLModelNode *modelNode, vtkMRMLSegmentationNode *segmentationNode=NULL) |
static int | DoesLabelmapContainSingleLabel (vtkMRMLLabelMapVolumeNode *labelmapVolumeNode) |
static bool | ExportAllSegmentsToLabelmapNode (vtkMRMLSegmentationNode *segmentationNode, vtkMRMLLabelMapVolumeNode *labelmapNode) |
static bool | ExportAllSegmentsToModelHierarchy (vtkMRMLSegmentationNode *segmentationNode, vtkMRMLModelHierarchyNode *modelHierarchyNode) |
static bool | ExportSegmentsClosedSurfaceRepresentationToFiles (std::string destinationFolder, vtkMRMLSegmentationNode *segmentationNode, vtkStringArray *segmentIds=NULL, std::string fileFormat="STL", bool lps=true, double sizeScale=1.0, bool merge=false) |
static bool | ExportSegmentsToLabelmapNode (vtkMRMLSegmentationNode *segmentationNode, std::vector< std::string > &segmentIDs, vtkMRMLLabelMapVolumeNode *labelmapNode, vtkMRMLVolumeNode *referenceVolumeNode=NULL) |
static bool | ExportSegmentsToLabelmapNode (vtkMRMLSegmentationNode *segmentationNode, vtkStringArray *segmentIDs, vtkMRMLLabelMapVolumeNode *labelmapNode, vtkMRMLVolumeNode *referenceVolumeNode=NULL) |
static bool | ExportSegmentsToModelHierarchy (vtkMRMLSegmentationNode *segmentationNode, std::vector< std::string > &segmentIDs, vtkMRMLModelHierarchyNode *modelHierarchyNode) |
static bool | ExportSegmentsToModelHierarchy (vtkMRMLSegmentationNode *segmentationNode, vtkStringArray *segmentIds, vtkMRMLModelHierarchyNode *modelHierarchyNode) |
static bool | ExportSegmentToRepresentationNode (vtkSegment *segment, vtkMRMLNode *representationNode) |
static bool | ExportVisibleSegmentsToLabelmapNode (vtkMRMLSegmentationNode *segmentationNode, vtkMRMLLabelMapVolumeNode *labelmapNode, vtkMRMLVolumeNode *referenceVolumeNode=NULL) |
static bool | ExportVisibleSegmentsToModelHierarchy (vtkMRMLSegmentationNode *segmentationNode, vtkMRMLModelHierarchyNode *modelHierarchyNode) |
static void | GetAllLabelValues (vtkIntArray *labels, vtkImageData *labelmap) |
Utility function that returns all non-empty label values in a labelmap. More... | |
static vtkMRMLSegmentationNode * | GetSegmentationNodeForSegment (vtkMRMLScene *scene, vtkSegment *segment, std::string &segmentId) |
static vtkMRMLSegmentationNode * | GetSegmentationNodeForSegmentation (vtkMRMLScene *scene, vtkSegmentation *segmentation) |
static vtkMRMLSegmentationNode * | GetSegmentationNodeForSegmentSubjectHierarchyItem (vtkIdType segmentShItemID, vtkMRMLScene *scene) |
Utility function for getting the segmentation node for a segment subject hierarchy item. More... | |
static bool | GetSegmentBinaryLabelmapRepresentation (vtkMRMLSegmentationNode *segmentationNode, std::string segmentID, vtkOrientedImageData *imageData, bool applyParentTransform=true) |
static bool | GetSegmentClosedSurfaceRepresentation (vtkMRMLSegmentationNode *segmentationNode, std::string segmentID, vtkPolyData *polyData, bool applyParentTransform=true) |
static vtkSegment * | GetSegmentForSegmentSubjectHierarchyItem (vtkIdType segmentShItemID, vtkMRMLScene *scene) |
Utility function for getting the segment object for a segment subject hierarchy item. More... | |
static bool | GetSegmentRepresentation (vtkMRMLSegmentationNode *segmentationNode, std::string segmentID, std::string representationName, vtkDataObject *segmentRepresentation, bool applyParentTransform=true) |
static bool | GetTransformBetweenRepresentationAndSegmentation (vtkMRMLTransformableNode *representationNode, vtkMRMLSegmentationNode *segmentationNode, vtkGeneralTransform *representationToSegmentationTransform) |
static bool | ImportLabelmapToSegmentationNode (vtkMRMLLabelMapVolumeNode *labelmapNode, vtkMRMLSegmentationNode *segmentationNode, std::string insertBeforeSegmentId="") |
static bool | ImportLabelmapToSegmentationNode (vtkOrientedImageData *labelmapImage, vtkMRMLSegmentationNode *segmentationNode, std::string baseSegmentName="", std::string insertBeforeSegmentId="") |
static bool | ImportLabelmapToSegmentationNode (vtkMRMLLabelMapVolumeNode *labelmapNode, vtkMRMLSegmentationNode *segmentationNode, vtkStringArray *updatedSegmentIDs) |
static bool | ImportLabelmapToSegmentationNode (vtkOrientedImageData *labelmapImage, vtkMRMLSegmentationNode *segmentationNode, vtkStringArray *updatedSegmentIDs, vtkGeneralTransform *labelmapToSegmentationTransform=NULL) |
static bool | ImportModelHierarchyToSegmentationNode (vtkMRMLModelHierarchyNode *modelHierarchyNode, vtkMRMLSegmentationNode *segmentationNode, std::string insertBeforeSegmentId="") |
Import model hierarchy into the segmentation as segments. More... | |
static bool | ImportModelToSegmentationNode (vtkMRMLModelNode *modelNode, vtkMRMLSegmentationNode *segmentationNode, std::string insertBeforeSegmentId="") |
Import model into the segmentation as a segment. More... | |
static int | IsTypeOf (const char *type) |
static vtkSlicerSegmentationsModuleLogic * | New () |
static vtkSlicerSegmentationsModuleLogic * | SafeDownCast (vtkObject *o) |
static bool | SetBinaryLabelmapToSegment (vtkOrientedImageData *labelmap, vtkMRMLSegmentationNode *segmentationNode, std::string segmentID, int mergeMode=MODE_REPLACE, const int extent[6]=0) |
Static Public Member Functions inherited from vtkSlicerModuleLogic | |
static int | IsTypeOf (const char *type) |
static vtkSlicerModuleLogic * | New () |
The Usual vtk class functions. More... | |
static vtkSlicerModuleLogic * | SafeDownCast (vtkObject *o) |
Static Public Member Functions inherited from vtkMRMLAbstractLogic | |
static int | IsTypeOf (const char *type) |
static vtkMRMLAbstractLogic * | New () |
static vtkMRMLAbstractLogic * | SafeDownCast (vtkObject *o) |
Protected Member Functions | |
virtual void | OnMRMLSceneNodeAdded (vtkMRMLNode *node) VTK_OVERRIDE |
Handle MRML node added events. More... | |
virtual void | RegisterNodes () VTK_OVERRIDE |
Register MRML Node classes to Scene. Gets called automatically when the MRMLScene is attached to this logic class. More... | |
virtual void | SetMRMLSceneInternal (vtkMRMLScene *newScene) VTK_OVERRIDE |
vtkSlicerSegmentationsModuleLogic () | |
virtual | ~vtkSlicerSegmentationsModuleLogic () |
Protected Member Functions inherited from vtkSlicerModuleLogic | |
vtkSlicerModuleLogic () | |
virtual | ~vtkSlicerModuleLogic () |
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 () |
vtkObserverManager * | GetMRMLLogicsObserverManager () const |
vtkCallbackCommand * | GetMRMLNodesCallbackCommand () |
vtkObserverManager * | GetMRMLNodesObserverManager () const |
vtkCallbackCommand * | GetMRMLSceneCallbackCommand () |
vtkObserverManager * | GetMRMLSceneObserverManager () const |
int | GetPendingModifiedEventCount () const |
int | GetProcessingMRMLSceneEvent () const |
Return the event id currently processed or 0 if any. More... | |
int | InvokePendingModifiedEvent () |
virtual void | Modified () VTK_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 | 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 | ProcessMRMLNodesEvents (vtkObject *caller, unsigned long event, void *callData) |
virtual void | ProcessMRMLSceneEvents (vtkObject *caller, unsigned long event, void *callData) |
void | SetAndObserveMRMLSceneEventsInternal (vtkMRMLScene *newScene, vtkIntArray *events, vtkFloatArray *priorities=0) |
void | SetDisableModifiedEvent (bool onOff) |
void | SetInMRMLLogicsCallbackFlag (int flag) |
void | SetInMRMLNodesCallbackFlag (int flag) |
void | SetInMRMLSceneCallbackFlag (int flag) |
void | SetProcessingMRMLSceneEvent (int event) |
bool | StartModify () |
virtual void | UnobserveMRMLScene () |
virtual void | UpdateFromMRMLScene () |
vtkMRMLAbstractLogic () | |
virtual | ~vtkMRMLAbstractLogic () |
Static Protected Member Functions | |
static bool | ExportSegmentsClosedSurfaceRepresentationToObjFile (std::string destinationFolder, vtkMRMLSegmentationNode *segmentationNode, std::vector< std::string > &segmentIDs, bool lps, double sizeScale) |
static bool | ExportSegmentsClosedSurfaceRepresentationToStlFiles (std::string destinationFolder, vtkMRMLSegmentationNode *segmentationNode, std::vector< std::string > &segmentIDs, bool lps, double sizeScale, bool merge) |
static std::string | GetSafeFileName (std::string originalName) |
static void | OnSubjectHierarchyUIDAdded (vtkObject *caller, unsigned long eid, void *clientData, void *callData) |
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. More... | |
static void | MRMLNodesCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData) |
MRMLNodesCallback is a static function to relay modified events from the nodes. More... | |
static void | MRMLSceneCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData) |
Protected Attributes | |
vtkCallbackCommand * | SubjectHierarchyUIDCallbackCommand |
Command handling subject hierarchy UID added events. More... | |
vtkSlicerTerminologiesModuleLogic * | TerminologiesLogic |
Terminologies module logic. More... | |
Definition at line 51 of file vtkSlicerSegmentationsModuleLogic.h.
Definition at line 56 of file vtkSlicerSegmentationsModuleLogic.h.
anonymous enum |
Set a labelmap image as binary labelmap representation into the segment defined by the segmentation node and segment ID. Master representation must be binary labelmap! Master representation changed event is disabled to prevent deletion of all other representation in all segments. The other representations in the given segment are re-converted. The extent of the segment binary labelmap is shrunk to the effective extent. Display update is triggered.
mergeMode | Determines if the labelmap should replace the segment, or combined with a maximum or minimum operation. |
extent | If extent is specified then only that extent of the labelmap is used. |
Enumerator | |
---|---|
MODE_REPLACE | |
MODE_MERGE_MAX | |
MODE_MERGE_MIN |
Definition at line 319 of file vtkSlicerSegmentationsModuleLogic.h.
|
protected |
|
protectedvirtual |
|
static |
Apply the parent transform of a node to an oriented image data. Useful if we want to get a labelmap representation of a segmentation in the proper geometry for processing.
|
static |
Apply the parent transform of a node to a poly data. Useful if we want to get a surface or contours representation of a segmentation in the proper geometry for processing.
|
static |
Create volume MRML node from oriented image data. Display node is not created.
orientedImageData | Oriented image data to create volume node from |
scalarVolumeNode | Volume to be populated with the oriented image data. |
shallowCopy | If true then voxel array is not duplicated. |
shiftImageDataExtentToZeroStart | Adjust image origin to make image extents start from zero. May be necessary for compatibility with some algorithms that assumes image extent start from 0. |
|
static |
Create labelmap volume MRML node from oriented image data. Creates a display node if a display node does not exist. Shifts image extent to start from zero. Image is shallow-copied (voxel array is not duplicated).
orientedImageData | Oriented image data to create labelmap from |
labelmapVolumeNode | Labelmap volume to be populated with the oriented image data. The volume node must exist and be added to the MRML scene. |
|
static |
Create oriented image data from a volume node
outputParentTransformNode | Specifies the parent transform node where the created image data can be placed. NOTE: Need to take ownership of the created object! For example using vtkSmartPointer<vtkOrientedImageData>::Take |
|
static |
Create representation of only one segment in a segmentation. Useful if only one segment is processed, and we do not want to convert all segments to a certain segmentation to save time. NOTE: Need to take ownership of the created object! For example using vtkSmartPointer<vtkDataObject>::Take
|
static |
Create segment from labelmap volume MRML node. The contents are set as binary labelmap representation in the segment. Returns NULL if labelmap contains more than one label. In that case
labelmapVolumeNode | Model node containing image data that will be the binary labelmap representation in the created segment |
segmentationNode | Segmentation node that will be the container of the segment. It is used to get parent transform to make sure the created segment will be located the same place the image was, considering all transforms involved. NULL value means that this consideration is not needed. Default value is NULL. |
|
static |
Create segment from model MRML node. The contents are set as closed surface model representation in the segment. NOTE: Need to take ownership of the created object! For example using vtkSmartPointer<vtkSegment>::Take
modelNode | Model node containing poly data that will be the closed surface representation in the created segment |
segmentationNode | Segmentation node that will be the container of the segment. It is used to get parent transform to make sure the created segment will be located the same place the model was, considering all transforms involved. NULL value means that this consideration is not needed. Default value is NULL. |
|
static |
Utility function to determine if a labelmap contains a single label
|
static |
Export all segments into a multi-label labelmap volume node
segmentationNode | Segmentation node from which the the segments are exported |
labelmapNode | Labelmap node to export the segments to |
|
static |
Export all segments into a model hierarchy, a model node from each segment
segmentationNode | Segmentation node from which the the segments are exported |
modelHierarchyNode | Model hierarchy to export the segments to |
|
static |
Export closed surface representation of multiple segments to files. Typically used for writing 3D printable model files.
segmentationNode | Segmentation node from which the the segments are exported |
destinationFolder | Folder name where segments will be exported to |
fileFormat | Output file format (STL or OBJ). |
merge | Merge all models into a single mesh. Only applicable to STL format. |
lps | Save files in LPS coordinate system. If set to false then RAS coordinate system is used. |
segmentIds | List of segment IDs to export |
|
staticprotected |
|
staticprotected |
|
static |
Export multiple segments into a multi-label labelmap volume node
segmentationNode | Segmentation node from which the the segments are exported |
segmentIds | List of segment IDs to export |
labelmapNode | Labelmap node to export the segments to |
referenceVolumeNode | If specified, then the merged labelmap node will match the geometry of referenceVolumeNode |
|
static |
Export multiple segments into a multi-label labelmap volume node
segmentationNode | Segmentation node from which the the segments are exported |
segmentIds | List of segment IDs to export |
labelmapNode | Labelmap node to export the segments to |
referenceVolumeNode | If specified, then the merged labelmap node will match the geometry of referenceVolumeNode |
|
static |
Export multiple segments into a model hierarchy, a model node from each segment
segmentationNode | Segmentation node from which the the segments are exported |
segmentIds | List of segment IDs to export |
modelHierarchyNode | Model hierarchy to export the segments to |
|
static |
Export multiple segments into a model hierarchy, a model node from each segment
segmentationNode | Segmentation node from which the the segments are exported |
segmentIds | List of segment IDs to export |
modelHierarchyNode | Model hierarchy to export the segments to |
|
static |
Export segment to representation MRML node.
|
static |
Export visible segments into a multi-label labelmap volume node
segmentationNode | Segmentation node from which the the visible segments are exported |
labelmapNode | Labelmap node to export the segments to |
referenceVolumeNode | If specified, then the merged labelmap node will match the geometry of referenceVolumeNode |
|
static |
Export visible segments into a model hierarchy, a model node from each segment
segmentationNode | Segmentation node from which the the segments are exported |
modelHierarchyNode | Model hierarchy to export the visible segments to |
|
static |
Utility function that returns all non-empty label values in a labelmap.
|
virtual |
Reimplemented from vtkSlicerModuleLogic.
vtkMRMLSegmentationNode* vtkSlicerSegmentationsModuleLogic::GetDefaultSegmentationNode | ( | ) |
Get default segmentation node. All new segmentation nodes are initialized to the content of this node.
bool vtkSlicerSegmentationsModuleLogic::GetDefaultSurfaceSmoothingEnabled | ( | ) |
Get/Set default closed surface smoothing enabled flag for new segmentation nodes.
|
staticprotected |
Generate a safe file name from a given string. The method is in this logic so that it does not cause confusion throughout Slicer (there is an implementation already in qSlicerSaveDataDialogPrivate::nodeFileInfo and it would be good to keep a central one)
|
static |
Get segmentation node containing a given segment. As segments are out-of-MRML VTK objects, there is no direct link from it to its parent node, so must be found from the MRML scene.
scene | MRML scene |
segment | Segment to find |
segmentId | Output argument for the ID of the found segment |
|
static |
Get segmentation node containing a segmentation object. As segmentation objects are out-of-MRML VTK objects, there is no direct link from it to its parent node, so must be found from the MRML scene.
scene | MRML scene |
segmentation | Segmentation to find |
|
static |
Utility function for getting the segmentation node for a segment subject hierarchy item.
|
static |
Convenience function to get binary labelmap representation of a segment in a segmentation. Uses
segmentationNode | Input segmentation node containing the segment to extract |
segmentID | Segment identifier of the segment to extract |
imageData | Output oriented image data into which the segment binary labelmap is copied |
applyParentTransform | Flag determining whether to apply parent transform of the segmentation node. If on, then the oriented image data is in RAS, otherwise in the segmentation node's coordinate frame. On by default |
|
static |
Convenience function to get closed surface representation of a segment in a segmentation. Uses
segmentationNode | Input segmentation node containing the segment to extract |
segmentID | Segment identifier of the segment to extract |
polyData | Output polydata into which the segment polydata is copied |
applyParentTransform | Flag determining whether to apply parent transform of the segmentation node. If on, then the oriented image data is in RAS, otherwise in the segmentation node's coordinate frame. On by default |
|
static |
Utility function for getting the segment object for a segment subject hierarchy item.
|
static |
Convenience function to get a specified representation of a segment in a segmentation. A duplicate of the representation data object is copied into the argument output object, with the segmentation's parent transform applied if requested (on by default).
segmentationNode | Input segmentation node containing the segment to extract |
segmentID | Segment identifier of the segment to extract |
representationName | Name of the requested representation |
segmentRepresentation | Output representation data object into which the given representation in the segment is copied |
applyParentTransform | Flag determining whether to apply parent transform of the segmentation node. On by default |
|
static |
Get transform between a representation node (e.g. labelmap or model) and a segmentation node. Useful if we want to add a representation to a segment, and we want to make sure that the segment will be located the same place the representation node was. The output transform is the representation node's parent transform concatenated with the inverse of the segmentation's parent transform. It needs to be applied on the representation.
representationNode | Transformable node which contains the representation we want to add to the segment |
segmentationNode | Segmentation node that will contain the segment to which the representation is added. It is the representation node's parent transform concatenated with the inverse of the segmentation's parent transform. |
representationToSegmentationTransform | General transform between the representation node and the segmentation node. |
|
static |
Import all labels from a labelmap node to a segmentation node, each label to a separate segment. The colors of the new segments are set from the color table corresponding to the labelmap volume.
insertBeforeSegmentId | New segments will be inserted before this segment. |
|
static |
Import all labels from a labelmap image to a segmentation node, each label to a separate segment The colors of the new segments are randomly generated, unless terminology context is specified, in which case the terminology entries are attempted to be mapped to the imported labels LabelmapImage is defined in the segmentation node's coordinate system (parent transform of the segmentation node is not used during import).
baseSegmentName | Prefix for the names of the new segments. Empty by default, in which case the prefix will be "Label" |
|
static |
Update segmentation from segments in a labelmap node.
updatedSegmentIDs | Defines how label values 1..N are mapped to segment IDs (0..N-1). |
|
static |
Update segmentation from segments in a labelmap node.
updatedSegmentIDs | Defines how label values 1..N are mapped to segment IDs (0..N-1). |
bool vtkSlicerSegmentationsModuleLogic::ImportLabelmapToSegmentationNodeWithTerminology | ( | vtkMRMLLabelMapVolumeNode * | labelmapNode, |
vtkMRMLSegmentationNode * | segmentationNode, | ||
std::string | terminologyContextName, | ||
std::string | insertBeforeSegmentId = "" |
||
) |
Import all labels from a labelmap node to a segmentation node, each label to a separate segment. Terminology and color is set to the segments based on the color table corresponding to the labelmap volume node.
terminologyContextName | Terminology context the entries of which are mapped to the labels imported from the labelmap node |
insertBeforeSegmentId | New segments will be inserted before this segment. |
|
static |
Import model hierarchy into the segmentation as segments.
|
static |
Import model into the segmentation as a segment.
|
virtual |
Reimplemented from vtkSlicerModuleLogic.
|
static |
vtkMRMLSegmentationNode* vtkSlicerSegmentationsModuleLogic::LoadSegmentationFromFile | ( | const char * | filename, |
bool | autoOpacities = true |
||
) |
Load segmentation from file
filename | Path and name of file containing segmentation (nrrd, vtm, etc.) |
autoOpacities | Optional flag determining whether segment opacities are calculated automatically based on containment. True by default |
|
static |
|
protectedvirtual |
Handle MRML node added events.
Reimplemented from vtkMRMLAbstractLogic.
|
staticprotected |
Callback function observing UID added events for subject hierarchy nodes. In case the newly added UID is a volume node referenced from a segmentation, its geometry will be set as image geometry conversion parameter. The "other order", i.e. when the volume is loaded first and the segmentation second, should be handled at loading time of the segmentation (because then we already know about the volume)
void vtkSlicerSegmentationsModuleLogic::PrintSelf | ( | ostream & | os, |
vtkIndent | indent | ||
) |
|
protectedvirtual |
Register MRML Node classes to Scene. Gets called automatically when the MRMLScene is attached to this logic class.
Reimplemented from vtkMRMLAbstractLogic.
|
static |
|
static |
void vtkSlicerSegmentationsModuleLogic::SetDefaultSurfaceSmoothingEnabled | ( | bool | enabled | ) |
|
protectedvirtual |
Called each time a new scene is set. Can be reimplemented in derivated classes. Doesn't observe the scene by default, that means that UpdateFromMRMLScene() won't be called by default when a scene is imported, closed or restored, only when a new scene is set.
Reimplemented from vtkMRMLAbstractLogic.
void vtkSlicerSegmentationsModuleLogic::SetTerminologiesLogic | ( | vtkSlicerTerminologiesModuleLogic * | terminologiesLogic | ) |
Set Terminologies module logic.
bool vtkSlicerSegmentationsModuleLogic::SetTerminologyToSegmentationFromLabelmapNode | ( | vtkMRMLSegmentationNode * | segmentationNode, |
vtkMRMLLabelMapVolumeNode * | labelmapNode, | ||
std::string | terminologyContextName | ||
) |
Assign terminology to segments in a segmentation node based on the labels of a labelmap node. Match is made based on the 3dSlicerLabel terminology type attribute. If the terminology context does not contain that attribute, match cannot be made.
terminologyContextName | Terminology context the entries of which are mapped to the labels imported from the labelmap node |
|
protected |
Command handling subject hierarchy UID added events.
Definition at line 375 of file vtkSlicerSegmentationsModuleLogic.h.
|
protected |
Terminologies module logic.
Definition at line 378 of file vtkSlicerSegmentationsModuleLogic.h.