21 #ifndef otbLabelMapToSampleListFilter_hxx
22 #define otbLabelMapToSampleListFilter_hxx
29 template <
class TInputLabelMap,
class TOutputListSample,
class TMeasurementFunctor>
32 this->SetNumberOfRequiredInputs(1);
33 this->SetNumberOfRequiredOutputs(1);
35 this->itk::ProcessObject::SetNthOutput(0, this->MakeOutput(0).GetPointer());
38 template <
class TInputLabelMap,
class TOutputListSample,
class TMeasurementFunctor>
43 template <
class TInputLabelMap,
class TOutputListSample,
class TMeasurementFunctor>
48 output =
static_cast<itk::DataObject*
>(OutputSampleListType::New().GetPointer());
53 template <
class TInputLabelMap,
class TOutputListSample,
class TMeasurementFunctor>
57 this->itk::ProcessObject::SetNthInput(0,
const_cast<InputLabelMapType*
>(inputLabelMap));
61 template <
class TInputLabelMap,
class TOutputListSample,
class TMeasurementFunctor>
65 if (this->GetNumberOfInputs() < 1)
70 return static_cast<const InputLabelMapType*
>(this->itk::ProcessObject::GetInput(0));
74 template <
class TInputLabelMap,
class TOutputListSample,
class TMeasurementFunctor>
82 template <
class TInputLabelMap,
class TOutputListSample,
class TMeasurementFunctor>
94 bool isFirstIteration =
true;
101 typename OutputSampleListType::MeasurementVectorSizeType measurementSize;
102 measurementSize = m_MeasurementFunctor(it.GetLabelObject()).Size();
103 outputSampleList->SetMeasurementVectorSize(measurementSize);
104 isFirstIteration =
false;
106 outputSampleList->PushBack(m_MeasurementFunctor(it.GetLabelObject()));
111 template <
class TInputLabelMap,
class TOutputListSample,
class TMeasurementFunctor>
114 Superclass::PrintSelf(os, indent);
const InputLabelMapType * GetInputLabelMap() const
const OutputSampleListType * GetOutputSampleList()
void PrintSelf(std::ostream &os, itk::Indent indent) const override
itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
LabelMapToSampleListFilter()
~LabelMapToSampleListFilter() override
Superclass::DataObjectPointer DataObjectPointerType
void SetInputLabelMap(const InputLabelMapType *inputLabelMap)
void GenerateData() override
InputLabelMapType::ConstPointer InputLabelMapConstPointerType
InputLabelMapType::ConstIterator ConstIteratorType
TInputLabelMap InputLabelMapType
DataObjectPointerType MakeOutput(DataObjectPointerArraySizeType idx) override
OutputSampleListType::Pointer OutputSampleListPointerType
TOutputSampleList OutputSampleListType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.