A comparative assessment of various image analysis workflows to provide a fast, accurate and objective intramuscular fat quantification of H&E stained tissue sections. To learn about JIPipe read the according paper and to learn more about the evaluation read the paper.
If you used IMFSegNet for intramuscular fat segmentation cite the paper:
Praetorius, J.-P., Walluks, K., Svensson, C.-M., Arnold, D., Figge M.T. (2023). IMFSegNet: Cost-effective and objective quantification of intramuscular fat in histological sections by deep learning. Publication in progress.
# InstallationTo compare the image analysis workflows the following dependencies need to be installed:
- JIPipe (only for Linux, take: "python-cellpose-gpu") (version 1.74)
- scikit-learn for k-means clustering (version 1.0.2)
- ilastik (version 1.3.3)
- Cellpose (version 0.7.3)
- python (version 3.7)
- python libraries (here provided with a anaconda file) with tensorflow-gpu (version 2.5.1) (see the next point)
Use the terminal or an Anaconda Prompt for the following steps:
-
Create the environment from the
sheepfat/sheepfat_env.yml
file:conda env create -f sheepfat/sheepfat_env.yml
The first line of the
yml
file sets the new environment's name. For details see Creating an environment file manually. -
Activate the new environment:
conda activate sheepfat
-
Verify that the new environment was installed correctly:
conda env list
You can also use conda info --envs
.
To get JIPipe running inside Fiji follow these steps:
- Open this link from the paper and download the required JIPipe plugin from the
/model/JIPipe/JIPipe-1.74.0/
directory - Download Fiji and copy the JIPipe plugin to
/Fiji.app/plugins/
- Start Fiji, search for
JIPipe
and run it - Open the file
/SheepFat.jip
as project from the main directory - Copy the required anaconda environment from the link
/model/JIPipe/python-cellpose-gpu/
to the/Fiji.app/jipipe/
directory - Configure the prepackaged from 5. in JIPipe in order to navigate to
/Project/Application settings/Extensions/Python integration/
and specify the according path at the/Python environment/
In case you want to start the k-means clustering or the IMFSegNet manual follow these steps:
-
Activate the new environment:
conda activate sheepfat
-
Verify that the new environment was installed correctly:
conda env list
-
Start a jupyter lab or notebook with
jupyter lab
-
Run the notebooks
SheepFat_2_SegNetSegmentation
to use the SegNet andSheepFat_3_kmeansSegmentation
to make use of the k-means based clustering workflowAlternatively you can start the python scripts of the SegNet cross-validation and the IMFSegNet in the terminal as follows:
-
For the training of the SegNet cross-validation, run
python ./examples/KW/model_0_KW.py
and adjust the corresponding k-fold in the python script at the
model_id
variable, also specify the corresponding directory paths in the script. -
For the training of the so called IMFSegNet, which takes all images into account, run
python ./examples/KW/model_all_KW.py
and specify the corresponding directory paths in the script.
-
For the prediction using the SegNet cross-validation, run
python ./examples/KW/prediction_kfold.py
and adjust the corresponding k-fold in the python script at the
model_id
variable, also specify the corresponding directory paths in the script. -
For the prediction of the so called IMFSegNet run
python ./examples/KW/prediction_all.py
and specify the corresponding directory paths in the script.
This option can also be used to detect intramuscular fat as accurately as possible in H&E stained tissue sections that are not included in this study (see
/data/images/KW/H&E/inputs/
, first unzip the corresponding directories)
-