Skip to content

LanczosInterpolator crashes #212

@tpietzsch

Description

@tpietzsch

It seems that LanczosInterpolator is broken. The following simple example crashes:

import net.imglib2.RealRandomAccess;
import net.imglib2.img.Img;
import net.imglib2.img.array.ArrayImgs;
import net.imglib2.interpolation.randomaccess.LanczosInterpolatorFactory;
import net.imglib2.type.numeric.real.FloatType;
import net.imglib2.view.Views;

public class FAILS
{
	public static void main( final String[] args )
	{
		final Img< FloatType > img = ArrayImgs.floats( 10 );
		final RealRandomAccess< FloatType > a = Views.interpolate( Views.extendBorder( img ), new LanczosInterpolatorFactory<>() ).realRandomAccess();
		a.setPosition( new int[] { 5 } );
		a.get();
	}
}

It throws

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 41
	at net.imglib2.interpolation.randomaccess.LanczosInterpolator.lookUpLanczos(LanczosInterpolator.java:224)
	at net.imglib2.interpolation.randomaccess.LanczosInterpolator.get(LanczosInterpolator.java:188)
	at net.imglib2.interpolation.randomaccess.LanczosInterpolator.get(LanczosInterpolator.java:50)
	at t4realviews.FAIL.main(FAIL.java:31)

Apparently this hasn't anything todo with size or dimensionality of the image.

@StephanPreibisch Do you want to fix it? Or should we just remove it. (Apparently nobody is using it or they would have discovered this problem...)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions