|
|
Currently, to use the Pulse Python API, you must build Pulse and enable the Pulse_PYTHON_API option.
|
|
|
We hope to have pyip support is the future.
|
|
|
|
|
|
![image](uploads/1435972b9039aa82410875f4162c13dc/image.png)
|
|
|
|
|
|
Once Pulse is built with Python support, the easiest way to get started with the Pulse Python API is to use PyCharm.
|
|
|
|
|
|
### Open The Pulse Project In PyCharm
|
|
|
|
|
|
From the initial PyCharm splash screen, choose the Open option.
|
|
|
|
|
|
![image](uploads/0098abd981bc50e806bd6c1546e011b8/image.png)
|
|
|
|
|
|
### Navigate to your Pulse source code folder and select the src/python folder.
|
|
|
|
|
|
![image](uploads/8e815e8a9884a15dfd5a9ad4f3b169cf/image.png)
|
|
|
|
|
|
## Add the Pulse to your PYTHONPATH
|
|
|
|
|
|
From the `File` menu option, select `Settings`
|
|
|
|
|
|
Navigate to the `Project:python` option and select `Project Interpreter`
|
|
|
|
|
|
![image](uploads/6114a5878cbcdafcdcba3779ef9ed031/image.png)
|
|
|
|
|
|
Ensure you have a Python interpreter selected ( one of version >= 3.6 is suggested)
|
|
|
|
|
|
Click on the `Cog Icon` to the right of the selected interpreter drop down, and select `Show All`
|
|
|
|
|
|
![image](uploads/575807dc93135c745e0f2a978ddedc09/image.png)
|
|
|
|
|
|
Next, click on the bottom icon (Folder hierarchy) of the vertically arranged buttons.
|
|
|
|
|
|
The tooltip of the button is `Show paths for the selected interpreter`
|
|
|
|
|
|
![image](uploads/e50e9dd710492fd4804bbccb3e4722c2/image.png)
|
|
|
|
|
|
Add the path to your Pulse build install\bin directory
|
|
|
|
|
|
And click the many `OK` buttons to close out all settings windows.
|
|
|
|
|
|
Next, From the `Run` menu option, select the `Edit Configurations...` option
|
|
|
|
|
|
Select the `Python` option under `Templates` and set the `Working directory` field to your Pulse build install/bin folder, and hit `OK`
|
|
|
|
|
|
![image](uploads/f4b47b66e2e9c7081692dab6c1a68ad8/image.png)
|
|
|
|
|
|
Now you can right-click any of the How-To files and Debug/Run them!
|
|
|
|
|
|
![image](uploads/13c9fab23192e9bb47a91f7adb40eee9/image.png)
|
|
|
|
|
|
Create your own python files or modify ours, and let us know if you have any issues on our [discourse forum](https://discourse.kitware.com/c/pulse-physiology-engine/)!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|