[MINC-development] volume_stats/mincstats???
Robert VINCENT
minc-development@bic.mni.mcgill.ca
Tue, 12 Aug 2003 14:11:31 -0400
Hi,
I've taken a look at this. If I follow Peter's comments and the program's
logic, it looks as though the following line needs to be added to
mincstats.c:
Index: mincstats.c
===================================================================
RCS file: /software/source/minc/cvsroot/minc/progs/mincstats/mincstats.c,v
retrieving revision 1.11
diff -c -r1.11 mincstats.c
*** mincstats.c 5 Sep 2002 00:41:57 -0000 1.11
--- mincstats.c 12 Aug 2003 18:09:54 -0000
***************
*** 618,623 ****
--- 618,624 ----
else
stats->median = ((double)median_bin + (0.5 - cdf[median_bin])
* pdf[median_bin + 1]) * hist_sep;
+ stats->median += hist_centre[0];
stats->majority = hist_centre[majority_bin];
stats->biModalT = hist_centre[bimodalt_bin];
Does this look correct?
-bert
On Tue, 12 Aug 2003, Jacqueline Chen wrote:
>
> Hello!
>
> Peter Neelin suggested that I email my problem here...hope you can help!
>
> My data is here:
>
> /home/bic/chen/mincstats_dir
>
> the commands I used were:
>
> volume_stats lipst10_MT_to_e2.mnc.gz
> and
> mincstats lipst10_MT_to_e2.mnc.gz
>
> I have found a bug...specifically with the calculation of the median.
>
> Peter's message:
>
> "Send your message, along with the location of the file and the
> command-line to minc-development@bic.mni.mcgill.ca. Either Steve or Andrew
> should fix this. You can tell them that I said that the median calculation
> looks like it is not adding the histogram offset (centre of the zeroth
> bin). Someone should check all of the results when using a volume that has
> a significantly non-zero minimum (I suspect that Andrew, who wrote the
> code, did not use such a volume for testing)."
>
> here are my outputs:
>
> =====================
> volume_stats output
>
> File: lipst10_MT_to_e2.mnc.gz
> # voxels: 2949120
> % of total: 100
> Volume (mm3): 8.84736e+06
> Min: -114.595
> Max: 85.3346
> Sum: 1.57703e+07
> Sum2: 4.93394e+08
> Mean: 5.34745
> Variance: 138.707
> Stddev: 11.7774
> ***************Median: -0.00774425******************
> Majority: -0.00774425
> BiModalT: 15.2738
> PctT (-1.79769e+308): -114.619 85.359
> Entropy: 3.13281
> CoM_voxel: zspace:27.4898 yspace:135.843 xspace:96.4351
> CoM_world: zspace:-29.6355 yspace:12.7787 xspace:1.77514
>
> =============
> mincstats output
>
> File: lipst10_MT_to_e2.mnc.gz
> Mask file: (null)
> Total voxels: 2949120
> # voxels: 2949120
> % of total: 100
> Volume (mm3): 8847360
> Min: -114.5949692
> Max: 85.33459454
> Sum: 15783756.65
> Sum^2: 493391934.2
> Mean: 5.35202252
> Variance: 138.6573119
> Stddev: 11.77528394
> CoM_voxel(z,y,x): 27.49728313 135.8338074 96.43413711
> CoM_real(x,y,z): 1.777973285 12.78375223 -29.61186191
>
> Histogram: (null)
> Total voxels: 2949120
> # voxels: 2949119
> % of total: 99.99996609
> ****************Median: 114.4969327***********
> Majority: 0.01465323195
> BiModalT: 84.88475037
> PctT [ 0%]: 0
> Entropy : 2.815999481
>
> ============================
>
> many thanks,
> Jacqueline
>
> _______________________________________________
> MINC-development mailing list
> MINC-development@bic.mni.mcgill.ca
> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-development
>