Code Monkey home page Code Monkey logo

Comments (5)

chafey avatar chafey commented on May 24, 2024

Hi Nicolas,
I am aware of these files and have been reluctant to add support for them as they are non standard and would result in an inconsistent interface (sometimes the P10 header is present, sometimes it is not). My general stance on non standard files is that the logic to deal with them should be handled at the application layer and not the library itself. The library can expose functions to make it easier for the application to deal with but should not contain any logic for non standard files itself. The dicomParser library does allow a higher level application to parse these byte streams today - it just takes a few lines of code to do so.

from dicomparser.

NicolasRannou avatar NicolasRannou commented on May 24, 2024

Thanks that makes sense.

Would exposing the readDataSet and mergeDataSets method would be fine with you?
https://github.com/chafey/dicomParser/blob/master/src/parseDicom.js#L140-144

This way I could add the defaultTransferSyntax in the metaHeaderDataSet before reading/merging the data.

Or would you rather expose something else in order to deal with it?

from dicomparser.

chafey avatar chafey commented on May 24, 2024

No that doesn't feel right - both of those are internal functions and don't look like good public APIs. Here is the code needed to parse little endian byte streams:

            var dataSetByteStream = new dicomParser.ByteStream(dicomParser.littleEndianByteArrayParser, byteArray);
            var dataSet = new dicomParser.DataSet(dataSetByteStream.byteArrayParser, dataSetByteStream.byteArray, {});
            dicomParser.parseDicomDataSetImplicit(dataSet, dataSetByteStream, dataSetByteStream.byteArray.length);

I thought about putting this in a utility function but that doesn't feel right either. Perhaps I just need an example to show how to do this? Open to more ideas

from dicomparser.

NicolasRannou avatar NicolasRannou commented on May 24, 2024

YesI agree, it is probably best to have an example or even just an entry in the wiki to let people know how they can manually parse a dataset.

from dicomparser.

chafey avatar chafey commented on May 24, 2024

I haven't forgotten about this (well sort of, but github doesn't). If someone wants to submit a PR with an example that does this it would be great as people keep running into this issue. It isn't something I need so I haven't been motivated to do it myself yet

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.