Skip to content

flip dimensions in OrthoSlicer3D #559

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
pelednoam opened this issue Sep 28, 2017 · 10 comments · Fixed by #564
Closed

flip dimensions in OrthoSlicer3D #559

pelednoam opened this issue Sep 28, 2017 · 10 comments · Fixed by #564
Labels

Comments

@pelednoam
Copy link

Hey,
I'm loading sample subject (from freesurfer) T1.mgz file, both using OrthoSlicer3D and freeview (same slice: 133, 84, 122). It looks like in the coronal and axial views, the left and right are flipped:

OrthoSlicer3D:

orthoslicer3d

freeview:

freeview

Any idea why?
Thanks!

@effigies
Copy link
Member

effigies commented Oct 14, 2017

I'm replicating this issue, so I'd say it's either a bug in nibabel or in freeview...

Edit: Freeview is consistent with fslview, so I'm going to call this a nibabel bug.

@effigies effigies added the bug label Oct 14, 2017
@pelednoam
Copy link
Author

I've loaded a CT of an epileptic patient with depth electrodes, and it can be seen clearly from the electrodes locations that it's a nibabel bug.

@effigies
Copy link
Member

I'm going to generate a series of images with different orientations to check whether it's always LR flipped or just in some orientations. Hopefully it's always, because that'll be the easiest to fix. (The logic of this feature is not easy to follow.)

@pelednoam
Copy link
Author

Yes, I used this code to support slices view in my visualization software (mmvt), and indeed, it was quite hard to follow. In the end, I've just flipped this dimension. From what I checked, it seems to be always LR flipped.

@effigies
Copy link
Member

Thanks. Feel free to submit a PR with your modification. Otherwise I will, when I get a few more minutes.

@pelednoam
Copy link
Author

Well, for now, in my code I've just added this line:
`flips[0] = not flips[0]
Not sure it's the best solution... Maybe a further investigation is needed to understand why the first item in flips is flipped on the first place...

@matthew-brett
Copy link
Member

Sorry to be superficial - but can the difference be explained by differences in display conventions? Nibabel does display the left on the left - neurological convention. Maybe Freesurfer does right on the left - radiological? Or am I missing something?

@matthew-brett
Copy link
Member

@pelednoam - yes - the visualization code needs to be refactored. It's been on my to-do list for a while ...

@effigies
Copy link
Member

effigies commented Oct 14, 2017 via email

@pelednoam
Copy link
Author

@matthew-brett, I don't think it's conventions issue, because both in nibabel and freeview, in those two perspectives, the label R is on the right and L is on the left. I could understand the flip if also the labels were flipped.
Refactored or not, your code is really great, and saved me so much work! Thanks to you, I could add a slicer viewer into my Blender addon:

image

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants