Purpose

The module Switch selects one of several input images to output.

The selected one is passed unchanged to the output, even if the input in not connected or or the input image undefined.

Note that it is not necessary that all inputs are connnected. Unconnected or undefined inputs are bypassed as an undefined (empty) image.

Notifications are only propagated for the selected input, all others are ignored.

The number of shown inputs can be changed.

Tips

If a switch “UseSomething” is used to either use or bypass a subnetwork implementing a feature “Something”, the latter should be connected to the second input. That way, the bi-valued Active Input Index can be used like a regular boolean, with 1 meaning “use Something” and 0 meaning “don’t use Something”.

Windows

Default Panel

../../../Modules/ML/MLMiscModules/mhelp/Images/Screenshots/Switch._default.png

Input Fields

input5 (hidden)

name: input5, type: Image

input6 (hidden)

name: input6, type: Image

input7 (hidden)

name: input7, type: Image

input8 (hidden)

name: input8, type: Image

input9 (hidden)

name: input9, type: Image

input10 (hidden)

name: input10, type: Image

input11 (hidden)

name: input11, type: Image

input12 (hidden)

name: input12, type: Image

input13 (hidden)

name: input13, type: Image

input14 (hidden)

name: input14, type: Image

input15 (hidden)

name: input15, type: Image

input16 (hidden)

name: input16, type: Image

input17 (hidden)

name: input17, type: Image

input18 (hidden)

name: input18, type: Image

input19 (hidden)

name: input19, type: Image

input20 (hidden)

name: input20, type: Image

input21 (hidden)

name: input21, type: Image

input22 (hidden)

name: input22, type: Image

input23 (hidden)

name: input23, type: Image

input24 (hidden)

name: input24, type: Image

Output Fields

output0

name: output0, type: Image

Parameter Fields

Visible Fields

Active Input Index

name: currentInput, type: Integer, default: 0, minimum: 0, maximum: :field:`maxInput`, deprecated name: whichInput

Sets the index of the input image that is currently bypassed to the module’s output.

Number of Inputs

name: numberOfInputs, type: Integer, default: 5, minimum: 1, maximum: 25, deprecated name: NumberOfInputs

Sets the number of visible outputs.

Hidden Fields

maxInput (hidden)

name: maxInput, type: Integer, persistent: no