Dear Prof. Fang Qianqian:
MCX is an amazing repo.
There is a bug in mcxpreview.m dealing with "Grid", "Box" and "subgrid".
The originate of box doesn't change acroing to my settings.
cfg.shapes=['{ "Shapes":['... '{"ZLayers":[[1,2,2]]}, {"Box": {"Tag":3, "O":[50,50,50], "Size":[50,50,10]}}' ... '] }'];
Because of the code in
https://github.com/fangq/mcx/blob/80b57941cea33e10ab369723846108606d1cdba6/utils/mcxplotshapes.m#L72-L83
I tried to fix it using these code.
Thanks for this amazing work again.
Best wishes.
Jiayu Chen
case {'Grid','Box','Subgrid'}
if(strcmp(sname{1},'Grid') && ~isempty(hseg))
delete(hseg);
hseg=[];
end
obj=shp.(sname{1});
if(isfield(obj,'Tag'))
tag=obj.Tag;
end
gridsize=obj.Size;
if(isfield(obj, 'O'))
[no,fc]=latticegrid([obj.O(1) obj.Size(1)+obj.O(1)],[obj.O(2) obj.Size(2)+obj.O(2)],[obj.O(3) obj.Size(3)+obj.O(3)]);
else
[no,fc]=latticegrid([0 obj.Size(1)],[0 obj.Size(2)],[0 obj.Size(3)]);
end
hseg(end+1)=plotmesh(no*voxelsize,fc,'facealpha',0.3, 'linestyle', '-', 'facecolor','none', varargin{:});
Dear Prof. Fang Qianqian: MCX is an amazing repo. There is a bug in mcxpreview.m dealing with "Grid", "Box" and "subgrid". The originate of box doesn't change acroing to my settings.
cfg.shapes=['{ "Shapes":['... '{"ZLayers":[[1,2,2]]}, {"Box": {"Tag":3, "O":[50,50,50], "Size":[50,50,10]}}' ... '] }'];
Because of the code in https://github.com/fangq/mcx/blob/80b57941cea33e10ab369723846108606d1cdba6/utils/mcxplotshapes.m#L72-L83I tried to fix it using these code. Thanks for this amazing work again. Best wishes. Jiayu Chen