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

N4 bias field correction without rescaling also converts to UCHAR #461

Closed
dkuegler opened this issue Feb 21, 2024 · 2 comments · Fixed by #465
Closed

N4 bias field correction without rescaling also converts to UCHAR #461

dkuegler opened this issue Feb 21, 2024 · 2 comments · Fixed by #465
Assignees
Labels
needs-fix A reproducable bug that needs to be fixed

Comments

@dkuegler
Copy link
Member

Description

In recon_surf/N4_bias_correct.py if it is called to output the --outvol, but the input is not UCHAR (i.e. the mean is not around 150 or so) the script renormalizes the input to the old mean (of the input image). After that, it is converted to UCHAR by clamping, so all intensity information >255 is lost. This is not an expected behavior.

Steps to Reproduce

Run N4_bias_correct on an image that is not UCHAR / not conformed.

Expected Behavior

Retains data type, or additional flag for conforming intensities.

@m-reuter
Copy link
Member

I think the expected behaviour if only bias field is corrected, is to keep data type. If also intensities are rescaled to 0--255 then the default could be to convert to UCHAR (as that is the main reason of scaling to that range).

@m-reuter m-reuter added the needs-fix A reproducable bug that needs to be fixed label Feb 22, 2024
@dkuegler
Copy link
Member Author

I agree, but scaling/conversion to UCHAR is probably likely use case (at least we need it for #459 ), so maybe by default we keep the data type of the input, but we can also add an option to rescale the not am normalized image to UCHAR and that the also is a robust scaling (that also gives us limits on how to scale, i.e. by percentiles).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-fix A reproducable bug that needs to be fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants