Print

Print


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
>>>>> 
>