Dear Luis,
1 - It works fine for me. For example, if I have a functional
image with voxel size 4x4x6mm and use the following matrix:
1 0 0 0
0 1 0 0
0 0 1 6
0 0 0 1
then I get a single pixel shift in the z-direction (it also
works for x and y). Note that the translation in the 4th
column is in mm, and that the image looks identical (no blurring)
except that it is shifted in the field of view. You can easily
see this by loading the pre- and post-transformed images into
FSLView and flicking between them (turning the "top" one on and
off). If you still cannot reproduce this, can you give us more
details like the exact matrix you and using and the avwhd output
for the images involved, as well as the platform/machine you are
running everything on.
2 - Your command line is writing over your inputs (as
input=output=fmaps) but assuming that this is what you want
then the line seems fine.
It might be failing to work if the new images are quite different
in voxel size and Field of View (FOV) from the original images
used in mcflirt (i.e. structs vs fmaps). Is this the case?
The matrix files in the .mat directory are standard flirt matrices
where they map mm coordinates to mm coordinates. The par files
from mcflirt (which are very different) are in units of radians
and mm, but they require careful handling as translation is very
sensitive to the exact coordinate conventions that you use.
I do not advise trying to use the par file directly as you will
need to reverse engineer our conventions, which although sensible,
are not straightforward (e.g. the centre of rotation is the
centre of gravity of the image - whereas this is not the case for
the MAT* files). So I would stick to using the MAT* files.
You can check if you have a problem with applyxfm4D as opposed
to mcflirt and the MAT files by using flirt with -applyxfm and
-init on the individual parts of the 4D image. So, extract
the required 3D volume (use avwroi) then apply flirt using
the correct MAT* transformation file, then see if the result
seems correct or not.
If you are still having trouble after all of this then
let us know.
All the best,
Mark
On 20 Oct 2005, at 17:23, Luis Hernandez-Garcia wrote:
> Dear FSL experts,
>
> I have a couple of questions to ask about
>
> 1- I think this one is a bug: if you try to do integer pixel shifts
> using flirt (like this)
>> flirt -in spgr.hdr -ref spgr.hdr -out upspgr.hdr -init up1.mat
>> -applyxfm
> where up1.mat contains an INTEGER z-direction shift only, flirt
> doesn't do anything at all to the image. With non-integer shifts it
> works fine though.
>
>
> 2. I think that this other one is lack of knowing the correct usage:
>
> Lets say that I run mcflrt on a time series of images (structs.img)
> and produce rstructs.mat/MAT000* series of matrices. I want to apply
> those MAT transformations to a set of corresponding field maps.
>
> applyxfm4D fmaps.img r_fmaps.img fmaps.img rstructs.mat -fourdigit
>
> The resulting rotated images have crazy rotations/translations (except
> fot the first one) even though the original realigned structurals have
> been realigned properly.
>
> Could someone tell me what's wrong? What are the units in the .par
> files? is it mm and degrees?
>
> Thank you very much,
>
> -Luis
>
>
> Begin forwarded message:
>
>> From: "Robert Welsh" <[log in to unmask]>
>> Date: July 13, 2005 2:47:37 PM EDT
>> To: <[log in to unmask]>
>> Subject: flirt command
>>
>>
>> bug is when the transformation matrix appears to have unit voxel
>> shift.
>>
>> flirt -in spgr.hdr -ref spgr.hdr -out upspgr.hdr -init up1.mat
>> -applyxfm
>>
>>
>> -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
>> Robert C. Welsh, PhD
>> Research Investigator
>> Department of Radiology
>> University of Michigan
>> (734) - 764 - 2412 (fax)
>> [log in to unmask]
>>
>>
>>
>>
>> **********************************************************
>> Electronic Mail is not secure, may not be read every day, and should
>> not be used for urgent or sensitive issues.
>>
>>
|