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

Function for rescaling pixel data #41

Merged
merged 5 commits into from
Dec 10, 2019
Merged

Function for rescaling pixel data #41

merged 5 commits into from
Dec 10, 2019

Conversation

notZaki
Copy link
Member

@notZaki notZaki commented Dec 10, 2019

This PR adds a rescale!() function which will rescale the pixel values by taking into account the rescale intercept and slope.
This allows for negative pixel values even if they are stored as unsigned integers, i.e. Pixel Representation = 0.

Example usage of the function would be:

# Reading
dcm = dcm_parse(file)
rescale!(dcm)
# Writing
rescale!(dcm, :backward) # Undo's the previous rescale
dcm_write(newfile, dcm)

The new tests are in lines 152-157 of test/runtests.jl.
The rest of the changes in the tests are from applying JuliaFormatter and converting the older open(...); dcm_write(...); close() statements to the simpler dcm_write(...) format.

@codecov
Copy link

codecov bot commented Dec 10, 2019

Codecov Report

Merging #41 into master will increase coverage by 0.09%.
The diff coverage is 88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #41      +/-   ##
==========================================
+ Coverage   88.46%   88.55%   +0.09%     
==========================================
  Files           1        1              
  Lines         286      297      +11     
==========================================
+ Hits          253      263      +10     
- Misses         33       34       +1
Impacted Files Coverage Δ
src/DICOM.jl 88.55% <88%> (+0.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 20d1607...bf75ffc. Read the comment docs.

@notZaki notZaki merged commit 8d94ebf into JuliaHealth:master Dec 10, 2019
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

Successfully merging this pull request may close these issues.

1 participant