godicom
The dataset library — Part 10 files, transfer syntaxes, the data dictionary, Pixel Data, DICOM JSON, and a CLI. Everything else in the organisation builds on it.
Datasets, diagnostics, Pixel Data
Read, modify and write DICOM datasets, decode and encode Pixel Data, talk DIMSE and DICOMweb — from idiomatic Go, with no CGO for callers.
package main
import (
"log"
"github.com/godicom-dev/godicom"
"github.com/godicom-dev/godicom/tag"
)
func main() {
ds, err := godicom.ReadFile("ct.dcm", nil)
if err != nil {
log.Fatal(err)
}
if err := ds.SetString(tag.PatientID, "12345678"); err != nil {
log.Fatal(err)
}
if err := ds.SaveAs("ct_updated.dcm", nil); err != nil {
log.Fatal(err)
}
}go get github.com/godicom-dev/godicom@latestAbout this site
These pages are written against the released versions of each module and link to pkg.go.dev for the full API reference, which is generated from the source and therefore never out of date. Where the two disagree, pkg.go.dev is right.