Convert a scatter field into a uniform field without interpolation
module sct2unif <build_dir="iac_proj/sct2unif", src_file="sct2unif.cxx", out_hdr_file="gen.hxx", out_src_file="gen.cxx", cxx_hdr_files="fld/Xfld.h"> { Grid_Struct+Node_Data+read+req+notify &in_fld<NEportLevels={2,0}>; prim+read+req+notify &fill_value<NEportLevels={2,0}>; float+read+nres min_coord[]=>in_fld.coordinates.min_vec - 1; float+read+nres max_coord[]=>in_fld.coordinates.max_vec + 1; float+read+nres coords[]=>in_fld.coordinates.values; Mesh_Unif+Node_Data+write out_fld<NEportLevels={0,2}> { ndim=>in_fld.nspace; nspace=>in_fld.nspace; nnode_data=>in_fld.nnode_data; }; cxxmethod+req+notify_inst sct2unif_meth; };
The sct2unif module converts a structured field with a number of scattered nodes into a uniform field. The resultant uniform field can then be visualised using simple techniques, such as orthoslice. This generation is done by creating a uniform mesh and mapping each scattered node to the nearest node in the uniform mesh. If a uniform node has no corresponding scattered node then all node-data components are given the value fill_value. If multiple scattered nodes map to a single uniform node then the resultant node-data values are the average of the scattered node-data values.
The uniform mesh used to generate the output field has nodes spaced at unit intervals along each at its dimensions. The mesh has as many computational dimensions (ndim) as the input field has coordinate dimensions (nspace) and the same number of coordinate dimensions as the input field. Each coordinate dimension of the output field extends from the (minimum value -1) to the (maximum value +1) of that dimension in the input field.
The sct2unif module performs a similar function to that of the standard AVS scat_to_unif macro. The scat_to_unif macro also performs interpolation between the nodes in the resultant uniform field. Therefore the sct2unif module is significantly less complex and hence will be of most use in situations where only a simple conversion is required. In some situations interpolation between nodes reduces the clarity of the visualisation and is not desirable. Therefore this module can also be used in those situations to provide better results.
&in_fld
Reference to the structured field that contains the scattered nodes that are to be converted into a uniform field. The structered field must have a 1 dimensional array of nodes (ndim=1). If this is not the case then the module will stop with an error.
&fill_value
Reference to a primitive value that specifies which value should be used to fill in blank nodes. If no scattered node maps to a node in the uniform field then the node-data components for that node will be set equal to this value.
out
The generated uniform field. The uniform field has dimensions that are a unit larger in all dimensions than the extents of the scattered nodes. The field also has the same number of node-data components as the scattered nodes.
The macro field2scat takes Field objects, removes any connectivity information present and rearranges the resultant data into a format that can be used by the sct2unif module. The primary application of this macro is to allow UCD data to be mapped to a uniform mesh using the sct2unif module. This is demonstrated in the example application Sct2UnifEg3.
Three example applications are provided; Sct2UnifEg1, Sct2UnifEg2, Sct2UnifEg3. Please note that an object of one color in the "Before" view does not neccessarily correspond to the same color object in the "After" view. This is because the fill_value used changes the range of data values, and hence changes the way values are mapped to colours.
iac_proj/sct2unif/s2ufmods.v contains the sct2unif module and the field2scat utility macro V definitions.
The low-level Sct2UnifMods library containing the module sct2unif does not specify a process. By default the express process will be used.
James Schumm
Andrew Dodd
International AVS Centre Manchester Visualization Centre Manchester Computing University of Manchester Oxford Road Manchester United Kingdom M13 9PL
scat_to_unif, field2scat, Sct2UnifEg1, Sct2UnifEg2, Sct2UnifEg3