[MINC-users] bug in minctracc when using mutual information and thresholds

Dallas Card dallas.card at sickkids.ca
Tue Dec 11 12:56:09 EST 2012


Hello all,

I believe I've found a bug in minctracc. The -threshold option allows you to set thresholds, which are supposed to be specified in terms of the real range. However, when using the mutual information objective function (-mi) the input volumes are automatically converted to bytes, and the thresholds get interpreted in the range 0-255.

The culprit seems to be the function that is used to convert the data, namely replace_volume_data_with_ubyte() in minctracc/Optimize/optimize.c, which contains the following comment:

   /*
   * BLEAGHH!! This is an evil and nasty hack, made worse by the fact that
   * we have to support two versions of Volume_io for it to work!  (At
   * least this is done by the VOXEL_DATA hack^H^H^H^Hmacro, in <config.h>.)
   * -GPW 96/04/34
   */

It does convert the values to bytes, but it fails to set the "real_range_set" flag to True. Thus, when the data are eventually compared to the thresholds, they are not converted back to the real values.

I believe a simple fix is to add the following line at the end of replace_volume_data_with_ubyte():

set_volume_real_range(data, min, max);


I'll make the change and create a pull request.

Cheers,
Dallas

P.S. My apologies if you're seeing this message for the second time.



________________________________

This e-mail may contain confidential, personal and/or health information(information which may be subject to legal restrictions on use, retention and/or disclosure) for the sole use of the intended recipient. Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. If you have received this e-mail in error, please contact the sender and delete all copies.


More information about the MINC-users mailing list