Skip to content

ImageJ Roi names are ignored during import #2005

@petebankhead

Description

@petebankhead

Bug report

Describe the bug

When importing objects an ImageJ TIFF with an overlay, the ROI name is no longer used in QuPath v0.6.0.
It was used to set the annotation name in QuPath v0.5.

See https://forum.image.sc/t/different-behaviour-when-importing-objects-from-file-in-qupath-v0-5-1-vs-v0-6-0/116784

To Reproduce

Steps to reproduce the behavior:

  1. Create a project
  2. Import the example image from the linked forum post
  3. Ensure that 'Import objects' is selected
  4. See that the annotations do not have names set

Expected behavior

The QuPath annotations have names that match the ImageJ Rois.

Screenshots

See forum post.

Desktop (please complete the following information):

  • OS: All
  • QuPath Version: v0.6.0

Additional context

This is a tricky one because the decision not to use Roi.getName() was intentional - see ebeb854

The reasoning seems to be concerned mostly with ROIs that are passed from QuPath and then retrieved later: we set the name so that it appears in ImageJ, but we don't want to then grab that back into QuPath. If we did, then the simple act of sending a ROI to ImageJ and getting it back again would result in an object having a new name on the QuPath side.

In the specific case of importing objects, we could easily fix things by making a change at

var roi = IJTools.convertToROI(roiIJ, 0, 0, 1, IJTools.getImagePlane(roiIJ, imp));

This doesn't handle the case of importing ROIs from an existing image other ways though, and we need to check what happens when the name is set as part for a serialized .roi file or RoiSet.zip.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions