Thanks a lot Mark!
So I understand that I should round to the closest integer when I want
to select the voxel I want to work with (I identify the voxel on a
functional that is coregistered to anatomical, covert the coordinate
back to the native space of the functional non-registered with
img2imgcoord, round it to closest integer and use this rounded
coordinate to locate the corresponding voxel in the original
non-registered functional).
I also understand that rounding should not be perform in intermediate
steps to avoid errors in coordinate conversions between applications.
Thanks again! That was very useful :-)
Sébastien Proulx, MSc
Research Assistant
McGill University
(514) 398-6644 #00445
Le 13-02-07 4:06 AM, Mark Jenkinson a écrit :
> Dear Sébastien,
>
> The origin is in the centre of the voxel at the corner of the image. Hence the centre of first voxel is at (0,0,0), then next at (1,0,0) and so on. For your example of 27 1mm voxels that exactly fit into 1 3mm voxel (aligned at the outer faces) then the voxel coordinate of the big 3mm voxel is (0,0,0) in its own voxel coordinate system but will be (1,1,1) in the coordinate system of the 1mm voxels. That is, the centre voxel of the 3x3x3 array of voxels will have its centre exactly aligned with the centre of the 3mm voxel. The coordinates of the other 1mm voxels are (-1,-1,-1), (0,-1,-1), (+1,-1,-1), (-1,0,-1), etc.
>
> The mappings that you get from img2imgcoord are always in floating-point values as they refer to mappings of the centres of the voxels. Whether you round these values or not depends on your application but most of the time you do not want to round them as the decimal parts are important for doing interpolation.
>
> All the best,
> Mark
>
>
> On 7 Feb 2013, at 00:28, Sébastien Proulx <[log in to unmask]> wrote:
>
>> Hello fsl community,
>>
>> Converting voxel coordinates with img2imgcoord usually gives non integer output coordinates (voxel number with decimal). The question, that may sound dumb, is whether those new coordinates should be rounded to the nearest integer, or to the (nearest) smaller or bigger integer?
>>
>> I think it comes down to whether the voxel coordinate locates a corner of the voxel or its centre?
>>
>> If an example is needed, consider an image A containing a single big 3mm isometric voxel, the coordinate of which would be 0 0 0, and a corresponding image B with 27 1mm isometric voxels, arrange in a cube that perfectly fits the big fat simgle voxel in image A. Will image B coordinates 0 0 0, 1 0 0 and 3 0 0 correspond respectively to coordinates 0 0 0, 0.33 0 0 and 0.66 0 0 in image A (the corner of the voxel is indexed, so that I have to round to the lower integer), or to coordinates -0.33 0 0, 0 0 0 and 0.33 0 0 (the middle of the voxel is indexed, so that I should round to the nearest integer)?
>>
>> Thanks a lot!!!
>>
>> --
>> Sébastien Proulx, MSc
>> Research Assistant
>> McGill University
>> (514) 398-6644 #00445
|