Comments (9)
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.
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.
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.
@sedghi How did the contourSets data come from
from cornerstone3d.
@longuto you can take a look at the example https://www.cornerstonejs.org/live-examples/contourrendering and its code.
from cornerstone3d.
@sedghi i know the data structure, I want to know How data is obtained from other software。 because i saw these data in OHIF.
from cornerstone3d.
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.
I have already managed to present the segmentation
from cornerstone3d.
@jlopes90 how can i get segmentations in arrayBuffer format? is it SEG file?
from cornerstone3d.
Related Issues (20)
- [Bug] dicomParser.readFixedString: attempt to read past end of buffer and CORNERSTONE_IMAGE_VOLUME_LOADING_COMPLETED RangeError: Invalid typed array length: 65536
- [Bug] Cornerstone3D tools does not build with vite HOT 8
- [Feature Request] Drag Annotations from center rather than borders only
- [Bug] PlanarFreehandROITool error when calculate stats is true
- cant get segmentation state for BrushTool HOT 1
- [Bug] Freehand cnotour segmentation tool
- [Bug] livewire editing control points
- [Bug] Dynamic threshold brush tool inner circle size
- [Bug] segmentation bidirectional tool HOT 1
- [Bug] window level tool for video HOT 1
- [Bug] Basic video tool demo
- [Bug] WSI demo HOT 2
- [Bug] Video viewport spline interpolations
- [Bug] labelmap shadow in video viewport
- [Bug] Enhanced livewire
- [Bug] interpolate on contour holes as well
- [Bug] Should not add childrens to the annoationUIDMap and also remove the shift click to be explicit for holes in the api
- [Bug] Freehand tool moving back to the previous drawn pixel removes the whole thing
- [Bug] Images wrongly loaded when size in x and y are different HOT 2
- [Feature Request] How to obtain scalar data in the coronal or sagittal plane? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cornerstone3d.