18 #ifndef __otbGISTableToLabelMapFilter_txx
19 #define __otbGISTableToLabelMapFilter_txx
22 #include "itkNumericTraits.h"
26 template<
class TGISTable,
class TLabelMap>
30 m_BackgroundValue = itk::NumericTraits<OutputLabelMapPixelType>::max();
31 m_GISTableToVectorDataFilter = GISTableToVectorDataFilterType::New();
32 m_VectorDataToLabelMapFilter = VectorDataToLabelMapFilterType::New();
34 m_VectorDataToLabelMapFilter->SetInput(m_GISTableToVectorDataFilter->GetOutput());
37 template<
class TGISTable,
class TLabelMap>
44 const_cast<InputGISTableType *>(input));
47 template<
class TGISTable,
class TLabelMap>
54 const_cast<InputGISTableType *>(input));
57 template<
class TGISTable,
class TLabelMap>
62 if (this->GetNumberOfInputs() < 1)
67 return static_cast<const TGISTable *
>
71 template<
class TGISTable,
class TLabelMap>
76 return static_cast<const TGISTable *
>
80 template<
class TGISTable,
class TLabelMap>
109 template <
class TGISTable,
class TLabelMap>
119 if (!inputPtr || !outputPtr)
125 typename OutputLabelMapType::RegionType outputLargestPossibleRegion;
126 outputLargestPossibleRegion.SetSize(m_Size);
127 outputLargestPossibleRegion.SetIndex(m_StartIndex);
128 outputPtr->SetLargestPossibleRegion(outputLargestPossibleRegion);
131 outputPtr->SetSpacing(m_GISTableToVectorDataFilter->GetOutput()->GetSpacing());
132 outputPtr->SetOrigin(m_GISTableToVectorDataFilter->GetOutput()->GetOrigin());
136 template<
class TGISTable,
class TLabelMap>
142 this->AllocateOutputs();
146 m_GISTableToVectorDataFilter->SetInput(this->GetInput());
148 m_BackgroundValue = itk::NumericTraits<OutputLabelMapPixelType>::max();
149 m_VectorDataToLabelMapFilter->SetBackgroundValue(this->GetBackgroundValue());
152 m_VectorDataToLabelMapFilter->SetSize(m_Size);
153 m_VectorDataToLabelMapFilter->SetStartIndex(m_StartIndex);
157 output = m_VectorDataToLabelMapFilter->GetOutput();
159 m_VectorDataToLabelMapFilter->Update();
163 template<
class TGISTable,
class TLabelMap>
168 Superclass::PrintSelf(os, indent);
170 os << indent <<
"GISTableToVectorData:" << this->m_GISTableToVectorDataFilter << std::endl;