Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
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 
101  virtual void GenerateOutputInformation();
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
itk::IndexedUnaryFunctorImageFilter::Self
IndexedUnaryFunctorImageFilter Self
Definition: itkIndexedUnaryFunctorImageFilter.h:43
itk::IndexedUnaryFunctorImageFilter::GetFunctor
FunctorType & GetFunctor()
Definition: itkIndexedUnaryFunctorImageFilter.h:71
itk::IndexedUnaryFunctorImageFilter::IndexedUnaryFunctorImageFilter
IndexedUnaryFunctorImageFilter()
itk::IndexedUnaryFunctorImageFilter::FunctorType
TFunction FunctorType
Definition: itkIndexedUnaryFunctorImageFilter.h:52
itk::IndexedUnaryFunctorImageFilter::SetFunctor
void SetFunctor(const FunctorType &functor)
Definition: itkIndexedUnaryFunctorImageFilter.h:80
itk::IndexedUnaryFunctorImageFilter::InputImageType
TInputImage InputImageType
Definition: itkIndexedUnaryFunctorImageFilter.h:57
itk::IndexedUnaryFunctorImageFilter::Superclass
InPlaceImageFilter< TInputImage, TOutputImage > Superclass
Definition: itkIndexedUnaryFunctorImageFilter.h:44
itk::IndexedUnaryFunctorImageFilter::Pointer
SmartPointer< Self > Pointer
Definition: itkIndexedUnaryFunctorImageFilter.h:45
itk::IndexedUnaryFunctorImageFilter::InputImagePixelType
InputImageType::PixelType InputImagePixelType
Definition: itkIndexedUnaryFunctorImageFilter.h:60
itk::IndexedUnaryFunctorImageFilter::ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkIndexedUnaryFunctorImageFilter.h:46
itk::SmartPointer< Self >
itk::IndexedUnaryFunctorImageFilter::GetFunctor
const FunctorType & GetFunctor() const
Definition: itkIndexedUnaryFunctorImageFilter.h:72
itk::IndexedUnaryFunctorImageFilter::OutputImageRegionType
OutputImageType::RegionType OutputImageRegionType
Definition: itkIndexedUnaryFunctorImageFilter.h:64
itk::IndexedUnaryFunctorImageFilter
Perform a generic pixel-wise index specific operation on an input image and produces an output image.
Definition: itkIndexedUnaryFunctorImageFilter.h:39
itk::IndexedUnaryFunctorImageFilter::OutputImagePointer
OutputImageType::Pointer OutputImagePointer
Definition: itkIndexedUnaryFunctorImageFilter.h:63
itk::IndexedUnaryFunctorImageFilter::~IndexedUnaryFunctorImageFilter
virtual ~IndexedUnaryFunctorImageFilter()
Definition: itkIndexedUnaryFunctorImageFilter.h:91
itk::IndexedUnaryFunctorImageFilter::OutputImagePixelType
OutputImageType::PixelType OutputImagePixelType
Definition: itkIndexedUnaryFunctorImageFilter.h:65
itk::IndexedUnaryFunctorImageFilter::GenerateOutputInformation
virtual void GenerateOutputInformation()
itk::IndexedUnaryFunctorImageFilter::InputImagePointer
InputImageType::ConstPointer InputImagePointer
Definition: itkIndexedUnaryFunctorImageFilter.h:58
itk
SET FUNCTIONS.
Definition: itkIntelligentBinaryClosingFilter.h:30
itk::IndexedUnaryFunctorImageFilter::ThreadedGenerateData
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId)
itk::IndexedUnaryFunctorImageFilter::InputImageRegionType
InputImageType::RegionType InputImageRegionType
Definition: itkIndexedUnaryFunctorImageFilter.h:59
itk::IndexedUnaryFunctorImageFilter::OutputImageType
TOutputImage OutputImageType
Definition: itkIndexedUnaryFunctorImageFilter.h:62