ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkNonLocalPatchBasedImageFilter.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 * https://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 itkNonLocalPatchBasedImageFilter_h
19#define itkNonLocalPatchBasedImageFilter_h
20
21#include <iostream>
23#include "AdaptiveDenoisingExport.h"
24
26
27namespace itk
28{
29
35
37{
38public:
43 enum class SimilarityMetric : uint8_t
44 {
47 };
48};
49
50extern AdaptiveDenoising_EXPORT std::ostream &
52
53
60
61template <typename TInputImage, typename TOutputImage = TInputImage>
62class ITK_TEMPLATE_EXPORT NonLocalPatchBasedImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
63{
64public:
65 ITK_DISALLOW_COPY_AND_MOVE(NonLocalPatchBasedImageFilter);
66
72
74 itkOverrideGetNameOfClassMacro(NonLocalPatchBasedImageFilter);
75
77 itkNewMacro(Self);
78
80 static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
81
83 using InputImageType = TInputImage;
84 using InputPixelType = typename InputImageType::PixelType;
85 using InputImagePointer = typename InputImageType::Pointer;
86 using InputImageList = std::vector<InputImagePointer>;
87 using InputImageSetList = std::vector<InputImageList>;
88 using RegionType = typename InputImageType::RegionType;
89
90 using OutputImageType = TOutputImage;
91 using OutputPixelType = typename OutputImageType::PixelType;
92
93 using InputImagePixelVectorType = std::vector<InputPixelType>;
94
95 using RealType = float;
99
102
106
107 using NeighborhoodOffsetListType = std::vector<NeighborhoodOffsetType>;
108
110#if !defined(ITK_LEGACY_REMOVE)
111 using SimilarityMetricType = SimilarityMetricEnum;
112 static constexpr SimilarityMetricType PEARSON_CORRELATION = SimilarityMetricEnum::PEARSON_CORRELATION;
113 static constexpr SimilarityMetricType MEAN_SQUARES = SimilarityMetricEnum::MEAN_SQUARES;
114#endif
115
120 itkSetMacro(NeighborhoodSearchRadius, NeighborhoodRadiusType);
121 itkGetConstMacro(NeighborhoodSearchRadius, NeighborhoodRadiusType);
122
126 itkSetMacro(NeighborhoodSearchSize, NeighborhoodSizeType);
127 itkGetConstMacro(NeighborhoodSearchSize, NeighborhoodSizeType);
128
132 virtual void
138 itkGetConstMacro(NeighborhoodSearchOffsetList, NeighborhoodOffsetListType);
139
144 itkSetMacro(NeighborhoodPatchRadius, NeighborhoodRadiusType);
145 itkGetConstMacro(NeighborhoodPatchRadius, NeighborhoodRadiusType);
146
150 itkSetMacro(NeighborhoodPatchSize, NeighborhoodSizeType);
151 itkGetConstMacro(NeighborhoodPatchSize, NeighborhoodSizeType);
152
156 virtual void
162 itkGetConstMacro(NeighborhoodPatchOffsetList, NeighborhoodOffsetListType);
163
169
170protected:
172 ~NonLocalPatchBasedImageFilter() override = default;
173
174 void
176
177 void
178 PrintSelf(std::ostream & os, Indent indent) const override;
179
182 const IndexType,
184 const bool);
185
188
191
192 void
194
195 itkSetMacro(TargetImageRegion, RegionType);
196 itkGetConstMacro(TargetImageRegion, RegionType);
197
199
203
207
209};
210
211} // end namespace itk
212
213#ifndef ITK_MANUAL_INSTANTIATION
214# include "itkNonLocalPatchBasedImageFilter.hxx"
215#endif
216
217#endif
Neighborhood patch similarity metric enumerated type.
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
Templated n-dimensional image class.
Definition itkImage.h:89
Index< VImageDimension > IndexType
Control indentation during Print() invocation.
Definition itkIndent.h:50
A light-weight container object for storing an N-dimensional neighborhood of values.
Non-local patch-based image filter enum classes.
RealType ComputeNeighborhoodPatchSimilarity(const InputImageList &, const IndexType, const InputImagePixelVectorType &, const bool)
NonLocalPatchBasedImageFilter< TInputImage, TOutputImage > Self
InputImagePixelVectorType VectorizeImagePatch(const InputImagePointer, const IndexType, const bool)
~NonLocalPatchBasedImageFilter() override=default
void BeforeThreadedGenerateData() override
virtual void SetNeighborhoodSearchOffsetList(const NeighborhoodOffsetListType list)
NonLocalPatchBasedImageFilterEnums::SimilarityMetric SimilarityMetricEnum
void PrintSelf(std::ostream &os, Indent indent) const override
void GetMeanAndStandardDeviationOfVectorizedImagePatch(const InputImagePixelVectorType &, RealType &, RealType &)
virtual void SetNeighborhoodPatchOffsetList(const NeighborhoodOffsetListType list)
typename ConstNeighborhoodIteratorType::RadiusType NeighborhoodRadiusType
typename ConstNeighborhoodIteratorType::OffsetType NeighborhoodOffsetType
InputImagePixelVectorType VectorizeImageListPatch(const InputImageList &, const IndexType, const bool)
virtual void Modified() const
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType
Definition itkIntTypes.h:86
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, AnatomicalOrientation::CoordinateEnum value)