-
-
Notifications
You must be signed in to change notification settings - Fork 410
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
New labels annotation tool and tensorstore #6761
Comments
I was playing with this pattern: Script:
Painting is much more performant and glitches with the polygon tool less frequent (but still happening oddly enough): |
Playing a bit further, not sure if this is too hacky, but it does work:
(for painting it seems to be good, and I think it could be made into a widget. the polygon tool is still unpredictable though) |
I assume you could go on painting indefinitely before doing the commit, so it's actually not bad from a UX point of view. It's just |
@psobolewskiPhD I haven't played that much with Tensorstore beyond getting plain-old-paint to work, and in fact you are now the expert. 😂 But that exploration seems very interesting. I've thought about a general approach here in which we paint only the Anyway, the performance issue is, I think, secondary to the polygon glitching issue. I wonder whether it's related to my issues with triangulation in #6654 #5673. I don't think the two issues are related, though it's interesting that you can reduce the glitching by using transactions... My suspicion is that there's something a bit weird going on with tensorstore indexing — it is a little bit different from NumPy indexing in that it maintains the index of sliced dimensions: In [4]: arr = ts.array(np.arange(5*10*12).reshape((5, 10, 12)))
In [5]: b = arr[1:3]
In [6]: b[0]
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
Cell In[6], line 1
----> 1 b[0]
IndexError: OUT_OF_RANGE: Checking bounds of constant output index map for dimension 0: Index 0 is outside valid range [1, 3) [domain='{origin={1, 0, 0}, shape={2, 10, 12}}'] [transform='Rank 2 -> 3 index space transform: Input domain: 0: [0, 10) 1: [0, 12) Output index maps: out[0] = 0 out[1] = 0 + 1 * in[0] out[2] = 0 + 1 * in[1] '] [source locations='tensorstore/index_space/internal/propagate_bounds.cc:109\ntensorstore/index_space/internal/propagate_bounds.cc:109\ntensorstore/index_space/internal/compose_transforms.cc:113\ntensorstore/index_space/index_transform.h:106']
In [7]: b[1]
Out[7]:
TensorStore({
'array': [
[120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131],
[132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143],
[144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155],
[156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167],
[168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179],
[180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191],
[192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203],
[204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215],
[216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227],
[228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239],
],
'context': {'data_copy_concurrency': {}},
'driver': 'array',
'dtype': 'int64',
'transform': {'input_exclusive_max': [10, 12], 'input_inclusive_min': [0, 0]},
}) |
🐛 Bug Report
Using the new annotation tool in the labels layer with tensorstore doesn't provide any feedback when the saving operation is unsuccessful.
💡 Steps to Reproduce
A test showing interaction with a tensorstore array (numpy array for comparison).
The array has two slices to easily demonstrate re-reading of the annotation.
Recording.2024-03-20.144103.mp4
💡 Expected Behavior
Maybe an error message that saving to the zarr array failed in this situation?
🌎 Environment
napari: 0.5.0a2.dev606+gb3e15c51
Platform: Windows-10-10.0.19045-SP0
Python: 3.10.13 | packaged by conda-forge | (main, Dec 23 2023, 15:27:34) [MSC v.1937 64 bit (AMD64)]
Qt: 5.15.2
PyQt5: 5.15.10
NumPy: 1.26.4
SciPy: 1.12.0
Dask: 2024.3.1
VisPy: 0.14.2
magicgui: 0.8.2
superqt: 0.6.2
in-n-out: 0.2.0
app-model: 0.2.5
npe2: 0.7.4
💡 Additional Context
It's related to the performance and when the classical drawing tool (brush) is responsive, the new tool is working correctly too. Yet, this performance issue seems unavoidable with an HDD drive (in the example that I provide, a small 2k x 2k px array is not performant) and when the brush is used the problem is obvious. In contrast with the new tool, the annotation is displayed correctly but stored incorrectly in the underlying zarr.
The text was updated successfully, but these errors were encountered: