2 #ifndef itkTimeSeriesDatabase_h 3 #define itkTimeSeriesDatabase_h 7 #include <itkImageSource.h> 12 #define TimeSeriesBlockSize 16 13 #define TimeSeriesBlockSizeP2 TimeSeriesBlockSize*TimeSeriesBlockSize 14 #define TimeSeriesBlockSizeP3 TimeSeriesBlockSize*TimeSeriesBlockSize*TimeSeriesBlockSize 15 #define TimeSeriesVolumeBlockSize TimeSeriesBlockSize*TimeSeriesBlockSize*TimeSeriesBlockSize 16 #define TimeSeriesVolumeBlockSizeP3 TimeSeriesVolumeBlockSize*TimeSeriesVolumeBlockSize*TimeSeriesVolumeBlockSize 54 void Connect (
const char* filename );
70 static void CreateFromFileArchetype (
const char* filename,
const char* archetype,
unsigned long BlocksPerFile );
82 itkGetMacro ( OutputSpacing,
typename OutputImageType::SpacingType );
83 itkGetMacro ( OutputRegion,
typename OutputImageType::RegionType );
84 itkGetMacro ( OutputOrigin,
typename OutputImageType::PointType );
85 itkGetMacro ( OutputDirection,
typename OutputImageType::DirectionType );
108 void PrintSelf(std::ostream& os, Indent indent)
const override;
120 static std::streampos
CalculatePosition (
unsigned long index,
unsigned long BlocksPerFile );
123 static unsigned int CalculateFileIndex (
unsigned long Index,
unsigned long BlocksPerFile );
125 unsigned long CalculateIndex ( Size<3> Position,
int ImageCount );
126 static unsigned long CalculateIndex ( Size<3> Position,
int ImageCount,
unsigned int BlocksPerImage[3] );
128 bool CalculateIntersection ( Size<3> BlockIndex,
typename OutputImageType::RegionType RequestedRegion,
129 typename OutputImageType::RegionType& BlockRegion,
130 typename OutputImageType::RegionType& ImageRegion );
153 # include "itkTimeSeriesDatabase.txx" SmartPointer< Self > Pointer
unsigned long m_BlocksPerFile
void GetVoxelTimeSeries(typename OutputImageType::IndexType idx, ArrayType &array)
itk::TimeSeriesDatabaseHelper::counted_ptr< std::fstream > StreamPtr
void Connect(const char *filename)
itkGetMacro(CurrentImage, unsigned int)
void PrintSelf(std::ostream &os, Indent indent) const override
Array< unsigned int > m_BlocksPerImage
std::vector< StreamPtr > m_DatabaseFiles
Image< TPixel, 2 > OutputSliceType
Array< unsigned int > m_PixelRemainder
How many pixels are in the last block?
Array< unsigned int > m_Dimensions
float GetCacheSizeInMiB()
static void CreateFromFileArchetype(const char *filename, const char *archetype)
TimeSeriesDatabaseHelper::LRUCache< unsigned long, CacheBlock > m_Cache
Array< TPixel > ArrayType
TPixel data[TimeSeriesBlockSize *TimeSeriesBlockSize *TimeSeriesBlockSize]
std::vector< std::string > m_DatabaseFileNames
itkTypeMacro(TimeSeriesDatabase, ImageSource)
Simplified inverse ITK transforms.
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!
unsigned long CalculateIndex(Size< 3 > Position, int ImageCount)
OutputImageType::Pointer OutputImageTypePointer
OutputImageType::DirectionType m_OutputDirection
void GenerateOutputInformation() override
#define TimeSeriesBlockSize
SmartPointer< const Self > ConstPointer
static std::streampos CalculatePosition(unsigned long index, unsigned long BlocksPerFile)
void SetCacheSizeInMiB(float sz)
unsigned int CalculateFileIndex(unsigned long Index)
void GenerateData() override
OutputSliceType::Pointer OutputSliceTypePointer
Image< TPixel, 3 > OutputImageType
CacheBlock * GetCacheBlock(unsigned long index)
TimeSeriesDatabase transforms a series of images stored on disk into a high performance database...
OutputImageType::SpacingType m_OutputSpacing
OutputImageType::RegionType m_OutputRegion
ImageSource< Image< TPixel, 3 > > Superclass
OutputImageType::PointType m_OutputOrigin
itkSetMacro(CurrentImage, unsigned int)
~TimeSeriesDatabase() override
unsigned int m_CurrentImage
WeakPointer< const Self > ConstWeakPointer