In [1]:
import os.path as op
In [ ]:
%%bash
sub_list=~/Experiments/ObjFam/data/subids_subset_no23or19.txt
for hemi in lh rh
do
make_masks.py -s $sub_list -roi $hemi.17Networks_5 \
-label 17Networks_5 -sample graymid -hemi $hemi -debug -unsmoothed
done
In [7]:
%%bash
sub_list=~/Experiments/ObjFam/data/subids_subset_no23or19.txt
for hemi in lh rh
do
make_masks.py -s $sub_list -roi $hemi.perirhinal \
-aseg -id 222 -native -hemi $hemi -debug -unsmoothed
done
In [10]:
%%bash
sub_list=~/Experiments/ObjFam/data/subids_subset_no23or19.txt
for hemi in lh rh
do
make_masks.py -s $sub_list -roi $hemi.spl-hit-miss \
-native -label superiorparietal -sample graymid -hemi $hemi -debug -smoothed \
-exp objfam-submem -contrast hit-miss -thresh 2
done
In [5]:
%%bash
sub_list=~/Experiments/ObjFam/data/subids_subset_no23or19.txt
for hemi in lh rh
do
make_masks.py -s $sub_list -roi $hemi.hit-miss \
-label 17Networks_5 \
-sample graymid -hemi $hemi -debug -unsmoothed \
-exp objfam-submem_nuisance_comb -contrast hit-miss -thresh 2
done
In [2]:
%%bash
for subjid in 150; do
mri_annotation2label --subject ap$subjid --hemi rh --outdir /Volumes/group/awagner/sgagnon/AP/data/ap$subjid/label
mri_annotation2label --subject ap$subjid --hemi lh --outdir /Volumes/group/awagner/sgagnon/AP/data/ap$subjid/label
done
In [2]:
%%bash
sub_list=/Volumes/group/awagner/sgagnon/AP/scripts/subjects.txt
for hemi in lh rh
do
make_masks.py -s $sub_list -roi $hemi.parahippocampal -exp mvpa \
-label parahippocampal -native -sample graymid -hemi $hemi -debug -unsmoothed
done
In [5]:
%%bash
#sub_list=/Volumes/group/awagner/sgagnon/AP/scripts/subjects.txt
sub_list=ap150
make_masks.py -s $sub_list -roi bilat-fusiform -exp mvpa \
-label fusiform -native -sample graymid -debug -unsmoothed
In [7]:
%%bash
sub_list=/Volumes/group/awagner/sgagnon/AP/scripts/subjects.txt
fs_dir=/Volumes/group/awagner/sgagnon/AP/data
IFS=,
while read subid
do
echo $subid
mask_path=$fs_dir/$subid/masks
fslmaths $mask_path/bilat-parahippocampal.nii.gz \
-add $mask_path/bilat-fusiform.nii.gz \
-add $mask_path/bilat-inferiortemporal.nii.gz \
-bin $mask_path/bilat-parahipp_fusi_inftemp.nii.gz
done < $sub_list
In [ ]:
In [9]:
%%bash
sub_list=~/Experiments/ObjFam/data/subids_subset_no23or19.txt
for hemi in lh rh
do
make_masks.py -s $sub_list -hemi $hemi -roi $hemi.perirhinal -label perirhinal -sample graymid -debug -unsmoothed
done
In [49]:
%%bash
mri_annotation2label --annotation aparc --hemi rh --subject fsaverage --outdir $SUBJECTS_DIR/fsaverage/label
mri_annotation2label --annotation aparc --hemi lh --subject fsaverage --outdir $SUBJECTS_DIR/fsaverage/label
In [55]:
%%bash
sub_list=~/Experiments/ObjFam/data/subids_subset_no23or19.txt
make_masks.py -s $sub_list -roi Bilat-Hippocampus \
-aseg -id 17 53 -debug -unsmoothed
In [36]:
jeulich_locations = dict(hIP1_lh=1,
hIP1_rh=2,
hIP2_lh=3,
hIP2_rh=4,
hIP3_lh=5,
hIP3_rh=6)
atlas_path = '/usr/local/fsl/data/atlases/Juelich'
In [37]:
op.join(atlas_path, 'Juelich-maxprob-thr0-2mm.nii.gz')
Out[37]:
In [9]:
atlas_path = '/usr/local/fsl/data/atlases/HarvardOxford'
harvardoxford_locations = dict(SMG_ant = 19,
SMG_post = 20,
LO_supp = 22,
parahipp_post = 35,
parahipp_ant = 34,
occ_fusiform = 40,
temp_occ_fusiform = 39,
temp_fusiform_ant = 37,
temp_fusiform_post = 38)
In [12]:
harvardoxford_locations['parahipp_ant']
Out[12]:
In [16]:
op.join(atlas_path, 'HarvardOxford-cort-maxprob-thr0-2mm.nii.gz')
Out[16]:
In [43]:
%%bash
fslmaths '/usr/local/fsl/data/atlases/Juelich/Juelich-maxprob-thr0-2mm.nii.gz' -thr 6 -uthr 6 '/Users/steph-backup/Experiments/ObjFam/data/fsaverage/masks/hIP3_rh'
In [25]:
%%bash
sub_list=~/Experiments/ObjFam/data/subids_subset_no23or19.txt
mask1=17Networks_5.nii.gz
mask2=lateraloccipital.nii.gz
output=17Networks_5_LO.nii.gz
while read sub; do
subj_mask_dir='/Users/steph-backup/Experiments/ObjFam/data/'$sub'/masks/'
echo $subj_mask_dir
for hemi in lh rh; do
fslmaths $subj_mask_dir$hemi.$mask2 -mas $subj_mask_dir$hemi.$mask1 $subj_mask_dir$hemi.$output
done
done < $sub_list
In [26]:
%%bash
sub=subj25
mask1=17Networks_5.nii.gz
mask2=lateraloccipital.nii.gz
output=17Networks_5_LO.nii.gz
subj_mask_dir='/Users/steph-backup/Experiments/ObjFam/data/'$sub'/masks/'
echo $subj_mask_dir
for hemi in lh rh; do
fslmaths $subj_mask_dir$hemi.$mask2 -mas $subj_mask_dir$hemi.$mask1 $subj_mask_dir$hemi.$output
done
In [44]:
experiment = 'objfam-studyrep'
contrast_name = 'linear-study'
filepath = op.join('/Users/steph-backup/Experiments/ObjFam/scripts/analysis/',
experiment, 'group', 'mni', contrast_name,
'zstat1_threshold.nii.gz')
print filepath
outpath = op.join('/Users/steph-backup/Experiments/ObjFam/data/fsaverage/masks/',
'studyrep_linear-study')
print outpath
In [46]:
%%bash
fslmaths '/Users/steph-backup/Experiments/ObjFam/scripts/analysis/objfam-studyrep/group/mni/linear-study/zstat1_threshold.nii.gz' -thr 0 '/Users/steph-backup/Experiments/ObjFam/data/fsaverage/masks/studyrep_linear-study'
In [55]:
%%bash
mask_input=$SUBJECTS_DIR/fsaverage/masks/ventral_topdown.nii.gz
mask_output=$SUBJECTS_DIR/fsaverage/masks/ventral_topdown_inv.nii.gz
fslmaths $mask_input -mul -1 -add 1 $mask_output
In [56]:
%%bash
mask1=$SUBJECTS_DIR/fsaverage/masks/topdown_ALE_pN05.nii
mask2=$SUBJECTS_DIR/fsaverage/masks/ventral_topdown_inv.nii.gz
intersect_mask=$SUBJECTS_DIR/fsaverage/masks/topdown_ALE_ventral_inv.nii.gz
fslmaths $mask1 -mas $mask2 $intersect_mask
In [57]:
%%bash
mask_toconvert=$SUBJECTS_DIR/fsaverage/masks/topdown_ALE_ventral_inv.nii.gz
mask_output=$SUBJECTS_DIR/fsaverage/masks/topdownALEventral_inv_fslMNI.nii
#mask_toconvert=$SUBJECTS_DIR/fsaverage/masks/topdown_ALE_pN05.nii
flirt -in $mask_toconvert -ref $FSLDIR/data/standard/MNI152_T1_2mm -applyxfm -usesqform -out $mask_output
In [58]:
%%bash
#input=$SUBJECTS_DIR/fsaverage/masks/topdownALEventral_fslMNI.nii
#output=$SUBJECTS_DIR/fsaverage/masks/topdownALEventral_fslMNI_thresh.nii.gz
input=$SUBJECTS_DIR/fsaverage/masks/topdownALEventral_inv_fslMNI.nii
output=$SUBJECTS_DIR/fsaverage/masks/topdownALEventral_inv_fslMNI_thresh.nii
fslmaths $input -thr 0 -bin $output
In [ ]:
%%bash
mystruct=fsl.Info.standard_image("avg152T1_brain.nii.gz")
warps_into_MNI_space=warpfield.nii.gz
warp_mni2native=warp_mni2native.nii.gz
file_to_invwarp=topdown.nii.gz
outfile=topdown_native.nii.gz
invwarp --ref=$my_struct --warp=$warps_into_MNI_space --out=$warp_mni2native
applywarp --ref=$my_struct --in=$file_to_invwarp --warp=$warp_mni2native --out=$outfile --interp=nn
In [ ]:
In [51]:
%%bash
input=~/Experiments/ObjFam/scripts/analysis/objfam-submem_nuisance_comb/group/mni/hit-miss/zstat1_threshold.nii.gz
output=$SUBJECTS_DIR/fsaverage/masks/hit-miss_thresh.nii.gz
fslmaths $input -thr 0 -bin $output
In [ ]:
%%bash
input=~/Experiments/ObjFam/scripts/analysis/objfam-submem_nuisance_comb/group/mni/hit-miss/zstat1_threshold.nii.gz
output=$SUBJECTS_DIR/fsaverage/masks/hit-miss_thresh.nii.gz
fslmaths $input -thr 0 -bin $output
In [53]:
%%bash
curr_dir=`pwd`
cd /Users/steph-backup/Experiments/ObjFam/data/fsaverage/label
label1=rh.17Networks_5.label
label2=rh.superiorparietal.label
output=rh.Network5_SPL.label
./labels_union.sh $label1 $label2 $output
In [ ]: