Skip to content

Commit

Permalink
mri_compute_seg_overlap. #NF. Added ability to use 'embedded' as colo…
Browse files Browse the repository at this point in the history
…rtable with -dice
  • Loading branch information
Douglas Greve committed Jul 22, 2021
1 parent 001cbde commit 6a73d90
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
17 changes: 14 additions & 3 deletions mri_compute_seg_overlap/mri_compute_seg_overlap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ static int get_option(int argc, char *argv[])
// 7: seg1 seg2 ctab ReportEmpty01 ExcludeId datfile tablefile
// seg1 - first segmentation (for fdr and tdr, this is ground truth)
// seg2 - second segmentation (for fdr and tdr, this is the test seg)
// ctab - color table of segmentations to report on
// ctab - color table of segmentations to report on. can used "embedded"
// ReportEmpty - 0=do not report segs that are empty in both, 1=report
// ExcludeId - exclude this seg (eg, 0 to exclude Unknown)
// datfile - save the dice for each seg on a single line without anymore info
Expand All @@ -493,8 +493,19 @@ static int get_option(int argc, char *argv[])
if(sd.seg1==NULL) exit(1);
sd.seg2 = MRIread(argv[3]);
if(sd.seg2==NULL) exit(1);
sd.ctab = CTABreadASCII(argv[4]);
if(sd.ctab==NULL) exit(1);
if(strcmp(argv[4],"embedded")!=0){
sd.ctab = CTABreadASCII(argv[4]);
if(sd.ctab==NULL) exit(1);
}
else {
printf("Using embedded color table\n");
if(sd.seg1->ct != NULL) sd.ctab = sd.seg1->ct;
else if(sd.seg2->ct != NULL) sd.ctab = sd.seg2->ct;
else {
printf("ERROR: neither seg1 nor seg2 have an embedded color table\n");
exit(1);
}
}
sscanf(argv[5],"%d",&sd.ReportEmpty);
int ExcludeId;
sscanf(argv[6],"%d",&ExcludeId);
Expand Down
2 changes: 1 addition & 1 deletion mri_compute_seg_overlap/mri_compute_seg_overlap.help.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<argument>-all_labels</argument>
<explanation>check all labels</explanation>
<argument>-dice seg1 seg2 ctab ReportEmpty01 ExcludeId datfile tablefile</argument>
<explanation>Standalone way to compute dice. </explanation>
<explanation>Standalone way to compute dice. ctab can = embedded</explanation>
</optional-flagged>
</arguments>
<example>mri_compute_seg_overlap manual_seg.mgz aseg.mgz
Expand Down

0 comments on commit 6a73d90

Please sign in to comment.