This is the python script I am running: from paquo.projects import QuPathProject I think I almost got it to work, thanks to the Paquo python library, but I am not able to call the final writeImage() function from the python side. My main question is: where is the writeImage() function taken from?Īt the moment, I am trying to export segmentation images for all images in a project by calling a python script. multichannelOutput(false) // If true, each label refers to the channel of a multichannel binary image (required for multiclass probability) useInstanceLabels() // Assign labels based on instances, not classifications downsample(downsample) // Choose server resolution this should match the resolution at which tiles are exported backgroundLabel(0, ColorTools.BLACK) // Specify background label (usually 0 or 255) Create an ImageServer where the pixels are derived from annotationsĭef labelServer = new LabeledImageServer.Builder(imageData) Define how much to downsample during export (may be required for large images) Define output path (relative to project)ĭef outputDir = buildFilePath(PROJECT_BASE_DIR, 'export')ĭef name = GeneralTools.getNameWithoutExtension(imageData.getServer().getMetadata().getName())ĭef path = buildFilePath(outputDir, name + "-labels.tif") If I run the following QuPath script (which I got from this post), I am able to export the annotations for the current loaded image as tif image with instance-segmentation masks: def imageData = getCurrentImageData()
0 Comments
Leave a Reply. |