Slicer 5.4
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkITKImageToImageFilterSS.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 __vtkITKImageToImageFilterSS_h
16#define __vtkITKImageToImageFilterSS_h
17
19#include "vtkImageAlgorithm.h"
20#include "itkImageToImageFilter.h"
21#include "itkVTKImageExport.h"
22#include "itkVTKImageImport.h"
23#include "vtkITKUtility.h"
24
26{
27public:
29 static vtkITKImageToImageFilterSS* New() { return nullptr; }
30 void PrintSelf(ostream& os, vtkIndent indent) override
31 {
32 Superclass::PrintSelf ( os, indent );
33 os << m_Filter;
34 }
35
39 void SetReleaseDataFlag(int f) override
40 {
41 Superclass::SetReleaseDataFlag(f);
42 m_Filter->SetReleaseDataFlag(f);
43 }
44
45protected:
46
48 typedef short InputImagePixelType;
49 typedef short OutputImagePixelType;
50 typedef itk::Image<InputImagePixelType, 3> InputImageType;
51 typedef itk::Image<OutputImagePixelType, 3> OutputImageType;
52
53 typedef itk::VTKImageImport<InputImageType> ImageImportType;
54 typedef itk::VTKImageExport<OutputImageType> ImageExportType;
55 ImageImportType::Pointer itkImporter;
56 ImageExportType::Pointer itkExporter;
57
58 typedef itk::ImageToImageFilter<InputImageType,OutputImageType> GenericFilterType;
59 GenericFilterType::Pointer m_Filter;
60
62 {
64 m_Filter = filter;
65 this->itkImporter = ImageImportType::New();
66 this->itkExporter = ImageExportType::New();
67 ConnectPipelines(this->vtkExporter, this->itkImporter);
68 ConnectPipelines(this->itkExporter, this->vtkImporter);
69 this->LinkITKProgressToVTKProgress ( m_Filter );
70
72 m_Filter->SetInput ( this->itkImporter->GetOutput() );
73 this->itkExporter->SetInput ( m_Filter->GetOutput() );
74 this->vtkCast->SetOutputScalarTypeToShort();
75 };
76
77 ~vtkITKImageToImageFilterSS() override = default;
78
79private:
81 void operator=(const vtkITKImageToImageFilterSS&) = delete;
82};
83
84#endif
~vtkITKImageToImageFilterSS() override=default
itk::VTKImageExport< OutputImageType > ImageExportType
vtkITKImageToImageFilterSS(GenericFilterType *filter)
GenericFilterType::Pointer m_Filter
itk::ImageToImageFilter< InputImageType, OutputImageType > GenericFilterType
void PrintSelf(ostream &os, vtkIndent indent) override
itk::Image< OutputImagePixelType, 3 > OutputImageType
static vtkITKImageToImageFilterSS * New()
itk::VTKImageImport< InputImageType > ImageImportType
itk::Image< InputImagePixelType, 3 > InputImageType
ImageExportType::Pointer itkExporter
ImageImportType::Pointer itkImporter
Abstract base class for connecting ITK and VTK.
void ConnectPipelines(ITK_Exporter exporter, VTK_Importer *importer)