ITK  4.13.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< typename TInput, typename 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< typename TInputImage, typename TOutputImage >
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  // Begin concept checking
97  itkConceptMacro( InputHasNumericTraitsCheck,
99  // End concept checking
100 #endif
101 
102 protected:
104  virtual ~VectorMagnitudeImageFilter() ITK_OVERRIDE {}
105 
106 private:
107  ITK_DISALLOW_COPY_AND_ASSIGN(VectorMagnitudeImageFilter);
108 };
109 } // end namespace itk
110 
111 #endif
TOutput operator()(const TInput &A) const
Take an image of vectors as input and produce an image with the magnitude of those vectors...
Base class for all process objects that output image data.
bool operator!=(const VectorMagnitude &) const
UnaryFunctorImageFilter< TInputImage, TOutputImage, Functor::VectorMagnitude< typename TInputImage::PixelType, typename TOutputImage::PixelType > > Superclass
Implements pixel-wise generic operation on one image.
#define itkConceptMacro(name, concept)
bool operator==(const VectorMagnitude &other) const