ITK  4.6.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 >
42  public ImageToImageFilter< TInputImage, TOutputImage >
43 {
44 public:
50 
52  itkNewMacro(Self);
53 
56 
59  typedef typename TOutputImage::PixelType OutputPixelType;
60  typedef typename TInputImage::PixelType InputPixelType;
62 
65  itkStaticConstMacro(ImageDimension, unsigned int,
66  TOutputImage::ImageDimension);
67 
69  typedef TInputImage InputImageType;
70  typedef TOutputImage OutputImageType;
71  typedef typename InputImageType::Pointer InputImagePointer;
72  typedef typename OutputImageType::Pointer OutputImagePointer;
73 
76 
85  virtual void GenerateInputRequestedRegion();
86 
90  { this->SetUseImageSpacing(true); }
91 
95  { this->SetUseImageSpacing(false); }
96 
99  itkSetMacro(UseImageSpacing, bool);
100  itkGetConstMacro(UseImageSpacing, bool);
102 
103 #ifdef ITK_USE_CONCEPT_CHECKING
104  // Begin concept checking
105  itkConceptMacro( InputHasNumericTraitsCheck,
107  // End concept checking
108 #endif
109 
110 protected:
112  {
113  m_UseImageSpacing = true;
114  }
115 
117 
129  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
130  ThreadIdType threadId);
131 
132  void PrintSelf(std::ostream &, Indent) const;
133 
134 private:
135  GradientMagnitudeImageFilter(const Self &); //purposely not implemented
136  void operator=(const Self &); //purposely not implemented
137 
139 };
140 } // end namespace itk
141 
142 #ifndef ITK_MANUAL_INSTANTIATION
143 #include "itkGradientMagnitudeImageFilter.hxx"
144 #endif
145 
146 #endif
virtual void GenerateInputRequestedRegion()
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId)
NumericTraits< InputPixelType >::RealType RealType
void PrintSelf(std::ostream &, Indent) const
Base class for all process objects that output image data.
ImageToImageFilter< TInputImage, TOutputImage > Superclass
Computes the gradient magnitude of an image region at each pixel.
Superclass::OutputImageRegionType OutputImageRegionType
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
Superclass::OutputImageRegionType OutputImageRegionType
Define additional traits for native types such as int or float.
#define itkConceptMacro(name, concept)
virtual void SetUseImageSpacing(bool _arg)
unsigned int ThreadIdType
Definition: itkIntTypes.h:159