Skip to content
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

fixes for the latest cluster plotter #34

Merged
merged 4 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,10 @@ jobs:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4.2.0
- name: Set up conda ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3.0.4
with:
mamba-version: "*"
activate-environment: napari-tomotwin
channel-priority: true
python-version: ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion conda_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ dependencies:
- pip
- pip:
- napari-boxmanager # Install napari-boxmanager via pip because otherwise scripts in setup.cfg are ignored
- git+https://github.com/BiAPoL/napari-clusters-plotter.git@b9b08f3500c9b0831d2cd1b4d9a757c688f76005 #until 0.7.4 is released
- napari-clusters-plotter
1 change: 1 addition & 0 deletions src/napari_tomotwin/_tests/test_load_umap.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def test_something(self):
widget, _ = viewer.window.add_plugin_dock_widget('napari-tomotwin', widget_name='TomoTwin clustering workflow')
lyr = tool.load_umap(filename=f"{tmpdirname}/umap.tumap")
viewer.add_layer(lyr)
viewer.close()

assert True # just make sure that now exception is raised

Expand Down
4 changes: 3 additions & 1 deletion src/napari_tomotwin/cluster_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ def after_draw_event(self):
self._recalc_umap.setEnabled(True)
self._add_candidate.setEnabled(True)
self._show_targets.setEnabled(True)
self.plotter_widget.layer_select.value.opacity = 0 # hot fix until line 108 in load_umap works (PR must be accepted)

except Exception as e:
print(e)
Expand Down Expand Up @@ -557,7 +558,8 @@ def update_items_cluster_dropdown(

dropdown.clear()
for c in np.unique(cluster_ids):
if c == 0:

if c <= 0:
continue
rgba = self.index_to_rgba(c)
dropdown.addItem("")
Expand Down
8 changes: 4 additions & 4 deletions src/napari_tomotwin/load_umap.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,18 @@ def show_umap(self, label_layer):

self.update_progress_bar("Visualize umap")
self.viewer.add_layer(label_layer)

label_layer.opacity = 0
label_layer.visible = True
self.created_layers.append(label_layer)

try:
# napari-clusters-plotter > 0.7.4
label_layer.opacity = 0
label_layer.visible = True
self.plotter_widget.layer_select.value = label_layer
except:
print("ERROR!!")
# napari-clusters-plotter < 0.7.4
pass

#self.plotter_widget.manual_label_opacity = 0
self.plotter_widget.plot_x_axis.setCurrentIndex(3)
self.plotter_widget.plot_y_axis.setCurrentIndex(4)
self.plotter_widget.bin_auto.setChecked(True)
Expand Down
Loading