Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spm_matlab_version_chk does not seem to be used anymore in SPM while SwE still uses it #165

Closed
BryanGuillaume opened this issue Apr 11, 2020 · 3 comments
Assignees

Comments

@BryanGuillaume
Copy link
Collaborator

It seems that spm_matlab_version_chk is not used anymore in the most recent versions of SPM while it was used in less recent versions (e.g., SPM8). In the SwE toolbox, we use it to save the SwE.mat file:

%-Save analysis parameters in SPM.mat file
%--------------------------------------------------------------------------
if spm_matlab_version_chk('7') >=0
    save('SPM.mat','SPM','-V6');
else
    save('SPM.mat','SPM');
end

In the most recent version of SPM12, the piece of code saving the SPM.mat files does not use this type of piece of code anymore, but something like

fmt = spm_get_defaults('mat.format');
s = whos('SPM');
if s.bytes > 2147483647, fmt = '-v7.3'; end
save('SPM.mat','SPM', fmt);

and I wonder if we should update the SwE toolbox to follow this saving style for the SwE.mat as well or if it is fine to leave it as is.

That needs to be reviewed.

@nicholst
Copy link
Collaborator

Interesting... so instead of spm_matlab_version_chk.m we have spm_check_version.m. But, indeed, if we in SwE are only checking the version for I/O, i.e. for saving, I'm inclined to copy what Guillaume is doing, yes.

Is this enough to go on?

@nicholst
Copy link
Collaborator

While the PR #183 addresses this it will introduce errors with old, un-updated versions of SPM12.

The more robust solution is to create a swe_check_version that tests for the existance ofspm_check_version and uses it if it's available, and otherwise falls back to spm_matlab_version_chk.

@nicholst
Copy link
Collaborator

I was halfway through adding a wrapper swe_check_version when I realised that our code already depends on spm_check_version (the new function) in various places. Hence there is no reason to maintain backwards compatiblity with spm_matlab_version_chk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants