Giter VIP home page Giter VIP logo

image-jpeg2000's People

Contributors

chafey avatar jpambrun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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

image-jpeg2000's Issues

Lossy unsigned int test fails

Test jp2_U16bit_test fails with

jp2_U16bit_test.js
✔ file_860AE501
✖ file_lossyhdr

Assertion Message: 1994381 / 1998132 degraded pixels, MSE=46125280.03677685 Max err= 65535

2015-07-06-125156_1611x1233_scrot

When compared with Matlab's JPEG 2000 decoder, almost every pixels appears incorrectly reconstructed. This is illustrated in the attached figure where black represents perfect reconstruction and white represents a difference of 1000. Pixel close to 0 and 65,535 can roll over resulting in very obvious distortions.

2015-07-06-104922_1601x1225_scrot

covert kodak PNG images into JP2 with sampling factor

I am trying to convert png images into JP2 with sampling factor. I am imagemagick tool for conversion, as they mentioned in docs -sampling-factor is used for sampling but it did not work.

http://ftp.icm.edu.pl/pub/unix/graphics/ImageMagick/www/jp2.html

convert wizard.png -colorspace YUV -sampling-factor 2,2 wizard.jp2

My command, it did not work
convert test/images/kodim$i.png -quality $(($j*5)) -colorspace YUV -sampling-factor 4,2 test/JP2/kodim$i/printf "%02d" $j.jp2

Returned typed array

Hi, I would like some clarification about the documentation:
In the readme, it states that jpxData is uint8 and returns pixelData as int16.

Is it always the case? or somehow it could sometimers return uint8, int8, uint16 and int16?

Thanks!

jpxImage.parse(jpxData);
var width = jpxImage.width;
var height = jpxImage.height;
var pixelData = tileComponents.items;

Chrome locking using jpx on linux

Hi!

I'm having some problems using the lib on linux os. When I open a page and try to convert the image my chrome almost close and it happens only on linux os.

After that my computer gets so slow that I have do restart it.

Anyone have had the same problem? I tested on others computers and all linux had the problem.

I'm using Ubuntu 14.04 and the other computer is a Arch Linux OS.

Sorry if this is the wrong place to post it.

Error decoding 16 bits images

I had issues decoding a 16 bits DICOM image encoded using JPEG2000. After some debugging, I saw that the values from the storedPixelData array had negative values. Investigating further, I saw that JPEG2000 was storing the pixels in an Int16Array instead of a Uint16Array (which is used for raw images).

The following patch seems to work for me:

diff --git a/dist/jpx.js b/dist/jpx.js
index 14da7c9..e0095b7
--- a/dist/jpx.js
+++ b/dist/jpx.js
@@ -1383,7 +1383,7 @@ var JpxImage = (function JpxImageClosure() {
         transformedTiles[c] = transformTile(context, tile, c);
       }
       var tile0 = transformedTiles[0];
-      var out = new Int16Array(tile0.items.length * componentsCount);
+      var out = new Uint16Array(tile0.items.length * componentsCount);
       var result = {
         left: tile0.left,
         top: tile0.top,
diff --git a/dist/jpx.min.js b/dist/jpx.min.js

Error while parsing COC information

"Cannot read property 'decompositionLevelsCount" error is thrown when trying to parse DICOM JPEG2000 images with COC information. On some type of exams (e.g., US) we reproduce this error when loading with cornerstoneWADOImageLoader. The parsing error is thrown at:

function decodeJPEG2000(dataSet, frame)
{
var height = dataSet.uint16('x00280010');
var width = dataSet.uint16('x00280011');
var compressedPixelData = dicomParser.readEncapsulatedPixelData(dataSet, dataSet.elements.x7fe00010, frame);
var jpxImage = new JpxImage();
jpxImage.parse(compressedPixelData); <<<-------- ERROR!
...

The cause is the inability of the JPEG 2000 library to parse the COC information:

case 0xFF53: // Coding style component (COC)
throw new Error('JPX Error: Codestream code 0xFF53 (COC) is ' +
'not implemented');

Test failing

Some images don't produce the same result when decompressed with Matlab.

5-8% of pixels in cameraman and peppers are not reconstructed identically in lossy mode.

1.4% of pixels in 00000.dcm are not reconstructed perfectly in lossless mode (!!). All in the last few rows.

Subsampling 1 and 2 fails completely with the code from pdf.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.