Skip to content

Commit 2a2cedb

Browse files
author
Antonios Makropoulos
committed
update Readme and scripts
1 parent bfaa293 commit 2a2cedb

3 files changed

Lines changed: 42 additions & 36 deletions

File tree

README.md

Lines changed: 41 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,69 @@
1-
Draw-EM Segmentation Software
2-
==========================================
1+
# Draw-EM Segmentation Software
2+
3+
![segmentation image](segmentation.png)
34

45
Draw-EM (Developing brain Region Annotation With Expectation-Maximization) is a package of [MIRTK](https://github.com/BioMedIA/MIRTK) developed by Antonios Makropoulos and the [BioMedIA](https://biomedia.doc.ic.ac.uk/) research group.
5-
It provides a collection of command-line tools as well as pipelines for the segmentation of developing brain MR images.
6+
It provides a collection of command-line tools and pipelines for the segmentation of developing brain MR images.
7+
8+
Draw-EM is used as part of the [dHCP structural pipeline](https://github.com/BioMedIA/dhcp-structural-pipeline) for the structural analysis (segmentation and surface extraction) of the neonatal brain.
9+
610

11+
## Dependencies
12+
### FSL
713

8-
Installation
9-
------------
14+
The segmentation pipeline uses
15+
[FSL](https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FSL).
16+
See the [installation instructions](https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FslInstallation) for FSL.
17+
18+
19+
## Installation
1020

1121
Draw-EM is part of MIRTK.
12-
In order to compile it as part of MIRTK you need to do the following steps:
13-
- download (clone) Draw-EM inside the Packages folder of your MIRTK directory
14-
- enable compile of the package by setting the CMake flag "MODULE_DrawEM" of MIRTK to "ON" (using cmake or ccmake)
22+
In order to compile it as part of MIRTK you need to:
23+
- enable compilation of the package by setting the CMake flag "MODULE_DrawEM" of MIRTK to "ON" (using cmake or ccmake)
1524
- build MIRTK
1625

1726
See the [installation instructions](https://mirtk.github.io/install.html)
1827
for a step-by-step guide on how to install MIRTK.
1928

20-
The segmentation pipeline further requires the following:
21-
- The atlases required by Draw-EM need to be downloaded from [here](https://www.doc.ic.ac.uk/~am411/atlases-DrawEM.html) and extracted inside the Draw-EM directory.
22-
- [FSL](http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/) installed
23-
- The N4BiasFieldCorrection from ANTS installed.
24-
25-
Run
26-
---
29+
## Running the pipeline
2730

28-
The segmentation pipeline can be run with the following script:
31+
The segmentation pipeline can be run as follows:
2932

30-
pipelines/neonatal-pipeline.sh
33+
mirtk neonatal-segmentation <subject_T2> <age_at_scan>
3134

32-
The script requires the T2 image and the age at scan of the subject to be segmented (as first and second argument respectively).
33-
Run the script without arguments for a detailed list of options.
35+
```
36+
Arguments:
37+
<subject_T2> Nifti Image: The T2 image of the subject to be segmented.
38+
<age_at_scan> Integer: Subject age in weeks. This is used to select the appropriate template for the initial registration.
39+
If the age is <28w or >44w, it will be set to 28w or 44w respectively.
40+
Options:
41+
-d / -data-dir <directory> The directory used to run the script and output the files.
42+
-c / -cleanup <0/1> Whether cleanup of temporary files is required (default: 1)
43+
-p / -save-posteriors <0/1> Whether the structures' posteriors are required (default: 0)
44+
-t / -threads <number> Number of threads (CPU cores) allowed for the registration to run in parallel (default: 1)
45+
-v / -verbose <0/1> Whether the script progress is reported (default: 1)
46+
-h / -help / --help Print usage.
47+
```
3448

3549

36-
License
37-
-------
50+
## License
3851

3952
Draw-EM is distributed under the terms of the Apache License Version 2.
4053
See the accompanying [license file](LICENSE.txt) for details. The license enables usage of
4154
Draw-EM in both commercial and non-commercial applications, without restrictions on the
4255
licensing applied to the combined work.
4356

57+
## Releases
58+
- v1.2: dHCP segmentation pipeline, method improvements described in [2]: multi-channel registration, modelling of hyper and hypo-intensities.
59+
- v1.1: initial code release, method described in [1].
4460

4561

46-
Citation and acknowledgements
47-
-----------------------------
62+
## Citation and acknowledgements
4863

4964
In case you found Draw-EM useful please give appropriate credit to the software.
5065

51-
Publication:
66+
Publications:
5267

53-
A. Makropoulos et al. Automatic whole brain MRI segmentation of the developing neonatal brain, IEEE TMI, 2014
68+
1. A. Makropoulos et al. *"Automatic whole brain MRI segmentation of the developing neonatal brain"*, IEEE TMI, 2014
69+
2. A. Makropoulos, E. C. Robinson et al. *"The Developing Human Connectome Project: a Minimal Processing Pipeline for Neonatal Cortical Surface Reconstruction"*, NeuroImage, 2018

scripts/preprocess.sh

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,6 @@ else
3232
export PATH="$FSLDIR/bin:$PATH"
3333
fi
3434

35-
N4=N4
36-
if ! hash $N4 2>/dev/null; then
37-
N4=N4BiasFieldCorrection
38-
if ! hash $N4 2>/dev/null; then
39-
echo "The N4 command is not installed!" 1>&2;
40-
exit 1;
41-
fi
42-
fi
43-
44-
4535
sdir=segmentations-data
4636

4737
mkdir -p segmentations N4 dofs bias || exit 1
@@ -57,7 +47,7 @@ if [ ! -f N4/$subj.nii.gz ];then
5747
fi
5848

5949
#bias correct
60-
run $N4 3 -i N4/${subj}_rescaled.nii.gz -x segmentations/${subj}_brain_mask.nii.gz -o "[N4/${subj}_corr.nii.gz,bias/$subj.nii.gz]" -c "[50x50x50,0.001]" -s 2 -b "[100,3]" -t "[0.15,0.01,200]"
50+
run mirtk N4 3 -i N4/${subj}_rescaled.nii.gz -x segmentations/${subj}_brain_mask.nii.gz -o "[N4/${subj}_corr.nii.gz,bias/$subj.nii.gz]" -c "[50x50x50,0.001]" -s 2 -b "[100,3]" -t "[0.15,0.01,200]"
6151
run mirtk calculate N4/${subj}_corr.nii.gz -mul segmentations/${subj}_brain_mask.nii.gz -out N4/${subj}_corr.nii.gz
6252

6353
#rescale image

segmentation.png

554 KB
Loading

0 commit comments

Comments
 (0)