Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new equation ops #396

Closed
wants to merge 1 commit into from
Closed

Add new equation ops #396

wants to merge 1 commit into from

Conversation

bnorthan
Copy link
Contributor

Add ops for calibrated equations (AbstractCalibratedEquation.java), equations passed in using an op (DefaultCalibratedEquation.java), and equations passed in using a binary lambda
(DefaultXYCalibratedEquation.java).

This allows me to implement equations fairly easily. For example:

// define origin and calibration
double[] origin = new double[] { -1., -1. };
double[] calibration = new double[]{0.1,0.1};

ops.image().equation(image, (x, y) -> Math.pow(x, 2) + Math.pow(y, 2),
            origin, calibration);

or (since origin and calibration are optional)

ops.image().equation(image, (x, y) -> 10 * (Math.cos(0.3 * x) + Math.sin(
            0.3 * y)));

Add ops for calibrated equations (AbstractCalibratedEquation.java),
equations passed in using an op (DefaultCalibratedEquation.java),
and equations passed in using a binary lambda
(DefaultXYCalibratedEquation.java).
@bnorthan
Copy link
Contributor Author

@ctrueden, @dietzc let me know your thoughts. Some of the code is a little tricky. I am happy to consider changes to design. I just need a concise way to implement a calibrated equation.

@ctrueden
Copy link
Member

ctrueden commented May 13, 2016 via email

@@ -58,7 +62,7 @@
@OpMethod(op = net.imagej.ops.image.ascii.DefaultASCII.class)
public <T extends RealType<T>> String ascii(final IterableInterval<T> image) {
final String result = (String) ops().run(
net.imagej.ops.Ops.Image.ASCII.class, image);
Copy link
Member

@dietzc dietzc May 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

several format changes in this file make it hard to review the actual changes. can you undo the format changes and commit only thing related to the functionality you added/changed? I know it's a bit annoying, but it helps in the long run :-)

@dietzc
Copy link
Member

dietzc commented May 15, 2016

I added some comments about the coding style itself, but didn't have time to check the actual functionality in detail. maybe @ctrueden can quickly do that.

@ctrueden
Copy link
Member

Sorry, some urgent priorities have come up. I will not have time to look at this for some weeks now.

@dietzc
Copy link
Member

dietzc commented Jun 19, 2016

I suggest to wait with the merge until we finally decided how we represent calibrated images in the future.

@ctrueden
Copy link
Member

ctrueden commented Dec 8, 2017

Closed in favor of #531, as suggested by @bnorthan.

@ctrueden ctrueden closed this Dec 8, 2017
@ctrueden ctrueden deleted the calibratequation branch April 13, 2018 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants