Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
* dev:
  ENH: added spatio-temporal atlas (Gholipour et al., 2017)
  STYLE: Print NiftyMIC version to stdout at execution time
  • Loading branch information
Michael Ebner committed Feb 6, 2019
2 parents 9a9d887 + 6fdcc22 commit 05abb39
Show file tree
Hide file tree
Showing 78 changed files with 247 additions and 9 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
build/
html/
latex/
data/templates/
data/tests/
dist/
*.nii
Expand Down
4 changes: 0 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ variables:
ITK_DIR: /mnt/shared/mebner/environment/ITK/ITK_NiftyMIC-python${PY_VERSION}-build
FSL_DIR: /mnt/shared/mebner/environment/FSL/fsl
TEST_DIR: /home/mebner/Development/NiftyMIC/data/tests
TEMPLATES_DIR: /home/mebner/Development/NiftyMIC/data/templates
NIFTYREG_INSTALL: /mnt/shared/mebner/environment/NiftyReg/NiftyReg-master-install
CONVERT3D_INSTALL: /mnt/shared/mebner/environment/Convert3D/c3d-git-install

Expand Down Expand Up @@ -60,9 +59,6 @@ before_script:
# run installation
- pip install -e .

# copy templates to NiftyMIC
- cp -r ${TEMPLATES_DIR} ${cwd_dir}/data/

