The adjust_slice_spacing user macro takes a 3D uniform field, changes the spacing of the specified axis and converts it into a 3D rectilinear field. This macro can be used to irregularly space the uniform output of the build3d_2 user macro.
Name | Type | Description | |
in_fld | Field | 3D Uniform field data that is to be irregularly spaced. | |
slice_position | float[] | Position of each slice on the specified axis. | |
Name | Type | Description | |
spacing_axis | int | Specifies which axis spacing should be adjusted. | |
Name | Type | Description | |
out_field | Field | Output 3D Rectilinear field data. | |
When gathering data it is quite common to find situations where data is evenly spaced in two dimensions but is irregularly spaced in the third dimension. One example of this is medical imaging where several techniques involve taking a number of cross-sectional images of a body. Each of these individual cross-sectional images can be high resolution. However setting up the imaging equipment to acquire each image is a time consuming and expensive process. Therefore relatively few images and taken and they are distributed so that they are concentrated around the region of interest.
Data volumes built from these irregularly spaced images are called rectilinear fields within AVS/Express. Rectilinear fields can have irregularly spaced axes in all three dimensions. To create a rectilinear field the spacing for each axes has to be specified. This can be difficult and time-consuming. The adjust_slice_spacing user macro aims to solve this problem by automating the create of a rectilinear field.
The adjust_slice_spacing macro takes a 3D uniform field and a floating point array as input. The floating point array specifies the position that each slice on the specified axis should take. The macro creates the necessary spacing data for each axis and outputs a complete rectilinear field. The axis that should be irregularly spacing can be specified. By default the spacing of the Z axis is adjusted.
in_fld
Uniform 3D field that is to be irregularly spaced. The input field must have 3 dimensions and must be uniform. It can contain node data components. These will be copied into the output rectilinear field.
slice_position[]
Floating point array that specifies the position of each slice on the selected axis. The array must have one value for each position on specified axis. The module will raise an error if this is not the case. Note that this array specifies slice position not slice spacing. Hence to evenly space 4 slices at unit intervals the necessary array would be {0, 1, 2, 3}
. The values for this array can either be entered manually or could be read from a data file that was created when the data was originally acquired.
spacing_axis
Integer parameter that specifies which axis should be irregularly spaced. This parameter must be either 0, 1 or 2. These values refer to the X, Y and Z axes respectively. By default the axis that is changed is the Z axis.
out_fld
The output 3D rectilinear field. The output field contains the generated rectilinear mesh and any node data components that are present on the input.
The low-level AdjustSliceSpacingCore module is used in the User Macro adjust_slice_spacing. No parameter block is used.
Four example applications are provided. The Build3D_2_Eg application loads a series of 30 TIFF images, builds a 3D volume from these and displays the volume using an orthoslice and a bounding box. The AdjustSliceSpacingEg application similarly loads a series of TIFF images. However this application also uses the adjust_slice_spacing user macro to irregularly space the image slices. You should be able to see that the orthoslice does not now move up and down in uniform steps.
The NodeARGBDataEg and NodeColorDataEg example applications illustrate how colour from images can be used to colour a final visualization. The NodeARGBDataEg application reads a small set of colour images and displays an orthoslice of the volume. This orthoslice has the same colouring as the original images. No 3D fields are coloured as Express does not support using ARGB data to colour 3D fields. In a similar way the NodeColorDataEg application reads the set of colour images. However it displays both a coloured orthoslice and a coloured isosurface. This illustrates that it is possible to use image data to colour 3D fields.
iac_proj/build3d_2/bl3dmods.v contains the V definitions of the Build3D_2_Params parameter group and the Build3D_2_Core and AdjustSliceSpacingCore low-level modules.
iac_proj/build3d_2/bl3dmacs.v contains the V definitions of the Build3D_2_UI UI Macro, the Build3D_2_Func, node_2_argb_data and node_2_color_data Functional Macros and the build3d_2 and adjust_slice_spacing User Macros.
iac_proj/build3d_2/bl3dapps.v contains the V definitions of the Build3D_2_Eg, AdjustSliceSpacingEg, NodeARGBDataEg and NodeColorDataEg example applications.
The low-level Build3D_2_Mods library containing the low-level Build3D_2_Core and AdjustSliceSpacingCore modules does not specify a process. By default the express process will be used.
Andrew Dodd International AVS Centre
International AVS Centre Manchester Visualization Centre Manchester Computing University of Manchester Oxford Road Manchester United Kingdom M13 9PL