imagej / imagej/imagej-ops

Create position-sensitive map operation

Open
#17 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
94
Forks
44
PR merge metrics
No merged PRs in 30d

Description

Would it make sense to create a map operation where the position within the `Interval` (or `RealInterval`) is known to the nested function? We would probably need a new subtype of `Function` that has the position (maybe as a `double[]`) as an additional argument to the `compute` method.

I recently created an [equation op](https://github.com/imagej/imagej-ops/blob/faec4dcda7172c804eb1ec816865654594b77759/src/main/java/imagej/ops/equation/DefaultEquation.java#L78) that illustrates why such a map would be nice. The implementation currently uses an `IterableInterval` as its output, but the actual operation is completely independent pixel-wise. However, the value of each pixel is defined by an equation which operates on the `Interval` position, so that you can generate stuff like gradients, sinusoidal shapes, or whatever your mathy brain can dream up. So at the moment, it is not possible to use the current mappers to create an equation op that operates on a single pixel only.

I think this new mapper would end up being quite useful; it is sort of analogous to ImgLib2's distinction between "cursor" and "localizing cursor". Some operations need to localize at every pixel, some occasionally, and some never. Shall OPS support all of these cases, too?

/cc @dietzc

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked equation implementation in src/main/java/imagej/ops/equation/DefaultEquation.java and compare it with the current mapper and Function APIs. Determine how a position argument should be represented and which cursor-localization cases the operation must support. Done means a decided API and an implementation path for position-aware mapping, with coverage for equation-style pixel-wise operations.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
computer-vision
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.