Slicer  5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkITKImageToImageFilterF2F.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 __vtkITKImageToImageFilterF2F_h
16 #define __vtkITKImageToImageFilterF2F_h
17 
18 
20 #include "vtkImageAlgorithm.h"
21 #include "itkImageToImageFilter.h"
22 #include "itkVTKImageExport.h"
23 #include "itkVTKImageImport.h"
24 #include "vtkITKUtility.h"
25 
26 
28 {
29 public:
31  static vtkITKImageToImageFilterF2F* New() { return 0; };
32  void PrintSelf(ostream& os, vtkIndent indent)
33  {
34  Superclass::PrintSelf ( os, indent );
35  os << m_Filter;
36  };
37 
38 protected:
39 
41  typedef itk::Vector<float,2> InputImagePixelType;
42  typedef float OutputImagePixelType;
43  typedef itk::Image<InputImagePixelType, 3> InputImageType;
44  typedef itk::Image<OutputImagePixelType, 3> OutputImageType;
45 
46  typedef itk::VTKImageImport<InputImageType> ImageImportType;
47  typedef itk::VTKImageExport<OutputImageType> ImageExportType;
48  ImageImportType::Pointer itkImporter;
49  ImageExportType::Pointer itkExporter;
50 
51  typedef itk::ImageToImageFilter<InputImageType,OutputImageType> GenericFilterType;
52  GenericFilterType::Pointer m_Filter;
53 
55  {
57  m_Filter = filter;
58  this->itkImporter = ImageImportType::New();
59  this->itkExporter = ImageExportType::New();
60  ConnectPipelines(this->vtkExporter, this->itkImporter);
61  ConnectPipelines(this->itkExporter, this->vtkImporter);
62  this->LinkITKProgressToVTKProgress ( m_Filter );
63 
65  m_Filter->SetInput ( this->itkImporter->GetOutput() );
66  this->itkExporter->SetInput ( m_Filter->GetOutput() );
67  this->vtkCast->SetOutputScalarTypeToFloat();
68  };
69 
71  {
72  };
73 
74 private:
76  void operator=(const vtkITKImageToImageFilterF2F&);
77 };
78 
79 #endif
80 
81 
82 
83 
void ConnectPipelines(ITK_Exporter exporter, VTK_Importer *importer)
Definition: vtkITKUtility.h:26
void PrintSelf(ostream &os, vtkIndent indent)
itk::VTKImageExport< OutputImageType > ImageExportType
itk::Image< InputImagePixelType, 3 > InputImageType
Abstract base class for connecting ITK and VTK.
vtkITKImageToImageFilterF2F(GenericFilterType *filter)
ImageImportType::Pointer itkImporter
GenericFilterType::Pointer m_Filter
ImageExportType::Pointer itkExporter
itk::VTKImageImport< InputImageType > ImageImportType
void LinkITKProgressToVTKProgress(itk::ProcessObject *process)
BTX.
static vtkITKImageToImageFilterF2F * New()
itk::ImageToImageFilter< InputImageType, OutputImageType > GenericFilterType
itk::Image< OutputImagePixelType, 3 > OutputImageType