21 #ifndef otbConcatenateSampleListFilter_hxx
22 #define otbConcatenateSampleListFilter_hxx
25 #include "itkProgressReporter.h"
32 template <
class TSampleList>
37 template <
class TSampleList>
41 Superclass::ProcessObject::AddInput(
const_cast<SampleListType*
>(inputPtr));
45 template <
class TSampleList>
52 outputSampleListPtr->Clear();
55 outputSampleListPtr->SetMeasurementVectorSize(
static_cast<SampleListType*
>(Superclass::ProcessObject::GetInput(0))->GetMeasurementVectorSize());
58 unsigned long totalNumberOfSamples = 0;
60 for (
unsigned int inputIndex = 0; inputIndex < this->GetNumberOfInputs(); ++inputIndex)
63 typename SampleListType::ConstPointer inputPtr =
static_cast<SampleListType*
>(Superclass::ProcessObject::GetInput(inputIndex));
65 totalNumberOfSamples += inputPtr->Size();
69 itk::ProgressReporter progress(
this, 0, totalNumberOfSamples);
71 for (
unsigned int inputIndex = 0; inputIndex < this->GetNumberOfInputs(); ++inputIndex)
74 typename SampleListType::ConstPointer inputSampleListPtr =
static_cast<SampleListType*
>(Superclass::ProcessObject::GetInput(inputIndex));
76 typename SampleListType::ConstIterator inputIt = inputSampleListPtr->Begin();
79 while (inputIt != inputSampleListPtr->End())
82 outputSampleListPtr->PushBack(inputIt.GetMeasurementVector());
85 progress.CompletedPixel();
92 template <
class TSampleList>
96 Superclass::PrintSelf(os, indent);
97 os << indent <<
"Number of input SampleList: " << this->GetNumberOfInputs();