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

Refactor #24

Closed
jcreinhold opened this issue Jun 26, 2020 · 6 comments
Closed

Refactor #24

jcreinhold opened this issue Jun 26, 2020 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@jcreinhold
Copy link
Owner

🚀 Feature

Current code is a jumbled mess—it is hard to debug and hard to use as an importable module. Refactor for clarity.

Motivation

Current importable functions don't make sense and are incosistent; some take a directory of images instead of an individual image—this is bad. Some of the CLIs are a jumble of hacked-together code (e.g., the ones that have a single-image option).

Pitch

Refactor code to improve importable functionality and clean up CLIs with single-img option.

@jcreinhold jcreinhold added the enhancement New feature or request label Jun 26, 2020
@jcreinhold jcreinhold self-assigned this Jun 26, 2020
@jcreinhold jcreinhold changed the title Refactor code Refactor Jun 27, 2020
@vkyprmr
Copy link

vkyprmr commented Feb 25, 2021

Hi, I don't have any issue, but just had a question regarding z-score normalization. I am new to working with medical images and so I don't understand why do you do the z-score with a mask and not directly take the image, take mean and std and calculate. Could you please explain it to me?

@jcreinhold
Copy link
Owner Author

Hi @vkyprmr—for future reference—if you have a feature request or question about unclear documentation, you should open up a new issue. But to answer your question, you can have z-score normalize use the entire image; if you use the zscore-normalize script, then you can pass in none for the option --brain-mask. The script states this option in the argument description if you run zscore-normalize --help in your terminal after you've installed this package.

Hope this helped.

@vkyprmr
Copy link

vkyprmr commented Feb 25, 2021

I am sorry. I knew the programming side: specifying none if needed. I was wandering more about the clinical side and what difference does it make. But, I am sorry if it was a dumb question. Good luck for the future.

@jcreinhold
Copy link
Owner Author

@vkprmr I see. That's not a dumb question. I don't suspect that any of these normalization methods would be used for clinical work. These methods are mostly used as preprocessing for image processing/machine learning methods. With respect to z-score normalization with the brain mask, the normalization is usually more consistent across a image data set if you use the brain intensities to z-score normalize vs. the whole image.

Generally these normalization methods are used to put the tissue intensities into alignment across a dataset. z-score normalization works by subtracting the mean and dividing by the standard deviation (std) on every voxel—where the mean and std are computed either from the intensities in the brain mask or across the whole image. If the mean and std are computed from the whole image, the mean will be very close to zero (because the vast majority of voxels in a 3D volume are background) and the std will also not be as meaningful for the same reason.

@vkyprmr
Copy link

vkyprmr commented Feb 25, 2021

@jcreinhold That really makes sense. Thanks a lot :)

@jcreinhold
Copy link
Owner Author

Completed with ede16c3

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

No branches or pull requests

2 participants