Skip to content

Commit

Permalink
Napari + nomachine instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
msschwartz21 committed Aug 21, 2024
1 parent 4e5ddc8 commit 1054ab6
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,30 @@
#
# This notebook was originally written by Benjamin Gallusser, and was edited for 2024 by Caroline Malin-Mayor.

# %% [markdown]
# Visualizations on a remote machine
# If you are running this notebook on a remote machine, we need to set up a few things so that you can view `napari` on the remote machine.
# 1. From VSCode connected to your remote machine, forward a port (e.g. `4000`) to your local machine.
# - Open you command palette in VSCode (usually CMD-Shift-P) and type "forward a port"
# - Then type in the desired port number `4000` and hit enter
# - From the "PORTS" tab, you should see port 4000 listed as a forwarded port
# 2. Download and install [NoMachine](https://www.nomachine.com/download) on your local machine if it is not already installed.
# 3. Enter the server address in host, set the port to match the port you forwarded in step 1 and protocol as NX. Feel free to enter any name you would like.
# 4. Click on the configuration tab on the left.
# 5. Choose "Use key-based authentication with a key you provide" and hit the "Modify" button.
# 6. Provide the path to your ssh key .pem file.
# 7. Finally hit connect (or Add).
# 8. If you are asked to create a desktop, click yes.
# 9. You should then see a time and date, hitting enter should let you enter your username and access the desktop. The first login may be slow.
# 10. Still in NoMachine, open a shell window. Hit the application button in the bottom left corner and launch "Konsole"
# 11. From the shell, run `echo $DISPLAY`. Copy the output. It should be something like `:1005`
# 12. Return to your notebook in VSCode, and proceed with the exercise.
# 13. Modify the cell below to input the DISPLAY port you retrieved in step 11

# %%
import os
os.environ["DISPLAY"] = "TODO"

# %% [markdown]
# ## Import packages

Expand Down Expand Up @@ -111,6 +135,9 @@
viewer.add_labels(segmentation, name="seg")
viewer.add_image(probabilities, name="probs", scale=(1, 2, 2))

# %% [markdown]
# After running the previous cell, open NoMachine and check for an open napari window.

# %% [markdown]
# ## Read in the ground truth graph
#
Expand Down

0 comments on commit 1054ab6

Please sign in to comment.