====== Condition ====== With this element smaller if-clauses can be implemented. It can be verified if the I/O fulfills certain conditions and therefore needs different processing. The condition will not modify the I/O. ===== Usage ===== {{ :eyes:flowcontrol:conditionprop.png?nolink&600|}} [[https://www.lua.org/manual/5.1/manual.html#2.5.2 | Relational operators from Lua]] are used to construct valid condition statements. All statements formulated with relational operators return true or false. The condition will not modify the I/O. It only passes the IO to either the then - true or else - false output stream.\\ In order to verify a specification of an I/O it is necessary to formulate a conditional statement. To compare a certain I/O header value it is possible to read this value by standard Lua scripting.\\ **cow.io[0]["image header value name"] == value** \\ Furthermore, [[eyes:flowcontrol:variable|Variables]] can be checked to fulfill certain requirements. A Variable is called with the prefix "cow."\\ **cow.VariableName > = value** A third option is to compare a header value of an I/O with a Variable.\\ **cow.VariableName < = cow.io[0]["image header value name"]** ===== Example ==== {{ :eyes:flowcontrol:condition.png?nolink800 |}} **Properties Window** |< 100% 5% 40% >| ^ ^ ^ ^ |{{:eyes:flowcontrol:a.png?nolink&40|}}|{{:eyes:flowcontrol:conditionproperties.png?nolink|}}|The condition here in the example verifies the dimension of the I/O from the Import logic on the first position of the I/O. It checks whether the header key dimensionality is equal to three. In this case the condition is true and therefore the statement will pass the I/O to the logic Projection. The logic ran through and went green. The logic FourierProcesses is pending.| ===== Parameters and I/O ===== |< 100% 30% >| ^ Input ^ Description ^ | FirstInput | IO to be passed unmodified | |< 100% 30% >| ^ Output ^ Description ^ | FirstOutput | IO passed, if the condition is true | | SecondOutput | IO passed, if the condition is false | ===== Concept ===== [[https://www.lua.org/pil/3.2.html|Relational Operators in Lua]]