DMRITool  v0.1.1-139-g860d86b4
Diffusion MRI Tool
itkVTKImageDataToImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: VTK Image Data to Image Converter
4 
5  Copyright (c) Pew-Thian Yap. All rights reserved.
6  See http://www.unc.edu/~ptyap/ for details.
7 
8  This software is distributed WITHOUT ANY WARRANTY; without even
9  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10  PURPOSE. See the above copyright notices for more information.
11 
12  =========================================================================*/
13 
14 #ifndef __itkVTKImageDataToImageFilter_h
15 #define __itkVTKImageDataToImageFilter_h
16 
17 #include "itkImageSource.h"
18 #include "itkImageRegionIterator.h"
19 
20 #include "vtkSmartPointer.h"
21 #include "vtkImageData.h"
22 
23 namespace itk
24 {
25 
29 template <class TOutputImage>
30 class ITK_EXPORT VTKImageDataToImageFilter :
31  public ImageSource<TOutputImage>
32 {
33 public:
36  typedef ImageSource<TOutputImage> Superclass;
37  typedef SmartPointer<Self> Pointer;
38  typedef SmartPointer<const Self> ConstPointer;
39 
41  itkNewMacro(Self);
42 
44  itkTypeMacro(VTKImageDataToImageFilter, ImageSource);
45 
47  itkStaticConstMacro(Dimension, unsigned int, TOutputImage::ImageDimension);
48 
50  typedef TOutputImage OutputImageType;
51  typedef typename OutputImageType::Pointer OutputImagePointer;
52  typedef typename OutputImageType::RegionType OutputRegionType;
53  typedef typename OutputImageType::SizeType OutputSizeType;
54  typedef typename OutputImageType::SpacingType OutputSpacingType;
55  typedef typename OutputImageType::PointType OutputPointType;
56  typedef typename OutputImageType::IndexType OutputIndexType;
57  typedef typename OutputImageType::PixelType OutputPixelType;
58  typedef ImageRegionIterator<OutputImageType> OutputImageIteratorType;
59  typedef vtkSmartPointer<vtkImageData> InputImageType;
60 
62  void SetInputData( vtkImageData * );
63 
64 protected:
67 
68  virtual void GenerateData() ITK_OVERRIDE;
69 
70 private:
71  VTKImageDataToImageFilter(const Self&); //purposely not implemented
72  void operator=(const Self&); //purposely not implemented
73 
74  InputImageType m_Image;
75 
76 };
77 
78 } // end namespace itk
79 
80 #ifndef ITK_MANUAL_INSTANTIATION
82 #endif
83 
84 #endif
ImageRegionIterator< OutputImageType > OutputImageIteratorType
OutputImageType::RegionType OutputRegionType
OutputImageType::SpacingType OutputSpacingType
Convert VTK image data to an ITK image.
#define ITK_OVERRIDE
Definition: utlITKMacro.h:46
OutputImageType::PixelType OutputPixelType
vtkSmartPointer< vtkImageData > InputImageType
ImageSource< TOutputImage > Superclass
OutputImageType::IndexType OutputIndexType
OutputImageType::PointType OutputPointType