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: Labels and centerline are now output with correct header if -rescale is used #1926

Merged
merged 6 commits into from
Jul 17, 2018

Conversation

jcohenadad
Copy link
Member

@jcohenadad jcohenadad commented Jul 12, 2018

Description of the Change

This PR fixes a few issues associated with the recently-introduced -rescale flag:

  • The output centerline is now scaled back to the original data header
  • The manual labels (if used) are now output and rescaled appropriately
  • If -init-centerline or -init-mask is used along with -rescale, the input labels are rescaled.

Fixes #1925

@jcohenadad jcohenadad requested a review from zougloub July 12, 2018 20:48
@jcohenadad jcohenadad added this to the v3.2.3 milestone Jul 12, 2018
@jcohenadad jcohenadad self-assigned this Jul 12, 2018
@jcohenadad jcohenadad added enhancement category: improves performance/results of an existing feature sct_propseg context: labels Jul 12, 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.

Added some suggestions but the code looks fine.

if use_viewer:
fname_labels_viewer_new = os.path.join(folder_output, os.path.basename(sct.add_suffix(fname_data,
"_labels_viewer")))
shutil.copy(fname_labels_viewer, fname_labels_viewer_new)
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually we added a sct.copy(), you could use it.

Copy link
Contributor

Choose a reason for hiding this comment

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

And we also have sct.mv() which can replace the os.rename() above.

@jcohenadad jcohenadad merged commit 070207d into master Jul 17, 2018
@jcohenadad jcohenadad deleted the jca/1925-propseg-rescale-output branch July 17, 2018 16:27
@jcohenadad jcohenadad changed the title Labels and centerline are now output with correct header sct_propseg: Labels and centerline are now output with correct header Jul 21, 2018
@jcohenadad jcohenadad changed the title sct_propseg: Labels and centerline are now output with correct header sct_propseg: Labels and centerline are now output with correct header if -rescale is used Jul 21, 2018
jcohenadad added a commit that referenced this pull request Dec 18, 2019
* labels and centerline are now output with correct header (fixes #1925)

* Fixed issue when manual labels are input and rescale is used

* replaced os.rename by sct.mv and shutil.copy by sct.copy


Former-commit-id: 070207d
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 sct_propseg context:
Projects
None yet
Development

Successfully merging this pull request may close these issues.

if -rescale is used, the output centerline should be scaled back to the original data header
2 participants