Skip to content
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

Segment SC using contrast agnostic model #44

Merged
merged 46 commits into from
Oct 17, 2023

Conversation

valosekj
Copy link
Member

@valosekj valosekj commented Oct 4, 2023

This PR adds a segment_sc_contrast-agnostic.sh bash script.
The script:

  • segments SC using the contrast-agnostic MONAI model (by calling run_inference_single_image.py script. Note that the run_inference_single_image.py script is just a copy of the contrast-agnostic script, see this comment for details)
  • performs vertebral labeling using sct_label_vertebrae

@valosekj valosekj self-assigned this Oct 7, 2023
- sc_seg folder to segment_sc_contrast-agnostic
- segment_sc.sh script to segment_sc_contrast-agnostic.sh
@@ -0,0 +1,352 @@
"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scripts are the same. There is a note about that at the end of this README. I duplicated the script because I did not want to create dependency on another repo's branch. I am aware that this duplication is suboptimal. We could move the run_inference_single_image.py script to the ivadomed/utilities repo to avoid further duplications. Tagging @naga-karthik.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think the plan is to have it inside SCT, right @naga-karthik? The faster we get it inside SCT, the faster we can remove the duplicates and all work on the SCT-based implementation

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the plan is to get it inside SCT. That is my action task for this week!

@@ -240,6 +240,36 @@ def keep_largest_object(predictions):
return predictions


# Adapted from ivadomed:
# https://github.com/ivadomed/ivadomed/blob/e101ebea632683d67deab3c50dd6b372207de2a9/ivadomed/postprocessing.py#L224-L245
def remove_small_objects(data, size_min):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i suggest working with atomic PRs-- ie: first, merge this one, and then create a new PR where you implement the remove_small functionality

@valosekj valosekj marked this pull request as ready for review October 17, 2023 20:28
@valosekj
Copy link
Member Author

The segment_sc_contrast-agnostic.sh works --> merging

@valosekj valosekj merged commit e3f3768 into main Oct 17, 2023
@valosekj valosekj deleted the jv/segment_sc_using_contrast_agnostic_model branch October 17, 2023 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants