ITK  4.3.0
Insight Segmentation and Registration Toolkit
itkImageToVectorImageFilter.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 __itkImageToVectorImageFilter_h
19 #define __itkImageToVectorImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 #include "itkVectorContainer.h"
23 #include "itkVectorImage.h"
24 
25 #ifndef ITKV3_COMPATIBILITY
26 #error "This file is only valid when ITKV3_COMPATIBILITY is turned on. Users are encouraged to convert to itkDisplacementFieldJacobianDeterminantFilter.h in ITKv4"
27 #endif
28 
29 namespace itk
30 {
57 template< class TInputImage >
58 class ITK_EXPORT ImageToVectorImageFilter:
59  public ImageToImageFilter< TInputImage,
60  VectorImage< typename TInputImage::InternalPixelType,
61  TInputImage::ImageDimension > >
62 {
63 public:
64 
68  itkNewMacro(Self);
70 
71  itkStaticConstMacro(Dimension, unsigned int, TInputImage::ImageDimension);
72 
73  typedef typename TInputImage::InternalPixelType PixelType;
74  typedef VectorImage< PixelType,
75  itkGetStaticConstMacro(Dimension) > OutputImageType;
76  typedef ImageToImageFilter< TInputImage,
78 
79  typedef typename Superclass::InputImageType InputImageType;
80 
81  typedef typename Superclass::InputImageRegionType RegionType;
82 
83  virtual void SetNthInput(unsigned int idx, const InputImageType *inputImage)
84  { this->SetInput(idx, inputImage); }
85 
86 #ifdef ITK_USE_CONCEPT_CHECKING
87 
88  // Check if the pixeltype is a scalar, (native pixel type).
89 
91 #endif
92 
93 protected:
95 
96  virtual void GenerateOutputInformation(void);
97 
98  virtual void BeforeThreadedGenerateData();
99 
100  virtual void ThreadedGenerateData(const RegionType & outputRegionForThread, ThreadIdType);
101 
102  virtual void SetNthInput(unsigned int num, DataObject *input)
103  {
104  Superclass::SetNthInput(num, input);
105  }
106 
107 private:
108  ImageToVectorImageFilter(const Self &); //purposely not implemented
109  void operator=(const Self &); //purposely not implemented
110 };
111 }
112 
113 #ifndef ITK_MANUAL_INSTANTIATION
114 #include "itkImageToVectorImageFilter.hxx"
115 #endif
116 
117 #endif
118