1. Non-transitory computer-readable storage media having instructions stored thereon that, when executed by a processor, perform a method comprising: acquiring an N-dimensional digital image representative of a medical image, said image comprising a plurality of data items associated with an N-dimensional domain of points; constructing a directed graph from the N-dimensional digital image, wherein each point of said image is associated with a vertex of said directed graph and said directed graph includes a directed edge connecting each vertex to all adjacent vertices corresponding to adjacent points in said image, wherein the directed edge has a direction toward the adjacent vertex; calculating a plurality of cost functions, wherein each calculated cost function of the plurality of cost functions is related to each directed edge; constructing an electrical network based upon the constructed directed graph and the plurality of cost functions, wherein one or more points in the graph are connected to a source node and one or more points in the graph are connected to a sink node, wherein the electrical network comprises operational rules including current-voltage behavior; generating a set of nodes in the electrical network and associating the nodes to a set of vertices in the constructed directed graph; generating a set of devices in the electrical network and associating the devices with a set of edges in the constructed directed graph, wherein the devices are governed by a set of current-voltage characteristics, the current-voltage characteristics based upon a set of edge weights; simulating the electrical network to estimate a minimum-weight s-t cut using fixed-point linearization approximation, wherein the approximation is executed, in part, by using a software library configured for obtaining a solution with a generalized minimal residual technique; segmenting the N-dimensional digital image based upon the simulating to produce segmented layers; and wherein the current-voltage behavior, between pairs of nodes in the simulated electrical network, is defined as: I ij ⁡ ( x ij ) = m ij ⁢ x ij 1 +  x ij  + δ ij for the nodes in the network, x=(x 1 ,. .. x |v| ), wherein differences in voltages between two nodes is represented as x ij =x i −x j , where: m ij = w ij + w ji 2 and δ ij = w ij - w ji 2 wherein i and j are vertices in the directed graph or nodes in the simulated electrical network, w ij is a weight of the directed edge (i, j), x is a vector representing electrical voltages at a defined node in the simulated electrical network, wherein w ij is the weight of the edge in the direction from i to j and w ij is the weight of the edge in the direction from j to i, δ ij and m ij are defined mathematically with in terms of w ij and w ji I represents current.