gen
Description
Generate an image with given channel values. Can also generate patterns. Each band is given a nominal value and uncertainty, along with a centre frequency and a mode (for patterns).
Modes are:
- flat : N and U are used to fill the entire band
- ripple-n: the N value is not a value, but a multiplier applied to distance from centre - the sine of this gives the value. The U value is generated as in 'flat'
- ripple-u: as ripple-n, but this time U is used as a multiplier to generate the ripple pattern in uncertainty, while N is generated as in 'flat'
- ripple-un: both values are ripple multipliers.
- half: nominal is N on the left, U on the right. Uncertainty is 0.1. (Test value)
- checkx: nominal is a checquered pattern with each square of size N, offset by U in the x-axis. uncertainty=nominal.
- checky: nominal is a checquered pattern with each square of size N, offset by U in the y-axis. uncertainty=nominal.
- rand: both nom. and unc. are filled with non-negative pseudorandom uniform noise multiplied by N and U respectively
- gaussian: nom. is filled with gaussian noise centered around N with a std. dev. of U. U is zero. The RNG is seeded from the CWL.
- gradient-x: nom. is filled with a gradient from 0-1, U is zero. Number of steps is N (zero means smooth).
- gradient-y: nom. is filled with a gradient from 0-1, U is zero. Number of steps is N (zero means smooth).
A useful pattern might be something like this:
- Chan 0: checkx, N=8, U=0
- Chan 1: checkx, N=8, U=4
- Chan 2: checky, N=8, U=4
To get variation in uncertainty, create a similar pattern but with a longer period using another gen node:
- Chan 0: checkx, N=16, U=0
- Chan 1: checkx, N=16, U=8
- Chan 2: checky, N=16, U=8
and merge the two together, using the first gen to create nominal values and the second to create uncertainty values, with an expr node using the expression v(a,b).
Connections
Outputs
| Index | Name | Type | Desc |
|---|---|---|---|
| 0 | (none) | img | (none) |
Parameters
| gen | imgwidth: integer (default 256) | Width of the image | |
| imgheight: integer (default 256) | Height of the image | ||
| chans: list | (ordered) | n: float (default 0.0) | Nominal control value - 'mode' determines how it is used |
| u: float (default 0.0) | Uncertainty control value - 'mode' determines how it is used | ||
| cwl: integer (default 100) | Centre wavelength | ||
| mode: string (flat, ripple-n, ripple-u, ripple-un, half, checkx, checky, rand, gaussian, gradient-x, gradient-y) (default 'flat') | Mode of operation | ||
| text: string (default '') | Text to write on the image | ||
| textx: integer (default 0) | X position of text | ||
| texty: integer (default 0) | Y position of text | ||
| textsize: float (default 1.0) | Size of text (units arbitrary but relative to image size) |
Automatically generated by generate_autodocs.py
Date: 2025-10-24T15:30:01.755150