Slicer 4.2
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkITKImageToImageFilter2DFF.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Copyright Brigham and Women's Hospital (BWH) All Rights Reserved.
00004 
00005   See COPYRIGHT.txt
00006   or http://www.slicer.org/copyright/copyright.txt for details.
00007 
00008   Program:   vtkITK
00009   Module:    $HeadURL: http://svn.slicer.org/Slicer4/trunk/Libs/vtkITK/vtkITKImageToImageFilter2DFF.h $
00010   Date:      $Date: 2012-09-18 20:49:07 -0400 (Tue, 18 Sep 2012) $
00011   Version:   $Revision: 21009 $
00012 
00013 ==========================================================================*/
00014 
00015 #ifndef __vtkITKImageToImageFilter2DFF_h
00016 #define __vtkITKImageToImageFilter2DFF_h
00017 
00018 #include "vtkITKImageToImageFilter.h"
00019 #include "vtkImageToImageFilter.h"
00020 #include "itkImageToImageFilter.h"
00021 #include "itkVTKImageExport.h"
00022 #include "itkVTKImageImport.h"
00023 #include "vtkITKUtility.h"
00024 
00025 class VTK_ITK_EXPORT vtkITKImageToImageFilter2DFF : public vtkITKImageToImageFilter
00026 {
00027 public:
00028   vtkTypeMacro(vtkITKImageToImageFilter2DFF,vtkITKImageToImageFilter);
00029   static vtkITKImageToImageFilter2DFF* New() { return 0; };
00030   void PrintSelf(ostream& os, vtkIndent indent)
00031   {
00032     Superclass::PrintSelf ( os, indent );
00033     os << m_Filter;
00034   };
00035 
00036 protected:
00037   
00039   typedef float InputImagePixelType;
00040   typedef float OutputImagePixelType;
00041   typedef itk::Image<InputImagePixelType, 2> InputImageType;
00042   typedef itk::Image<OutputImagePixelType, 2> OutputImageType;
00043 
00044   typedef itk::VTKImageImport<InputImageType> ImageImportType;
00045   typedef itk::VTKImageExport<OutputImageType> ImageExportType;
00046   ImageImportType::Pointer itkImporter;
00047   ImageExportType::Pointer itkExporter;
00048 
00049   typedef itk::ImageToImageFilter<InputImageType,OutputImageType> GenericFilterType;
00050   GenericFilterType::Pointer m_Filter;
00051 
00052   vtkITKImageToImageFilter2DFF ( GenericFilterType* filter )
00053   {
00055     m_Filter = filter;
00056     this->itkImporter = ImageImportType::New();
00057     this->itkExporter = ImageExportType::New();
00058     ConnectPipelines(this->vtkExporter, this->itkImporter);
00059     ConnectPipelines(this->itkExporter, this->vtkImporter);
00060     this->LinkITKProgressToVTKProgress ( m_Filter );
00061     
00063     m_Filter->SetInput ( this->itkImporter->GetOutput() );
00064     this->itkExporter->SetInput ( m_Filter->GetOutput() );
00065     this->vtkCast->SetOutputScalarTypeToFloat ();
00066   };
00067 
00068   ~vtkITKImageToImageFilter2DFF()
00069   {
00070   };
00071   
00072 private:
00073   vtkITKImageToImageFilter2DFF(const vtkITKImageToImageFilter2DFF&);  
00074   void operator=(const vtkITKImageToImageFilter2DFF&);  
00075 };
00076 
00077 #endif
00078 
00079 
00080 
00081 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines