I’m back. ![]()
I learned from @Sebastien_Jourdain that I probably don’t need multiple proxyManagers to handle multiple scans.
I’m now wondering if there are any resources (tutorials, code examples) of setting up a proxyManager that takes data in from multiple inputs (e.g. scan files) and then renders them as views?
For example, I can create a proxyManager:
let myProxyManager = state.proxyManager.createProxy('Sources', 'TrivialProducer',);
I can set the input of myProxyManager to a scan:
myProxyManager.setInputData(scanData);
But what about when I want to load a second scan with the proxyManager without unloading the first?
If I do:
myProxyManager.setInputData(scanData2);
I’ll overwrite the first scan rather than adding a second source?
Update
Looking at setInputData in macros.js I see that it takes two parameters, the first being the dataset (e.g. scan) and the second being a port.
It appears that the port is how I would set multiple inputs, but then there is an error message in the code noting “To add more input ports, use addInputData()”…
Update 2
addInputData is also in macros.js:
function addInputData(dataset) {
if (model.deleted) {
vtkErrorMacro('instance deleted - cannot call any method');
return;
}
setInputData(dataset, getPortToFill());
}
So addInputData actually calls setInputData…which calls getPortToFill().