SMIL  0.10.3
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

BaseImagecreateFromFile (const char *filename)
 createFromFile TBD
 
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)
 Get information about file. More...
 
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)
 
 IMAGEFILEHANDLER_TEMP_SPEC (BMP, UINT8)
 
 IMAGEFILEHANDLER_TEMP_SPEC (BMP, RGB)
 
 IMAGEFILEHANDLER_TEMP_SPEC (TIFF, UINT8)
 
 IMAGEFILEHANDLER_TEMP_SPEC (JPG, RGB)
 
 IMAGEFILEHANDLER_TEMP_SPEC (TIFF, UINT16)
 
 IMAGEFILEHANDLER_TEMP_SPEC (TIFF, RGB)
 
 IMAGEFILEHANDLER_TEMP_SPEC (PNG, UINT8)
 
 IMAGEFILEHANDLER_TEMP_SPEC (PNG, UINT16)
 
 IMAGEFILEHANDLER_TEMP_SPEC (PNG, RGB)
 
 IMAGEFILEHANDLER_TEMP_SPEC (PGM, UINT8)
 
 IMAGEFILEHANDLER_TEMP_SPEC (PGM, RGB)
 
template<class T >
RES_T read (const char *filename, Image< T > &image)
 Read image file. More...
 
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)
 
template<class T >
RES_T write (const Image< T > &image, const char *filename)
 Write image file. More...
 
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

◆ getFileInfo()

RES_T getFileInfo ( const char *  filename,
ImageFileInfo fInfo 
)

Get information about file.

Parameters
[in]filename:
[out]fInfo:

◆ read() [1/2]

RES_T read ( const char *  filename,
Image< T > &  image 
)

Read image file.

Parameters
[in]filename: filename (with path) to read
[out]image: output image

◆ read() [2/2]

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

Read a stack of 2D images.

Read a stack of 2D images and convert then into a 3D image.

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

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

Parameters
[in]fileList: list of 2D image files to read
[out]image: output image

◆ write() [1/2]

RES_T write ( const Image< T > &  image,
const char *  filename 
)

Write image file.

Parameters
[in]image: image to write to file
[in]filename: file name

◆ write() [2/2]

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

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

Write 3D image into a stack of 2D image files.

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

Example:

im1 = Image("img3d.vtk")
fileNames = [ "img{:03d}.png".format(i) for i in range(im1.getDepth()) ]
write(im1, fileNames)
Parameters
[in]image: image to write to file
[in]fileList: list of filenames.