THIS PAGE HAS BEEN MOVED TO SHAREPOINT!
For LCN faculty/staff, please refer to this site/make edits here for the most updated information: https://partnershealthcare.sharepoint.com/sites/LCN/SitePages/ADNI.aspx
ADNI Archive
This page contains all old notes regarding downloading and processing ADNI data.
ADNI Download Notes
Notes on how to download ADNI subject data and incorporate into our local copy, which is found here:
cd /autofs/space/mreuter/ADNI
The main ADNI site is here: http://adni.loni.ucla.edu/
It is necessary to obtain an account with them in order to download data from the LONI site, which is here: https://ida.loni.ucla.edu/login.jsp?project=ADNI
T2/PD data
on the LONI ADNI page, click on Search->Advanced Search
- for 'month 0' scans, select both Screening and Baseline, or select one of the other months (for longitudinal scans)
- enter '*PD*T2*' in the MRI Series Description text box
- select PD and T2 weighting
- select Image count All
- click the SEARCH button
- now you will need to save the matches, to do this you will need to select each scan on every page of the results (there could be 20 or more pages of results, because the stupid interface seems to display only 20 at a time). click the 'Click here to select all series on the page' checkbox, but then uncheck duplicate scans for the same subject.
- before going to the next page, click Add to Collection. if this is the first page of the search, then create a new collection name (say, 'Month_6_PDT2'). Click Add.
- repeat the 'select all', 'unselect duplicates', 'add to collection' step for each page of the search results (warning! this is mind numbingly boring, tedious and time consuming!)
once the image collection is done, click on Download->Image Collections, in My Collections, find the collection you just created and select 'Not Downloaded'
- select the 'All' checkbox
- select the 'Nifti' radio button
click DOWNLOAD, this brings-up a java box which then prompts for a directory. these downloads should be saved to a local directory (not the main ADNI dir, as that is short on space). i use /autofs/space/terrier_001/users/nicks/tmp. once that is selected, then it will begin downloading, which could take days....
- once the download finishes, by default the java thing puts the files in a directory named ADNI... rename that to something appropriate, in this example, to "Month_6_PDT2"
- within this dir, the .xml files contain info on the PD and T2 files, and the name itself contains unique identifying info for each file, so a script is necessary to extract all this and mri_convert the nifti file. that script looks like this:
#\! /bin/tcsh -ef # the adni root dir set ADNI=(/autofs/cluster/con_002/users/ADNI) # the month we're working with (be sure to update this var!!!!!!) set m=(_m6) foreach f (`ls *.xml`) # find out which image type this .xml file describes (PD or T2) set weighting=(`grep Weighting $f | awk 'BEGIN { FS = "[<>]" } ; {printf $3}'`) # chop-off .xml extension set ff=(`basename $f .xml`) # extract subject name set subjid=(`echo $ff | awk 'BEGIN { FS = "_" } ; {printf $4}'`) # extract unique identifier for this file set uid=(`echo $ff | awk 'BEGIN { FS = "_I" } ; {printf $2}'`) # convert file, storing into main adni dir set niifile=(`find | grep "_S_${subjid}" | grep "_I${uid}" | grep "\.nii"`) set origdir=($ADNI/${subjid}${m}/mri/orig) if ( -e $origdir) then mri_convert $niifile $origdir/${weighting}.mgz endif end
In this script, be sure to update the 'm' var to the proper month if reusing this script on a different month!
- Next, a 'subjects' script needs to be created to set the SUBJECTS var with the names of the subjects which have PD and T2 files for this month (the files we just copied). To do that:
cd /autofs/cluster/con_002/users/ADNI echo "#! /bin/tcsh -ef" > scripts/PD_T2_Month_6_subjs echo "set SUBJECTS=(\\" >> scripts/PD_T2_Month_6_subjs foreach s (`ls -d ????_m6`) if ( -e $s/mri/orig/PD.mgz) then if ( -e $s/mri/orig/T2.mgz) then echo $s echo "$s \\" >> scripts/PD_T2_Month_6_subjs endif endif end echo ")" >> scripts/PD_T2_Month_6_subjs echo "echo <dollar>SUBJECTS" >> scripts/PD_T2_Month_6_subjs echo "" >> scripts/PD_T2_Month_6_subjs echo "echo <dollar>#SUBJECTS month_6 subjects with PD and T2 scans" >> scripts/PD_T2_Month_6_subjs
Be sure to update the month in this script! Also, you will need edit the script (PD_T2_Month_X_subjs) to replace <dollar> with $ before SUBJECTS, since its not possible to echo a dollar.
- As of 30 Aug 2011, the following scripts define the available PD/T2 files, found in the subjects /mri/orig dir as PD.mgz and T2.mgz:
- scripts/PD_T2_Month_0_subjs
- scripts/PD_T2_Month_6_subjs
- scripts/PD_T2_Month_12_subjs
- scripts/PD_T2_Month_18_subjs
- scripts/PD_T2_Month_24_subjs
- scripts/PD_T2_Month_36_subjs
ADNI data was previously stored here:
cd /autofs/cluster/con_002/users/ADNI