Table of contents

Pipeline to detect, orient and measure sepals. The pipeline is based on different type of scripts that we developed and can be found in this repository.
- image type transformations are done with ImageJ macros
- python scripts making use of MorphoGraphX
- python scripts that make use of TimageTk

1. Preliminaries

You will need to change different image file formats to .tif format. For this purpose, you have suitable ImageJ macros in this repository's bin/ImageJ folder : lif2tif, lsm2tif, inr2tif, tif2tif. Their usage is the same. Lounch the macro and select the directory, where the files to transform are ; a new directory with the output tif files is created.

Recall how to install a macro in ImageJ: Plugins → Macros → Install → macroname.ijm

2. Normalise images

usage: normalise.py imagefolder 30

positional arguments:
    imagefolder  folder containing the images to normalise (.tif format)
    30           common Otsu value

3. Detect the contour

Use the MGX_EdgeDetect.py script on MorphoGraphX:
- open the script file with a texteditor;
- put the path to the directory of grey sepal images (line 13)
- save the script file
- drag and drop the script file on the MorphoGraphX black window

Remark:
Before you lounch the scrcipt the first time in a session, you need to do some clicks on MorphoGraphX:
-> Process -> System -> set current stack -> Both + double click on Set current stack

4. Orient sepals

cd in the folder containing the contours folder and type

usage: orient_sepals.sh contours filetype

positional arguments:
    contours     folder name containing the contours
    filetype     '.tif' or '.inr.gz'

the oriented sepals are written in the "contours_oriented" folder

5. Do measurements

5.1. All but area measurements

detected contours are in the folder « contours »
cd in the folder containing the oriented contours and type

usage: measure_sepals.py foldername filetype

positional arguments:
    foldername     folder name containing the oriented contours
    filetype       '.tif' or '.inr.gz'

the measurements are written in the "foldername_measures.csv" file

5.2. Area measurements

Use the MGX_CurvatureMapSegmentation.py script on MorphoGraphX:
- open the script file with a texteditor;
- put the path to the directory of sepal contours (line 13)
- save the script file
- drag and drop the script file on the MorphoGraphX black window

The segmented meshes (abaxial and adaxial surfaces are treated as cells) as well as one csv file per sepal containing the surface areas are saved.

5.3. Gather all geometrical measurements in one file

usage: gather_data.py measures_filename areadir

positional arguments:
    measures_filename     the outputfile at 5.1
    areadir               directory with area measurement outputs (output of 5.2)