Fiducial Registration and Saving Voxel Data

The Voxel Controls Window

The fiducial registration window can be used to save a voxelised version of the current data set, optionally registered to external data using fiducial points. It uses the reslice window to create the registered voxel data, and hence some of the features are only available when the reslice window is also open. The fiducial registration window can be opened either by clicking the 'Voxels' button in the reslice window, or by selecting 'Fiducial registration' from the registration menu. The window is split into two sections: the image area and upper section of the controls handle registration of the current reslice plane to external data, and the lower section of the controls handle creation of a new voxel data set based on the orientation of the current reslice. If registration is not required, it is possible to save voxel data simply by manually aligning the reslice to cover the current data set, and then skipping directly to saving voxel data.

Registering the data using fiducial points

In order to register the ultrasound data with external (e.g. CT or MRI) data, at least three points must be known in both the ultrasound and external data coordinate sytems. These points must lie on the surface of the subject being scanned. The points are marked within Stradx by landmarks 'a' to 'z'. If using three landmarks 'a' and 'c' must be within one x-z plane of the external data, and landmark 'b' can either be another point in this plane, or alternatively a point out of this plane, where the shortest vector joining 'b' to the line from 'a' to 'c' defines the planar normal. If using more than three landmarks, all landmarks must lie in the same x-z plane.

Establishing fiducial positions

The first step in this process is to define the landmarks in the ultrasound coordinate system. The easiest way to do this is by using the MousePoint window, which can record the landmarks directly using any tracked device that has a fixed point which can be used to locate each landmark. Alternatively, record a data set (using the 'single' sampling rate option) comprising one image per landmark, by holding the face of the probe against each fiducial point in turn. Then place landmarks 'a' to 'z' at the top centre of each B-scan in the review window. The image above shows such a data set in the outline window (in this case four B-scans were recorded), together with the landmarks (seen as blue circles with corresponding labels). It is also possible to place these landmarks in the preview window.

Having recorded the location of these landmarks, the position sensor reference must not be moved during subsequent scans, else the registration will be invalid. The landmarks will persist through data sets being closed or cleared, or new data loaded.

The location of the landmarks also needs to be defined in the external data. The simplest way to do this is if an x-z plane through the data is available, which contains at least the fiducial points corresponding to landmarks 'a' and 'c'. This plane of data should first be converted to a 'pgm' or 'ppm' image: for documentation on this very simple format, see for instance the netpbm pages. Having done so, the image can be loaded into Stradx using the 'Image: Load' button.

Marking fiducial points on external data

The screenshot above shows such an image (in this case from CT data): the fiducial points are around the skin surface at the top left hand side. The fiducial points corresponding to landmarks 'a' and 'c' have been marked by holding the mouse pointer over the location and using keys 'a' and 'c' to place the landmarks. Landmarks can be deleted by pressing the key again whilst holding the mouse still. They can be located more accurately by zooming the image: click and drag the left mouse button to mark the area you wish to enlarge. The zoomed image is smoothly interpolated using cubic B-splines, enabling landmarks to be located with sub-pixel accuracy.

