Slice interpolation produces strange results
Closed this issue · 3 comments
Describe the bug
Sometimes the slice interpolation fills in missing slices with masks which are not "proper" average of the labels they were interpolated from. This does not occur all the time, so I'm not sure what causes this.
To Reproduce
Steps to reproduce the behavior:
- Download https://drive.google.com/file/d/1l47Qlao4ABr8B4Or2YVWjPou02auYNR0/view?usp=sharing
- Start napari
- Open the downloaded mask
- Start the 'Annotation plugin'
- Click 'Interpolate' in the 'Interpolation' tab
- See results.
Expected behavior
The interpolated masks' shapes should be similar to the existing ones'.
napari info
napari: 0.4.15
Platform: Windows-10-10.0.22621-SP0
Python: 3.9.10 (tags/v3.9.10:f2f3f53, Jan 17 2022, 15:14:21) [MSC v.1929 64 bit (AMD64)]
Qt: 5.15.2
PyQt5: 5.15.6
NumPy: 1.22.4
SciPy: 1.8.1
Dask: 2022.05.2
VisPy: 0.9.6
OpenGL:
- GL version: 4.5.0 - Build 25.20.100.6577
- MAX_TEXTURE_SIZE: 16384
Screens:
- screen 1: resolution 1920x1080, scale 1.0
Plugins:
- console: 0.0.4
- napari-nd-cropper: 0.1.3
- napari-tools-menu: 0.1.11
- scikit-image: 0.4.15
- svg: 0.1.6
Hi @bauerdavid ,
I'm not sure whether this falls into the same category/is the same issue, but I am getting some weird results when using the slice interpolation for multiple labels.
To reproduce:
- Take any 3D image data
- annotate two slices with label
1
and interpolate - now annotate a second object with label 2 in any two slices and interpolate again.
I'd expect the result from label 1 not to change, but this is the case.
Hi @bauerdavid ,
I'm not sure whether this falls into the same category/is the same issue, but I am getting some weird results when using the slice interpolation for multiple labels.
To reproduce:
- Take any 3D image data
- annotate two slices with label
1
and interpolate- now annotate a second object with label 2 in any two slices and interpolate again.
I'd expect the result from label 1 not to change, but this is the case.
Hey @jo-mueller,
I think I know what the problem is with that. The label 1
annotations are overwritten when the interpolation for the label 2
is stored in the layer (they are replaced with 0
s, as they are not 2
s). As this is an unrelated problem, I'll create a new issue for it. Thanks for the input!
As for the strange interpolation results, I think I found the solution, I will soon push the corrected version.
resolved in ed69226