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,16 @@ 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}
3940 * @throws IllegalArgumentException if the input interval has at least one minimum different from 0, if the provided scale is less
40- * than or equal to 0, or if the input interval has less than two dimensions
41+ * than or equal to 0, if the input interval has less than two dimensions, or if the type T is invalid (see above)
4142 */
4243 public static <T extends NumericType <T >> RandomAccessibleInterval <T > scaleWithLinearInterpolation (
4344 RandomAccessibleInterval <T > input ,
4445 double scale
4546 ) {
46- return scale (input , scale , new NLinearInterpolatorFactory <>());
47+ return scale (input , scale , new LinearInterpolationFactory <>());
4748 }
4849
4950 /**
0 commit comments