Wiki

Version 47 (Annamaria Kiss, 18/05/2022 15:39)

1 18 Annamaria Kiss
*Table of contents*
2 17 Annamaria Kiss
3 17 Annamaria Kiss
{{TOC}}
4 17 Annamaria Kiss
5 38 Annamaria Kiss
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.
6 37 Annamaria Kiss
- image type transformations are done with "ImageJ":https://imagej.net/Welcome macros
7 37 Annamaria Kiss
- python scripts making use of "MorphoGraphX":https://morphographx.org/
8 37 Annamaria Kiss
- python scripts that make use of "TimageTk":https://mosaic.gitlabpages.inria.fr/timagetk/
9 1 Annamaria Kiss
10 30 Annamaria Kiss
h2. 1. Preliminaries
11 1 Annamaria Kiss
12 46 Annamaria Kiss
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.
13 20 Annamaria Kiss
14 46 Annamaria Kiss
Recall how to install a macro in ImageJ: Plugins → Macros → Install → macroname.ijm
15 20 Annamaria Kiss
16 46 Annamaria Kiss
17 1 Annamaria Kiss
18 14 Annamaria Kiss
h2. 2. Normalise images
19 10 Annamaria Kiss
20 47 Annamaria Kiss
<pre> usage: normalise.py imagefolder 30
21 47 Annamaria Kiss
positional arguments:
22 47 Annamaria Kiss
    imagefolder  folder containing the images to normalise (.tif format)
23 47 Annamaria Kiss
    30           common Otsu value
24 47 Annamaria Kiss
</pre>
25 1 Annamaria Kiss
26 19 Annamaria Kiss
h2. 3. Detect the contour
27 1 Annamaria Kiss
28 31 Annamaria Kiss
Use the MGX_EdgeDetect.py script on MorphoGraphX:
29 31 Annamaria Kiss
- open the script file with a texteditor;
30 31 Annamaria Kiss
- put the path to the directory of grey sepal images (line 13)
31 31 Annamaria Kiss
- save the script file
32 31 Annamaria Kiss
- drag and drop the script file on the MorphoGraphX black window
33 31 Annamaria Kiss
34 39 Annamaria Kiss
*Remark:*
35 40 Annamaria Kiss
Before you lounch the scrcipt the first time in a session, you need to do a clicks on MorphographX:
36 39 Annamaria Kiss
-> Process -> System -> set current stack -> Both + double click on Set current stack
37 31 Annamaria Kiss
38 1 Annamaria Kiss
39 19 Annamaria Kiss
h2. 4. Orient sepals
40 1 Annamaria Kiss
41 1 Annamaria Kiss
cd in the folder containing the contours folder and type
42 1 Annamaria Kiss
<pre>orient_sepals.sh contours filetype</pre>
43 1 Annamaria Kiss
contours = folder name containing the contours
44 1 Annamaria Kiss
filetype = '.tif' or '.inr.gz'
45 1 Annamaria Kiss
the oriented sepals are written in the "contours_oriented" folder
46 1 Annamaria Kiss
47 19 Annamaria Kiss
h2. 5. Do measurements
48 1 Annamaria Kiss
49 32 Annamaria Kiss
h3. 5.1. All but area measurements
50 32 Annamaria Kiss
51 1 Annamaria Kiss
detected contours are in the folder « contours »
52 7 Annamaria Kiss
cd in the folder containing the oriented contours and type
53 1 Annamaria Kiss
<pre>measure_sepals.py foldername filetype</pre>
54 1 Annamaria Kiss
foldername = folder name containing the oriented contours
55 1 Annamaria Kiss
filetype = '.tif' or '.inr.gz'
56 1 Annamaria Kiss
the measurements are written in the "foldername_measures.csv" file
57 32 Annamaria Kiss
58 32 Annamaria Kiss
h3. 5.2. Area measurements
59 32 Annamaria Kiss
60 32 Annamaria Kiss
Use the MGX_CurvatureMapSegmentation.py script on MorphoGraphX:
61 32 Annamaria Kiss
- open the script file with a texteditor;
62 32 Annamaria Kiss
- put the path to the directory of sepal contours (line 13)
63 32 Annamaria Kiss
- save the script file
64 32 Annamaria Kiss
- drag and drop the script file on the MorphoGraphX black window
65 32 Annamaria Kiss
66 34 Annamaria Kiss
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.