Git Product home page Git Product logo

codecs's Introduction

codecs

Packages

This repository is maintained as a monorepo. This means that this repository, instead of containing a single project, contains many projects. If you explore our project structure, you'll see the following:

.
├── packages                #
│   ├── charls-js           # 
│   ├── libjpeg-turbojs     # 
│   └── openjpegjs          #
│
├── ...                     # misc. shared configuration
├── lerna.json              # MonoRepo (Lerna) settings
├── package.json            # Shared devDependencies and commands
└── README.md               # This file

Transfer Syntaxes

ℹ List of DICOM Transfer syntaxes: https://www.dicomlibrary.com/dicom/transfer-syntax/. More on each transfer syntax, how they differ, and in which situations they excel can be found here: https://www.medicalconnections.co.uk/kb/Transfer-Syntax

Transfer Syntax is the language used in DICOM to describe the DICOM file format and the network transfer methods. 3 main variables are contained in the Transfer Syntax:

  • VR: Implicit/Explicit
  • Endianism: Little-Endian/BigEndian
  • Pixel Data Compression
Transfer Syntax UID Transfer Syntax Name Codec
Uncompressed
1.2.840.10008.1.2 Implicit VR Little Endian: Default DICOM Transfer Syntax Little Endian
1.2.840.10008.1.2.1 Explicit VR Little Endian Little Endian
1.2.840.10008.1.2.2 Explicit VR Big Endian Big Endian
Lossless Compressed
1.2.840.10008.1.2.4.57 JPEG Lossless, Nonhierarchical (Processes 14) ?
1.2.840.10008.1.2.4.70 JPEG Lossless, Nonhierarchical (Processes 14 [Selection 1]) ?
1.2.840.10008.1.2.4.80 JPEG-LS Lossless Image Compression CharLS
1.2.840.10008.1.2.4.90 JPEG 2000 Image Compression (Lossless Only) OpenJPEG
1.2.840.10008.1.2.5 RLE Lossless RLE
Lossy Compressed
1.2.840.10008.1.2.4.50 JPEG Baseline lossy process 1 (8 bit)* libJPEG-turbo
1.2.840.10008.1.2.4.51 JPEG Baseline lossy process 2 & 4 (12 bit) libJPEG-turbo
1.2.840.10008.1.2.4.81 JPEG-LS Lossy (Near-Lossless) Image Compression CharLS
1.2.840.10008.1.2.4.91 JPEG 2000 Image Compression OpenJPEG
1.2.840.10008.1.2.4.92 JPEG 2000 Part 2 Multicomponent Image Compression (Lossless Only)** OpenJPEG?
1.2.840.10008.1.2.4.93 JPEG 2000 Part 2 Multicomponent Image Compression** OpenJPEG?
MPEG
1.2.840.10008.1.2.4.100 MPEG-2 Not supported
1.2.840.10008.1.2.4.101 MPEG-2 Not supported
1.2.840.10008.1.2.4.102 MPEG-4 Not supported
1.2.840.10008.1.2.4.103 MPEG-4 Not supported
Special
1.2.840.10008.1.2.4.94 JPIP Not supported
1.2.840.10008.1.2.4.95 JPIP-Deflate Not supported
1.2.840.10008.1.2.1.99 Deflated Explicit VR Little Endian *** Little Endian
  • * - 1.2.840.10008.1.2.4.50: 8-bit RGB can leverage the browser's built in decoder.

  • ** - 1.2.840.10008.1.2.4.[92|93]: Not supported in previous image loaders; OpenJPEG may work with these

  • *** - Unlike all other DICOM transfer syntaxes, the deflate transfer syntaxes compress the whole of the DICOM data (tags, lengths, VR etc.) rather than just the pixel data - this is done using the standard “deflate” mechanism as used in gzip etc.) It is therefore most suitable for non-pixel objects such as structured reports, presentation states etc.

  • 5: JS Decoder

  • 57 & 70: JS Decoder

  • 1.2 & 2.1 & 99: JS Decoder

  • 2.2: JS Decoder

CI

We are leveraging lerna to version and publish packages. Lerna adds tooling on top of yarn workspaces to enable monorepo functionality. Our lerna configuration/usage is confined to:

  • package.json
  • lerna.json
  • .circleci/config.yml

Pull requests attempt to build and test packages that have been modified (when compared against the main branch). "Semantic commit" messages, and the files included in the commit, help lerna determine how package versions should be updated and what to include in changelogs. Example commit messages include:

  • fix(charls-decode): should not break when no config option is provided
  • feat(encode): add encode API method
  • feat(encode): friendlier API method BREAKING_CHANGE

You can read more about the specific lerna features we're using here:

  • lerna run <cmd>: Used in package.json
  • lerna version: Used in .circleci/config.yml
  • lerna publish: Used in .circleci/config.yml
  • "Lerna filter options": Used in package.json (--since main)

You can read more about semantic commit messages here:

  • Semantic commits

Codec Package Anatomy

...

codecs's People

Contributors

dannyrb avatar dougyau avatar emelalkim avatar jmhmd avatar ladeirarodolfo avatar punzo avatar sedghi avatar swederik avatar wayfarer3130 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

codecs's Issues

jpeg2000 bug for blurry pixels

Apparently switching j2k decoder to wasm has introduced a pixelated/blury bug for some images.

Reported here:

Data by community can be found here

Based on my investigation the bug has happened on this commit for CSWIL (the commit for changing to wasm codecs)

e38c066 (tag: v4.0.0) feat(codecs, loadImage): Switch to WASM Codecs, use image load into distinct queues for retrievals and decoding (#39

Steps Taken

Using the dev containers for our codec repo, first I tried to use Chris Hafey's openjpeg codec (since it is more up to date than ours here).

Updating the git submodule was very tricky, it didn't like changing the external git repo, I had to force remove the remote and add the new one.

After the build, and copy pasting the new wasm codecs (generated by build) and putting it inside the CSWIL node_modules for the openjpeg folder, and rebuilding the CSWIL and running example, it didn't work

However, seems like Chris's demo which uses raw dicom pixel data works with the shared data by community.
To extract the pixel data drag and drop data here and check the Frames and download the binary and drag and drop into Chris's demo here

So my assumption is his build of the openjpeg is different than ours and for him it works and not for us.

CC @swederik @heyflynn @kunjesh1 @lambacini

install error

image

I have installed version 0.1.9 of @cornerstonejs/dicom-codec in my project. After the installation, errors were reported indicating that corresponding files could not be found at:

@cornerstonejs/codec-charls/wasmjs in ./node_modules/@cornerstonejs/dicom-codec/src/codecs/jpegls.js
@cornerstonejs/codec-libjpeg-turbo-8bit/wasmjs in ./node_modules/@cornerstonejs/dicom-codec/src/codecs/libjpegTurbo8bit.js
@cornerstonejs/codec-openjpeg/wasmjs in ./node_modules/@cornerstonejs/dicom-codec/src/codecs/jpeg2000.js

I suspect that the package versions on which your npm package depends may not correspond correctly.

Add dispatch logic

A very common use case is to decompress a given image frame given the compressed bitstream and the transfer syntax. These could be obtained in a variety of ways such as by parsing the DICOM P10 file (e.g. with dicomParser), via DICOMweb, etc. Currently this dispatch logic is in cornerstoneWADOImageLoader making it difficult to use independently of cornerstone. Ideally that dispatch logic would be added to this library so it could be more easily reused. The logic is here:

https://github.com/cornerstonejs/cornerstoneWADOImageLoader/blob/master/src/shared/decodeImageFrame.js

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.