Try using the call_fsl function from within MATLAB to run the FEAT task.
Background:
MATLAB ships a large number of dynamic libraries to allow old Linux distros to run the software. Unfortunately, these are often significantly older than the version the OS provides and so the FSL C++ programs try to link against the older MATLAB libraries rather than the OS ones they were built against. Mathworks official line on this, is you don’t need these libraries so they can be removed *with care*.
However, the call_fsl function does the work necessary to make the shell that the FSL commands run in forget about the MATLAB libraries for the duration of the external program so there is no need to mess around with the MATLAB internals, possibly breaking it.
We actually created this wrapper because on our cluster the extra overhead of searching all the additional locations for shared libraries that MATLAB references slowed down our compute nodes and NFS file server significantly.
Duncan
On 26 Jun 2014, at 15:24, Chris McNorgan <[log in to unmask]> wrote:
> I'm assisting a colleague in debugging an FSL processing pipeline. He is carrying out a series of preprocessing steps and running a GLM. When executed through MATLAB, the procedure crashes with several errors when calling slicer. I'm attaching a representative output report containing the errors. To summarize: when the script calls slicer, repeated errors are thrown, complaining about libtiff.so.5:
>
> e.g.:
> /usr/share/fsl/5.0/bin/slicer: /usr/local/MATLAB/R2013b/bin/glnxa64/libtiff.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libgd.so.3)
> /usr/share/fsl/5.0/bin/pngappend: /usr/local/MATLAB/R2013b/bin/glnxa64/libtiff.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libgd.so.3)
> etc.
>
> Curiously, the same processing steps executed via the command-line, using files generated during the failed MATLAB script, runs without any problem (A report from a successful run is available, but I am not attaching to this message it to avoid confusion). This suggests the problem stems from the way in which MATLAB interacting with FSL. Is this a known problem, or does anyone have any suggestions?
>
> Thanks
>
> Progress Report / Log
>
> Started at Wed Jun 25 10:24:58 EDT 2014
> Feat main script
>
> /bin/cp /home/smacd49/Documents/FSL_analyses/BZ22/Tool1.fsf design.fsf
>
> /usr/share/fsl/5.0/bin/feat_model design
>
> mkdir .files;cp /usr/share/fsl/5.0/doc/fsl.css .files;ln -s /usr/share/fsl/5.0/doc/images .files/images
>
> /usr/share/fsl/5.0/bin/fsl_sub -T 10 -l logs -N feat0_init /usr/share/fsl/5.0/bin/feat /home/smacd49/Documents/FSL_analyses/BZ22/BZ22_o1.feat/design.fsf -D /home/smacd49/Documents/FSL_analyses/BZ22/BZ22_o1.feat -I 1 -init
> 19912
>
> /usr/share/fsl/5.0/bin/fsl_sub -T 60 -l logs -N feat1b_reg -j 19912 /usr/share/fsl/5.0/bin/feat /home/smacd49/Documents/FSL_analyses/BZ22/BZ22_o1.feat/design.fsf -D /home/smacd49/Documents/FSL_analyses/BZ22/BZ22_o1.feat -I 1 -reg
>
> FATAL ERROR ENCOUNTERED
>
> /usr/share/fsl/5.0/bin/mainfeatreg -F 6.00 -d /home/smacd49/Documents/FSL_analyses/BZ22/BZ22_o1.feat -l /home/smacd49/Documents/FSL_analyses/BZ22/BZ22_o1.feat/logs/feat5_reg -R /home/smacd49/Documents/FSL_analyses/BZ22/BZ22_o1.feat/report_unwarp.html -r /home/smacd49/Documents/FSL_analyses/BZ22/BZ22_o1.feat/report_reg.html -i /home/smacd49/Documents/FSL_analyses/BZ22/BZ22_o1.feat/example_func.nii.gz -n 10 -h /home/smacd49/Documents/FSL_analyses/BZ22/struct_brain -w BBR -x 180 -s /usr/share/fsl/data/standard/MNI152_T1_1mm_brain -y 12 -z 180
> Option -F ( FEAT version parameter ) selected with argument "6.00"
> Option -d ( output directory ) selected with argument "/home/smacd49/Documents/FSL_analyses/BZ22/BZ22_o1.feat"
> Option -l ( logfile )input with argument "/home/smacd49/Documents/FSL_analyses/BZ22/BZ22_o1.feat/logs/feat5_reg"
> Option -R ( html unwarping report ) selected with argument "/home/smacd49/Documents/FSL_analyses/BZ22/BZ22_o1.feat/report_unwarp.html"
> Option -r ( html registration report ) selected with argument "/home/smacd49/Documents/FSL_analyses/BZ22/BZ22_o1.feat/report_reg.html"
> Option -i ( main input ) input with argument "/home/smacd49/Documents/FSL_analyses/BZ22/BZ22_o1.feat/example_func.nii.gz"
> Option -n ( use nonlinear reg ) input with argument "10"
> Option -h ( high-res structural image ) selected with argument "/home/smacd49/Documents/FSL_analyses/BZ22/struct_brain"
> Option -w ( highres dof ) selected with argument "BBR"
> Option -x ( highres search ) selected with argument "180"
> Option -s ( standard image ) selected with argument "/usr/share/fsl/data/standard/MNI152_T1_1mm_brain"
> Option -y ( standard dof ) selected with argument "12"
> Option -z ( standard search ) selected with argument "180"
> /usr/share/fsl/5.0/bin/slicer: /usr/local/MATLAB/R2013b/bin/glnxa64/libtiff.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libgd.so.3)
> /usr/share/fsl/5.0/bin/pngappend: /usr/local/MATLAB/R2013b/bin/glnxa64/libtiff.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libgd.so.3)
> /usr/share/fsl/5.0/bin/slicer: /usr/local/MATLAB/R2013b/bin/glnxa64/libtiff.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libgd.so.3)
> /usr/share/fsl/5.0/bin/pngappend: /usr/local/MATLAB/R2013b/bin/glnxa64/libtiff.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libgd.so.3)
> /usr/share/fsl/5.0/bin/pngappend: /usr/local/MATLAB/R2013b/bin/glnxa64/libtiff.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libgd.so.3)
> /usr/share/fsl/5.0/bin/slicer: /usr/local/MATLAB/R2013b/bin/glnxa64/libtiff.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libgd.so.3)
> /usr/share/fsl/5.0/bin/pngappend: /usr/local/MATLAB/R2013b/bin/glnxa64/libtiff.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libgd.so.3)
> /usr/share/fsl/5.0/bin/slicer: /usr/local/MATLAB/R2013b/bin/glnxa64/libtiff.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libgd.so.3)
> /usr/share/fsl/5.0/bin/pngappend: /usr/local/MATLAB/R2013b/bin/glnxa64/libtiff.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libgd.so.3)
> /usr/share/fsl/5.0/bin/pngappend: /usr/local/MATLAB/R2013b/bin/glnxa64/libtiff.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libgd.so.3)
> /usr/share/fsl/5.0/bin/slicer: /usr/local/MATLAB/R2013b/bin/glnxa64/libtiff.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libgd.so.3)
> /usr/share/fsl/5.0/bin/pngappend: /usr/local/MATLAB/R2013b/bin/glnxa64/libtiff.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libgd.so.3)
> /usr/share/fsl/5.0/bin/slicer: /usr/local/MATLAB/R2013b/bin/glnxa64/libtiff.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libgd.so.3)
> /usr/share/fsl/5.0/bin/pngappend: /usr/local/MATLAB/R2013b/bin/glnxa64/libtiff.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libgd.so.3)
> /usr/share/fsl/5.0/bin/pngappend: /usr/local/MATLAB/R2013b/bin/glnxa64/libtiff.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libgd.so.3)
>
> FATAL ERROR ENCOUNTERED
>
> Initialisation
> /usr/share/fsl/5.0/bin/fslmaths /home/smacd49/Documents/FSL_analyses/BZ22/Tool1 prefiltered_func_data -odt float
> Total original volumes = 246
>
> /usr/share/fsl/5.0/bin/fslroi prefiltered_func_data example_func 123 1
> /usr/share/fsl/5.0/bin/pngappend: /usr/local/MATLAB/R2013b/bin/glnxa64/libtiff.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libgd.so.3)
> while executing
> "if { [ catch {
>
>
>
> for { set argindex 1 } { $argindex < $argc } { incr argindex 1 } {
> switch -- [ lindex $argv $argindex ] {
>
> -I {
> incr argin..."
> (file "/usr/share/fsl/5.0/bin/feat" line 119)
>
> Registration
> /bin/mkdir -p /home/smacd49/Documents/FSL_analyses/BZ22/BZ22_o1.feat/reg
>
>
> /usr/share/fsl/5.0/bin/fslmaths /home/smacd49/Documents/FSL_analyses/BZ22/struct_brain highres
>
>
> /usr/share/fsl/5.0/bin/fslmaths /home/smacd49/Documents/FSL_analyses/BZ22/struct highres_head
>
>
> /usr/share/fsl/5.0/bin/fslmaths /usr/share/fsl/data/standard/MNI152_T1_1mm_brain standard
>
>
> /usr/share/fsl/5.0/bin/fslmaths /usr/share/fsl/data/standard/MNI152_T1_1mm standard_head
>
>
> /usr/share/fsl/5.0/bin/fslmaths /usr/share/fsl/data/standard/MNI152_T1_1mm_brain_mask_dil standard_mask
>
> did not find file: example_func2highres.mat. Generating transform.
>
> /usr/share/fsl/5.0/bin/epi_reg --epi=example_func --t1=highres_head --t1brain=highres --out=example_func2highres
> Running FAST segmentation FLIRT pre-alignment Running BBR 0.403044 0.999886 -0.012033 0.009113 0.000000 0.011996 0.999920 0.004062 0.000000 -0.009161 -0.003952 0.999950 0.000000 -0.365464 4.252835 0.823210 1.000000
>
> /usr/share/fsl/5.0/bin/convert_xfm -inverse -omat highres2example_func.mat example_func2highres.mat
>
>
> /usr/share/fsl/5.0/bin/slicer example_func2highres highres -s 2 -x 0.35 sla.png -x 0.45 slb.png -x 0.55 slc.png -x 0.65 sld.png -y 0.35 sle.png -y 0.45 slf.png -y 0.55 slg.png -y 0.65 slh.png -z 0.35 sli.png -z 0.45 slj.png -z 0.55 slk.png -z 0.65 sll.png ; /usr/share/fsl/5.0/bin/pngappend sla.png + slb.png + slc.png + sld.png + sle.png + slf.png + slg.png + slh.png + sli.png + slj.png + slk.png + sll.png example_func2highres1.png ; /usr/share/fsl/5.0/bin/slicer highres example_func2highres -s 2 -x 0.35 sla.png -x 0.45 slb.png -x 0.55 slc.png -x 0.65 sld.png -y 0.35 sle.png -y 0.45 slf.png -y 0.55 slg.png -y 0.65 slh.png -z 0.35 sli.png -z 0.45 slj.png -z 0.55 slk.png -z 0.65 sll.png ; /usr/share/fsl/5.0/bin/pngappend sla.png + slb.png + slc.png + sld.png + sle.png + slf.png + slg.png + slh.png + sli.png + slj.png + slk.png + sll.png example_func2highres2.png ; /usr/share/fsl/5.0/bin/pngappend example_func2highres1.png - example_func2highres2.png example_func2highres.png; /bi
> n/rm -f sl?.png example_func2highres2.png
>
>
> /bin/rm example_func2highres1.png
>
> did not find file: highres2standard.mat. Generating transform.
>
> /usr/share/fsl/5.0/bin/flirt -in highres -ref standard -out highres2standard -omat highres2standard.mat -cost corratio -dof 12 -searchrx -180 180 -searchry -180 180 -searchrz -180 180 -interp trilinear
>
>
> /usr/share/fsl/5.0/bin/fnirt --iout=highres2standard_head --in=highres_head --aff=highres2standard.mat --cout=highres2standard_warp --iout=highres2standard --jout=highres2highres_jac --config=T1_2_MNI152_2mm --ref=standard_head --refmask=standard_mask --warpres=10,10,10
>
>
> /usr/share/fsl/5.0/bin/applywarp -i highres -r standard -o highres2standard -w highres2standard_warp
>
>
> /usr/share/fsl/5.0/bin/convert_xfm -inverse -omat standard2highres.mat highres2standard.mat
>
>
> /usr/share/fsl/5.0/bin/slicer highres2standard standard -s 2 -x 0.35 sla.png -x 0.45 slb.png -x 0.55 slc.png -x 0.65 sld.png -y 0.35 sle.png -y 0.45 slf.png -y 0.55 slg.png -y 0.65 slh.png -z 0.35 sli.png -z 0.45 slj.png -z 0.55 slk.png -z 0.65 sll.png ; /usr/share/fsl/5.0/bin/pngappend sla.png + slb.png + slc.png + sld.png + sle.png + slf.png + slg.png + slh.png + sli.png + slj.png + slk.png + sll.png highres2standard1.png ; /usr/share/fsl/5.0/bin/slicer standard highres2standard -s 2 -x 0.35 sla.png -x 0.45 slb.png -x 0.55 slc.png -x 0.65 sld.png -y 0.35 sle.png -y 0.45 slf.png -y 0.55 slg.png -y 0.65 slh.png -z 0.35 sli.png -z 0.45 slj.png -z 0.55 slk.png -z 0.65 sll.png ; /usr/share/fsl/5.0/bin/pngappend sla.png + slb.png + slc.png + sld.png + sle.png + slf.png + slg.png + slh.png + sli.png + slj.png + slk.png + sll.png highres2standard2.png ; /usr/share/fsl/5.0/bin/pngappend highres2standard1.png - highres2standard2.png highres2standard.png; /bin/rm -f sl?.png highres2st
> andard2.png
>
>
> /bin/rm highres2standard1.png
>
>
> /usr/share/fsl/5.0/bin/convert_xfm -omat example_func2standard.mat -concat highres2standard.mat example_func2highres.mat
>
>
> /usr/share/fsl/5.0/bin/convertwarp --ref=standard --premat=example_func2highres.mat --warp1=highres2standard_warp --out=example_func2standard_warp
>
>
> /usr/share/fsl/5.0/bin/applywarp --ref=standard --in=example_func --out=example_func2standard --warp=example_func2standard_warp
>
>
> /usr/share/fsl/5.0/bin/convert_xfm -inverse -omat standard2example_func.mat example_func2standard.mat
>
>
> /usr/share/fsl/5.0/bin/slicer example_func2standard standard -s 2 -x 0.35 sla.png -x 0.45 slb.png -x 0.55 slc.png -x 0.65 sld.png -y 0.35 sle.png -y 0.45 slf.png -y 0.55 slg.png -y 0.65 slh.png -z 0.35 sli.png -z 0.45 slj.png -z 0.55 slk.png -z 0.65 sll.png ; /usr/share/fsl/5.0/bin/pngappend sla.png + slb.png + slc.png + sld.png + sle.png + slf.png + slg.png + slh.png + sli.png + slj.png + slk.png + sll.png example_func2standard1.png ; /usr/share/fsl/5.0/bin/slicer standard example_func2standard -s 2 -x 0.35 sla.png -x 0.45 slb.png -x 0.55 slc.png -x 0.65 sld.png -y 0.35 sle.png -y 0.45 slf.png -y 0.55 slg.png -y 0.65 slh.png -z 0.35 sli.png -z 0.45 slj.png -z 0.55 slk.png -z 0.65 sll.png ; /usr/share/fsl/5.0/bin/pngappend sla.png + slb.png + slc.png + sld.png + sle.png + slf.png + slg.png + slh.png + sli.png + slj.png + slk.png + sll.png example_func2standard2.png ; /usr/share/fsl/5.0/bin/pngappend example_func2standard1.png - example_func2standard2.png example_func2standard
> .png; /bin/rm -f sl?.png example_func2standard2.png
>
>
>
--
Duncan Mortimer
Computing Officer, FMRIB Centre, University of Oxford
John Radcliffe Hospital, Oxford, UK
|