TMA Dearrayer Problem


I’ve just started working with QuPath v.0.2.3, and have encountered an issue that it doesn’t recognise any of the cores.
Steps I took:

  1. Set image type to H-DAB (Brightfield)
  2. Estimate stain vectors → auto
  3. TMA dearraying, with the appropriate number of rows and columns, as well as various core sizes, ranging from 1.5 to 0.6 mm (as suggested in other similar topics)Uploading: Captura de Tela 2021-01-30 às 18.27.16.png… . None of them worked.

I have successfully applied the same parameters to another slide with the same cores, stained differently. Both were scanned with the same slide scanner (Aperio GT30).

Hi @jvictorcastr0 I’d probably need to see an example image to have a better guess what the problem may be. However, one possibility is that the cores are too close together – and so QuPath isn’t able to separate them (it does the dearraying in a low-resolution version of the image).

In an emergency when nothing else works, you can create a TMA grid by drawing a rectangle around the codes and then running a script. Here’s an updated version:

The original discussion is here (but the script posted there is now out-of-date).

1 Like

Hello, Pete,

It’s my first time using this forum, and for some reason I wasn’t able to upload images related to my issue the first time I tried, sorry :sweat_smile:

I will try running the script, but I thought this issue was unique because I had no problems running the dearrayer in the other two slides with similar cores and core arrangement, as follows:

1 Like

Ah yes, I think there’s a forum rule that blocks including images on your first post… so that probably wasn’t an option :slight_smile:

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
import qupath.imagej.detect.dearray.TMADearrayerPluginIJ.Dearrayer
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 
1 Like

Thanks, Pete!

It has worked by using a value of 8 in requestedPixelSize. Two columns didn’t show up, even after adjusting other parameters, but I quickly added them manually :smiley:

Thank you for your support :slight_smile: