You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+66-8Lines changed: 66 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,22 +11,50 @@ This repository contains code for the automatic segmentation of tree lumen and m
11
11
All images used in this tutorial are licensed under **CC-BY**. If any of the instructions are not working, please [open an issue](https://github.com/ai4life-opencalls/oc_3_project_17/issues) or contact us at [ai4life@fht.org](ai4life@fht.org)!
12
12
13
13
## Introduction
14
-
The project focuses on ...
14
+
This project investigates differences in wood quality among trees from the Boubín Forest nature reserve, the largest indigenous forest in Central Europe. The forest has been significantly affected by windstorm disturbances in 1868 and 2017.
15
+
Wood samples from trees aged 300–400 years provide an opportunity to investigate potential changes in wood anatomy associated with these events.
_Figure 1: Wood sample illustrating earlywood cells (orange region) and latewood cells (red region) and annual tree rings (green lines). Samples were cut into 10 cm sticks, stained with Safranin, dehydrated, and imaged with a Zeiss confocal microscope._
20
+
21
+
In general, the software [ROXAS](https://www.quantitative-plant.org/software/roxas) is commonly used for wood cell analysis. However, in this study a new sample preparation method based on Safranin staining was applied, which significantly reduced preparation time. Safranin reacts with cellulose and alters the coloration of anatomical structures in the images, making them incompatible with the ROXAS software. Therefore, a new analysis solution had to be developed.
22
+
23
+
To investigate changes in wood anatomy, annual tree rings are first detected to assign wood cells to the correct year. Within each tree ring, individual wood cells are then identified. For each cell, the lumen and cell wall are distinguished, and the average wall thickness and lumen area are measured.
17
24
18
25
## Installation
26
+
For the analysis, two types of programs were developed: a FIJI macro and a Python Jupyter Notebook.
27
+
28
+
### 1. FIJI macro
29
+
30
+
Install FIJI:
31
+
32
+
1. Go to the official FIJI website: [https://imagej.net/software/fiji/downloads](https://imagej.net/software/fiji/downloads).
33
+
2. Download the installer or ZIP file for your operating system (Windows, macOS, or Linux).
34
+
3. Unzip the downloaded archive to a folder on your computer.
35
+
36
+
⚠️ Avoid installing FIJI in C:\Program Files to prevent permission issues.
37
+
38
+
Run the FIJI macro:
39
+
40
+
1. Download the FIJI macro file.
41
+
2. Move the macro file into the FIJI plugins directory, e.g.: Fiji.app/plugins/
42
+
3. Start FIJI.
43
+
4. Run the macro via:
44
+
Plugins → FIJI preprocessing
45
+
46
+
### 2. Python (Jupyter Notebook)
19
47
20
48
Install the [conda](https://conda.io) package, dependency and environment manager.
21
49
22
50
You can download this repository from the green `Code` button → download ZIP, or clone through the command line with
This FIJI macro performs automated preprocessing and segmentation of confocal microscopy images of wood samples stained with Safranin. The goal is to identify healthy wood regions, segment cell lumina and cell walls, and produce cell-level masks suitable for downstream quantitative analysis.
77
+
78
+
Main processing steps:
79
+
1.**Image loading**: Images are imported using the Bio-Formats Importer to ensure compatibility with microscopy file formats.
80
+
2.**Image preprocessing**:
81
+
* Contrast enhancement with controlled saturation.
82
+
* Gaussian blurring to reduce noise.
83
+
* CLAHE (Contrast Limited Adaptive Histogram Equalization) preprocessing to improve local contrast.
84
+
3.**Detection of healthy wood regions**: Dark background regions are removed using background subtraction and global thresholding. Morphological operations (erosion/dilation) are applied to clean the mask. Small objects are excluded to retain only continuous, well-preserved wood tissue.
85
+
4.**Lumen segmentation**: Local thresholding (Sauvola method) is applied to detect cell lumina. The segmentation is restricted to the previously detected wood region. Morphological cleanup removes artifacts and fills holes.
86
+
5.**Detection of elongated cells**: Shape descriptors (area and aspect ratio) are used to identify elongated cells. Only cells exceeding a defined aspect-ratio threshold are retained.
87
+
6.**Cell segmentation using watershed**: A distance transform is computed from the lumen segmentation. Classical watershed segmentation is applied to separate touching cells. Very small, very large, or irregular regions are filtered out.
88
+
7.**Cell wall segmentation**: Cell wall regions are derived by combining lumen and watershed segmentations. Binary wall masks are generated and refined.
89
+
8.**Visualization outputs**: For quality control and inspection, the macro generates transparent overlays showing wood mask, lumen segmentation, cell segmentation and cell wall segmentation on the original image.
_Figure 4: Cell wall and cell lumen borders overlaid on the original image._
102
+
45
103
46
104
## Acknowledgements
47
105
AI4Life has received funding from the European Union’s Horizon Europe research and innovation programme under grant agreement number 101057970. Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Research Council Executive Agency. Neither the European Union nor the granting authority can be held responsible for them.
0 commit comments