-
Notifications
You must be signed in to change notification settings - Fork 1
Image
Image class is the responsible of handling image files. According to the file extension it selects the specific algorithm for each format and then, It read the header. Finally, Image data is set into a MultidimArray. Image is a template class (i.e. its datatype is decided by the programmer). Therefore, if a Image<char> is used to read from a file whose datatype is, let say, float, then bytes are truncated for each pixel with an information loss.
The simplest way of reading an image is:
although the read method allows different special cases as follows:
It is possible to read only the values of the image file header. The information read is: image dimensions, data type, offset and bit order
Image img; img.read('filename.ext', HEADER); ArrayDim aDim; DataType datatype; img.getDimensions(aDim); datatype = img.datatype();
Reading independent images in a stack can be done in two ways: adding a prefix number to the filename separated by @,
or passing the selected image number as argument,