# replace TEST_DIR in niftymic/definitions.py file
- sed -i -- 's:DIR_TEST = os.path.join(DIR_ROOT, "data", "tests"):DIR_TEST = "'"$TEST_DIR"'":g' niftymic/definitions.py
- cat niftymic/definitions.py
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,11 @@ niftymic_register_image \
--dir-input-mc dir-to-motion_correction \
--output path-to-registration-transform.txt \
```
For fetal brain template space alignment, a [spatio-temporal atlas][gholipour_atlas] is provided in [`data/templates`](data/templates). If you make use of it, please cite

* Gholipour, A., Rollins, C. K., Velasco-Annis, C., Ouaalam, A., Akhondi-Asl, A., Afacan, O., Ortinau, C. M., Clancy, S., Limperopoulos, C., Yang, E., Estroff, J. A. & Warfield, S. K. (2017). A normative spatiotemporal MRI atlas of the fetal brain for automatic segmentation and analysis of early brain growth. Scientific Reports 7, 476.

and abide by the license agreement as described in [`data/templates/LICENSE`](data/templates/LICENSE).

### SRR Methods for Motion Corrected (or Static) Data

Expand Down Expand Up @@ -270,3 +274,4 @@ Associated publications are
[simplereg-dependencies]: https://github.com/gift-surg/SimpleReg/wikis/simplereg-dependencies
[pysitk]: https://github.com/gift-surg/PySiTK
[fetal_brain_seg]: https://github.com/gift-surg/fetal_brain_seg
[gholipour_atlas]: https://www.nature.com/articles/s41598-017-00525-w
1 change: 1 addition & 0 deletions data/templates/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CRL (Computational Radiology Laboratory) hereby grants a license to use, including the right to share, copy, distribute, and transmit, the information, images and data that appears on this webpage solely for non-commercial educational and research purposes, subject to the following restrictions: (1) You must at all times acknowledge and attribute ownership of the information, images and data to CRL, including reproducing CRL's copyright to the extent that the same appears thereon; for publications referencing the fetal structural atlas, cite Gholipour et al., Scientific Reports, 2017; for publications referencing the DTI atlas, cite Khan et al., NeuroImage, 2018 and Khan et al., MICCAI, 2018 (full citations found on the Fetal Brain Atlas webpage); and (2) You may not post the information, images and data on any website, electronic bulletin board or any other electronic medium without the express written permission of CRL or required acknowledgements. As the information, images and data is experimental in nature and is being provided solely to facilitate academic and scientific research, you agree that you will use this information, images and data at your own risk and without liability of any kind to CRL. CRL MAKES NO REPRESENTATIONS AND EXTENDS NO WARRANTIES OF ANY KIND, EITHER EXPRESSED OR IMPLIED WITH RESPECT TO THE INFORMATION, IMAGES AND DATA, AND THERE ARE NO EXPRESS OR IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Use of the information, images or data for any commercial purposes is strictly prohibited without the express written consent of CRL. By requesting access through submitting this form, you acknowledge that you understand and accept all the terms and conditions in this license agreement.
115 changes: 115 additions & 0 deletions data/templates/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
2016 Fetal Brain Atlas
Copyright 2016, Computational Radiology Lab, Boston Childrens Hospital

Contact:
Ali Gholipour: [email protected]
Clemente Velasco-Annis: [email protected]

This version of the Spatio-Temporal Atlas (STA) was last edited on 11/21/16

This spatio-temporal atlas and the included parcellations are not intended for medical use and have no warranty. Structures received varying amounts of attention and refinement based on the research goals at the time of creation and thus no guarantees can be made regarding the accuracy or precision of the segmentations, nor the withholding to any particular labeling convention or protocol between structures. Any output derived from the use of these atlases or parcellations shouled be checked in order to validate the accuracy of the results.

# # # # # # # # # # # # # # # # # # # # # #
New to this update (11/21/16) "Olympic edition":

CHANGES TO LABELING SCHEME:
The parcellation scheme (label numbers) has been reorganized
All atlas images now share the same label key
The full key can be found below
Left and right white matter have been separated into separate labels
Labels for left and right internal capsule have been added to all images

REFINEMENT TO PARCELLATIONS:
"Miscellanous_brain_tissue" has been mostly removed as most of the label was internal capsule
Developing white matter zones (SP, IZ & VZ) have been removed from STA31-33 because they were not felt to be accurate (differentiation between layers was arbitrary)
*There are two versions of the STA30 parcellation, one with developing white matter zones, one without*
Cortical plate was reduced in the region anterior to the corpus callosum (reduced the portion "wrapping" into hemisphere)
Subplate has been expanded to the appropriate width as per reviewer feedback
The intermediate zone/ventricular zone has been edited to shrink the ventricular zone in line with reviewer feedback
Deep gray matter structures have been edited to increase segmentation consistency between gestational ages

# # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # #
New to this update (06/07/16):

White and gray cerebellum have been recombined because we could not ensure the accuracy of the delineation (very little refinement had been done since initial propagation of the parcellation scheme to this atlas).

The files have been renamed slightly.

# # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # #
New to this update (03/30/16):

ADDED TEMPLATES:
There are now atlas images and labels for gestational age (GA) weeks 21-37.

DEVELOPING WHITE MATTER ZONES:
Labels for developing white matter zones have been added for GA 21-33
This includes left and right "ventricular zone", "intermediate zone" (similar to subventricular zone), and "subplate"
In these images, label 51 is now "miscellaneous brain tissue", mostly deep gray matter found between the larger subcortical structures
Images with the labeling convention are marked with "wmz"; for example, STA27_WMZparc.nii.gz

There are two versions of labels for STA31, STA32, and STA33
STA31_parc.nii.gz = All white matter is label 51
STA31_WMZparc.nii.gz = Developing white matter layers have been separated into miscellaneous brain tissue (#51), subplate (#73,74), intermediate zone (#75,76), and ventricular zone (#77,78)

Note: As the white matter homogenizes in composition during development, the visual differentiation between the layers also decreases. Because of this the accuracy of the developmental layers may not be great for the older brains (i.e. STA30-33). This primarily pertains to the border between intermediate zone and subplate.

ADDITIONAL ADDED LABELS:
#5: Hippocampal commisure
#6: Fornix

LABEL REFINEMENTS:
Many of the labels have been refined to increase accuracy, in particular:
hippocampus
caudate
thalamus
lentiform
corpus callosum
cortical plate
# # # # # # # # # # # # # # # # # # # # # #

Label key (all images):

37 Hippocampus_L
38 Hippocampus_R
41 Amygdala_L
42 Amygdala_R
71 Caudate_L
72 Caudate_R
73 Lentiform_L
74 Lentiform_R
77 Thalamus_L
78 Thalamus_R
91 CorpusCallosum
92 Lateral_Ventricle_L
93 Lateral_Ventricle_R
94 Brainstem
100 Cerebellum_L
101 Cerebellum_R
108 Subthalamic_Nuc_L
109 Subthalamic_Nuc_R
110 Hippocampal_Comm
111 Fornix
112 Cortical_Plate_L
113 Cortical_Plate_R
114 Subplate_L
115 Subplate_R
116 Inter_Zone_L
117 Inter_Zone_R
118 Vent_Zone_L
119 Vent_Zone_R
120 White_Matter_L
121 White_Matter_R
122 Internal_Capsule_L
123 Internal_Capsule_R
124 CSF
125 Misc

# # # # # # # # # # # # # # # # # # # # # #

Michael Ebner, Feb 16, 2018:
- All image headers have been updated using fslreorient2std using `for i in *.nii.gz; do echo $i; fslreorient2std $i $i; done`
- _mask: binarized image labels
- _mask_dil: dilated binary masks; applied to SRR it approximates brain tissue only
- templates_info.json: Additional information on templates like volume
Binary file added data/templates/STA21.nii.gz
Binary file not shown.
Binary file added data/templates/STA21_WMZparc.nii.gz
Binary file not shown.
Binary file added data/templates/STA21_mask.nii.gz
Binary file not shown.
Binary file added data/templates/STA21_mask_dil.nii.gz
Binary file not shown.
Binary file added data/templates/STA22.nii.gz
Binary file not shown.
Binary file added data/templates/STA22_WMZparc.nii.gz
Binary file not shown.
Binary file added data/templates/STA22_mask.nii.gz
Binary file not shown.
Binary file added data/templates/STA22_mask_dil.nii.gz
Binary file not shown.
Binary file added data/templates/STA23.nii.gz
Binary file not shown.
Binary file added data/templates/STA23_WMZparc.nii.gz
Binary file not shown.
Binary file added data/templates/STA23_mask.nii.gz
Binary file not shown.
Binary file added data/templates/STA23_mask_dil.nii.gz
Binary file not shown.
Binary file added data/templates/STA24.nii.gz
Binary file not shown.
Binary file added data/templates/STA24_WMZparc.nii.gz
Binary file not shown.
Binary file added data/templates/STA24_mask.nii.gz
Binary file not shown.
Binary file added data/templates/STA24_mask_dil.nii.gz
Binary file not shown.
Binary file added data/templates/STA25.nii.gz
Binary file not shown.
Binary file added data/templates/STA25_WMZparc.nii.gz
Binary file not shown.
Binary file added data/templates/STA25_mask.nii.gz
Binary file not shown.
Binary file added data/templates/STA25_mask_dil.nii.gz
Binary file not shown.
Binary file added data/templates/STA26.nii.gz
Binary file not shown.
Binary file added data/templates/STA26_WMZparc.nii.gz
Binary file not shown.
Binary file added data/templates/STA26_mask.nii.gz
Binary file not shown.
Binary file added data/templates/STA26_mask_dil.nii.gz
Binary file not shown.
Binary file added data/templates/STA27.nii.gz
Binary file not shown.
Binary file added data/templates/STA27_WMZparc.nii.gz
Binary file not shown.
Binary file added data/templates/STA27_mask.nii.gz
Binary file not shown.
Binary file added data/templates/STA27_mask_dil.nii.gz
Binary file not shown.
Binary file added data/templates/STA28.nii.gz
Binary file not shown.
Binary file added data/templates/STA28_WMZparc.nii.gz
Binary file not shown.
Binary file added data/templates/STA28_mask.nii.gz
Binary file not shown.
Binary file added data/templates/STA28_mask_dil.nii.gz
Binary file not shown.
Binary file added data/templates/STA29.nii.gz
Binary file not shown.
Binary file added data/templates/STA29_WMZparc.nii.gz
Binary file not shown.
Binary file added data/templates/STA29_mask.nii.gz
Binary file not shown.
Binary file added data/templates/STA29_mask_dil.nii.gz
Binary file not shown.
Binary file added data/templates/STA30.nii.gz
Binary file not shown.
Binary file added data/templates/STA30_WMZparc.nii.gz
Binary file not shown.
Binary file added data/templates/STA30_mask.nii.gz
Binary file not shown.
Binary file added data/templates/STA30_mask_dil.nii.gz
Binary file not shown.
Binary file added data/templates/STA30_parc.nii.gz
Binary file not shown.
Binary file added data/templates/STA31.nii.gz
Binary file not shown.
Binary file added data/templates/STA31_mask.nii.gz
Binary file not shown.
Binary file added data/templates/STA31_mask_dil.nii.gz
Binary file not shown.
Binary file added data/templates/STA31_parc.nii.gz
Binary file not shown.
Binary file added data/templates/STA32.nii.gz
Binary file not shown.
Binary file added data/templates/STA32_mask.nii.gz
Binary file not shown.
Binary file added data/templates/STA32_mask_dil.nii.gz
Binary file not shown.
Binary file added data/templates/STA32_parc.nii.gz
Binary file not shown.
Binary file added data/templates/STA33.nii.gz
Binary file not shown.
Binary file added data/templates/STA33_mask.nii.gz
Binary file not shown.
Binary file added data/templates/STA33_mask_dil.nii.gz
Binary file not shown.
Binary file added data/templates/STA33_parc.nii.gz
Binary file not shown.
Binary file added data/templates/STA34.nii.gz
Binary file not shown.
Binary file added data/templates/STA34_mask.nii.gz
Binary file not shown.
Binary file added data/templates/STA34_mask_dil.nii.gz
Binary file not shown.
Binary file added data/templates/STA34_parc.nii.gz
Binary file not shown.
Binary file added data/templates/STA35.nii.gz
Binary file not shown.
Binary file added data/templates/STA35_mask.nii.gz
Binary file not shown.
Binary file added data/templates/STA35_mask_dil.nii.gz
Binary file not shown.
Binary file added data/templates/STA35_parc.nii.gz
Binary file not shown.
Binary file added data/templates/STA36.nii.gz
Binary file not shown.
Binary file added data/templates/STA36_mask.nii.gz
Binary file not shown.
Binary file added data/templates/STA36_mask_dil.nii.gz
Binary file not shown.
Binary file added data/templates/STA36_parc.nii.gz
Binary file not shown.
Binary file added data/templates/STA37.nii.gz
Binary file not shown.
Binary file added data/templates/STA37_mask.nii.gz
Binary file not shown.
Binary file added data/templates/STA37_mask_dil.nii.gz
Binary file not shown.
Binary file added data/templates/STA37_parc.nii.gz
Binary file not shown.
121 changes: 121 additions & 0 deletions data/templates/templates_info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
{
"21": {
"image": "STA21.nii.gz",
"mask": "STA21_mask.nii.gz",
"mask_dil": "STA21_mask_dil.nii.gz",
"volume_mask": 89246.38487071976,
"volume_mask_dil": 120038.46124333153
},
"22": {
"image": "STA22.nii.gz",
"mask": "STA22_mask.nii.gz",
"mask_dil": "STA22_mask_dil.nii.gz",
"volume_mask": 101490.30689354343,
"volume_mask_dil": 134909.44540126887
},
"23": {
"image": "STA23.nii.gz",
"mask": "STA23_mask.nii.gz",
"mask_dil": "STA23_mask_dil.nii.gz",
"volume_mask": 106235.50507484014,
"volume_mask_dil": 140715.503598928
},
"24": {
"image": "STA24.nii.gz",
"mask": "STA24_mask.nii.gz",
"mask_dil": "STA24_mask_dil.nii.gz",
"volume_mask": 130878.99653601555,
"volume_mask_dil": 170357.1202916332
},
"25": {
"image": "STA25.nii.gz",
"mask": "STA25_mask.nii.gz",
"mask_dil": "STA25_mask_dil.nii.gz",
"volume_mask": 178492.25774336213,
"volume_mask_dil": 227175.59493246424
},
"26": {
"image": "STA26.nii.gz",
"mask": "STA26_mask.nii.gz",
"mask_dil": "STA26_mask_dil.nii.gz",
"volume_mask": 201635.08283969283,
"volume_mask_dil": 253806.15093200956
},
"27": {
"image": "STA27.nii.gz",
"mask": "STA27_mask.nii.gz",
"mask_dil": "STA27_mask_dil.nii.gz",
"volume_mask": 210435.81779203523,
"volume_mask_dil": 263941.1528740433
},
"28": {
"image": "STA28.nii.gz",
"mask": "STA28_mask.nii.gz",
"mask_dil": "STA28_mask_dil.nii.gz",
"volume_mask": 233175.18840337868,
"volume_mask_dil": 290329.5337829808
},
"29": {
"image": "STA29.nii.gz",
"mask": "STA29_mask.nii.gz",
"mask_dil": "STA29_mask_dil.nii.gz",
"volume_mask": 257051.194746539,
"volume_mask_dil": 317684.56706204003
},
"30": {
"image": "STA30.nii.gz",
"mask": "STA30_mask.nii.gz",
"mask_dil": "STA30_mask_dil.nii.gz",
"volume_mask": 282285.5319890282,
"volume_mask_dil": 346364.6513653975
},
"31": {
"image": "STA31.nii.gz",
"mask": "STA31_mask.nii.gz",
"mask_dil": "STA31_mask_dil.nii.gz",
"volume_mask": 312587.62620157294,
"volume_mask_dil": 380993.6413300073
},
"32": {
"image": "STA32.nii.gz",
"mask": "STA32_mask.nii.gz",
"mask_dil": "STA32_mask_dil.nii.gz",
"volume_mask": 340744.4484698328,
"volume_mask_dil": 413634.54276009236
},
"33": {
"image": "STA33.nii.gz",
"mask": "STA33_mask.nii.gz",
"mask_dil": "STA33_mask_dil.nii.gz",
"volume_mask": 356126.40670901025,
"volume_mask_dil": 430765.4864316511
},
"34": {
"image": "STA34.nii.gz",
"mask": "STA34_mask.nii.gz",
"mask_dil": "STA34_mask_dil.nii.gz",
"volume_mask": 392819.77292167663,
"volume_mask_dil": 472869.6483262277
},
"35": {
"image": "STA35.nii.gz",
"mask": "STA35_mask.nii.gz",
"mask_dil": "STA35_mask_dil.nii.gz",
"volume_mask": 418491.86852033855,
"volume_mask_dil": 502023.33085117553
},
"36": {
"image": "STA36.nii.gz",
"mask": "STA36_mask.nii.gz",
"mask_dil": "STA36_mask_dil.nii.gz",
"volume_mask": 422497.7414778769,
"volume_mask_dil": 506874.512634493
},
"37": {
"image": "STA37.nii.gz",
"mask": "STA37_mask.nii.gz",
"mask_dil": "STA37_mask_dil.nii.gz",
"volume_mask": 390531.14151572104,
"volume_mask_dil": 470833.9439705052
}
}
2 changes: 1 addition & 1 deletion niftymic/__about__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__author__ = "Michael Ebner"
__email__ = "[email protected]"
__license__ = "BSD-3-Clause"
__version__ = "0.5.2"
__version__ = "0.6"
__summary__ = "NiftyMIC is a research-focused toolkit for " \
"motion-correction and volumetric image reconstruction of " \
"2D ultra-fast MRI."
4 changes: 2 additions & 2 deletions niftymic/application/run_reconstruction_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ def main():
ph.execute_command(cmd)

# Copy SRR to output directory
output = "%sSRR_Stacks%d_GW%d.nii.gz" % (
args.prefix_output, len(args.filenames), gestational_age)
output = "%sSRR_Stacks%d.nii.gz" % (
args.prefix_output, len(args.filenames))
path_to_output = os.path.join(args.dir_output, output)
cmd = "cp -p %s %s" % (srr_template, path_to_output)
exit_code = ph.execute_command(cmd)
Expand Down
3 changes: 2 additions & 1 deletion niftymic/utilities/input_arparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def parse_args(self):

return self._parser.parse_args()

def print_arguments(self, args, title="Input Parameters:"):
def print_arguments(self, args, title="Configuration:"):
ph.print_title(title)
for arg in sorted(vars(args)):
ph.print_info("%s: " % (arg), newline=False)
Expand All @@ -92,6 +92,7 @@ def print_arguments(self, args, title="Input Parameters:"):
print("\t%s" % val)
else:
print(vals)
print("\nNiftyMIC version: %s" % niftymic.__version__)
ph.print_line_separator(add_newline=False)
print("")

Expand Down

0 comments on commit 05abb39

Please sign in to comment.