Note that if you are only using three points, there is no need to place landmark 'b' in this image: you simply need to indicate whether this landmark is in the plane, or out of the plane, by checking the appropriate box. By default, the origin of the registered coordinate system is at the bottom left hand corner of the image. If you want the origin to be placed at landmark 'a' instead, check the `Origin at A?' box.

Providing you have already marked the fiducial locations in the ultrasound coordinate system, as the landmarks are placed on this image, the location of 'A', and the two variables Angle and Scale, are updated automatically from the position of the landmarks. If the registration procedure has been followed correctly, the scale (in cm/pixel) should be the same as the known scale of the external data. If you do not have an external data image available, then the location of 'A', and the Angle and Scale can be entered manually instead of placing landmarks on an image. The angle is measured anti-clockwise about landmark 'a' from the x axis to the direction of the line joining 'a' to 'c'.

If you are using more than three landmarks, the registration will be achieved by optimising the RMS error between the ultrasound-based and external data-based locations of each of these landmarks. This can provide a more reliable registration in some circumstances.

Changing the contrast

If the original data has more than 8 bits per pixel, and the corresponding 'ppm'/'pgm' image was also saved with more than 8 bits per pixel, then the colour mapping of the image to the display can be varied using the middle mouse button. This is known as windowing in a CT context. Clicking and dragging horizontally will vary the range of displayed pixel values, and clicking and dragging vertically will vary the central value about which this range is disposed. These values are displayed in red at the bottom left of the image as the mouse is dragged (note that the units are simple integers corresponding to the range of the stored data, NOT Hounsfield units). See below for an example of the previous image with adjusted colour mapping.

Checking data alignment

Once the landmarks have been positioned in both the ultrasound and external data, the reslice can be aligned with the external data by pressing the 'Align' button. Having aligned the reslice, it is also superimposed on the external data image in the fiducial registration window, providing the reslice window is open, as shown above. This allows verification that the registration is sensible. The reslice alignment ensures it is in the plane of the external data image, and the axes point in the same direction. However, translation of the reslice within this plane, and the size of the reslice, are dependent on the original reslice. If you want to change the location of the reslice, or its size, then move the reslice to the approximate location, then press the 'Align' button once more. When the data set is saved, the location of the top left corner of the reslice relative to the registered coordinate system is also saved: see the description of file formats for details.

Aligned data in outline window

Above is an example of an aligned reslice in the outline window, also showing the fiducials corresponding to landmarks 'a', 'b' and 'c'. The white outlines show the ultrasound data set. The 'Align at' slider can be used to align the reslice at a fixed offset from the external data image plane. Note that this only affects the current reslice (and hence also what is superimposed on the external data) and not the saved registered data set. Once you have changed this slider, you need to press the 'Align' button to generate a new reslice.

External data aligned in reslice

If you want to save the current displayed image to a '.ppm' file, then use the 'Image: Save' button. This can be used either to save a zoomed version of the original image, or to save an image which has registered ultrasound data superimposed on top of it. Such an image is shown above.

The fiducial registration can be save to a .sxf file by using the 'Fiducial registration: Save' button, and similarly saved files can be loaded using the 'Load' button. These files contain the persistent landmarks 'a' to 'z' (displayed in the measurements window), the landmarks placed in the fiducial registration window, and the values of the various fiducial registration controls. Once loaded, this information persists through the opening and closing of data files: it is expected that fiducial registrations will be valid for multiple sets of ultrasound data.

Saving the data to a voxel data set

Once the reslice has been registered (or manually aligned if registration was not required), then a new Stradx data set can be created in voxel form, by clicking on the 'Save voxel data' button. Each frame in this new data set will be aligned with, and have the same dimensions as, the current reslice. The spacing between each new frame will be the same as the pixel width in each frame, thus generating a uniform cuberille. The total number of frames is dependent on both the setting of the 'Maximum depth' slider, and the extent of the current data. The new data set will have enough frames to cover the minimum of the data extent or the value of this slider, i.e. the voxel data will never contain frames which have no data in them.

The reslice thickness (and therefore also the nature of compounding) is ignored in the generation of this data set. However if the reslice is being cropped to a surface, then the voxel data will also be cropped to that surface. In addition, a segmentation file will be created which contains a contour for each new frame corresponding to the intersection of the current surface with that frame. This facility can be used to register surfaces generated in Stradx to external data. If you are cropping the reslice to a surface but don't want to save a segmentation file, un-check the 'with segmentation' button.

Note that the creation of this data set can take a while: it will usually involve calculating hundreds of reslices of the original data. A message is displayed in the reslice window to indicate progress. The 'Reduce data by' slider can be used to reduce the size of the generated data set (and also the time taken to generate it): if set to 1, the voxel width will be the same as the pixel width in the reslice window. If set to a larger value, the voxel width will be increased by this value in all dimensions (hence a value of 2 will reduce the storage space by a factor of 8).

Voxel data set in outline window

The voxel data is saved in standard Stradx file format, so that it can be loaded into Stradx after it has been created. The image above shows the outline window with a voxel data set which has been created from the same data set as in the previous examples. Note that all the frames are now exactly parallel and evenly spaced. Since the '.sxi' data file is simply a stack of bytes, this can easily be loaded into other visualisation packages or read by custom software.

If the reslice was registered (by clicking the 'Align' button) immediately before the voxel data was saved, then the new data set will be saved in the registered coordinate system, otherwise it will be saved in the original coordinate system. In the latter case, this means that a landmark placed in the original data will still be at the same anatomical position when the new voxel data is loaded into Stradx.

Voxel data set in review window

The image above shows one frame from the data set above. This data was saved with a 'Reduce data by' value of two, hence the frame is half the width and height, but in all other respects the same, as a reslice of the original data.