ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkBinaryOpenParaImageFilter.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 itkBinaryOpenParaImageFilter_h
19 #define itkBinaryOpenParaImageFilter_h
20 
25 
26 namespace itk
27 {
68 template< typename TInputImage,
69  typename TOutputImage = TInputImage >
70 class ITK_EXPORT BinaryOpenParaImageFilter:
71  public ImageToImageFilter< TInputImage, TOutputImage >
72 
73 {
74 public:
75  ITK_DISALLOW_COPY_AND_ASSIGN(BinaryOpenParaImageFilter);
76 
82 
84  itkNewMacro(Self);
85 
88 
90  using InputImageType = TInputImage;
91  using OutputImageType = TOutputImage;
92  using PixelType = typename TInputImage::PixelType;
95  using OutputPixelType = typename TOutputImage::PixelType;
96 
98  using InputImagePointer = typename TInputImage::Pointer;
99  using InputImageConstPointer = typename TInputImage::ConstPointer;
100 
102  // perhaps a bit dodgy, change to int if you want to do enormous
103  // binary operations
104  using InternalIntType = short;
105 
107  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
108 
110 
111  void SetRadius(ScalarRealType radius);
112 
113  itkSetMacro(Radius, RadiusType);
114  itkGetConstReferenceMacro(Radius, RadiusType);
115 
116  void SetUseImageSpacing(bool g)
117  {
118  m_RectErode->SetUseImageSpacing(g);
119  m_RectDilate->SetUseImageSpacing(g);
120  m_CircErode->SetUseImageSpacing(g);
121  m_CircDilate->SetUseImageSpacing(g);
122  }
123 
128  itkSetMacro(Circular, bool);
129  itkGetConstReferenceMacro(Circular, bool);
130  itkBooleanMacro(Circular);
132 
135  itkSetMacro(SafeBorder, bool);
136  itkGetConstReferenceMacro(SafeBorder, bool);
137  itkBooleanMacro(SafeBorder);
139 
142  /* add in the traits here */
143 protected:
144  void GenerateData(void) override;
145 
148  void PrintSelf(std::ostream & os, Indent indent) const override;
149 
156 
159 
162 private:
166 
167  typename CircErodeType::Pointer m_CircErode;
168  typename CircDilateType::Pointer m_CircDilate;
169 
170  typename CCastTypeA::Pointer m_CircCastA;
171  typename CCastTypeB::Pointer m_CircCastB;
172 
173  typename RectErodeType::Pointer m_RectErode;
174  typename RectDilateType::Pointer m_RectDilate;
175 
176  typename RCastTypeA::Pointer m_RectCastA;
177  typename RCastTypeB::Pointer m_RectCastB;
178 };
179 } // end namespace itk
180 
181 #ifndef ITK_MANUAL_INSTANTIATION
182 #include "itkBinaryOpenParaImageFilter.hxx"
183 #endif
184 
185 #endif //__itkBinaryOpenParaImageFilter_h
typename itk::FixedArray< ScalarRealType, TInputImage::ImageDimension > RadiusType
Class for binary morphological opening operation.
typename NumericTraits< PixelType >::RealType RealType
typename itk::ParabolicDilateImageFilter< OutputImageType, InternalRealImageType > RectDilateType
Define numeric traits for std::vector.
typename itk::BinaryThresholdImageFilter< InternalRealImageType, OutputImageType > RCastTypeB
typename itk::ParabolicErodeImageFilter< TInputImage, InternalIntImageType > RectErodeType
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 itk::GreaterEqualValImageFilter< InternalIntImageType, OutputImageType > RCastTypeA
typename itk::GreaterEqualValImageFilter< InternalRealImageType, OutputImageType > CCastTypeA
typename NumericTraits< PixelType >::ScalarRealType ScalarRealType
Binarize an input image by thresholding.
typename itk::Image< InternalRealType, InputImageType::ImageDimension > InternalRealImageType
typename InputImageType::Pointer InputImagePointer
Computes the absolute difference between an image and a constant. Can be done with ShiftScale and Abs...
Class for morphological dilation operations with parabolic structuring elements.
typename TOutputImage::PixelType OutputPixelType
TOutputImage OutputImageType
typename NumericTraits< PixelType >::FloatType InternalRealType
typename itk::ParabolicDilateImageFilter< OutputImageType, InternalRealImageType > CircDilateType
Base class for filters that take an image as input and produce an image as output.
typename itk::ParabolicErodeImageFilter< TInputImage, InternalRealImageType > CircErodeType
typename TInputImage::PixelType PixelType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename itk::Image< InternalIntType, InputImageType::ImageDimension > InternalIntImageType
typename itk::BinaryThresholdImageFilter< InternalRealImageType, OutputImageType > CCastTypeB
typename InputImageType::ConstPointer InputImageConstPointer
Templated n-dimensional image class.
Definition: itkImage.h:75