Lanczos range#213
Open
axtimwalde wants to merge 1 commit into
Open
Conversation
Member
|
Without this patch, the following Groovy script works in my up-to-date version of Fiji (with imglib2 5.3.0): #@ ImageJ ij
import net.imagej.Dataset
import net.imagej.ImageJ
import net.imglib2.interpolation.randomaccess.LanczosInterpolatorFactory
image = ij.scifio().datasetIO().open("/Users/curtis/data/clown.jpg")
ij.ui().show(image)
interp = new LanczosInterpolatorFactory()
double[] scaleDown = [0.5, 0.5, 1]
Object small = ij.op().run("scaleView", image, scaleDown, interp)
ij.ui().show(small)
double[] scaleUp = [2.5, 2.5, 1]
Object large = ij.op().run("scaleView", image, scaleUp, interp)
ij.ui().show(large)
double[] scaleWeird = [2.2, 0.6, 1]
Object stretched = ij.op().run("scaleView", image, scaleWeird, interp)
ij.ui().show(stretched)And with the patch, it also works. |
Member
|
Maybe the difference is that |
Member
|
This script also works: #@ ImageJ ij
import net.imagej.Dataset
import net.imagej.ImageJ
import net.imglib2.interpolation.randomaccess.LanczosInterpolatorFactory
image = ij.scifio().datasetIO().open("/Users/curtis/data/clown.jpg")
image32 = ij.op().convert().float32(image)
ij.ui().show(image32)
interp = new LanczosInterpolatorFactory()
double[] scaleDown = [0.5, 0.5, 1]
Object small = ij.op().run("scaleView", image32, scaleDown, interp)
ij.ui().show(small)
double[] scaleUp = [2.5, 2.5, 1]
Object large = ij.op().run("scaleView", image32, scaleUp, interp)
ij.ui().show(large)
double[] scaleWeird = [2.2, 0.6, 1]
Object stretched = ij.op().run("scaleView", image32, scaleWeird, interp)
ij.ui().show(stretched) |
3b9e2c2 to
4b28755
Compare
Member
|
I rebased the final float[] f = {10, 20, 30, 40, 50, 60, 70, 80, 90, 100};
final Img<FloatType> img = ArrayImgs.floats(f, f.length);
final RealRandomAccess<FloatType> a = Views.interpolate(Views.extendBorder(
img), new LanczosInterpolatorFactory<>()).realRandomAccess();
for (int i=0; i<img.dimension(0); i++) {
a.setPosition(new int[] { i });
System.out.println(a.get());
a.setPosition(new float[] { i + 0.5f });
System.out.println(a.get());
}I found that changing @axtimwalde Does that shed any light on the issue? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Does that fix #212 ?