Slicer  4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes
itk::TimeSeriesDatabase< TPixel > Class Template Reference

TimeSeriesDatabase transforms a series of images stored on disk into a high performance database. More...

#include <Libs/vtkITK/itkTimeSeriesDatabase.h>

Inheritance diagram for itk::TimeSeriesDatabase< TPixel >:
Inheritance graph
[legend]
Collaboration diagram for itk::TimeSeriesDatabase< TPixel >:
Collaboration graph
[legend]

Classes

struct  CacheBlock
 our cache More...
 

Public Types

typedef Array< TPixel > ArrayType
 
typedef SmartPointer< const SelfConstPointer
 
typedef WeakPointer< const SelfConstWeakPointer
 
typedef Image< TPixel, 3 > OutputImageType
 
typedef OutputImageType::Pointer OutputImageTypePointer
 
typedef Image< TPixel, 2 > OutputSliceType
 
typedef OutputSliceType::Pointer OutputSliceTypePointer
 
typedef SmartPointer< SelfPointer
 
typedef TimeSeriesDatabase Self
 
typedef ImageSource< Image< TPixel, 3 > > Superclass
 

Public Member Functions

void Connect (const char *filename)
 
void Disconnect ()
 
virtual void GenerateData (void) ITK_OVERRIDE
 
virtual void GenerateOutputInformation (void) ITK_OVERRIDE
 
float GetCacheSizeInMiB ()
 
int GetNumberOfVolumes ()
 
void GetVoxelTimeSeries (typename OutputImageType::IndexType idx, ArrayType &array)
 
 itkGetMacro (CurrentImage, unsigned int)
 
 itkGetMacro (OutputSpacing, typename OutputImageType::SpacingType)
 
 itkGetMacro (OutputRegion, typename OutputImageType::RegionType)
 
 itkGetMacro (OutputOrigin, typename OutputImageType::PointType)
 
 itkGetMacro (OutputDirection, typename OutputImageType::DirectionType)
 
 itkNewMacro (Self)
 
 itkSetMacro (CurrentImage, unsigned int)
 
 itkTypeMacro (TimeSeriesDatabase, ImageSource)
 
void SetCacheSizeInMiB (float sz)
 

Static Public Member Functions

static void CreateFromFileArchetype (const char *filename, const char *archetype)
 
static void CreateFromFileArchetype (const char *filename, const char *archetype, unsigned long BlocksPerFile)
 

Protected Types

typedef itk::TimeSeriesDatabaseHelper::counted_ptr< std::fstream > StreamPtr
 

Protected Member Functions

unsigned int CalculateFileIndex (unsigned long Index)
 
unsigned long CalculateIndex (Size< 3 > Position, int ImageCount)
 
bool CalculateIntersection (Size< 3 > BlockIndex, typename OutputImageType::RegionType RequestedRegion, typename OutputImageType::RegionType &BlockRegion, typename OutputImageType::RegionType &ImageRegion)
 Return true if this is a full block, false otherwise. Assumes there is overlap! More...
 
CacheBlockGetCacheBlock (unsigned long index)
 
bool IsOpen () const
 
virtual void PrintSelf (std::ostream &os, Indent indent) const ITK_OVERRIDE
 
 TimeSeriesDatabase ()
 
 ~TimeSeriesDatabase ()
 

Static Protected Member Functions

static unsigned int CalculateFileIndex (unsigned long Index, unsigned long BlocksPerFile)
 
static unsigned long CalculateIndex (Size< 3 > Position, int ImageCount, unsigned int BlocksPerImage[3])
 
static std::streampos CalculatePosition (unsigned long index, unsigned long BlocksPerFile)
 

Protected Attributes

unsigned long m_BlocksPerFile
 
Array< unsigned int > m_BlocksPerImage
 
TimeSeriesDatabaseHelper::LRUCache< unsigned long, CacheBlockm_Cache
 
unsigned int m_CurrentImage
 
std::vector< std::string > m_DatabaseFileNames
 
std::vector< StreamPtrm_DatabaseFiles
 
Array< unsigned int > m_Dimensions
 
std::string m_Filename
 
OutputImageType::DirectionType m_OutputDirection
 
OutputImageType::PointType m_OutputOrigin
 
OutputImageType::RegionType m_OutputRegion
 
OutputImageType::SpacingType m_OutputSpacing
 
Array< unsigned int > m_PixelRemainder
 How many pixels are in the last block? More...
 

Detailed Description

template<class TPixel>
class itk::TimeSeriesDatabase< TPixel >

TimeSeriesDatabase transforms a series of images stored on disk into a high performance database.

The main idea behind TimeSeriesDatabase is to have a representation of a 4 dimensional dataset that is larger than main memory, but may still be accessed in a rapid manner. Though not strictly ITK conforming, this initial pass is strictly 4 dimensional datasets.

Definition at line 28 of file itkTimeSeriesDatabase.h.

Member Typedef Documentation

◆ ArrayType

template<class TPixel >
typedef Array<TPixel> itk::TimeSeriesDatabase< TPixel >::ArrayType

Definition at line 47 of file itkTimeSeriesDatabase.h.

◆ ConstPointer

template<class TPixel >
typedef SmartPointer<const Self> itk::TimeSeriesDatabase< TPixel >::ConstPointer

Definition at line 34 of file itkTimeSeriesDatabase.h.

◆ ConstWeakPointer

template<class TPixel >
typedef WeakPointer<const Self> itk::TimeSeriesDatabase< TPixel >::ConstWeakPointer

Definition at line 35 of file itkTimeSeriesDatabase.h.

◆ OutputImageType

template<class TPixel >
typedef Image<TPixel, 3> itk::TimeSeriesDatabase< TPixel >::OutputImageType

Definition at line 43 of file itkTimeSeriesDatabase.h.

◆ OutputImageTypePointer

template<class TPixel >
typedef OutputImageType::Pointer itk::TimeSeriesDatabase< TPixel >::OutputImageTypePointer

Definition at line 44 of file itkTimeSeriesDatabase.h.

◆ OutputSliceType

template<class TPixel >
typedef Image<TPixel, 2> itk::TimeSeriesDatabase< TPixel >::OutputSliceType

Definition at line 45 of file itkTimeSeriesDatabase.h.

◆ OutputSliceTypePointer

template<class TPixel >
typedef OutputSliceType::Pointer itk::TimeSeriesDatabase< TPixel >::OutputSliceTypePointer

Definition at line 46 of file itkTimeSeriesDatabase.h.

◆ Pointer

template<class TPixel >
typedef SmartPointer<Self> itk::TimeSeriesDatabase< TPixel >::Pointer

Definition at line 33 of file itkTimeSeriesDatabase.h.

◆ Self

template<class TPixel >
typedef TimeSeriesDatabase itk::TimeSeriesDatabase< TPixel >::Self

Definition at line 31 of file itkTimeSeriesDatabase.h.

◆ StreamPtr

template<class TPixel >
typedef itk::TimeSeriesDatabaseHelper::counted_ptr<std::fstream> itk::TimeSeriesDatabase< TPixel >::StreamPtr
protected

Definition at line 118 of file itkTimeSeriesDatabase.h.

◆ Superclass

template<class TPixel >
typedef ImageSource<Image<TPixel,3> > itk::TimeSeriesDatabase< TPixel >::Superclass

Definition at line 32 of file itkTimeSeriesDatabase.h.

Constructor & Destructor Documentation

◆ TimeSeriesDatabase()

template<class TPixel >
itk::TimeSeriesDatabase< TPixel >::TimeSeriesDatabase ( )
protected

◆ ~TimeSeriesDatabase()

template<class TPixel >
itk::TimeSeriesDatabase< TPixel >::~TimeSeriesDatabase ( )
protected

Member Function Documentation

◆ CalculateFileIndex() [1/2]

template<class TPixel >
unsigned int itk::TimeSeriesDatabase< TPixel >::CalculateFileIndex ( unsigned long  Index)
protected

◆ CalculateFileIndex() [2/2]

template<class TPixel >
static unsigned int itk::TimeSeriesDatabase< TPixel >::CalculateFileIndex ( unsigned long  Index,
unsigned long  BlocksPerFile 
)
staticprotected

◆ CalculateIndex() [1/2]

template<class TPixel >
unsigned long itk::TimeSeriesDatabase< TPixel >::CalculateIndex ( Size< 3 >  Position,
int  ImageCount 
)
protected

◆ CalculateIndex() [2/2]

template<class TPixel >
static unsigned long itk::TimeSeriesDatabase< TPixel >::CalculateIndex ( Size< 3 >  Position,
int  ImageCount,
unsigned int  BlocksPerImage[3] 
)
staticprotected

