Slicer  4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkITKTimeSeriesDatabase.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 __vtkITKTimeSeriesDatabase_h
11 #define __vtkITKTimeSeriesDatabase_h
12 
13 #include <vector>
14 
15 #include "vtkImageData.h"
16 #include "vtkPointData.h"
17 #include "vtkImageAlgorithm.h"
18 #include "itkTimeSeriesDatabase.h"
19 #include "vtkImageImport.h"
20 #include "itkVTKImageExport.h"
21 #include <vtkVersion.h>
22 
23 #include "vtkITK.h"
24 #include "vtkITKUtility.h"
25 
36 class VTK_ITK_EXPORT vtkITKTimeSeriesDatabase : public vtkImageAlgorithm
37 {
38 public:
40  static vtkITKTimeSeriesDatabase *New();
41  void PrintSelf(ostream& os, vtkIndent indent) override{ Superclass::PrintSelf(os, indent);}
42  vtkTypeMacro(vtkITKTimeSeriesDatabase,vtkImageAlgorithm);
43 
44 public:
46  static void CreateFromFileArchetype ( const char* TSDFilename, const char* ArchetypeFilename )
47  {
49  };
50 
54 
56  void SetCurrentImage ( unsigned int value )
57  { DelegateITKInputMacro ( SetCurrentImage, value); };
58  unsigned int GetCurrentImage ( unsigned int vtkNotUsed(value) )
59  { DelegateITKOutputMacro ( GetCurrentImage ); };
60 
62  { DelegateITKOutputMacro ( GetNumberOfVolumes ); };
63 
64 protected:
66  {
67  m_Filter = SourceType::New();
68  this->itkExporter = ImageExportType::New();
69  this->vtkImporter = vtkImageImport::New();
70  ConnectPipelines ( this->itkExporter, this->vtkImporter );
71  this->itkExporter->SetInput ( m_Filter->GetOutput() );
72  };
74  {
75  this->vtkImporter->Delete();
76  }
77  typedef short InputImagePixelType;
78  typedef short OutputImagePixelType;
79  typedef itk::Image<OutputImagePixelType, 3> OutputImageType;
80  typedef itk::VTKImageExport<OutputImageType> ImageExportType;
83 
85  ImageExportType::Pointer itkExporter;
86  vtkImageImport* vtkImporter;
87 
88  int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override;
90  void ExecuteDataWithInformation(vtkDataObject *output, vtkInformation *outInfo) override;
91 
92 private:
94  void operator=(const vtkITKTimeSeriesDatabase&) = delete;
95 
96 };
97 
98 #endif
SmartPointer< Self > Pointer
void ConnectPipelines(ITK_Exporter exporter, VTK_Importer *importer)
Definition: vtkITKUtility.h:26
#define DelegateITKInputMacro(name, arg)
Definition: vtkITKUtility.h:65
static void CreateFromFileArchetype(const char *filename, const char *archetype)
itk::TimeSeriesDatabase< OutputImagePixelType > SourceType
void PrintSelf(ostream &os, vtkIndent indent) override
itk::Image< OutputImagePixelType, 3 > OutputImageType
static void CreateFromFileArchetype(const char *TSDFilename, const char *ArchetypeFilename)
Create a TimeSeriesDatabase from a series of volumes.
Efficiently process large datasets in small memory.
#define DelegateITKOutputMacro(name)
Definition: vtkITKUtility.h:77
TimeSeriesDatabase transforms a series of images stored on disk into a high performance database...
ImageExportType::Pointer itkExporter
itk::VTKImageExport< OutputImageType > ImageExportType
unsigned int GetCurrentImage(unsigned int vtkNotUsed(value))
void SetCurrentImage(unsigned int value)
Get/Set the current time stamp to read.