• Stars
    star
    928
  • Rank 49,232 (Top 1.0 %)
  • Language
    Go
  • License
    MIT License
  • Created about 6 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

⚡High Performance DICOM Medical Image Parser in Go.

dicom

High Performance Golang DICOM Medical Image Parser

👀 v1.0 just released!

This is a library and command-line tool to read, write, and generally work with DICOM medical image files in native Go. The goal is to build a full-featured, high-performance, and readable DICOM parser for the Go community.

After a fair bit of work, I've just released v1.0 of this library which is essentially rewritten from the ground up to be more canonical go, better tested, has new features, many bugfixes, and more (though there is always more to come on the roadmap).

Some notable features:

  • Parse multi-frame DICOM imagery (both encapsulated and native pixel data)
  • Channel-based streaming of Frames to a client as they are parsed out of the dicom
  • Cleaner Go Element and Dataset representations (in the absence of Go generics)
  • Better support for icon image sets in addition to primary image sets
  • Write and encode Datasets back to DICOM files
  • Enhanced testing and benchmarking support
  • Modern, canonical Go.

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:

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

// Dataset will nicely print the DICOM dataset data out of the box.
fmt.Println(dataset)

// Dataset is also JSON serializable out of the box.
j, _ := json.Marshal(dataset)
fmt.Println(j)

More details about the package (and additional examples and APIs) can be found in the godoc.

CLI Tool

A CLI tool that uses this package to parse imagery and metadata out of DICOMs is provided in the cmd/dicomutil package. This tool can take in a DICOM, and dump out all the elements to STDOUT, in addition to writing out any imagery to the current working directory either as PNGs or JPEG (note, it does not perform any automatic color rescaling by default).

Installation

You can download the prebuilt binaries from the releases tab, or use the following to download the binary at the command line using my getbin tool:

wget -qO- "https://getbin.io/suyashkumar/dicom" | tar xvz

(This attempts to infer your OS and 301 redirects wget to the latest github release asset for your system. Downloads come from GitHub releases).

Usage

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).

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:

make

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:

go build -o dicomutil ./cmd/dicomutil

History

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

v0

The v0 suyashkumar/dicom started off as a hard fork of go-dicom which was not being maintained actively anymore (with the original author being supportive of my fork--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.

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 branch.

Acknowledgements

More Repositories

1

ssl-proxy

🔒 Simple zero-config SSL reverse proxy with real autogenerated certificates (LetsEncrypt, self-signed, provided)
Go
727
star
2

seven-segment-ocr

Digitizes numbers from videos & images of seven segment displays
Python
69
star
3

getbin

💻 Easily fetch latest GitHub release binaries (for your OS/arch) using just wget or curl
Go
64
star
4

conduit

☁ Securely call firmware functions from the cloud.
Go
37
star
5

smart-lights

Cloud-Controlled house lights using home-grown electronics and 3D printed light switch covers
Swift
20
star
6

jenkins-ssl-docker

Jenkins container with SSL and docker
Shell
8
star
7

go-starter

A Golang starter web service with RESTful API, SSL, and static frontend serving
Go
6
star
8

OpenSpirometer

Bluetooth Spirometer records data on cloud-connected Android app, helps measure lung function and respiratory triggers
Java
5
star
9

heart_rate_databases_starter

Starter codebase for BME590 Databases Assignment
Python
5
star
10

auth

A simple Golang authentication library with batteries included (hashing, permissions, validation, etc)
Go
5
star
11

bme590_melanoma_detection

[In Progress] Starter repository for BME590 Medical Software Design Final Projects
Jupyter Notebook
4
star
12

CloudPulse

A cloud based pulse device and platform--electronics, firmware, server, frontend.
CSS
4
star
13

fgen_interface

Control the Agilent 33522A function generator over USB, some Oscilloscope functions now too!
Python
4
star
14

bike

🚴Capture & Save RPM derived data from my Exercise Bike
C++
3
star
15

bbb_adc

Beaglebone Black High-Speed ADC
C
3
star
16

scad_modules

Useful OpenSCAD Modules
OpenSCAD
3
star
17

ResistorColorCode

A simple Apple Watch Resistor Color Code Resolver
Swift
3
star
18

CloudRelay

A cloud-controlled physical relay with iOS, Apple Watch, and Web control applications
Swift
2
star
19

conduit-firmware-library

Use magical RESTful APIs from a central server to communicate to/from the ESP8266 chip with ease
C++
2
star
20

CloudADC

High-speed (1.8 MHz) BeagleBone Cloud ADC
C
2
star
21

deeplesion-gcp-loader

Get the DeepLesion CT Image data set into a GCP Storage Bucket
Go
2
star
22

filter

Easily filter an arbitrary slice of structs based on certain configurable criteria determined at runtime
Go
2
star
23

docker-vtk-itk

ITK, VTK, and Jupyter container for a Kitware Seminar
Jupyter Notebook
1
star
24

icestorm-docker

Dockerized open-source toolchain for Lattica FPGAs
1
star
25

CO2

Explorations/learnings building a CO2 monitoring device for fun.
Jupyter Notebook
1
star
26

particle-logger

Simple tool to log and record Particle Publishes to either MongoDB (exposed via RESTful API) or CSV
JavaScript
1
star
27

sponge_holder

Parametric 3D Model for a simple sink sponge holder
OpenSCAD
1
star
28

auth-grpc

Authentication gRPC microservice with batteries included (db, hashing, validation, etc)
Go
1
star
29

matrix_to_scad

3D Rendering of Matricies via generated OpenSCAD
Python
1
star
30

conduit-frontend

The frontend for the Conduit service, a central web service used to easily interface with IoT (ESP8266, etc)
JavaScript
1
star
31

bump-explore

A web application to allow bumper pool players to explore their data
HTML
1
star
32

bme590_frontend_starter

Starter repository for BME590 Final Projects (Frontend)
JavaScript
1
star
33

provision

Provisions Ubuntu 14+ servers as I like them for deployment
Shell
1
star