◆ CalculateIntersection()

template<class TPixel >
bool itk::TimeSeriesDatabase< TPixel >::CalculateIntersection ( Size< 3 >  BlockIndex,
typename OutputImageType::RegionType  RequestedRegion,
typename OutputImageType::RegionType &  BlockRegion,
typename OutputImageType::RegionType &  ImageRegion 
)
protected

Return true if this is a full block, false otherwise. Assumes there is overlap!

◆ CalculatePosition()

template<class TPixel >
static std::streampos itk::TimeSeriesDatabase< TPixel >::CalculatePosition ( unsigned long  index,
unsigned long  BlocksPerFile 
)
staticprotected

◆ Connect()

template<class TPixel >
void itk::TimeSeriesDatabase< TPixel >::Connect ( const char *  filename)

Connect to an existing TimeSeriesDatabase file on disk The idea behind the Connect method is to associate this class with a pre-existing self-describing file containing a 4-dimensional dataset that is indexed for rapid retrieval.

◆ CreateFromFileArchetype() [1/2]

template<class TPixel >
static void itk::TimeSeriesDatabase< TPixel >::CreateFromFileArchetype ( const char *  filename,
const char *  archetype 
)
static

Create a new TimeSeriesDatabase from an Archetype filename Find all the volumes matching the archetype pattern, loading and checking that they are all the same size. Write the data into a series of files. The default filesize is 1 GiB, but may be changed using the overloaded method. A call to Connect in required to open the newly created TimeSeriesDatabase.

◆ CreateFromFileArchetype() [2/2]

template<class TPixel >
static void itk::TimeSeriesDatabase< TPixel >::CreateFromFileArchetype ( const char *  filename,
const char *  archetype,
unsigned long  BlocksPerFile 
)
static

◆ Disconnect()

template<class TPixel >
void itk::TimeSeriesDatabase< TPixel >::Disconnect ( )

Disconnect from a TimeSeriesDatabase file Essentially closes the file and returns the object to its original state.

◆ GenerateData()

template<class TPixel >
virtual void itk::TimeSeriesDatabase< TPixel >::GenerateData ( void  )
virtual

◆ GenerateOutputInformation()

template<class TPixel >
virtual void itk::TimeSeriesDatabase< TPixel >::GenerateOutputInformation ( void  )
virtual

Standard method for a ImageSource object

◆ GetCacheBlock()

template<class TPixel >
CacheBlock* itk::TimeSeriesDatabase< TPixel >::GetCacheBlock ( unsigned long  index)
protected

◆ GetCacheSizeInMiB()

template<class TPixel >
float itk::TimeSeriesDatabase< TPixel >::GetCacheSizeInMiB ( )

Get the size of the cache in MiB (1 MiB = 2^20 bytes)

◆ GetNumberOfVolumes()

template<class TPixel >
int itk::TimeSeriesDatabase< TPixel >::GetNumberOfVolumes ( )
inline

Return information about the TimeSeriesDatabase file

Definition at line 81 of file itkTimeSeriesDatabase.h.

◆ GetVoxelTimeSeries()

template<class TPixel >
void itk::TimeSeriesDatabase< TPixel >::GetVoxelTimeSeries ( typename OutputImageType::IndexType  idx,
ArrayType array 
)

A convenience method for reading a voxel's time course Subsequent calls to voxels in the immediate region of this will be cached for quick access

◆ IsOpen()

template<class TPixel >
bool itk::TimeSeriesDatabase< TPixel >::IsOpen ( ) const
protected

◆ itkGetMacro() [1/5]

template<class TPixel >
itk::TimeSeriesDatabase< TPixel >::itkGetMacro ( CurrentImage  ,
unsigned  int 
)

◆ itkGetMacro() [2/5]

template<class TPixel >
itk::TimeSeriesDatabase< TPixel >::itkGetMacro ( OutputSpacing  ,
typename OutputImageType::SpacingType   
)

◆ itkGetMacro() [3/5]

template<class TPixel >
itk::TimeSeriesDatabase< TPixel >::itkGetMacro ( OutputRegion  ,
typename OutputImageType::RegionType   
)

◆ itkGetMacro() [4/5]

template<class TPixel >
itk::TimeSeriesDatabase< TPixel >::itkGetMacro ( OutputOrigin  ,
typename OutputImageType::PointType   
)

◆ itkGetMacro() [5/5]

template<class TPixel >
itk::TimeSeriesDatabase< TPixel >::itkGetMacro ( OutputDirection  ,
typename OutputImageType::DirectionType   
)

◆ itkNewMacro()

template<class TPixel >
itk::TimeSeriesDatabase< TPixel >::itkNewMacro ( Self  )

Method for creation through the object factory.

◆ itkSetMacro()

template<class TPixel >
itk::TimeSeriesDatabase< TPixel >::itkSetMacro ( CurrentImage  ,
unsigned  int 
)

Set the image to be read when GenerateData is called. This method selects the image to be returned by an Update call. By changing the CurrentImage, a pipeline can process each image in the series one after another.

◆ itkTypeMacro()

template<class TPixel >
itk::TimeSeriesDatabase< TPixel >::itkTypeMacro ( TimeSeriesDatabase< TPixel >  ,
ImageSource   
)

Run-time type information (and related methods).

◆ PrintSelf()

template<class TPixel >
virtual void itk::TimeSeriesDatabase< TPixel >::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
protectedvirtual

◆ SetCacheSizeInMiB()

template<class TPixel >
void itk::TimeSeriesDatabase< TPixel >::SetCacheSizeInMiB ( float  sz)

Set the size of the cache in MiB (1 MiB = 2^20 bytes)

Member Data Documentation

◆ m_BlocksPerFile

template<class TPixel >
unsigned long itk::TimeSeriesDatabase< TPixel >::m_BlocksPerFile
protected

Definition at line 141 of file itkTimeSeriesDatabase.h.

◆ m_BlocksPerImage

template<class TPixel >
Array<unsigned int> itk::TimeSeriesDatabase< TPixel >::m_BlocksPerImage
protected

Definition at line 111 of file itkTimeSeriesDatabase.h.

◆ m_Cache

template<class TPixel >
TimeSeriesDatabaseHelper::LRUCache<unsigned long, CacheBlock> itk::TimeSeriesDatabase< TPixel >::m_Cache
protected

Definition at line 148 of file itkTimeSeriesDatabase.h.

◆ m_CurrentImage

template<class TPixel >
unsigned int itk::TimeSeriesDatabase< TPixel >::m_CurrentImage
protected

Definition at line 137 of file itkTimeSeriesDatabase.h.

◆ m_DatabaseFileNames

template<class TPixel >
std::vector<std::string> itk::TimeSeriesDatabase< TPixel >::m_DatabaseFileNames
protected

Definition at line 140 of file itkTimeSeriesDatabase.h.

◆ m_DatabaseFiles

template<class TPixel >
std::vector<StreamPtr> itk::TimeSeriesDatabase< TPixel >::m_DatabaseFiles
protected

Definition at line 139 of file itkTimeSeriesDatabase.h.

◆ m_Dimensions

template<class TPixel >
Array<unsigned int> itk::TimeSeriesDatabase< TPixel >::m_Dimensions
protected

Definition at line 110 of file itkTimeSeriesDatabase.h.

◆ m_Filename

template<class TPixel >
std::string itk::TimeSeriesDatabase< TPixel >::m_Filename
protected

Definition at line 136 of file itkTimeSeriesDatabase.h.

◆ m_OutputDirection

template<class TPixel >
OutputImageType::DirectionType itk::TimeSeriesDatabase< TPixel >::m_OutputDirection
protected

Definition at line 116 of file itkTimeSeriesDatabase.h.

◆ m_OutputOrigin

template<class TPixel >
OutputImageType::PointType itk::TimeSeriesDatabase< TPixel >::m_OutputOrigin
protected

Definition at line 115 of file itkTimeSeriesDatabase.h.

◆ m_OutputRegion

template<class TPixel >
OutputImageType::RegionType itk::TimeSeriesDatabase< TPixel >::m_OutputRegion
protected

Definition at line 114 of file itkTimeSeriesDatabase.h.

◆ m_OutputSpacing

template<class TPixel >
OutputImageType::SpacingType itk::TimeSeriesDatabase< TPixel >::m_OutputSpacing
protected

Definition at line 113 of file itkTimeSeriesDatabase.h.

◆ m_PixelRemainder

template<class TPixel >
Array<unsigned int> itk::TimeSeriesDatabase< TPixel >::m_PixelRemainder
protected

How many pixels are in the last block?

Definition at line 134 of file itkTimeSeriesDatabase.h.


The documentation for this class was generated from the following file: