Kevin Mader
23 April 2015
ETHZ: 227-0966-00L
M.E. Wolak, D.J. Fairbairn, Y.R. Paulsen (2012) Guidelines for Estimating Repeatability. Methods in Ecology and Evolution 3(1):129-137.
The course has covered imaging enough and there have been a few quantitative metrics, but “big” has not really entered.
What does big mean?
So what is “big” imaging
Going back to our original cell image
We have at least a few samples (or different regions), large number of metrics and an almost as large number of parameters to tune
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
A very broad topic with plenty of sub-areas and deeper meanings. We mean two things by reproducibility
The process of going from images to numbers is detailed in a clear manner that anyone, anywhere could follow and get the exact (within some tolerance) same numbers from your samples
Everything for analysis + taking a measurement several times (noise and exact alignment vary each time) does not change the statistics significantly
The basis for reproducible scripts and analysis are scripts and macros. Since we will need to perform the same analysis many times to understand how reproducible it is.
IMAGEFILE=$1
THRESHOLD=130
matlab -r "inImage=$IMAGEFILE; threshImage=inImage>$THRESHOLD; analysisScript;"
java -jar ij.jar -macro TestMacro.ijm blobs.tif
Rscript -e "library(plyr);..."
The intraclass correlation coefficient basically looking at how similar objects within a group are compared to between groups
ICC = \frac{S_A^2}{S_A^2+S_W^2}
where
S_W^2 is the variance within groups or classes.
1 means 100% of the variance is between classes
0 means 0% of the variance is between classes
We have one biased coin and try to figure out how many flips we need for the ICC to tell the difference to the normal coin
With many thousands of flips we eventually see a very strong difference but unless it is very strongly biased ICC is a poor indicator for the differences
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.
How does a standard image processing chain look?
Given the complexity of the tree, we need to do some pruning
With a quantitative approach, we can calculate the specific shape or distribution metrics on the sample with each parameter and establish the relationship between parameter and metric.
The way we do this is usually a parameter sweep which means taking one (or more) parameters and varying them between the reasonable bounds (judged qualitatively).
Sensitivity is defined in control system theory as the change in the value of an output against the change in the input. S = \frac{|\Delta \textrm{Metric}|}{|\Delta \textrm{Parameter}|}
Such a strict definition is not particularly useful for image processing since a threshold has a unit of intensity and a metric might be volume which has m^3 so the sensitivity becomes volume per intensity.
A more common approach is to estimate the variation in this parameter between images or within a single image (automatic threshold methods can be useful for this) and define the sensitivity based on this variation. It is also common to normalize it with the mean value so the result is a percentage.
S = \frac{max(\textrm{Metric})-min(\textrm{Metric})}{avg(\textrm{Metric})}
In this graph it is magnitude of the slope. The steeper the slope the more the metric changes given a small change in the parameter
Comparing Different Variables we see that the best (lowest) value for the count sensitivity is the highest for the volume and anisotropy.
In computer programming, unit testing is a method by which individual units of source code, sets of one or more computer program modules together with associated control data, usage procedures, and operating procedures, are tested to determine if they are fit for use.
The first requirement for unit testing to work well is to have you tools divided up into small independent parts (functions)
Ideally with realistic but simulated test data
function vxCnt=countVoxs(inImage)
assert countVoxs(zeros(3,3)) == 0
assert countVoxs(zeros(3,3,3)) == 0
assert countVoxs(eye(3)) == 3
function shapeTable=shapeAnalysis(inImage)
We should decompose the task into sub-componentsfunction clImage=componentLabel(inImage)
function objInfo=analyzeObject(inObject)
function vxCnt=countVoxs(inObject)
function covMat=calculateCOV(inObject)
function shapeT=calcShapeT(covMat)
function angle=calcOrientation(shapeT)
function aniso=calcAnisotropy(shapeT)
Read more and Here The Java-based unit-testing can be used (JUnit) before any of the plugins are compiled, additionally entire workflows can be made to test the objects using special testing nodes like
Test Driven programming is a style or approach to programming where the tests are written before the functional code. Like very concrete specifications. It is easy to estimate how much time is left since you can automatically see how many of the tests have been passed. You and your collaborators are clear on the utility of the system.
One of the biggest problems with big sciences is trying to visualize a lot of heterogeneous data.
There are too many graphs which say
The most important modern work in graphical grammars is “The Grammar of Graphics” by Wilkinson, Anand, and Grossman (2005). This work built on earlier work by Bertin (1983) and proposed a grammar that can be used to describe and construct a wide range of statistical graphics.
H. Wickham. ggplot2: elegant graphics for data analysis. Springer New York, 2009.
Normally we think of plots in terms of some sort of data which is fed into a plot command that produces a picture
plot(xdata,ydata,color/shape)
Separate the graph into its component parts
Construct graphics by focusing on each portion independently.