SMIL  0.9.1
IO and Image Formats
+ Collaboration diagram for IO and Image Formats:

Classes

class  BMPImageFileHandler< T >
 
class  FileCloser
 
class  Image< T >
 Main Image class. More...
 
class  ImageFileHandler< T >
 
struct  ImageFileInfo
 
class  JPGImageFileHandler< T >
 
class  PBMImageFileHandler< T >
 
class  PGMImageFileHandler< T >
 
class  PNGImageFileHandler< T >
 
class  TIFFImageFileHandler< T >
 
struct  VTKHeader
 
class  VTKImageFileHandler< T >
 

Functions

BaseImage * createFromFile (const char *filename)
 
template<class T >
void endswap (T *objp)
 
RES_T getBMPFileInfo (const char *filename, ImageFileInfo &fInfo)
 
string getFileExtension (const char *fileName)
 
RES_T getFileInfo (const char *filename, ImageFileInfo &fInfo)
 
template<class T >
ImageFileHandler< T > * getHandlerForFile (const char *filename)
 
RES_T getHttpFile (const char *url, const char *outfilename)
 
string getHttpFile (const char *url)
 Download file data into a string buffer.
 
RES_T getJPGFileInfo (const char *filename, ImageFileInfo &fInfo)
 
RES_T getPNGFileInfo (const char *filename, ImageFileInfo &fInfo)
 
RES_T getTIFFFileInfo (const char *filename, ImageFileInfo &fInfo)
 
RES_T getVTKFileInfo (const char *filename, ImageFileInfo &fInfo)
 
virtual RES_T read (const char *filename, Image< T > &image)
 
virtual RES_T read (const char *filename, Image< T > &image)
 
virtual RES_T read (const char *filename, Image< T > &image)
 
virtual RES_T read (const char *filename, Image< T > &image)
 
virtual RES_T read (const char *filename, Image< T > &image)
 
template<class T >
RES_T read (const char *filename, Image< T > &image)
 Read image file.
 
template<class T >
RES_T read (const vector< string > fileList, Image< T > &image)
 Read a stack of 2D images. More...
 
RES_T readNetPBMFileInfo (ifstream &fp, ImageFileInfo &fInfo, unsigned int &maxval)
 
RES_T readNetPBMFileInfo (const char *filename, ImageFileInfo &fInfo, unsigned int &maxval)
 
template<class T >
RES_T readRAW (const char *filename, size_t width, size_t height, size_t depth, Image< T > &image)
 RAW file read.
 
RES_T readVTKHeader (ifstream &fp, VTKHeader &hStruct)
 
virtual RES_T write (const Image< T > &image, const char *filename)
 
virtual RES_T write (const Image< T > &image, const char *filename)
 
virtual RES_T write (const Image< T > &image, const char *filename)
 
virtual RES_T write (const Image< T > &image, const char *filename)
 
virtual RES_T write (const Image< T > &image, const char *filename)
 
template<class T >
RES_T write (const Image< T > &image, const char *filename)
 Write image file.
 
template<class T >
RES_T write (const Image< T > &image, const vector< string > fileList)
 Write a 3D image as a stack of 2D images. More...
 
template<class T >
RES_T writeRAW (Image< T > &image, const char *filename)
 RAW file write.
 

Detailed Description

Function Documentation

RES_T read ( const vector< string >  fileList,
Image< T > &  image 
)

Read a stack of 2D images.

The output 3D image will have the width and height of the first (2D) image and the number of images for depth.

RES_T write ( const Image< T > &  image,
const vector< string >  fileList 
)

Write a 3D image as a stack of 2D images.

The file list must contain the same number of filenames as the 3D image depth.

Example:

1 im1 = Image("img3d.vtk")
2 fileNames = [ "img{:03d}.png".format(i) for i in range(im1.getDepth()) ]
3 write(im1, fileNames)