Giter VIP home page Giter VIP logo

Comments (10)

DominionSoftware avatar DominionSoftware commented on August 26, 2024

Not sure how to get other data into correct json format or other way to load data. Also need some RBG data to test with

from vtkplugin.

swederik avatar swederik commented on August 26, 2024

OHIF/Viewers#177

Gist is here:

https://gist.github.com/swederik/b7901bd933e6497720783e532616eec0

from vtkplugin.

swederik avatar swederik commented on August 26, 2024

Check image pixelRepresentation (signed) and bitsAllocated to determine data type. Use correct typed array. An example is here: https://github.com/cornerstonejs/cornerstoneWADOImageLoader/blob/b468ad706276daa4c3cf6aefb3beca924a588b61/src/shared/decoders/decodeLittleEndian.js#L6

from vtkplugin.

pieper avatar pieper commented on August 26, 2024

The point here is to use the BitsAllocated and the PixelRepresentation to determine the correct array datatype to create. Also to generate appropriate diagnostics if there isn't a valid mapping.

from vtkplugin.

DominionSoftware avatar DominionSoftware commented on August 26, 2024

We now support signed and unsigned 16 bit data. console.asserts() have been put in for 8 bit data (signed and unsigned) as the vtk renderer crashes when using 8 bit data. RGB data makes no sense for these plugins so we also console.assert() on components > 1.

from vtkplugin.

pieper avatar pieper commented on August 26, 2024

console.assert doesn't really do anything except print. Better to throw an error that can be caught and acted on by the application.

from vtkplugin.

DominionSoftware avatar DominionSoftware commented on August 26, 2024

Agreed. I’ll add them. One advantage to the Singleton approach might be that if we associate a valid data configuration with the class rather than the instance we can show one error message for the class. So in the case of the MPR views we would get 2 errors thrown rather than 4....

Or perhaps the application can combine the errors in a list view dialog....

from vtkplugin.

DominionSoftware avatar DominionSoftware commented on August 26, 2024

I put in throw new Error("messages") but they get swallowed here in tracker.js:
_compute() {
this.invalidated = false;

var previous = Tracker.currentComputation;
setCurrentComputation(this);
var previousInCompute = inCompute;
inCompute = true;
try {
  withNoYieldsAllowed(this._func)(this);
} finally {
  setCurrentComputation(previous);
  inCompute = previousInCompute;
}

}

The try just does a finally, no errors are reported to the user.
I put in console.log() messages as well so that something will show up.

from vtkplugin.

swederik avatar swederik commented on August 26, 2024

Oh that's interesting... I'll see if we can fix that

from vtkplugin.

DominionSoftware avatar DominionSoftware commented on August 26, 2024

Is there more to do on this task?

from vtkplugin.

Related Issues (17)

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.