spinalcordtoolbox / manual-correction

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

Issue with manual suffix addition #40

Closed NathanMolinier closed 1 year ago

NathanMolinier commented 1 year ago

The script automatically adds manual suffix even when just modifying the labels:

python manual_correction.py -config config_T1w.yml -path-in ~/data/data-multi-subject -suffix-files-label _labels-disc-manual git:(main|…1
The following files are missing:
['/Users/Nathan/data/data-multi-subject/sub-*/anat/sub-*_T1w.nii.gz']

Please check that the files listed in the yaml file and the input path are correct.

The following label files are missing:
['/Users/Nathan/data/data-multi-subject/sub-*/anat/sub-*_T1w_labels-disc-manual.nii.gz']

Please check that the used suffix '_labels-disc-manual' is correct. If not, you can provide custom suffix using '-suffix-files-' flags.
If you are creating label(s) from scratch, ignore this message.

Enter your name (Firstname Lastname). It will be used to generate a json sidecar with each corrected file: Nathan Molinier
FILES_LABEL:   0%|                                                                                                                                         | 0/268 [00:00<?, ?file/s]
No label file found, creating an empty mask: /Users/Nathan/code/manual-correction/derivatives/labels/sub-brnoCeitec01/anat/sub-brnoCeitec01_T1w_labels-disc-manual-manual.nii.gz

Also, the script raises warnings when using wildcard -- already reported in #35

valosekj commented 1 year ago

Good point! Thanks! 👍🏻

Yeah, the script automatically ads manual suffix:

https://github.com/spinalcordtoolbox/manual-correction/blob/b1cf43e6e8e325fdd80ba64c4ff3b209676d91fa/manual_correction.py#L650-L652

We should probably drop this. Especially when the user uses -suffix-files-label flag.

valosekj commented 1 year ago

The easiest solution could be to add a check if -manual is already presented in the filename; if so, do not add it again.

valosekj commented 1 year ago

Resolved in https://github.com/spinalcordtoolbox/manual-correction/pull/43 -- we do not use the -manual suffix anymore.