ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkParabolicOpenCloseSafeBorderImageFilter.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 itkParabolicOpenCloseSafeBorderImageFilter_h
19#define itkParabolicOpenCloseSafeBorderImageFilter_h
20
22#include "itkCropImageFilter.h"
24#include "itkCastImageFilter.h"
26
27/* this class implements padding and cropping, so we don't just
28 * inherit from the OpenCloseImageFitler */
29
30namespace itk
31{
32template <typename TInputImage, bool DoOpen, typename TOutputImage = TInputImage>
33class ITK_TEMPLATE_EXPORT ParabolicOpenCloseSafeBorderImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
34{
35public:
36 ITK_DISALLOW_COPY_AND_MOVE(ParabolicOpenCloseSafeBorderImageFilter);
37
43
45 itkNewMacro(Self);
46
48 itkOverrideGetNameOfClassMacro(ParabolicOpenCloseSafeBorderImageFilter);
49
51 using InputImageType = TInputImage;
52 using OutputImageType = TOutputImage;
53 using InputPixelType = typename TInputImage::PixelType;
56 using OutputPixelType = typename TOutputImage::PixelType;
57
59 using InputImagePointer = typename TInputImage::Pointer;
60 using InputImageConstPointer = typename TInputImage::ConstPointer;
61
64
66 static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
70
71 // set all of the scales the same
72 void
74 {
75 RadiusType s = this->GetScale();
76
77 this->m_MorphFilt->SetScale(scale);
78 if (s != this->GetScale())
79 {
80 this->Modified();
81 }
82 }
83
84 // different scale for each direction
85 void
87 {
88 if (scale != this->GetScale())
89 {
90 this->m_MorphFilt->SetScale(scale);
91 this->Modified();
92 }
93 }
94
95 //
96 const RadiusType &
97 GetScale() const
98 {
99 return (this->m_MorphFilt->GetScale());
100 }
101
102 void
104 {
105 if (B != this->GetUseImageSpacing())
106 {
107 this->m_MorphFilt->SetUseImageSpacing(B);
108 this->Modified();
109 }
110 }
111
112 bool
114 {
115 return (this->m_MorphFilt->GetUseImageSpacing());
116 }
117
118 itkBooleanMacro(UseImageSpacing);
119
120 itkSetMacro(SafeBorder, bool);
121 itkGetConstReferenceMacro(SafeBorder, bool);
122 itkBooleanMacro(SafeBorder);
123 // should add the Get methods
124
126 {
127 NOCHOICE = 0, // decices based on scale - experimental
128 CONTACTPOINT = 1, // sometimes faster at low scale
129 INTERSECTION = 2 // default
130 };
131
136
138 itkGetConstReferenceMacro(ParabolicAlgorithm, int);
139
142 void
143 Modified() const override;
144
145protected:
146 void
147 GenerateData() override;
148
149 void
150 PrintSelf(std::ostream & os, Indent indent) const override;
151
156
166
169
170private:
175
179};
180} // end namespace itk
181#ifndef ITK_MANUAL_INSTANTIATION
182# include "itkParabolicOpenCloseSafeBorderImageFilter.hxx"
183#endif
184
185#endif
Increase the image size by padding with a constant value.
Decrease the image size by cropping the image by an itk::Size at both the upper and lower bounds of t...
Simulate a standard C array with copy semantics.
Control indentation during Print() invocation.
Definition itkIndent.h:53
Parent class for morphological opening and closing operations with parabolic structuring elements.
typename itk::FixedArray< ScalarRealType, TInputImage::ImageDimension > RadiusType
void PrintSelf(std::ostream &os, Indent indent) const override
~ParabolicOpenCloseSafeBorderImageFilter() override=default
Implements transparent reference counting.
Compute min, max, variance and mean of an Image.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
#define itkSetMacro(name, type)