Sweep Alignment Window

With multi-sweep data sets, there is sometimes a significant misalignment between neighbouring pairs of sweeps, especially with high resolution scans. This is because the anatomy is pushed one way during one sweep of the probe, and another during the next sweep: however accurate the position sensor may be, the anatomy has moved between sweeps and there will therefore be a misregistration between the sweeps. The example below shows a reslice through a two-sweep scan of the liver. A dividing plane has been used to separate data from the two sweeps. The misregistration is evident along the dividing plane, especially around the diaphragm and the blood vessels.

The Reslice Window

To remedy this misalignment, Stradx incorporates a rigid registration facility to translate one sweep relative to another until they line up optimally. This assumes that there is no rotational misalignment between the two sweeps, which is reasonable since it is unlikely that the contact pressure of an ultrasound probe will cause the anatomy to rotate. It also assumes that there is no non-rigid misalignment between the two sweeps - more about this later. Stradx assesses the quality of registration by looking at data only on the dividing plane which separates the two sweeps: this is much faster than computing a similarity criterion across the whole overlap region.

The sweep alignment window is launched by a button on the image registration window. The button is normally greyed out, since the sweep alignment facility is enabled only when a dividing plane is defined. The sweep alignment window will be blank until you select the dividing plane on which you wish to perform the registration. The selection is achieved by right clicking on the appropriate dividing plane in the `Outline' window. When this is done, the sweep alignment window should look something like the example below.

The Sweep Alignment Window

The window shows a reslice from the first sweep (sweep 0) in red, superimposed on a reslice from the second sweep (sweep 1) in green. Both reslices are computed on the dividing plane so, if the sweeps are properly aligned, they should exhibit certain similarities: strong features should coincide, though the grey levels will differ since the sweeps were acquired from different directions of insonification. In this example, the misregistration is evident in the poor alignment of the dark blood vessels and the bright diaphragm.

The sliders and buttons at the bottom of the window allow you to control the subsequent registration process. A pull-down menu in the top row allows you to select which sweeps to align, in the geometrically complicated case where a dividing plane separates more than two sweeps. Next is a menu to select the similarity criterion with which to assess the quality of the alignment. Stradx offers a choice of mutual information, correlation ratio or absolute grey level difference. The last control in the top row is a toggle button to select whether the overlap between the sweeps should be preserved. This is useful with simple similarity criteria like the absolute difference: it stops Stradx separating the sweeps, leaving just a small, featureless overlap region which scores well with the absolute difference similarity criterion (since two featureless regions look very similar). The button is less influential with the other two similarity criteria, which are sufficiently sophisticated to favour overlaps with a higher information content.

The next row of controls allows you to set the search range for the registration algorithm. The coordinates are with reference to the dividing plane, with x and y spanning the plane, and z normal to the plane (ie. out of the plane of the reslices displayed in the sweep alignment window). Finally, a registration region of interest can be defined in two ways. First, you can limit the comparison to grey levels in a particular range using the sliders in the segmentation thresholds and gating window. You can use this facility, for example, to exclude dark grey levels where there is no data around the edge of a fan-shaped B-scan. Note that you will not be able to calculate the alignment until you have set these sliders to some valid range. Secondly, you can define a rectangular region of interest on the dividing plane by clicking and dragging with the left mouse button in the sweep alignment window. In the example above, you can see the rectangular region of interest (a red box) at its default setting, right at the edge of the reslices in the sweep alignment window. The region of interest can be returned to its default setting by clicking with the right mouse button.

When all these controls have been set, you can start the registration calculation by pressing the `Calculate' button. Stradx uses a multiresolution search to find the x, y and z offsets for one sweep relative to the other that best align the reslices on the dividing plane, according to the selected similarity criterion applied within the selected region of interest. The progress of the multiresolution search is shown in the sweep alignment window as the computation proceeds. When finished, the window might look something like the example below.

The Sweep Alignment Window

The calculated offsets are displayed towards the bottom of the window, and the dividing plane reslices now appear much better aligned. At the moment, the result is local to the sweep alignment window. To export it to the rest of Stradx, specifically to the image registration window, press the `Apply' button. The sweep offset is now a part of the current image registration: you can see its effect by pressing the `use sweeps' button in the image registration window, and save it in an .sxr file by pressing the `save' button. Referring back to the example at the top of this page, here's the same reslice, but this time after the sweep alignment and with `use sweeps' selected in the image registration window.

The Reslice Window

In this case, the alignment has clearly been successful: the principal features are much better aligned across the dividing plane. To preserve the result, simply save the image registration file using the `save' button in the image registration window. Then, next time you load the data set, you can apply the correction again using the `use sweeps' button. Alternatively, you can save a new data set with the correction applied (though you'll lose the raw data) using the `update' facility in the file menu.

If you don't like the result of the sweep alignment, you can remove it in two ways: either press `clear' in the image registration window (though this will remove any inter-B-scan corrections and any other inter-sweep alignments as well), or press `Remove' in the sweep alignment window, which undoes only the most recently calculated sweep alignment (the `Remove' button is not evident in the pictures of the window above - this is because the `Apply' button turns to `Remove' after you press it). You can attempt to get a better alignment in several ways:

If all this fails, it is likely that the sweeps differ by more than a rigid body translation. Assuming no patient motion (which is difficult to ensure in obstetrics applications), the most likely problem is that there is also a non-rigid distortion between the two sweeps: in one of them, the probe compressed the anatomy more than in the other. You can attempt to correct this by first performing a non-rigid inter-B-scan registration using the image registration window. This will even out any contact pressure artefacts between the B-scans in each sweep, stretching them so that they match the B-scan acquired with the smallest contact pressure. If the smallest contact pressure was approximately the same in the two sweeps, then all that should remain is a rigid body misregistration. So calculate the inter-B-scan registration, select "use rigid" and "use non-rigid" in the image registration window, and then try again with the inter-sweep alignment. If a satisfactory sweep alignment still proves to be elusive, then it is likely that the smallest contact pressure was not the same in the two sweeps.

Note that inter-sweep alignments are valid only for the particular set of registrations which were in use when the alignment was calculated. So, if you calculate an alignment using previously calculated rigid and non-rigid inter-B-scan registrations, you won't be able to apply the result unless you select both "use rigid" and "use non-rigid" in the image registration window. If you want a sweep alignment valid for rigid inter-B-scan registration only, select "use rigid" only and recalculate the inter-sweep alignment. All the various inter-sweep alignments (ie. for no inter-B-scan registration, rigid inter-B-scan registration, etc.) are remembered by the image registration window after you apply them (using the `Apply' button in the sweep alignment window) and saved in the .sxr file.

If a data set comprises more than two sweeps, you can concatenate inter-sweep alignments to correct the entire data set. So, for example, first select the appropriate dividing plane to align sweeps 0 and 1. Calculate and apply this alignment, select `use sweeps' in the image registration window, then calculate the alignment between sweeps 1 and 2 using the appropriate dividing plane. When you apply this alignment, you should find that sweeps 0, 1 and 2 are now well aligned.