This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find native-to-freesurfer transform matrix | |
tkregister2 --mov out/fmriprep/sub-06/anat/sub-06_T1w_preproc.nii.gz --targ out/freesurfer/sub-06/mri/orig.mgz --reg native2fs.dat --noedit --regheader --s sub-06 | |
# Convert to lta | |
lta_convert --src out/fmriprep/sub-06/anat/sub-06_T1w_preproc.nii.gz --trg out/freesurfer/sub-06/mri/orig.mgz --inreg native2fs.dat --outlta native2fs.lta --subject sub-06 | |
# Concatenate BOLD-to-native and native-to-freesurfer | |
mri_concatenate_lta -out_type 1 -subject sub-06 work/fmriprep_wf/single_subject_06_wf/func_preproc_ses_pre_task_rest_run_01_wf/bold_reg_wf/bbreg_wf/bbregister/uni_xform_masked_bbreg_sub-06.lta native2fs.lta bold2fs.lta |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find native-to-freesurfer transform matrix | |
tkregister2 --mov out/fmriprep/sub-06/anat/sub-06_T1w_preproc.nii.gz --targ out/freesurfer/sub-06/mri/orig.mgz --reg native2fs.dat --noedit --regheader --s sub-06 | |
# Convert to lta | |
lta_convert --src out/fmriprep/sub-06/anat/sub-06_T1w_preproc.nii.gz --trg out/freesurfer/sub-06/mri/orig.mgz --inreg native2fs.dat --outlta native2fs.lta --subject sub-06 | |
# Concatenate BOLD-to-native and native-to-freesurfer | |
mri_concatenate_lta -out_type 1 -subject sub-06 work/fmriprep_wf/single_subject_06_wf/func_preproc_ses_pre_task_rest_run_01_wf/bold_reg_wf/bbreg_wf/bbregister/uni_xform_masked_bbreg_sub-06.lta native2fs.lta bold2fs.lta |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nibabel as nb | |
from nipype.utils.filemanip import fname_presuffix | |
def center_surface(in_gifti, newpath=None, | |
offset_from=['VolGeomC_R', 'VolGeomC_A', 'VolGeomC_S']): | |
gii = nb.load(in_gifti) | |
offset = [float(gii.darrays[0].meta.metadata[v]) for v in offset_from] | |
data = gii.darrays[0].data + offset | |
meta = gii.darrays[0].meta.metadata | |
for k in offset_from: | |
meta[k] = '%f' % 0.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
#SBATCH -J fmriprep | |
#SBATCH --array=1-257%7 | |
#SBATCH --time=24:00:00 | |
#SBATCH -n 1 | |
#SBATCH --cpus-per-task=16 | |
#SBATCH --mem-per-cpu=4G | |
#SBATCH -p russpold,owners,normal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find empty folders starting with ds | |
for dir in ds*; do [ -z "`find $dir -maxdepth 1 -type f`" ] && echo "$dir is empty"; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
antsRegistration -d 3 -m MI[sub-EMV00017_run-01_T2w_preproc.nii.gz,time2_hmc_avg_inu.nii.gz,1.0,32,Random,0.2] -t Affine[0.01] -c [100x100x100,1.0e-8,25] -s 0.6x0.4x0.2mm -f 2x1x1 -l -x [sub-EMV00017_run-01_T2w_brainmask.nii.gz] -u -v -o ts2_epi0 -a 1 | |
antsRegistration -d 3 -m MI[sub-EMV00017_run-01_T2w_preproc.nii.gz,time2_hmc_avg_inu.nii.gz,0.5,32,Random,0.2] -m CC[sub-EMV00017_run-01_T2w_preproc.nii.gz,time2_hmc_avg_inu.nii.gz,0.5,5,Random,0.2] -t SyN[1,2.0,1.75] -c [200x50,1.0e-8,5] -s 0.4x0mm -f 2x1 -m MI[sub-EMV00017_run-01_T2w_preproc.nii.gz,time2_hmc_avg_inu.nii.gz,0.5,32,Random,0.2] -m CC[sub-EMV00017_run-01_T2w_preproc.nii.gz,time2_hmc_avg_inu.nii.gz,0.5,5,Random,0.2] -t SyN[1,1.0,0.75] -c [200x50,1.0e-8,5] -s 0.6x0.2mm -f 2x1 -l -x [sub-EMV00017_run-01_T2w_brainmask.nii.gz] -l -x [sub-EMV00017_run-01_T2w_brainmask.nii.gz] -u -v -o ts2_epiA -a 1 -r ts2_epi0Composite.h5 &> ts2.log | |
antsApplyTransforms -d 3 -i ~/Data/LC_dfMRI/tpl-Schwarz/tpl-Schwarz_rois.nii.gz -r time2_hmc_avg_inu.nii.gz -o time2_rois. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import getenv | |
from pathlib import Path | |
from json import load | |
import urllib.request, json | |
import pandas as pd | |
def get_rating(checksum): | |
""" | |
Grab the latest rating found for a given MD5 checksum. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Makefile for Sphinx documentation | |
# | |
# You can set these variables from the command line. | |
SPHINXOPTS = | |
SPHINXBUILD = sphinx-build | |
PAPER = | |
BUILDDIR = _build | |
# User-friendly check for sphinx-build |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- | |
# vi: set ft=python sts=4 ts=4 sw=4 et: | |
""" | |
A tool to sample OpenfMRI datasets using a datalad installation | |
Please run this first: :: | |
# install openfmri dataset | |
datalad install -r ///openfmri |