How to importing bounding boxes for multiple slides?

35 views
Skip to first unread message

Henrik Marklund

unread,
May 21, 2019, 4:07:43 AM5/21/19
to QuPath users
Hi!

I have a csv with bounding boxes that I want to import in to QuPath for multiple slides.

I know how to do this for one slide at the time:
imageData.getHierarchy().addPathObject(annotation, false)
imageData = getCurrentImageData()ode here...

However, when I try and loop over slides this does not work for me:

for (entry in project.getImageList()) {
    def fileData = QuPathGUI.getImageDataFile(project, entry)//
    def hierarchy = PathIO.readHierarchy(fileData)
    // Can use this also: imageData = QPEx.loadImageData(fileData.getAbsolutePath(), true)

   //// code to get annotation ////
    hierarchy.addPathObject(annotation, false)


The code runs and console message is: "Adding XXX to hierarchy". However, when I using the GUI switch to these slides, the annotations are not there.

Any idea of what is going on?

Thanks a lot for your help,
Henrik

Pete

unread,
May 21, 2019, 4:24:53 AM5/21/19
to QuPath users
Hi Henrik,

It looks like the data files aren't being saved after you add the annotations.
The easiest way to take care of this is to use your original script with Run -> Run for Project and let QuPath take care of reading/saving the data files.

Note that the forum has moved to https://forum.image.sc/tags/qupath - this one is just around for posterity. Better for any further discussion to be at image.sc
Reply all
Reply to author
Forward
0 new messages