Get dcm_write() to work. Switch to using Dict for handling data. #22
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 was meant to be a simple fix to get
dcm_write()
to work, but it kinda got out of control somehow.The good news is
dcm_write()
now works, but breaking changes were made along the way, so old code usingDICOM.jl
will have to be updated.Summary of Changes
dcm_write()
now works - on the current test cases at least. It also accepts a path to a file now, instead of requiring an IOStream.dcm_parse()
now works on a larger variety of DICOM files. It can read files without headers (Ability to read DICOM files without headers #5), it can parse signed data (Properly support signed types in pixeldata_parse #3) and data with multiple frames. It might be able to handle private creators too (Handle private creator data elements #6) - not sure about the latter, but it does allow the user to provide VR in caselookup_vr()
fails, or to just skip them entirely. It can't handle big-endian files, perhaps the changes from PR Handle big-endian data #18 could be incorporated eventually?DcmElt
composite type is removed. Now,dcm_parse
returns a dictionary. This means we no longer needlookup(d, tag)
and can now just used[tag]
. The double indexing issue (fix Arrays for 0.5 #14) is also gone. I think this leads to cleaner code, e.g. we can now dodcm[(0x0020,0x0010)]
instead oflookup(dcm,(0x0020,0x0010)).data[1][1]
to get the number of rows.runtests.jl
now has more tests (tests #1), using sample data from http://www.barre.nom.fr/medical/samples/ including cases with signed data, missing headers, multiple frames, and retired elements. The tests no longer create temporary directories, and instead create a folder in the Pkg dir (ignored by git). This was to make it easier to find/see the results of the tests, such as the written/saved dicom files.readme.md
to get users started (addresses comment in tests #1), though I started to ramble a bit in the latter portion with the VR-handling. Some examples, made while testing out the new changes, are in https://gist.github.com/notZaki/d89e6cf6bf44886cddbd2717b1749bf9 which might be useful - I'll add the examples usingdcm_write()
eventually.dcm_dict.jl
; specified types in functions,The performance of the package is about the same as before. Results from
BenchmarkTools
are in the Table below (bold is better result)