-
Couldn't load subscription status.
- Fork 42
Sobel and hessian filter #349
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
Conversation
| } | ||
|
|
||
| @OpMethod(op = net.imagej.ops.create.kernelSobel.CreateKernelSobelSeparated.class) | ||
| public <T extends ComplexType<T>> Img<T> kernelSobelSeparated(final Type<T> outType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't you use final T outType rather than final Type<T> outType? @ctrueden?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, always use T, not Type<T>. I actually just fixed all of the known offenders with 9316184. Let's try to keep things clean!
5b724bb to
1bbbf2d
Compare
|
|
||
| derivativeComputers = new UnaryComputerOp[in().numDimensions()]; | ||
| for (int i = 0; i < in().numDimensions(); i++) { | ||
| derivativeComputers[i] = RAIs.computer(ops(), Ops.Filter.DirectionalDerivative.class, in(), i); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only works if DirectionalDerivative is also working for n-d...
|
@iarganda do you want to review? do the implementations make sense to you? if you have questions about ops, just ping me and I can explain. |
|
Sure, I'll have a look as soon as possible! Thanks! |
| @@ -0,0 +1,51 @@ | |||
| package net.imagej.ops.filter.derivative; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
License header is missing.
|
Hey @EikeHeinz,
|
| @@ -0,0 +1,69 @@ | |||
| package net.imagej.ops.create.kernelSobel; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing license header.
|
Thank you for your comments @stelfrich, I'll look into them as soon as possible. |
| // add dimensions to kernel if input has more than 2 dimensions to | ||
| // properly rotate the kernel | ||
| if (in().numDimensions() > 2) { | ||
| MixedTransformView<T> expandedKernelA = Views.addDimension(kernelA); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generalize expandedKernelA to be RandomAccessible<T>.
I won't be using it until some time next week. No worries 😄 |
|
Thanks everyone for reviewing. Regarding the license headers, I am less worried about these, since they can be easily added after the fact using |
|
I stumbled across an issue with using I have added a dirty hack on that branch to circumvent a matching of |
|
why do we need to cast it to |
|
@EikeHeinz Awesome, thank you! |
|
@EikeHeinz Have you gotten around to working on the issues? |
|
@stelfrich Yes, I think I have resolved most or all issues, except the one I'm having with the CompositeView. I'll look into that one again tomorrow and hopefully fix it. |
a6c18fa to
1791778
Compare
|
@stelfrich Seems like the rebase requires some more work to do. I'm going to solve the new issues over the next few days. |
|
@EikeHeinz Were you able to resolve the issues and compute all derivatives? If you need a second opinion/review, I'd be glad to help! |
|
did you see: imglib/imglib2-algorithm#29? does this help? |
|
Sorry for the late answer. |
|
|
||
| /** Executes the "directional derivative" operation on the given arguments */ | ||
| @OpMethod(op = net.imagej.ops.filter.derivative.PartialDerivativeRAI.class) | ||
| public <T extends RealType<T>> RandomAccessibleInterval<T> directionalDerivative(final RandomAccessibleInterval<T> in, final int dimension) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one and the next method are a left-over from the rename to partialDerivative, I guess? If so, they can now be removed.
85366c0 to
d0c573e
Compare
|
@stelfrich Thanks for your comments and help. |
92fac01 to
4d2292f
Compare
94724f4 to
713f9ce
Compare
713f9ce to
9a3d7e8
Compare
|
Rebased over the latest master to resolve conflicts. I almost merged this, but there is one inconsistency I want to fix first: is the op name |
|
We can name it |
|
I tried to research the difference between separable and non-separable Sobel operators, but wikipedia just describes it as separable. I assume the separable version is the original/canonical one? In which case, calling it only |
9a3d7e8 to
8e4061c
Compare
|
Woo hoo, merged! Thank you @EikeHeinz! |
This adds an implementation of a separated sobel kernel, a sobel filter and a hessian filter. Both filters use a derivative filter that uses the separated sobel kernel. Tests are included.
I've tested the sobel filter on several images and compared these to the already filtered versions.If required I can add some assert statements to the SobelFilterTest case.