Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkSegmentationModifier.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Copyright (c) Laboratory for Percutaneous Surgery (PerkLab)
4 Queen's University, Kingston, ON, Canada. All Rights Reserved.
5
6 See COPYRIGHT.txt
7 or http://www.slicer.org/copyright/copyright.txt for details.
8
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14
15 This file was originally developed by Kyle Sunderland, PerkLab, Queen's University
16 and was supported through CANARIE's Research Software Program, Cancer
17 Care Ontario, OpenAnatomy, and Brigham and Women's Hospital through NIH grant R01MH112748.
18
19==============================================================================*/
20
21#ifndef __vtkSegmentationModifier_h
22#define __vtkSegmentationModifier_h
23
24// Segmentation includes
25#include "vtkSegmentationCoreConfigure.h"
26
27// VTK includes
28#include "vtkObject.h"
29
30// STD includes
31#include <vector>
32
34class vtkSegmentation;
35
37class vtkSegmentationCore_EXPORT vtkSegmentationModifier : public vtkObject
38{
39public:
41 vtkTypeMacro(vtkSegmentationModifier, vtkObject);
42
43public:
50 enum
51 {
56 };
58 vtkSegmentation* segmentation,
59 std::string segmentID,
60 int mergeMode = MODE_REPLACE,
61 const int extent[6] = nullptr,
62 bool minimumOfAllSegments = false,
63 bool sourceRepresentationModifiedEnabled = false,
64 const std::vector<std::string> segmentIdsToOverwrite = {},
65 std::vector<std::string>* modifiedSegmentIDs = nullptr);
66
73 static bool GetSharedSegmentIDsInMask(vtkSegmentation* segmentation,
74 std::string sharedSegmentID,
76 const int extent[6],
77 std::vector<std::string>& segmentIDs,
78 int maskThreshold = 0.0,
79 bool includeInputSharedSegmentID = false);
80
81protected:
83 vtkSegmentation* segmentation,
84 std::string segmentID,
85 int mergeMode,
86 const int extent[6],
87 bool minimumOfAllSegments,
88 std::vector<std::string>* modifiedSegmentIDs,
89 bool& segmentLabelmapModified);
90
92
93 static bool SharedLabelmapShouldOverlap(vtkSegmentation* segmentation, std::string segmentID, std::vector<std::string>& segmentIDsToOverwrite);
94
96 vtkSegmentation* segmentation,
97 std::string segmentID,
98 const int extent[6],
99 const std::vector<std::string>& segmentIDsToOverwrite);
100
107 static void GetExtentIntersection(const int extentA[6], const int extentB[6], int extentIntersection[6]);
108
111 static bool IsExtentValid(int extent[6]);
112
113protected:
116
117private:
119 void operator=(const vtkSegmentationModifier&) = delete;
120};
121
122#endif
Image data containing orientation information.
~vtkSegmentationModifier() override
static void GetExtentIntersection(const int extentA[6], const int extentB[6], int extentIntersection[6])
static vtkSegmentationModifier * New()
static void SeparateModifiedSegmentFromSharedLabelmap(vtkOrientedImageData *labelmap, vtkSegmentation *segmentation, std::string segmentID, const int extent[6], const std::vector< std::string > &segmentIDsToOverwrite)
static bool AppendLabelmapToSegment(vtkOrientedImageData *labelmap, vtkSegmentation *segmentation, std::string segmentID, int mergeMode, const int extent[6], bool minimumOfAllSegments, std::vector< std::string > *modifiedSegmentIDs, bool &segmentLabelmapModified)
static bool SharedLabelmapShouldOverlap(vtkSegmentation *segmentation, std::string segmentID, std::vector< std::string > &segmentIDsToOverwrite)
static bool GetSharedSegmentIDsInMask(vtkSegmentation *segmentation, std::string sharedSegmentID, vtkOrientedImageData *mask, const int extent[6], std::vector< std::string > &segmentIDs, int maskThreshold=0.0, bool includeInputSharedSegmentID=false)
static bool ModifyBinaryLabelmap(vtkOrientedImageData *labelmap, vtkSegmentation *segmentation, std::string segmentID, int mergeMode=MODE_REPLACE, const int extent[6]=nullptr, bool minimumOfAllSegments=false, bool sourceRepresentationModifiedEnabled=false, const std::vector< std::string > segmentIdsToOverwrite={}, std::vector< std::string > *modifiedSegmentIDs=nullptr)
static bool IsExtentValid(int extent[6])
static void ShrinkSegmentToEffectiveExtent(vtkOrientedImageData *segmentLabelmap)
This class encapsulates a segmentation that can contain multiple segments and multiple representation...