[ImageJ-devel] [fiji-devel] ImgLib2 merge to master

Stephan Saalfeld saalfeld at mpi-cbg.de
Thu Apr 21 15:40:01 CDT 2011


Because the create method of the factory creates the interpolator, not
another factory.

You mean

final RealRandomAccess<R> inter;

...




On Thu, 2011-04-21 at 18:49 +0200, Albert Cardona wrote: 
> Imglib1 to Imglib2: why does the following code claims that:
> 
>   "Type mismatch: cannot convert from NearestNeighborInterpolator<R>
> to InterpolatorFactory<R,Img<R>>"
> 
> ... where <R extends RealType<R>> ?
> 
> 
> 		final InterpolatorFactory<R,Img<R>> inter;
> 		switch (mode) {
> 		case LINEAR:
> 			inter = new NLinearInterpolatorFactory<R>().create(img);
> 			break;
> 		case NEAREST_NEIGHBOR:
> 			inter = new NearestNeighborInterpolatorFactory<R>().create(img);
> 			break;
> 		default:
> 			throw new IllegalArgumentException("Scale: don't know how to scale
> with mode " + mode);
> 		}
> 
> -- 
> http://albert.rierol.net
> 





More information about the ImageJ-devel mailing list