https://github.com/dagdpz/rs-fmri-afni-macaque

Resting state fMRI analysis using MACAQUE_DEMO in AFNI

https://github.com/dagdpz/rs-fmri-afni-macaque

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.6%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

Resting state fMRI analysis using MACAQUE_DEMO in AFNI

Basic Info
  • Host: GitHub
  • Owner: dagdpz
  • Language: Jupyter Notebook
  • Default Branch: master
  • Size: 2.26 MB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created about 2 years ago · Last pushed 12 months ago
Metadata Files
Readme

README.md

rs-fMRI-afni-macaque

Resting state fMRI analysis using MACAQUE_DEMO in AFNI

  • Initial version by Pascal G. (see below 'TB_scripts')
  • Further developed by Tabea B. (TB_scripts)

TB_scripts

  • This folder contains all scripts which were created by Tabea Bruening during her work for her bachelor thesis. This folder provides README files for every script.
  • For more information, please refer to 'TB_scripts'

README by Pascal G.

Based on README.txt by Pascal G.

Data

The data used with these scripts is from Linus_20230704. They are resting state recordings of an anesthetized monkey that were separated into two sessions (predrug and postdrug). A drug was applied to inhibit the resting state activity of the pulvinar in the right hemisphere. With these scripts we determined if there is a difference in the resting state activity of the whole brain when comparing the two different conditions.

mac1003: contains anatomical scans, 0101T1w and 0102T1w. T1w was used for skull-stripping and alignment to EPI for Linus20230704 mac1004: functional runs before drug injection (runs 1-6) mac_1005: functional runs after drug injection (runs 7-10)

MRI folder structure

Everything can be found in the /MRI folder. Archive: failed attempts, old versions, etc. These files serve no purpose anymore data: original dicom files, unedited nifti files in bids-structure Linusanalysis: analyzed data from Linus (recordings from 20230704 and 20131015) with and without smoothing MACAQUEDEMO: the analyzed macaque demo provided by AFNI, the unmodified do* and run* scripts are also here Tests: Testing certain things such as new scripts or modifications of already existing ones


Scripts

The two folders provided in github (scripts, scripts_ordered) contain the same files, but the 'scripts' folder can be copied like it is to start the data analysis for your dataset, no structural changes need to be made to this directory.

The 'scriptsordered' directory is ordered more intuitevely but would need to be structured in the same way as 'scripts' to work for data analysis. Additionally, 'scriptsordered' contains .json config files for dcm2bids and .ipynb scripts for further data analysis such as creating histograms of correlation coefficients for visualization and for statistical tests.

The do* and run* scripts were provided by the MACAQUEDEMO from the AFNI docs and were modified to suit our data. The scripts provided are used to analyze the dataset of Linus20230704. Modify the path variables in the script to be suitable for your analysis.

All scripts were made to be run from the /scripts directory (exemplary structure in the MACAQUEDEMO), meaning they should all (except for the .json files) be in one folder without other subdirectories. For that you can just copy the 'scripts' folder from github. If you want to use the provided .json files as config files for dcm2bids, move them into the /code directory created by dcm2bidsscaffold (described in dcm2bids).

A custom tcsh script was written to automate the process of correctly orienting anatomical and EPI recordings. Python scripts were written for further analysis and validation of the results.

do13aw.tcsh: runs animal warper to perform alignment of subject to template and skull-stripping run13aw.tcsh: loops do13aw over subjects and sessions

do20apvox: uses afniproc.py to align EPI recordings to skull-stripped anatomical in a voxelwise manner run20apvox.tcsh: loops do20apvox over subjects and sessions

do22aproi.tcsh: uses afniproc.py to align EPI recordings to skull-stripped anatomical in a roi-based manner run22aproi.tcsh: loops do22aproi over subjects and sessions

do30pproi.tcsh: creates correlation matrix and plots of the roi-based analysis using 3dnetcorr and others run30pproi.tcsh: loops do30pp_roi over subjects and sessions

runall.tcsh: assumes that you have a dcm2bids structure and runs all steps there: - reorientflippedLIPtoLPI - all run* scripts

dcm2bidsscaffoldhelper.tcsh: creates bids scaffold and helper files to write your config file. Three exemplary config files are provided: https://github.com/dagdpz/rs-fMRI-afni-macaque/tree/master/scriptsordered/dcm2bidsconfig_files

dcm2bidsconv: an example of a dcm2bids command which creates the bids structure and then moves the bids directory to the databasic folder where the analysis with the run_* scripts continues

In case you do not want to run all scripts, you can run them separately with the dcm2bids package to convert DICOMs to NIFTI and with the run* scripts. To run tcsh scripts type (e.g.) the following into the terminal: tcsh run13_aw.tcsh


dcm2bids

How to get started is explained here: https://unfmontreal.github.io/Dcm2Bids/3.1.1/

But to give a brief overview: - !Use '-h' as an options for the commands to view all options and their explanations! - first run 'dcm2bidsscaffold', this command will create empty folders for the bids structure such as code (for the config file you will create later), sourcedata, etc. - move your DICOM data into the sourcedata folder; it is fine to copy entire directories, does not need to be raw unordered dicoms - run 'dcm2bidshelper', this command creates json files that you can extract information from to create a config file. This step has to be done manually as you need to find unique identifiers for the different NIFTI files you want to create. Three exemplary config files are provided and labeled according to their corresponding data - after you manually created your config file, you run 'dcm2bids' where you specify the created config file among others. this command creates the final bids structure in the directory you specified and converts the Dicom files to NIFTI files

The script 'dcm2bidsscaffoldhelper.tcsh' runs dcm2bidsscaffold and dcm2bidshelper. the script 'dcm2bidsconv' is an example of a dcm2bids command which creates the bids structure and then moves the bids directory to the databasic folder where the analysis with the run_* scripts continues.


Requirements

For the scripts to work you need basic data with anatomical and functional scans which are ordered in the bids structure with a separation into sessions. Atlas and template, provided in the MACAQUEDEMO to copy into the directory one above 'scripts' (NMTv2.1_sym; you will need the whole folder). dcm2bids installed with conda, afni version 24.0.12 or newer, Python matplotlib.pyplot

https://www.hostinger.com/tutorials/how-to-install-anaconda-on-ubuntu/


Instructions with Linus20230704 as an example

  • Copy the 'scripts' folder from github: rs-fMRI-afni-macaque
  • run the script 'dcm2bidsscaffoldhelper.tcsh'
  • put dicom data into the 'sourcedata' directory
  • put the config file into the /bids_structure/code (in case of Linus20230704 you need one config file for every session, hence why there are two config files for that dataset)
  • run 'dcm2bids_conv'
  • copy the NMTv2.1sym folder into the directory one above scripts
  • run 'run_all.tcsh'

If you want to use any other dataset, modify the paths in these scripts: dcm2bidsscaffoldhelper, dcm2bidsconv, all of the do* and run_* scripts

Owner

  • Name: Decision and Awareness Group, German Primate Center
  • Login: dagdpz
  • Kind: organization

GitHub Events

Total
  • Push event: 217
  • Gollum event: 2
Last Year
  • Push event: 217
  • Gollum event: 2