Hi everyone,
I found a groovy script that allows me to export all the cores of a TMA as individual images that works very well. What I would like to do though is also export the same image with the overlay of the Positive Cell Detection results. I don’t need to use the images for data analysis at all, I just need the images for viewing purposes and in publications.
Below I am posting the script that Pete wrote that exports the individual images but I can not figure out how to adapt it to export the images with the Positive Cell Detection overlay.
Any help would be greatly appreciated,
Thanks!
import javax.imageio.ImageIO
import qupath.lib.regions.RegionRequest
// Define resolution - 1.0 means full size
double downsample = 1.0
// Create output directory inside the project
def dirOutput = buildFilePath(PROJECT_BASE_DIR, ‘cores’)
mkdirs(dirOutput)
// Write the cores
def server = getCurrentImageData().getServer()
def path = server.getPath()
for (core in getTMACoreList()){
// Stop if Run -> Kill running script is pressed
if (Thread.currentThread().isInterrupted())
break
// Write the image
img = server.readBufferedImage(RegionRequest.createInstance(path, downsample, core.getROI()))
ImageIO.write(img, ‘PNG’, new File(dirOutput, core.getName() + ‘.png’))
}
print(‘Done!’)