Outputs a filename string which includes a sequence number within user specifiable text, which may be looped according to the given parameters.
Input Ports
No inputs. Parameters
These parameters are found within the parameter group AnimLoopParams.
reset boolean reset the output sequence number to the start value run boolean start/stop the sequence loop cycle boolean allow the sequence to cycle start_val integer the first nunber in the sequence end_val integer the last number in the sequence incr integer amount to increment on each turn These parameters are found within the parameter group AnimFilenameParams.
pre string text placed before the sequence number post string text placed after the sequence number precision integer miniumum number of digits used for sequence number Output Ports
output string looped output filename string
The User Macro animfilename allows the user to generate a sequence of filenames, which may be passed to other modules and macros, allowing a set of files to be read from disk. The generated filename string has a naming scheme that incorporates a simple sequence of numbers. animfilename will generate a sequence of filename strings on its output, each time the macro executes a step, when the user has selected the macro to run its loop, until either the loop reaches its end value and is not cycled, or the user stops the execution.
The parameters allow text to be included in the output filename string, that occurs both before and after the number. Additionally, the number may have a precision attached to it. A start and end value for the number is required, and optionally the increment value may be altered.The AnimFilenameUI UI Macro incorporates a user interface for both the AnimFilenameGen and AnimFilenameLoop modules, via the Functional Macro, AnimFilename.
No Inputs.
Pre-number text
Text which is placed before the sequence number in the output filename string, i.e., <pre>000.tif.
Post-number text
Text which is placed after the sequence number in the output filename string, .i.e., myfile000<post>.
File number precision
The sequence number precision to be used in the generation of the output filename string. This allows the number of digits used for the sequence number to be fixed to at least the value of precision given, e.g., precision=1, produces output of the form <pre>0<post>, whereas precision=3, forces it to <pre>000<post>. If the numer of digits exceeds the precision, then the required number of digits will be present, e.g., precision=3, when the sequence number has reached 1234, will result in output of the form <pre>1234<post>.
reset
Reset the sequence number back to the start value. This will produce an output filename string of the form <pre><start_val><post>, where <start_val> has the minimum number of digits as specified by the precision parameter.
run
This will start and stop the sequence generation, repeatedly outputting the filename string with the current sequence number.
cycle
Selecting this will allow the sequence to cycle continuously through the specified loop, until either the sequence is stopped by turning off the run parameter, or if cycle is deselected, and the sequence subsequently reaches the end value.
start value
The first number to be used in the sequence generation.
end value
The last number to be used in the sequence generation. The value of the increment parameter may result in this value not being reached; in this instance the numbers generated will not exceed this end value.
increment
The amount to increment the sequence number each time the loop executes.
output
The output filename string, which contains the string based on the pre- and post-text, with the current sequence number inserted according to the specified precision.
The low-level AnimFilenameGen module is used in conjunction with the AnimFilenameLoop module (which is a variation of the AVS/Express loop module), and used in the Functional Macro AnimFilename, and the User Macro animfilename. Additionally these macros also use the AnimFilenameParams and AnimLoopParams parameter block group objects, as does the AnimFilenameUI UI Macro. The User Macro animfilename combines the Functional Macro AnimFilename with the UI Macro AnimFilename UI, via the use of the common parameter blocks AnimFilenameParams and AnimLoopParams, to provide a usable macro in the visualization library.
An example application is not provided, however the use is very simple. For example, typing "myfile" into pre-text, ".tif" into post-text, setting precision to 3, and using start and end values of 0 and 10 respectively, with an increment of 1, will produce the sequence "myfile000.tif", "myfile001.tif", and so on upto "myfile010.tif".
iac_proj/animfile/afn_macs.v contains the Functional Macro AnimFilename, the User Macro animfilename, and the UI Macro AnimFilenameUI.
The AnimFilenameGen and AnimFilenameLoop modules do not require any compilation.
Paul G. Lever International AVS Centre Manchester Visualization Centre Manchester Computing University of Manchester Oxford Road Manchester UK M13 9PL
AnimFilenameParams, AnimLoopParams, AnimFilenameGen, AnimFilenameLoop, AnimFilename, and AnimFilenameUI.
Loop, loop