Skip to content

Commit

Permalink
allow converting integer cfg.vol to json
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Nov 8, 2023
1 parent d6c64e4 commit a710ab3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion utils/mcx2json.m
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,13 @@ function mcx2json(cfg,filestub)
cfg.vol=single(cfg.vol);
end
if(all(mod(cfg.vol(:),1) == 0))
Domain.MediaFormat='integer';
if(max(cfg.vol(:))<256)
Domain.MediaFormat='byte';
cfg.vol=uint8(cfg.vol);
else
Domain.MediaFormat='integer';
cfg.vol=uint32(cfg.vol);
end
elseif(ndims(cfg.vol)==4)
if(size(cfg.vol,1))==1
Domain.MediaFormat='mua_float';
Expand Down

0 comments on commit a710ab3

Please sign in to comment.