How to add modules for segmentation to VIEW - galizia-lab/pyview GitHub Wiki

A segmentation module essentially reads data and identifies pixels that belong to neural units. VIEW expects this information to be in ".roi.tif" files within the folder pointed to by the flags "STG_OdormaskPath" (E.g.: coor, 05_COOR). This tif file should have the same file name as the animal. For example, if your list file is called "animal1.lst" or "animal1.lst.xlsx", then the tif file should have the name "animal1.roi.tif".

Every ".roi.tif" file is expected be a standard 2D or 3D Tiff file with pixel value 1 for pixels belonging to neural units and 0 otherwise. The last two dimensions of the tiff file represent Y and X dimensions respectively. A 3D tiff file would contain information of more than one component, i.e., have information of one component per tiff page. Additionally, this TIFF file can have a "description" containing component labels. This can be added to the tiff file for example using the the keyword argument "description" of the function "imwrite" of the package "tifffile". The recommended way of creating such a tiff file is to use the function view.python_core.io.write_tif_2Dor3D (see doc string and code for more details). All ".roi.tif" files are internally read using the function "view.python_core.io.read_tif_2Dor3D".