Improve handling of pixel size#17
Conversation
|
Is it in microns? In I haven't checked the possible code paths, but we would ideally deal with the scenarios where:
Is this PR compatible with those? |
|
I operated under the assumption that it's in microns. Is there any existing code for translating SI units? edit: or indeed feet, inches, miles, parsecs or yards... |
I don't know how to reconcile this with the only downsample specification present in the bioimageio spec (and our pixel classifier spec?) being pixel size. |
|
I've tried to find and navigate the bioimage.io model spec, but became too confused before I could decipher the part on pixel sizes. But I think it's possible to include specific units, or none at all? If the spec gives a pixel size of
The first seems more intuitive to me, whereas the second seems (just about) defensible if it's substantially easier to implement with the current design, and we document the behavior somewhere. In the case where the image doesn't contain a pixel size, then it's taken to be It's annoyingly vague, but I think preferable to 'the pixel size can only be specified in µm, nothing else' (which is what I think this PR is heading towards?). |
|
I don't think "we're using qupath to analyze landscapes" is an expected use case for bioimageio models PixelCalibration only supports microns and no units currently? I can change the extension to support no units, but given that the only two ways to specify resolution are with just a pixelCalibration or with a pixelCalibration and a downsample, I'm not really satisfied with how you would handle that beyond the current approach of "everything is based on the currently open image" which seems borderline nonsensical to me |
Unit: https://bioimage-io.github.io/spec-bioimage-io/bioimageio_schema_latest/#oneOf_i2_oneOf_i1_inputs_items_axes_items_oneOf_i4_unit Both of which are optional. A path forward would be to have an X and Y spinner using microns if the model's pixel size unit is microns, and a single spinner to specify a downsample otherwise. I don't want to bother converting between other units, if I'm being perfectly honest. |
|
Sounds fine, as long as the spinners are editable so that it's possible to enter anything. There's a chance qupath-fxtras might help if I also wouldn't want to get into converting units at this point; very much a problem for the future (after we've explored JSR 385 and how Bio-Formats does things). |
|
Right, well that should be implemented now. We don't support different pixel sizes in X and Y at the moment but I can revisit that in a future PR if we think it's something people will actually use (doubt). I've not tested the output yet, I'll probably get around to it on Friday. |
|
I did note a separate issue with our spec: qupath/qupath-bioimageio-spec#25 |
|
Tested this with different pixel size and downsample settings, seems to work well |
In future, could allow specifying a pixel size and downsample level, although that may be redundant.