ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkGradientMagnitudeImageFilter.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 itkGradientMagnitudeImageFilter_h
19 #define itkGradientMagnitudeImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 
23 namespace itk
24 {
40 template< typename TInputImage, typename TOutputImage >
41 class ITK_TEMPLATE_EXPORT GradientMagnitudeImageFilter:
42  public ImageToImageFilter< TInputImage, TOutputImage >
43 {
44 public:
45  ITK_DISALLOW_COPY_AND_ASSIGN(GradientMagnitudeImageFilter);
46 
52 
54  itkNewMacro(Self);
55 
58 
61  using OutputPixelType = typename TOutputImage::PixelType;
62  using InputPixelType = typename TInputImage::PixelType;
64 
67  static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
68 
70  using InputImageType = TInputImage;
71  using OutputImageType = TOutputImage;
72  using InputImagePointer = typename InputImageType::Pointer;
73  using OutputImagePointer = typename OutputImageType::Pointer;
74 
76  using OutputImageRegionType = typename Superclass::OutputImageRegionType;
77 
86  void GenerateInputRequestedRegion() override;
87 
91  { this->SetUseImageSpacing(true); }
92 
96  { this->SetUseImageSpacing(false); }
97 
100  itkSetMacro(UseImageSpacing, bool);
101  itkGetConstMacro(UseImageSpacing, bool);
103 
104 #ifdef ITK_USE_CONCEPT_CHECKING
105  // Begin concept checking
106  itkConceptMacro( InputHasNumericTraitsCheck,
108  // End concept checking
109 #endif
110 
111 protected:
113  {
114  m_UseImageSpacing = true;
115  this->DynamicMultiThreadingOn();
116  }
117 
118  ~GradientMagnitudeImageFilter() override = default;
119 
131  void DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
132 
133 
134  void PrintSelf(std::ostream &, Indent) const override;
135 
136 private:
138 };
139 } // end namespace itk
140 
141 #ifndef ITK_MANUAL_INSTANTIATION
142 #include "itkGradientMagnitudeImageFilter.hxx"
143 #endif
144 
145 #endif
typename OutputImageType::Pointer OutputImagePointer
typename NumericTraits< InputPixelType >::RealType RealType
Define numeric traits for std::vector.
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Base class for all process objects that output image data.
typename TOutputImage::PixelType OutputPixelType
typename InputImageType::Pointer InputImagePointer
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
Computes the gradient magnitude of an image region at each pixel.
typename TInputImage::PixelType InputPixelType
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)