ITK  4.8.0
Insight Segmentation and Registration Toolkit
itkCompose3DCovariantVectorImageFilter.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 itkCompose3DCovariantVectorImageFilter_h
19 #define itkCompose3DCovariantVectorImageFilter_h
20 #if !defined( ITK_LEGACY_REMOVE )
21 
23 #include "itkCovariantVector.h"
24 
25 namespace itk
26 {
27 namespace Functor
28 {
29 template< typename TInput >
30 class Compose3DCovariantVector
31 {
32 public:
33  typedef CovariantVector< TInput, 3 > OutputType;
34  Compose3DCovariantVector() {}
35  ~Compose3DCovariantVector() {}
36  bool operator!=(const Compose3DCovariantVector &) const
37  {
38  return false;
39  }
40 
41  bool operator==(const Compose3DCovariantVector & other) const
42  {
43  return !( *this != other );
44  }
45 
46  inline OutputType operator()(const TInput & s1,
47  const TInput & s2,
48  const TInput & s3) const
49  {
50  OutputType v;
51 
52  v[0] = s1;
53  v[1] = s2;
54  v[2] = s3;
55  return v;
56  }
57 };
58 }
59 
77 template< typename TInputImage,
78  typename TOutputImage =
79  Image< CovariantVector< typename TInputImage::PixelType, 3 >,
80  TInputImage::ImageDimension > >
81 class Compose3DCovariantVectorImageFilter:
82  public
83  TernaryFunctorImageFilter< TInputImage, TInputImage,
84  TInputImage, TOutputImage,
85  Functor::Compose3DCovariantVector< typename TInputImage::PixelType > >
86 {
87 public:
89  typedef Compose3DCovariantVectorImageFilter Self;
90  typedef TernaryFunctorImageFilter<
91  TInputImage, TInputImage, TInputImage,
92  TOutputImage,
93  Functor::Compose3DCovariantVector<
94  typename TInputImage::PixelType > > Superclass;
95 
96  typedef SmartPointer< Self > Pointer;
97  typedef SmartPointer< const Self > ConstPointer;
98 
99  typedef typename Superclass::OutputImageType OutputImageType;
100 
102  itkNewMacro(Self);
103 
105  itkTypeMacro(Compose3DCovariantVectorImageFilter,
106  TernaryFunctorImageFilter);
107 
108 #ifdef ITK_USE_CONCEPT_CHECKING
109  // Begin concept checking
110  itkConceptMacro( InputHasNumericTraitsCheck,
111  ( Concept::HasNumericTraits< typename TInputImage::PixelType > ) );
112  // End concept checking
113 #endif
114 
115 protected:
116  Compose3DCovariantVectorImageFilter() {}
117  virtual ~Compose3DCovariantVectorImageFilter() {}
118 
119 private:
120  Compose3DCovariantVectorImageFilter(const Self &); //purposely not implemented
121  void operator=(const Self &); //purposely not implemented
122 };
123 } // end namespace itk
124 
125 #endif //#if !defined( ITK_LEGACY_REMOVE )
126 #endif
bool operator!=(const ImageRegionCopier< D1, D2 > &c1, const ImageRegionCopier< D1, D2 > &c2)
#define itkConceptMacro(name, concept)