Skip to content

Commit

Permalink
pmcx.cpp:
Browse files Browse the repository at this point in the history
- Parse issavedet field of the cfg dict as an int instead of a bool.
  • Loading branch information
matinraayai committed Jan 10, 2025
1 parent 8f433e9 commit cf10d5f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pmcx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ void parse_config(const py::dict& user_cfg, Config& mcx_config) {

// Output arguments parsing
GET_SCALAR_FIELD(user_cfg, mcx_config, issave2pt, py::bool_);
GET_SCALAR_FIELD(user_cfg, mcx_config, issavedet, py::bool_);
GET_SCALAR_FIELD(user_cfg, mcx_config, issavedet, py::int_);
GET_SCALAR_FIELD(user_cfg, mcx_config, issaveseed, py::bool_);

// Flush the std::cout and std::cerr
Expand Down Expand Up @@ -1110,7 +1110,7 @@ py::dict pmcx_interface(const py::dict& user_cfg) {
mcx_config.exportfield = (float*) calloc(field_len, sizeof(float));
}

if (mcx_config.issavedet == 1) {
if (mcx_config.issavedet >= 1) {
mcx_config.exportdetected = (float*) malloc(hostdetreclen * mcx_config.maxdetphoton * sizeof(float));
}

Expand Down Expand Up @@ -1200,7 +1200,7 @@ py::dict pmcx_interface(const py::dict& user_cfg) {
}
}

if (mcx_config.issavedet == 1) {
if (mcx_config.issavedet >= 1) {
field_dim[0] = hostdetreclen;
field_dim[1] = mcx_config.detectedcount;
field_dim[2] = 0;
Expand Down

0 comments on commit cf10d5f

Please sign in to comment.