PrincetonUniversity / princeton-mvpa-toolbox

Automatically exported from code.google.com/p/princeton-mvpa-toolbox
GNU General Public License v3.0
64 stars 56 forks source link

A problem in zeroify_write_afni.m #10

Closed Y2KdeLaplace closed 1 year ago

Y2KdeLaplace commented 2 years ago

if we use 'write_to_afni' to export the patterns with multiple subbricks, like below data:

subj = init_subj(exp_name,subjid);
subj = load_afni_mask(subj,'Wholebrain',mask);
subj = load_afni_pattern(subj,'pattern_name','Wholebrain',{'data_file_name+tlrc'});
vox = get_mat(subj,'pattern','pattern_name');
disp(size(vox)) > 69391 3 kk = [vox,vox,vox,vox] % whose size will be 69391*12
subj = initset_object(subj,'pattern','repeated_patterns',kk,'masked_by','Wholebrain');
write_to_afni(subj,'pattern','repeated_patterns','atlas/MNI_Glasser_HCP_2019_v1.0/MNI152_mask+tlrc',... 'overwrite_if_exist',true,'output_filename','repeated_patterns_data','view','+tlrc');'

errors will be reported as below:

++ 3dcalc: AFNI version=AFNI_22.3.03 (Oct 13 2022) [64-bit] ++ Authored by: A cast of thousands ERROR: selector index 99 is out of range 0..0  ERROR: bad sub-brick selector [0..99]  FATAL ERROR: can't open dataset EPI_T1_mask+tlrc[0..99] Program compile date = Oct 13 2022

Error in BrikLoad : HEAD file allvolszeros_EPI_T1_mask+tlrc.HEAD not found

Error using zeroify_write_afni>load_sample_brik (line 186) error in BrikLoad -BrikLoad: allvolszeros_EPI_T1_mask+tlrc.HEAD not found

Error in zeroify_write_afni (line 63) [V head] = load_sample_brik(allvolszeros_sample_brik_name,allvols);

Error in write_to_afni>try_zeroify (line 412) zeroify_write_afni(allvols,sample_filename,cur_filename,zeroify_args);

Error in write_to_afni (line 151) try_zeroify(subj,objtype,objin,sample_filename,args,runTRs);

Error in permutation_searchlight>permutation_sl (line 45) write_toafni(subj,'pattern',['perm' cond_names{icond}],'EPI_T1_mask+tlrc',...

Error in permutation_searchlight (line 18) permutation_sl(exp,subjects{i},period,analysis,condition,perm_times,filenames)

it could be fixed the problem as below changings:

zeroify_write_afni>line 61:
[allvolszeros_sample_brik_name] = zeroify_sample_brik(sample_brik_name,args); zeroify_write_afni>line 149: function [avz_sbn] = zeroify_sample_brik(sbn,args) zeroify_write_afni>zeroify_sample_brik>line 171 & 172:
[~,tmp_V,~,~] = BrikLoad(sbn); exec = sprintf('%s -a %s''[0..%i]'' -expr 0 -datum float -prefix %s', ...
command_3dcalc,sbn,size(tmp_V,4)-1,avz_sbn);

hepcat72 commented 1 year ago

I'm confused. Why did I receive an email about this issue being closed - or any communication at all about this repo? How am I connected to this repo at all?