Skip to content

Commit

Permalink
Merge pull request #35 from nikhil153/gh-pages
Browse files Browse the repository at this point in the history
added local data
  • Loading branch information
nikhil153 authored May 27, 2021
2 parents b4d1307 + bb5a2f4 commit ef33b03
Show file tree
Hide file tree
Showing 44 changed files with 2,250 additions and 68 deletions.
164 changes: 103 additions & 61 deletions code/1_sMRI_modalities.ipynb

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion code/2_sMRI_image_cleanup.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
"import nilearn\n",
"from nilearn import datasets\n",
"from nilearn import plotting\n",
"\n",
"import os"
]
},
Expand Down
17 changes: 11 additions & 6 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ root: . # Is the only page that doesn't follow the pattern /:path/index.html
permalink: index.html # Is the only page that doesn't follow the pattern /:path/index.html
---

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/carpentries-incubator/SDC-BIDS-sMRI/gh-pages)

Welcome to the **Structural Neuroimaging Analysis in Python** workshop!

The primary goals of this workshop are:
Expand All @@ -16,19 +18,22 @@ Things to keep in mind:
2. In structural neuroimaging, MR scans can refer to several different image modalities including, T1-weighted, T2-weighted, diffusion weighted images (DWI), proton-densty (PD), Fluid attenuation inversion recovery (FLAIR) etc.
3. MR (pre)processing pipeline is a set of sequential image processing tasks performed on acquired MR scans prior to the statistical analyese.
4. MR software packages: In order to standardize and simplify computational effort, several software packages encapsulate MR (pre)processing pipelines. Thus as a user, you need not know the details of each image processing algorithm. Nevertheless it is useful to understand the key objectives of these tasks, the corresponding computational approaches, and their impact on the downstream analyses. This will 1) help developers to improve the underlying algorithms and 2) help users to customize the neuorimaging pipelines according to specific dataset requirements. Here are a few common software packages:
- FressSurfer
- FSL
- CIVET
- SPM (mostly for functional data)
- AFNI (mostly for functional data)
- sMRIprep/fMRIprep

