Slicer  5.3
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkBinaryLabelmapToClosedSurfaceConversionRule.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 Csaba Pinter, PerkLab, Queen's University
16  and was supported through the Applied Cancer Research Unit program of Cancer Care
17  Ontario with funds provided by the Ontario Ministry of Health and Long-Term Care
18 
19 ==============================================================================*/
20 
21 #ifndef __vtkBinaryLabelmapToClosedSurfaceConversionRule_h
22 #define __vtkBinaryLabelmapToClosedSurfaceConversionRule_h
23 
24 // SegmentationCore includes
27 
28 #include "vtkSegmentationCoreConfigure.h"
29 
30 // VTK includes
31 #include <vtkPolyData.h>
32 
38 class vtkSegmentationCore_EXPORT vtkBinaryLabelmapToClosedSurfaceConversionRule
40 {
41 public:
43  static const std::string GetDecimationFactorParameterName() { return "Decimation factor"; };
45  static const std::string GetSmoothingFactorParameterName() { return "Smoothing factor"; };
47  static const std::string GetComputeSurfaceNormalsParameterName() { return "Compute surface normals"; };
51  static const std::string GetJointSmoothingParameterName() { return "Joint smoothing"; };
52 
53 public:
57 
61  vtkDataObject* ConstructRepresentationObjectByRepresentation(std::string representationName) override;
62 
66  vtkDataObject* ConstructRepresentationObjectByClass(std::string className) override;
67 
69  bool CreateClosedSurface(vtkOrientedImageData* inputImage, vtkPolyData* outputPolydata, std::vector<int> values);
70 
72  bool Convert(vtkSegment* segment) override;
73 
76  bool PostConvert(vtkSegmentation* segmentation) override;
77 
79  unsigned int GetConversionCost(vtkDataObject* sourceRepresentation=nullptr, vtkDataObject* targetRepresentation=nullptr) override;
80 
82  const char* GetName() override { return "Binary labelmap to closed surface"; };
83 
86 
89 
90 protected:
93  bool IsLabelmapPaddingNecessary(vtkImageData* binaryLabelMap);
94 
95 protected:
98 
99 protected:
102  std::map<vtkOrientedImageData*, vtkSmartPointer<vtkPolyData> > JointSmoothCache;
103 
104 private:
107 };
108 
109 #endif // __vtkBinaryLabelmapToClosedSurfaceConversionRule_h
Convert binary labelmap representation (vtkOrientedImageData type) to closed surface representation (...
This class encapsulates a segment that is part of a segmentation.
Definition: vtkSegment.h:45
virtual vtkDataObject * ConstructRepresentationObjectByRepresentation(std::string representationName)=0
virtual bool PostConvert(vtkSegmentation *vtkNotUsed(segmentation))
void operator=(const vtkSegmentationConverterRule &)
static const char * GetSegmentationBinaryLabelmapRepresentationName()
std::map< vtkOrientedImageData *, vtkSmartPointer< vtkPolyData > > JointSmoothCache
Abstract converter rule class. Subclasses perform conversions between specific representation types...
virtual vtkDataObject * ConstructRepresentationObjectByClass(std::string className)=0
Image data containing orientation information.
virtual unsigned int GetConversionCost(vtkDataObject *sourceRepresentation=nullptr, vtkDataObject *targetRepresentation=nullptr)
static const char * GetSegmentationClosedSurfaceRepresentationName()
This class encapsulates a segmentation that can contain multiple segments and multiple representation...
const char * GetTargetRepresentationName() override
Human-readable name of the target representation.
virtual vtkSegmentationConverterRule * CreateRuleInstance()=0
virtual bool Convert(vtkSegment *segment)=0
static const std::string GetDecimationFactorParameterName()
Conversion parameter: decimation factor.
const char * GetSourceRepresentationName() override
Human-readable name of the source representation.
const char * GetName() override
Human-readable name of the converter rule.
static const std::string GetSmoothingFactorParameterName()
Conversion parameter: smoothing factor.
static const std::string GetComputeSurfaceNormalsParameterName()
Conversion parameter: compute surface normals.