Dear FreeSurfers,
I just wanted to share a solution for an issue that can arise when running selxavg3-sess with octave instead of Matlab.
In fast_selxavg3.m (which is called by selxavg3) there is a line (579 in my version) that computes the mean of an array by calling the mean function with the DIM argument, which specifies the dimension over which the average should be computed (4th dimension in this case):
rho1mn.vol = mean(rho1.vol,4);
This line will throw an error under octave if the number of dimensions of the array rho1.vol is smaller than 4. In Matlab it will simply return the array.
To solve this issue for octave users one can use a simple if-else statement to check for the number of dimensions and return the unchanged volume if the number of dimensions is smaller than four or if the fourth dimension is a singleton, like this:
if 4 > ndims(rho1.vol) || size(rho1.vol,4) == 1 rho1mn.vol = rho1.vol; else rho1mn.vol = mean(rho1.vol,4); end
Best, Michael
Thanks Michael. This will be in the next version
On 01/11/2017 07:47 AM, Michael Schirner wrote:
Dear FreeSurfers,
I just wanted to share a solution for an issue that can arise when running selxavg3-sess with octave instead of Matlab.
In fast_selxavg3.m (which is called by selxavg3) there is a line (579 in my version) that computes the mean of an array by calling the mean function with the DIM argument, which specifies the dimension over which the average should be computed (4th dimension in this case):
rho1mn.vol = mean(rho1.vol,4);
This line will throw an error under octave if the number of dimensions of the array rho1.vol is smaller than 4. In Matlab it will simply return the array.
To solve this issue for octave users one can use a simple if-else statement to check for the number of dimensions and return the unchanged volume if the number of dimensions is smaller than four or if the fourth dimension is a singleton, like this:
if 4 > ndims(rho1.vol) || size(rho1.vol,4) == 1 rho1mn.vol = rho1.vol; else rho1mn.vol = mean(rho1.vol,4); end
Best, Michael
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
freesurfer@nmr.mgh.harvard.edu