21 #ifndef otbLabelMapToVectorDataFilter_hxx
22 #define otbLabelMapToVectorDataFilter_hxx
29 template <
class TLabelMap,
class TVectorData,
class TFieldsFunctor>
35 template <
class TLabelMap,
class TVectorData,
class TFieldsFunctor>
42 template <
class TLabelMap,
class TVectorData,
class TFieldsFunctor>
46 this->itk::ProcessObject::SetNthInput(idx,
const_cast<InputLabelMapType*
>(input));
49 template <
class TLabelMap,
class TVectorData,
class TFieldsFunctor>
53 if (this->GetNumberOfInputs() < 1)
58 return static_cast<const TLabelMap*
>(this->itk::ProcessObject::GetInput(0));
61 template <
class TLabelMap,
class TVectorData,
class TFieldsFunctor>
65 return static_cast<const TLabelMap*
>(this->itk::ProcessObject::GetInput(idx));
68 template <
class TLabelMap,
class TVectorData,
class TFieldsFunctor>
83 folder1->SetNodeType(
FOLDER);
85 output->GetDataTree()->Add(document, root);
86 output->GetDataTree()->Add(folder1, document);
97 typename PolygonType::Pointer polygon = functor(
const_cast<LabelObjectType*
>(labelObject));
106 std::ostringstream oss;
107 oss << labelObject->GetLabel();
108 node->SetNodeId(oss.str());
110 node->SetPolygonExteriorRing(correctPolygon);
114 std::map<std::string, std::string> fields = m_FieldsFunctor(
const_cast<LabelObjectType*
>(labelObject));
115 std::map<std::string, std::string>::const_iterator it2;
116 for (it2 = fields.begin(); it2 != fields.end(); ++it2)
118 node->SetFieldAsString(it2->first, it2->second);
123 output->GetDataTree()->Add(node, folder1);
128 template <
class TLabelMap,
class TVectorData,
class TFieldsFunctor>
131 Superclass::PrintSelf(os, indent);