|
Slicer 4.2
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
|
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/vtkITKImageToImageFilterFUL.h $ 00010 Date: $Date: 2012-09-18 20:49:07 -0400 (Tue, 18 Sep 2012) $ 00011 Version: $Revision: 21009 $ 00012 00013 ==========================================================================*/ 00014 00015 #ifndef __vtkITKImageToImageFilterFUL_h 00016 #define __vtkITKImageToImageFilterFUL_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 00026 class VTK_ITK_EXPORT vtkITKImageToImageFilterFUL : public vtkITKImageToImageFilter 00027 { 00028 public: 00029 vtkTypeMacro(vtkITKImageToImageFilterFUL,vtkITKImageToImageFilter); 00030 static vtkITKImageToImageFilterFUL* New() { return 0; }; 00031 void PrintSelf(ostream& os, vtkIndent indent) 00032 { 00033 Superclass::PrintSelf ( os, indent ); 00034 os << m_Filter << std::endl; 00035 }; 00036 00037 protected: 00038 00040 typedef itk::Image<float, 3> InputImageType; 00041 typedef itk::Image<unsigned long, 3> OutputImageType; 00042 00043 typedef itk::VTKImageImport<InputImageType> ImageImportType; 00044 typedef itk::VTKImageExport<OutputImageType> ImageExportType; 00045 ImageImportType::Pointer itkImporter; 00046 ImageExportType::Pointer itkExporter; 00047 00048 typedef itk::ImageToImageFilter<InputImageType,OutputImageType> GenericFilterType; 00049 GenericFilterType::Pointer m_Filter; 00050 00051 vtkITKImageToImageFilterFUL ( GenericFilterType* filter ) : vtkITKImageToImageFilter() 00052 { 00054 m_Filter = filter; 00055 this->itkImporter = ImageImportType::New(); 00056 this->itkExporter = ImageExportType::New(); 00057 ConnectPipelines(this->vtkExporter, this->itkImporter); 00058 ConnectPipelines(this->itkExporter, this->vtkImporter); 00060 m_Filter->SetInput ( this->itkImporter->GetOutput() ); 00061 this->itkExporter->SetInput ( m_Filter->GetOutput() ); 00062 this->LinkITKProgressToVTKProgress ( m_Filter ); 00063 this->vtkCast->SetOutputScalarTypeToFloat(); 00064 }; 00065 00066 ~vtkITKImageToImageFilterFUL() 00067 { 00068 }; 00069 00070 private: 00071 vtkITKImageToImageFilterFUL(const vtkITKImageToImageFilterFUL&); 00072 void operator=(const vtkITKImageToImageFilterFUL&); 00073 }; 00074 00075 #endif
1.7.4