ITK  4.8.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:
77 
79  itkNewMacro(Self);
80 
83 
85  typedef TInputImage InputImageType;
86  typedef TOutputImage OutputImageType;
87  typedef typename TInputImage::PixelType InputPixelType;
90  typedef typename TOutputImage::PixelType OutputPixelType;
91 
93  typedef typename TInputImage::Pointer InputImagePointer;
94  typedef typename TInputImage::ConstPointer InputImageConstPointer;
95 
97  itkStaticConstMacro(OutputImageDimension, unsigned int,
98  TOutputImage::ImageDimension);
99  itkStaticConstMacro(InputImageDimension, unsigned int,
100  TInputImage::ImageDimension);
101  itkStaticConstMacro(ImageDimension, unsigned int,
102  TInputImage::ImageDimension);
104 
107 
108  itkSetMacro(Iterations, int);
109  itkGetConstReferenceMacro(Iterations, int);
110 
112  {
113  m_Erode->SetScale(scale);
114  m_Dilate->SetScale(scale);
115  }
116 
117  void SetScale(RadiusType scale)
118  {
119  m_Erode->SetScale(scale);
120  m_Dilate->SetScale(scale);
121  }
122 
123  void SetUseImageSpacing(bool uis)
124  {
125  m_Erode->SetUseImageSpacing(uis);
126  m_Dilate->SetUseImageSpacing(uis);
127  }
128 
129  // need to include the Get methods
131  {
132  return m_Erode->GetScale();
133  }
134 
135  const bool & GetUseImageSpacing()
136  {
137  return m_Erode->GetUseImageSpacing();
138  }
139 
140 #ifdef ITK_USE_CONCEPT_CHECKING
141 
142  itkConceptMacro( SameDimension,
143  ( Concept::SameDimension< itkGetStaticConstMacro(InputImageDimension),
144  itkGetStaticConstMacro(OutputImageDimension) > ) );
145 
146  itkConceptMacro( Comparable,
148 
150 #endif
151 protected:
154  void PrintSelf(std::ostream & os, Indent indent) const;
156 
158  void GenerateData(void);
159 
160  // do everything in the output image type, which should have high precision
164 
167 private:
168  MorphologicalSharpeningImageFilter(const Self &); //purposely not implemented
169  void operator=(const Self &); //purposely not implemented
170 
172 
177 };
178 } // namespace itk
179 #ifndef ITK_MANUAL_INSTANTIATION
180 #include "itkMorphologicalSharpeningImageFilter.hxx"
181 #endif
182 
183 #endif
itk::FixedArray< ScalarRealType, TInputImage::ImageDimension > RadiusType
Implements the sharpening operation. The inputs are the dilated, eroded and original images...
ImageToImageFilter< TInputImage, TOutputImage > Superclass
Image sharpening using methods based on parabolic structuring elements.
itk::ParabolicDilateImageFilter< OutputImageType, OutputImageType > DilateType
Class for morphological erosion operations with parabolic structuring elements.
Base class for all process objects that output image data.
NumericTraits< InputPixelType >::ScalarRealType ScalarRealType
itk::CastImageFilter< InputImageType, OutputImageType > CastType
Class for morphological dilation operations with parabolic structuring elements.
itk::SharpenOpImageFilter< OutputImageType, OutputImageType, OutputImageType, OutputImageType > SharpenOpType
itk::ParabolicErodeImageFilter< OutputImageType, OutputImageType > ErodeType
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 additional traits for native types such as int or float.
TOutputImage OutputImageType
#define itkConceptMacro(name, concept)
Casts input pixels to output pixel type.
NumericTraits< InputPixelType >::RealType RealType