Hi Torsten,
I can assure you that qforms and sforms are treated in the same way. They are ignored if their respective code is set to zero, otherwise the sign of the determinant is used. Given that they cannot have different determinant signs (as that would be a malformed nifti file) then it doesn't even matter about precedence in this case (although the general rule in FSL is that sforms get precedence over qforms). It is also always the x voxel axis that gets flipped, in either the source or destination image, or both, depending on the sign of the determinants in the respective images.
So I'm not sure if this helps with your problem or not.
If you really cannot figure out a solution, then let us know.
All the best,
Mark
On 13 Mar 2014, at 21:38, Torsten Rohlfing <[log in to unmask]> wrote:
> Mark -
>
> Thanks again, I was indeed able to make this work. But one more question:
>
> Is it at all possible that for the purposes of determining the flip in x a qform is treated differently from an sform?
>
> I am asking because, following exactly your description, I am able to create a working FSL-style warp for images with qforms, and that includes non-axial images (specifically - sagittal images). Better yet, running applywarp on the same image, once stored as axial once as sagittal, I get the exact same resliced result (using different warp files, obviously), and it's the same resliced result that I am getting using my own reslice tool with the transform in my own format.
>
> For images with sform, however, it seems that the determinant sign test is not applied consistently inside FSL for axial vs. non-axial. So depending on whether I apply your criterion or its reverse, I either get the axially-stored image resliced properly by applywarp and the sagittally-stored with an A/P flip, or I get both images resliced to the same result, but that result is incorrect.
>
> Sorry if this is a bit vague, but right now, this is to the best of my understanding.
>
> Again, thanks for your help!
>
> Torsten
|