Skip to content

Improve conversion of QuPath objects to/from ImageJ Rois#2034

Merged
petebankhead merged 5 commits intoqupath:mainfrom
petebankhead:imagej
Nov 10, 2025
Merged

Improve conversion of QuPath objects to/from ImageJ Rois#2034
petebankhead merged 5 commits intoqupath:mainfrom
petebankhead:imagej

Conversation

@petebankhead
Copy link
Member

  • Fixes ImageJ Roi names are ignored during import #2005 by providing a way to distinguish between Roi names that are set on the QuPath side from those that are set elsewhere.
  • In IJTools, return SortedMap<Integer, PathObject instead of SortedMap<Number, PathObject> because it turns out that Number does not implement Comparable.
  • Add IJTools.setObjectType methods to standardize how an object type can be saved as a Roi property.

- In `IJTools`, return `SortedMap<Integer, PathObject` instead of `SortedMap<Number, PathObject>` because it turns out that `Number` does not implement `Comparable`.
- Add `IJTools.setObjectType` methods to standardize how an object type can be saved as a `Roi` property
Fixes qupath#2005 by providing a way to distinguish between Roi names that are set on the QuPath side from those that are set elsewhere.
@petebankhead petebankhead added this to the v0.7.0 milestone Nov 7, 2025
@alanocallaghan
Copy link
Contributor

Number does not implement Comparable

My gut reaction to this was one of exasperated confusion but it does make sense given the existence of complex numbers, NaN, etc.

This allows objects of a specified type to be created from a Roi (usually annotation or detection).
Remove deprecated methods
@petebankhead
Copy link
Member Author

When an overlay is saved on a TIFF, it's now possible to specify the type of an object that will be imported.

For example, to test I applied this macro in ImageJ to blobs.gif and saved the image as blobs.tif.

Roi.setProperty("qupath.object.type", "detection");
Roi.setName("My detection");
Roi.setStrokeColor("BLUE");

Importing resulted in a detection, rather than an annotation, being created.

@petebankhead petebankhead merged commit 04670d8 into qupath:main Nov 10, 2025
1 of 3 checks passed
@petebankhead petebankhead deleted the imagej branch November 10, 2025 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ImageJ Roi names are ignored during import

2 participants