0001 function dimensions=getPathwayDimensions(pathway)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 right=0;
0014 left=inf;
0015 top=inf;
0016 bottom=0;
0017
0018
0019
0020 for i=1:length(pathway.listOfCompartments)
0021 if pathway.listOfCompartments(1,i).x<left
0022 left=pathway.listOfCompartments(1,i).x;
0023 end
0024 if pathway.listOfCompartments(1,i).y<top
0025 top=pathway.listOfCompartments(1,i).y;
0026 end
0027 if (pathway.listOfCompartments(1,i).x+pathway.listOfCompartments(1,i).w)>right
0028 right=pathway.listOfCompartments(1,i).x+pathway.listOfCompartments(1,i).w;
0029 end
0030 if (pathway.listOfCompartments(1,i).y+pathway.listOfCompartments(1,i).h)>bottom
0031 bottom=pathway.listOfCompartments(1,i).y+pathway.listOfCompartments(1,i).h;
0032 end
0033 end
0034
0035
0036
0037 for i=1:length(pathway.listOfSpecies)
0038 if pathway.listOfSpecies(1,i).x<left
0039 left=pathway.listOfSpecies(1,i).x;
0040 end
0041 if pathway.listOfSpecies(1,i).y<top
0042 top=pathway.listOfSpecies(1,i).y;
0043 end
0044 if (pathway.listOfSpecies(1,i).x+pathway.listOfSpecies(1,i).w)>right
0045 right=pathway.listOfSpecies(1,i).x+pathway.listOfSpecies(1,i).w;
0046 end
0047 if (pathway.listOfSpecies(1,i).y+pathway.listOfSpecies(1,i).h)>bottom
0048 bottom=pathway.listOfSpecies(1,i).y+pathway.listOfSpecies(1,i).h;
0049 end
0050 end
0051
0052 dimensions=[left,top,right-left,bottom-top];
0053 end