Title: Can't uses `stats.mean` with a `SamplingIterableInterval` · Issue #270 · scijava/scijava · GitHub
Open Graph Title: Can't uses `stats.mean` with a `SamplingIterableInterval` · Issue #270 · scijava/scijava
X Title: Can't uses `stats.mean` with a `SamplingIterableInterval` · Issue #270 · scijava/scijava
Description: With SciJava ops in Fiji (via a Jython script) I am unable to use the stats.mean Op on a sample created from an ImgLabeling. Here's small example that replicates this behavior (use with the Blobs example open). #@ OpEnvironment ops #@ Im...
Open Graph Description: With SciJava ops in Fiji (via a Jython script) I am unable to use the stats.mean Op on a sample created from an ImgLabeling. Here's small example that replicates this behavior (use with the Blobs e...
X Description: With SciJava ops in Fiji (via a Jython script) I am unable to use the stats.mean Op on a sample created from an ImgLabeling. Here's small example that replicates this behavior (use with the Blo...
Opengraph URL: https://github.com/scijava/scijava/issues/270
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Can't uses `stats.mean` with a `SamplingIterableInterval`","articleBody":"With SciJava ops in Fiji (via a Jython script) I am unable to use the stats.mean Op on a sample created from an `ImgLabeling`.\r\n\r\nHere's small example that replicates this behavior (use with the Blobs example open).\r\n\r\n```python\r\n#@ OpEnvironment ops\r\n#@ Img img\r\n\r\nfrom net.imglib2.algorithm.labeling.ConnectedComponents import StructuringElement\r\nfrom net.imglib2.roi import Regions\r\nfrom net.imglib2.roi.labeling import LabelRegions\r\nfrom net.imglib2.type.logic import BitType\r\n\r\n# create an ImgLabeling\r\nthres = ops.op(\"create.img\").input(img, BitType()).apply()\r\nops.op(\"threshold.otsu\").input(img).output(thres).compute()\r\nlabeling = ops.op(\"labeling.cca\").input(thres, StructuringElement.FOUR_CONNECTED).apply()\r\n\r\n# create a sample for each label and run stats.mean\r\nregions = LabelRegions(labeling)\r\nfor r in regions:\r\n sample = Regions.sample(r, img)\r\n print(ops.op(\"stats.mean\").input(sample).apply())\r\n```\r\n\r\nThis creates the following stack trace:\r\n\r\n```java\r\nStarted bug_ops_stats_mean.py at Thu Aug 22 11:42:24 CDT 2024\r\nTraceback (most recent call last):\r\n File \"/home/edward/Documents/workspaces/ops/examples/bugs/bug_ops_stats_mean.py\", line 18, in \u003cmodule\u003e\r\n print(ops.op(\"stats.mean\").input(sample).apply())\r\n\r\nName: \"stats.mean\", Types: java.util.function.Function\u003cnet.imglib2.roi.util.SamplingIterableInterval\u003cnet.imglib2.type.numeric.integer.UnsignedByteType\u003e, org.scijava.common3.Any\u003e\r\nInput Types: \r\n\t\t* net.imglib2.roi.util.SamplingIterableInterval\u003cnet.imglib2.type.numeric.integer.UnsignedByteType\u003e\r\nOutput Type: \r\n\t\t* org.scijava.common3.Any\r\n\r\nSee debugging output for full failure report.\r\n\tat org.scijava.ops.engine.impl.DefaultOpEnvironment.findOp(DefaultOpEnvironment.java:367)\r\n\tat org.scijava.ops.engine.impl.DefaultOpEnvironment.op(DefaultOpEnvironment.java:215)\r\n\tat org.scijava.ops.api.OpBuilder.matchFunctionHelper(OpBuilder.java:15392)\r\n\tat org.scijava.ops.api.OpBuilder.matchFunction(OpBuilder.java:15233)\r\n\tat org.scijava.ops.api.OpBuilder$Arity1_IV_OU.function(OpBuilder.java:945)\r\n\tat org.scijava.ops.api.OpBuilder$Arity1_IV_OU.apply(OpBuilder.java:982)\r\n\tat java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)\r\n\tat java.base/java.lang.reflect.Method.invoke(Method.java:580)\r\norg.scijava.ops.engine.DependencyMatchingException: org.scijava.ops.engine.DependencyMatchingException: Error matching dependencies for request:\r\n\r\nName: \"stats.mean\", Types: java.util.function.Function\u003cnet.imglib2.roi.util.SamplingIterableInterval\u003cnet.imglib2.type.numeric.integer.UnsignedByteType\u003e, org.scijava.common3.Any\u003e\r\nInput Types: \r\n\t\t* net.imglib2.roi.util.SamplingIterableInterval\u003cnet.imglib2.type.numeric.integer.UnsignedByteType\u003e\r\nOutput Type: \r\n\t\t* org.scijava.common3.Any\r\n\r\nSee debugging output for full failure report.\r\n\r\n\tat org.python.core.Py.JavaError(Py.java:547)\r\n\tat org.python.core.Py.JavaError(Py.java:538)\r\n\tat org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:192)\r\n\tat org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:208)\r\n\tat org.python.core.PyObject.__call__(PyObject.java:461)\r\n\tat org.python.core.PyObject.__call__(PyObject.java:465)\r\n\tat org.python.core.PyMethod.__call__(PyMethod.java:126)\r\n\tat org.python.pycode._pyx22.f$0(/home/edward/Documents/workspaces/ops/examples/bugs/bug_ops_stats_mean.py:16)\r\n\tat org.python.pycode._pyx22.call_function(/home/edward/Documents/workspaces/ops/examples/bugs/bug_ops_stats_mean.py)\r\n\tat org.python.core.PyTableCode.call(PyTableCode.java:173)\r\n\tat org.python.core.PyCode.call(PyCode.java:18)\r\n\tat org.python.core.Py.runCode(Py.java:1687)\r\n\tat org.python.core.__builtin__.eval(__builtin__.java:497)\r\n\tat org.python.core.__builtin__.eval(__builtin__.java:501)\r\n\tat org.python.util.PythonInterpreter.eval(PythonInterpreter.java:255)\r\n\tat org.python.jsr223.PyScriptEngine.eval(PyScriptEngine.java:57)\r\n\tat org.python.jsr223.PyScriptEngine.eval(PyScriptEngine.java:31)\r\n\tat java.scripting/javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:262)\r\n\tat org.scijava.script.ScriptModule.run(ScriptModule.java:173)\r\n\tat org.scijava.module.ModuleRunner.run(ModuleRunner.java:165)\r\n\tat org.scijava.module.ModuleRunner.call(ModuleRunner.java:125)\r\n\tat org.scijava.module.ModuleRunner.call(ModuleRunner.java:64)\r\n\tat org.scijava.thread.DefaultThreadService.lambda$wrap$2(DefaultThreadService.java:247)\r\n\tat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)\r\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)\r\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)\r\n\tat java.base/java.lang.Thread.run(Thread.java:1583)\r\nCaused by: org.scijava.ops.engine.DependencyMatchingException: Error matching dependencies for request:\r\n\r\nName: \"stats.mean\", Types: java.util.function.Function\u003cnet.imglib2.roi.util.SamplingIterableInterval\u003cnet.imglib2.type.numeric.integer.UnsignedByteType\u003e, org.scijava.common3.Any\u003e\r\nInput Types: \r\n\t\t* net.imglib2.roi.util.SamplingIterableInterval\u003cnet.imglib2.type.numeric.integer.UnsignedByteType\u003e\r\nOutput Type: \r\n\t\t* org.scijava.common3.Any\r\n\r\nSee debugging output for full failure report.\r\n\tat org.scijava.ops.engine.impl.DefaultOpEnvironment.findOp(DefaultOpEnvironment.java:367)\r\n\tat org.scijava.ops.engine.impl.DefaultOpEnvironment.op(DefaultOpEnvironment.java:215)\r\n\tat org.scijava.ops.api.OpBuilder.matchFunctionHelper(OpBuilder.java:15392)\r\n\tat org.scijava.ops.api.OpBuilder.matchFunction(OpBuilder.java:15233)\r\n\tat org.scijava.ops.api.OpBuilder$Arity1_IV_OU.function(OpBuilder.java:945)\r\n\tat org.scijava.ops.api.OpBuilder$Arity1_IV_OU.apply(OpBuilder.java:982)\r\n\tat java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)\r\n\tat java.base/java.lang.reflect.Method.invoke(Method.java:580)\r\n\tat org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:190)\r\n\t... 24 more\r\n```\r\n\r\nUsing ImageJ-Ops stats.mean works just fine.","author":{"url":"https://github.com/elevans","@type":"Person","name":"elevans"},"datePublished":"2024-08-22T16:54:05.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/270/scijava/issues/270"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d8aff09c-94a2-da86-f75a-88786e40ce18 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9300:A39F5:213500D:2D22FC1:696ACB2D |
| html-safe-nonce | 45d06d670990d49a382bb2f601d71085ba4ce4eba72a0262049de5ac47efbaf9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MzAwOkEzOUY1OjIxMzUwMEQ6MkQyMkZDMTo2OTZBQ0IyRCIsInZpc2l0b3JfaWQiOiI1MTkxNzYxNzMwNTA4MzQ0MTA5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 7931b8c508eb48bbcf4d77d201aa95896f4a5cbc80769d95b58b67fe056f22da |
| hovercard-subject-tag | issue:2481297899 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/scijava/scijava/270/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3fb66480bd6947a76b9d66b726d2c10845cba5bbbba5d8c6b18ed632f0c9aef0/scijava/scijava/issues/270 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3fb66480bd6947a76b9d66b726d2c10845cba5bbbba5d8c6b18ed632f0c9aef0/scijava/scijava/issues/270 |
| og:image:alt | With SciJava ops in Fiji (via a Jython script) I am unable to use the stats.mean Op on a sample created from an ImgLabeling. Here's small example that replicates this behavior (use with the Blobs e... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | elevans |
| hostname | github.com |
| expected-hostname | github.com |
| None | c785f4ce187e9e7331257791b36ddee01625bb8e292a9b4fe2c16d4c006abf5d |
| turbo-cache-control | no-preview |
| go-import | github.com/scijava/scijava git https://github.com/scijava/scijava.git |
| octolytics-dimension-user_id | 1262770 |
| octolytics-dimension-user_login | scijava |
| octolytics-dimension-repository_id | 85618439 |
| octolytics-dimension-repository_nwo | scijava/scijava |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 85618439 |
| octolytics-dimension-repository_network_root_nwo | scijava/scijava |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c718a376fcf780eb22089171adb84a543f660bf7 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width