forked from Slicer/SlicerGitSVNArchive
-
Notifications
You must be signed in to change notification settings - Fork 2
/
vtkITKTimeSeriesDatabase.h
102 lines (83 loc) · 3.5 KB
/
vtkITKTimeSeriesDatabase.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*=========================================================================
Copyright Brigham and Women's Hospital (BWH) All Rights Reserved.
See COPYRIGHT.txt
or http://www.slicer.org/copyright/copyright.txt for details.
Program: vtkITK
Module: $HeadURL: http://svn.slicer.org/Slicer4/trunk/Libs/vtkITK/vtkITKArchetypeImageSeriesReader.h $
Date: $Date: 2008-03-11 13:22:52 -0500 (Tue, 11 Mar 2008) $
Version: $Revision: 6159 $
==========================================================================*/
#ifndef __vtkITKTimeSeriesDatabase_h
#define __vtkITKTimeSeriesDatabase_h
#include <vector>
#include "vtkImageData.h"
#include "vtkPointData.h"
#include "vtkImageSource.h"
#include "itkTimeSeriesDatabase.h"
#include "vtkImageImport.h"
#include "itkVTKImageExport.h"
#include "vtkITK.h"
#include "vtkITKUtility.h"
/// \brief Effeciently process large datasets in small memory.
///
/// TimeSeriesDatabase creates a database on disk from a series of volumes
/// stored on disk. The database allows efficient access to volumes,
/// slices and voxels through time.
///
/// \note
/// This work is part of the National Alliance for Medical Image Computing
/// (NAMIC), funded by the National Institutes of Health through the NIH Roadmap
/// for Medical Research, Grant U54 EB005149.
class VTK_ITK_EXPORT vtkITKTimeSeriesDatabase : public vtkImageSource
{
public:
/// vtkStandardNewMacro ( vtkITKTimeSeriesDatabase );
static vtkITKTimeSeriesDatabase *New();
void PrintSelf(ostream& os, vtkIndent indent){ Superclass::PrintSelf(os, indent);};
vtkTypeRevisionMacro(vtkITKTimeSeriesDatabase,vtkImageSource);
public:
/// Create a TimeSeriesDatabase from a series of volumes
static void CreateFromFileArchetype ( const char* TSDFilename, const char* ArchetypeFilename )
{
itk::TimeSeriesDatabase<OutputImagePixelType>::CreateFromFileArchetype ( TSDFilename, ArchetypeFilename );
};
/// Connect/Disconnect to a database
/// void Connect ( const char* filename ) { this->m_Filter->Connect ( filename ); this->Modified(); };
/// void Disconnect() { this->m_Filter->Disconnect(); }
/// Get/Set the current time stamp to read
void SetCurrentImage ( unsigned int value )
{ DelegateITKInputMacro ( SetCurrentImage, value); };
unsigned int GetCurrentImage ( unsigned int vtkNotUsed(value) )
{ DelegateITKOutputMacro ( GetCurrentImage ); };
int GetNumberOfVolumes()
{ DelegateITKOutputMacro ( GetNumberOfVolumes ); };
protected:
vtkITKTimeSeriesDatabase()
{
m_Filter = SourceType::New();
this->itkExporter = ImageExportType::New();
this->vtkImporter = vtkImageImport::New();
ConnectPipelines ( this->itkExporter, this->vtkImporter );
this->itkExporter->SetInput ( m_Filter->GetOutput() );
};
~vtkITKTimeSeriesDatabase()
{
this->vtkImporter->Delete();
}
typedef short InputImagePixelType;
typedef short OutputImagePixelType;
typedef itk::Image<OutputImagePixelType, 3> OutputImageType;
typedef itk::VTKImageExport<OutputImageType> ImageExportType;
typedef itk::TimeSeriesDatabase<OutputImagePixelType> SourceType;
typedef SourceType ImageFilterType;
SourceType::Pointer m_Filter;
ImageExportType::Pointer itkExporter;
vtkImageImport* vtkImporter;
virtual void ExecuteInformation();
/// defined in the subclasses
virtual void ExecuteData(vtkDataObject *output);
private:
vtkITKTimeSeriesDatabase(const vtkITKTimeSeriesDatabase&); /// Not implemented.
void operator=(const vtkITKTimeSeriesDatabase&); /// Not implemented.
};
#endif