Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
itkLocalStatisticFilter.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 itkLocalStatisticFilter_h
14 #define itkLocalStatisticFilter_h
15 
16 #include <itkImageToImageFilter.h>
17 
18 namespace itk
19 {
26  template<typename TInputImageType, typename TOuputImageType >
27  class LocalStatisticFilter : public ImageToImageFilter< TInputImageType, TOuputImageType>
28  {
29  public:
31  typedef ImageToImageFilter< TInputImageType, TOuputImageType > Superclass;
33  typedef typename TInputImageType::ConstPointer InputImagePointer;
34  typedef typename TOuputImageType::Pointer OutputImagePointer;
35  typedef typename TOuputImageType::RegionType OutputImageRegionType;
36 
37  itkNewMacro (Self);
38  itkTypeMacro(LocalStatisticFilter, ImageToImageFilter);
39 
40  itkSetMacro(Size, int);
41  itkGetConstMacro(Size, int);
42 
43  protected:
45  ~LocalStatisticFilter() override{};
46 
47  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId) override;
48  void BeforeThreadedGenerateData(void) override;
49 
50 
51  using itk::ProcessObject::MakeOutput;
52  itk::ProcessObject::DataObjectPointer MakeOutput(itk::ProcessObject::DataObjectPointerArraySizeType /*idx*/) override;
53 
55 
56  private:
57  LocalStatisticFilter(const Self &); // purposely not implemented
58  void operator=(const Self &); // purposely not implemented
59 
60  int m_Size;
61  int m_Bins;
62  };
63 }
64 
65 #ifndef ITK_MANUAL_INSTANTIATION
66 #include <itkLocalStatisticFilter.tpp>
67 #endif
68 
69 #endif // itkLocalStatisticFilter_h
Computes local statistics (mean, variance, etc.) for each voxel in a given neighbourhood.
void BeforeThreadedGenerateData(void) override
void CreateOutputImage(InputImagePointer input, OutputImagePointer output)
TInputImageType::ConstPointer InputImagePointer
itk::ProcessObject::DataObjectPointer MakeOutput(itk::ProcessObject::DataObjectPointerArraySizeType) override
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId) override
ImageToImageFilter< TInputImageType, TOuputImageType > Superclass
TOuputImageType::RegionType OutputImageRegionType
TOuputImageType::Pointer OutputImagePointer