Differences between revisions 1 and 9 (spanning 8 versions)
Revision 1 as of 2018-09-19 18:37:33
Size: 1020
Editor: AndrewHoopes
Comment:
Revision 9 as of 2018-09-20 10:36:48
Size: 3461
Editor: AndrewHoopes
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
This proposes a new program, called `mri_overlap`, that will replace the redundant (and buggy) `mri_compute_seg_overlap` and `mri_compute_overlap`. A detailed report of the overlap results can be output to a json file. = mri_overlap =

This page proposes a new program, called `mri_overlap`, that will replace the redundant (and buggy/slow) `mri_compute_seg_overlap` and `mri_compute_overlap`. A primary new feature is the ability to save a detailed overlap report to a JSON file.
Line 8: Line 10:
DESCRIPTION:

    This program computes the overlap between two segmentation volumes. The following
    statistics can be calculated for each label:

        dice coefficient - F1-measure of the similarity between the two labels
        jaccard coefficient - intersecting volume over the combined volume of the two labels
        volume difference - fractional difference in volumes of the labels

    By default, only dice scores are computed, but this can be reconfigured
    with the --measures flag.

    Each structure in the input volumes will be considered by default, but
    an alternative list of labels can be specified with the -l flag. Additionally,
    the --seg flag will compute the overlap between the following 12 major
    anatomical structures:

        Hippocampus (17,53)
        Caudate (11,50)
        Putamen (12,51)
        Pallidum (13,52)
        Amygdala (18,54)
        Thalamus Proper (10,49)
        Lateral Ventricle (4,43)
        Third and Fourth Ventricles (14,15)
        Inf Lateral Vent (5,44)
        Cerebral White Matter (2,41)
        Cerebral Cortex (3,42)
        Accumbens Area (26,58)
Line 10: Line 42:
    -o, --out
        Save detailed overlap report to a json file.
    -o, --out [FILE]
        Save detailed overlap report to a JSON file.
Line 13: Line 45:
    -m, --measures            -m, --measures [MEASURE...]
Line 15: Line 47:
        are computed. Options include:
         
dice    - ...
         
jaccard - ...
         
voldiff - ...
        are computed. Options include: dice, jaccard, voldiff
Line 20: Line 49:
    -l, --labels
        Space-separated list of labels to use. By default, the overlap
    -l, --labels  [LABEL...]
        Space-separated list of label values to include. By default, the overlap
Line 24: Line 53:
    -f, --labelfile
        File with space-separated list of labels to use.
    -f, --labelfile [FILE]
        File specifying a list of labels to include. This file can either be a
        space-separated list of label values or in the format of a freesurfer
        color lookup-table.
Line 30: Line 61:
    -q, --quiet
        Quiet mode - do not print computed results to stdout
EXAMPLE:

    mri_overlap aseg.mgz mseg.mgz -l 17 53 -m dice voldiff -o overlap.json

    This example will compute the dice scores and volume differences of
    hippocampal segmentations between the two input volumes. Results will
    be saved to overlap.json.
Line 33: Line 69:

== JSON ==

The proposed JSON output would look something like this:

{{{
{
    "names": {
        "1": "structure 1",
        "2": "structure 2"
        ...
    },
    "inputs": [
        "/path/to/manual_label.mgz",
        "/other/path/to/aseg.mgz"
    ],
    "measures": {
        "dice": {
            "mean": 0.9142,
            "std": 0.0232,
            "labels": {
                "2": 0.9143,
                "3": 0.8739,
                "4": 0.9002,
                ...
            }
        },
        "jaccard": {
            "mean": 0.8902,
            "std": 0.0144,
            "labels": {
                "2": 0.8921,
                ...
            }
        },
        "voldiff": {
            "mean": 0.0221,
            "std": 0.0032,
            "labels": {
                "2": 0.0123,
                ...
            }
        }
    }
}
}}}

mri_overlap

This page proposes a new program, called mri_overlap, that will replace the redundant (and buggy/slow) mri_compute_seg_overlap and mri_compute_overlap. A primary new feature is the ability to save a detailed overlap report to a JSON file.

USAGE:

    mri_overlap <vol1> <vol2> [options]

DESCRIPTION:

    This program computes the overlap between two segmentation volumes. The following
    statistics can be calculated for each label:

        dice coefficient     -  F1-measure of the similarity between the two labels
        jaccard coefficient  -  intersecting volume over the combined volume of the two labels
        volume difference    -  fractional difference in volumes of the labels

    By default, only dice scores are computed, but this can be reconfigured
    with the --measures flag.

    Each structure in the input volumes will be considered by default, but
    an alternative list of labels can be specified with the -l flag. Additionally,
    the --seg flag will compute the overlap between the following 12 major
    anatomical structures:

        Hippocampus (17,53)
        Caudate (11,50)
        Putamen (12,51)
        Pallidum (13,52)
        Amygdala (18,54)
        Thalamus Proper (10,49)
        Lateral Ventricle (4,43)
        Third and Fourth Ventricles (14,15)
        Inf Lateral Vent (5,44)
        Cerebral White Matter (2,41)
        Cerebral Cortex (3,42)
        Accumbens Area (26,58)

OPTIONAL ARGUMENTS:

    -o, --out [FILE]
        Save detailed overlap report to a JSON file.

    -m, --measures  [MEASURE...]
        List of measures to compute. By default, only dice scores
        are computed. Options include: dice, jaccard, voldiff

    -l, --labels  [LABEL...]
        Space-separated list of label values to include. By default, the overlap
        will be computed between all labels available in both input volumes.

    -f, --labelfile  [FILE]
        File specifying a list of labels to include. This file can either be a
        space-separated list of label values or in the format of a freesurfer
        color lookup-table.

    -s, --seg
        Compute overlap between the major segmentation structures listed above.

EXAMPLE:

    mri_overlap aseg.mgz mseg.mgz -l 17 53 -m dice voldiff -o overlap.json

    This example will compute the dice scores and volume differences of
    hippocampal segmentations between the two input volumes. Results will
    be saved to overlap.json.

JSON

The proposed JSON output would look something like this:

{
    "names": {
        "1": "structure 1",
        "2": "structure 2"
        ...
    },
    "inputs": [
        "/path/to/manual_label.mgz",
        "/other/path/to/aseg.mgz"
    ],
    "measures": {
        "dice": {
            "mean": 0.9142,
            "std": 0.0232,
            "labels": {
                "2": 0.9143,
                "3": 0.8739,
                "4": 0.9002,
                ...
            }
        },
        "jaccard": {
            "mean": 0.8902,
            "std": 0.0144,
            "labels": {
                "2": 0.8921,
                ...
            }
        },
        "voldiff": {
            "mean": 0.0221,
            "std": 0.0032,
            "labels": {
                "2": 0.0123,
                ...
            }
        }
    }
}

mri_overlap (last edited 2018-09-24 11:22:21 by AndrewHoopes)