ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkImageToVectorImageFilter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkImageToVectorImageFilter_h
00019 #define __itkImageToVectorImageFilter_h
00020 
00021 #include "itkImageToImageFilter.h"
00022 #include "itkVectorContainer.h"
00023 #include "itkVectorImage.h"
00024 
00025 namespace itk
00026 {
00051 template< class TInputImage >
00052 class ITK_EXPORT ImageToVectorImageFilter:
00053   public ImageToImageFilter< TInputImage,
00054                              VectorImage< typename TInputImage::InternalPixelType,
00055                                           ::itk::GetImageDimension< TInputImage >::ImageDimension > >
00056 {
00057 public:
00058 
00059   typedef ImageToVectorImageFilter   Self;
00060   typedef SmartPointer< Self >       Pointer;
00061   typedef SmartPointer< const Self > ConstPointer;
00062   itkNewMacro(Self);
00063   itkTypeMacro(ImageToVectorImageFilter, ImageToImageFilter);
00064 
00065   itkStaticConstMacro(Dimension, unsigned int, TInputImage::ImageDimension);
00066 
00067   typedef typename TInputImage::InternalPixelType PixelType;
00068   typedef VectorImage< PixelType,
00069                        itkGetStaticConstMacro(Dimension) >   OutputImageType;
00070   typedef ImageToImageFilter< TInputImage,
00071                               OutputImageType >     Superclass;
00072 
00073   typedef typename Superclass::InputImageType InputImageType;
00074 
00075   typedef typename Superclass::InputImageRegionType RegionType;
00076 
00077   virtual void SetNthInput(unsigned int idx, const InputImageType *inputImage)
00078   { this->SetInput(idx, inputImage); }
00079 
00080 #ifdef ITK_USE_CONCEPT_CHECKING
00081 
00082   // Check if the pixeltype is a scalar, (native pixel type).
00083 
00085 #endif
00086 protected:
00087   ImageToVectorImageFilter();
00088 
00089   virtual void GenerateOutputInformation(void);
00090 
00091   virtual void BeforeThreadedGenerateData();
00092 
00093   virtual void ThreadedGenerateData(const RegionType & outputRegionForThread, ThreadIdType);
00094 
00095   virtual void SetNthInput(unsigned int num, DataObject *input)
00096   {
00097     Superclass::SetNthInput(num, input);
00098   }
00099 
00100 private:
00101   ImageToVectorImageFilter(const Self &); //purposely not implemented
00102   void operator=(const Self &);           //purposely not implemented
00103 };
00104 }
00105 
00106 #ifndef ITK_MANUAL_INSTANTIATION
00107 #include "itkImageToVectorImageFilter.hxx"
00108 #endif
00109 
00110 #endif
00111