The align Program

Rob MacLeod

1 Overview

The program that we often to place epicardial sock geometry into the reference frame of the torso tank is called align. More generally, align will align any two sets of points according to some subset of points from both files that should be approximately the same. It generates a transformation matrix that any program can multiply with the nodes of the geometry to apply the same transformation to any other points. When we run align we apply the matrix automatically to the nodes of the geometry, and any landmarks in a file optionally included on the command line. We need to apply the same transformation to the needle points that we apply to the sock (and coronaries, stimulus sites, or any other landmarks that we digitize at the same time as the sock). Thus, the transformation matrix that we can reuse for subsequent manipulation of geometry elements.

2 Usage

align  fixfilename rotatefilename  [-l linksfile] [-m landmarkfile] [-z zoffset]
       fixfilename:    contains points in fixed space (.pts) [mm]
       rotatefilename: contains points that will be rotated (.pts) [mm]
       linksfile:      links between fixed and shifted points (.links)
       landmarkfile:   landmark file to be shifted (.lmark)
       zoffset:        z-offset to apply to the aligned points [mm]
                       (Note: negative number to apply downward shift!

3 Applications

3.1 Alignment of 490 sock to tank geometry

For the geometry measurements of the 490 lead sock, we do the following steps.

3.1.1 During the experiment

  1. Before the experiment, align the tank supports to be in the same vertical axis as the digitizer.

  2. Use the reference markers that should be on the sock from previous experiments at the following locations:
    1. to the left of the line between leads 124 and 128.
    2. between leads 79, 117, and 121.
    3. above the line between 92 and 93.
    4. Above the line joining 99, 100, 101, almost directly above 100.
    5. In the rectangle from leads 77, 78, 85, and 86.
    6. Top of the LAD line: lead 240
    7. Bottom of the LAD: lead 213
    In principle, we only need 4 of these but having extra markers is always good in reducing error.

  3. Before any measurements on the sock, digitize the standard reference locations on the torso tank; this provides the means to transform all subsequent measurements to the tank reference frame. These will first be in a file that we will call, which the digitizer program creates.

  4. After lifting the heart from the tank to get access, digitize all the reference markers on the sock. Always make careful note of the amount you raise the heart! We need this value below as part of the alignment phase. All these sock reference points can also go into the same file.

  5. Optionally, remove the sock and digitize the coronaries.

3.1.2 After the experiment

  1. Copy a set of tank reference points, e.g., ~macleod/torso/geom/andy3/tankrefs-all.pts and a 490 sock geometry with 5 reference points, e.g.,
    ~macleod/torso/socks/sock490/490sock-5align.pts, to the local directory.
  2. If necessary, rearrange the order of the sock ref points to correspond with the standard order listed above and then convert the .ms file to .pts file that contains all the reference points using digtoxyz.

    digtoxyz tankrefs.pts

    Note that the tankrefs.pts file contains all tank reference points, but that we digitize only a subset and have them in a file together with the sock reference points.
  3. Set up a file to link the points in tankrefs-all.pts to those in tankrefs.pts (we can use the leadlinks file format described in the map3d manual). Note the order of each entry pair has to point from the fixed file to the same point in the file that contains the points that we wish to rotate. I called this file
  4. Run align on the two files to align all the reference points to the tank space:

    align tankrefs-all.pts tankrefs.pts -l tankrefs.leadlinks

    This generates a file called something like tankrefs_aligned.pts, which contains the tank reference points and the sock reference points, now in the coordinate system of the torso tank.
  5. Make another links file (sockalign.leadlinks to indicate where the nodes in the
    tankrefs_aligned.pts line up with the five reference points in the 490+5 pts file. Note the order can be tricky here, but is easier when the sock ref points are ordered 1-5.
  6. Run align on the 490 sock file to align it according to the five reference points

    align tankrefs_aligned.pts 490sock-5align.pts -l sockalign.leadlinks -z -184

    (we assume here that 184 is the z-offset, the upward shift of the heart in the tank required to digitize from the sock) and make the file called something like 490sock-5align_aligned.pts.
  7. Using emacs, strip the five reference points from the aligned sock points file
    (490sock-5align_aligned.pts) and generate final, aligned 490 sock nodes in a file called something like 490sock_aligned.pts. Copy a .fac file and we have our geometry for the sock and tank, all in the same coordinate space.
  8. To check results, ran the following map3d command:

              map3d -f tank_exact.fac -f 490sock_aligned.fac

To try out a test case of this procedure, go to ~macleod/torso/align/docs/test and you will find a complete set of files, including the log file from each of the two runs of align.

About this document ...

The align Program

This document was generated using the LaTeX2HTML translator Version 2002-2-1 (1.70)

Copyright © 1993, 1994, 1995, 1996, Nikos Drakos, Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999, Ross Moore, Mathematics Department, Macquarie University, Sydney.

The command line arguments were:
latex2html -split 3 -no_white -link 3 -no_navigation -no_math -html_version 3.2,math -show_section_numbers -local_icons align

The translation was initiated by Rob Macleod on 2004-12-17

Rob Macleod 2004-12-17