In some datasets extracting surfaces fails because we check for the sform code here. But what is the significance of this code, and is it necessary?
I believe @cgohil8 mentioned the sform code is not important for MEG purposes, so I've manually changed the sform in order to compute the surfaces, but is this valid? And if so, can't we do this automatically so we don't get these errors anymore?
See the error message below
Processing failed during stage : "custom_coregister"<class 'ValueError'>
sform code for /ohba/pi/mwoolrich/mvanes/Projects/NTAD/source/P1023_resting_close_af/rhino/surfaces/smri.nii.gz is 2, and needs to be 4 or 1
File "/ohba/pi/mwoolrich/mvanes/software/osl/osl/source_recon/batch.py", line 183, in run_src_chain
func(src_dir, subject, preproc_file, smri_file, epoch_file, **userargs)
File "coregister.py", line 222, in custom_coregister
source_recon.wrappers.compute_surfaces(
File "/ohba/pi/mwoolrich/mvanes/software/osl/osl/source_recon/wrappers.py", line 110, in compute_surfaces
already_computed = rhino.compute_surfaces(
File "/ohba/pi/mwoolrich/mvanes/software/osl/osl/source_recon/rhino/surfaces.py", line 211, in compute_surfaces
flirt_mri2mniaxes_xform = rhino_utils._get_flirt_xform_between_axes(filenames["smri_file"], filenames["std_brain"])
File "/ohba/pi/mwoolrich/mvanes/software/osl/osl/source_recon/rhino/utils.py", line 834, in _get_flirt_xform_between_axes
fromvox2from = _get_sform(from_nii)["trans"]
File "/ohba/pi/mwoolrich/mvanes/software/osl/osl/source_recon/rhino/utils.py", line 275, in _get_sform
raise ValueError("sform code for {} is {}, and needs to be 4 or 1".format(nii_file, sformcode))
In some datasets extracting surfaces fails because we check for the
sform
code here. But what is the significance of this code, and is it necessary?I believe @cgohil8 mentioned the sform code is not important for MEG purposes, so I've manually changed the sform in order to compute the surfaces, but is this valid? And if so, can't we do this automatically so we don't get these errors anymore?
See the error message below