cornerstone3D
cornerstone3D copied to clipboard
[Feature Request] setScalar?
What feature or change would you like to see made?
Is there a way to update points of a segmentation and segmentation volume ? Actually I apply a scalar to a volume and a volume to a segmentation. But I'd like to have the possibility to update this scalar (like it works with a tool like brush, etc...) but from a reducer. Which way? I tried to apply values on scalar but it doesn't refresh despite the viewport.render() thing. Is there a way or is it possible to implement it? Thanks.
Why should we prioritize this feature?
Because I need to be able to update / refresh segmentations with an easy way...
I also need this feature.I have the following program, but I don't know where it went wrong. It cannot update.
let scalarData = segmentationVolume.scalarData;
let voxelIndex = 0;
const { dimensions } = segmentationVolume;
for (let z = 0; z < dimensions[2]; z++) {
for (let y = 0; y < dimensions[1]; y++) {
for (let x = 0; x < dimensions[0]; x++) {
scalarData[voxelIndex] = 0;
voxelIndex++;
}
}
}
const segmentationRepresentationUID = segmentation.state.getSegmentationRepresentations('MY_TOOLGROUP_ID')[0].segmentationRepresentationUID;
const toolGroupId = VolumeInfomation.TOOL_GROUP_ID;
segmentation.triggerSegmentationEvents.triggerSegmentationRepresentationModified(toolGroupId, segmentationRepresentationUID);
@YaXinHuu I found a way to update by recreating each segmentation and derived volume each time I have to update the scalarData, but it's really weird dirty code and I hate it... I'd love to have a true functional API for that...
Use the new VoxelManager
@sedghi you have a tutorial, an example? I tried but it doesn't work / no update and crash... Thx
How can I write a scalar in my current volume?
are you guys calling .modified() after you update the scalar of thet volume? volume.modified