Medical Imaging Interaction Toolkit  2018.4.99-e1268d66
Medical Imaging Interaction Toolkit
itkMaskedNaryStatisticsImageFilter.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef __itkMaskedNaryStatisticsImageFilter_h
14 #define __itkMaskedNaryStatisticsImageFilter_h
15 
16 #include "itkImageToImageFilter.h"
17 #include "itkImageIterator.h"
18 #include "itkArray.h"
19 
20 namespace itk
21 {
31 template< class TInputImage, class TMaskImage = ::itk::Image<unsigned char, TInputImage::ImageDimension> >
33  public ImageToImageFilter< TInputImage, TInputImage >
34 
35 {
36 public:
39  typedef ImageToImageFilter< TInputImage, TInputImage > Superclass;
43  itkNewMacro(Self);
44 
46  itkTypeMacro(MaskedNaryStatisticsImageFilter, ImageToImageFilter);
47 
49  typedef TInputImage InputImageType;
50  typedef typename InputImageType::Pointer InputImagePointer;
51  typedef typename InputImageType::RegionType InputImageRegionType;
53  typedef typename NumericTraits< InputImagePixelType >::RealType RealType;
54 
55  typedef std::vector<InputImagePixelType> PixelVectorType;
56  typedef std::vector<RealType> RealVectorType;
57 
58  typedef TMaskImage MaskImageType;
59  typedef typename MaskImageType::Pointer MaskImagePointer;
60  typedef typename MaskImageType::ConstPointer MaskImageConstPointer;
61  typedef typename MaskImageType::RegionType MaskImageRegionType;
62 
63  itkSetConstObjectMacro(Mask, MaskImageType);
64  itkGetConstObjectMacro(Mask, MaskImageType);
65 
66  itkGetConstReferenceMacro(Mean,RealVectorType);
67  itkGetConstReferenceMacro(Sigma,RealVectorType);
68  itkGetConstReferenceMacro(Variance,RealVectorType);
69  itkGetConstReferenceMacro(Sum,RealVectorType);
70  itkGetConstReferenceMacro(Minimum,PixelVectorType);
71  itkGetConstReferenceMacro(Maximum,PixelVectorType);
72 
74  itkStaticConstMacro(
75  InputImageDimension, unsigned int, TInputImage::ImageDimension);
76 
77 #ifdef ITK_USE_CONCEPT_CHECKING
78 
79  itkConceptMacro( SameDimensionCheck,
80  ( Concept::SameDimension< InputImageDimension, InputImageDimension > ) );
81  itkConceptMacro( OutputHasZeroCheck,
82  ( Concept::HasZero< InputImagePixelType > ) );
84 #endif
85 protected:
88 
89  void GenerateData() override;
90 
91 private:
92  MaskedNaryStatisticsImageFilter(const Self &); //purposely not implemented
93  void operator=(const Self &); //purposely not implemented
94 
95  RealVectorType m_Mean;
96  RealVectorType m_Sigma;
97  RealVectorType m_Variance;
98  RealVectorType m_Sum;
99  PixelVectorType m_Minimum;
100  PixelVectorType m_Maximum;
101 
102  MaskImageConstPointer m_Mask;
103 };
104 } // end namespace itk
105 
106 #ifndef ITK_MANUAL_INSTANTIATION
107 #include "itkMaskedNaryStatisticsImageFilter.hxx"
108 #endif
109 
110 #endif
NumericTraits< InputImagePixelType >::RealType RealType
std::vector< InputImagePixelType > PixelVectorType
ImageToImageFilter< TInputImage, TInputImage > Superclass
Computes a masked statistic on N images and produces vectors of those statistic results.
unsigned short PixelType