22 #ifndef otbStreamingStatisticsVectorImageFilter_h
23 #define otbStreamingStatisticsVectorImageFilter_h
27 #include "itkSimpleDataObjectDecorator.h"
28 #include "itkImageRegionSplitter.h"
29 #include "itkVariableSizeMatrix.h"
30 #include "itkVariableLengthVector.h"
53 template <
class TInputImage,
class TPrecision>
82 itkStaticConstMacro(ImageDimension,
unsigned int, TInputImage::ImageDimension);
89 typedef itk::VariableSizeMatrix<PrecisionType>
MatrixType;
91 typedef itk::VariableLengthVector<unsigned long>
CountType;
104 return this->GetNbRelevantPixelsOutput()->Get();
106 CountObjectType* GetNbRelevantPixelsOutput();
107 const CountObjectType* GetNbRelevantPixelsOutput()
const;
113 return this->GetMinOutput()->Get();
115 PixelObjectType* GetMinimumOutput();
116 const PixelObjectType* GetMinimumOutput()
const;
122 return this->GetMaxOutput()->Get();
124 PixelObjectType* GetMaximumOutput();
125 const PixelObjectType* GetMaximumOutput()
const;
132 return this->GetComponentMeanOutput()->Get();
134 RealObjectType* GetComponentMeanOutput();
135 const RealObjectType* GetComponentMeanOutput()
const;
142 return this->GetComponentCorrelationOutput()->Get();
144 RealObjectType* GetComponentCorrelationOutput();
145 const RealObjectType* GetComponentCorrelationOutput()
const;
152 return this->GetComponentCovarianceOutput()->Get();
154 RealObjectType* GetComponentCovarianceOutput();
155 const RealObjectType* GetComponentCovarianceOutput()
const;
161 return this->GetMeanOutput()->Get();
163 RealPixelObjectType* GetMeanOutput();
164 const RealPixelObjectType* GetMeanOutput()
const;
170 return this->GetSumOutput()->Get();
172 RealPixelObjectType* GetSumOutput();
173 const RealPixelObjectType* GetSumOutput()
const;
179 return this->GetCorrelation()->Get();
181 MatrixObjectType* GetCorrelationOutput();
182 const MatrixObjectType* GetCorrelationOutput()
const;
188 return this->GetCovarianceOutput()->Get();
190 MatrixObjectType* GetCovarianceOutput();
191 const MatrixObjectType* GetCovarianceOutput()
const;
197 DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx)
override;
198 using Superclass::MakeOutput;
200 void Reset(
void)
override;
202 void Synthetize(
void)
override;
204 itkSetMacro(EnableMinMax,
bool);
205 itkGetMacro(EnableMinMax,
bool);
207 itkSetMacro(EnableFirstOrderStats,
bool);
208 itkGetMacro(EnableFirstOrderStats,
bool);
210 itkSetMacro(EnableSecondOrderStats,
bool);
211 itkGetMacro(EnableSecondOrderStats,
bool);
213 itkSetMacro(IgnoreInfiniteValues,
bool);
214 itkGetMacro(IgnoreInfiniteValues,
bool);
216 itkSetMacro(IgnoreUserDefinedValue,
bool);
217 itkGetMacro(IgnoreUserDefinedValue,
bool);
219 itkSetMacro(UserIgnoredValue, InternalPixelType);
220 itkGetMacro(UserIgnoredValue, InternalPixelType);
222 itkSetMacro(UseUnbiasedEstimator,
bool);
223 itkGetMacro(UseUnbiasedEstimator,
bool);
235 void AllocateOutputs()
override;
237 void GenerateOutputInformation()
override;
239 void PrintSelf(std::ostream& os, itk::Indent indent)
const override;
242 void ThreadedGenerateData(
const RegionType& outputRegionForThread, itk::ThreadIdType threadId)
override;
246 void operator=(
const Self&) =
delete;
296 template <class TInputImage, class TPrecision = typename itk::NumericTraits<typename TInputImage::InternalPixelType>::RealType>
318 typedef typename StatFilterType::RealType
RealType;
329 using Superclass::SetInput;
332 this->GetFilter()->SetInput(input);
336 return this->GetFilter()->GetInput();
342 return this->GetFilter()->GetNbRelevantPixelsOutput()->Get();
346 return this->GetFilter()->GetNbRelevantPixelsOutput();
350 return this->GetFilter()->GetNbRelevantPixelsOutput();
358 return this->GetFilter()->GetMinimumOutput()->Get();
362 return this->GetFilter()->GetMinimumOutput();
366 return this->GetFilter()->GetMinimumOutput();
373 return this->GetFilter()->GetMaximumOutput()->Get();
377 return this->GetFilter()->GetMaximumOutput();
381 return this->GetFilter()->GetMaximumOutput();
388 return this->GetFilter()->GetMeanOutput()->Get();
392 return this->GetFilter()->GetMeanOutput();
396 return this->GetFilter()->GetMeanOutput();
403 return this->GetFilter()->GetSumOutput()->Get();
407 return this->GetFilter()->GetSumOutput();
411 return this->GetFilter()->GetSumOutput();
418 return this->GetFilter()->GetCovarianceOutput()->Get();
422 return this->GetFilter()->GetCovarianceOutput();
426 return this->GetFilter()->GetCovarianceOutput();
433 return this->GetFilter()->GetCorrelationOutput()->Get();
437 return this->GetFilter()->GetCorrelationOutput();
441 return this->GetFilter()->GetCorrelationOutput();
448 return this->GetFilter()->GetComponentMeanOutput()->Get();
452 return this->GetFilter()->GetComponentMeanOutput();
456 return this->GetFilter()->GetComponentMeanOutput();
463 return this->GetFilter()->GetComponentCovarianceOutput()->Get();
467 return this->GetFilter()->GetComponentCovarianceOutput();
471 return this->GetFilter()->GetComponentCovarianceOutput();
478 return this->GetFilter()->GetComponentCorrelationOutput()->Get();
482 return this->GetFilter()->GetComponentCorrelationOutput();
486 return this->GetFilter()->GetComponentCorrelationOutput();
524 void operator=(
const Self&) =
delete;
529 #ifndef OTB_MANUAL_INSTANTIATION