Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
github.com/suyashkumar/dicom
High Performance Golang DICOM Medical Image Parser
: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:
Frame
s to a client as they are parsed out of the dicomTo 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.
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).
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).
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).
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
Here's a little more history on this repository for those who are interested!
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.
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.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.