Slicer 4.2
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
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

#include <Libs/vtkITK/itkTimeSeriesDatabase.h>

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

List of all members.

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)
virtual void GenerateOutputInformation (void)
float GetCacheSizeInMiB ()
int GetNumberOfVolumes ()
void GetVoxelTimeSeries (typename OutputImageType::IndexType idx, ArrayType &array)
 itkGetMacro (OutputSpacing, typename OutputImageType::SpacingType)
 itkGetMacro (OutputRegion, typename OutputImageType::RegionType)
 itkGetMacro (OutputOrigin, typename OutputImageType::PointType)
 itkGetMacro (OutputDirection, typename OutputImageType::DirectionType)
 itkGetMacro (CurrentImage, unsigned int)
 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!
CacheBlockGetCacheBlock (unsigned long index)
bool IsOpen () const
virtual void PrintSelf (std::ostream &os, Indent indent) const
 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, CacheBlock
m_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?

Detailed Description

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

Definition at line 28 of file itkTimeSeriesDatabase.h.


Member Typedef Documentation

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

Definition at line 47 of file itkTimeSeriesDatabase.h.

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

Definition at line 34 of file itkTimeSeriesDatabase.h.

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

Definition at line 35 of file itkTimeSeriesDatabase.h.

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

Definition at line 43 of file itkTimeSeriesDatabase.h.

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

Definition at line 44 of file itkTimeSeriesDatabase.h.

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

Definition at line 45 of file itkTimeSeriesDatabase.h.

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

Definition at line 46 of file itkTimeSeriesDatabase.h.

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

Definition at line 33 of file itkTimeSeriesDatabase.h.

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

Definition at line 31 of file itkTimeSeriesDatabase.h.

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

Definition at line 116 of file itkTimeSeriesDatabase.h.

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

Definition at line 32 of file itkTimeSeriesDatabase.h.


Constructor & Destructor Documentation

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

Member Function Documentation

template<class TPixel >
unsigned int itk::TimeSeriesDatabase< TPixel >::CalculateFileIndex ( unsigned long  Index) [protected]
template<class TPixel >
static unsigned int itk::TimeSeriesDatabase< TPixel >::CalculateFileIndex ( unsigned long  Index,
unsigned long  BlocksPerFile 
) [static, protected]
template<class TPixel >
unsigned long itk::TimeSeriesDatabase< TPixel >::CalculateIndex ( Size< 3 >  Position,
int  ImageCount 
) [protected]
template<class TPixel >
static unsigned long itk::TimeSeriesDatabase< TPixel >::CalculateIndex ( Size< 3 >  Position,
int  ImageCount,
unsigned int  BlocksPerImage[3] 
) [static, protected]
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!

template<class TPixel >
static std::streampos itk::TimeSeriesDatabase< TPixel >::CalculatePosition ( unsigned long  index,
unsigned long  BlocksPerFile 
) [static, protected]
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.

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.

template<class TPixel >
static void itk::TimeSeriesDatabase< TPixel >::CreateFromFileArchetype ( const char *  filename,
const char *  archetype,
unsigned long  BlocksPerFile 
) [static]
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.

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

Standard method for a ImageSource object

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

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

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

Return information about the TimeSeriesDatabase file

Definition at line 81 of file itkTimeSeriesDatabase.h.

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

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

template<class TPixel >
bool itk::TimeSeriesDatabase< TPixel >::IsOpen ( ) const [protected]
template<class TPixel >
itk::TimeSeriesDatabase< TPixel >::itkGetMacro ( OutputDirection  ,
typename OutputImageType::DirectionType   
)
template<class TPixel >
itk::TimeSeriesDatabase< TPixel >::itkGetMacro ( CurrentImage  ,
unsigned  int 
)
template<class TPixel >
itk::TimeSeriesDatabase< TPixel >::itkGetMacro ( OutputRegion  ,
typename OutputImageType::RegionType   
)
template<class TPixel >
itk::TimeSeriesDatabase< TPixel >::itkGetMacro ( OutputOrigin  ,
typename OutputImageType::PointType   
)
template<class TPixel >
itk::TimeSeriesDatabase< TPixel >::itkGetMacro ( OutputSpacing  ,
typename OutputImageType::SpacingType   
)
template<class TPixel >
itk::TimeSeriesDatabase< TPixel >::itkNewMacro ( Self  )

Method for creation through the object factory.

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.

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

Run-time type information (and related methods).

template<class TPixel >
virtual void itk::TimeSeriesDatabase< TPixel >::PrintSelf ( std::ostream &  os,
Indent  indent 
) const [protected, virtual]
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

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

Definition at line 138 of file itkTimeSeriesDatabase.h.

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

Definition at line 110 of file itkTimeSeriesDatabase.h.

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

Definition at line 145 of file itkTimeSeriesDatabase.h.

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

Definition at line 134 of file itkTimeSeriesDatabase.h.

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

Definition at line 137 of file itkTimeSeriesDatabase.h.

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

Definition at line 136 of file itkTimeSeriesDatabase.h.

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

Definition at line 109 of file itkTimeSeriesDatabase.h.

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

Definition at line 133 of file itkTimeSeriesDatabase.h.

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

Definition at line 115 of file itkTimeSeriesDatabase.h.

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

Definition at line 114 of file itkTimeSeriesDatabase.h.

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

Definition at line 113 of file itkTimeSeriesDatabase.h.

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

Definition at line 112 of file itkTimeSeriesDatabase.h.

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

How many pixels are in the last block?

Definition at line 132 of file itkTimeSeriesDatabase.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines