Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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
37class vtkSegmentationCore_EXPORT vtkBinaryLabelmapToClosedSurfaceConversionRule
39{
40public:
42 static const std::string GetDecimationFactorParameterName() { return "Decimation factor"; };
44 static const std::string GetSmoothingFactorParameterName() { return "Smoothing factor"; };
46 static const std::string GetConversionMethodParameterName() { return "Conversion method"; };
50 static const std::string GetSurfaceNetInternalSmoothingParameterName() { return "SurfaceNets smoothing"; };
52 static const std::string GetComputeSurfaceNormalsParameterName() { return "Compute surface normals"; };
56 static const std::string GetJointSmoothingParameterName() { return "Joint smoothing"; };
57
58 // Conversion methods
59 static const std::string CONVERSION_METHOD_FLYING_EDGES;
60 static const std::string CONVERSION_METHOD_SURFACE_NETS;
61
62public:
66
70 vtkDataObject* ConstructRepresentationObjectByRepresentation(std::string representationName) override;
71
75 vtkDataObject* ConstructRepresentationObjectByClass(std::string className) override;
76
78 bool CreateClosedSurface(vtkOrientedImageData* inputImage, vtkPolyData* outputPolydata, std::vector<int> values);
79
81 bool Convert(vtkSegment* segment) override;
82
85 bool PostConvert(vtkSegmentation* segmentation) override;
86
88 unsigned int GetConversionCost(vtkDataObject* sourceRepresentation=nullptr, vtkDataObject* targetRepresentation=nullptr) override;
89
91 const char* GetName() override { return "Binary labelmap to closed surface"; };
92
95
98
99protected:
102 bool IsLabelmapPaddingNecessary(vtkImageData* binaryLabelMap);
103
104protected:
107
108protected:
111 std::map<vtkOrientedImageData*, vtkSmartPointer<vtkPolyData> > JointSmoothCache;
112
113private:
116};
117
118#endif
static const std::string GetConversionMethodParameterName()
Conversion parameter: Conversion method (flying edges or surface nets)
bool IsLabelmapPaddingNecessary(vtkImageData *binaryLabelMap)
const char * GetTargetRepresentationName() override
Human-readable name of the target representation.
static vtkBinaryLabelmapToClosedSurfaceConversionRule * New()
bool PostConvert(vtkSegmentation *segmentation) override
const char * GetName() override
Human-readable name of the converter rule.
bool CreateClosedSurface(vtkOrientedImageData *inputImage, vtkPolyData *outputPolydata, std::vector< int > values)
Perform the actual binary labelmap to closed surface conversion.
static const std::string GetSmoothingFactorParameterName()
Conversion parameter: smoothing factor.
static const std::string GetDecimationFactorParameterName()
Conversion parameter: decimation factor.
vtkDataObject * ConstructRepresentationObjectByClass(std::string className) override
vtkSegmentationConverterRule * CreateRuleInstance() override
vtkDataObject * ConstructRepresentationObjectByRepresentation(std::string representationName) override
unsigned int GetConversionCost(vtkDataObject *sourceRepresentation=nullptr, vtkDataObject *targetRepresentation=nullptr) override
Get the cost of the conversion.
static const std::string GetComputeSurfaceNormalsParameterName()
Conversion parameter: compute surface normals.
const char * GetSourceRepresentationName() override
Human-readable name of the source representation.
std::map< vtkOrientedImageData *, vtkSmartPointer< vtkPolyData > > JointSmoothCache
bool Convert(vtkSegment *segment) override
Update the target representation based on the source representation.
Image data containing orientation information.
This class encapsulates a segment that is part of a segmentation.
Definition vtkSegment.h:45
void operator=(const vtkSegmentationConverterRule &)
static const char * GetSegmentationClosedSurfaceRepresentationName()
static const char * GetSegmentationBinaryLabelmapRepresentationName()
This class encapsulates a segmentation that can contain multiple segments and multiple representation...