# Toolboxes file level help

## C:\Users\AB\DArT_Toolshed\Toolboxes\AreaFinder

AreaFinder.m

function AreaFinder Dr. A. I. Hanna, CMP, 2008

## C:\Users\AB\DArT_Toolshed\Toolboxes\CellFinder

CellFinderTool.m

## C:\Users\AB\DArT_Toolshed\Toolboxes\CellFinder\Images

## C:\Users\AB\DArT_Toolshed\Toolboxes\CellFinder\SegmentationAlgorithms

cells_SEM.m

%%%%%%%%%%%%%%%%%%%% Process the cell image %%%%%%%%%%%%%%%%%%%%%

small_white_circles_on_black.m

%%%%%%%%%%%%%%%%%%%% Process the cell image %%%%%%%%%%%%%%%%%%%%%

stomata_stitched.m

%%%%%%%%%%%%%%%%%%%% Process the cell image %%%%%%%%%%%%%%%%%%%%%

## C:\Users\AB\DArT_Toolshed\Toolboxes\CellSegment

cellSegment.m

gaussian3DBy1DFilter.m

function vol = gaussian3DBy1DFilter(f1d,numberOfTimes,display,halfwidth,halflength,halfheight,vol) f1d - a one dimensional filter numberOfTimes - number of times vol will be filtered with f1d display - flag set to 1 for debug display halfwidth,- only used for debugging default volumes set to 99 and ignore halflength,- only used for debugging default volumes set to 99 and ignore halfheight,- only used for debugging default volumes set to 99 and ignore vol optional - volume to be filtered (if not provided then it will use a default volume and return a 3D filter) filpdir - flag set to 1 to invert the filtered volume left to right Usage: filteredVolume = gaussian3DBy1DFilter(a1DFilter,1,0,99,99,99,volumeToBeFiltered,0);

imoverlay.m

IMOVERLAY Create a mask-based image overlay. OUT = IMOVERLAY(IN, MASK, COLOR) takes an input image, IN, and a binary image, MASK, and produces an output image whose pixels in the MASK locations have the specified COLOR. IN should be a grayscale or an RGB image of class uint8, uint16, int16, logical, double, or single. If IN is double or single, it should be in the range [0, 1]. If it is not in that range, you might want to use mat2gray to scale it into that range. MASK should be a two-dimensional logical matrix. COLOR should be a 1-by-3 vector of values in the range [0, 1]. [0 0 0] is black, and [1 1 1] is white. OUT is a uint8 RGB image. Examples -------- Overlay edge detection result in green over the original image. I = imread('cameraman.tif'); bw = edge(I, 'canny'); rgb = imoverlay(I, bw, [0 1 0]); imshow(rgb) Treating the output of peaks as an image, overlay the values greater than 7 in red. The output of peaks is not in the usual grayscale image range of [0, 1], so use mat2gray to scale it. I = peaks; mask = I > 7; rgb = imoverlay(mat2gray(I), mask, [1 0 0]); imshow(rgb, 'InitialMagnification', 'fit')

readTIFStack.m

A function that takes a string containing the name of a TIF stack, and returns a MxNxF volume where F is the number of images in the stack. Dr. A. I. Hanna (2007)

seedGaussFiller2d.m

need to tidy this function up, written on a plane with no sleep - % sorry...

seedGaussFiller2dVER2.m

need to tidy this function up, written on a plane with no sleep - % sorry...

seedGaussFiller3d.m

construct filler

seedGaussFiller3dVER2.m

construct filler

## C:\Users\AB\DArT_Toolshed\Toolboxes\ClusterControl

getTheClusterNameAddress.m

function plain_pw=getTheClusterNameAddress(encrypted_pw) encrypted_name, number array containing encrypted password if there is no password file you will be asked for your escluster.uea.ac.uk password and an encrypted version will be stored in the same directory as your DArT_Toolbox It is stored in a file called 'growthpassword.mat' plain_name, plain text version of password J.Andrew Bangham, 2008

getpassword.m

function plain_pw=getpassword(encrypted_pw) encrypted_pw, number array containing encrypted password if there is no password file you will be asked for your escluster.uea.ac.uk password and an encrypted version will be stored in the same directory as your DArT_Toolbox It is stored in a file called 'growthpassword.mat' plain_pw, plain text version of password J.Andrew Bangham, 2008

getyourclusterdirectory.m

function plain_directory=getyourclustername(encrypted_directory) encrypted_directory, number array containing encrypted directory if there is no directory file you will be asked for your escluster.uea.ac.uk directory e.g. (A) is interpreted as gpfs_esscratch01/sys/ (B) is interpreted as gpfs_esscratch02/bio/ (C) specify the complete string e.g. gpfs_esscratch01/sys/ and an encrypted version will be stored in the same directory as your DArT_Toolbox It is stored in a file called 'growthpassword.mat' plain_directory, plain text version of directory J.Andrew Bangham, 2008

getyourclustername.m

function plain_pw=getyourclustername(encrypted_pw) encrypted_name, number array containing encrypted password if there is no password file you will be asked for your escluster.uea.ac.uk password and an encrypted version will be stored in the same directory as your DArT_Toolbox It is stored in a file called 'growthpassword.mat' plain_name, plain text version of password J.Andrew Bangham, 2008

getyouremail.m

function plain_pw=getyouremail(encrypted_name) encrypted_name, number array containing encrypted email address if there is no password file you will be asked for your escluster.uea.ac.uk password and an encrypted version will be stored in the same directory as your DArT_Toolbox It is stored in a file called 'growthpassword.mat' plain_name, plain text version of password J.Andrew Bangham, 2008

## C:\Users\AB\DArT_Toolshed\Toolboxes\FilterTubulesExperiments

Bfillif.m

if nargin<1 arg='initialise'; end if nargin<2 opt=[]; end

FillRidge.m

load fillridgedata flood fill counter=1; loop over the seed points push seed point counter=counter+1; while stack pop mark memoryimage with counter look north/northeast etc. if not already marked and most likely then push the index end endloop

PrepareImage.m

addtubulintoeb1.m

alterLFile.m

andrewToPaul.m

calcCatastrophies.m

velperum(length(collisionfiles)) = 0; velperumid(length(collisionfiles)) = 0; dyingprob(length(collisionfiles)) = 0;

calcdot.m

a = [1 1; 5 5] b = [3 3; 8 15] b = [1 1; 5 5]

chi.m

e = [0.25 0.25 0.25 0.25 0.25] x = [0 0 1 0 0] [sig chires] = chi(x,e)

collisionAnalyser.m

cropImage.m

crossFoldValidateKNN.m

dimsToUse = [2 3 4 5 6 7]

eb1speeds.m

fillif.m

filterToCell.m

A function for returning the tubules which intersect with the specified points. -path, a string containing the path to a dir containing tubule data (e.g /Users/JacobNewman/MyTubuleData2011/). -t, the time/frame to load from the data. t = 1 will load path/alltubules1.mat -xy, is a matrix where rows are samples the columns are x and y. These are the points we wish to check for tubules. -imXimY, is a two element vector where the first element is the length in x of the tubule image, and the second element is y. -tubules, is a structure returned upon executing this function. It contains data regarding the tubules that intersect with the specified xy-coords.

filterflow.m

findEnds.m

findTheBigOnes.m

findTubuleID.m

findseeds.m

fitGaussians.m

fitexample.m

floodfill.m

Jacob Newman 2011

followTubules.m

path = '/Users/jacobnewman/Desktop/DArT2/trunk/Toolboxes/FilterTubulesExperiments/28092011/'; outputpath = '/Users/jacobnewman/Desktop/DArT2/trunk/Toolboxes/FilterTubulesExperiments/28092011/2/';

followTubules2.m

formatForPaul.m

jakeTubules.m

A function for returning the tubules which intersect with the specified points. -path, a string containing the path to a dir containing tubule data (e.g /Users/JacobNewman/MyTubuleData2011/). -t, the time/frame to load from the data. t = 1 will load path/alltubules1.mat -xy, is a matrix where rows are samples the columns are x and y. These are the points we wish to check for tubules. -imXimY, is a two element vector where the first element is the length in x of the tubule image, and the second element is y. -tubules, is a structure returned upon executing this function. It contains data regarding the tubules that intersect with the specified xy-coords.

joinTubules.m

Input argument setup

labelRegions.m

makeArff.m

makeTestArff.m

img2;

makeTrainingMatFile.m

makeTrainingMatFile2.m

plot3DMTs.m

plotCompositeTubuleStats.m

queryTubules.m

queryTubulesStats.m

readScott.m

runDemo.m

Clear Matlab command window.

sammonFeatures.m

saveMask1D.m

Jacob Newman 2011

showAllCells.m

showstatic.m

sieve1d.m

skeleton.m

SKELETON produces skeletons of binary images [skg,rad] = skelgrad(img) computes the skeleton for a binary image, and also the local radius at each point.

statsPerLayer.m

steerGauss.m

STEERGAUSS Implements a steerable Gaussian filter. This m-file can be used to evaluate the first directional derivative of an image, using the method outlined in: W. T. Freeman and E. H. Adelson, "The Design and Use of Steerable Filters", IEEE PAMI, 1991. [J,H] = STEERGAUSE(I,THETA,SIGMA,VIS) evaluates the directional derivative of the input image I, oriented at THETA degrees with respect to the image rows. The standard deviation of the Gaussian kernel is given by SIGMA (assumed to be equal to unity by default). The filter parameters are returned to the user in the structure H. [J,H] = STEERGAUSE(I,H,VIS) evaluates the directional derivative of the input image I, using the previously computed filter stored in H. Note that H is a structure, with the following fields: H.g: 1D Gaussian H.gp: first-derivative of 1D Gaussian H.theta: orientation of filter H.sigma: standard derivation of Gaussian Note that the filter support is automatically adjusted (depending on the value of SIGMA). In general, the visualization can be enabled (or disabled) by setting VIS = TRUE (or FALSE). By default, the visualization is disabled. Author: Douglas R. Lanman, Brown University, Jan. 2006.

testAngles.m

testfillif.m

tubulesGUI.m

Jacob Newman 2011 Code for the findTubules_fig figure

velocityFig.m

wekaMatlab.m

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Boings

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\ExternalTools

check_menu_bar.m

VALUE = CHECK_MENU_BAR CHECK_MENU_BAR returns true if the integrated menu bar is DISABLED through a JAVA.OPTS file with "-Dapple.laf.useScreenMenuBar=false".

cvt_iterate.m

CVT_ITERATE takes one step of the CVT iteration. Discussion: The routine is given a set of points, called "generators", which define a tessellation of the region into Voronoi cells. Each point defines a cell. Each cell, in turn, has a centroid, but it is unlikely that the centroid and the generator coincide. Each time this CVT iteration is carried out, an attempt is made to modify the generators in such a way that they are closer and closer to being the centroids of the Voronoi cells they generate. A large number of sample points are generated, and the nearest generator is determined. A count is kept of how many points were nearest to each generator. Once the sampling is completed, the location of all the generators is adjusted. This step should decrease the discrepancy between the generators and the centroids. The centroidal Voronoi tessellation minimizes the "energy", defined to be the integral, over the region, of the square of the distance between each point in the region and its nearest generator. The sampling technique supplies a discrete estimate of this energy. Modified: 19 November 2004 Author: John Burkardt Reference: Qiang Du, Vance Faber, and Max Gunzburger, Centroidal Voronoi Tessellations: Applications and Algorithms, SIAM Review, Volume 41, 1999, pages 637-676. Parameters: Input, integer DIM_NUM, the spatial dimension. Input, integer N, the number of Voronoi cells. Input, integer BATCH, sets the maximum number of sample points generated at one time. It is inefficient to generate the sample points 1 at a time, but memory intensive to generate them all at once. You might set BATCH to min ( SAMPLE_PER_GEN*N, 10000 ), for instance. BATCH must be at least 1. Input, integer SAMPLE, specifies how the sampling is done. -1, 'RAND', using MATLAB's RAND function; 0, 'UNIFORM', using a simple uniform RNG; 1, 'HALTON', from a Halton sequence; 2, 'GRID', points from a grid; 3, 'USER', refers to the USER routine; Input, logical INITIALIZE, is TRUE if the SEED must be reset to SEED_INIT before computation. Also, the pseudorandom process may need to be reinitialized. Input, integer SAMPLE_PER_GEN, the number of sample points per generator. Input, integer SEED, the random number seed. Input, real R(DIM_NUM,N), the Voronoi cell generators. Input, real AMOUNT, the proportion of distance towards the centroid to move. 0 = no movement, 1 = original algorithm. Added by RK. Input, string USERTYPE, and all subsequent arguments, extra information to be supplied to user() (only used if SAMPLE==3). Defaults to the empty string and no further arguments. Added by RK 2006 Oct 02. Output, real R(DIM_NUM,N), the updated Voronoi cell generators. Output, integer SEED, the updated random number seed. Output, real IT_DIFF, the L2 norm of the difference between the iterates. Output, real ENERGY, the discrete "energy", divided by the number of sample points. Output, real COUNT(N), the number of points in each cell. Output, real CELLAXIS(N,DIM_NUM), the longest axis of each Voronoi cell. Output, real CENTROID(N,DIM_NUM), the centroid of each Voronoi cell. Output, real CELLEIGS(N,2), the maximum and minimum eigenvalues of the covariance matrix of each Voronoi cell. Output, real CELLCOV(N,DIM_NUM,DIM_NUM), the covariance matrix of each Voronoi cell. (Not currently computed.)

cvt_sample.m

CVT_SAMPLE returns sample points. Discussion: N sample points are to be taken from the unit box of dimension DIM_NUM. These sample points are usually created by a pseudorandom process for which the points are essentially indexed by a quantity called SEED. To get N sample points, we generate values with indices SEED through SEED+N-1. It may not be practical to generate all the sample points in a single call. For that reason, the routine allows the user to request a total of N points, but to require that only N_NOW be generated now (on this call). Modified: 23 June 2005 Author: John Burkardt Parameters: Input, integer DIM_NUM, the spatial dimension. Input, integer N, the number of sample points to be generated. Input, integer N_NOW, the number of sample points to be generated on this call. N_NOW must be at least 1. Input, integer SAMPLE, specifies how the sampling is done. -1, 'RAND', using MATLAB RAND function; 0, 'UNIFORM', using a simple uniform RNG; 1, 'HALTON', from a Halton sequence; 2, 'GRID', points from a grid; 3, 'USER', refer to USER routine. Input, logical INITIALIZE, is TRUE if the pseudorandom process should be reinitialized. Input, integer SEED, the random number seed. Input, struct USERDATA, extra information to be supplied to user() (only used if SAMPLE==3). Defaults to the empty structure. Added by RK 2006 Oct 02. Output, real R(DIM_NUM,N_NOW), the initial value for the generators. Output, integer SEED, the updated random number seed.

find_closest.m

FIND_CLOSEST finds the nearest R point to each S point. Discussion: This routine finds the closest Voronoi cell generator by checking every one. For problems with many cells, this process can take the bulk of the CPU time. Other approaches, which group the cell generators into bins, can run faster by a large factor. Modified: 22 October 2004 Author: John Burkardt Parameters: Input, integer DIM_NUM, the spatial dimension. Input, integer N, the number of cell generators. Input, integer SAMPLE_NUM, the number of sample points. Input, real S(DIM_NUM,SAMPLE_NUM), the points to be checked. Input, real R(DIM_NUM,N), the cell generators. Input, real W(N), weights associated with the cell generators. Output, integer NEAREST(SAMPLE_NUM), the index of the nearest cell generators.

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\ExternalTools\nearestneighbour

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\ExternalTools\nearestneighbour\demo

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\ExternalTools\nearestneighbour\demo\html

nndemo.m

NEARESTNEIGHBOUR Demonstration This (publishable) script |nndemo.m| demonstrates the features of the nearestneighbour function. Example: Open this file in an editor (in Matlab 7+) and press publish to generate the html document

Published output in the Help browser showdemo nndemo

timingtest.m

TIMINGTEST Works out the average cputime required to run nearestneighbour This is a support function for nndemo.m T = TIMINGTEST(P, X, MODE) Runs NEARESTNEIGHBOUR(P, X, 'DelaunayMode', MODE) for at least one second, and returns the average cputime for a single execution Example % A set of points X = rand(2, 1000) % A set of points to find the neighbours of P = rand(2, 100) % Compute the time to run with DelaunayMode 'on' timingtest(P, X, 'on')

nearestneighbour.m

NEARESTNEIGHBOUR find nearest neighbours IDX = NEARESTNEIGHBOUR(X) finds the nearest neighbour by Euclidean distance to each point (column) in X from X. X is a matrix with points as columns. IDX is a vector of indices into X, such that X(:, IDX) are the nearest neighbours to X. e.g. the nearest neighbour to X(:, 2) is X(:, IDX(2)) IDX = NEARESTNEIGHBOUR(P, X) finds the nearest neighbour by Euclidean distance to each point in P from X. P and X are both matrices with the same number of rows, and points are the columns of the matrices. Output is a vector of indices into X such that X(:, IDX) are the nearest neighbours to P IDX = NEARESTNEIGHBOUR(I, X) where I is a logical vector or vector of indices, and X has at least two rows, finds the nearest neighbour in X to each of the points X(:, I). I must be a row vector to distinguish it from a single point. If X has only one row, the first input is treated as a set of 1D points rather than a vector of indices IDX = NEARESTNEIGHBOUR(..., Property, Value) Calls NEARESTNEIGHBOUR with the indicated parameters set. Property names can be supplied as just the first letters of the property name if this is unambiguous, e.g. NEARESTNEIGHBOUR(..., 'num', 5) is equivalent to NEARESTNEIGHBOUR(..., 'NumberOfNeighbours', 5). Properties are case insensitive, and are as follows: Property: Value: --------- ------ NumberOfNeighbours natural number, default 1 NEARESTNEIGHBOUR(..., 'NumberOfNeighbours', K) finds the closest K points in ascending order to each point, rather than the closest point. If Radius is specified and there are not sufficient numbers, fewer than K neighbours may be returned Radius positive, default +inf NEARESTNEIGHBOUR(..., 'Radius', R) finds neighbours within radius R. If NumberOfNeighbours is not set, it will find all neighbours within R, otherwise it will find at most NumberOfNeighbours. The IDX matrix is padded with zeros if not all points have the same number of neighbours returned. Note that specifying a radius means that the Delaunay method will not be used. DelaunayMode {'on', 'off', |'auto'|} DelaunayMode being set to 'on' means NEARESTNEIGHBOUR uses the a Delaunay triangulation with dsearchn to find the points, if possible. Setting it to 'auto' means NEARESTNEIGHBOUR decides whether to use the triangulation, based on efficiency. Note that the Delaunay triangulation will not be used if a radius is specified. Triangulation Valid triangulation produced by delaunay or delaunayn If a triangulation is supplied, NEARESTNEIGHBOUR will attempt to use it (in conjunction with dsearchn) to find the neighbours. [IDX, TRI] = NEARESTNEIGHBOUR( ... ) If the Delaunay Triangulation is used, TRI is the triangulation of X'. Otherwise, TRI is an empty matrix Example: % Find the nearest neighbour in X to each column of X x = rand(2, 10); idx = nearestneighbour(x); % Find the nearest neighbours to each point in p p = rand(2, 5); x = rand(2, 20); idx = nearestneighbour(p, x) % Find the five nearest neighbours to points x(:, [1 6 20]) in x x = rand(4, 1000) idx = nearestneighbour([1 6 20], x, 'NumberOfNeighbours', 5) % Find all neighbours within radius of 0.1 of the points in p p = rand(2, 10); x = rand(2, 100); idx = nearestneighbour(p, x, 'r', 0.1) % Find at most 10 nearest neighbours to point p from x within a % radius of 0.2 p = rand(1, 2); x = rand(2, 30); idx = nearestneighbour(p, x, 'n', 10, 'r', 0.2) See also DELAUNAYN, DSEARCHN, TSEARCH

select3d.m

SELECT3D(H) Determines the selected point in 3-D data space. P = SELECT3D determines the point, P, in data space corresponding to the current selection position. P is a point on the first patch or surface face intersected along the selection ray. If no face is encountered along the selection ray, P returns empty. P = SELECT3D(H) constrains selection to graphics handle H and, if applicable, any of its children. H can be a figure, axes, patch, or surface object. [P V] = SELECT3D(...), V is the closest face or line vertex selected based on the figure's current object. [P V VI] = SELECT3D(...), VI is the index into the object's x,y,zdata properties corresponding to V, the closest face vertex selected. [P V VI FACEV] = SELECT3D(...), FACE is an array of vertices corresponding to the face polygon containing P and V. [P V VI FACEV FACEI] = SELECT3D(...), FACEI is the row index into the object's face array corresponding to FACE. For patch objects, the face array can be obtained by doing get(mypatch,'faces'). For surface objects, the face array can be obtained from the output of SURF2PATCH (see SURF2PATCH for more information). RESTRICTIONS: SELECT3D supports surface, patch, or line object primitives. For surface and patches, the algorithm assumes non-self-intersecting planar faces. For line objects, the algorithm always returns P as empty, and V will be the closest vertex relative to the selection point. Example: h = surf(peaks); zoom(10); disp('Click anywhere on the surface, then hit return') pause [p v vi face facei] = select3d; marker1 = line('xdata',p(1),'ydata',p(2),'zdata',p(3),'marker','o',... 'erasemode','xor','markerfacecolor','k'); marker2 = line('xdata',v(1),'ydata',v(2),'zdata',v(3),'marker','o',... 'erasemode','xor','markerfacecolor','k'); marker2 = line('erasemode','xor','xdata',face(1,:),'ydata',face(2,:),... 'zdata',face(3,:),'linewidth',10); disp(sprintf('\nYou clicked at\nX: %.2f\nY: %.2f\nZ: %.2f',p(1),p(2),p(3)')) disp(sprintf('\nThe nearest vertex is\nX: %.2f\nY: %.2f\nZ: %.2f',v(1),v(2),v(3)')) Version 1.3 11-11-04 Copyright Joe Conti 2004 Send comments to jconti@mathworks.com See also GINPUT, GCO.

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\ExternalTools\uiinspect

uiinspect.m

uiinspect Inspect an object handle (Java/COM/HG) and display its methods/props/callbacks in a unified window Syntax: hFig = uiinspect(obj, hFig) % hFig input argument is optional Description: UIINSPECT(OBJ) inspects an object handle (e.g., Java, COM, Handle Graphics, Matlab class etc.) and displays inspection results in a Matlab figure window with all the relevant object methods (as can be displayed via Matlab's methodsview function), properties (as can be displayed via Matlab's inspect function), static fields and callbacks. UIINSPECT also displays properties that are not normally displayed with Matlab's inspect function. Property meta-data such as type, accessibility, visibility and default value are also displayed (where available). If the inspected object is an HG handle, then a component tree is displayed instead of the methods pane (see attached animated screenshot). Unlike Matlab's inspect function, multiple UIINSPECT windows can be opened simultaneously. Object properties and callbacks may be modified interactively within the UIINSPECT window. UIINSPECT(OBJ) reuses an already-displayed UIINSPECT window if its title is the same (i.e., same object or class); otherwise a new window is created. UIINPECT(OBJ,hFIG) forces using the specified hFig window handle, even if another window would otherwise have been reused/created. hFig = UIINSPECT(...) returns a handle to the UIINSPECT figure window. UIINSPECT creates a regular Matlab figure window which may be accessed via this hFig handle (unlike Matlab's methodsview function which opens a Java frame that is not easily accessible from Matlab). Examples: hFig = uiinspect(0); % root (desktop) hFig = uiinspect(handle(0)); % root handle hFig = uiinspect(gcf); % current figure uiinspect(get(gcf,'JavaFrame')); % current figure's Java Frame uiinspect(classhandle(handle(gcf))); % a schema.class object uiinspect(findprop(handle(gcf),'MenuBar')); % a schema.prop object uiinspect('java.lang.String'); % a Java class name uiinspect(java.lang.String('yes')); % a Java object uiinspect(actxserver('Excel.Application')); % a COM object uiinspect(Employee) % a Matlab class object uiinspect(?handle) % a Matlab metaclass object uiinspect('meta.class') % a Matlab class name uiinspect(System.Diagnostics.Process.GetCurrentProcess) % a .Net object Known issues/limitations: - Fix: some fields generate a Java Exception, or a Matlab warning - other future enhancements may be found in the TODO list below Warning: This code heavily relies on undocumented and unsupported Matlab functionality. It works on Matlab 7+, but use at your own risk! Bugs and suggestions: Please send to Yair Altman (altmany at gmail dot com) Change log: 2011-03-03: Fixed several issues in the Value field of the "Other properties" table 2011-02-28: Removed R2010b warning messages; minor fix for Dot-Net classes 2010-11-02: Minor fixes for callbacks table; fixed online docpage for Swing classes 2010-11-01: Major fix for pre-R2010 compatibility 2010-10-20: Minor fix suggested by Andrew Stamps; added automatic callbacks grouping 2010-06-13: Fixed download (m-file => zip-file) 2010-06-11: Displayed class modifiers; improved performance; removed empty panels by default; fixed warning msgs when sorting props table; fixes for R2010b 2010-03-18: Minor fix in copy-handle-value-to-clipboard (in tree context-menu) 2010-03-17: Fixes for R2010a 2010-01-16: Fixed a few bugs in properties meta-info of Matlab classes 2009-10-23: Added CaretPositionChanged & InputMethodTextChanged to list of standard callbacks; minor fix to requesting focus of Java handles; minor fix to version-check display 2009-05-22: Added support for Matlab classes (helped by Darik Gamble); improved display for classname input 2009-05-20: Fixed methods info gathering for some handles 2009-05-19: Improved information display for HG handles; added HG-handle screenshot to animated gif (added to COM, Java screenshots); enabled reuse of uiinspect window 2009-05-04: Fixed setting callbacks on non-handle('CallbackProperties')ed Java objects; fixed input param edge-case; hyperlinked the className to Sun's Javadocs where relevant; auto-checked newer version; removed main menu 2009-04-16: Fixed occasional endless loop upon callback update error 2009-04-01: Fixed case of no methods (e.g., uimenus); fixed superclass/interfaces of classname input; auto-hide callbacks pane if no CBs are available 2009-03-30: Added Extra method details checkbox (default=off); auto-hide inspectable checkbox if irrelevant; auto-sort methods by args list; hyperlinked classes; fixed title for classname inputs 2009-03-14: Fixed string property value displayed; fixed display of Java classes added to the dynamic classpath; fixed display of classname static fields value; updated list of standard callbacks 2009-03-05: Fixed single property edge-case; fixed prop name case sensitivity problem; fixed properties tooltip; accept class names; added display of class interfaces & static fields 2008-01-25: Fixes for many edge-cases 2007-12-08: First version posted on <a href="http://www.mathworks.com/matlabcentral/fileexchange/loadAuthor.do?objectType=author&mfx=1&objectId=1096533#">MathWorks File Exchange</a> See also: ishandle, iscom, inspect, methodsview, FindJObj (on the File Exchange)

user.m

USER samples points in a user-specified region with given density. Discussion: This routine can be used to * specify an interesting initial configuration for the data, by specifing that USER be used for initialization (INIT = 3); * specify the shape of the computational region, by specifying that sample points are to be generated by this routine, (SAMPLE = 3) and then returning sample points uniformly at random. * specify the distribution or density function, by specifying that sample points are to be generated by this routine, (SAMPLE = 3 ) and then returning sample points according to a given probability density function. Author: John Burkardt Modified: 23 June 2005 Parameters: Input, integer DIM_NUM, the spatial dimension. Input, integer N, the number of sample points desired. Input, integer SEED, a seed for the random number generator. Input, string USERTYPE, specifying what sort of user data are supplied. Input, struct USERDATA, user data. Output, real R(DIM_NUM,N), a set of N sample values. Output, integer SEED, the updated seed.

GFtbox.m

GFTBOX M-file for GFtbox.fig GFTBOX, by itself, creates a new GFTBOX or raises the existing singleton*. H = GFTBOX returns the handle to a new GFTBOX or the handle to the existing singleton*. GFTBOX('CALLBACK',hObject,eventData,handles,...) calls the local function named CALLBACK in GFTBOX.M with the given input arguments. GFTBOX('Property','Value',...) creates a new GFTBOX or raises the existing singleton*. Starting from the left, property value pairs are applied to the GUI before GFtbox_OpeningFunction gets called. An unrecognized property name or invalid value makes property application stop. All inputs are passed to GFtbox_OpeningFcn via varargin. *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one instance to run (singleton)". See also: GUIDE, GUIDATA, GUIHANDLES

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Help

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\IFtemplates

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Icons

InitGFtboxPath.m

InitGFtboxPath() Call this if you have never run GFtbox before. It will add all of the GFtbox directories to your command path. You must be in the main GFtbox directory when you give this command. This command only affects the path for the current Matlab session. If you want to have the GFtbox directories on the command path permanently, then use the SAVEPATH command to save the current path. This will avoid having to use the INITGFTBOX command again. It is harmless, but unnecessary, to give this command if the GFtbox directories are already on your command path.

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Models

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Models\Published

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Models\Published\Green-etal-2010

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Models\Published\Green-etal-2010\GPT_Snapdragon_2010_Green_et_al

gpt_snapdragon_2010_green_et_al.m

m = gpt_snapdragon_2010_green_et_al( m ) Morphogen interaction function. Written at 2011-04-29 13:52:19. GFtbox revision 3502, 2011-04-15 16:29:35.777989. Model last saved to SVN as revision 1779, 2009-10-02 11:46:19.097914.

gpt_snapdragon_2010_green_et_alBAK.m

m = gpt_snapdragon_2010_green_et_al( m ) Morphogen interaction function. Written at 2011-04-29 13:52:19. GFtbox revision 3502, 2011-04-15 16:29:35.777989. Model last saved to SVN as revision 1779, 2009-10-02 11:46:19.097914.

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Models\Published\Green-etal-2010\GPT_Snapdragon_2010_Green_et_al\snapshots

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Models\Published\Kennaway-etal-2011

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Models\Published\Kennaway-etal-2011\GPT_CASES_FGHI

gpt_cases_fghi.m

m = gpt_cases_fghi( m ) Morphogen interaction function. Written at 2011-04-19 15:43:11. GFtbox revision 3499, 2011-04-15 16:29:35.777989.

gpt_cases_fghiBAK.m

m = gpt_cases_fghi( m ) Morphogen interaction function. Written at 2011-04-19 15:43:11. GFtbox revision 3499, 2011-04-15 16:29:35.777989.

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Models\Published\Kennaway-etal-2011\GPT_CASES_FGHI\snapshots

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Models\Published\Kennaway-etal-2011\GPT_CASES_JKLM

gpt_cases_jklm.m

m = gpt_cases_jklm( m ) Morphogen interaction function. Written at 2011-04-29 15:09:39. GFtbox revision 3518, 2011-04-29 13:30:15.502745.

gpt_cases_jklmBAK.m

m = gpt_cases_jklm( m ) Morphogen interaction function. Written at 2011-04-29 15:09:39. GFtbox revision 3518, 2011-04-29 13:30:15.502745.

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Models\Published\Kennaway-etal-2011\GPT_CASES_JKLM\snapshots

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Models\Published\Kennaway-etal-2011\GPT_CASES_NOPQ

gpt_cases_nopq.m

m = gpt_cases_nopq( m ) Morphogen interaction function. Written at 2011-04-29 15:17:15. GFtbox revision 3518, 2011-04-29 13:30:15.502745.

gpt_cases_nopqBAK.m

m = gpt_cases_nopq( m ) Morphogen interaction function. Written at 2011-04-29 15:17:15. GFtbox revision 3518, 2011-04-29 13:30:15.502745.

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Models\Published\Kennaway-etal-2011\GPT_CASES_NOPQ\snapshots

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Models\Published\Kennaway-etal-2011\GPT_CASE_A

gpt_case_a.m

m = gpt_case_a( m ) Morphogen interaction function. Written at 2011-04-29 14:44:45. GFtbox revision 3502, 2011-04-15 16:29:35.777989.

gpt_case_aBAK.m

m = gpt_case_a( m ) Morphogen interaction function. Written at 2011-04-29 14:44:45. GFtbox revision 3502, 2011-04-15 16:29:35.777989.

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Models\Published\Kennaway-etal-2011\GPT_CASE_A\snapshots

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Models\Published\Kennaway-etal-2011\GPT_CASE_B

gpt_case_b.m

m = gpt_case_b( m ) Morphogen interaction function. Written at 2011-04-29 14:45:32. GFtbox revision 3502, 2011-04-15 16:29:35.777989.

gpt_case_bBAK.m

m = gpt_case_b( m ) Morphogen interaction function. Written at 2011-04-29 14:45:32. GFtbox revision 3502, 2011-04-15 16:29:35.777989.

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Models\Published\Kennaway-etal-2011\GPT_CASE_B\snapshots

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Models\Published\Kennaway-etal-2011\GPT_CASE_C

gpt_case_c.m

m = gpt_case_c( m ) Morphogen interaction function. Written at 2011-04-29 14:57:50. GFtbox revision 3518, 2011-04-29 13:30:15.502745.

gpt_case_cBAK.m

m = gpt_case_c( m ) Morphogen interaction function. Written at 2011-04-29 14:57:50. GFtbox revision 3518, 2011-04-29 13:30:15.502745.

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Models\Published\Kennaway-etal-2011\GPT_CASE_C\snapshots

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Models\Published\Kennaway-etal-2011\GPT_CASE_E

gpt_case_e.m

m = gpt_case_e( m ) Morphogen interaction function. Written at 2011-04-29 14:59:28. GFtbox revision 3518, 2011-04-29 13:30:15.502745.

gpt_case_eBAK.m

m = gpt_case_e( m ) Morphogen interaction function. Written at 2011-04-29 14:59:28. GFtbox revision 3518, 2011-04-29 13:30:15.502745.

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Models\Published\Kennaway-etal-2011\GPT_CASE_E\snapshots

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Models\Published\Kennaway-etal-2011\GPT_CASE_RST

gpt_case_rst.m

m = gpt_case_rst( m ) Morphogen interaction function. Written at 2011-04-28 21:20:35. GFtbox revision 3517, 2011-04-27 08:05:05.157080.

gpt_case_rstBAK.m

m = gpt_case_rst( m ) Morphogen interaction function. Written at 2011-04-28 21:20:35. GFtbox revision 3517, 2011-04-27 08:05:05.157080.

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Models\Published\Kennaway-etal-2011\GPT_CASE_RST\snapshots

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Models\Published\Kennaway-etal-2011\GPT_InvagEmbryo

gpt_invagembryo.m

m = gpt_invagembryo( m ) Morphogen interaction function. Written at 2011-04-28 13:51:14. GFtbox revision 3502, 2011-04-15 16:29:35.777989.

gpt_invagembryoBAK.m

m = gpt_invagembryo( m ) Morphogen interaction function. Written at 2011-04-28 13:51:14. GFtbox revision 3502, 2011-04-15 16:29:35.777989.

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Models\Published\Kennaway-etal-2011\GPT_InvagEmbryo\snapshots

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Models\Tutorial

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Utils

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Utils\Colour

brighten.m

combinedOpacity.m

darken.m

desaturate.m

nzimage.m

nzimage( A, blockx, blocky, f ) Produce a greyscale image showing the non-zero elements of A. Each pixel of im corresponds to a blockx*blocky tile of A, and its greyscale level represents the proportion of non-zero elements in that tile. f is a figure to plot into.

oppositeColor.m

c = oppositeColor( c, mode ) Compute a modified version of the colour complement of c (an N*3 matrix of RGB values). If 'mode' is 'redblue' (the default) then red and blue are opposites, as are green and magenta. If 'mode is 'redgreen', red and green are opposites, as are orange and blue, and yellow and magenta. Otherwise (the default), the standard inversion of hue is performed, i.e. red <-> cyan, green <-> magenta, and blue <-> yellow.

randcolornear.m

crange = randcolornear( numcolors, color, colorvariation ) Generate NUMCOLORS random colors that are "near" the given COLOR. If COLORVARIATION is 0, they will be equal to COLOR, while of COLORVARIATION is 1, they will be scattered over the whole colour space.

redBlueComplement.m

c = redBlueComplement( c ) Compute a modified version of the colour complement of c (an N*3 matrix of RGB values). If 'mode' is 'redblue' (the default) then red and blue are opposites, as are green and magenta. If 'mode is 'redgreen', red and green are opposites, as are orange and blue, and yellow and magenta. Otherwise (the default), the standard inversion of hue is performed, i.e. red <-> cyan, green <-> magenta, and blue <-> yellow.

saturate.m

c1 = saturate( v, c ) c is an RGB colour. v is a vector of N reals. The results is an N*3 array of N colours, being copies of c saturated by each element of v. Where v is 0, the colour is [1,1,1] (white), and where v is 1, the colour is c, with linear interpolation between. There is no check that v or c are within the range 0..1

translateToColors.m

c = translateToColors( v, crange, cmap ) Given a vector of values v, and range vrange = [lo,hi], and a list of colours, map every element of v to the corresponding colour. v is N*1, and c is N*3.

unspreadHue.m

h = unspreadHue( h, alph ) The inverse of h = spreadHue( h, alph )

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Utils\Geometry

aabbox.m

ab = aabbox( pts ) Return the axis-aligned bounding box of a set of points. pts is an N*K array of N K-dimensional points. The result is a 2*K array: a(1,:) is the minimum values of the coordinates and ab(2,:) the maximum values.

aabboxsize.m

absize = aabboxsize( pts ) Return the size of the axis-aligned bounding box of a set of points. pts is an N*K array of N K-dimensional points. The result is a 2*K array: a(1,:) is the minimum values of the coordinates and ab(2,:) the maximum values.

abutRect.m

r1 = abutRect( r, positioning, distance, thickness, len ) Create a rectangle r1 abutting r on the outside according to the other parameters. POSITIONING is a two-character string, with the second character defaulting to 'c'. The first is 'n', 's', 'w', or 'e' and specifies which side the new rectangle abuts the old. The second is 'n', 's', 'w', 'e', or 'c', and indicates which end of the abutted side r1 lines up with. For example, 'nw' abuts the new rectangle on the top edge of the old one, flush with its left-hand edge. DISTANCE is the space between r and r1. THICKNESS is the width of r1 in the direction in which it abuts r, and LEN is the width in the transverse direction. LEN can be omitted and defaults to the corresponding dimension of r, in which case the result is independent of the second character of POSITIONING.

alignFrames.m

perm = alignFrames( F1, F2 ) F1 and F2 are orthonormal frames of column vectors. The result is the permutation that makes F2(:,perm) most closely approximate F1. It first determines the column of F2 that F1(:,3) is closest to, then decides the order of the other two.

altitude.m

d = altitude( vxs, p ) Find the altitude of a point from a line segment. VXS is a 3*2 vector containing the ends of the segment.

altitudeTriangle.m

[a,alt,foot] = altitudeTriangle( vxs ) Compute the altitude of the triangle VXS, whose rows are the vertexes, through the first vertex. ALT is the altitude vector from the base towards that vertex, FOOT is the foot of the altitude, and A is the proportion into which it divides the base: FOOT = (1-A)*V(2,:) + A*V(3,:).

altitudeTriangle2D.m

[a,alt,foot] = altitudeTriangle2D( vxs ) Compute the altitude of the triangle VXS, whose rows are the vertexes, through the first vertex. ALT is the altitude vector from the base towards that vertex, FOOT is the foot of the altitude, and A is the proportion into which it divides the base: FOOT = (1-A)*V(2,:) + A*V(3,:). POSITIVE is true if the triangle is right-handed.

altitudeVector.m

a = altitudeVector( vxs, p ) Find the altitude vector from a line segment to a point. VXS is a 3*2 vector containing the ends of the segment.

azel2dir.m

d = azel2dir( az, el ) Convert azimuth and elevation, in degrees, to a unit vector. Azimuth and elevation have the meanings given to them by the Matlab function [az,el] = view(). That is, when the azimuth of the view is zero, the positive Y axis points into the screen. When the azimuth is 90, the negative X axis points into the screen. When elevation is zero, the positive Z axis points up the screen. When elevation is positive, the positive Z axis points upwards and out from the screen. When elevation is 90, the positive z axis points directly out of the screen. See also: dir2azel.

baryCoords.m

bc = baryCoords( vxs, n, v ) Calculate the barycentric coordinates of point v with respect to triangle vxs, in three dimensions. vxs contains the three vertexes of the triangle as rows. n is a normal vector to the triangle. The component of v perpendicular to the plane of the triangle is ignored. If n is the empty array, the normal vector will be computed. If supplied, the normal vector may be of any non-zero length. n and v must be row vectors, and the result is a 3-element row vector. v can also be a matrix of row vectors; the result will then be a matrix of 3-element row vectors. This procedure works in 3 or more dimensions. For 2 dimensions, use baryCoordsPlanar( vxs, v ).

baryCoords2.m

bc2 = baryCoords2( v1, v2, v ) Set bc2 to [a,b], where a+b = 1 and v = a*v1 + b*v2. v1, v2, and v must be row vectors, and the result is a 2-element row vector. v can be a matrix of row vectors; the result will then be a matrix of 2-element row vectors. v1 and v2 must be distinct. A divide by zero error will result if not. v is assumed to be collinear with v1 and v2, but no check is made and no errors are produced. The resulting values a and b will always satisfy a+b = 1. If v is not collinear with v1 and v2, the point a*v1 + b*v2 will be the closest point to v on the line through v1 and v2. This procedure works in any number of dimensions.

baryCoordsPlanar.m

bc = baryCoords( vxs, v ) Calculate the barycentric coordinates of point v with respect to triangle vxs, in two dimensions. vxs contains the three vertexes of the triangle as rows. v must be a row vector, and the result is a 3-element row vector. v can also be a matrix of row vectors; the result will then be a matrix of 3-element row vectors.

baryCoordsPlane.m

bc = baryCoords( vxs, v ) Calculate the barycentric coordinates of point v with respect to triangle vxs, in two dimensions. vxs contains the three vertexes of the triangle as rows. The component of v perpendicular to the plane of the triangle is ignored. If n is the empty array, the normal vector will be computed. If supplied, the normal vector may be of any non-zero length. n and v must be row vectors, and the result is a 3-element row vector. v can also be a matrix of row vectors; the result will then be a matrix of 3-element row vectors. This procedure works in 3 or more dimensions. For 2 dimensions, use baryCoordsPlanar( vxs, v ).

baryToEdge.m

bc = baryToEdge( bc ) Move the barycentric coordinate to the nearest edge, by replacing the component with minimum absolute value by zero and renormalising.

baryToGlobalCoords.m

gc = baryToGlobalCoords( cells, bcs, nodes, triangles ) Convert barycentric coordinates to global coordinates. NODES is an N*D matrix containing the global coordinates of a set of N points in D dimensions. TRIANGLES is an M*3 matrix containing the indexes of triples of nodes. CELLS is a C*1 or 1*C vector of indexes of triangles. BCS is a C*3 array of barycentric coordinates. bcs(i,:) is the barycentric coordinates of a point in the triangle cells(i). The result is a C*D array of global coordinates of all the given points. See also GLOBALTOBARYCOORDS. Timing tests: 3.2 microseconds per point, for 100 points. 4 microseconds per point for 10 points. 20 microseconds per point for 1 point.

baryVector2.m

bc = baryVector2( vxs, v ) Express the vector v in terms of the three 2D row vectors in vxs, as a linear combination adding to zero (not one, as for barycentric coordinates of points).

baryVector3.m

bc = baryVector3( vxs, v ) Express the vector v in terms of the three 3D row vectors in vxs, as a linear combination adding to zero (not one, as for barycentric coordinates of points).

bc2vec.m

v = bc2vec( bc, vxs ) Convert a vector described in barycentric coordinates with respect to the triangle whose vertexes are the rows of the 3*3 matrix vxs, to a vector in global coordinates.

bcgradendpoints.m

pts = bcgradendpoints( v, bc, vxs ) Given v, a vector of the three values of some scalar at the vertexes vxs of a triangle, and bc, the bcs of a point in the triangle. Compute the bcs of the intersection of the line parallel to the gradient vector of v through the point bc with the three sides of the triangle.

bcisoendpoints.m

pts = bcisoendpoints( v, bc ) Given v, a vector of the three values of some scalar at the vertexes of a triangle, and bc, the bcs of a point in the triangle. Consider v as defining a linear function on the triangle. Compute the bcs of the intersection of the isoline of this function through the point bc with the three sides of the triangle.

bestFitEllipsoid.m

principalAxes = bestFitEllipsoid( vxs ) Find the best-fit ellipsoid containing the vertexes VXS, an N*D array where D is the number of dimensions. The result is returned as a matrix of column vectors, being the principal axes of the ellipsoid.

bestFitPlane.m

[c,p,flatness] = bestFitPlane( vxs, weights ) Find the best-fit plane through the vertexes VXS, an N*D array where D is the number of dimensions. The result is returned in the form of C, the centroid of the vertexes, and P, the unit normal vector to the plane through C, both as row vectors. FLATNESS is a measure of how flat the set of points is, and is the ratio of the smallest to second smallest eigenvalue of the covariance matrix. Zero means very flat, 1 means not at all flat. WEIGHTS, if supplied, weights the vertices.

bestRotation.m

r = bestRotation( x, u ) Find the linear transformation of x that best approximates the displacements u, and return its rotational component. The method used here is only valid for small rotations.

cameraFrame.m

[cameraLook, cameraUp, cameraRight] = cameraFrame( ... CameraPosition, CameraTarget, CameraUp ) Construct the camera orthonormal frame of reference. The arguments are fields of an axes object. If called as [cameraLook, cameraUp, cameraRight] = cameraFrame( axes ), the position, target, and up vectors are taken from the axes object. Calling it with no arguments is equivalent to cameraFrame( gca ). Note that cameraUp will not necessarily coincide with CameraUp, since cameraUp is constrained to be orthogonal to the look direction, while CameraUp is not. cameraFrame can be called with a single argument, which is either a struct containing the three camera parameters, or an axes handle. In the latter case the camera parameters will be taken from the axes. If omitted, it defaults to the current axes.

cameraParamsFromOurViewParams.m

camParams = cameraParamsFromOurViewParams( viewParams ) Convert our camera parameters to Matlab's. Matlab's camera parameters are: CameraViewAngle CameraTarget CameraPosition CameraUpVector Our camera parameters are: fov (field of view) azimuth elevation roll pan (two components) targetdistance See also: ourViewParamsFromCameraParams.

centroids.m

c = centroids( nodes, tricellvxs, triangles ) Find the centroids of the triangles.

circle.m

[xx,yy,zz] = circle( varargin ) Similar to SPHERE, but draws a unit circle in the XY plane, or returns the [xx,yy,zz] data for plotting with SURF. The zz result is always a zero matrix. See also: SPHERE.

circlepoints.m

clipAngleDeg.m

cloudAxes.m

a = cloudAxes( p ) Determine the principal axes of the cloud of points p. p is an N*D matrix, where there are N points in D dimensional space.

clump7.m

convexify.m

vxs = convexify( vxs ) vxs is an N*2 array of points in the plane defining a polygon. They are modified to force the polygon to be convex.

crosses3.m

crossproc1.m

a = crossproc1( b, c ) Equivalent to cross(b,c,1) where b and c are two-dimensional 3*N matrices. See also DOTPROC1, DOTPROC2, CROSSPROC2.

crossproc2.m

a = crossproc2( b, c ) Equivalent to cross(b,c,2) where b and c are two-dimensional 3*N matrices. See also DOTPROC1, DOTPROC2, CROSSPROC2.

decomposedTriangleTransform.m

[th,X,Y,th2] = decomposedTriangleTransform( vxs, wxs ) vxs and wxs are two planar triangles given as 3*2 matrices. There is a unique linear transformation which, combined with a suitable translation (which we are not interested in), maps vxs to wxs. This routine calculates a description of that linear transformation in the form of a rotation by angle TH, followed by growth in the x and y directions of X and Y respectively, followed by rotation by angle TH2. The growth tensor which maps vxs to the same shape as wxs is then [X 0;0 Y]*rotMatrix(th).

diffRect.m

r = diffRect( r1, r2 ) r1 and r2 are rectangles represented as [ xlo, xhi, ylo, yhi ]. r is set to an array of disjoint rectangles whose union is r1 - r2.

dir2azel.m

[ az, el ] = dir2azel( d ) Convert a unit direction vector to azimuth and elevation in degrees. Azimuth and elevation have the meanings given to them by the Matlab function [az,el] = view(). That is, when the azimuth of the view is zero, the positive Y axis points into the screen. When the azimuth is 90, the negative X axis points into the screen. When elevation is zero, the positive Z axis points up the screen. When elevation is positive, the positive Z axis points upwards and out from the screen. When elevation is 90, the positive z axis points directly out of the screen. See also: azel2dir.

dotproc1.m

d = dotproc1( v1, v2 ) Equivalent to dot(v1,v2,1) where v1 and v2 are two-dimensional matrices of the same size. See also DOTPROC2, CROSSPROC1, CROSSPROC2.

dotproc2.m

d = dotproc1( v1, v2 ) Equivalent to dot(v1,v2,2) where v1 and v2 are two-dimensional matrices of the same size. See also DOTPROC1, CROSSPROC1, CROSSPROC2.

drawPlane.m

h = drawPlane( ax, normal, distance, radius, alph ) In the axes AX, draw a rectangle in the plane whose unit normal vector is NORMAL, and which is a DISTANCE from the origin. The semidiameter of the rectangle is RADIUS and its alpha value is ALPH. The centre of the rectangle will be at the closest point of the plane to the origin. NORMAL must be a row vector.

drawVoronoi.m

drawVoronoi( r ) Draw the Voronoi and Delaunay diagrams of the set of points R, a 2*N array.

enclosesLine.m

encloses = enclosesLine( pts, line ) Determine whether a given polygon, defined by pts, its vertexes listed in order, encloses a line, given as a 2*3 array of two points.

eulerRotation.m

rotmatrix = eulerRotation( eulerangles, euleraxes, mode ) Calculate the rotation matrix corresponding to the given Euler angles. Any number of Euler angles can be given. The same number of axis names must also be given in the string EULERAXES, each element of which is 'X', 'Y', or 'Z' (case is ignored). Normally, the rotations are all composed in the global frame. eulerRotation( eulerangles, euleraxes, 'local' ) will compose each rotation in the frame of reference rotated by all the preceding rotations. This is equivalent to applying the rotations all in the global frame and in the reverse order. The resulting matrix is suitable for applying to column vectors: given a column vector V, the result of rotating V by the result is ROTMATRIX*V. If you require a matrix R which can be applied to a row vector V by V*R, take the transpose of ROTMATRIX.

findAltitude.m

[v,a,b] = findaltitude( v1, v2, v3 ) v is the foot of the perpendicular from v1 to the line v2 v3. v is equal to a*v2 + b*v3.

findAreaAndNormal.m

[a,n] = findAreaAndNormal( vxs ) Compute the normal vector and area of a triangle whose vertices are the rows of vxs. We do these together, since this is faster than computing them separately.

findCycle.m

cycle = findCycle( v ) v is an n*2 matrix of vertex indexes, which represents the set of edges of a polygon. cycle is a list of the vertexes in order round the polygon. Since there is no geometrical information present, it is not possible to determine whether the ordering is clockwise or anticlockwise (indeed, the polygon need not be planar). This procedure assumes the data are valid and makes no checks. perm is the permutation such that cycle = perm(v(:,1)).

findgraphpolys.m

polys = findpolys( vxs, edges ) Given a set of vertex positions and a set of edges joining them, and assuming that the whole is a planar graph, find the polygons. VXS is an N*2 aray of vertex positions in the plane. EDGES is an M*2 list of pairs of vertexes. POLYS will be a cell array of arrays of vertexes. VVXS is a list of the neighbours of each vertex, in anticlockwise order of direction, starting from -180 degrees. VEDGES is a list of the directed edges incident on each vertex, in the same order as VEDGES. If the graph is not planar, empty arrays are returned.

findperp.m

w = findperp( v ) Find a 3-element vector perpendicular to the 3-element vector v. In general the result will not be a unit vector, even if v is. v must be a row vector or N*3 array of N row vectors. w will be the same shape as v.

findtriangleareas.m

m = findtriangleareas( nodes, tricellvxs ) Calculate the area of the triangles.

findunitperp.m

w = findunitperp( v ) Find a 3-element unit vector perpendicular to the 3-element unit vector v.

fitRotation.m

[r,c,u1,resid,resid1] = fitRotation( x, u ) Given a set of points x and displacements of those points u, each an N*3 matrix, find the rotation r about centre c that best fits the displacements. u1 is set to the residual displacements, resid is set to the mean squared error of u, and resid1 to that of u1. x, u, r, and u1 are related by: for all i, u1(i,:) = u(i,:) - cross(r,x(i,:)) - c The calculation asumes that the displacements ant rotation are infinitesimal. Equivalently, if u is a matrix of velocities, r will be the angular velocity and c the linear velocity which best fit u. The method is as follows. Define: ubar = average of u xbar = average of x crosscross(a,b) for row vectors a and b = the matrix P-Q, where P is dot(a,b) times the identity, and Q is a'*b. For matrices of row vectors, it sums over all the rows. The result is a 3*3 matrix. Then the desired rotation r satisfies: (crosscross(u,x) - crosscross(ubar,xbar)) . r = cross(x,u) - N cross(xbar,ubar) and c is obtained as c = ubar - cross(r,xbar). These are the values that minimise the mean squared error.

fitToBbox.m

frameChangeMatrix.m

frameChangePoints.m

getview.m

vp = getview( theaxes ) [az,el] = getview( theaxes ) [az,el,roll] = getview( theaxes ) Get the view parameters from the axes handle. With one output, the whole view structure is returned. With two, only the azimuth and elevation are returned, and with three, roll is also returned. See also: setview.

globalToBaryCoords.m

[cells,bcs] = globalToBaryCoords( bc, nodes, triangles ) Convert global coordinates to barycentric coordinates. NODES is an N*D matrix containing the global coordinates of a set of N points in D dimensions. TRIANGLES is an M*3 matrix containing the indexes of triples of nodes. GC is a C*D array of global coordinates of a set of points. NORMALS is an M*3 matrix giving normal vectors for all the triangles. This argument can be missing or empty, in which case the normals will be computed. HINT, if supplied, is a C*1 array of triangle indexes or a C*1 cell array of arrays of triangle indexes. CELLS will be a C*1 or 1*C vector of indexes of triangles. BCS will be a C*3 array of barycentric coordinates. cells(i) is the index of the triangle that gc(i,:) lies in. bcs(i,:) is the barycentric coordinates of that point with respect to that triangle. See also BARYTOGLOBALCOORDS.

grad.m

gf = grad( vxs, f ) Given a matrix vxs whose three rows are the corners of a triangle, and a three-element row vector f giving the value of a scalar quantity at each corner, determine the gradient of f, assuming it to be parallel to the plane of the triangle. f may validly have K rows, in which case the calculation is performed for each row and the result is a K*3 matrix.

grad2.m

This is a continuous transformation of atan2 that is about twice as fast to compute. It returns values in a range from -0.5 to +0.5 varying continuously and montonically with atan2(pts).

gradOp.m

go = gradOp( vxs ) Given a matrix vxs whose three rows are the corners of a triangle, determine a 3*3 matrix go such that for any 3-element row vector f, f*go is the gradient of the linear interpolation of f over the triangle.

gradOpLinear.m

gol = gradOpLinear( vxs ) Given a matrix vxs whose three rows are the corners of a triangle, determine a 9*9 matrix go such that for any 3*3-matrix v, representing a velocity at each vertex of the triangle, we have reshape(go,[],1) = go * reshape(v,[],1).

gradT.m

gt = gradT( vxs ) Given a matrix vxs whose three rows are the corners of a triangle, calculate a tensor gt such that for any three-element row vector f defining a scalar value at each corner of the triangle, the gradient vector of f (assumed linearly interpolated over the triangle) is f * gt * vxs. gt is a 3*3 symmetric matrix whose rows and columns sum to zero.

insetRect.m

insideSurface.m

isinside = insideSurface( s, v ) Determine whether v is inside or outside the closed surface s. s is assumed to have all its faces oriented so that the right-handed normals point outwards.

interpolateAngle.m

intersectCapsule.m

intersectDepth = intersect_capsule( capsule0, capsule1 ) Determine whether two capsules intersect. A capsule is a cylinder closed with hemispherical end caps. The data structure representing a capsule is a struct with these fields: ends: a 2xN array, being the two endpoints of the cylinder in N-dimensional space. radius: the radius of the cylinder and the hemispheres. The result is the depth of intersection, positive when they intersect and negative when they do not. Mathematically, a depth of zero means that they touch, but due to rounding errors this is not a test that can be relied on, and zero should be counted either always as intersecting or always as non-intersecting.

intersectPolygons.m

p = intersectPolygons( p1, p2 ) Compute the intersection of two convex polygons. The polygons are represented as N*2 arrays containing their vertexes in anticlockwise order. The vertexes of the intersection are: (1) Every vertex of one that lies inside the other, and (2) Every intersection of any edge of one with any edge of the other. The only edges that need be tested are those from a point inside to a point outside, and between two points outside.

inv3.m

q = inv3( p ) Compute the inverse of a 3*3 matrix. If the matrix is singular, return the zero matrix and give a warning.

layOutPolygon.m

vxs = layOutPolygon( edges, angles ) Given the set of edge lengths and exterior angles of a polygon, calculate its vertexes in the plane. The first vertex is placed at the origin and the second on the positive x axis. If the exterior angles do not sum to 2pi, they will be adjusted to fit.

lineCutByPolygon.m

v = lineCutByPolygon( pv, vin, vout ) PV is a polygon represented by an N*2 array, which is the N vertexes in order round the polygon (it does not matter which way). VIN is a point known to be inside the polygon, and VOUT a point outside, represented as column vectors. The result V is a point where the line V1 V2 intersects the boundary of the polygon, represented as a column vector.

lineIntersection.m

[b,v] = lineIntersection( v1, v2, v3, v4 ) Find the intersection of the lines v1 v2 and v3 v4. The vectors must be 2-dimensional column vectors. b is true if the lines intersect, v is the intersection. v is not computed unless asked for.

lineLineDistance.m

[d,p,a,q,b] = lineLineDistance( p01, q01 ) p01 and q01 are 2*D arrays, specifying pairs of D-dimensional points. Find the closest point on each of these line segments to the other segment, and the distance between these points. The closest points are expressed both as points and as barycentric coordinates, i.e. p = a(1)*p01(1,:) + a(2)*p01(2,:) and q = b(1)*q01(1,:)+b(2)*q01(2,:). The five results are row vectors of lengths 1, D, 2, D, and 2. p01 and q01 can instead be 2*D*N arrays, and the results will be, respectively, N*1, N*D, N*2, N*D, and N*2 arrays. If N for just one of p01 or q01 is 1, it will be replicated as necessary to match the other.

lineTriangleIntersection.m

[p,pbary,v,e] = intersectLineTriangle( line, tri, insideonly ) Find the intersection of a line and a triangle in 3D. The line is represented as a 2x3 matrix consisting of two 3D points, defining the infinite line passing through them. The triangle is a 3x3 matrix whose rows are the vertexes of the triangle. The result is the intersection point, its barycentric coordinates with respect to the triangle, and the vertex and edge that the point is closest to. The point is in the interior of the triangle if the barycentric coordinates are all positive, on the interior of an edge if exactly one is zero, at a vertex if two are zero, and outside the triangle if any are negative. If the triangle or the line are degenerate, or the line lies in the plane of the triangle, then p and pbary are both returned as all zeros. Note that [0 0 0] is not a valid set of barycentric coordinates. If insideonly is true (the default is false), then if the point lies outside it will be returned as zero, with barycentric coordinates of zero. Note that due to rounding errors it is possible that a point exactly on the edge of the triangle will be detected as lying outside.

lineplaneIntersection.m

[i,r] = lineplaneIntersection( p1, p2, n, c ) Find the intersection between the line through p1 and p2, and the plane through c perpendicular to n. All vectors must be row vectors. r will be the value such that i = p1*(1-2) + p2*r.

localDirection.m

a = localDirection( vxs, v ) VXS is a matrix of 3 row vectors. V is a row vector. A will be set to a vector such that A*VXS is as close as possible to V while satisfying SUM(A) = 0. For this to be useful, V should be roughly in the plane of the three vertexes VXS. V can be an N*3 matrix of vectors, and an N*3 matrix will be returend for A.

makeSquare.m

r = makeSquare( r ) r is a 4-element array [x y w h] such as is used to represent rectangles in GUIs. This procedure trims r to be square, and centres the new square within the old rectangle.

makeframe.m

[v1,v2] = makeframe( v ) V is a unit vector. Chose unit vectors V1 and V2 such that [V V1 V2] is a right-handed coordinate system. If V is a nonzero non-unit unit vector, the resulting vectors will be mutually orthogonal, but may be of arbitrary non-zero lengths. If V is zero, V1 and V2 will be zero.

makeperp.m

v2p = makeperp( v1, v2 ) Construct the vector v2p which is orthogonal to v1 and in the same plane as v2 and v1.

maketristrip.m

Result will be a list of pairs (i,j) signifying an edge from pts1(i,:) to pts2(j,:).

matRot.m

m = matRot( rotAxis, rotAmount ) Calculate the rotation matrix that rotates about the given axis by the given amount in radians. The axis must be a unit vector. Formula cribbed from Wikipedia.

matchTriangleRots.m

[thv,thw] = matchTriangleRots( vxs, wxs ) vxs and wxs are two planar triangles given as 3*2 matrices. Calculate the direction angles thv and thw of unit vectors dv and dw, such that when the triangles are both projected onto the respective lines, their vertices lie in the same order and divide the line in the same ratio; and such that this is also true for projection onto the perpendiculars to the lines. The difference between the two angles is then the rotation that, followed by a non-isotropic expansion, maps vxw onto wxs.

meanpos.m

m = meanpos( nodes, triangles, values ) NODEs is an N*3 array, containing the vertex positions of a mesh. TRIANGLES is an M*3 array of triples of node indexes, defining the triangles of the mesh. VALUES is an N*1 array of values defined at each vertex. Consider VALUES to define the distribution of concentration os a substance over the mesh, linearly interpolated over every triangle. The result will be the centroid of that distribution.

moment2distrib.m

[mom2,centroid] = moment2distrib( nodes, tricellvxs, values, centre ) NODEs is an N*3 array, containing the vertex positions of a mesh. TRIANGLES is an M*3 array of triples of node indexes, defining the triangles of the mesh. VALUES is an N*1 array of values defined at each vertex. CENTRE is a point, by default the centroid of the distribution. Consider VALUES to define the distribution of concentration os a substance over the mesh, linearly interpolated over every triangle. Results: MOM2 will be the second moment of that distribution about the centre. CENTROID (if asked for) will be the centroid of the distribution. If CENTRE is omitted it will default to the centroid; in that case MOM2 is the variance of the distribution. TOTAL (if asked for) will be the total quantity of the distribution. See also: meanpos.

nearestNeighbours.m

r = nearestNeighbours( p1, p2 ) For each point in p1, find the point in p2 that is closest. For all i, p2(r(i),:) is the member of p2 that is closest to p1(i,:). Brute force algorithm.

nearestPointOnLine.m

a = nearestPointOnLine( vxs, p ) VXS is a 3*2 vector containing the ends of a line segment. a is set to the point on that line that is closest to p. (a is not restricted to be within the line segment.)

nearfarpoints.m

[near,far] = nearfarpoints( p, ps ) Find the nearest and farthest points in the set ps from the point p. Return their indexes. p is a row vector of length D, and ps is an N*D matrix.

normaliseAngle.m

a = normalizeAngle( a, mina, degrees, lowerClosed ) An integer multiple of one revolution is added to A as necessary to make it fall in the range [mina...mina+onerevolution]. If lowerClosed is true (the default), then the interval is [mina...mina+onerevolution), otherwise (mina...mina+onerevolution]. If degrees is true (the default), then the calculation is carried out in degrees, otherwise in radians.

normaliseBaryCoords.m

bc = normaliseBaryCoords( bc ) Force all elements of bc to be in the range 0..1 with a sum of 1. bc may be a matrix in which each row is a set of barycentric coordinates.

normaliseNumber.m

a = normaliseNumber( a, lo, hi, lowerClosed ) An integer multiple of HI-LO is added to A as necessary to make it fall in the range [LO..HI]. If lowerClosed is true (the default), then the interval is [LO..HI), otherwise (LO..HI]. LOWERCLOSED defaults to TRUE. HI defaults to LO+1. LO defaults to 0. If LO==HI, every element of A is set to LO. If LO > HI, LO and HI are swapped and LOWERCLOSED is negated.

norms.m

ns = norms( vs ) Calculate the norms of all the row vectors in vs.

normvecs.m

vs = normvecs( vs ) Transform every non-zero row of vs into a unit vector.

ourViewParamsFromCameraParams.m

viewParams = ourViewParamsFromCameraParams( camParams ) Convert Matlab's camera parameters to ours. camParams may be either an axes handle or a struct containing Matlab's camera parameters. Matlab's camera parameters are: CameraViewAngle CameraTarget CameraPosition CameraUpVector Our camera parameters are: fov (field of view) azimuth elevation roll pan (two components) targetdistance camdistance targetdistance is the distance of the target point behind the plane through the origin perpendicular to the view direction. camdistance is the distance of the camera from the target point. See also: cameraParamsFromOurViewParams.

pathViaEdge.m

v = pathViaEdge( v1, v2, e1, e2 ) Set v3 to the point on the line joining e1 and e2 which minimises the length of the path v1 v v2. All vectors must be row vectors. Error: there is a degenerate case where v1 and v2 both lie on the line from e1 to e2

perVertextoperTriangle.m

perVx = perVertextoperTriangle( tricellvxs, perVx, triangles ) Given a quantity that is defined for each vertex of a triangular mesh, calculate an equivalent quantity per triangle. The per-vertex quantity can be a vector. If m has numVx vertexes and numFEs finite elements, then perVx has size [numVxs,K] for some K, and perTri has size [numFEs,K]. Note that this is an approximation: some smoothing is unavoidable in the calculation. The function perFEtoperVertex translates the other way, but these two functions are not inverses. Converting back and forth will have the side-effect of spreading out the distribution of the quantity.

perpBisIntersect.m

p = perpBisIntersect( v ) v is a 3x2 array representing a triangle in the plane. Set p to the intersection of the perpendicular bisectors of the sides of the triangle.

perpBisIntersect1.m

p = perpBisIntersect1( v ) v is a 3x2 array representing a triangle in the plane. Set p to the intersection of the perpendicular bisectors of the sides of the triangle.

perpendicularBC.m

bcp = perpendicular( vxs, bc ) Given the coordinates of a triangle as a 3*3 matrix of row vectors, and the barycentric coordinates of a vector in that triangle, compute the barycentric corodinates of a perpendicular vector.

placeRectInRect.m

r1 = foo( r, r1, mode ) r and r1 are positions (both of the form [x,y,w,h]). margins is a list of 4 numbers [ml, mb, mr, mt]. glue is an array of compass directions, each of which is n, w, s, or e. The result is a rectangle obtained by first insetting r by the margins to produce a frame rectangle, then attaching the sides of r1 to the sides of the frame wherever the corresponding compass point appears in the glue string. Where a side is unglued, r1 retains its dimension (width or height) in that direction.

planeSide.m

side = planeSide( n, a, pts ) The column vector N and the real number A define a plane by the equation N*X==A. Set SIDE to an array of booleans of length size(p,1), in which each element is truee iff the corresponding row of p satisfies N*P(i,:) >= A.

plotRect.m

plotRect( r ) Plot the rectangles r, an array of which each row has the form [ xlo, xhi, ylo, yhi ].

plotcolouredlines.m

plotlines.m

plotpts.m

plotpts( ax, pts, varargin ) Plot the 2 or 3 dimensional points with any plot options.

pointInPoly.m

inside = pointInPoly( pt, poly ) Determine whether the point is inside the polygon, by computing the winding number of the polygon about the point. The polygon is represented as an N*2 array containing its vertexes in anticlockwise order. If the points are in clockwise order, the result will be true if the point is outside.

pointLineDistance.m

[d,pp] = pointLineDistance( vxs, p, wholeLine ) Find the distance of a point from a line segment. VXS is a 2*D vector containing the ends of the segment, where D is the number of dimensions. pp is the foot of the perpendicular from p to the line. bc is the barycentric coordinates of pp with respect to the ends. If wholeLine is false (the default), then if pp lies outside the line segment, it will be moved to the nearer end. However, bc will be unchanged. To determine from the result whether pp was moved, look at bc: one of its components will be negative in that case. In both cases, d will be the distance from p to pp.

pointPlaneDistance.m

d = pointPlaneDistance( vxs, p ) Find the distance from the point p to the plane through the given three vertexes vxs. The result is always nonnegative. d = pointPlaneDistance( planeCentre, planeNormal, p ) Find the distance from the point p to the plane through planeCentre with unit normal vector planeNormal. The result is positive if p is on the same side of planeCentre as planeNormal.

pointPointDistance.m

d = pointPointDistance( p0, p1 ) Return the distances between corresponding members of the N*K arrays p0 and p1 of N K-dimensional points. Either p0 or p1 can be a single point, in which case its distance from all the points in the other set will be calculated.

pointTransform.m

Calculate a 3*2 matrix describing an affine transformation mapping v1 to w1 and v2 to w2. The transformation must consist of translation, scaling, and rotation only. Given a N*2 array of points n, the new value of n should be [n,ones(size(n,1),1)]*mx)[:,1:2].

pointTriangleDistance.m

d = pointTriangleDistance( vxs, p ) Find the distance from a point to a triangle.

polyCentroid.m

c = polyCentroid( v ) Compute the centroid of the polygon whose vertexes are the rows of v. The polygon must be 2 or 3 dimensional.

polySelfIntersect.m

polySelfIntersect( pts ) PTS is the set of vertexes of a polygon in the plane, listed in anticlockwise order. The result is a list of self-intersections. Each row contains 4 elements: [A,B,C,D] means that the edge from A to B intersects the edge from C to D.

polyarea3.m

POLYAREA3 Area of polygon in 3D space. POLYAREA3(X,Y,Z) returns the area of the polygon specified by the vertices in the vectors X, Y, and Z. If X, Y, and Z are matrices of the same size, then POLYAREA3 returns the area of polygons defined by the columns of X, Y, and Z. If X, Y, and Z are arrays, POLYAREA3 returns the area of the polygons in the first non-singleton dimension of X, Y, and Z. POLYAREA3(X,Y,Z,DIM) returns the area of the polygons specified by the vertices in the dimension DIM. POLYAREA3(M), where M is an N*3 matrix, is equivalent to POLYAREA3( M(:,1), M(:,2), M(:,3), 1 ). If the polygon is not flat, the area computed is the total area of all the triangles formed by the centroid of the vertices and every consecutive pair of vertices of the polygon. Based on the Matlab code for POLYAREA. See also: POLYAREA.

polygonArea.m

a = polygonArea( d, vxs ) Compute a representation of the area of a polygon in 3D cut off by a plane perpendicular to d. The polygon vertexes are in the N*3 array vxs. d must be a unit row vector. n is a vector normal to the polygon. If omitted, it defaults to [0 0 1].

polygonArea2.m

a = polygonArea2( d, vxs ) Compute a representation of the area of a polygon in the XY plane cut off by a line parallel to the Y axis. The polygon vertexes are in the N*2 array vxs.

polygoncentre.m

centre = polygoncentre( vxs ) Find the centroid of a polygon.

polysplitdiameter.m

[c,v] = polysplitdiameter( vxs ) Given an N*2 matrix of vertexes of a 2D polygon, find the centroid c of the polygon and a unit vector v, such that the distance from c along v to an edge of the polygon is minimised.

povrayParamsFromOurViewParams.m

povrayParams = povrayParamsFromOurViewParams( viewParams ) Convert our camera parameters to POV-Ray's. POV-Ray's camera parameters are: perspective|orthographic location: a vector look_at: a vector right: a vector up: a vector direction: a vector Our camera parameters are: fov (field of view) azimuth elevation roll pan (two components) targetdistance See also: ourViewParamsFromCameraParams.

projectPointToLine.m

[pp,bc] = projectPointToLine( vxs, p ) Project P perpendicularly onto the line defined by the two vertexes VXS, giving point P1. VXS is a 2*D matrix of two row vectors of any dimensionality D. If the two points coincide, then PP is set equal to both. BC is set to the barycentric coordinates of the point with respect to VXS, as a 1*D row vector. The equality PP == BCS*VXS holds. P may be an N*D matrix of row vectors for any N.

projectPointToPlane.m

pp = projectPointToPlane( vxs, p ) Project P perpendicularly onto the plane defined by the three vertexes VXS, giving point PP. VXS is a 3*D matrix of three row vectors of any dimensionality D. If the three points are collinear, then P is projected onto the line they define. BC is set to the barycentric coordinates of the projected point with respect to VXS, as a 1*D row vector. The equality PP == BCS*VXS holds. P may be an N*D matrix of row vectors for any N.

projectPointToPlane2.m

p = projectPointToPlane2( point, normal, distance ) Project POINT to the plane normal to NORMAL at DISTANCE from the origin. p = projectPointToPlane2( point, normal, through ) Project POINT to the plane normal to NORMAL that passes through the point THROUGH. NORMAL must be nonzero, but does not have to be a unit vector. POINT can be an N*D matrix of D-dimensional points. If RATIO is supplied, the points will not be moved the full distance to the plane, but only the given proportion of the distance. Thus RATIO=1 gives full flattening, RATIO=0 gives no change.

projectstreamline.m

gradendpoint = projectstreamline( v, bc, vxs, positive ) Given v, a vector of the three values of some scalar at the vertexes vxs of a triangle, and bc, the bcs of a point in the triangle. Compute the bcs of the intersection of the line parallel to the gradient vector of v, in either the direction of the gradient vector or its opposite or both, starting from the point bc, with the first side of the triangle that it hits. If POSITIVE is true, only the intersection in the direction of the gradient is returned. If POSITIVE is false, only the intersection in the opposite direction is returned. If POSITIVE is not supplied, both intersections are returned. If two output arguments are supplied, the positive intersection is returned in gradendpoint1 and the negative in gradendpoint2. If one output argument is supplied, it will hold the intersection that was asked for, if POSITIVE was supplied, otherwise it will hold the positive intersection. Any intersection asked for which does not exist, because it lies outside the triangle, is returned as the empty list.

quivervec.m

randInCircle2.m

randPointsOnSurface.m

[cellindexes,bcs,pts] = randPointsOnSurface( nodes, tricellvxs, areas, d, hintFE, hintBC ) Choose a maximal set of points on a surface defined by a set of nodes and a set of triangles, subject to the condition that the distance between any two points is greater than d. The AREAS argument is a vector of the areas of the triangles. This can be calculated from the nodes and tricellvxs arguments, but in the circumstances where we call this, we already have the areas to hand. We use an approximate algorithm for this: first we generate many points at random, far more than the number we estimate that we will eventually select. Then we select from these points one by one, adding a point to the selected set if it is far enough from each of the previously selected points. The more points we generate, the less likely we are to have a chance void in our pattern, where we should have added another point but did not. But the more points we generate, the longer the algorithm takes. If hintFE and hintBC are supplied, these points are used before any of the generated points. The result consists of a vector of triangle indexes, the barycentric coordinates of the selected points in those triangles, and the 3d coordinates of the points. This method generates a set of points that are guaranteed to be at least d apart from each other, and (if the initial sample is large enough) will ensure that no other point of the surface is more than a distance d from the nearest member of the set. This still allows for some lumpiness: there can be voids in the pattern whose shortest diameter is up to 2d.

randRotation.m

r = randRotation() Generate a random rotation matrix in 3 dimensions.

randomDirection.m

newdir = randomDirection( curstart, radius, curdir, maxangle, surfnormal, insurface, usemaxangle, N ) Generate a random direction that deviates by not more than maxangle from currentdir, and which is uniformly distributed over the spherical cap that is the space of all permitted directions. If surfnormal is supplied, nonempty, and nonzero, limit the new vector to the subset making an angle with surfnormal of more than 90 degrees. If maxangle is empty, all directions are permitted, the same as if maxangle were pi or more. insurface is a boolean. If false, the above happens, but if true, the new direction is constrained to lie parallel to the surface, i.e. perpendicular to surfnormal. (surfnormal must be supplied and nonzero in this case.) The new direction is randomly uniformly distributed over the range of permitted angles in the surface. curdir must be a row vector. newdir will be a unit length row vector. The default value of N is 1. A larger value can be supplied to generate any number of random directions as an N*3 matrix.

randperp.m

w = randperp( v ) Return a random unit vector perpendicular to the unit vector v. v may be an N*3 matrix of row vectors, in which case an N*3 matrix will be returned, of a random perpendicular to each row of v.

rectInRect.m

r1 = rectInRect( r, where, pos ) POS is an array [insetx, insety, width, height]. Set r1 to be a rectangle of size [width height], inset by insetx and insety from the edges of R indicated by WHERE, which is a string being one of 'n', 's', 'w', 'e', 'ne', 'ne, 'sw', 'se', 'c'. x and y are assumed to increase to the right and up.

rectifyFOV_MVP.m

matlabViewParams = rectifyFOV_MVP( matlabViewParams, newfov ) Set the field of view angle, and change the camera distance so that in orthographic projection, the visible appearance of the scene is unchanged. This computation is carried out in terms of Matlab's view parameters. newfov is given in degrees.

rectifyFOV_OVP.m

ourViewParams = rectifyFOV_OVP( ourViewParams, newfov ) Set the field of view angle, and change the camera distance so that in orthographic projection, the visible appearance of the scene is unchanged. This computation is carried out in terms of our view parameters. newfov is given in degrees.

rotVec.m

v = rotVec( v, centre, rotAxis, rotAmount ) Rotate v about the axis rotAxis passing through centre by rotAmount in radians. v may be a 3-element row vector or an N*3 matrix.

rotateElastMatrix2.m

rotD = rotateElastMatrix( D, J ) D is a 2D elasticity tensor in 3-matrix form. The result is the rotation of D by J, a 2D rotation matrix or a rotation angle.

rotateTensor.m

t1 = rotateTensor( t0, r ) t0 is a tensor in 6-vector form, i.e. [ xx, yy, zz, yz, zx, xy ], or 3-vector form [xx yy xy]. r is a rotation matrix in 3 or 2 dimensions respectively. The result is t rotated by r. t may be a matrix of N row vectors, in which case t1 will also be.

rotmat2To3mat.m

J3 = rotmat2To3mat( J ) Convert a 2*2 rotation matrix to 3-matrix form, suitable for rotating elasticity tensors in 3-matrix form.

setaxis.m

setaxis( theaxes, axisrange, centre ) This works like axis, but assumes that the camera is on manual mode, and does the automatic camera ranging. If centre is true (the default) then the view will be adjusted to pass through the centre of the axis box.

setview.m

setview( theaxes, vp ) setview( theaxes, az, el ) setview( theaxes, az, el, roll ) Set the view parameters of the axes handle. Either the whole view parameters structure can be given, or just azimuth and elevation, or azimuth, elevation, and roll.

simpleplotmesh.m

smoothGrid.m

smoothSurface.m

s = smoothSurface( s, n ) Given a surface S as returned by isosurface(), smooth it by averaging each point with its neighbours, N times. N defaults to 1.

sparsifyPoints.m

subpts = sparsifyPoints( pts, distance ) Given a set of points as an N*D matrix, and a distance, choose a maximal subset of the points such that no two members of the subset are within a distance of less than distance. The indexes of the selected points are returned in a column vector. If distance is zero, points with identical coordinates will be deemed to be too close. Thus setting distance=0 amounts to striking out all duplicates. If distance is negative, 1:size(pts,1) is returned immediately.

splaynodes.m

n is assumed to be a N*3 array of points, assumed to have x and y coordinates all lying in the sector whose vertex is at the origin and which is bounded by angles a1 and a2. The points are rotated and transformed so as to lie in the sector bounded by angles a3 and a4.

spline3.m

x = spline3( x0, x1, x2, x3, alpha ) Interpolate a cubic spline through the four points, which may be in space of any number of dimensions. The spline will pass through the four points at alpha = -1, 0, 1, and 2 respectively. If x0...x3 are row vectors and alpha is a column vector then x will be a matrix of row vectors; and vice versa.

splinePoints.m

Given a set of points PTS (an N*3 array) and a vector of value in the range 0..1, calculate the positions of a set of points INTERPPTS, such that the i'th point is a proportion interps(i) of the way along a smooth path through all the given points. The return value THESPLINE is a data structure from which further interpolants can be computed by the PPVAL function. For example, the returned value of INTERPPTS is calculated by: interppts = ppval( thespline, interps )'; Note that ppval returns a 3*K array of K points (K being the length of INTERPS), so for consistency with our convention that PTS is N*3, this array is transposed before being returned.

splitBaryCoords.m

bc = splitBaryCoords( bc, femCell, newFemCell, splitv1, splitv2 ) bc is the barycentric coordinates of a point in the cell FEMCELL, which has just been split, the added cell being NEWFEMCELL. The edge that was split has endpoints SPLITV1 and SPLITV2 relative to the old cell, where these are indexes in the range 1:3. Calculate the new barycentric coordinates of the same point, and its cell index.

splitPoly.m

[vi1a,vi1b,v1,vi2a,vi2b,v2] = splitPoly( direction, splitpoint, vxs ) vxs contains the vertexes of a polygon as an N*3 matrix. direction is a direction and splitpoint a point. This routine finds where the plane perpendicular to direction through splitpoint intersects the polygon.

splitPolyShortest.m

[vi1a,vi1b,v1,vi2a,vi2b,v2] = splitPolyShortest( splitpoint, vxs ) Find the shortest line through splitpoint cutting the polygon vxs. The results are

splitPolygonByArea.m

splitVector.m

[par,per] = splitVector( v, n ) Split a row vector r into its components parallel and perpendicular to the row vector n. r and n can be N*3 matrices.

splitbc.m

newbc = splitbc( oldbc, splitinfo ) When a finite element is split, any points within it that were defined by their barycentric coordinates must have those coordinate recomputed, and the descendant cell containing the point must be found. That is done by this function. ci is the cell that was split. splitinfo is an array of six elements [ ci1, ci2, ci3, nc1, nc2, nc3 ]. ci1, ci2, and ci3 are the indexes within the cell of the edges that were split. If only two edges were split, ci3 is zero, and if only one edge, ci2 is also zero. nc1, nc2, and nc3 are the indexes of the new cells. If only two edges were split, nc3 is zero, and if only one edge, nc2 is also zero. The edges and cells are listed in a canonical order, for which see the code here, or look at how splitinfo is computed in splitalledges.m.

squarebc.m

bc4 = squarebc( bc, d ) Return the barycentric coordinates of a quadrilateral centred on bc with radius d.

stereoOffset.m

[cameraPosition, cameraRight] = ... stereoOffset( cameraPosition, cameraTarget, cameraUp, cameraRight, offset ) Rotate cameraPosition and cameraRight by offset about cameraUp through cameraTarget. offset is in degrees. The vectors should be row vectors.

subdivide4.m

p = subdivide4( v ) Given a 4*3 matrix holding four points, find a point on a smooth curve through the four points, about halfway between the middle two points.

surfaceNeighbours.m

nb = surfaceNeighbours( s ) % Given a surface S as returned by isosurface(), return a cell array listing for each vertex, the indexes of its neighbours.

tensorVector.m

g = tensorVector( t, v ) Given a growth tensor t in 2 or 3 dimensions, and a column vector v, compute the growth in direction v (scaled as |v| squared), i.e. g = v' t v. t is assumed given in 3-vector format for 2 dimensions, or 6-vector format for 3 dimensions.

tensorsToComponents.m

[cs,fs] = tensorsToComponents( ts, preferredframes ) Convert a set of growth tensors ts given as an N*6 matrix into an N*3 matrix cs of the growth amounts and a 3*3*N matrix of the axis frames. preferredframes is an optional argument. If not supplied, then the values in cs will be in descending order. If supplied and maxmin is false or absent, the columns of the matrices in fs will be permuted to lie as close as possible to those of preferredframes, and cs will be permuted likewise. If maxmin is true then the first two elements in each row of cs will be permuted to place the largest first, and the corresponding axes likewise permuted.

testdv.m

testperpbis.m

testpoly.m

tetrahedronAngle.m

a = tetrahedronAngle( v1, v2, v3, v4 ) The arguments are the four vertices of a tetrahedron. Return the angle between the two faces joined by the edge v1 v2.

timevor.m

translatearray.m

triAltitudes.m

triInterpolate.m

gv = triInterpolate( points, v ) v is a row vector of 3 values, the values of some quantity at the vertexes of a triangle. points is a 3*N matrix of points in barycentric coordinates. The result is the interpolated values of v at those points.

triangleAngle.m

a = triangleAngles( tri ) TRI is a 3*3 matrix of row vectors, the vertexes of a triangle. A is set to the angle at the first vertex. If you want all three angles, use triangleAngles.

triangleAngles.m

a = triangleAngles( tri ) TRI is a 3*3 matrix of row vectors, the vertexes of a triangle. A is set to the angles of the triangle, as a column vector.

triangleQuality.m

q = triangleQuality( pts ) Compute a measure of the quality of the triangular FEM element whose vertexes are the rows of pts. The measure is the ratio of twice the triangle area to the square of its longest side. Equivalently, it is the ratio of the altitude to the longest side. The maximum possible value is sqrt(3)/2 = 0.866.

triangleTransform.m

t = triangleTransform( vxs1, vxs2, growthonly ) Find the affine transformation that maps the triangle vxs1 to the triangle vxs2, both being 3*2 matrices representing three points in the plane. The transformation t is a 3*2 matrix satisfying [ vxs1, [1; 1; 1] ]*t = vxs2. It exists and is unique unless the points vxs1 are collinear. If growthonly is true (default false) then the translationsl and rotational parts of t will be removed and t returned as a 2*2 symmetric matrix.

trianglearea.m

ta = trianglearea( vxs ) Compute the area of the triangle in 3D space whose vertices are the rows of vxs. If the third dimension of vxs is greater than 1, this calculation will be carried out for every slice.

triangleareas.m

[areas,normals] = triangleareas( nodes, triangles ) Compute the areas and normal vectors to a set of triangles specified by the positions of their vertexes and the triples of vertexes that make the triangles.

trianglesAngles.m

a = trianglesAngles( tri ) TRI is a 3*3*N matrix of row vectors, the vertexes of N triangles. A is set to the angles of all the triangles, as a 3*N matrix. The triangles are assumed to be all non-degenerate.

triangulate.m

t = triangulate( vxs ) Create a triangulation of the given vertexes. VXS is an N*2 array listing the vertexes of a polygon in order. T will be a K*3 array of triples of indexes of V.

triframe.m

frame = triframe( t ) Calculate a right-handed orthonormal frame of reference for a triangle t, such that the third axis is the triangle normal, and the first is one of its edges. The vertices of the triangle are the rows of t.

trinormal.m

normal = trinormal( t ) Calculate a normal vector to the triangle whose vertices are the rows of t. The length of the vector is twice the area of the triangle. If the three points are collinear, the vector will be zero.

tritransformation.m

mx = tritransformation( vxsA, vxsB ) Compute a linear transformation mapping the triangle whose vertexes are the rows of vxsA to the triangle given by vxsB, assuming the unit normal vector of the first is mapped to the unit normal vector of the second. mx should have the property that vxsA*mx differs from vxsB by a translation. The translation from vxsA*mx to vxsB is vxsB(1,:) - vxsA(1,:)*mx.

vec2bc.m

bc = vec2bc( v, vxs ) Convert a vector to barycentric coordinates with respect to the triangle whose vertexes are the rows of the 3*3 matrix vxs. n, if supplied and nonempty, is a normal vector to the triangle.

vec3Angle.m

vecangle2.m

voronoiChange.m

voronoiChange( v, dv ) V is a set of voronoi generating points. DV is a perturbation to V. We compute the change in edge lengths of the Voronoi tessellation of V when DV is added to V, on the assumption that the topology of the network does not change. Since smalledges tend to be fragile, we ignore edges whose length is less than 0.2 of the typical cell diameter. Several measures of edge shrinkage are returned: NS: the number of edges, originally above the threshold length, which shrank. FS: the fraction of edges, originally above the threshold length, which shrank. AMT: geometric mean of the shrinkage, taking non-shrinking edges to have zero shrinkage.

voronoiFromDelaunay.m

vv = voronoiFromDelaunay( v, t ) Calculate the Voronoi vertexes from the Delaunay trangulation t of a set of vertexes V.

vorticity.m

v = vorticity( x, u ) Given N*3 matrices x and u of points and displacements respectively, find the best-fit rigid rotation v. EXPERIMENTAL CODE, DO NOT USE YET.

whichSide.m

z = whichSide( n, p, v ) Returns 1 or 0, depending on which side v is of the hyperplane perpendicular to n through p. n and p must be row vectors, and v a matrix of row vectors. z will be a column vector of booleans.

windingNumber.m

wrappoints.m

v = wrappoints( v, r ) Wrap the set of points around a cylinder whose axis is the z-axis, with radius r.

xorRect.m

r = xorRect( r1, r2 ) r1 and r2 are rectangles represented as [ xlo, xhi, ylo, yhi ]. r is set to an array of disjoint rectangles whose union is the symmetric difference of r1 and r2.

xvoronoi.m

XVORONOI Modified Voronoi diagram. By RK, based on Matlab's VORONOI. VORONOI(X,Y) plots the Voronoi diagram for the points X,Y. Lines-to- infinity are approximated with an arbitrarily distant endpoint. VORONOI(X,Y,TRI) uses the triangulation TRI instead of computing it via DELAUNAY. VORONOI(X,Y,OPTIONS) specifies a cell array of strings to be used as options in Qhull via DELAUNAY. If OPTIONS is [], the default DELAUNAY options will be used. If OPTIONS is {}, no options will be used, not even the default.VORONOI(AX,...) plots into AX instead of GCA. H = VORONOI(...,'LineSpec') plots the diagram with color and linestyle specified and returns handles to the line objects created in H. [VX,VY] = VORONOI(...) returns the vertices of the Voronoi edges in VX and VY so that plot(VX,VY,'-',X,Y,'.') creates the Voronoi diagram. The lines-to-infinity are the last columns of VX and VY. To ensure the lines-to-infinity do not affect the settings of the axis limits, use the commands: h = plot(VX,VY,'-',X,Y,'.'); set(h(1:end-1),'xliminclude','off','yliminclude','off') For the topology of the voronoi diagram, i.e. the vertices for each voronoi cell, use the function VORONOIN as follows: [V,C] = VORONOIN([X(:) Y(:)]) See also VORONOIN, DELAUNAY, CONVHULL.

ypiecequadpos.m

v = ypiecequadpos( u, v ) Calculate the 3D position of a point on the basic quadilateral, of which 12 copies form the basic y-shaped junction of three tubes.

HSVtoRGB.m

rgb = HSVtoRGB( h, s, b ) Better version of hsv2rgb that allows any real number as a value of h, and trims s and b to the range 0..1.

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Utils\MSR

msrConvertBaseIndex.m

msr = msrConvertBaseIndex( msr, baseIndex ) Convert an MSR structure such as returned by msrfilereader or as supplied to msrfilewriter between 0-indexing and 1-indexing. MSR files use 0-indexing for those fields that consist of indexes into other fields, i.e. the lower index is zero. Matlab indexes arrays from 1. Therefore it is necessary to convert between 0- and 1-indexing in order to process MSR data in Matlab. baseIndex is the indexing mode that is required for the result. If baseIndex is zero, the given msr structure is assumed to currently be 1-indexed, and 1 is subtracted from every array index it contains. If baseIndex is 1, the given msr structure is assumed to currently be 0-indexed, and 1 is added to every array index it contains. This procedure will rarely be called by the end user, as msrfilereader and msrfilewriter automatically call this already.

msrfilereader.m

[result,errs] = msrfilereader( filename ) Read the given MSR file and return its contents as a Matlab structure. All error messages generated in the process are returned in the cell array of strings ERRS. Run this on an example file to see what the returned structure looks like. msrfilereader tries to know as little as possible about the data. It has hard-wired into it the data type associated with each field name (string, integer, or float) and how many data items there should be, but this information should be stored in an external file instead. Unknown field names default to expecting any number of string values. Because MSR data indexes its arrays from 0, and Matlab indexes arrays from 1, all array indexes present in the data must be converted from one convention to the other when reading or writing this format. msrfilereader therefore needs to know which fields contain array indexes. These fields are (currently) assumed to be OBJECT, EDGE, and FACE. If an MSR file contains any other fields containing array indexes that you are going to use as such, you will have to convert them yourself after reading the data. This procedure uses tokeniseString() in the Growth Toolbox.

msrfilewriter.m

[ok,errs] = msrfilewriter( filename, msr ) Write an MSR structure as returned by MSRFILEREADER to the given file. If the filename is empty then output will be to the console. If MSR is missing or empty then no file will be touched. OK is a boolean to say whether the operation succeeded. If it fails, ERRS will be a cell array of associated error message strings. Because MSR data indexes its arrays from 0, and Matlab indexes arrays from 1, all array indexes present in the data must be converted from one convention to the other when reading or writing this format. msrfilewriter therefore needs to know which fields contain array indexes. These fields are (currently) assumed to be OBJECT, EDGE, and FACE. If an MSR file contains any other fields containing array indexes that you are going to use as such, you will have to convert them yourself before writing the data.

testmsr.m

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Utils\Maths

arithprog.m

a = arithprog( first, last, n ) Return an array of n integers, beginning with FIRST and ending with LAST, and being as equally spaced as possible between,

averageAngle.m

a = averageAngle( angles, weights ) Take the weighted average of the given angles. If there are N angles, there are N candidates for the average, depending on which candidate value is selected for each angle. Choose the one that minimises the variance. If there is more than one, choose one at random. The angles are assumed to be in radians.

averageDirection.m

v = averageDirection( vectors, weights, normal ) VECTORS is an N*3 matrix of unit row vectors. WEIGHTS is a vector of N weights summing to 1. The result is a unit vector whose direction is in some sense the weighted average of the directions of the given vectors. It is constrained to be perpendicular to NORMAL, and the given vectors are expected to be at least approximately perpendicular to NORMAL. If NORMAL is not supplied, it defaults to [0 0 1]. There is no continuous averaging operation in the space of unit vectors. Therefore, this function is discontinuous. There is more than one plausible candidate for the "average". The one we implement is to take the weighted average of the vectors, project it perpendicular to NORMAL, then normalise it to unit length. If the projection of the average is zero, a random perpendicular to NORMAL is returned. An alternative method is to choose the direction that minimises the second moment of the distribution of the directions around that value. An implementation of that is available in the code below, but only for the case where NORMAL is [0 0 1].

bestFitLine2D.m

theta = bestFitLine2D( pts ) Find the direction of the line through the centroid of the given points that minimises the sum of the squares of the distances of the points from the line. pts must be an N*2 array. theta will be an angle between -PI/2 and +PI/2. Both limits are possible.

bestflipvxs.m

pts = bestflipvxs( pts ) pts is an Nx2 matrix of N points in the plane. Reflect this set about a line chosen to minimise the total squared displacement of all the points.

cancelMoment.m

w = cancelMoment( u, d, cancelDrift ) d is a set of velocities of particles at positions u. Calculate the angular velocity about the centroid of u that will cancel out the moment of the velocities d. If cancelDrift is true (default is false), then d will also be translated to make its average zero. The moment of velocities (assuming the centroid is zero) is sum_i u_i cross d_i.

cfrac.m

a = cfrac( r, n ) Calculate the continued fraction representation of r to n places.

checkUniqueRows.m

clumplinear.m

[cnum,cmin,cstep,csz,clumpindex] = clumplinear( v ) v is a vector which is expected to consist of a large number of values that fall into clumps clustered around a smaller number of values. These clump values are expected to be in arithmetic progression. This routine finds the best-fit description of this form. Results: cnum The number of clumps cmin The central value of the zeroth clump. cstep The distance between central values of consecutive clumps. csz The maximum difference of any clump member from its central value. clumpindex A row vector the same length as v, mapping each index of v to the index of the clump it belongs to. Thus v(i) is approximated by cmin + cstep*clumpindex(i), and the error is bounded by csz. v can also be a matrix of any size and number of dimensions. clumpindex will have the same size and shape as v. See also: clumpsize, clumpseparation, clumpsepsize.

clumpseparation.m

cs = clumpseparation( v ) v is a vector which is expected to consist of a large number of values that fall into clumps clustered around a smaller number of values. The spread of values within each clump is expected to be much smaller than the difference of values between any two clumps. This routine returns the minimum separation found between any two members of different clumps. v can be a row or column vector, or a matrix of any shape. See also: clumpsize, clumpsepsize, clumplinear.

clumpsepsize.m

[csep,csz] = clumpsepsize( v ) Returns the results of clumpsize(v) and clumpseparation(v), but is more efficient than calling both of those separately. See also: clumpsize, clumpseparation, clumplinear.

clumpsize.m

csz = clumpsize( v ) v is a vector which is expected to consist of a large number of values that fall into clumps clustered around a smaller number of values. The spread of values within each clump is expected to be much smaller than the difference of values between any two clumps. This routine returns the maximum separation found between any two members of the same clump. v can be a row or column vector. See also: clumpseparation, clumpsepsize, clumplinear.

combinations.m

c = combinations(n,i) Calculate n!/i!(n-i)!

convertIsoElasticParams.m

s = convertIsoElasticParams( p1, v1, p2, v2 ) Given any two of the six standard elastic parameters of a 3-dimensional isotropic material, return a struct containing all of them: s.bulk bulk modulus s.young Young's modulus s.lame1 Lame's first parameter s.shear shear modulus s.poisson Poisson's ratio (also called Lame's second parameter) s.pwave P-wave modulus p1 and p2 are any two distinct field names from the above list, and v1 and v2 are their values. For certain pairs (young and either lame1 or pwave), the computation requires the solution of a quadratic equation, and hence there are two solutions. Only one solution will be returned, and when possible, it will be a physically realistic one (i.e. all properties except s.poisson will be non-negative, and s.poisson will be in the range -1...0.5). Some of the calculations will be singular when s.poisson is -1 or 0.5. If the arguments p1 and p2 are equal, or either is unrecognised, an empty result is returned.

diffs.m

dv = diffs( v ) Set dv to the vector of differences between consecutive members of v. v must be nonempty.

efrac.m

r = efrac( cf ) Evaluate a continued fraction.

extractRotation.m

q = extractRotation( q, tol ) Find the rotational component of a polar decomposition of q. See http://www.cs.wisc.edu/graphics/Courses/838-s2002/Papers/polar-decomp.pdf http://tog.acm.org/resources/GraphicsGems/gemsiv/polar_decomp/Decompose.c http://eprints.ma.man.ac.uk/340/01/covered/MIMS_ep2006_161.pdf If the determinant of q is negative, the decomposition will be a combination of rotation and reflection. The tolerance defaults to 1e-6.

fitmat.m

[m,t] = fitmat( p0, p1 ) P0 and P1 are N*2 or N*3 arrays of 2D or 3D vectors. [M,T] are the linear transformation and translation that best approximate the transformation of P0 to P1. T is P1mean-P0mean, and M is chosen to minimise the squared error of (P1-P1mean) - (P0-P0mean)*M. If M is close to singular, it is returned as the identity matrix instead.

fourpointforce.m

forces = fourpointforce( torque, vxs, n3, n4 ) Given a 4*3 matrix of points [v1;v2;v3;v4] and equal and opposite torques TORQUE about the line V1 V2, find a set of forces on the four vertexes equivalent to those torques. The torques are assumed to be trying to move vertexes v3 and v4 in the direction of the normal vectors n3 and n4. If n3 and n4 are not supplied, they are calculated from the vertexes, assuming that v1 v2 v3 ans v4 v2 v1 are anticlockwise enumerations.

genrand.m

r = genrand( df, n ) df is a cumulative distribution function over its subscript range. This function generates n random elements drawn from that distribution. Where consecutive members of cumdist are equal, the later element will always be chosen.

interpolateArray.m

c = interpolateArray( v, cmap, crange ) C is the color produced by mapping V into the color map CMAP. V can be a column vector of length N and C will be an N*3 matrix.

inv3n.m

M is a 3*3*N matrix. Each of its 3*3 slices is inverted.

isoproducts.m

M = isoproducts( vxs ) Calculate the integral of the product of any two isoparametric shape functions over the pentahedron given by the 6*3 array vxs. The standard pentahedron has the vertex array: [ 1 0 -1; 0 1 -1; 0 0 -1; 1 0 1; 0 1 1; 1 1 1 ]; and the given vertexes are assumed to be listed in the same order. The result is a 6*6 array M, which is indexed along both dimensions by the first index of vxs. M is symmetric, and its upper right 3*3 quadrant is symmetric. This means that the matrix has at most 18 independent elements. This must be an over-estimate, though. M is a function of vxs, which already only has 18 dfs. M is invariant under volume-preserving linear transformations, which have 8 dfs, leaving only 10 dfs for M. 10 is the number of dfs of a symmetric 4*4 matrix. Furthermore, M is determined by the coefficients td1, tdx, etc. computed below. There are only 9 of these, so M has at most 9 degrees of freedom. In fact, tdxzz and tdyzz are identically zero, leaving only 7 dfs. For the standard pentahedron, M is: [ 4 2 2 2 1 1 2 4 2 1 2 1 2 2 4 1 1 2 2 1 1 4 2 2 1 2 1 2 4 2 1 1 2 2 2 4 ] / 72 Its elementwise reciprocal is: [ 1 2 2 2 4 4 2 1 2 4 2 4 2 2 1 4 4 2 2 4 4 1 2 2 4 1 4 2 1 2 4 4 2 2 2 1 ] * 18 Its inverse is [ 6 -2 -2 -3 1 1 -2 6 -2 1 -3 1 -2 -2 6 1 1 -3 -3 1 1 6 -2 -2 1 -3 1 -2 6 -2 1 1 -3 -2 -2 6 ] * 6 Under linear transformations M is scaled by the determinant, and hence M is invariant under rigid motions and shears. More general movements of the six vertices break much of the symmetry. Pathological pentahedra can have zero volume, and in this case M is singular. When there is no interpenetration of faces, M is non-singular, and its determinant has the same sign as the volume. In finite element calculations, the vertexes should be numbered in such a way that the volume is positive. This means that the outward surface normal for the triangle vxs([4 5 6],:) should follow the right-hand rule for that listing of those vertexes. The standard pentahedron can be parameterised by the coordinates x, y, and z. Every other pentahedron can inherit this parameterisation, by interpreting x and y as two of the barycentric coordinates on the triangles vxs([1 2 3],:) and vxs([4 5 6],:), and z as parameterising each of the lines vxs([1 4],:), vxs([2 5],:), and vxs([3 6],:). z thus represents the pentahedron as a stack of triangles, to which the barycentric coordinates x and y can be applied. To obtain the integral of any quantity Q defined in terms of these coordinates, one integrates over the standard pentahedron the quantity Q*D, where D is the dilation of the mapping of the standard pentahedron to the one we are integrating over. D is the determinant of the Jacobian of the transformation, as a function of the x, y, and z coordinates in the standard pentahedron. This is a cubic polynomial in x, y, and z, the coefficients of which are calculated below as the quantities tp1 (the linear term), tpx (the term in x), etc., up to tpyzz (the term in y*z^2). Each of these coefficients is a sum of triple vector products of linear combinations of the vertexes of the pentahedron.

logodds.m

o = logodds( p ) Calculate the log-odds of a probability, i.e. log( p/(1-p) ). p can be a matrix of any shape. logodds(0) is -Inf, and logodds(1) is Inf. SEE ALSO: logoddsinv.

logoddsinv.m

p = logoddsinv( o ) Calculate the probability corresponding to a log-odds value, i.e. p = 1 ./ (1 + exp(-o)). o can be a matrix of any shape. logoddsinv(-Inf) = 0 and logoddsinv(Inf) = 1. SEE ALSO: logodds.

makedistribution.m

df = makedistribution( pdf ) Convert a probability density function to a cumulative distribution function. pdf is a vector of N elements, being the probability of a random variable being equal to 1:N. df is a vector of the same length, such that df(i) = sum( pdf(1:i) );

matrixToQuat.m

q = matrixToQuat( m ) Convert a column rotation matrix to a row quaternion. Code adapted from http://cache-www.intel.com/cd/00/00/29/37/293748_293748.pdf J.M.P. van Waveren "From Quaternion to Matrix and Back"

mnsd.m

[mn,sd] = mnsd( xx, yy ) Find the mean and standard deviation for the points xx, yy.

moment2distrib1D.m

moment2distrib1D( xx, yy, centre ) XX is a vector of N positions on the X axis. YY is a set of N values, each value being the amount of a quantity at the corresponding element of XX. CENTRE is a point, by default the centroid of the distribution. Consider YY to define the distribution of concentration of a substance over the range of XX, linearly interpolated, and zero everywhere outside the range of XX. Results: MOM2 will be the second moment of that distribution about the centre. CENTROID (if asked for) will be the centroid of the distribution. If CENTRE is omitted it will default to the centroid; in that case MOM2 is the variance of the distribution. TOTAL (if asked for) will be the total quantity of the distribution. See also: meanpos.

mul3n.m

P = mul3n( M, N ) M and N are 3*3*n matrices. P is set to a matrix the same size, such that P(:,:,i) = M(:,:,i)*N(:,:,i). This is more efficient than iterating through the slices when n is at least 20.

ncdf.m

normaliseVector.m

notIn.m

nzdiv.m

v = nzdiv( num, denom, zeroval ) For vectors num and denom of the same shape, this is equivalent to v = num ./ denom, except that where denom is zero, v will be zeroval. zeroval defaults to 0.

oddsratio.m

o = oddsratio( p ) Calculate the odds ratio for a probability p: o = p/(1-p). p can be a matrix of any size. p=1 implies o=Inf. SEE ALSO: oddsratioinv.

oddsratioinv.m

p = oddsratioinv( o ) Calculate the probability for an odds ratio o: p = 1/(1 + 1/o). o can be a matrix of any size. o=Inf implies p=1. SEE ALSO: oddsratio.

otherof3.m

k = otherof3( i, j ) If i and j are distinct digits in the range 1..3, k is the third digit.

quatToMatrix.m

r = quatToMatrix( q ) Convert a quaternion (x,y,z,w) to a rotation column matrix. The quaternion must be a 4-element row vector, with the phase component last. It can also be an N*4 matrix, in which case the result is a 3*3*N array. The quaternions are not checked for being normalised. If the norm is k, the result will be a rotation matrix multipled by k^2.

randsubset.m

Return a random subset of k of the numbers from 1 to n. s will be an array of booleans the same size as n, with k randonly selected elements set to true. This is guaranteed to give exactly k numbers. If what you need is for each number to be chosen independently with probability k/n, just use s = rand(1,n) < k/n.

rotMatFromAngVel.m

angvel is an angular velocity vector. Compute the rotation matrix that represents rotation at that angular velocity for time t (default 1).

rotateVecAboutVec.m

v = rotateVecAboutvec( v, a, theta ) Rotate the 3D vector v about the axis a by angle theta. a is assumed to be a unit vector. v and a must be row vectors. v and a can also be N*3 matrices, and theta an N-element vector: each vector will be rotated about the corresponding axis by the corresponding angle.

saw.m

sinelength.m

l = sinelength( a ) Compute the arc length of a sine wave of amplitude A and period P.

transformGrowthTensor.m

rotD = rotateGrowthTensor( D, J ) D is a rank 2 tensor in row 6-vector form. The result is the transformation of D by J, a 3*3 matrix in column vector form. Otherwise put, D is the expression of the growth tensor in the frame J, and the result is the growth tensor represented in the global frame. This is computed by converting D to a matrix, transforming by J, then converting back to a row 6-vector. If D is an N*6 matrix, this transformation is applied to every row of D.

triangleAltitude.m

vxD = triangleAltitude( vxA, vxB, vxC ) D is the foot of the altitude from A to the line BC. vxA, vxB, and vxC are expected to be row vectors. Any of them may be matrices of more than one row vectors; if more than one is, they must contain the same number of rows, and if any is a single vector it will be replicated the required number of times.

tritrirot.m

r = tritrirot( oldnodes, newnodes, tricellvxs ) OLDNODES and NEWNODES are the old and new positions of a set of N nodes, each an N*3 matrix. TRICELLVXS is a set of M triangles on those nodes, an M*3 matrix. R is set to an M*3*3 array containing M rotation matrices that rotate the old triangles to the same orientation as the new.

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Utils\Random

calcdistrib.m

distribPLC.m

distrib = distribPLC ( density ) density is an N*2 matrix of (x,y) coordinates, defining a piecewise linear continuous function. The result is the corresponding piecewise quadratic distribution function, i.e. the integral of the density (but not scaled to have range 0...1). This function is represented as an N*4 matrix. For each tuple (x,y,y',a), (x,y') is the value of the distribution function corresponding to the point (x,y) in the density function, and a expresses the quadratic component between that point and the next: distrib( x+eps ) = y' + y*eps + a*eps^2.

invdistrib.m

polygonDensity.m

dens = polygonDensity( poly ) Construct a density function from a convex polygon. The density function is continuous and piecewise linear. It is represented as an N*4 array. dens(:,1) is the series of x values in increasing order. dens(:,2) is the density function at x. dens(:,3) and dens(4,:) are the y coordinates of the intersections of the line parallel to the y-axis at x with the polygon.

polygonDistrib.m

distrib = polygonDistrib( poly ) Returns a structure representing the distribution function for the x coordinate of a random variable uniformly distributed over the polygon. The polygon is specified as an N*2 matrix.

randBaryCoords.m

bc = randBaryCoords Return random barycentric coordinates yielding a uniform distribution over a triangle. n is the number of coordinate sets to return, defaulting to 1.

randBinCounts.m

r = randBins( binsizes, numpts, uniformise ) Select a random number of points from each of the bins, in proportion to their size. The result is an array the same size as binsizes, containing the number of points that fell into each bin. If uniformise is true (the default is false) then each bin is guaranteed to have n members, where n is one of the two integers on either side of its expected number of members.

randBins.m

r = randBins( binsizes, numpts, uniformise ) Select a random number of points from each of the bins, in proportion to their size. The result is a list, in random order, of which bin each point falls in. If uniformise is true (the default is false) then each bin is guaranteed to have n members, where n is one of the two integers on either side of its expected number of members.

randCDF.m

r = randCDF( cdf, varargin ) Sample according to a CDF. The arguments after the first specify the shape of an array in the same way as for rand(). CDF is a vector of increasing values representing a cumulative distribution function. The result is an array of indexes into CDF. The probability of selecting index N is cdf(N)/cdf(end) if N=1, otherwise (cdf(N) - cdf(n-1))/cdf(end).

randFromDist.m

r = randFromDist( dist, n ) Select N random indexes into a distribution given by DIST. Each index will be chosen with probability proportional to its value in DIST.

randInCircle.m

Uniform distribution in the unit circle.

randInEllipse.m

Uniform distribution on an ellipse of specified semi-axes A and B, centred on the origin.

randInPoly.m

pts = randInPoly( n, poly ) Generate a random set of points uniformly distributed in the polygon POLY in the plane. POLY is an N*2 matrix listing the points of the polygon in anticlockwise order.

randInTriangles.m

[cells,bcs] = randInTriangles( areas, n ) Generate a set of n random points in the plane, uniformly distributed over the triangles (which are assumed to be disjoint). The results are returned in the form of cell indexes and barycentric coordinates.

randPointInCell.m

bcs = randPointInCell( eps ) Return a random point in a triangle in barycentric coordinates, subject to the point not lying close to the sides or medians of the triangle. n is the number of points, defaulting to 1. eps should be in the range 0...0.1.

randcolor.m

c = randcolor( n, hsv1, hsv2 ) Generate n random colors as an N*3 matrix of RGB values. hsv1 and hsv2 are two colors in HSV space. The resulting colours will be distributed in the box of HSV space bounded by these two colours.

randelement.m

randint.m

n = randint( lo, hi, m, n ) Return an m*n array of random integers in the range lo..hi inclusive.

randints.m

r = randints( n, p ) Randomly select a proportion p of the integers from 1 to n. Each integer has a probability p of being chosen; the number of integers selected will therefore average pn but will vary randomly from that figure. At least one integer will always be selected unless n is zero. The integers are returned in ascending order.

randpoly.m

randsubset.m

Return a random subset of k of the numbers from 1 to n. s will be an array of booleans the same size as n, with k randonly selected elements set to true. This is guaranteed to give exactly k numbers. If what you need is for each number to be chosen independently with probability k/n, just use s = rand(1,n) < k/n.

randunitvector.m

v = randunitvector( nvecs, ndims ) Return an nvecs*ndims matrix of random unit row vectors uniformly distributed over the surface of the ndims-dimensional sphere. ndims must be 2 or 3, and defaults to 2. nvecs defaults to 1.

selectPLC.m

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Utils\Structs

addToStruct.m

cellFromStruct.m

checkFields.m

ok = checkFields( s, requiredfields, optionalfields ) Check that the structure s has all the required fields, and nothing else except the optional fields.

checkstructfields.m

u = checkfields( s, mode, varargin ) Check that the set of fields of structure s includes/is included in/equals the fields listed in varargin, according to whether mode is 'incl', 'only', or 'exact'.

compareStructs.m

ok = compareStructs( s1, s2, reportCompatible ) Report on any differences of structure between s1 and s2. A difference of structure is: s1 and s2 are of different classes. s1 and s2 are both arrays, struct arrays, or cell arrays, but have different shapes. s1 and s2 are both structs, but have different sets of fields. s1 and s2 are both structs, but for some field f belonging to both, s1.f and s2.f have an incompatibility. The result is true iff there are no incompatibilities. If reportCompatible is true, compatible components of s1 and s2 will be reported, otherwise only incompatibilities will be reported.

decoratetree.m

t = decoratetree( t, decor ) Take a tree whose leaves are integers, and make an isomorphic tree whose leaves are the corresponding members of d.

defaultFromStruct.m

s = defaultFromStruct( s, d ) Set nonexistent fields of S in the cellarray FN of field names to the corresponding values of D. FN is optional and defaults to the set of all fields of D.

defaultfields.m

s = defaultfields( s, fieldname, fieldvalue, ... ) Set nonexistent fields of s to the specified values.

emptystructarray.m

fieldvalue.m

v = fieldvalue( s, f ) Set v to s.(f) if s has such a field, otherwise to the default if there is one, otherwise to [].

hashandle.m

invertDictionary.m

s = invertDictionary( a ) a is a cell array of strings. s is set to a structure whose fields are those strings, and whose value for each field is the index of that string in the cell array. The strings must be all different and valid Matlab field names.

invertNameArray.m

loadAddToStruct.m

s = loadAddToStruct( filename, s ) Load a struct from the file, and add its fields to s. Fields not present in s will be added. Fields already present in s will be overwritten if MODE is 'override', and discarded otherwise.

maketree.m

t = maketree( n, s, b ) n = number of items. s = index of first item. b = maximum number of descendants of a node. b1 = maximum number of descendants of the root node (defaults to b).

moveFromStructFields.m

[s,t] = moveFromStructFields( t, varargin ) The variable arguments must be field names of t. Set s to a structure containing those fields of t, and delete them from t.

overridefield.m

s = overridefield( s, fieldtokeep1, fieldstoremove1, fieldtokeep2, fieldstoremove2, ... ) If certain fields of s are nonempty, set certain other fields to be empty, if they exist. Fields not in s are ignored.

printtree.m

printtree( t, indent ) Print a tree whose leaves are integers.

Overloaded methods: tree/printtree

readstruct.m

newstruct = readstruct( filepath, filename ) Read a Matlab struct from a file. A .stc file stores a Matlab struct in textual form. Each field of the struct is printed, together with the dimensions of its value, on a line of its own. It is followed on subsequent lines by the value of the field. (If the field contains a single, numeric value, then that value is printed on the same line as the field name.) If the field is itself a struct (or struct array) this continues recursively.

reconcileStructs.m

sa = reconcileStructs( varargin ) The arguments are structs of possibly dissimilar structures. The result is an array of structs, consisting of all the given structs in the order they were given, and with any missing fields filled by []. If no arguments are given, an empty struct array of empty structs is returned.

renameStrings.m

s = renameStrings( s, renameindex ) s is either a single string or a cell array of strings. renameindex is a struct mapping strings to strings. Every string in s which is a field name of renameindex is replaced by the value renameindex associates to it.

renameStructFields.m

replacefields.m

safermfield.m

x = safermfield( x, varargin ) Like RMFIELD, but does not throw an exception if a field is not present or if no fields are given.

safestructaccess.m

saveFields.m

[s,r] = saveFields( s, r ) For every field f of r, swap the values of s.(f) and r.(f). It is assumed that every field of r is a field of s.

saveStructFields.m

saveStructFields( filename, s, ... ) Save specified fields from a structure into a file. The field names can be given either as a series of string arguments or as a single cell array of strings. If any specified fields are not present in s they are silently ignored. If no fields are supplied, or none of the specified fields are present, then no file will be written.

setFromStruct.m

s = setFromStruct( s, t, fn ) Set fields of S in the cellarray FN of field names to the corresponding values of T. FN is optional and defaults to the set of all fields of T. Other fields of s are left unchanged.

setFromStructFields.m

s = setFromStructFields( s, t, varargin ) The variable arguments must be field names of t. Set those fields of s to their values in t.

showSort.m

showSort( s ) Show what sort of thing s is, and all of its components recursively.

showStruct.m

showStruct( s ) Print s, and all of its components recursively. There are assumed to be no arrays involved except at the bottom level.

splitstruct.m

varargout = splitstruct( s, varargin ) The optional arguments are cell arrays of strings, which are expected to be field names of the struct s. There should be as many optional output arguments. Each output argument is set to a struct which contains those components of s whose field names are listed in the corresponding optional input argument.

struct2args.m

structFromFile.m

c = structFromFile( filename ) Read the given file, and parse each line into a token followed by a string. Use the token as a field name and the string as the corresponding value. The token will be forced to be a valid Matlab field name by replacing all non-alphanumerics by underscores, and if the result begins with a digit, prefixing 'F_'. If a token occurs multiple times, the values will be stored as a cell array. Blank lines and lines beginning with a # are ignored. If the file cannot be read, an empty struct is returned.

structeq.m

structeq( A, B ) Compare two structs for equality and print a report of the difference. This is a quick and dirty test intended for structs of which every member is a numerical array.

substruct.m

s1 = substruct( s, ... ) Set s1 to a new structure whose fields are those fields of s whose names are given as arguments.

trimStruct.m

s = trimStruct( s, fields ) Remove all fields from s except those in the cell array FIELDS.

writestruct.m

writestruct( dirname, basename, s ) Write the value of s to the file. readstruct(dirname, basename) can be used to read it in again. This does not write any Java objects that the value of s may contain. Other than that, the structure read in by readstruct should be identical to the structure written by writestruct.

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Utils\UI

GUIElementPlaceWithin.m

GUIElementPlaceWithin( movable, fixed, isleft, leftmargin, isright, rightmargin ) Place the GUI element MOVABLE relative to the GUI element FIXED. MOVABLE is assumed to be a child of FIXED. If ISLEFT is true, the left side of MOVABLE is placed LEFTMARGIN pixels to the right of the left side of FIXED. If ISLEFT is false, the right side of MOVABLE is placed LEFTMARGIN pixels to the left of the right side of FIXED. Similarly for ISTOP and TOPMARGIN.

GUIElementRelPlace.m

GUIElementRelPlace( movable, fixed, isleft, leftmargin, isright, rightmargin ) Place the GUI element MOVABLE relative to the GUI element FIXED. MOVABLE and FIXED are assumed to be children of the same parent. If ISLEFT is true, the left side of MOVABLE is placed LEFTMARGIN pixels to the right of the left side of FIXED. If ISLEFT is false, the right side of MOVABLE is placed LEFTMARGIN pixels to the left of the right side of FIXED. Similarly for ISTOP and TOPMARGIN.

XrelPosUIElement.m

relPosUIElement( uihandle1, uihandle2, relhoriz, relvert ) Position a UI element uihandle2 within uihandle1. If relhoriz is positive, it is 1 more than the desired distance from the left edge of uihandle1 to the left edge of uihandle2. If negative, it is similarly applied to the right hand sides. If zero, no horizontal repositioning is done. relvert similarly applies to vertical repositioning, with positive values applying to the bottom edge and negative to the top edge.

addMenuHelp.m

addMenuHelp( hm, m, helptexts, separator ) hm is a handle to a help menu, to which an item should be added to provide help for the menu or menu item m. If m is a menu item, the correspomnding help menu item will bring up a dialog showing some helpful text for that item. If m is a menu (i.e. it has children), then a menu will be created whose first item will be the help item for m, and whose remaining items or submenus will provide the help for the children of m. helptexts is a struct which maps the tag of each menu or menu item to its help text. If separator is true, a separator should appear before the help menu item.

addUserData.m

ud = addUserData( h, fieldname, value, fieldname, value, ... ) Set fields of the UserData attribute of the handle h. The complete UserData struct is returned.

addpathif.m

added = addpathif( d ) As addpath(d), but returns true if and only if d was not already on the path. If d is already on the path, addpath(d) is still called, as this has the effect of moving d to the beginning of the path.

alignPics.m

askForFloat.m

i = askForFloat( title, prompt, dflt, bounds ) Put up a modal dialog asking the user to enter a floating point number. The dialog will have the specified title. The PROMPT string will be displayed as static text above the text-entry box. DFLT is the initial contents of the text-entry box. The result will be [] if the user cancelled the dialog (by clicking the "Cancel" button, clicking the close box, or hitting escape). Otherwise, it will be the final contents of the text-entry box, interpreted as a floating-piont number. If it is invalid, the dialog will be re-opened. BOUNDS is a pair of numbers, a lower and upper bound of acceptable answers. If omitted, it defaults to [-Inf Inf].

askForInt.m

i = askForInt( title, prompt, initval ) Put up a modal dialog asking the user to enter an integer. The dialog will have the specified title. The PROMPT string will be displayed as static text above the text-entry box. INITVAL is the initial contents of the text-entry box. The result will be [] if the user cancelled the dialog (by clicking the "Cancel" button, clicking the close box, or hitting escape). Otherwise, it will be the final contents of the text-entry box, interpreted as an integer. If it is invalid, the dialog will be re-opened.

askForNumlist.m

[nums,ok] = askForNumlist( title ) Put up a dialog that asks the user for a list of numbers. TITLE is the title of the dialog. If the user types something syntactically invalid, the dialog will be re-presented. If the user cancels the dialog, OK will be false and NUMS will be empty, otherwise OK will be true and NUMS will be the list of numbers. Matlab A:B and A:B:C syntax is supported: these will be expanded out to the equivalent series of values.

askForString.m

[s,ok] = askForString( title, prompt, initval ) Put up a modal dialog asking the user to enter a single line of text. The dialog will have the specified title. The PROMPT string will be displayed as static text above the text-entry box. INITVAL is the initial contents of the text-entry box. The result S will be empty and OK will be false if the user cancelled the dialog (by clicking the "Cancel" button, clicking the close box, or hitting escape). Otherwise, S will be the final contents of the text-entry box and OK will be true. All arguments are optional and default to the empty string.

askForStringDlg.m

Begin initialization code - DO NOT EDIT

askForText.m

[x,ok] = askForText( title, rubric ) Present a modal dialog to request some multiline text from the user. TITLE will be used as the title of the figure and RUBRIC is a string that will appear within the figure at the top. x will be returned as a one-dimensional character array containing newline characters to separate the lines. Trailing spaces before newlines will have been removed. OK will be true if the user clicked the OK button, false if the user cancelled the dialog. In the latter case X will be empty.

autoSubMenus.m

autozoomcentre.m

camParams = autozoomcentre( camParams, bbox, zoom, centre ) Adjust the camera params so as to look at the centre of the bbox (if centre is true) and have the bbox fill the field of view (if zoom is true). bbox is a 6-element vector as returned by axis().

axissize.m

basicLineStyle.m

[lw,ls] = basicLineStyle( width ) Because Mathworks don't think zero is a number.

bgColorPick.m

callbackName.m

centreDialog.m

Set the position of the dialog - centered on the callback figure if available, else, centered on the screen

checkMenuItem.m

checkMenuLengths.m

ok = checkMenuLengths( mh, maxlen ) Check that neither the menu mh nor any of its descendants has more than maxlen children.

checkSlider.m

checkTerminationKey.m

closeDialog.m

collectDialogData.m

complain.m

confirmDialog.m

ok = confirmDialog( format, varargin ) Put up a two-button dialog to ask the user to confirm some operation. The text of the dialog will be the result of sprintf( format, varargin ). The buttons will be labelled 'OK' abnd 'Cancel'.

confirmOverwrite.m

connectTextAndSlider.m

connectTextAndSlider( hText, hSlider, name, callback ) Connect the text item and the slider, so that changes to either will show up in the other and invoke the callback. The callback should expect to be called thus: callback( hObject, name, x ) where hObject is the handle to the slider and x is the value, of type double. NAME and CALLBACK can be omitted.

defaultButtonDownFcn.m

defaultButtonDownFcn( hObject, eventData ) Install this into any graphics object that should pass button down events to its parent. IMHO, this ought to be the default behaviour, but the default behaviour is to ignore the event. For objects that process some mouse-down events but not others, call this function from that object's ButtonDownFcn when it decides it does not want to handle the event itself.

defaultScaleBarUnit.m

deleteMenuItems.m

dialogOutputFcn.m

Get the result of the dialog.

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Utils\UI\dialoglayout

abutUIElement.m

abutUIElement( uihandle1, uihandle2, isHoriz, distance ) Position uihandle2 relative to uihandle1. If isHoriz is true, it is positioned on the same horizontal line, otherwise the same vertical line. alignMode = 0 if it is to be centred, -1 if left/bottom edges aligned, 1 is right/top edges aligned. distance is the size of the gap between them.

buildFigure.m

WORK IN PROGRESS

buildRSSSdialogFromFile.m

[result,s] = buildRSSSdialogFromFile( fn, initvals, userdata, initfun ) Create a dialog from the dialogspec contained in the file called fn. Fill it with values from initvals (a struct mapping item tags to values). Perform the (modal) dialog and return the result. result is empty if the user cancelled the dialog (by hitting a cancel button, hitting the escape key, or clicking the close box on the dialog). Otherwise, result is a structure mapping item tags to their values when the user closed the dialog. s is a structure describing the dialog and should be ignored. It exists only for debugging purposes.

buildRSSSstructdialog.m

compactRSSSSpace.m

computeIntervals.m

s = computeIntervals( s ) s is a tree structure whose nodes may each have these attributes: natsize: natural size (a number) actualsize: actual size (a number) position: two numbers: startpos and length. align: 'min', 'max', 'mid', or 'fill'. When s is given, none of the position attributes are set. All leaves have a natsize and the root has a maxsize.

convertStringsToHandles.m

items = convertStringsToHandles( parent, items ) items is a nested cell array of strings. This procedure crawls over the structure, replacing strings that it recognises by GUI handles which it creates. The recognised strings are: 'OK' 'Cancel' 'OKCancel' all of the standard uicontrol type names These are recognised when they occur as the first child of a parent node. For the first three, the other children are also processed. For the last, the other children are interpreted as its parameters.

createDialog.m

figure_SpaceItems.m

figure_SpaceItems( parent, items, bbox, vn, hsep, vsep, hmargin, vmargin ) WORK IN PROGRESS parent is a panel or a figure. items is an array of handles to UI items. The procedure lays out the items within the parent in a regular grid according to the remaining parameters. bbox is the bounding box of an area within the parent that the items are to be placed. If it is empty, it defaults to the full size of the parent. hn is the number vertically. vn is the number vertically. hsep is the horizontal space between items. vsep is the vertical space between items. hmargin is the horizontal space between items and the bounding box. vmargin is the vertical space between items and the bounding box.

fillRSSSdefaults.m

forceRSSSPosition.m

getLayoutStructItem.m

getRSSSFromFile.m

getRSSSPositions.m

handleInteriorSize.m

insetPosition.m

pos = insetPosition( pos, inset ) POS is an array [x y w h]. INSET is an array [left right top bottom]. The result is a position which is inset from the given position by the given amount on each edge.

isgroupinghandle.m

layoutItem.m

layoutSkeleton.m

listGUIObjects.m

makeCancelButton.m

h = makeCancelButton( fig, pos ) Make a standard Cancel button in the given figure at the given position. FIG can also be a uipanel handle.

makeEditableText.m

h = makeEditableText( fig, pos, tag, inittext, multiline ) Make a standard editable text object.

makeGeneralDialog.m

makeOKButton.m

h = makeOKButton( fig, pos ) Make a standard OK button in the given figure at the given position. FIG can also be a uipanel handle.

makeStaticText.m

modelessRSSSdialogFromFile.m

[fig,s] = modelessRSSSdialogFromFile( fn, initvals, userdata, initfun ) Perform a modeless dialog. The arguments are the same as those for performRSSSdialogFromFile. FIG is a handle to the dialog window. S (for debugging purposes) contains a struct describing the dialog layout. See also: performRSSSdialogFromFile.

normaliseGUIItemSize.m

normaliseTag.m

tag = normaliseTag( tag ) Take a string from which a GUI object tag is to be made, and normalise it by: * Converting to lower case. * Deleting everything other than lower case letters, numbers, underscore, and spaces. * Deleting leading and trailing spaces. * Replacing all remaining spaces by underscores. If tag is a cell array, each member will be normalised.

parseRSSS.m

s = parseRSSS( ts ) Parse the token stream ts, returning a structure s.

performDialog.m

performRSSSdialogFromFile.m

[result,s] = performRSSSdialogFromFile( fn, initvals, userdata, initfun ) Perform a modal dialog. The layout of the dialog is specified in the text file FN. Initial values can be supplied by the struct INITVALS. USERDATA will be stored (together with a struct defining the dialog layout -- this is only for debugging purposes) in the 'Userdata' field of the dialog window. INITFUN is a function which will be called after constructing the dialog but before making it visible, in order to make any changes to it that cannot be done by setting initial values and storing user data. It receives the window handle as its only argument. All arguments except the first are optional. RESULT will be empty if the user cancels. Otherwise, it will be a struct mapping the tags of all editable GUI elements to the corresponding values. S (for debugging purposes) contains a struct describing the dialog layout. See also: modelessRSSSdialogFromFile.

printSetupCode.m

rectifyRSSSPositions.m

Pass 1: Compact all space.

setPositionsInDialog.m

setRSSSColors.m

s = setRSSSColors( s )

setRSSSPositions.m

showGUIPositions.m

testPerformDialog.m

dirnames.m

names = dirnames( filename ) Like DIR, but return a cell array of just the names.

displayFileInDlg.m

displayTextDialog.m

displayTextDialog( title, msg ) Present a modal dialog displaying some text to the user. TITLE will be used as the title of the dialog and MSG is a string that will appear within the dialog. The user may hit return or escape to dismiss the dialog.

displayTextInDlg.m

dragviewButtonDownFcn.m

dragviewButtonDownFcn( hObject, eventData ) Installing this as the ButtonDownFcn for an axes object or its children will cause a click on the object to produce panning, zooming, or trackball-like behaviour when the mouse is dragged. This routine temporarily stores all the information it needs to process the mouse movement, in the field 'clickdragData' of the guidata of the figure. The field is deleted when the mouse button is released. As a side-effect, all of the camera mode properties of the axes are set to manual. There is more than one way to map mouse movement to rotation, and the choice is a matter of design. Three mappings are implemented, and the choice can be specified by setting the 'trackballMode' field of guidata. 'global' (the default) maps trackball coordinates [x,y] to a rotation about an axis perpendicular to that vector in the (cameraright,cameraup) plane, by an amount proportional to the length of the vector. 'local' maps incremental motion of the mouse to incremental rotation in the same way. 'upright' maps trackball coordinates [x,y] to azimuth and elevation, maintaining the camera up vector equal to [0 0 1]. This is equivalent to the trackball mode available from the standard camera toolbar, except that the scaling may be different. Global and Upright mode have the advantage that mouse positions are uniquely mapped to rotations: moving the mouse back to its starting point restores the axes to its original orientation. Local mode has the advantage that the current rotation axis is always perpendicular to the current mouse velocity. There is no mapping of trackball data to axes rotation that allows both of these. The scaling factor is currently set so that movement by a distance equal to the smaller of the width and height of the axes object rotates it by 2 radians.

dumpFigure.m

dumpFigure( fig ) Print an indented list of the contents of the figure.

edittextCreateFcn.m

enableGUIitem.m

enableHandle.m

exitDialog.m

figureaxes.m

ax = figureaxes( fig, legends ) FIG is a figure handle. Return a list of all the children of FIG that are axes handles. If LEGENDS is true (the default is false) then legend axes will be included.

fillAxes.m

fillAxes( h, color ) Clear the axes object h and fill it with the given colour.

findBadCheckbox.m

findinpath.m

x = findinpath( d, p ) Returns 0 if d is not a directory on the path p, otherwise the index of d's position in p. If p is not supplied the current command path is used.

firstOnPath.m

x = firstOnPath() Return the first directory on the Matlab command path. Returns the empty string if the path is empty (which should never happen).

forceMenuSeparator.m

forceMenuSeparator( h ) This is a workaround for a bug in Matlab 2010a on Mac OS, whereby in some circumstances, menu separators fail to appear even though the 'Separator' attribute of the menu handle is properly set.

forcepixelunits.m

fullpath.m

pname = fullpath( fname, relto ) Find the full path name of a given file name. If the filename is relative, it is taken to be relative to the directory relto, which defaults to the current directory.

genpathnodot.m

s = genpathnodot( d ) Like genpath, except that the argument is required, and directories whose name begins with a dot are excluded.

getCameraParams.m

getCheckedSubmenu.m

[h,n] = getCheckedSubmenu( menuhandle ) Return the handle and position of the first child of menuhandle that has a checkmark. If there are none, return zero and the empty list.

getDialogItemData.m

getDoubleFromDialog.m

getDoubleFromString.m

getFontDetails.m

fd = getFontDetails( h ) Find the font properties of the graphics handle h. The result is a structure with the fields FontName, FontUnits, FontSize, FontWeight, and FontAngle. All values are strings. Missing fields are returned as empty strings.

getIntFromDialog.m

getIntFromString.m

getMenuChildren.m

c = getMenuChildren( h ) Return a list of the children of h in the same order they appear in the menu.

getMenuIndexFromLabel.m

getMenuLabelFromIndex.m

getMenuLabelsFromIndex.m

getMenuSelectedIndex.m

getMenuSelectedLabel.m

getPatchHit.m

n = getPatchHit( patchHandle, hitPoint ) Given the hitPoint as returned by get( gca, 'CurrentPoint' ) and a patch handle, determine which polygon was hit. Matlab must know this, in order to have detected a hit on the patch, but I can't find any way of getting this information. The test is performed by determining which of the polygons enclose the line, and then taking the one whose centroid is closest to the near end of the line.

getRootHandle.m

getSelectionType.m

selectionType = getSelectionType( hitObject ) Get the mouse/keyboard modifier information for a click on an object contained in an axes contained in a figure. We have to hunt up the chain of parents to find the object that has the SelectionType information.

getViewWidth.m

getsubdirs.m

dirs = getsubdirs( dir, ... ) Return the names of the directory dirname and all its subdirectories, except for directories matching any of the regexp patterns given as subsequent arguments. The result is a single string in which the names of all the directories are concatenated, separated by a ':' character. This string can be passed to the path() command, to add all of these directories to the MATLAB command path.

groupRadioButtons.m

handleSliderToText.m

handleTextToSlider.m

inputFilterspec.m

filters = inputFilterspec( extensions, allowall ) Given a cell array of file extensions (which must NOT include the initial "."), construct a filterspec for use with uigetfile. If allowall is given, it specifies whether to include the 'All files' option. The default is to include it. If there is more than one extension in the list, the 'All suitable' option will be included as the first filter.

insertDefaultsInDlg.m

installDefaultButtonDownFcn.m

installDefaultButtonDownFcn( h ) Install a default ButtonDownFcn into h and all of the children of h, recursively. defaultButtonDownFcn transmits mouse-down events to the first ancestor that has a nonempty ButtonDownFcn property.

isMenuSelectedLabel.m

isPathPrefix.m

isprefix = isPathPrefix( shorter, longer ) SHORTER and LONGER are paths to files. This procedure determines whether SHORTER is a path prefix of LONGER. This is true if SHORTER is a prefix of LONGER, and either SHORTER ends with a file separator ('/' or '\'), or the next character of LONGER, if there is one, is a file separator.

isabsolutepath.m

isabs = isabsolutepath( filename ) Determine whether the filename is an absolute pathname or not. It is deemed to be absolute if it begins with a slash, a backslah, or /[A-Za-z]:/.

ischeckedMenuItem.m

labelAxes.m

lightAxes.m

lightAxes( theaxes, turnLightOn ) Turn lighting for the given axes object on or off. To turn the light off, every child object of type 'light' is deleted. To turn it on, if there is already a child object of type 'light', nothing is done. Otherwise a light is created with default properties.

magicButtonBackgroundColor.m

Magic value that makes buttons take on the native platform appearance (at least on a Mac).

makeDirMenu.m

h = makeDirMenu( parent, dirstruct, readonly, callback ) Take a structure returned by findProjectDirs and make a hierarchy of menus, as a child of the parent menu. The userdata field of each menu item will contain these fields: fullname: the full pathname to the directory basename: the base name of the directory readonly: a boolean to indicate whether projects within this directory should be treated as read-only.

makePackedMenu.m

makePackedMenu( parent, position, menudata, maxmenulength, mintopmenulength ) Create a tree of submenus of the given parent menu. MENUDATA is an array of structs, one for each of the menus to be created. These structs contain the parameters to be supplied to uimenu for each menu. They must define the 'Label' property and may define any others; typically they will define at least the 'Callback' property. All of them must define the same set of parameters. If a parameter is needed for some menu items but not others, provide an empty value or an appropriate default value for those where it is not needed. The maximum length of any of the created menus will be MAXMENULENGTH. PARENT is the top-level menu into which the items will be inserted, starting at POSITION. PARENT may already have other menu items; in this case the number of top level items inserted will be no more than will bring the total length of the parent up to MAXMENULENGTH, unless this would result in fewer than MINTOPMENULENGTH top-level items, in which case MINTOPMENULENGTH top-level items will be inserted.

menuPath.m

modalOpeningFcn.m

Choose default command line output for timeunitDlg

mygetframe.m

f = mygetframe( theaxes ) Like getframe(), but brings the axes to the front.

myquiver3.m

MYQUIVER3 3-D quiver plot. This differs from the standard quiver3 in the following ways: 1. The origins and velocities are given as row vectors, or matrices of the same. 2. It takes an additional argument NORMALS, which should follow the velocity argument. The arrowheads will be drawn in a plane perpendicular to the corresponding normal vector. 3. It takes an additional argument HEADSIZE specifying the size of the arrowheads as a proportion of the size of the shaft. The handle returned by quiver3 has a MaxHeadSize attribute, but I find there appears to be a maximum size that it allows, irrespective of the value requested. 4. It takes an additional argument AXISHANDLE. 5. It does not return a quiver object. Instead, it returns an N*3 array of handles to line objects. The three handles in each row are the shaft and two barbs of a single arrow.

newlistdlg.m

This is a reimplementation of the MATLAB listdlg() using my dialog layout system. The arguments are identical to those for listdlg(): 'ListString' cell array of strings for the list box. 'SelectionMode' string; can be 'single' or 'multiple'; defaults to 'multiple'. 'ListSize' [width height] of listbox in pixels; defaults to [160 300]. 'InitialValue' vector of indices of which items of the list box are initially selected; defaults to the first item. 'Name' String for the figure's title; defaults to.'PromptString' string matrix or cell array of strings which appears as text above the list box; defaults to {}. 'OKString' string for the OK button; defaults to 'OK'. 'CancelString' string for the Cancel button; defaults to 'Cancel'.

nums2string.m

s = nums2string( x, fmt ) Format a list of numbers to a string, using FMT as the format for each number.

numsDlg.m

Begin initialization code - DO NOT EDIT

offsetCameraParams.m

camParams = offsetCameraParams( camParams, eyeoffset )

opendir.m

[ok,msg] = opendir( dirname ) Open the named directory on the desktop, by default the current working directory. This works on Mac OS X and Windows systems. It might work on Linux or other Unix systems, but this has not been tested. If dirname is a relative path name, it will be interpreted relative to the current working directory. If dirname is the name of a file, its containing directory will be opened. If dirname does not exist, no action is taken. status will be 0 for success and nonzero for failure. If nonzero, then msg will be an error message. If the msg parameter is not asked for, the message will be written to the Matlab console.

openmdir.m

success = openmdir( mname ) Open an Explorer window for the directory containing the given Matlab command. If the return argument is specified, it will be 1 for success and 0 for failure. If it is not, then on failure an error message will be written to the Matlab console.

outputFilterspec.m

filters = inputFilterspec( extensions ) Given a cell array of file extensions (which must NOT include the initial "."), construct a filterspec for use with uiputfile.

packmenu.m

packmenu( menuhandle ) This takes a handle to a menu and reorganises it so that no submenu contains more than maxitems items.

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\Utils\UI\projects

clearImageData.m

closeProject.m

makeNewProject.m

queryDialog.m

result = queryDialog( numbuttons, title, format, varargin ) Show a modal dialog displaying the result of sprintf( format, varargin{:} ). The title of the dialog will be TITLE. numbuttons must be 1, 2, or 3, and is the number of buttons in the dialog. Their labels will depend on the number of buttons: 1 button: OK 2 buttons: OK, Cancel 3 buttons: Yes, No, Cancel. Alternatively, the first argument can be a cell array of 1, 2, or 3 strings. These strings will specify the labels of the buttons. If title is empty, it will default to a string depending on the number of buttons: 'Alert', 'Confirm', or 'Query' respectively. The result is the index of the selected button. Hitting return selects the first button. Hitting escape selects the last button (even if that is the same as the first button). Closing the dialog returns 0 (this should be taken to be equivalent to selecting the last button). The text of the dialog can have any length. The dialog will automatically be resized to fit.

querydlg.m

QUERYDLG M-file for querydlg.fig QUERYDLG, by itself, creates a new QUERYDLG or raises the existing singleton*. H = QUERYDLG returns the handle to a new QUERYDLG or the handle to the existing singleton*. QUERYDLG('CALLBACK',hObject,eventData,handles,...) calls the local function named CALLBACK in QUERYDLG.M with the given input arguments. QUERYDLG('Property','Value',...) creates a new QUERYDLG or raises the existing singleton*. Starting from the left, property value pairs are applied to the GUI before querydlg_OpeningFunction gets called. An unrecognized property name or invalid value makes property application stop. All inputs are passed to querydlg_OpeningFcn via varargin. *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one instance to run (singleton)". See also: GUIDE, GUIDATA, GUIHANDLES

removeUserDataFields.m

restoreColor.m

restoreColor( h ) Set the BackgroundColor of h to the value saved in the UserData.

safeSetHandleFields.m

safeSetHandleFields( h, s ) H is a graphics handle, S is a struct, and FNS is a set of fieldnames (which defaults to the set of all fieldnames of S). For every field that occurs in FNS, S, and H, this procedure sets that field of H to its value in S. All error conditions are ignored and there is no return value. Case is ignored, e.g. fontweight and FontWeight will both be recognised as valid fields of a text item.

saveColor.m

saveColor( h ) Store the foreground and background color attributes of h in its UserData, so that if we have occasion to temporarily change the colors, we can later restore the original values.

scalebarsize.m

selectButton.m

selectButton( onButton, buttons ) onButton is a radio button or checkbox and buttons is an array of buttons of checkboxes which includes onButton. None of the buttons should belong to a button group. This routine creates the effect of a button group: onButton is set to on and all the other buttons are set to off. The result is the index of onButton in buttons. If onButton is not in the list, the result is zero. All of the buttons in such a pseudo-group should have the same callback function. This function should call SELECTBUTTON, passing the current handle as the first argument and a list of all the buttons in the group as the second. The result tells it which button was clicked. If the result is zero, this means that the currently selected button was clicked, and was a radio button. No action should be taken. If the result is negative, this means that the currently selected button was clicked, and was a checkbox, whose index is minus the return value. See also: WHICHBUTTON

selectGraphicObject.m

selectMenuByLabel.m

selectMenuChoice.m

selectMenuChoice( hObject ) Make the menu item hObject be the only checked item in its parent menu.

setCameraParams.m

fprintf( 1, 'setCameraParams pos [%f %f %f] tgt [%f %f %f] up [%f %f %f] ang %f\n', ... cp.CameraPosition, cp.CameraTarget, cp.CameraUpVector, cp.CameraViewAngle );

setDoubleInTextItem.m

setGUIElementColor.m

setGUIElementColor( h, c ) Sets the colour of the GUI element H to color C, without caring whether the relevant field is called 'Color' or 'BackgroundColor'.

setGUISizes.m

setManualCamera.m

setMenuHighlight.m

hadhighlight = setMenuHighlight( menuhandle, sethighlight ) Highlight or dehighlight a menu item. If it has no children do this by setting or removing the checkmark. If it has children, do this by adding or removing the string '* ' at the beginning of the menu label. We do this because checkmarks cannot be applied to menu items that have children. The 'Checked' attribute can be set but has no visual effect. We cannot do highlighting by changing the text style or colour of a menu or menu item, because Matlab does not support it, and the unsupported way of doing it (by using HTML in the label) works only when menus are implementd by Java Swing, which at least on Mac OS they are not.

setMenuItemStyle.m

setMenuItemItalic( menuhandle, italic ) Set or remove the italic, bold, or underline properties of the given menu handle. The style is a string whose characters mean: 'I' italic 'i' nonitalic 'B' bold 'b' nonbold 'U' underline 'u' no underline 'H' coloured (colour is hard-wired in this procedure) 'h' uncoloured (black) Type style settings for Matlab menu items are performed by using HTML in the Label property of the menu handle. Your menu callback for the item should therefore not depend on the label to determine which menu item it is. The new label and the old label are returned.

setPixelUnits.m

setShowHideMenuItem.m

setShowHideMenuItem( h, v ) For a menu item having a label of the form 'Show ...' or 'Hide ...', set it to 'Hide ...' if v is 1, otherwise 'Show ...'. See also: toggleShowHideMenuItem, valueShowHideMenuItem.

setSliderAndText.m

setTextAndSlider.m

setTextAndSlider( h, x ) H is either a text object or a slider, of a pair which are linked to each other. x is a double. The slider is given the value of x, and the text object is given the value as a string.

setViewWidth.m

setVisibility.m

showHandleInfo.m

simpleExceptionMessage.m

sliderToTextCallback.m

sliderToTextCallback( hObject, eventdata )

standardResize.m

standardResize(hObject, handles) hObject handle to GFTwindow (see GCBO) handles structure with handles and user data (see GUIDATA) This is a figure resize callback routine. It assumes that the figure consists of two parts: a control panel of fixed size, and a picture which is to be automatically resized to take up maximum space in the window. The picture has horizontal and vertical scroll bars, and a text area below the latter: all of these are to be moved and resized along with the picture. Handles is assumed to have the following fields: initmainpanelposition: A 4-element array containing the initial position and size of the control panel. margin: The distance between the control panel and the top and left edges of the window. picturepanel Handle to the panel containing the picture. picture, legend, elevation, roll, azimuth, report: Handles for the picture, the vertical scroll bars, the horizontal scroll bar, and the text area respectively.

stereoPairAxes.m

stereoPairAxes( ax1, ax2, vergence, trackball ) Make the two axes objects into a stereo trackball pair, by storing in the guidata of each a reference to the other and the angle of convergence. ax1 is assumed to be the left eye view and ax2 the right eye view, in which case vergence should be positive. The trackball argument is optional and defaults to false. If true, trackballButtonDownFcn is installed as the ButtonDownFcn in both axes objects and all their children. Clicking and dragging on either window will rotate both views together. If you only want trackball functionality part of the time -- for example, only when the user does a control-click-drag -- then you should not install it here, but call trackballButtonDownFcn from your own ButtonDownFcn when you detect that trackball behaviour is required.

stereoTransfer.m

stereoTransfer( varargin ) Set the viewpoint of one axes to that of another, rotated about the camera up vector. stereoTransfer(AX) will transfer the view of the axes AX to the axes contained in AX's guidata element stereodata.otheraxes, rotated by stereodata.vergence (an angle in radians). stereoTransfer() is equivalent to stereoTransfer(gca). stereoTransfer( AX1, AX2, VERGENCE ) will transfer the view from AX1 to AX2, offset by the angle VERGENCE. stereoTransfer( AX, POSITION, TARGET, UP, VERGENCE ) will set the view of the axes AX to the result of offsetting the view by a rotation about UP by VERGENCE, from the view specified by the given camera POSITION, TARGET, and UP vectors. In all cases, vergence must be an angle in radians. If the view is being transferred from the left eye to the right eye, vergence should be positive. If the distance between someone's eye is E and they are a distance D from the screen, vergence should be E/D radians. The resulting view is returned in the output arguments.

svnrevision.m

[revs,dates] = svnrevision( dirname, recurse ) Find the SVN revision number and date of revision of a directory, and optionally, all its subdirectories. In the latter case, if there is more than one revision number, the list of revision numbers and dates found will be returned in reverse chronological order, with duplicates omitted. revs(1) is therefore always the most recent revision found, and dates{1} the most recent revision date. If a directory is not under SVN control, revs is 0 and dates is.In a recursive search, subdirectories whose name begins with '.' are ignored. DIRNAME itself can begin with a '.' and will be searched. If a directory is not under SVN control, its subdirectories will still be searched. WARNING AND IMPLEMENTATION: The documentation for SVN explicitly denies offering any way to read this information, so I have had to discover where it resides by trial and error. Since it is undocumented, my code might break in future revisions of SVN, and I cannot be sure that it will work under all circumstances in the current version of SVN. The method is to look in the file .svn/entries. The third token in this file is the revision number, and the sixth is the date in Zulu format. Richard Kennaway 2011.

testAndClear.m

textToSliderCallback.m

textToSliderCallback( hObject, eventdata )

toggleCheckedMenuItem.m

toggleShowHideMenuItem.m

v = toggleShowHideMenuItem( h ) For a menu item having a label of the form 'Show ...' or 'Hide ...', switch from one state to the other. Return 1 if the old state was 'Show ...', otherwise 0. See also: setShowHideMenuItem, valueShowHideMenuItem.

trackballButtonDownFcn.m

trackballButtonDownFcn( hObject, eventData ) Installing this as the ButtonDownFcn for an axes object or its children will cause a click on the object to produce trackball-like behaviour when the mouse is dragged. This routine temporarily stores all the information it needs to process the mouse movement, in the field 'trackballData' of the guidata of the figure. The field is deleted when the mouse button is released. As a side-effect, all of the camera mode properties of the axes are set to manual. There is more than one way to map mouse movement to rotation, and the choice is a matter of design. Three mappings are implemented, and the choice can be specified by setting the 'trackballMode' field of guidata. 'global' (the default) maps trackball coordinates [x,y] to a rotation about an axis perpendicular to that vector in the (cameraright,cameraup) plane, by an amount proportional to the length of the vector. 'local' maps incremental motion of the mouse to incremental rotation in the same way. 'upright' maps trackball coordinates [x,y] to azimuth and elevation, maintaining the camera up vector equal to [0 0 1]. This is equivalent to the trackball mode available from the standard camera toolbar, except that the scaling may be different. Global and Upright mode have the advantage that mouse positions are uniquely mapped to rotations: moving the mouse back to its starting point restores the axes to its original orientation. Local mode has the advantage that the current rotation axis is always perpendicular to the current mouse velocity. There is no mapping of trackball data to axes rotation that allows both of these. The scaling factor is currently set so that movement by a distance equal to the smaller of the width and height of the axes object rotates it by 2 radians. A different value can be set by setting the 'trackballScale' field of the figure's guidata to the requried value.

trycd.m

olddir = trycd( newdir ) Like CD, but prints a warning if it fails instead of raising an exception. If it fails, olddir will be set to the empty string. See also: CD

tryget.m

tryget( h, varargin ) Get attributes of a handle. Do not crash if any of them do not exist.

tryset.m

ok = tryset( h, varargin ) Set attributes of a handle. Do not crash if anything goes wrong, just return a boolean to indicate success or failure.

tryuncd.m

uiputdir.m

dirname = uiputdir( startpath, title ) Provide a way for the user to create a new directory. uigetdir can be used for this purpose, but we have found that users find the resulting dialog confusing. uiputdir as defined here performs two successive dialogs: the first to obtain a name for the directory that should be created, and the second to select a directory within which to create it. If the directory to be created already exists, the user will be asked if they want to use it, or to try again with a different name. startpath is the directory from which the directory-selection dialog will start. prompt1 is the prompt displayed in the dialog asking the user for the name of the new directory. prompt2 is the prompt displayed in the dialog asking the user to select a parent directory. On Mac OS, the latter dialog does not display prompt2 anywhere. All arguments are optional. startpath defaults to the current directory, and prompt1 and prompt2 default to the empty string.

validateGUI.m

ok = validateGUI( h ) Make validity checks of the GUI element h.

valueShowHideMenuItem.m

v = valueShowHideMenuItem( h ) For a menu item having a label of the form 'Show ...' or 'Hide ...', return 0 if the label is 'Show ...', otherwise 1. This may seem to be the opposite of what one would expect, but remember that when the menu command says 'Hide', the last menu command that the user performed was 'Show', and vice versa. See also: setShowHideMenuItem, toggleShowHideMenuItem.

viewControlIcon.m

whichButton.m

whichButton( buttons ) buttons is an array of radio buttons. None of the buttons should belong to a button group. This routine creates the effect of a button group: it returns the index of the first button that is set to on, or zero if there is no such button. See also: SELECTBUTTON

adddirstopath.m

dirs = adddirstopath( dir, ... ) Add dir and all its subdirectories to the path, except for directories matching any of the patterns given as subsequent arguments.

addstrings.m

s = addstrings( s, ss ) Concatenate the strings in the cell array ss onto the end of s, each with an added newline.

allfileparts.m

allmin.m

[y,i] = allmin( x ) Return the minimum value of the vector x, and a list of indexes of all elements of x having that value.

alphabins.m

binsizes = alphabins( names, maxbin ) Result is list of indexes saying which bin each name belongs to. Names are assumed already sorted. No multi-level hierarchy: either no bins required or one level of binning.

appendFileToStream.m

ok = appendFileToStream( fid, filename ) Append the contents of the named file to the open output stream. The result is true if the operation succeeds, false otherwise. No error messages are generated if the operation fails.

array2cellarray.m

ca = array2cellarray( a ) a is an N*2 array which is assumed to be sorted by its first column. The result is a cell array of arrays such that ca{i} is an array of all values of a(:,2) for which the corresponding element of a(:,1)==i.

binsearchall.m

i = binsearchall( vec, vals ) Apply binsearch to vec and every member of the array vals. The result is a matrix the same shape as vals.

binsearchupper.m

i = binsearchupper( vec, val ) Find that i such that vec(i-1) < val <= vec(i), where vec(0) and vec(length(vec)) are notionally considered to be -Inf and +Inf. val may be a vector, in which case i will be a column vector of the same length. THIS FUNCTION SHOULD BE DELETED, AND EVERYWHERE THAT THIS FUNCTION IS CALLED SHOULD BE REVISED TO USE MATLAB'S binsearch INSTEAD. THE MATLAB FUNCTION IS DEFINED DIFFERENTLY TO THIS ONE, SO EVERY CALL OF THIS ONE MUST BE CHANGED ACCORDINGLY.

blueRedCmap.m

boing.m

boolchar.m

canUseGPUArray.m

canonicalNewlines.m

s = canonicalNewlines( s ) Force Unix newline convention: replace crlf and cr by lf.

capitalise.m

checkallints.m

ok = checkallints( msg, list, max ) Check that list is 1:max. Complain if not. List is expected to be a list of integers resulting from a call of unique(), i.e. sorted with no repetitions. This implies that it is necessary and sufficient that it have the right length, and if nonempty, begins with 1 and ends with max.

colorDistance.m

d = colorDistance( rgb1, rgb2 ) A very crude estimate of psychological color distance.

colorStep.m

cmap = colorStep( c1, c2, n, open1, open2 ) Construct a colour map with n elements, going from c1 to c2. If open1 is true, the first value will be omitted. If open2 is true, the last value will be omitted. open1 and open2 default to false.

compareObs.m

contrastColor.m

cc = contrastColor( c ) Find a colour that contrasts well with C, so that if either colour is the background, the other can be used for text in the foreground. This is a fairly crude algorithm: each RGB component is 0 or 1, depending on which is further from that component of C.

copyFilesAndFolders.m

copyFilesAndFolders( oldpath, newpath, includes, excludes ) Copy all files and folders from OLDPATH to NEWPATH that match any of the patterns in INCLUDES and do not match any of the patterns in EXCLUDES. OLDPATH must exist. NEWPATH will be created. INCLUDES and EXCLUDES are cell arrays of regular expressions. If INCLUDES is empty, it matches everything.

countreps.m

y = countreps( x ) X is a vector. X is divided into runs of repeated elements. Y is set to an N*2 array in which row i = [a,b] represents the i'th run by the value A and the number of repetitions B.

cov1.m

datasize.m

n = structsize( s ) Estimate the number of bytes in anything.

datestring.m

decodePermutation.m

pairs = decodePermutation( pairs ) PAIRS is an N*(2+M) array of integers. Every integer occurs exactly twice in the first two columns, and the two occurrences are in different rows. Thus the set of pairs defines a cyclic ordering of the set of integers. PAIRS will be reordered so that the first two columns represent that cyclic ordering.

deescape.m

s = deescape( s ) Replace backslash escapes in s by the characters they stand for.

endsWithM.m

result = endsWithM( s1, s2 ) Returns 1 if the string s1 ends with the string s2, 0 otherwise. This is called endsWithM to avoid a clash with a java function present in some systems called endsWith.

eraseFileContents.m

extendHeight.m

a = extendHeight( a, extra ) Add extra zero rows to an array.

fencepostindex.m

pi = pixelindex( position, firstpost, fencelength, numposts ) Given a set of numposts fenceposts, beginning at firstpost and with total extent fencelength, compute which fencepost position is closest to.

findCurrentAxesIfAny.m

ax = findCurrentAxesIfAny() Get the current axes object, if there is one, otherwise return empty. When this returns an axes object, it is the same one that gca would return.

findjobj.m

findjobj Find java objects contained within a specified java container or Matlab GUI handle Syntax: [handles, levels, parentIds, listing] = findjobj(container, 'PropName',PropValue(s), ...) Input parameters: container - optional handle to java container uipanel or figure. If unsupplied then current figure will be used 'PropName',PropValue - optional list of property pairs (case insensitive). PropName may also be named -PropName 'position' - filter results based on those elements that contain the specified X,Y position or a java element Note: specify a Matlab position (X,Y = pixels from bottom left corner), not a java one 'size' - filter results based on those elements that have the specified W,H (in pixels) 'class' - filter results based on those elements that contain the substring (or java class) PropValue Note1: filtering is case insensitive and relies on regexp, so you can pass wildcards etc. Note2: '-class' is an undocumented findobj PropName, but only works on Matlab (not java) classes 'property' - filter results based on those elements that possess the specified case-insensitive property string Note1: passing a property value is possible if the argument following 'property' is a cell in the format of {'propName','propValue'}. Example: FINDJOBJ(...,'property',{'Text','click me'}) Note2: partial property names (e.g. 'Tex') are accepted, as long as they're not ambiguous 'depth' - filter results based on specified depth. 0=top-level, Inf=all levels (default=Inf) 'flat' - same as specifying: 'depth',0 'not' - negates the following filter: 'not','class','c' returns all elements EXCEPT those with class 'c' 'persist' - persist figure components information, allowing much faster results for subsequent invocations 'print' - display all java elements in a hierarchical list, indented appropriately Note1: optional PropValue of element index or handle to java container Note2: normally this option would be placed last, after all filtering is complete. Placing this option before some filters enables debug print-outs of interim filtering results. Note3: output is to the Matlab command window unless the 'listing' (4th) output arg is requested 'list' - same as 'print' 'nomenu' - skip menu processing, for "lean" list of handles & much faster processing Output parameters: handles - list of handles to java elements levels - list of corresponding hierarchy level of the java elements (top=0) parentIds - list of indexes (in unfiltered handles) of the parent container of the corresponding java element listing - results of 'print'/'list' options (empty if these options were not specified) Note: If no output parameter is specified, then an interactive window will be displayed with a ^^^^ tree view of all container components, their properties and callbacks. Examples: findjobj; % display list of all javaelements of currrent figure in an interactive GUI handles = findjobj; % get list of all java elements of current figure (inc. menus, toolbars etc.) findjobj('print'); % list all java elements in current figure findjobj('print',6); % list all java elements in current figure, contained within its 6th element handles = findjobj(hButton); % hButton is a matlab button handles = findjobj(gcf,'position',getpixelposition(hButton,1)); % same as above but also return hButton's panel handles = findjobj(hButton,'persist'); % same as above, persist info for future reuse handles = findjobj('class','pushbutton'); % get all pushbuttons in current figure handles = findjobj('class','pushbutton','position',123,456); % get all pushbuttons at the specified position handles = findjobj(gcf,'class','pushbutton','size',23,15); % get all pushbuttons with the specified size handles = findjobj('property','Text','not','class','button'); % get all non-button elements with 'text' property handles = findjobj('-property',{'Text','click me'}); % get all elements with 'text' property = 'click me' Sample usage: hButton = uicontrol('string','click me'); jButton = findjobj(hButton); % or: jButton = findjobj('property',{'Text','click me'}); jButton.setFlyOverAppearance(1); jButton.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.HAND_CURSOR)); set(jButton,'FocusGainedCallback',@myMatlabFunction); % some 30 callback points available... jButton.get; % list all changeable properties... hEditbox = uicontrol('style',edit'); jEditbox = findjobj(hEditbox); jEditbox.setCaretColor(java.awt.Color.red); jEditbox.KeyTypedCallback = @myCallbackFunc; % many more callbacks where this came from... jEdit.requestFocus; Known issues/limitations: - Cannot currently process multiple container objects - just one at a time - Initial processing is a bit slow when the figure is laden with many UI components (so better use 'persist') - Passing a simple container Matlab handle is currently filtered by its position+size: should find a better way to do this - Matlab uipanels are not implemented as simple java panels, and so they can't be found using this utility - Labels have a write-only text property in java, so they can't be found using the 'property',{'Text','string'} notation Warning: This code heavily relies on undocumented and unsupported Matlab functionality. It works on Matlab 7+, but use at your own risk! Bugs and suggestions: Please send to Yair Altman (altmany at gmail dot com) Change log: 2007-11-14: Fixed edge case problem with class properties tooltip; used existing object icon if available; added checkbox option to hide standard callbacks 2007-08-15: Fixed object naming relative property priorities; added sanity check for illegal container arg; enabled desktop (0) container; cleaned up warnings about special class objects 2007-08-03: Fixed minor tagging problems with a few Java sub-classes; displayed UIClassID if text/name/tag is unavailable 2007-06-15: Fixed problems finding HG components found by J. Wagberg 2007-05-22: Added 'nomenu' option for improved performance; fixed 'export handles' bug; fixed handle-finding/display bugs; "cleaner" error handling 2007-04-23: HTMLized classname tooltip; returned top-level figure Frame handle for figure container; fixed callbacks table; auto-checked newer version; fixed Matlab 7.2 compatibility issue; added HG objects tree 2007-04-19: Fixed edge case of missing figure; displayed tree hierarchy in interactive GUI if no output args; workaround for figure sub-menus invisible unless clicked 2007-04-04: Improved performance; returned full listing results in 4th output arg; enabled partial property names & property values; automatically filtered out container panels if children also returned; fixed finding sub-menu items 2007-03-20: First version posted on the MathWorks file exchange: <a href="http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=14317">http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=14317</a> See also: java, handle, findobj, findall, javaGetHandles

formatvalue.m

getUserDataField.m

v = getUserDataField( h, fieldname ) Get a field of the UserData attribute of the handle h. If the field is absent, [] is returned.

interp.m

v = interp( keys, vals, x ) Look up x in keys (must be in ascending order) and return corresponding value from vals, with piecewise linear interpolation.

isAncestorDirOf.m

result = isAncestorDirOf( a, d ) Return TRUE if the pathname A is a prefix of pathname D.

isFullPathname.m

is_function_handle.m

iseof.m

ie = iseof( line ) Determines whether a value read from a file is signalling the end of the file.

isminusone.m

isrootpath.m

joinfloat.m

s = join( sep, f, fmt ) Concatenate the numbers in f together, separated by sep (by default a single space). The numbers are converted to strings by the format fmt, (default %.3f).

joinstrings.m

js = joinstrings( s, ss ) ss is a cell array of strings. Concatenate all members of ss together, separated by the string s.

makeCitation.m

makeCmap.m

makeFunctionName.m

ifname = makeIFname( modelname ) Turn an arbitrary string into something that can be a valid Matlab function name or struct field name. If this is not possible, return the empty string. All runs of non-alphanumerics are replaced by underscore, and the resulting string must begin with a letter.

makeRenumbering.m

[ newToOld, oldToNew ] = makeRenumbering( boolmap ) boolmap is a bitmap indicataing which elements of a vector are to be deleted. If W == V(boolmap), then we will have W == V(newToOld) and W(oldToNew) == V except where oldToNew is zero.

makechains.m

ch = makechains( r ) R is an N*3 matrix representing a labelled relation: the row [c e1 e2] represents an arrow from e1 to e2 labelled c. The relation is assumed to be either a set of linear chains, or a single cycle. The result is a representation of the chain as a list of alternate elements and labels, in which the above instance of the relation will appear as subsequence [... e1 c e2 ...]. Where the relation consists of more than one chain, they will be separated from each other in the list by a value of 0 (which is never the value of an element or label). The result will begin with some ei and end with some c.

makefilename.m

ifname = makefilename( modelname ) Turn an arbitrary string into something that can be a valid base file name (without extension). The string is mapped to lower case, and all non-alphanumerics are replaced by underscore.

myCamlight.m

CAMLIGHT Create or set position of a light. CAMLIGHT HEADLIGHT creates a light in the current axes at the camera position of the current axes. CAMLIGHT RIGHT creates a light right and up from camera. CAMLIGHT LEFT creates a light left and up from camera. CAMLIGHT same as CAMLIGHT RIGHT. CAMLIGHT(AZ, EL) creates a light at AZ, EL from camera. CAMLIGHT(..., style) set the style of the light. Style can be 'local' (default) or 'infinite'. CAMLIGHT(H, ...) places specified light at specified position. H = CAMLIGHT(...) returns light handle. CAMLIGHT creates or positions a light in the coordinate system of the camera. For example, if both AZ and EL are zero, the light will be placed at the camera's position. In order for a light created with CAMLIGHT to stay in a constant position relative to the camera, CAMLIGHT must be called whenever the camera is moved. See also LIGHT, LIGHTANGLE, LIGHTING, MATERIAL, CAMORBIT.

mycgs.m

MYCGS Conjugate Gradients Squared Method. See CGS for the documentation. This version behaves exactly the same except that it eliminates some unnecessary code for options we never use, adds a limit on the allowed wallclock time, and prints out an indication of progress.

myiterapp.m

MYITERAPP Multiply afun and x.

mylsqr.m

LSQR LSQR Method. X = LSQR(A,B) attempts to solve the system of linear equations A*X=B for X if A is consistent, otherwise it attempts to solve the least squares solution X that minimizes norm(B-A*X). The N-by-P coefficient matrix A need not be square but the right hand side column vector B must have length N. X = LSQR(AFUN,B) accepts a function handle AFUN instead of the matrix A. AFUN(X,'notransp') accepts a vector input X and returns the matrix-vector product A*X while AFUN(X,'transp') returns A'*X. In all of the following syntaxes, you can replace A by AFUN. X = LSQR(A,B,TOL) specifies the tolerance of the method. If TOL is [] then LSQR uses the default, 1e-6. X = LSQR(A,B,TOL,MAXIT) specifies the maximum number of iterations. If MAXIT is [] then LSQR uses the default, min([N,P,20]). X = LSQR(A,B,TOL,MAXIT,M) and LSQR(A,B,TOL,MAXIT,M1,M2) use P-by-P preconditioner M or M = M1*M2 and effectively solve the system A*inv(M)*Y = B for Y, where Y = M*X. If M is [] then a preconditioner is not applied. M may be a function handle MFUN such that MFUN(X,'notransp') returns M\X and MFUN(X,'transp') returns M'\X. X = LSQR(A,B,TOL,MAXIT,M1,M2,X0) specifies the P-by-1 initial guess. If X0 is [] then LSQR uses the default, an all zero vector. [X,FLAG] = LSQR(A,B,...) also returns a convergence FLAG: 0 LSQR converged to the desired tolerance TOL within MAXIT iterations. 1 LSQR iterated MAXIT times but did not converge. 2 preconditioner M was ill-conditioned. 3 LSQR stagnated (two consecutive iterates were the same). 4 one of the scalar quantities calculated during LSQR became too small or too large to continue computing. [X,FLAG,RELRES] = LSQR(A,B,...) also returns estimates of the relative residual NORM(B-A*X)/NORM(B). If RELRES <= TOL, then X is a consistent solution to A*X=B. If FLAG is 0 but RELRES > TOL, then X is the least squares solution which minimizes norm(B-A*X). [X,FLAG,RELRES,ITER] = LSQR(A,B,...) also returns the iteration number at which X was computed: 0 <= ITER <= MAXIT. [X,FLAG,RELRES,ITER,RESVEC] = LSQR(A,B,...) also returns a vector of estimates of the residual norm at each iteration including NORM(B-A*X0). [X,FLAG,RELRES,ITER,RESVEC,LSVEC] = LSQR(A,B,...) also returns a vector of least squares estimates at each iteration: NORM((A*inv(M))'*(B-A*X))/NORM(A*inv(M),'fro'). Note the estimate of NORM(A*inv(M),'fro') changes, and hopefully improves, at each iteration. Example: n = 100; on = ones(n,1); A = spdiags([-2*on 4*on -on],-1:1,n,n); b = sum(A,2); tol = 1e-8; maxit = 15; M1 = spdiags([on/(-2) on],-1:0,n,n); M2 = spdiags([4*on -on],0:1,n,n); x = lsqr(A,b,tol,maxit,M1,M2); Or, use this matrix-vector product function %-----------------------------------% function y = afun(x,n,transp_flag) if strcmp(transp_flag,'transp') y = 4 * x; y(1:n-1) = y(1:n-1) - 2 * x(2:n); y(2:n) = y(2:n) - x(1:n-1); elseif strcmp(transp_flag,'notransp') y = 4 * x; y(2:n) = y(2:n) - 2 * x(1:n-1); y(1:n-1) = y(1:n-1) - x(2:n); end %-----------------------------------% as input to LSQR: x1 = lsqr(@(x,tflag)afun(x,n,tflag),b,tol,maxit,M1,M2); Class support for inputs A,B,M1,M2,X0 and the output of AFUN: float: double See also BICG, BICGSTAB, CGS, GMRES, MINRES, PCG, QMR, SYMMLQ, LUINC, FUNCTION_HANDLE.

namedColor.m

namedHue.m

newfilename.m

f = newfilename( filename ) Given a filename, find a filename similar to it for which a file does not already exist, by inserting a 4-digit number before the extension, starting from 0001 and counting upwards as far as necessary.

nextPresent.m

i = nextPresent( i, retained ) RETAINED is a list of booleans. I is an index into that list. If RETAINED(I) is true, I is returned. Otherwise, the index of the first element of RETAINED after I is returned, if any. Otherwise, the index of the last element of RETAINED before I is returned, if any. Otherwise, 0 is returned.

notminusone.m

num2string.m

s = num2string( n ) Convert the number n to a string without unnecessary zeroes or decimal points. decpl (default 6) is the maximum number of decimal places to allow.

othersOf3.m

bc = othersOf3( a ) [b,c] = othersOf3( a ) If a is in the range 1..3, set bc or [b,c] to the successors of a.

parseNumList.m

partitionlist.m

s = partitionlist( n ) Set s{i} equal to find(n==j), where j is the i'th smallest value occurring in n.

plot3circle.m

plot3circle( centre, numpts, v1, v2, varargin ) Plot a circle in 3d with the given centre, radii v1 and v2, and numpts points. The remaining arguments are passed to plot3. centre, v1, and v2 can all be k*3 matrices, to plot k circles at once.

plotProfile.m

plotProfile( data ) DATA is an N*P matrix of N rows of P values. Plot each row of values against index, successively.

plotconic.m

h = plotconic( ax, x, r, steps ) Plot a lathed surface or generalised cone. AX is the axes object into which to plot. Z and R are vectors of equal length. STEPS is an integer. The surface is plotted, circularly symmetric about the z axis, for which the radius at each point of Z is R. STEPS is the number of steps to take around the z axis in sweeping out the surface. The remaining arguments are passed to SURF. The surface will be coloured according to the z coordinate. See also: SURF.

plotobj.m

plotvecs.m

plotvecs( v, ... ) Plot a set of line segments. V1 and V2 are both N*2 or N*3 matrices. Plot a line from each member of V1 to the corresponding member of V2. Pass all remaining arguments to plot3.

printstrings.m

quiverpts.m

readWholeFile.m

readfile.m

readtextfile.m

reformatText.m

s = reformatText( s ) Wherever s contains a single newline not followed by a space, replace it by a space. Leave all other newlines alone.

renumberArray.m

v1 = renumberArray( v, ren ) Replace every element x of v by ren(x). Works for arrays of any number of dimensions.

repeatString.m

replaceval.m

a = replaceend( a, oldval, newval ) Replace every occurrence of OLDVAL in A by NEWVAL.

rescaleimage.m

imagedata = rescaleimage( imagedata, xwidth, ywidth ) Resample an image to a lower resolution. imagedata should be an X*Y*3 array of uint8. This is rather inefficient when xwidth and ywidth are large, and is intended for making small thumbnails of no more than 64 pixels square. xwidth and ywidth must not be larger than the corresponding dimension of imagedata.

samesize.m

same = samesize( a, b ) Determine whether sizes A and B are the same.

saturate.m

c1 = saturate( v, c ) c is an RGB colour. v is a vector of N reals. The results is an N*3 array of N colours, being copies of c saturated by each element of v. Where v is 0, the colour is [1,1,1] (white), and where v is 1, the colour is c, with linear interpolation between. There is no check that v or c are within the range 0..1

scaleticks.m

[ticks,ranks] = scaleticks( lo, hi ) Given a scale ranging from lo to hi, choose suitable values to put tick marks against. 0, if within the range and not too close to a nonzero endpoint, always gets a tick. We scale the range so that the end with larger magnitude has nagnitude between 1 and 10. Then we choose ticks at all the integer points in the range, or more finely if that doesn't give enough ticks. Finally, we force the endpoints to receive ticks. ranks specifies which of the ticks are major and which minor -- for example, in order to draw the major ones thicker than the minor ones. 0 is always a major rank. Currently, it is the only major rank. The higher the rank, the more important the tick mark. The number is actually the line thickness in pixels.

segmentBetween.m

b = segmentBetween( a, i1, i2 ) Return the segment of the 1-dimensional array A that lies between index i1 and i2, including i1 but not i2. If i2 is less than i1 then the segment should proceed from i1 to the end of A and continue from the beginning. If i2==i1, the result is empty. i1 and i2 are reduced mod length(a) to lie within the bounds of A.

segmentOfCircularList.m

[indexes,values] = segmentOfCircularList( cl, v1, v2 ) cl is a circular array in which both v1 and v2 occur once. Find the segment of cl strictly between v1 and v2. If v1 is empty and v2 is present, the list from the start up to bevore v2 is returned. If v1 is present and v2 is empty, the list from after v1 to the end is returned. If both are empty, the whole list is returned.

setCamlight.m

setCamlight( theaxes, az, el, force ) Set the position of a light relative to the camera in terms of azimuth and elevation. The values of az and el will be stored in the UserData of theaxes, and these values will be used as defaults. The on argument can be either true, false, or empty. The default is empty. If true, a light will be created if none exists. If false, any light will be deleted and none will be created. If empty (the default), a light will be created only if none exists.

shortestSegmentBetween.m

b = segmentBetween( n, i1, i2 ) Return the segment of 1:n that lies between index i1 and i2, including i1 but not i2. The segment will proceed downwards or upwards, whichever gives the shortest result, and going round the end of the array if necessary. If i2==i1, the result is empty. i1 and i2 are reduced mod n to lie within the bounds of 1:n.

showhideAxisContents.m

spacing.m

spacing( f, n ) Print n spaces to file id f.

split.m

toks = split( pat, str ) Implementation of the Perl split() function. Splits the string STR wherever the pattern PAT matches, and returns a cell array of the strings between the matches. If the string begins or ends with a match, the cell array will correspondingly begin or end with an empty string.

splitintolines.m

splitpathname.m

[parentname,filename] = splitpathname( pathname ) Split a path name into the parent and base parts. Unlike fileparts(), this does not split off the file extension, if any. The file version, which was returned as the fourth result of fileparts in versions of Matlab prior to 2012, is ignored. See also: fileparts.

spreadHue.m

h = spreadHue( h, alph ) This takes a value of hue in the range 0..1 and attempts to map it to actual hue in a manner that better matches psychological distance, by spreading apart the green/blue part of the colour wheel. ALPH is a parameter specifying the amount of spreading out. 0.2 is about right.

step.m

s = step( r1, r2, n, open1, open2 ) Construct a row vector of equally spaced values from r1 to r2, containing n intervals. If open1 is true, the first value will be omitted. If open2 is true, the last value will be omitted. open1 and open2 default to false.

Overloaded methods: system/step DynamicSystem/step

stitchints.m

string2num.m

subtractiveMix.m

c = subtractiveMix( a, s ) s is a parameter between 0 and 1. a is an N*M*3 array

tokeniseString.m

tokens = tokeniseString( s ) Convert s into a cell array of tokens, splitting it at white space.

trimimageborders.m

trimnumber.m

x = trimnumber( lo, x, hi ) Force every element of x to lie within lo..hi. x may be a numerical array of any size and shape.

trymkdir.m

ok = trymkdir( dirname ) Creates a directory and returns a boolean to indicate success or failure. If it fails, a warning will be printed. See also: MKDIR

trymkdircd.m

ok = trymkdircd( targetdir ) Create the directory TARGETDIR if it does not exist, then cd to it. On success, olddir will be set to the previous current directory. On failure for any reason, olddir will be set to the empty string.

twonums2str.m

uint8color.m

unspace.m

s = unspace( s ) Remove the spaces from the string or cell array of strings s.

updateBoolList.m

useAllProcessors.m

useAllProcessors( msg ) Attempt to make use of all available processors. This code is Windows-specific and invokes deprecated Matlab procedures, and should probably not be used. It will not actually throw an error though.

userHomeDirectory.m

vecsums.m

vs = vecsums( v ) Set vs(i) to the sum of v(1:i) for all i.

warningDialog.m

warningDialog( format, varargin ) Put up a one-button dialog to warn the user of something. The text of the dialog will be the result of sprintf( format, varargin ).

wordsplit.m

toks = wordsplit( str, spacing, delimiters ) The string STR is split into tokens. Any sequence of one or more whitespace characters is deleted and replaced by a token break. DELIMITERS is a string or a cell array of strings: every occurrence in STR of any of these strings is taken to be a token. The result is a cell array of strings.

writefile.m

ok = writefile( filename, contents ) Write a string to a named file. Returns true on success, false on failure.

bulgeProfile.m

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\cmdinterp

addCommandToGUIElement.m

addCommandToGUIElement( h, cmd, requiresMesh, args ) Add the CMD, REQUIRESMESH flag, and cellarray ARGS to the UserData element of the GUI component H.

argToMatlabString.m

argToScriptString.m

atend.m

[tokenstream,ended] = atend( tokenstream ) Test whether a token stream is at the end.

attemptCommand.m

attemptCommand( h, i, cmd, varargin ) If there is no current mesh, do nothing. If there is a mesh and the simulation is not running, execute the specified command CMD(VARARGIN{:}). If REPLOT is true, redraw the mesh. If the simulation is running, and NEEDSSTOP is false, add the command to the command queue. If NEEDSSTOP is true, ask for confirmation, and if given, also set the stop flag.

attemptNewMeshCommand.m

m = attemptNewMeshCommand( h, replace cmd, varargin ) Assumes the simulation is not running. Executes the specified command cmd(varargin{:}), which creates a new mesh. If the GUI specifies that a random perturbation should be made, it does so. If REPLACE is true, the old mesh is discarded, otherwise as many properties as possible of the old mesh are copied to the new one. If successful, it installs the new mesh into h.

buildRSSSdialog.m

buildRSSSdialog( fn ) Create a dialog from the dialogspec contained in the file called fn. The result is a handle to the figure it creates, or -1 if it could not be created.

checkType.m

ok = checkType( msg, type, arg ) Check the type of arg and print an error message if it is not of the required type.

checkcommandargs.m

ok = checkcommandargs( commandname, s, mode, varargin ) varargin is a series of string arguments. s is a struct. If mode is 'incl', determine whether the fields of s include all the members of varargin. If mode is 'only', determine whether the fields of s are contained in varargin. If mode is 'exact', determine whether the fields of s are precisely the members of varargin. For modes 'only' and 'exact', if s is found to have extra fields then these fields will be deleted from s.

closetokenlinestream.m

tokenstream = closetokenlinestream( tokenstream ) Close the token-line stream and the underlying file, discarding any unused data.

closetokenstream.m

tokenstream = closetokenstream( tokenstream ) Close the token stream and the underlying file, discarding any unused data.

concattokenstreams.m

ts2 = concattokenstreams( ts0, ts1 ) Create a token stream that reads first from ts0, and when that ends, from ts1.

docommands.m

m = docommands( m, filename, varargin ) Execute Matlab commands from the file. The optional arguments can request the leaf to be plotted after each leaf command, and for execution to be paused after each leaf command. Each command is echoed to the terminal window before it is executed. Leaf commands are defined to be Matlab statements of the form m = leaf_xxxxxx( ... ); where leaf_xxxxxx is a command for creating or modifying a leaf. Note that the left hand side of the assignment must be the variable m. The result of docommands is the result of the final leaf command. Every command in the Matlab file must be on a single line. This includes compound commands such as for-loops: the entire for...end must be on a single line. Options: 'plot': draw the leaf after every command (except for leaf_plot commands, which draw the leaf themselves). 'pause': pause Matlab after each command. 'pause' implies 'plot'. 'nostop': Don't try to execute the file line by line, just eval the entire contents at once.

docommandsText.m

m = docommandsText( m, cmdtext, varargin ) Execute Matlab commands from the cell array of strings. The optional arguments can request the leaf to be plotted after each leaf command, and for execution to be paused after each leaf command. Each command is echoed to the terminal window before it is executed. Leaf commands are defined to be Matlab statements of the form m = leaf_xxxxxx( ... ); where leaf_xxxxxx is a command for creating or modifying a leaf. Note that the left hand side of the assignment must be the variable m. The result of docommands is the result of the final leaf command. Every command in the Matlab file must be on a single line. This includes compound commands such as for-loops: the entire for...end must be on a single line. Options: 'plot': draw the leaf after every command (except for leaf_plot commands, which draw the leaf themselves). 'pause': pause Matlab after each command. 'pause' implies 'plot'.

emptytokenstream.m

execcmds.m

v = execcmds( filename, syntaxdef, v ) Apply commands from the given file, with meanings defined by syntaxdef, to the structure v.

execcmdstring.m

v = execcmdstring( s, syntaxdef, v, do ) Apply the commands contained in the string s, with meanings defined by syntaxdef, to the structure v.

executeCommands.m

m = executeCommands( m, c, ploteach, h ) M is a mesh. C is a list of commands to execute. C is an array of structures with fields 'cmd' and 'args', being respectively the name of a script command and a cell array of its arguments. H, if given, is the handle structure of the GUI.

getTypedArg.m

isDotName.m

isMatlabName.m

isType.m

ok = isType( x, type ) Determine whether X has type TYPE. TYPE can be a string or a cell array of strings. In the latter case, the result is true if X has a type contained in the cell array.

makescriptcommandtext.m

opentokenlinestream.m

tokenstream = opentokenlinestream( filename ) Create a token-line input stream from a filename. Each read from this returns a cell array of tokens, consisting of the contents of a nonempty line.

opentokenstream.m

Create a token input stream from a filename.

peektoken.m

putback.m

tokenstream = putback( tokenstream, token ) Put a token back into the stream, so that that token will be the next token read. Note that the token is not inserted into the underlying file.

readNumbers.m

[ts,argarray] = readNumbers( ts ) Read numbers from the token stream ts until end of stream or a non-number is detected. Return the numbers in the one-dimensional array argarray.

readsyntax.m

syntaxdef = readsyntax( filename ) Reads a command syntax definition from the given file.

readtoken.m

[tokenstream,token] = readtoken( tokenstream ) Read a token from a stream. At end of stream, the empty string will be returned and the underlying file will be closed.

readtokenline.m

[ts,toks] = readtokens( ts ) Read a nonempty line of tokens. Returns an empty cell array at end of file.

recordcommand.m

refillbuffer.m

tokenstream = refillbuffer( tokenstream ) Read a line from the input file and tokenise it. Repeat until at least one token is found or the end of file is reached.

safemakestruct.m

s = safemakestruct( self, args ) Construct a struct S from the cell array ARGS by S = STRUCT(ARGS), but catch and report errors. ARGS is expected to be the VARARGIN argument of the function this is called from. ARGS may also be a structure, in which case S is set to ARGS and OK to true. If ARGS is absent, S is set to the empty structure and OK to true. Unlike STRUCT, SAFEMAKESTRUCT does not treat cell array arguments specially. The SELF argument is a string used in error messages, and should be the name of the procedure this function was called from (e.g. as provided by MFILENAME()). If SELF is empty, no error messages will be printed.

scriptcommand.m

m = scriptcommand( m, commandname, varargin ) Execute the command with the given name. The arguments are varargin.

showRSSS.m

showRSSS( fid, s, indent ) Write to the console a pretty-printed form of the dialog description s. The indent defaults to 0.

stringtokenstream.m

Create a token input stream from a string or a cell array of strings.

testtok.m

tscmds.m

v = tscmds( ts, syntaxdef, v ) Apply commands from the given token stream, with meanings defined by syntaxdef, to the structure v.

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\docs

gendoc.m

gogt.m

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\growth

BSequilibrate.m

[nodes,abserr, relerr, stretchchange,numiters,ok] = BSequilibrate( ... nodes, edgeends, restlengths, springconst, t, iters, maxerr, finald, ... fig, progressCallback ) Use the ball and spring method to equilibrate a mesh.

ClusterControl.m

function ClusterControl(arg,opt,projectnamecell) Use GUI that allows one to setup growth projects on the cluster Run them Retrieve the results and clear up by deleting the intermediate files CONFIGURATION for running projects that are not the snapdragon Find the line calling VMSReport and change as illustrated below. Usage 1) At the beginning of the session, start ClusterControl and press the svn update button - this ensures that the DArT_Toolshed on the cluster is up to date. (To install the DArT_Toolshed in the firstplace, use WinSCP. 2) use SilentGFtbox to prepare an experiment, e.g. SilentGFtbox('Name','NewFig4test2','dt',1,'Stages',[2,5,7],'Use','Cluster') Having set up the experiment(s) this program will send the project and the commands required to run it (them) on the cluster. Finally, it will keep a note of the program that will get the results back from the cluster. Not only does ClusterControl keep a list of experiments, but it also has buttons to enable you to check the processing queue, your directories on the cluster. To forcibly stop the automatic collection of results type ti=timerfind; % finds all the timers stop(ti); % this stops all the timers delete(ti); % and deletes them all J.Andrew Bangham, 2008 global ClusterControl_fig

ClusterControlAdd.m

global ClusterControl_fig

ClusterControlAddGrace.m

global ClusterControl_fig

ClusterControlPOP.m

global ClusterControl_fig

ClusterDELEXP.m

ClusterDELEXPGrace.m

ClusterDELJOB.m

ClusterDELJOBGrace.m

ClusterDELPROJ.m

ClusterDELPROJGrace.m

ClusterDELSH.m

ClusterDIR.m

ClusterDIRV2.m

ClusterMonitor.m

function ClusterMonitor(arg,opt,projectnamecell) Use GUI that allows one to setup growth projects on the cluster Run them Retrieve the results and clear up by deleting the intermediate files CONFIGURATION for running projects that are not the snapdragon Find the line calling VMSReport and change as illustrated below. Usage 1) At the beginning of the session, start ClusterMonitor and press the svn update button - this ensures that the DArT_Toolshed on the cluster is up to date. (To install the DArT_Toolshed in the firstplace, use WinSCP. 2) use SilentGFtbox to prepare an experiment, e.g. SilentGFtbox('Name','NewFig4test2','dt',1,'Stages',[2,5,7],'Use','Cluster') Having set up the experiment(s) this program will send the project and the commands required to run it (them) on the cluster. Finally, it will keep a note of the program that will get the results back from the cluster. Not only does ClusterMonitor keep a list of experiments, but it also has buttons to enable you to check the processing queue, your directories on the cluster. To forcibly stop the automatic collection of results type ti=timerfind; % finds all the timers stop(ti); % this stops all the timers delete(ti); % and deletes them all J.Andrew Bangham, 2008 global ClusterMonitor_fig

ClusterMonitorGrace.m

function ClusterMonitorGrace(arg,opt,projectnamecell) Use GUI that allows one to setup growth projects on the cluster Run them Retrieve the results and clear up by deleting the intermediate files CONFIGURATION for running projects that are not the snapdragon Find the line calling VMSReport and change as illustrated below. Usage 1) At the beginning of the session, start ClusterMonitorGrace and press the svn update button - this ensures that the DArT_Toolshed on the cluster is up to date. (To install the DArT_Toolshed in the firstplace, use WinSCP. 2) use SilentGFtbox to prepare an experiment, e.g. SilentGFtbox('Name','NewFig4test2','dt',1,'Stages',[2,5,7],'Use','Cluster') Having set up the experiment(s) this program will send the project and the commands required to run it (them) on the cluster. Finally, it will keep a note of the program that will get the results back from the cluster. Not only does ClusterMonitorGrace keep a list of experiments, but it also has buttons to enable you to check the processing queue, your directories on the cluster. To forcibly stop the automatic collection of results type ti=timerfind; % finds all the timers stop(ti); % this stops all the timers delete(ti); % and deletes them all J.Andrew Bangham, 2008 global ClusterMonitorGrace_fig

ClusterQSTAT.m

ClusterQSTATGrace.m

ClusterRun.m

function GFtboxCommandG(ProjectName,Args.Directory,Args.number_steps,Args.stepsize) A Matlab program for running models on a cluster Based on GFtboxCommand Arguments are given in pairs, ['arg',value]. To see a list of args type ClusterRun('Args'); For running growth models in batch mode. Results are filed in a subdirectory ProjectName:Movies:experimentname:meshes stores full mesh .mat files At the end of each stage/step the mesh is stored in a separate file. In addition, the command line used to invoke GFtboxCommand and a copy of the interaction function are saved in the experimentname directory. The meshes can be viewed using VMS (View Mesh System) or VMSReport. They can also be moved into the project directory where GFtbox will recognise them as 'Stages'. When running jobs on the cluster, GFtboxCommand will automatically log the fact with a program called ClusterControl. To run on the cluster you must have 1) Your (UEA) Cluster username 2) Your (UEA) Cluster username Password 3) The (UEA) Cluster name, e.g. eslogin.uea.ac.uk 4) Path to your filespace within the cluster (excluding your name) (e.g 'gpfs/tmpscratch01/sys/') (or 'gpfs/sys/') and the following programs installed on your computer 4) WinSCP 5) Putty 6) pscp 7) plink these can be installed on a Mac from the Terminal using MacPorts (e.g. sudo port install putty) There is an option to output a set of shell scripts (.sh files) that enable the results to be computed on a cluster in parallel. This is invoked by the 'Use','Cluster', command pair. Usage, all argument pairs are optional GFtboxCommand(... 'State','RunNow',... % status of command, options are: % default is 'RunNow', i.e. when 'State' is not used then % system is run on the current computer % % The following only apply to running on the cluster % 'Run' create and run a single command % % 'Begin' to begin assembling a batch of commands % 'Add' to add to the existing batch % 'Start' to add to and then run batch of commands % 'Use','Cluster' % use the cluster if it is accessible % default is not to use the cluster 'Name','IMotif2a',... % project to be run 'Path', pwd,... % present working directory either specify the modelling time in steps or Args.stages 'Args.dt',[0.1, 0.01,...] % default value is set by the project itself % this command is used to change Args.dt Using time 'Stages',[80,120,...] % default, output at every iteration % list of Args.stages (in hours) that are to be % output. % Overrides Stepsize. % Overrides Args.total_time, i.e. Args.total_time=max(Args.stages) % stage filenumbers are time - consistent % GFtbox 'Total_time',tvalue,...% i.e. Args.number_steps = tvalue/Args.dt, also see Stages Using steps 'N_steps', 20,... % number of steps to be run 'Stepsize',1,... % interval between steps that are recorded % overridden by Stages % defaut 1 'Flatten',true or false,...% The mesh will be dissected, (edges to be dissected must % be entered into the mesh using the GUI). % The mesh will then be dissected,exploded and Args.flattened. % after the last step (or stage). % it can take a long time. 'Mut_list',{'cych','div'},...% cell array of morphogen names to be set % to zero activity % default is 'wilArgs.dtype' i.e. all morph_a=1 'param',[indices] % it is possible to automatically %create set of experiments that systematically vary parameters %of the model. These have to be setup inside the interaction %function. e.g. the parameter called 'param' is set up with %m.userdata.ranges.param.range=[0, 1.2, 5, 10] %m.userdata.ranges.param.index=3; % this sets the default, i.e. %param=5. By setting an invalid index using %on the GFtboxCommand command line, i.e. 10 in this case, each value of the parameter will be used. If two range parameters are set then the combinations will be run as separate jobs, i.e. if there were 4 and 5 alternatives respectively, 20 experiments would be created. %Sensitivity testing %m.userdata.ranges.sensitivity.range %m.userdata.ranges.sensitivity.index this is a reserved userdatat ranges field that is recognised by GFtboxCommand. In To perform a sensitivity test, there must be set of obj files in a directory called objs. One obj per time step. It is differences between the test sensitivity values and these obj files that will be computed. that will 'Subdiv',false, % default, false, % true then FE model will be subdivided % to four times the number of vertices at the beginning % 'ExpID',name, % not for general use. Used internally by GFtboxCommand % to label experiments as they are run on % the cluster e.g. Run on personal computer GFtboxCommand('Name','HoleMotif4','Stages',[5,15,25]); Run on cluster, exploring two range parameters GFtboxCommand('Name','HoleMotif4','Stages',[5,15,25],'wound_production',3,'growth',1,'Use','Cluster'); Run on cluster, exploring the effect of different Args.dt and number of vertices ClusterRun('State','Start','Name','GPT_SnapPol_20111108','Stages',[250 335 340 370 410 490 570],'Use','Cluster','modelnumber',[1 2],'mingradient',[1 2]); GFtboxCommand('State','Begin','Name','NewFig4','Args.dt',1.0,'Stages',[2,5,7],'Use','Cluster'); GFtboxCommand('State','Add','Name','NewFig4','Args.dt',0.1,'Stages',[2,5,7],'Use','Cluster'); GFtboxCommand('State','Add','Name','NewFig4','Args.dt',1.0,'Subdiv',true,Stages',[2,5,7],'Use','Cluster'); GFtboxCommand('State','Start','Name','NewFig4','Args.dt',0.1,'Subdiv',true,'Stages',[2,5,7],'Use','Cluster'); Try a range of Args.dts, run for two separate models, for all combinations of the specified mutations GFtboxCommand('State','Start','Name','NewFig4','Args.dt',[0.1 0.5 1] ,'Subdiv',true,'Stages',[2,5,7],'Use','Cluster','modelname',[1 2],'Mut_List',{'mutation1','mutation1'}); J.Andrew Bangham, 2008 Jacob Newman, 2011 if isunix % then assume it is running on the cluster and the paths are to be % setup relative to the current directory pathnames=fullfile(pwd,'DArT_Toolshed'); addpath(genpath(pathnames)); end

ClusterSVN.m

CopyAndRun.m

FindMorphogenIndex.m

FindMorphogenName.m

Convert any set of morphogens to names. mgen can be any of: a single morphogen index an array of morphogen indexes a string a cell array of strings. The result is always a cell array of strings. Morphogen indexes that are out of range are ignored. Morphogen names are checked for validity, and invalid ones ignored.

GFTwindow_KeyPressFcn.m

GFTwindow_KeyPressFcn(hObject,eventdata) Process keystroke events.

GFtboxAlert.m

GFtboxCloseRequestFcn.m

GFtboxCommand.m

function GFtboxCommand(ProjectName,Directory,number_steps,stepsize) For running growth models in batch mode. Results are filed in a subdirectory ProjectName:Movies:experimentname:meshes stores full mesh .mat files At the end of each stage/step the mesh is stored in a separate file. In addition, the command line used to invoke GFtboxCommand and a copy of the interaction function are saved in the experimentname directory. The meshes can be viewed using VMS (View Mesh System) or VMSReport. They can also be moved into the project directory where GFtbox will recognise them as 'Stages'. When running jobs on the cluster, GFtboxCommand will automatically log the fact with a program called ClusterControl. To run on the cluster you must have 1) Your (UEA) Cluster username 2) Your (UEA) Cluster username Password 3) The (UEA) Cluster name, e.g. eslogin.uea.ac.uk 4) Path to your filespace within the cluster (excluding your name) (e.g 'gpfs/tmpscratch01/sys/') (or 'gpfs/sys/') and the following programs installed on your computer 4) WinSCP 5) Putty 6) pscp 7) plink these can be installed on a Mac from the Terminal using MacPorts (e.g. sudo port install putty) There is an option to output a set of shell scripts (.sh files) that enable the results to be computed on a cluster in parallel. This is invoked by the 'Use','Cluster', command pair. Usage, all argument pairs are optional GFtboxCommand(... 'State','RunNow',... % status of command, options are: % default is 'RunNow', i.e. when 'State' is not used then % system is run on the current computer % % The following only apply to running on the cluster % 'Run' create and run a single command % % 'Begin' to begin assembling a batch of commands % 'Add' to add to the existing batch % 'Start' to add to and then run batch of commands % 'Use','Cluster' % use the cluster if it is accessible % default is not to use the cluster 'Name','IMotif2a',... % project to be run 'Path', pwd,... % present working directory either specify the modelling time in steps or stages 'dt',[0.1, 0.01,...] % default value is set by the project itself % this command is used to change dt Using time 'Stages',[80,120,...] % default, output at every iteration % list of stages (in hours) that are to be % output. % Overrides Stepsize. % Overrides total_time, i.e. total_time=max(stages) % stage filenumbers are time - consistent % GFtbox 'Total_time',tvalue,...% i.e. number_steps = tvalue/dt, also see Stages Using steps 'N_steps', 20,... % number of steps to be run 'Stepsize',1,... % interval between steps that are recorded % overridden by Stages % defaut 1 'Flatten',true or false,...% The mesh will be dissected, (edges to be dissected must % be entered into the mesh using the GUI). % The mesh will then be dissected,exploded and flattened. % after the last step (or stage). % it can take a long time. 'Mut_list',{'cych','div'},...% cell array of morphogen names to be set % to zero activity % default is 'wildtype' i.e. all morph_a=1 'param',[indices] % it is possible to automatically %create set of experiments that systematically vary parameters %of the model. These have to be setup inside the interaction %function. e.g. the parameter called 'param' is set up with %m.userdata.ranges.param.range=[0, 1.2, 5, 10] %m.userdata.ranges.param.index=3; % this sets the default, i.e. %param=5. By setting an invalid index using %on the GFtboxCommand command line, i.e. 10 in this case, each value of the parameter will be used. If two range parameters are set then the combinations will be run as separate jobs, i.e. if there were 4 and 5 alternatives respectively, 20 experiments would be created. %Sensitivity testing %m.userdata.ranges.sensitivity.range %m.userdata.ranges.sensitivity.index this is a reserved userdatat ranges field that is recognised by GFtboxCommand. In To perform a sensitivity test, there must be set of obj files in a directory called objs. One obj per time step. It is differences between the test sensitivity values and these obj files that will be computed. that will 'Subdiv',false, % default, false, % true then FE model will be subdivided % to four times the number of vertices at the beginning % 'ExpID',name, % not for general use. Used internally by GFtboxCommand % to label experiments as they are run on % the cluster e.g. Run on own computer, exploring one range parameters GFtboxCommand('Path','C:\Users\AB\GFtbox_Projects\Motifs','Name','GPT_CASES_NOPQ','Stages',[10,20]); GFtboxCommand('Path','C:\Users\AB\GFtbox_Projects\Motifs','Name','GPT_CASES_NOPQ','Stages',[10,20],'modelname',[1,3]); Run on cluster, exploring one range parameters GFtboxCommand('Path','C:\Users\AB\GFtbox_Projects\Motifs',... 'Name','GPT_CASES_NOPQ','Stages',[10,20]),'Use','Cluster'); GFtboxCommand('Path','C:\Users\AB\GFtbox_Projects\Motifs',... 'Name','GPT_CASES_NOPQ','Stages',[10,20],'modelname',[1,3],'Use','Cluster'); Run on cluster, exploring the effect of different dt and number of vertices GFtboxCommand('State','Begin','Name','NewFig4','dt',1.0,'Stages',[2,5,7],'Use','Cluster'); GFtboxCommand('State','Add','Name','NewFig4','dt',0.1,'Stages',[2,5,7],'Use','Cluster'); GFtboxCommand('State','Add','Name','NewFig4','dt',1.0,'Subdiv',true,Stages',[2,5,7],'Use','Cluster'); GFtboxCommand('State','Start','Name','NewFig4','dt',0.1,'Subdiv',true,'Stages',[2,5,7],'Use','Cluster'); Try a range of dts, run for two separate models, for all combinations of the specified mutations GFtboxCommand('State','Start','Name','NewFig4','dt',[0.1 0.5 1] ,'Subdiv',true,'Stages',[2,5,7],'Use','Cluster','modelname',[1 2],'Mut_List',{'mutation1','mutation1'}); J.Andrew Bangham, 2008 Jacob Newman, 2011 if isunix % then assume it is running on the cluster and the paths are to be % setup relative to the current directory pathnames=fullfile(pwd,'DArT_Toolshed'); addpath(genpath(pathnames)); end

GFtboxDir.m

dirname = GFtboxDir() Find the Growth Toolbox directory.

GFtboxDirectory.m

GFtboxPath.m

GFtboxRevision.m

[rev,date] = GFtboxRevision() Determine the revision number and date of the GFtbox code. Do this from the SVN admin data if present, otherwise from GFtbox_version.txt.

GFtboxUpdateFonts.m

GUIPlotMesh.m

This must not be called while the simulation is running.

GaussQuadPoints.m

gqp = GaussQuadPoints() Calculate the Gaussian quadrature points for a triangular prism. The result is a 3*6 matrix.

GetTransform6.m

function MV = GetTransform6( M ) Given a 3*3 linear transformation M, calculate the 6*6 matrix MV which is appropriate for transforming symmetric second rank tensors represented as 6-element vectors.

IsotropicComplianceMatrix.m

C = IsotropicComplianceMatrix( K, nu ) Compute the 6*6 compliance matrix for an isotropic material with bulk modulus K and Poisson's ratio nu. WARNING: I don't believe this is accurate. This procedure is never used.

IsotropicStiffnessMatrix.m

D = IsotropicStiffnessMatrix( K, nu, nuNormal ) Compute the 6*6 stiffness matrix for an isotropic material with bulk modulus K and Poisson's ratio nu. If K, nu, and nuNormal are vectors of the same length N > 1, D is returned as an 6*6*N matrix. nuNormal defaults to nu (and in fact is not used anyway).

IsotropicStiffnessMatrixGnu.m

D = IsotropicStiffnessMatrixGnu(( G, nu ) Compute the 6*6 stiffness matrix for an isotropic material with shear modulus G and Poisson's ratio nu, multiplied by 1-2*nu. If G and nu are vectors of the same length N > 1, D is returned as an 6*6*N matrix.

Kgauss.m

[k,f] = Kgauss( v, gauss, C, eps0 ) Calculate the K matrix and force vector for a finite element cell. v: cell vertexes. 3*6 matrix, one column per vertex. gauss: Gauss quadrature structure in isoparametric coordinates. Includes the points, and the values and gradients of the shape functions there. C: compliance matrix. 6*6. eps0: pre-strain at each vertex (calculated from thermal expansion). 6*6, one column for each vertex. Each column is a 6-vector representing a 3*3 symmetric tensor.

MorphogenViewer.m

J.Andrew Bangham CMP, UEA, 2008.

MoveStagesToProject.m

MoveStagesToProject(ProjectDirectory) Move 'stage' files resulting from a run conducted on a remote cluster machine into the project whose directory is ProjectDirectory, replacing any existing stage files there. The files to be copied are assumed to reside in directories of the form [ProjectDirectory]/runs/[experimentname]/meshes. The folder [ProjectDirectory]/runs/[experimentname] is also assumed to contain a file called 'CommandLine.txt'. The presence of this file is what tells this procedure that [ProjectDirectory]/runs/[experimentname] is an experimental results directory. If there is more than one such directory, the user is asked to choose one, each being identified to the user by the first line of its CommandLine.txt file. The result is empty in case of any problems, otherwise a positive number (whose value is not otherwise meaningful). When there is a problem, a message will be printed to the Matlab command window. J.Andrew Bangham 2008

NormaliseGrad.m

function signal=NormaliseGrad(signal,localmask,wholemask) normalise a morphogen gradient found in signal and in a region localmask so that its values lie in the range 0 to 1 Set all values outside the region specified by wholemask to 0 J.A.Bangham 2009

OrthotropicStiffnessMatrix.m

PrismJacobian.m

j = PrismJacobian( v, p ) Calculate the Jacobian of the transformation from p = (xi,eta,zeta) to (x,y,z) for a triangular prism with vertices v. v is 3*6, each point being a column of v.

PrismJacobians.m

j = PrismJacobians( v, p ) Calculate the Jacobian of the transformation from p = (xi;eta;zeta) to (x,y,z) for a triangular prism with vertices v. v is 3*6, each point being a column of v. p may be a 3*n array: a Jacobian will be computed for each column of p, and J will be a 3*3*n array. If v is 3*6*m, J will be a 3*3*nm array.

ReconcileFields.m

function [s1]=ReconcileFields(s1,s2) Recursively find all fields in s2 that do not exist in s1 then create them as empty fields in s1 to ensure two structures have the same fields call the function twice, i.e. s1=ReconcileFields(s1,s2); s2=ReconcileFields(s2,s1) J.Andrew Bangham, 2008

ReplaceMorphogensInProject.m

function ReplacemorphogensInProject(FileName) Filename, *.morphogens.txt is a text file containing a list of morphogens to replace those in an existing project File format MorphogenName [,diffusion constant[,decay rate]] will generate id_MorphogenName and s_MorphogenName with associated properties when no diffusion and decay constants only the id_ will be formed

RunGFtboxSilently.m

runs SilentGFtbox having ensured that paths to the DArT_Toolbox are present.

RunModels.m

function RunModels(ExperimentNumber,ProjectName) Runs GFtbox modelling experiments without a user interface View the results using the program: VMS ExperimentNumber, experiment ExperimentNumber should be programmed into the switch ProjectName, default 'sd-pd-ls-200807-19a' J.Andrew Bangham, 2008

RunSilent.m

runs SilentGFtbox having ensured that paths to the DArT_Toolbox are present.

SemiOrthotropicStiffnessMatrix.m

SilentGFtbox.m

function SilentGFtbox(ProjectName,Directory,number_steps,stepsize) For running growth models in batch mode. Results are filed in a subdirectory ProjectName:Movies:experimentname:meshes stores full mesh .mat files At the end of each stage/step the mesh is stored in a separate file. In addition, the command line used to invoke SilentGFtbox and a copy of the interaction function are saved in the experimentname directory. The meshes can be viewed using VMS (View Mesh System) or VMSReport. They can also be moved into the project directory where GFtbox will recognise them as 'Stages'. When running jobs on the cluster, SilentGFtbox will automatically log the fact with a program called ClusterControl. To run on the cluster you must have 1) (UEA) Cluster username 2) Password 3) email address and the following programs installed on your computer 4) WinSCP 5) Putty 6) pscp 7) plink There is an option to output a set of shell scripts (.sh files) that enable the results to be computed on a cluster in parallel. This is invoked by the 'Use','Cluster', command pair. Usage, all argument pairs are optional SilentGFtbox(... 'State','RunNow',... % status of command, options are: % default is 'RunNow', i.e. when 'State' is not used then % system is run on the current computer % % The following only apply to running on the cluster % 'Run' create and run a single command % % 'Begin' to begin assembling a batch of commands % 'Add' to add to the existing batch % 'Start' to add to and then run batch of commands % 'Use','Cluster' % use the cluster if it is accessible % default is not to use the cluster 'Name','IMotif2a',... % project to be run 'Dir', pwd,... % present working directory either specify the modelling time in steps or stages 'dt',[],... % default value is set by the project itself % this command is used to change dt Using time 'Stages',[80,120,...] % default, output at every iteration % list of stages (in hours) that are to be % output. % Overrides Stepsize. % Overrides total_time, i.e. total_time=max(stages) % stage filenumbers are time - consistent % GFtbox 'Total_time',tvalue,...% i.e. number_steps = tvalue/dt, also see Stages Using steps 'N_steps', 20,... % number of steps to be run 'Stepsize',1,... % interval between steps that are recorded % overridden by Stages % defaut 1 'Flatten',true or false,...% The mesh will be dissected, (edges to be dissected must % be entered into the mesh using the GUI). % The mesh will then be dissected,exploded and flattened. % after the last step (or stage). % it can take a long time. 'Mut_list',{'cych','div'},...% cell array of morphogen names to be set % to zero activity % default is 'wildtype' i.e. all morph_a=1 'param',[indices] % it is possible to automatically %create set of experiments that systematically vary parameters %of the model. These have to be setup inside the interaction %function. e.g. the parameter called 'param' is set up with %m.userdata.ranges.param.range=[0, 1.2, 5, 10] %m.userdata.ranges.param.index=3; % this sets the default, i.e. %param=5. By setting an invalid index using %on the SilentGFtbox command line, i.e. 10 in this case, each value of the parameter will be used. If two range parameters are set then the combinations will be run as separate jobs, i.e. if there were 4 and 5 alternatives respectively, 20 experiments would be created. %Sensitivity testing %m.userdata.ranges.sensitivity.range %m.userdata.ranges.sensitivity.index this is a reserved userdatat ranges field that is recognised by SilentGFtbox. In To perform a sensitivity test, there must be set of obj files in a directory called objs. One obj per time step. It is differences between the test sensitivity values and these obj files that will be computed. that will 'Subdiv',false, % default, false, % true then FE model will be subdivided % to four times the number of vertices at the beginning % 'ClearPasswords','All',% The first time SilentGFtbox is run by a user on % a particular computer, passwords are requested % which are encrypted and saved % It may be easier to configure passwords % etc. by the command sequence ... % clearpasswords % getyouremail % getyourclusterdirectory % getpassword % getyourclustername 'ExpID',name, % not for general use. Used internally by SilentGFtbox % to label experiments as they are run on % the cluster e.g. To make full use of the program, ClusterControl, please put the projects in a directory called 'clusterstuff' Run on personal computer SilentGFtbox('Name','HoleMotif4','Stages',[5,15,25]); Run on cluster, exploring two range parameters SilentGFtbox('Name','HoleMotif4','Stages',[5,15,25],'wound_production',3,'growth',1,'Use','Cluster'); Run on cluster, exploring the effect of different dt and number of vertices SilentGFtbox('State','Begin','Name','NewFig4','dt',1.0,'Stages',[2,5,7],'Use','Cluster'); SilentGFtbox('State','Add','Name','NewFig4','dt',0.1,'Stages',[2,5,7],'Use','Cluster'); SilentGFtbox('State','Add','Name','NewFig4','dt',1.0,'Subdiv',true,Stages',[2,5,7],'Use','Cluster'); SilentGFtbox('State','Start','Name','NewFig4','dt',0.1,'Subdiv',true,'Stages',[2,5,7],'Use','Cluster'); J.Andrew Bangham, 2008 if isunix % then assume it is running on the cluster and the paths are to be % setup relative to the current directory pathnames=fullfile(pwd,'DArT_Toolshed'); addpath(genpath(pathnames)); end

StandardPrism.m

v = StandardPrism() Return the vertexes of a standard triangular prism.

Steps.m

SubPhase.m

To allow subphases to be specified within the interaction function. As each stage is encountered a structure is built that can be used to pass stage specifications to the GFtbox. This then appears on the Stages menu. realtime, StC the data structure to be elaborated duration the time to be spent on this activity headingstr, the stage label counter, the stage counter. These should start at 1 and increment with each call iteraction counter, = m.currentiteration used to control initialisation State, true if realtime lies within this activity J.Andrew Bangham, 2009

TMIndex.m

TimedAdd.m

a=TimedAdd(realtimeNow,realtimeStart,realtimeStop) a=1 if start<=realtime<stop else a=0

TimedMul.m

a=TimedMul(realtimeNow,realtimeStart,realtimeStop) a=value if start<=realtime<stop else a=1

TransformModuli.m

TransformTensor.m

VMS.m

VMS(arg,options)

VMSReport.m

VMSReport(varargin) Produce a printed report on results from running SilentGFtbox before it finishes it invites you to rotate the figures (rotate one using the sliders and the others follow suit) it then invites you to print everything Arguments come in command,value pairs 'Path', path to project default, pwd (default); 'Project', name of project in the path 'Experiment', either 'All' (the default) where all the experiments in path/project/movies/result_directory/* are compiled into a printed report or {'experiment_name','experiment_name',...} 'MORPHOGEN','name' default 'Polariser' 'DRAWEDGES',integer, default 0 none, 1 outside edges only, 2 all edges 'DRAWGRADIENTS',logical default true 'THICK',logical default true 'DRAWSECONDLAYER',logical default false (cell layer) 'PRINT',logical default false 'VISIBLE',logical default true if true do not display figures 'ROTATION',[azimuth,elevation] default is as stored in project 'CELLS',logical default true 'STEREO',logical default false usage VMSreport('Project','HoleMotif4') J. Andrew Bangham 2008

VRMLparams.m

VRMLPARAMS M-file for VRMLparams.fig VRMLPARAMS, by itself, creates a new VRMLPARAMS or raises the existing singleton*. H = VRMLPARAMS returns the handle to a new VRMLPARAMS or the handle to the existing singleton*. VRMLPARAMS('CALLBACK',hObject,eventData,handles,...) calls the local function named CALLBACK in VRMLPARAMS.M with the given input arguments. VRMLPARAMS('Property','Value',...) creates a new VRMLPARAMS or raises the existing singleton*. Starting from the left, property value pairs are applied to the GUI before VRMLparams_OpeningFcn gets called. An unrecognized property name or invalid value makes property application stop. All inputs are passed to VRMLparams_OpeningFcn via varargin. *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one instance to run (singleton)". See also: GUIDE, GUIDATA, GUIHANDLES

ab_from_kbend.m

[a,b] = ab_from_kbend( k, bend ) Given growth K and bending BEND, compute the equivalent surface growths A and B, such that K-BEND = A and K+BEND = B. If allownegative is false, A and B are forced to be nonnegative, at the expense of violating the equalities. The default is that negative values are allowed.

addAIHgrowthdata.m

formatTest = max((1+abs(growthparams(:,1))) ./ (0.01+abs(growthparams(:,2))));

addCell.m

m = addCell( m, a, b, c ) Add to m a cell whose corners are the existing vertexes a, b, and c. No error checking is done; it is assumed that the operation is sensible. a and b, and a and c, are assumed to be connected by edges, and b-a-c is assumed to be the positive orientation.

addProjectsMenu.m

handles = addProjectsMenu( handles, projectsDir, readonly, callback ) projectsDir is a folder to be added to the Projects menu.

addStages.m

[times,fromold,fromnew] = addStages( oldtimes, newtimes ) Combine the lists of times, striking out duplicates and putting them into sorted order. fromold and fromnew are bitmaps of the result, showing which elements came from which list. oldtimes and newtimes do not have to already be sorted, and they may contain duplicates.

addStaticData.m

m = addStaticData( sd ) sd contains the static mesh data. Overwrite the static data in m by sd and reconcile them. This mostly consists of replacing fields in m by fields in sd, but the morphogen dictionary is shared by both and any changes require reindexing the per-morphogen fields of m.

addToNormal.m

m = addToNormal( m, addn, absolute ) addn is a vector containing one value per node of m. If absolute is true, then each node is displaced normal to the surface by that amount. If absolute is false (the default), then each node is displaced normal to the surface by that proportion of the thickness at that point.

addToRawMesh.m

addToZ.m

addinternalrotation.m

m = addinternalrotation( m, angle )

addmesh.m

m = addmesh( m, m1 ) Combine two meshes which contain only nodes and tricellvxs.

addmovieframe.m

movieobj = addmovieframe( movieobj ) Add a frame to a movie object created by either avifile or VideoWriter.

addquad.m

m = addquad( m, i, j, k, l ) m contains only m.nodes and m.tricellvxs. Add two cells to m.tricellvxs, which tringulate the quadrilateral i j k l.

addquadstrip.m

addrandomfield.m

mesh = addrandomfield( mesh, amount, whichMgen, smoothness, add ) Add a random amount of growth factor to every point.

addtrianglestrip.m

allCellFlatDisplacements.m

displacements = cellFlatDisplacements( normal, vxs ) Calculate the displacements of the vertexes of the cell from a right prism.

angle3.m

theta = angle3( v ) v is a 3*3 matrix [A;B;C]. The result is the angle ABC.

anisotropy.m

a = anisotropy( pp ) Calculate the anisotropy from parallel and perpendicular growth. This is zero when both are zero, otherwise (par-perp)/(par+perp).

anisotropyFromParPerp.m

announceSimStatus.m

announceSimStatus( handles ) Update the report of leaf size, number of iterations, etc. in the GUI display.

announceview.m

applyMgenDefaults.m

m = applyMgenDefaults( m, mgenindexes, numnodes ) Insert default per-morphogen values for various fields, for the given set of new morphogen indexes. The indexes are assumed to be at the end of all current indexes.

applyMutations.m

arealGrowth.m

g = arealGrowth( pp ) Calculate the areal growth rate from parallel and perpendicular growth. This is their sum.

arealTensorGrowth.m

g = arealGrowth( t ) Compute the total growth rate of a two-dimensional growth tensor.

askForLegendDlg.m

Begin initialization code - DO NOT EDIT

askForLegend_getDefault.m

askForNameDesc.m

askForTimeUnit.m

s = askForTimeUnit() Put up a modal dialog asking for the name of the time unit.

attemptInteractionFunction.m

averageConductivity.m

d = averageConductivity( m, morphogenindex ) d = averageConductivity( c ) The first type of call translates to the second: d = averageConductivity( m.conductivity(morphogenindex) ) Make a crude estimate of the average conductivity given by c.Dpar and c.Dper. This is accurate when the conductivity is uniform, but should not be used for numerical computation if it is non-uniform, only for giving a rough estimate. c can be a struct array, and morphogenindex can be an array of indexes. d will be an array of average conductivities of the same length.

averageMeshThickness.m

avpolgrad.m

apg = avpolgrad( m, ci, bc, vx, sparsedistance ) Calculate the average polarisation gradient over all of the finite elements, all of whose vertexes are within a distance sparsedistance of vx.

axesFromCell.m

axes = axesFromCell( vxs ) Compute a frame of reference for a triangular prism cell. One axis is parallel to the xi isoparametric coordinate, one is perpendicular to xi in the xi-eta plane, and the third is perpendicular to both. Its direction should roughly coincide with the zeta axis. The vectors vxs are assumed to be column vectors. There must be 6 of them: vxs(1:3) are the bottom face and vxs(4:6) are the top face.

axisrangeFromDialog.m

azelDlg.m

Begin initialization code - DO NOT EDIT

b3weights.m

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\growth\bio

in_lin.m

x = in_lin( k, m ) Calculate the inhibitory effect of morphogen m with scale factor k.

inh.m

x = inh( k, m ) Calculate the inhibitory effect of morphogen m with scale factor k. The morphogen and the scale are forced to be non-negative.

pro.m

x = pro( k, m ) Calculate the promoting effect of morphogen m with scale factor k. The morphogen and the scale are forced to be non-negative.

blankColorBar.m

blueRedCmap.m

borderedgemap.m

edgemap = borderedgemap( m, cellmap ) M is a mesh. CELLMAP is a boolean map pf cells. All of the border edges of the set of cells are found, that is, every edge which has one of the given cells on exactly one side. The set of edges is returned as a boolean map. If you need an array of indexes, call borderedges( m, cellmap ). See also: borderedges

borderedges.m

edges = borderedges( m, cellmap ) M is a mesh. CELLMAP is a boolean map pf cells. All of the border edges of the set of cells are found, that is, every edge which has one of the given cells on exactly one side. The set of edges is returned as an array of edge indexes. If you need a boolean map, call borderedgemap( m, cells ); See also: borderedgemap

borderingCells.m

boundingbox.m

bb = boundingbox( m, extra ) Calculate the bounding box of the mesh m, in a form that can be passed to axis(). If extra is specified, the box is expanded by this amount, e.g. if extra = 0.1 then the box will be 10% large than the exact bounds of the mesh.

buildMorphogenDict.m

m = buildMorphogenDist( m ) Build a dictionary mapping morphogen names to indexes and vice versa. Make sure the standard morphogens are included.

butterfly.m

[pos,prismpos] = butterfly( m, ei ) Find the location of the point resulting from subdividing edge ei by the butterfly algorithm.

butterfly3.m

pos = butterfly3( m, ci, bc, tension ) Generalises the butterfly algorithm to pick a point corresponding to the point in cell ci with barycentric coordinates bc. The resulting surface is continuous but not smooth across edges and vertexes.

butterflyPoints.m

[vxs,weights] = butterflyPoints( m, ei, tension ) Find the points and weights associated with subdividing edge ei by the butterfly algorithm.

butterflystencil.m

[wts,pts] = butterflystencil( m, ei ) Find the stencil resulting from subdividing edge ei by the butterfly algorithm.

calcBioACellAreas.m

calcN.m

vn = calcN( p ) Calculate the value of all the shape functions for a triangular prism at isoparametric coordinates p. The result is a row vector. p is a 3-element column vector. It may also be a 3*N matrix, in which case the result will be a 6*N matrix.

calcNewMorphogens.m

calcOldMorphogens.m

calcPolGrad.m

m = calcPolGrad( m ) Calculate the polarising gradients for growth and bending in the specified cells of the mesh, by default all of them.

calcmeshareas.m

m = calcmeshareas( m ) Calculate the area of every cell of the mesh.

calcnodeareas.m

nodeareas = calcnodeareas( m ) For each node, calculate the area of all of the cells containing that node.

calculateOutputs.m

m = calculateOutputs( m ) Calculate all of the tensors for specified/actual/residual growth on the A/B sides, and the rotations. This creates the following components of m: m.outputs.specifiedstrain.A m.outputs.specifiedstrain.B m.outputs.actualstrain.A m.outputs.actualstrain.B m.outputs.residualstrain.A m.outputs.residualstrain.B m.outputs.rotation Each of these is a per-FE quantity. If there are N finite elements, then the tensor fields are N*6 and the rotations field is N*3. These are all rates of growth or rotation, not absolute amounts. Take the average of an A and a B quantity to get the value for the midplane; take half of B-A to get the bending component. To convert tensors to principal components, write for example: [amounts,frames] = tensorsToComponents( m.outputs.actualstrain.A ); amounts will then be the principal components of actual growth on the A side, listed in descending order. If you want them listed in the order parallel, perpendicular, and normal, replace the second line by: [amounts,frames] = tensorsToComponents( m.outputs.actualstrain.A, m.cellFrames ); To resolve rotation vectors into rotation about the normal vector and the remainder, write: [inplane,outofplane] = splitVector( m.outputs.rotations, m.unitcellnormals ); inplane will be a column of scalars, the rotation rates around the normal vectors, and outofplane will be an N*3 matrix of vectors in the planes of the respective finite elements. To convert any per-element quantity to a per-vertex quantity, call: perVxQuantity = perFEtoperVertex( m, perFEquantity ); The per-element quantity can be an N*K matrix, where N is the number of finite elements. perVxQuantity will then be M*K where M is the number of vertices.

callbackWaypoints.m

canvasColorsDlg.m

CANVASCOLORSDLG M-file for canvasColorsDlg.fig CANVASCOLORSDLG by itself, creates a new CANVASCOLORSDLG or raises the existing singleton*. H = CANVASCOLORSDLG returns the handle to a new CANVASCOLORSDLG or the handle to the existing singleton*. CANVASCOLORSDLG('CALLBACK',hObject,eventData,handles,...) calls the local function named CALLBACK in CANVASCOLORSDLG.M with the given input arguments. CANVASCOLORSDLG('Property','Value',...) creates a new CANVASCOLORSDLG or raises the existing singleton*. Starting from the left, property value pairs are applied to the GUI before canvasColorsDlg_OpeningFcn gets called. An unrecognized property name or invalid value makes property application stop. All inputs are passed to canvasColorsDlg_OpeningFcn via varargin. *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one instance to run (singleton)". See also: GUIDE, GUIDATA, GUIHANDLES

cell3DCoords.m

v = cell3DCoords( mesh, ci, bc ) Find the 3D coordinates of the point with barycentric coordinates bc in cell ci.

cellBaryCoords.m

bc = cellBaryCoords( mesh, ci, v ) Find the barycentric coordinates of v in cell ci. v must be a single vector.

cellClick.m

handles = cellClick( handles, ci, bc, pt, selectionType ) Handle a click on element ci at barycentric coordinates bc and global coordinates pt. This should only be called when the simulation is not running.

cellFlatDisplacements.m

displacements = cellFlatDisplacements( normal, vxs ) Calculate the displacements of the vertexes of the cell from a right prism.

cellListFromNodeMap.m

cells = cellsfromnodemap( m, nodes, mode ) M is a mesh. NODES is either an array of node indexes or a boolean map of nodes. If MODE is 'all', find every finite element for which every vertex is in the set of nodes; if 'any', every finite element with at least one vertex in the set. The set of cells is returned as an array of indexes. If you need a boolean map of the cells, call cellMapFromNodeMap( m, nodemap, mode ). See also: cellMapFromNodeMap

cellMapFromEdgeMap.m

cellmap = cellMapFromEdgeMap( m, edgemap, mode ) M is a mesh. EDGE is a boolean map of edges or an array of edge indexes. If MODE is 'all', find every finite element for which every edge is in the set of nodes; if 'any', every finite element with at least one edge in the set. The set of cells is returned as a boolean map. If you also need an array of indexes, apply FIND to it. If you only need an array of indexes, call cellsFromEdgeMap( m, nodes, mode ); See also: cellsFromEdgeMap

cellMapFromNodeMap.m

cellmap = cellmapfromnodes( m, nodemap, mode ) M is a mesh. NODEMAP is an array of node indexes. If MODE is 'all', find every finite element for which every vertex is in the set of nodes; if 'any', every finite element with at least one vertex in the set. The set of cells is returned as a boolean map. If you also need an array of indexes, apply FIND to it. If you only need an array of indexes, call cellListFromNodeMap( m, nodes, mode ); See also: cellListFromNodeMap

cellToVertex.m

vertexStuff = cellToVertex( mesh, cellStuff ) Convert a quantity defined per cell to a quantity defined per vertex. The vertex value is the average of all the cell values for cells that the vertex belongs to.

cellToVx.m

vxstuff = cellToVx( mesh, cellstuff ) From an array of stuff-per-cell, construct an array of stuff-per-vertex, setting the quantity at each vertex to be the average of the quantity at each cell the vertex belongs to. The tricellvxs component of the mesh is assumed to be valid.

cellVectorGlobalToLocal.m

lv = cellVectorGlobalToLocal( m, gv ) GV contains one vector per finite element of M in global coordinates. LV is the corresponding vector field expressed in local coordinates for each cell. That is, for every i, LV(i,:) sums to zero, and subject to that, the following equality is satisfied as closely as possible: gv(i,:) = lv(i,:) * m.nodes(m.tricellvxs(i,:),:) SEE ALSO: cellVectorLocalToGlobal

cellVectorLocalToGlobal.m

gv = cellVectorLocalToGlobal( m, lv ) LV contains one vector per finite element of M in local cell coordinates. GV is the corresponding vector field expressed in global coordinates. That is, for every i: gv(i,:) = lv(i,:) * m.nodes(m.tricellvxs(i,:),:) SEE ALSO: cellVectorGlobalToLocal

cellcentres.m

cc = cellcentres( m, cells, side ) Find the centres of all the finite elements, on either the A side, the B side, or the midplane. side==-1 is the A side, 0 is the midplane, and 1 is the B side. If side is omitted, it is determined from the plotting options.

cellcoords.m

coords = cellcoords( mesh, ci ) Return the coordinates of the three vertexes of triangular cell ci.

cellneighbours.m

cellnormal.m

normal = cellnormal( mesh, ci ) Calculate the normal vector to element ci of the mesh. The length of the vector is twice the area of the cell. ci can be a vector; the result will be an N*3 array.

cellsFromEdgeMap.m

cells = cellsFromEdgeMap( m, edgemap, mode ) M is a mesh. EDGE is a boolean map of edges or an array of edge indexes. If MODE is 'all', find every finite element for which every edge is in the set of nodes; if 'any', every finite element with at least one edge in the set. The set of cells is returned as a boolean map. If you also need an array of indexes, apply FIND to it. If you only need an array of indexes, call cellMapFromEdgeMap( m, nodes, mode ); See also: cellMapFromEdgeMap

cellvorticities.m

centremesh.m

m = centremesh( m ) Translate the mesh m so that the midpoint of the range of its node positions is at the origin.

cgsmsg.m

checkVoronoiAngles.m

checkVoronoiAngles( V, P ) [V,P] is the output of VORONOIN(...): V is the set of vertexes of the Voronoi network, and P the set of vertex lists that define the cells. For every vertex in V, if there are N edges meeting at the vertex, where N >= 3, then the angles between them should be 2pi/N. Calculate the average deviation from that figure over the whole network. This can be used as a measure of non-centroidality of the network. When the CVT algorithm is run, it typically converges from an initial error value of about 0.5 for a random set of Voronoi generators to about 0.2, that is, from about 30 degrees to about 12 degrees. If P is not given, V is assumed to be a set of Voronoi generators, and the Voronoi network is first calculated from them.

chooseColorMap.m

citation_Callback.m

citation_Callback(hObject, eventdata) Display a citation of our papers.

clearFlag.m

clearpasswords.m

clipmgenDlg.m

clipmgenDlg M-file for clipmgenDlg.fig clipmgenDlg, by itself, creates a new clipmgenDlg or raises the existing singleton*. H = clipmgenDlg returns the handle to a new clipmgenDlg or the handle to the existing singleton*. clipmgenDlg('CALLBACK',hObject,eventData,handles,...) calls the local function named CALLBACK in clipmgenDlg.M with the given input arguments. clipmgenDlg('Property','Value',...) creates a new clipmgenDlg or raises the existing singleton*. Starting from the left, property value pairs are applied to the GUI before clipmgenDlg_OpeningFunction gets called. An unrecognized property name or invalid value makes property application stop. All inputs are passed to clipmgenDlg_OpeningFcn via varargin. *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one instance to run (singleton)". See also: GUIDE, GUIDATA, GUIHANDLES

closemovie.m

movieobj = closemovie( movieobj ) Close a movie, whether it was created with avifile or VideoWriter.

combineDFs.m

dfs = combineDFs( x, y, z )

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\growth\commands

leaf_add_mgen.m

m = leaf_add_mgen( m, mgen_name, ... ) Add a new morphogen to m with the given name. If there is already a morphogen with that name, this command is ignored. Any number of names can be given at once. Equivalent GUI operation: the "New" button on the "Morphogens" panel. A dialog will appear in which the user chooses a name for the new morphogen. See also: leaf_delete_mgen, leaf_rename_mgen Topics: Morphogens.

leaf_add_userdata.m

m = leaf_add_userdata( m, ... ) Add fields to the userdata of m. The arguments should be alternately a field name and a field value. Existing fields of those names in m.userdata will be left unchanged. See also: leaf_set_userdata, leaf_delete_userdata. Equivalent GUI operation: none. Topics: User data

leaf_addpicture.m

m = leaf_addpicture( m, ... ) Create a new picture window to plot the mesh in. This is primarily intended for plotting the mesh in multiple windows simultaneously. Options: 'figure' A handle to a window. The previous contents of the window will be erased. 'position' An array [x y w h] specifying the position and size of the window relative to the bottom left corner of the screen. x is horizontal from the left, y is vertical from the bottom, w is the width and h is the height, all in pixels. 'relpos' A similar array, but this time measured relative to the bottom left corner of the previous picture, if there is one, otherwise the bottom left corner of the screen. Only one of position or relpos may be supplied. w and h can be omitted from relpos, in which case the size defaults to the size of the existing window, if any, otherwise the default size for a new window. x and y can be omitted from position, in which case the new window is centred on the screen. If both position and relpos are omitted, a window of default size and position is created. 'vergence' A number in degrees, default 0. The view direction of the figure is offset by this amount, so that the eye seeing the figure sees it as if the eye was turned towards the centre line by this angle. 'eye' 'l' or 'r', to specify which eye this is for. If no eye is specified, vergence defaults to zero. If vergence is specified, an eye must also be specified. 'properties' A structure containing any other attribute of the figure that should be set. Topics: Plotting, Stereo.

leaf_addseam.m

m = leaf_addseam( m, ... ) Marks some edges of m as being or not being seams, according to criteria given in the options. Unlike most other toolbox commands, the options to this command are processed sequentially and the same option may occur multiple times in the list. Options: 'init' Either 'all' or 'none'. Sets either all of the edges, or none of them, to be seam edges. 'edges' An array of edge indexes. All of these edges will become seam edges. 'nonedges' An array of edge indexes. All of these edges will become non-seam edges. 'nodes' An array of node indexes. All edges joining two nodes in this set will become seam edges. 'nonnodes' An array of node indexes. All edges touching any node in this set will become non-seam edges. 'edgemap', 'nonedgemap', 'nodemap', 'nonnodemap': As above, but these are arrays of booleans specifying the edges of nodes to be included or excluded from the seams. 'morphogen' A cell array of two elements. The first is a morphogen name or index. The second is a string specifying how the value of the morphogen will be used as a criterion for deciding whether an edge should become a seam. It consists of three parts. It begins with one of 'min', 'mid', or 'max'. This is followed by one of '<', '<=', '>=', or '>'. This is followed by a number. Examples: 'min>0.5' means that an edge becomes a seam if the minimum value of the morphogen at either end is greater than 0.5. 'max' would take the maximum of the ends, and 'mid' would take the average. Example: m = leaf_addseam( m, 'init', 'none', ... 'nodemap', m.morphogens(:,12) > 0.1 ); Topics: Mesh editing, Seams.

leaf_addwaypoint.m

Add a waypoint to m. A waypoint stores the current plotting options, the simulated time, and the options given to this procedure. The waypoints are states of the mesh that form keyframes for a movie. Once all of the desired waypoints have been created, a movie can be generated by leaf_waypointmovie which begins at the first waypoint continues through all of them to the last. Between waypoints iterations of the simulation can be performed, the viewpoint smoothly changed, plotting options can change, the plotting options themselves can be smoothly interpolated between waypoints. OPTIONS: 'name' A name for the waypoint. This is optional, and is only used in the dialog for editing the waypoint list. 'frames' The number of frames to be generated from the previous waypoint to the current one, including the current but not the previous. If simulated time has elapsed since the ;ast waypoint, the simulation step will be adjusted to fit. 'timestep' You can spcify this instead of the number of frames, if some simulated time has elapsed since the last waypoint. 'spin' The number of revolutions of spin that should be performed in the interval since the last waypoint. 'tilt' The number of cycles of up and down tilting of the viewpoint that should be performed in the interval since the last waypoint. 'crossfade' Whether the non-interpolable plotting options should be cross-faded in this segment of the movie, or be applied only on the last frame. See also leaf_waypointmovie, leaf_clearwaypoints. Topics: Movies/Waypoints.

leaf_allowmutant.m

m = leaf_allowmutant( m, enable ) Enable or disable the whole mutation feature. When enabled, all mutant levels of morphogens will be active. When disabled, the tissue will grow as the wild type. Arguments: enable: 1 or true to allow mutation, 0 or false to disable mutation. Topics: Morphogens, Mutation.

leaf_alwaysflat.m

m = leaf_alwaysflat( m, flat ) If FLAT is 1, force the mesh to never bend out of the XY plane. The mesh will be flattened if it is not already flat, by setting the Z coordinate of every node to zero. If FLAT is 0, allow the mesh to bend out of the XY plane. If the mesh happens to be flat, it will not actually bend unless it is perturbed out of the XY plane, e.g. by adding a random Z displacement with the leaf_perturbz command. A flat mesh is still allowed to vary in thickness. Example: m = leaf_alwaysflat( m, 1 ); Equivalent GUI operation: clicking the "Always flat" checkbox on the "Mesh editor" panel. Topics: Mesh editing, Simulation.

leaf_archive.m

m = leaf_archive( m ) Create an archive of the current state of the project. Archived states are kept in a subfolder ARCHIVE of the current project. Each archived state is in a project folder whose name is the name of the current project, with '_Ann' appended, where nn is a number 1 greater than the maximum number that has already been used, or 1 for the first created archive. Arguments: none. Equivalent GUI operation: clicking the "Archive" button. INCOMPLETE -- DO NOT USE. Topics: HIDE, Project management.

leaf_attachpicture.m

m = leaf_attachpicture( varargin ) NOT SUPPORTED. INCOMPLETE. NON-OPERATIONAL. Load a picture from a file. Create a rectangular mesh of the same proportions. If no filename is given for the picture, a dialog will be opened to choose one. Equivalent GUI operation: none. Topics: HIDE, Picture distortion.

leaf_bowlz.m

m = leaf_bowlz( m, ... ) Add a bowl-shaped perturbation to the z coordinate of every point of the finite element mesh. The z displacement will be proportional to the square of the distance from the origin of coordinates. Arguments: A number, being the maximum displacement. The displacement will be scaled so that the farthest point from the origin is displaced by this amount. The default is 1. Examples: m = leaf_bowlz( m, 2 ); Equivalent GUI operation: the "Bowl Z" button on the "Mesh editor" panel. The amount of bowl deformation is specified by the value in the upper of the two text boxes to the right of the button. Topics: Mesh editing.

leaf_cellcentroids.m

cellcentroids = leaf_cellcentroids( m ) Compute the centroids of all of the biological cells, as an N*3 array.

leaf_circle.m

m = leaf_circle( m, ... ) Create a new circular mesh. Arguments: M is either empty or an existing mesh. If it is empty, then an entirely new mesh is created, with the default set of morphogens. If M is an existing mesh, then its geometry is replaced by the new mesh. It retains the same set of morphogens (all set to zero everywhere on the new mesh), interaction function, and all other properties not depending on the specific geometry of the mesh. Options: 'xwidth' The diameter of the circle in the x direction. Default 2. 'ywidth' The diameter of the circle in the y direction. Default 2. 'rings' The number of circular rings of triangles to divide it into. Default 4. 'circumpts' The number of vertexes around the circumference. The default is rings*6. It must be at least 4, and for best results should be at least rings*4. As a special case, if zero is specified, rings*6 is chosen. 'innerpts' The number of vertexes around the innermost ring of points. Default is max( floor(circum/nrings), 3 ). 'dealign' Dealign the vertexes on adjacent rings. Default false. Only applies when circumpts is nonzero. 'coneangle' Make a circular cap of a sphere instead of a flat circle. The surface can be defined as the interscetion of the surface of a sphere with a cone whose apex is at the centre of the sphere. The value of coneangle is the angle between the axis of the cone and the surface of the cone. The default is zero, i.e. make a flat circle. If coneangle is negative, the spherical cap is made in the -z direction. coneangle should be between -PI and PI. 'height' Modify the height of the circular cap specified by coneangle, by scaling the z-axis to make the height of the centre of the cap above the plane of its rim equal to the specified value. If coneangle is not specified, and height is non-zero, then coneangle defaults to PI/2. If coneangle is specified and height is not, then height defaults to thevalue for a spherical cap, i.e. height = radius(1 - cos(coneangle), where radius = sqrt(xwidth*ywidth). Example: m = leaf_circle( [], 'radius', 2, 'rings', 4 ); Equivalent GUI operation: selecting "Circle" or "Hemisphere" on the pulldown menu on the "Mesh editor" panel, and clicking the "Generate mesh" button. Topics: Mesh creation.

leaf_clearwaypoints.m

m = leaf_clearwaypoints( m ) Clear the waypoint list. See also leaf_addwaypoint, leaf_waypointmovie. Topics: Movies/Waypoints.

leaf_colourA.m

m = leaf_colourA( m ) Assign colours to all the cells in the biological layer. If there is no biological layer, the values of the options are stored in m but the command is otherwise ignored. Optional arguments: colors: The colour of the cells, as a pair of RGB values as a 2*3 array. The first is for the unshocked state and the second for the shocked state. colorvariation: The amount of variation in the colour of the new cells. Each component of the colour value will be randomly chosen within this ratio of the value set by the 'color' argument. That is, a value of 0.1 will set each component to between 0.9 and 1.1 times the corresponding component of the specified colour. (The variation is actually done in HSV rather than RGB space, but the difference is slight.) The default is zero. A value of 1 or more will give colours scattered over the entire colour space. The values of the options are stored in the mesh, and the options default to the stored values. Topics: Bio layer.

leaf_computeGrowthFromDisplacements.m

[out1, out2, out3, out4] = leaf_computeGrowthFromDisplacements( m, displacements, time, ... ) Compute the growth rate in each FE of m given the displacements of all the prism nodes and the time over which these displacements happened. This assumes that m is in the state after these displacements have happened. The results returned depend on the options and on how many output arguments are given. Note that unlike most leaf_* commands, m itself is not one of the output arguments, since this procedure does not need to modify m. The growth rates are returned as an N*3 matrix with one row for each finite element. The ordering of the three values is determined by the 'axisorder' option. If the displacement array is empty or the time interval is not positive, then zeros will be returned. Options: 'frames': a boolean. If true, then the frames of reference defining the directions of growth will also be returned, as a 3*3*N matrix. The axes of each 3*3 matrix are its columns. Their ordering is the same as the ordering of growth rates. frames need only be specified when two output arguments are given, since it is then required to disambiguate which two output values the caller wants. 'axisorder': a string, one of 'parpernor' (the default), 'maxminnor', or 'descending'. This determines the ordering of the growth rates and axes at each point. 'parpernor' returns them in the order parallel to the polariser gradient, perpendicular to it within the surface, and normal to the surface. (To be precise, the "parallel" axis is the tensor axis that is closest to being parallel to the gradient, "perpendicular" is the closest to the perpendicular direction, and "normal" is orthogonal to the other two.) 'maxminnor' also puts the rate normal to the surface last, but of the first two it puts the largest value first. 'descending' puts all three values in descending order. 'anisotropythreshold': a non-negative number. Wherever the anisotropy is less than this value, the growth rates returned will be set to zero. Anisotropy is measured in terms of kmax (maximum in-surface growth rate) and kmin (minimum in-surface growth rate) by the following formula: (kmax-kmin)/kmax, or zero if kmax is zero. Anisotropy is zero when growth is perfectly isotropic, and 1 where growth is in one direction only. Pass a value of zero (the default) to allow all values of anisotropy. 'exponential': The value of this option is a non-negative real number. If zero (the default) the growth rate reported will be the amount of growth divided by the time interval TO BE COMPLETED If one output argument is given, then the result will be the requested growth rates for each finite element. If frames is true (the default) and two output arguments are given, then the first result will be the requested growth rates for each finite element, and the second will be the frames of reference. If frames is false and two output arguments are given, then the first result will be the growth rates for the A side of each finite element, and the second result will be the rates for the B side. If four output arguments are given, then the first result will be the requested growth rates on the A side for each finite element, the second will be the corresponding frames of reference, and the third and fourth will be the growth rates and frames of reference for the B side. For example, to plot the parallel growth rate for a given set of displacements from within the interaction function, one can write: growth = leaf_computeGrowthFromDisplacements( m, displacements ); m = leaf_plotoptions( m, ... 'perelement', growth(:,1), 'cmaptype', 'monochrome' ); To use this to plot the growth that has taken place over some extended time interval, you should at the beginning of that interval store the current locations of all of the vertexes, e.g. like this: if (we are at the start of the interval) m.userdata.oldpositions = m.prismnodes; m.userdata.starttime = m.globalDynamicProps.currenttime; end When it is time to calculate the growth, the growth rate parallel to the polariser gradient can be calculated and plotted thus: if (we are at the end of the interval) displacements = m.prismnodes - m.userdata.oldpositions; growth = leaf_computeGrowthFromDisplacements( m, displacements, ... m.globalDynamicProps.currenttime - m.userdata.starttime ); m = leaf_plotoptions( m, ... 'perelement', growth(:,1), 'cmaptype', 'monochrome' ); end For areal growth rate you would use growth(:,1)+growth(:,2). CAUTIONS: 1. The above method of calculating growth over an interval requires that no subdivision or transformation of the mesh have taken place during that interval, otherwise m.prismnodes and m.userdata.oldpositions may have different sizes. 2. The interaction function is called before growth is computed, so the values plotted as a result of the above code will be one step out of date. You can plot the up-to-date values by clicking the "Call" button in GFtbox in order to just call the interaction function without performing a growth step, but for this to be safe you must write your interaction function in such a way that calling it twice in a row always has the same effect as calling it once.

leaf_createmesh.m

m = leaf_createmesh( m, nodes, triangles ) Create a new mesh from a given set of vertexes and triangles. Arguments: M is either empty or an existing mesh. If it is empty, then an entirely new mesh is created, with the default set of morphogens. If M is an existing mesh, then its geometry is replaced by the new mesh. It retains the same set of morphogens (all set to zero everywhere on the new mesh), interaction function, and all other properties not depending on the specific geometry of the mesh. NODES is an N*3 matrix containing N points in 3D space. These are the vertexes of the new mesh. TRIANGLES is an M*3 matrix containing triples of indexes of points in NODES. These must be consistently oriented. All arguments must be present. Options: version: Specifies whether the standard morphogen set should be A-side and B-side growth (the default, given by version = 1), or growth and bend (given by version = 0). Equivalent GUI operation: none. Topics: Mesh creation.

leaf_cylinder.m

m = leaf_cylinder( m, ... ) Create a new surface, in the form of an open-ended cylinder whose axis is the Z axis, centred on the origin. Arguments: M is either empty or an existing mesh. If it is empty, then an entirely new mesh is created, with the default set of morphogens If M is an existing mesh, then its geometry is replaced by the new mesh. It retains the same set of morphogens (all set to zero everywhere on the new mesh), interaction function, and all other properties not depending on the specific geometry of the mesh. Options: 'xwidth' The diameter of the cylinder in the X direction. Default 2. 'ywidth' The diameter of the cylinder in the Y direction. Default 2. 'centre' The position of the centre of the cylinder. 'height' The height of the cylinder. Default 2. 'circumdivs' The number of divisions around the cylinder. Default 12. 'heightdivs' The number of divisions along the axis of the cylinder. Default 4. 'basecap' Boolean. If true, the foot of the cylinder will be closed by a hemispherical cap. 'baseheight' The height of the base cap as a fraction of the radius of the cylinder. 1 will make it exactly hemispherical, 0 will make it flat. 'baserings' The number of rings of triangles to divide the base cap into. If zero, empty, or absent, a default value will be chosen. 'topcap', 'topheight', 'toprings': Similar to basecap, baseheight, and baserings. Example: m = leaf_cylinder( [], 'radius', 2, 'height', 2, 'circumdivs', 12, 'heightdivs', 4 ); See also: LEAF_CIRCLE, LEAF_LUNE, LEAF_ONECELL, LEAF_RECTANGLE, LEAF_SEMICIRCLE. Equivalent GUI operation: selecting "Cylinder" on the pulldown menu on the "Mesh editor" panel, and clicking the "Generate mesh" button. The radius, height, number of divisions around, and number of divisions vertically are given by the values of the text boxes named "radius", "y width", "x divs", and "y divs" respectively. Topics: Mesh creation.

leaf_delete_mgen.m

m = leaf_delete_mgen( m, mgen_name, ... ) Delete from m the morphogen that has the given name. If there is no such morphogen, or if the name is one of the reserved morphogen names, this command is ignored. Any number of names can be given at once. Equivalent GUI operation: clicking the "Delete" button in the "Morphogens" panel, which deletes the currently selected morphogen. See also: leaf_add_mgen, leaf_rename_mgen Topics: Morphogens

leaf_delete_userdata.m

m = leaf_delete_userdata( m, ... ) Delete specified fields from the userdata of m. The arguments should be strings. If no strings are given, all the user data is deleted. If a named field does not exist, it is ignored. See also: LEAF_SET_USERDATA, LEAF_ADD_USERDATA. Equivalent GUI operation: none. Topics: User data

leaf_deletenodes.m

m = leaf_deletenodes( m, nodes ) Delete from the leaf every finite element for which any of the nodes is a vertex. Arguments: nodes: A list of the nodes to delete, or a boolean map of the nodes which is true for the nodes to be deleted. Equivalent GUI operation: none. Topics: Mesh editing.

leaf_deletepatch.m

m = leaf_deletepatch( m, cells ) Delete the specified finite element patches from the leaf. Arguments: cells: A list of the cells to delete, or a boolean map of the cells which is true for the cells to be deleted. Equivalent GUI operation: clicking on the mesh when the "Delete canvas" item is selected in the "Mouse mode" pulldown menu. Topics: Mesh editing.

leaf_deletepatch_from_morphogen_level.m

function m=leaf_deletepatch_from_morphogen_level(m,wound) method for deleting a region of mesh specified by setting a morphogen (say 'wound') greater than 0.5. The value of 'wound' specified for all the vertices of the patch to be deleted must be set to greater than 0.5 (i.e. a patch is not specified by a single vertex - there must be at least three) Topics: Mesh editing.

leaf_deletesecondlayer.m

m = leaf_deletesecondlayer( m ) Delete the first biological layer. Equivalent GUI operation: clicking the "Delete all cells" button in the "Cells" panel. Topics: Bio layer.

leaf_deletestages.m

m = leaf_deletestages( m ) Delete all the stage files for m, and optionally, the stage times. Deleted files are gone at once, not put in the wastebasket. Options: 'times' Boolean. Default false. 'stages' Boolean. Default true. If 'stages' and 'times' are both true, then all stage files and stage times will be deleted. If 'stages' is true and 'times' is false, then the stage files will be deleted, but all stage times will be retained. If 'stages' is false and 'times' is true, then the stage files will be preserved, and all times will be deleted for which there is no stage file. If 'stages' and 'times' are both false, nothing happens. Equivalent GUI operation: the "Delete All Stages..." and "Delete Stages and Times" commands on the Stages menu. Topics: Project management.

leaf_destrain.m

m = leaf_destrain( m ) Remove all residual strain from the mesh. Equivalent GUI operation: clicking the "De-strain" button on the "Simulation" panel. Topics: Simulation.

leaf_dissect.m

m = leaf_dissect( m ) Cut m along all of its seam edges. Arguments and options: none. Topics: Mesh editing, Seams.

leaf_dointeraction.m

[m,ok] = leaf_dointeraction( m, enable ) Execute the interaction function once, without doing any simulation steps. This will happen even if the do_interaction property of the mesh is set to false, If there is no interaction function, this has no effect. If there is an interaction function and it throws an exception, OK will be returned as FALSE. Arguments: enable: 1 if the interaction function should be enabled for all subsequent simulation steps, 0 if its state of enablement should be left unchanged (the default). If the i.f. throws an error then it will be disabled for subsequent steps regardless of the setting of this argument. Topics: Interaction function.

leaf_edit_interaction.m

m = leaf_edit_interaction( m, ... ) Open the interaction function in the Matlab editor. If there is no interaction function, create one. Options: 'force' If true, the interaction function will be opened even if the model m is marked read-only. If false (the default) a warning will be given and the function not opened. Extra results: ok is true if the function was opened, false if for any reason it was not. Topics: Interaction function.

leaf_enablelegend.m

m = leaf_enablelegend( m, enable ) Cause the legend to be drawn or not drawn. When not drawn, the graphic item that holds the legend text will be made invisible. Arguments: enable: A boolean specifying whether to draw the legend (default true). Topics: Plotting.

leaf_enablemutations.m

m = leaf_enablemutations( m, enable ) Enable or disable mutations. Arguments: enable: True to enable all mutations, false to disable them. Examples: m = leaf_enablemutations( m, 0 ); % Disable all mutations, i.e. revert to wild-type. Topics: Morphogens, Mutation.

leaf_explode.m

m = leaf_explode( m, amount ) Separate the connected components of m. Arguments: amount: Each component of m is moved so as to increase the distance of its centroid from the centroid of m by a relative amount AMOUNT. Thus AMOUNT==0 gives no movement and AMOUNT < 0 will draw the pieces inwards. Topics: Mesh editing.

leaf_fix_mgen.m

m = leaf_fix_mgen( m, morphogen, ... ) Make the current value of a specified morphogen at a specified vertex or set of vertexes be fixed or changeable. Arguments: 1: The name or index of a morphogen. Options: 'vertex' Indexes of the vertexes. The default is the empty list (i.e. do nothing). 'fix' 1 or true if the value is to be made fixed, 0 or false if it is to be made changeable. The default is true. Equivalent GUI operation: control-clicking or right-clicking on the canvas when the Morphogens panel is selected. Topics: Morphogens.

leaf_fix_vertex.m

m = leaf_fix_vertex( m, ... ) Constrain vertexes of the mesh so that they are only free to move along certain axes; or remove such constraints. Options: 'vertex' The vertexes to be constrained or unconstrained. If the empty list is supplied, the set of all vertexes is used. 'dfs' The degrees of freedom to be constrained. This is a string made of the letters 'x', 'y', and 'z'. This defaults to 'xyz', i.e. fix the vertexes completely. Each degree of freedom not in dfs will be made unconstrained for all of the given vertexes. Vertexes not in the list of vertexes will have their constraints left unchanged. Note that to remove all constraints from all vertexes, do this: m = leaf_fix_vertex( m, 'vertex', [], 'dfs',);It is only possible to constrain vertexes in directions parallel to the axes. Invalid vertex indexes will be detected, warned about, and ignored. If you receive such a warning you should check the indexes you are supplying, since the fact of some of them being out of range may cast doubt on the correctness of the others. Equivalent GUI operation: clicking on the mesh while the Mesh editor panel is selected and 'Fix' is selected in the mouse-mode menu. The 'x', 'y', and 'z' checkboxes specify which degrees of freedom to constrain or unconstrain. Topics: Mesh editing.

leaf_flatstrain.m

m = leaf_flatstrain( m ) Set the residual strains in the mesh to what they would be if the whole mesh were flat. Arguments: none. Options: none. Equivalent GUI operation: clicking the "Flat strain" button in the "Simulation" panel. Topics: Simulation.

leaf_flatten.m

[m,ok] = leaf_flatten( m ) Flatten each of the connected components of m. Options: interactive: If true (default is false), then the flattening will be carried out interactively. The user can skip the flattening of components that appear not to be well flattenable, or cancel the whole operation. method: One of the following: 'laplacian' (NOT IMPLEMENTED) 'geodesic' (NOT IMPLEMENTED) 'ballandspring' (the default) getdeformation: Boolean. If true (the default), the deformation to its that would restore the shape of each flattened element original shape is calculated and stored in m.celldata(:).cellThermExpGlobalTensor. If the leaf is then grown with the property 'useGrowthTensors' set to true, then in one unit of time its original shape should be (approximately) restored. bsiters: An integer. The maximum number of iterations to perform in the ball-and-spring phase. If 0, the ball-and-spring phase will be omitted. The growth output argument is optional. If provided, it will be set to a set of growth tensors, one per finite element, describing the deformation from the flattened state to the original. Topics: Mesh editing.

leaf_flattenByElasticity.m

m = leaf_flatten( m ) Flatten each of the connected components of m. Options: ratio: This is the proportion of the flattening displacements to apply. The default value is 1, i.e. complete flattening. Topics: OBSOLETE, Mesh editing.

leaf_fliporientation.m

m = leaf_fliporientation( m ) Interchange the two surfaces of the mesh. Topics: Mesh editing.

leaf_getimage.m

img = leaf_getimage( m ) Get an image of the current mesh. It will be forced to be the same size as the size stored in m.globalProps.framesize, unless that is empty, in which case m.globalProps.framesize will be set to the size of the captured image. This ensures that successive images are all the same size, which is essential when recording a movie. See also: leaf_movie. Topics: Movies/Images

leaf_getplotoptions.m

s = leaf_getplotoptions( m, ... ) Read the default plotting options. See LEAF_PLOT for details. The arguments are names of any plotting options that can be passed to LEAF_PLOT or LEAF_PLOTOPTIONS. The result is a structure whose fields are those option names and whose values are the values they have in m. Unrecognised options will be ignored. Unlike most leaf_* commands, this command does not modify m and therefore does not return a new value of m. See also: leaf_plot, leaf_plotoptions. Topics: Plotting.

leaf_getproperty.m

s = leaf_getproperty( m, ... ) Read various properties of the mesh. The arguments are any property names that can be passed to leaf_setproperty. The result is a structure whose fields are those names and whose values are the values they have in m. Unrecognised names will be ignored. Unlike most leaf_* commands, this command does not modify m and therefore does not return a new value of m. See also: leaf_setproperty. Topics: Misc.

leaf_gyrate.m

m = leaf_gyrate( m, ... ) Spin and/or tilt the mesh about the Z axis, leaving it at the end in exactly the same orientation as when it started. If a movie is currently being recorded, the animation will be appended to the movie. The current view is assumed to have already been written to the movie. Options: 'frames': The number of frames to be added. Default 32. 'spin': The number of complete rotations about the Z axis. Default 1. 'waveangle': If zero (the default) spinning is in complete revolutions. If non-zero, spinning consists of turning right and left and back to centre. The initial direction will be rightwards of waveangle is positive. 'tilt': The number of cycles of tilting up, down, and back to the initial elevation. Default 1. 'tiltangle': The angle to tilt up and down to, in degrees from the horizontal. Default 89.99. Topics: Movies/Images, Plotting.

leaf_hemisphere.m

m = leaf_hemisphere( m, ... ) Create a new hemispherical mesh. The mesh is oriented so that the cell normals point outwards. Arguments: M is either empty or an existing mesh. If it is empty, then an entirely new mesh is created, with the default set of morphogens If M is an existing mesh, then its geometry is replaced by the new mesh. It retains the same set of morphogens (all set to zero everywhere on the new mesh), interaction function, and all other properties not depending on the specific geometry of the mesh. Options: 'diameter' The diameter of the hemisphere in both x and y directions. Default 2. 'xwidth' The diameter of the hemisphere in the x direction. Default 2. 'ywidth' The diameter of the hemisphere in the y direction. Default 2. 'divisions' The number of divisions around the circumference. Default 20. 'rings' The number of circular rings of triangles to divide it into. Default is floor(divisions/6). Example: m = leaf_hemisphere( [], 'radius', 2, 'divisions', 15, 'rings', 3 ); Equivalent GUI operation: selecting "Hemisphere" on the pulldown menu on the "Mesh editor" panel, and clicking the "Generate mesh" button. The radius and the number of rings are specified in the text boxes with those labels. Topics: Mesh creation.

leaf_icosahedron.m

m = leaf_icosahedron( m, ... ) Create a new icosahedral mesh. Arguments: M is either empty or an existing mesh. If it is empty, then an entirely new mesh is created, with the default set of morphogens If M is an existing mesh, then its geometry is replaced by the new mesh. It retains the same set of morphogens (all set to zero everywhere on the new mesh), interaction function, and all other properties not depending on the specific geometry of the mesh. Options: 'radius' The radius of the icosahedron. Default 1. Example: m = leaf_circle( [], 'radius', 2, 'rings', 4 ); Equivalent GUI operation: selecting "Circle" or "Hemisphere" on the pulldown menu on the "Mesh editor" panel, and clicking the "Generate mesh" button. Topics: Mesh creation.

leaf_iterate.m

[m,ok] = leaf_iterate( m, numsteps, ... ) Run the given number of iterations of the growth process. In each iteration, the following things happen: * Strains are set up in the leaf according to the effects of the morphogens at each point causing the material to grow. * The elasticity problem is solved to produce a new shape for the leaf. * Morphogens which have a nonzero diffusion coefficient are allowed to diffuse through the mesh. * If dilution by growth is enabled, the amount of every morphogen is diluted at each point according to how much that part of the leaf grew. * A user-supplied routine is invoked to model local interactions between the morphogens. * The layer of biological cells is updated. * If requested by the options, the mesh is plotted after each iteration. Results: ok: True if there was no problem (e.g. invalid arguments, a user interrupt, or an error in the interaction function). False if there was. Arguments: numsteps: The number of iterations to perform. If this is zero, the computation will continue indefinitely or until terminated by the 'until' or 'targetarea' options. The default is 1. Options: 'until' Run the simulation until this time has been reached or exceeded. A value of zero disables this option. 'targetarea' Run the simulation until the area of the canvas is at least this number times the initial area. A value of zero disables this option. 'plot' An integer n. The mesh will be plotted after every n iterations. 0 means do not plot the mesh at all; -1 means plot the mesh only after all the iterations have been completed. The default value is 1. Example: m = leaf_iterate( m, 20, 'plot', 4 ); Equivalent GUI operation: clicking one of the following buttons in the "Simulation" panel: "Run" (do a specified number of steps), "Step" (do one step), or "Run to..." (run until the area has increased by a specified factor). Topics: Simulation.

leaf_light.m

m = leaf_light( m, on ) Turn the scene light on or off. Arguments: on: boolean, true if the light is to be on. Topics: Plotting.

leaf_load.m

m = leaf_load( m, filename, ... ) Load a mesh from a file. If no filename is given, a dialog will be opened to choose one. The expected format depends on the extension of the filename: .MAT The leaf is contained in the file as a Matlab object called m. .M The file contains Matlab commands to create or modify a leaf. These commands will be executed. .OBJ Contains only nodes and triangles, in OBJ format. All other properties of the mesh will be set to their default values. If no filename is given, a dialog will be opened to choose one. If the filename consists of just an extension (including the initial "."), a dialog will be opened showing only files with that extension. All of these formats can be generated by leaf_save. In the case of .MAT and .OBJ files, the existing leaf will be discarded. A .M file will discard the current leaf only if it contains a command to create a new leaf; otherwise, it will apply its commands to the current leaf. Equivalent GUI operation: the "Load..." button. Topics: Files, Mesh editing.

leaf_loadgrowth.m

m = leaf_loadgrowth( m, filename ) Load growth data for the leaf from an OBJ or MAT file. If no filename is given, one will be asked for. This assumes the mesh is in growth/anisotropy mode. Equivalent GUI operation: the "Load Growth..." button on the "Morphogens" panel. Topics: Files, Mesh editing.

leaf_loadmodel.m

[m,ok] = leaf_loadmodel( m, modelname, projectdir, ... ) Load a model. If no model name is given or the model name is empty, a dialog will be opened to choose one. The model will be looked for in projectdir, if given, otherwise the project directory of m, if any, otherwise the current directory. The argument m can be empty; in fact, this will be the usual case. If the model is successfully loaded, the new model is returned in M and the (optional) return value OK is set to TRUE. Otherwise M is left unchanged and OK is set to FALSE. Options: rewrite: Normally, when a model is loaded, its interaction function (if there is one) is read, parsed, and rewritten. This is because it may have been created with an older version of GFtbox. Specifying the rewrite option as false prevents this from being done. This may be necessary when running several simulations concurrently on a parallel machine, all using the same project. Note that when rewrite is true (the default), the interaction function will not actually be rewritten until the first time it is called, or any morphogen is added, deleted, or renamed, or the user requests a rewrite. copyname, copydir: If either of these is given, a new copy of the project will be made and saved with the specified project name and parent folder. The original project folder will be unmodified. If one of these options is given, the other can be omitted or set to the empty string, in which case it defaults to the original project name or project folder respectively. If the value of copyname is '?', then the user will be prompted to select or create a project folder. In this case, copydir will be the folder at which the select-folder dialog starts. If both options are empty, this is equivalent to omitting both of them (the default). If copydir and copyname are the same as modelname and projectdir, a warning will be given, and the copy options ignored. interactive: A boolean value. If true, situations such as missing files will be reported by dialogs; if false, no dialogs will be presented. In both cases a message will be written to the console. If for any reason the model cannot be saved, a warning will be output, the loaded model will be discarded, and the empty list returned. Equivalent GUI operation: the "Load model..." button, or the items on the Projects menu. The items on the Motifs menu use copyname and copydir to force the "motif" projects to be opened as copies in the user's default project directory. Examples: m = leaf_loadmodel( [], 'flower7', 'C:\MyProjects\flowers', ... 'copyname', 'flower8', ... 'copydir', 'C:\MyProjects\flowers' ); This loads a model from the folder 'C:\MyProjects\flowers\flower7', and saves it into a new project folder 'C:\MyProjects\flowers\flower8'. Since the value of copydir is the same as the projectdir argument, the copydir option could have been omitted. Topics: Project management.

leaf_lobes.m

m = leaf_lobes( m, ... ) Create a new mesh in the form of one or more lobes joined together in a row. A lobe is a semicircle on top of a rectangle. Arguments: M is either empty or an existing mesh. If it is empty, then an entirely new mesh is created, with the default set of morphogens If M is an existing mesh, then its geometry is replaced by the new mesh. It retains the same set of morphogens (all set to zero everywhere on the new mesh), interaction function, and all other properties not depending on the specific geometry of the mesh. Options: 'radius' The radius of the semicircle. Default 1. 'rings' The number of circular rings of triangles to divide it into. Default 4. 'height' The height of the rectangle, as a multiple of the semicircle's diameter. Default 0.7. 'strips' The number of strips of triangles to divide the rectangular part into. If 0 (the default), this will be calculated from the height so as to make the triangles similar in size to those in the lobes. 'lobes' The number of lobes. The default is 1. 'base' Half the number of divisions along the base of a lobe. Defaults to rings. 'cylinder' The series of lobes is to behave as if wrapped round a cylinder and the two ends stitched together. This is implemented by constraining the nodes on the outer edges in such a way that the outer edges remain parallel to the y axis. Example: m = leaf_lobes( 'radius', 2, 'rings', 4, 'lobes', 3, 'base', 2 ); See also: LEAF_CIRCLE, LEAF_CYLINDER, LEAF_LUNE, LEAF_ONECELL, LEAF_RECTANGLE. Equivalent GUI operation: selecting "Lobes" in the pulldown menu in the "Mesh editor" panel and clicking the "Generate mesh" button. Topics: Mesh creation.

leaf_locate_vertex.m

m = leaf_locate_vertex( m, ... ) Ensure that certain degrees of freedom of a single node remain constant. This is ensured by translating the mesh so as to restore the values of the specified coordinates, after each iteration. Options: 'vertex' The vertex to be held stationary. If the empty list is supplied, no vertex will be fixed and dfs is ignored. 'dfs' The degrees of freedom to be held stationary. This is a string made of the letters 'x', 'y', and 'z'. This defaults to 'xyz', i.e. fix the vertex completely. Each degree of freedom not in dfs will be unconstrained. It is only possible to fix a vertex in directions parallel to the axes. Equivalent GUI operation: clicking on the mesh while the Mesh editor panel is selected and 'Locate' is selected in the Fix/Delete menu. The 'x', 'y', and 'z' checkboxes specify which degrees of freedom to constrain or unconstrain. Topics: Mesh editing.

leaf_lune.m

m = leaf_lune( m, ... ) NOT IMPLEMENTED. Create a new mesh in the shape of a stereotypical leaf, oval with pointed ends. Arguments: M is either empty or an existing mesh. If it is empty, then an entirely new mesh is created, with the default set of morphogens If M is an existing mesh, then its geometry is replaced by the new mesh. It retains the same set of morphogens (all set to zero everywhere on the new mesh), interaction function, and all other properties not depending on the specific geometry of the mesh. Options: 'xwidth' The diameter in the X dimension. Default 3. 'ywidth' The diameter in the Y dimension. Default 2. 'xdivs' The number of segments to divide it into along the X axis. Default 8. Example: m = leaf_lune( [], 'xwidth', 3, 'ywidth', 2, 'xdivs', 8 ); See also: LEAF_CIRCLE, LEAF_CYLINDER, LEAF_ONECELL, LEAF_RECTANGLE, LEAF_SEMICIRCLE, LEAF_LOBES. Equivalent GUI operation: selecting "Leaf" in the pulldown menu in the "Mesh editor" panel and clicking the "Generate mesh" button. Topics: UNIMPLEMENTED, Mesh creation.

leaf_makesecondlayer.m

m = leaf_makesecondlayer( m, ... ) Make a new Bio-A layer, either adding to or discarding any existing one. Options: mode: One of the following strings: 'full': cover the entire surface with a continuous sheet of cells. There will be one cell per FE cell plus one cell per FE vertex. 'grid': cover the entire surface with a continuous sheet of square cells. 'voronoi': cover the entire surface with a continuous sheet of cells. The 'numcells' option specifies how many. This is only valid for flat or nearly flat meshes. 'single': make a single second layer cell in a random position. 'few': make a specified number of second layer cells, each in a different randomly chosen FEM cell. 'each': make one second layer cell within each FEM cell. absdiam: Not valid for mode=full. In all other cases, this is a real number, being the diameter of a single cell. absarea: Not valid for mode=full. In all other cases, this is a real number, being the area of a single cell. reldiam: Not valid for mode=full. In all other cases, this is a real number, being the diameter of a single cell as a proportion of the diameter of the current mesh (estimated as the square root of the mesh area). relarea: Not valid for mode=full. In all other cases, this is a real number, being the area of a single cell as a proportion of the area of the current mesh. relinitarea: Not valid for mode=full. In all other cases, this is a real number, being the area of a single cell as a proportion of the area of the initial mesh. abssize: OBSOLETE, REMOVED. Use 'absdiam' instead. relsize: OBSOLETE, REMOVED. Use 'reldiam' instead. relinitarea: OBSOLETE, REMOVED. relFEsize: OBSOLETE, REMOVED. axisratio: The ratio of major to minor axis of the cells. If this is not 1, the major axis will be parallel to the polariser gradient, if any; if there is no polariser gradient, or at the cell location it is beneath the threshold for it to be effective, the cell will be created circular. The default value is 1. numcells: Valid only for mode='voronoi', mode='each', or mode='few'. An integer specifying the number of cells to create. sides: Each cell is created as a regular polygon having this many sides. The default is 12, but if you are using a very large number of cells, rendering will be significantly faster if you use fewer sides. refinement: NOT USED. IGNORE. add: Boolean. If true, existing cells are retained and new cells are added to them. If false, any existing biological layer is discarded. If 'mode' is 'full' or 'voronoi', the old layer is always discarded, ignoring the 'add' argument. allowoverlap: Boolean. If true, cells are allowed to overlap each other. If false, cells will not overlap each other. You may as a result end up with fewer cells that you asked for. colors: The colour of the new cells, as an RGB value. colorvariation: The amount of variation in the colour of the new cells. Each component of the colour value will be randomly chosen within this ratio of the value set by the 'color' argument. That is, a value of 0.1 will set each component to between 0.9 and 1.1 times the corresponding component of the specified colour. (The variation is actually done in HSV rather than RGB space, but the difference is slight.) probperFE: For 'each' mode, this specifies for each FE the probability per unit area for creating a cell there. Any value less than 0 is equivalent to 0. The values will be scaled so as to add to 1. probpervx: Like probperFE, but the values are given per vertex. Alternatively, the value can be a morphogen name or index, in which case the values of that morphogen at each vertex will be used. The options 'probperFE', and 'probpervx' are mutually exclusive. vertexdata: Instead of generating the cells according to one of the methods described above, take this N*3 array to be the positions of all of the cell vertexes. celldata: To be used with vertexdata. This is a cell array of integer arrays, each integer array specifying the vertexes of one cell in order around the cell. vertexindexing: This is either 1 or 0. If celldata is provided, then this specifies whether the indexes in celldata are 1-based or 0-based. 1-based is the default, since that is Matlab's convention for all indexing of arrays, but external data may often be zero-based. If vertexindexing is not supplied or is empty, then if zero occurs anywhere in celldata, it will be assumed to be zero-based, otherwise 1-based. If either 'vertexdata' or 'celldata' is supplied, the other must also be, and all other options that specify the manner of creating cells will be ignored. At most one of ABSDIAM, ABSAREA, RELDIAM, and RELAREA should be given. Equivalent GUI operation: clicking the "Make cells" button on the Bio-A panel. This is equivalent to m = leaf_makesecondlayer(m,'mode','full'). Topics: Bio layer.

leaf_mgen_absorption.m

m = leaf_mgen_absorption( m, morphogen, absorption ) Set the rate at which a specified morphogen is absorbed. Arguments: morphogen: The name or index of a morphogen. absorption: The rate of decay of the morphogen. A value of 1 means that the morphogen decays by 1% every 0.01 seconds. Values can be set for multiple morphogens by listing morphogens names and absorptions alternately. Where more than one morphogen is to be given the same absorption, an array of morphogen indexes or a cell array of morphogen names can be given. Examples: m = leaf_mgen_absorption( m, {'abc','def'}, 0.5 ); Equivalent GUI operation: setting the value in the "Absorption" text box in the "Morphogens" panel. Topics: Morphogens.

leaf_mgen_color.m

m = leaf_mgen_color( m, ... ) Associate colours with morphogens. Options: 'morphogen': The morphogens to attach colours to. This can be a single morphogen name, an array of morphogen indexes, or a cell array or morphogen names. 'color': Either a single letter, as used in various Matlab plotting functions, a single RGB triple (row or column), or a 3*N array of colours, one for each of the N morphogens specified by the morphogen argument. If you give an N*3 array instead it will transpose it for you, unless N=3, in which case you have to get it right yourself. The colours are the columns, not the rows. Instead of a single letter, it can be a pair of letters, in which case the first is used for the color of positive values and the second for negative values. If numerical values are supplied, color can be an A*B*2 array, in which color(:,:,1) is used as described above for the positive values, and color(:,:,2) is used for the negative values. If colours are not provided for negative values, colours opposite to those supplied for positive values will automatically be used. Topics: Morphogens, Plotting.

leaf_mgen_conductivity.m

m = leaf_mgen_conductivity( m, morphogen, conductivity, ... ) Set the rate at which a specified morphogen diffuses through the leaf. Arguments: morphogen: The name or index of a morphogen. conductivity: The diffusion constant for the morphogen, in units of length^2/time. Values can be set for multiple morphogens by listing morphogen names and conductivities alternately. Where more than one morphogen is to be given the same conductivity, an array of morphogen indexes or a cell array of morphogen names can be given. Example: m = leaf_mgen_conductivity( m, 'kapar', 0.05, {'foo','bar'}, 0.3, [10 12 13], 0.02 ); This will set the diffusion constant for KAPAR to 0.05, those for FOO and BAR to 0.3, and those for morphogens 10, 12, and 13 to 0.02. Equivalent GUI operation: setting the value in the "Diffusion" text box in the "Morphogens" panel. Topics: Morphogens.

leaf_mgen_const.m

m = leaf_mgen_const( m, morphogen, amount ) Add a constant amount to the value of a specified morphogen everywhere. Arguments: 1: The name or index of a morphogen. Currently, if the name is provided, it must be one of the following: 'growth', 'polariser', 'anisotropy', 'bend', 'bendpolariser', 'bendanisotropy'. These are respectively equivalent to the indexes 1 to 6 (which are the only valid indexes). There is no default for this option. 2: The amount of morphogen to add to every node. A value of 1 will give moderate growth or bend, and a maximum growth or bend anisotropy. A constant field of growth or bend polarizer has no effect: polarising morphogen has an effect only through its gradient. Examples: m = leaf_mgen_const( m, 'growth', 1 ); m = leaf_mgen_const( m, 3, 0.8 ); See also: LEAF_MGEN_RADIAL. Equivalent GUI operation: clicking the "Add const" button in the "Morphogens" panel. The amount is specified by the "Amount slider and test item. Topics: Morphogens.

leaf_mgen_dilution.m

m = leaf_mgen_dilution( m, morphogen, enable ) Set the rate at which a specified morphogen is absorbed. Arguments: 1: The name or index of a morphogen. 2: A boolean specifying whether to enable dilution by growth Examples: m = leaf_mgen_dilution( m, 'growth', 1 ); Equivalent GUI operation: setting the "Dilution" checkbox in the "Morphogens" panel. Topics: Morphogens.

leaf_mgen_edge.m

m = leaf_mgen_edge( m, morphogen, amount, ... ) Set the value of a specified morphogen to a given amount everywhere on the edge of the leaf. Arguments: 1: The name or index of a morphogen. 2: The maximum amount of morphogen to add to every node. Examples: m = leaf_mgen_edge( m, 'growth', 1 ); See also: leaf_mgen_const. Equivalent GUI operation: clicking the "Add edge" button in the "Morphogens" panel. The amount is specified by the "Amount slider and test item. Topics: Morphogens.

leaf_mgen_get_conductivity.m

c = leaf_mgen_get_conductivity( m, morphogens ) Return the rate at which a specified morphogen diffuses through the leaf. Arguments: morphogens: The name or index of a morphogen, or a cell array or numeric array of morphogens. The result is a struct array with one element for each morphogen requested. The fields of each struct will be Dpar and Dper, each of which will be either a single number or an array or numbers, one per finite element. Dper may also be empty. These are the diffusion constants of the morphogen parallel or perpendicular to the polariser gradient. A single number imples a constant value over the whole mesh. An empty array for Dper implies that it is everywhere identical to Dpar. An empty array for Dpar implies that it is everywhere zero. Example: c = leaf_mgen_get_conductivity( m, {'foo','bar'} ); c will be a struct array of length two. Topics: Morphogens.

leaf_mgen_linear.m

m = leaf_mgen_linear( m, morphogen, amount, ... ) Set the value of a specified morphogen to a linear gradient. Arguments: 1: The name or index of a morphogen. 2: The maximum amount of morphogen to add to every node. Options: 'direction' Either a single number (the angle in degrees between the gradient vector and the X axis, the gradient vector lying in the XY plane; or a triple of numbers, being a vector in the direction of the gradient. The length of the vector does not matter. Default is a gradient parallel to the positive X axis. Examples: m = leaf_mgen_linear( m, 'growth', 1, 'direction', 0 ); See also: leaf_mgen_const. Equivalent GUI operation: clicking the "Add linear" button in the "Morphogens" panel. The amount is specified by the "Amount" slider and test item. Direction is specified in degrees by the "Direction" text box. Topics: Morphogens.

leaf_mgen_modulate.m

m = leaf_mgen_modulate( m, ... ) Set the switch and mutant levels of a morphogen. Options: morphogen: The name or index of a morphogen. If omitted, the properties are set for every morphogen. switch, mutant: Value by which the morphogen is multiplied to give its effective level. If either switch or mutant is omitted its current value is left unchanged. The effective value of a morphogen is the product of the actual morphogen amount, the switch value, and the mutant value. So mutant and switch have the same effect; the difference is primarily in how they are intended to be used. Mutant value is settable in the Morphopgens panel of the GUI and is intended to have a constant value for each morphogen throughout a run. There is also a checkbox in the GUI to turn all mutations on and off. Switch value has no GUI interface, and is intended to be changed in the interaction function. The switch values are always effective. The initial values for switch and mutant in a newly created leaf are 1. Examples: m = leaf_mgen_modulate( m, 'morphogen', 'div', ... 'switch', 0.2, ... 'mutant', 0.5 ); Sets the switch level of 'div' morphogen to 0.2 and the mutant level to 0.5. The effective level will then be 0.1 times the actual morphogen. Topics: Morphogens.

leaf_mgen_plotpriority.m

m = leaf_mgen_plotpriority( m, morphogen, priority, thresholds ) Set the plotting priorities of specified morphogens. In multi-plot mode, the priorities determine whether morphogens present at the same place are mixed, or one overlies the other. The default priority for all morphogens is 0. When multiple morphogens of differing priorities are plotted together, the procedure for determining the colour of a vertex is as follows: 1. For each group of morphogens of the same priority, the colors for those morphogens are mixed. This gives one coloring of the whole mesh for each priority group. 2. At each vertex of the mesh, the chosen colour is taken from the color map of highest priority for which at least one of the associated morphogens is above its plotting threshold at that vertex. If the canvas has a background colour, it is considered to have the same priority as the morphogen with least priority, or zero, whichever is less. Arguments: 1: The name or index of a morphogen, or a cell array of names or an array of indexes 2: The priorities of the listed morphogens. If a single value is given it is applied to all of them. If multiple values are given there must be exactly as many of them as in the list of morphogens. Priorities can be any numerical value. 3: (Optional) Thresholds for each of the listed morphogens. In multi-plotting mode, a morphogen whose value is less than or equal to its threshold will be treated as zero for the purpose of masking lower-priority morphogens. The default threshold is zero. Example: m = leaf_mgen_plotpriority( m, ... {'id_sink','id_source','id_ridge'}, [1 1 2], [0,0,0.1] ); This gives priority 2 to the morphogen id_ridge, 1 to id_sink and id_source, and leaves all others with the default priority of zero. If all morphogens are being plotted together, then where id_ridge is greater than 0.1, its colour will be plotted. Elsewhere, where id_sink or id_source is greater than zero, their colours will be mixed and plotted. Everywhere else, the other morphogen colours will be mixed together. This will have the effect that id_source will overlie id_sink, and both will overlie all other morphogens. Equivalent GUI operation: None. Topics: Plotting.

leaf_mgen_radial.m

m = leaf_mgen_radial( m, morphogen, amount, ... ) Add to the value of a specified morphogen an amount depending on the distance from an origin point. Arguments: 1: The name or index of a morphogen. 2: The maximum amount of morphogen to add to every node. Options: 'x', 'y', 'z' The X, Y, and Z coordinates of the centre of the distribution, relative to the centre of the mesh. Default is (0,0,0). Examples: m = leaf_mgen_radial( m, 'growth', 1, 'x', 0, 'y', 0, 'z', 0 ); m = leaf_mgen_radial( m, 'g_anisotropy', 0.8 ); See also: leaf_mgen_const. Equivalent GUI operation: clicking the "Add radial" button in the "Morphogens" panel. The amount is specified by the "Amount slider and test item. x, y, and z are specified in the text boxes of those names. Topics: Morphogens.

leaf_mgen_random.m

m = leaf_mgen_random( m, morphogen, amount, ... ) Add a random amount of a specified morphogen at each mesh point. Arguments: 1: The name or index of a morphogen. 2: The maximum amount of morphogen to add to every node. Options: 'smooth' An integer specifying the smoothness of the distribution. 0 means no smoothing: the value at each node is independent of each of its neighbours. Greater values imply more smoothness. Default is 2. Examples: m = leaf_mgen_random( m, 'growth', 1 ); m = leaf_mgen_random( m, 'g_anisotropy', 0.8 ); See also: LEAF_MGEN_CONST. Equivalent GUI operation: clicking the "Add random" button in the "Morphogens" panel. The amount is specified by the "Amount slider and test item. Topics: Morphogens.

leaf_mgen_reset.m

m = leaf_mgen_reset( m ) Set the values of all morphogens, and their production rates and clamp settings, to zero everywhere. Example: m = leaf_mgen_reset( m ); Equivalent GUI operation: clicking the "Set zero all" button in the "Morphogens" panel. Topics: Morphogens.

leaf_mgen_scale.m

m = leaf_mgen_scale( m, morphogen, scalefactor ) Scale the value of a given morphogen by a given amount. Arguments: 1: The name or index of a morphogen. 2: The scale factor. Examples: m = leaf_mgen_scale( m, 'bpar', -1 ); See also: leaf_mgen_const. Equivalent GUI operation: clicking the "Invert" button in the "Morphogens" panel will scale the current morphogen by -1. There is not yet a user interface for a general scale factor. Topics: Morphogens.

leaf_mgen_zero.m

m = leaf_mgen_zero( m, morphogen ) Set the value of a specified morphogen to zero everywhere. Arguments: 1: The name or index of a morphogen. Examples: m = leaf_mgen_zero( m, 'growth' ); See also: LEAF_MGEN_CONST. Equivalent GUI operation: clicking the "Set zero" button in the "Morphogens" panel. Topics: Morphogens.

leaf_mgeninterpolation.m

m = leaf_mgeninterpolation( m, ... ) Set the interpolation mode of morphogens of m. When an edge of the mesh is split, this determines how the morphogen values at the new vertex are determined from the values at either end of the edge. Options: 'morphogen' This can be a morphogen name or index, a cell array of morphogen names and indexes, or a vector of indexes. 'interpolation' Either 'min', 'max', or 'average'. If 'min', the new values are the minimum of the old values, if 'max' the maximum, and if 'average' the average. GUI equivalent: the radio buttons in the "On split" subpanel of the "Morphogens" panel. These set the interpolation mode for the current morphogen. As of the version of 2008 Sep 03, new meshes are created with the interpolation mode for all morphogens set to 'min'. Previously the default mode was 'average'. Example: m = leaf_mgeninterpolation( m, ... 'morphogen', 1:size(m.morphogens,2), ... 'interpolation', 'average' ); This sets the interpolation mode for every morphogen to 'average'. Topics: Morphogens.

leaf_morphogen_midpoint.m

function [m,target_p,TargetMorphArea]=morphogen_midpoint(m,varargin) uses one or two gradient of diffusing morphogen to define a region in TARGETMORPH. initially the region is set to the value 1 However, once it is stable it is set to 2 and the interaction function should stop trying to change the midpoint. It also defines a region of all vertices > threshold used to define TARGETMORPH (i.e. all below the midpoint) usage %intersection of two opposing gradients and view clustering [circ2_p,tube_p]=leaf_morphogen_midpoint('DIFF1MORPH',p1_l,... 'DIFF2MORPH',p2_l,'TARGETMORPH',circ2_p,'LABEL','CIRC2','VERBOSE',true); %intersection of two opposing gradients [circ2_p,tube_p]=leaf_morphogen_midpoint('DIFF1MORPH',p1_l,... 'DIFF2MORPH',p2_l,'TARGETMORPH',circ2_p); %find lowpoint in a U shaped diffusing morphogen [mid_p]=leaf_morphogen_midpoint('DIFF1MORPH',midd_p,'TARGETMORPH',mid_ p); Topics: Morphogens.

leaf_morphogen_pulse.m

[gm_l,gm_p]=leaf_morphogen_pulse(m,varargin) Topics: Morphogens.

leaf_morphogen_switch.m

function gm_l=leaf_morphogen_switch(m,varargin) usage Here the default on and off values of 0 and 1 are used [m,tube_l]=leaf_morphogen_switch(m,... 'StartTime',OnsetOfTubeGrowth,'EndTime',FinishTubeGrowth,... 'Morphogen_l','tube','RealTime',realtime); Alternatively, these can be specified [m,basemid_l]=leaf_morphogen_switch(m,... 'StartTime',OnsetOfTubeGrowth,'EndTime',FinishTubeGrowth,... 'Morphogen_l','basemid','RealTime',realtime,... 'OnValue',1.0,'OffValue',0.0); Topics: Morphogens.

leaf_movie.m

m = leaf_movie( m, ... ) Start or stop recording a movie. Any movie currently being recorded will be closed. If the first optional argument is 0, no new movie is started. Otherwise, the arguments may contain the following option-value pairs: FILENAME The name of the movie file to be opened. If this is not given, and m.globalProps.autonamemovie is true, then a name will be generated automatically, guaranteed to be different from the name of any existing movie file. Otherwise, a file selection dialog is opened. MODE (NOT IMPLEMENTED) This is one of 'screen', 'file', or 'fig'. 'screen' will capture the movie frames from the figure as drawn on the screen, using avifile(). 'file' will use print() to save the figure to a file, then load the file and add it to the movie. This allows arbitrarily high resolution movies to be made, not limited to the size drawn on the screen. 'fig' will save each frame as a MATLAB .fig file and will not generate a movie file. The figures can later be assembled into a movie file by running the command fig2movie. The reason for this option is that when running in an environment with no graphics, I have been unable to find a way of creating images from figures. FPS, COMPRESSION, QUALITY, KEYFRAME, COLORMAP, VIDEONAME: These options are passed directly to the Matlab function AVIFILE. LEAF_MOVIE provides defaults for some of these: FPS 15 COMPRESSION 'None' QUALITY 100 KEYFRAME 5 Equivalent GUI operation: clicking the "Record movie..." button. See also AVIFILE. Topics: Movies/Images.

leaf_multiplylayers.m

[m,ok] = leaf_multiplylayers( m, varargin ) Replace a single-layer mesh by a mesh of multiple layers glued together. This should not be called if the mesh is already a multple-layer mesh, or already contains any vertexes that are stitched together. Options: layers: The number of layers to make. The default value is 2. force: Normally this procedure will not act on a mesh that already contains constraints that force some nodes to have equal displacements. If 'force' is true then any such constraints will be deleted and the mesh will be multiplied. The default is false.

leaf_onecell.m

m = leaf_onecell( m, ... ) Create a new leaf consisting of a single triangular cell. Arguments: M is either empty or an existing mesh. If it is empty, then an entirely new mesh is created, with the default set of morphogens If M is an existing mesh, then its geometry is replaced by the new mesh. It retains the same set of morphogens (all set to zero everywhere on the new mesh), interaction function, and all other properties not depending on the specific geometry of the mesh. Options: 'xwidth' The diameter in the X dimension. Default 1. 'ywidth' The diameter in the Y dimension. Default 1. Example: m = leaf_onecell( [], 'xwidth', 1, 'ywidth', 1 ); See also: LEAF_CIRCLE, LEAF_CYLINDER, LEAF_LUNE, LEAF_RECTANGLE, LEAF_SEMICIRCLE. Equivalent GUI operation: selecting "One cell" in the pulldown menu in the "Mesh editor" panel and clicking the "Generate mesh" button. Topics: Mesh creation.

leaf_paintpatch.m

m = leaf_paintpatch( m, cells, morphogen, amount ) Apply the given amount of the given morphogen to every vertex of each of the cells. The cells are identified numerically; the numbers are not user-accessible. This command is therefore not easily used manually; it is generated when the user clicks on a cell in the GUI. Arguments: 1: A list of the cells to apply the morphogen to. 2: The morphogen name or index. 3: The amount of morphogen to apply. Equivalent GUI operation: clicking on every vertex of the cell to be painted, with the "Current mgen" item selected in the "Mouse mode" menu. The morphogen to apply is specified in the "Displayed m'gen" menu in the "Morphogens" panel. Topics: Morphogens.

leaf_paintvertex.m

m = leaf_paintvertex( m, morphogen, ... ) Apply the given amount of the given morphogen to all of the given vertexes. The vertexes are identified numerically; the numbers are not user-accessible. This command is therefore not easily used manually; it is generated when the user clicks on a vertex in the GUI. Arguments: 1: The morphogen name or index. Options: 'vertex' The vertexes to apply morphogen to. 'amount' The amount of morphogen to apply. This can be either a single value to be applied to every specified vertex, or a list of values of the same length as the list of vertexes, to be applied to them respectively. 'mode' Either 'set' or 'add'. 'set sets the vertex to the given value, 'add' adds the given value to the current value. Equivalent GUI operation: clicking on the mesh when the "Morphogens" panel is selected. This always operates in 'add' mode. The morphogen to apply is specified in the "Displayed m'gen" menu in the "Morphogens" panel. Shift-clicking or middle-clicking will subtract the morphogen instead of adding it. Topics: Morphogens.

leaf_perturbz.m

m = leaf_perturbz( m, z, ... ) Add a random perturbation to the Z coordinate of every node. Arguments: A number z, the amplitude of the random displacement. The displacements will be randomly chosen from the interval -z/2 ... z/2. Options: 'absolute': A boolean. If true, then the displacements will be interpreted as alsolute distances. If false (the default), they will be interpreted as amounts relative to the thickness at each point. Example: m = leaf_perturbz( m, 0.5, 'absolute', true ) Equivalent GUI operation: the "Random Z" button on the "Mesh editor" panel. The amount of random deformation is specified by the value in the upper of the two text boxes to the right of the button. In the GUI, 'absolute' is always assumed to be false. Topics: Mesh editing.

leaf_plot.m

m = leaf_plot( m, ... ) Plot the leaf. There are many options. leaf_plot stores all of the plotting options in the mesh, so that a subsequent call to leaf_plot with only the mesh as an argument will plot the same thing. Equivalent GUI operation: none. The leaf is plotted automatically. Various options may be set in the "Plot options" panel, and the scroll bars on the picture change the orientation. See also: leaf_plotoptions. Topics: Plotting.

leaf_plotoptions.m

[m,plotinfo] = leaf_plotoptions( m, ... ) Set the plotting options. There are many options. leaf_plotoptions resolves all inconsistencies among the options given and the options already present in m, and stores the resulting set of options into m. leaf_plot2 calls leaf_plotoptions2, computes the data to be plotted, and does the plotting. The PLOTINFO output argument is for internal use and should be ignored. Equivalent GUI operation: Various options may be individually set in the GUI, especially the "Plot options" panel. See also: leaf_plot. Topics: Plotting.

leaf_plotview.m

m = leaf_plotview( m, ... ) Set the view parameters. There are two sets of parameters with which the view can be described: 1. The parameters that Matlab itself uses: CameraViewAngle CameraTarget CameraPosition CameraUpVector 2. An alternative set that is sometimes more convenient: fov (field of view) azimuth elevation roll pan (two components) targetdistance (the distance that CameraTarget is behind the plane perpendicular to the view direction through the origin of coordinates) camdistance (the distance that CameraTarget is in front of the plane perpendicular to the view direction through the origin of coordinates) Both sets of parameters are maintained in the mesh structure. For example, to set an overhead view: m = leaf_plotview( m, 'azimuth', 0, 'elevation', 90, 'roll', 0 ); Topics: Plotting.

leaf_profile_monitor.m

function m=leaf_profile_monitor(m,realtime,RegionLabels,Morphogens,start_figno) monitor morphogen levels at a set of vertices m, mesh RegionLabels, vertices to be monitored as designated by cell array of strings, i.e. region labels Morphogens, cell array of strings, i.e. uppercase morphogen names to be monitored. There should be one RegionLabels string for each Morphogens string Vertlabels, if true then display vertex numbers in each regionlabel on the mesh default false start_figno, default figure 1 (Must open a fig even if just monitoring to file) MonData, optional output of data structure For example: pathname: 'D:\ab\Matlab stuff\Growth models\GPT_MeasureGrowth_20121203\snapshots' filename: 'monitor--03-Dec-2012-17-39-16.xls' CurrentExcelColumn: 5 vertex_set: {[5x1 double]} index: {[1]} list_order: {[1 2 3 4 5]} regionlabel: {'ID_MID'} ListOK: {[1]} Results: [1x1 struct] Results.REGN: {'ID_MID'} Results.XYZ: {[5x3 double]} Results.XYZA: {[5x3 double]} Results.XYZB: {[5x3 double]} Results.X: {[5 5 5 5 5]} Results.Y: {[5x1 double]} Results.Z: {[]} Results.D: {[5x1 double]} % distances between vertices Results.G: {[]} Results.XYZ_LegendString: Results.D_LegendString: {' ID_MID: intervals'} Results.G_LegendString: [] theaxes: [0 1.1410e+03 1.1420e+03] InitialMaxD: 0.5061 LastD: {[5x1 double]} e.g. monitor properties of vertices m=leaf_profile_monitor(m,... % essential 'REGIONLABELS',{'V_PROFILE1','V_PROFILE2'},... % essential 'MORPHOGENS',{'S_LEFTRIGHT','S_CENTRE'},... % optional (one element per REGIONLABEL) 'VERTLABELS',false,'FigNum',1,'EXCEL',true,'MODELNAME',modelname); % optional (file in snapshots directory') or if you want to limit the time(s) over which it runs if realtime>5 m=leaf_profile_monitor(m,... % essential 'REGIONLABELS',{'V_PROFILE1','V_PROFILE2'},... % essential 'MORPHOGENS',{'S_LEFTRIGHT','S_CENTRE'},... % optional (one element per REGIONLABEL) 'VERTLABELS',false,'FigNum',1,'MATFILE',true,'MODELNAME',modelname); % optional (file in snapshots directory') end Topics: Simulation. J. Andrew Bangham, 2011

leaf_purgeproject.m

m = leaf_purgeproject( m ) Purge the project directory of generated files. The movies directory and its entire contents will be deleted. The snapshots directory and its entire contents will be deleted. The runs directory and its entire contents will be deleted. All stage files will be deleted. No other files will be affected. Options: 'recycle' A boolean. If true (the default) then deleted files are sent to the wastebin. If false, they are irrevocably deleted immediately. 'confirm' A boolean. If true (the default is false), the user will be asked to confirm the operation.

leaf_rasterize.m

m = leaf_rasterize( m, ... ) Convert a mesh to a 3D raster scan. The raster is represented as a series of PNG files, one for each section through the mesh. The raster scan will be coloured according to the current plot settings for the mesh. Options: filename The pattern of the names of the files to create. This should contain the substring '%d', which will be replaced by the index number of each section through the mesh. The name can be a relative or absolute path name. If relative, it will be understood as relative to the 'dirname' argument, if present, otherwise relative to the project directory's 'meshes' subdirectory, or if the mesh does not belong to a project, the current working directory. dirname The direectory to save the files in. Ignored if the 'filename' argument was an absolute path name. rastersize A vector of three integers [X Y Z], specifying how many pixels the raster should be in each direction. The mesh will be centered in the resulting 3D image, and will be uniformly scaled so as to fill the space, less whatever margin is specified. margin A single integer, a triple [X Y Z], or a sextuple [X1 X2 Y1 Y2 Z1 Z2]. The specified number of pixels will be left blank on the faces of the raster and the mesh rendered within the remaining volume.

leaf_recomputestages.m

m = leaf_recomputestages( m, ... ) Recompute a set of stages of the project, starting from the current state of m. If this is after any of the stages specified, those stages will not be recomputed. Options: 'stages' A list of the stages to be recomputed as an array of numerical times. The actual times of the saved stages will be the closest possible to those specified, given the starting time and the time step. If this option is omitted, it will default to the set of stage times currently stored in m, which can be set by leaf_requeststages. See also: leaf_requeststages Topics: Simulation.

leaf_record_mesh_frame.m

It is intended that this will add a file copy of m to a subdirectory of movie Once RecordMeshes has been turned on either by using the user interface, 'Movie:Also record meshes' or by calling this function with arguments 'RECORD','ON' (or turned off with 'RECORD','OFF') then this function is called from 'leaf_movie' each time a frame is added to a movie. The meshes are stored in a directory with a filename that matches that of the movie. Topics: Movies/Images.

leaf_rectangle.m

m = leaf_rectangle( m, varargin ) Create a new rectangular mesh. Arguments: M is either empty or an existing mesh. If it is empty, then an entirely new mesh is created, with the default set of morphogens If M is an existing mesh, then its geometry is replaced by the new mesh. It retains the same set of morphogens (all set to zero everywhere on the new mesh), interaction function, and all other properties not depending on the specific geometry of the mesh. Options: 'xwidth' The width of the rectangle in the X dimension. Default 2. 'ywidth' The width of the rectangle in the Y dimension. Default 2. 'centre' Where the centre of the rectangle should be. 'xdivs' The number of finite element cells along the X dimension. Default 8. 'ydivs' The number of finite element cells along the Y dimension. Default 8. 'base' The number of divisions along the side with minimum Y value. The default is xdivs. Example: m = leaf_rectangle( [], 'xwidth', 2, 'ywidth', 2, 'xdivs', 8, 'ydivs', 8, 'base', 5 ) See also: LEAF_CIRCLE, LEAF_CYLINDER, LEAF_LEAF, LEAF_ONECELL, LEAF_SEMICIRCLE. Equivalent GUI operation: selecting "Rectangle" in the pulldown menu in the "Mesh editor" panel and clicking the "Generate mesh" button. Topics: Mesh creation.

leaf_rectifyverticals.m

m = leaf_rectifyverticals( m ) Force the lines joining vertexes on opposite surfaces of the mesh to be perpendicular to the mid-surface.

leaf_refineFEM.m

m = leaf_refineFEM( m, amount ) AMOUNT is between 0 and 1. Split that proportion of the edges of the finite element mesh, in random order. Example: m = leaf_refineFEM( m, 0.3 ); Equivalent GUI operation: clicking the "Refine mesh" button in the "Mesh editor" panel. The scroll bar and text box set the proportion of edges to be split. Topics: Mesh editing.

leaf_reload.m

m = leaf_reload( m, stage, varargin ) Reload a leaf from the MAT, OBJ, or PTL file it was last loaded from, discarding all changes made since then. If there was no such previous file, the mesh is left unchanged. Arguments: stage: If 0 or more, the indicated stage of the mesh, provided there is a saved state from that stage. If 'reload', the stage that the mesh was loaded from or was last saved to, whichever is later. If 'restart', the initial stage of the mesh. If the indicated stage does not exist a warning is given and the mesh is left unchanged. The default is 'reload'. Options: rewrite: Normally, when a model is loaded, its interaction function (if there is one) is read, parsed, and rewritten. This is because it may have been created with an older version of GFtbox. Specifying the rewrite option as false prevents this from being done. This may be necessary when running several simulations concurrently on a parallel machine, all using the same project. Equivalent GUI operations: The "Restart" button is equivalent to m = leaf_reload( m, 'restart' ); The "Reload" button is equivalent to m = leaf_reload( m, 'reload' ); or m = leaf_reload( m ); The items on the "Stages" menu are equivalent to m = leaf_reload( m, s ); for each valid s. s should be passed as a string. For example, if the Stages menu has a menu item called 'Time 315.25', that stage can be loaded with m = leaf_reload( m, '315.25' ); Topics: Project management.

leaf_rename_mgen.m

m = leaf_rename_mgen( m, oldMgenName, newMgenName, ... ) Rename one or more morphogens. Any number of old name/new name pairs can be given. The standard morphogens cannot be renamed, and no morphogen can be renamed to an existing name. Equivalent GUI operation: clicking the "Rename" button in the "Morphogens" panel. See also: leaf_add_mgen, leaf_delete_mgen Topics: Morphogens.

leaf_requeststages.m

m = leaf_requeststages( m, ... ) Add a set of stage times to the mesh. None of these will be computed, but a subsequent call to leaf_recomputestages with no explicit stages will compute them. Options: 'stages' A list of numerical stage times. These do not have to be sorted and may contain duplicates. The list will be sorted and have duplicates removed anyway. 'mode' If 'replace', the list will replace any stage times stored in m. If 'add' (the default), they will be combined with those present. GUI equivalent: Stages/RequestMore Stages... menu item. This does not support the 'mode' option and always operates in 'add' mode. Topics: Simulation, Project management.

leaf_rescale.m

m = leaf_rescale( m, ... ) Rescale a mesh in space and/or time. Arguments: M is either empty or an existing mesh. If it is empty, then an entirely new mesh is created, with the default set of morphogens If M is an existing mesh, then its geometry is replaced by the new mesh. It retains the same set of morphogens (all set to zero everywhere on the new mesh), interaction function, and all other properties not depending on the specific geometry of the mesh. Options: 'spaceunitname' The name of the new unit of distance. 'spaceunitvalue' The number of old units that the new unit is equal to. 'timeunitname' The name of the new unit of time. 'timeunitvalue' The number of old units that the new unit is equal to. If either spaceunitname or timeunitname is omitted or empty, no change will be made to that unit. Example: Convert a leaf scaled in microns to millimetres, and from days to hours: m = leaf_rescale( m, 'spaceunitname', 'mm', ... 'spaceunitvalue', 1000, ... 'timeunitname', 'hour', ... 'timeunitvalue', 1/24 ); Equivalent GUI operation: the 'Params/Rescale...' menu item. Topics: Mesh editing.

leaf_rewriteIF.m

m = leaf_rewriteIF( m, ... ) Rewrite the interaction function of m. Normally the interaction function is rewritten the first time that it is called after loading a mesh. This is to ensure that it is always compatible with the current version of GFtbox. Sometimes it is necessary to prevent this from happening. In this case, if it is later desired to force a rewrite, this function can be called. leaf_rewriteIF will do nothing if the i.f. has already been rewritten, unless the 'force' option has value true. Note that a rewrite always happens when a morphogen is added, deleted, or renamed, or when the standard morphogen type (K/BEND or A/B) is changed. Equivalent GUI operation: the Rewrite button on the Interction function panel. Topics: Interaction function.

leaf_rotate.m

m = leaf_rotate( m, type1, rot1, type2, rot2, ... ) Rotate the mesh about the given axes. The rotations are performed in the order they are given: the order matters. Each type argument is one of 'M', 'X', 'Y', or 'Z' (case is ignored). For a type 'M', the following rotation should be a 3*3 rotation matrix. For 'X', 'Y', or 'Z' it should be an angle in degrees. Any sequence of rotations can be given. See also: leaf_rotatexyz. Topics: Mesh editing.

leaf_rotatexyz.m

m = leaf_rotatexyz( m, varargin ) Rotate the coordinates of the leaf: x becomes y, y becomes z, and z becomes z. If the argument -1 is given, the opposite rotation is performed. Equivalent GUI operation: clicking on the "Rotate xyz" button in the "Mesh editor" panel. See also: leaf_rotate. Topics: Mesh editing.

leaf_saddlez.m

m = leaf_saddlez( m, ... ) Add a saddle-shaped displacement to the nodes of m. Options: 'amount' The maximum amount of the displacement, which is proportional to the distance from the origin. Default 1. 'lobes' How many complete waves the displacemnt creates on the edge (an integer, minimum value 2). Default 2. Example: m = leaf_saddlez( m, 'amount', 1, 'lobes', 2 ); Equivalent GUI operation: the "Saddle Z" button on the "Mesh editor" panel. The amount of saddle deformation is specified by the value in the upper of the two text boxes to the right of the button. The number of waves is specified by the lower text box. Topics: Mesh editing

leaf_save.m

m = leaf_save( m, filename, folderpath, ... ) Save the leaf to a file. The way the leaf is saved depends on the extension of the filename: .MAT The leaf is saved in a MAT file as a Matlab object called m. .M Matlab commands to recreate this leaf are saved in a .M file. .OBJ Only the nodes and triangles are saved, in OBJ format. .MSR Whatever data will fit into MSR format are saved. .WRL The nodes and triangles, and either vertex or face colours are saved, in VRML 97 format. .STL The finite elements are subdivided into tetrahedrons and saved in STL format. .FIG The current plot of the leaf is saved as a figure file. All of these formats except FIG can be read back in by leaf_load. Note that OBJ format discards all information except the geometry of the mesh. If the filename is just an extension (including the initial "."), then a filename will be prompted for, and the specified extension will be the default. If no filename is given or the filename is empty, then one will be prompted for, and any of the above extensions will be accepted. The folder path specifies what folder to save the file in. If not specified, then the default folder will be chosen, which depends on the file extension. If a filename is then prompted for, the file dialog will open at that folder, but the user can navigate to any other. If the filename is a full path name then the folder name will be ignored and the file will be stored at the exact location specified by filename. Options: overwrite: If true, and the output file exists already, it will be overwritten without warning. If false (the default), the user will be asked whether to overwrite it. minimal: For OBJ files, if this is true (the default), then only the vertexes and triangles of the mesh, and either vertex or face colours will be written. OBJ files of this form should be readable by any program that claims to read OBJ files. If false, more of the information in the mesh will be written, including all of the morphogen names and values, in an ad-hoc extension of OBJ format. (The prefix 'mn' is used for morphogen names, and 'm' for values: each 'm' line lists all the morphogen values for a single vertex.) throughfaces: For OBJ files, if this is true, then for every edge of the mesh, there will be a pair of triangles representing the quadrilateral connecting the two copies that edge on the two sides of the mesh. If false (the default), this will only be done for edges on the rim of the canvas. bbox: If supplied and nonempty, this is either a bounding box (a 6-tuple [xmin xmax ymin ymax zmin zmax]) or a size (a triple [xsize ysize zsize]), or a single number size. A single number size is equivalent to [size size size], and a triple [xsize ysize zsize] is equivalent to a bounding box [-xsize/2 xsize/2 -ysize/2 ysize/2 -zsize/2 zsize/2]. For OBJ and VRML format only, the model will be translated and uniformly scaled so as to best fit into the box. Equivalent GUI operations: the "Save model..." button (saves as MAT file) or the "Save script...", "Save OBJ...", or "Save FIG..." menu commands on the "Mesh" menu. Topics: Project management.

leaf_savemodel.m

[m,ok] = leaf_savemodel( m, modelname, projectdir, ... ) Save the model to a model directory. MODELNAME is the name of the model folder. This must not be a full path name, just the base name of the folder itself. It will be looked for in the folder PROJECTDIR, if specified, otherwise in the parent directory of m, if any, otherwise the current directory. If MODELNAME is not specified or empty, the user will be prompted for a name using the standard file dialog. The model directory will be created if it does not exist. If the model is being saved into its own model directory: If it is in the initial state (i.e. no simulation steps have been performed, and the initialisation function has not been called) then it is saved into the file MODELNAME.mat. If it is in a later state, it will be saved to MODELNAME_Snnnn.mat, where nnnn is the current simulation time as a floating point number with the decimal point replaced by a 'd'. If the model is being saved into a new directory: The current state will be saved as an initial state or a later stage file as above. If the current state is not the initial state, then the initial state will be copied across. Furthermore, the initial state of the new project will be loaded. The interaction function and notes file will be copied, if they exist. If the notes file exists, the new notes file will also be opened in the editor. Stage files, movies, and snapshots are NOT copied across. If for any reason the model cannot be saved, OK will be false. Options: new: If true, the mesh will be saved as the initial state of a project, even if it is not the initial state of the current simulation. The default is false. strip: If true, as many fields as possible of the mesh will be deleted before saving. They will be reconstructed as far as possible when the mesh is loaded. The only information that is lost is the residual strains and effective growth tensor from the last iteration. The default is false. static: If true, the static file of the project will also be written. If false, not. The default is the value of ~m.globalDynamicProps.staticreadonly. Equivalent GUI operation: the "Save As..." button prompts for a directory to save a new project to; the "Save" button saves the current state to its own model directory. The "strip" option can be toggled with the "Misc/Strip Saved Meshes" menu command. Topics: Project management.

leaf_saverun.m

m = leaf_saverun( m, ... ) Save all the current stage files to a new directory runs/NAME/meshes, where NAME is supplied in the arguments. In addition, the directory will contain a file called CommandLine.txt, containing a one-line description of the set of files. Options: name: The name of the directory to store this run. desc: A one-line description of the run. This is used by the "Import Experimental Stages..." menu command, which reads all of the CommandLine.txt files and displays their contents in a listbox for the user to select one. desc defaults to name. verbose: In case of error, if this is true then error messages will be written to the console. The default is true. The result OK is true if it succeeded, false if it failed for any reason.

leaf_savestage.m

[m,ok] = leaf_savestage( m ) Save the current state of the mesh as a stage file. Options: none.

leaf_semicircle.m

m = leaf_semicircle( m, ... ) Create a new semicircular mesh. Parameters are as for leaf_circle. Equivalent GUI operation: selecting "Semicircle" in the pulldown menu in the "Mesh editor" panel and clicking the "New" button. See also: LEAF_CIRCLE, LEAF_CYLINDER, LEAF_LEAF, LEAF_ONECELL, LEAF_RECTANGLE. Topics: Mesh creation.

leaf_set_seams.m

m = leaf_set_seams( m, f_seam_p ) Create seems between the nodes in a given set. OBSOLETE: use leaf_addseam instead. Arguments: f_seam_p: an array giving a real number for every node. Every edge joining nodes for both of which this value is greater than 0.5 will be made a seam edge. See also: leaf_addseam. Topics: Mesh editing, Seams.

leaf_set_userdata.m

m = leaf_set_userdata( m, ... ) Set fields of the userdata of m. The arguments should be alternately a field name and a field value. You can store anything you like in the userdata field of the canvas. The growth toolbox will never use it, but your own callbacks, such as the morphogen interaction function, may want to make use of it. See also: LEAF_ADD_USERDATA, LEAF_DELETE_USERDATA. Equivalent GUI operation: none. Topics: User data.

leaf_setbgcolor.m

m = leaf_setbgcolor( m, color ) Set the background colour of the picture, and of any snapshots or movies taken. COLOR is a triple of RGB values in the range 0..1. Topics: Plotting.

leaf_setgrowthmode.m

m = leaf_setgrowthmode( m, mode ) Specify whether growth is described by growth and anisotropy, or by growth parallel and perpendicular to the polarisation gradient. Allowable values for MODE are 'ga' or 'pp' respectively. THIS FUNCTION HAS BEEN WITHDRAWN, 2008 May 15. Topics: OBSOLETE.

leaf_setmutant.m

m = leaf_setmutant( m, ... ) Set the mutant level of a morphogen. Options: morphogen: The name or index of a morphogen. If omitted, the mutation properties are set for every morphogen. value: The value the morphogen has in the mutant state, as a proportion of the wild-type state. Examples: m = leaf_setmutant( m, 'morphogen', 'div', 'value', 0 ); % Set the mutated level of the 'div' morphogen to zero. Topics: Morphogens.

leaf_setproperty.m

m = leaf_setproperty( m, ... ) Set global properties of the leaf. The arguments are a series of name/value pairs. The property names that this applies to are: 'poisson' Poisson's ratio. The normal value is 0.35 and there is little need to change this. 'bulkmodulus' The bulk modulus. The normal value is 3000 and there is little need to change this. 'validate' Whether to validate the mesh after every iteration. This is for debugging purposes and should normally be off. 'displayedgrowth' Specifies which morphogen to plot. ...and many others I have omitted to document. Example: m = leaf_setproperty( m, 'poisson', 0.49 ); Equivalent GUI operation: several GUI elements are implemented by this command: poisson: Text box in "Mesh editor" panel. bulkmodulus: No GUI equivalent. residstrain: "Strain retention" in "Simulation" panel. validate: No GUI equivalent. displayedgrowth: "Displayed m'gen" menu in "Morphogens" panel. ...etc. Topics: Misc.

leaf_setsecondlayerparams.m

m = leaf_setsecondlayerparams( m, varargin ) Set various general properties of the second layer. If the second layer does not exist an empty second layer will be created, and the properties set here will be the defaults for any subsequently created nonempty second layer. If m already has a second layer, this procedure does not affect the colours of existing cells, only the colours that may be chosen by subsequent recolouring operations. Options: colors: An N*3 array of RGB values. These are the colours available for colouring cells. The special value 'default' will use the array [ [0.1 0.9 0.1]; [0.9 0.1 0.1] ]. N should be 2. "Ordinary" cells will be coloured with the first colour, while "shocked" cells will be coloured with the second colour. colorvariation: A real number between 0 and 1. When a colour for a cell is selected from the colour table, this amount of random variation will be applied to the value selected from colors. A suitable value is 0.1, to give a subtle variation in colour between neighbouring cells. Topics: Bio layer.

leaf_setthickness.m

[m,ok] = leaf_setthickness( m, thickness ) Set the thickness of the leaf everywhere to the specified value. This only affects the current mesh and does not modify any of the static mesh properties. If thickness is being handled non-physically, the effect of this command will be overridden on the next simulation step. In that case you should call leaf_setthicknessparams instead. see also: leaf_setthicknessparams. Topics: Mesh editing.

leaf_setthicknessparams.m

m = leaf_setthicknessparams( m, value ) Set the thickness of the leaf, as a function of its current area. thickness = K*area^(P/2). K may have any positive value. P must be between 0 and 1. When P is 1, K is dimensionless; when P is 0, K is the actual thickness in length units. Options: 'scale' K. Default is 0.5. 'power' P. Default is 0. Topics: Mesh editing, Simulation.

leaf_setzeroz.m

m = leaf_setzeroz( m ) Set the Z displacement of every node to zero. Equivalent GUI operation: the "Zero Z" button on the "Mesh editor" panel. Topics: Mesh editing.

leaf_shockA.m

m = leaf_shockB( m, amount ) AMOUNT is between 0 and 1. Mark that proportion of randomly selected cells of the A layer with random colours. At least one cell will always be marked. If there is no A layer, the command is ignored. Example: m = leaf_shockA( m, 0.3 ); Equivalent GUI operation: "Shock cells" button on the Bio-A panel. The accompanying slider and text box set the proportion of cells to shock. Topics: Bio layer.

leaf_shockB.m

m = leaf_shockB( m, amount ) AMOUNT is between 0 and 1. Mark that proportion of randomly selected cells of the B layer with random colours. At least one cell will always be marked. If there is no B layer, the command is ignored. Example: m = leaf_shockB( m, 0.3 ); Equivalent GUI operation: "Shock cells" button on the Bio-B panel. The accompanying slider and text box set the proportion of cells to shock. Topics: OBSOLETE, Bio layer 2.

leaf_showaxes.m

m = leaf_showaxes( m, axeson ) Make the axes visible or invisible, according as AXESON is true or false. Topics: Plotting.

leaf_snapdragon.m

m = leaf_snapdragon( m, ... ) Make an early stage of a snapdragon flower. This consists of a number of petals, each of which consists of a rectangle surmounted by a semicircle. The rectangular parts of the petals are connected to form a tube. The mesh is oriented so that the cell normals point outwards. Arguments: M is either empty or an existing mesh. If it is empty, then an entirely new mesh is created, with the default set of morphogens If M is an existing mesh, then its geometry is replaced by the new mesh. It retains the same set of morphogens (all set to zero everywhere on the new mesh), interaction function, and all other properties not depending on the specific geometry of the mesh. Options: 'petals' The number of petals. Default 5. 'radius' The radius of the tube. Default 1. 'rings' The number of circular rings of triangles to divide the semicircular parts into. Default 3. 'height' The height of the rectangle, as a multiple of the semicircle's diameter. Default 0.7. 'base' The number of divisions along half of the base of each petal. By default this is equal to rings, i.e. the same as the number at the top of the tube. 'strips' The number of strips of triangles to divide the tubular part into. If 0 (the default), this will be calculated from the height so as to make the triangles similar in size to those in the lobes. Example: m = leaf_snapdragon( [], 'petals', 5, 'radius', 2, 'rings', 4 ); See also: LEAF_CIRCLE, LEAF_CYLINDER, LEAF_LEAF, LEAF_ONECELL, LEAF_RECTANGLE, LEAF_LOBE. Topics: Mesh creation.

leaf_snapshot.m

[m,ok] = leaf_snapshot( m, filename, ... ) Take a snapshot of the current view of the leaf into an image file. A name for the image file will be automatically generated if none is given. If the snapshot cannot be taken or the arguments are invalid then ok will be returned as false. Arguments: 1: The name of the file to write. The extension of the filename specifies the image format. This may be any format acceptable to the Matlab function IMWRITE. These include 'png', 'jpg', 'tif', and others. Options: 'newfile': if true (the default), the file name given will be modified so as to guarantee that it will not overwrite any existing file. If false, the filename will be used as given and any existing file will be overwritten without warning. 'thumbnail': if true (the default is false), the other arguments and options will be ignored (the filename must be given as the empty string), and a snapshot will be saved to the file thumbnail.png in the project directory. 'resolution': Dots-per-inch value. Passing this option will cause the procedure to use the Matlab function print() instead of imwrite(), so as to take a picture at whatever resolution you require. This also has the advantage that as the snapshot is not performed by grabbing the screen buffer, it does not matter whether the window is entirely visible on the screen. However, the image obtained will be of the entire figure window, instead of just the picture part. If this option is specified with the empty array as its value, the value currently stored in m.plotdefaults.hiresdpi will be used. Specifying a value for resolution does not update m.plotdefaults.hiresdpi: for that, use leaf_plotoptions( m, 'hiresdpi', ... ). All remaining arguments will be passed as options to IMWRITE. Any arguments taken by IMWRITE may be given. If any such arguments are provided, the filename must be present (otherwise the first argument for IMWRITE would be taken to be the filename). If you do not want to provide a filename, specify it as the empty string. The image will be saved in the 'snapshots' folder of the current project folder, if any, otherwise the current folder. You can override this by specifying an absolute path. Example: m = leaf_snapshot( m, 'foo.png' ); Equivalent GUI operation: clicking the "Take snapshot" button. This saves an image in PNG format into a file with an automatically generated name. A report is written to the Matlab command window. The 'thumbnail' option is equivalent to the "Make Thumbnail" menu command. If stereo mode is turned on, snapshots will be stereo, with the two images arranged according to the stereo parameters. See also: IMWRITE, PRINT Topics: Movies/Images.

leaf_splitsecondlayer.m

m = leaf_splitsecondlayer( m ) Split every cell in the second layer. Reset the splitting threshold to make the new cell sizes the target sizes. Equivalent GUI operation: "Split L2" button. Topics: Bio layer.

leaf_splitting_factor.m

[m,ok] = leaf_splitting_factor( m, factorname ) Specify the name of a morphogen to use to control edge-splitting, edge-flipping, and retriangulation. Edges will only be modified by these transformations if the value of the morphogen is at least 0.5 at both ends. Specify the empty string as the name to turn this off. Topics: Morphogens, Simulation.

leaf_stereoparams.m

m = leaf_stereoparams( m, ... ) Turn stereo on and off, and change associated parameters. In stereo mode, the mesh is displayed simultaneously in two different windows, from the viewpoints of the left eye and the right eye. When running from the GUI, the main GUI window shows the left eye view and the second window which appears when stereo is enabled shows the right eye view. When using a 3D screen that operates by superimposing both screens in the user's view using polarisers to separate the left and right eye views, the two windows should automatically appear to be superimposed on each other. When stereo is enabled, all snapshots and movies taken will be recorded in stereo, with the two views composited into a single frame, either side by side or one above the other. Options: 'enable' Boolean, turns stereo on or off. 'vergence' The number of degrees each image is rotated. A positive value (the usual case) means that the image view directions are what they would be if the eyes turned inwards to converge on the real 3D object. (This value is independent of the actual convergence of the eyes when viewing the stereo images. A typical 3D display does not require any convergence of the eyes.) 'windowsize' The size in pixels of both of the windows. If the first window already exists, do not supply this argument: the second window will automatically be sized so that its picture is the same size as that in the first. 'spacing' The number of pixels separating the centres of the two images in the combined image. Pass 0 to have the two images abutted. Pass -1 to specify the screen width or height, as appropriate to the value of 'direction'. Any empty space between the images will be filled with the current background colour. 'direction' A string specifying how the two windows are placed relative to each other in the composite frame. The value is one of these strings: '-h' Right-eye window is placed to the left. '+h' Right-eye window is placed to the right. '-v' Right-eye window is placed below. '+v' Right-eye window is placed above. The initial default is '-h' 'imagespacing', 'imagedirection' Like spacing, but refers to the spacing between the two halves of snapshots and movie frames. The default for all options is to leave the previous value unchanged. The initial defaults are 'enable' = false, 'vergence' = 2.5 degrees, 'spacing' = 0, 'direction = '-h', 'imagespacing' = 0, 'imagedirection = '-h' (which means you have to cross your eyes to fuse the images in snapshots and movies). Topics: Movies/Images, Plotting.

leaf_stitch_vertex.m

m = leaf_stitch_vertex( m, dfs ) Constrain sets of vertexes of the mesh so that they move identically. Arguments: dfs: a cell array of vectors of degree of freedom indexes. Dfs in the same vector will be constrained to change identically. No index may occur more than once anywhere in dfs. Equivalent GUI operation: none. Topics: Mesh editing, Simulation.

leaf_subdivide.m

m = leaf_subdivide( m, ... ) Subdivide every edge of m where a specified morphogen is above and/or below thresholds, and the length of the current edge is at least a certain value. NB. This function is currently NOT suitable for calling from an interaction function. It will go wrong. Note that this command will subdivide every eligible edge every time it is called. It does not remember which edges it has subdivided before and refrain from subdividing them again. Options: 'morphogen': The name or index of the morphogen 'min': The value that the morphogen must be at least equal to. 'max': The value that the morphogen must not exceed. 'mode': 'all' [default], 'any', or 'mid'. 'minabslength': A real number. No edge shorter than this will be subdivided. 'minrellength': A real number. This is a fraction of the current threshold for automatic splitting of edges. No edge shorter than this will be subdivided. The current threshold value is returned by currentEdgeThreshold(m). 'levels': The levels of morphogen the new vertices will adopt 'all','interp','none' 'force': If true (the default), all of the requested subdivisions will happen. If false, edges will not be split where this would result in excessively small cells or cell angles. An edge will be subdivided if and only if it satisfies all of the conditions that are specified. Any combination of the arguments can be given. No arguments gives no subdivision. 'mode' is only relevant if 'min' or 'max' has been specified. If mode is 'all', then each edge is split for which both ends satisfy the min/max conditions. If mode is 'any', each edge is split for which either edge satisfies the conditions. If mode if 'mid', each edge is split for which the average of the morphogen values at its ends satisfies the conditions. This command ignores the setting, that can be set through the GUI or leaf_setproperty(), that enables or disables automatic splitting of long edges. Topics: Mesh editing.

leaf_unshockA.m

m = leaf_unshockA( m ) Restore all cells of the Bio-A layer to their unshocked state. Example: m = leaf_unshockA( m ); Equivalent GUI operation: "Unshock all cells" button on the Bio-A panel. Topics: Bio layer.

leaf_vertex_follow_mgen.m

function m=leaf_vertex_set_monitor(m,realtime,RegionLabels,Morphogens,start_figno) monitor morphogen levels at a set of vertices. Several morphogens can be monitored simultaneously. The results can be recorded and an output in opne figure given over time. The pattern is saved automatically in the model directory.

leaf_vertex_monitor.m

m=leaf_vertex_monitor(m,realtime,RegionLabels,Morphogens,figno) monitor morphogen levels at individual vertices m, mesh realtime, time starting at 0 RegionLabels, vertices to be monitored as designated by cell array of strings, i.e. region labels Morphogens, cell array of strings, i.e. uppercase morphogen names to be monitored figno, figure number ... one figure per morphogen e.g. leaf_vertex_monitor(m,realtime,{'POINT1','POINT2'},{'KPAR','POLARISER'},1); Topics: Simulation.

leaf_vertex_set_monitor.m

function m=leaf_vertex_set_monitor(m,realtime,RegionLabels,Morphogens,start_figno) monitor morphogen levels at a set of vertices m, mesh realtime, time starting at 0 RegionLabels, vertices to be monitored as designated by cell array of strings, i.e. region labels Morphogens, cell array of strings, i.e. uppercase morphogen names to be monitored start_figno, first figure number ... one figure per morphogen e.g. leaf_vertex_set_monitor(m,'RealTime',realtime,'ZeroTime',zerotime,... 'REGIONLABELS',{'MEDIAL','MEDIAL'},... 'MORPHOGENS',{'KPAR','APAR'},... 'FigNum',4); the 'REGIONLABELS' can be 'SEAM' in which case m.seam is used Topics: Simulation.

leaf_waypointmovie.m

Generate a movie from the currently stored waypoints in m. The options are the same as for leaf_movie. See also leaf_movie, leaf_addwaypoint, leaf_clearwaypoints. Topics: Movies/Waypoints.

compareWithOBJ.m

result = compareWithOBJ( m, fn, varargin ) m is a mesh. fn is the name of an OBJ file which is expected to contain the node and triangle data for a mesh isomorphic to m. The remaining arguments are strings naming the comparisons between the mesh and the OBJ data that are to be returned. Possibilities are: 'distance' The distances between corresponding vertexes. 'area' The ratios of areas of corresponding finite elements are returned. ...other possibilities may be added if needed.

componentBoundary.m

[bn,ba] = componentBoundary( m, vi ) Given a mesh m and a vertex vi, assumed to be a boundary vertex, set bn to the sequence of vertexes around the boundary starting from v. Set ba to the external angles at those vertexes, i.e. pi minus the sum of the internal angles of the triangles at each vertex. Set be to the lengths of the edges.

componentBoundary2.m

[bn,ba] = componentBoundary( m, vi ) Given a mesh m and a vertex vi, assumed to be a boundary vertex, set bn to the sequence of vertexes around the boundary starting from v. Set ba to the external angles at those vertexes, i.e. pi minus the sum of the internal angles of the triangles at each vertex. Set be to the lengths of the edges.

computeAltitudes.m

m = computeAltitudes( m ) Set m.altitudes to an N*3*3 array such that m.altitudes(ci,cei,:) is the altitude vector in element ci perpendicular to edge cei. m.altratios is set to an N*3 array in which m.altratios(ci,cei) is the ratio in which the foot of the corresponding altitude vector divides the edge.

computeCellGNGlobal.m

gnGlobal = computeCellGNGlobal( v, gaussInfo ) Compute the gradients of the shape functions in the global frame, at every gauss point. v is the set of vertexes of the cell, gaussInfo is the globally constant Gauss point information in isoparametric coordinates.

computeCellsGNGlobal.m

gnGlobal = computeCellsGNGlobal( v, gaussInfo ) Compute the gradients of the shape functions in the global frame, at every gauss point of every cell. v is the set of vertexes of all cells, as a 3*6*n array: v(:,:,i) is the set of 6 vertexes of cell i. the globally constant Gauss point information in isoparametric coordinates. NEVER USED.

computeGNGlobal.m

mesh = computeGNGlobal( mesh ) Compute the gradients of the shape functions in the global frame, at every gauss point in every cell.

computeGaussInfo.m

mesh = computeGaussInfo( mesh ) Compute the gauss points in barycentric coordinates, and the values and gradients of the shape functions there.

computeResiduals.m

m = computeResiduals( m, retainFraction ) Given m.displacements, this computes the following components of m.celldata: displacementStrain residualStrain If required (i.e. if celldata.actualGrowthTensor exists), it also computes: actualGrowthTensor

conductivityMatrix.m

connectedComponent.m

cis = connectedComponent( m, ci ) ci is the index of a cell of m. Find the set of all cells in the strongly connected component of ci, i.e. those cells reachable from ci by traversing edges.

connectedComponents.m

cc = connectedComponents( m ) Find the connected components of m. The result is a cell array of arrays of cell indexes, one for each component, and an array listing for each FE its component. Connected components are defined as being connected across at least an edge. Thus parts connected only at corners will be regarded as separate components, even though they may have one or more vertexes in common. If it is desired to eliminate corner contacts, call SPLITCORNERTOUCH first.

connectedComponentsE.m

[nodeindexes,nodesets,edgeindexes,edgesets,cellindexes,cellsets] = connectedComponentsE( m ) Find the connected components of m by following the edges. nodeindexes will be an array mapping each node to the index of its component, and nodesets will be a cell array of the connected components. For every node n, n occurs in nodesets{nodeindexes(n)}.

convertXYZtoDFs.m

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\growth\converting_movies

MakeVideosAndFLV.m

function MakeVideosAndFLV( max_width, pngs, input_video_folder,input_video_name,finalPicFileName) based on ---=== VIDEO2FLV ===--- AUTHORS Vincent Garcia and Sylvain Boltz 1. Convert a video (MPEG, WMV, AVI) into a Adobe Flash Video (FLV). The conversion process is performed using the FFMPEG application. max_width, default 0 same as input file, else say 250 for small files pngs, default 0 none, else 1 for just first and 2 for first and last frames as pngs output_video_folder,output_video_name, output_pngs, default 0, value 1 and it outputs first frame, 2 and it outputs both the first and last frames Usage MakeVideosAndFLV( 400, 0, moviefilepath ,[moviefilename,'.avi'],finalPicFileName ); J. Andrew Bangham, 2011

copyAtoB.m

m = copyAtoB( m ); Copy the A morphogens to the B side. Does nothing if the morphogens are K/BEND style.

copy_experiment_results_back.m

createMeshParamInfo.m

mkparams( internal name, user name, default value, x, y )

createWaypoints.m

create_retrieval_function.m

currentEdgeThreshold.m

currentPanelName.m

currentView.m

cutCells.m

m = cutCells( m, cis ) cis is a set of indexes of cells of m. Split m into two pieces, consisting of the cells cis, and the rest. This does not yet deal with places where the cells may be connected to the rest of the mesh through nodes only and not vertexes.

cutCellsMulti.m

m = cutCellsMulti( m, cs ) cs is a cell array of arrays of cell indexes. cutCells will be called for each member array of cs.

cycle.m

CYCLE( X, N ) return a cyclic permutation of x. N is the amount to rotate x by: cycle(x,1) will return the list resulting from moving the first element of x to the end. N can be any integer.

decayParam.m

defaultMgenColors.m

defaultUserCodeSections.m

definePropertyLists.m

definePropertyLists() This defines some tables of mesh properties, mainly gGlobalProps (the default value of m.globalProps), gGlobalDynamicProps (the default value of m.globalDynamicProps), and gDefaultPlotOptions (the default value of m.plotdefaults). Documentation is interspersed with the definitions which can be automatically extracted and used to populate a Help menu.

deleteAllStagesItem_Callback.m

deleteMgenValues.m

deleteUnusedNodes.m

deleteUnusedStagesItem_Callback.m

deletecell.m

m = deletecell(m,cellstodelete) Delete finite elements from the mesh.

deletepoints.m

deletepointsnearOBS.m

derotate.m

m = derotate( m )

diffusegrowth.m

m = diffusegrowth( m ) Perform one diffusion step for all the diffusible morphogens. This includes decay and clamped values.

dilateSubstance.m

function newg = dilateSubstance( mesh, u, g ) Given a set of vertex displacements u and a vector g of the concentration of a substance at each vertex, calculate the concentration at each vertex after performing the displacements.

dilateSubstances.m

m = dilateSubstances( m, u ) Apply dilateSubstance to each growth factor for which mgen_dilution is true, using the displacements u. Clamped values are not changed.

dilations.m

function d = dilations( m, u ) Given a set of vertex displacements u, calculate the dilution at each vertex after performing the displacements.

disallowNegativeGrowth.m

m = disallowNegativeGrowth( m ) If m.globalProps.allowNegativeGrowth is false, force all growth morphogens to be non-negative.

displayHelpFile.m

displayOutlines.m

displayOutlines( m ) Display the outlines of the flattened connected components of m.

dissect.m

m = dissect( m, separation ) Cut m along all its seam edges. Determine the connected components and separate them.

distunitDlg.m

Begin initialization code - DO NOT EDIT

doEdgeClick.m

doMeshClick.m

doVxClick.m

drawColorbar.m

drawColorbar( h, cmap, crange, cmaptype, backgroundColor ) Draw a color bar filling the axes object h, displaying the colormap cmap, annotated with scale crange. The colorbar is drawn along the longer dimension of h. Does nothing if h is not a handle. The parameters are stored in the userdata, in order to allow for erasing and then restoring the colorbar without requiring a replot. If no parameters are given, the parameters are retrieved from the userdata and the colorbar is redrawn.

drawHistory.m

drawHistoryImage.m

drawLineOnSurface.m

[edges,bc2s,endcell,endbc] = drawLineOnSurface( nodes, edges, startcell, startbc, heading, distance ) Given a surface defined by a mesh of triangles (nodes,edges

drawThumbnail.m

duplicatenode.m

m = duplicatenode( m, vi, vis ) vis is the set of indexes of duplicates of vertex vi that are to be created. Replicate all of the per-vertex information for vertex vi, for each of the new vertexes.

echoCommand.m

edgeClick.m

This should only be called when the simulation is not running.

edgeData.m

[ edgeVxs, edgeEdges, edgeCells ] = edgeData( m, vi ) If vi is a vertex on the edge of the leaf, find the two edges incident on that vertex, and the vertexes at the other ends of those edges, and the cells that the edges belong to.

edgeListFromNodeList.m

es = edgeListFromNodeList( m, vs ) Find all the edges of the mesh m, both of whose ends are in the set vs. vs must be a vector of vertex indexes of m. es will be a list of edge indexes. See also: edgeMapFromNodeMap

edgeMapFromNodeMap.m

emap = edgeMapFromNodeMap( m, vmap ) Find all the edges of the mesh m, both of whose ends are in the set vmap. vmap must be a vector of booleans of the same length as the number of vertexes of m. emap will be a similar boolean map of the edges. See also: edgeListFromNodeList

edgeincell.m

cei = edgeincell( m, ci, ei ) Return the index of edge ei in cell ci of m. If ei is not an edge os ci, return zero. ci and ei can be vectors of the same length.

edgelengthsq.m

lensq = edgelengthsq(mesh,ei) Return the squared length of edge ei of the mesh.

edgelengthsqs.m

lengthsqs = edgelengthsqs(mesh) Find squared lengths of all edges.

edgesplinewts.m

elideCells.m

m = elideCells( m, ei, threshold, force ) Shrink the cells on either side of edge ei down to ei, splitting ei in the middle. Threshold is a value of triangle quality such that if any triangle has its quality decreased to a value below the threshold, the transformation will not be done. The default is 0.1. If force is true, the quality criterion will be ignored and the transformation will always be done unless it would make the mesh invalid. The default is false.

elideEdge.m

[m,elided,newedgeindex] = elideEdge( m, ei, threshold ) Shrink the edge ei to a point, and the cells on either side to single edges. The transformation will not be done if it would make the mesh invalid, or if it would reduce the quality of any cell below the threshold. elided is true if the transformation was done. The mesh is not validated afterwards: this should be done after a batch of calls to elideEdge. newedgeindex is the mapping from old edge indexes to new.

eligibleEdges.m

es = eligibleEdges( m ) Return a bitmap of all edges, both ends of which have a corresponding value of splitting morphogen of at least 0.5. If there is no splitting morphogen, all edges are returned.

eliminateEquations.m

(K,f] = eliminateEquations( K, f, rowsToElim, stitchrows, oppositePairs, stitchPairs, oppMoves ) For each i in rowsToElim, delete row i of f and row and column i of K. For each array in stitchrows, impose the constraint that the corresponding set of variables are all equal. For each pair [i,j] in oppositePairs, impose the condition that the corresponding variables x and y have the property that o-x = o+y, where o is the corresponding member of oppMoves. When o=0, this is the condition that x and y are equal and opposite. For each pair [i,j] in stitchPairs, impose the condition that the corresponding variables are equal. If any vertex appears in both oppositePairs and stitchPairs, remove it from stitchPairs and ensure that its partner in stitchPairs appears in oppositePairs.

eliminateVals.m

remainingVals = eliminateVals( nvals, valsToElim ) Make a list in ascending order of all the integers from 1 to nvals excluding all values in valsToElim.

emptySelection.m

emptyWaypoint.m

enableMenus.m

enableMenus( handles ) Set the enabled/disabled state of every menu and menu item, depending on the state of the simulation.

enableMutations.m

equivSR.m

p = equivSR( q, T ) Find the continuous strain retention that is equivalent to a discrete strain retention of q with time step T.

equivStrainRetention.m

r1 = equivStrainRetention( t0, t1, r0 ) Compute the value of strain retention for a time step t1 that is equivalent to having strain retention r0 (default zero) at time step t0. t1 must be less than or equal to t0.

estimateGrowth.m

g = estimateGrowth( oldpts, newpts ) oldpts and newpts are N*K matrices (with N > K) containing two sets of N points in K dimensions. estimateGrowth calculates the best-fit growth tensor that will grow oldpts into the shape of newpts in one time unit. Its eigenvectors and eigenvalues are returned as the column matrix v and the columnvector d. g is returned in the frame of reference of newpts, i.e. the best-fit linear transformation of oldpts to newpts is decomposed into g*q where q is a rotation and g is symmetric. This is either the left or right polar decomposition. g and v will be K*K symmetric matrices, and d will be a K*1 vector. oldpts and newpts can be N*K*M matrices, in which case g and v will be K*K*M and d will be K*M.

extendToZero.m

fakemycgs.m

FAKEMYCGS Same arguments and results as MYCGS, but does nothing. Intended for timing tests of the rest of the program.

feAngle.m

a = feAngle( m, ci, cei ) Compute one angle of the finite element ci.

feAngles.m

a = feAngles( m, ci ) Compute the angles of the finite element ci.

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\growth\fecellstuff

cellFEM.m

[k,f] = cellFEM( cell, v, gaussInfo, C, eps0, residualScale ) Calculate the K matrix and force vector for a finite element cell. Calculate also the pre-strain at each Gauss point (by interpolating eps0). v: cell vertexes. 3*6 matrix, one column per vertex. gaussInfo: Gauss quadrature structure in isoparametric coordinates. Includes the points, and the values and gradients of the shape functions there. C: compliance matrix. 6*6. eps0: pre-strain at each vertex (calculated from thermal expansion). 6*6, one column for each vertex. Each column is a 6-vector representing a 3*3 symmetric tensor. This also returns in the cell structure the interpolated strains, the Jacobian of the isoparametric coordinates at each Gauss point, and the gradients of the shape functions with respect to the global coordinates at each Gauss point.

computeDisplacementStrains.m

cell = computeDisplacementStrains( cell, displacements ) Set cell.displacementStrain equal to the strain at each Gauss point resulting from the given displacements of the vertexes.

computeResidualStrains.m

cell = computeResidualStrains( cell, retainFraction, vorticities ) Compute the residual strains remaining after applying the given displacements to the vertexes of the cell. We average this over the cell, since for a single FEM element constrained to act linearly, there is no physical meaning to a strain field that varies over the cell.

computeResidualStrainsAA.m

cell = computeResidualStrainsAA( cell, scale ) Compute the residual strains remaining after applying the given displacements to the vertexes of the cell. We average this over the cell, since for a single FEM element constrained to act linearly, there is no physical meaning to a strain field that varies over the cell.

fecell.m

fixCell.m

getFixed.m

showdebug.m

femCellAngles.m

femCellQualities.m

fillstreamlines.m

findBioCell.m

cells = findBioCell( m, pts ) pts is an N*3 array of N points. This function returns an N*1 array specifying for each point, which biological cell it lies within. If it does not lie within any bio cell, the corresponding value will be zero.

findCellAreaAndNormal.m

[a,n] = findCellAreaAndNormal( m, ci ) Compute the normal vector and area of finite element ci of mesh m. We do these together, since this is faster than computing them separately.

findConstrainedNodes.m

findEdgesToElide.m

eis = findEdgesToElide( m ) An edge can be elided if the triangles on both sides have a narrow angle opposite to the edge, and if eliding the edge does not have a bad effect on any triangles.

findElidableEdges.m

findFEareas.m

m = findFEareas( m ) Calculate the area of every cell of the mesh.

findGFtboxFile.m

findHitBC.m

[hitBC,hitPoint] = findHitBC( m, ci, hitLine, normalise ) Given a click on cell ci with the given hitLine, find the barycentric coordinates of the hit point on the cell. If normalise is true (the default), the barycentric coordinates are forced to lie within the cell.

findHitPatch.m

[pi,paramcoordshitPointpt] = findHitPatch( p, hitLine ) Given a patch handle p and a hit line, find which polygon of the path is hit by the line. The polygons are assumed to be either all triangles or all quadrilaterals. WORK IN PROGRESS

findNextEdgeAndCell.m

findNodeFixedDFs.m

vdfs = findNodeFixedDFs( m, vi ) Find which degrees of freedom of the triangular mesh node vi are fixed.

findNodesToSplit.m

[ns,c1s,bc1s,c2s,bc2s,e1s,e2s] = findNodesToSplit( m ) Find nodes of the mesh that require splitting. If no nodes are selected, n will be empty and the other outputs should be ignored.

findPerpVector.m

w = findPerpVector( v ) Returns a unit vector perpendicular to v. v can be a row vector of length 3 or an N*3 matrix of row vectors.

findPolGrad.m

gp = findPolGrad( m, cis ) Calculate the polarising gradient for growth in the specified cells of the mesh, by default all of them.

findProjectDirMenuItems.m

findProjectDirs.m

dirstruct = findProjectDirs( dname ) If dname is not a project directory and contains no project directories (including the case where dname does not exist), return an empty array. Otherwise, return a struct whose elements are: isprojectdir: boolean, true if the node is a project directory. When this is true, there should be no children. name: the full pathname of this directory. children: a struct array describing the children.

findStopButton.m

b = findStopButton( m ) Find the stop button in the GUI, if present.

findUnusedNodes.m

findVisiblePart.m

m = findVisiblePart( m ) Set m.visible to a structure having the fields 'nodes', 'edges', 'cells', 'borderedges', and 'bordercells'. Each of the first four is a boolean array. The first three indicate which of the respective objects are visible, and the fourth defines the set of edges bordering the visible region. The 'bordercells' field is a column vector of cell indexes, listing the visible cell index bordering each border edge. This is used to implement clipping in leaf_plot and writemeshvrml.

findcellarea.m

findvertexes.m

[v1,v2,v3] = findvertexes( p1, p2, f ) Find where nodes p1 and p2 occur in face f. We require that p1==f(v1), p2==f(v2), and f(v3) is the third vertex. Used in the edge-splitting routine SPLITEDGE.

fitmat2.m

m = fitmat( p0, p1 ) P0 and P1 are N*2 or N*3 arrays of 2D or 3D vectors. [M,T] are the linear transformation and translation that best approximate the transformation of P0 to P1. T is P1mean-P0mean, and M is chosen to minimise the squared error of (P1-P1mean) - (P0-P0mean)*M.

fixNodeDFs.m

mesh = fixNodeDFs( mesh, fixedDFs ) Fix all the given degrees of freedom. fixedDFs is an N*s array in which each row contains the index of a node of the triangular mesh and a degree of freedom (1=X, 2=Y, 3=Z). MODE is 'add' to add the constraints to the existing constraints, 'replace' to replace all the existing constraints, and 'delete' to remove these constraints from the existing constraints. The default is 'replace'

fixOrientations.m

m = fixOrientations( m ) Reorder the vertexes of the cells of m so as to give them all a consistent orientation.

fixVertexDF.m

handles = fixVertexDF( handles, vxs, x, y, z ) Fix or unfix the degrees of freedom of a vertex.

fixVertexMgen.m

handles = fixVertexMgen( handles, vi ) Fix or unfix a morphogen at a vertex.

flattenComponents.m

m = flattenComponents( m, interactive, method, cpt, bsiters ) Flatten the indicated components of m. cpt is the index of a component of m, in the arbitrary order in which those components are discovered. It may also be a list of such indexes. By default, it is all of them. As this is quite a time-consuming operation, the process is animated on the screen (provided that INTERACTIVE is true), with progress indicators. If cpt is out of range, it is ignored. BSITERS is a parameter determining how hard it tries to flatten each component. Setting it to zero eliminates the phase of the flattenng process in which, after having laid out the whole mesh in the plane, it tries to adjust the edge lengths to be as close as possible to their lengths in the unflattened mesh.

flipOrientation.m

flipedge.m

m = flipedge( m, eis ) For each ei in eis, ei is the index of an edge that has a triangle on both sides. Those two triangles form a quadrilateral of which the given edge is a diagonal. flipedge replaces that edge by the other diagonal.

flipedges.m

m = flipedges( m ) Find every place where it would improve the mesh to flip an edge, and flip it.

foojava.m

class foo { int bar; foo() { bar = 17; } };

forceFlatThickness.m

m = forceFlatThickness( m ) Set m.prismnodes from m.nodes, assuming a thickness of m.globalDynamicProps.thicknessAbsolute and that the mesh is flat in the XY plane.

forceflat.m

m = forceflat( m ) Force m to be flat and contained in the XY plane. The method first chooses a point on the boundary of m. (If m has no boundary, it isn't flattenable.) That point is mapped to (0,0,0). Its neighbour vertexes, in order, are mapped to points (1,y,0) for value of y in the same order. Their neighbours that we haven't seen already are mapped to (2,y,0), and so on until an entire connected component of m has been mapped. Repeat for every other component, mapping them to the planes z=1, z=2, etc.

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\growth\generalFE

completeFEconnections.m

fe = completeFEconnections( fe ) Given a standard FE with just vertexes, edgeends and faceedges defined, construct all the other connectivity data.

standardFEpentahedron.m

fe = standardFEpentahedron() Create a standard pentahedral FE.

generateCellData.m

m = generateCellData( m, cis ) Create the per-cell data structures for the cells listed in cis. The mesh and its globalProps are assumed to have already been computed. If cis is omitted it defaults to all the cells.

generateInteractionFunction.m

generatePlotOptions.m

getAllRealGrowth.m

m = getAllRealGrowth( m )

getAllStageTimes.m

getCellFrame.m

J = getCellFrame( n, p ) J is set to a right-handed unit basis whose first column is parallel to the polarisation gradient P, and whose third is parallel to the cell normal N. If the polarisation gradient is zero, an arbitrary unit vector perpendicular to the cell normal will be chosen instead of the polarisation gradient.

getDisplayedMgen.m

getDisplayedMgenIndex.m

getDraggedView.m

m = getDraggedView( m ) Called by the button-up function after a click-drag to change the view. m has its view parameters updated from the picture.

getFlag.m

--- help for BioMap/getFlag ---

GETFLAG retrieve the 'Flag' property of a BioMap object. OUT = GETFLAG(OBJ) retrieves the 'Flag' property in a BioMap object. OUT is an array of integers. OUT = GETFLAG(OBJ, X) retrieves the 'Flag' property for the elements indexed by X in a BioMap object. X must be a vector of positive integers, a logical vector, or a cell array of strings corresponding to valid 'Header' values. OUT is an array of integers. Note: Each flag must be interpreted bitwise (0 = false, 1 = true) to obtain the following information: 0x001: the read is paired in sequencing 0x002: the read is mapped in a proper pair 0x004: the read is unmapped 0x008: the mate is unmapped 0x010: strand of the read (0 = forward, 1 = reverse) 0x020: strand of the mate (0 = forward, 1 = reverse) 0x040: the read is the first in a pair 0x080: the read is the second in a pair 0x100: the alignment is not primary 0x200: the read fails platform/vendor quality checks 0x400: the read is a PCR or optical duplicate Examples: % Create a BioMap object. s = samread('ex1.sam'); obj = BioMap(s); % Retrieve the 'Flag' value of the second element in the object. getFlag(obj, 2) getFlag(obj, {s(2).QueryName}) getFlag(obj, [false true]) % Retrieve the 'Flag' value of the first and third elements in the % object. getFlag(obj, [1 3]) getFlag(obj, {s([1 3]).QueryName}) getFlag(obj, [true false true]) % Retrieve the 'Flag' values of all elements in the object. getFlag(obj) See also BIOMAP, BIOMAP/GET, BIOMAP/SETFLAG.

Reference page in Help browser doc BioMap/getFlag

getGFtboxAxes.m

h = getGFtboxHandles( m ) If m is being run from GFtbox, return the GUI handles, otherwise return empty.

getGFtboxConfig.m

Read the GFtbox configuration file and return the config as a struct.

getGFtboxFigure.m

fig = getGFtboxFigure( m ) If m is being run from GFtbox, return a handle to the GFtbox figure, otherwise return empty.

getGFtboxHandles.m

h = getGFtboxHandles( m ) If m is being run from GFtbox, return the GUI handles, otherwise return empty.

getGrowthAmplitudes.m

getHelpText.m

getMatlabViewParams.m

getMeshAxes.m

ax = getMeshAxes( m ) Return an array of all of the axes in which m is plotted.

getMeshCellFrame.m

J, = getMeshCellFrame( m, ci ) J is set to a right-handed unit basis whose first column is parallel to the polarisation gradient, and whose third is parallel to the cell normal. If the polarisation gradient is zero, the first column will be an arbitrary unit vector perpendicular to the cell normal.

getMeshParams.m

mp = getMeshParams( h ) Get the currently selected mesh type and read all of its parameters from the GUI.

getMgenLevels.m

getModelDir.m

getOurViewParams.m

getPlotOptionsFromDialog.m

getRealGrowth.m

gp = getRealGrowth( m, ci ) This function computes the equivalent growth parameters from the displacements of cell ci. The result is a 6-element vector consisting of major growth, minor growth, growth angle, major bend, minor bend, and bend angle.

getRotations.m

r = getRotations( m ) Compute for each finite element the rotation that best approximates the displacements of its vertexes.

getSelectedCompressor.m

getThickness.m

t = getThickness( m ) Return the thickness of the mesh at every vertex.

getViewParams.m

[ourViewParams,matlabViewParams,s] = getViewParams( s )

getnumcells.m

getprismcells.m

getprojectname.m

THIS ROUTINE IS NOT USED ANYWHERE.

globalToLocalGradient.m

locgrad = globalToLocalGradient( globgrad, trinodes ) Compute the barycentric coordinates of the given global vector with respect to the given triangle.

goToProjectDir.m

gradN.m

gn = gradN( p ) Calculate the gradient of all the shape functions for a triangular prism at isoparametric coordinates p. p is a 3x1 column vector. The result gn is a 3x6 matrix, one column for each shape function. If p is a 3xN matrix, gn is a 3x6xN matrix.

growmesh.m

MESH = GROWMESH(MESH,DT) Grow the mesh.

growthAnisotropyFromParPerp.m

growthDisplacements.m

[m,U,G,K,F] = growthDisplacements( m ) Calculate plastic growth.

growthFromParPerp.m

growthParPerp.m

growthParallel.m

growthParamsFromTensor.m

Given an N*6 matrix of N growth tensors as row 6-vectors, compute N*1 arrays of the major growth, minor growth, and angle. The growth tensors are assumed to be given in the plane of the cell, i.e. one principal axis is the local z axis.

growthPerpendicular.m

growthRateFromGrowthAmount.m

[ gmajor, gminor ] = growthRateFromGrowthAmount( doublingtime, anisotropy ) Given the time to double in area, and the ratio of the major and minor axes when the area has doubled, compute the growth rates along the major and minor axes.

growthTensorFromParams.m

growthToDouble.m

hSaveNodeBeforeChange.m

hasPicture.m

hexcircle.m

m = HEXCIRCLE(r,n,c) Make a circle triangulated into a hexagon of triangles. R Radius N Number of concentric circles of triangles C Centre

hitmesh.m

ci = hitmesh( m, hitLine ) Return the element of m that is first intersected by the hitline, 0 if there is no such cell. This is rather slow: it tests every element of m for intersection. There are more efficient ways of doing this, but they're not worth the effort of programming.

importRemoteStagesItem_Callback.m

indicateInteractionValidity.m

inflatemesh.m

m = inflatemesh( m ) Reconstruct all the information that was removed from m by stripmesh. See also: STRIPMESH.

initProperties.m

m = initProperties( m ) Set to a default state many fields of m that affect the simulation. This is convenient to call from your interaction function at time zero, before initialising the mesh with the values you want. The following fields are set: morphogens all set to 0 mgen_production all set to 0 mgen_absorption all set to 0 mgen_dilution all set to 0 mgenswitch all set to 1 mutantLevel all set to 1 allMutantEnabled true

insertFixedDFS.m

v = insertFixedDFS( v, renumber, numfulldfs, stitchDFs, oppositePairs, ) v is a vector indexed by reduced degrees of freedom. Insert zeros into v so that it is indexed by the full degrees of freedom.

insertFixedDFS2.m

M = insertFixedDFS2( M, renumber, numfulldfs, stitchDFs ) M is a matrix indexed by reduced degrees of freedom. Insert zeros into M so that it is indexed by the full degrees of freedom.

installNewMesh.m

handles = installNewMesh( handles, m ) Install a new, fully constructed mesh into the handles. m is copied to handles.mesh. Various other cross-references between the mesh, the handles, and the GUI are set up. This routine assumes that the simulation is not running.

interpolateVertex.m

m = interpolateVertex( m, v0, v1, v01 ) v01 is a new vertex that has been created at the midpoint of v0 v1. Set all the data for that vertex by suitably interpolating the data for v0 and v1. v0, v1, and v01 may be equal-sizes vectors, in which case the operation is performed for all corresponding elements.

interpolationStencil.m

[ns,ws] = interpolationStencil( m, c, bc ) Given a cell C and barycentric coordinates BC in C, determine the corresponding point on the subdivision surface, in terms of a set of nodes of M and weights. Not fully implemented: this returns the flat subdivision scheme and needs to be revised to use the butterfly.

isCurrentStage.m

isCurrentStage( m ) Test whether M is currently at a stage time, to within 0.1 of the time step.

isDiffusible.m

d = isDiffusible( m, morphogenindex ) d = isDiffusible( c ) The first type of call translates to the second: d = isDiffusible( m.conductivity(morphogenindex) ) Determine whether the given morpohgens have any non-zero diffusion coefficients.

isGFtboxBusy.m

isBusy = isGFtboxBusy( handles ) Determine whether the busy flag is set.

isGFtboxProjectDir.m

result = isGFtboxProjectDir( pathname ) Returns TRUE or FALSE depending on whether PATHNAME is a path to a GFtbox project directory. The test is that the directory contain a MAT-file whose basename is identical to the name of the directory.

isValidMgenName.m

isinteractive.m

isint = isinteractive( m ) Determine if m is being processed interactively from within GFtbox. This is deemed to be true if m.pictures is nonempty, m.pictures(1) is a figure handle, and its tag is 'GFTwindow'.

itemStringToSuffixPattern.m

Convert a stage suffix to a pattern that will match any equivalent stage suffix when used as an argument to ls() or dir().

itemStringToSuffixString.m

iterateadj.m

[MESH,vels,force] = ITERATEADJ(MESH,VELS,DT) Perform a single iteration step of a spring graph. PTS is the set of points, VELS is the set of their velocities, and EDGES is the edge data matrix.

kbend_from_ab.m

[k,bend] = kbend_from_ab( a, b ) Given surface growth A and B, compute the equivalent growth and bend factors K and BEND, such that K-BEND = A and K+BEND = B. If ALLOWNEGATIVE is false, force K to be non-negative, at the expense of violating these equalities.

kbend_from_kab.m

[k,bend] = kbend_from_kab( k, a, b ) Given general growth K and surface factors A and B, where the growth on side A is K*A and the growth on side B is K*B, compute the equivalent growth and bend factors K1 and BEND, such that K1-BEND = K*A and K1+BEND = K*B.

keyPanelSwitch.m

latestComputedStageBefore.m

loadIFtemplate.m

loadmesh_anyfile.m

m = loadmesh_anyfile( m, filename, staticdata, interactive ) Load a leaf from a file. The expected format depends on the extension of the filename: .OBJ Contains only nodes and triangles, in OBJ format. All other properties of the mesh will be set to their default values. .MAT The leaf is contained in the file as a Matlab object called m. If staticdata is supplied, data from these overwrites data loaded from filename. If staticdata is a string, it will be assumed to be a MAT-file containing the static data. .M The file contains Matlab commands to create or modify a leaf. These commands will be executed. All of these formats can be generated by leaf_save. In the case of .OBJ and .MAT files, the existing leaf will be discarded. A .M file will discard the current leaf only if it contains a command to create a new leaf.

lobeedges.m

[l,r] = lobeedges( nrings, nrows ) Return two column vectors containing the indexes of the nodes on the left and right edge of the rectangular part of a lobe mesh.

lobemesh.m

m = LOBEMESH(radius, nrings, rectht, nrows, nbase ) Make a mesh in the shape of a semicircle atop a rectangle. RADIUS is the radius of the semicircle. RECTHT is the height of the rectangle. NRINGS is the number of rings of triangles the semicircle is divided into. NROWS is the number of rows of triangles in the rectangle. NBASE is half the number of edges the base of the rectangle is divided into. By default this is NRINGS. The bottom edge of the lobe consists of the last 2n+1 nodes. The nodes on the right edge are the nth node, and nrows nodes at intervals of 2nrings+1, ending at the last node. The resulting mesh contains only the following components: nodes, tricellvxs, globalProps.trinodesvalid, globalProps.prismnodesvalid, and borders.{bottom,left,right}.

lobesmesh.m

locateVertexDF.m

handles = locateVertexDF( handles, vxs, x, y, z )

make6vector.m

v = make6vector( m ) Convert a symmetric 3*3 matrix into a 6*1 vector. If m is 2*2 it will be treated as a 3*3 matrix with row 3 and column 3 all zero.

makeAreasAndNormals.m

m = makeAreasAndNormals( m, cells ) Compute the normal vector and area of the given finite elements, by default all of them. We do these together, since this is faster than computing them separately.

makeCanvasPicture.m

fig = makeCanvasPicture( msg, varargin ) Create a figure window containing a canvas picture, legend, report text, colorbar, etc. Options: 'figure': An existing figure can be supplied, instead of creating a new one. 'fpos': The position of the figure on the screen, given as a four-element array of integers [x y width height]. If a two-element array is given, it will be interpreted as [width height], and the figure will be automatically centered on the screen. 'ppos': The relative position of the picture content elements within the figure. This is also a four-element array. The picture elements will be automatically laid out within this rectangle. If ppos is supplied, fpos is omitted, and a new figure is being created, then the new figure will be automatically sized to fit the contents. 'black' A boolean, by default false. If true, the picture will have a black background, otherwise white. 'add' A boolean, by default true. If false, any existing picture will be deleted, otherwise it will be retained. 'stereooffset' A real number, by default zero. The number of degrees of azimuth by which the view will be changed relative to that indicated by the scrollbar. 'properties' A structure containing any other attribute of the figure that should be set. 'uicontrols' If true, sliderbars and text items will be created, otherwise not. The UserData of the figure will be set to a structure containing handles to all of the created components, and the Position attribute of the figure. The latter is needed because when the figure is resized, this is the only way the resize function has of knowing what the old size was. This procedure is also used by the resize callback (ResizeFcn). If a figure is given to it which already has a nonempty UserData component, then the UserData is assumed to be a structure as above, and the components are resized and repositioned as required, instead of being created. If the figure is found not to have actually changed its size, the resize function does nothing.

makeCellFrames.m

m = makeCellFrames( m ) Calculate the preferred frame of reference of every cell. Column 1 is the polarisation gradient, column 2 the perpendicular in the plane of the cell, and column 3 the normal to the cell.

makeCircularCrossSection.m

m = makeCircularCrossSection( m, rel_thickness_upper, rel_thickness_lower ) Force the mesh m to have a circular or elliptic cross-section in the XZ plane, assuming the mesh is initially more or less flat in the XY plane. If the semi-diameter of the mesh in the X direction at some point Y is r, then the height of the upper surface of the mesh in the Z direction at X=0 will be r*rel_thickness_upper, and the depth of the lower surface in the -Z direction will be r*rel_thickness_lower. If rel_thickness_lower is not specified, it defaults to rel_thickness_upper, giving elliptical cross-sections symmetric in the plane Z=0. If the original mesh is flat in the XY plane, the resulting mesh will be flat if and only if rel_thickness_upper is equal to rel_thickness_lower.

makeCircularCrossSection2.m

m = makeCircularCrossSection( m, rel_thick_upper, angle_upper, rel_thick_lower, angle_lower ) Force the mesh m to have a circular or elliptic cross-section in the XZ plane, assuming the mesh is initially more or less flat in the XY plane.

makeCitations.m

makeDefaultThumbnail.m

makeDefaultThumbnail( m ) Make a default thumbnail for a mesh. This only does something if m is part of a project and the project has no thumbnail file already.

makeEmptyPlotHandles.m

makeGlobalAxes.m

axes = makeThDiffGlobalTensor( localAngle, xiV, etaV, zetaV ) Construct the set of axes resulting from rotating xiV and etaV about zetaV by localAngle. xiV, etaV, and zetaV are assumed to be unit column vectors.

makeGrowthTensor2.m

t = makeGrowthTensor2( majoraxis, majorgrowth, minorgrowth ) Return a 2*2 matrix containing a growth tensor in two dimensions having MAJORGROWTH along MAJORAXIS and MINORGROWTH perpendicular to that.

makeHelpMenu.m

makeIFname.m

ifname = makeIFname( modelname ) Turn an arbitrary string into something that can be a valid Matlab function name or struct field name. The string is mapped to lower case, all non-alphanumerics are replaced by underscore, and if the string does not begin with a letter, it is prefixed by 'IF_'.

makeLocalGrowthTensor.m

G = makeLocalGrowthTensor( gpar, gper, gradpol, gthick, ... bendpar, bendper ) Compute a growth tensor in the local frame.

makeLocalGrowthTensorNEW.m

G = makeLocalGrowthTensorNEW( apar, aper, bpar, bper, ... gthick, gradpol, gradpolthresh ) Construct growth tensors for a pentahedral element, given the values of the growth-determining morphogens at the three vertexes of its midplane. The result is returned in the frame of its own principal axes, and therefore the skew components are omitted. A growth tensor is returned for each vertex; these all have the same principal frame. apar, aper, bpar, bper are the absolute growth rates on the A and B sides of the pentahedron. gradpol is the polarisation gradient. gthick is the growth in thickness. If this is empty, then thickness is being handled non-physically, and for the purposes of constructing growth tensors we use the average of major and minor growth on the top and bottom. The result is a set of growth tensors in the global frame of reference, one for each vertex of the pentahedron. If the triangular vertexes are v1, v2, and v3, the growth tensors are listed for the prism nodes in order: v1*2-1, v2*2-1, v1*2, v3*2-1, v2*2, v3*2.

makeMeshGrowthTensors.m

m = makeMeshGrowthTensors( m ) Calculate the growth tensors at every vertex of every cell.

makeMeshLocalGrowthTensor.m

gt = makeMeshGrowthTensor( m, ci ) Calculate the growth tensors at the vertexes of the cell ci in the local frame of ci.

makeModelNamesConsistent.m

m = makeModelNamesConsistent( m ) Update all of the following data so as to be consistent with the folder name: The internal model name, m.globalProps.modelname. The internal projects directory name, m.globalProps.projectdir. The name of the static file. The name of the file containing the interaction function. The name of the notes file.

makeMultiplotWindow.m

make new figure of suitable size

makeNotesName.m

name = makeNotesName( modelname ) Make the name of the notes file for a model m.

makePolygon.m

vxs = makePolygon( mesh, cells ) Assuming that the given FEM cells form a connected region of the mesh with no holes, list the vertexes and edges of the polygon that they form. CELLS is the list of cell indexes. CELLMAP is a bitmap thereof.

makeProjectSubfolders.m

makeTRIvalid.m

makeVertexConnections.m

m = makeVertexConnections( m ) Construct m.nodecelledges, given that all of trinodevxs, edgecells, edgeends, and celledges are valid. m.nodecelledges is a cell array indexed by vertexes. m.nodecelledges{vi} is a list of all of the edges and cells contacting vertex vi, listed in the same order as are the vertexes of each cell. Edges and cells alternate; in the sequence e c e', e and e' are edges of c. Where there is no cell between e and e' (because they are on the edge of the mesh, c is zero. If the node is on an edge of the mesh, m.nodecelledges{vi} begins with an edge on the edge of the mesh and ends with zero.

makeZeroGrowthTensors.m

m = makeZeroGrowthTensors( m ) Set the growth tensors at every vertex of every cell to zero.

makebasis.m

J = makebasis( v1, v2 ) Set J to an orthonormal matrix whose column vectors j1, j2, j3 are given by: j1 is parallel to v1. j2 is in the plane of v1 and v2, and has a positive dot product with v2. [j1 j2 j3] is a right-handed basis. v1 and v2 must be linearly independent non-zero three-element row vectors. If v2 is not supplied, an arbitrary suitable value will be chosen.

makebendangles.m

m = makebendangles( m, es ) Calculate the angle between element normals across the edges es, by default all of them. For boundary edges this is set to zero.

makecelledges.m

m = makecelledges( m ) Reconstruct the edgecells array, assuming that all the other connectivity information is valid.

makecylindermesh.m

m = makecylindermesh( x, y, centre, height, nx, ny, topcap, basecap, etc... ) Make a cylindrical surface divided into triangles. x is the radius and y the height. There are nx cells around and ny cells vertically. nx must be at least 3 and ny at least 1. topcap and basecap are booleans: if true, a hemispherical end will be added to the top or base. All arguments must be positive.

makeedges.m

m = makeedges( m, ee, ec, ce ) Construct m.edgeends, m.edgecells, m.celledges, and m.seams from m.tricellvxs.

makeedgethreshsq.m

makefig.m

makeleafmesh.m

mesh = makeleafmesh( xwidth, ywidth, xdivs ) Make a leaf-shaped surface. INCOMPLETE.

makeprismsvalid.m

m = makeprismsvalid( m ) Convert 2Dmesh to 3D set of prisms.

makerectmesh.m

m = makerectmesh( x, y, c, nx, ny ) Make a rectangular plate divided into triangles. If x is a single number, it is the diameter of the mesh along the x axis. If it is a pair of numbers, it is the minimum and maximum x value. y is similar. nx and ny are the number of cells it is subdivided into each way. nx may be a pair of numbers: in this case the first number is the number of divisions along the lower edge (lesser y value) and the second is the number of divisions along the upper edge. c is the position of the centre of the rectangle.

makestagesuffixf.m

s = makestagesuffixf( t ) Convert a number T to a stage suffix S. T is converted to a stage label, and the stage prefix prepended.

manageMutantControls.m

measureThickness.m

meshAfterTime.m

isat = meshAtOrAfterTime( m, t, tolerance ) Test to see if the current simulation time is after the time T, allowing for numerical rounding error. The tolerance is a fraction of the current timestep, and defaults to 0.01. To be counted as after T, the current time must exceed it by at least this amount. meshAfterTime( m, t, tolerance ) is exactly equivalent to ~meshAtOrBeforeTime( m, t, tolerance ). SEE ALSO: meshAtTime, meshBeforeTime, meshAtOrAfterTime, meshAtOrBeforeTime

meshAtOrAfterTime.m

isat = meshAtOrAfterTime( m, t, tolerance ) Test to see if the current simulation time is at or after the time T, allowing for numerical rounding error. The tolerance is a fraction of the current timestep, and defaults to 0.01. Thus function returns true if the current time does not fall below T by this tolerance or more. meshAtOrAfterTime( m, t, tolerance ) is exactly equivalent to ~meshBeforeTime( m, t, tolerance ). SEE ALSO: meshAtTime, meshAfterTime, meshBeforeTime, meshAtOrBeforeTime

meshAtOrBeforeTime.m

isat = meshAtOrAfterTime( m, t, tolerance ) Test to see if the current simulation time is at or before the time T, allowing for numerical rounding error. The tolerance is a fraction of the current timestep, and defaults to 0.01. This function returns true if the current time does not exceed T by this amount or more. meshAtOrBeforeTime( m, t, tolerance ) is exactly equivalent to ~meshAfterTime( m, t, tolerance ). SEE ALSO: meshAtTime, meshAfterTime, meshBeforeTime, meshAtOrAfterTime

meshAtTime.m

isat = meshAtTime( m, t, tolerance ) Test to see if the current simulation time is close to the time T. The tolerance is a fraction of the current timestep, and defaults to 0.01. The function returns true if the simulation time is within this interval of T. SEE ALSO: meshAfterTime, meshBeforeTime, meshAtOrAfterTime, meshAtOrBeforeTime

meshBaryToGlobalCoords.m

meshBeforeTime.m

isat = meshBeforeTime( m, t, tolerance ) Test to see if the current simulation time is after the time T, allowing for numerical rounding error. The tolerance is a fraction of the current timestep, and defaults to 0.01. To be counted as before T, the current time must fall short of it by at least this amount. meshBeforeTime( m, t, tolerance ) is exactly equivalent to ~meshAtOrAfterTime( m, t, tolerance ). SEE ALSO: meshAtTime, meshAfterTime, meshAtOrAfterTime, meshAtOrBeforeTime

meshColors.m

meshDiameter.m

meshFlatStrain.m

mesh = meshFlatStrain( mesh, scale ) Set the residual strain to be the strain the mesh must have, for its relaxed state to be flat. If scale is supplied, the strain is multiplied by that amount

meshFromCells.m

m = meshFromCells( vvxs, vcells ) Create a mesh from a set of biological cells. vvxs is an N*3 array of N vertexes, and vcells is a C*1 cell array listing the vertexes of each cell. centroids, if supplied, is a C*3 array giving the position of a point within each cell. If not supplied, it defaults to the average of all the vertexes belonging to that cell.

meshFromTriangles.m

m = meshFromTriangles( m ) Given a mesh of which the only fields known to exist are m.nodes and m.tricellvxs, build all of the connectivity information: m.celledges m.edgecells m.edgeends

meshGlobalToBaryCoords.m

meshInfoText.m

meshQueryDialog.m

result = meshQueryDialog( m, numbuttons, format, varargin ) If m is being run interactively, ask the user the question and return the user's response. Otherwise, don't ask, and return 1 (the OK button).

meshThickness.m

ts = meshThickness( m, vis ) Compute the thickness of the mesh at each vertex in vis. If vis is omitted, the thickness at every vertex is returned, as a column vector.

meshZeroStrain.m

mesh = meshZeroStrain( mesh ) Set all residual strains to zero.

mesh_bbox.m

meshbbox.m

meshbboxsize.m

meshgrad.m

g = meshgrad( m, f ) m is a mesh of which at least m.nodes and m.tricellvxs exist, and f is a column vector containing one value for each node. Calculate a N*D matrix g, where N is the number of nodes and D the number of dimensions, in which row i is the gradient vector of f over cell i.

mgenCellGradient.m

g = mgenCellGradient( m, mgen, cis ) For a mesh m, and morphogen field mgen defined at each vertex of m, compute the gradient of mgen for each cell. mgen can be either a morphogen index, a morphogen name, or a row or column vector of values, one for each vertex. This is calculated in the global frame.

mgenColorPick.m

mgenNameFromMgenMenu.m

mgenVertexGradient.m

g = mgenVertexGradient( m, mi ) For a mesh m, and morphogen field mgen defined at each vertex of m, compute the gradient of mgen for each vertex.

mixcolors.m

mixplotoptions.m

fraction is assumed not to be equal to 0 or 1, as these special cases will have been dealt with outside this function. For the interpolable plot options, set those fields in both p0f and p1f to the interpolation of their values from p0 and p1. For non-interpolable fields, set ths of p0f to their values on p0, and those of p1f to their values in p1.

monoColormap.m

[cmap,range] = monoColormap( range, hues ) Create a monochromatic colour map. Hues can be a single colour or a pair of colors. The colors can be specified either as single-letter names: b, w, r, g, b, c, m, y, o; or as hues (single values in the range 0..1); or as rgb colours (a 1*3 or 2*3 matrix).

moreStagesItem_Callback.m

morphogenInteractions.m

g = morphogenInteractions( g ) Calculate the effect of morphogen interaction over a single time step. g is the matrix of morphogens, with one row for every vertex and one column for every morphogen.

mouseeditmodeMenu_Callback.m

--- Executes on selection change in mouseeditmodeMenu.

moveOldRunsToNewRuns.m

moveOldRunsToNewRuns( modeldir ) Move every subdirectory of modeldir/movies which contains a file called "CommandLine.txt" to modeldir/runs.

msrToMesh.m

multicolourmgens.m

multiplotDlg.m

multiplyLayers.m

m = multiplyLayers( m, nlayers ) Replace the mesh of m by nlayers copies, stacked up and with the B surface of one layer glued to the A surface of the next.

mylegend.m

Begin initialization code - DO NOT EDIT

nbvcells.m

cis = nbcells( m, ci ) Find all finite elements that share a vertex with any element in cis.

negativeness.m

neighbourVxs.m

vis = neighbourVxs( m, vi ) Find the vertexes that are the neighbours of vertex vi.

neighbourhoodTension.m

t = neighbourhoodTension( v ) v is an N*2 matrix of row vectors. If each of these represents a tension acting at a point, calculate the stress tensor resulting from the combination of all of them.

newArchiveDirectory.m

a = newArchiveDirectory( adir, basename ) Create a directory whose name has the form basename_Annn. nnn is chosen to be 1 if no such directory exists, or 1 more than the highest number for which such a directory does exist.

newcirclemesh.m

[m,rimnodes] = newcirclemesh( sz, circum, nrings, centre, inner, dealign, sector, coneangle )

newicosmesh.m

m = newicosmesh()

newversioninfo.m

v = newversioninfo( version ) Create version info.

nextborderedge.m

[e,v] = nextborderedge( m, ei, vi ) If ei is the index of a border edge of m, and vi is the index of the vertex at one end of ei, find the index of the other border edge impinging on vi, and the vertex at its other end.

notifyPlotChange.m

notifyPlotChange( handles, varargin ) Set a flag to indicate that the mesh needs to be replotted. Replot the mesh if the simulation is not currently running.

notifySplit.m

Pierre's code goes here.

notifySplits.m

numFEMnodes.m

octagadj.m

MESH = OCTAGADJ(L) Create connection graph of trangulated octagon. L is the radius of the octagon.

octagon.m

OCTAGON(L) Draw a triangulated octagon. L = radius of octagon. The octagon is centred at the origin.

onecell.m

mesh = onecell( x, y ) Make a mesh consisting of a single triangle with vertexes at [0,0,0], [x,0,0], and [0,y,0].

onestep.m

[m,ok] = onestep( m, useGrowthTensors ) Run one step of the iteration: * Calculate the polarisation gradients. * Perform a FEM calculation. * Restore flatness/thickness. * Perform dilution-by-growth. * Generate the FEM cell normal vectors. * Split large FEM cells. * Recalculate FEM cell areas. * Recalculate the second layer global positions and split large second layer cells. The result OK will be false if the user interrupts in the middle of a simulation step or there is an error in the interaction function.

openManual_Callback.m

openManual_Callback(hObject, eventdata) Callback for the Help/Open Manual menu item. Open the PDF manual.

openWaypointDialog.m

For testing purposes, MOVIES is a struct array of movies, MI is the index of a movie, and wpi is the index of a waypoint of that movie. In production, the argument will be a mesh from which the waypoints are read, and the indexes will be determined...somehow.

orientMesh.m

m = orientMesh( m ) Force m to be oriented. NOT IMPLEMENTED

othercell.m

ci1 = othercell( m, ci, ei ) If ci is the cell on one side of edge ei, return the cell on the other side, or zero if there is no such cell. ei can be a vector, and ci1 will be a vector of the same length.

otherend.m

vi1 = otherend( m, vi, ei ) If vi is the vertex at one end of edge ei, return the vertex on the other end. ei can be a vector, and vi1 will be a vector of the same length.

othervertex.m

paintVertex.m

if strcmp( selectionType, 'open' ), return; end

paintmesh.m

paintmesh( V, I, res ) Paint the surface through the vertexes V with the image I. res is the grid interval in units of the maximum diameter of V. The vertexes are the rows of V.

parseMgenList.m

mgens = parseMgenList( s ) s is a string containing a list of morphogen names and possibly morphogen properties. The general syntax is: mgenname ( propertyname = propertyvalue, ... ) The property names that can be specified are: d, diff: diffusion constant (default value 0) dec, decay: decay constant (default value 0) The result is a struct array with fields 'mgen', 'diff', and 'decay'.

parseStageFileName.m

Take a file name without extension, and look for a stage file suffix. If there is none, return basename as the original name, stagestring as empty, and stagetime as zero. Otherwise, return the stage segment as a string in stagestring (without the leading '_s'), and the corresponding real number in stagetime. If the suffix fails to parse as a number, return stagestring as -1 and stagetime as zero.

partialArea.m

a = partialArea( m, vs ) Calculate the total area of all cells, all of whose vertexes are in the set vs.

partitionCellStrain.m

[Uplanar,Ubending] = partitionCellStrain( U ) U is a 6*3 matrix of the displacements of the vertexes of a cell. Rows 1:3 are one side, and rows 4:6 the other side. This function returns a pair of such matrices, such that U = Uplanar + Ubending and Ubending has equal and opposite components for the top and bottom vertexes of the cell.

perFEtoperVertex.m

perVx = perFEtoperVertex( m, perFE ) Given a quantity that is defined for each finite element, calculate an equivalent quantity per vertex. The per-element quantity can be a vector. If m has numVx vertexes and numFEs finite elements, then perVx has size [numVxs,K] for some K, and perTri has size [numFEs,K]. Note that this is an approximation: some smoothing is unavoidable in the calculation. The function perVertextoperFE translates the other way, but these two functions are not inverses. Converting back and forth will have the side-effect of spreading out the distribution of the quantity.

perVertextoperFE.m

perVx = perVertextoperFE( m, perVx, fes ) Given a quantity that is defined for each vertex, calculate an equivalent quantity per finite element. The per-vertex quantity can be a vector. If m has numVx vertexes and numFEs finite elements, then perVx has size [numVxs,K] for some K, and perFE has size [numFEs,K]. Note that this is an approximation: some smoothing is unavoidable in the calculation. The function perFEtoperVertex translates the other way, but these two functions are not inverses. Converting back and forth will have the side-effect of spreading out the distribution of the quantity.

perturbz.m

ping_cluster.m

planarCellStrain.m

Uplanar = planarCellStrain( U ) U is a 6*3 matrix of the displacements of the vertexes of a cell. Rows 1:3 are one side, and rows 4:6 the other side. Uplanar is set to the planar component of the strain, ignoring the bending at the edges of the cell.

plotConcSummary_20090805.m

Erika 30.01.2009 This tools takes the collected concentration profiles over time from leaf_vertex_follow_mgen.m to create a separate graph for each morphogen with the Distance from the base on the x-axis and the Concentration for morphogens or growth rate in cases of kpar and kper on the y-axis. In leaf_vertex_follow_mgen.m an indivisdual starttime does not seem settable, so that records are always taken right from the start of the simulation.

plotGrowthCrosses.m

plotHighlightedEdges.m

plotMeshGrowth.m

plotMeshPoint.m

plotMinMesh.m

plotMinMesh( m ) Minimal plotting routine that assumes only the node and tricellvxs fields.

plotMinMeshClip.m

plotMinMeshClip( m, n, a ) Minimal plotting routine plus clipping plane. N is a column vector and A is a real number.

plotSecondLayer.m

ph = plotSecondLayer( m ) Draw the second layer.

plotadj.m

PLOTADJ( MESH, VELS, FORCE ) Draw vertexes and edges of a graph. PTS is a 2*n matrix containing the X and Y components of the vertexes of the graph. ADJ is the adjacency matrix: when ADJ(a,b) is nonzero, a line will be drawn from [X(a),Y(a)] to [X(b),Y(b)]. The result is a plot structure.

plotbaremesh.m

plotbaremesh( m ) Plot a mesh which only contains m.nodes and m.tricellvxs.

plotmeshsurface.m

h = plotmeshsurface( theaxes, vxs, triangles, data, pervertex, edgethickness, s ) Plot a triangular mesh.

plotsimplemesh.m

plotspringmesh.m

plotspringmesh(MESH,COLOR,VELS,FORCES) Plot a mesh as a surface.

plottemps.m

PLOTTEMPS(MESH) Plot a mesh as a surface.

plottrimesh.m

plottrimesh( ... ) Simple plot of a mesh. plottrimesh(FILENAME) will read the obj file FILENAME and plot it in the current figure. plottrimesh( V, F ) will plot the triangles specified by V and F. V is an N*3 array of vertexes and F is an M*3 array of vertex indexes. plottrimesh(R), where R has fields V and F will plot R.V and R.F. plottrimesh(M), where M has fields NODES and TRICELLVXS will plot M.NODES and M.TRICELLVXS.

polariseFELayer.m

m = polariseFELayer( m ) Create polarisation vectors for the FE layer. Each vector is a unit vector in the plane of the cell. The directions are chosen randomly.

polariserIndex.m

positiveRainbow.m

posnegMap.m

pp_from_ga.m

prepareProjectNameDialog.m

prismIndexes.m

p = prismIndexes( n ) Calculate the set of prism node indexes corresponding to the given triangle node vertexes.

prismnodesfromnodes.m

processPendingData.m

procrustesHeight.m

procrustesWidth.m

projectVecToLine.m

w = projectVecToLine( v, n ) Find w such that v-w is parallel to n and w is perpendicular to n. n need not be a unit vector. v and n must be row vectors; w will be a row vector.

randInFEMcells.m

r = randInFEMcells( m, cellIndexes, n ) Select n random points from within the given FEM cells.

randomDirection.m

newdir = randomDirection( curstart, radius, curdir, maxangle, surfnormal, insurface, usemaxangle, N ) Generate a random direction that deviates by not more than maxangle from currentdir, and which is uniformly distributed over the spherical cap that is the space of all permitted directions. If surfnormal is supplied, nonempty, and nonzero, limit the new vector to the subset making an angle with surfnormal of more than 90 degrees. If maxangle is empty, all directions are permitted, the same as if maxangle were pi or more. insurface is a boolean. If false, the above happens, but if true, the new direction is constrained to lie parallel to the surface, i.e. perpendicular to surfnormal. (surfnormal must be supplied and nonzero in this case.) The new direction is randomly uniformly distributed over the range of permitted angles in the surface. curdir must be a row vector. newdir will be a unit length row vector. The default value of N is 1. A larger value can be supplied to generate any number of random directions as an N*3 matrix.

randomiseDisplacements.m

readCitationFile.m

readMeshFromOBJ.m

mesh = readMeshFromOBJ( dirname, basename ) Read a mesh from the set of OBJ files in the given directory having the given basename. If basename is the name of a subdirectory, read the mesh from the set of files contained in that subdirectory. It does not matter whether dirname has a trailing '/' or not. Basename should not contain wildcards. If basename is empty, dirname will be taken to be the full file name or directory name. In each file, comments begin with a #, extend to the end of the line, and are ignored. Empty lines are ignored. Leading and trailing space is ignored. Each remaining line is expected to begin with a token, made of letters, digits, underscores, and hyphens (but hyphens will be taken as equivalent to underscores). The token is followed by series of numbers separated by whitespace. The same token must always be followed by the same number of numbers. Extra numbers will be ignored and missing numbers set to zero, with a warning printed. In addition, a line consisting entirely of numbers is allowed: in this case the implied token name is the file extension (with invalid characters removed). If the file has no file extension, the basename of the file is used. The result of reading the raw data is a structure containing a field for each different token that was seen. The value of that field is a matrix in which each row corresponds to a line of data readin from the files. When reading multiple files, it does not matter which file any piece of data came from. 2008 Feb 27: readMeshFromOBJ cannot be used to read prim meshes, only triangular meshes.

readobj.m

o = readobj( filename )

readrawmesh.m

rawmesh = readrawmesh( dirname, basename ) Read a mesh from the set of files in the given directory having the given basename. If basename is the name of a subdirectory, read the mesh from the set of files contained in that subdirectory. It does not matter whether dirname has a trailing '/' or not. Basename should not contain wildcards. If basename is empty, dirname will be taken to be the full file name or directory name. In each file, comments begin with a #, extend to the end of the line, and are ignored. Empty lines are ignored. Leading and trailing space is ignored. Each remaining line is expected to begin with a token, made of letters, digits, underscores, and hyphens (but hyphens will be taken as equivalent to underscores). The token is followed by series of numbers separated by whitespace. The same token must always be followed by the same number of numbers. Extra numbers will be ignored and missing numbers set to zero, with a warning printed. In addition, a line consisting entirely of numbers is allowed: in this case the implied token name is the file extension (with invalid characters removed). If the file has no file extension, the basename of the file is used. The result of reading the raw data is a structure containing a field for each different token that was seen. The value of that field is a matrix in which each row corresponds to a line of data readin from the files. When reading multiple files, it does not matter which file any piece of data came from. 2008 Feb 27: readrawmesh cannot be used to read prim meshes, only triangular meshes.

realStringToItemString.m

realToItemString.m

recalc3d.m

m = recalc3d( m ) Call this after the shape of a mesh has been changed, to recalculate various things that depend on the shape.

recentprojectsMenuItemCallback.m

recomputeStagesItem_Callback.m

recordframe.m

rectifyMeshFOV.m

m = rectifyMeshFOV( m, fov ) Set the field of view to the given value (default 10 degrees), and adjust the camera distance so that in orthographic projection, the visible scene remains unchanged. In perspective projection, the intersection of the view frustum with the target plane will remain unchanged.

rectifyVerticals.m

m = rectifyVerticals( m ) Adjust the positions of the prism nodes on either side of each triangle node, so that the line joining them is parallel to the average of the cell normals of the adjoining cells. The thickness of the mesh at each point is left unchanged.

refineall.m

m = refineall( m ) Split all edges of m, giving a mesh with four times as many cells.

refinemesh.m

mesh = refinemesh( mesh, frac ) Refine a mesh by splitting every edge which is at least as long as the shortest of the longest frac of the edges.

reloadMesh.m

remakeStageMenu.m

renumberMesh.m

m has had vertexes, edges, and cells merged or deleted. rnodes is an array whose length is the number of vertexes of the old version of m. If vi is the index of such a vertex, then rnodes(vi) is the index of the same vertex in the current mesh. If vi has been deleted, rnodes(vi) is zero. Similarly for redges and rcells. The ordering of indexes is assumed to be unchanged. rnodesmap, redgesmap, rcellsmap are boolean maps of the same information in rnodes, redges, rcells. At least one of rnodes or rnodesmap must be supplied; if only one is, the other will be computed from it. The same applies to redges and redgesmap, and rcells and rcellsmap.

replaceNodes.m

m = replaceNodes( m, newm ) Replace m.nodes and m.tricellvxs by newm.nodes and newm.tricellvxs. If newm has prismnodes, replace that also.

requestStagesItem_Callback.m

rescaleSpaceTime.m

m = rescaleSpaceTime( m, spaceunitname, spacescale, timeunitname, timescale ) Choose new units for space and time. m is physically unchanged by this, and therefore its growth behaviour should be unaltered. We could refrain from changing m at all, and merely store the factors that convert between internal units and units displayed to the user. However, it is useful to actually rescale m itself, as a check on the invariance of our calculations to such rescaling. The new space unit is spacescale old units. Therefore all of the numbers that represent distances or positions must be divided by spacescale. Areas must be divided by spacescale^2. Gradients must be multiplied by spacescale. The new time unit is timescale old units. Therefore every numerical time must be divided by timescale. Every rate of change must be multiplied by timescale. Every decay rate must be raised to the power timescale. Every growth rate g should in principle be replaced by (1+g)^timescale - 1; when g is small, this is close to g*timescale. Elasticity coefficients are scale-free. Diffusion constants must be multiplied by timescale/spacescale^2.

resetGlobals.m

resetInteractionHandle.m

m = resetInteractionHandle( m, msg ) Get a handle to the interaction function. This should be called whenever M has been loaded from a file or a new interaction function has been created.

resetView.m

fprintf( 1, '%s\n', mfilename() );

resetView_ButtonDownFcn.m

resetVisibility.m

resetVisibility( handles ) Set the proper visibility of all GUI items. Required when print() corrupts the GUI by making everything visible.

restoreflatness.m

restorethickness.m

retimeSR.m

q = retimeSR( q0, T0, T ) Solve 2(1-q)/T(1+q) = 2(1-q0)/T0(1+q0) for q.

reverseGrowth.m

rewriteInteractionSkeleton.m

ok = rewriteInteractionSkeleton( m, newIFname, newIFdir, msg ) Regenerate the interaction function for M. JAB removed requirement for a leading \n since some editors insert spaces automatically Also, it seems that some versions of Matlab return tokenExtents as a cell array of one element from which the matrix must be extracted.

rimEdges.m

re = rimEdges( m ) This returns information about the edges on the rim of the mesh. re is an N*2 array of the vertex indexes of those edges. ei is a list of the edge indexes. ci is a list of the indexes of the cells they belong to. For each pair of vertexes in ri, they are ordered consistently with their ordering as vertexes of the corresponding cell. The edges are listed in no particular order.

rollzero_ButtonDownFcn.m

rotateAllTensors.m

rotateElastMatrix.m

rotD = rotateElastMatrix( D, J ) D is an elasticity tensor in 6-matrix form. The result is the rotation of D by J, a rotation matrix.

rotateGNglobal.m

g = rotateGNglobal( g, R ) g is a set of 36 vectors as a 3*6*6 matrix, as returned by computeCellGNGlobal. R is a 3*3 rotation matrix. This procedure rotates all the vectors in g by R. NEVER USED.

rotateGrowthTensor.m

rotD = rotateGrowthTensor( D, J ) D is a rank 2 tensor in either 3*3 matrix or 1*6 vector form. The result is the rotation of D by J, a 3*3 rotation matrix in column vector form. Otherwise put, D is the expression of the growth tensor in the frame J, and the result is the growth tensor represented in the global frame. D may also be 3*3*N or N*6, in which case the transformation is applied to every component 3*3 or 1*6 slice.

rotateK.m

k = rotateK( k, R ) Rotate the K matrix by a rotation R in column vector form.

rotateXYZ.m

rotatemesh.m

m = rotatemesh( m, rotmatrix, euleraxes ) Rotate the mesh about the origin by the given matrix. If ROTMATRIX is a 3*3 matrix, EULERAXES is ignored. If ROTMATRIX is a vector of one, two, or three numbers, it is interpreted as a set of Euler angles, about axes specified by EULERAXES. EULERAXES is a string of characters of the same length as rotmatrix, consisting of 'X', 'Y', or 'Z'.

rotmatTo6mat4.m

J6 = rotmatTo6mat4( J ) Convert a 3*3 rotation matrix to 6-matrix form, suitable for rotating elasticity tensors in 6-matrix form. The following two expressions should give identical results (apart from rounding error), where s is a symmetric 3*3 matrix and m is a 3*3 rotation matrix: make6vector( s ) * rotmatTo6mat4( m ) make6vector( m' * s * m ) In fact, they give identical results when m is any 3*3 matrix, although the interpretation of m'*s*m as a transformation of a symmetric tensor no longer applies.

rounddec.m

stolen from Peter J. Acklam Erika 30.01.2009

runToButton_Callback.m

runUntilButton_Callback.m

run_Callback.m

saturate.m

c1 = saturate( v, c ) c is an RGB colour. v is a vector of N reals. The results is an N*3 array of N colours, being copies of c saturated by each element of v. Where v is 0, the colour is [1,1,1] (white), and where v is 1, the colour is c, with linear interpolation between. There is no check that v or c are within the range 0..1

saveExperimentStagesItem_Callback.m

saveGFtboxConfig.m

saveStaticPart.m

saveStaticPart( m ) If m is the mesh of a project, save its static part.

savedStages.m

stageTimes = savedStages( m ) Return a cell array of the time suffixes of all the stages for which there is a saved state of the mesh, excluding the initial state.

scalegraph.m

MESH = SCALEGRAPH(MESH,SCALE) Scale a mesh by a real number.

scalevec.m

v = scalevec( v, newmin, newmax ) Scale the entries of the vector so they span the range between min and max. If all the entries are equal, they are all set to min.

scalevecs.m

vs = scalevecs( v, len ) Scale the row vectors in vs so that the longest has length len.

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\growth\secondlayer

addRandomSecondLayerCell.m

mesh = addRandomSecondLayerCell( mesh, ... diameter, axisratio, numsides, cloneindex, ... ci, newci, allowoverlap, cellcolor ) Add a second layer cell at a random position within the FEM cell ci. If ci is omitted, a random FEM cell will be chosen. The index of the new cell will be newci; by default, this will be 1 more than the number of existing second layer cells. The new cell will have NUMSIDES sides. DIAMETER is the diameter of the cell, in absolute units. If allowoverlap is false, it will not create the new cell unless it does not overlap any existing cell.

addRandomSecondLayerClump.m

mesh = addRandomSecondLayerClump( mesh, sz, ci, newci ) Add a second layer clump of seven cells at a random position within the finite element ci. If ci is omitted, a random finite element will be chosen. The index of the new cells will start at newci; by default, this will be 1 more than the number of existing second layer cells.

allocateCells.m

calcCloneVxCoords.m

m = calcCloneVxCoords( m, vxs ) Calculate the 3D coordinates of a list of clone vertexes and install them in the mesh.

calcEdgeData.m

secondlayer = calcEdgeData( secondlayer ) Calculate secondlayer.edges and secondlayer.cells(:).edges from the other information in secondlayer. This requires: secondlayer.cells(:).vxs secondlayer.vxFEMcell (only to get number of vertexes) This produces: secondlayer.cells(:).edges secondlayer.edges

checkclonesvalid.m

ok = checkclonesvalid( secondlayer ) Make consistency checks of secondlayer.

completesecondlayer.m

m = completesecondlayer( m ) This takes a mesh having a second layer containing only the components cells(:).vxs(:) vxFEMcell(:) vxBaryCoords(:,1:3) cell3dcoords(:,1:3) and calculates all the rest.

deleteBoringCells.m

secondlayer = deleteBoringCells( secondlayer ) Delete all second layer cells which are not either shocked or share an edge with a shocked cell.

deleteCellsInFEs.m

secondlayer = deleteCellsInFEs( secondlayer, badFEmap ) This deletes every second layer cell, any vertexes of which lie in any of the finite elements listed in badFEs. This is called by deletecell, which deletes finite elements.

deleteCellsOnBadEdges.m

m = deleteCellsOnBadEdges( m, badedges ) Delete every biological cell which crosses any edge of the finite element mesh listed in badedges. badedges can be a bitmap or an array of indexes. We use a conservative test: every biological cell that has vertexes in two cells joined by a bad edge is deleted. It is possible that a cell is deleted unnecessarily. WARNING: this test is not conservative enough. It is possible for a bio cell to contain vertexes straddling a seam edge, but without it containing vertexes in both of the cells directly bordering the edge.

deleteFemToSecondLayer.m

secondlayer = deleteFemToSecondLayer( secondlayer, oldToNewFEMCell ) After deleting cells from the FEM layer of a mesh, call this to delete every secondlayer cell which has a vertex in any of the deleted FEM cells. oldToNewFEMCell maps old FEM cell indexes to new FEM cell indexes, mapping the deleted cell indexes to zero.

deleteSecondLayerCells.m

secondlayer = deleteSecondLayerCells( secondlayer, cellsToDelete ) cellToDelete is a bitmap of the cells to delete from the second layer.

doSecondLayerClick.m

dumpsecondlayer.m

findBaryPoint.m

[ ci1, bc1 ] = findBaryPoint( mesh, ci, bc ) Given barycentric coordinates bc in cell ci, with one or more negative values, find a point in a neighbouring cell which most closely approximates the given point. UNFINISHED.

findCloneVxCoords.m

mesh = calcFEMcoords( mesh, vxs, mode ) Calculate the 3D coordinates of a list of clone vertexes. If mode==0, the calculation is done on the mid-plane of the FEs. If mode==-1 it is done on the A side, and if mode==1, the B side.

findFEMCell.m

[ ci, bc, bcerr, abserr ] = findFEMCell( m, p, hint ) Find the FEM cell which p is closest to lying inside, and the barycentric coordinates of p in that cell. err is the difference between the resulting point and p. hint is a list of FEM cells to try first. If p does not appear to be in any of them (i.e. its barycentric coordinates are not all positive), then all cells sharing any vertexes with the hint cells are tried.

findbioedgepoint.m

p = findbioedgepoint( m, ci, edgepoint ) m is a mesh and ci is the index of one of its biological cells. ei is an index of an edge of ci. If the vertexes of the endpoints of the edge are at v1 and v2, then p is set to v1*r2 + v2*r1. r2 defaults to 1-r1, giving a weighted average of the two points. If r1=-1 and r2=1, this gives v2-v1, the vector along the edge.

fixSecondLayer.m

m = fixSecondLayer( m, biovxs, hint ) biovxs is a list of biological vertexes lying in cells of m that have just moved. This function recomputes their coordinates, using hint as a list of places to look in first.

hasSecondLayer.m

hexbc.m

bc6 = hexbc( bc, d ) Return the barycentric coordinates of a hexagon centred on bc with radius d.

loadsecondlayer.m

m = loadsecondlayer( x, fi ) Load the Bio-A layer from Andy's data structure.

makeCellGrid.m

m = makeCellGrid( m, spacing ) Create a cellular layer in the form of a regular square grid. The mesh m is assumed to be flat or nearly so.

makeExternCells.m

m = makeExternCells( m, vertexdata, celldata, add ) Create the biological layer from vertexdata, an N*3 array giving the three-dimensional positions of all the vertexes, and celldata, a cell array, each member of which is the list of vertex indexes for one cell. If add is true then the cells will be added to any existing biological layer, otherwise they will replace it.

makeFullSecondlayer2.m

m = makeFullSecondlayer2( m, r ) Create a new second layer for a mesh. R is the refinement, but is not implemented.

makeVoronoiBioA.m

m = makeVoronoiBioA( m, numpoints ) Generate a bio-A layer by the Voronoi method. This only applies if the mesh is flat in the XY plane or nearly so. The layer will contain numBioCells cells.

makeedgedata.m

s = makeedgedata( s ) Given a second layer s containing just the cell vertex index data, construct the cell edge data.

makesecondlayercolorparams.m

cp = makesecondlayercolorparams( colors, colorvariation ) Given an N*3 array of RGB colours and an amount of colour variation expressed in HSV space, calculate an N*6 array, each row of which contains two HSV colours, being the original colours converted to HSV, plus and minus the variation.

mgenPerCell.m

Calculate the average value of the given named morphogen over a given biological cell.

newemptysecondlayer.m

sl = newemptysecondlayer() Create a second layer containing no cells.

numcellsBioA.m

n = numcells( sl ) Find the number of cells in the bio-A layer.

perturbBaryCoords.m

bc1 = perturbBaryCoords( bc ) Randomly perturb the given barycentric coordinates, while keeping them all in the range 0..1 with sum equal to 1.

perturbSecondLayer.m

m = perturbSecondLayer( m, amount ) Randomly move every second-layer vertex by the given amount. The amount is a proportion of the barycentric coordinates.

plotSecondLayerCell.m

ph = plotSecondLayerCell( ci, cellpts, ax, cellcolor ) Plot a single cell of the second layer and return its handle. Arguments are the index of the cell, its vertexes, and its colour.

replaceEdgeEnd.m

e = replaceVertex( e, v1, v2 ) e contains a pair of vertexes. v1 is assumed to equal one element of e. Its occurrence is replaced by v2, and the result is sorted. All other elements of e are undisturbed.

ringbc.m

bcs = ringbc( bc, r, n ) Return the barycentric coordinates of an n-gon centred on bc with radius r.

secondlayerSplitFE.m

secondlayer = secondlayerSplitFE( secondlayer, splitinfo ) The positions of second layer vertexes are defined by the finite element they lie in, and their barycentric coordinates within the element. When a finite element is split by splitalledges, each second layer vertex lying within it must be assigned to one of the descendant finite elements, and its barycentric coordinates with respect to that cell computed. That is done by this function. splitinfo is an array built by splitalledges. It contains one row for every finite element vertex, with six elements [ ci1, ci2, ci3, nc1, nc2, nc3 ]. ci1, ci2, and ci3 are the indexes within the cell of the edges of that cell that were split. If only two edges were split, ci3 is zero, and if only one edge, ci2 is also zero. nc1, nc2, and nc3 are the indexes of the new cells. If only two edges were split, nc3 is zero, and if only one edge, nc2 is also zero. The edges and cells are listed in a canonical order, for which see how they are computed in splitalledges.

secondlayercolor.m

setSecondLayerColorsByArea.m

setSplitThreshold.m

mesh = setSplitThreshold( mesh ) Set the split threshold to be the given multiple of the maximum cell diameter.

splitFEMcell.m

secondlayer = splitFEMcell( secondlayer, femCell, newFemCell, edge ) Recalculate the parent cell and barycentric coordinates when the FEM cell with index femCell splits on the specified edge, with the new cell index newFemCell. The edge is specified by splitv1 and splitv2, which are the FEM vertexes at either end of the split edge, with splitv1 belonging to the old FEM cell and splitv2 belonging to the new FEM cell.

splitSecondLayer.m

m = splitSecondLayer( m ) Split the second layer components where necessary. If m.globalProps.bioAsplitcells, cells larger than a certain size will be split; otherwise, edges longer than a certain amount will be split.

splitSecondLayerCells.m

m = splitSecondLayerCells( m ) Split all second layer cells satisfying certain criteria. If SPLITALL is true, all cells will be split. Otherwise, the choice depends on cell size.

splitSecondLayerEdges.m

m = splitSecondLayerEdges( m ) Split edges of the second layer that are longer than a certain amount.

splitclonecell.m

m = splitclonecell( m, ci, v ) Split cell ci perpendicular to direction v, through splitpoint. splitpoint defaults to the centroid of the vertexes.

splitcloneedge.m

[ vi, bc ] = splitcloneedge( mesh, ei, a, b ) Given a second layer edge ei that is to be split, return the FEM cell and barycentric coordinates of the new point.

spreadBioAtoEdge.m

m = spreadBioAtoEdge( m ) Assuming that the bio-A layer is intended to cover the entire mesh, force it to do so by moving every vertex on the edge of the bio-A layer to the nearest edge of its cell. This is just a special hack to fix a particular mesh and should not be generally used.

selectCurrentTool.m

selectMgenInMenu.m

selectPanel.m

selectProjectMenu.m

separateDFs.m

[x,y,z] = separateDFs( dfs )

setAbsoluteThickness.m

m = setAbsoluteThickness( m, thickness ) Set the current absolute thickness of the mesh everywhere. The thickness parameters are not affected. This procedure should only be used when thickness is implemented physically.

setCheckboxesFromMesh.m

setComponentInfo.m

setDisplayedGrowthMenuStrings.m

setElasticity.m

setFlag.m

--- help for BioMap/setFlag ---

SETFLAG set the 'Flag' property of a BioMap object. SETFLAG(OBJ, Y) sets the 'Flag' property of a BioMap object OBJ to Y. Y must be a numeric array. SETFLAG(OBJ, Y, X) sets the 'Flag' property of the elements indexed by X in a BioMap object OBJ to the value Y. Y must be a numeric array. X can be an array of positive integers, a logical array, or a cell array of strings corresponding to valid 'Header' values. NOTE: SETFLAG(OBJ,...) without assigning to a variable does not modify the object's property. Use OBJ = SETFLAG(OBJ,...) to modify OBJ. Examples: % Create a BioMap object with the first 10 elements of the structure s. s = samread('ex1.sam'); obj = BioMap(s(1:10)); % Create copies of obj and set the 'Flag' value of the second element to zero. out1 = setFlag(obj, 0, 2) out2 = setFlag(obj, 0, {s(2).QueryName}) out3 = setFlag(obj, 0, [false true]) % Set the first and third values of 'Flag' in obj. obj = setFlag(obj, [0 0], [1 3]) % Set all 'Flag' values in the object to 1. y = ones(1, obj.NSeqs); obj = setFlag(obj, y) See also BIOMAP, BIOMAP/GETFLAG, BIOMAP/SET.

Reference page in Help browser doc BioMap/setFlag

setGFtboxBusy.m

wasBusy = setGFtboxBusy( handles, isBusy ) Set the busy flag and return its previous value. To ensure that the busy flag displays during execution of a block of code, bracket it like this: wasBusy = setGFtboxBusy( handles, true ); ...your code... setGFtboxBusy( handles, wasBusy ); This ensures that whatever value it had previously is restored.

setGUIColors.m

setGUIColors( h ) h is a handle to a GUI object. This routine crawls over h to determine the parent-child relations, then colours the background of items according to their depth in the tree. The figure background is given the backColor, and successively nested panels are given colours tending towards the foreColor.

setGUIMgenInfo.m

setGUIMgenInfo( h ) Cause the GUI to display values relating to a given morphogen. If no mgenIndex is specified, get it from the displayedGrowthMenu item. If there is no mesh, restore default values.

setGUIPlotBackground.m

setGlobals.m

setInitialThickness.m

m.globalProps.thicknessRelative = 0.5; % ... m.globalProps.initialArea^((1 - m.globalProps.thicknessArea)/2) ... / size(m.tricellvxs,2);

setInteractionModeFromGUI.m

setMatlabViewParams.m

setMeshDefaultFields.m

m = setMeshDefaultFields( m ) Given a mesh which may be lacking some of its fields, fill in all the missing ones with default values. There are two reasons for fields to be missing. The mesh may be an old one that needs to be upgraded to the current version of GFtbox, or it may be a newly created one, that has nothing but its geometry present.

setMeshFigureTitle.m

setMeshMultiView.m

setMeshParams.m

fprintf( 1, '%s\n', mfilename() );

setMeshViewFromPicture.m

setMorphogenPanelLabelX.m

setMultiView.m

setMyLegend.m

setNewThickness.m

m = setNewThickness( m, th ) th is a vector of real numbers, one per vertex of the mesh. This routine sets the thickness of the mesh at each vertex to be the corresponding value of th. For this to be effective, m.globalProps.physicalThickness should be set to true.

setNumMorphogens.m

mesh = setNumMorphogens( mesh, n ) Set the number of morphogens of the mesh, either discarding excess morphogens or creating new ones.

setOurViewParams.m

setParPerpMode.m

setPictureColor.m

m = setPictureColor( m, c ) Set the background colour to c, and the foreground colour (the colour of the axes, the legend, etc.) to a colour contrasting with c.

setPictureColorContrast.m

setPictureColorContract( pichandles, c ) Set the background colour to c, and the foreground colour (the colour of the axes, the legend, etc.) to a colour contrasting with c.

setPlotBackground.m

setPlotQuantity.m

setRunColor.m

setRunning.m

setSecondLayerColorInfo.m

m = setSecondLayerColorInfo( m, colors, colorvariation ) Set the colour range for the second layer. This information must be stored in m.globalProps, not m.secondlayer, since it needs to exist even when there is no second layer. colors must be either empty (to get the default green/red colours), a single colour (which will be complemented to get the shocked color), or a pair of colours as a 2*3 matrix. colorvariation is a real number, expressing the amount of random variation allowed for cells nominally of the same colour. The default is 0.1.

setThickness.m

setToolboxName.m

setVertexThicknesses.m

setVertexThicknesses( m, vt ) Set the thickness of m at every vertex. vt is an N*1 array, where N is the number of vertexes of the finite element mesh. SEE ALSO: vertexThicknesses

setViewFromMesh.m

setWaypointTextItems.m

setaxisrangeFromDialog.m

setbowlz.m

M = SETBOWLZ(M,Z) Apply bowl-shaped z-displacement of the mesh.

setconstantfield.m

mesh = setconstantfield(mesh,amount,whichGrowth, add) Set or add constant growth factor for all points.

setedgegrowth.m

setemptymesh.m

setinternalrotation.m

m = setinternalrotation( m, angle )

setlengths.m

MESH = SETLENGTHS(MESH) Set the lengths of all the edges.

setlengthscale.m

mesh = setlengthscale( mesh ) Set mesh.globalProps.lengthscale to the largest diameter of the mesh along the x, y, or z dimensions. This uses the prismnodes data if it is valid, otherwise the nodes data.

setlinearfield.m

mesh = setlinearfield( mesh, maxgf, whichGrowth, direction, add ) Set a field of growth factor with a linear gradient in a given direction.

setmeshfromnodes.m

m = setmeshfromnodes( newmesh, oldmesh ) Complete a mesh structure which only has tricellvxs and either nodes or prismnodes defined. If oldmesh is provided, it is assumed to be a complete mesh structure, and as much information as possible is reused from it.

setmeshgeomfromnodes.m

m = setmeshgeomfromnodes( m ) Given a mesh containing only nodes and tricellvxs, construct the rest of its geometrical and topological information.

setradialfield.m

MESH = SETRADIALFIELD(MESH,INCR,CENTRE) Set growthfactor for all points.

setrestlengths.m

mesh = setrestlengths(mesh) Set resting lengths to current values.

setrestsprings.m

m = setrestsprings( m ) Set the rest lengths and angles of all the springs to their current values. If onlylength is supplied and is true (the default is false), then rest angles and hinge strengths will be set to zero.

setsaddlez.m

MESH = SETSADDLEZ(MESH,Z) Apply saddle-shaped z-displacement of the points in P.

setscalebarsize.m

setstruct.m

setzeroz.m

m = setzeroz( m ) Set z coordinates of the mesh to zero.

shapeN.m

n = shapeN( p ) Calculate the shape functions for a triangular prism at isoparametric coordinates p. p can be a column vector for a single point, or a matrix with one column for each point.

sharedEdge.m

[ eci1, eci2 ] = sharedEdge( mesh, ci1, ci2 ) Determine the cell-edge indexes of the edge common to the two cells. Zero if no common edge.

simRunningDialog.m

simStatusString.m

s = simStatusString( m ) Make the report of leaf size, number of iterations, etc. and return it as a string.

simtrumpet.m

fn_arclen( maxs ) Simulated trumpet growth.

singlestep_Callback.m

--- Executes on button press in singlestep. hObject handle to singlestep (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)

sixMatrix.m

M6 = sixMatrix( M3 ) M3 is assumed to be a 3*3 rotation matrix. This function returns the corresponding 6*6 matrix for transforming a tensor written in 6-vector form. NEVER USED. Not known if this is correct regarding the issue of doubling the off-diagonal elements.

sm.m

snapdragonmesh.m

m = snapdragonmesh( petals, radius, rings, height, nbase, nrows ) Make a snapdragon flower. The resulting mesh contains only the following components: nodes, tricellvxs, prismnodes, globalProps.trinodesvalid, globalProps.prismnodesvalid, and borders.{bottom,left,right}.

solve22.m

s = solve22( A, B, C, D, E, F ) Solve the equations ( A B ) ( E ) ( ) s = ( ) ( C D ) ( F )

split2dinterior.m

split2dinterior( edges ) Given a set of unit 2D vectors listed in clockwise order, determine whether this is an opportunity to split the vertex at the centre.

splitAlongEdges.m

m = splitAlongEdges( m, eis ) Split every triangle containing any of the edges in eis into four.

splitBadNodes.m

m = splitBadNodes( m, ang ) Find nodes with incident angles of less than ang, and split as many as possible.

splitSeams.m

m = splitSeams( m ) Split the mesh along its seams. Each vertex on the seam gets S-E new copies, where S is the number of seam edges it lies on and E is 0 for vertexes on the edge of the mesh and 1 elsewhere. Each seam edge becomes two edges, except for seam edges, both of whose ends fail to split. Those seam edges don't split at all and should be removed from the seams.

splitalledges.m

m = splitalledges( m, es, force ) Split all the edges in the list es. If force is true, all the specified edges are split, otherwise an edge will not be split if doing so would make either a cell or an angle too small.

splitchain.m

[ch1,ch2] = splitchain( ch, e1, e2 ) CH is the chain of edges and cells around a node of a mesh. E1 and E2 are edges occurring in that chain. CH1 is set to the subchain from E1 to but not including E2, while CH2 is set to the rest of the chain.

splitcornertouch.m

m1 = splitcornertouch( m ) Wherever there is a node that belongs to cells that share no edges, split that node into as many copies as it takes to eliminate such corner contacts.

splitnode.m

m = splitnode( m, v1, cp1, bc1, cp2, bc2, e1, e2 ) Split node vi of mesh m. The new points are at barycentric coordinates of bc1 in cell cp1 and bc2 in cell cp2. e1 and e2 are the edges of vi which are to be split. e2 is zero if and only if v1 is on the edge of the mesh. If cp1==0, then bc1 is ignored and the first new point coincides with the old point. If cp2==0 then bc2 is ignored and the second new point coincides with the old point.

springEquilibrate.m

m = springEquilibrate( m, iters, frac )

springdisplacementR0.m

d = springdisplacementR0( nodes, edgeends, restlengths, springconst, dt ) Given a set of balls and springs described by NODES, EDGEENDS, RESTLENGTHS, and SPRINGCONST, calculate the displacement of the balls in time DT, assuming that they are immersed in aviscous medium in which the effect of a constant force is to produce a constant velocity equal to that force. The midpoint method is used for the numerical integration.

springforces.m

asd = springforces( m, onlylength ) Calculate the force on each node resulting from the springs of m.

springforces2D.m

[nodeforces,stretches] = springforces2D( nodes, edgeends, restlengths, springconst ) NODES is the set of 2D positions of a set of nodes. EDGEENDS is a list of pairs of nodes. RESTLENGTHS is a vector of floats one for each edge, defining the rest length of that edge. SPRINGCONST is a single number, the spring constant of all the springs. NODEFORCES is the set of resulting forces on the nodes. STRETCHES is a vector of floats, one for each edge, which is the amount by which each edge is stretched from its rest length.

squareadj.m

MESH = SQUAREADJ() Make a triangulated square.

stageMenuItemCallback.m

Find and load the state corresponding to the menu item

stageStringToReal.m

stageTagToString.m

stageTextToTime.m

t = stageTextToTime( s ) Convert a stage suffix of the form 0123d456 to a number 123.456. s may be a cell array, in which case t will be an array of floats. See also: stageTimeToText.

stageTimeToText.m

s = stageTimeToText( t ) Convert a number T to a stage label S. T is converted to a string, and padded out to a fixed length with leading and trailing zeros. The decimal point is replaced by a 'd'. If T is a list of numbers, s will be a cell array of strings. See also: stageTextToTime.

staticBaseName.m

s = staticBaseName( m ) If m is a string, return m concatenated with the static suffix and '.mat.' If m is a mesh, do the same with the model name, provided that m belongs to a project; if not, return the empty string.

stepinternalrotation.m

m = stepinternalrotation( m )

stereoParamsDlg.m

Begin initialization code - DO NOT EDIT

stitchmesh.m

[m,remapnodes] = stitchmesh( m, is, js ) m contains only m.nodes and m.tricellvxs. Make corresponding nodes in is and js identical. remapnodes is set to the renumbering function: remapnodes(i) is the index in the new m of node i of the original m. The nodes being identified with each other will be moved to their midpoint. WARNING: All of the other 3D geometrical information will be recalculated.

stitchmeshes.m

[m,renumber] = stitchmeshes( m1, m2, b1, b2 ) Stitch the two meshes together along b1 and b2. b1 and b2 are lists of node indexes of the same length, of m1 and m2 respectively. The mesh m2 will be translated, rotated and scaled to bring the b2 nodes into coincidence with the b1 nodes. renumber will be set to an array such that renumber(i) is the index in the stitched mesh of node i of m2. The indexes of nodes in m1 are preserved.

stopButton_Callback.m

--- Executes on button press in stopButton.

stopMovie.m

storeCodeRevInfo.m

strainEnergy.m

e = strainEnergy( strain, elasticity ) Compute the energy resulting from the strain and elasticity. Strain is a column 6-vector representing a 3*3 matrix, and elasticity is a 6*6 matrix. The result is strain'*elasticity*strain.

stresscolormap.m

stripmesh.m

m = stripmesh( m, level ) Remove from m all data that can be reconstructed from the remainder. LEVEL can take three values: 0: (the default) Only delete information that is perfectly reconstructable. 1: In addition, delete certain information that will be zeroed out when the mesh is reinflated. This information consists of: residual strain ... 2: Delete as much information as possible, on the assumption that the resulting data structure will only be used for visualising this state of the mesh, and will not be used for further computation. See also: INFLATEMESH.

subdivideedge.m

subdivideedgePoints.m

suffixStringToItemString.m

tailLogFile.m

copy project to cluster (without movie directory)

tempdiff.m

temperatures = tempdiff( nodecoords, cellvertexes, conductivity, ... absorption, production, temperatures, transportfield, dt, ... lengthscale, fixednodes, cellareas ) Perform a finite-element computation of thermal diffusion. nodecoords is a numnodes*3 array of coordinates. cellvertexes is a numcells*3 array of node indexes: each row lists the node indexes of the three vertices of the cell. conductivity is one of the following: * A single number. This is the uniform isotropic thermal conductivity (divided by the specific heat). * A vector of numbers, equal in length to the number of finite elements. This is the non-uniform isotropic thermal conductivity. * A 3*3*N matrix, where N is the number of finite elements. This is the anisotropic thermal conductivity for each finite element, expressed in the global frame of reference. temperatures is a vector of numnodes elements, giving the current temperature at each node. transportfield contains a vector for every finite element, giving the direction and rate of flow of the substance in that element. If this is empty, there is no transport. dt is the time interval: the result is the vector of new temperatures after a time dt has elapsed. lengthscale (UNUSED) should determine the distance the substance diffuses for a given conductivity and time interval. fixednodes is a list of those elements of the temperature vector whose values are assumed to be fixed.

tempdiff3D.m

temperatures = tempdiff3D( nodecoords, cellvertexes, conductivity, ... absorption, production, temperatures, transportfield, dt, ... lengthscale, fixednodes, cellareas ) Perform a finite-element computation of thermal diffusion on a 3D mesh. nodecoords is a numnodes*3 array of vertexes. cellvertexes is a numcells*6 array of node indexes. Each row lists the vertexes of one FE in a standard ordering. The A side is [1 2 3], the B side is [4 5 6], the edges from A to B are [1 4], [2 5], and [3 6], and the sense is such that the outward normal from B satisfies the right-hand rule.

tensorComponents.m

[Glocal,J] = tensorComponents( Gglobal ) Gglobal is a growth tensor represented as a 3-vector or a 6-vector. Glocal is set to the three principal components of growth in descending order and J to the corresponding orthonormal frame. The columns of J are the principal axes of the tensor.

tensorsFrom3Displacements.m

tensorsFrom3Displacements( vxs, d ) vxs in an array of three row vectors, being points in 3D space. d is a set of displacements of these points. G is set to a pair [g1,g2] of the principal growth components of the displacements, and J is a frame whose first two axes are the principal directions of growth and whose third is perpendicular to the triangle.

tensorsFromDisplacements.m

[G,Gbend,J] = tensorsFromDisplacements( vxs, d ) NEVER USED.

testRotE.m

testcallback.m

stop = testcallback(m) Callback function for passing to mycgs().

testfeapfile.m

valid = testfeapfile(filename) Load the FEAP file and check its validity.

testhavejava.m

testhist.m

testrkmesh.m

TESTRKMESH(N) Run RKMESH with a predefined set of arguments.

testsliders.m

teststructs.m

profile on;

testtensors.m

textdisplayDlg.m

Begin initialization code - DO NOT EDIT

timeunitDlg.m

Begin initialization code - DO NOT EDIT

toggleFixedCell.m

torture.m

totalGrowth.m

g = totalGrowth( G ) Return the total growth given by the growth tensor G in 6-vector form. This is the determinant of the matrix representation of G.

totalK.m

[m,U,K,F] = totalK( m, useGrowthTensors ) Solve the FEM model for the mesh. The mesh already contains the temperature at each node and the residual displacements of the nodes. After the computation, the mesh will contain the new positions of all the nodes. The additional results are: U: the displacements applied to all the nodes. If the computation fails in a manner that renders U non-meaningful, U will be returned as empty. K: The assembled K matrix for the FEM computation. F: The assembled force vector for the FEM computation. The mesh is additionally assumed to have the following components: m.gaussInfo: the Gauss quadrature points for a single cell in isoparametric coordinates, and the values and gradients of the shape functions at those points. m.D: the compliance matrix in global coordinates. This will eventually be replaced by data per cell. If useGrowthTensors is true (default is false) then growth tensors have been specified for each cell. Otherwise they are calculated from the morphogens.

totalStrainEnergy.m

e = totalStrainEnergy( m ) Compute the total strain energy due to the residual strains in the mesh m.

traceStreamline.m

m = traceStreamline( m, ci ) Start a streamline from the centre of the finite element ci. Continue it in both directions until it either hits the edge of the mesh, is reflected back into the FE it just came from, or hits a cell with no gradient.

transferEdgeBC.m

[cj,bc] = transferEdgeBC( m, ci, bc ) Given barycentric coordinates bc of a point on an edge of a cell ci of m, find the barycentric coordinates of the same point relative to the cell on the other side of the same edge. If there is no such cell, cj is returned as zero.

translatemesh.m

transportvectors.m

tv = transportvectors( m, mi ) Calculate the global transport field for morphogen mi, from the local transport field stored in m.transportfield{mi}.

treeimage.m

triangleIndexes.m

n = triangleIndexes( p ) Calculate the set of triangle node indexes corresponding to the given prism node vertexes.

trianglegradient.m

g = gradient( vertexes, values ) vertexes is a 3*3 matrix of vertex coordinates of a triangle, one vertex in each row. values is a vector of the values that a variable has at each of those vertexes. The result is the gradient vector of that quantity over the triangle, in the global frame.

trimframe.m

f = trimframe( f, sz ) Force the movie frame f to have the given size sz (a two-element vector). If the frame is too big, chop pixels off the edges. If it's too small, pad it out with bgcolor. Maintain the centering of the frame.

truncateCells.m

[vvxs,vcells] = truncateCells( mesh, vvxs, vcells ) Modify the Voronoi tessellation representated by [vvxs,vcells] so that the cells are confined to the FEM cells containing the Voronoi generators. We ignore all cells that include the point at infinity (since we cannot determine the direction of any edge from a finite point to [Inf Inf]). The point at infinity is assumed to be the first vertex in vvxs.

tryElideEdge.m

[m,numElided] = tryElideEdge( m ) Attempts to find an edge of m to elide. It first assesses the quality of each edge (the minimum angle of the cells incident on it), arranges those falling below a threshold in increasing order, and then attempts to elide each one in turn until one succeeds. Elision fails if either it would result in an invalid mesh, or if it would reduce the quality of any cell to a value below the threshold.

trysplit.m

[ m, didsplit ] = trysplit( m ) Split all edges which are longer than the threshold for splitting. Split them in descending order of length. Also split cells bordering an edge where the angle has changed by too much.

ttygrid.m

unfinishedSeams.m

vxs = unfinishedSeams( m ) Find the ends of unfinished seams of m. These are the vertexes lying on exactly one seam and not on the edge of the mesh.

unionmesh.m

m = unionmesh( varargin ) Set m to be the union of the given meshes. The meshes are assumed to be raw, i.e. only nodes and tricellvxs are defined. The same will be true of the result.

unitcellnormal.m

unitnormal = unitcellnormal( m, ci ) Calculate the unit normal vector to element ci of the mesh. The length of the vector is twice the area of the cell. ci can be a vector; the result will be an N*3 array.

unitsfig.m

Begin initialization code - DO NOT EDIT

unixcluster.m

errors=unixcluster(s,m,copymove,filename) Issue the unix command s to the cluster, annotated with the message m. If the command contains the string 'pscp', and copymove is 'move', then filename will be deleted from the cluster. Otherwise, copymove and filename are ignored. J.A.Bangham, 2008

unselectProjectMenu.m

updateAziElScrollFromView.m

updateCreateMorphogensDialog.m

updateElasticity.m

updateFEpolarisation.m

m = updateFEpolarisation( m, w, normalise, alph, generalV ) Replace each polarisation vector by a weighted average of it, its neighbours, and GENERALV. w is the amount of neighbour influence, and alph the amount of general influence, both in the range 0..1.

updateGUIFromMesh.m

h = updateGUIFromMesh( h ) Updates every GUI element that displays a property of the mesh, to be consistent with h.mesh. When h.mesh is empty, it clears all settings to their defaults. If h is a mesh then h will be set to guidata(h.plotdefaults.hfigure). h.plotdefaults.hfigure is assumed to be a GFtbox window. If it does not recognise what h is, it will do nothing.

updateMgenElasticity.m

updateProjectMenuHighlights.m

updateProjectMenuHighlights( handles, selectedDir ) Update the peoject menu highlights so the the path leading to selectedDir is highlighted and all other items are unhighlighted.

updateRecentProjects.m

handles = updateRecentProjects( handles ) A project has just been loaded. Add its project directory to the Recent Projects menu.

updateSelection.m

m = updateSelection( m, vis, cis, eis, selecting ) Update the selection with the given cell, vertex, and edge indices. If SELECTING is 2, replace the selection by the given objects. If SELECTING is 1, add all the given objects to the selection. If SELECTING is -1, remove all the given objects from the selection. If SELECTING is 0, toggle the state of all the given objects.

updateVRMLdialog.m

updateptsSplitFE.m

[fes,bcs] = updateptsSplitFE( fes, bcs, splitinfo ) The positions of a set of points on the surface are defined by the finite element they lie in, and their barycentric coordinates within the element. When a finite element is split by splitalledges, each point lying within it must be assigned to one of the descendant finite elements, and its barycentric coordinates with respect to that cell computed. That is done by this function. splitinfo is an array built by splitalledges. It contains one row for every finite element vertex, with six elements [ ci1, ci2, ci3, nc1, nc2, nc3 ]. ci1, ci2, and ci3 are the indexes within the cell of the edges of that cell that were split. If only two edges were split, ci3 is zero, and if only one edge, ci2 is also zero. nc1, nc2, and nc3 are the indexes of the new cells. If only two edges were split, nc3 is zero, and if only one edge, nc2 is also zero. The edges and cells are listed in a canonical order, for which see how they are computed in splitalledges.

upgradePlotoptions.m

upgradeStaticData.m

s = upgradeStaticData( s, m ) Upgrade any old version of static data to the current version. m, if present, is assumed to be already upgraded to the current GFtbox version. Missing components of s should be defaulted from m, and failing that, from gGlobalProps and gDefaultPlotOptions.

upgradeVeryOldMesh.m

m = upgradeVeryOldMesh( m ) Bring the mesh up to version 0.

upgrademesh.m

m = upgrademesh( m ) Ensure the mesh M is compatible with the current version of the software.

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\growth\userinteraction

clearInteractionMode.m

m = clearInteractionMode( m ) Clear the interaction mode.

compatibleInteractionMode.m

compat = compatibleInteractionMode( m, clickMode, varargin ) Determine whether the interaction mode specified by the arguments is compatible with the current mode. In general, compatibility requires that the clickMode, and where applicable, the extra arguments, have not changed. The extra arguments have the same significance as in setInteractionMode.

establishInteractionMode.m

m = establishInteractionMode( m, clickMode, varargin ) Set the interaction mode. If the current mode is compatible with the new mode, is should be updated as necessary with the extra arguments. Otherwise, it should be replaced by the new mode. The extra arguments have the same significance as in setInteractionMode.

setInteractionMode.m

m = setInteractionMode( m, clickMode, varargin ) Replace the current interaction mode by that specified by the arguments. When clickMode is 'Current mgen' or 'Fixed mgen', varargin{1} is the index of the selected morphogen, and varargin{2} is the amount.

userinterrupt.m

ui = userinterrupt( sb ) Detect that the user has clicked the stop button. sb is the stop button's graphics handle.

validateChains.m

ok = validateChains( m ) Check the validity of m.nodecelledges, if it exists.

validmesh.m

RESULT = VALIDMESH(M,VERBOSE) Determines whether the mesh is valid. All the connectivity information is checked for consistency. Triangles with very small angles are detected. The morphogen array must be the right size. If VERBOSE is true (default false), messages will be printed to the command window in case of flaws. RESULT will be FALSE if the mesh has fatal errors in it.

vecangle.m

theta = vecangle( a, b ) Return the angle between two row vectors. If n is not supplied, the answer will always be in the range 0..pi. If n is supplied then the answer will be in the range -pi..pi, with the sign positive if the triple (a,b,n) is right-handed and negative if left-handed. a, b, and n can also be N*3 matrices, and theta will be an N*1 vector of angles.

veclen.m

[lensq,len] = veclen(v) Euclidean length and squared length of a vector.

vertexClick.m

This should only be called when the simulation is not running.

vertexThicknesses.m

vt = vertexThicknesses( m ) Calculate the thickness of m at every vertex. The result is an N*1 array, where N is the number of vertexes of the finite element mesh. SEE ALSO: setVertexThicknesses

vertexToCell.m

cellStuff = vertexToCell( mesh, vertexStuff ) Convert a quantity defined per vertex to a quantity defined per cell. The cell value is the average of all the vertex values for vertexes belonging to the cell.

viewScroll_Callback.m

viewWasDragged.m

dragged = viewWasDragged( m ) Discover if the view was changed by dragging in any of m's pictures. If so return true, and set all the drag flags to false.

webify_interaction_function.m

function webify_interaction_function(filename) filename, interaction function filename including suffix J.Andrew Bangham 2011

whoami.m

WHOAMI display user id and retrieve system properties WHOAMI displays a long user id (LID) in the form %time|username|domain|hostname|osarch|osname|osver|MLver WHOAMI optionally returns various system properties including a short user id (SID), which only contains static information about the current system programmers can easily create their own IDs SYNTAX ------------------------------------------------------------------------------- WHOAMI; shows LID in the command window W = WHOAMI; retrieves user/net/cpu IDs only W = WHOAMI(X); retrieves user/net/cpu IDs and system properties INPUT ------------------------------------------------------------------------------- X any number or character OUTPUT ------------------------------------------------------------------------------- W structure with contents according to calling syntax selected fields .sid = short ID without time stamp .lid = long ID with time stamp .res = char array with all system information format: 'fieldname(s): entry' .(fld1:n) = structures of single system properties format: .fieldname(s) = entry NOTE ------------------------------------------------------------------------------- - the JAVA engine must be loaded - system properties are retrieved from java sources InetAddress NTSystem System EXAMPLE ------------------------------------------------------------------------------- whoami; %18-Jun-2008 13:47:52|us|USZ|ws-36362|x86|Windows XP|5.1|7.6.0.324.R2008a w=whoami(1); w.ip % xxx.yyy.192.244 w.file % encoding: 'Cp1252' % separator: '\'

wrapmesh.m

m = wrapmesh( m, r ) m should not contain any components except nodes, prismnodes, globalProps.trinodesvalid, globalProps.prismnodesvalid, and borders. None of these are required. The resulting mesh will have the same components as m.

writeInteractionSkeleton.m

writeMeshInfo.m

Write out the morphogen properties: diffusion, decay, and mutation.

writemeshmsr.m

status = writemeshmsr( filedir, filename, m ) Write the mesh to a file in MSR format.

writemeshobj.m

writemesh( mesh, filedir, filename, surface, minimal ) Write the mesh to a file in extended OBJ format. If minimal is true (default is false), then only the nodes and cells will be written, otherwise everything in the mesh is written. If surface and minimal are both true, the resulting file should be a standard OBJ file, readable by any software that reads OBJ files.

writemeshstl.m

status = writemeshstl( filedir, filename, m ) Write the mesh to a file in STL format.

writemeshvrml.m

status = writemeshvrml( m, filedir, filename ) Write the mesh to a file in VRML 97 format.

zerogrowth.m

mesh = zerogrowth( mesh, mi ) Set the specified growth factors (by default, all of them) to zero, and their production rates and clamp settings.

zsection.m

[vxs,edgeends,colors] = zsection( m, w, windex ) Determine the intersection of m with a plane perpendicular to one of the axes at value w. windex specifies which axis (1=X, 2=Y, 3=Z), by default 3.

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\guilayouts

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\java

plotBulgeProfile.m

## C:\Users\AB\DArT_Toolshed\Toolboxes\GrowthToolbox\testmxmult

time_cgs.m

time_emm.m

time_gels.m

use_culaGels.m

use_culaSgesv.m

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\doc

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\Movies

adjustAgreement.m

agreementDialog.m

analyseHapticPointPlacementTest.m

bezierInterpolation.m

calculateOPTVoxelSize.m

function calculateOPTVoxelSize

chi2TestForHomogeneity.m

function [chi2Stat, expectedValues, testBins] = chi2TestForHomogeneity(observedValues, bins) Description: Performs a chi-squared test for homogeneity on the input matrix. Each row is assumed to be an experiment containing a number of multinomial trials whose outcomes are recorded in the columns which represent the categories outcomes can fall in. The matrix must have at least two rows. Note that this function requires the statistical toolbox to compute the p-value. If the statistical toolbox is not installed a warning is issued and the p-value is empty. Note that the centreBins is assumed to contain the centres of bins and not the edges. This is relevant only if the called function has to combine bins, because it calculates a new centre for combined bins. If on the other hand edges are passed, the result in the testCentreBins will not be correct, however the statistical test is still valid as the bin vector itself is not used in the test. It is only returned to provide additional information. Author: Johann Strasser Date: 2009/06/26

chi2TestForPairwiseHomogeneity.m

function [pValuesForPairs, chi2StatsForPairs, expectedValuesForPairs, ... testObservedValuesForPairs, testBinsForPairs] = chi2TestForPairwiseHomogeneity(observedValues, centreBins) Description: Performs a chi-squared test for homogeneity on all pairs of rows in the input matrix. Each row is assumed to be an experiment containing a number of multinomial trials whose outcomes are recorded in the columns which represent the categories outcomes can fall in. The matrix must have at least two rows. Note that this function requires uses a function that requires the statistical toolbox to compute the p-value. If the statistical toolbox is not installed, the p-values variable is empty. Note that the length of the last three output variables might not be equal due to bins being combined by a lower level function to ensure all expected values are >= 5 Author: Johann Strasser Date: 2009/06/26

chi2TestStatisticForHomogeneity.m

function [chi2Stat, testObservedValues, expectedValues, testCentreBins] = chi2TestStatisticForHomogeneity(observedValues, centreBins) Description: Computes the chi-squared test statistic from a matrix. Each row is assumed to be an experiment containing a number of multinomial trials whose outcomes are recorded in the columns which represent the categories outcomes can fall in. The matrix must have at least two rows. The function checks iteratively from the tails inward whether any expected values along a column is not >= five and combines bins if this is the case. Note that although it checks two adjacent columns at the same time, a broad spike in the tail might prevent it from proceeding further inward to a bin which has expected values smaller than 5. Hence no bins in the interior are being merged. The bin merging procedure was inspired by the poolbins function in file chi2gov. The function returns the chi-squared statistic and the associated test data, which might have bins combined. If bins have not been combined, the returned observed values and bins are identical to the passed arguments. Note that the bins vector is assumed to contain centres and not edges. Other strategies for ensuring the expected values are greater than 5 are to use larger bins before calling this function or to truncate the data/bins before calling this function. Though those approaches are valid they have drawbacks. For instance the former reduces resolution as it smoothes out the distribution and the latter ignores data. Hence it is usually best to rely on the bin mergin procedure in this function. Author: Johann Strasser Date: 2009/06/26

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\demoData

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\demoData\672clippedA128Cubed

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\demoData\cube_128_subCubeHotSpot_x1p0y1p0z1p0

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\demoData\drosophila (291gfp1+txr+vis)_256Cubed

dummyHeader.m

editHapticVolumePointSet.m

function varargout = editHapticVolumePointSet(varargin) Description: Edit points in a volume using hapticTool. Point coordinates are in the volume's local frame Author: Johann Strasser Date: 090330

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\experimentData

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\experimentDataAdjusted

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\experimentTestData

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\experimentTestData2

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\experimentTestData3

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\experimentTestDataOnLaptop_noStereo

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\foreignCode

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\foreignCode\bezierfitlms_aih

bezcurve.m

function [varargout] = bezcurve(varargin) Calculates the points along a Bezier curve. Inputs: ctrl_pts - the control points for the Bezier t - the parameterization (time in this case) Outputs: bpts - the xy points along the Bezier curve defined by ctrl_pts at time t. Example: x = linspace(-1,1,100); y = x.^3 + randn(size(x))/5; pts = [x(:), y(:)]; cpts = bezierfitlms('pts', pts, 'order', 4); bpts = bezcurve('ctrl_pts', cpts, 't', [0:0.001:1]); See also: bezierfitlms Dr. A. I. Hanna (2005) Revision 1: 070821 by Johann Strasser Extended to provide 3D output in case of 3D control points.

bezierfitlms.m

function [varargout] = bezierfitlms(varargin) Calculates the control points for a Bezier curve given some data using a least mean square approach. Note it is important that the point be ordered in terms of a parameterization, i.e. arc length or time. Unordered points will result in a poor fit. Inputs: pts - the Nx2 data that the Bezier should fit to (default = 100 points for a cubic polynomial) order - the order of the Bezier curve (default = 3) verbose - display any output (default = 0) Outputs: cpts - a set of Mx2 control points Example: bezierfitlms('verbose', 1); Example: x = linspace(-1,1,100); y = x.^3 + randn(size(x))/5; pts = [x(:), y(:)]; cpts = bezierfitlms('pts', pts, 'order', 4, 'verbose', 1); plotbezslopes('cpts', cpts, 'parent', gca); See also: bezcurve Dr. A. I. Hanna (2006) Revision 1: 070821 by Johann Strasser Extended to cater for the case of 3D control points.

plotbezslopes.m

function varargout = plotbezslopes(varargin) Plots the slopes of the control points for a bezier curve Inputs: 'cpts' - the control points 'parent' - the axis to draw to (default = gca) Outputs: 'ph' - the plot handles to the slopes cpts = bezierfitlms('verbose', 1); plotbezslopes('cpts', cpts, 'parent', gca); See also: bezierfitlms, bezcurve Dr. A. I. Hanna (2007) Revision 1: 070821 by Johann Strasser Extended to cater for the case of 3D control points.

getCubeQuadFaces.m

function quadFaces = getCubeQuadFaces() Returns the 6 x 4 matrix containing indices into a vertex array.

getCubeVertices.m

function vertices = getCubeVertices(sideLength) Returns the m x 3 matrix of vertices of a cube with a given side length. The cube is centred around its local coordinate centre

getDefaultHapticPointPlacementTestUserData.m

getDefaultTransformationStructures.m

Set up transformation structures that enables us to specify random translations in x, y and z and random rotations around x, y and z. We use four transformations, one for the translations and three for the rotations. Note that H3D would allow us to make due with only one transformation if we use the rotation around any axis field (Euler axis and angle, also called rotation vector) of the Transform object. However to make initial orientation and finding/setting limits easy we use 3 separate Euler rotations. Also converting Euler angles to a rotation matrix (Direction Cosine Matrix) is trivial, allowing us to easily transform the local points to world space points in Matlab. The order of rotations is x, y, z An initial orientation of 45 degrees around x, -45 around y and 0 around z puts the right top front corner into the middle of the view aligned space Centre screen is x = 45, y = -45 and z = 0

getHTClipPlane.m

[cp] = getHTClipPlane() Utility function to obtain a clip plane structure to be used with the function hapticTool. hapticViewer internally uses hapticToolMex which in turn uses the h3d scene graph api Author: Johann Strasser Date: 070410 (YYMMDD) Revision #1

getHTDefaultOptions.m

getHTIndexedLineSet.m

[ils] = getHTIndexedLineSet() Utility function to obtain an indexed line set structure to be used with the function hapticTool. hapticViewer internally uses hapticToolMex which in turn uses the h3d scene graph api Author: Johann Strasser Date: 070402 (YYMMDD) Revision #1

getHTPointSet.m

[vs] = getHTPointSet() Utility function to obtain a point structure to be used with the function hapticTool. hapticViewer internally uses hapticToolMex which in turn uses the h3d scene graph api Author: Johann Strasser Date: 070129 (YYMMDD) Revision #1 090323 Changed native implementation to be similar to indexed line set

getHTTransform.m

[ts] = getHVTransform(name, parent, matrix) Utility function to obtain a sample transform structure to be used with the function hapticViewer. HapticViewer calls hapticTool which internally uses the scene graph api h3d which. In order to provide user interaction with objects in the scene, transformations are specified intividually. Note that we do not specify a single transformation matrix, due to the H3D's transformation class being a composite transformation. Hence we specify the corresponding components. Below is an excerpt from the H3D reference concerning its transformation class

getHTVolume.m

[vs] = getHTVolume() Utility function to obtain a volume structure to be used with the function hapticTool. hapticTool internally uses hapticToolMex which in turn uses the h3d scene graph api Author: Johann Strasser Date: 070129 (YYMMDD) Revision #1

getHorizontalDistributionTransforms.m

function transforms] = getHorizontalDistributionTransforms(volumes) Description: Function to obtain transforms that distribute volumes horizontally with a given spacing. The number of transforms obtained equals the number of volumes passed Author: Johann Strasser Date: 070326

getImreadSupportedTypesFilterSpec.m

function [filterSpec] = getImreadSupportedFilterSpec() Description: Returns the filterSpec containing all file types supported by function imread. As opposed to getImreadSupportedTypesListFilterSpec this function returns a one-element filter containing all the supported graphics file types at once. Author: Johann Strasser Date: 070312

getImreadSupportedTypesListFilterSpec.m

function [filterSpec] = getImreadSupportedFilterSpec() Description: Returns the filterSpec listing all file types supported by function imread. Author: Johann Strasser Date: 070312

getVoxelSizeFromString.m

function varargout = getVoxelsizeFromString(varargin) Description: Given a string, typically a directory- or filename return a vector containing the voxel size as given in the string Author: Johann Strasser Date: 071105

hapticPointPlacementTest.m

function hapticPlacementTest Description: Tests the speed and accuracy of placing a single point using hapticTool under different combinations of haptics and stereo switched on or off Author: Johann Strasser Date: 090330

hapticPointPlacementTestPrerequisitsDevelopment.m

Make a dummy volume, a 256 cube with full intensity and save it

hapticTool.m

function [transformsOut, volumesOut, pointSetsOut, indexedLineSetsOut, ... clipPlanesOut] = ... hapticTool(transforms, volumes, pointSets, indexedLineSets, clipPlanes, options) A 3d haptic viewer based on H3DApi. Author: Johann Strasser Date: 061123 (YYMMDD) Revisions: Date: 090320 Added options structure and therefore changed the calling method to variable argument list to enable code calling hapticTool with 5 argument to remain unchanged. Note, however, that we still assume the same order of arguments as in the old conventional 5 argument interface.

hapticToolDemo.m

function hapticToolDemo()

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\hapticToolNative

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\hapticToolNative\MatlabR2006bMexFiles

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\hapticToolNative\Microsoft.VC80.CRT

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\hapticToolNative\Microsoft.VC80.MFC

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\hapticToolNative\backup

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\hapticToolNative\hapticToolSolution

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\hapticToolNative\hapticToolSolution\H3DQTHapticTool

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\hapticToolNative\hapticToolSolution\H3DQTHapticTool\GeneratedFiles

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\hapticToolNative\hapticToolSolution\H3DQTHapticTool\GeneratedFiles\debugheavymatlab2007a

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\hapticToolNative\hapticToolSolution\H3DQTHapticTool\GeneratedFiles\debugmatlab2007a

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\hapticToolNative\hapticToolSolution\H3DQTHapticTool\GeneratedFiles\releasematlab2007a

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\hapticToolNative\hapticToolSolution\H3DQTHapticTool\GeneratedFiles\test

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\hapticToolNative\hapticToolSolution\H3DQTHapticTool\Resources

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\hapticToolNative\python

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\hapticToolNative\x3d

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\hapticToolNative\x3d\settings

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\hapticToolNative\x3d\settings\default

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\hapticToolNative\x3d\ui

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\src\hapticToolNative\x3d\ui\textures

loadUserData.m

odefunction.m

dydt = 2 * y; dydt = y .^2;

plot3d_bz_org_intrp_cp.m

% plot original data, interpolated data, control points of bezier curve Mat: original data MatI: approximated (fitted) data p0mat,p1mat,p2mat,p3mat: control points

scratch2.m

smoothIntermediates.m

function [smoothedVertices] = smoothIntermediates(vertices, indices)

smoothPathDemo.m

Input path points and save

temp.m

viewVolume.m

function viewVolume(varargin) Description: Utility function that enables users to view a volume given the path and name of a volume directory containing the image slices in any image format known to Matlab. If no volume directory is given users are presented with an open file dialog to choose a volume slice. All images with the same extension in the same directory are assumed to compose the volume. Specifying path in this case causes the file dialog to open in that location which. Keeping the volume directory and the path to it separate increases reusability of the function as it makes it useful in the context of other programs that maintain the notion of a project. Furthermore if both the path and the volume directory are specified, a third parameter stipulating the image file type has to be present. For instance to invoke the viewer without presenting a file dialog use the following function call syntax:

## C:\Users\AB\DArT_Toolshed\Toolboxes\HapticToolbox\volumeUtils

clipVolume.m

function varargout = clipVolume(varargin) Description: Clip a volume (single or rgb) given one or more plane equations in volume space Author: Johann Strasser Date: 071111

clipVolumeTool.m

function varargout = clipVolumeTool(varargin) Description: GUI tool for clipping a volume Author: Johann Strasser Date: 080103

getPlaneEquationFromPointAndNormal.m

function equation = getPlaneEquationFromPointAndNormal(point, normal) Description: Get coefficients of plane equation. Ax + By + Cz + D = 0 is the plane equation. Refer to http://mathworld.wolfram.com/Plane.html on how to derive the plane equation from a point and a normal (dot product). Author: Johann Strasser Date: 080107

getPolylineLength.m

function l = getPolylineLength(vertices) Description: Calculate the length of a polyline which is defined as a series of vertices. Each row is assumed to be a vertex, i.e. for 3D vertices the argument must be an m x 3 array. Author: Johann Strasser Date: 071122

imBatchCrop.m

IMBATCHCROP crops a batch of image files of type JPG, TIF, GIF, BMP and PNG. syntax: imBatchCrop(rect) description: imBatchCrop crops batch of images to a specified rectangle. Images are saved in the same format as the original file and in a subdirectory named CroppedImage. A postfix '_cropped' is added to the original name of the file. rect is a four-element vector with the form [xmin ymin width height]; these values are specified in spatial coordinates. fmt is the image format of the ouput images. Note: to obtain 256x256 images with top left corner at position (100,50) the parameter rect should be rect = [100 50 255 255]. see also imcrop Dr. Blot (Dec. 2006)

imBatchResize.m

IMBATCHRESIZE resises a batch of imsge files of type JPG, TIF, GIF, BMP and PNG. syntax: imBatchResize(option) description: resizes images using opiton arguments of the imresize function of matlab. Images are saved in the same format as the original file and in a subdirectory named ResizedImage. A postfix '_resized' is added to the original name of the file see also imresize Dr. Blot (Dec. 2006)

indexedLineSet2PolylineStructs.m

function varargout = indexedLineSet2PolylineStructs(varargin) Description: Convert an indexed line set into a polyline structures. Author: Johann Strasser Date: 071122

loadVolumeFromSlicesDir.m

function varargout = loadVolumeFromSlicesDir(varargin) Description: Function to load slices given the directory where the slices reside. The matlab supported image formats are tried in turn to load a volume comprising image slices in the given directory. As soon as one or more image files of a given type are encounterd, all the images with the given extension are assumed to comprise the volume and image search stops. Author: Johann Strasser Date: 070326

loadVolumeFromSlicesDirTyped.m

function varargout = loadVolumeFromSlicesDir(varargin) Description: Function to load slices given the directory where the slices reside and the extension of the graphics file type. Author: Johann Strasser Date: 070312

makeMovie.m

imreadSupportedFileTypes = getImreadSupportedTypesFilterSpec(); [f, p] = uigetfile('bmp', 'Choose volume slice'); if isequal(fileName, 0) disp('User selected cancel.'); userCancel = 1; else [fullVolumePath, name, extension, versn] = fileparts(fullfile(p, f)); end

measureVolumeTool.m

function varargout = measureVolumeTool(varargin) Description: GUI tool for taking simple polyline measurements in volumetric data Author: Johann Strasser Date: 071120

resizeVolume.m

function varargout = resizeVolume(varargin) Description: Resize a volume given one or three scale factors using one of two algorithms: Algorithm 1: A simple nearest neighbour implementation in the z dimensions. Matlab's imresize function is used to resize in the x and y dimensions. Note that choosing the simple algorithm and specifying cubic interpolation will result in nearest neighbour interpolation in the z dimension and cubic interpolation in the x and y dimensions. Algorithm 2; Utilises Matlab's n-dim spatial transformation function. Note that in contrast to imresize this method does not seem to take into account neighbouring pixels when the resize factor is 1/someInteger , i.e. 0.5, 0.25, etc., even though cubic interpolation was specified. For scaling up or non 1/someInteger factors this method in conjunction with cubic interpolation is recommended. Author: Johann Strasser Date: 071111

resizeVolumeDemo.m

function resizeVolumeDemo

resizeVolumeTool.m

function varargout = resizeVolumeTool(varargin) Description: GUI tool to resize a volume Author: Johann Strasser Date: 071111

## C:\Users\AB\DArT_Toolshed\Toolboxes\MediawikiToolbox

## C:\Users\AB\DArT_Toolshed\Toolboxes\MediawikiToolbox\wikiscripts

## C:\Users\AB\DArT_Toolshed\Toolboxes\MediawikiToolbox\wikiscripts\ja_scripts

## C:\Users\AB\DArT_Toolshed\Toolboxes\MediawikiToolbox\wikiscripts\path

## C:\Users\AB\DArT_Toolshed\Toolboxes\MediawikiToolbox\wikiscripts\pywikipedia

## C:\Users\AB\DArT_Toolshed\Toolboxes\MediawikiToolbox\wikiscripts\pywikipedia\archive

## C:\Users\AB\DArT_Toolshed\Toolboxes\MediawikiToolbox\wikiscripts\pywikipedia\cache

## C:\Users\AB\DArT_Toolshed\Toolboxes\MediawikiToolbox\wikiscripts\pywikipedia\category

## C:\Users\AB\DArT_Toolshed\Toolboxes\MediawikiToolbox\wikiscripts\pywikipedia\commonsdelinker

## C:\Users\AB\DArT_Toolshed\Toolboxes\MediawikiToolbox\wikiscripts\pywikipedia\commonsdelinker\plugins

## C:\Users\AB\DArT_Toolshed\Toolboxes\MediawikiToolbox\wikiscripts\pywikipedia\copyright

## C:\Users\AB\DArT_Toolshed\Toolboxes\MediawikiToolbox\wikiscripts\pywikipedia\deadlinks

## C:\Users\AB\DArT_Toolshed\Toolboxes\MediawikiToolbox\wikiscripts\pywikipedia\disambiguations

## C:\Users\AB\DArT_Toolshed\Toolboxes\MediawikiToolbox\wikiscripts\pywikipedia\families

## C:\Users\AB\DArT_Toolshed\Toolboxes\MediawikiToolbox\wikiscripts\pywikipedia\featured

## C:\Users\AB\DArT_Toolshed\Toolboxes\MediawikiToolbox\wikiscripts\pywikipedia\interwiki-dumps

## C:\Users\AB\DArT_Toolshed\Toolboxes\MediawikiToolbox\wikiscripts\pywikipedia\interwiki-graphs

## C:\Users\AB\DArT_Toolshed\Toolboxes\MediawikiToolbox\wikiscripts\pywikipedia\login-data

## C:\Users\AB\DArT_Toolshed\Toolboxes\MediawikiToolbox\wikiscripts\pywikipedia\logs

## C:\Users\AB\DArT_Toolshed\Toolboxes\MediawikiToolbox\wikiscripts\pywikipedia\maintenance

## C:\Users\AB\DArT_Toolshed\Toolboxes\MediawikiToolbox\wikiscripts\pywikipedia\mediawiki-messages

## C:\Users\AB\DArT_Toolshed\Toolboxes\MediawikiToolbox\wikiscripts\pywikipedia\simplejson

## C:\Users\AB\DArT_Toolshed\Toolboxes\MediawikiToolbox\wikiscripts\pywikipedia\spelling

## C:\Users\AB\DArT_Toolshed\Toolboxes\MediawikiToolbox\wikiscripts\pywikipedia\userinterfaces

## C:\Users\AB\DArT_Toolshed\Toolboxes\MediawikiToolbox\wikiscripts\pywikipedia\watchlists

## C:\Users\AB\DArT_Toolshed\Toolboxes\MediawikiToolbox\wikiscripts\pywikipedia\wiktionary

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleAnalysis

Chains2mat.m

MicrotubuleAnalysis.m

MicrotubuleAnalysis Tool to analyse EB1 spots in sequences of microtubule images see also (first get to a position where data.ad has been populated checkSpotPairs used to compute probability of an edge between two spots using correlation histoSpotProperties.m to histogram properties of spots that are in chains < and >= a particular length Paul Southam and Andrew Bangham, 2011

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleAnalysis\MtMaker

makeMTfigure.m

function makeMTfigure(figno,ScottsData) figno, default 1 ScottsData Usage copy the Data and DiffData directories into a new project

readScottsData.m

ProbTwoSpotsInLine2.m

first get a set of refined chains then use this

ProbTwoSpotsInLine3.m

improved by allowing weighting by spot separation and weighting by spot intensity data spots, two spots (from allspots) each spot has a number of points with associated image/spot values type, default 0, i.e. do not use either spot or point intensity, 1 use point intensity i.e. wXY see regionprops_improved 2 not point intensity, but use spot intensity 3 use point intensity and spot intensity separation_weight, default 1, if zero then spot separation has no effect first get a set of refined chains then use this

RemoveChains.m

buildParsedList.m

methodType is either 'spotAngles' (used spot angles to calc prob) or 'noSpotAngles' (does not use spot angles in prob)

build_frame_LIST.m

loop through the points build_list if nargin<5 numOfPoints=100; gaussProbWidth = 13; minMove = 5; maxMove = 18; end

build_frame_LIST_withAngles.m

loop through the points build_list if nargin<5 numOfPoints=100; gaussProbWidth = 13; minMove = 5; maxMove = 18; end

build_frame_LIST_withAnglesRich.m

loop through the points build_list if nargin<5 numOfPoints=100; gaussProbWidth = 13; minMove = 5; maxMove = 18; end

build_list.m

Consider this one spot (eb1Coords(index,1:2)) and visit all other spots in the NEXT frame and start a chain if the transition is probable eb1Coords - the array of xy postions and frame number for every eb1head index - the index into eb1Coord of the start coord

build_list_Rich.m

build_list_withAngles.m

if(nargin < 5) gaussProbWidth = 13; minMove = 5; maxMove = 18; end

bwL2chL.m

function [out,minchainlen]=bwL2chL(bwLabelList,eb1Coords,siz,parsedListProb,minchainlen) bundle chain information into a data structure that keeps all the relevant data in the same structure essential to maintain the chain ID as it is output per frame. in this structure the first element of Chain and Inds is the start of the chain eb1Coords x,y coordinates are converted in single number indices

chL2bwL.m

function [bwL,frames,probs,eb1Cds]=chL2bwL(chL) convert a chainlist structure (array) to bwLabelList, frames, probabilities and, if given the entire chainlist, reconstruct eb2Coords - actually, this is probably not possible since some spots might not be a part of any chain that has been accepted so far.

chainHistogram.m

checkSpotPairs.m

usage ensure that there refined chains, View spots make data global global data select a chain (right click and note chain number, e.g. 14) de-select chains checkSpotPairs(data,chainnumber,2,0.2)

combineForwardBackward.m

compareChainLists.m

compareHistoChainStrightness.m

compareSpots.m

compareSpots

computeRefine.m

computeRemoveDuplicates.m

distance.m

DISTANCE - computes Euclidean distance matrix E = distance(A,B) A - (DxM) matrix B - (DxN) matrix Returns: E - (MxN) Euclidean distances between vectors in A and B Description : This fully vectorized (VERY FAST!) m-file computes the Euclidean distance between two vectors by: ||A-B|| = sqrt ( ||A||^2 + ||B||^2 - 2*A.B ) Example : A = rand(400,100); B = rand(400,200); d = distance(A,B);

distance_Bunschoten.m

DISTANCE - computes Euclidean distance matrix E = distance(A,B) A - (DxM) matrix B - (DxN) matrix Returns: E - (MxN) Euclidean distances between vectors in A and B Description : This fully vectorized (VERY FAST!) m-file computes the Euclidean distance between two vectors by: ||A-B|| = sqrt ( ||A||^2 + ||B||^2 - 2*A.B ) Example : A = rand(400,100); B = rand(400,200); d = distance(A,B);

edit_lineStrightnessPval_threshold.m

getAllChainsInChainListFrame.m

getAllChainsInFrame, given a frame it finds indexes to all the chains present in that frame bwLabelList, a full list of all (N) labelled chains eb1CoordsM, a full list of all vertex coordinates (i.e. points) FrameNumber, image frame of interest NotProcessedLabelList, a list of N flags one per entry in bwLabelList indChainWanted, indexes (into bwLabelList) of chains represented in the frame of interest bwLabelListWanted, list of chains extracted from bwLabelList NotProcessedLabelList, modifed to clear indChainWanted flags J.Andrew Bangham, 2011

getAllChainsInFrame.m

getAllChainsInFrame, given a frame it finds indexes to all the chains present in that frame bwLabelList, a full list of all (N) labelled chains eb1CoordsM, a full list of all vertex coordinates (i.e. points) FrameNumber, image frame of interest NotProcessedLabelList, a list of N flags one per entry in bwLabelList indChainWanted, indexes (into bwLabelList) of chains represented in the frame of interest bwLabelListWanted, list of chains extracted from bwLabelList NotProcessedLabelList, modifed to clear indChainWanted flags J.Andrew Bangham, 2011

getAllFramesInChain.m

getAllFramesInChain, given a list of chains it looks through them to find the range of frame numbers that could contain chains that intersect with the input chains The range is MinFrame:MaxFrame bwLabelList, a full list of all (N) labelled chains eb1CoordsM, a full list of all vertex coordinates (i.e. points) MinFrame, frame containing chains of interest indChainWanted, indexes (into bwLabelList) of chains represented in the frame of interest crosscheckStartList, list of chains against which chains in a frame of interest (MinFrame) must be tested to make sure they don't coincide (see refineListFunc2) MaxFrame, last frame of the range over which we need to analyse for intersecting chains J.Andrew Bangham, 2011

getEb1XYCord.m

getMinMaxFrame.m

getMinMaxLength.m

getNiceDirNames.m

hideAllChainsExceptClicked.m

histSpotOtsuThresholds.m

histoChainLengths.m

histoChainLengths(chainList,titleString) chainList, from data.ad.chainList titleString, i.e. 'All frame in random order' Usage first load a microtubule project, ensure that it has loaded 'Refine_*' then ... global data histoChainLengths(data)

histoChainStrightness.m

histoSpotProperties.m

histoSpotProperties(data,minChainLength,verbose) histogram spot paramenters for spots <minChainLength and >=minChainLength data, from data minChainLength, default 3 verbose, default false Usage first load a microtubule project, ensure that it has loaded 'Refine_*' then ... global data histoSpotProperties(data,3)

jordiMarkerLocator.m

linefitChain.m

listtags.m

macroM.m

node_add.m

node_constructor.m

parseList.m

plotChain2.m

plotInstanceOfChains.m

figure(1); hold on;

plotOnlySomechains.m

probFunction2.m

probFunction2_withAngles.m

if(nargin < 6) maxMoveDist = 18; minMoveDist = 5; %maxMoveDist = 15; %minMoveDist = 8; end

probFunction2_withAngles2.m

function prob = probFunction2_withAngles2(p1, p2, v, sigma,minMoveDist,maxMoveDist,AnglePt2,AnglePt1, EccentricityPt2)

probFunction2_withAngles2JAB.m

function prob = probFunction2_withAngles2JAB This starts to work on a completely different principle. The idea is ... 1) each spot is represented by a set of values, in regionprops_improved these are weighted according to the spot intensity these weighted valuas are now available in spot.wXY plot column 2 against col. 1 and ... 2) if there is no correlation (i.e. slope = 0) then the correlation coefficient can be calculated and the probability that the slope is meaningful is given in spot.prob_slope_significant and the slope in spot.slope 3) We can see whether spot 1 and spot 2 have the same orientation and whether the combined slope is significant by concatenating the two spots wXY2=[spot(1).wXY;spot(2).wXY] and repeating the steps now in regionprops_improved. e.g. [r,p]=corrcoef(wXY2); prob_slope_significant=1-p(1,2); This will give a combined slope and probability that it is meaningful. 4) In a similar way we can do (I think) include how they relate to the S where S is the observed slope between the two spots The idea is to assume that the spots have the same slope as S so we subtract this slope from wXY2. If the slopes were the same, then a plot of wXY2 should show them randomly distributed about 0 (remember we have subtracted the mean). So the corrcoef yield prob_slope_significant which is low come to think of it, p (from [r,p]) will be high. Conversely, if S differed from from the individual spot slopes (actually the combined spot slopes) then p will be low. If the slope of one spot agreed with S then p will be midway In other words, we will have progressively removed our estimates from the data (a) removed two means - making the spots overlap (b) removed the expected slope - leaving us to see whether the residual values are correlated. Then we are testing to see if what remains is random (i.e. we have accounted for everything) or contains a residual slope (so we have not and our hypothesis is less probable).

probFunction2_withAnglesRichard.m

BUGGED DO NO USE

probFunction2_withAnglesRichard2.m

probFunctionOners.m

probRefineNers.m

probRefineOners.m

probRefineThreers.m

probRefineTwoers.m

probRefineTwoersVer2.m

probRefineTwoersVer3.m

pruneTwoer.m

randSpotXY.m

randomType 1 randomly permutes the xy coords of the spots ransomType 2 generates a random number for xy coords

refineListFunc1.m

function [eb1Coords,bwLabelList,parsedListProb,startFrame,endFrame] = refineListFunc1(... startList,Ceb1Coords,CparsedListProb,startFrame,endFrame)

refineListFunc2.m

function [eb1Coords,bwLabelList,parsedListProb,startFrame,endFrame] = refineListFunc1(... startList,Ceb1Coords,CparsedListProb,startFrame,endFrame)

refineListFunc3.m

function [chainList,chainsInFrame] = refineListFunc3(bwLabelList,parsedListProb,eb1Coords,siz) should remove all chains that are completely contained by another chain should do the same thing as refineListFunc1 - it is not frame based like refineListFunc2 bwLabelList, Either (for backwards compatibility) each element (indexed by ChainIndex) is a chain and contains a list of indices (INDICES) into eb1Coords Or is a structure containing a chainList parsedListProb, chain probabilities indexed with ChainIndex eb1Coords,one row per spot, x,y,framenumber, rows indexed by INDICES siz, size(im) size of the image into which x,y are subscripts chainList, array of structures, one element per chain - see bwL2chL for structure chainsInFrame, list of cells indexed by frame number each containing a list of ID's visible in the frame J. Andrew Bangham, 2011

refineListFunc4.m

function [chainList,chainsInFrame] = refineListFunc4(bwLabelList,parsedListProb,eb1Coords,siz) NEW IN ver 4 Deletes initial part of chains that overlap another chain should remove all chains that are completely contained by another chain should do the same thing as refineListFunc1 - it is not frame based like refineListFunc2 bwLabelList, Either (for backwards compatibility) each element (indexed by ChainIndex) is a chain and contains a list of indices (INDICES) into eb1Coords Or is a structure containing a chainList parsedListProb, chain probabilities indexed with ChainIndex eb1Coords,one row per spot, x,y,framenumber, rows indexed by INDICES siz, size(im) size of the image into which x,y are subscripts chainList, array of structures, one element per chain - see bwL2chL for structure chainsInFrame, list of cells indexed by frame number each containing a list of ID's visible in the frame J. Andrew Bangham, 2011

refineListFunc5.m

function [chainList,chainsInFrame] = refineListFunc4(bwLabelList,parsedListProb,eb1Coords,siz) NEW IN ver 5 replace the arbitrary choice of the i'th chain as the one to keep as a full length chain - by - the chain with the minimum bend at the possible break point NEW IN ver 4 Deletes initial part of chains that overlap another chain should remove all chains that are completely contained by another chain should do the same thing as refineListFunc1 - it is not frame based like refineListFunc2 bwLabelList, Either (for backwards compatibility) each element (indexed by ChainIndex) is a chain and contains a list of indices (INDICES) into eb1Coords Or is a structure containing a chainList parsedListProb, chain probabilities indexed with ChainIndex eb1Coords,one row per spot, x,y,framenumber, rows indexed by INDICES siz, size(im) size of the image into which x,y are subscripts chainList, array of structures, one element per chain - see bwL2chL for structure chainsInFrame, list of cells indexed by frame number each containing a list of ID's visible in the frame J. Andrew Bangham, 2011

refineListFunc6.m

refineListFunc6Reverse.m

regionprops_improved.m

function result=regionprops_improved(mask,im) regionprops_improved computes prob_slope_significant, wXY, slope, Orientation associated with each spot mask, [0,1] image marking the extent of each spot im, image showing the image intensity at each spot (WARNING - this needs to be normalised, because the values are used as scaling factors) result.slope result.Orientation result.prob_slope_significant result.wXY the weighted differences from the mean x and mean y where the weights are the im (spot) image values i.e. white weights the point more heavily see also regionprops computes orientation by fitting a first order polynomial 'WeightedCentroid','Orientation','MajorAxisLength',... 'MinorAxisLength','Eccentricity','PixelValues')

renumber_image_files.m

renumber_image_files(projectdirectory) renumbers the image files starting at 0 (used to make it easy to copy a set of images from the middle of a long dataset and check code without having to compute the whole image set)

segmentEB1heads.m

if nargin<5 findcoords=false; end

segmentEB1heads2.m

if nargin<5 findcoords=false; end

slider_prob_threshold.m

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleAnalysis\spotMaker

arrangeSpots.m

createImagesFromLineOfSpots.m

createLines.m

genLine.m

genSpot.m

lineOfSpotsToAllspot.m

spotXYToAllspot.m

spotim.m

spotim(im,frame,sievescale1,sievescale2,centile,integralArea1,integralArea2,verbose)

update_image.m

viewChainCoords.m

mark (with a dash) chains where the first (last) coords are the same bwLabelList is either what it says or an array of chL structs

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\MTtbox

Allsetdiff.m

AnnihilateDynOrganelle.m

this plotting stuff should be elsewhere but should not fail on the cluster so leave it here find associated plots

CheckVertsAreValid.m

ClipCell.m

ConsumeReleaseMols.m

function [MT,AvailableTubulin,AvailableBranch,totalAllMTlengths,nextstepAllMTlength]=ConsumeReleaseMols(... data,MT,... AvailableTubulin,AvailableBranch,... totalAllMTlengths,nextstepAllMTlength) To control the behaviour of microtubules when the amount of tubulin and/or branching factor is limiting data, MTtbox data structure MT, a microtubule e.g. data.working.dyn.microtubule.Org(i) AvailableTubulin, the number of molecules of tubulin available to be consumed AvailableBranch, the number of molecules of branching factor available to be consumed totalAllMTlengths, running total of all microtubule lengths in microns nextstepAllMTlength, the expected length of the next step in microns

CreateDynamicOrganelle.m

FactorProfilePlot.m

function FactorProfilePlot(data,factornames,coordinate,rows,cols,subplotNumber) Plot the concentration profile of a factor along one axis (the middle of the other two) on figure(2) data, the main data structure factornames i.e. s_a or id_stuff or a cell array of names to be plotted on same axis e.g. {'s_a','cytoplasm'} coordinate, 'x','y' or 'z' default 'x' rows, number of rows in a subplot (default 1) cols, default 1 subplotNumber, default 1 FigNo, default 2

FillShell.m

fill voxels up to wallthickness with value Label forming a shell

FillStaticOrganelleVolumes.m

GetNSFRegionDefaultProps.m

non-space filling regions co-occupy space, i.e. might occupy a volume within the cytoplasm, cell_membrane or both the regions are specified by an xyz position, the origin or anchor point and a neighbourhood. The neighbourhood is specified by a geometric shape typically a sphere or ellipse, i.e. major axis, minor axis. A pair of positions, pos and neg, on the perimeter of the shape specify the polarity region. For the current Vol, the shape is translated into a set of offsets from the origin. Populations of non-space occupying regions can be placed in space occupying regions A non-space filling region might represent a membrane channel - in which case it would traverse the membrane - overlapping the extracellular space and the cytoplasm. It would have an associated permeability - relating to its diffusion constant A transmembrane pump would be similar, but actively transport material A nucleolus could nucleate microtubules It is possible that these regions have the role of 'edges' in a VVE cell-cell neighbourhood graph. Similarly, spacefilling organelles might combine junction-junction neighbourhoods bi-partite graph

GetOrganelleData.m

get values and put them into the data structure

GetOrganelleDefaultProps.m

Defines and sets all parameters of the cell organelles that can be used in the current model Some fields, such as FaceColor and Static, cannot be chosen by the user these are returned by name Parameters for others can be chosen by the user, these default values and parameter names are returned through defaultstr,fields Likewise the list of organelles that are possible and whether they are to be used in the current model or not

GetOrganelleProps.m

props=GetOrganelleProps(data,organelle,property) data, primary data structure organelle, e.g. microtubules, plasma_membrane, etc. property, e.g. size, growthrate, etc.

GrowDynamicOrganelles.m

GrowOneDynamicOrganelle.m

function [data,collisionlist,MT]=GrowOneDynamicOrganelle(data,name,MT) It will grow an MT (or actin) using the local properties specified by in organelleprops data, data structure name, type of dynaMT organelle i.e. microtubule or actin MT, organelle structure (usually MT for the moment) organelleprops, copy of the MT properties - which may be default or the same as MT.Props or may have been modified in some way to according to context (Actually, so far it is the same as MT.Props data, data structure for project MT, modified organelle structure Input: the following fields are important MT.Growing if true, it will grow; else it will not MT.Verts list of vertices MT.Props.maxZipToMTAngle of MT on hitting another MT MT.Props.maxAlignToSurfAngle of MT on hitting a membrane Output: The rule is supposed to be that if Growing is false nothing changes else it remains true unless it collides with and is unable to bend and align with another MT, plasma-membrane or vacuole membrane (it may be that the Interaction Function acts on Growing==false to flag the MT for destruction by the ShrinkOneDynamicOrganelle function) flags to control the future of the MT, should be cleared in the interaction function MT.Growing if collision at large angle MT.Verts extended list of vertices MT.Hit a data structure with pointers to MT's that have been hit MT.CurrentDirection will change if MT bends

HideBoxRegion.m

function H=HideBoxRegion(data,bottom_right_back,commandstr,bottom_right_back,top_left_front) hide a portion of the cell, by default the back (low z) half data, data structure commandstr, one of 'hide',['show'],'clear' bottom_right_back, by default data.cellprops.cellsize FaceVertexAlphaData, (0,...,1) where 1 is opaque top_left_front, by default [0,0,0] H, handle to the faces of the box

InitialiseModel.m

MTFitGaussians.m

function ObjOut=MTFitGaussians(Y,observedHist,N,axH) Y, list of observed angles N, number of Gaussions to be fitted (each with mean, standard deviation and contribution to mixture) observedHist, observed histogram of data, bins 0:180 degrees axH, axis on which data and results are to be plotted Circular, default false else assume X is periodic ObjOut structure similar to that produced by gmdistribution.fit global axH

MTShowResults.m

function [] = MTShowResults(inputs) To display results from the cluster The results include both png files (which are shown) and stage files Usage cd into project of interest MTShowResults and first click on the experiment parameter file (within the project)

MTStats.m

function data=MTStats(data,varargin) data, MT data structure The remaining args are optional and in pairs, e.g. 'Type','Lengths' plot accumulating distributions of MT lengths and density per frame 'Type','Directions', plot accumulating distribution of MT segment directions and directions per frame 'Save','Lengths' histogram of microtubule lengths in each frame [time,numberMTs;time,numberMTs ...] 'Save','Directions' histogram of microtubule segment directions in each frame [12345, time;bin,number;bin,number ...] If Directions is set then ... 'NumGaus',n, default 2, number of Gaussians to be fitted to the MT segment angle data 'Method','Cyclic' fit Gaussian to augmented data to allow Gaussians to be fitted around the ends it would be better to have a custom method 'Method','NonCyclic' default, Gaussian mixture fitted to histogram 'Method','AugmentedNonCyclic' Gaussian mixture fitted to augmented histogram to simulate cyclic - but faster Usage data=MTStats(data,'Type','Lengths','Type','Directions' ); data=MTStats(data,'Type','Directions','NumGaus',4,'Method','Cyclic'); data=MTStats(data,'Type','Directions','NumGaus',4,'Method','Cyclic','Save','Directions'); PRODUCES a results file in MT_layersAB_3_20130119\runs\default\results MT_layersAB_3_20130119_default_Directions130121-15-51-50 which after a few steps contains three columns of numbers the dummy numbers 12345 and 678 allow you to identify the time (in seconds) in the middle other rows contain: mixture-fraction, mean, standard-deviation 12345 208.000000 678 0.483026 46.117965 16.787653 0.273457 17.826171 10.289600 0.121758 139.249681 30.820787 0.121758 139.249699 30.820780 12345 209.000000 678 0.105868 165.838961 10.096433 0.167310 108.714920 28.797453 0.459578 45.068372 14.944308 0.267243 16.365847 9.543478 12345 210.000000 678 0.450218 46.068017 14.948798 0.285971 16.806099 9.809341 0.162995 109.043207 28.595623 0.100816 165.469058 10.325557 J.Andrew Bangham, 2012

MT_CloseMovie.m

MT_ID2ind.m

function ind=MT_ID2ind(data,ID) data, MT data structure ID, Unique identity of a microtubule ID ind, current index to microtubule ID in data.working.dyn.microtubules.Org

MT_LoadStage.m

data = MT_LoadStage( data, stage, runDirectory ) Load a stage file. DATA can be any of the following: A path to a .mat file containing a data structure. A data structure which has been saved as a project. A path to a project directory. STAGE may be any of the following: Omitted or empty (treated equivalently). A real number. A string containing a canonical representation of a real number (as constructed by makeStageString()). RUNDIRECTORY may be: Omitted or empty. The name of a directory within the "runs" directory within the project directory specified by DATA. The different forms of the arguments all have the effect of specifying a file to load. When DATA is a path to a .mat file, STAGE and RUNDIRECTORY are ignored and the specified file is loaded. When DATA is a data structure or a path to a project directory, if STAGE is omitted or absent, the initial state of the project is loaded. If STAGE is present, it specifies a stage file to be found in the subdirectory of the project specified by RUNDIRECTORY. If RUNDIRECTORY is absent or empty, the stage directory is "stages" within the project directory. If RUNDIRECTORY is nonempty, it names a subdirectory of the "runs" subdirectory of the project directory. If RUNDIRECTORY is specified, STAGE must also be specified, since run directories do not contain initial files, only stage files. All cases of invalid data result in either the original data structure (if one was supplied) being returned unchanged, or [] returned. Otherwise, the data structure returned is the one read from the file, with all necessarily invalid data (such as graphics handles) removed.

MT_SaveStage.m

MT_classifyFields.m

MT_defaultPlotoptions.m

MT_deletePlotWindow.m

MT_get_config_parameter.m

function parameter_string=MT_get_config_parameter(parameter_name,default_string) opens 'MTtbox_config.txt' if it can find it and looks for a string that starts with the parameter_name followed by a space then takes the next string i.e. starting with a space and followed by the end of line or a % character e.g. moviecodec Motion JPEG AVI % this is a string parameter_name is 'moviecodec' and parameter_string will be 'Motion JPEG AVI' If the parameter_name is not found it will add it to the end of 'MTtbox_config.txt' together with the default_string

MT_haveGUI.m

x = MT_haveGUI( data ) Test to see if a GUI is present.

MT_havePlot.m

x = MT_havePlot( data ) Test to see if a plotting window is present.

MT_haveProject.m

x = MT_haveProject( data ) Test to see if a project is present.

MT_makePlotWindow.m

MT_plotoptions.m

MT_reshapeCell.m

data = MT_reshapeCell( data, ... ) Change the shape and dimensions of the cell and restart the simulation. When the DATA argument is present, default values for all options are the values contained there. Otherwise, default values are as described below. Options: 'shape': Allowed values are 'Rect' (the default), 'Sphere', or 'Disc'. 'vacuole': a triple [X,Y,Z] or a single number X, which will be treated as the triple [X,X,X]. The dimensions in microns of the vacuole, if any. The vacuole is always centred in the cytoplasm. To specify that there is no vacuole, pass the number zero. The default is no vacuole. 'dimensions': a triple [X,Y,Z] or a single number X, which will be treated as the triple [X,X,X]. The dimensions in microns of the cell. There is no default for this: when creating a new cell from scratch, its dimensions must be specified. 'xvoxels': A single integer, the number of voxels along the X dimension of the cell. The number of voxels in the other dimensions will be proportional to this. 'yvoxels', 'zvoxels': Similar to xvoxels. Only one of these three options can be given. If more than one is given, the one implying the smallest total number of voxels will be used. 'voxels': A three-element array, equivalent to specifying all of xvoxels, yvoxels, and zvoxels. A single integer can be given, implying that the three numbers are equal. 'numvoxels': A single integer, specifying the total number of voxels in the cell. The actual number of voxels will be the largest value of X*Y*Z less than or equal to this number, consistent with the voxel array being X by Y by Z. If more than one of 'xvoxels', 'yvoxels', 'zvoxels', or 'numvoxels' is specified, that one will be used which implies the smallest total number of voxels. At least one of these options must be given when creating a cell from scratch. 'sheetmodel': True or false (the default). If true, microtubules will be constrained to a flat sheet vertically bisecting the cell, with vertical coordinate rounded to the height of a middle layer of voxels. 'timestep': A real number, the time step of the simulation (default 1). 'nuclspont': The probability per cubic micron per unit time of the spontaneous nucleation of a microtubule. 'nuclonMT': The probability per micron per unit time of the branching of a new microtubule from another microtubule.

MT_save_project_as.m

[data,ok] = MT_save_project_as( data, projectname, parentdir, ... ) Save the project to a project directory. PROJECTNAME is the name of the project folder. This must not be a full path name, just the base name of the folder itself. It will be looked for in the folder PROJECTDIR, if specified, otherwise in the parent directory of DATA, if any, otherwise the current directory. If PROJECTNAME is not specified or empty, the user will be prompted for a name using the standard file dialog. The project directory will be created if it does not exist. If the project is being saved into its own project directory: If it is in the initial state (i.e. no simulation steps have been performed, and the initialisation function has not been called) then it is saved into the file PROJECTNAME.mat. If it is in a later state, it will be saved to PROJECTNAME_Snnnn.mat, where nnnn is the current simulation time as a floating point number with the decimal point replaced by a 'd'. If the project is being saved into a new directory: The current state will be saved as an initial state or a later stage file as above. If the current state is not the initial state, then the initial state will be copied across. Furthermore, the initial state of the new project will be loaded. The interaction function and notes file will be copied, if they exist. If the notes file exists, the new notes file will also be opened in the editor. Stage files, movies, and snapshots are NOT copied across. If for any reason the project cannot be saved, OK will be false. Options: new: If true, the mesh will be saved as the initial state of a project, even if it is not the initial state of the current simulation. The default is false. strip: If true, as many fields as possible of the data will be deleted before saving. They will be reconstructed as far as possible when the mesh is loaded. The only information that is lost is the residual strains and effective growth tensor from the last iteration. The default is false. Equivalent GUI operation: the "Save As..." button prompts for a directory to save a new project to; the "Save" button saves the current state to its own project directory. The "strip" option can be toggled with the "Misc/Strip Saved Meshes" menu command. Topics: Project management.

MT_setRunName.m

data = MT_setRunName( data ) Set the name of the current run. The name given will be canonicalised so as to force it to be a legal directory name. If the name is empty then it will be replaced by 'default'.

MT_set_config_parameter.m

function data = MT_set_config_parameter( data, parameter_name, default_string ) opens 'MTtbox_config.txt' if it can find it and looks for a string that starts with the parameter_name followed by a space then replaces the next string by the default_string i.e. starting with a space and followed by the end of line or a % character e.g. moviecodec Motion JPEG AVI % this is a string parameter_name is 'moviecodec' and parameter_string will be 'Motion JPEG AVI' If the parameter_name is not found it will add it to the end of 'MTtbox_config.txt' together with the default_string

MT_updateDataFromGUI.m

MT_updateGUIFromData.m

MT_wrap.m

function data=MT_wrap(data,operation,organelle) for use in the interaction function. Allows microtubules to wrap from one side to another by creating a new MT on the other side that grows in the same direction data, MTtbox structure operation, at startup time set to 'STARTUP' else 'RUN' organelle, default 'cytoplasm) usage if data.iterations==0 % setup wrapping data=MT_wrap(data,'setup'); else % Wrap where needed by creating new MTs that form the wrap data=MT_wrap(data,'run'); end

MTlengthMicrons.m

function [MTlength,NewMT]=MTlengthMicrons(data,MT) data, MTtbox data structure MT, microtubule e.g. from data.working.dyn.microtubule.Org(i) MTlength, in microns (the vertices are spaced in voxels ?) NewMT, logical 1 if MT is thought to be new else 0

MTtbox.m

MTtboxAddFactor.m

data = MTtboxAddFactor( data, newnames ) NEWNAMES is a cell array of names of new factors to be added. they are checked to see if they exist already; those that do are ignored.

MTtboxCommand.m

function [argument_list,subfileArgList]=MTtboxCommand(varargin) For running microtubule models in batch mode. Results are filed in a subdirectory ProjectName:runs:experimentname:meshes stores full microtubule .mat files At the end of each stage/step the data structure is stored in a separate file. In addition, the command line used to invoke MTtboxCommand and a copy of the interaction function are saved in the experimentname directory. The data structures can be viewed using MTtbox software When running jobs on the cluster, MTtboxCommand will automatically log the fact with a program called ClusterControl. To run on the cluster you must have 1) Your (UEA) Cluster username 2) Your (UEA) Cluster username Password 3) The (UEA) Cluster name, e.g. eslogin.uea.ac.uk 4) Path to your filespace within the cluster (excluding your name) (e.g 'gpfs/tmpscratch01/sys/') (or 'gpfs/sys/') and the following programs installed on your computer 4) WinSCP 5) Putty 6) pscp 7) plink these can be installed on a Mac from the Terminal using MacPorts (e.g. sudo port install putty) There is an option to output a set of shell scripts (.sh files) that enable the results to be computed on a cluster in parallel. This is invoked by the 'Use','Cluster', command pair. Usage, all argument pairs are optional MTtboxCommand(... 'State','RunNow',... % status of command, options are: % default is 'RunNow', i.e. when 'State' is not used then % system is run on the current computer % % The following only apply to running on the cluster % 'Run' create and run a single command % % 'Begin' to begin assembling a batch of commands % 'Add' to add to the existing batch % 'Start' to add to and then run batch of commands % 'Use','Cluster' % use the cluster if it is accessible % default is not to use the cluster 'Name','IMotif2a',... % project to be run 'Path', pwd,... % present working directory 'DryRun', false,... % If true, no actual invocation of MTtbox % will be made. Instead the commands that % would have been issued are printed to the % console. % this command is used to change dt Using time 'Stages',[80,120,...] % default, output at every iteration % list of stages (in hours) that are to be % output. % Overrides Stepsize. % Overrides total_time, i.e. total_time=max(stages) % stage filenumbers are time - consistent % GFtbox Using steps 'N_steps', 20,... % number of steps to be run 'Stepsize',1,... % interval between steps that are recorded % overridden by Stages % defaut 1 'param',[indices] % it is possible to automatically %create set of experiments that systematically vary parameters %of the model. These have to be setup inside the interaction %function. e.g. the parameter called 'param' is set up with %m.userdata.ranges.param.range=[0, 1.2, 5, 10] %m.userdata.ranges.param.index=3; % this sets the default, i.e. %param=5. By setting an invalid index using %on the MTtboxCommand command line, i.e. 10 in this case, each value of the parameter will be used. If two range parameters are set then the combinations will be run as separate jobs, i.e. if there were 4 and 5 alternatives respectively, 20 experiments would be created. %Sensitivity testing %m.userdata.ranges.sensitivity.range %m.userdata.ranges.sensitivity.index this is a reserved userdatat ranges field that is recognised by MTtboxCommand. In To perform a sensitivity test, there must be set of obj files in a directory called objs. One obj per time step. It is differences between the test sensitivity values and these obj files that will be computed. that will 'ExpID',name, % not for general use. Used internally by MTtboxCommand % to label experiments as they are run on % the cluster e.g. Run on personal computer MTtboxCommand('path','D:\ab\Matlab stuff\Microtubule','Name','MT_Demo5_20120807','N_steps',[5,15,25]); MTtboxCommand('path','D:\ab\Matlab stuff\Microtubule','Name','MT_Demo5_20120807','N_steps',[5,15,25],'spont_nucleation',[1,3]); Run on cluster, exploring two range parameters MTtboxCommand('Name','MT_Demo4_20120718','N_steps',[5,15,25],'spont_nucleation',1); MTtboxCommand('Name','MT_Demo4_20120718','N_steps',[5,15,25],'spont_nucleation',1,'growth',1,'Use','Cluster'); Run on cluster, exploring the effect of different dt and number of vertices MTtboxCommand('State','Begin','Name','NewFig4','dt',1.0,'Stages',[2,5,7],'Use','Cluster'); MTtboxCommand('State','Add','Name','NewFig4','dt',0.1,'Stages',[2,5,7],'Use','Cluster'); MTtboxCommand('State','Add','Name','NewFig4','dt',1.0,'Subdiv',true,Stages',[2,5,7],'Use','Cluster'); MTtboxCommand('State','Start','Name','NewFig4','dt',0.1,'Subdiv',true,'Stages',[2,5,7],'Use','Cluster'); Try a range of dts, run for two separate models, for all combinations of the specified mutations MTtboxCommand('State','Start','Name','NewFig4','dt',[0.1 0.5 1] ,'Subdiv',true,'Stages',[2,5,7],'Use','Cluster','modelname',[1 2],'Mut_List',{'mutation1','mutation1'}); J.Andrew Bangham, 2008 Jacob Newman, 2011 if isunix % then assume it is running on the cluster and the paths are to be % setup relative to the current directory pathnames=fullfile(pwd,'DArT_Toolshed'); addpath(genpath(pathnames)); end

MTtboxCommandGrace.m

function [argument_list,subfileArgList]=MTtboxCommand(varargin) For running microtubule models in batch mode. Results are filed in a subdirectory ProjectName:runs:experimentname:meshes stores full microtubule .mat files At the end of each stage/step the data structure is stored in a separate file. In addition, the command line used to invoke MTtboxCommand and a copy of the interaction function are saved in the experimentname directory. The data structures can be viewed using MTtbox software When running jobs on the cluster, MTtboxCommand will automatically log the fact with a program called ClusterControl. To run on the cluster you must have 1) Your (UEA) Cluster username 2) Your (UEA) Cluster username Password 3) The (UEA) Cluster name, e.g. grace.uea.ac.uk 4) Path to your filespace within the cluster (excluding your name) (e.g 'gpfs/tmpscratch01/sys/') (or 'gpfs/sys/') and the following programs installed on your computer 4) WinSCP 5) Putty 6) pscp 7) plink these can be installed on a Mac from the Terminal using MacPorts (e.g. sudo port install putty) There is an option to output a set of shell scripts (.sh files) that enable the results to be computed on a cluster in parallel. This is invoked by the 'Use','Cluster', command pair. Usage, all argument pairs are optional MTtboxCommand(... 'State','RunNow',... % status of command, options are: % default is 'RunNow', i.e. when 'State' is not used then % system is run on the current computer % % The following only apply to running on the cluster % 'Run' create and run a single command % % 'Begin' to begin assembling a batch of commands % 'Add' to add to the existing batch % 'Start' to add to and then run batch of commands % 'Use','Cluster' % use the cluster if it is accessible % default is not to use the cluster 'Name','IMotif2a',... % project to be run 'Path', pwd,... % present working directory 'DryRun', false,... % If true, no actual invocation of MTtbox % will be made. Instead the commands that % would have been issued are printed to the % console. % this command is used to change dt Using time 'Stages',[80,120,...] % default, output at every iteration % list of stages (in hours) that are to be % output. % Overrides Stepsize. % Overrides total_time, i.e. total_time=max(stages) % stage filenumbers are time - consistent % GFtbox Using steps 'N_steps', 20,... % number of steps to be run 'Stepsize',1,... % interval between steps that are recorded % overridden by Stages % defaut 1 'param',[indices] % it is possible to automatically %create set of experiments that systematically vary parameters %of the model. These have to be setup inside the interaction %function. e.g. the parameter called 'param' is set up with %m.userdata.ranges.param.range=[0, 1.2, 5, 10] %m.userdata.ranges.param.index=3; % this sets the default, i.e. %param=5. By setting an invalid index using %on the MTtboxCommand command line, i.e. 10 in this case, each value of the parameter will be used. If two range parameters are set then the combinations will be run as separate jobs, i.e. if there were 4 and 5 alternatives respectively, 20 experiments would be created. %Sensitivity testing %m.userdata.ranges.sensitivity.range %m.userdata.ranges.sensitivity.index this is a reserved userdatat ranges field that is recognised by MTtboxCommand. In To perform a sensitivity test, there must be set of obj files in a directory called objs. One obj per time step. It is differences between the test sensitivity values and these obj files that will be computed. that will 'ExpID',name, % not for general use. Used internally by MTtboxCommand % to label experiments as they are run on % the cluster e.g. Run on personal computer MTtboxCommand('path','D:\ab\Matlab stuff\Microtubule','Name','MT_Demo5_20120807','N_steps',[5,15,25]); MTtboxCommand('path','D:\ab\Matlab stuff\Microtubule','Name','MT_Demo5_20120807','N_steps',[5,15,25],'spont_nucleation',[1,3]);

MTtboxDeleteFactor.m

data = MTtboxDeleteFactor( data, selectednames ) Delete the named factors. Names that do not exist are ignored.

MTtboxDir.m

dirname = MTtboxDir() Find the Microtubule Toolbox directory.

MTtboxQuit.m

MTtboxRunSilent.m

runs SilentGFtbox having ensured that paths to the DArT_Toolbox are present.

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\MTtbox\OLD

OrgID2Index.m

ResetDynamicPlotPropsH.m

ResetFactorPropsH.m

ResetStaticPlotPropsH.m

ResetWorkingStructure.m

SetUnscaleMarkers.m

SetUnscaleMarkers([property,value]) Scale markers in proportion to x-axis scale rather than in points. When active SetUnscaleMarkers stores data in the axes.userdata and redirects the resize callback of the axes parent figure. properties and values 'State','on' the size of specified markers is in proportion to x axis (instead of in points) 'off' default, markers are specified in points - as normal in Matlab 'Axes',handle (default: current axes from gca) 'Size',value (default: 0.1) fraction of x-axis maxscale-minscale 'Tag','name' (default all markers) name of line containing markers to be scaled Example usage: linemarkertag='ThisOne'; a=0:10; plot(a,a,'.b','markersize',10,'tag',linemarkertag); handle=gca; SetUnscaleMarkers('State','on','Axes',handle,'Size',0.1,'Tag',linemarkertag); % now drag figure window to resize according to length of x axis % and to return things to normal SetUnscaleMarkers('State','off'); J. Andrew Bangham, 2011

ShrinkDynamicOrganelle.m

function [data]=ShrinkDynamicOrganelle(data) Reduce the length of all the dynamic organelle (microtubule) data, MTtbox data structure

ShrinkOneDynamicOrganelle.m

function [data,i_MT]=ShrinkOneDynamicOrganelle(data,name,i_MT) I'm not sure why an index into the MT of interest is passed rather than the MT itself - but there was a reason at some stage. Always shrinks from the tail end - irrespective of speed - but catastrophes should work from the front end - likewise rescues - but not yet implemented % where MT=data.working.dyn.(name).Org(i_MT) the idea is that if MT.Alive==false then the MT will be deleted else it will shrink from the - end until it is deleted Input: the following fields are important MT.Alive MT.Verts MT.Shrinking MT.ShrinkingHead Output: the following fields are important MT.Verts MT.CurrentDirection

SphereSubscripts.m

r is radius i,j,k indices into the sphere

SuffixToStageTime.m

function time=SuffixToStageTime(name)

TestInsertMTintoVol.m

mt, microtubule or other growing/shrinking organelle data, main data structure NameRegionTofill, name of volume in which the organelle is growing, usually 'cytoplasm' DynamicOrg, name of growing, nucleating or shrinking organelle, e.g. microtubule collision.mtHitIDs List of all microtubules this one has hit. collision.staticorgHitIDs List of static organelles it has hit, other than the one it swims in. collision.acollision True if either of these is nonempty. J. Andrew Bangham, 2011

ViewVols.m

This is a no-op.

backOffLineCollision.m

[p2new,remainingdistance] = backOffLineCollision( p1, p2, o1, o2, d ) The arguments define two line segments, one from p1 to p2, one from o1 to o2. d is a distance. p2 is assumed to be closer than d to the line joining o1 and o2. This procedure calculates a point p2new which is at a distance d from the line through o1o2 and has the same projection onto that line as p2. remainingdistance is the amount by which the distance from p1 to p2new is less than the distance from p1 to p2. Negative values (which should not happen) are replaced by 0.

bestFitPlaneOneSide.m

[p1,n] = bestFitPlaneOneSide( vxs, pt ) Calculate a best-fit plane to the set of vertexes vxs, and return its unit normal vector as N. Consider a plane parallel to the best-fit plane, such that (1) all of the points in VXS lie on one side of that plane, (2) PT is at least as close to that plane as the centroid of VXS, and (3) the plane is as close to the centroid as possible. P! is the intersection of that plane with the line through PTZ parallel to N.

calculateEllipse.m

# This functions returns points to draw an ellipse # # @param x X coordinate # @param y Y coordinate # @param a Semimajor axis # @param b Semiminor axis # @param angle Angle of the ellipse (in degrees) #

capsuleProximity.m

[isnear,distance,approaching,p,q] = capsuleProximity( p01, q01, dmin ) Return true if the line segments specified by p01 and q01 are closer than dmin. p01 and q01 are exactly as in lineLineDistance().

cellAge.m

function t = cellAge( data ) t, age in seconds

checkMTvalid.m

checkMTvalid( mt ) Perform validity checks on a microtubule, for debugging purposes. This checks that consecutive vertexes are distinct. When they aren't, bad things happen.

checkbox_clipped.m

chooseDirection.m

direction=chooseDirection(n) Generate N random unit vectors in 3D, uniformly distributed on the unit sphere. N defaults to 1. The result is an N*3 matrix of row vectors.

chooseEndPosition.m

chooseEndPositionSheetModel.m

End_polar=[ rand*2*pi, rand*2*pi, Radius]; % polar relative to StartXYZ

chooseStartPosition.m

function xyz=chooseStartPosition(data,regionsToFill) data, main data structure of MTtbox ind, indexes to region to be filled (if default then it will use cytoplasm) regionsToFill, [default cytoplasm] list of regions e.g. {'cytoplasm','plasma_membrane'} xyz, coordinates of position in data.cellprops.Vol J.Andrew Bangham 2011

clipoutregionMovie.m

function outputMovie = clipoutregionMovie( filename1, filename2 ) narrows the gap between the two movies J.Andrew Bangham, 2013

compactMTData.m

mtdata = compactMTData( mtdata ) Eliminate all fields of mtdata that can be reconstructed from the remainder.

createCellShape.m

function data=createCellShape(data) Requires data.cellprops.shape data.cellprops.cellsize Returns data.cellprops.Vol where -1 labels non_cell region and 0 labels the cell region J.Andrew Bangham, 2012

create_cell_organelles_interactively.m

function data=create_cell_organelles_interactively(data) populate data.organelleprops i.e. data.cell_wall: [1x1 struct] data.plasma_membrane: [1x1 struct] data.cytoplasm: [1x1 struct] data.nucleus: [1x1 struct] data.microtubules: [1x1 struct] data.actin: [1x1 struct] data.vacuole: [1x1 struct]

create_cell_properties_interactively.m

function [data,cancelled]=create_cell_properties_interactively(data) populate data.cellprops e.g. data.shape: 'Rect:1:1:1' data.cellsize: [25 25 25] data.Smooth: 'None'

deleteGraphicsHandleAndChildren.m

deleteWindow.m

diffuse3D.m

x = diffuse( x, k ) X is a 3D array of concentrations defined on a spatially regular grid of any size. K is either a single number or a 3D array of diffusion coefficients on the same grid. The concentration of x on the bounding surfaces is assumed to be clamped at whatever value it has initially. For the calculation to be valid, the relative change in concentration at every point should be below 10% on each iteration step. To create an impermeable barrier between two diffusion regions, their common boundary must be defined by a set of nodes with diffusion constant zero, such that every path from the interior of one region to the interior of the other, passing always from a node to one of its orthogonal neighbours, passes along a consecutive pair of nodes in the barrier. To make the boundary surface of the mesh impermeable, make the diffusion constant zero on the outermost two layers of vertices. All of the following computation schemes are based on the idea of replacing each value by a weighted sum of it and its orthogonal neighbours' values. When k is spatially constant the following simple scheme is correct: x' = (1-6*k)*x + k(sum of neighbouring values of x) If k varies from place to place, it is not correct to simply replace k in the above by the value of k at the point, because this will violate conservation of material. Neither is the following scheme correct: x' = (1-6*k)*x + sum of( neighbouring value of k * neighbouring value of x ) This satisfies conservation of material but violates the principle that if the concentration of x is spatially constant, there can be no net flow in any direction. There will be a fictitious flow down the gradient of diffusion coefficient, proportional to its spatial rate of change and to the square of the mesh step size. The scheme that is implemented here satisfies both conditions. It calculates the flow from a point A to a neighbouring point B as equal to (xA - xB)(kA + kB)/2. This amount is added to B and subtracted from A. The relationship between k, the diffusion constant D of the underlying continuous system, the time step dt, and the mesh step dx is k = (D dt)/(4 dx^2).

discreteCapsule.m

vertexes = discreteCapsule( startPt, endPt ) Imagine a 3D grid of points at integer coordinates. STARTPT and ENDPT are points with not necessarily integer coordinates. This routine returns a list, in increasing order, of the indexes of all grid points that lie within RADIUS of the straight line segment from STARTPT to ENDPT. STARTPT and ENDPT can validly be the same point.

dispMTprops.m

function displays MT properties dispMTprops(ID)

displayMT.m

function [inds,IDs]=displayMT(data,type,num) data, type, either 'Index' requires num or 'ID' requires num or 'All' (DEFAULT) or 'MT' i.e. all bound to other MT's or 'PL' i.e. all bound to plasma-membrane or 'Prop' requires num to be the name of a property num, one or more indexes or ID's if no arguments on the left hand side then display all results else do not display inds, indexes of all found IDs, ID's of all found

doInteraction.m

doStep.m

function data = doStep(data) Step of the MTtbox model. If called from the MTtbox then it displays results etc.(UsingGUI=true) else it simply updates data end data, MTtbox data structure

edit_clip_0.m

if nargin<2 || ~isfield(data.cellprops,'slicenumber')

edit_clip_2.m

establishAxes.m

expandMTData.m

mtdata = expandMTData( mtdata ) Restore all fields of mtdata that were removed by compactMTData( mtdata ).

findBestDeflection.m

[newdir,deflectionAngle] = findBestDeflection( dir, impactVectors, maxDeflection ) Find a direction NEWDIR which minimises the angle between it and DIR, subject to its angle with each vector in impactVectors being at least pi/2. DIR is a row vector and IMPACTVECTORS is a matrix of row vectors. NEWDIR is returned as a row vector. If there is no solution, NEWDIR and DEFLECTIONANGLE are returned as empty. If there are no impactVectors, then NEWDIR is DIR and DEFLECTIONANGLE is 0. Requires the Optimisation Toolbox, for the procedure quadprog.

findBestDisplacement.m

[displacementVec,displacementSize,ok] = findBestDisplacement( penetrations ) A sphere at the origin penetrates several planes by amounts and in directions specified by PENETRATIONS. These should be imagined to be small compared with the radius of the sphere, although the calculation is correct regardless of their sizes. Each penetration is a vector, along a radius of the sphere perpendicular to one of the planes, and proceeding from the intersection of the radius and that plane to the intersection of the radius and the sphere. This procedure calculates the vector of shortest length such that, if the sphere is displaced by this vector, it no longer intersects any of the planes. If no such vector exists, the zero vector is returned. It also returns the length of the displacement vector. In this case, OK will be false, otherwise true. PENETRATIONS is an array of row vectors, and DISPLACEMENTVEC is a row vector. If PENETRATIONS is empty, then DISPLACEMENTVEC is the zero vector, DISPLACEMENTSIZE is zero, and OK is true

findBestRetraction.m

[newdir,frac,ok] = findBestRetraction( dir, vecs ) DIR is a vector representing one step in the growth of a microtubule. VECS is the set of impact vectors resulting from collisions during that step. NEWDIR is the maximum step in the original direction that would avoid all of those collisions. FRAC is the ratio of the length of NEWDIR to DIR. OK is true if FRAC is at least 1e-3 times the length of DIR. Any vectors in VECS with squared length less than 1e-8 will be ignored. If there are no other vectors then NEWDIR will equal DIR, FRAC will be 1, and OK will be true.

findMTtboxFile.m

findNonMember.m

n = findNonMember( v ) Find the smallest positive integer not in the given list of positive integers.

findRunDir.m

findRunSubDir.m

gauss_distribution.m

getClipSliceNumber.m

function slicenumber=getClipSliceNumber(data,pc) data, MTtbox data structure pc, clip position as percentage along the z- axis

getClipSliceNumber2.m

function slicenumber=getClipSliceNumber2(data,pc) data, MTtbox data structure pc, clip position as percentage along the x- axis

getDiffusionK.m

function diffk=getDiffusionK(data,factorname) Convert the data structure created by setupDiffusion into a 3D Vol of diffusion coefficients factorname can be a string or an index. If the diffusion constants are all zero, the empty array is returned. J. Andrew Bangham, 2011

getFactorFromRole.m

[factorIndex,factorName] = getFactorFromRole( data, role ) Return the index and the name of the factor occupying the given role. If there is no such role or no such factor, the index is zero and the name is empty.

getProjectDir.m

getStaticOrganelleColours.m

goToMTProjectDir.m

gomt.m

hasHit.m

function [hit,hitat,hitwhen]=hasHit('what',MT) what, 'MT' (default) or 'STATIC' (any of the following) or 'PLM' or 'VAC' or 'WLL' or 'NUC' MT, microtubule structure hitmt, false if nothing has ever been hit by microtubule MT of ID of microtubule that has been hit or label of static organelle that has been hit hitat, x,y,z coordinates of collision hitwhen, time of collision To cancel all previous hits MT.Hit=struct('hitmt',[],'hitstatic',[],'hitat',[],'hitwhen',[]); Usage if hasHit('MT',MT) then do something end hasHit('Static',MT);

hasJustHit.m

function hit=hasJustHit(what,MT,data) what, 'MT' (default) or 'STATIC' (any of the following) or 'PLM' or 'VAC' or 'WLL' or 'NUC' or 'ANY' either MT or STATIC MT, microtubule structure where MT.Userdata.type is set to e.g. 1 or 2 or 'A' or 'B' designating say, cortical or subcortical MT then you also require data, MTtbox data structure hit, false if nothing has JUST been hit by microtubule MT of ID of microtubule that has been hit or label of static organelle that has been hit Usage if hasJustHit('MT',MT) then do something end where there are two types of MT, MT.Userdata.type=1; % set according MT type (cortical, sub-cortical) MT.Userdata.type=2; if hasJustHit('MT',MT,data) ... to test for collision between identical types see also hasHit('Static',MT);

hideAllMTsExceptClicked.m

insertNSFRegion.m

non-space filling regions (NSF) co-occupy space, i.e. might occupy a volume within the cytoplasm, cell_membrane or both the regions are specified by an xyz position, the origin or anchor point and a neighbourhood. The neighbourhood is specified by a geometric shape typically a sphere or ellipse, i.e. major axis, minor axis. A pair of positions, pos and neg, on the perimeter of the shape specify the polarity region. For the current Vol, the shape is translated into a set of offsets from the origin. Populations of non-space occupying regions can be placed in space occupying regions A non-space filling region might represent a membrane channel - in which case it would traverse the membrane - overlapping the extracellular space and the cytoplasm. It would have an associated permeability - relating to its diffusion constant A transmembrane pump would be similar, but actively transport material A nucleolus could nucleate microtubules It is possible that these regions have the role of 'edges' in a VVE cell-cell neighbourhood graph. Similarly, spacefilling organelles might combine junction-junction neighbourhoods bi-partite graph

isCheckedMenuByTag.m

isInCytoplasm.m

isinside = isInCytoplasm( data, pos ) Determine whether the given point is in the cytoplasm, by rounding it and looking it up in data.cellprops.Vol.

isoCapsCorrect.m

fv = isosurfaceCorrect( vol, value ) Workaround for Matlab's perverse implementation of isosurface, which arbitrarily swaps the coordinates X and Y in the result.

isocapPatchStaticOrganelles.m

isonormalsCorrect.m

isosurfaceCell.m

setup outside of volume for isosurface set(data.plotprops.AxesH,'color','w');

isosurfaceCorrect.m

fv = isosurfaceCorrect( vol, value ) Workaround for Matlab's perverse implementation of isosurface, which arbitrarily swaps the coordinates X and Y in the result.

listOfTags.m

listbox_experimentlist.m

function data=listbox_experimentlist(data) Use the Experiment name listbox to select and load an experiment

listbox_factorlist.m

loadProject.m

--- help for vdspdebug/loadProject ---

LOADPROJECT Load the program file.

Overloaded methods: explorer.loadProject

load_experiment_stage.m

localImDilate.m

makeFactorName.m

Convert s to upper case. Replace all strings of non-word characters by single underscores. If the result does not begin with a letter, prefix 'X_'.

makeRunDir.m

makeRunSubDir.m

makeStageSuffix.m

menu_printsnapshot.m

menu_refresh_plot.m

menu_replot.m

menu_snapshot.m

menu_start_movie_recording.m

microtubuleCollision.m

[mts,mtids,ds,angles,mtAngles,impactVectors,newIgnoreMTIDs] = microtubuleCollision( data, mtID, p01 ) mtID is the ID of a microtubule. p01 is its last two vertices, or its last vertex if it has only one. mts is a list of the indexes, and mtids a list of the IDs, of all the microtubules it collides with. ds is a list of the distances. angles is a list of the contact angles. impactVectors is a list of the vectors from the centre of the end of the microtubule to each of the contact points with other microtubules.

mtCollisionDir.m

[newDir,collisiontype] = mtCollisionDir( previousDir, otherDir, maxAngle ) A microtubule travelling in direction previousDir collides with a microtubule travelling in the direction otherDir. This procedure calculates the resulting direction of the microtubule. This will be parallel or antiparallel to otherDir, provided the angle between otherDir and previousDir is below maxAngle, otherwise it will be previousDir. previousDir should be a unit vector. otherDir may have any nonzero length. newDir will be a unit vector. collisiontype is 1 if newDir is parallel to otherDir, -1 if antiparallel, and 0 if newDir is previousDir.

mtSETMTprops.m

function data=mtSETprops(data,varargin) data, MTtbox data structure remaining arguments in pairs ('fieldname',value) where fieldnames are: thicknessMicrons: 0.025000 outerThicknessRatio: 1 % tip 'magnetic range' centred on and 1*diameter of MT tip, could be e.g. 4 minvox: 1.0000e-04 growthrate: 0.1000 % microns per sec positive end shrinkrate: 0.0300 % microns per sec negative end catastropherate: 0.5000 % transition rate positive end maxAlignToSurfAngle: 40 maxZipToMTAngle: 50 maxSpawnAngle: 50 maxAge: 0 nuclspont: 0.0012 % transition rate nuclonMT: 1.2000e-04 % transition rate probCatastropheWhenHit: 0.3000 % transition rate positive end rescuerate: 0.0 % transition rate from paused to growing probPauseOnCollision: 0.7000 % transition rate positive end probSpontaneousCatastrophe: 0.0300 % transition rate positive end backwardBranching: 0.5000 (50% forwards and 50% backwards) parallelspawnprob: [] wraparound: 0 FaceColor: [0 0 1] FaceAlpha: 0.4000 Label: -6 isLayer: 0 Static: 0 InUse: 1 bendpriority: 'membrane' (default), 'mt' (microtubule),'max' (max of the two), 'min' shrinkheadrate: 0.3000 ( % microns per sec positive end)

mtSETindividualMTprops.m

function data=mtSETindividualMTprops(data,varargin) data, MTtbox data structure ID, identity of microtubule(s) remaining arguments in pairs ('fieldname',value) where fieldnames are: Type PauseDuration TimeNucleated ID parentID Alive: logical Growing: logical Shrinking: logical ShrinkingHead: false (default)see Props.shrinkheadrate Catastrophe: logical Verts CurrentDirection Props: structure see below AgeFormed BoundPLM: logical BoundMic: logical BoundVac: logical BoundWll: logical plothandles plotprops HitMe: structure Hit: structure Userdata Wrapped: logical %Props also see help on mtSETMTprops thicknessMicrons: 0.5000 minvox: 1.0000e-04 growthrate: 0.1000 shrinkrate: 0.0300 catastropherate: 0.5000 maxAlignToSurfAngle: 40 maxZipToMTAngle: 50 maxSpawnAngle: 50 maxAge: 0 nuclspont: 0.0012 nuclonMT: 1.2000e-04 probCatastropheWhenHit: 0.3000 probPauseOnCollision: 0.7000 probSpontaneousCatastrophe: 0.0300 backwardBranching: 0.5000 parallelspawnprob: [] wraparound: 0 FaceColor: [0 0 1] FaceAlpha: 0.4000 Label: -6 isLayer: 0 Static: 0 InUse: 1 bendpriority: 'membrane' shrinkheadrate: 0.3000

multiMovie.m

function outputMovie = multiMovie( filename1, filename2 ) Combines two movies into one with images side by side If one movie is longer than the other, the longer one is evenly subsampled to give the same number of frames as the shorter the width of the final movie is 1024 pixels and the height varies depending on the size of the input movies Images are scaled such that the aspect ratios of both are maintained. The output file name is a concatenation of the input filenames J.Andrew Bangham, 2013

non_interactive_MTtbox_B.m

nucleateDyn.m

function [data,nucleated]=nucleateDyn(data,NameRegionTofill,... NucleatingOrganelle,forcedStartPosition,NewDirection,parentID,N) Usage: to create a new cytoplasmic MT at the growing tip of an old one (indexed=1) StartPosition= data.working.dyn.microtubules.Org(1).Verts(end,:); InitialDirection== data.working.dyn.microtubules.Org(1).CurrentDirection; [data,newID] = nucleateDyn( data, 'cytoplasm', 'microtubules', ... StartPosition, InitialDirection );

overlayStats.m

plotCylinderExtrusion.m

plotCylinderExtrusion( ax, h, vxs, radius, npts, colorspec ) Plot a piecewise cylindrical object that passes through the vertexes in VXS, and whose cross-section is a regular polygon of NPTS vertexes and radius RADIUS. The plotting takes place in the axes object AX. If H is nonempty, it is assumed to be a graphics handle returned by a previous call of plotCylinderExtrusion. In this case its properties will be updated instead of a new handle being made. COLORSPEC is a structure with fields START, MIDDLE, END, TIPS, and VARIATION. START, MIDDLE, and END are the colours of the start, middle, and end of the extrusion. VARIATION specifies an amount by which the colour varies around the microtubule. TIPS affects how much the start and end colours are localised to the tips of the cylinder. The larger the value, the more the tip colours are localised. Default values aredefined for each of these properties.

plot_MTStats_Gaussians.m

plot_dynamic_organelle.m

mic, microtubule/actin name, name of dynamic organelle, i.e. microtubule/actin

plot_static_organelles.m

plotfactor.m

plotmarkers.m

p = plotmarkers( points, sizes, color, alpha, shape, ... ) Plot a marker at each of a set of points. POINTS is an N*3 array of N points. SIZES is a 1*N or N*1 vector of diameters of the markers. COLOR is an RGB triple specifying the color of all the markers. ALPHA is a single number, the alpha value (opacity) of the markers. 1 is completely opaque, 0 is invisibly transparent. SHAPE is either 'cube', 'octahedron', or 'tetrahedron'. The remaining arguments are passed on to a call of PATCH. These should not specify any of 'EdgeColor', 'FaceAlpha', 'EdgeAlpha', or 'LineStyle', but may specify any other properties. The result is a graphics handle to a patch object.

previousHit.m

h = previousHit( mt, data ) Return the hit structure that records what, if anything the microtubule mt hit on the previous iteration. Note that this procedure can only be called during a simulation step, because the iteration count will be incremented at the end of the step.

pushbutton_initialise.m

initialise the model make an initialising call to the interaction function

pushbutton_restart.m

clear the working arrays

pushbutton_stop.m

quickProximityTest.m

mightBeNear = quickProximityTest( p01, q01, dmin ) Perform a quick proximity test between the point sets defined by the p01 and q01, and the distance dmin. This returns a boolean for each point in q01, which is true if an only if that point is within a distance of d1 of the axis-aligned bounding box of p01. If one wants to know whether the points of q01 are close to any member of p01, or to the convex hull of p01, or to the lines joining the points of p01, then this procedure can be used as a quick screening test. Where it returns false, the point is certainly far, but where it returns true, it may or may not be near, and then a more precise test is needed.

randPosOnMT.m

[p,vi,vr] = randPosOnMT( mt ) Choose N random positions on the microtubule, uniformly by length.

randomSpawnDirection.m

[newdir,newstart,offsetdir] = randomSpawnDirection( ... curdir, maxangle, maxangleback, curstart, radius, surfnormal, insurface, parallelprob, backprob ) Generate a random direction that deviates by not more than maxangle from currentdir, and which is uniformly distributed over the spherical cap that is the space of all permitted directions. If surfnormal is supplied, nonempty, and nonzero, limit the new vector to the subset making an angle with surfnormal of more than 90 degrees. If maxangle is empty, all directions are permitted, the same as if maxangle were pi or more. insurface is a boolean. If false, the above happens, but if true, the new direction is constrained to lie parallel to the surface, i.e. perpendicular to surfnormal. (surfnormal must be supplied and nonzero in this case.) The new direction is randomly uniformly distributed over the range of permitted angles in the surface. curdir must be a row vector. newdir will be a unit length row vector. offsetdir will be a unit vector in the plane of curdir and newdir, specifying the direction the spawn point should be offset. The default value of N is 1. A larger value can be supplied to generate any number of random directions as an N*3 matrix.

randsubset.m

Return a random subset of k of the numbers from 1 to n. s will be an array of booleans the same size as n, with k randonly selected elements set to true. This is guaranteed to give exactly k numbers. If what you need is for each number to be chosen independently with probability k/n, just use s = rand(1,n) < k/n.

rate2prob.m

function p=rate2prob(data,f) convert a transition rate in probability per (second per step) to a probability. (Allard et al use prob per minute) data, MTtbox data structure f, transition probability p, probability

readMTtboxConfig.m

configStruct = readMTtboxConfig() Get config info.

region.m

function [ind,array] = region(data,factor,organellename) data, MTtbox data structure factor, 3D matrix of factor organellename, string e.g. 'cytoplasm' ind, indexes to the region selected by the intersection of the factor and organelle regions array, array the size of the cell containing 1's marking the region usage s_a_p(region(data,id_a_p>0.5,'cytoplasm')=1; % to set s_a_p within the cytoplasm to 1

resetAllMicColours.m

sampleFactor.m

function level=sampleFactor(factor,MT,type) factor, volume representing the factor, e.g. id_a_p MT, microtubule data structure type default 'POSITIVE' or 'GROWING' the growing end level of factor at the specified point Usage if sampleFactor(id_a_p,MT)>0.5 then etc.

saveCurrentState.m

saveMTtboxConfig.m

scaleVertexSize.m

setAlignmentOfAB.m

setAxisTicks.m

setAxisTicks( ax, unit, unitname ) Set the position and labelling of the axis ticks, on the assumption that the unit of labelling is UNIT and not the actual values.

setFactorRole.m

data = setFactorRole( data, role, factorname ) Specify the name of the factor that occupies a given role. If the name is empty or absent, the role is removed.

setMicColour.m

setPlotOptionFromToggleItem.m

setStopRequest.m

Can only be called from within a callback.

setToggleItemFromPlotOption.m

setupDiffusion.m

function data=setupDiffusion(data,varargin) Diffusion constant may vary from region to region This routine sets up data structure that can be translated in to a 3D pattern of diffusion constants. varargin, data,value pairs where 'Factor' is the name of the signalling factor, e.g. s_factor 'DiffK' is the diffusion constant, N values means that N regions must be specified 'ListOfVolumes', is a list of lists specifying the regions associated with each DiffK Regionlist i.e. {'plasma_membrane','cytoplasm'} or {'nucleus'} ListOfVolumes i.e. {{'plasma_membrane','cytoplasm'},{'nucleus'}} usage data=setupDiffusion(data,'Factorname','s_a','DiffK',[0.02,0.0],... 'RegionLists',{{'cytoplasm'},{'plasma_membrane','microtubules','vacuole','cell_wall'}}); see also diffk=setup2DiffusionK(data,'factorname'); J.Andrew Bangham, 2011

setup_static_organelle_volume.m

Fill a volume representing the organelle (used to create a surf for visulisation) save in data.cellprops.(Organelle).Vol Also, use this volume to contribute to the labelling of all regions of the cell save in data.cellprops.Vol This must be done by going through the Organelles from largest to smallest, followed by membranes data.cellprops.Vol be zero everywhere inside the cell and -1 (representing non_cell) outside

showAllMTs.m

show_cortical_microtubules.m

slicefactor.m

smoothStaticOrganelles.m

sortByStageNumber.m

spawnFromMTs.m

data = spawnFromMTs( data ) Spawn new MTs from existing MTs.

splitMT.m

data = splitMT( data, mtID, mtIndex ) Split the microtubule identified either by mtID or mtIndex into two parts at vertex i (an index into its Verts array). That vertex will become the last vertex of the original mt and the first vertex of the new mt.

stopWasRequested.m

Can only be called from within a callback.

surfCollisionDir.m

newDir = surfCollisionDir( previousDir, surfNormal, maxAngle ) A microtubule travelling in direction previousDir collides with a surface, whose surface normal at the collision point is surfNormal, pointing in the direction away from the microtubule. This procedure calculates the resulting direction of the microtubule, which should be tangent to the surface, and subject to that, as close as possible to the original direction. previousDir and surfNormal are assumed to be unit vectors. newDir will be a unit vector. softCollision is true if the angle of incidence with the surface is below maxAngle. The value returned for newDir is independent of whether softCollision is true.

surfDistance.m

[penetrationDistance,penetrationVector] = surfDistance( pt, dir, vertices, normals, normalsense, maxdist, surfsize, planeOnly ) Determine whether the point PT is closer than maxdist to the surface, and if so, how close, and calculate a vector in the direction of the contact, whose length is equal to the penetration depth. This vector always points into the collision object. If PT is not closer than maxdist, then the penetration distance is returned as 0 and the penetration vector as the zero vector.

testDiffuse.m

Set X to be a spherically symmetric gaussian concentration field.

testrandsubset.m

toggleMenuPlotOption.m

trimToVol.m

ijk = trimToVol( ijk, volsize ) Force every component of ijk to lie between 1 and the corresponding component of volsize.

updateFactorListbox.m

updateMTtboxFactorsDialog.m

update_Interaction_Function_Tail.m

function ok=update_Interaction_Function_Tail(data) to ensure that when the interaction function is next opened the commented parameters at the end together with any changes specified in the body of the interaction function represent a complete description of the model

update_control_panel.m

update_nsfregion_menus.m

update_organelle_menus.m

upgradeData.m

validateData.m

ok = validateData( data ) Perform validity checks on the data. These are not exhaustive, but just a collection of whatever tests occurred to me.

viewCombinedFlapHists.m

vieworganelle.m

volSub2ind.m

indexes = volSub2ind( volsize, ipp ) Version of sub2ind that runs much faster than Matlab's.

whichSideOfSurface.m

[side,closestpt,normal,offset] = whichSideOfSurface( pt, surface, normals, maxdist ) Determine whether the point PT is on the positive or negative side of the surface defined by VERTICES and NORMALS. SIDE is 1 if the point is on the side that the normals point towards, otherwise -1. SURFACE is a struct containing two fields, VERTICES and FACES, as returned by ISOSURFACE(). Only the vertices are actually used. Vertexes farther away from PT than MINDIST along any coordinate are ignored. If this leaves no vertices, SIDE will be zero. Otherwise, the closest remaining vertex to PT will be chosen and the normal vector at that point used to determine SIDE. CHOSENPT is the closest vertex to PT. NORMAL is the normal vector at that vertex. OFFSET is the vector such that PT+OFFSET lies in the plane through CHOSENPT perpendicular to NORMAL.

writeDefaultCellParameters.m

writeDefaultFactorParameters.m

writeDefaultOrganelleParameters.m

function writeDefaultOrganelleParameters(data,fid) see GetOrganelleDefaultProps

writeDefaultParameters.m

MicrotubuleModeller.m

function MicrotubuleModeller(varargin) Example: MicrotubuleModeller; Dr. A. I. Hanna (2007) CMP, UEA, 2007.

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\Params

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\PyMicrotubules

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\PyMicrotubules\Mathematica Versions

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\PyMicrotubules\Mathematica Versions\Library Version

Arg.m

Microtubules.m

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\PyMicrotubules\Mathematica Versions\Library Version\Test

Collatz.m

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\PyMicrotubules\Mathematica Versions\Library-3D

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\PyMicrotubules\Mathematica Versions\OBJUnpickle

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\PyMicrotubules\Mathematica Versions\OldVersions

MTmain.m

A class to handle all the MT admin

Microtubules.m

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\PyMicrotubules\PyMT

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\PyMicrotubules\PyMT\.eric4project

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\PyMicrotubules\PyMT\CellData

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\PyMicrotubules\PyMT\Logs

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\PyMicrotubules\PyMT\Movies

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\PyMicrotubules\PyMT\POV-Renders

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\PyMicrotubules\PyMT\Parameters

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\PyMicrotubules\PyMT\Parameters\FlipCell

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\PyMicrotubules\PyMT\Parameters\NoFlipCell

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\PyMicrotubules\PyMT\Parameters\Transmission

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\PyMicrotubules\PyMT\PicklingJar

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\PyMicrotubules\PyMT\build

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\PyMicrotubules\PyMT\build\temp.macosx-10.3-fat-2.6

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\PyMicrotubules\PyMTPanda

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\PyMicrotubules\PyMTPanda\.eric4project

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\PyMicrotubules\PyMultipleMT

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\PyMicrotubules\PyMultipleMT\.eric4project

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\PyMicrotubules\PyMultipleMT\Movies

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\PyMicrotubules\PySingleMT

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\PyMicrotubules\PySingleMT\.eric4project

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\PyMicrotubules\PySingleMT\Movies

## C:\Users\AB\DArT_Toolshed\Toolboxes\MicrotubuleModeller\Tests

rand_orient.m

rand_orient(sensor_type,base_angle,noise) Exploring ways of plotting changing patterns of orientation Two state machine producing orientations at two angles 90 degrees apart sensor_type, 0 orientations at 0 to 360 degrees 1 modulo 180 (c.f. actual measurements of microtubules 2 modulo 90 for test purposes base_angle, angle from which 90 excursions occur noise, 0 to 360 standard deviation of angle measurement error background, 0 to 1 proportion of instances with background random oriented noise usage rand_orient(1,30,3) J. Andrew Bangham, 2010

rand_orient3.m

rand_orient(sensor_type,base_angle,noise) Exploring ways of plotting changing patterns of orientation Two state machine producing orientations at four angles 0, 50 70 90 sensor_type, 0 orientations at 0 to 360 degrees 1 modulo 180 (c.f. actual measurements of microtubules 2 modulo 90 for test purposes base_angle, angle from which 90 excursions occur noise, 0 to 360 standard deviation of angle measurement error background, 0 to 1 proportion of instances with background random oriented noise usage rand_orient(1,30,3) J. Andrew Bangham, 2010

runnable.m

viewPhases.m

[results,names]=viewPhases(resultsDir,sigma,verbose) resultsDir, directory containing the results text files sigma,minimum distance (along time axis) between min and max verbose, 0 no graphics, 3 full heat map graphic results, data structure names, names of parameters on ordinate (rows) and abscissa (cols) used by viewTuringHeatMap.m J.Andrew Bangham, 2012

viewTuringHeatMap.m

function HM=viewTuringHeatMap(resultsDirectory) resultsDirectory, string giving the name of a local directory containing all the MT counts for the two layers e.g. containing Phases.VALUESubCorticalMaxLength=8VALUECrossoverExponent=2.txt Phases.VALUESubCorticalMaxLength=8VALUECrossoverExponent=3.txt where a typical file two columns of MT counts per time frame, one column per layer HM, heat map names, names of parameters being varied - rows cols it also saves a screenshot of the matrix of plots in the current directory Usage viewTuringHeatMap('ForAndrew'); Depends on viewPhases.m J. Andrew Bangham, 2012

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROConnectC++

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROConnectJ

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROConnectJ\build

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROConnectJ\build\classes

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROConnectJ\build\classes\omeroconnect

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROConnectJ\dist

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROConnectJ\dist\javadoc

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROConnectJ\dist\javadoc\index-files

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROConnectJ\dist\javadoc\omeroconnect

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROConnectJ\dist\javadoc\omeroconnect\class-use

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROConnectJ\dist\javadoc\resources

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROConnectJ\lib

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROConnectJ\nbproject

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROConnectJ\nbproject\private

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROConnectJ\src

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROConnectJ\src\omeroconnect

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROConnectPy

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROConnectTest

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROConnectTest\build

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROConnectTest\build\classes

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROConnectTest\build\classes\omeroconnecttest

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROConnectTest\dist

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROConnectTest\dist\lib

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROConnectTest\lib

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROConnectTest\nbproject

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROConnectTest\nbproject\private

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROConnectTest\src

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROConnectTest\src\omeroconnecttest

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROConnectTest\test

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROMatlab

Tutorial0.m

TUTORIAL0 How to connect to the omero server and list the whole database

Tutorial1.m

TUTORIAL1 How to connect to the omero server and save a specific ImageID to the local disk

Tutorial2.m

TUTORIAL2 How to connect to the omero server and access an Image object

Tutorial3.m

TUTORIAL3 How to connect to the omero server, access an Image object, process the image and save the results back on the server.

Tutorial4.m

TUTORIAL4 How to connect to the omero server and retrieve Image objects by searching for TAGS.

Tutorial5.m

TUTORIAL5 How to connect to the omero server and perform data management.

Tutorial6.m

TUTORIAL6 How to use annotations.

findAllImages.m

utilityFunctions.m

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROUploader

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROUploader\build

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROUploader\build\classes

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROUploader\build\classes\omeroconnect

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROUploader\build\classes\omerouploader

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROUploader\dist

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROUploader\dist\lib

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROUploader\lib

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROUploader\nbproject

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROUploader\nbproject\private

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROUploader\src

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROUploader\src\omerouploader

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROUploader\test

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMERO_daemon

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMERO_daemon\build

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMERO_daemon\build\classes

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMERO_daemon\build\classes\omero_daemon

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMERO_daemon\dist

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMERO_daemon\lib

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMERO_daemon\nbproject

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMERO_daemon\nbproject\private

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMERO_daemon\src

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMERO_daemon\src\omero_daemon

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMERO_daemon\test

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROtoOMERO

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROtoOMERO\lib

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROtoOMERO\nbproject

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROtoOMERO\nbproject\private

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROtoOMERO\src

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROtoOMERO\src\omerotoomero

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROtoOMERO\test

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OMEROwebsync

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OPT_Uploader

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OPT_Uploader\dist

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OPT_Uploader\lib

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OPT_Uploader\nbproject

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OPT_Uploader\nbproject\private

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OPT_Uploader\src

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\OPT_Uploader\src\opt_uploader

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtNetworkClients

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtNetworkClients\QtNetworkClient

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtNetworkClients\QtNetworkClient\dist

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtNetworkClients\QtNetworkClient\dist\icons

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtNetworkClients\QtNetworkClient\dist\icons\_PAlbTN

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtNetworkClients\QtNetworkClient\dist\icons\_PAlbTN\170x128

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtNetworkClients\QtNetworkClient\dist\icons\_PAlbTN\320x320

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtNetworkClients\QtNetworkClient\dist\icons\_PAlbTN\56x42

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtNetworkClients\QtNetworkClient\lib

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtNetworkClients\QtNetworkClient\nbproject

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtNetworkClients\QtNetworkClient\nbproject\private

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtNetworkClients\QtNetworkClient\src

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtNetworkClients\QtNetworkClient\src\qtnetworkclient

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtNetworkClients\QtNetworkClient\src\qtnetworkclient\icons

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtNetworkClients\QtNetworkClient\src\qtnetworkclient\icons\_PAlbTN

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtNetworkClients\QtNetworkClient\src\qtnetworkclient\icons\_PAlbTN\170x128

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtNetworkClients\QtNetworkClient\src\qtnetworkclient\icons\_PAlbTN\320x320

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtNetworkClients\QtNetworkClient\src\qtnetworkclient\icons\_PAlbTN\56x42

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtNetworkClients\QtNetworkClientC

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtNetworkClients\QtNetworkClientC\QtNetworkClientC

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtNetworkClients\QtNetworkClientC\QtNetworkClientC\GeneratedFiles

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtNetworkClients\QtNetworkClientC\QtNetworkClientC\GeneratedFiles\Debug

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtNetworkClients\QtNetworkClientC\QtNetworkClientC\GeneratedFiles\Release

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtNetworkClients\QtNetworkClientC\QtNetworkClientC\_PAlbTN

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtNetworkClients\QtNetworkClientC\QtNetworkClientC\_PAlbTN\170x128

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtNetworkClients\QtNetworkClientC\QtNetworkClientC\_PAlbTN\320x320

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtNetworkClients\QtNetworkClientC\QtNetworkClientC\_PAlbTN\56x42

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtNetworkClients\QtNetworkClientC\release

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\QtNetworkServer

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\QtNetworkServer\dist

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\QtNetworkServer\lib

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\QtNetworkServer\nbproject

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\QtNetworkServer\nbproject\private

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\QtNetworkServer\src

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\QtNetworkServer\src\qtnetworkserver

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\QtNetworkServer\src\qtnetworkserver\icons

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\QtNetworkServer\src\qtnetworkserver\icons\_PAlbTN

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\QtNetworkServer\src\qtnetworkserver\icons\_PAlbTN\170x128

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\QtNetworkServer\src\qtnetworkserver\icons\_PAlbTN\320x320

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\QtNetworkServer\src\qtnetworkserver\icons\_PAlbTN\56x42

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\QtOmeClient

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\QtOmeClient\dist

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\QtOmeClient\dist\icons

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\QtOmeClient\dist\icons\_PAlbTN

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\QtOmeClient\dist\icons\_PAlbTN\170x128

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\QtOmeClient\dist\icons\_PAlbTN\320x320

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\QtOmeClient\dist\icons\_PAlbTN\56x42

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\QtOmeClient\jui

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\QtOmeClient\lib

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\QtOmeClient\nbproject

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\QtOmeClient\nbproject\private

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\QtOmeClient\oldcode

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\QtOmeClient\src

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\QtOmeClient\src\qtomeclient

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\QtOmeClient\src\qtomeclient\icons

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\QtOmeClient\src\qtomeclient\icons\_PAlbTN

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\QtOmeClient\src\qtomeclient\icons\_PAlbTN\170x128

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\QtOmeClient\src\qtomeclient\icons\_PAlbTN\320x320

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\QtOmeClient\src\qtomeclient\icons\_PAlbTN\56x42

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\omeImageIO

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\omeImageIO\dist

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\omeImageIO\dist\javadoc

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\omeImageIO\dist\javadoc\index-files

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\omeImageIO\dist\javadoc\omeImageIO

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\omeImageIO\dist\javadoc\omeImageIO\class-use

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\omeImageIO\dist\javadoc\resources

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\omeImageIO\lib

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\omeImageIO\nbproject

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\omeImageIO\nbproject\private

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\omeImageIO\src

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\omeImageIO\src\omeImageIO

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\omeServerBrowser

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\omeServerBrowser\dist

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\omeServerBrowser\dist\javadoc

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\omeServerBrowser\dist\javadoc\index-files

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\omeServerBrowser\dist\javadoc\omeServerBrowser

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\omeServerBrowser\dist\javadoc\omeServerBrowser\class-use

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\omeServerBrowser\dist\javadoc\resources

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\omeServerBrowser\lib

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\omeServerBrowser\nbproject

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\omeServerBrowser\nbproject\private

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\omeServerBrowser\src

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\QtOMEBrowser\omeServerBrowser\src\omeServerBrowser

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\ScreenShot

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\ScreenShot\build

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\ScreenShot\build\classes

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\ScreenShot\build\classes\screenshot

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\ScreenShot\dist

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\ScreenShot\dist\lib

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\ScreenShot\lib

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\ScreenShot\nbproject

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\ScreenShot\nbproject\private

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\ScreenShot\src

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\ScreenShot\src\screenshot

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\ScreenShot\src\screenshot\web

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\ScreenShot\test

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\bioformatsConverter

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\bioformatsConverter\dist

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\bioformatsConverter\lib

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\bioformatsConverter\nbproject

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\bioformatsConverter\nbproject\private

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\bioformatsConverter\src

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpenMicroscopyToolbox\bioformatsConverter\src\bioformatsconverter

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpticalFlowTool

OpticalFlowTool.m

function OpticalFlowTool(varargin) A tool that allows the user to load and crop avi files and then compute the direction of flow using an optical flow algorithm. Example: OpticalFlowTool; Dr. A. I. Hanna, CMP, UEA, 2008.

## C:\Users\AB\DArT_Toolshed\Toolboxes\OpticalFlowToolPlus

CalcCyclicMeanTheta.m

function returns meanTheta, the mean angle from an array of angles Requires upLim and lowLim which are the upper and lower limits of the search.

OpticalFlowToolPlus.m

function OpticalFlowToolPlus(varargin) A tool that allows the user to load and crop avi files and then compute the direction of flow using an optical flow algorithm. Example: OpticalFlowToolPlus;

calcOrderCoefficient.m

circMean.m

data is a frequency count of 180 elements (each bin is 1 degree)

csvimport.m

CSVIMPORT reads the specified CSV file and stores the contents in a cell array or matrix The file can contain any combination of text & numeric values. Output data format will vary depending on the exact composition of the file data. CSVIMPORT( fileName ): fileName - String specifying the CSV file to be read. Set to [] to interactively select the file. CSVIMPORT( fileName, ... ) : Specify a list of options to be applied when importing the CSV file. The possible options are: delimiter - String to be used as column delimiter. Default value is , (comma) columns - String or cell array of string listing the columns from which data is to be extracted. If omitted data from all columns in the file is imported. outputAsChar - true / false value indicating whether the data should be output as characters. If set to false the function attempts to convert each column into a numeric array, it outputs the column as characters if conversion of any data element in the column fails. Default value is false. uniformOutput - true / false value indicating whether output can be returned without encapsulation in a cell array. This parameter is ignored if the columns / table cannot be converted into a matrix. noHeader - true / false value indicating whether the CSV file's first line contains column headings. Default value is false. ignoreWSpace - true / false value indicating whether to ignore leading and trailing whitespace in the column headers; ignored if noHeader is set to true. Default value is false. The parameters must be specified in the form of param-value pairs, parameter names are not case-sensitive and partial matching is supported. [C1 C2 C3] = CSVIMPORT( fileName, 'columns', {'C1', 'C2', C3'}, ... ) This form returns the data from columns in output variables C1, C2 and C3 respectively, the column names are case-sensitive and must match a column name in the file exactly. When fetching data in column mode the number of output columns must match the number of columns to read or it must be one. In the latter case the data from the columns is returned as a single cell matrix. [C1 C2 C3] = CSVIMPORT( fileName, 'columns', [2, 3, 4], ,'noHeader', true, ... ) This form returns the data from columns in output variables C1, C2 and C3 respectively, the columns parameter must contain the column indices when the 'noHeader' option is set to true.

ellipse_fit2d.m

function [data] = ellipse_fit2d(PC) This function fits an ellipse to some data given by PC. Input Params: PC - this is an Mx2 matrix of x, y coordinates that specify a region Output Params: data - this is a structure that contains the information about the ellipse as follows: data.Orientation - the principle direction of the ellipse data.MajorAxisLength - length along the principle direction data.MinorAxisLength - length along the minor axis data.Centroid - this is an 1x2 vector of x and y coordinates data.Area - this is the length of the data 'PC', i.e. the number of pixels for that sector. Dr. A. I. Hanna (2006).

microOrientate.m

normHistForLength.m

normalise histogram for line lengths at different angles (45 degrees line should count for mor than a vert or hori line).

normalise.m

NORMALISE - Normalises image values to 0-1, or to desired mean and variance Usage: n = normalise(im) Offsets and rescales image so that the minimum value is 0 and the maximum value is 1. Result is returned in n. If the image is colour the image is converted to HSV and the value/intensity component is normalised to 0-1 before being converted back to RGB. n = normalise(im, reqmean, reqvar) Arguments: im - A grey-level input image. reqmean - The required mean value of the image. reqvar - The required variance of the image. Offsets and rescales image so that it has mean reqmean and variance reqvar. Colour images cannot be normalised in this manner.

plotridgeorient.m

PLOTRIDGEORIENT - plot of ridge orientation data Usage: plotridgeorient(orient, spacing, im, figno) orientim - Ridge orientation image (obtained from RIDGEORIENT) spacing - Sub-sampling interval to be used in ploting the orientation data the (Plotting every point is typically not feasible) im - Optional fingerprint image in which to overlay the orientation plot. figno - Optional figure number for plot A spacing of about 20 is recommended for a 500dpi fingerprint image See also: RIDGEORIENT, RIDGEFREQ, FREQEST, RIDGESEGMENT

rad2deg.m

rayleigh.m

critical z val for alpha=0.05, for n = inf is 2.9957. if z > 2.9957 reject H0.

ridgeOrientationPaul.m

squaring the gradient vectors: Kass and Witkin "Analysing oriented patterns" Computer Vision, Graphics and Image Processing, vol. 37, pp. 362-385, 1987. sigmas need to be odd

ridgeorientation.m

Arguments: im - A normalised input image. gradientsigma - Sigma of the derivative of Gaussian used to compute image gradients. blocksigma - Sigma of the Gaussian weighting used to sum the gradient moments. orientsmoothsigma - Sigma of the Gaussian used to smooth the final orientation vector field. Returns: orientim - The orientation image in radians. Orientation values are +ve clockwise and give the direction *along* the ridges.

ridgesegment.m

RIDGESEGMENT - Normalises fingerprint image and segments ridge region Function identifies ridge regions of a fingerprint image and returns a mask identifying this region. It also normalises the intesity values of the image so that the ridge regions have zero mean, unit standard deviation. This function breaks the image up into blocks of size blksze x blksze and evaluates the standard deviation in each region. If the standard deviation is above the threshold it is deemed part of the fingerprint. Note that the image is normalised to have zero mean, unit standard deviation prior to performing this process so that the threshold you specify is relative to a unit standard deviation. Usage: [normim, mask, maskind] = ridgesegment(im, blksze, thresh) Arguments: im - Fingerprint image to be segmented. blksze - Block size over which the the standard deviation is determined (try a value of 16). thresh - Threshold of standard deviation to decide if a block is a ridge region (Try a value 0.1 - 0.2) Returns: normim - Image where the ridge regions are renormalised to have zero mean, unit standard deviation. mask - Mask indicating ridge-like regions of the image, 0 for non ridge regions, 1 for ridge regions. maskind - Vector of indices of locations within the mask. Suggested values for a 500dpi fingerprint image: [normim, mask, maskind] = ridgesegment(im, 16, 0.1) See also: RIDGEORIENT, RIDGEFREQ, RIDGEFILTER

trklib_csv2track.m

CSV2TRACK(filename) Extract the data from a csv file create with the point_tracking python tool and convert it for the TrackingToolbox

vTest.m

v-test to test whether the observed angles have a tendency to cluster around a given angle. data is a vector of angles in degrees, modified for axial data. for alpha = 0.05 n=1000 vScore crit val is 1.6449

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\CellData

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Logs

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Movies

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\OldParameters

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\OldParameters\FlipCell

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\OldParameters\LayerFlipCell17

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\OldParameters\LayerFlipCell37

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\OldParameters\LayerFlipping

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\OldParameters\LayerFlippingSides

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\OldParameters\NoFlipCell

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\OldParameters\NoFlipCellReal17

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\OldParameters\NoFlipCellReal17For3D

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\OldParameters\NoFlipCellReal37

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\OldParameters\NoFlipCellReal37For3D

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\OldParameters\NoFlipCellReal4

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\OldParameters\NoFlipCellReal6a

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\OldParameters\Transmission

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\OldParameters\TransmissionCellReal17For3D

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\OldParameters\TransmissionCellReal37For3D

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\OldParameters\TransmissionFlipCell17

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\OldParameters\TransmissionFlipCell37

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\OldParameters\TransmissionReal

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\POV-Renders

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\DoubleCrosslinks

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\DoubleCrosslinks\CellData

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\DoubleCrosslinks\Logs

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\DoubleCrosslinks\Movies

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\DoubleCrosslinksReal

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\DoubleCrosslinksReal\CellData

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\DoubleCrosslinksReal\Logs

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\DoubleCrosslinksReal\Movies

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\DoubleCrosslinksRectangle

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\DoubleCrosslinksRectangle\CellData

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\DoubleCrosslinksRectangle\Logs

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\DoubleCrosslinksRectangle\Movies

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\LengthDependentCat

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\LengthDependentCat\CellData

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\LengthDependentCat\Logs

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\LengthDependentCat\Movies

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\OnePlaneCollisions

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\OnePlaneCollisions\CellData

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\OnePlaneCollisions\Logs

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\OnePlaneCollisions\Movies

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\TuringCopyTest

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\TuringCopyTest\CellData

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\TuringCopyTest\Logs

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\TuringCopyTest\Movies

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\TuringCrosslinks

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\TuringCrosslinks\CellData

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\TuringCrosslinks\Logs

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\TuringCrosslinks\Movies

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\TuringDiffusion

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\TuringDiffusion\CellData

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\TuringDiffusion\Logs

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\TuringDiffusion\Movies

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\TuringHysteresis

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\TuringLocalCrossNoNuc

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\TuringLocalCrossNoNuc\CellData

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\TuringLocalCrossNoNuc\Logs

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\TuringLocalCrossNoNuc\Movies

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\TuringLocalCrosslinks

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\TuringLocalCrosslinks\CellData

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\TuringLocalCrosslinks\Logs

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\TuringLocalCrosslinks\Movies

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\TuringLocalCrosslinksReal

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\TuringLocalCrosslinksReal\CellData

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\TuringLocalCrosslinksReal\Logs

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\TuringLocalCrosslinksReal\Movies

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\TuringLocalCrosslinksRectangle

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\TuringLocalCrosslinksRectangle\CellData

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\TuringLocalCrosslinksRectangle\Logs

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\Parameters\TuringLocalCrosslinksRectangle\Movies

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\PicklingJar

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\build

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\build\temp.macosx-10.3-fat-2.6

## C:\Users\AB\DArT_Toolshed\Toolboxes\PyMicrotubules\pymt\build\temp.macosx-10.5-i386-2.6

## C:\Users\AB\DArT_Toolshed\Toolboxes\SectorAnalysisToolbox

## C:\Users\AB\DArT_Toolshed\Toolboxes\SectorAnalysisToolbox\DisplayFunctions

satdisp_list.m

function satdisp_list A function that lists the display functions for SAToolbox Dr. A. I. Hanna (2007)

satdisp_sector_coverage.m

function varargout = satdisp_sector_coverage(varargin) Display method for showing the proportion of the petal covered by sectors in the SA toolbox Usages: satdisp_sector_coverage('parent', gca); Dr. A. I. Hanna (2007)

## C:\Users\AB\DArT_Toolshed\Toolboxes\SectorAnalysisToolbox\IOFunctions

satio_export_av_grid_data_to_excel.m

function satio_export_av_grid_data_to_excel A function that exports the average sector data for a grid to a file. See also: satio_list Dr. A. I. Hanna (2007)

satio_export_growth_data_to_excel.m

function satio_export_growth_data_to_excel A function that exports the growth data from an ungrowth file to excel See also: satio_list Dr. A. I. Hanna (2007)

satio_list.m

function satio_list A function that lists all the I/O functions for SectorAnalysisToolbox Dr. A. I. Hanna (2007)

satio_load_mean_shape.m

function satio_load_mean_shape A method that loads the mean shape for the current project, if the mean shape does not exist, the function returns an empty matrix. See also: satio_list Dr. A. I. Hanna (2007)

satio_load_ungrowth.m

function varargout = satio_load_ungrowth(varargin) IO Method for loading ungrowth data in the SA toolbox Usages: ungrowth_data = satlib_load_ungrowth('filename', filename); or ungrowth_data = satlib_load_ungrowth; See also: satio_list Dr. A. I. Hanna (2007)

satio_load_warped_sector_info.m

function varargout = satio_load_warped_sector_info(varargin) IO Method for loading warped sector data in the SA toolbox Usages: warped_sector_info = satio_load_warped_sector_info('organ_directory', direc); or warped_sector_info = satio_load_warped_sector_info; See also: satio_list Dr. A. I. Hanna (2007)

satio_meshes2GrowthData.m

satio_opengrid.m

function varargout = satio_opengrid(varargin) i/o function for loading grids in the SA toolbox Usage: grid = satlib_opengrid('filename', filename); or grid = satlib_opengrid; See also: satio_list Dr. A. I. Hanna (2007)

satlib_individualsectorStats2Excel.m

satlib_sectorStats2Excel.m

function satlib_sectorStats2Excel(varargin) Dr. A. I. Hanna, CMP, 2008.

## C:\Users\AB\DArT_Toolshed\Toolboxes\SectorAnalysisToolbox\LibraryFunctions

get_warped_stage_data.m

function [x, n] = get_warped_stage_data(stage_dir, number_of_pixels_per_cell) A function that takes a stage directory and a scalar that defines the number of pixels per cell. Returns the center of the bins and the frequency of a particular sector size for that stage. This can then be used in a histogram plot to stage images. Dr. A. I. Hanna (2006)

interpolateGrowthField.m

plot_grid_old.m

plot_mean_shape.m

rtable.m

satlib_drawGridData.m

function satlib_drawGridData(varargin) This method takes a grid and draws the growth information on the grid. Inputs: grid (default = []) colours (default = 'g') axish (default = []) edgecolor (default = 'k') tensorcol (default = 'k') Dr. A. I. Hanna, CMP & JIC, Norwich, UK, 2008

satlib_drawRegions.m

function figvec = satlib_drawRegions(varargin) Dr. A. I. Hanna, CMP, 2008.

satlib_plot_region_patches.m

satlib_plot_ungrowth_data.m

function satlib_plot_ungrowth_data(varargin) Shows the areal growth real and anisotropy for ungrowth data example 1 show_region_areal_growth; example 2 show_region_areal_growth('ungrowthfilename', 'Staged\Data\UngrowthData\Ungrowth_aih_001.mat', 'scale', 0); Dr. A. I. Hanna (2007)

satlib_warpRegularMesh.m

function figvec = satlib_warpRegularMesh(varargin) Generates and warps a regular grid according to the deformation of the supplied ungrown grids. Uses the motion coherence library to determine the warp. It has been proven that for sparse data sets the chosen regularizer in mctlib satisfies the two constraints for regularizers put forward by Yuille. Dr. A. I. Hanna, CMP, 2008

show_all_stages.m

show_average_ellipses_all_stages.m

show_average_ellipses_all_stages(mean_shape_dir, stage_dir) Dr. A. I. Hanna (2005);

show_average_ellipses_for_stage.m

show_average_ellipses_for_stage(mean_shape_dir, stage_dir) Dr. A. I. Hanna (2005);

show_average_stage_growth_rate.m

show_average_stage_growth_rate(mean_shape_dir, grid_name) Dr. A. I. Hanna (2005);

show_mean_sector_area.m

[ma] = show_mean_sector_area() Dr. A. I. Hanna (2005);

show_region_areal_growth.m

function show_region_areal_growth(varargin) Shows the areal growth real and anisotropy for ungrowth data example 1 show_region_areal_growth; example 2 show_region_areal_growth('ungrowthfilename', 'Staged\Data\UngrowthData\Ungrowth_aih_001.mat', 'scale', 0); Dr. A. I. Hanna (2007)

show_sectors_for_stage.m

stage_dir = 'Staged\P38\'; mean_shape_dir = 'Staged\Data';

show_stage_sector_info.m

show_stage_sector_info(mean_shape_dir, stage_dir) Dr. A. I. Hanna (2005);

show_variance_in_orientation.m

## C:\Users\AB\DArT_Toolshed\Toolboxes\SectorAnalysisToolbox\SectorAnalysisToolbox

## C:\Users\AB\DArT_Toolshed\Toolboxes\SectorAnalysisToolbox\SectorAnalysisToolbox\EdgeEditor

EdgeEditor.m

Hanna, 2005

## C:\Users\AB\DArT_Toolshed\Toolboxes\SectorAnalysisToolbox\SectorAnalysisToolbox\GridEditorTool

Copy of GridEditorTool.m

function [value] = GridEditorTool(varargin) Notes: every region must have at least 4 control points so we can find an inverse transform for the strain matrix. Hanna, 2005

GridEditorTool.m

function GridEditorTool(varargin) Notes: every region must have at least 4 control points so we can find an inverse transform for the strain matrix. Hanna, 2007

## C:\Users\AB\DArT_Toolshed\Toolboxes\SectorAnalysisToolbox\SectorAnalysisToolbox\GridFunctions

auto_regions.m

function auto_regions(reg_x, reg_y, Xm) A function that takes the number of regions in the x-direction

build_regions.m

function grid = build_regions(grid) A function that takes a grid and uses the region vertices and the control points to build the regions. Dr. A. I. Hanna (2007)

calcDeficientRegions.m

function [density, empty_regions] = calcDeficientRegions(T, pts, regions_ind, xydata) Dr. A. I. Hanna (2007)

calcRegionalGrowthTensors.m

for each region that is not empty, merge surrounding regions if they are empty.

calcStageGridCentroids.m

drawGrid_old.m

drawStageGrowthTensors.m

findRegionContainingTri.m

function id = findRegionContainingTri(regind, triid) Dr. A. I. Hanna (2007)

findTouchingTriangles.m

function tind = findTouchingTriangles(T, tri_in_region) Dr. A. I. Hanna (2007)

getCentroid.m

function centroid = getCentroid(r) Returns the centroid of a binary image. Dr. A. I. Hanna (2007)

getGridId.m

function curr_stage_ind = getGridId(organ_grid, stage) Dr. A. I. Hanna (2007)

getRegionCornerPts.m

grid2triangulation.m

function [T, tri_pts] = grid2triangulation(mature_grid) Dr. A. I. Hanna (2007)

init_grid.m

function grid = init_grid(grid) This function initializes the grid Dr. A. I. Hanna (2007)

interp_region_pts.m

makeExternalSprings.m

makeInternalSprings.m

makeRegionSprings.m

makeShapeSprings.m

makeSpringsFromTri.m

function [grid] = makeSpringsFromTri(grid) Dr. A. I. Hanna (2007)

merge_regions.m

function grid = merge_regions(grid, region_ind) A function that takes a grid and indices to the regions to merge. The function returns the new grid with the regions updates and automatically builds the springs. Dr. A. I. Hanna (2007)

optimizeGridForStagePair.m

order_xy_pts.m

function [rpts] = order_xy_pts(pts) Dr. A. I. Hanna (2006).

plot_adj_graph.m

plot_all_grid_stages.m

plot_centroids.m

plot_grid.m

function ph = plot_grid(grid, axish, i)

plot_region_density.m

plot_region_patches.m

plot_shape.m

plot_springs.m

plot_stage_grid.m

pts2binim.m

function [R] = pts2binim(pts) Given some Nx2 matrix of ordered points defining a shape this function call will return a PxQ binary image of the shape. Example theta = 0:.1:2*pi; x = 20*cos(theta) + 30; y = 10*sin(theta) + 30; R = pts2binim([x', y']); imagesc(R); Dr. A. I. Hanna (2005)

segmentOrgan.m

stage_info2average_region_info.m

triFindNeighbours.m

function regind = triFindNeighbours(T, tri_in_region) Dr. A. I. Hanna (2007)

validateGridForStage.m

Extract the triangulation information

## C:\Users\AB\DArT_Toolshed\Toolboxes\SectorAnalysisToolbox\SectorAnalysisToolbox\ImageProcessingTool

ImageProcessingTool.m

Hanna, 2005

## C:\Users\AB\DArT_Toolshed\Toolboxes\SectorAnalysisToolbox\SectorAnalysisToolbox\OptimiseGridTool

OptimiseGridTool.m

Hanna, 2005

## C:\Users\AB\DArT_Toolshed\Toolboxes\SectorAnalysisToolbox\SectorAnalysisToolbox\SATPlotOptionsTool

SATPlotOptionsTool.m

function SATPlotOptionsTool A small utility that allows the user to select some plot options before displaying the ungrowth data. Usage: >>SATPlotOptionsTool Dr. A. I. Hanna, CMP & JIC, Norwich, UK, 2008.

SATWarpParamsDlg.m

function SATWarpParamsDlg A small utility that allows the user to select some plot options before displaying the ungrowth data. Usage: >>SATWarpParamsDlg Dr. A. I. Hanna, CMP & JIC, Norwich, UK, 2008.

tri2boundary.m

triplotedges.m

SectorAnalysisToolbox.m

function SectorAnalysisToolbox Example: SectorAnalysisToolbox; Dr. A. I. Hanna (2007) CMP, UEA, 2008.

SectorAnalysisToolboxOLD.m

Hanna, 2005 Global figure handles

## C:\Users\AB\DArT_Toolshed\Toolboxes\SectorAnalysisToolbox\SectorAnalysisToolbox\SectorAreaTool

SectorTool.m

function SectorAreaTool(varargin) Notes: every region must have at least 4 control points so we can find an inverse transform for the strain matrix. Hanna, 2007

## C:\Users\AB\DArT_Toolshed\Toolboxes\SectorAnalysisToolbox\SectorAnalysisToolbox\SectorEditorTool

SectorEditorTool.m

function [value] = SectorEditorTool(varargin) This is the sector editor tool, it allows the user to erode, dilate, merge, delete add sectors. You can also edit the point model for the organ and you can recalculate any of the sectors and organs at any time. Dr. A. I. Hanna (2007)

## C:\Users\AB\DArT_Toolshed\Toolboxes\SectorAnalysisToolbox\SectorAnalysisToolbox\SectorWarpingTool

SectorWarpingTool.m

Hanna, 2005

warpSectorsViaTriangles.m

warpSectorsViaTrianglesConcave.m

## C:\Users\AB\DArT_Toolshed\Toolboxes\SectorAnalysisToolbox\SectorAnalysisToolbox\SegmentationAlgorithms

Erika_CellDivisionPlanes.m

GFP_confocal.m

do some image normalise - (don't really need to do this tho)

GFP_confocal_MSE.m

do some image normalise - (don't really need to do this tho)

JRK_sectors.m

amelia_petal_sectors.m

#function checknargin clear all; w = waitbar(0, 'Testing...'); im = imread('C:\Documents and Settings\aih\My Documents\post_doc\amelia\Images\StagedTestSet\S4\P10F15P1I.JPG'); im = imread('C:\Documents and Settings\aih\My Documents\post_doc\amelia\Images\StagedTestSet\S4\P7F22P1I.JPG'); im = imread('C:\Documents and Settings\aih\My Documents\post_doc\amelia\Images\StagedTestSet\S1\P12F8P1I.JPG'); im = imread('C:\Documents and Settings\aih\My Documents\post_doc\amelia\Images\StagedTestSet\S4\P12F18P1I.JPG'); im = imread('C:\Documents and Settings\aih\My Documents\post_doc\amelia\Images\StagedTestSet\S4\P10F17P1I.JPG'); im = imread('C:\Documents and Settings\aih\My Documents\post_doc\amelia\Images\StagedTestSet\S3\P12F12P1I.JPG'); im = imread('C:\Documents and Settings\aih\My Documents\post_doc\amelia\Images\P7\P21F11-2P1I_small_cluster.JPG'); im = imread('C:\Documents and Settings\aih\My Documents\post_doc\amelia\Images\P7\F33F3082_cells.JPG'); im = imresize(im, .5);

sandra_leaf_sectors.m

sandra_leaf_