Skip to content

Commit

Permalink
Merge pull request #20 from AlexBowring/amended_FSL_analyses
Browse files Browse the repository at this point in the history
Amended ds120 analyses
  • Loading branch information
AlexBowring authored Nov 8, 2020
2 parents edd62be + 6ee33bc commit 6e33f78
Show file tree
Hide file tree
Showing 6 changed files with 845 additions and 9 deletions.
359 changes: 359 additions & 0 deletions figures/ds120_notebook_amended.ipynb

Large diffs are not rendered by default.

29 changes: 20 additions & 9 deletions figures/lib/download_data_amended.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,26 @@ def download_data(nv_collection, study, output_dir):
print(url + " already downloaded at " + localzip_rel)

# --- Copy CSV files with Euler characteristics and Cluster counts
euler_char_files = (
(os.path.join('AFNI', 'LEVEL2', 'euler_chars.csv'), 'afni_euler_chars.csv'),
(os.path.join('SPM', 'LEVEL2', 'euler_chars.csv'), 'spm_euler_chars.csv'),
)

cluster_count_files = (
(os.path.join('AFNI', 'LEVEL2', 'cluster_count.csv'), 'afni_cluster_count.csv'),
(os.path.join('SPM', 'LEVEL2', 'cluster_count.csv'), 'spm_cluster_count.csv'),
)
if study not in ('ds120'):
euler_char_files = (
(os.path.join('AFNI', 'LEVEL2', 'euler_chars.csv'), 'afni_euler_chars.csv'),
(os.path.join('SPM', 'LEVEL2', 'euler_chars.csv'), 'spm_euler_chars.csv'),
)

cluster_count_files = (
(os.path.join('AFNI', 'LEVEL2', 'cluster_count.csv'), 'afni_cluster_count.csv'),
(os.path.join('SPM', 'LEVEL2', 'cluster_count.csv'), 'spm_cluster_count.csv'),
)
else:
euler_char_files = (
(os.path.join('AFNI', 'LEVEL2_AMENDED', 'euler_chars.csv'), 'afni_euler_chars.csv'),
(os.path.join('SPM', 'LEVEL2', 'euler_chars.csv'), 'spm_euler_chars.csv'),
)

cluster_count_files = (
(os.path.join('AFNI', 'LEVEL2_AMENDED', 'cluster_count.csv'), 'afni_cluster_count.csv'),
(os.path.join('SPM', 'LEVEL2', 'cluster_count.csv'), 'spm_cluster_count.csv'),
)

if study not in ('ds120'):
if study not in ('ds001'):
Expand Down
20 changes: 20 additions & 0 deletions scripts/ds120_euler_chars_amended.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
base_dir = '/home/maullz/NIDM-Ex/BIDS_Data/RESULTS/SOFTWARE_COMPARISON/';
study = 'ds120';

if ~exist('euler_chars', 'file')
addpath(fullfile(fileparts(mfilename('fullpath')), 'lib'))
end

study_dir = fullfile(base_dir, study);
spm_stat_file = fullfile(study_dir, 'SPM', 'LEVEL2', 'spmF_0002.nii');
afni_stat_file = fullfile(study_dir, 'AFNI', 'LEVEL2_AMENDED', 'Group_f_stat_masked.nii.gz');
spm_mask = fullfile(study_dir, 'SPM', 'LEVEL2', 'mask.nii');
afni_mask = fullfile(study_dir, 'AFNI', 'LEVEL2_AMENDED', 'mask.nii.gz');

euler_array = {spm_stat_file, afni_stat_file};
mask_array = {spm_mask, afni_mask};


for i=1:length(euler_array)
euler_chars_f_statistic(euler_array{i}, mask_array{i});
end
22 changes: 22 additions & 0 deletions scripts/ds120_r_squared_maps_amended.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
base_dir = '/home/maullz/NIDM-Ex/BIDS_Data/RESULTS/SOFTWARE_COMPARISON/';
study = 'ds120';
% Find degrees of freedom in 2nd-level results
spm_dof1 = 8;
spm_dof2 = 142;
afni_dof1 = 7;
afni_dof2 = 98;

if ~exist('r_squared_maps', 'file')
addpath(fullfile(fileparts(mfilename('fullpath')), 'lib'))
end

study_dir = fullfile(base_dir, study);
spm_stat_file = fullfile(study_dir, 'SPM', 'LEVEL2', 'spmF_0002.nii');
afni_stat_file = fullfile(study_dir, 'AFNI', 'LEVEL2_AMENDED', 'Group_f_stat_masked.nii.gz');
spm_mask = fullfile(study_dir, 'SPM', 'LEVEL2', 'mask.nii');
afni_mask = fullfile(study_dir, 'AFNI', 'LEVEL2_AMENDED', 'mask.nii.gz');

% Creating r_squared_maps, degrees of freedom obtained from second level results
r_squared_maps(afni_stat_file, afni_mask, afni_dof1, afni_dof2, study_dir);
r_squared_maps(spm_stat_file, spm_mask, spm_dof1, spm_dof2, study_dir);

Loading

0 comments on commit 6e33f78

Please sign in to comment.