Print

Print


Hi Steve,

Yes, if you parse the text of the featquery web page very carefully, the
phrase "non-zero" is only directly mentioned in regards to the count,
but will a typical user assume that it is "implied" to apply to the
other measures as well?  To us, it certainly was implied, simply because
why report the number of non-zero voxels within the mask, but then
report the mean based on all voxels (including zeros)?  That dichotomy
just doesn't make sense to me, and is certainly not what I would have
expected beforehand.  

Now that we've clarified that this isn't considered a "bug", I still
suggest that you state explicitly that the mean/median/percentile calcs
include zeros, and thus the count value is NOT necessarily the number of
voxels that went into computing the mean/median/percentile outputs.  

Perhaps an option to exclude zero values would be a useful addition to
featquery?

In our particular case, the masks were situated in MNI152 standard space
and one was a sphere that got centered (based on a priori activation
coordinates) at the edge of the brain.  Thus for that mask (ROI), a fair
number of the stat values were 0, due to the brain mask applied during
FEAT.  But more generally, a mask may be defined on the MNI152 standard
template that appears to fully cover brain on the template, yet due to
movement, or just limited slice coverage, that mask might have many
zeros in the actual statistic image of interest.

cheers,
-MH
 

On Thu, 2010-06-17 at 15:50 +0100, Stephen Smith wrote:
> Hi Michael,
> 
> 
> Yes - the script is correct and in keeping with the manual:   The
> manual says "For each of these in turn, Featquery will calculate
> various quantities within the selected mask, for example, the number
> of non-zero voxels within the mask, the mean and max values of the
> stats image within the mask, and the co-ordinates of the max image
> value within the mask."
> 
> 
> And so the number of non-zero voxels in the mask is correctly counted
> (this is using the -V option in the call to fslstats that you quoted
> before), whilst the rest of the quantities are estimated for ALL
> voxels in the mask. The phrase "non-zero" is only applying to that
> first quantity - the non-zero count.   It is not *in general* the
> intended behaviour in FSL that zero voxels will get ignored (except in
> mask images, etc) - that would not be safe or robust.
> 
> 
> Maybe it might be worth expanding on the scenario that gave rise to
> the problem at your end?   In my experience people don't end up
> zeroing images in this context that would leave zeros in the data but
> still inside the mask?
> 
> 
> Cheers.
> 
> 
> 
> 
> 
> 
> 
> On 17 Jun 2010, at 14:58, Michael Harms wrote:
> 
> > Hi Steve,
> > If you search the featquery web page
> > (http://www.fmrib.ox.ac.uk/fsl/feat5/featquery.html) for "zero" you
> > find
> > the following statements:
> > 
> > ---
> > Featquery will calculate various quantities within the selected
> > mask,
> > for example, the number of non-zero voxels within the mask, the mean
> > and
> > max values of the stats image within the mask, and the co-ordinates
> > of
> > the max image value within the mask.
> > 
> > Featquery saves the mask, once transformed into the native space of
> > the
> > selected FEAT directory, inside the Featquery output directory,
> > called
> > "mask" (even if this only contains a single non-zero voxel, in the
> > case
> > of selecting a co-ordinate).
> > 
> > If you turn on Do not binarise mask (allow weighting) then if your
> > mask
> > is non-binary, its non-zero values will weight all Featquery output
> > values rather than treating the mask as binary.
> > 
> > The first column in the main table shows the "stats image", i.e.
> > lists
> > the different FEAT stats images that you asked Featquery to report
> > on;
> > each of these is also a link to a raw text file giving the data
> > timeseries plot at the position of the maximum image value within
> > the
> > mask. The next column tells you the number of non-zero voxels within
> > the
> > mask.
> > ---
> > 
> > So, the web page clearly indicates (1st and 4th statements above)
> > that
> > the number of voxels output measure is the number of non-zero voxels
> > (consistent with the -V flag in the featquery script).  And on
> > careful
> > reading, the 2nd and 3rd statements above deal with the mask itself,
> > rather than the values underlying the mask in the statistic of
> > interest.
> > But overall, the frequent mention of "non-zero" gives the
> > impression/expectation that ALL featquery output would be based on
> > the
> > non-zero values in the STATISTIC image, especially since that is the
> > way
> > the number of voxels output is itself treated.  Indeed, that was
> > exactly
> > the expectation that someone here had, but I upon seeing 0 as the
> > output
> > for the median and 10% values, I realized that it couldn't be the
> > case
> > that zero values in the statistic image under the mask were being
> > excluded.
> > 
> > Since exact 0's are almost always doing to reflect an absence of
> > data at
> > that voxel, why is the default behavior to include those 0's as part
> > of
> > the mean/median/percentile statistics?
> > 
> > That said, if those stat values are going to include the 0's, then I
> > would suggest that you make this explicitly clear on both the web
> > page,
> > and within the text of featquery's html report.  Based on our
> > experience, I'm rather confident in speculating that we are
> > certainly
> > not the only ones that assumed that the mean/median/percentile
> > statistics excluded 0's under the mask from the calculation.  In our
> > particular case, in which we had some masks that ended up including
> > a
> > fair number of zero values in the statistic images of interest, the
> > featquery statistics are meaningless.
> > 
> > Best,
> > -MH
> > 
> > 
> > On Thu, 2010-06-17 at 07:59 +0100, Stephen Smith wrote:
> > > Hi - which part of the manual are you thinking of?   I think the
> > > script is correct - the intention is to estimate the statistics
> > > across
> > > all voxels inside the mask, unless you turn on the thresholding
> > > option?
> > > 
> > > 
> > > Cheers.
> > > 
> > > 
> > > 
> > > On 15 Jun 2010, at 03:57, Michael Harms wrote:
> > > 
> > > > Hello,
> > > > Re-posting this since the original post coincided with HDBM.
> > > > 
> > > > Best,
> > > > -MH
> > > > 
> > > > ---------------------------- Original Message
> > > > ----------------------------
> > > > Subject: [FSL] bug in featquery's treatment of zeros?
> > > > From:    "Michael Harms" <[log in to unmask]>
> > > > Date:    Thu, June 10, 2010 4:58 pm
> > > > To:      [log in to unmask]
> > > > --------------------------------------------------------------------------
> > > > 
> > > > Hello FSL developers,
> > > > Is Featquery supposed to include only non-zero voxels for all
> > > > calculated
> > > > statistics included in its output (i.e., report.txt)?  That at
> > > > least
> > > > seems to be the implied behavior according to the Featquery web
> > > > page.
> > > > 
> > > > However, if that is the intent, it doesn't appear to be
> > > > happening.
> > > > For brevity I'll just cut to what I think is the relevant line
> > > > in
> > > > the
> > > > featquery script:
> > > > 
> > > > catch { exec sh -c "${FSLDIR}/bin/fslstats ${fqroot}/tmp -k
> > > > ${fqroot}/tmpmask -m -R -V -p 10 -p 50 -p 90 -x -s" } thevals
> > > > 
> > > > Shouldn't the flags be "-M -R -V -P 10 -P 50 -P 90 -x -S" if the
> > > > intent
> > > > is to include only non-zero voxels in the calculations?
> > > > 
> > > > thanks,
> > > > -Mike H.
> > > > 
> > > > 
> > > > -- 
> > > > Michael Harms, Ph.D.
> > > > --------------------------------------------------------------------
> > > > Conte Center for the Neuroscience of Mental Disorders
> > > > Washington University School of Medicine
> > > > Department of Psychiatry, Box 8134
> > > > Renard Hospital, Room 6604           Tel: 314-747-6173
> > > > 660 South Euclid Ave.                Fax: 314-747-2182
> > > > St. Louis, MO 63110                  Email: [log in to unmask]
> > > > --------------------------------------------------------------------
> > > > 
> > > > 
> > > 
> > > 
> > > ---------------------------------------------------------------------------
> > > Stephen M. Smith, Professor of Biomedical Engineering
> > > Associate Director,  Oxford University FMRIB Centre
> > > 
> > > FMRIB, JR Hospital, Headington, Oxford  OX3 9DU, UK
> > > +44 (0) 1865 222726  (fax 222717)
> > > [log in to unmask]    http://www.fmrib.ox.ac.uk/~steve
> > > ---------------------------------------------------------------------------
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > 
> > 
> 
> 
> ---------------------------------------------------------------------------
> Stephen M. Smith, Professor of Biomedical Engineering
> Associate Director,  Oxford University FMRIB Centre
> 
> FMRIB, JR Hospital, Headington, Oxford  OX3 9DU, UK
> +44 (0) 1865 222726  (fax 222717)
> [log in to unmask]    http://www.fmrib.ox.ac.uk/~steve
> ---------------------------------------------------------------------------
> 
> 
> 
> 
> 
>