This is easy enough to do by adding an onModified hook to the volume's volumeProperty RGB Transfer Function that calls renderWindow.render() in any other viewports that the volume is displayed in. I had this implemented but I didn't have a good way to remove the onModified handler when the viewports were destroyed.
|
/*const rgbTransferFunction = apiByViewport[0].volumes[0] |
|
.getProperty() |
|
.getRGBTransferFunction(0); |
|
rgbTransferFunction.onModified(() => { |
|
apiByViewport.forEach(a => { |
|
const renderWindow = a.genericRenderWindow.getRenderWindow(); |
|
|
|
renderWindow.render(); |
|
}); |
|
});*/ |
|
|
This means that whenever I switched back to 2d, then back to 3d, I would end up with duplicate handlers. For now I disabled the feature, and so windowing happens in one viewport (and updates on the next render in the others, which is pretty awkward).
This is easy enough to do by adding an onModified hook to the volume's volumeProperty RGB Transfer Function that calls
renderWindow.render()in any other viewports that the volume is displayed in. I had this implemented but I didn't have a good way to remove the onModified handler when the viewports were destroyed.Viewers/extensions/ohif-vtk-extension/src/commands.js
Lines 179 to 189 in 24a8d7b
This means that whenever I switched back to 2d, then back to 3d, I would end up with duplicate handlers. For now I disabled the feature, and so windowing happens in one viewport (and updates on the next render in the others, which is pretty awkward).