-
Notifications
You must be signed in to change notification settings - Fork 20
bspline interpolation #86
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
* on-the-fly bspline interpolation * bspline interpolation with precomputed coefficients * bspline orders 0-5 inclusive use bspline factory in test
Note: don't merge this quite yet, I'm going to add methodology to lazily compute the coefficients block-wise on demand. |
* depend on imglib2-cache * add some benchmarks
@axtimwalde |
TODO - make all added packages children of |
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.
I am all for merging this in the algorithms package until ImgLib2 core includes imglib2-cache and something like Lazy. Some left-overs and TODOs from testing should be removed or moved into tests.
src/test/java/net/imglib2/algorithm/bspline/GenBsplineKernels.java
Outdated
Show resolved
Hide resolved
src/main/java/net/imglib2/algorithm/bspline/BSplineDecomposition.java
Outdated
Show resolved
Hide resolved
src/main/java/net/imglib2/algorithm/bspline/BSplineDecomposition.java
Outdated
Show resolved
Hide resolved
* add TODOs for future generalization * fix test
This pull request has been mentioned on Image.sc Forum. There might be relevant details there: |
@axtimwalde @tpietzsch
This pull request adds two kinds of BSpline interpolation.
1) On the fly interpolation
The first is most similar to current interpolation methods:
This computes the interpolation kernel on-the-fly at every
get
. The kernel size is defined byradius
.clipping=true
sets the interpolator to behave like the ClampingNLinearInterpolator2) Precomputed coefficients
The second method precomputes BSpline coefficients and is substantially faster if
get
is called many times, but at the cost of memory - it allocates aRandomAccessibleInterval<T>
the same size as the image to be interpolated.T
defaults toDoubleType
. Use it like this:here the factory constructor computes the coefficients - which is why it needs to be passed. Unfortunately, this means that the
img
argument toViews.interpolate
is meaningless. For example,both result in the same thing. We stuck with this to keep the api consistent. No one should be doing the bottom thing anyway.
Generating the coefficients
BSplineDecomposition
andBSplineCoefficientsInterpolator
give more control for those who need it.For example