ITK  4.2.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 protected:
113  {
114  m_UseImageSpacing = true;
115  }
116 
118 
130  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
131  ThreadIdType threadId);
132 
133  void PrintSelf(std::ostream &, Indent) const;
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
147