spinalcordtoolbox / manual-correction

Scripts for the manual correction of spinal cord labels
MIT License
4 stars 0 forks source link

Track algorithm/model used to correct a label #75

Open valosekj opened 10 months ago

valosekj commented 10 months ago

The manual_correction.py currently generates the following JSON sidecars using code here:

{
    "GeneratedBy": [
        {
            "Author": "Jan Valosek",
            "Date": "2024-01-18 10:42:24"
        }
    ]
}

But, in many cases, we do not create labels completely from scratch. Instead, we correct labels obtained using some method (sct_deepseg_sc, custom models, etc.). Thus, it would be a good idea to store the info about the method in the JSON sidacars, for example:

{
    "GeneratedBy": [
        {
            "Name": "SCISeg nnUNet3D",
            "Version": "Dataset183_tSCI3SitesALPhase2Seed710",
            "Date": "2024-01-16"
        },
        {
            "Author": "Jan Valosek",
            "Note": "Manually corrected",
            "Date": "2024-01-18 10:42:24"
        }
    ]
}

In the future, SCT functions will generate JSON sidecars tracking such info, see this PR: https://github.com/spinalcordtoolbox/spinalcordtoolbox/issues/3394. Until then, and also for future models in development before integration to SCT, we could add an input arg to the manual_correction.py, allowing us to provide specific information to include in JSON sidecars.

Relevant comments: https://github.com/spinalcordtoolbox/manual-correction/issues/34, https://github.com/ivadomed/canproco/issues/73

Our intranet convention: https://intranet.neuro.polymtl.ca/data/dataset-curation.html#json-sidecars

valosekj commented 9 months ago

Custom metadata can now be provided using -json-metadata flag; see https://github.com/spinalcordtoolbox/manual-correction/pull/80.