importFromTif

importFromTif


Imports imaging data from .TIF files.

Description


This function imports imaging data stored in a multi-frame .TIF file and saves in a .dat file to be used in umIToolbox. The function reads all valid .TIF files (see section below) inside a folder (RawFolder) and saves the output files (to a SaveFolder). This function has optional parameters that allows one to perform spatial and temporal binning to the data.

Input data format


Here are the properties of a valid .TIF file:

  • be an image time series with dimensions Y,X,T(ime) from a single channel
  • contain pixel values encoded as one of the following data types:
    • uint8
    • uint16
    • uint32
  • have a .txt file with the same name as the .TIF file located in the folder which contains meta data about the recording (see section below)

The meta data text file

In order to import the data from the .TIF file(s), this function uses some information stored in a text file with the same name of the associated .TIF file. For example, the file fluo.tif should have the file fluo.txtin the same folder. A template of the file is located in umIT's folder as '.\Analysis\Tiff_data_import_info_template.txt'. Otherwise, copy the template below and save it to a .txt file:

Template of text file for .TIF file meta data:

Scan info
DateTime: yyyymmdd_HHMMSS
FrameRateHz: 30.000000
ExposureMsec: 0.100000
Illumination1: <CHANNEL_NAME>

The parameters are the following:

  • DateTime: recording timestamp (start) in the format yyyymmdd_HHMMSS (e.g. 20220101_120510 for a recording that started January 1st 2022 at 12:05:10)

    Note
    This parameter is optional.

  • FrameRateHz: (float) recording frame rate (in Hertz)
  • ExposureMsec: (float) illumination exposure (in milliseconds)
  • Illumination1: (char) name of the imaging channel

Important
Use the template as show and change only the values (after the ": "). Do not change the names of the parameters from the text file! Otherwise, the function will fail.

Output


A .dat file will be created and stored in the SaveFolder with the channel name (located in the Illumination1 parameter from the metadata text file). For example, for the .TIF file img_fluo.tif with the text file img_fluo.txt containing the information below, the resulting output will be a .dat file named fluo.dat.

Scan info
DateTime: 20220101_120510
FrameRateHz: 30
ExposureMsec: 0.1
Illumination1: fluo

Parameters


The parameters of this function are the following:

Performs binning on each frame of the imported channels using a bicubic interpolation. The BinningSpatial values represent the scale factor that a frame is divided by. For example, for a recording with original frame size of 1024 by 1024 pixels, a BinningSpatial value of 2 will result in a frame of size 512 by 512 pixels.
A BinningSpatial value of 1 equals to no binning.

Performs binning across frames (i.e. over the time dimension) using a linear interpolation. The BinningTemp values represent the scale factor for the temporal dimension of a recording. For example, for a recording with original frame rate of 10Hz, a BinningTemp value of 2 will reduce the number of frames in half, resulting in a frame rate of 5Hz.
A BinningSpatial value of 1 equals to no binning.


Back to top

Copyright © LabeoTech 2024. This work is licensed under the GNU General Public License, Version 3.0.