Last active
September 25, 2025 01:55
-
-
Save vjcitn/634e722fe2eea78449bbe3dbd2a39d13 to your computer and use it in GitHub Desktop.
silly approach to starting napari from R
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # based on https://alisterburt.com/napari-workshops/notebooks/viewer_intro.html | |
| library(reticulate) | |
| py_require("napari[all]") | |
| py_require("scikit-image") | |
| nap = import("napari") | |
| v = nap$Viewer() | |
| si = import("skimage") | |
| #id = si$data$cells3d() | |
| if (!file.exists("nuclei.tif")) { | |
| system("wget --no-check-certificate https://raw.githubusercontent.com/alisterburt/napari-workshops/main/napari-workshops/notebooks/data/nuclei.tif") | |
| } | |
| if (!file.exists("cell_membranes.tif")) { | |
| system("wget --no-check-certificate https://raw.githubusercontent.com/alisterburt/napari-workshops/main/napari-workshops/notebooks/data/cell_membranes.tif") | |
| } | |
| nuc = si$io$imread("nuclei.tif") | |
| v$add_image(nuc) | |
| mem = si$io$imread("cell_membranes.tif") | |
| v$add_image(mem) | |
| nap$run() |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
can this help avoid blocking?