-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 @@ | |||
""" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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') |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add QC
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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 insct_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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That worked !
TO DO: