I attempted to load some FSL .nii.gz files into matlab but the path was not recognized. Initially I tried making a startup.m file using the syntax
setenv( 'FSLDIR', '/usr/local/fsl');
fsldir = getenv('FSLDIR');
fsldirmpath = sprintf('%s/etc/matlab',fsldir);
path(path, fsldirmpath);
clear fsldir fsldirmpath;
from
http://fsl.fmrib.ox.ac.uk/fsl/fsl4.0/fsl/macosx.html#matlab
but this resulted in this error in matlab
Warning: Name is nonexistent or not a
directory: /usr/local/fsl/etc/matlab.
> In path at 110
In startup at 4
I then check the dir /usr/local/fsl/etc/matlab
but fsl did not have a path in this location, but rather in applications/fsl/etc/matlab
setenv( 'FSLDIR', '/Applications/fsl');
fsldir = getenv('FSLDIR');
fsldirmpath = sprintf('%s/etc/matlab',fsldir);
path(path, fsldirmpath);
clear fsldir fsldirmpath;
this now works, in so far as I can use the read_avw function but this may not be an optimal solution.
Any recommendations would be much appreciated. I have had zero problems with FSL...
The version of matlab I'm using is 7.14 R2012a; the version of FSL is 5.0.1, FLIRT version 6.0, echo $FSLDIR returns the expected /Applications/fsl
All the best
|