Skip to content

Disable crosshairs OrthoSlicer3D #689

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

Closed
mko010 opened this issue Nov 6, 2018 · 6 comments
Closed

Disable crosshairs OrthoSlicer3D #689

mko010 opened this issue Nov 6, 2018 · 6 comments

Comments

@mko010
Copy link
Contributor

mko010 commented Nov 6, 2018

Hello, how I can disable the crosshairs of Orthoslicer3D?

thank you.

@effigies
Copy link
Member

effigies commented Nov 6, 2018

In the short term, you can comment out these lines:

nibabel/nibabel/viewers.py

Lines 501 to 502 in 118d305

for line in self._crosshairs[ii].values():
ax.draw_artist(line)

If you'd like to submit a pull request, you could add a _show_crosshairs instance variable that's togglable with a keypress in

nibabel/nibabel/viewers.py

Lines 479 to 492 in 118d305

def _on_keypress(self, event):
"""Handle mpl keypress events"""
if event.key is not None and 'escape' in event.key:
self.close()
elif event.key in ["=", '+']:
# increment volume index
new_idx = min(self._data_idx[3] + 1, self.n_volumes)
self._set_volume_index(new_idx, update_slices=True)
self._draw()
elif event.key == '-':
# decrement volume index
new_idx = max(self._data_idx[3] - 1, 0)
self._set_volume_index(new_idx, update_slices=True)
self._draw()

that you could use to selectively deactivate the above lines.

@mko010
Copy link
Contributor Author

mko010 commented Nov 6, 2018 via email

@effigies
Copy link
Member

effigies commented Nov 6, 2018

I'm sorry, I don't understand the question.

@mko010
Copy link
Contributor Author

mko010 commented Nov 6, 2018 via email

@effigies
Copy link
Member

effigies commented Nov 7, 2018

I think freezing some views will require a more significant change. I'm not immediately sure of how I'd go about that.

@mko010
Copy link
Contributor Author

mko010 commented Nov 7, 2018 via email

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

No branches or pull requests

2 participants