Training Image localization / Size

Regarding the training image tool.
Is there a way to find the localization of one of the small images within a training image? The tutorial says that its not a new image file but the pixels extracted from their original locations.
The reason, if its incorrectly classified to be able to find it to change the class.
Also, the default image width of the tool is 5000 pixels, is there a reason for that or will any size work the same?
Thank you all for your time !

@petebankhead ? I have no idea, I don’t know of one.

I occasionally change this depending on how many rows/columns I want. If your training montage image is too wide and you want it to be “taller,” lower the number. If you want more sub-images per row, increase the number.

There’s no easy way to do it… although this script will print the available regions and associated image paths (as URIs):

def manager = getCurrentServer().getManager()
def regions = manager.getRegions()
for (region in regions) {
    def uris = manager.getServer(region, 1).getURIs().collect {it.toString()}
    def uriString = String.join("\t", uris)
    print region.toString() + "\t" + uriString
}

Since it’s still quite hard to unpick exactly where the regions are from the coordinates, here’s an alternative version that works with a selected object. Basically, if you select any object in the image and run the script then it should print out only regions that intersect with that object.

def roi = getSelectedROI()

def manager = getCurrentServer().getManager()
def regions = manager.getRegions()
if (roi)
    regions = regions.findAll {it.intersects(ImageRegion.createInstance(roi))}

for (region in regions) {
    def uris = manager.getServer(region, 1).getURIs().collect {it.toString()}
    def uriString = String.join("\t", uris)
    print region.toString() + "\t" + uriString
}

1 Like

thank you! that will be very useful when dealing with hundred of slides.

2 Likes