[Simnibs-discuss] "The qform and sform of do not match..." why this requirement?

Sean McBride sean at rogue-research.com
Fri Jan 13 21:38:53 CET 2023


Oula,

Thanks for your reply, sorry for my delayed response.

So we have a nifti file where simnibs gives "the qform and sform of do 
not match".  This file has a `qform_code` of `NIFTI_XFORM_UNKNOWN` (0), 
and an `sform_code` of `NIFTI_XFORM_SCANNER_ANAT` (1).

Usually, when you encounter NIFTI_XFORM_UNKNOWN in either the sform or 
qform, you should ignore it.

The `--forceqform` option is not helpful here because it's the qform 
that is `NIFTI_XFORM_UNKNOWN`.  There appears to be no way to make 
SimNIBS use the sform.

I would suggest that:

1) SimNIBS should look at the `[qs]form_code` value and ignore any 
`NIFTI_XFORM_UNKNOWN`.  If you are then left with only one, there's no 
need to even check if they match.

and/or

2) add a `--forcesform` option

Cheers,

Sean


On 6 Jan 2023, at 9:03, Oula Puonti wrote:

> Hi Sean,
>
> Techincally they don't have to match, but it that seems different 
> nifti
> readers sometimes use one and sometimes the other, which can cause
> problems. We decided it's best to explicitly "force" the qform to keep
> everything consistent within charm. As the qform should store the
> transformation from voxels to scanner coordinates, i.e., no shears, we
> decided to go with that.
>
> Best,
> Oula
>
>
> On Thu, 2023-01-05 at 19:14 -0500, Sean McBride wrote:
>> Hi all,
>>
>> I notice here:
>>
>> https://github.com/simnibs/simnibs/blob/8fe54625a6d5b523456a4bf2efb24b890ee05fdb/simnibs/segmentation/charm_main.py#L661
>>
>> The error message "The qform and sform of do not match. Please run
>> charm with the --forceqform option".
>>
>> Why are the qform and sform expected/required to match?
>>
>> Also: there is a stray "of" in that error message text.
>>
>> Thanks,
>>
>> Sean
>> _______________________________________________
>> Simnibs-discuss mailing list
>> Simnibs-discuss at drcmr.dk
>> https://mailman.drcmr.dk/mailman/listinfo/simnibs-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.drcmr.dk/pipermail/simnibs-discuss/attachments/20230113/b52f3f14/attachment-0001.html>


More information about the Simnibs-discuss mailing list