npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@abasb75/dicom-pixel-decoder

v0.0.0-test8

Published

a powerfull javascript dicom pixel data decoder

Downloads

508

Readme

@abasb75/dicom-pixel-decoder

a javascript powerfull dicom decoder

Demo

demo link

Supported transfer syntax

#Transfer Syntax UID | #Transfer Syntax name | #support --- | --- | --- 1.2.840.10008.1.2 | Implicit VR Endian: Default Transfer Syntax for DICOM | Yes 1.2.840.10008.1.2.1 | Explicit VR Little Endian | Yes 1.2.840.10008.1.2.1.99 | Deflated Explicit VR Little Endian | Yes 1.2.840.10008.1.2.2 | Explicit VR Big Endian | Yes 1.2.840.10008.1.2.4.50 | JPEG Baseline (Process 1) | Yes 1.2.840.10008.1.2.4.51 | JPEG Baseline (Processes 2 & 4) | Yes 1.2.840.10008.1.2.4.57 | JPEG Lossless, Nonhierarchical (Processes 14) | Yes 1.2.840.10008.1.2.4.70 | JPEG Lossless, Nonhierarchical, First- Order Prediction | Yes 1.2.840.10008.1.2.4.80 | JPEG-LS Lossless Image Compression | Yes 1.2.840.10008.1.2.4.81 | JPEG-LS Lossy (Near- Lossless) Image Compression | Yes 1.2.840.10008.1.2.4.90 | JPEG 2000 Image Compression (Lossless Only) | Yes 1.2.840.10008.1.2.4.91 | JPEG 2000 Image Compression | Yes 1.2.840.10008.1.2.4.201 | High-Throughput JPEG 2000 Image Compression (Lossless Only) | Yes 1.2.840.10008.1.2.4.203 | High-Throughput JPEG 2000 Image Compression | Yes 1.2.840.10008.1.2.5 | RLE Lossless | Yes 1.2.840.10008.1.2.4.52 | JPEG Extended (Processes 3 & 5) | Yes(Retired) 1.2.840.10008.1.2.4.202 | High-Throughput JPEG 2000 with RPCL Options Image Compression (Lossless Only) | Untested 1.2.840.10008.1.2.4.53 | JPEG Spectral Selection, Nonhierarchical (Processes 6 & 8) | Untested(Retired) 1.2.840.10008.1.2.4.54 | JPEG Spectral Selection, Nonhierarchical (Processes 7 & 9) | Untested(Retired) 1.2.840.10008.1.2.4.55 | JPEG Full Progression, Nonhierarchical (Processes 10 & 12) | Untested(Retired) 1.2.840.10008.1.2.4.56 | JPEG Full Progression, Nonhierarchical (Processes 11 & 13) | Untested(Retired) 1.2.840.10008.1.2.4.58 | JPEG Lossless, Nonhierarchical (Processes 15) Retired | Untested(Retired) 1.2.840.10008.1.2.4.59 | JPEG Extended, Hierarchical (Processes 16 & 18) | Untested(Retired) 1.2.840.10008.1.2.4.60 | JPEG Extended, Hierarchical (Processes 17 & 19) | Untested 1.2.840.10008.1.2.4.61 | JPEG Spectral Selection, Hierarchical (Processes 20 & 22) | Untested(Retired) 1.2.840.10008.1.2.4.62 | JPEG Spectral Selection, Hierarchical (Processes 21 & 23) | Untested(Retired) 1.2.840.10008.1.2.4.63 | JPEG Full Progression, Hierarchical (Processes 24 & 26) | Untested(Retired) 1.2.840.10008.1.2.4.64 | JPEG Full Progression, Hierarchical (Processes 25 & 27) | Untested(Retired) 1.2.840.10008.1.2.4.65 | JPEG Lossless, Nonhierarchical (Process 28) | Untested(Retired) 1.2.840.10008.1.2.4.66 | JPEG Lossless, Nonhierarchical (Process 29) | Untested(Retired) 1.2.840.10008.1.2.4.92 | JPEG 2000 Part 2 Multicomponent Image Compression (Lossless Only) | Untested 1.2.840.10008.1.2.4.93 | JPEG 2000 Part 2 Multicomponent Image Compression | Untested 1.2.840.10008.1.2.4.94 | JPIP Referenced | No 1.2.840.10008.1.2.4.95 | JPIP Referenced Deflate | No 1.2.840.10008.1.2.6.1 | RFC 2557 MIME Encapsulation | No 1.2.840.10008.1.2.4.100 | MPEG2 Main Profile Main Level | No 1.2.840.10008.1.2.4.102 | MPEG-4 AVC/H.264 High Profile / Level 4.1 | No 1.2.840.10008.1.2.4.103 | MPEG-4 AVC/H.264 BD-compatible High Profile / Level 4.1 | No

Tested Datasets:

  1. Many Private datasets.

https://github.com/cornerstonejs/cornerstoneWADOImageLoader/tree/master/testImages

https://github.com/pydicom/pydicom-data

https://www.dicomlibrary.com/

Decode PixelData:

import { parse } from "@abasb75/dicom-parser";
import Dataset from "@abasb75/dicom-parser/Dataset";
import decode from "@abasb75/dicom-pixel-decoder";

...

const dataset = await pare(arrayBuffer);
const { pixelModule, scalingModule, voiLUTModule } = dataset;

const decodedImage = await decode(
    pixelData,
    {
        transferSyntaxUID: dataset.transferSyntaxUID,
        littleEndian: dataset.littleEndian,

        modality:scalingModule.modality,

        windowWidth:voiLUTModule.windowWidth,
        windowCenter:voiLUTModule.windowCenter,

        bitsAllocated:pixelModule.bitsAllocated,
        pixelRepresentation: pixelModule.pixelRepresentation,
        samplesPerPixel: pixelModule.samplesPerPixel,
        rows: pixelModule.rows,
        columns: pixelModule.columns,
        rescaleSlope: pixelModule.rescaleSlope,
        rescaleIntercept: pixelModule.rescaleIntercept,
        planarConfiguration: pixelModule.planarConfiguration,
        photometricInterpretation: pixelModule.photometricInterpretation, 
        bitsStored: pixelModule.bitsStored,

        // must be true if pixel data finded in #7fe00009 or #7fe00008 elements.
        isFloat:dataset.getPixelTypes()===Dataset.Float,
    }
);

console.log(decodedImage);

// image yet need to apply some process like apply windowing, apply color palette map data and ...

...