Writes an AVS/Express field containing uniform/rectilinear/structured field data to an AVS5 "Field" file (*.fld), suitable for reading with the "read field" module.
Name | Type | Description | |
in_field | Field | uniform, rectilinear, or structured field | |
Name | Type | Description | UI Control |
filename | string | name of the file to write. | UIfileDialog |
trigger | int | triggers writing of file. | Save UIbutton |
This module accepts an AVS/Express field and then creates a binary output file in the AVS5 "field" file format (*.fld). The AVS5 "field" file consists of an ASCII header and either the data itself or the filename of a separate data file. The write_field module writes the field data to the field file itself in binary format. The module was designed to allow either the AVS5 or AVS/Express "read_field" modules to access the resulting file.
This module only writes a subset of the .fld format. The module is not able to write out time dependent data. The .fld format does not allow represntation of all possible AVS/Express fields. All node data components must have the same data type and must have a veclen of one.
The binary data is written out in machine-dependent format. If this module is run on a little-endian machine (PC, Linux, Alpha), the resulting .fld file will not be readable on a big-endian machine (Sun, HP, SGI, IBM). In the special case of a Uniform field with byte data and default coordinate information, the resulting .fld files are portable. 2D images, 3D image volumes, or other 3D voxel data are common examples of fields that fit this special case.
in_field
Reference to the input field that should be written.
filename
This string value is used to specify the file that the field data should be written to.
trigger
This integer value is used to trigger the writing of the field file. The field file will not be written until this parameter is updated. Normally this parameter will be connected to a button displayed within the user interface.
(none)
The User Macro write_field combines the low-level module WriteFldCore with the UI Macro WriteFldUI.
Two example applications are provided, WriteFldEg and ReadFldEg. The WriteFldEg application demonstrates how slices from the Hydrogen data-set can be written to field files. ReadFldEg is a very simple application that allows those fields to be quickly read back into AVS/Express and shown to be correct.
iac_proj/wr_fld/wfldmods.v contains the V definition of the WriteFldCore module.
iac_proj/wr_fld/wfldmacs.v contains the V definitions of the WriteFldUI UI macro, the write_field user macro and the example applications.
The low-level WriteFldMods library containing the module WriteFldCore does not specify a process. By default the express process will be used.
David Goughnour, Sudhir Sangappa Advanced Visual Systems, Inc. sudhir@avs.com
International AVS Centre Manchester Visualization Centre Manchester Computing University of Manchester Oxford Road Manchester United Kingdom M13 9PL
AVS Read_Field module