Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
eyes:flowcontrol:script [2018/01/22 15:19] sfiedle [Usage] |
eyes:flowcontrol:script [2018/01/22 15:58] sfiedle [Example] |
||
---|---|---|---|
Line 23: | Line 23: | ||
The following line reads the dimension in X of the 100-th image in the current I/O to the [[eyes:flowcontrol:variable|]] dimension, which is of type integer. | The following line reads the dimension in X of the 100-th image in the current I/O to the [[eyes:flowcontrol:variable|]] dimension, which is of type integer. | ||
<code lua>cow.dimension = cow.io[100]["dimX"] </code> | <code lua>cow.dimension = cow.io[100]["dimX"] </code> | ||
- | |||
- | The following line reads the dimension in X of the i-th image in the I/O to the [[eyes:flowcontrol:variable|]] dimension. It is necessary to set up a Variable named iter of type integer, which is incremented at the end of the script. | ||
- | <code lua> | ||
- | cow.dimension = cow.io[cow.iter]["dimX"] | ||
- | cow.iter = cow.iter + 1 </code> | ||
- | |||
**To overwrite the header value in the I/O** | **To overwrite the header value in the I/O** | ||
Line 68: | Line 62: | ||
<code lua>cow.VariableName = cow.io[cow.IterationVariableName]["image header values name"]</code> | <code lua>cow.VariableName = cow.io[cow.IterationVariableName]["image header values name"]</code> | ||
+ | Example \\ | ||
+ | The following line reads the header key dimX of the i-th image in the I/O and passes it to the [[eyes:flowcontrol:variable|]] dimension. In order to iterate though the whole I/O it is necessary to set up a Variable named e.g. iter of type integer, which is incremented at the end of the script. | ||
+ | <code lua> | ||
+ | cow.dimension = cow.io[cow.iter]["dimX"] | ||
+ | cow.iter = cow.iter + 1 </code> | ||
===== Example ==== | ===== Example ==== | ||
Line 73: | Line 72: | ||
**Properties Window** | **Properties Window** | ||
- | |< 100% 5% 50% >| | + | |< 100% 5% 35% >| |
^ ^ ^ ^ | ^ ^ ^ ^ | ||
- | |{{:eyes:flowcontrol:a.png?nolink&40|}}|{{:eyes:flowcontrol:examplescript1properties.png?nolink&500|}}| | | + | |{{:eyes:flowcontrol:a.png?nolink&40|}}|{{:eyes:flowcontrol:examplescript1properties.png?nolink|}}|In the properties window the Script lines is shown. Here the dimension in X is read from the header key "dimX" and passed to the [[eyes:flowcontrol:variable|]] dimension.| |
- | |{{:eyes:flowcontrol:b.png?nolink&40|}}|{{:eyes:flowcontrol:examplescript1var.png?nolink&500|}}| | | + | |{{:eyes:flowcontrol:b.png?nolink&40|}}|{{:eyes:flowcontrol:examplescript1var.png?nolink|}}|The Variable of type decimal is called dim. The default value is zero.| |
- | |{{:eyes:flowcontrol:c.png?nolink&40|}}|{{:eyes:flowcontrol:examplescript1group.png?nolink&500|}} | | | + | |{{:eyes:flowcontrol:c.png?nolink&40|}}|{{:eyes:flowcontrol:examplescript1group.png?nolink|}}|The value of the Variable dim after executing the Script can be checked by clocking into the work space of a [[eyes:flowcontrol:group|]].| |
Line 83: | Line 82: | ||
**Properties Window** | **Properties Window** | ||
- | |< 100% 5% 50% >| | + | |< 100% 5% 35% >| |
^ ^ ^ ^ | ^ ^ ^ ^ | ||
- | |{{:eyes:flowcontrol:a.png?nolink&40|}}|{{:eyes:flowcontrol:examplescript2script.png?nolink&500|}}| | | + | |{{:eyes:flowcontrol:a.png?nolink&40|}}|{{:eyes:flowcontrol:examplescript2script.png?nolink&500|}}|Here a new header key is added to the image in the I/O. The first position in the current I/O is read to the temporary variable temp. To add a new header key and value we just call temp of the preferred new key and set is to a any value. There is no need to define it before hand. In addition it is possible to use a Variable as a value for the header key as explained in **To write new header values to the I/O**.| |
- | | |{{:eyes:flowcontrol:examplescript2header.png?nolink&500|}}| | | + | | |{{:eyes:flowcontrol:examplescript2header.png?nolink&500|}}| After running the Script it is possible to open the Viewer and check if the header key war written to the I/O. On the left side is a screenshot showing the new header key and value as well as the preexisting header key pixel size. All header keys are alphabetically ordered.| |
- | {{ :eyes:flowcontrol:examplescript3.png?nolink&600 |}} | + | {{ :eyes:flowcontrol:examplescript3.png?nolink&800 |}} |
**Properties Window** | **Properties Window** | ||
- | |< 100% 5% 50% >| | + | |< 100% 5% 35% >| |
^ ^ ^ ^ | ^ ^ ^ ^ | ||
- | |{{:eyes:flowcontrol:a.png?nolink&40|}}|{{:eyes:flowcontrol:examplescript3script.png?nolink&500|}}| | | + | |{{:eyes:flowcontrol:a.png?nolink&40|}}|{{:eyes:flowcontrol:examplescript3script.png?nolink&500|}}|The scirpt writes to the current position in the I/O the iteration variable value as header value to the header key.| |
- | |{{:eyes:flowcontrol:b.png?nolink&40|}}|{{:eyes:flowcontrol:examplescript3var.png?nolink&500|}}| | | + | |{{:eyes:flowcontrol:b.png?nolink&40|}}|{{:eyes:flowcontrol:examplescript3var.png?nolink&500|}}|The Variable of type integer is called iter. The default value is zero.| |
- | |{{:eyes:flowcontrol:c.png?nolink&40|}}|{{:eyes:flowcontrol:examplescript3calc.png?nolink&500|}} | | | + | |{{:eyes:flowcontrol:c.png?nolink&40|}}|{{:eyes:flowcontrol:examplescript3calc.png?nolink&500|}}|The element [[eyes:flowcontrol:calculate|]] iterates through the I/O. It is linked with the output of the Script and the input of the [[eyes:flowcontrol:queue|]]. After each execution of the Script the calculation element takes the Variable iter and adds one to it.| |
- | |{{:eyes:flowcontrol:d.png?nolink&40|}}|{{:eyes:flowcontrol:examplescript3group.png?nolink&500|}} | | | + | |{{:eyes:flowcontrol:d.png?nolink&40|}}|{{:eyes:flowcontrol:examplescript3group.png?nolink&500|}}|The value of the Variable iter after executing the Script can be checked by clocking into the work space of a [[eyes:flowcontrol:group|]].| |