3D deep learning MONAI segmentation pipelines for fetal MRI
2.3K
Note: all segmentation script were combined now with the main reconstruction docker:
For the source code and instructions please go to https://github.com/SVRTK/auto-proc-svrtk
This docker repository contains a set of scripts for automated segmentation of fetal MRI.
The general SVRTK Segmentation docker repository was created by Dr Alena Uus (KCL).
For information about main authors for individual functions - please see the description below.
In case of any general questions please contact : alena.uus(at)kcl.ac.uk
An automated pipeline for fetal brain tissue segmentation (19 ROIs) for 3D SVR-reconstructed fetal brain MRI based on MONAI.
The brain segmentation functions and models were created by Dr Alena Uus.
The source code is available at: https://github.com/SVRTK/auto-proc-svrtk
Uus, A. U., Kyriakopoulou, V., Makropoulos, A., Fukami-Gartner, A., Cromb, D., Davidson, A., Cordero-Grande, L., Price, A. N., Grigorescu, I., Williams, L. Z. J., Robinson, E. C., Lloyd, D., Pushparajah, K., Story, L., Hutter, J., Counsell, S. J., Edwards, A. D., Rutherford, M. A., Hajnal, J. V., Deprez, M. (2023) BOUNTI: Brain vOlumetry and aUtomated parcellatioN for 3D feTal MRI. eLife 12:RP88818; doi: https://doi.org/10.7554/eLife.88818.1

