Need help or advice ? Come to the Icy club ! - Every Wenesday morning from 9h30 to 12h30 - Francois Jacob Building - Main hall - Pasteur
Register

Math Operation Two Sequences

by tprovoost / Thomas Provoost

This script shows how to use the Math Operation on two sequences, with a more advanced formula.

version 1 (last version):

download to use and modify in Icy. How do I use scripts ? A Problem ? ask the community.
Changelog for this version: initial version
importClass(Packages.plugins.ylemontag.mathoperations.functors.Functor2)

// get the sequence
if (gui.getSequences().size() < 2)
	throw "Please open two sequences first"

seq = gui.getSequences().get(0)
seq2 = gui.getSequences().get(1)

// create the expression
formula = "a + 2 * min(b, 10)"


// The Functor parses the formula, 
// and apply() assigns its arguments to the variables of the formula.
// Ex : Here, seq is assigned to "a" and seq2 is assigned to "b"
seqRes = Functor2.parse(formula).apply(seq, seq2)

gui.addSequence(seqRes)

This script has no documentation. A Problem ? ask the community.



Icy script publication Id : E7R1W2