Skip to content

Commit

Permalink
add example to pmcx.mcxlab(), bump pmcx to 0.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Sep 25, 2023
1 parent ef4ef45 commit fedc049
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions pmcx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

- Copyright: (C) Matin Raayai Ardakani (2022-2023) <raayaiardakani.m at northeastern.edu>, Qianqian Fang (2019-2023) <q.fang at neu.edu>, Fan-Yu Yen (2023) <yen.f at northeastern.edu>
- License: GNU Public License V3 or later
- Version: 0.2.1
- Version: 0.2.2
- URL: https://pypi.org/project/pmcx/
- Github: https://github.com/fangq/mcx

Expand Down Expand Up @@ -134,12 +134,14 @@ plt.show()
```
* Alternatively, one can also define a Python dict object containing each setting
as a key, and pass on the dict object to `pmcx.run()`
as a key, and pass on the dict object to `pmcx.run()`, or preferably, `pmcx.mcxlab()`
```python3
import pmcx
import numpy as np
cfg = {'nphoton': 1000000, 'vol':np.ones([60,60,60],dtype='uint8'), 'tstart':0, 'tend':5e-9, 'tstep':5e-9,
'srcpos': [30,30,0], 'srcdir':[0,0,1], 'prop':[[0,0,1,1],[0.005,1,0.01,1.37]]}
res = pmcx.run(cfg)
res = pmcx.run(cfg) # pmcx.run returns detected photon data as a concatenated 2D array res['detp'], same for res['traj']
# or alternatively/preferably
res = pmcx.mcxlab(cfg) # pmcx.mcxlab calls pmcx.run, and postprocess res['detp'] and res['traj'] raw data into dict form
```
2 changes: 1 addition & 1 deletion pmcx/pmcx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
# from .files import loadmc2, loadmch, load, save
from .bench import bench

__version__ = "0.2.1"
__version__ = "0.2.2"

__all__ = (
"gpuinfo",
Expand Down
2 changes: 1 addition & 1 deletion pmcx/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def build_extension(self, ext):
setup(
name="pmcx",
packages=['pmcx'],
version="0.2.1",
version="0.2.2",
requires=['numpy'],
license='GPLv3+',
author="Matin Raayai Ardakani, Qianqian Fang, Fan-Yu Yen",
Expand Down

0 comments on commit fedc049

Please sign in to comment.