Function details
spm_2_bids only provides names to use but does not actually rename the files.
- src.spm_2_bids(varargin)
Provides a bids derivatives name for a file preprocessed with SPM
USAGE:
[new_filename, pth, json] = spm_2_bids(file [, map][, verbose])
- Parameters:
file (
string) – SPM preprocessed filename (can be fullpath); for examplewmsub-01_ses-01_T1w.niimap – optional spm_2_bids map to overwrite the default map (see Mapping)
map – Mapping object
verbose –
verbose – boolean
- Returns:
- new_filename:
(string) BIDS compatible filename for example
sub-01_ses-01_space-IXI549Space_desc-preproc_T1w.nii;
- pth:
(string) relative BIDS path for example
sub-01/ses-01
- json:
(structure) JSON derivatives content
The behaviour of which prefix gives which BIDS derivatives can be modified by adapting the
cfg.
- src.defaults.check_cfg(cfg)
Check the option inputs and add any missing field with some defaults
USAGE:
cfg = check_cfg(cfg)
- Parameters:
cfg (
structure) – structure or json filename containing the spm_2_bids.anat.- Returns:
- cfg:
the option structure with missing values filled in by the defaults.
cfgfields:all_entity_order: order of all the official bids entitiesentity_order: order of the entities in bids derivativesfwhm: value to append to smoothing description labelspec: specification details to over ride some of the defaults
BIDS derivatives defining fields:
Each of those fields contain a structure that lists the BIDS suffix and entities-label pairs for each type of preprocessed image.
segmentstcrealign_unwarpreal_parammeannormalized_meanpreprocpreproc_normsmoothsmooth_norm
For example:
% for grey matter segmentation output cfg.segment.gm = struct('entities', struct('space', 'individual', ... 'label', x), ... 'suffix', 'probseg')
- src.defaults.Mapping