Homec4science

A second unit test for Manders' coefficients

Authored by daniel j. white <dan@chalkie.org.uk> on Aug 5 2015, 09:57.

Description

A second unit test for Manders' coefficients

Uses a real life , noisy, but biologically perfect coloc dataset,
with a mask image. Both are 3D z stacks.
made sure mask image is 3D stack image to match the
+ve correlation test images, which are z stacks.

Mask 3D image was recreated from the green test image
colocsample1b-green.tif by
smooth3D with default settings, then Ostu auto threshold.

Need to use thresholds in the unit test because
then the result will be much more sensitive to
errors coming from elsewhere.

with thresholds of 14 and 12 it should give
a result of about 0.75
when using this 3D mask

New method to open tiff as a Cursor,
in the TestImageAccessor then use
it in the test

open the mask image as Img so can
get its cursor for use in the TwinCursor

Fixed setting the thresholds manually by
making new Type instances for
them of the required UnsignedByteType.

got the mask image to do the cursor job, with help and cide suggestion
from Christian Dietz @dietzc for data conversion required. Used
Converters class to get a usable Cursor <BitType> mask from the
<UnsignedByteType> input mask image.

set manual thresholds and expected output values
to known true good values:
Ran the coloc_2 on the positive correlation test images
colocsample1b-green.tif ch1, -red ch2, using the mask image we use
here, colocsample1b-mask.tif to find the auto thresholds (bisection
method) generated and thresholded Manders' coefficients resulting.
Then hard code these into this unit test. Set the precision of the test
to be a very precise 0.000001, so that it will fail if any tiny
disturbances/bugs happen elsewhere numerically or with faulty logic or
maths. Hopefully this makes the test much more robust at catching
problems than the other test here that works on the artificial smooth
images from the Manders paper with no thresholds.

use Views.iterable instead of a dangerous cast
this should be much safer, thanks to @ctrueden foir the tip.

Details

Committed
daniel j. white <dan@chalkie.org.uk>Aug 30 2015, 16:04
Pushed
oburriMar 8 2018, 18:06
Parents
R6269:f83fb54e445e: PDFWriter file name: uses maskHash so remove "mask"
Branches
Unknown
Tags
Unknown

Event Timeline

daniel j. white <dan@chalkie.org.uk> committed R6269:5610ed689846: A second unit test for Manders' coefficients (authored by daniel j. white <dan@chalkie.org.uk>).Aug 30 2015, 16:04