-
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
Generalize manual correction scripts #2
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ng 'label_list' specifying labels to correct.
…d get_session under a single function).
…ffix-files-label' to build the 'suffix_dict'.
The script allows copying of manually corrected labels (segmentations, vertebral labeling, etc.) from the preprocessed dataset to the git-annex BIDS dataset's derivatives folder
@naga-karthik Thank you for the implementation of this super useful feature! 👍🏻 |
The PR is ready for merge. If there are no additional comments or suggestions, I will do merge. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR proposes an initial version of scripts for manual correction workflow. For details, see README.
The scripts are based on ukbiobank-spinalcord-csa scripts. To allow easy tracking of changes proposed in this PR, I pushed the
ukbiobank-spinalcord-csa
scripts to the main branch.Compared
ukbiobank-spinalcord-csa
scripts, I added:-path-derivatives
,-path-derivatives
,-suffix-files-seg
,-suffix-files-gmseg
,-suffix-files-label
,-label-list
,-viewer
) in f89a9acfetch_subject_and_session
function (to unifyget_subject
andget_session
under a single function) in 0e312aa and daf74dcfetch_yaml_config
function to simplify loading of yaml config file among scripts in 272c4c9I would extremely appreciate feedback from SCT users, such as @sandrinebedard, @kiristern, @naga-karthik, @rohanbanerjee, and @mchen1110. You can test the PR using the instructions below or on some dataset you are currently working on.
This PR partly addresses #1. But still, a lot of features describes in spinalcordtoolbox/spinalcordtoolbox#3353 (comment) have to be implemented.
How to test this PR
venv
, and install dependencies:Download the testing dataset. The dataset contains a sample output as provided by
sct_run_batch
. The dataset also includes thefiles_to_correct.yml
file with a list of files for manual correction (obtained from the SCT QC html report.Run
package_for_correction.py
:This simulates the real-world workflow in which a dataset is processed on a remote server, and you do not want to copy the whole dataset (GB of data). Instead, only the images and labels that need to be corrected (listed in
files_to_correct.yml
) are zipped by thepackage_for_correction.py
:(Now, you would have copied the zipped file from a server to your local machine. Since we are just simulating real-world workflow, the copy from a server to a local machine is skipped for now.)
manual_correction.py
:The
package_for_correction.py
outputsdata_to_correct.zip
. Unzip this archive and runmanual_correction.py
:Note: you can specify a viewer (FSLeyes, ITK-SNAP) for SC and GM segmentation corrections. (3D Slicer is not implemented yet)
First, you will have to enter your name (which will be used for .json sidecars). Then, the
package_for_correction.py
will iterate across files listed infiles_to_correct.yml
. It will gradually open FSLeyes (or ITK-snap) for SC and GM segmentation correction and sct_label_utils for disc label correction. The script saves manually corrected files under thederivatives/labels
folder (you can change this folder by the-path-derivatives
flag). The script also outputs a QC report (--> you can check how you corrected the labels).Once finished, you can rerun the command. In this case, the script detects manually corrected files under
derivatives/labels
and asks you if you want to overwrite them.Fixes: #1