Last active
March 20, 2023 12:13
-
-
Save gillesdemey/8c1e95c64accbbf030ff73548a8888d2 to your computer and use it in GitHub Desktop.
Dicom writer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module github.com/gillesdemey/dicom-test | |
go 1.20 | |
require ( | |
github.com/suyashkumar/dicom v1.0.6 // indirect | |
golang.org/x/text v0.3.8 // indirect | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/binary" | |
"os" | |
"github.com/suyashkumar/dicom" | |
"github.com/suyashkumar/dicom/pkg/tag" | |
) | |
func main() { | |
file, _ := os.Create("dicom.dcm") | |
defer file.Close() | |
writer := dicom.NewWriter(file) | |
writer.SetTransferSyntax(binary.BigEndian, true) | |
patient, _ := dicom.NewElement(tag.PatientName, []string{"Bob", "Jones"}) | |
writer.WriteElement(patient) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment