-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to specify custom metadata to be included in JSON sidecars #80
Conversation
… containing metadata to be added to the JSON sidecar of all corrected labels.
…o be compatible with new 'json_metadata' param.
Hey @valosekj ! Thanks for adding this new feature, it will help in some situations indeed. However, even if it could be helpful, let's not forget that this scenario is not ideal. This repository should only be used for manual corrections, not to fix problems generated by other scripts/pipelines. If i understand correctly, you generated images using |
Completely agree! The proposed PR can be used until spinalcordtoolbox/spinalcordtoolbox#3394 is addressed (which aims to make SCT and sct_run_batch BIDS compatible). |
Thanks for the PR, @valosekj ! The output JSON sidecar is a bit confusing in the sense that, if there are multiple revisions of the labels (i.e. rater1, deepseg, rater2, rater3, etc.), how is the order of the Ideally, we can show in reverse chronological order, such as:
This tells us that the first there was deepseg_sc, then corrected by Jan, then corrected by Naga (i.e. the latest set of labels are obtained with Naga's corrections) What do you think? |
Personally, I'm not a fan of this new key But, to make sure that we are able to retrace the timeline, we should make sure to always add the time to the |
We use the manual-correction/manual_correction.py Line 542 in fe8a8c1
I believe that this assures that the order of revisions is chronological. |
@NathanMolinier thanks for clarifying! I somehow overlooked the |
Good idea! Let's go with more specific |
I self-tested and self-reviewed the PR --> merging. |
This PR adds a new
-json-metadata
flag to allow you to specify a custom JSON file containing metadata to be added to the JSON sidecar of all corrected labels.This flag is useful, for example, when a label was obtained automatically, and you want to include this information into the JSON sidecar.
Example usage:
python manual_correction.py -path-img ~/data/site-001_2024-02-21/data_processed/ -path-label ~/data/site-001_2024-02-21/data_processed/ -path-out ~/data/site-001/derivatives/labels/ -config sc_seg_to_correct_t2w.yml -json-metadata custom_metadata.json
where
custom_metadata.json
:The output JSON sidecar then looks like this:
Without
-json-metadata custom_metadata.json
, the JSON sidecar would look like this:I added a lot of people as reviewers just to let you know that this feature has been added :-)
Relevant: #75