Hi Nick,
I can't get the script to work but that might be due to my inexperience with matlab. I copied the script into my matlab directory, and tried to run dice_labels (/autofs/space/phrenic_007/users/jon/hires_amy/Round_1/HRDEV150/whole_amygdala.label, /autofs/space/phrenic_007/users/jon/hires_amy/Round_2/HRDEV150/whole_amygdala.label)
But the error message said unexpected matlab operator.
I then tried altering the script by substituting the actual labels for 'label1' and 'label2' but that didn't work either, and it gave me the same error message.
Running the command alone, dice_labels, the error reads
dice_labels
??? Input argument "lname1" is undefined.
Error in ==> dice_labels at 29 label1 = read_label('',lname1);
I'm sure I'm doing something wrong, but no one in my group knows matlab well enough to figure it out.
Jon,
Do the matlab scripts work for you? The approach you are taking with the existing tools is the one I was considering myself but decided it was too roundabout and probably wouldn't work for you anyway (because mri_compute_seg_overlap looks for particular label ids corresponding to subcortical structures), compared to the ease of just computing the dice directly from the label files, which are just text files listing the label coordinates.
Nick
On Thu, 2009-08-20 at 14:09 -0400, jentis@nmr.mgh.harvard.edu wrote:
Hi Nick,
I was actually able to convert the label files into volumes using mri_label2vol and then use the mri_segstats to get the total number of pixels from each volume file. But the mri_compute_seg_overlap didn't work as easily. I tried running the following but the results were all zero, which I've included as well: mri_compute_seg_overlap -olog text whole_amygdala_test.mgz ../../Round_2/HRDEV150/whole_amygdala_test2.mgz
logging overall Dice to text Jaccard Coefficients: correct ratio for label 2 = 0 correct ratio for label 41 = 0 correct ratio for label 3 = 0 correct ratio for label 42 = 0 correct ratio for label 4 = 0 correct ratio for label 43 = 0 correct ratio for label 17 = 0 correct ratio for label 53 = 0 correct ratio for label 10 = 0 correct ratio for label 49 = 0 correct ratio for label 11 = 0 correct ratio for label 50 = 0 correct ratio for label 12 = 0 correct ratio for label 51 = 0 correct ratio for label 13 = 0 correct ratio for label 52 = 0 correct ratio for label 18 = 0 correct ratio for label 54 = 0 correct ratio for label 26 = 0 correct ratio for label 58 = 0 correct ratio for label 14 = 0 correct ratio for label 15 = 0 correct ratio for label 5 = 0 correct ratio for label 44 = 0 mean +/- std = 0.0000 +/- 0.0000 Dice Coefficients: label 2 = 0 label 41 = 0 label 3 = 0 label 42 = 0 label 4 = 0 label 43 = 0 label 17 = 0 label 53 = 0 label 10 = 0 label 49 = 0 label 11 = 0 label 50 = 0 label 12 = 0 label 51 = 0 label 13 = 0 label 52 = 0 label 18 = 0 label 54 = 0 label 26 = 0 label 58 = 0 label 14 = 0 label 15 = 0 label 5 = 0 label 44 = 0 mean +/- std = 0.0000 +/- 0.0000 Overall subcortical dice = nan
Any ideas?
Thanks
Jon,
None of the existing utilities will calculate the Dice of two labels
(at
least not in a straightforward manner). However, its easy to do in matlab.
Attached is a script to do this. Copy it to your $FREESURFER_HOME/matlab directory.
Usage is:
dice_labels('label1.label','label2.label')
or just
dice_labels('label1','label2')
this assumes the two labels were created in the same volume.
Nick
On Thu, 2009-08-20 at 12:21 -0400, jentis@nmr.mgh.harvard.edu wrote:
Hi,
I need to compute the reliability of two manually traced ROIs and
I
was told to use the command mri_compute_seg_overlap. However, it seems this command needs its input to be in .mgz format, but the ROIs have been saved as .label files in Freeview. A simple renaming function does not work, so is there another way to make
mri_compute_seg_overlap
work with .label files? Thanks.
Best, Jon _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
freesurfer@nmr.mgh.harvard.edu