Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PixelData parse error. PixelData VR=OB,TransferSyntax=1.2.840.10008.1.2.1 #270

Closed
Refactoring opened this issue Sep 24, 2016 · 3 comments
Closed
Labels
bug Something isn't working
Milestone

Comments

@Refactoring
Copy link

Refactoring commented Sep 24, 2016

As described in the title, (7FE0,0010)Pixel Data VR=OB and (0002,0010)Transfer Syntax=1.2.840.10008.1.2.1, when pixeldata parse error.

My Capacity is limited, I don't know where to start. :)
Download DCM File:

DWV Parse:
qq 20160924223547
ClearCanvas Parse:
qq 20160924223553

@ivmartel
Copy link
Owner

Hi, I can't find the test data, the TESTDCM zip file just contains a corrupted png file. Could you recreate it?

@Refactoring
Copy link
Author

Modify the file extension name for “.dcm” or download again.

@ivmartel ivmartel added the bug Something isn't working label Sep 27, 2016
@ivmartel ivmartel added this to the 0.17.0 milestone Sep 27, 2016
@Refactoring
Copy link
Author

1


I'm too stupid! I had seen your modified code, I follow the bitsAllocated judgement, but I was the original else if (VR === "OB") logic in the process, I found my code forgot else.

    // OB
    else if( vr === "OB")
    {
        // PixelRepresentation 0->unsigned, 1->signed
        var pixelRep = 0;
        if ( typeof this.dicomElements.x00280103 !== 'undefined' ) {
            pixelRep = this.dicomElements.x00280103.value[0];
        }
        if(tag.name === "x7FE00010"){
            //TODO bitsAllocated logic process
            data = reader.readUint16Array( offset, vl );
        }
        // read accordingly
        /*forgot else*/ if (pixelRep === 0) { 
           data = reader.readUint8Array( offset, vl );
        }
        else {
           data = reader.readUint8Array( offset, vl );
        }
        offset += vl;
    }

ivmartel added a commit that referenced this issue Oct 6, 2016
Using bitsAllocated and pixelRepresentation for data reading just for
pixel data. Added regular reading for non pixel data. Relates to #270.
Send error when no transfer syntax is provided.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants