-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VALUE is not a is not a valid RESUNIT #329
Comments
I can't reproduce this in my dev environment with tifffile 2022.10.10 . In colab the notebook installs version 2023.2.3 via pip., but there I can run this without error, too:
Do you have a minimal example that fails? |
Hi @FynnBe The problem here is that the image is a volume and for some reason, when specifying the resolution for the three dimensions, it does not work. For example, these work import numpy as np
import tifffile
im = np.zeros((8, 512, 512)).astype("float32")
tifffile.imwrite("/content/lala.tif", im, imagej=True, resolution=(1, 2))
tifffile.imwrite("/content/lala.tif", im, imagej=True, resolution=(.8, 0.005)) and these not: tifffile.imwrite("/content/lala.tif", im, imagej=True, resolution=(.8, 0.005, .8))
tifffile.imwrite("/content/lala.tif", im, imagej=True, resolution=(.8, .8, 0.005))
tifffile.imwrite("/content/lala.tif", im, imagej=True, resolution=(0.005, .8, .8)) |
ah, we might have to use |
there are solutions out there: https://github.com/cgohlke/tifffile/blob/eb79f64e65fdd17fa5722dac9ce32ec6dd224f5d/tifffile/tifffile.py#L453-L468 I started working on this in #331, but I do not have time to finish that atm. |
But the function is inside the bioimageio library. Do you suggest building the model with res = (1,1,1) and then change it manually? This is not a huge problem but note that we will need a workaround as QuPath requires the pixel size. We could also store that value in the deepImageJ config and stored a tiff file without metadata regarding the resolution :) |
yes, probably best with |
We don't need that information in the tiff but rather in the config field of the yaml |
Hi again! |
no, I wonder if @constantinpape is aware of that library? Before changing anything image io related I would want to consult him! |
Yeah, this is the image data format developed by Allen. I haven't used it much myself, but from what I know it's pretty good. If we can added without too much dependency hassle I am all for adding it. (I am saying this because I think it uses bioformats internally, which in turn uses a javabridge, which makes it a bit of a mess; but I might be wrong / or this might only be an optional dependency that we don't need). |
I won't have time for this in the next few weeks though |
closing in favor of #353 |
Hi! I'm trying to export a model specifying the pixel size but whenever it's different from 1 or 0.5, it gives the following error. The variable pixel size enters as
{'x': 0.8, 'y': 0.8, 'z': 0.005}
in the kwargs of the build_model.I'm trying it with the 3D UNet notebook of ZeroCostDL4Mic using TF 2.11 (I will update the notebook now in their repo)
tifffile
has changed some parameters ofimwrite
in their last version so it may be that they also have some requirements for theresolution
variable.core-bioimage-io-python/bioimageio/core/build_spec/build_model.py
Line 447 in 7be3e2e
The text was updated successfully, but these errors were encountered: