22 #ifndef otbStreamingStatisticsImageFilter_h
23 #define otbStreamingStatisticsImageFilter_h
26 #include "itkNumericTraits.h"
28 #include "itkSimpleDataObjectDecorator.h"
51 template <
class TInputImage>
72 typedef typename TInputImage::SizeType
SizeType;
76 itkStaticConstMacro(InputImageDimension,
unsigned int, TInputImage::ImageDimension);
79 itkStaticConstMacro(ImageDimension,
unsigned int, TInputImage::ImageDimension);
82 typedef typename itk::NumericTraits<PixelType>::RealType
RealType;
95 return this->GetMinimumOutput()->Get();
97 PixelObjectType* GetMinimumOutput();
98 const PixelObjectType* GetMinimumOutput()
const;
104 return this->GetMaximumOutput()->Get();
106 PixelObjectType* GetMaximumOutput();
107 const PixelObjectType* GetMaximumOutput()
const;
113 return this->GetMeanOutput()->Get();
115 RealObjectType* GetMeanOutput();
116 const RealObjectType* GetMeanOutput()
const;
122 return this->GetSigmaOutput()->Get();
124 RealObjectType* GetSigmaOutput();
125 const RealObjectType* GetSigmaOutput()
const;
131 return this->GetVarianceOutput()->Get();
133 RealObjectType* GetVarianceOutput();
134 const RealObjectType* GetVarianceOutput()
const;
140 return this->GetSumOutput()->Get();
142 RealObjectType* GetSumOutput();
143 const RealObjectType* GetSumOutput()
const;
148 DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx)
override;
149 using Superclass::MakeOutput;
154 void AllocateOutputs()
override;
155 void GenerateOutputInformation()
override;
156 void Synthetize(
void)
override;
157 void Reset(
void)
override;
160 itkSetMacro(IgnoreInfiniteValues,
bool);
161 itkGetMacro(IgnoreInfiniteValues,
bool);
163 itkSetMacro(IgnoreUserDefinedValue,
bool);
164 itkGetMacro(IgnoreUserDefinedValue,
bool);
174 void PrintSelf(std::ostream& os, itk::Indent indent)
const override;
177 void ThreadedGenerateData(
const RegionType& outputRegionForThread, itk::ThreadIdType threadId)
override;
233 template <
class TInputImage>
258 using Superclass::SetInput;
261 this->GetFilter()->SetInput(input);
265 return this->GetFilter()->GetInput();
271 return this->GetFilter()->GetMinimumOutput()->Get();
275 return this->GetFilter()->GetMinimumOutput();
279 return this->GetFilter()->GetMinimumOutput();
285 return this->GetFilter()->GetMaximumOutput()->Get();
289 return this->GetFilter()->GetMaximumOutput();
293 return this->GetFilter()->GetMaximumOutput();
299 return this->GetFilter()->GetMeanOutput()->Get();
303 return this->GetFilter()->GetMeanOutput();
307 return this->GetFilter()->GetMeanOutput();
314 return this->GetSigmaOutput()->Get();
318 return this->GetFilter()->GetSigmaOutput();
322 return this->GetFilter()->GetSigmaOutput();
329 return this->GetFilter()->GetVarianceOutput()->Get();
333 return this->GetFilter()->GetVarianceOutput();
337 return this->GetFilter()->GetVarianceOutput();
344 return this->GetFilter()->GetSumOutput()->Get();
348 return this->GetFilter()->GetSumOutput();
352 return this->GetFilter()->GetSumOutput();
381 #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 min. max, variance and mean of an image using the output requested region.
RealType m_UserIgnoredValue
itk::Array< RealType > m_SumOfSquares
PersistentStatisticsImageFilter Self
itk::Array< PixelType > m_ThreadMax
bool m_IgnoreInfiniteValues
bool m_IgnoreUserDefinedValue
itk::DataObject::Pointer DataObjectPointer
itk::SimpleDataObjectDecorator< PixelType > PixelObjectType
itk::SimpleDataObjectDecorator< RealType > RealObjectType
PersistentImageFilter< TInputImage, TInputImage > Superclass
RealType GetSigma() const
itk::Array< PixelType > m_ThreadMin
itk::NumericTraits< PixelType >::RealType RealType
TInputImage::PixelType PixelType
TInputImage::SizeType SizeType
itk::Array< long > m_Count
void operator=(const Self &)=delete
TInputImage::IndexType IndexType
itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
PixelType GetMinimum() const
TInputImage::Pointer InputImagePointer
PersistentStatisticsImageFilter(const Self &)=delete
std::vector< unsigned int > m_IgnoredInfinitePixelCount
itk::Array< RealType > m_ThreadSum
PixelType GetMaximum() const
itk::SmartPointer< Self > Pointer
itk::SmartPointer< const Self > ConstPointer
~PersistentStatisticsImageFilter() override
TInputImage::RegionType RegionType
std::vector< unsigned int > m_IgnoredUserPixelCount
RealType GetVariance() const
This class streams the whole input image through the PersistentStatisticsImageFilter.
PixelType GetMaximum() const
TInputImage InputImageType
RealType GetVariance() const
PersistentFilterStreamingDecorator< PersistentStatisticsImageFilter< TInputImage > > Superclass
otbSetObjectMemberMacro(Filter, IgnoreInfiniteValues, bool)
const PixelObjectType * GetMaximumOutput() const
RealObjectType * GetSigmaOutput()
itk::SimpleDataObjectDecorator< PixelType > PixelObjectType
otbGetObjectMemberMacro(Filter, IgnoreUserDefinedValue, bool)
PixelObjectType * GetMinimumOutput()
otbGetObjectMemberMacro(Filter, IgnoreInfiniteValues, bool)
const RealObjectType * GetMeanOutput() const
itk::SimpleDataObjectDecorator< RealType > RealObjectType
itk::SmartPointer< Self > Pointer
StreamingStatisticsImageFilter(const Self &)=delete
otbGetObjectMemberMacro(Filter, UserIgnoredValue, RealType)
void SetInput(InputImageType *input)
StreamingStatisticsImageFilter()
const InputImageType * GetInput()
const PixelObjectType * GetMinimumOutput() const
PixelObjectType * GetMaximumOutput()
RealObjectType * GetMeanOutput()
PixelType GetMinimum() const
~StreamingStatisticsImageFilter() override
StatFilterType::PixelType PixelType
RealType GetSigma() const
RealObjectType * GetSumOutput()
RealObjectType * GetVarianceOutput()
otbSetObjectMemberMacro(Filter, IgnoreUserDefinedValue, bool)
otbSetObjectMemberMacro(Filter, UserIgnoredValue, RealType)
StatFilterType::RealType RealType
const RealObjectType * GetSigmaOutput() const
void operator=(const Self &)=delete
StreamingStatisticsImageFilter Self
itk::SmartPointer< const Self > ConstPointer
Superclass::FilterType StatFilterType
const RealObjectType * GetVarianceOutput() const
const RealObjectType * GetSumOutput() const
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.