Home > BiKEGG > pixFill.m

pixFill

PURPOSE ^

pixFill

SYNOPSIS ^

function [I,pixx,pixy,pixx1,pixy1] = pixFill(I,pixx,pixy,LineStrength,ColSpec)

DESCRIPTION ^

 pixFill
 is a subfunction of NetDraw for generating pixel data points
 based on the specified line width for reactions. 
 
 Inputs:
 I: An array containing the customized metabolic map.
 pixx, pixy: Reaction coordinates.
 ColSpec: Color code of the specified reaction.
 
 Outputs:
 I: Customized metabolic map after adjustments.
 pixx,pixy,pixx1,pixy1: Boundary pixel data based on the specified
 reactions' width.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [I,pixx,pixy,pixx1,pixy1] = pixFill(I,pixx,pixy,LineStrength,ColSpec)
0002 % pixFill
0003 % is a subfunction of NetDraw for generating pixel data points
0004 % based on the specified line width for reactions.
0005 %
0006 % Inputs:
0007 % I: An array containing the customized metabolic map.
0008 % pixx, pixy: Reaction coordinates.
0009 % ColSpec: Color code of the specified reaction.
0010 %
0011 % Outputs:
0012 % I: Customized metabolic map after adjustments.
0013 % pixx,pixy,pixx1,pixy1: Boundary pixel data based on the specified
0014 % reactions' width.
0015 
0016 % O. Jamialahmadi
0017 % TMU, Chem. Eng. Dept., Biotech. Group
0018 % July 2016
0019 
0020 if ~std(pixx)
0021     pixx1 = pixx + LineStrength/2;
0022     pixx = pixx - LineStrength/2;
0023     pixy1 = pixy;
0024 elseif ~std(pixy)
0025     pixy1 = pixy + LineStrength/2;
0026     pixy = pixy - LineStrength/2;
0027     pixx1 = pixx;
0028 else
0029     pixx1 = pixx + LineStrength/2;
0030     pixx = pixx - LineStrength/2;
0031     pixy1 = pixy + LineStrength/2;
0032     pixy = pixy - LineStrength/2;
0033 end
0034 pixx1 = round(pixx1); pixx = round(pixx);
0035 pixy1 = round(pixy1); pixy = round(pixy);
0036 for i5 = 1:numel(pixx)
0037     I(pixy(i5):pixy1(i5),pixx(i5),1) = ColSpec(1);
0038     I(pixy(i5),pixx(i5):pixx1(i5),1) = ColSpec(1); 
0039     I(pixy(i5):pixy1(i5),pixx(i5),2) = ColSpec(2);
0040     I(pixy(i5),pixx(i5):pixx1(i5),2) = ColSpec(2); 
0041     I(pixy(i5):pixy1(i5),pixx(i5),3) = ColSpec(3);
0042     I(pixy(i5),pixx(i5):pixx1(i5),3) = ColSpec(3); 
0043 end

Generated on Sat 16-Jul-2016 20:21:30 by m2html © 2005