- [FressSurfer](https://surfer.nmr.mgh.harvard.edu/)
- [FSL](https://fsl.fmrib.ox.ac.uk/fsl/fslwiki)
- [CIVET](http://www.bic.mni.mcgill.ca/ServicesSoftware/CIVET-2-1-0-Table-of-Contents)
- [ANTs](http://stnava.github.io/ANTs/)
- [SPM](https://www.fil.ion.ucl.ac.uk/spm/) (mostly for functional data)
- [AFNI](https://afni.nimh.nih.gov/) (mostly for functional data)
- [sMRIprep](https://github.com/nipreps/smriprep) or [fMRIprep](https://github.com/nipreps/fmriprep) (pipeline customization)


_Note: All of this may sound complicated, but we'll explain things step-by-step in depth with practical examples as the course goes along. We will begin our computational journey stating from how an MR image is acquired, followed by several pre-processing tasks, with the end goal of conducting a statistical analysis to investigate neuroanatomical differences between patients and healthy controls groups._

## You Are Here!
![course_flow](fig/index/Course_flow_0.png)


<!-- this is an html comment -->

{% comment %} This is a comment in Liquid {% endcomment %}
Expand Down
Binary file added local_data/2_sMRI_cleanup/sub001/mri/T1.mgz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added local_data/2_sMRI_cleanup/sub001/mri/aseg.mgz
Binary file not shown.
Binary file not shown.
Binary file added local_data/2_sMRI_cleanup/sub001/mri/nu.mgz
Binary file not shown.
Binary file added local_data/2_sMRI_cleanup/sub001/mri/orig.mgz
Binary file not shown.
30 changes: 30 additions & 0 deletions local_data/2_sMRI_cleanup/sub001/mri/transforms/cc_up.lta
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# transform file /home/nikhil/projects/neurodocker/nipype_tutorial/freesurfer/sub001/mri/transforms/cc_up.lta
# created by nikhil on Tue Apr 6 15:19:41 2021

type = 0 # LINEAR_VOX_TO_VOX
nxforms = 1
mean = 129.0000 135.0000 129.0000
sigma = 10000.0000
1 4 4
9.974024295806885e-01 -4.251025244593620e-02 5.814732611179352e-02 -1.239935994148254e+00
4.243819415569305e-02 9.990959763526917e-01 2.474094275385141e-03 6.396048545837402e+00
-5.819993838667870e-02 0.000000000000000e+00 9.983048439025879e-01 6.610050201416016e+00
0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 1.000000000000000e+00
src volume info
valid = 1 # volume info valid
filename = /home/nikhil/projects/neurodocker/nipype_tutorial/freesurfer/sub001/mri/norm.mgz
volume = 256 256 256
voxelsize = 1.000000000000000e+00 1.000000000000000e+00 1.000000000000000e+00
xras = -1.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00
yras = 0.000000000000000e+00 0.000000000000000e+00 -1.000000000000000e+00
zras = 0.000000000000000e+00 1.000000000000000e+00 0.000000000000000e+00
cras = -8.583132171630859e+01 -9.457855224609375e-01 5.000000000000000e-01
dst volume info
valid = 1 # volume info valid
filename = /home/nikhil/projects/neurodocker/nipype_tutorial/freesurfer/sub001/mri/norm.mgz
volume = 256 256 256
voxelsize = 1.000000000000000e+00 1.000000000000000e+00 1.000000000000000e+00
xras = -1.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00
yras = 0.000000000000000e+00 0.000000000000000e+00 -1.000000000000000e+00
zras = 0.000000000000000e+00 1.000000000000000e+00 0.000000000000000e+00
cras = -8.583132171630859e+01 -9.457855224609375e-01 5.000000000000000e-01
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
MNI Transform File
% avi2talxfm

Transform_Type = Linear;
Linear_Transform =
1.053177 -0.061204 -0.060685 90.310684
0.070210 1.009246 0.117766 -9.806847
0.023069 -0.117785 1.186777 13.209366;
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
type = 1 # LINEAR_RAS_TO_RAS
nxforms = 1
mean = 0.0000 0.0000 0.0000
sigma = 1.0000
1 4 4
1.053176999092102e+00 -6.120400130748749e-02 -6.068500131368637e-02 9.031068420410156e+01
7.021000236272812e-02 1.009245991706848e+00 1.177660003304482e-01 -9.806846618652344e+00
2.306899987161160e-02 -1.177849993109703e-01 1.186776995658875e+00 1.320936584472656e+01
0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 1.000000000000000e+00
src volume info
valid = 1 # volume info valid
filename = /home/nikhil/projects/neurodocker/nipype_tutorial/freesurfer/sub001/mri/orig_nu.mgz
volume = 256 256 256
voxelsize = 1.000000000000000e+00 1.000000000000000e+00 1.000000000000000e+00
xras = -1.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00
yras = 0.000000000000000e+00 0.000000000000000e+00 -1.000000000000000e+00
zras = 0.000000000000000e+00 1.000000000000000e+00 0.000000000000000e+00
cras = -8.583132171630859e+01 -9.457855224609375e-01 5.000000000000000e-01
dst volume info
valid = 1 # volume info valid
filename = /opt/freesurfer-6.0.0-min/average/mni305.cor.mgz
volume = 256 256 256
voxelsize = 1.000000000000000e+00 1.000000000000000e+00 1.000000000000000e+00
xras = -1.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00
yras = 0.000000000000000e+00 0.000000000000000e+00 -1.000000000000000e+00
zras = 0.000000000000000e+00 1.000000000000000e+00 0.000000000000000e+00
cras = 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00
subject fsaverage
fscale 0.100000
30 changes: 30 additions & 0 deletions local_data/2_sMRI_cleanup/sub001/mri/transforms/talairach.lta
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# transform file transforms/talairach.lta
# created by nikhil on Tue Apr 6 13:02:09 2021

type = 0 # LINEAR_VOX_TO_VOX
nxforms = 1
mean = 129.0000 135.0000 129.0000
sigma = 10000.0000
1 4 4
1.035310864448547e+00 -5.322968959808350e-02 6.893639266490936e-02 -7.738219261169434e+00
2.411704696714878e-02 1.148522019386292e+00 5.860143527388573e-02 -4.360515213012695e+01
-7.657878845930099e-02 -6.251266598701477e-02 9.747626781463623e-01 1.660344839096069e+00
0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 1.000000000000000e+00
src volume info
valid = 1 # volume info valid
filename = nu.mgz
volume = 256 256 256
voxelsize = 1.000000000000000e+00 1.000000000000000e+00 1.000000000000000e+00
xras = -1.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00
yras = 0.000000000000000e+00 0.000000000000000e+00 -1.000000000000000e+00
zras = 0.000000000000000e+00 1.000000000000000e+00 0.000000000000000e+00
cras = -8.583132171630859e+01 -9.457855224609375e-01 5.000000000000000e-01
dst volume info
valid = 1 # volume info valid
filename = /opt/freesurfer-6.0.0-min/average/RB_all_2016-05-10.vc700.gca
volume = 256 256 256
voxelsize = 1.000000000000000e+00 1.000000000000000e+00 1.000000000000000e+00
xras = -1.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00
yras = 0.000000000000000e+00 0.000000000000000e+00 -1.000000000000000e+00
zras = 0.000000000000000e+00 1.000000000000000e+00 0.000000000000000e+00
cras = 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00
8 changes: 8 additions & 0 deletions local_data/2_sMRI_cleanup/sub001/mri/transforms/talairach.xfm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
MNI Transform File
% avi2talxfm

Transform_Type = Linear;
Linear_Transform =
1.053177 -0.061204 -0.060685 90.310684
0.070210 1.009246 0.117766 -9.806847
0.023069 -0.117785 1.186777 13.209366;
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# transform file transforms/talairach_with_skull.lta
# created by nikhil on Tue Apr 6 12:11:55 2021

type = 0 # LINEAR_VOX_TO_VOX
nxforms = 1
mean = 129.0000 157.0000 140.0000
sigma = 10000.0000
1 4 4
1.042325973510742e+00 -3.924698382616043e-02 4.048125073313713e-02 -7.795707702636719e+00
3.624658659100533e-02 1.252970337867737e+00 2.024739608168602e-02 -5.292900085449219e+01
-7.761660963296890e-02 1.142661087214947e-03 1.019986867904663e+00 -1.212160015106201e+01
0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 1.000000000000000e+00
src volume info
valid = 1 # volume info valid
filename = nu.mgz
volume = 256 256 256
voxelsize = 1.000000000000000e+00 1.000000000000000e+00 1.000000000000000e+00
xras = -1.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00
yras = 0.000000000000000e+00 0.000000000000000e+00 -1.000000000000000e+00
zras = 0.000000000000000e+00 1.000000000000000e+00 0.000000000000000e+00
cras = -8.583132171630859e+01 -9.457855224609375e-01 5.000000000000000e-01
dst volume info
valid = 1 # volume info valid
filename = /opt/freesurfer-6.0.0-min/average/RB_all_withskull_2016-05-10.vc700.gca
volume = 256 256 256
voxelsize = 1.000000000000000e+00 1.000000000000000e+00 1.000000000000000e+00
xras = -1.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00
yras = 0.000000000000000e+00 0.000000000000000e+00 -1.000000000000000e+00
zras = 0.000000000000000e+00 1.000000000000000e+00 0.000000000000000e+00
cras = 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00
125 changes: 125 additions & 0 deletions local_data/2_sMRI_cleanup/sub001/stats/aseg.stats
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Title Segmentation Statistics
#
# generating_program mri_segstats
# cvs_version $Id: mri_segstats.c,v 1.121 2016/05/31 17:27:11 greve Exp $
# cmdline mri_segstats --seg mri/aseg.mgz --sum stats/aseg.stats --pv mri/norm.mgz --empty --brainmask mri/brainmask.mgz --brain-vol-from-seg --excludeid 0 --excl-ctxgmwm --supratent --subcortgray --in mri/norm.mgz --in-intensity-name norm --in-intensity-units MR --etiv --surf-wm-vol --surf-ctx-vol --totalgray --euler --ctab /opt/freesurfer-6.0.0-min/ASegStatsLUT.txt --subject sub001
# sysname Linux
# hostname JBLAB-laptop1
# machine x86_64
# user nikhil
# anatomy_type volume
#
# SUBJECTS_DIR /home/nikhil/projects/neurodocker/nipype_tutorial/freesurfer
# subjectname sub001
# Measure BrainSeg, BrainSegVol, Brain Segmentation Volume, 1207330.000000, mm^3
# Measure BrainSegNotVent, BrainSegVolNotVent, Brain Segmentation Volume Without Ventricles, 1181804.000000, mm^3
# Measure BrainSegNotVentSurf, BrainSegVolNotVentSurf, Brain Segmentation Volume Without Ventricles from Surf, 1181996.028410, mm^3
# Measure VentricleChoroidVol, VentricleChoroidVol, Volume of ventricles and choroid plexus, 19789.000000, mm^3
# Measure lhCortex, lhCortexVol, Left hemisphere cortical gray matter volume, 263263.911286, mm^3
# Measure rhCortex, rhCortexVol, Right hemisphere cortical gray matter volume, 262440.156667, mm^3
# Measure Cortex, CortexVol, Total cortical gray matter volume, 525704.067953, mm^3
# Measure lhCerebralWhiteMatter, lhCerebralWhiteMatterVol, Left hemisphere cerebral white matter volume, 227017.706337, mm^3
# Measure rhCerebralWhiteMatter, rhCerebralWhiteMatterVol, Right hemisphere cerebral white matter volume, 223831.254119, mm^3
# Measure CerebralWhiteMatter, CerebralWhiteMatterVol, Total cerebral white matter volume, 450848.960456, mm^3
# Measure SubCortGray, SubCortGrayVol, Subcortical gray matter volume, 63823.000000, mm^3
# Measure TotalGray, TotalGrayVol, Total gray matter volume, 702689.067953, mm^3
# Measure SupraTentorial, SupraTentorialVol, Supratentorial volume, 1062731.028410, mm^3
# Measure SupraTentorialNotVent, SupraTentorialVolNotVent, Supratentorial volume, 1042942.028410, mm^3
# Measure SupraTentorialNotVentVox, SupraTentorialVolNotVentVox, Supratentorial volume voxel count, 1040097.000000, mm^3
# Measure Mask, MaskVol, Mask Volume, 1639795.000000, mm^3
# Measure BrainSegVol-to-eTIV, BrainSegVol-to-eTIV, Ratio of BrainSegVol to eTIV, 0.795071, unitless
# Measure MaskVol-to-eTIV, MaskVol-to-eTIV, Ratio of MaskVol to eTIV, 1.079865, unitless
# Measure lhSurfaceHoles, lhSurfaceHoles, Number of defect holes in lh surfaces prior to fixing, 50, unitless
# Measure rhSurfaceHoles, rhSurfaceHoles, Number of defect holes in rh surfaces prior to fixing, 30, unitless
# Measure SurfaceHoles, SurfaceHoles, Total number of defect holes in surfaces prior to fixing, 80, unitless
# Measure EstimatedTotalIntraCranialVol, eTIV, Estimated Total Intracranial Volume, 1518517.873449, mm^3
# SegVolFile mri/aseg.mgz
# SegVolFileTimeStamp 2021/04/06 19:55:39
# ColorTable /opt/freesurfer-6.0.0-min/ASegStatsLUT.txt
# ColorTableTimeStamp 2017/01/18 17:00:02
# InVolFile mri/norm.mgz
# InVolFileTimeStamp 2021/04/06 13:03:03
# InVolFrame 0
# PVVolFile mri/norm.mgz
# PVVolFileTimeStamp 2021/04/06 13:03:03
# Excluding Cortical Gray and White Matter
# ExcludeSegId 0 2 3 41 42
# VoxelVolume_mm3 1
# TableCol 1 ColHeader Index
# TableCol 1 FieldName Index
# TableCol 1 Units NA
# TableCol 2 ColHeader SegId
# TableCol 2 FieldName Segmentation Id
# TableCol 2 Units NA
# TableCol 3 ColHeader NVoxels
# TableCol 3 FieldName Number of Voxels
# TableCol 3 Units unitless
# TableCol 4 ColHeader Volume_mm3
# TableCol 4 FieldName Volume
# TableCol 4 Units mm^3
# TableCol 5 ColHeader StructName
# TableCol 5 FieldName Structure Name
# TableCol 5 Units NA
# TableCol 6 ColHeader normMean
# TableCol 6 FieldName Intensity normMean
# TableCol 6 Units MR
# TableCol 7 ColHeader normStdDev
# TableCol 7 FieldName Itensity normStdDev
# TableCol 7 Units MR
# TableCol 8 ColHeader normMin
# TableCol 8 FieldName Intensity normMin
# TableCol 8 Units MR
# TableCol 9 ColHeader normMax
# TableCol 9 FieldName Intensity normMax
# TableCol 9 Units MR
# TableCol 10 ColHeader normRange
# TableCol 10 FieldName Intensity normRange
# TableCol 10 Units MR
# NRows 45
# NTableCols 10
# ColHeaders Index SegId NVoxels Volume_mm3 StructName normMean normStdDev normMin normMax normRange
1 4 8771 9124.1 Left-Lateral-Ventricle 20.7584 13.9166 0.0000 84.0000 84.0000
2 5 577 615.8 Left-Inf-Lat-Vent 35.2998 15.9115 0.0000 83.0000 83.0000
3 7 13929 14818.6 Left-Cerebellum-White-Matter 81.7133 8.4380 13.0000 106.0000 93.0000
4 8 56122 56061.7 Left-Cerebellum-Cortex 52.5078 12.5745 0.0000 130.0000 130.0000
5 10 8494 8188.1 Left-Thalamus-Proper 83.4987 10.3988 19.0000 109.0000 90.0000
6 11 4309 4334.8 Left-Caudate 71.5516 7.7897 38.0000 99.0000 61.0000
7 12 5436 5418.0 Left-Putamen 80.5486 6.3864 48.0000 106.0000 58.0000
8 13 2156 2102.8 Left-Pallidum 95.1633 5.3868 71.0000 111.0000 40.0000
9 14 1137 1187.8 3rd-Ventricle 28.6016 15.2157 2.0000 79.0000 77.0000
10 15 3587 3740.4 4th-Ventricle 14.2138 10.1541 0.0000 65.0000 65.0000
11 16 20001 20132.3 Brain-Stem 80.7432 10.5844 13.0000 125.0000 112.0000
12 17 4250 4074.2 Left-Hippocampus 62.3169 9.2062 13.0000 108.0000 95.0000
13 18 1847 1784.3 Left-Amygdala 64.3546 7.1456 31.0000 91.0000 60.0000
14 24 1013 1013.6 CSF 33.8045 12.9771 6.0000 68.0000 62.0000
15 26 663 673.0 Left-Accumbens-area 69.0724 6.4822 29.0000 98.0000 69.0000
16 28 4428 4201.4 Left-VentralDC 89.0976 12.4963 21.0000 109.0000 88.0000
17 30 4 8.6 Left-vessel 56.0000 3.1623 52.0000 59.0000 7.0000
18 31 650 565.3 Left-choroid-plexus 45.2400 12.1988 19.0000 86.0000 67.0000
19 43 8683 8976.5 Right-Lateral-Ventricle 20.9663 13.9983 0.0000 85.0000 85.0000
20 44 361 393.1 Right-Inf-Lat-Vent 32.0443 17.2848 0.0000 76.0000 76.0000
21 46 14510 15185.5 Right-Cerebellum-White-Matter 77.3130 8.1816 8.0000 112.0000 104.0000
22 47 55878 56003.1 Right-Cerebellum-Cortex 49.9057 12.6932 0.0000 95.0000 95.0000
23 49 8623 8275.7 Right-Thalamus-Proper 83.1272 10.1998 15.0000 108.0000 93.0000
24 50 4679 4595.0 Right-Caudate 71.8949 8.5059 31.0000 98.0000 67.0000
25 51 5625 5572.3 Right-Putamen 78.5858 7.1141 28.0000 103.0000 75.0000
26 52 1922 1824.4 Right-Pallidum 92.4246 5.8170 31.0000 110.0000 79.0000
27 53 4454 4291.2 Right-Hippocampus 61.7443 9.0039 16.0000 100.0000 84.0000
28 54 1777 1715.3 Right-Amygdala 60.3742 7.5962 33.0000 92.0000 59.0000
29 58 756 746.3 Right-Accumbens-area 67.1958 6.0817 47.0000 93.0000 46.0000
30 60 4451 4264.5 Right-VentralDC 88.6989 12.8147 15.0000 109.0000 94.0000
31 62 15 21.5 Right-vessel 54.2000 6.9096 40.0000 66.0000 26.0000
32 63 777 669.3 Right-choroid-plexus 44.2085 13.8733 14.0000 79.0000 65.0000
33 72 0 0.0 5th-Ventricle 0.0000 0.0000 0.0000 0.0000 0.0000
34 77 1449 1312.0 WM-hypointensities 64.5162 16.2334 0.0000 98.0000 98.0000
35 78 0 0.0 Left-WM-hypointensities 0.0000 0.0000 0.0000 0.0000 0.0000
36 79 0 0.0 Right-WM-hypointensities 0.0000 0.0000 0.0000 0.0000 0.0000
37 80 0 0.0 non-WM-hypointensities 0.0000 0.0000 0.0000 0.0000 0.0000
38 81 0 0.0 Left-non-WM-hypointensities 0.0000 0.0000 0.0000 0.0000 0.0000
39 82 0 0.0 Right-non-WM-hypointensities 0.0000 0.0000 0.0000 0.0000 0.0000
40 85 112 101.3 Optic-Chiasm 75.9554 20.3958 24.0000 110.0000 86.0000
41 251 831 781.5 CC_Posterior 98.9519 13.9526 40.0000 111.0000 71.0000
42 252 504 454.9 CC_Mid_Posterior 91.1131 16.7744 23.0000 109.0000 86.0000
43 253 634 555.5 CC_Central 89.1435 17.9143 33.0000 113.0000 80.0000
44 254 483 433.6 CC_Mid_Anterior 95.0932 17.3683 24.0000 116.0000 92.0000
45 255 1106 1038.9 CC_Anterior 100.6347 18.6827 31.0000 124.0000 93.0000
Loading

0 comments on commit ef33b03

Please sign in to comment.