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

Question about direction pre-processing one liner #45

Closed
dscarmo opened this issue May 7, 2021 · 2 comments
Closed

Question about direction pre-processing one liner #45

dscarmo opened this issue May 7, 2021 · 2 comments
Labels
question Further information is requested

Comments

@dscarmo
Copy link

dscarmo commented May 7, 2021

Hello, i am very intestered by this one-liner that i found in your pre-processing of simpleitk images:

np.flip(data, np.where(directions[[0,4,8]][::-1]<0)[0])

Visualizing the data before and after this operation, it seems that it normalizes the direction of the CT volume.

Can you confirm this line alone is enough to normalize the 3D direction of data extracted using SimpleITK, from DCM and NIFT images?

Thank you!

@JoHof JoHof added the question Further information is requested label May 8, 2021
@JoHof
Copy link
Owner

JoHof commented May 8, 2021

Hi Diedre,

yes, that is the purpose of the line. It normalizes the orientation with respect to the patient. For example, if the patient was scanned in prone position (that is, lying on the belly) the image will also be flipped. This way of normalization is a bit limited though as it assumes the coordinate system being orthogonal to the patient. This is true for almost all chest ct scans but I would not recommend to it that way for MR imaging.

@dscarmo
Copy link
Author

dscarmo commented May 12, 2021

Thanks for the clarification! I was surprised as to how lungmask was able to work in hundreds of CTs I and my team had access. Those being from multiple different sources, and with that direction normalization apparently working.

Keep up the good work!

@dscarmo dscarmo closed this as completed May 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants