Plugin Microscope Image Focus Quality - Cannot work with more than 6x6 matrices

Hi everyone,

I am working with the plugin “Microscope Image Focus Quality” but unfortunately ever time I attempt to increment the size of the matrix from 6x6 it gives me the error (shown below).

Possibly related to this is the weird fact that whenever I try to call the plugin via script and use a 7x7 or a 12X12 matrix, it does not give me an error, but it simply proceeds with a 6X6 matrix completely ignoring the command. Example of script that does not work:

run("Microscope Image Focus Quality", 
		"originalimage=" + imageinput +
		" tilecountx=7 tilecounty=7 createprobabilityimage=true overlaypatches=true solidpatches=false borderwidth=6");

Has anyone encountered a similar issue?

If I try to use the plugin via the GUI and use a larger matrix, I get an error as shown below:

[ERROR] null
java.lang.ArrayIndexOutOfBoundsException: -19494
	at net.imglib2.img.basictypeaccess.array.AbstractShortArray.getValue(AbstractShortArray.java:61)
	at net.imglib2.type.numeric.integer.GenericShortType.getShort(GenericShortType.java:131)
	at net.imglib2.type.numeric.integer.UnsignedShortType.get(UnsignedShortType.java:160)
	at net.imglib2.type.numeric.integer.UnsignedShortType.getIntegerLong(UnsignedShortType.java:177)
	at net.imglib2.type.numeric.integer.AbstractIntegerType.getRealDouble(AbstractIntegerType.java:62)
	at sc.fiji.imageFocus.Images.lambda$normalize$0(Images.java:56)
	at net.imglib2.converter.read.ConvertedRandomAccess.get(ConvertedRandomAccess.java:62)
	at net.imglib2.converter.read.ConvertedRandomAccess.get(ConvertedRandomAccess.java:46)
	at net.imglib2.util.Util.getTypeFromInterval(Util.java:775)
	at net.imagej.tensorflow.Tensors.tensor(Tensors.java:421)
	at sc.fiji.imageFocus.MicroscopeImageFocusQualityClassifier.run(MicroscopeImageFocusQualityClassifier.java:193)
	at org.scijava.command.CommandModule.run(CommandModule.java:199)
	at org.scijava.module.ModuleRunner.run(ModuleRunner.java:168)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:127)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:66)
	at org.scijava.thread.DefaultThreadService$3.call(DefaultThreadService.java:238)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

RESOLVED.
So the problem seems to reside in the number of pixels contained in the image. So there is a minimum number of pixels that each patch (point in the probability matrix) needs to consider in order for the algorithm to work.

I looks in fact that for my 512x512 pixel images, a 6x6 matrix is the maximum number of patches it can work with. When I scaled up my image to 3072x3072 the plugin loaded automatically a matrix of 36x36 patches.