Skip to content

EmitterGroup object has no attribute contrast_limits errors #259

Closed
@K-Meech

Description

@K-Meech

With the latest napari-matplotlib and napari, I'm seeing some odd errors while the histogram is open: AttributeError: 'EmitterGroup' object has no attribute 'contrast_limits'. This error doesn't appear when running the same commands below without the histogram open.

To reproduce

  • File > Open Sample > napari builtins > Cells (3D + 2Ch)
  • Plugins > napari matplotlib > Histogram
  • Open napari python console
  • Run commands:
nuclei = viewer.layers["nuclei"].data
mask = nuclei > 8266
viewer.add_labels(mask)

Error

File ~\anaconda3\envs\napari-env-matplot-testing\lib\site-packages\napari_matplotlib\histogram.py:59, in HistogramWidget.on_update_layers(self)
     57 super().on_update_layers()
     58 for layer in self.viewer.layers:
---> 59     layer.events.contrast_limits.connect(self._update_contrast_lims)

File ~\anaconda3\envs\napari-env-matplot-testing\lib\site-packages\napari\utils\events\event.py:978, in EmitterGroup.__getattr__(self, name)
    977 def __getattr__(self, name) -> EventEmitter:
--> 978     return object.__getattribute__(self, name)

AttributeError: 'EmitterGroup' object has no attribute 'contrast_limits'

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions