Open gselzer opened 2 years ago
You missed nothing.
I can see that adding documentation for that is a good idea. The reasoning behind not retaining old information is that the original label does not hold intrinsic value beyond separating the label from the other labels in the image.
I see no reason to add the complexity of retaining information because I would not know how to handle the very likely case of two images with the same label being added, possibly even at the same spot. Are they different? Are they the same? I cannot tell from the library side.
What I can see is to add the option to add a static mapping or a mapping function similar to the Java library. Then you could use the mapping
to reconstruct from result
back to data
What I can see is to add the option to add a static mapping or a mapping function similar to the Java library. Then you could use the
mapping
to reconstruct fromresult
back todata
This sounds great!
@gselzer is this just something you noticed and wanted clarified or does this produce actual problems for anything else? Just so that I can prioritize the issue.
This is not urgent, it just affects what I can assert in my napari-imagej conversions.
I see, thanks @gselzer! The way you assert is looks absolutely right though. At least for one source image.
I see, thanks @gselzer! The way you assert is looks absolutely right though. At least for one source image.
Thanks for looking over that function :sweat_smile:. I think the assert covers the use cases for napari-imagej, since we will only ever be adding one source image to the Labeling
.
Here is a MCVE, on labeling
0.1.12
And the printout on my machine, running Ubuntu 20.04:
As the MCVE shows, looking at the result shows no trace of the value
4
.I do concede it is tricky to retain the values in the result image from the original data given to the
Labeling
, e.g. when multiple input images have the same non-zero values. But, if this is the behavior, it should be documented somewhere. And, despite the limitations, I'd think we should try our best to ensure that you can get the original values from the result.@tomburke-rse what do you think? Am I missing something?