Hi Dianne,
The FSLeyes nudge tool allows you to adjust the sform/qform matrices
that are stored in NIFTI images, and encode a voxel-to-world affine
transformation. They are used by FSLeyes to project different images
into a common display coordinate system.
Most FSL tools work in a voxel-based coordinate system, rather than
the world coordinate system encoded in the sform/qform matrices. Tools
like fslmaths require the input images to share both the same voxel
dimensions, and orientation (as defined by the sform/qforms). So you
need to resample the second mask so that it is in the same space as
the first mask. You can do this using flirt:
flirt -in mask2 -ref mask1 -applyxfm -usesqform -out mask2_resampled_to_mask1
I am planning to add this as an option in FSLeyes at some stage, but
haven't gotten around to it yet.
Cheers,
Paul
On 27/03/2019, Dianne Patterson <[log in to unmask]> wrote:
> I am encountering unexpected behavior. I'm hoping someone can shed some
> light on this (is it broken, or are my expectations just wrong).
>
> I am using fsleyes 0.27.3 on Mac OSX Mojave.
>
> I do the following:
> 1) Create a simple mask using the edit tools and save it.
> 2) Now I nudge a copy of the mask (x and y translation). They partly
> overlap.
> I save the copy and reopen them in FSLeyes to confirm they are partially
> overlapping.
>
> The original mask has this sform and qform:
> qform_code 1
> qto_xyz:1 -0.349530 0.000652 0.018126 103.802238
> qto_xyz:2 -0.000000 0.349774 -0.012589 -84.776505
> qto_xyz:3 0.018138 0.012572 0.349304 -87.746201
> qto_xyz:4 0.000000 0.000000 0.000000 1.000000
> qform_xorient Right-to-Left
> qform_yorient Posterior-to-Anterior
> qform_zorient Inferior-to-Superior
> sform_name Scanner Anat
> sform_code 1
> sto_xyz:1 -0.349530 0.000652 0.018125 103.802238
> sto_xyz:2 0.000000 0.349774 -0.012589 -84.776505
> sto_xyz:3 0.018137 0.012572 0.349304 -87.746201
> sto_xyz:4 0.000000 0.000000 0.000000 1.000000
>
> The nudged mask has a revised sform:
> qform_code 1
> qto_xyz:1 -0.349530 0.000652 0.018126 103.802238
> qto_xyz:2 -0.000000 0.349774 -0.012589 -84.776505
> qto_xyz:3 0.018138 0.012572 0.349304 -87.746201
> qto_xyz:4 0.000000 0.000000 0.000000 1.000000
> qform_xorient Right-to-Left
> qform_yorient Posterior-to-Anterior
> qform_zorient Inferior-to-Superior
> sform_name Scanner Anat
> sform_code 1
> sto_xyz:1 -0.349530 0.000652 0.018125 113.802238
> sto_xyz:2 0.000000 0.349774 -0.012589 -74.776505
> sto_xyz:3 0.018137 0.012572 0.349304 -87.746201
> sto_xyz:4 0.000000 0.000000 0.000000 1.000000
>
> Now I subtract one from the other:
> test> fslmaths anat_mask -sub anat_mask_copy -bin anat_diff
>
> WARNING:: Inconsistent orientations for individual images in pipeline!
> Will use voxel-based orientation which is probably incorrect -
> *PLEASE CHECK*!
>
> The resulting image has no voxels:
> fslstats anat_diff -V
> 0 0.000000
>
> So, what is the purpose of nudge in fsleyes? Apparently the nudges I make
> are ignored when it comes to applying other fsl commandline tools.
>
> I even tried this (but it does not help):
>
> test> rm anat_diff.nii.gz
> test> fslmaths anat_mask -sub anat_mask_copy -bin anat_diff
>
> WARNING:: Inconsistent orientations for individual images in pipeline!
> Will use voxel-based orientation which is probably incorrect -
> *PLEASE CHECK*!
>
> 9608:feckless:Beeson_Data_Review/test> fslstats anat_diff -V
> 0 0.000000
>
> Suggestions and insights appreciated!
>
> Thanks,
>
> Dianne
> --
> Dianne Patterson, Ph.D.
> Research Scientist
> [log in to unmask] <[log in to unmask]>
> or
> [log in to unmask]
> University of Arizona
> Speech and Hearing Science 314
> 1131 E 2nd Street, Building #71
> (Just East of Harvill)
> ==============
> If you don't hear back from me (and you expected to),
> I blame the University's new SPAM filter.
> Please write to my gmail account.
> ==============
> Antipiphany: That moment when you realize how little you actually know
> ==============
>
> ########################################################################
>
> To unsubscribe from the FSL list, click the following link:
> https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=FSL&A=1
>
########################################################################
To unsubscribe from the FSL list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=FSL&A=1
|