Skip to content

New Feature: Importing directly *.tiff files

Christian Trageser requested to merge tiff_importer into main

With this MR OpenHKL gain the ability of directly importing *.tif/tiff files instead of the arbitrary raw format.

Center piece of this is the new class TiffDataReader which has been designed linear to RawDataReader in function. It uses the LibTiff (already existing dep) for reading tags and pixel information from tiff files and delivers it to the same interface used with RawDataReader.

A number of meta information (tif tags) are read from the tif files and automatically set to internal variables like TIFFTAG_IMAGEWIDTH (picture width), TIFFTAG_IMAGELENGTH (picture height), TIFFTAG_BITSPERSAMPLE (bps), TIFFTAG_COMPRESSION (compressed tiff files are not currently supported), TIFFTAG_PLANARCONFIG ( Only PLANARCONFIG_CONTIG tiff are support currently), TIFFTAG_PHOTOMETRIC (we only support black/white colored files).

The individual file dimensions are now stored as meta data and saved into the project file.

For this feature to full make sense the BioDiff project has been changed and a new feature was introduced into the Instrument system. So far only one fixed resolution per instrument could be used and therefore BiodDiff had two Instrument option BioDIff2500 and 5000. Now One Instrument can offer up to three resolution and can be specified by the user in a new TiffDataReaderDialague. Therefore now there is only one BioDiff Instrument which offers three resolution 2500x900, 5000x1800 and 10kx3600. These dimensions are automatically detected when the files are imported. The user can then decided about the binning by choosing a target resolution to which the files are mapped to. Currenly there are not 10kx3600 BioDiff files. Additionaly the Import File Dialogue has been removed from no longer used gui elements (see figures 1 and 2)

The interface has been expanded by splitting the menu Data -> Add raw/tiff data to two options Data -> Add raw (for importing raw data) and a new Data -> Add tif (shortcut Ctrl+T).

Note: Because of time issues I had to combine many single changes into one commit regarding connecting the new class with gui interfaces and other classes

Figure 1: During the creation of a new Experiment now only one BioDIFF choice is available
image

Figure 2: The resolution for BioDiff is now set during TiffDataImportDialog with other informations
image image

Resolves #355 (closed) #541 (closed)

Edited by Christian Trageser

Merge request reports