33import net .imglib2 .RandomAccessible ;
44import net .imglib2 .RandomAccessibleInterval ;
55import net .imglib2 .interpolation .InterpolatorFactory ;
6- import net .imglib2 .interpolation .randomaccess .NLinearInterpolatorFactory ;
76import net .imglib2 .interpolation .randomaccess .NearestNeighborInterpolatorFactory ;
87import net .imglib2 .realtransform .AffineGet ;
98import net .imglib2 .realtransform .RealViews ;
109import net .imglib2 .realtransform .Scale2D ;
1110import net .imglib2 .realtransform .Translation2D ;
1211import net .imglib2 .type .numeric .NumericType ;
1312import net .imglib2 .view .Views ;
13+ import qupath .ext .imglib2 .interpolators .LinearInterpolationFactory ;
1414
1515import java .util .Arrays ;
1616import java .util .stream .LongStream ;
@@ -35,15 +35,17 @@ private AccessibleScaler() {
3535 * @param scale the scale to apply to the first two dimensions of the input {@link RandomAccessibleInterval}. Shouldn't be
3636 * less than or equal to 0
3737 * @return the input if the provided scale is 1, or a new scaled {@link RandomAccessibleInterval} otherwise
38- * @param <T> the type of elements of the random accessible interval
38+ * @param <T> the type of elements of the random accessible interval. It must be {@link net.imglib2.type.numeric.ARGBType}
39+ * or an instance of {@link net.imglib2.type.numeric.RealType}, otherwise a {@link IllegalArgumentException}
40+ * will be thrown when accessing the output
3941 * @throws IllegalArgumentException if the input interval has at least one minimum different from 0, if the provided scale is less
4042 * than or equal to 0, or if the input interval has less than two dimensions
4143 */
4244 public static <T extends NumericType <T >> RandomAccessibleInterval <T > scaleWithLinearInterpolation (
4345 RandomAccessibleInterval <T > input ,
4446 double scale
4547 ) {
46- return scale (input , scale , new NLinearInterpolatorFactory <>());
48+ return scale (input , scale , new LinearInterpolationFactory <>());
4749 }
4850
4951 /**
0 commit comments