Coming Soon.
July 8, 2009
The comparing of normal growth and irregular growth of mammalian tissue via Fractal Dimensions.
June 24, 2009
Box counting to determine the fractal dimension.
In this post, I am going to be referring to many sites and journals to clarify a couple of points The images are Hyperlinks to sources and listed in the “database” page on our home page:
- The definition of the term “Fractal Dimension.”
- Method to determine the Fractal Dimension.
The simple mathematical derivation of how we get “Dimension” and ‘my’ mathematical definition of “Fractal” and “Dimension.”
Putting geometric dimension in my wording is is any theoretical void divided by 3 hypothetical vectors in space perpendicular to each other in respective planes. The vectors are present to quantify the relative distance between theoretical locations (coordinates) in space in terms of 6 directions: Up, Down, Left, Right, Back, and Forward. The distance is measured in unit lengths. The relationship with any unit length in space that is being discussed in the following text is of self similar objects, fractals. Take for example a mere square, 4 perpendicular lines is also considered a fractal in the sense no matter into how many boxes you divide it up into, the general shape is of that a square. Let us examine a square with the following dimensions: 4 units x 4 units. It takes four 2 unit x 2 unit to fill it up. Each 2 unit x 2 unit box’s side length is of 1/2 the original box’s. It takes sixteen boxes of the side length 1 unit x 1 unit to fill the original 4 unit by 4 unit square. This leads to a particular relationship…
(Number of boxes) = (The magnification needed*)^(D)
Where D is the Dimension.
For example….
4 = 2^D *When the total of 4 boxes were needed to cover the Big Square, the small boxes were 1/2 the size in area, so each side length of the small box needed to be magnified 2x.
16 = 4^D *When a total of 16 boxes were needed to cover the big square, the small boxes were 1/16 the size in area, so each side length needed to be magnified 4x.
General formula for Dimension reduces to: Log N(r) / Log (r) = D
Where N(r) = total Number of shapes present.
(r) = The inverse size ratio of the sub-shapes.
When we solve for D in each case, we get 2, an expected value due to its presence in the 2nd Dimension in Euclidean geometry’s perspective. As the iteration goes on, one can see the relationship in the general formula, as the size of the squares that fills up the big square reduces each time by half (length, but 1/4 by area) the constant exponent D remains the same: 2. But in what situations does the D value becomes a non integer? What does the shape look like when D is between 1-2 or 2-3? This general rule can be used for all self similar shapes, even ones that reduce in area over iterations due to the “algorithm”– pattern — that is being iterated, for example Sierpinski Triangle, and even shapes in what we call 3D– fractals in 3D as well — just count how many sub-cubes rather than sub-squares make up the geometric shape! Let us examine Sierpinski’s Triangle as an example where the dimension falls between two integers.
This fractal shape is formed by one original triangle side’s midpoints connected to create 4 sub-triangles within. The same division is done to the three triangles inside (minus the middle triangle). The figures below describe the iteration by images. In the images, the black triangles are representing empty space, because the pattern only accounts for the peripheral triangles’ area. But as one can see, easily, as iterations increases the area compared to the original triangle decreases substantially, approaching zero, with each iteration (simply measure the black spaces verses the white spaces), but the perimeter of the shape increases dramatically approaching infinity — A definition by Mandlebrot of a Fractal.
Mathematically, for the 2nd triangle in the sequence, lets use the same concept we used above to calculate the fractal dimension of this irregular shape. There are a total of 3 triangles present in each iteration of a particular triangle, and each triangle’s side length is 1/2 it’s original triangle’s length (so it has to be multiplied by 2)…. hence we get:
3 = 2^D
Log 3 = Log 2^D
Log 3 = D Log 2
Log 3 / Log 2 = D = 1.585 This value makes a lot of sense because we expect a value between 1 and 2, a line (perimeter) of a 2D shape, hence between the 1st and 2nd dimension. This is Sierpinski Triangle’s fractal dimension. The next post is going to be of a 3D fractal and determining its fractal dimension, the same 3D checkered cube I had submitted matrices, coordinates, and visual pictures of in the “Programming Aspect” sister site.
Method to determine the Fractal Dimension.
Box counting is one method. It was also the method mentioned in “Fractals and Cancer,” an entry indexed in our database. This method uses the same concept as by the definition determined by the relationship between the intervals “r” on the length verses the total number of shapes “N(r)”. The concept centers around how many boxes of a particular size cover the irregular shape. Same idea: Log (number of boxes covering the shape) / Log (size of the box) = Fractal Dimension. This box counting method is an approximation of it’s fractal dimension, because when a grid of boxes is overlaid a line or shape, there is a margin of error, where the two do not over lap. This means to get a better approximation of the fractal dimension we need to get many box dimensions from different –proportionately different boxes–or smaller and smaller boxes (means a larger number of boxes covering the shape) for higher overlapping accuracy. To analyze this simple phenomenon Take for example the ‘Box fractal’.


Initiator and Generator Respectively.
In this shape, the initiator is a 2D box shape subdivided into a checkered pattern (similar to the 3D cube submitted in the other site). In the one initial box, there are 5 sub boxes, each with 1/3 the side length of the original box. The fractal dimension hence is Log 5 / Log 3 = 1.46. To apply the box counting method, we will cover the pattern over a grid where boxes overlap the shape at various magnifications by various size (large to small). The first generator (A 5 square checkered pattern), is covered by 5 squares from the grid each with 1/3 the side length (Log 5 / Log 3). In the next magnification, 25 grid boxes cover the pattern, but here the grid boxes are with 1/9 the side length of the original box (Log 25 / Log 9). With another magnification One can see 125 boxes covered when the grid box side lengths are 1/27 of the original box. This example is a simple accurate, simple one because the shape we are measuring is itself a box derivative.
With curves such as the Koch Snow Flake, will not always have proportional boxes covering it at different magnification. Hence we would have to take the average of all the box dimensions calculated via the box counting method, easily by graphing our results and taking the linear regression, the slope will be our estimated fractal dimension. Here is an example of a Log to Log plot for determining the fractal dimension for the Koch Snow Flake and illustrations for further ease of understanding.

Initiator and Generator Respectively



Above is the formula to create a Koch Curve. The expected fractal dimension of such curve should be approximately Log 4 / Log 3 = 1.26. There are 4 line segments in the generator, each of which being 1/3 the size of the initiator. The method to obtain it’s box dimension is as follows. First cover the Curve with relatively big boxes and continue to smaller and smaller boxes as shown below:
Take the Slope of the linear regression line and that is our rough approximation of the fractal dimension of the shape/ pattern. Here is an example of a Log to Log plot.
dimension (experimental) = 1.18
dimension (analytical) = 1.26
deviation = 6%
June 24, 2009
The Z-axis.
I recently had a chance to visit a doctor, specifically a radiologist who kindly welcomed me to a real live radiologist setting and exposure to total anonymous CT scans of the various human body parts. An awesome experience in itself, but most of all, a very valuable experience. We, or at least I specifically, have been imagining the images to be in 2D, which the CT scans are, but of a 3D organ. The scan’s very valuable when you see the dissection of the organs, in other words the sequencing/ flipping through the images that layer up to a 3D model of the organ(s) in questions. This way you can see a transitional difference between the pictures.
In my previous post, I suggested a method, using matrices to vectorize an image and enable to transfer the image to a coordinate plane so distance between points, and other mathematical calculations that deal with numerical values may be conducted (Ex: the fractal dimension of a sampled area of the organ in question, angle of the vascular branching, thickness, etc.). In the previous post I was only accounting for a 2D image that I assumed we’d be presented with. However correct that assumption was, I didn’t think (of reasons why I cannot phantom why I didn’t think…) that we would not be supplied with just one 2D image, rather a several hundred series of 2D images, when stacked producing a 3D image.
One thing I realized with the scans were, if I took the organ under consideration only in 2D, analyzing a specific disection image of the organ, the image pattern wouldn’t be the same if I took another CT scan of the body in question and analyzed it at the same location, even at the same relative time period (one after the other). For example, a CT image of the mid section of the lungs of a human patient (either view, arial or flat front view) couldn’t look the same because of the curvature of the human back when it lays down inside the machine, and the non- exact positioning of the patient into the machine. In the arial view of the CT image, there would be a slight rotation on the spinal cord, acting like the Z-axis– in one scan the patient may be favoring his left side more than his right on his back. The front view wouldn’t account for depth at which the veins and alveoli ducts reside ‘into’ the body, but will only account for the width of the lung as a whole and the height of the lung, not the depth (that would only be accounted for when you compile all the 2D image to see a 3D view of the lung). In the arial 2D view, the Z axis is not accounted for. If we look at the image in the flat front-on view, the Y axis is not accounted for. In an upright vertical human the X-axis is the width of the body, Z-axis the height of the body, and Y-axis is the depth of the body.
This is a problem. In our visual representation, we need to account for the Z axis, the 3rd dimension of the organ as a whole, or else our data will be inaccurate and most likely inconsistent like the pattern we might observe if we only take the 2D section image of the organ under consideration. If we account for the 3rd dimension, then the pattern of the vascular system, will be much more accurately displayed, because the only way the image or CT scan in a 3D representation can be different here is not by orientation of the patient under observation, but rather with tissue growth. Tissue growth or damage will cause significant alterations in the subject’s 3D model, and that is what we hope to monitor and detect caused by cancer.
I thought of a simple plan to attempt modeling the CT scans onto a coordinate plane in 3D. It is identical to the previous method, but with a slight addition. Since each image is 2D, compiled to make a 3D model of the organ, we can implement the matrix as layers. Stack the matrix on top of each other which each layer gives one value to the Z coordinate. For example, layer one of the first image from a CT archive, the coordinate will be something like (X, Y, 1), then for the second image, (X, Y, 2). This way it will be adding the pixels at values on each 1 unit interval on the Z-axis, litearlly layering the 3D pattern up.
I am hoping with two scans of the same specimen under a CT with no carcinogen induced will render a very very similar 3D pattern of the organ in both trials. then induce the carcinogen and see the difference.








