Skip to content

Commit

Permalink
allow JSON input to have only one detector
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Apr 15, 2015
1 parent cb32105 commit 08da9f9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mmc/trunk/src/mcx_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,10 @@ int mcx_loadjson(cJSON *root, mcconfig *cfg){
}
dets=FIND_JSON_OBJ("Detector","Optode.Detector",Optode);
if(dets){
cJSON *det=dets->child;
cJSON *det=dets;
if(!FIND_JSON_OBJ("Pos","Optode.Detector.Pos",dets))
det=dets->child;

if(det){
cfg->detnum=cJSON_GetArraySize(dets);
cfg->detpos=(float4*)malloc(sizeof(float4)*cfg->detnum);
Expand Down

0 comments on commit 08da9f9

Please sign in to comment.