AllenInstitute / MIES

Multichannel Igor Electrophysiology Suite
https://alleninstitute.github.io/MIES/user.html
Other
23 stars 7 forks source link

SweepFormula: add data as variables #276

Closed ukos-git closed 1 year ago

ukos-git commented 5 years ago

Similar to JSON logic, the data should get separated from the operations. This ensures that we do not call the getter two times if for example, calculating with it.

derivative(data(cursors(a,b), channels(AD), sweeps())) * data(cursors(a,b), channels(AD), sweeps())

will then reduce to

derivative(var0)*var0

with the data object

var0=data(cursors(a,b), channels(AD), sweeps());

It can also mean that the functions are a lot easier to read. and you can name the data.

To get to that point, string values need to get checked if a variable is registered for them. Probably related to #274

I don't see significant problems implementing that.

ukos-git commented 5 years ago

http://jsonlogic.com/

t-b commented 5 years ago
ukos-git commented 5 years ago

From the json logic documentation about the var operation:

logic:

{
  "and": [
    {
      "<": [
        {
          "var": "temp"
        },
        110
      ]
    },
    {
      "==": [
        {
          "var": "pie.filling"
        },
        "apple"
      ]
    }
  ]
}

data:

{
  "temp": 100,
  "pie": {
    "filling": "apple"
  }
}

should return true aka 1

t-b commented 1 year ago

Example:

currSel = select(channels(AD9), [31,33,34], all)
myrange = [2000,4000]
kernel = epspKernel($myrange, $currSel)

epspKernel($myrange, $currSel)
and
epspStats($myrange, $currSel, tau, accept, hist)

Properties:

Implementation idea:

Limitations:

Related idea: