All Projects → VarianAPIs → PyESAPI

VarianAPIs / PyESAPI

Licence: MIT license
Python interface to Eclipse Scripting API

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to PyESAPI

ventilator
Open source turbine based medical ventilator developed by CRUX (www.cruxbd.com)
Stars: ✭ 21 (-53.33%)
Mutual labels:  medical-physics
MRQy
MRQy is a quality assurance and checking tool for quantitative assessment of magnetic resonance imaging (MRI) data.
Stars: ✭ 58 (+28.89%)
Mutual labels:  medical-physics
Varian-Code-Samples
Code samples for ESAPI and other Varian APIs and web services.
Stars: ✭ 97 (+115.56%)
Mutual labels:  medical-physics
GateContrib
User-oriented public repository of Gate (macros, examples and user contributions)
Stars: ✭ 57 (+26.67%)
Mutual labels:  medical-physics
pymedphys
A community effort to develop an open standard library for Medical Physics in Python. Building quality transparent software together via peer review and open source distribution. Open code is better science.
Stars: ✭ 179 (+297.78%)
Mutual labels:  medical-physics
open-kbp
Develop dose prediction models for knowledge-based planning in radiotherapy
Stars: ✭ 37 (-17.78%)
Mutual labels:  medical-physics
DICOMautomaton
A multipurpose tool for medical physics.
Stars: ✭ 35 (-22.22%)
Mutual labels:  medical-physics

PyESAPI

"Pie-Sappy" for research use only.

A passion project to help accelerate breakthroughs in medical physics research by bringing the power of Python into the Varian API ecosystem.

Quickstart (updated August 8th 2020)

To simpify the install process and to provide users with accelerated (pre-compiled) numerical libraries, Anaconda's python distribution and repos are recommended. The following documents the quickest path to a "live" jupyter notebook:

  • Access your Eclipse 15.5 (or later) TBOX desktop
  • Install Anaconda3
    • Choose to install for "Just Me" (unless you know what you are doing and have admin privlages on your machine)
    • Use defaults (don't add anaconda to path, but do set ananconda as your default python installation)
  • Optionally install google chrome or chromium browser (for better Jupyter Notebook experience) and set it as your default browser
  • Launch "Anaconda Prompt" by searching in Windows menu
  • In the prompt, execute the command:
    • pip install https://api.github.com/repos/VarianAPIs/PyESAPI/tarball
  • Then execute the command jupyter notebook
  • Create a new notebook and see below for examples (be sure not to select "root" kernel).

Examples

Upgrading

  • Inside your conda env, execute pip install https://api.github.com/repos/VarianAPIs/PyESAPI/tarball --upgrade
    • This will check and upgrade PyESAPI if a newer version is available

Visual Studio Code

  • Tested to work with new projects being built with pyesapi
  • Install Python Extension
  • Select your pyesapi36 conda env (bottom bar, left side)
  • Set path to conda in your User settings.json:
    • "python.condaPath": "C:\\Example\\Path\\To\\anaconda3\\Scripts\\conda.exe"
  • Set cmd to default integrated terminal in Workspace settings.json file (ref)
    • "terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe"
  • Linting is still experimental, but code completion seems to work, please report any issues you find
    • Flake8 is already included in the provided pyesapi36 conda env

Proxy and Git Considerations

  • Proxy for Anaconda
  • Install git in a conda env: conda install -c anaconda git
    • No admin privlages are arequired when installing git this way
  • Proxy for git: git config --global https.proxy https://some.proxy.net:1234

Development

For those wishing to contribute to PyESAPI

Custom ESAPI DLL path

Set custom ESAPI_PATH (to DLLs) before import (bypasses production directory path search)

import os
os.environ['ESAPI_PATH'] = r'C:\Users\CoolKid\Source\Magic\Bin\Debug64'
import pyesapi
# ...

Stub Gen

To create lintable code and enable code completion (in Visual Studio Code at least) we generate python stubs for ESAPI libs...

  1. Download and install IronPython (2.7.9 tested to work) in default location (C:\Program Files\IronPython 2.7\ipy.exe).
  2. Load ironpython-stubs submodule git submodule update --init (ironstubs)
  3. Move to stubgen folder cd stubgen
  4. Execute script stubgen.ps1 (if you hit a Pdb prompt, type continue)
  5. Commit updates to stubs folder

TODOs

  • [*] PyESAPI Stubs V1 (2.7 style, incomplete)
  • PyESAPI Stubs V2 (.pyi style, needs dev work)
  • Official PyPi release
  • [*] Visual Studio Code support
  • Versioning of stubs
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].