Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
vtkITKImageToImageFilterUSUS.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 __vtkITKImageToImageFilterUSUS_h
16 #define __vtkITKImageToImageFilterUSUS_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 vtkITKImageToImageFilterUSUS* 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 unsigned short InputImagePixelType;
42  typedef unsigned short 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 
54  vtkITKImageToImageFilterUSUS ( GenericFilterType* filter )
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->SetOutputScalarTypeToUnsignedShort();
68  };
69 
71  {
72  };
73 
74 private:
76  void operator=(const vtkITKImageToImageFilterUSUS&);
77 };
78 
79 #endif
itk::ImageToImageFilter< InputImageType, OutputImageType > GenericFilterType
void ConnectPipelines(ITK_Exporter exporter, VTK_Importer *importer)
Definition: vtkITKUtility.h:26
itk::VTKImageImport< InputImageType > ImageImportType
void PrintSelf(ostream &os, vtkIndent indent)
Abstract base class for connecting ITK and VTK.
itk::VTKImageExport< OutputImageType > ImageExportType
vtkITKImageToImageFilterUSUS(GenericFilterType *filter)
itk::Image< OutputImagePixelType, 3 > OutputImageType
void LinkITKProgressToVTKProgress(itk::ProcessObject *process)
BTX.
unsigned short InputImagePixelType
To/from ITK.
itk::Image< InputImagePixelType, 3 > InputImageType
static vtkITKImageToImageFilterUSUS * New()