Closed KevinJJH closed 2 years ago
@jourdain Do you know how proxyFilter is handled? I forget, and would need to look around for this.
@jourdain Do you know how proxyFilter is handled? I forget, and would need to look around for this.
take a look, you defined proxyFilter but never use it Thanks for your help!
Ah, I looked through it and now see what happened. I deleted proxyFilter
references since we weren't using that anymore (i.e. we don't have that exposed in the current UI). Take a look here. You can add it back in as a Source. Then, when you want to run your image through the Contour filter, you do:
const contourSource = proxyManager.createProxy('Sources', 'Contour', { name: '', ... });
contourSource.setInputProxy(myImageSource);
And don't forget to re-add Contour as a vtkImageData!
Let me know if you need anymore clarification.
How can you run your image through the filter? is there any other way to use filter in this project?I want to use WindowedSincPolyDataFilter to make image more smooth, it seems ImageMarchingCubes can do it too. but when I refer vtk document WindowedSincPolyDataFilter I still don't know how to use it, how to setInputConnection with mySource;
I followed your advice,but It doesn't work. ERROR:Invalid or missing input.please check my code:
const contourSource = this.$proxyManager.createProxy('Sources', 'Contour');//this doesn't work,ERROR:Invalid or missing input. contourSource.setInputProxy(this.$proxyManager.getProxyById(this.activeSourceId));
I followed code and found:
if (model.algo && model.inputProxy) {
model.algo.setInputData(model.inputProxy.getDataset());
}
if (model.updateDomain && model.inputProxy) {
model.updateDomain(publicAPI, model.inputProxy.getDataset());
}
if (model.algo) {
publicAPI.setInputData(model.algo.getOutputData(), model.type);//problem is here
}//model.algo.getOutputData() will output 'Invalid or missing input'
that would be great if write some filter demo in the current UI. Because vtk's docutmentation is too brief for me and hard to understand.. I really need your help, Thank you!
The median filter currently in Glance uses itk.js to run the algorithm.
As for your issue, you should be able to get it to work via:
const contourSource = this.$proxyManager.createProxy('Sources', 'Contour', {
inputProxy: <your proxy here>,
});
I'm surprised that you get an invalid input error on createProxy. I'll take a look.
thx, now it work.but when I do:
const contourSource = this.$proxyManager.createProxy('Sources', 'Contour',{inputProxy:myProxy})
this.$nextTick(() => { contourSource.setComputeNormals(true) this.$forceUpdate(); });
I am confused why it doesn't have any change on my window. I would like to WindowedSincPolyDataFilter in the current UI, should I write another filter like proxyFilter? I try to use it by this way but failed. And ui you had define in proxyFilter seems useless,I want to know how to use proxyFilter and WindowedSincPolyDataFilter in the current UI, can you write them in your UI so that I can clone the project and watch directly?I am depressed :( that these problems confused me a few days and I have checked your commit history,still not found where you use the proxyFilter in the UI.Though you defined proxy;Please teach me,thank you ;
Hi,are you still there? I need more clarification
Hi! this dropped off my radar. Right now Glance needs a bit of tweaking before you can comfortably use filters, since those were unfortunately not expanded upon after testing it early on. I can quickly outline a few things that would need to be changed:
|| s.getProxyName() === 'Contour'
and change the .filter(...)
line to get your contour to show up on the side.proxyPropertyMapping
, and note how they line up with the "name" property in the ui section. (A side note: you should make the Contour ui property look something more like what is in proxyUI.js
, since that is old code that doesn't have meaning in Glance anymore.) These properties get usable UI via control components like Representation/script.js and Representation/template.html. Once you define them (e.g. a "computeNormals" property that gets associated with a checkbox in template.html
), then your filter will have the beginnings of a usable UI.This requires a bit more plumbing work going into Glance, and I currently don't have available time to provide concrete code. However, I'll try to provide guidance so you can get this to work. :)
Addendum: You probably are better off doing something similar to how MedianFilter is done. That way, your filtered datasets will automatically show up in Glance without modifying internal plumbing.
Thank you,I will try. Talk later
Hi,can you tell me how to use proxyFilter.js? now I need to use WindowedSincPolyDataFilter or ImageMarchingCubes,but I don't know how to use it in this project. thx