Re: Translation Error [message #26637] |
Thu, 20 September 2001 13:00  |
Steve Hartmann
Messages: 21 Registered: March 2000
|
Junior Member |
|
|
Are you certain that the translation components of your *matrix* array
are in pixels and not cm or mm?
I don't believe that any type of round-off or other error in the IDL
commands would give that much error. You could easily test the
accuracy of your technique by creating a transformation without any
rotation and some set translation (say [20, 0, 0]) and see if your
transformed image is correct.
-Steve
On Thu, 20 Sep 2001 21:13:58 +0200, "B.C. Hamans"
<s448443@stud.tue.nl> wrote:
> Hi Guys,
>
> first thank you for your help on the initial rotation/translation problem.
> The rotation works great but with the translation I'm still off a factor of
> a few voxels (about 5 in each direction) Each voxel represent a volume of
> about 9.6x9.6x9.6mm so this is too much. I'm trying to match the images for
> detection of tumor growth, hart infarct development etc. So i need more
> precision. Can you tell me something more about the precision of the
> functions interpolate (cubic), t3d etc and precision?. These are some pieces
> of code i'm currently using:
> <----Begin--->
> ;Get dimension of the volume
> s = size(vol)
> sx = s(1)
> sy = s(2)
> sz = s(3)
>
> ; Generate volume coordinates
> i = lindgen(sx*sy*sz) ; This is a temporary array for vector indices
> coords = [ [i mod sx],[(i/ sx) mod (sy)],[i / (sx*sy)],[replicate(1,
> sx*sy*sz)]]
>
> ; Reset transformation vector
> T3D, /RESET
>
> ; Set 3D transformation system variable
> !P.T = matrix ; This Matrix is an input from another program which i think
> works without any question
> ; i wan't to keep it this way for ease of use. I don't
> wan't to input the seperate trans or rotations
>
> ;Calculate new sample positions of voxels
> coords = temporary(coords)#!P.T ;temporary to save some memory
>
> ;Interpolate the voxels to the new coords
> trans_vol = reform(interpolate(vol, coords(*,0), coords(*,1), coords(*,2)
> ,cubic, missing=0),sx,sy,sz)
>
> <----End--->
> Earlier in this discussion some of you guys talked about shift vs translate.
> I can't use shift because of pretty large translation in my patient dataset
> which would wrap-around and create false matches. (In the automatic
> registration mode.)
>
> Kind regards,
>
> Bob
>
|
|
|
Re: Translation Error [message #26762 is a reply to message #26637] |
Sat, 22 September 2001 06:44  |
Martin Downing
Messages: 136 Registered: September 1998
|
Senior Member |
|
|
"Steve Hartmann" <s.l.h@badspam.home.com> wrote in message
news:+EiqO3DfXtqC9YDSjBLiIBClgzb+@4ax.com...
> Are you certain that the translation components of your *matrix* array
> are in pixels and not cm or mm?
>
> I don't believe that any type of round-off or other error in the IDL
> commands would give that much error. You could easily test the
> accuracy of your technique by creating a transformation without any
> rotation and some set translation (say [20, 0, 0]) and see if your
> transformed image is correct.
>
> -Steve
I agree - sounds to me like your transform matrix is the culprit - it is a
float/double isnt it?
If I were you I would use T3d to set the tranform as in the example
transform code I posted, or at least check against T3D.
Martin
|
|
|