Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

Image3DSet< ImageType > Class Template Reference

A class for handling a set of images. More...

#include <Image3DSet.hpp>

List of all members.

Public Types

typedef ImageType::value_type Im3DValue
typedef ImageType::value_type value_type
enum  ImageStatus { ON_FILE, IN_MEM }

Public Member Functions

 Image3DSet (const vector< string > &_fileNames, bool _fileIsReadOnly=true, bool _isMemOnly=false)
 Image3DSet (bool _fileIsReadOnly=true, bool _isMemOnly=false)
 Image3DSet (const Image3DSet< ImageType > &_other)
virtual void Clear (bool _fileIsReadOnly=true, bool _isMemOnly=false)
 erases all images from image set
ImageType & operator[] (int position)
 get a reference to an image from the image set
const ImageType & operator[] (int position) const
ImageType & GetImage (int position)
const ImageType & GetImage (int position) const
 Returns a pointer to the contained container-element at position n (start indexing at 0).
string GetFilename (int position)
bool IsEmpty () const
int Size () const
Im3DValue & operator() (const Vect3Di &gpos, int pos)
Im3DValue & operator() (int x, int y, int z, int pos)
Im3DValue Value (const Vect3Di &gpos, int pos)
Im3DValue Value (int x, int y, int z, int pos)
int AddImage (ImageType *image, const string &fileName="")
 Add image to set, optional file argument, returns position in set.
int GetPosition (const string &filename)
ImageType * RemoveImage (const string &filename)
 Removes first instance of the pointer associated with the filename.
ImageType * RemoveImage (int position)
bool IsAllSameSize ()
 Returns true if all images are of the same size, else false. Warning: all images will be loaded into memory if necessary!
vector< string > ImagesThatAreAlike ()
 Checks if the contents of some files by accident could be the same. The function return a list of filenames if it found images that are alike (operator==), where one filename might occur several times. If the set is mem only, the numbers (1, 2 ..)will be pushed_back as strings.
vector< string > GetFileList ()

Protected Member Functions

void DeleteImages ()
void FlushToDisk (int i) const
 Saves one image into disk.
void LoadImage (int i) const
 Loads one image into memory.
void LoadAllImages ()
 Loads all images into memory.
void FlushAllToDisk ()
 Saves all images into disk.
int LeastRecentlyUsed () const
 Finds lru image and flushes it to disk.
bool Fits (int i) const

Protected Attributes

vector< string > fileNames
vector< ImageType * > images
vector< ImageStatus > status
int nbImages
bool fileIsReadOnly
bool isMemOnly
int lruGap
double startTime
 Start of lru timing.
vector< double > lastTimeUsed
 last acces time , for lru

Friends

template<class T>
ostream & operator<< (ostream &s, const Image3DSet< T > &set)


Detailed Description

template<class ImageType>
class Image3DSet< ImageType >

A class for handling a set of images.

The image set can be be disk resident, in which case images are read into memory or flushed back to disk as needed.

Definition at line 33 of file Image3DSet.hpp.


Member Function Documentation

template<class ImageType>
ImageType & Image3DSet< ImageType >::GetImage int  position  ) 
 

Image is on disk, must load it!

Definition at line 179 of file Image3DSet.hxx.

References DTime(), Image3DSet< ImageType >::lastTimeUsed, Image3DSet< ImageType >::LoadImage(), and Image3DSet< ImageType >::startTime.

Referenced by Image3DSet< ImageType >::ImagesThatAreAlike(), Image3DSet< ImageType >::IsAllSameSize(), and Image3DSet< ImageType >::operator[]().

template<class ImageType>
const ImageType & Image3DSet< ImageType >::GetImage int  position  )  const
 

Returns a pointer to the contained container-element at position n (start indexing at 0).

<long-description> return value: NULL if position is outside scope or the container couldn't be achieved.

Parameters:
position Image is on disk, must load it!

Definition at line 164 of file Image3DSet.hxx.

References DTime(), Image3DSet< ImageType >::lastTimeUsed, Image3DSet< ImageType >::LoadImage(), and Image3DSet< ImageType >::startTime.

template<class ImageType>
ImageType * Image3DSet< ImageType >::RemoveImage const string &  filename  ) 
 

Removes first instance of the pointer associated with the filename.

<long-description> Returns the pointer that has been removed from the list. The user is responsible for deleting this pointer. If the Image couldn't be found in the filelist, the NULL pointer will be returned (don't delete). If the Image is not in memory it will be loaded.

Parameters:
filename 

Definition at line 251 of file Image3DSet.hxx.


The documentation for this class was generated from the following files:
Generated on Fri Jun 17 13:36:18 2005 for ImLib3D by  doxygen 1.4.2