ITK  4.8.0
Insight Segmentation and Registration Toolkit
itkCompose2DCovariantVectorImageFilter.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 itkCompose2DCovariantVectorImageFilter_h
19 #define itkCompose2DCovariantVectorImageFilter_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 Compose2DCovariantVector
31 {
32 public:
33  typedef CovariantVector< TInput, 2 > OutputType;
34  Compose2DCovariantVector() {}
35  ~Compose2DCovariantVector() {}
36  bool operator!=(const Compose2DCovariantVector &) const
37  {
38  return false;
39  }
40 
41  bool operator==(const Compose2DCovariantVector & other) const
42  {
43  return !( *this != other );
44  }
45 
46  inline OutputType operator()(const TInput & s1,
47  const TInput & s2) const
48  {
49  OutputType v;
50 
51  v[0] = s1;
52  v[1] = s2;
53  return v;
54  }
55 };
56 }
57 
70 template< typename TInputImage,
71  typename TOutputImage =
72  Image< CovariantVector< typename TInputImage::PixelType, 2 >,
73  TInputImage::ImageDimension > >
74 class Compose2DCovariantVectorImageFilter:
75  public
76  BinaryFunctorImageFilter< TInputImage, TInputImage,
77  TOutputImage,
78  Functor::Compose2DCovariantVector< typename TInputImage::PixelType > >
79 {
80 public:
82  typedef Compose2DCovariantVectorImageFilter Self;
83  typedef BinaryFunctorImageFilter<
84  TInputImage, TInputImage,
85  TOutputImage,
86  Functor::Compose2DCovariantVector< typename TInputImage::PixelType > > Superclass;
87 
88  typedef SmartPointer< Self > Pointer;
89  typedef SmartPointer< const Self > ConstPointer;
90 
91  typedef typename Superclass::OutputImageType OutputImageType;
92 
94  itkNewMacro(Self);
95 
97  itkTypeMacro(Compose2DCovariantVectorImageFilter,
98  BinaryFunctorImageFilter);
99 
100 #ifdef ITK_USE_CONCEPT_CHECKING
101  // Begin concept checking
102  itkConceptMacro( InputHasNumericTraitsCheck,
103  ( Concept::HasNumericTraits< typename TInputImage::PixelType > ) );
104  // End concept checking
105 #endif
106 
107 protected:
108  Compose2DCovariantVectorImageFilter() {}
109  virtual ~Compose2DCovariantVectorImageFilter() {}
110 
111 private:
112  Compose2DCovariantVectorImageFilter(const Self &); //purposely not implemented
113  void operator=(const Self &); //purposely not implemented
114 };
115 } // end namespace itk
116 
117 #endif //#if !defined( ITK_LEGACY_REMOVE )
118 #endif
bool operator!=(const ImageRegionCopier< D1, D2 > &c1, const ImageRegionCopier< D1, D2 > &c2)
#define itkConceptMacro(name, concept)