ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkMorphologicalSharpeningImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 itkMorphologicalSharpeningImageFilter_h
19 #define itkMorphologicalSharpeningImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 //#include "itkProgressReporter.h"
23 #include "itkCastImageFilter.h"
27 
28 namespace itk
29 {
66 template< typename TInputImage, typename TOutputImage = TInputImage >
68  public ImageToImageFilter< TInputImage,
69  TOutputImage >
70 {
71 public:
72  ITK_DISALLOW_COPY_AND_ASSIGN(MorphologicalSharpeningImageFilter);
73 
79 
81  itkNewMacro(Self);
82 
85 
87  using InputImageType = TInputImage;
88  using OutputImageType = TOutputImage;
89  using InputPixelType = typename TInputImage::PixelType;
92  using OutputPixelType = typename TOutputImage::PixelType;
93 
95  using InputImagePointer = typename TInputImage::Pointer;
96  using InputImageConstPointer = typename TInputImage::ConstPointer;
97 
99  static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
100  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
101  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
102 
105 
106  itkSetMacro(Iterations, int);
107  itkGetConstReferenceMacro(Iterations, int);
108 
110  {
111  m_Erode->SetScale(scale);
112  m_Dilate->SetScale(scale);
113  }
114 
115  void SetScale(RadiusType scale)
116  {
117  m_Erode->SetScale(scale);
118  m_Dilate->SetScale(scale);
119  }
120 
121  void SetUseImageSpacing(bool uis)
122  {
123  m_Erode->SetUseImageSpacing(uis);
124  m_Dilate->SetUseImageSpacing(uis);
125  }
126 
127  // need to include the Get methods
129  {
130  return m_Erode->GetScale();
131  }
132 
133  const bool & GetUseImageSpacing()
134  {
135  return m_Erode->GetUseImageSpacing();
136  }
137 
138 #ifdef ITK_USE_CONCEPT_CHECKING
139 
140  itkConceptMacro( SameDimension,
141  ( Concept::SameDimension< itkGetStaticConstMacro(InputImageDimension),
142  itkGetStaticConstMacro(OutputImageDimension) > ) );
143 
144  itkConceptMacro( Comparable,
146 
148 #endif
149 protected:
152  void PrintSelf(std::ostream & os, Indent indent) const override;
154 
156  void GenerateData(void) override;
157 
158  // do everything in the output image type, which should have high precision
162 
165 private:
167 
168  typename ErodeType::Pointer m_Erode;
169  typename DilateType::Pointer m_Dilate;
170  typename CastType::Pointer m_Cast;
171  typename SharpenOpType::Pointer m_SharpenOp;
172 };
173 } // namespace itk
174 #ifndef ITK_MANUAL_INSTANTIATION
175 #include "itkMorphologicalSharpeningImageFilter.hxx"
176 #endif
177 
178 #endif
Implements the sharpening operation. The inputs are the dilated, eroded and original images...
typename itk::FixedArray< ScalarRealType, TInputImage::ImageDimension > RadiusType
Image sharpening using methods based on parabolic structuring elements.
typename NumericTraits< InputPixelType >::ScalarRealType ScalarRealType
Define numeric traits for std::vector.
typename itk::SharpenOpImageFilter< OutputImageType, OutputImageType, OutputImageType, OutputImageType > SharpenOpType
typename itk::CastImageFilter< InputImageType, OutputImageType > CastType
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Class for morphological erosion operations with parabolic structuring elements.
Base class for all process objects that output image data.
typename InputImageType::Pointer InputImagePointer
Class for morphological dilation operations with parabolic structuring elements.
TOutputImage OutputImageType
typename NumericTraits< InputPixelType >::RealType RealType
typename itk::ParabolicDilateImageFilter< OutputImageType, OutputImageType > DilateType
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
#define itkConceptMacro(name, concept)
typename InputImageType::ConstPointer InputImageConstPointer
typename itk::ParabolicErodeImageFilter< OutputImageType, OutputImageType > ErodeType
Casts input pixels to output pixel type.