Slicer  4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkITKImageToImageFilterUSF.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: http://svn.slicer.org/Slicer4/trunk/Libs/vtkITK/vtkITKImageToImageFilterUSF.h $
10  Date: $Date: 2006-12-21 07:21:52 -0500 (Thu, 21 Dec 2006) $
11  Version: $Revision: 1900 $
12 
13 ==========================================================================*/
14 
15 #ifndef __vtkITKImageToImageFilterUSF
16 #define __vtkITKImageToImageFilterUSF
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 vtkITKImageToImageFilterUSF* New() { return 0; };
31  void PrintSelf(ostream& os, vtkIndent indent)
32  {
33  Superclass::PrintSelf ( os, indent );
34  os << m_Filter;
35  };
36 
37 protected:
38 
40  typedef unsigned short InputImagePixelType;
41  typedef float OutputImagePixelType;
42  typedef itk::Image<InputImagePixelType, 3> InputImageType;
43  typedef itk::Image<OutputImagePixelType, 3> OutputImageType;
44 
45  typedef itk::VTKImageImport<InputImageType> ImageImportType;
46  typedef itk::VTKImageExport<OutputImageType> ImageExportType;
47  ImageImportType::Pointer itkImporter;
48  ImageExportType::Pointer itkExporter;
49 
50  typedef itk::ImageToImageFilter<InputImageType,OutputImageType> GenericFilterType;
51  GenericFilterType::Pointer m_Filter;
52 
54  {
56  m_Filter = filter;
57  this->itkImporter = ImageImportType::New();
58  this->itkExporter = ImageExportType::New();
59  ConnectPipelines(this->vtkExporter, this->itkImporter);
60  ConnectPipelines(this->itkExporter, this->vtkImporter);
61  this->LinkITKProgressToVTKProgress ( m_Filter );
62 
64  m_Filter->SetInput ( this->itkImporter->GetOutput() );
65  this->itkExporter->SetInput ( m_Filter->GetOutput() );
66  this->vtkCast->SetOutputScalarTypeToUnsignedShort();
67  };
68 
70  {
71  };
72 
73 private:
75  void operator=(const vtkITKImageToImageFilterUSF&);
76 };
77 
78 #endif
void ConnectPipelines(ITK_Exporter exporter, VTK_Importer *importer)
Definition: vtkITKUtility.h:26
vtkITKImageToImageFilterUSF(GenericFilterType *filter)
itk::ImageToImageFilter< InputImageType, OutputImageType > GenericFilterType
itk::Image< OutputImagePixelType, 3 > OutputImageType
ImageImportType::Pointer itkImporter
ImageExportType::Pointer itkExporter
Abstract base class for connecting ITK and VTK.
itk::VTKImageExport< OutputImageType > ImageExportType
itk::Image< InputImagePixelType, 3 > InputImageType
void LinkITKProgressToVTKProgress(itk::ProcessObject *process)
BTX.
static vtkITKImageToImageFilterUSF * New()
itk::VTKImageImport< InputImageType > ImageImportType
void PrintSelf(ostream &os, vtkIndent indent)
GenericFilterType::Pointer m_Filter