Hi All,
I have developed a script in Matlab that calls fsl functions. One of the tasks I am trying to include is decay-correcting a PET image by using the fslmaths function, but I am having issues running the command in Matlab.
At the beginning of my script I have set the path to fsl environment as follow:
setenv( 'FSLDIR', '/usr/local/fsl'); % this to tell where FSL folder is
fsldir = getenv('FSLDIR');
fsldirmpath = sprintf('%s/etc/matlab',fsldir);
path(path, fsldirmpath);
clear fsldir fsldirmpath;
In order to run fsl functions I have to start the command line with dos(['fslfunction ...']). For example I have run some registrations like this:
dos(['flirt -applyxfm -usesqform -interp trilinear -in ',PET_FET,' -ref ',CT_FET,' -out ',PET_FET_inFETCT,' -omat ',PET_FETinFETCTmtrx,]);
and it works perfectly.
Now, by the same principle I am trying to multiply the intensity of each voxel of a PET image by a conversion factor that I calculated as a variable in my script (conversionFactorF). However, when I run the command:
dos(['fslmaths ',PET_FET_raw,' -mul ',conversionFactorF,' ',PET_FET,]);
where PET_FET_raw is the path to my raw PET image, and PET_FET is the path to my decay-corrected image, I do not get the decay corrected image as an output.
However, if I substitute the conversion factor numerically in the command, like this:
dos(['fslmaths ',PET_FET_raw,' -mul 0.00000042622 ',PET_FET,]);
it works and I get the decay corrected image.
Since I would like to automate this process, without having to manually input the calculated conversion factor, I was wondering if you could help me understand what am I doing wrong, and why the original command including conversionFctorF does not work.
Many thanks in advance for your help.
Kind Regards,
Caterina
########################################################################
To unsubscribe from the FSL list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=FSL&A=1
|