Code Monkey home page Code Monkey logo

Comments (7)

yagni avatar yagni commented on May 23, 2024

I don't think that's the fix we want. I'm actually not sure how dicomParser is even getting into findItemDelimitationItemAndSetElementLength. It shouldn't be using that on the SQ element, only on individual items. Do you know?

It's hard to tell from just the dump, but it looks like that item has an explicitly-defined length of 8 bytes, which wouldn't even cover the (0507,0000) element. If that's the case, per the standard there wouldn't even be an item delimitation item and dicomParser should be throwing an exception when it looks for a second item and doesn't find the item tag (see readSequenceItem). That would mean the file isn't standard-compliant.

from dicomparser.

chafey avatar chafey commented on May 23, 2024

This sounds like an invalid DICOM file, especially if anonymization tools remove the tag. Your fix may solve your problem, but it would make the library non standards compliant so is not an acceptable change for the library. My general philosophy is to keep the library standards compliant but provide hooks when possible for higher levels to implement workarounds for non standard data. Unfortunately I can't really suggest any hooks for a workaround without looking at the file itself

from dicomparser.

evren217 avatar evren217 commented on May 23, 2024

This is the (0507,1001) element it reads:
{
"tag": "x05071001",
"vr": "UN",
"length": 4294967295,
"dataOffset": 2384
}

Its VR is not SQ and it has undefined length, so that is why it is getting in findItemDelimitationItemAndSetElementLength.

from dicomparser.

chafey avatar chafey commented on May 23, 2024

Rereading the DICOM standard on undefined length handling and it looks like we have the logic wrong for non SQ elements. Use of undefined length appears to be restricted to specific VR's and is also parsed in the same way as a SQ element. I need to find some data sets that have this condition so I can verify a fix, if anyone has an anonymized one please send it my way :)

from dicomparser.

chafey avatar chafey commented on May 23, 2024

Just pushed version 1.7.3 which should fix this - can you please test and confirm? Your workaround fix is not correct

from dicomparser.

chafey avatar chafey commented on May 23, 2024

actually test 1.7.4, a bug slipped into 1.7.3 on accident :(

from dicomparser.

evren217 avatar evren217 commented on May 23, 2024

1.7.4 works fine for that case

from dicomparser.

Related Issues (20)

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.