-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
sct_propseg: Now possible to rescale data header to be able to segment non-human spinal cord (mice, rats, etc.) #1903
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.
Reviewed the code changes only, didn't execute anything.
scripts/sct_image.py
Outdated
mandatory=False, | ||
example='RIP LIP RSP LSP RIA LIA RSA LSA IRP ILP SRP SLP IRA ILA SRA SLA RPI LPI RAI LAI RPS LPS RAS LAS PRI PLI ARI ALI PRS PLS ARS ALS IPR SPR IAR SAR IPL SPL IAL SAL PIR PSR AIR ASR PIL PSL AIL ASL'.split()) | ||
parser.add_option(name="-setorient-data", | ||
type_value="multiple_choice", | ||
description='Set orientation of the input image\'s data. Use with care !ro', | ||
description='Set orientation of the input image\'s data (does NOT modify the header, but the data). Use with care !ro', |
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.
Sorry, what's the trailing "ro" in that string?
scripts/sct_propseg.py
Outdated
header_rescaled.set_qform(qform) | ||
# the data are the same-- only the header changes | ||
img_rescaled = nib.nifti1.Nifti1Image(img.get_data(), None, header=header_rescaled) | ||
path_tmp = sct.tmp_create(basename="propseg", verbose=verbose) |
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.
Looks like the temp. folder is not removed at the end.
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.
indeed-- i've added a todo (not urgent): 4987b7a
@zougloub not ready for review (WIP) |
…t non-human spinal cord (mice, rats, etc.) (#1903) * reorganized usage * minor usage update * started to implement header-based rescaling (WIP) * now creating file in temp folder, and fixed input to propseg function * added flag to enable/disable the algorithm that corrects the segmentation * added doc * refactored to follow variable conventions * finished implementing the major part of the rescaling * fixed issue with output file name * moved import at the beginning * added flag -rescale * fixing output path issues (unfinished) * fixed output filename * fixed typo in usage * does not rename the centerline if rescaled is on * removed TODO * added TODO to deal with removal of temp file (not urgent) Former-commit-id: 932caac
Description of the Change
-rescale
, which rescales the image (only the header, not the data) in order to enable segmentation on spinal cords with dimensions different than that of humans (e.g., mice, rats, elephants, etc.)-correct-seg
, which enables/disables a few corrections on the output segmentation. This was introduced because sometimes the correction makes things worse.