Re: CMTK statistics question

34 views
Skip to first unread message

Dr Gregory Jefferis

unread,
Jun 29, 2015, 12:33:15 PM6/29/15
to nat-...@googlegroups.com, mjd...@cam.ac.uk
Hi Mike,

cmtk.statistics calculates the image statistics within a labelled
region. n refers to the number of voxels in that labelled region
*without implying anything about their value*. If you look at the mean,
sdev or sum columns, you will see that they do indeed vary and they will
be larger for positive lines.


Applying thresholds
===================

Now your second problem is that these numbers do not take account of any
kind of threshold. If you want to calculate the number of positive
voxels above some threshold, then you need to threshold the images
explicitly. This could be done either

1. with an external tool
a) with the cmtk imagemath tool
b) the unu command line tools (http://teem.sourceforge.net/unrrdu/ I use
these quite a bit for pipelines). In particular you would want the
c) or Fiji/ImageJ via a macro

2. by opening the greyscale image in R directly and then calculating the
overlap of supra-threshold voxels. Something like:

library(nat)
mask=read.im3d("mymask.nrrd") # could also be amiramesh
x=read.im3d("greyscale.nrrd")
# calculate statistics for 3 different threshold levels
sapply(c(5000,10000,15000), function(thresh) table(mask[x>thresh]))


I'll write separately re image thresholds ...

Alternatively
=============
Of course, calculating thresholds is a tricky business, so I have
another suggestion that might side-step the issue. How about defining
one or more additional label regions adjacent to your target regions, or
at least voxels in roughly the same slices, that *should* be negative?
Then you could look at the statistics for the control regions vs the
existing regions. You can do that just using cmtk.statistics. If you
want to do it at scale, you would iterate over all the images, probably
saving the results for each to a temporary spreadsheet file on disk and
then loading them in.

Best,

Greg.

--
Gregory Jefferis, PhD                   Tel: +44 1223 267048
Division of Neurobiology
MRC Laboratory of Molecular Biology
Francis Crick Avenue
Cambridge Biomedical Campus
Cambridge, CB2 OQH, UK

http://www2.mrc-lmb.cam.ac.uk/group-leaders/h-to-m/g-jefferis
http://jefferislab.org
http://flybrain.stanford.edu
Reply all
Reply to author
Forward
0 new messages