matplotlib / matplotlib/napari-matplotlib
HistogramWidget: 'MultiScaleData' object has no attribute 'ndim'
- Dominant language
- Python
- Stars
- 46
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Description
Getting this error trying to use `HistogramWidget` with some zarr data loaded into napari:
```python
File ~/miniconda3/lib/python3.11/site-packages/napari_matplotlib/histogram.py:72, in HistogramWidget.draw(self=)
67 """
68 Clear the axes and histogram the currently selected layer/slice.
69 """
70 layer = self.layers[0]
---> 72 if layer.data.ndim - layer.rgb == 3:
layer =
layer.rgb = False
73 # 3D data, can be single channel or RGB
74 data = layer.data[self.current_z]
75 self.axes.set_title(f"z={self.current_z}")
AttributeError: 'MultiScaleData' object has no attribute 'ndim'
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in napari_matplotlib/histogram.py at HistogramWidget.draw, especially line 72 where layer.data.ndim is accessed. Reproduce the error with the reported zarr data loaded into napari and trace how MultiScaleData is provided to the widget. Done means HistogramWidget can handle this data without raising the reported AttributeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100