Kevin Mader
21 August 2015
Control of in vitro tissue-engineered bone-like structures using human mesenchymal stem cells and porous silk scaffolds in Biomaterials 2007 by Sandra Hofmann, et. al
Inspired by: imagej-pres
Proper processing and quantitative analysis is however much more difficult with images.
Furthermore in image processing there is a plethora of tools available
Thousands of algorithms available
Thousands of tools
Many images require multi-step processing
Experimenting is time-consuming
Look for potentially cancerous nodules in the following lung image, taken from NPR
Which center square seems brighter?
Are the intensities constant in the image?
Science demands repeatability! and really wants reproducability
Easy to follow the list, anyone with the right steps can execute and repeat (if not reproduce) the soup
Here it is harder to follow and you need to carefully keep track of what is being performed
Clearly a linear set of instructions is ill-suited for even a fairly easy soup, it is then even more difficult when there are dozens of steps and different pathsways
Furthermore a clean workflow allows you to better parallelize the task since it is clear which tasks can be performed independently
A very abstract definition: A pairing between spatial information (position) and some other kind of information (value).
In most cases this is a 2 dimensional position (x,y coordinates) and a numeric value (intensity)
| x | y | Intensity |
|---|---|---|
| 1 | 1 | 44 |
| 2 | 1 | 12 |
| 3 | 1 | 13 |
| 4 | 1 | 48 |
| 5 | 1 | 97 |
| 1 | 2 | 1 |
This can then be rearranged from a table form into an array form and displayed as we are used to seeing images
The next step is to apply a color map (also called lookup table, LUT) to the image so it is a bit more exciting
Which can be arbitrarily defined based on how we would like to visualize the information in the image
Formally a lookup table is a function which \[ f(\textrm{Intensity}) \rightarrow \textrm{Color} \]
These transformations can also be non-linear as is the case of the graph below where the mapping between the intensity and the color is a \( \log \) relationship meaning the the difference between the lower values is much clearer than the higher ones
On a real image the difference is even clearer
Changing a 'lookup table' can also be called “Normalization”, “Equalization”, “Auto-Enhance” and many other names. It must be used very carefully when displaying scientific results.
\[ \Downarrow \textrm{After} \]
For a 3D image, the position or spatial component has a 3rd dimension (z if it is a spatial, or t if it is a movie)
| x | y | z | Intensity |
|---|---|---|---|
| 1 | 1 | 1 | 31 |
| 2 | 1 | 1 | 93 |
| 3 | 1 | 1 | 26 |
| 1 | 2 | 1 | 98 |
| 2 | 2 | 1 | 99 |
| 3 | 2 | 1 | 28 |
This can then be rearranged from a table form into an array form and displayed as a series of slices
Control of in vitro tissue-engineered bone-like structures using human mesenchymal stem cells and porous silk scaffolds in Biomaterials 2007 by Sandra Hofmann, et. al
tissue engineered bone-like structure resulting from silk fibroin (SF) implants is pre-determined by the scaffolds’ geometry
SF scaffolds with different pore diameters were prepared and seeded with human mesenchymal stem cells (hMSC). As compared to static seeding, dynamic cell seeding in spinner flasks resulted in equal cell viability and proliferation, and better cell distribution throughout the scaffold as visualized by histology and confocal microscopy
Natural bone consists of cortical and trabecular morphologies, the latter having variable pore sizes. This study aims at engineering different bone-like structures using scaffolds with small pores (112–224 μm) in diameter on one side and large pores (400–500 μm) on the other, while keeping scaffold porosities constant among groups. We hypothesized that tissue engineered bone-like structure resulting from silk fibroin (SF) implants is pre-determined by the scaffolds’ geometry. To test this hypothesis, SF scaffolds with different pore diameters were prepared and seeded with human mesenchymal stem cells (hMSC). As compared to static seeding, dynamic cell seeding in spinner flasks resulted in equal cell viability and proliferation, and better cell distribution throughout the scaffold as visualized by histology and confocal microscopy, and was, therefore, selected for subsequent differentiation studies. Differentiation of hMSC in osteogenic cell culture medium in spinner flasks for 3 and 5 weeks resulted in increased alkaline phosphatase activity and calcium deposition when compared to control medium. Micro-computed tomography (μCT) detailed the pore structures of the newly formed tissue and suggested that the structure of tissue-engineered bone was controlled by the underlying scaffold geometry.
Copyright 2003-2013 J. Konrad in EC520 lecture, reused with permission
\[ \left[\left([b(x,y)*s_{ab}(x,y)]\otimes h_{fs}(x,y)\right)*h_{op}(x,y)\right]*h_{det}(x,y)+d_{dark}(x,y) \]
\( s_{ab} \) is the only information you are really interested in, so it is important to remove or correct for the other components
For color (non-monochromatic) images the problem becomes even more complicated \[ \int_{0}^{\infty} {\left[\left([b(x,y,\lambda)*s_{ab}(x,y,\lambda)]\otimes h_{fs}(x,y,\lambda)\right)*h_{op}(x,y,\lambda)\right]*h_{det}(x,y,\lambda)}\mathrm{d}\lambda+d_{dark}(x,y) \]
Since we know the modality, standard microscopy, we can simplify these equations a bit and basically say we have 4 primary sources of problems (warning this is a very strong oversimplification).
\[ \textrm{Output}_{image}= \left(\textbf{Illumination} * \textrm{Object}+\textbf{Dirt}\right) \otimes \textbf{PointSpreadFunction} + \textbf{CameraNoise} \]
We have refered to an object up until now, but what exactly does that mean? It depends heavily on what is being measured and how. the terms we use for this is contrast.
| Modality | Impulse..Characteristic | Response | Detection | |
|---|---|---|---|---|
| Light Microscopy | White Light | Electronic interactions | Absorption | Film, Camera |
| Phase Contrast | Coherent light | Electron Density (Index of Refraction) | Phase Shift | Phase stepping, holography, Zernike |
| Confocal Microscopy | Laser Light | Electronic Transition in Fluorescence Molecule | Absorption and reemission | Pinhole in focal plane, scanning detection |
| X-Ray Radiography | X-Ray light | Photo effect and Compton scattering | Absorption and scattering | Scintillator, microscope, camera |
| Ultrasound | High frequency sound waves | Molecular mobility | Reflection and Scattering | Transducer |
| MRI | Radio-frequency EM | Unmatched Hydrogen spins | Absorption and reemission | RF coils to detect |
| Atomic Force Microscopy | Sharp Point | Surface Contact | Contact, Repulsion | Deflection of a tiny mirror |
It is important to understand the contrasts well since that determines everything else for our further processing and interpretation of the images. Specifically we can focus on quantitative and qualitative contrasts.
\[ \textrm{Output}_{image}= \left(\textbf{Illumination} * \textrm{Contrast}_{Object}+\textbf{Dirt}\right) \otimes \textbf{PointSpreadFunction} + \textbf{CameraNoise} \]
How can we go from \( \textrm{Output}_{image} \) to just \( \textrm{Contrast}_{Object} \)?
Particularly when we have NO idea what
And very little idea about
All about recovering the object or contrast from the image \[ \textrm{Output}_{image}= \left(\textbf{Illumination} * \textrm{Contrast}_{Object}+\textbf{Dirt}\right) \otimes \textbf{PointSpreadFunction} +\\ \textbf{CameraNoise} \]
What would the perfect filter be
What most filters end up doing
Segmentation and all the steps leading up to it are really a specialized type of learning problem.
Returning to the ring image we had before, we start with our knowledge or ground-truth of the ring
Which we want to identify the from the following image by using image processing tools
What does identify mean?
We can then apply a threshold to the image to determine the number of points in each category
Try a number of different threshold values on the image and compare them to the original classification
| Thresh | TP | TN | FP | FN |
|---|---|---|---|---|
| 0.0 | 224 | 0 | 217 | 0 |
| 0.2 | 224 | 26 | 191 | 0 |
| 0.4 | 214 | 88 | 129 | 10 |
| 0.6 | 148 | 174 | 43 | 76 |
| 0.8 | 57 | 215 | 2 | 167 |
| 1.0 | 0 | 217 | 0 | 224 |
| Thresh | TP | TN | FP | FN | Recall | Precision |
|---|---|---|---|---|---|---|
| 0.30 | 222 | 54 | 163 | 2 | 99 | 58 |
| 0.38 | 217 | 82 | 135 | 7 | 97 | 62 |
| 0.46 | 204 | 115 | 102 | 20 | 91 | 67 |
| 0.54 | 174 | 151 | 66 | 50 | 78 | 72 |
| 0.62 | 137 | 182 | 35 | 87 | 61 | 80 |
| 0.70 | 105 | 205 | 12 | 119 | 47 | 90 |
Reciever Operating Characteristic (first developed for WW2 soldiers detecting objects in battlefields using radar). The ideal is the top-right (identify everything and miss nothing)
We can then use this ROC curve to compare different filters (or even entire workflows), if the area is higher the approach is better.
Different approaches can be compared by area under the curve
Another way of showing the ROC curve (more common for machine learning rather than medical diagnosis) is using the True positive rate and False positive rate
These show very similar information with the major difference being the goal is to be in the upper left-hand corner. Additionally random guesses can be shown as the slope 1 line. Therefore for a system to be useful it must lie above the random line.
While finding a ring might be didactic, it is not really a relevant problem and these terms are much more meaningful when applied to medical images where every False Positives and False Negative can be mean life-threatening surgery or the lack thereof. (Data courtesy of Zhentian Wang)
From these images, an expert labeled the calcifications by hand, so we have ground truth data on where they are:
We can perform the same analysis on an image like this one, again using a simple threshold to evalulate how accurately we identify the calcifications
| Thresh | TP | TN | FP | FN | Recall | Precision |
|---|---|---|---|---|---|---|
| 7 | 2056 | 13461 | 74483 | 0 | 100 | 3 |
| 23 | 2030 | 25806 | 62138 | 26 | 99 | 3 |
| 34 | 1950 | 38744 | 49200 | 106 | 95 | 4 |
| 42 | 1726 | 51676 | 36268 | 330 | 84 | 5 |
| 48 | 1435 | 64161 | 23783 | 621 | 70 | 6 |
| 54 | 1043 | 76363 | 11581 | 1013 | 51 | 8 |
\[ I_{measured}(\vec{x}) = F_{system}(I_{stimulus}(\vec{x}),S_{sample}(\vec{x})) \]
\( \longrightarrow \alpha(\vec{x})=\frac{I_{measured}(\vec{x})}{\textrm{Beam}_{profile}(\vec{x})} \)
In many setups there is un-even illumination caused by incorrectly adjusted equipment and fluctations in power and setups
Frequently there is a fall-off of the beam away from the center (as is the case of a Gaussian beam which frequently shows up for laser systems). This can make extracting detail away from the center challenging
For absorption/attenuation imaging \( \rightarrow \) Beer-Lambert Law \[ I_{detector} = \underbrace{I_{source}}_{I_{stimulus}}\underbrace{\exp(-\alpha d)}_{S_{sample}} \]
For segmentation this model is:
to a single, discrete value (usually true or false, but for images with phases it would be each phase, e.g. bone, air, cellular tissue)
2560 x 2560 x 2160 x 32 bit = 56GB / sample \[ \downarrow \]
2560 x 2560 x 2160 x 1 bit = 1.75GB / sample
Start out with a simple image of a cross with added noise
\[ I(x,y) = f(x,y) \]
The intensity can be described with a probability density function
\[ P_f(x,y) \]
By examining the image and probability distribution function, we can deduce that the underyling model is a whitish phase that makes up the cross and the darkish background
Applying the threshold is a deceptively simple operation
\[ I(x,y) = \begin{cases} 1, & f(x,y)\geq0.5 \\ 0, & f(x,y)<0.5 \end{cases} \]
One of the most repeated criticisms of scientific work is that correlation and causation are confused.
There are two broad classes of data and scientific studies.
We examined 100 people and the ones with blue eyes were on average 10cm taller
In 100 cake samples, we found a 0.9 correlation between cooking time and bubble size
We examined 50 mice with gene XYZ off and 50 gene XYZ on and as the foot size increased by 10%
We increased the temperature and the number of pores in the metal increased by 10%
Since most of the experiments in science are usually specific, noisy, and often very complicated and are not usually good teaching examples
We normally assume
Once the reproducibility has been measured, it is possible to compare groups. The idea is to make a test to assess the likelihood that two groups are the same given the data
We have 1 coin from a magic shop
| Number of Flips | Probability of All Heads Given Null Hypothesis (p-value) |
|---|---|
| 1 | 50 % |
| 5 | 3.1 % |
| 10 | 0.1 % |
How good is good enough?
Since we do not usually know our distribution very well or have enough samples to create a sufficient probability model
We assume the distribution of our stochastic variable is normal (Gaussian) and the t-distribution provides an estimate for the mean of the underlying distribution based on few observations.
Incorporates this distribution and provides an easy method for assessing the likelihood that the two given set of observations are coming from the same underlying process (null hypothesis)
Back to the magic coin, let's assume we are trying to publish a paper, we heard a p-value of < 0.05 (5%) was good enough. That means if we get 5 heads we are good!
| Number of Flips | Probability of All Heads Given Null Hypothesis (p-value) |
|---|---|
| 1 | 50 % |
| 4 | 6.2 % |
| 5 | 3.1 % |
| Number of Friends Flipping | Probability Someone Flips 5 heads |
|---|---|
| 1 | 3.1 % |
| 10 | 27.2 % |
| 20 | 47 % |
| 40 | 71.9 % |
| 80 | 92.1 % |
Clearly this is not the case, otherwise we could keep flipping coins or ask all of our friends to flip until we got 5 heads and publish
The p-value is only meaningful when the experiment matches what we did.
Many methods to correct, most just involve scaling \( p \). The likelihood of a sequence of 5 heads in a row if you perform 10 flips is 5x higher.
This is very bad news for us. We have the ability to quantify all sorts of interesting metrics
So lets throw them all into a magical statistics algorithm and push the publish button
With our p value of less than 0.05 and a study with 10 samples in each group, how does increasing the number of variables affect our result
Using the simple correction factor (number of tests performed), we can make the significant findings constant again
So no harm done there we just add this correction factor right? Well what if we have exactly one variable with shift of 1.0 standard deviations from the other.