Skip to content

Commit e02d933

Browse files
author
Antonios Makropoulos
authored
Merge pull request #21 from MIRTK/release/v1.2
Release v1.2
2 parents 7908cee + 2a2cedb commit e02d933

47 files changed

Lines changed: 3342 additions & 1457 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Atlases.cmake

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
cmake_minimum_required(VERSION 2.7)
2+
3+
include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)
4+
5+
set(ATLAS_URL "https://biomedic.doc.ic.ac.uk/brain-development/downloads/dHCP/atlases-dhcp-structural-pipeline-v1.zip")
6+
set(ATLAS_MD5 77e924bc17a4906f5814874009f5eca6)
7+
8+
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/atlases)
9+
ExternalProject_Add(atlases
10+
URL ${ATLAS_URL}
11+
URL_MD5 ${ATLAS_MD5}
12+
PREFIX atlases
13+
CONFIGURE_COMMAND ""
14+
BUILD_COMMAND ""
15+
INSTALL_COMMAND ""
16+
)
17+
18+
add_custom_target(atlases_move ALL
19+
${CMAKE_COMMAND} -E rename ${CMAKE_CURRENT_BINARY_DIR}/atlases/src/atlases ${CMAKE_CURRENT_SOURCE_DIR}/atlases
20+
)
21+
22+
ADD_DEPENDENCIES(atlases_move atlases)
23+
endif()

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ if (NOT COMMAND mirtk_configure_module)
2525
endif ()
2626

2727
mirtk_configure_module()
28+
29+
SUBDIRS(ThirdParty/ANTs)
30+
INCLUDE(Atlases.cmake)

README.md

Lines changed: 41 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +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+
10+
11+
## Dependencies
12+
### FSL
613

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.
717

8-
Installation
9-
------------
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-
- [FSL](http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/) installed
22-
- 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.
23-
- The N4 bias field correction from ITK is included in the ThirdParty/ITK folder. If the executable does not work, you will need to compile ITK and replace the ThirdParty/ITK/N4 binary with the N4BiasFieldCorrectionImageFilter binary
24-
25-
26-
Run
27-
---
29+
## Running the pipeline
2830

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

31-
pipelines/neonatal-pipeline-v1.1.sh
33+
mirtk neonatal-segmentation <subject_T2> <age_at_scan>
3234

33-
The script requires the T2 image and the age at scan of the subject to be segmented (as first and second argument respectively).
34-
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+
```
3548

3649

37-
License
38-
-------
50+
## License
3951

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

45-
Draw-EM uses third-party software, namely the "ITK: The Insight Toolkit for Segmentation and Registration".
46-
ITK is distributed under the Apache License Version 2.
47-
Specifically, the N4 bias field correction by Tustison et al. is included (http://www.insight-journal.org/browse/publication/640).
48-
The covered file (N4) and license (LICENSE) can be found in ThirdParty/ITK.
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].
4960

5061

51-
Citation and acknowledgements
52-
-----------------------------
62+
## Citation and acknowledgements
5363

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

56-
Publication:
66+
Publications:
5767

58-
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

ThirdParty/ANTs/CMakeLists.txt

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
cmake_minimum_required(VERSION 2.7)
2+
if(COMMAND cmake_policy)
3+
cmake_policy(SET CMP0046 NEW)
4+
cmake_policy(SET CMP0048 NEW)
5+
endif(COMMAND cmake_policy)
6+
7+
PROJECT( N4 )
8+
9+
IF(NOT ITK_DIR)
10+
INCLUDE(External_ITK.cmake)
11+
SET(External_ITK 1)
12+
ENDIF()
13+
14+
# Set up ITK
15+
FIND_PACKAGE(ITK)
16+
IF(ITK_FOUND)
17+
INCLUDE(${ITK_USE_FILE})
18+
ELSE(ITK_FOUND)
19+
MESSAGE(FATAL_ERROR
20+
"Cannot build without ITK. Please set ITK_DIR.")
21+
ENDIF(ITK_FOUND)
22+
23+
INCLUDE_DIRECTORIES(${ITK_INCLUDE_DIRS})
24+
25+
SET(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/antsCommandLineParser" "${CMAKE_CURRENT_SOURCE_DIR}/antsCommandLineOption" )
26+
27+
ADD_EXECUTABLE( N4 N4.cxx ${SOURCES} )
28+
TARGET_LINK_LIBRARIES(N4 ${ITK_LIBRARIES})
29+
set_target_properties(N4 PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${MIRTK_TOOLS_DIR}")
30+
31+
IF(External_ITK)
32+
ADD_DEPENDENCIES(N4 ITK)
33+
ENDIF()

ThirdParty/ANTs/External_ITK.cmake

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
cmake_minimum_required(VERSION 2.7)
2+
3+
include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)
4+
5+
ExternalProject_Add(
6+
ITK
7+
GIT_REPOSITORY "https://github.com/InsightSoftwareConsortium/ITK.git"
8+
SOURCE_DIR "${CMAKE_SOURCE_DIR}/ThirdParty/ITK"
9+
CMAKE_ARGS -DBUILD_EXAMPLES=OFF -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${ITK_DIR}
10+
UPDATE_COMMAND ""
11+
PATCH_COMMAND ""
12+
INSTALL_COMMAND ""
13+
)
14+
15+
ExternalProject_Get_Property(ITK SOURCE_DIR)
16+
ExternalProject_Get_Property(ITK BINARY_DIR)
17+
set(ITK_SOURCE_DIR ${SOURCE_DIR})
18+
set(ITK_DIR ${BINARY_DIR})

ThirdParty/ANTs/LICENSE.txt

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
The file N4.cxx is based on the N4BiasFieldCorrection.cxx provided by ANTs.
2+
Minor modifications have been applied to allow to build N4BiasFieldCorrection as an external package without the need to build the whole ANTs package.
3+
Modifications are noted in the code with "modification{ ... }modification".
4+
5+
6+
------------------------------------------------------------------------------
7+
The following copyright applies to the files:
8+
antsCommandLineOption.cxx
9+
antsCommandLineOption.h
10+
antsCommandLineParser.cxx
11+
antsCommandLineParser.h
12+
N4BiasFieldCorrection.cxx
13+
14+
15+
ConsortiumOfANTS® - http://www.picsl.upenn.edu/ANTS/
16+
Copyright (c) 2009-2013 (updated to current year ad infinitum)
17+
18+
Redistribution and use in source and binary forms, with or without
19+
modification, are permitted provided that the following conditions
20+
are met:
21+
1. Redistributions of source code must retain the above copyright
22+
notice, this list of conditions and the following disclaimer.
23+
2. Redistributions in binary form must reproduce the above copyright
24+
notice, this list of conditions and the following disclaimer in the
25+
documentation and/or other materials provided with the distribution.
26+
3. Neither the name of the consortium nor the names of its contributors
27+
may be used to endorse or promote products derived from this software
28+
without specific prior written permission.
29+
30+
THIS SOFTWARE IS PROVIDED BY THE CONSORTIUM AND CONTRIBUTORS ``AS IS'' AND
31+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33+
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
34+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
35+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
36+
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
37+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
38+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
39+
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
40+
SUCH DAMAGE.

0 commit comments

Comments
 (0)