Describe Your Question
I need to use a contour filter to draw a CT 3D model, to make this work I need to use vtkActor instead of the provided vtkVolume (given by the callback). I tried to use viewport.setActors([{ uid: "CT_ACTOR", actor }]);
in the callback, before and after theviewport.setVolumes
but the resulting render is exactly the same as not modifying the actor in any way.
Is there any way to make cornerstone use my vtkActor? Or to properly debug the process such that I can see if there’s any place where setting my actor actually has any effect.
What steps can we follow to reproduce the bug?
viewport.setVolumes([
{
volumeId: ctVolume.id,
callback: ({ volumeActor }) => {
const cfun = vtkColorTransferFunction.newInstance();
cfun.addRGBPoint(0, 0.0, 0.0, 0.0);
cfun.addRGBPoint(200.0, 0.0, 0.0, 0.0);
cfun.addRGBPoint(500.0, 1.0, 1.0, 1.0);
cfun.addRGBPoint(1000.0, 1.0, 1.0, 1.0);
const mCubes = vtkImageMarchingSquares.newInstance({ contourValue: 500.0 });
mCubes.setInputData(ctVolume.volume.imageData);
const mapper = vtkMapper.newInstance();
mapper.setInputConnection(mCubes.getOutputPort());
mapper.setLookupTable(cfun);
mapper.setScalarVisibility(true);
const actor = vtkActor.newInstance();
actor.getProperty().setOpacity(0.15);
actor.setMapper(mapper);
viewport.setActors([{ uid: "CT_ACTOR", actor }]);
viewport.render();
}
}
]);