|
Size: 603
Comment:
|
Size: 1296
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 1: | Line 1: |
| ## page was renamed from python = FreeSurfer Python Development = To facilitate straightforward and reproducible python development in the lab, a custom python3 (anaconda) distribution for internal developers is installed at '''/space/freesurfer/python/linux'''. To use this version, make sure all calls to `python` or `python3` point to this install by adding the following to your PATH. |
|
| Line 5: | Line 10: |
| After setting this, any calls to python or python3 will use this install. Keep in mind that there's also a python3 link in `/usr/pubsw/bin`, so it's important that you `/space/freesurfer/python/linux/bin` comes first in your PATH. | Keep in mind there's also a `python3` link in `/usr/pubsw/bin`, so it's important that `/space/freesurfer/python/linux/bin` comes before that in your PATH. |
| Line 7: | Line 12: |
| === Tensorflow GPU === | === Developing and Using the FreeSurfer Python Library === |
| Line 9: | Line 14: |
| If you're on a machine with cuda installed, you can use the gpu-enabled tensorflow by modifying the following search paths. | The freesurfer python library, which contains general utilities and various submodules like deepsurfer, gems, and samseg, is developed in the repository under '''repo/python/freesurfer'''. In order to utilize this library during development, you must point your `PYTHONPATH` at it: |
| Line 12: | Line 17: |
| export PYTHONPATH=/space/freesurfer/python/linux/tensorflow-gpu:$PYTHONPATH export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH |
export PYTHONPATH=/path/to/your/freesurfer-repository/python:$PYTHONPATH |
| Line 15: | Line 19: |
This allows you to import your working version of the freesurfer library in any script or python interpreter. You can test it by opening a python interpreter and running: {{{ import freesurfer as fs status = fs.run('echo hello!') }}} |
FreeSurfer Python Development
To facilitate straightforward and reproducible python development in the lab, a custom python3 (anaconda) distribution for internal developers is installed at /space/freesurfer/python/linux. To use this version, make sure all calls to python or python3 point to this install by adding the following to your PATH.
export PATH=/space/freesurfer/python/linux/bin:$PATH
Keep in mind there's also a python3 link in /usr/pubsw/bin, so it's important that /space/freesurfer/python/linux/bin comes before that in your PATH.
Developing and Using the FreeSurfer Python Library
The freesurfer python library, which contains general utilities and various submodules like deepsurfer, gems, and samseg, is developed in the repository under repo/python/freesurfer. In order to utilize this library during development, you must point your PYTHONPATH at it:
export PYTHONPATH=/path/to/your/freesurfer-repository/python:$PYTHONPATH
This allows you to import your working version of the freesurfer library in any script or python interpreter. You can test it by opening a python interpreter and running:
import freesurfer as fs
status = fs.run('echo hello!')