Print

Print


OK, so I've been investigating yet a bit longer. Sorry for my previous ramblings, they were mostly incorrect. Of course it is perfectly valid to divide the mask by its mean value (although the issue of doing this on integer images like probability masks still stands). However, from what I can tell there is a much more serious issue with featquery. I've inspected the source code closely and I cannot escape the conclusion that featquery in fact does NOT weight all of its output using the mask weights when so specified by the -w option. That is, although the mean_mask_ts.txt output IS weighted using the mask weights, the mean value that it outputs in report.txt is NOT weighted. Conversely, when specifying that featquery should calculate percent signal change, the output in report.txt IS transformed into percent signal change, but the output in mean_mask_ts.txt is NOT transformed into percent signal change. So different options given to featquery affect different outputs. Maybe this is intended behavour, but as far as I can tell it is not documented in the manual. As it is now, I would consider it a bug, unless I'm missing some important information.
Even without digging into the source code of featquery, the odd behaviour can easily be verified: take a non-binary mask, create a binary version of it, and run featquery using both masks. The mean values in output.txt are invariably the same. As far as I can tell, the reason is that featquery runs fslstats with the -k option to extract the stat values from the mask, but fails to actually weight stat values using the mask (i.e. it never multiplies the stats with the mask). It does do this early on in the script, where it calculates the output of mean_mask_ts.txt, but this never finds its way into the average that is output into output.txt. Maybe I'm missing something, but that's the best I can make of it. I would be great if somebody from the FSL community could respond, or tell me if I went wrong somewhere. 

Thanks!

Johannes