Skip to content

putiw/DecodingPublic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Identifying cortical areas that underlie the transformation from 2D retinal to 3D head-centric motion signals

Screen

Table of Contents
  1. Getting Started
  2. Pipelines
  3. Analysis
  4. Visualization

Getting Started


Download dataset from OpenNeuro



  • Download with nodejs, S3, or datalad
openneuro download --draft ds004443 ds004443-download/
aws s3 sync --no-sign-request s3://openneuro.org/ds004443 ds004443-download/
datalad install https://github.com/OpenNeuroDatasets/ds004443.git

  • Dataset is in BIDS format such that the each subject folder sub-0XXX contains the orginal raw NIfTI files for both anatomical and funcational files, and the folder derivatives/fmriprep contains files that have been processed through fMRIPrep (in T1w space and in fsaverage6 space).
    Read more about the output space here.

Setup GitHub repositories


  • Go to Github directory
    cd ~/Documents/GitHub 
  • Clone the repositories
    git clone https://github.com/putiw/DecodingPublic.git
    git clone https://github.com/Rokers/TAFKAP.git
    git clone https://github.com/cvnlab/knkutils.git
    git clone https://github.com/cvnlab/cvncode.git
    git clone https://github.com/gllmflndn/gifti.git

(back to top)


Pipelines


dcm2bids


  • In this step we converted data from raw DICOM images into NIfTI files and organized data in BIDS format using Dcm2Bids.

  • The output of this step is provided on OpenNeuro and is used in the proceeding steps. (The DICOM images will be provided upon request).


fMRIPrep


  • We processed raw NIfTI files (those within sub-0XXX folder) using fMRIPrep version: 20.2.6.

Using the fMRIPrep command: /usr/local/miniconda/bin/fmriprep --nprocs 14 --omp-nthreads 14 /scratch/pw1246/MRI/Decoding/rawdata /scratch/pw1246/MRI/Decoding/derivatives participant --fs-license-file /scratch/pw1246/MRI/Decoding/code/license.txt --output-space T1w:res-native fsnative:den-41k MNI152NLin2009cAsym:res-native fsaverage:den-41k --participant_label sub-0201 --skip_bids_validation -w /tmpdata/pw1246/2800748/1 --no-submm-recon


  • The output of this step can be found in the derivatives/fmriprep folder.

        * 📝 Note: this step also requires freeSurfer.


Extract ROIs


  • We extracted the region of interests (ROIs) using the neuropythy pipeline.

  • Example way of running neuropythy with Docker.

docker run -ti --rm -v <path-to-SUBJECTS_DIR>:/subjects nben/neuropythy atlas --verbose <subject-ID> --volume-export
  • This step generates the ROI atlas file named wang15_mplbl.mgz in derivatives/freesurfer/sub-xxxx/mri folder.

     * 📝 Note: You can find the output of this step (i.e. pre-generated the ROIs files in appropriate resolution) in derivatives/fmriprep/sub-xxxx/ses-01/anat/rois folder.

     * 📝 Note: Alternatively, you can run extractRois.m in the current repo to generate the same files.

     * 📝 Note: A better way: atlasmgz (the paper did not use this way)


Analysis


TAFKAP


  • This analysis resulted in figure 3 to 6.
    See orginal paper here.
    See the code for this analysis here: run_TAFKAP.

  • The input to this code is the fmriprep processed NIfTI files in derivatives/fmriprep/sub-xxxx/ses-xx/func folder.
    The file name should contain "*space-T1w_desc-preproc_bold.nii.gz".

  • The only variable that needs user input is the bidsDir, which should be set to whichever the directory of the project is in.

  • The code will print out the decoding accuracy for each ROI and for each subject as the output in the command window.

  • You can play with different ways of denoise, detrend, and estimate response amplitude in the sub-function load_vol.m


Searchlight


  • This analysis resulted in figure 7 and 8.
    See the code for this analysis here: run_Searchlight.

  • The required input files to the searchlight analysis are the functional scans in fsaverage6 space in the derivatives/fmriprep/sub-xxxx/func/ folder.
    The file name should contain "*space-fsaverage6_hemi-R_bold.func.gii".

  • You will also need the inflate surface files in the derivatives/freesurfer/fsaverage6/mri folder.


  • The output is the 81924 by 1 matrix containing one decoding accuracy value for each vertex in the fsaverage6 space.
    This result can be then used in further analysis.

  • You will need to manually define three directories.

bidsDir = '/Volumes/Vision/MRI/DecodingPublic'; % project directory containing the folder **derivatives**.
fsDir = '/Applications/freesurfer/7.2.0'; % freesurfer directory, most likely in application folder.
gitDir = '~/Documents/GitHub'; % GitHub directory, where you installed all the repositories. 
set_up(bidsDir,gitDir,fsDir)
  • You can play with different ways of denoise, detrend, and estimate response amplitude in the sub-function load_surf.m

Visualization

Contact

Puti Wen - pw1246@nyu.edu

(back to top)

About

Analysis code for single-trial fMRI decoding of stereoscopic and perspective 3D motion cues

Topics

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages