Skip to content

Commit

Permalink
Merge pull request #322 from arayabrain/feature/fix-microscope-env
Browse files Browse the repository at this point in the history
Feature/fix microscope env
  • Loading branch information
ReiHashimoto committed Mar 28, 2024
2 parents a0c48a4 + 6911c33 commit e46a248
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/gui/workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,9 @@ You may not want to modify your original data folder, or you may want to make yo
- get the C library files from the manufacturer's support.
- use OptiNiSt by :ref:`developer mode <each-platforms-for-developer>`.
- put the libraries into ``optinist/studio/app/optinist/microscopes/dll/{nikon | olympus}/{linux | windows}/``
- set environment value ``MICROSCOPES_LIBRARY_DIR`` in ``studio/config/.env`` to your library path.
- put the libraries into ``MICROSCOPES_LIBRARY_DIR/dll/{nikon | olympus}/{linux | windows}/``
- If you use Linux, open ``studio/app/optinist/wrappers/optinist/conda/microscope.yaml`` and uncomment the ``- gcc=12`` line.
```

<p align="center">
Expand Down
4 changes: 4 additions & 0 deletions studio/app/dir_path.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import os
from enum import Enum

from dotenv import load_dotenv

_DEFAULT_DIR = "/tmp/studio"
_ENV_DIR = os.environ.get("OPTINIST_DIR")

Expand All @@ -23,6 +25,8 @@ class DIRPATH:
STUDIO_DIR = os.path.dirname(os.path.dirname(__file__))
APP_DIR = os.path.dirname(__file__)
CONFIG_DIR = f"{STUDIO_DIR}/config"
if os.path.isfile(f"{CONFIG_DIR}/.env"):
load_dotenv(f"{CONFIG_DIR}/.env")

CONDAENV_DIR = (
f"{os.path.dirname(os.path.dirname(os.path.dirname(__file__)))}/conda"
Expand Down
3 changes: 3 additions & 0 deletions studio/app/optinist/wrappers/optinist/conda/microscope.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
channels:
- conda-forge
dependencies:
- python=3.9
# NOTE: Uncomment the following line if you want to use .nd2 .oir files on linux
# - gcc=12
- pip
- pip:
Expand Down
3 changes: 3 additions & 0 deletions studio/config/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ IS_STANDALONE=True
# MYSQL_DATABASE=studio
# MYSQL_USER=studio_db_user
# MYSQL_PASSWORD=studio_db_password

# NOTE: Uncomment and set your own values when using .nd2 or .oir reader
# MICROSCOPES_LIBRARY_DIR="/app/studio/app/optinist/microscopes/dll"

0 comments on commit e46a248

Please sign in to comment.