项目 / suyashkumar/dicom

suyashkumar/dicom

行业推荐
语言 Go标签 dicomdicom-imagesgolanggolang-librarygolang-packageparsermedicalmedical-imagingpacsstreamingreal-timeimagingdicom-filesmedical-image-analysisdcmgo数据更新 2026-11-20 06:49:16 · 仓库 2026-11-19

一段话介绍

这是一套用 Go 编写的 DICOM 医学影像解析库,并附带命令行工具,用来读取、写入和处理 DICOM 文件。在 Go 模块项目中导入 `github.com/suyashkumar/dicom` 后,可用 `dicom.ParseFile` 或面向 `io.Reader` 的 `dicom.Parse` 解析文件;得到的 Dataset 可直接打印,也可序列化为 JSON。更多 API 见 [godoc](https://godoc.org/github.com/suyashkumar/dicom)。本页按文件解析与互操作用途介绍,不涉及诊疗。说明见[仓库 README](https://github.com/suyashkumar/dicom)。

本站整理,非 GitHub 官方 description。

官方 description(GitHub API 原样)
⚡High Performance DICOM Medical Image Parser in Go.
1,098累计星
171Fork
—峰值日增
0上榜次数
总榜
暂未入榜
日榜
暂未入榜
周榜
暂未入榜
月榜
暂未入榜

官方快照(gh_history.db,2026-11-25):总榜 未进 Top50 · 日榜 未进 Top50 · 周榜未满 7 天基线(官方不生成) · 月榜暂无官方口径;下方四卡为站内趋势聚合(周卡按上榜次数,非官方 7 日增量窗)。

行业与场景

按行业选型 →

医学影像分析与辅助诊断

适配系统:医学影像系统 · 得分 3.0

高性能 DICOM 解析库(Go),影像数据接入底层组件。

更多信息

以下三段按该项目自己的 GitHub README 章节摘录(可合理截断并标明);README 没有对应章节的留空,不编造。

我的用法
安装或使用说明见 https://godoc.org/github.com/suyashkumar/dicom。
特点或设计要点
v1.0 起核心库已重写。已实现的能力包括:解析多帧影像(封装与原生像素数据)、在解析过程中通过 channel 向调用方流式发送 `Frame`、写入并重新编码 Dataset、对图标影像集与主影像集的支持,以及测试与基准测试。命令行工具位于 `cmd/dicomutil`:可从 [Releases](https://github.com/suyashkumar/dicom/releases) 下载预编译二进制,或用 `go build -o dicomutil ./cmd/dicomutil` 自行构建;运行 `dicomutil -path myfile.dcm` 会把元素打印到标准输出,并把影像写成当前目录下的 PNG 或 JPEG。文档提醒:部分含原生像素数据的文件目前不会自动做强度缩放。许可为 MIT。
星标走势还差一天的数据,明天就能看到曲线
每天 10:30 记一次星标,连续两天后自动生成曲线
首次发现 — · 最近在榜 2026-06-21 · 语言 Go · 贡献者 —
image

GitHub 项目主页介绍

来自 GitHub 仓库 README / 主页介绍正文,原样摘录,共 6,171 字节。

<p align="center">
  <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> 
    <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> 
  </p>
</p>

:eyes: __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:
- [x] Parse multi-frame DICOM imagery (both encapsulated and native pixel data)
- [x] Channel-based streaming of `Frame`s to a client _as they are parsed_ out of the dicom
- [x] Cleaner Go Element and Dataset representations (in the absence of Go generics)
- [x] Better support for icon image sets in addition to primary image sets
- [x] Write and encode Datasets back to DICOM files
- [x] Enhanced testing and benchmarking support
- [x] 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:
```go 

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](https://godoc.org/github.com/suyashkumar/dicom).

## 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](https://github.com/suyashkumar/dicom/releases), or use the following to download the binary at the command line using my [getbin tool](https://github.com/suyashkumar/getbin):

```sh
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:
```sh
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:

```sh
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](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. 

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


## 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. 
* 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](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>
↑