Skip to content

Commit

Permalink
Documentation: http → https (#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitriPapadopoulos committed Dec 24, 2022
1 parent a4ded52 commit b67132d
Show file tree
Hide file tree
Showing 17 changed files with 49 additions and 49 deletions.
24 changes: 12 additions & 12 deletions README.md
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<img src="https://suyashkumar.com/assets/img/magnetic-resonance.png" width="125px"/>
<h3 align="center">dicom</h3>
<p align="center">High Performance Golang DICOM Medical Image Parser<p>
<p align="center">
<a href="https://github.com/suyashkumar/dicom/actions"><img src="https://github.com/suyashkumar/dicom/workflows/build/badge.svg" /></a>
<p align="center">
<a href="https://github.com/suyashkumar/dicom/actions"><img src="https://github.com/suyashkumar/dicom/workflows/build/badge.svg" /></a>
<a href="https://godoc.org/github.com/suyashkumar/dicom"><img src="https://godoc.org/github.com/suyashkumar/dicom?status.svg" alt="" /></a>
<a href="https://goreportcard.com/report/github.com/suyashkumar/dicom"><img src="https://goreportcard.com/badge/github.com/suyashkumar/dicom" alt=""></a>
<a href="https://goreportcard.com/report/github.com/suyashkumar/dicom"><img src="https://goreportcard.com/badge/github.com/suyashkumar/dicom" alt=""></a>
</p>
</p>

Expand All @@ -26,7 +26,7 @@ Some notable features:

## Usage
To use this in your golang project, import `github.com/suyashkumar/dicom`. This repository supports Go modules, and regularly tags releases using semantic versioning. Typical usage is straightforward:
```go
```go

dataset, _ := dicom.ParseFile("testdata/1.dcm", nil) // See also: dicom.Parse which has a generic io.Reader API.

Expand Down Expand Up @@ -54,15 +54,15 @@ wget -qO- "https://getbin.io/suyashkumar/dicom" | tar xvz
```
dicomutil -path myfile.dcm
```
Note: for some DICOMs (with native pixel data) no automatic intensity scaling is applied yet (this is coming). You can apply this in your image viewer if needed (in Preview on mac, go to Tools->Adjust Color).
Note: for some DICOMs (with native pixel data) no automatic intensity scaling is applied yet (this is coming). You can apply this in your image viewer if needed (in Preview on mac, go to Tools->Adjust Color).


### Build manually
To build manually, ensure you have `make` and `go` installed. Clone (or `go get`) this repo into your `$GOPATH` and then simply run:
```sh
make
```
Which will build the dicomutil binary and include it in a `build/` folder in your current working directory.
Which will build the dicomutil binary and include it in a `build/` folder in your current working directory.

You can also built it using Go directly:

Expand All @@ -71,24 +71,24 @@ go build -o dicomutil ./cmd/dicomutil
```

## History
Here's a little more history on this repository for those who are interested!
Here's a little more history on this repository for those who are interested!

### v0
The v0 [suyashkumar/dicom](https://github.com/suyashkumar/dicom) started off as a hard fork of [go-dicom](https://github.com/gillesdemey/go-dicom) which was not being maintained actively anymore (with the [original author being supportive of my fork](https://www.reddit.com/r/golang/comments/bnu47l/high_performance_dicom_medical_image_parser_in/en9hp6h?utm_source=share&utm_medium=web2x&context=3)--thank you!). I worked on adding several new capabilities, bug fixes, and general maintainability refactors (like multiframe support, streaming parsing, updated APIs, low-level parsing bug fixes, and more).

That represents the __v0__ history of the repository.
That represents the __v0__ history of the repository.

### v1

For __v1__ I rewrote and redesigned the core library essentially from scratch, and added several new features and bug fixes that only live in __v1__. The architecture and APIs are completely different, as is some of the underlying parser logic (to be more efficient and correct). Most of the core rewrite work happened at the [`s/1.0-rewrite`](https://github.com/suyashkumar/dicom/tree/s/1.0-rewrite) branch.
For __v1__ I rewrote and redesigned the core library essentially from scratch, and added several new features and bug fixes that only live in __v1__. The architecture and APIs are completely different, as is some of the underlying parser logic (to be more efficient and correct). Most of the core rewrite work happened at the [`s/1.0-rewrite`](https://github.com/suyashkumar/dicom/tree/s/1.0-rewrite) branch.


## Acknowledgements

* <img src="https://user-images.githubusercontent.com/6299853/90325771-b23f2e80-df34-11ea-9d18-5c33b69c2746.png" width="110px" align="left"/> [Segmed](https://www.segmed.ai/) for their help with validation and other contributions to the library.
* <img src="https://user-images.githubusercontent.com/6299853/90325771-b23f2e80-df34-11ea-9d18-5c33b69c2746.png" width="110px" align="left"/> [Segmed](https://www.segmed.ai/) for their help with validation and other contributions to the library.
* Original [go-dicom](https://github.com/gillesdemey/go-dicom)
* Grailbio [go-dicom](https://github.com/grailbio/go-dicom) -- commits from their fork were applied to ours
* GradientHealth for supporting work I did on this while there [gradienthealth/dicom](https://github.com/gradienthealth/dicom)
* Innolitics [DICOM browser](https://dicom.innolitics.com/ciods)
* [DICOM Specification](http://dicom.nema.org/medical/dicom/current/output/pdf/part05.pdf)
* <div>Icons made by <a href="https://www.freepik.com/?__hstc=57440181.48e262e7f01bcb2b41259e2e5a8103b3.1557697512782.1557697512782.1557697512782.1&__hssc=57440181.4.1557697512783&__hsfp=2768524783" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a></div>
* [DICOM Specification](https://dicom.nema.org/medical/dicom/current/output/pdf/part05.pdf)
* <div>Icons made by <a href="https://www.freepik.com/?__hstc=57440181.48e262e7f01bcb2b41259e2e5a8103b3.1557697512782.1557697512782.1557697512782.1&__hssc=57440181.4.1557697512783&__hsfp=2768524783" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a> is licensed by <a href="https://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a></div>
2 changes: 1 addition & 1 deletion dataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
var ErrorElementNotFound = errors.New("element not found")

// Dataset represents a DICOM dataset, see
// http://dicom.nema.org/medical/dicom/current/output/html/part05.html#chapter_7.
// https://dicom.nema.org/medical/dicom/current/output/html/part05.html#chapter_7.
//
// This Dataset representation is JSON serializable out of the box
// (implements json.Marshaler) and will also pretty print as a string nicely (see String example).
Expand Down
4 changes: 2 additions & 2 deletions element.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
var ErrorUnexpectedDataType = errors.New("the type of the data was unexpected or not allowed")

// Element represents a standard DICOM data element (see the DICOM standard:
// http://dicom.nema.org/medical/dicom/current/output/html/part05.html#sect_7.1 ).
// https://dicom.nema.org/medical/dicom/current/output/html/part05.html#sect_7.1 ).
// This Element can be serialized to JSON out of the box and pretty printed as a string via the String() method.
type Element struct {
Tag tag.Tag `json:"tag"`
Expand Down Expand Up @@ -251,7 +251,7 @@ func (s *floatsValue) MarshalJSON() ([]byte, error) {

// SequenceItemValue is a Value that represents a single Sequence Item. Learn
// more about Sequences at
// http://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_7.5.html.
// https://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_7.5.html.
type SequenceItemValue struct {
elements []*Element
}
Expand Down
2 changes: 1 addition & 1 deletion parse.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Package dicom provides a set of tools to read, write, and generally
// work with DICOM (http://dicom.nema.org/) medical image files in Go.
// work with DICOM (https://dicom.nema.org/) medical image files in Go.
//
// dicom.Parse and dicom.Write provide the core functionality to read and write
// DICOM Datasets. This package provides Go data structures that represent
Expand Down
2 changes: 1 addition & 1 deletion pkg/charset/charset.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ var htmlEncodingNames = map[string]string{
// ParseSpecificCharacterSet converts DICOM character encoding names, such as
// "ISO-IR 100" to encoding.Decoder(s). It will return nil, nil for the default (7bit
// ASCII) encoding. Cf. P3.2
// D.6.2. http://dicom.nema.org/medical/dicom/2016d/output/chtml/part02/sect_D.6.2.html
// D.6.2. https://dicom.nema.org/medical/dicom/2016d/output/chtml/part02/sect_D.6.2.html
func ParseSpecificCharacterSet(encodingNames []string) (CodingSystem, error) {
var decoders []*encoding.Decoder
for _, name := range encodingNames {
Expand Down
6 changes: 3 additions & 3 deletions pkg/dcmtime/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ import "errors"
var ErrParseDA = errors.New(
"error parsing dicom DA (date) value -- expected format is 'YYYYMMDD'. " +
"for more details on proper DA value formatting, see here: " +
"http://dicom.nema.org/medical/dicom/current/output/html/part05.html#table_6.2-1",
"https://dicom.nema.org/medical/dicom/current/output/html/part05.html#table_6.2-1",
)

// ErrParseDA is a sentinel error returned from ParseDatetime.
var ErrParseDT = errors.New(
"error parsing dicom DT (datetime) value -- expected format is" +
" 'YYYYMMDDHHMMSS.FFFFFF&ZZXX'. " +
"for more details on proper DT value formatting, see here: " +
"http://dicom.nema.org/medical/dicom/current/output/html/part05.html#table_6.2-1",
"https://dicom.nema.org/medical/dicom/current/output/html/part05.html#table_6.2-1",
)

// ErrParseTM is a sentinel error returned from ParseTime.
var ErrParseTM = errors.New(
"error parsing dicom TM (time) value, but expected format is 'HHMMSS.FFFFFF'. " +
"for more details on proper TM value formatting, see here: " +
"http://dicom.nema.org/medical/dicom/current/output/html/part05.html#table_6.2-1",
"https://dicom.nema.org/medical/dicom/current/output/html/part05.html#table_6.2-1",
)
2 changes: 1 addition & 1 deletion pkg/personname/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
The personname package provides methods and data types for inspecting Person Name (PN)
DICOM Value Representations, as defined here:
http://dicom.nema.org/dicom/2013/output/chtml/part05/sect_6.2.html
https://dicom.nema.org/dicom/2013/output/chtml/part05/sect_6.2.html
*/
package personname
4 changes: 2 additions & 2 deletions pkg/personname/errs.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var ErrNullSepLevelInvalid = fmt.Errorf("TrailingNullLevel exceeded maximum")
func newErrTooManyGroups(groupsFound int) error {
return fmt.Errorf(
"%w: value contains %v groups. see 'PN' entry in official dicom spec: "+
"http://dicom.nema.org/medical/dicom/current/output/html/part05.html#sect_6.2",
"https://dicom.nema.org/medical/dicom/current/output/html/part05.html#sect_6.2",
ErrParseGroupCount,
groupsFound,
)
Expand All @@ -51,7 +51,7 @@ func newErrTooManyGroups(groupsFound int) error {
func newErrTooManyGroupSegments(group pnGroup, segmentsFound int) error {
return fmt.Errorf(
"%w: value group %v contains %v segments. see 'PN' entry in official "+
"dicom spec: http://dicom.nema.org/medical/dicom/current/output/html/part05.html#sect_6.2",
"dicom spec: https://dicom.nema.org/medical/dicom/current/output/html/part05.html#sect_6.2",
ErrParseGroupSegmentCount,
group,
segmentsFound,
Expand Down
2 changes: 1 addition & 1 deletion pkg/personname/groupInfo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ func TestNewPersonNameFromDicom_Err(t *testing.T) {
expectedString := "error parsing PN value: no more than 5 segments with " +
"'[Last]^[First]^[Middle]^[Prefix]^[Suffix]' format are allowed: value group " +
"Alphabetic contains 6 segments. see 'PN' entry in official dicom spec: " +
"http://dicom.nema.org/medical/dicom/current/output/html/part05.html#sect_6.2"
"https://dicom.nema.org/medical/dicom/current/output/html/part05.html#sect_6.2"

if err.Error() != expectedString {
t.Errorf("unexpected error text: %v", err.Error())
Expand Down
2 changes: 1 addition & 1 deletion pkg/personname/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func validateInfoNullSepLevel(level InfoTrailingNullLevel) error {
}

// Info holds information from an element with a "PN" VR. See the "PN"
// entry at: http://dicom.nema.org/dicom/2013/output/chtml/part05/sect_6.2.html
// entry at: https://dicom.nema.org/dicom/2013/output/chtml/part05/sect_6.2.html
//
// PN values are split into three groups which represent three different ways to
// represent a name:
Expand Down
8 changes: 4 additions & 4 deletions pkg/personname/info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,31 +400,31 @@ func TestParse_Err(t *testing.T) {
ErrString: "error parsing PN value: no more than 3 groups with " +
"'[Alphabetic]=[Ideographic]=[Phonetic]' format are allowed: value " +
"contains 4 groups. see 'PN' entry in official dicom spec: " +
"http://dicom.nema.org/medical/dicom/current/output/html/part05.html#sect_6.2",
"https://dicom.nema.org/medical/dicom/current/output/html/part05.html#sect_6.2",
},
{
Raw: "^^^^^",
ErrString: "error parsing PN value: no more than 5 segments with " +
"'[Last]^[First]^[Middle]^[Prefix]^[Suffix]' format are allowed: " +
"value group Alphabetic contains 6 segments. see 'PN' entry in " +
"official dicom spec: " +
"http://dicom.nema.org/medical/dicom/current/output/html/part05.html#sect_6.2",
"https://dicom.nema.org/medical/dicom/current/output/html/part05.html#sect_6.2",
},
{
Raw: "=^^^^^",
ErrString: "error parsing PN value: no more than 5 segments with " +
"'[Last]^[First]^[Middle]^[Prefix]^[Suffix]' format are allowed: " +
"value group Ideographic contains 6 segments. see 'PN' entry in " +
"official dicom spec: " +
"http://dicom.nema.org/medical/dicom/current/output/html/part05.html#sect_6.2",
"https://dicom.nema.org/medical/dicom/current/output/html/part05.html#sect_6.2",
},
{
Raw: "==^^^^^",
ErrString: "error parsing PN value: no more than 5 segments with " +
"'[Last]^[First]^[Middle]^[Prefix]^[Suffix]' format are allowed: " +
"value group Phonetic contains 6 segments. see 'PN' entry in " +
"official dicom spec: " +
"http://dicom.nema.org/medical/dicom/current/output/html/part05.html#sect_6.2",
"https://dicom.nema.org/medical/dicom/current/output/html/part05.html#sect_6.2",
},
}

Expand Down
6 changes: 3 additions & 3 deletions pkg/tag/generate_tag_definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ def list_tags() -> List[Tag]:
if vr == "XS":
# Its generally safe to treat XS as unsigned. See
# https://github.com/dgobbi/vtk-dicom/issues/38 for
# some discussions.
# some discussions.
vr = "US"
elif vr == "OX":
# TODO(saito) I'm less sure about the OX rule. Where is
# this crap defined in the standard??
# TODO(saito) I'm less sure about the OX rule. Where is
# this crap defined in the standard??
vr = "OW"

tag = Tag(group=m.group(1),
Expand Down
2 changes: 1 addition & 1 deletion pkg/vrraw/vrraw.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Package vrraw offers aliases to all VR abbreviations as defined here:
//
// http://dicom.nema.org/medical/dicom/current/output/html/part05.html#table_6.2-1
// https://dicom.nema.org/medical/dicom/current/output/html/part05.html#table_6.2-1
//
// Deprecated VRs from older editions are also included
package vrraw
Expand Down
4 changes: 2 additions & 2 deletions read.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func readVL(r dicomio.Reader, isImplicit bool, t tag.Tag, vr string) (uint32, er
}

// Explicit Transfer Syntax
// More details here: http://dicom.nema.org/medical/dicom/current/output/html/part05.html#sect_7.1.2
// More details here: https://dicom.nema.org/medical/dicom/current/output/html/part05.html#sect_7.1.2
switch vr {
// TODO: Parsed VR should be an enum. Will require refactors of tag pkg.
case "NA", vrraw.OtherByte, vrraw.OtherDouble, vrraw.OtherFloat,
Expand Down Expand Up @@ -380,7 +380,7 @@ func readNativeFrames(d dicomio.Reader, parsedData *Dataset, fc chan<- *frame.Fr

// readSequence reads a sequence element (VR = SQ) that contains a subset of Items. Each item contains
// a set of Elements.
// See http://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_7.5.2.html#table_7.5-1
// See https://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_7.5.2.html#table_7.5-1
func readSequence(r dicomio.Reader, t tag.Tag, vr string, vl uint32, d *Dataset) (Value, error) {
var sequences sequencesValue

Expand Down
22 changes: 11 additions & 11 deletions testdata/data_details.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

This document contains citations and further details for the test DICOMs used
here. Eventually I would like to store a way more expansive set of test DICOMs
in a cloud bucket that we can pull down for testing (this would allow for more
DICOMs and larger files). This would, however add some complexity to testing
this repository.
in a cloud bucket that we can pull down for testing (this would allow for more
DICOMs and larger files). This would, however add some complexity to testing
this repository.


## Files from The Cancer Imaging Archive
Expand All @@ -13,16 +13,16 @@ The sub-bullets mention potentially interesting characteristics of the test file
Some of the interesting characteristics may apply to more than one file, but may only
be mentioned in one of them for brevity.

* [1.dcm](1.dcm) (from [#77](https://github.com/suyashkumar/dicom/issues/77))
* Modality: PET
* [1.dcm](1.dcm) (from [#77](https://github.com/suyashkumar/dicom/issues/77))
* Modality: PET
* Native Pixel Data
* Doubly Nested Sequences
* Icon pixel data in addition to typical pixel data
* Icon pixel data in addition to typical pixel data
* [2.dcm](2.dcm) (from [#77](https://github.com/suyashkumar/dicom/issues/77))
* Modality: PET
* Other items similar to 1.dcm
* [3.dcm](3.dcm)
* Modality: MRI
* Modality: MRI
* Native pixel data
* [4.dcm](4.dcm)
* Modality: X-Ray
Expand All @@ -35,16 +35,16 @@ be mentioned in one of them for brevity.
### Relevant Citations
#### For files 1.dcm, 2.dcm:
##### Data Citation:
Kinahan, Paul; Muzi, Mark; Bialecki, Brian; Coombs, Laura. (2017). Data from ACRIN-FLT-Breast. The Cancer Imaging Archive. http://doi.org/10.7937/K9/TCIA.2017.ol20zmxg
Kinahan, Paul; Muzi, Mark; Bialecki, Brian; Coombs, Laura. (2017). Data from ACRIN-FLT-Breast. The Cancer Imaging Archive. https://doi.org/10.7937/K9/TCIA.2017.ol20zmxg

##### Publication Citation
Kostakoglu L , Duan F , Idowu MO , Jolles PR , Bear HD , Muzi M , Cormack J , Muzi JP , Pryma DA , Specht JM , Hovanessian-Larsen L , Miliziano J , Mallett S , Shields AF , Mankoff DA ; ACRIN 668 Investigative Team . A Phase II Study of 3'-Deoxy-3'-18F-Fluorothymidine PET in the Assessment of Early Response of Breast Cancer to Neoadjuvant Chemotherapy: Results from ACRIN 6688. J Nucl Med. 2015 Nov;56(11):1681-9. doi: 10.2967/jnumed.115.160663. Epub 2015 Sep 10.
Kostakoglu L , Duan F , Idowu MO , Jolles PR , Bear HD , Muzi M , Cormack J , Muzi JP , Pryma DA , Specht JM , Hovanessian-Larsen L , Miliziano J , Mallett S , Shields AF , Mankoff DA ; ACRIN 668 Investigative Team . A Phase II Study of 3'-Deoxy-3'-18F-Fluorothymidine PET in the Assessment of Early Response of Breast Cancer to Neoadjuvant Chemotherapy: Results from ACRIN 6688. J Nucl Med. 2015 Nov;56(11):1681-9. doi: 10.2967/jnumed.115.160663. Epub 2015 Sep 10.


#### For file 3.dcm

##### Data Citation:
Choyke P, Turkbey B, Pinto P, Merino M, Wood B. (2016). Data From PROSTATE-MRI. The Cancer Imaging Archive. http://doi.org/10.7937/K9/TCIA.2016.6046GUDv
Choyke P, Turkbey B, Pinto P, Merino M, Wood B. (2016). Data From PROSTATE-MRI. The Cancer Imaging Archive. https://doi.org/10.7937/K9/TCIA.2016.6046GUDv


#### TCIA Citation
Expand All @@ -59,5 +59,5 @@ Desai, S., Baghal, A., Wongsurawat, T., Al-Shukri, S., Gates, K., Farmer, P., Ru
Clark K, Vendt B, Smith K, Freymann J, Kirby J, Koppel P, Moore S, Phillips S, Maffitt D, Pringle M, Tarbox L, Prior F. The Cancer Imaging Archive (TCIA): Maintaining and Operating a Public Information Repository, Journal of Digital Imaging, Volume 26, Number 6, December, 2013, pp 1045-1057. DOI: 10.1007/s10278-013-9622-7

#### File 5.dcm
This file was sourced from [cornerstone](https://github.com/cornerstonejs/dicomParser/blob/master/testImages/encapsulated/multi-frame/CT0012.explicit_little_endian.dcm)
This file was sourced from [cornerstone](https://github.com/cornerstonejs/dicomParser/blob/master/testImages/encapsulated/multi-frame/CT0012.explicit_little_endian.dcm)
(which is MIT licensed, see the license reproduced in included_licenses.md)
2 changes: 1 addition & 1 deletion testdata/included_licenses.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Included Licenses

This is where licenses related to some of the test files are included as per the
This is where licenses related to some of the test files are included as per the
clause in some licenses that require them to be reproduced in redistributions of
portions of the software

Expand Down
Loading

0 comments on commit b67132d

Please sign in to comment.