Dear Mathieu and Christian,
the 'ver' command gets its information from files Contents.m that are
not readable when compiled. As a workaround, SPM copies its Contents.m
into a file named Contents.txt that can then be read by spm('Ver'), see
spm12/config/spm_make_standalone.m and spm12/spm.m.
That said, I don't understand why you didn't get an error with variable
r_spm but only with r_vbm instead...
Best regards,
Guillaume.
On 16/12/15 11:14, Mathieu Dubois wrote:
> Dear Prof. Gaser,
>
> Thanks for your answer. (As mentionned,) I tried the command in
> non-standalone Matlab and it works (Matlab 2012 + SPM + VBM).
>
> The problem is in the compiled version. I don't know how can I test the
> output of `ver` in the compiled version (we tried SPM 'Call MATLAB
> function' without success - probably related to the fact that there is
> no interpreter in the compiled version).
> I think that recompiling SPM+VBM with hardcoded values would work but
> maybe there is a more general solution.
>
> Mathieu
>
> On 16/12/2015 09:00, Christian Gaser wrote:
>> Dear Mathieu,
>>
>> looks like your toolbox is not recognized on your system. Try the following at your matlab command line:
>>
>> A = ver;
>> for i=1:length(A)
>> if strcmp(A(i).Name,'Voxel Based Morphometry Toolbox')
>> r_vbm = A(i).Version
>> end
>> end
>>
>> if it's not giving any output for the r_vbm variable there should be some installation issue. You can try to set the variable manually to some value
>> r_vbm='435'
>> before the faulty line and test whether VBM is running at all...
>>
>> Best,
>>
>> Christian
>>
>> On Tue, 15 Dec 2015 22:20:18 +0100, Mathieu Dubois <[log in to unmask]> wrote:
>>
>>> Hello,
>>>
>>> Following the I have compiled SPM 8 (ver. 6313) and VBM 8 (ver. 435)
>>> with Matlab 2010a (same version that is used at UCL).
>>>
>>> In order to test, I tried to segment a simple T1 image. After writing
>>> the warped images, the code fails with the following error:
>>> Failed 'VBM8: Estimate & Write'
>>> Undefined function or variable "r_vbm".
>>> In file
>>> "/home_local/mdiallo/spm_exec/spm8_mcr/Code/matlab/spm8_updates_r6313/to
>>> olbox/vbm8/cg_vbm8_write.m" (???), function "cg_vbm8_write" at line 965.
>>> In file
>>> "/home_local/mdiallo/spm_exec/spm8_mcr/Code/matlab/spm8_updates_r6313/to
>>> olbox/vbm8/cg_vbm8_run.m" (???), function "run_job" at line 248.
>>> In file
>>> "/home_local/mdiallo/spm_exec/spm8_mcr/Code/matlab/spm8_updates_r6313/toolbox/vbm8/cg_vbm8_run.m"
>>> (???), function "cg_vbm8_run" at line 96.
>>> The following modules did not run:
>>> Failed: VBM8: Estimate & Write
>>>
>>> Looking at the source code, the faulty line is.
>>> str = [str struct('name', 'Versions
>>> Matlab/SPM8/VBM8:','value',sprintf('%s / %s / %s',r_matlab,r_spm,r_vbm))];
>>> The "r_vbm" variable is defined just above:
>>> A = ver;
>>> for i=1:length(A)
>>> if strcmp(A(i).Name,'Voxel Based Morphometry Toolbox')
>>> r_vbm = A(i).Version;
>>> end
>>> if strcmp(A(i).Name,'Statistical Parametric Mapping')
>>> r_spm = A(i).Version;
>>> end
>>> if strcmp(A(i).Name,'MATLAB')
>>> r_matlab = A(i).Version;
>>> end
>>> end
>>> The code seems correct (test on Matlab with non-compiled SPM+VBM). As
>>> Matlab doesn't complain about the "r_matlab" and "r_spm" variables, I
>>> guess they are correctly detected in the compiled version.
>>>
>>> Any clue?
>>>
>>> Mathieu
>>
--
Guillaume Flandin, PhD
Wellcome Trust Centre for Neuroimaging
University College London
12 Queen Square
London WC1N 3BG
|