Sign inSign up

fetalsvrtk/segmentation

By fetalsvrtk

•Updated over 1 year ago

3D deep learning MONAI segmentation pipelines for fetal MRI

Image
5

2.3K

fetalsvrtk/segmentation repository overview


Note: all segmentation script were combined now with the main reconstruction docker:

⁠https://hub.docker.com/r/fetalsvrtk/svrtk⁠

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



⁠OLD descriptions:


⁠BOUNTI: Brain vOlumetry and aUtomated parcellatioN for 3D feTal MRI (1.5/3T, SS TSE, TE=80-250ms):

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⁠

SVRTK_FETAL_MRI

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):

  1. good image quality (clear visibility of all features, high SNR and smooth texture (not grainy), no extreme bias field artifacts)
  2. reorientation to the standard radiological atlas space
  3. full brain coverage
  4. 21 - 36 week GA
  5. no extreme structural anomalies

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.

⁠Body organ segmentation for 3D fetal MRI (1.5/3T, SS TSE, TE=80-180ms):

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):

  1. good image quality (clear visibility of all features, high SNR and smooth texture (not grainy), no extreme bias field artifacts)
  2. reorientation to the standard radiological atlas space
  3. full body coverage
  4. no extreme structural anomalies
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

⁠Face / head segmentation for 3D fetal MRI (1.5/3T, SS TSE, TE=80-250ms):

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):

  1. good image quality (clear visibility of all features, high SNR and smooth texture (not grainy), no extreme bias field artifacts)
  2. reorientation to the standard radiological atlas space
  3. full head coverage (not masked)
  4. no extreme structural anomalies
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

⁠Whole fetal body segmentation for raw BTFE / TRUFI stacks:

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.

SVRTK_FETAL_MRI

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: Multi-task vessel Segmentation and diagnosis Classification for aortic arch anomalies (fetal cardiac MRI):

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.

MASC_FETAL_CARDIAC

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:

  1. Pull the docker image:
docker pull fetalsvrtk/segmentation:svr_heart_vessels_3.00
  1. 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: svr_heart_vessels_3.00/bin/bash
  1. Run 3D fetal cardiac vessel segmentation and classification:
bash /home/auto-seg-heart/auto-masc.sh /home/data/ your_folder_with_brain_svr_t2_files /home/data/output_folder_for_segmentations

⁠AutoCoA: Automatic aortic arch segmentation for Coarctation of the Aorta risk score prediction

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.

AUTOCOA_FETAL_CARDIAC

"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

⁠License:

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.

⁠Citation and acknowledgements:

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.

Tag summary

Content type

Image

Digest

sha256:49c951d41…

Size

12.1 GB

Last updated

over 1 year ago

docker pull fetalsvrtk/segmentation:cortex_for_slava