I am trying to extract time series data from BRIK/HEAD files one of which contains raw data and another which contains a fit for the data. I have no issues loading in the files into MATLAB using BrikLoad; they load in successfully as 4D doubles. My issue is being able to take these 4D doubles and 1. apply an 85x85x85 mask to them, then 2. extract the time series data from the file and then save it as a .mat file. In sections of code written by one of my collaborators he was able to turn these 4D doubles into 85^3 when dealing with files containing beta values. He did this in code written as:
[err, raw_data, raw_info, ~] = BrikLoad(raw_data_BRIK);
split_BRIK_LABS = strsplit(beta_info.BRICK_LABS, '~');
case_betas = strcmpi(split_BRIK_LABS, 'avg_effect#0_Coef');
assert(sum(case_betas) == 1, 'Multiple/no case betas?');
brain_betas = beta_data(:, :, :, case_betas);,
but unfortunately this method does not work with the files containing the fit and raw data since the BRICK_LABS is different and contain no 'avg_effect#0_Coef'. Is there a simple method that I am overlooking to easily extract the time series data and apply a 85^3 mask to it or is it a more in depth process?
Thanks