Slicer  5.0
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 ==========================================================================*/
9 
10 #ifndef __vtkITKImageToImageFilterUSF
11 #define __vtkITKImageToImageFilterUSF
12 
14 #include "vtkImageAlgorithm.h"
15 #include "itkImageToImageFilter.h"
16 #include "itkVTKImageExport.h"
17 #include "itkVTKImageImport.h"
18 #include "vtkITKUtility.h"
19 
20 
22 {
23 public:
25  static vtkITKImageToImageFilterUSF* New() { return 0; };
26  void PrintSelf(ostream& os, vtkIndent indent)
27  {
28  Superclass::PrintSelf ( os, indent );
29  os << m_Filter;
30  };
31 
32 protected:
33 
35  typedef unsigned short InputImagePixelType;
36  typedef float OutputImagePixelType;
37  typedef itk::Image<InputImagePixelType, 3> InputImageType;
38  typedef itk::Image<OutputImagePixelType, 3> OutputImageType;
39 
40  typedef itk::VTKImageImport<InputImageType> ImageImportType;
41  typedef itk::VTKImageExport<OutputImageType> ImageExportType;
42  ImageImportType::Pointer itkImporter;
43  ImageExportType::Pointer itkExporter;
44 
45  typedef itk::ImageToImageFilter<InputImageType,OutputImageType> GenericFilterType;
46  GenericFilterType::Pointer m_Filter;
47 
49  {
51  m_Filter = filter;
52  this->itkImporter = ImageImportType::New();
53  this->itkExporter = ImageExportType::New();
54  ConnectPipelines(this->vtkExporter, this->itkImporter);
55  ConnectPipelines(this->itkExporter, this->vtkImporter);
56  this->LinkITKProgressToVTKProgress ( m_Filter );
57 
59  m_Filter->SetInput ( this->itkImporter->GetOutput() );
60  this->itkExporter->SetInput ( m_Filter->GetOutput() );
61  this->vtkCast->SetOutputScalarTypeToUnsignedShort();
62  };
63 
65  {
66  };
67 
68 private:
70  void operator=(const vtkITKImageToImageFilterUSF&);
71 };
72 
73 #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