ALBULA  4.0.1
 All Classes Namespaces Functions Variables Pages
dectris.albula.DImageWriter Class Reference

class DImageWriter writes DImage objects to files. More...

Public Member Functions

def DImageWriter
 Construct a DImageWriter object. More...
 
def fileName
 Return the path to the file where to write to. More...
 
def setFileName
 Set the path to the file where to write to. More...
 
def format
 Return the image format. More...
 
def setFormat
 Set the image format. More...
 
def write
 Write image to fileName() with the given format. More...
 

Static Public Member Functions

def write
 Static convenience function: write image directly to a file given file name and format. More...
 

Detailed Description

class DImageWriter writes DImage objects to files.

The written header is based on DImage::optionalData(). In particular all variables DImageOptionalData, that can be accessed via convenience functions will be written to the DECTRIS mini header (See www.dectris.com for details about the DECTRIS mini header). If DImageOptionalData::rawHeader() is consistent, the header of the written file is based on it. Possible file formats are "cbf" and "tif". They are determined either by the filename suffix or by the format string passed as format argument to the constructor or to write(). Float images may be written to tif files only. If format is "cbf" float images are casted to integer images before they are written.

Constructor & Destructor Documentation

def dectris.albula.DImageWriter.DImageWriter (   fileName,
  format = None 
)

Construct a DImageWriter object.

Parameters
fileNameString type argument that denotes the file where write() writes to.
formatFormat string. Either None, or "cbf" or "tif". If None format is determined by the suffix of fileName.

Member Function Documentation

def dectris.albula.DImageWriter.fileName ( )

Return the path to the file where to write to.

def dectris.albula.DImageWriter.format ( )

Return the image format.

def dectris.albula.DImageWriter.setFileName (   fileName)

Set the path to the file where to write to.

Parameters
fileNameString type argument that denotes the file where write() writes to.
def dectris.albula.DImageWriter.setFormat (   format)

Set the image format.

Parameters
formatFormat string. Either "cbf" or "tif".
def dectris.albula.DImageWriter.write (   image)

Write image to fileName() with the given format.

Eventually throws an DException.

Parameters
imageDImage.
def dectris.albula.DImageWriter.write (   image,
  fileName,
  format = None 
)
static

Static convenience function: write image directly to a file given file name and format.

If format is None try to figure out the format from the file ending.

Parameters
imageDImage.
fileNameString type argument that denotes the file where write() writes to.
formatFormat string. Either None, or "cbf" or "tif". If None format is determined by the suffix of fileName.