Print

Print


Thank you I will try this.

Would this also cause issues in fnirt?  I had previously run some fnirt alignments using the diffusion (2x2x4mm) data as input, t2w(1x1x1mm) as ref and starting with the --aff flirt affine matrix.  The resulting image (before applywarp was used to apply the warp and the affine transform without resampling the voxel size of the diffusion) had odd swirls (best way to describe it, perhaps whispy) at the brain, scalp, air transition.  I assumed this was fnirt having issue with the 4mm slice thickness registered to a 1mm... could this actually be an issue with the FOV being too different?

Thank you again for the fslmaths -C trick.  I will try it out.

-----Original Message-----
From: FSL - FMRIB's Software Library [mailto:[log in to unmask]] On Behalf Of Mark Jenkinson
Sent: Saturday, July 27, 2013 7:42 AM
To: [log in to unmask]
Subject: Re: [FSL] flirt applyxfm annd init center image error

Hi,

When doing this sort of thing it is crucial to account for the difference in the FOV of the images, since the FOV is always aligned at the bottom corner, so if one is much bigger than the other then you can see effects like this.

You can easily change the translation in the transformation matrix by modifying the values in the fourth column (first three rows).  These values represent the translation in mm.

You should probably use the difference in the centre of gravity rather than the centre of the volume, if you want the alignment to be close.  You can get the centre of gravity using fslstats with -C.  You'll need to multiply these by the voxel sizes to convert them into mm.  Don't use the -c option as those mm coordinates are the NIFTI mm coordinates and not what is needed in the FLIRT matrix.  Whether you add or subtract the difference of these coordinates depends on many factors, such as the handedness of the images (radiological/neurological) and the order of operations.  I'd just use trial and error as it is pretty easy to figure out when it is working or not.

Hope this helps.
All the best,
        Mark


On 26 Jul 2013, at 22:40, Joseph Ackerman <[log in to unmask]> wrote:

> I am attempting to do a linear registration between a neonatal t2w anatomical (1x1x1mm) and diffusion (2x2x4mm).  I bet both data sets and run flirt.
>
> flirt -in diff_brain -ref t2w_brain -o test_align -omat lnr_mtrx -dof 6
>
> This gives a nice alignment.  I would then like to apply the transformation to the diffusion without changing the voxel size and thus I run
>
> flirt -in diff_brain -ref diff_brain -o diff_brain_lnr -applyxfm -init lnr_mtrx
>
> When I view the output diff_brain_lnr the center of the brain has been dramatically shifted (I think) and the entire brain is crammed in the upper left hand of the fslview viewing gui.  Has anyone seen this or experienced it before?  I also tried applywarp with no warp and --premat=lnr_mtrx and the results were the same.  Is there any way to calculate the center of an image in fsl and add that to the header (that would appear to be the problem).
>
> Any help is greatly appreciated.

________________________________

The material in this message is private and may contain Protected Healthcare Information (PHI). If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail.