Support parsing of big-endian & RGB files. Also refactoring. #38
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR started as an attempt to incorporate the additions from PR #18 but then it got out of hand.
Sorry about that.
With the PR, the package is now able to read big-endian data.
However, it still can not correctly write big-endian files.
A workaround is to change the transfer-syntax by
and then
dcm_write
will save the data as little-endian.This PR also changes the optional arguments to
dcm_parse
anddcm_write
, so it can break older code.The optional arguments are now keywords (described in the summary below).
Any suggestions to the keywords are welcome.
I want to manually test the PR on different machines before merging it and this will probably take me a week.
If there are no objections until then, then I will go ahead and merge.
Summary of changes:
dcm_parse()
into smaller functionsDICOM.jl
dcm_parse
anddcm_write
) were at the enddcm_parse
. They are now all keywords and are as follows:return_vr::Bool
controls whether to return the VRs with the parsed data. Default:false
preamble::Bool
controls whether the 128-bytes + "DICM" preamble is present. This was previouslyheader
. Default:true
aux_vr
is a user-supplied dictionary which can supplement/override the dictionary insrc/dcm_dict.jl
. This was previously nameddVR
.dcm_write
. It used to not be a keyword, but now it has the keywordaux_vr
.xr=rows
,yr=columns
, whererows
andcolumns
are values from the dicom header. The updated version has the order swapped, i.e.xr=columns
,yr=rows
.Planar configuration = 1
). If the channels are interlaced then the user will have to de-interlace them.