Ok ! <br>No, it doesn't work, but I made my mind:<br><br>* vtkImageMathematics has two input ports, the second one being optional. That's why the XML works with one filter.<br><br>* Function SetInput1 and SetInput2 are wrappers around SetInputConnection for old-style programming compatibility. SetInputX is in fact SetInputConnection(X-1, input_port1 )<br>
<br>When using AddInputConnection like vtkImageAppend does, it is based on the 'one port' fashion of the filter, then multiple inputs means multiple connections on one port... That is not the case for vtkImageMathematics !!<br>
<br>So, I would like to use kind of number_of_elements statement and element_types statement to handle something like :<br><InputProperty<br> name="Input1"<br>
command="SetInputConnection"<br>
<div> number_of_elements="2"<br> element_types="0 3" <!-- Yes I know, type '3' does not exist: I want this to be vtkAlgorithmOutput --><br>
default_values="0 Input1"> <!-- Yes I know, but you see what I means ?? --><br> <ProxyGroupDomain name="groups"><br>
<Group name="sources"/><br>
<Group name="filters"/><br>
</ProxyGroupDomain><br>
<DataTypeDomain name="input_type"><br>
<DataType value="vtkImageData"/><br>
</DataTypeDomain><br>
<Documentation><br> Set the input to the vtkImageMathematics filter.<br>
</Documentation><br>
</InputProperty></div><br><br>And then the same with Input2, where default_values would be "1 Input2".<br>I know one solution is to create an inherited class from vtkImageMathematics, with accessors on input port 0 and port 1. I already did that for vtkImageStencil, what works fine. My problem here is to make vtkImageMathematic available without building any plugins: c++-allergics have rights to use image addition and substraction inside ParaView !! one XML to load, that's all !<br>
<br>I hope -for these allergics- that there is a solution...<br><br>Best regards<br><br>Jerome<br><br><div class="gmail_quote">2009/4/2 Jérôme <span dir="ltr"><<a href="mailto:jerome.velut@gmail.com">jerome.velut@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br><br>Many thanks for your quick answer. The problem I described was observed on Paraview 3.4 release, debug build. I have a 3.5 CVS (not updated, so bad...) on which I tried my XML just right now: "Image Math" is no more gray!! I am able to apply the filter on a single image, with "Add constant", "Multiply by constant", etc.<br>
<br>The new problem is when I want to add two image. I selected two mandelbrot sources, then I plugged the "Image Math" filter. The output window claims: "Input port 0 of algorithm vtkImageMathematics(0x7f081c4bcb70) has 2 connections but is not repeatable".<br>
<br>I tried the repeat_command="1" statement, without optimism and not much success... It seems that vtkImageMathematics input is old-fashionned, but the VTK doc says that SetInput1 and SetInput2 is like involking AddInputConnection. Where do I miss something ??? <br>
<br>Thanks for all,<br><br>Jerome<br><br><div class="gmail_quote">2009/4/2 Utkarsh Ayachit <span dir="ltr"><<a href="mailto:utkarsh.ayachit@kitware.com" target="_blank">utkarsh.ayachit@kitware.com</a>></span><div><div>
</div><div class="h5"><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I justed loaded your XML as a plugin in CVS ParaView is seems to being<br>
enabled fine. I was able to apply the filter to Mandlebrot source.<br>
What version of ParaView are you using?<br>
<br>
Utkarsh<br>
<br>
2009/4/2 Jérôme <<a href="mailto:jerome.velut@gmail.com" target="_blank">jerome.velut@gmail.com</a>>:<br>
<div><div></div><div>> Dear all,<br>
><br>
> I am unsuccessfully fighting with XML description of the VTK<br>
> vtkImageMathematics filter. I want it to be available in the ParaView<br>
> filters. At the end of this mail is the XML I wrote, widely inspired from<br>
> "Append Geometry".<br>
><br>
> Note that it is part of a larger file making available ImageGaussianSmooth,<br>
> ImageSobel3D, ImageFilp, SplineFilter, some different sources... Everything<br>
> works well, except Image Mathematics and Image Reslice (I told about Reslice<br>
> in another thread).<br>
><br>
> The symptom is the following : the "Image Math" appears in the filters list,<br>
> but is always unavailable, even if I select one proxy or two in the<br>
> pipeline. What is the diagnostic, doctors ? Is there a therapy ?<br>
><br>
> Thanks all !<br>
><br>
> Best regards,<br>
> Jerome<br>
><br>
> <ServerManagerConfiguration><br>
> <ProxyGroup name="filters"><br>
> <!--<br>
> ================================================================== --><br>
> <SourceProxy name="ImageMathematics" class="vtkImageMathematics"<br>
> label="Image Math"><br>
> <Documentation<br>
> long_help="Provides some image operations, one or two<br>
> inputs."<br>
> short_help="vtkImageMathematics filter."><br>
> </Documentation><br>
> <InputProperty<br>
> name="Input"<br>
> command="AddInputConnection"<br>
> clean_command="RemoveAllInputs"<br>
> multiple_input="1"><br>
> <ProxyGroupDomain name="groups"><br>
> <Group name="sources"/><br>
> <Group name="filters"/><br>
> </ProxyGroupDomain><br>
> <DataTypeDomain name="input_type"><br>
> <DataType value="vtkImageData"/><br>
> </DataTypeDomain><br>
> <Documentation><br>
> Set the input to the Append Geometry filter.<br>
> </Documentation><br>
> </InputProperty><br>
><br>
> <IntVectorProperty<br>
> name="Operation"<br>
> command="SetOperation"<br>
> number_of_elements="1"<br>
> default_values="0"><br>
><br>
> <EnumerationDomain name="enum"><br>
> <Entry value="0" text="Add"/><br>
> <Entry value="1" text="Substract"/><br>
> <Entry value="2" text="Multiply"/><br>
> <Entry value="3" text="Divide"/><br>
> <Entry value="4" text="Invert"/><br>
> <Entry value="5" text="Sin"/><br>
> <Entry value="6" text="Cos"/><br>
> <Entry value="7" text="Exp"/><br>
> <Entry value="8" text="Log"/><br>
> <Entry value="9" text="Abs"/><br>
> <Entry value="10" text="Sqr"/><br>
> <Entry value="11" text="Sqrt"/><br>
> <Entry value="12" text="Min"/><br>
> <Entry value="13" text="Max"/><br>
> <Entry value="14" text="Atan"/><br>
> <Entry value="15" text="Atan2"/><br>
> <Entry value="16" text="Multiply by k"/><br>
> <Entry value="17" text="Add c"/><br>
> <Entry value="18" text="Conjugate"/><br>
> <Entry value="19" text="Complex multiply"/><br>
> <Entry value="20" text="Replace by k"/><br>
> </EnumerationDomain><br>
> </IntVectorProperty><br>
><br>
> <DoubleVectorProperty<br>
> name="ConstantK"<br>
> command="SetConstantK"<br>
> number_of_elements="1"<br>
> default_values="1"><br>
> </DoubleVectorProperty><br>
><br>
> <DoubleVectorProperty<br>
> name="ConstantC"<br>
> command="SetConstantC"<br>
> number_of_elements="1"<br>
> default_values="0"><br>
> </DoubleVectorProperty><br>
><br>
> <IntVectorProperty<br>
> name="DivideByZeroToC"<br>
> command="SetDivideByZeroToC"<br>
> number_of_elements="1"<br>
> default_values="1"><br>
> <BooleanDomain name="boolean"/><br>
> </IntVectorProperty><br>
><br>
> </SourceProxy><br>
> <!-- End ImageMathematics --><br>
> </ProxyGroup><br>
> <!-- End Filters Group --><br>
> </ServerManagerConfiguration><br>
><br>
><br>
><br>
</div></div>> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the ParaView Wiki at:<br>
> <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
><br>
><br>
</blockquote></div></div></div><br>
</blockquote></div><br>