Skip to content

Commit

Permalink
For MEDIA_ASGN_F2H where mua/mus are nan ensure that the provided g/n…
Browse files Browse the repository at this point in the history
… values are nontheless read
  • Loading branch information
lkeegan committed Jun 27, 2024
1 parent f959c71 commit b49b437
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/mcx_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -3525,16 +3525,14 @@ void mcx_loadvolume(char* filename, Config* cfg, int isbuf) {

if (f2h[0] != f2h[0] || f2h[1] != f2h[1]) { /*if one of mua/mus is nan in continuous medium, convert to 0-voxel*/
cfg->vol[i] = 0;
continue;
} else {
cfg->vol[i] = mcx_float2half2(f2h);
}

if (cfg->mediabyte == MEDIA_ASGN_F2H) {
cfg->vol[i] = mcx_float2half2(f2h);
f2h[0] = val[(i << 2) + 2]; // g
f2h[1] = val[(i << 2) + 3]; // n
cfg->vol[i + datalen] = mcx_float2half2(f2h);
} else {
cfg->vol[i] = mcx_float2half2(f2h);
}
}
} else if (cfg->mediabyte == MEDIA_2LABEL_SPLIT) {
Expand Down

0 comments on commit b49b437

Please sign in to comment.