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(
	at net.imglib2.type.numeric.integer.GenericShortType.getShort(
	at net.imglib2.type.numeric.integer.UnsignedShortType.get(
	at net.imglib2.type.numeric.integer.UnsignedShortType.getIntegerLong(
	at net.imglib2.type.numeric.integer.AbstractIntegerType.getRealDouble(
	at sc.fiji.imageFocus.Images.lambda$normalize$0(
	at net.imglib2.util.Util.getTypeFromInterval(
	at net.imagej.tensorflow.Tensors.tensor(
	at org.scijava.thread.DefaultThreadService$
	at java.util.concurrent.ThreadPoolExecutor.runWorker(
	at java.util.concurrent.ThreadPoolExecutor$

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.