Hi Marko,
It has indeed changed, spm_get used shell-style wildcards, spm_select
uses the more powerful "regular expression" framework, see
"help regexp" in Matlab.
Regular expressions can take a bit of getting used to... the Matlab
documentation is pretty good, but a few quick pointers:
the . matches any single character (like the shell wildcard "?")
whereas the * now means 0 or more of the previous match. Regular
expressions can match anywhere in a string by default, so:
> test*.img
[...]
> my_test_1.img
> my_test_2.img
Would actually also match
blah_tesQimg
blah_testttttt,img
etc!
To match a literal character that has a special meaning in regular
expressions just backslash escape it, e.g. "\.".
And to match from the start of the string use "^" as the first
character (similarly, though less usefully here, a "$" at the end will
require the string to end with the end of the match, i.e. "blah$" will
not match "blahdy".
So the spm_get "test*.img" becomes something like:
"^test.*\.img$" (though the $ is probably not useful)
And you might prefer something like "^test.*\.(img|nii)$" if you have
a mix of NIfTI files.
Best,
Ged.
|