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);
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;
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();
529 #ifndef OTB_MANUAL_INSTANTIATION
This filter link a persistent filter with a StreamingImageVirtualWriter.
This filter is the base class for all filter persisting data through multiple update....
Compute covariance & correlation of a large image using streaming.
CountType GetNbRelevantPixels() const
std::vector< unsigned int > m_IgnoredUserPixelCount
std::vector< PixelType > m_ThreadMin
PersistentStreamingStatisticsVectorImageFilter Self
PersistentStreamingStatisticsVectorImageFilter(const Self &)=delete
bool m_UseUnbiasedEstimator
bool m_IgnoreUserDefinedValue
ImageType::Pointer InputImagePointer
itk::SimpleDataObjectDecorator< CountType > CountObjectType
bool m_EnableSecondOrderStats
void operator=(const Self &)=delete
std::vector< RealType > m_ThreadFirstOrderComponentAccumulators
itk::SmartPointer< Self > Pointer
PixelType GetMaximum() const
itk::SimpleDataObjectDecorator< MatrixType > MatrixObjectType
RealType GetComponentCorrelation() const
itk::VariableLengthVector< PrecisionType > RealPixelType
PersistentImageFilter< TInputImage, TInputImage > Superclass
itk::SimpleDataObjectDecorator< RealPixelType > RealPixelObjectType
std::vector< unsigned int > m_IgnoredInfinitePixelCount
itk::SimpleDataObjectDecorator< IndexType > IndexObjectType
ImageType::InternalPixelType InternalPixelType
ImageType::PixelType PixelType
~PersistentStreamingStatisticsVectorImageFilter() override
bool m_IgnoreInfiniteValues
RealPixelType GetMean() const
bool m_EnableFirstOrderStats
itk::VariableLengthVector< unsigned long > CountType
std::vector< RealType > m_ThreadSecondOrderComponentAccumulators
itk::SmartPointer< const Self > ConstPointer
std::vector< PixelType > m_ThreadMax
PixelType GetMinimum() const
itk::DataObject::Pointer DataObjectPointer
itk::VariableSizeMatrix< PrecisionType > MatrixType
MatrixType GetCorrelation() const
std::vector< MatrixType > m_ThreadSecondOrderAccumulators
RealPixelType GetSum() const
ImageType::RegionType RegionType
std::vector< RealPixelType > m_ThreadFirstOrderAccumulators
MatrixType GetCovariance() const
itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
RealType GetComponentMean() const
InternalPixelType m_UserIgnoredValue
itk::SimpleDataObjectDecorator< PixelType > PixelObjectType
ImageType::SizeType SizeType
RealType GetComponentCovariance() const
itk::SimpleDataObjectDecorator< RealType > RealObjectType
ImageType::IndexType IndexType
This class streams the whole input image through the PersistentStatisticsImageFilter.
CountType GetNbRelevantPixels() const
otbSetObjectMemberMacro(Filter, EnableSecondOrderStats, bool)
RealObjectType * GetComponentCorrelationOutput()
const RealPixelObjectType * GetMeanOutput() const
const RealPixelObjectType * GetMaximumOutput() const
StatFilterType::CountObjectType CountObjectType
const RealPixelObjectType * GetSumOutput() const
RealObjectType * GetComponentMeanOutput()
otbGetObjectMemberMacro(Filter, UseUnbiasedEstimator, bool)
const InputImageType * GetInput()
RealPixelType GetMinimum() const
otbSetObjectMemberMacro(Filter, UserIgnoredValue, InternalPixelType)
MatrixType GetCovariance() const
otbGetObjectMemberMacro(Filter, IgnoreInfiniteValues, bool)
otbSetObjectMemberMacro(Filter, IgnoreInfiniteValues, bool)
MatrixObjectType * GetCovarianceOutput()
RealObjectType * GetComponentCovarianceOutput()
StreamingStatisticsVectorImageFilter(const Self &)=delete
const RealPixelObjectType * GetMinimumOutput() const
otbSetObjectMemberMacro(Filter, EnableFirstOrderStats, bool)
RealPixelObjectType * GetMaximumOutput()
MatrixObjectType * GetCorrelationOutput()
StatFilterType::InternalPixelType InternalPixelType
StatFilterType::MatrixType MatrixType
MatrixType GetCorrelation() const
CountObjectType * GetNbRelevantPixelsOutput()
const CountObjectType * GetNbRelevantPixelsOutput() const
itk::SmartPointer< const Self > ConstPointer
RealPixelObjectType * GetMinimumOutput()
StatFilterType::PixelType PixelType
StreamingStatisticsVectorImageFilter Self
RealPixelObjectType * GetMeanOutput()
otbGetObjectMemberMacro(Filter, EnableSecondOrderStats, bool)
StatFilterType::RealObjectType RealObjectType
const RealObjectType * GetComponentCovarianceOutput() const
~StreamingStatisticsVectorImageFilter() override
otbGetObjectMemberMacro(Filter, EnableMinMax, bool)
otbSetObjectMemberMacro(Filter, IgnoreUserDefinedValue, bool)
otbGetObjectMemberMacro(Filter, EnableFirstOrderStats, bool)
PersistentFilterStreamingDecorator< PersistentStreamingStatisticsVectorImageFilter< TInputImage, TPrecision > > Superclass
StatFilterType::RealType RealType
RealType GetComponentCovariance() const
otbGetObjectMemberMacro(Filter, IgnoreUserDefinedValue, bool)
StatFilterType::RealPixelType RealPixelType
void operator=(const Self &)=delete
otbSetObjectMemberMacro(Filter, UseUnbiasedEstimator, bool)
StatFilterType::RealPixelObjectType RealPixelObjectType
StreamingStatisticsVectorImageFilter()
itk::SmartPointer< Self > Pointer
RealType GetComponentMean() const
RealPixelType GetMaximum() const
StatFilterType::MatrixObjectType MatrixObjectType
RealType GetComponentCorrelation() const
RealPixelType GetSum() const
StatFilterType::CountType CountType
const RealObjectType * GetComponentMeanOutput() const
RealPixelType GetMean() const
const RealObjectType * GetComponentCorrelationOutput() const
otbSetObjectMemberMacro(Filter, EnableMinMax, bool)
const MatrixObjectType * GetCovarianceOutput() const
RealPixelObjectType * GetSumOutput()
TInputImage InputImageType
otbGetObjectMemberMacro(Filter, UserIgnoredValue, InternalPixelType)
const MatrixObjectType * GetCorrelationOutput() const
Superclass::FilterType StatFilterType
void SetInput(InputImageType *input)
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.