DOI: 10.6084/m9.figshare.3517844.v1
title: Supplement 1. MATLAB script files used to perform directional connectivity analyses.

description: File List connectivity_at_angle.m (md5: d85ec9d7c9edef5b96547b1feaa5676d)<br> im2adjacency_skel.m (md5: cd2b6f656ca5cdf0e3cdf7d503a1d1d2)<br> im2adjacency_full.m (md5: e49831740baa47319badd0d0b481400c)<br> im2adjacency_skel_directed.m (md5: 0999a139e5950e85eb210c64340c2ee9)<br> im2adjacency_full_directed.m (md5: 197271a5cb5a93677aa2750053c1ef78)<br> DCIu.m (md5: ec00121fd1f1070c19955265754ee42a)<br> DCIw.m (md5: 6bea1965bf2ec8e04721666bef919eb3)<br> despur.m (md5: 9eb042f4b9491c94dfbedec33fcc23d0)<br> indicator_semivariogram.m (md5: 49fe0467f357015e12f4b8bc5346b5c0)<br> topoICS.m (md5: 850a32f25615a72be83ef0ffe8fdda6e) Description To run this source code, Matlab is needed, together with the Matlab Image Processing toolbox and the MatlabBGL library. The latter is open source and can be downloaded at http://dgleich.github.com/matlab-bgl/. To view the source code only, the files may be viewed as plain text. The codes are commented with descriptions of the variables and algorithms, with comments following the "%" symbol. Disclaimer: Unless noted otherwise, the codes below written by the USGS are public domain. See individual third-party library and package descriptions for intellectual property information, user agreements, and related information. Although the codes below have been used by the USGS, no warranty, expressed or implied, is made by the USGS as to the accuracy and functioning of such software and related material nor shall the fact of distribution constitute any such warranty, and no responsibility is assumed by the USGS in connection therewith. connectivity_at_angle.m: Computes a specified directional connectivity index at a bearing different from that of the image boundary. Calls to functions to create the adjacency or distance matrix or to compute the directional connectivity index of choice are contained within this function. im2adjacency_skel.m: Converts a binary image to undirected adjacency and distance matrices, using the skeleton network convention for defining links and nodes. im2adjacency_full.m: Converts a binary image to undirected adjacency and distance matrices, using the full network convention for defining links and nodes. im2adjacency_skel_directed.m: Converts a binary image to directed adjacency and distance matrices, using the skeleton network convention for defining links and nodes. im2adjacency_full_directed.m: Converts a binary image to directed adjacency and distance matrices, using the full network convention for defining links and nodes. DCIu.m: Calculates the unweighted directional connectivity index (DCI) from a distance matrix. DCIw.m: Calculates the distance-weighted directional connectivity index (DCI) from a distance matrix. despur.m: Called within connectivity_at_angle.m, this function corrects for spurs in the skeleton image that arise as artifacts after image rotation. indicator_semivariogram.m: Calculates the indicator semivariogram along the horizontal dimension of the input matrix. The range of the semivariogram is the output, given in number of pixels. To convert it to a dimensional range, it needs to be multiplied by dx. topoICS.m: Calculates the directional integral connectivity scale length, given in number of pixels. The direction along which it is computed is the horizontal dimension of the matrix (from left to right). To convert the integral connectivity scale to a dimensional length, it needs to be multiplied by dx.