Regressor_names all the same label despite different sub-brick names

Hi (sorry for being back here already!),

I am using AFNI to generate by trial beta estimates to use in TDT. Due to the complexities added by participants having false alarms during the scanning task, I have opted to try and use individual trial beta estimates for those subjects, i.e. 1200 .BRIK/.HEAD files for each of the 1200 trials. This way I can easily discard the false alarm trials.

These .BRIK/.HEAD files contain one sub-brick named something like vowelstep1#000 for the first trial of the stimulus “vowelstep1” or something like vowelstep7#074 for the 75th trial of vowelstep7.

However, when I run design_from_afni(beta_loc) I end up with a cell in which the first and third column are identical for all 1200 entries; it is the name of the first stimulus alphabetically repeated over and over.

I used breakpoints in the design_from_afni.m for the loop from lines 89 to 101 and the issue seems to be that as each header is being read, hdr.BRICK_LABS is not being added to the cell labels. The regressor name from labels_concat doesn’t seem to be getting added to label. So when it gets to line 104:

regressors = repmat(labels,1,n_brik);

The name of the first label gets replicated n_brik times. Thus, I end up with regressor_names that has 1200 of the same label.

Should I add a line of code like labels = [labels label_concat] in order to get around this? Or is there something I should be specifying in my script that I am not?

Thanks again for your help!

I modified a version of the design_from_afni.m script and it yields a regressor_names matrix with the appropriate regressor names, that is each of the 1200 unique regressors are listed once. I can post it here or host it on GitHub if it would be of interest.

However, I am getting an error during the decoding process when it is loading data:

Unable to perform assignment because the size of the left side is 1-by-167338 and the size of the right side is 86-by-131-by-137.

Error in decoding_load_data (line 289)
        data(file_ind, :) = read_voxels(,data_hdr,[x y z]); % get in-mask voxels of image

Error in decoding (line 280)
    [passed_data, misc, cfg] = decoding_load_data(cfg, misc);

I’m pretty much clueless with this error but at this point I think I’m going to abandon the process of using each beta as an individual file as it seems much more cumbersome.

Hi Dave,

Thanks for digging into this. As I said in my previous reply, this code works for “normal” AFNI BRIK files, but I don’t know of all possible formats the data can take, so I’m not sure exactly what the problem could be. Please send me the HDR file and I’ll try taking a look at it.