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

Temporal analysis of MS lesions #40

Draft
wants to merge 26 commits into
base: main
Choose a base branch
from
Draft

Temporal analysis of MS lesions #40

wants to merge 26 commits into from

Conversation

plbenveniste
Copy link
Collaborator

TO DO:

  • list files

Copy link
Member

@jcohenadad jcohenadad left a comment

Choose a reason for hiding this comment

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

PR title: not specific to MS (could work with other diseases, right?)

@@ -0,0 +1,150 @@
"""
Copy link
Member

Choose a reason for hiding this comment

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

apparently this file is not used anymore-- so, consider removing. Also, consider discussing why not using sct_analyse_lesion. And if the SCT function has issues (eg: slow, etc.), consider modifying sct_analyse_lesion instead.

Copy link
Member

Choose a reason for hiding this comment

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

Also see #38 (comment)

"""

#first we segment the spinal cord on the two images using sct_deepseg_sc
os.system('sct_deepseg_sc -i ' + path_first_image + ' -c t2 -o ' + path_output_folder + '/first_image_sc_seg.nii.gz')
Copy link
Member

Choose a reason for hiding this comment

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

system call can be avoided once (if) this script becomes an SCT function. Until then, it is fine to keep it as system call, but clear reference to SCT's version should be made in the README, as a requirement

#we then remove the labels that are not in common
for label in np.unique(first_label_data):
if label not in common_labels:
first_label_data[first_label_data == label] = 0
Copy link
Member

Choose a reason for hiding this comment

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

you might want to consider some features of sct_label_utils -remove-reference

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I mentioned an issue with this in this comment about very large computation time.

nib.save(second_label, path_output_folder + '/second_image_sc_seg_labeled.nii.gz')

#then we register the images and the segmentations with the first image as reference using sct_register_multimodal using both the spinal cord segmentation and the vertebral levels
parameters = 'step=0,type=label,dof=Tx_Ty_Tz:step=1,type=im,algo=dl'
Copy link
Member

Choose a reason for hiding this comment

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

add QC

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I couldn't add QC because it requires -dseg which I am not using in sct_register_multimodal.

Copy link
Member

Choose a reason for hiding this comment

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

I couldn't add QC because it requires -dseg which I am not using in sct_register_multimodal.

Good point! Maybe, you can try to pass the -dseg arg. And since you are manually specifying registration parameters ('step=0,type=label,dof=Tx_Ty_Tz:step=1,type=im,algo=dl'), the SC seg will be used only for QC but not for the registration itself.
But I am unsure about this, it has to be tested.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That worked !

@plbenveniste plbenveniste marked this pull request as draft November 10, 2023 16:17
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.

3 participants