Ah yes, I think there’s a forum rule that blocks including images on your first post… so that probably wasn’t an option
I think spacing is probably the issue (I’m a bit surprised it worked in the first case!). The TMAs I was working with when I developed the algorithm were a lot more sparse, and QuPath downsamples the image quite aggressively and then smooths it a bit. Probably the cores are merging into one another at that point.
Unfortunately, core diameter is really the only thing you can easily modify.
The script below will circumvent QuPath’s UI to let you modify one more thing: the resolution of the image used for dearraying. It may be worth a try, in case running the dearraying at a higher resolution (i.e. a lower value for
requestedPixelSize) works better.
* Run QuPath's TMA dearrayer at a different resolution.
* This can give a bit more control over the output if the original dearraying fails.
* @author Pete Bankhead
// Change this to adjust the resolution at which cores are detected
// Lower values mean the dearraying is done on a larger image (and will be slower)
double requestedPixelSize = 10
// Adjust these for other detection parameters
double coreDiameter = 1200
double roiScaleFactor = 1.05
def horizontalLabels = 'A-J'
def verticalLabels = '1-16'
boolean horizontalLabelFirst = 100
double densityThreshold = 0.05
boolean isFluorescence = false
// Actually do the dearraying
def dearrayer = new Dearrayer()
def server = getCurrentServer()
double downsample = requestedPixelSize / server.getPixelCalibration().getAveragedPixelSize()
double fullCoreDiameterPx = coreDiameter / server.getPixelCalibration().getAveragedPixelSize()
def request = RegionRequest.createInstance(server, downsample)
dearrayer.ip = IJTools.convertToImagePlus(server, request).getImage().getProcessor()
def tmaGrid = dearrayer.doDearraying(
println 'Done! ' + println tmaGrid