neuropoly / data-management

Repo that deals with datalad aspects for internal use
4 stars 0 forks source link

Update the GT segmentation file names with the new conventions #300

Open Nilser3 opened 4 months ago

Nilser3 commented 4 months ago

Description

This issue will be used to update the GT segmentation names to be in conformity with the new conventions.

Current arborescence of datasets:

Data MP2RAGE

tree basel-mp2rage

├── sub-C001
│   └── anat
│       └── sub-C001_UNIT1.nii.gz
...
├── sub-P001
│   └── anat
│       ├── sub-P001_UNIT1.nii.gz
...
├── derivatives
│   └── labels
│       ├── sub-C001
│       │   └── anat
│       │       ├── sub-C001_UNIT1_label-SC_seg.json
│       │       └── sub-C001_UNIT1_label-SC_seg.nii.gz
...
│       ├── sub-P001
│       │   └── anat
│       │       ├── sub-P001_UNIT1_label-SC_seg.json
│       │       ├── sub-P001_UNIT1_label-SC_seg.nii.gz
│       │       ├── sub-P001_UNIT1_lesion-manualHaris.json
│       │       ├── sub-P001_UNIT1_lesion-manualHaris.nii.gz
│       │       ├── sub-P001_UNIT1_lesion-manualKatrin.json
│       │       ├── sub-P001_UNIT1_lesion-manualKatrin.nii.gz
│       │       ├── sub-P001_UNIT1_lesion-manualNeuroPoly.json
│       │       └── sub-P001_UNIT1_lesion-manualNeuroPoly.nii.gz

tree marseille-3T-mp2rage

├── sub-MRS00
│   └── ses-M0
│       └── anat
│           └── sub-MRS00_ses-M0_UNIT1.nii.gz
...
├── derivatives
│   └── labels
│       ├── sub-MRS00
│       │   └── ses-M0
│       │       └── anat
│       │           ├── sub-MRS00_ses-M0_UNIT1_label-lesion_desc-rater1.json
│       │           ├── sub-MRS00_ses-M0_UNIT1_label-lesion_desc-rater1.nii.gz
│       │           ├── sub-MRS00_ses-M0_UNIT1_label-lesion_desc-rater2.json
│       │           ├── sub-MRS00_ses-M0_UNIT1_label-lesion_desc-rater2.nii.gz
│       │           ├── sub-MRS00_ses-M0_UNIT1_label-SC_seg.json
│       │           └── sub-MRS00_ses-M0_UNIT1_label-SC_seg.nii.gz

tree nih-ms-mp2rage

├── sub-nih001
│   └── anat
│       ├── sub-nih001_desc-denoised_UNIT1.nii.gz
│       ├── sub-nih001_inv-1_part-mag_MP2RAGE.nii.gz
│       ├── sub-nih001_inv-2_part-mag_MP2RAGE.nii.gz
│       ├── sub-nih001_T1map.nii.gz
│       └── sub-nih001_UNIT1.nii.gz
...
├── derivatives
│   └── labels
│       ├── sub-nih001
│       │   └── anat
│       │       ├── sub-nih001_UNIT1_label-SC_seg.json
│       │       └── sub-nih001_UNIT1_label-SC_seg.nii.gz
jcohenadad commented 4 months ago

i think "desc-rater1" should not go at the end @NathanMolinier can confirm

image

NathanMolinier commented 4 months ago

i think "desc-rater1" should not go at the end @NathanMolinier can confirm

Yes, it should not indeed. Also, the suffix _seg is missing (or _dseg if multiple types of lesions are segmented).

See the corrected tree below for marseille-3T-mp2rage:

├── derivatives
│   └── labels
│       ├── sub-MRS00
│       │   └── ses-M0
│       │       └── anat
│       │           ├── sub-MRS00_ses-M0_UNIT1_desc-rater1_label-lesion_seg.json
│       │           ├── sub-MRS00_ses-M0_UNIT1_desc-rater1_label-lesion_seg.nii.gz
│       │           ├── sub-MRS00_ses-M0_UNIT1_desc-rater2_label-lesion_seg.json
│       │           ├── sub-MRS00_ses-M0_UNIT1_desc-rater2_label-lesion_seg.nii.gz

There is also a problem here with the basel-mp2rage dataset:

├── derivatives
│   └── labels
│       ├── sub-C001
│       │   └── anat
│       │       ├── sub-C001_UNIT1_label-SC_seg.json
│       │       └── sub-C001_UNIT1_label-SC_seg.nii.gz
...
│       ├── sub-P001
│       │   └── anat
│       │       ├── sub-P001_UNIT1_label-SC_seg.json
│       │       ├── sub-P001_UNIT1_label-SC_seg.nii.gz 
│       │       ├── sub-P001_UNIT1_desc-rater1_label-lesion_seg.json                 <-----------
│       │       ├── sub-P001_UNIT1_desc-rater1_label-lesion_seg.nii.gz                 <-----------
│       │       ├── sub-P001_UNIT1_desc-rater2_label-lesion_seg.json                 <-----------
│       │       ├── sub-P001_UNIT1_desc-rater2_label-lesion_seg.nii.gz                 <-----------
│       │       ├── sub-P001_UNIT1_desc-rater3_label-lesion_seg.json                 <-----------
│       │       └── sub-P001_UNIT1_desc-rater3_label-lesion_seg.nii.gz                 <-----------

The name of the rater should be added instead to the .json sidecar.

Nilser3 commented 4 months ago

Thanks you @NathanMolinier

Following the new conventions, here is the modifications for basel-mp2rage

I have no details to fill in the JSON files for Haris nor Katrin segmentations:

Previous JSON sidecar : sub-P001_UNIT1_lesion-manualHaris.json

{
  "Authors": [
    "USB",
    "Nilser Laines Medina"
  ],
  "Label": "lesion-manual"
}

New JSON sidecar : sub-P001_UNIT1_desc-rater1_label-lesion_seg.json

{
    "SpatialReference": "orig",
    "GeneratedBy": [
        {
            "Name": "Manual",
            "Author": "Haris",
            "Date": ""
        }
    ]
}

Previous JSON sidecar : sub-P001_UNIT1_lesion-manualNeuroPolyjson

{
    "SpatialReference": "orig",
    "GeneratedBy": [
        {
            "Name": "Manual",
            "Author": "Katrin",
            "Date": ""
        }
    ]
}

New JSON sidecar : sub-P001_UNIT1_desc-rater3_label-lesion_seg.json

{
    "SpatialReference": "orig",
    "GeneratedBy": [
        {
            "Name": "Manual",
            "Author": "Katrin",
            "Date": ""
        }
        {
            "Name": "Manual",
            "Author": "Michelle Chen",
            "Date": "2023-01-23"
        }
    ]
}

Feedback please @mguaypaq branch: nlm/update_gt_names commit: 0177d5dcbfb15cd1ba808c7671b8b8a6de675901

NathanMolinier commented 4 months ago

Regarding the format for JSON sidecars, please check our intranet.

These are the fields which are needed:

{
    "SpatialReference": "orig",
    "GeneratedBy": [
        {
            "Name": "Manual",
            "Author": "Nathan Molinier",
            "Date": "2023-07-14 13:43:10"
        }
    ]
}
Nilser3 commented 4 months ago

Update for dataset: marseille-3T-mp2rage

branch: nlm/update_gt_names commit: afd8282a1ee8d468fd4ab8769e82d4ffdd7acb67

Nilser3 commented 4 months ago

Regarding the format for JSON sidecars, please check our intranet.

Thanks you @NathanMolinier , I have updated the JSON sidecars

mguaypaq commented 4 months ago

For basel-mp2rage: some of the json sidecars were missing a comma, so I added a commit to fix this, and merged into master.

For marseille-3T-mp2rage: some of the json sidecars had a extra commas, so I added a commit to fix this, and merged into master.

For nih-ms-mp2rage: I don't see any branches to merge on the server. @Nilser3, did you push your changes to this repo?

Nilser3 commented 4 months ago

Oh, my bad, Thanks you @mguaypaq

For nih-ms-mp2rage we don't have masks yet (so nothing to modify), but as soon as we have them I will send them to the git-annex respecting these new conventions.