Hi Jorge,
I think the program is doing what it should, but this isn't what you
want... The attached screengrab shows in the spm_check_registration
window (right), from left-to-right, top-to-bottom:
- the original avg152 image
- the same, reoriented right 30mm
- the reoriented image after resize_img (in register still)
- a version which I will shortly explain, that appears in register
with the original.
The upper-left fslview window shows that the origin (note the 0,0,0 in
the world coordinate boxes) of the result of resize_img has shifted
right 30mm, as desired.
The lower-right fslview window shows the fourth image from the spm
window, it's world origin is unshifted, but, the new image has 30mm of
extra space to the right, and the voxel coords of the origin have
shifted by 15 (from 45 to 60) corresponding to 15*(voxel size of 2mm)
=30mm as expected.
This fourth image was actually created not by reorienting, but by
using resize_img and specifying a world bounding box lower
x-coordinate of -120 instead of -90 as the original image.
This might seem a bit confusing, but when you reorient an image in
SPM, the origin shifts as specified, *and* the bounding box may get
clipped -- since the voxel dimensions don't change. In the case of
shifting right, some of the world bounding box is clipped off the
right of the image. Therefore when my resize_img ensures that the
origin is in the right place, and the bounding box is left alone (if
you put all NaNs) in the resampled image, it doesn't need to change
anything!
If you want the image to voxel-wise shift, you need to manually
compute the desired padding, and specify the new bounding box
appropriately for resize_img.
I think if I changed resize_img to do what you want, it would probably
be wrong in some other cases (e.g. with rotations)... if I can find
the time, I might look into this. For the moment, I'd recommend that
you check the BB using e.g. check_reg, and modify it to give the
shifts you want when prompted in resize_img.
Hope that helps, sorry it's a bit awkward,
Ged.
Joerg Magerkurth wrote:
> Hi Ged,
>
> I'm sorry, but it didn't work. My procedure for testing was:
>
> - load the data in display (the same data is attached)
> - only add 30 in all three translation-fields, rotation is unchanged
> - press reorient
> - select the original file
> - exit spm
> - use resize_img, with the old dimensions and resolution
>
> If the resultion Image was loaded in spm the origin ist change in the
> parameterfields below but not in the Image.
>
> More worse, if I load the Image in FSL the origin doesn't change also in
> the
> showed image parameter.
>
> I have done the procedure several times with other dataset, everytime the
>
> same fault.
>
> But then matlab showing no errors during the hole prozess.
>
> Any ideas?
>
>
> Best regards
>
> Jörg
>
>
>
>
|