Please note that the network was trained on SS TSE 3D SVR reconstructed brain images.
The conditions for successful performance are (it won't work otherwise):
Pull the docker image:
docker pull fetalsvrtk/segmentation:general_auto_amd
Run the docker mounted to the folder with .nii.gz or .dcm files for processing (CPU version is operational on MAC OS, Linux and Windows):
docker run -it --rm --mount type=bind,source=location_on_your_machine,target=/home/data fetalsvrtk/segmentation:general_auto_amd /bin/bash
Please note that since the docker is CPU-based (all segmentation networks are CPU-based) - on average we do not recommend processing > 1-2 cases at once (unless it is a server machine).
Taking into account the large network size the pipeline normally requires > 20GB RAM allocated to the docker (you can adjust it in the docker settings) - otherwise segmentation will fail.
Run 3D CNN BOUNTI pipeline for 3D fetal brain tissue segmentation.
You need to pass the location of the folder with .nii (or .dcm) 3D SVR files to the following script:
bash /home/auto-proc-svrtk/sctipts/auto-brain-bounti-segmentation-fetal.sh /home/data/your_folder_with_brain_svr_t2_files /home/data/output_folder_for_segmentations
If required, run 3D CNN BET pipeline for 3D fetal brain extraction separately.
bash /home/auto-proc-svrtk/sctipts/auto-brain-bet-segmentation-fetal.sh /home/data/your_folder_with_brain_svr_t2_files /home/data/output_folder_for_segmentations
The resulting segmentations of the brain will be in output_folder_for_segmentations folder. In case if your input files are in .dcm format - they will be converted to .nii.gz directly in your_folder_with_brain_svr_t2_files folder.
An automated pipeline for fetal body organ segmentation (10 ROIs) for 3D DSVR-reconstructed fetal body MRI based on MONAI.
The brain segmentation functions and models were created by Dr Alena Uus.
The source code is available at: https://github.com/SVRTK/auto-proc-svrtk
Uus, A. U., Hall, M., Grigorescu, I., Avena Zampieri, C., Egloff Collado, A., Payette, K., Matthew, J., Kyriakopoulou, V., Hajnal, J. V., Hutter, J., Rutherford, M. A., Deprez, M., Story, L. (2024) Automated body organ segmentation, volumetry and population-averaged atlas for 3D motion-corrected T2-weighted fetal body MRI. Sci Rep 14, 6637; doi: https://doi.org/10.1038/s41598-024-57087-x
The conditions for successful performance are (it won't work otherwise):
bash /home/auto-proc-svrtk/sctipts/auto-body-organ-segmentation.sh /home/data/your_folder_with_body_dsvr_t2_files /home/data/output_folder_for_segmentations
An automated pipeline for fetal face / head surface segmentation (1 ROI) for 3D SVR-reconstructed fetal head MRI based on MONAI.
The brain segmentation functions and models were created by Dr Alena Uus.
The source code is available at: https://github.com/SVRTK/auto-proc-svrtk
Matthew, J., Uus, A., de Souza, L., Wright, R., Fukami-Gartner, A., Priego, G., Saija, C., Deprez, M., Collado, A. E., Hutter, J., Story, L., Malamateniou, C., Rhode, K., Hajnal, J., & Rutherford, M. A. (2024). Craniofacial phenotyping with fetal MRI: a feasibility study of 3D visualisation, segmentation, surface-rendered and physical models. BMC Medical Imaging, 24(1), 52. https://doi.org/10.1186/s12880-024-01230-7
The conditions for successful performance are (it won't work otherwise):
bash /home/auto-proc-svrtk/sctipts/auto-face-segmentation.sh /home/data/your_folder_with_head_svr_t2_files /home/data/output_folder_for_segmentations
A practical solution for 3D UNet segmentation of multiple BTFE / TRUFI images for the total fetal body (and placenta) volume estimation.
Whole body BTFE segmentation functions and models were created by Dr Alena Uus.

Pull the docker image:
docker pull fetalsvrtk/segmentation:btfe_whole_body
Run the docker mounted to the folder with .nii.gz or .dcm files for processing (CPU version is operational on MAC OS, Linux and Windows):
docker run -it --rm --mount type=bind,source=location_on_your_machine,target=/home/data fetalsvrtk/segmentation:btfe_whole_body /bin/bash
Please note that if you are using the CPU version - the processing time will be slower. On average we do not recommend processing > 50 stacks at once.
Run 3D UNet segmentation for the whole fetal body and placenta (structural BTFE MRI). You need to pass the location of the folder with .nii or .dcm BTFE files to the script.
docker-segmentation-btfe-whole-body.bash /home/data/your_folder_with_whole_uterus_btfe_files
The resulting segmentations of the fetus and placenta will be in your_folder_with_whole_uterus_btfe_files/segmentations folder. The input files will be moved to your_folder_with_whole_uterus_btfe_files/inputs folder.
NOTE: for extreme motion cases with interleaved slice acquisition (2 packages per stack) - you can use "docker-segmentation-btfe-whole-body-packages.bash" instead (it spits stacks into packages):
docker-segmentation-btfe-whole-body-packages.bash /home/data/your_folder_with_whole_uterus_btfe_files
The package images will be stored as *-p0.nii.gz and *-p1.nii.gz in the "inputs" along with the corresponding output segmentations in "segmentations" folder.
MASC is authored by Paula Ramirez Gilliland.
MASC is a Pytorch and MONAI (https://monai.io/) based multi-task framework for multi-class segmentation and classification in fetal cardiac aortic arch anomalies. The default architectures are Attention U-Net for segmentation and DenseNet121 for classification.

Our networks are trained on 3D T2w reconstructions of fetal cardiac MRI, cropped to the fetal thorax. It is only trained on the following anomalies: suspected Coarctation of the Aorta (CoA), Right Aortic Arch (RAA) with Aberrant left subclavian artery, and Double Aortic Arch (DAA). The predicted diagnosis class is one of CoA, RAA or DAA.
To run it:
docker pull fetalsvrtk/segmentation:svr_heart_vessels_3.00
docker run -it --rm --mount type=bind,source=location_on_your_machine,target=/home/data fetalsvrtk/segmentation: svr_heart_vessels_3.00/bin/bash
bash /home/auto-seg-heart/auto-masc.sh /home/data/ your_folder_with_brain_svr_t2_files /home/data/output_folder_for_segmentations
AutoCoA is authored by Paula Ramirez Gilliland.
Automatic segmentation strategy used for deriving a Coarctation of the Aorta risk score from 3D T2w fetal CMR. See Fig. below for segmentation protocol.
"Ramirez, P., Hermida, U., Uus, A., van Poppel, M.P., Grigorescu, I., Steinweg, J.K., Lloyd, D.F., Pushparajah, K., de Vecchi, A., King, A. and Lamata, P., 2023, October. Towards Automatic Risk Prediction of Coarctation of the Aorta from Fetal CMR Using Atlas-Based Segmentation and Statistical Shape Modelling. In International Workshop on Preterm, Perinatal and Paediatric Image Analysis (pp. 53-63). Cham: Springer Nature Switzerland. (doi: 10.1007/978-3-031-45544-5_5)
To run:
Follow steps 1 and 2 from MASC. Subsequently, run aortic arch segmentation:
bash /home/auto-seg-heart/auto-coa.sh /home/data/ your_folder_with_brain_svr_t2_files /home/data/output_folder_for_segmentations
The SVRTK dockers are distributed under the terms of the GNU General Public License v3.0. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
In case you found SVRTK Fetal MRI Segmentation useful please give appropriate credit to the software by providing the corresponding link to our docker repository:
SVRTK toolbox for fetal MRI segmentation: https://hub.docker.com/r/fetalsvrtk/segmentation
AND:
"BOUNTI: Brain vOlumetry and aUtomated parcellatioN for 3D feTal MRI" Alena U. Uus, Vanessa Kyriakopoulou, Antonios Makropoulos, Abi Fukami-Gartner, Daniel Cromb, Alice Davidson, Lucilio Cordero-Grande, Anthony N. Price, Irina Grigorescu, Logan Z. J. Williams, Emma C. Robinson, David Lloyd, Kuberan Pushparajah, Lisa Story, Jana Hutter, Serena J. Counsell, A. David Edwards, Mary A. Rutherford, Joseph V. Hajnal, Maria Deprez; eLife12:RP88818; doi: https://doi.org/10.1101/2023.04.18.537347
For MASC and AutoCoA:
"Ramirez Gilliland, P., Uus, A., van Poppel, M.P., Grigorescu, I., Steinweg, J.K., Lloyd, D.F., Pushparajah, K., King, A.P. and Deprez, M., 2022, September. Automated Multi-class Fetal Cardiac Vessel Segmentation in Aortic Arch Anomalies Using T2-Weighted 3D Fetal MRI. In International Workshop on Preterm, Perinatal and Paediatric Image Analysis (pp. 82-93). Cham: Springer Nature Switzerland.
"Ramirez, P., Hermida, U., Uus, A., van Poppel, M.P., Grigorescu, I., Steinweg, J.K., Lloyd, D.F., Pushparajah, K., de Vecchi, A., King, A. and Lamata, P., 2023, October. Towards Automatic Risk Prediction of Coarctation of the Aorta from Fetal CMR Using Atlas-Based Segmentation and Statistical Shape Modelling. In International Workshop on Preterm, Perinatal and Paediatric Image Analysis (pp. 53-63). Cham: Springer Nature Switzerland.
Content type
Image
Digest
sha256:49c951d41…
Size
12.1 GB
Last updated
over 1 year ago
docker pull fetalsvrtk/segmentation:cortex_for_slava