Slicer  5.3
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkITKImageToImageFilterFUL.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Copyright Brigham and Women's Hospital (BWH) All Rights Reserved.
4 
5  See COPYRIGHT.txt
6  or http://www.slicer.org/copyright/copyright.txt for details.
7 
8  Program: vtkITK
9  Module: $HeadURL$
10  Date: $Date$
11  Version: $Revision$
12 
13 ==========================================================================*/
14 
15 #ifndef __vtkITKImageToImageFilterFUL_h
16 #define __vtkITKImageToImageFilterFUL_h
17 
19 #include "vtkImageAlgorithm.h"
20 #include "itkImageToImageFilter.h"
21 #include "itkVTKImageExport.h"
22 #include "itkVTKImageImport.h"
23 #include "vtkITKUtility.h"
24 
25 
27 {
28 public:
30  static vtkITKImageToImageFilterFUL* New() { return 0; };
31  void PrintSelf(ostream& os, vtkIndent indent)
32  {
33  Superclass::PrintSelf ( os, indent );
34  os << m_Filter << std::endl;
35  };
36 
37 protected:
38 
40  typedef itk::Image<float, 3> InputImageType;
41  typedef itk::Image<unsigned long, 3> OutputImageType;
42 
43  typedef itk::VTKImageImport<InputImageType> ImageImportType;
44  typedef itk::VTKImageExport<OutputImageType> ImageExportType;
45  ImageImportType::Pointer itkImporter;
46  ImageExportType::Pointer itkExporter;
47 
48  typedef itk::ImageToImageFilter<InputImageType,OutputImageType> GenericFilterType;
49  GenericFilterType::Pointer m_Filter;
50 
52  {
54  m_Filter = filter;
55  this->itkImporter = ImageImportType::New();
56  this->itkExporter = ImageExportType::New();
57  ConnectPipelines(this->vtkExporter, this->itkImporter);
58  ConnectPipelines(this->itkExporter, this->vtkImporter);
60  m_Filter->SetInput ( this->itkImporter->GetOutput() );
61  this->itkExporter->SetInput ( m_Filter->GetOutput() );
62  this->LinkITKProgressToVTKProgress ( m_Filter );
63  this->vtkCast->SetOutputScalarTypeToFloat();
64  };
65 
67  {
68  };
69 
70 private:
72  void operator=(const vtkITKImageToImageFilterFUL&);
73 };
74 
75 #endif
void ConnectPipelines(ITK_Exporter exporter, VTK_Importer *importer)
Definition: vtkITKUtility.h:26
Abstract base class for connecting ITK and VTK.
itk::Image< unsigned long, 3 > OutputImageType
GenericFilterType::Pointer m_Filter
itk::VTKImageExport< OutputImageType > ImageExportType
itk::ImageToImageFilter< InputImageType, OutputImageType > GenericFilterType
void LinkITKProgressToVTKProgress(itk::ProcessObject *process)
BTX.
ImageExportType::Pointer itkExporter
void PrintSelf(ostream &os, vtkIndent indent)
static vtkITKImageToImageFilterFUL * New()
vtkITKImageToImageFilterFUL(GenericFilterType *filter)
itk::VTKImageImport< InputImageType > ImageImportType
ImageImportType::Pointer itkImporter