Code Monkey home page Code Monkey logo

Comments (5)

vjau avatar vjau commented on July 20, 2024 1

It's indeed working replacing data with data.buffer
I will look into your issue.

from dcmjs.

pieper avatar pieper commented on July 20, 2024

The code should work fine in node or browser. Try with one of the test datasets and if you still have issues post the full stack trace.

from dcmjs.

vjau avatar vjau commented on July 20, 2024

The dicom file used is the one provided in your examples/data folder.

Stacktrace is here

/home/vincent/dev/temp/dcmjs-try/node_modules/dcmjs/build/dcmjs.js:829
            this.view = new DataView(this.buffer);
                        ^

TypeError: First argument to DataView constructor must be an ArrayBuffer
    at new DataView (<anonymous>)
    at new BufferStream (/home/vincent/dev/temp/dcmjs-try/node_modules/dcmjs/build/dcmjs.js:829:18)
    at ReadBufferStream._createSuperInternal (/home/vincent/dev/temp/dcmjs-try/node_modules/dcmjs/build/dcmjs.js:632:25)
    at new ReadBufferStream (/home/vincent/dev/temp/dcmjs-try/node_modules/dcmjs/build/dcmjs.js:1183:21)
    at Function.readFile (/home/vincent/dev/temp/dcmjs-try/node_modules/dcmjs/build/dcmjs.js:3579:21)
    at /home/vincent/dev/temp/dcmjs-try/main.js:4:43
    at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:71:3)

I have made a repro here : https://github.com/vjau/dcmjs-try

Node v14.20.0
Ubuntu 20.04

from dcmjs.

pieper avatar pieper commented on July 20, 2024

Thanks for making the sample. Did you try changing this line to data.buffer?

https://github.com/vjau/dcmjs-try/blob/1283caae8a16a37bfe5a4cc513297eaa0c3f7e33/main.js#L4

from dcmjs.

pieper avatar pieper commented on July 20, 2024

I tested with data.buffer and it appears to work. Can you confirm. I did run into [this issue](https://github.com/dcmjs-org/dcmjs/issues/319}. If you are working on nodejs could you provide a PR to fix that?

from dcmjs.

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.