JOINING TOMOGRAMS FROM SERIAL SECTIONS
Joining tomograms from serial sections into one involves a sequence of
steps:
1) If necessary, flipping or rotating the volume so that slices in Z are
parallel to the plane of section;
2) Extracting sample slices from the section boundaries so that these
boundaries can be visualized and aligned;
3) Getting transformations to align the top of each section to the bottom
of the next;
4) Assembling the joined volume.
Steps 1 and 2 can be accomplished by a command file, startjoin.com, that is
produced by the program Makejoincom. The latter is a shell script that can be
run either interactively (by answering sequential questions) or with
command-line arguments. For step 3, you use Midas and can also use Xfalign
for automated alignment. Step 4 is done with the program Finishjoin, which is
run with a single command-line entry. This makes it easy to rerun the joining
with more or fewer slices included from the individual sections.
Preliminaries to Ponder
If you have N tomograms, then there are N-1 boundaries between sections.
The words "top" and "bottom" are used here with a particular meaning: the
"top" of a section is the part of the tomogram that matches up with the
"bottom" of the next section. These words do not refer to the high Z and low
Z portions of a tomogram, so the top of a section may be at either the high or
the low Z end. The programs will take care of any inversions in Z, both in
extracting sample slices and in assembling the final volume, so you do not
need to worry about entering slice numbers in a particular order.
If you have numbered your sections in the same order as they came off of
the block during cutting, then the surface of a section against the formvar
should be the top, and the other surface should be the bottom. You should be
able to distinguish these surfaces by which one has gold particles closest to
the sectioned material.
You should create a new directory for your joining operation so that it is
easy to clean up afterwards. You do not need to copy the tomograms into this
directory, however, as long as you give Makejoincom a directory path to each
tomogram. It will be easiest if you create a directory on the same level as
the directories for the individual tomograms. After changing to the new
directory, if you had three tomograms to join, you would then make entries to
Makejoincom such as:
../pombe5s1/pombe5s1.rec
../pombe5s2/pombe5s2.rec
../pombe5s3/pombe5s3.rec
Makejoincom provides a lot of flexibility in how you enter the names and
locations of the files. It does this by means of default directories and file
name extensions which you can override when you enter the name for a
particular file. This is potentially more confusing than helpful, so if you
just want to ignore this capability, just accept all the defaults if you run
Makejoincom interactively, and enter the full path and name of each file as
shown above.
If you are interested in using the default naming capabilities, here are
some details. You can enter a default directory for the individual tomograms;
if you enter nothing, the default will be the current directory. You can enter
names such as "../tomos" if the files are in a subdirectory "tomos" parallel
to your current one, or just ".." if the files are in the directory above the
one where you are joining. When you enter the name of an individual tomogram,
you can override this default by putting a directory name in front of the file
name. For example, you could enter "../oddball/sec3" if the tomogram
"sec3.rec" is in the directory "../oddball" while the rest are in "../tomos".
The program will assume the extension ".rec" for the original tomograms and
change the extension to ".tmp" if it has to make a flipped or rotated one. You
can enter different default extensions for either of these types of files.
For example, enter ".rot" if you want that to be the default extension for
newly flipped or rotated volumes. In any case, you can override the default
for an existing, individual volume by entering the name with extension.
You will be asked to enter a "root name" for the joined tomogram. The
final tomogram will be named with this root name plus the extension ".join".
An addition, a host of intermediate files will be created with this root name
and other extensions.
Flipping versus Rotating
Typically, you will have already flipped the Y and Z axes of the
tomograms in the trimming step in eTomo and they are flat enough to join.
However, Makejoincom provides three other options: a tomogram can be either
flipped or rotated into the proper orientation if it has not already been
flipped; and a tomogram that has been flipped can be rotated by small angles.
There are two reasons to use rotations, which are done with Rotatevol. 1) If
the surface of one section is pitched and can be made flat by a small
rotation, then the boundary between sections can be made smaller by correcting
this pitch. 2) If a tomogram is rotated by a large angle (e.g., 90 degrees)
relative to an adjacent section, and if all the sections are aligned to an
average orientation, then the final aligned result will come out at a strange
angle. To prevent this, you would have to set one tomogram as the reference
for alignment in Finishjoin. If for some reason it will not work to have one
tomogram be the reference, then use Rotatevol to avoid this problem.
If you do want to use Rotatevol, then load the section into 3dmod. Open a
Slicer window and adjust the angles to achieve the desired rotation. It may
take only a few tenths of a degree to correct significant pitch in the
section. Use the numeric keypad arrow keys to adjust an angle by small
increments (4 and 6 for 0.1 degree increments, 2 and 8 for 0.5 degree
increments). Once you have obtained the desired rotation, record the three
angles so that they can be entered into Makejoincom.
If you want to use Rotatevol on a volume that has not been flipped yet, then
load it into 3dmod unflipped (use Edit-Image-Flip to unflip it if you have
already loaded it flipped). In this case, one or more of the angles will need
to be set near +90 or -90. In the simple case of correcting a pitch, this
will be the first angle, for rotation around the X axis. If you need to
rotate by 90 degrees in the plane of the section, then the first angle will be
near zero and both the second and the third angles need to be near +90 or -90
(e.g., -90 around Y, 90 around Z).
Deciding on Slices to Extract
Finally, you need to decide which slices to extract from the top and
bottom of each section in order to construct a file that contains a sample of
each boundary. You should include the last slice that contains usable image
data, and 5 to 10 slices into the section from there. This will allow you to
see if there are trends in position within the section that need to be taken
in to account when aligning across the boundary. In some cases, this may not
be needed, and you could choose to extract just one slice that is adequate for
alignment. In general, it is safer to be generous in this initial sample.
These sample slices will also be averaged to produce images that can be used
for automatic alignment.
Note that the bottom of the first section and the top of the last section
will not be extracted because they do not connect to another section.
At the same time that you are making these choices, you may also be able
to decide what range of slices from each tomogram to include in the final
volume. You can do this for a volume that is going to be flipped or for one
that has already been flipped, but not for one that is going to be
rotated from an unflipped orientation.
When you have made all of these preliminary decisions, run Makejoincom
with no arguments and answer all of the questions, or run it with command line
arguments. For example, to do the latter, you could enter a line such as
makejoincom -top 93,98 ../pombe5s1/pombe5s1.rec -bot 5,11 -top 91,96 \
../pombe5s2/pombe5s2.rec -bot 89,95 -rot 0.6,0.4,0 ../pombe5s3/pombe5s3.rec
(The backslash allows you to enter a continuation line.) The "-rot" option tells
Makejoincom to apply Rotatevol on the third volume with the given angles. Note
that all of the entries that apply to one section appear before the section
name.
There is no problem with having spaces in your directory names. When
running interactively, enter the name with the spaces, but with no quotes. When
using command line arguments, enclose the file names in double quotes, e.g.:
makejoincom -top 93,98 "../pombe5 sec1/p5s1.rec" -bot 5,11 \
"../pombe5 sec2/p5s2.rec"
After running Makejoincom, use "subm" to run the command file startjoin.com.
Aligning the Sample Slices
The sample slices are aligned in Midas using a special "chunk" alignment
mode, in which you can adjust the alignment between chunks of slices while
viewing any pair of slices from the chunks. Midas must be run with the "-c"
option followed by a comma-separated list of the number of slices in each
chunk. To get one transform per section, include the top and bottom samples
from each section in the same chunk. In its final message, Makejoincom
outputs a command line to use to run Midas with the appropriate sizes. Run
midas -c size_list join_name.sample join_name.xf
to load the sample file ("join_name.sample") into Midas and make the output
file for transforms be "join_name.xf". For each section boundary, it will
initially show the slice from the top of the lower section as the "reference
section" and the slice from the bottom of the upper section as the "current
section". However, you are free to select another pair of slices for
aligning, to scroll through either set up slices to assess trends in the
structures, and to switch the pair of slices after you have started aligning.
Use the up and down arrows on the spin boxes, or the "a", "b", "c", and "d"
hot keys to move forward and back through the slices in the two sections.
Use the "Current chunk" spin box to switch to a different section boundary.
Using Automatic Alignment
The startjoin command file includes commands to average the slices from
the top and bottom of each section and stack the averages in a file,
join_name.sampavg. These averages can be used to determine the alignment
automatically with the program Xfalign. Xfalign could be useful at two
stages: getting an initial alignment that might need refinement by hand, or
refining an approximate alignment that you have made with Midas. To use
Xfalign for the first stage, enter
xfalign -tomo -pre join_name.sample join_name.xf
The "-tomo" argument tells it that the images are samples from serial section
tomograms, so that it will align only between sections and produce one
transform per tomogram. The "-pre" argument tells it do a prealignment by
cross-correlation.
When you run Midas to check the alignment after this operation, using the
command given above, you may find that some or all of the transformations are
useless. If so, use the menu entry "Edit - Reset to unit transform" to get rid
of a bad transformation, and realign manually.
If you find it difficult to correct for stretching in Midas, you can try
using Xfalign to refine the transformation after you have gotten it nearly
correct. Enter
xfalign -tomo -ini join_name.xf join_name.sample join_name.xf
Here, the "-ini join_name.xf" argument tells it to start with the existing
transformations. The new transformations will be put into a new file by the
same name and the old file will be renamed to join_name.xf~. Run Midas again
to check the alignment. If the alignments are bad, restore the join_name.xf
file from the backup file join_name.xf~.
Making the Final Joined Volume
Once you have found the transformations and exited Midas, you need only to
decide on which slices to include from each tomogram. You might have done
this earlier (see above), but if any of your files were not yet flipped and
were rotated with Rotatevol, you need to pick the slices from the newly
created rotated volume.
Finally, run Finishjoin with the range of sections given for each
tomogram, for example:
finishjoin join_name 15,89 32,95 17,82
Examine the joined volume ("join_name.join") to see whether you want fewer or
more slices at any of the section boundaries. If so, modify the Finishjoin
command and rerun it.
Finishjoin has two options. The -size option allows you to produce an
output volume that is smaller in X and Y than the individual tomograms, or
larger if necessary to compensate for big shifts between individual sections.
The -ref option allows you to specify one of the sections as the reference to
which the others will be aligned. In this case, that reference section will
not be transformed and the others will be. In addition to the case of large
rotations mentioned above, this could also be useful if you have already
modeled on one section, or if you are adding another section to an existing
set of serial sections. Without this option, all tomograms will be
transformed into alignment to a single average position.
Once you are done, you should be able to delete all of the intermediate
image files that have been created. The command file and small transform
files can be kept for future reference.