Skip to content
This repository has been archived by the owner on Dec 21, 2020. It is now read-only.

Report errors upstream instead of panicking. #10

Open
wants to merge 105 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
3500581
Remove uses of channels. They are not buying performance, and it's co…
Aug 11, 2017
b30dce9
Fixed tests.
Aug 11, 2017
add17fa
Added a fuzz test. Fixed a few bugs found by it.
Aug 12, 2017
17bf293
Cleaned the dictionary code so that it can be used by other packages.
yasushi-saito Aug 21, 2017
56f4672
applied gofmt.
yasushi-saito Aug 21, 2017
79ba23f
Added a Tag type. A bit more cleanup.
yasushi-saito Aug 22, 2017
40472c6
More cleanup. Remove the dictionary field from Parser, and simplify
yasushi-saito Aug 22, 2017
c8f2264
Change the Buffer structure to use the netdicom Decoder.
yasushi-saito Aug 22, 2017
6693fe7
Merged the buffer structs for dicom and netdicom.
yasushi-saito Aug 22, 2017
d9669cc
More cleanup.
yasushi-saito Aug 22, 2017
9b646c5
Added uiddict for translating UID to its info, such as name and type.
Aug 22, 2017
514714c
Added utility functions for getting a value from DicomElement.
Aug 22, 2017
1ea763f
Rename Encoder.EncodeUint* -> EncodeUInt*.
Aug 22, 2017
e63b68b
Checkpointing. Handle sequence and items in a more principled fashion.
Aug 23, 2017
d94122c
Updated the doc.
Aug 23, 2017
7d0eb7b
More docs.
Aug 23, 2017
60a014d
Updated the doc.
yasushi-saito Aug 23, 2017
5f0eb58
Merge branch 'master' of github.com:yasushi-saito/go-dicom
yasushi-saito Aug 23, 2017
9fcf4aa
Handle native pixel encoding. For now, just store the data in binary.
yasushi-saito Aug 23, 2017
f2b02d5
Cosmetic cleanups. Emit more informative error messages.
yasushi-saito Aug 23, 2017
412afc6
Updated the doc so that it looks better with godoc.
yasushi-saito Aug 23, 2017
87a6c0b
Doc updates.
yasushi-saito Aug 23, 2017
16b91fd
Change TagXXX connsts to just store the tag, not the associated attrs.
Aug 23, 2017
3d91306
Cleaned the uses of panic.
Aug 23, 2017
4e1c041
Fixed the fuzz test and dicomutil.
Aug 23, 2017
da0d711
Remove '\0' at the end of a string with odd length.
Aug 23, 2017
6c292b3
Started working on golden test using pydicom.
Aug 23, 2017
3391f6a
Add ParseBytes for parsing []byte instead of io.Reader.
yasushi-saito Aug 24, 2017
2ffc29b
Add a function to get a canonical transfer syntax given arbitrary syn…
Aug 24, 2017
7b01257
Added methods to extract metadata from a file. This is a temporary ha…
Aug 24, 2017
215888d
Add a few more standard tag types.
Aug 25, 2017
90faea8
Got rid of Name, Pos, and length from DicomElement. This is preparati…
Aug 25, 2017
353395a
Change implicit to be tristate - implicit, explicit, unknown. This al…
yasushi-saito Aug 26, 2017
175f551
Add the implicit attr to Encoder. Implement element writing more prop…
yasushi-saito Aug 26, 2017
22846bf
Support implicit/endianness attributes properly writing elements.
yasushi-saito Aug 26, 2017
9d93950
Fix various bugs in WriteFileHeader.
yasushi-saito Aug 26, 2017
22dfa8e
Remove bin/dicom.go. It's subsumed by dicomutil.
yasushi-saito Aug 26, 2017
139558b
Checkpointing.
yasushi-saito Aug 26, 2017
c1ad8bb
Merged dictionary and tagdict.
yasushi-saito Aug 26, 2017
340b3ae
Make print_elements to emulate pydicom when pretty-printing elements.
yasushi-saito Aug 27, 2017
936c9cb
Extend pydicom_test to compare results from pydicom and go-dicom.
yasushi-saito Aug 27, 2017
7618f48
Fix handling of empty strings when parsing. Before, we produced an empty
yasushi-saito Aug 27, 2017
693b9c1
More fixes to make print format compatible w/ pydicom.
yasushi-saito Aug 27, 2017
ec4c8fd
Update docs.
yasushi-saito Aug 27, 2017
8e2aaf0
Checkpointing.
yasushi-saito Aug 27, 2017
cda29b5
More cleanup.
yasushi-saito Aug 27, 2017
702053f
Fix a bunch of issues found by fuzz testing.
yasushi-saito Aug 27, 2017
ce9ad92
Got all files in examples/*.dcm pass the pydicom_test.py
yasushi-saito Aug 27, 2017
1c1d69c
Cleanup. Improved the documentation.
yasushi-saito Aug 27, 2017
57a2238
More doc updates.
yasushi-saito Aug 27, 2017
0d20f17
Checkpointing.
yasushi-saito Aug 28, 2017
333291a
Remove useless log messages.
Aug 28, 2017
5561ec5
Handle pre-DICOM DT strings of form 1993.08.22. It's noncompliant, bu…
Aug 28, 2017
e1b20cd
Handle non-ASCII character sets more properly. This change only handles
Aug 28, 2017
b39246d
Many changes to handle PN parsing better. Still broken somewhat.
Aug 29, 2017
2e3e00a
Checkpointing.
Aug 29, 2017
e340771
Added TagMetadataGroup.
yasushi-saito Aug 29, 2017
65d531e
Support more charsets that can be trivially handled by golang/x/htmli…
Aug 29, 2017
f20a2c1
Made Get* methods of DicomElement.
Aug 29, 2017
8a5c54c
Rename Decode -> Read to be consistent with the rest of the packages.
Aug 29, 2017
3752741
Merged a bunch of DIMSE tag types into tageg.o
Aug 29, 2017
a2e5d45
Moved the charset-related functions and types to a separate file.
Aug 29, 2017
1e9522a
Doc updates.
yasushi-saito Aug 30, 2017
ad69b39
More updates.
yasushi-saito Aug 30, 2017
f33b219
Updated.
yasushi-saito Aug 30, 2017
93ef13e
Remove a panic message.
Aug 31, 2017
7431c02
Use glog instead of log.
Sep 1, 2017
98ab475
Formatted.
Sep 1, 2017
9611cfd
Change to use vanadium log, not glog. Mixing the two causes conflicts.
Sep 1, 2017
f5e6767
Moved internal classes to separate packages.
yasushi-saito Sep 4, 2017
535bb55
Fixed tests.
yasushi-saito Sep 5, 2017
614eea9
More cleanup. Renamed DicomFile -> DataSet, DicomElement -> Element.
yasushi-saito Sep 5, 2017
ba59c82
Added a few more tags needed by DIMSE.
Sep 18, 2017
e8e6dc5
Updated the doc for dicom.Element; moved VR and UndefinedLength down …
Sep 19, 2017
cf25aca
More supports for writing a dicom file anew. Not yet fully functional.
Sep 19, 2017
5959bcb
Got the writer sort of working. Not yet fully functional.
yasushi-saito Sep 20, 2017
c81db8e
Change dicomio.Encoder to take io.Writer, not bytes.Buffer.
yasushi-saito Sep 20, 2017
5f8a881
Added dicom.Write(). It sort of works.
yasushi-saito Sep 20, 2017
0cee7d3
Do byte swap for "OW" vr types.
Sep 20, 2017
f597bbd
Writing basically works. More testing needed though.
Sep 20, 2017
638676d
Move the UID-related code to a new package, dicomuid.
Sep 20, 2017
e31d908
Add a few more C-FIND uid consts.
Sep 21, 2017
f11b883
Change DataSet to store []*Element, not []Element. []*Element leads t…
Sep 21, 2017
f6b979c
Changed to codegen tag constants.
Sep 21, 2017
6def683
Cosmetic doc updates.
Sep 22, 2017
c54cf74
Merge branch 'master' of github.com:yasushi-saito/go-dicom
Sep 22, 2017
9f47595
Added an option to skip PixelData during read.
Sep 25, 2017
44f8e40
Added a test for the DropPixelData option.
Sep 25, 2017
3683b28
A bunch of changes.
Sep 28, 2017
fb8f5f0
Lookup -> Find.
Sep 28, 2017
d7cb958
Avoid writing duplicate tags in WriteDataSet.
Sep 28, 2017
f3f80ac
Checkpointing.
Sep 29, 2017
a9767d4
Added a DICOMDIR parser.
Oct 4, 2017
8c086ff
Make WriteElement more forgiving when Element.VR doesn't exactly matc…
Oct 4, 2017
d5c5f5a
Various changes.
Oct 4, 2017
cc21978
Handle partial reads better.
Oct 5, 2017
ee2c246
Checkpointing.
Oct 5, 2017
dd07e49
Updated the doc.
Oct 6, 2017
cde2a10
Checkpointing.
Oct 10, 2017
a04a233
Checkpointing.
Oct 10, 2017
01237e2
Added VerificationSOPClass.
Oct 22, 2017
6fbe0d4
Added a few more C-GET/C-MOVE QR UIDs.
Oct 23, 2017
d7e31a7
Minor doc updates.
Oct 24, 2017
c0a9d0a
Query() sometimes misidentified empty queries.
Oct 24, 2017
28a4c4b
Moved.
Oct 29, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# binary
dicom

*~

# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
The MIT License (MIT)
Copyright (c) 2016 Gilles De Mey, Seppe Stas
Copyright (c) 2016 Gilles De Mey, Seppe Stas, Yaz Saito

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
74 changes: 1 addition & 73 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,73 +1 @@
# DICOM parser in Go [![GoDoc](https://godoc.org/github.com/gillesdemey/go-dicom?status.svg)](https://godoc.org/github.com/gillesdemey/go-dicom) [![wercker status](https://app.wercker.com/status/c250d72bc82a5d8f267c7ee0b9e839bc/s/master "wercker status")](https://app.wercker.com/project/bykey/c250d72bc82a5d8f267c7ee0b9e839bc)

## Usage
```Go
package main

import (
"fmt"
"github.com/gillesdemey/go-dicom"
"io/ioutil"
)

func main() {

bytes, err := ioutil.ReadFile("myfile.dcm")

parser, err := dicom.NewParser()
data, err := parser.Parse(bytes)

for _, elem := range data.Elements {
fmt.Printf("%+v\n", &elem)
}

}
```

## Commandline Interface

`dicom -file=myfile.dcm`

Will print something like:

```
Group Element Name VR VL Value
0002 0000 FileMetaInformationGroupLength UL 4 204
0002 0001 FileMetaInformationVersion OB 2 [0 1]
0002 0002 MediaStorageSOPClassUID UI 26 [1.2.840.10008.5.1.4.1.1.2]
0002 0003 MediaStorageSOPInstanceUID UI 56 [1.3.12.2.1107.5.1.4.54023.30000005032916373504600004748]
0002 0010 TransferSyntaxUID UI 22 [1.2.840.10008.1.2.4.91]
0002 0012 ImplementationClassUID UI 22 [1.3.6.1.4.1.19291.2.1]
0002 0013 ImplementationVersionName SH 10 [OSIRIX001]
0002 0016 SourceApplicationEntityTitle AE 6 [OsiriX]
0008 0008 ImageType CS 34 [ORIGINAL PRIMARY AXIAL CT_SOM5 SPI]
0008 0016 SOPClassUID UI 26 [1.2.840.10008.5.1.4.1.1.2]
0008 0018 SOPInstanceUID UI 56 [1.3.12.2.1107.5.1.4.54023.30000005032916373504600004748]
0008 0020 StudyDate DA 8 [20050329]
0008 0021 SeriesDate DA 8 [20050329]
0008 0022 AcquisitionDate DA 8 [20050329]
0008 0023 ContentDate DA 8 [20050329]
0008 0030 StudyTime TM 14 [142530.125000 ]
0008 0031 SeriesTime TM 14 [144801.203000 ]
0008 0032 AcquisitionTime TM 14 [143840.611848 ]
0008 0033 ContentTime TM 14 [143840.611848 ]
0008 0050 AccessionNumber SH 8 [2386679]
0008 0060 Modality CS 2 [CT]
0008 0070 Manufacturer LO 8 [SIEMENS]
0008 0080 InstitutionName LO 20 [UCLA Medical Center]
0008 0081 InstitutionAddress ST 52 [UCLA Medical PlazaLos Angeles/2782F4/Los AngelesUSA]
0008 0090 ReferringPhysicianName PN 16 [MIYAMOTO^MICHAEL]
0008 1010 StationName SH 8 [CT54023]
0008 1030 StudyDescription LO 48 [Cardiac^1CTA_CORONARY_ARTERIES_TESTBOLUS (Adult)]
```

### Acknowledgements

I'd like to thank my friend [Seppe Stas](https://github.com/Bitbored/) for helping me get through the horrific DICOM image specification and some of the harder parts of the parser.

Some more inspiration and helpful resource that brought this library to life (in no particular order):

DWV by ivmartel https://github.com/ivmartel/dwv/ <br>
dicomParser by Chris Hafey https://github.com/chafey/dicomParser <br>
http://www.dicomlibrary.com <br>
http://dicom.nema.org/medical/dicom/current/output/pdf/part05.pdf <br>
This package has moved to https://github.com/grailbio/go-dicom.
107 changes: 0 additions & 107 deletions bin/dicom.go

This file was deleted.

Loading