21 #ifndef __vtkSegmentationConverter_h 22 #define __vtkSegmentationConverter_h 25 #include <vtkObject.h> 26 #include <vtkSmartPointer.h> 35 #include "vtkSegmentationCoreConfigure.h" 39 class vtkAbstractTransform;
77 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
83 void GetAvailableRepresentationNames(std::set<std::string>& representationNames);
86 void GetPossibleConversions(
const std::string& sourceRepresentationName,
const std::string& targetRepresentationName, ConversionPathAndCostListType &pathsCosts);
98 void SetConversionParameter(
const std::string& name,
const std::string& value,
const std::string& description=
"");
102 std::string GetConversionParameter(
const std::string& name);
106 std::string GetConversionParameterDescription(
const std::string& description);
110 std::string SerializeAllConversionParameters();
114 void DeserializeConversionParameters(std::string conversionParametersString);
119 void ApplyTransformOnReferenceImageGeometry(vtkAbstractTransform* transform);
124 static ConversionPathType GetCheapestPath(
const ConversionPathAndCostListType &pathsCosts);
130 static std::string SerializeImageGeometry(vtkMatrix4x4* geometryMatrix, vtkImageData* imageData);
133 static std::string SerializeImageGeometry(vtkMatrix4x4* geometryMatrix,
int extent[6]);
142 static bool DeserializeImageGeometry(std::string geometryString,
vtkOrientedImageData* orientedImageData,
bool allocateScalars=
true,
int scalarType=VTK_VOID,
int numberOfScalarsComponents=-1);
149 static bool DeserializeImageGeometry(std::string geometryString, vtkMatrix4x4* geometryMatrix,
int extent[6]);
153 void RebuildRulesGraph();
164 void FindPath(
const std::string& sourceRepresentationName,
const std::string& targetRepresentationName, ConversionPathAndCostListType &pathsCosts, std::set<std::string>& skipRepresentations);
186 #endif // __vtkSegmentationConverter_h This class encapsulates a segment that is part of a segmentation.
static const char * GetThresholdValueFieldName()
static const char * GetInterpolationTypeFieldName()
static const std::string GetReferenceImageGeometryParameterName()
static const char * GetSegmentationBinaryLabelmapRepresentationName()
std::vector< ConversionPathAndCostType > ConversionPathAndCostListType
std::map< std::string, RulesListType > RepresentationToRepresentationToRuleMapType
For each "from" representation (first) stores an array of rules (second)
std::vector< vtkSmartPointer< vtkSegmentationConverterRule > > ConverterRulesListType
Image data containing orientation information.
std::vector< vtkSegmentationConverterRule * > RulesListType
For each "to" representation (first) stores a rule (second)
static const char * GetSegmentationClosedSurfaceRepresentationName()
RepresentationToRepresentationToRuleMapType RulesGraph
Source representation to target representation rule graph.
std::vector< vtkSegmentationConverterRule * > ConversionPathType
static const char * GetSegmentationFractionalLabelmapRepresentationName()
std::map< std::string, std::pair< std::string, std::string > > ConversionParameterListType
static const char * GetSegmentationPlanarContourRepresentationName()
static const char * GetScalarRangeFieldName()
Field names for 2D display parameters.
ConverterRulesListType ConverterRules
std::pair< ConversionPathType, unsigned int > ConversionPathAndCostType
Class that can convert between different representations of a segment.