Skip to content

Conversation

@tibuch
Copy link

@tibuch tibuch commented Jun 22, 2017

  • Remove the nice but slow implementation of central difference.
  • Add forward difference
  • Add backward difference

@tpietzsch
Copy link
Member

I would rather leave the nice and slow version for educational purposes. Just comment it out, but leave it in.

@tibuch
Copy link
Author

tibuch commented Jun 23, 2017

Removed the remove commit.

@hanslovsky
Copy link
Member

Please add test cases for small 2D and 3D images.

Copy link
Member

@hanslovsky hanslovsky left a comment

Choose a reason for hiding this comment

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

Minor additions to JavaDoc

}

/**
* Compute the backward difference of source in a particular dimension.
Copy link
Member

Choose a reason for hiding this comment

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

Please at some JavaDoc math that specifies exactly what is being computed, like
https://en.wikipedia.org/wiki/Finite_difference#Forward,_backward,_and_central_differences

Copy link
Author

Choose a reason for hiding this comment

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

Using the LoopBuilder implementation by @maarzt makes the code much more readable. If necessary I can add more java doc.

Copy link
Member

Choose a reason for hiding this comment

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

Having the math in the doc would be very helpful, either in code

d_f( x ) = f( x + h ) - f( x )

or tex

(examples for forward difference).

Copy link
Contributor

Choose a reason for hiding this comment

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

The function f in the equation d_f( x ) = f( x + h ) - f( x ) has an one dimensional domain. If we want to describe what gradientForwardDifference actually computes on 2d, 3d or Nd images, we would need a more complicated equation.
I think the resulting math will be rather confusing. @hanslovsky Please proof me wrong!

}

/**
* Compute the forward difference of source in a particular dimension.
Copy link
Member

Choose a reason for hiding this comment

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

Please at some JavaDoc math that specifies exactly what is being computed, like
https://en.wikipedia.org/wiki/Finite_difference#Forward,_backward,_and_central_differences

Copy link
Member

Choose a reason for hiding this comment

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

Having the math in the doc would be very helpful, either in code

d_f( x ) = f( x + h ) - f( x )

or tex

(examples for forward difference).

@hanslovsky hanslovsky self-assigned this Feb 5, 2018
<groupId>net.imglib2</groupId>
<artifactId>pom-imglib2</artifactId>
<version>10.0.1</version>
<version>10.0.2</version>
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need the bump here? Is it for the LoopBuilder?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, it's because this makes LoopBuilder available.
I changed commit message, to include that information.

@@ -0,0 +1,94 @@
package net.imglib2.algorithm.gradient;
Copy link
Member

Choose a reason for hiding this comment

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

Please run imglib2 eclipse formatter on this file.

Copy link
Contributor

Choose a reason for hiding this comment

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

done

@hanslovsky
Copy link
Member

Added some minor comments but then it looks good to merge for me.

Addresses comments in imglib#44
Also adds formulae for central difference
@hanslovsky
Copy link
Member

Looks good to me now. Will leave open for a bit for more comments/concerns and then merge eventually.

@hanslovsky hanslovsky merged commit 0454000 into imglib:master Mar 27, 2018
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.

4 participants