Medical Imaging Interaction Toolkit  2025.12.02
Medical Imaging Interaction Toolkit
itkIndexedUnaryFunctorImageFilter.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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef __itkIndexedUnaryFunctorImageFilter_h
18 #define __itkIndexedUnaryFunctorImageFilter_h
19 
20 #include "itkUnaryFunctorImageFilter.h"
21 
22 namespace itk
23 {
38  template< typename TInputImage, typename TOutputImage, typename TFunction >
39  class IndexedUnaryFunctorImageFilter :public InPlaceImageFilter< TInputImage, TOutputImage >
40  {
41  public:
44  typedef InPlaceImageFilter< TInputImage, TOutputImage > Superclass;
47 
49  itkNewMacro(Self);
50 
52  itkTypeMacro(IndexedUnaryFunctorImageFilter, InPlaceImageFilter);
53 
55  typedef TFunction FunctorType;
56 
57  typedef TInputImage InputImageType;
58  typedef typename InputImageType::ConstPointer InputImagePointer;
59  typedef typename InputImageType::RegionType InputImageRegionType;
60  typedef typename InputImageType::PixelType InputImagePixelType;
61 
62  typedef TOutputImage OutputImageType;
63  typedef typename OutputImageType::Pointer OutputImagePointer;
64  typedef typename OutputImageType::RegionType OutputImageRegionType;
65  typedef typename OutputImageType::PixelType OutputImagePixelType;
66 
71  FunctorType & GetFunctor() { return m_Functor; }
72  const FunctorType & GetFunctor() const { return m_Functor; }
73 
80  void SetFunctor(const FunctorType & functor)
81  {
82  if (m_Functor != functor)
83  {
84  m_Functor = functor;
85  this->Modified();
86  }
87  }
88 
89  protected:
92 
102 
113  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
114  ThreadIdType threadId);
115 
116  private:
117  IndexedUnaryFunctorImageFilter(const Self &); //purposely not implemented
118  void operator=(const Self &); //purposely not implemented
119 
120  FunctorType m_Functor;
121  };
122 } // end namespace itk
123 
124 #ifndef ITK_MANUAL_INSTANTIATION
125 #include "itkIndexedUnaryFunctorImageFilter.tpp"
126 #endif
127 
128 #endif
Perform a generic pixel-wise index specific operation on an input image and produces an output image.
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId)
InPlaceImageFilter< TInputImage, TOutputImage > Superclass