Difference between revisions of "Cerebellum CNN"

From IACL
Jump to navigation Jump to search
(Updated link. Added citation.)
Line 2: Line 2:
 
{{h2|Cerebellum Parcellation with Convolutional Neural Networks}}
 
{{h2|Cerebellum Parcellation with Convolutional Neural Networks}}
 
{{TOCright}}
 
{{TOCright}}
This work originally appeared at {{pub|conf=spie2019}} It can be downloaded as a Singularity image from {{iacl|~aaron/data/composed_parc-2019_01_23.simg|Cerebellar CNN Segmentation Code}}. The download is 1.7GB. If you use this work please cite:
+
This work originally appeared at {{pub|conf=spie2019}} It can be downloaded as a {{iacl|~shuo/data/cerebellum-parcellation.simg|Singularity image}}. The download is 1.3GB. If you use this work please cite:
 
{{iacl-pub|author=S. Han, Y. He, A. Carass, S.H. Ying, and J.L. Prince|title=Cerebellum parcellation with convolutional neural networks|conf=spie2019|doi=10.1117/12.2512119}}
 
{{iacl-pub|author=S. Han, Y. He, A. Carass, S.H. Ying, and J.L. Prince|title=Cerebellum parcellation with convolutional neural networks|conf=spie2019|doi=10.1117/12.2512119}}
 
  
 
{{h3|What the Singularity image can do}}
 
{{h3|What the Singularity image can do}}
 
The Singularity performs the following steps:
 
The Singularity performs the following steps:
* [https://www.nitrc.org/projects/robex ROBEX] is used to estimate a brain mask. This mask is then smoothed to generate a brain weight image.
+
* [https://www.nitrc.org/projects/robex ROBEX] is used to estimate a brain mask. This mask is then smoothed to generate a brain weight image. The mask is not used for skull-stripping. It is only used for the bias field correction below.
 
* N4 from [http://stnava.github.io/ANTs/ ANTs] is used to perform the bias field correction. The bias field is estimated using the weight image calculated above.
 
* N4 from [http://stnava.github.io/ANTs/ ANTs] is used to perform the bias field correction. The bias field is estimated using the weight image calculated above.
* The images are rigidly registered to the [http://www.bic.mni.mcgill.ca/ServicesAtlases/ICBM152NLin2009 ICBM2009c] nonlinear symmetric template using the ANTs package. The first MPRAGE image from the longitudinal series of a subject is registered to this template and other images with different contrasts/from the following sessions are registered to the first MPRAGE image.
+
* The image is rigidly registered to the [http://www.bic.mni.mcgill.ca/ServicesAtlases/ICBM152NLin2009 ICBM2009c] nonlinear symmetric template using the ANTs package.
 
* The cerebellum of an MNI-registered MPRAGE image is parcellated using the method described in "Shuo Han, et al., Cerebellum parcellation with convolutional neural networks, SPIE 2019 Medical Imaging Image Processing".
 
* The cerebellum of an MNI-registered MPRAGE image is parcellated using the method described in "Shuo Han, et al., Cerebellum parcellation with convolutional neural networks, SPIE 2019 Medical Imaging Image Processing".
:* Removing the neck should improve the results, such as using `robustfov` from [https://fsl.fmrib.ox.ac.uk/fslcourse/lectures/practicals/intro2/index.html fsl], but it is not done in this singularity image.
+
:* Removing the neck should improve the results, such as using "robustfov" from [https://fsl.fmrib.ox.ac.uk/fslcourse/lectures/practicals/intro2/index.html fsl], but it is not done in this Singularity image.
* (OPTIONAL) Generate a HTML report file. To generate the report, the images are converted to .png files which could occupy a large hard disk space.
+
* The parcellation is transformed back to the original space using ANTs with the "MultiLabel" interpolation.
 
+
* Generate .png files of slices in the axial, coronal, and sagittal views for quality control.
 
 
* [https://www.gnu.org/software/parallel/ GNU Parallel] is used to run jobs in parallel.
 
 
 
  
 
{{h3|Installation}}
 
{{h3|Installation}}
* Install [https://www.sylabs.io/guides/2.6/user-guide/installation.html singularity 2.6]
+
* Install [https://www.sylabs.io/guides/2.6/user-guide/installation.html Singularity 2.6]
  
 +
{{h3|Example Usage}}
 +
* The Singularity image can only run on '''CPU''' although [https://www.tensorflow.org TensorFlow] and [https://keras.io Keras] are used, because the Singularity image only contains the CPU version of TensorFlow.
  
{{h3|File structure (important)}}
+
* Assume that the Singularity image is ~/cerebellum-parcellation.simg, the image to parcellate is image.nii.gz, and the output folder is ~/output
* The images should be organized in the [http://bids.neuroimaging.io/ BIDS format]. For this singularity to run, the file structure is (be sure to create a subfolder `data/` under the processing folder):
+
singularity run ~/cerebellum-parcellation.simg -i ~/image.nii.gz -o ~/output
  
<data_dir>/
+
* If the image.nii.gz is under /path/to/image which is not under your home directory
    data/
 
      sub-<subject-label>/
 
          ses-<session-label>/
 
            anat/
 
                sub-<sub-label>_ses-<ses-label>_acq-mprage_[run-<run-label>]_T1w.nii.gz  
 
  
Note the '''"acq"''' label is required and run label is optional.
+
singularity run -B /path/to/image:/mnt ~/cerebellum-parcellation.simg -i /mnt/image.nii.gz -o /mnt/output
  
The processing will create subfolders '''"n4"''', '''"mni"''', '''"parc"''', and '''"post"''' under the folder '''"<data_dir>"'''. The final parcellation results are in '''"<data_dir>/post"'''.
+
* Print help
'''"*n4.nii.gz"''' is the bias field corrected image
+
  singularity run ~/cerebellum-parcellation.simg -h
'''"*n4_mni.nii.gz"''' is the image in the MNI space
 
'''"*n4_mni_seg.nii.gz"''' is the parcellation from the deep networks
 
'''"*n4_mni_seg_post.nii.gz"''' is the final post-processed result.
 
 
 
ICV is calculated from the ROBEX mask. A '''".tsv"''' file of the ICV is stored in '''"<data_dir>/n4"''' as '''"*_T1w_mask_icv.tsv"'''.
 
 
 
The volumes of the cerebellar regions are calculated from the '''"*post.nii.gz"''' and stored in '''"<data_dir>/post"''' as '''"*post_volumes.tsv"'''.
 
 
 
An optional report is stored as '''"<data_dir>/report.html"'''.
 
 
 
Using a bash/python/perl etc. script to organize your data using soft (symbolic) link is recommended.
 
 
 
 
 
{{h3|Example Usage}}
 
* Assuming the singularity image is ~/parc.simg
 
  singularity run ~/parc.simg -d ~/processing
 
 
 
* Generate a report html
 
singularity run ~/parc.simg -d ~/processing -r
 
 
 
* Run multiple 16 jobs in parallel
 
singularity run ~/parc.simg -d ~/processing -r -j 16
 
  
* Print help
+
{{h3|File structure}}
singularity run ~/parc.simg -h
 
  
 +
The processing will create subfolders '''"n4"''', '''"mni"''', '''"parc"''', and '''"pics"'' under the output folder. The final parcellation result is directly under the output folder.
 +
* '''"*n4.nii.gz"''' is the bias field corrected image
 +
* '''"*n4_mni.nii.gz"''' is the image in the MNI space
 +
* '''"*n4_mni_seg.nii.gz"''' is the parcellation from the deep networks
 +
* '''"*n4_mni_seg_post.nii.gz"''' is the post-processed result.
 +
* '''"*n4_mni_seg_post_inverse.nii.gz"''' is the final post-processed result in the original space.
 +
* The subfolder '''"pics/final"''' contains the axial, coronal, and sagittal slices of the file '''"*n4_mni_seg_post_inverse.nii.gz"'''.
  
 
{{h3|Cerebellum labels}}
 
{{h3|Cerebellum labels}}

Revision as of 01:48, 26 November 2019

<meta name="title" content="Cerebellum Parcellation with Convolutional Neural Networks"/>

Cerebellum Parcellation with Convolutional Neural Networks

This work originally appeared at Proceedings of SPIE Medical Imaging (SPIE-MI 2019), San Diego, CA, February 16 - 21, 2019. It can be downloaded as a Singularity image. The download is 1.3GB. If you use this work please cite:

  • S. Han, Y. He, A. Carass, S.H. Ying, and J.L. Prince, "Cerebellum parcellation with convolutional neural networks", Proceedings of SPIE Medical Imaging (SPIE-MI 2019), San Diego, CA, February 16 - 21, 2019. (doi)

What the Singularity image can do

The Singularity performs the following steps:

  • ROBEX is used to estimate a brain mask. This mask is then smoothed to generate a brain weight image. The mask is not used for skull-stripping. It is only used for the bias field correction below.
  • N4 from ANTs is used to perform the bias field correction. The bias field is estimated using the weight image calculated above.
  • The image is rigidly registered to the ICBM2009c nonlinear symmetric template using the ANTs package.
  • The cerebellum of an MNI-registered MPRAGE image is parcellated using the method described in "Shuo Han, et al., Cerebellum parcellation with convolutional neural networks, SPIE 2019 Medical Imaging Image Processing".
  • Removing the neck should improve the results, such as using "robustfov" from fsl, but it is not done in this Singularity image.
  • The parcellation is transformed back to the original space using ANTs with the "MultiLabel" interpolation.
  • Generate .png files of slices in the axial, coronal, and sagittal views for quality control.

Installation

Example Usage

  • The Singularity image can only run on CPU although TensorFlow and Keras are used, because the Singularity image only contains the CPU version of TensorFlow.
  • Assume that the Singularity image is ~/cerebellum-parcellation.simg, the image to parcellate is image.nii.gz, and the output folder is ~/output
singularity run ~/cerebellum-parcellation.simg -i ~/image.nii.gz -o ~/output
  • If the image.nii.gz is under /path/to/image which is not under your home directory
singularity run -B /path/to/image:/mnt ~/cerebellum-parcellation.simg -i /mnt/image.nii.gz -o /mnt/output
  • Print help
singularity run ~/cerebellum-parcellation.simg -h

File structure

The processing will create subfolders "n4"', "mni", "parc", and "pics" under the output folder. The final parcellation result is directly under the output folder.

  • "*n4.nii.gz" is the bias field corrected image
  • "*n4_mni.nii.gz" is the image in the MNI space
  • "*n4_mni_seg.nii.gz" is the parcellation from the deep networks
  • "*n4_mni_seg_post.nii.gz" is the post-processed result.
  • "*n4_mni_seg_post_inverse.nii.gz" is the final post-processed result in the original space.
  • The subfolder "pics/final" contains the axial, coronal, and sagittal slices of the file "*n4_mni_seg_post_inverse.nii.gz".

Cerebellum labels

   "12":  "Corpus_Medullare",
   "33":  "Left_Lobules_I-III",
   "36":  "Right_Lobules_I-III",
   "43":  "Left_Lobule_IV",
   "46":  "Right_Lobule_IV",
   "53":  "Left_Lobule_V",
   "56":  "Right_Lobule_V",
   "63":  "Left_Lobule_VI",
   "60":  "Vermis_VI",
   "66":  "Right_Lobule_VI",
   "73":  "Left_Lobule_VIIAf",
   "76":  "Right_Lobule_VIIAf",
   "74":  "Left_Lobule_VIIAt",
   "70":  "Vermis_VII",
   "77":  "Right_Lobule_VIIAt",
   "75":  "Left_Lobule_VIIB",
   "78":  "Right_Lobule_VIIB",
   "83":  "Left_Lobule_VIIIA",
   "80":  "Vermis_VIII",
   "86":  "Right_Lobule_VIIIA",
   "84":  "Left_Lobule_VIIIB",
   "87":  "Right_Lobule_VIIIB",
   "93":  "Left_Lobule_IX",
   "90":  "Vermis_IX",
   "96":  "Right_Lobule_IX",
   "103": "Left_Lobule_X",
   "100": "Vermis_X",
   "106": "Right_Lobule_X"