Fix duplicate entries in input selectors#482
Conversation
OK obviously it wasn't the title converter but DatasetToImagePlusConverter which registers A simple fix. We also decided to just not aggressively convert items though, and instead de-duplicate on |
When populating potential items for an input widget, we now prefer existing objects of a given input type to potentially convertiable types. Further, for convertibles we now avoid considering them if they share a toString with any other potential input. Candidates are prioritized in order returned by ConvertService.getCompatibleInputs. This mitigates the potential for duplicate entries in input harvesters when multiple input instances are convertible to the same effective output instance.
f5b020d to
f5230f6
Compare
|
In conjunction with these imagej-legacy changes this branch now appears to resolve the Fiji input harvester bug. However, the So we have to pick one: Functionally I like |
|
OK, decided that this is the least intrusive change (compared to converting) and we can fix the |
|
This pull request has been mentioned on Image.sc Forum. There might be relevant details there: |
This PR represents an alternative to this PR attempting to fix the duplicates earlier in the framework.
However, this does create a problem if the converters themselves consistently create new items. For example, this is what happens when running a trivial script multiple times:
This could be a bug in particular converters (ImageTitleToImagePlusConverter is a likely suspect) but it does raise a concern of potential behavior for other converters, too.