ITK  5.2.0
Insight Toolkit
itkNormalizedCorrelationImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkNormalizedCorrelationImageFilter_h
19 #define itkNormalizedCorrelationImageFilter_h
20 
22 
23 namespace itk
24 {
52 template <typename TInputImage,
53  typename TMaskImage,
54  typename TOutputImage,
55  typename TOperatorValueType = typename TOutputImage::PixelType>
56 class ITK_TEMPLATE_EXPORT NormalizedCorrelationImageFilter
57  : public NeighborhoodOperatorImageFilter<TInputImage, TOutputImage, TOperatorValueType>
58 {
59 public:
60  ITK_DISALLOW_COPY_AND_ASSIGN(NormalizedCorrelationImageFilter);
61 
65 
68 
70  itkNewMacro(Self);
71 
74 
77  using OutputPixelType = typename TOutputImage::PixelType;
78  using OutputInternalPixelType = typename TOutputImage::InternalPixelType;
79  using InputPixelType = typename TInputImage::PixelType;
80  using InputInternalPixelType = typename TInputImage::InternalPixelType;
81  using MaskPixelType = typename TMaskImage::PixelType;
82  using MaskInternalPixelType = typename TMaskImage::InternalPixelType;
83 
86  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
87  static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
88  static constexpr unsigned int MaskImageDimension = TMaskImage::ImageDimension;
89 
91  using InputImageType = TInputImage;
92  using MaskImageType = TMaskImage;
93  using OutputImageType = TOutputImage;
94  using InputImagePointer = typename InputImageType::Pointer;
95  using MaskImagePointer = typename MaskImageType::Pointer;
96 
99 
101  using OutputImageRegionType = typename Superclass::OutputImageRegionType;
102  using OperatorValueType = typename Superclass::OperatorValueType;
103 
105  using OutputNeighborhoodType = typename Superclass::OutputNeighborhoodType;
106 
110  void
111  SetMaskImage(const TMaskImage * mask);
112 
116  const TMaskImage *
117  GetMaskImage() const;
118 
122  void
124  {
125  this->SetOperator(t);
126  }
127 
128 #ifdef ITK_USE_CONCEPT_CHECKING
129  // Begin concept checking
131  itkConceptMacro(OutputHasNumericTraitsCheck, (Concept::HasNumericTraits<OutputPixelType>));
132  itkConceptMacro(OperatorHasNumericTraitsCheck, (Concept::HasNumericTraits<OperatorValueType>));
133  // This filter can only operate on data types that are signed.
134  itkConceptMacro(SignedOutputPixelType, (Concept::Signed<OutputPixelType>));
135  // End concept checking
136 #endif
137 
138 protected:
140  ~NormalizedCorrelationImageFilter() override = default;
141 
147  void
148  GenerateInputRequestedRegion() override;
149 
161  void
162  DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
163 
165  void
166  PrintSelf(std::ostream & os, Indent indent) const override
167  {
168  Superclass::PrintSelf(os, indent);
169  }
170 };
171 } // end namespace itk
173 
174 #ifndef ITK_MANUAL_INSTANTIATION
175 # include "itkNormalizedCorrelationImageFilter.hxx"
176 #endif
177 
178 #endif
itk::Concept::HasNumericTraits
Definition: itkConceptChecking.h:712
itk::NormalizedCorrelationImageFilter::MaskInternalPixelType
typename TMaskImage::InternalPixelType MaskInternalPixelType
Definition: itkNormalizedCorrelationImageFilter.h:82
itk::NormalizedCorrelationImageFilter::MaskImagePointer
typename MaskImageType::Pointer MaskImagePointer
Definition: itkNormalizedCorrelationImageFilter.h:95
itk::Neighborhood< OperatorValueType, Self::ImageDimension >
itk::NormalizedCorrelationImageFilter::MaskPixelType
typename TMaskImage::PixelType MaskPixelType
Definition: itkNormalizedCorrelationImageFilter.h:81
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::NeighborhoodOperatorImageFilter::OperatorValueType
TOperatorValueType OperatorValueType
Definition: itkNeighborhoodOperatorImageFilter.h:74
itk::Concept::SameDimension
Definition: itkConceptChecking.h:692
itk::ImageBoundaryCondition< InputImageType >
itk::NeighborhoodOperatorImageFilter::OutputPixelType
typename TOutputImage::PixelType OutputPixelType
Definition: itkNeighborhoodOperatorImageFilter.h:70
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::ImageToImageFilter::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition: itkImageToImageFilter.h:130
itk::Concept::Signed
Definition: itkConceptChecking.h:652
itk::NormalizedCorrelationImageFilter::MaskImageType
TMaskImage MaskImageType
Definition: itkNormalizedCorrelationImageFilter.h:92
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itkNeighborhoodOperatorImageFilter.h
itk::ImageSource::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkImageSource.h:92
itk::NormalizedCorrelationImageFilter
Computes the normalized correlation of an image and a template.
Definition: itkNormalizedCorrelationImageFilter.h:56
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:64
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::NeighborhoodOperatorImageFilter::InputPixelType
typename TInputImage::PixelType InputPixelType
Definition: itkNeighborhoodOperatorImageFilter.h:72
itk::NeighborhoodOperatorImageFilter::OutputInternalPixelType
typename TOutputImage::InternalPixelType OutputInternalPixelType
Definition: itkNeighborhoodOperatorImageFilter.h:71
itk::NormalizedCorrelationImageFilter::SetTemplate
void SetTemplate(const OutputNeighborhoodType &t)
Definition: itkNormalizedCorrelationImageFilter.h:123
itk::NormalizedCorrelationImageFilter::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
Definition: itkNormalizedCorrelationImageFilter.h:166
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:138
itk::NeighborhoodOperatorImageFilter
Applies a single NeighborhoodOperator to an image region.
Definition: itkNeighborhoodOperatorImageFilter.h:51
itk::NeighborhoodOperatorImageFilter::InputInternalPixelType
typename TInputImage::InternalPixelType InputInternalPixelType
Definition: itkNeighborhoodOperatorImageFilter.h:73
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90