ITK  4.3.0
Insight Segmentation and Registration Toolkit
itkVectorMagnitudeImageFilter.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 __itkVectorMagnitudeImageFilter_h
19 #define __itkVectorMagnitudeImageFilter_h
20 
22 
23 namespace itk
24 {
44 namespace Functor
45 {
46 template< class TInput, class TOutput >
48 {
49 public:
52 
53  bool operator!=(const VectorMagnitude &) const
54  {
55  return false;
56  }
57 
58  bool operator==(const VectorMagnitude & other) const
59  {
60  return !( *this != other );
61  }
62 
63  inline TOutput operator()(const TInput & A) const
64  {
65  return static_cast< TOutput >( A.GetNorm() );
66  }
67 };
68 }
69 
70 template< class TInputImage, class TOutputImage >
71 class ITK_EXPORT VectorMagnitudeImageFilter:
72  public
73  UnaryFunctorImageFilter< TInputImage, TOutputImage,
74  Functor::VectorMagnitude< typename TInputImage::PixelType,
75  typename TOutputImage::PixelType > >
76 {
77 public:
81  TInputImage, TOutputImage,
82  Functor::VectorMagnitude< typename TInputImage::PixelType,
83  typename TOutputImage::PixelType > > Superclass;
84 
87 
89  itkNewMacro(Self);
90 
92  itkTypeMacro(VectorMagnitudeImageFilter,
94 
95 #ifdef ITK_USE_CONCEPT_CHECKING
96 
97  itkConceptMacro( InputHasNumericTraitsCheck,
99 
101 #endif
102 
103 protected:
106 
107 private:
108  VectorMagnitudeImageFilter(const Self &); //purposely not implemented
109  void operator=(const Self &); //purposely not implemented
110 };
111 } // end namespace itk
112 
113 #endif
114