users > Transform a set of coordinates (not image) with registration output
Showing 1-4 of 4 posts
Display:
Results per page:
Dec 19, 2017  10:12 AM | Dan Xie - UCSF
Transform a set of coordinates (not image) with registration output
Hi Developers, 

Suppose that I have registered stack A to a reference stack B and have the output saved in AtoBoutput.xlist. Then, if I have a set of (x,y,z) coordinates marked from the unregistered A, how can I find their corresponding coordinates post registration? In other words, could I apply reformatx on a list of numbers instead of an image stack? 

Thanks and happy holidays! :)

Best,
Dan
Dec 29, 2017  10:12 AM | Torsten Rohlfing - Google LLC
RE: Transform a set of coordinates (not image) with registration output
Hi Dan -

I think the "streamxform" tool should do exactly what you want. The command line takes a single or multiple transform files, analogous to the "reformatx" tool.

It will then read x,y,z coordinates from standard inputs, one point per line, and write transformed coordinates to standard output.

Note, however, that the direction of the transform appears reversed relative to "reformatx", that is, the input coordinates are expected to be in the space of the reference image, and the transformed points will be in the coordinates of the moving image. Thus, while reformatx will produce a resliced moving image in the space of the reference, streamxform will produce a transformed reference image geometry in the space of the moving image.

Hope this makes sense.

Best,
 Torsten
Jan 3, 2018  11:01 AM | Dan Xie - UCSF
RE: Transform a set of coordinates (not image) with registration output
Thanks Torsten! Streamxform does function but the output looked weird. I have some 3D brain images with a couple of neurons marked in each. After registering them to a reference brain image, I transformed coordinates of all the marked neurons and plotted them together with the reformatted brain image. It seems a significant shift is applied to the coordinates so they fall out of the brain image range.I tried direct and inverse streamxform and the shift remained.

How should my coordinates in the input list be ordered, is it x_i, y_i, z_i or any other order? And are the definition of x,y,z consistent with that in tiff image stacks, i.e, x-horizontal from left to right, y-vertical from top to bottom, z- across different slices?  I was wondering if I have messed that up.

Best,
Dan
Jan 6, 2018  09:01 AM | Torsten Rohlfing - Google LLC
RE: Transform a set of coordinates (not image) with registration output
Hi Dan -

Coordinates are a bit tricky, because they depend on image size as well as (for medical images) standardized orientations.

Your best bet would be to use CMTK's "triplanar" viewer to locate landmarks and then use whatever coordinates the program gives you.

Note that "triplanar" will only be part of your installation if CMTK was build with Qt/GUI support. That should be the case for all binary packages here on NITRC *except* the native Windows package. (On Windows, you can use the Cygwin binaries instead, which do have Qt support enabled.)

Best,
  Torsten