itkComputeStatisticsWherePositiveFilter.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkComputeStatisticsWherePositiveFilter_h
00018 #define __itkComputeStatisticsWherePositiveFilter_h
00019
00020 #include "itkImageToImageFilter.h"
00021 #include "itkImage.h"
00022 #include "itkArray.h"
00023
00024 namespace itk
00025 {
00029 template <class TInputImage, class TOutputImage>
00030 class ITK_EXPORT ComputeStatisticsWherePositiveFilter : public ImageToImageFilter< TInputImage, TOutputImage >
00031 {
00032 public:
00034 typedef TInputImage InputImageType;
00035 typedef TOutputImage OutputImageType;
00036
00038 typedef ComputeStatisticsWherePositiveFilter Self;
00039 typedef ImageToImageFilter< InputImageType, OutputImageType> Superclass;
00040 typedef SmartPointer<Self> Pointer;
00041 typedef SmartPointer<const Self> ConstPointer;
00042
00044 itkNewMacro(Self);
00045
00047 itkTypeMacro( ComputeStatisticsWherePositiveFilter, ImageToImageFilter );
00048
00050 typedef typename InputImageType::PixelType InputPixelType;
00051 typedef typename OutputImageType::PixelType OutputPixelType;
00052 typedef typename NumericTraits<InputPixelType>::RealType InputRealType;
00053 typedef typename InputImageType::RegionType InputImageRegionType;
00054 typedef typename OutputImageType::RegionType OutputImageRegionType;
00055 typedef typename InputImageType::SizeType InputSizeType;
00056
00058 typedef itk::Array<double> StoreType;
00059 typedef itk::Array<unsigned long> CountType;
00060
00062 itkGetMacro( Mean, double );
00063 itkGetMacro( Std, double );
00064 itkGetMacro( Min, double );
00065 itkGetMacro( Max, double );
00066 itkGetMacro( Ready, bool );
00067 protected:
00068 ComputeStatisticsWherePositiveFilter();
00069 virtual ~ComputeStatisticsWherePositiveFilter() {}
00070 void ThreadedGenerateData( const OutputImageRegionType& outputRegionForThread, int threadId );
00071
00072 void Modified(){
00073 this->Superclass::Modified();
00074 m_Ready = false;
00075 }
00076 using itk::Object::Modified;
00077 void BeforeThreadedGenerateData();
00078 void AfterThreadedGenerateData();
00079 private:
00080 ComputeStatisticsWherePositiveFilter(const Self&);
00081 void operator=(const Self&);
00082
00083
00084 StoreType m_TMean;
00085 StoreType m_TStd;
00086 StoreType m_TMin;
00087 StoreType m_TMax;
00088 CountType m_TCount;
00089
00090
00091 double m_Mean;
00092 double m_Std;
00093 double m_Min;
00094 double m_Max;
00095
00096
00097 bool m_Ready;
00098 };
00099
00100 }
00101
00102 #ifndef ITK_MANUAL_INSTANTIATION
00103 #include "itkComputeStatisticsWherePositiveFilter.txx"
00104 #endif
00105
00106 #endif