21 #ifndef __vtkSegmentationConverterRule_h 22 #define __vtkSegmentationConverterRule_h 24 #include "vtkSegmentationCoreConfigure.h" 27 #include <vtkObject.h> 39 #ifndef vtkSegmentationConverterRuleNewMacro 40 #define vtkSegmentationConverterRuleNewMacro(newClass) \ 41 vtkStandardNewMacro(newClass); \ 42 vtkSegmentationConverterRule* newClass::CreateRuleInstance() \ 44 return newClass::New(); \ 63 static unsigned int GetConversionInfiniteCost() {
return 10000000; };
79 virtual vtkDataObject* ConstructRepresentationObjectByRepresentation(std::string representationName) = 0;
84 virtual vtkDataObject* ConstructRepresentationObjectByClass(std::string className) = 0;
103 virtual unsigned int GetConversionCost(vtkDataObject* sourceRepresentation=
nullptr, vtkDataObject* targetRepresentation=
nullptr)
105 (void)(sourceRepresentation);
106 (void)(targetRepresentation);
111 virtual const char* GetName() = 0;
114 virtual const char* GetSourceRepresentationName() = 0;
117 virtual const char* GetTargetRepresentationName() = 0;
121 virtual void GetRuleConversionParameters(ConversionParameterListType& conversionParameters);
124 virtual void SetConversionParameter(
const std::string& name,
const std::string& value,
const std::string& description=
"");
127 virtual std::string GetConversionParameter(
const std::string& name);
130 virtual std::string GetConversionParameterDescription(
const std::string& name);
133 bool HasConversionParameter(
const std::string& name);
137 virtual bool CreateTargetRepresentation(
vtkSegment* segment);
155 bool ReplaceTargetRepresentation{
false};
160 #endif // __vtkSegmentationConverterRule_h This class encapsulates a segment that is part of a segmentation.
virtual bool PostConvert(vtkSegmentation *vtkNotUsed(segmentation))
ConversionParameterListType ConversionParameters
Abstract converter rule class. Subclasses perform conversions between specific representation types...
virtual unsigned int GetConversionCost(vtkDataObject *sourceRepresentation=nullptr, vtkDataObject *targetRepresentation=nullptr)
This class encapsulates a segmentation that can contain multiple segments and multiple representation...
std::map< std::string, std::pair< std::string, std::string > > ConversionParameterListType
virtual bool PreConvert(vtkSegmentation *vtkNotUsed(segmentation))
Class that can convert between different representations of a segment.