Hi,
It is not exactly this way, what I do, though I do not see a huge
difference yet. However, it is within a bit more complex script, so I
guess I identified the problem.
I first coregister functional data with a small FoV to an anatonical
reference image to obtain a transformation matrix. I then create a
header for a volume, that covers the whole reference space, but has got
the resolution of the epi space. I use the transformation, to resample
the functional data to the new header (I guess, here is the problem). In
the next step I determine the ROI comprising the sampled functional
data, and use the information to reduce the volume size of the aligned data.
Just to check the quality of the registration, I was trying to overlay
the coregistered data onto the anatomical data. Since I assumed, that
the coordinate system of both data sets should be the same, I used the
identity transformation. This did not show a nice result for the small
volume.
Right now I think that I introduced this problem by using a newly
created header file as reference, at least this appears plausible to me
right now.
Thanks for the help,
wolf
On 01/11/11 23:14, Mark Jenkinson wrote:
> Oh.
> Can you explain exactly what you are trying to do?
> I'm unsure why you are having trouble.
>
> I just tried the following:
> fslroi epi epi_roi 10 40 10 40 5 12
> flirt -in epi_roi -ref epi -usesqform -applyxfm -out epi_roi2whole
> and it worked perfectly.
>
> Is this the kind of thing you were trying?
>
> All the best,
> Mark
>
>
> On 1 Nov 2011, at 22:02, wolf zinke wrote:
>
>> Hi Mark,
>>
>> Thanks for the fast reply.
>>
>> I tried it again with the -usesqform flag, but I did not notice much of a difference. For now I can skip fslroi and continue without a reduction of the data size. I will test it again these days.
>>
>> wolf
>>
>>
>>> Hi Wolf,
>>>
>>> This is probably about what you expect flirt to do.
>>> By default flirt does *not* use qform or sform information.
>>> So resampling with an identity matrix aligns the corners of
>>> the image (where the 0,0,0 voxel coordinates are) and
>>> so you'd see a shift. If you use the -usesqform flag with
>>> flirt then it should align the images based on the qform
>>> information, which will hopefully do what you want.
>>>
>>> Let me know if this does what you want.
>>>
>>> All the best,
>>> Mark
>>>
>>>
>>>
>>>
>>> On 1 Nov 2011, at 20:58, wolf zinke wrote:
>>>
>>>> Hi again,
>>>>> FSL 4.1.9 has a change to the ROI library functions, which I believe fixes the bug below,
>>>> Apparently, fslroi affects the data now in a different manner. After reducing the image volume with fslroi, mm coordinates refer to the same location in the brain as in the full volume. However, when I resample both images to overlay them with an anatomical image (flirt transformation with the identity matrix), the smaller volume is shifted while the large image is matching the brain reasonable well (I pasted some lines of the header for the full volume and the fslroi'd volume below).
>>>>
>>>> Is this now the expected behaviour? I would expect, that the same transformation of both, a full image volume and a smaller volume after using fslroi, does not change the spatial alignment to a reference image. Am I wrong and everything is working in the intended way?
>>>>
>>>> Thanks for all the support,
>>>> wolf
>>>>
>>>>
>>>> ____________________________________________
>>>> EPI_full_brain.nii.gz
>>>>
>>>> sizeof_hdr 348
>>>> data_type FLOAT32
>>>> dim0 3
>>>> dim1 121
>>>> dim2 163
>>>> dim3 121
>>>> [...]
>>>> qform_name Scanner Anat
>>>> qform_code 1
>>>> qto_xyz:1 -1.399333 -0.021830 -0.037304 84.721703
>>>> qto_xyz:2 -0.029030 1.369892 0.287320 -94.615875
>>>> qto_xyz:3 -0.032021 -0.287955 1.369698 -45.274288
>>>> 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 -1.399333 -0.021831 -0.037297 84.721703
>>>> sto_xyz:2 -0.029030 1.369893 0.287320 -94.615875
>>>> sto_xyz:3 -0.032015 -0.287956 1.369698 -45.274288
>>>> sto_xyz:4 0.000000 0.000000 0.000000 1.000000
>>>> ____________________________________________
>>>> EPI_red_brain.nii.gz
>>>>
>>>> sizeof_hdr 348
>>>> data_type FLOAT32
>>>> dim0 3
>>>> dim1 99
>>>> dim2 74
>>>> dim3 90
>>>> [...]
>>>> qform_name Scanner Anat
>>>> qform_code 1
>>>> qto_xyz:1 -1.399333 -0.021830 -0.037303 63.992867
>>>> qto_xyz:2 -0.029030 1.369892 0.287320 -79.045303
>>>> qto_xyz:3 -0.032021 -0.287955 1.369698 -10.468461
>>>> 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 -1.399333 -0.021831 -0.037297 63.993023
>>>> sto_xyz:2 -0.029030 1.369893 0.287320 -79.045303
>>>> sto_xyz:3 -0.032015 -0.287956 1.369698 -10.468370
>>>> sto_xyz:4 0.000000 0.000000 0.000000 1.000000
>>>>
>>>>
>>>>
>>>>
>>>> On 26/10/11 14:29, Matthew Webster wrote:
>>>>> Hello Wolf,
>>>>> FSL 4.1.9 has a change to the ROI library functions, which I believe fixes the bug below,
>>>>>
>>>>> Many Regards
>>>>>
>>>>> Matthew
>>>>>> Hi,
>>>>>>
>>>>>> Thanks for the new version.
>>>>>>
>>>>>> There was recently a discussing about a minor bug with fslroi (https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=FSL;2163c160.1109). The problem was, that it does not change the qform. Was this fixed with the current release, or is the suggested workaround still required? I guess applying such a correction when fslroi itself is already modifying the qform is not such a good idea...
>>>>>>
>>>>>> thanks for the support,
>>>>>> wolf
>>>>>>
|