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

sct_propseg: Now possible to rescale data header to be able to segment non-human spinal cord (mice, rats, etc.) #1903

Merged
merged 19 commits into from Jul 7, 2018

Conversation

jcohenadad
Copy link
Member

@jcohenadad jcohenadad commented Jul 4, 2018

Description of the Change

@jcohenadad jcohenadad self-assigned this Jul 4, 2018
@jcohenadad jcohenadad changed the title Various improvements for sct_propseg (WIP) Various improvements for sct_propseg Jul 4, 2018
Copy link
Contributor

@zougloub zougloub left a 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.

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',
Copy link
Contributor

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?

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)
Copy link
Contributor

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.

Copy link
Member Author

@jcohenadad jcohenadad Jul 7, 2018

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

@jcohenadad
Copy link
Member Author

@zougloub not ready for review (WIP)

@jcohenadad jcohenadad added this to the v3.2.2 milestone Jul 6, 2018
@jcohenadad jcohenadad added enhancement category: improves performance/results of an existing feature sct_propseg context: priority:HIGH labels Jul 7, 2018
@jcohenadad jcohenadad changed the title (WIP) Various improvements for sct_propseg Various improvements for sct_propseg Jul 7, 2018
@jcohenadad jcohenadad changed the title Various improvements for sct_propseg sct_propseg: Now possible to rescale data header to be able to segment non-human spinal cord (mice, rats, etc.) Jul 7, 2018
@jcohenadad jcohenadad merged commit 932caac into master Jul 7, 2018
@jcohenadad jcohenadad deleted the enh/1406 branch July 7, 2018 17:38
jcohenadad added a commit that referenced this pull request Dec 18, 2019
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement category: improves performance/results of an existing feature priority:HIGH sct_propseg context:
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants