Skip to content

Commit d16a55f

Browse files
committed
2 parents b592e77 + bda568f commit d16a55f

1 file changed

Lines changed: 22 additions & 9 deletions

File tree

README.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
1-
# JPEGLosslessDecoderJS
2-
A JPEG Lossless decoder (JavaScript).
1+
JPEGLosslessDecoderJS
2+
=====
3+
A common DICOM compression format is JPEG Lossless. This format is generally not supported in standard JPEG decoder libraries.
4+
5+
This decoder can read the following DICOM transfer syntaxes:
6+
7+
- 1.2.840.10008.1.2.4.57 JPEG Lossless, Nonhierarchical (Processes 14)
8+
- 1.2.840.10008.1.2.4.70 JPEG Lossless, Nonhierarchical (Processes 14 [Selection 1])
9+
10+
###Usage
11+
See tests/driver.js to run this example:
312

413
```javascript
5-
var buf = fs.readFileSync('./data/data.lossless');
6-
var data = toArrayBuffer(buf);
7-
var decoder = new jpeg.lossless.Decoder(data, 2);
8-
var output = decoder.decode();
9-
console.log("compressed size = " + data.byteLength);
10-
console.log("frame: dimX="+decoder.frame.dimX + " dimY=" + decoder.frame.dimY + " components=" + decoder.frame.numComp);
11-
console.log("decompressed size = " + output.byteLength);
14+
var decoder = new jpeg.lossless.Decoder(compressedBytes); // optional second parameter to specify 1 or 2 byte output
15+
var decompressedData = decoder.decode();
1216
```
17+
18+
###Building
19+
```shell
20+
./build.sh # normal build
21+
./build-min.sh # minimized build
22+
```
23+
24+
###Acknowledgments
25+
This library was originally written by Helmut Dersch for Java, later released by JNode. I added support for selection values 2 to 7 and ported to JavaScript.

0 commit comments

Comments
 (0)