Git Product home page Git Product logo

Comments (9)

sedghi avatar sedghi commented on July 1, 2024 1

I'm almost done with exporting segmentations and will create a PR soon. The import is done at OHIF here, although probably I will move it to adapters soon

from cornerstone3d.

jlopes90 avatar jlopes90 commented on July 1, 2024 1

Here's the code how it works import segmentation.

const { viewport } = libCornerstone.getEnabledElement(element);

await libCornerstone.imageLoader.loadAndCacheImages(imageIds);

const volume = await libCornerstone.volumeLoader.createAndCacheVolume(volumeId, {
    imageIds: imageIds
});

volume.load();

await viewport.setVolumes([{ volumeId }]);

viewport.render();

// "arrayBuffer" is segmentation
const result = libCornerstone.adapters.segmentation.generateToolState(viewport.imageIds, arrayBuffer);

const derivedVolume = await libCornerstone.volumeLoader.createAndCacheDerivedVolume(volume.volumeId, {
    volumeId: segmentationId
});
const derivedVolumeScalarData = derivedVolume.getScalarData();
derivedVolumeScalarData.set(new Uint8Array(result.labelmapBufferArray[0]));

libCornerstoneTools.segmentation.addSegmentation(segmentationId);
await libCornerstoneTools.segmentation.addSegmentationRepresentation(toolGroupId, segmentationId);

from cornerstone3d.

Dengjun21 avatar Dengjun21 commented on July 1, 2024

I'm almost done with exporting segmentations and will create a PR soon. The import is done at OHIF here, although probably I will move it to adapters soon

hi,i want to ask you that exporting segmentations is done? :)

from cornerstone3d.

longuto avatar longuto commented on July 1, 2024

@sedghi How did the contourSets data come from

from cornerstone3d.

sedghi avatar sedghi commented on July 1, 2024

@longuto you can take a look at the example https://www.cornerstonejs.org/live-examples/contourrendering and its code.

from cornerstone3d.

longuto avatar longuto commented on July 1, 2024

@sedghi i know the data structure, I want to know How data is obtained from other software。 because i saw these data in OHIF.
Dingtalk_20230727091702

from cornerstone3d.

jlopes90 avatar jlopes90 commented on July 1, 2024

I was looking at how imports done by "ohif" work. And I couldn't get it to work or something is missing in the code. If anyone knows how it works, can you create a new example?

from cornerstone3d.

jlopes90 avatar jlopes90 commented on July 1, 2024

I have already managed to present the segmentation

from cornerstone3d.

dima9911 avatar dima9911 commented on July 1, 2024

@jlopes90 how can i get segmentations in arrayBuffer format? is it SEG file?

from cornerstone3d.

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.