How to use Vecwarp to map coordinates after 3dAllineate

Dear AFNI Gurus-

I ran 3dAllineate to send data from an input dset DSET_A to a new dataset/space like this:

3dAllineate                                                                  \
    -base           DSET_B                                                   \
    -input          DSET_A                                                   \
    -prefix         DSET_AinB                                                \
    -cost           nmi                                                      \
    -1Dmatrix_save  DSET_A2B.aff12.1D

If I have have some coordinates in a file LIST_COORDS.1D that are defined in the original DSET_A, how can I find those locations for the mapped dset, DSET_AinB, particularly using Vecwarp?

--pt

Excellent question. You can do the following.

First, we assume your coordinates in LIST_COORDS.1D are defined in standard RAI-Dicom notation, which means that right, anterior and inferior directions have negative signs. Second, we assume that each coordinate is provided as 3 numbers on a line, like: x y z.

If that is all true, then you should be able to run the following Vecwarp command to warp all your coordinates (with the last part using shell syntax to dump all the new coords into a new text file):

Vecwarp                                           \
    -backward                                     \
    -matvec     DSET_A2B.aff12.1D                 \
    -input      LIST_COORDS.1D                    \
    > LIST_COORDS_inB.1D

And keep up the excellent questions!

--pt

Paul, are you congratulating yourself for an excellent question?

Ha, it was one that came up in an email thread, and I thought would be worth having findable publicly.

--pt

1 Like