Wiki

Version 41 (Annamaria Kiss, 18/05/2022 15:13)

1 18 Annamaria Kiss
*Table of contents*
2 17 Annamaria Kiss
3 17 Annamaria Kiss
{{TOC}}
4 17 Annamaria Kiss
5 5 Annamaria Kiss
6 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.
7 37 Annamaria Kiss
- image type transformations are done with "ImageJ":https://imagej.net/Welcome macros
8 37 Annamaria Kiss
- python scripts making use of "MorphoGraphX":https://morphographx.org/
9 37 Annamaria Kiss
- python scripts that make use of "TimageTk":https://mosaic.gitlabpages.inria.fr/timagetk/
10 1 Annamaria Kiss
11 30 Annamaria Kiss
h2. 1. Preliminaries
12 20 Annamaria Kiss
13 30 Annamaria Kiss
You will need to *change different image file formats to .tif format*. To achieve this, you have suitable ImageJ macros in this repository's _bin/ImageJ_ folder : lif2tif, lsm2tif, inr2tif, tif2tif.
14 20 Annamaria Kiss
15 27 Annamaria Kiss
*Install the macro*: ImageJ → Plugins → Macros → Install → macroname.ijm
16 20 Annamaria Kiss
17 27 Annamaria Kiss
*Usage*: 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.
18 1 Annamaria Kiss
19 14 Annamaria Kiss
h2. 2. Normalise images
20 10 Annamaria Kiss
21 28 Annamaria Kiss
<pre> normalise.py imagefolder 30 </pre>
22 28 Annamaria Kiss
imagefolder=folder containing the images to normalise (.tif format)
23 11 Annamaria Kiss
30=common Otsu value
24 1 Annamaria Kiss
25 19 Annamaria Kiss
h2. 3. Detect the contour
26 1 Annamaria Kiss
27 15 Annamaria Kiss
The followings are different possibilities. Choose your favorite detection method and apply it on your normalised images.
28 12 Annamaria Kiss
29 19 Annamaria Kiss
h3. 3.1. By a threshold
30 2 Annamaria Kiss
31 19 Annamaria Kiss
h3. 3.2. Using the EdgeDetect of MorphoGraphX (mgx)
32 1 Annamaria Kiss
33 31 Annamaria Kiss
Use the MGX_EdgeDetect.py script on MorphoGraphX:
34 31 Annamaria Kiss
- open the script file with a texteditor;
35 31 Annamaria Kiss
- put the path to the directory of grey sepal images (line 13)
36 31 Annamaria Kiss
- save the script file
37 31 Annamaria Kiss
- drag and drop the script file on the MorphoGraphX black window
38 31 Annamaria Kiss
39 39 Annamaria Kiss
*Remark:*
40 40 Annamaria Kiss
Before you lounch the scrcipt the first time in a session, you need to do a clicks on MorphographX:
41 39 Annamaria Kiss
-> Process -> System -> set current stack -> Both + double click on Set current stack
42 31 Annamaria Kiss
43 19 Annamaria Kiss
h3. 3.3. By the level set method (lsm)
44 3 Annamaria Kiss
45 1 Annamaria Kiss
cd in the directory with the smoothed tif files
46 1 Annamaria Kiss
<pre>
47 8 Annamaria Kiss
lsm-contour_mp.py imagefolder
48 1 Annamaria Kiss
</pre>
49 6 Annamaria Kiss
50 19 Annamaria Kiss
h3. 3.4. Lounch lsm on an already prepared initial contour (mgx for instance)
51 1 Annamaria Kiss
52 1 Annamaria Kiss
cd the directory, which contains a directory of (normalised and smoothed) images and another with the initial contours (same filename cooresponding to the same image)
53 1 Annamaria Kiss
<pre>
54 1 Annamaria Kiss
lsm-contour_mp-from-init.py imagefolder initcontourfolder
55 1 Annamaria Kiss
</pre>
56 1 Annamaria Kiss
detected contours are written in the folder « contours »
57 1 Annamaria Kiss
58 19 Annamaria Kiss
h2. 4. Orient sepals
59 1 Annamaria Kiss
60 1 Annamaria Kiss
cd in the folder containing the contours folder and type
61 1 Annamaria Kiss
<pre>orient_sepals.sh contours filetype</pre>
62 1 Annamaria Kiss
contours = folder name containing the contours
63 1 Annamaria Kiss
filetype = '.tif' or '.inr.gz'
64 1 Annamaria Kiss
the oriented sepals are written in the "contours_oriented" folder
65 1 Annamaria Kiss
66 19 Annamaria Kiss
h2. 5. Do measurements
67 1 Annamaria Kiss
68 32 Annamaria Kiss
h3. 5.1. All but area measurements
69 32 Annamaria Kiss
70 1 Annamaria Kiss
detected contours are in the folder « contours »
71 7 Annamaria Kiss
cd in the folder containing the oriented contours and type
72 1 Annamaria Kiss
<pre>measure_sepals.py foldername filetype</pre>
73 1 Annamaria Kiss
foldername = folder name containing the oriented contours
74 1 Annamaria Kiss
filetype = '.tif' or '.inr.gz'
75 1 Annamaria Kiss
the measurements are written in the "foldername_measures.csv" file
76 32 Annamaria Kiss
77 32 Annamaria Kiss
h3. 5.2. Area measurements
78 32 Annamaria Kiss
79 32 Annamaria Kiss
Use the MGX_CurvatureMapSegmentation.py script on MorphoGraphX:
80 32 Annamaria Kiss
- open the script file with a texteditor;
81 32 Annamaria Kiss
- put the path to the directory of sepal contours (line 13)
82 32 Annamaria Kiss
- save the script file
83 32 Annamaria Kiss
- drag and drop the script file on the MorphoGraphX black window
84 32 Annamaria Kiss
85 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.