ITK  4.4.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 
75  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
76 
85  virtual void GenerateInputRequestedRegion()
87 
90  void SetUseImageSpacingOn()
91  { this->SetUseImageSpacing(true); }
92 
95  void SetUseImageSpacingOff()
96  { this->SetUseImageSpacing(false); }
97 
100  itkSetMacro(UseImageSpacing, bool);
101  itkGetConstMacro(UseImageSpacing, bool);
103 
104 #ifdef ITK_USE_CONCEPT_CHECKING
105 
106  itkConceptMacro( InputHasNumericTraitsCheck,
108 
110 #endif
111 
112 protected:
114  {
115  m_UseImageSpacing = true;
116  }
117 
119 
131  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
132  ThreadIdType threadId);
133 
134  void PrintSelf(std::ostream &, Indent) const;
135 
136 private:
137  GradientMagnitudeImageFilter(const Self &); //purposely not implemented
138  void operator=(const Self &); //purposely not implemented
139 
141 };
142 } // end namespace itk
143 
144 #ifndef ITK_MANUAL_INSTANTIATION
145 #include "itkGradientMagnitudeImageFilter.hxx"
146 #endif
147 
148 #endif
149