Dear all,
I am trying to embed the vtkImageMathematics filter in ParaView, but I
have a pipeline issue (attached are the corresponding XML
servermanagers).
For "one input" operations (add K, invert, sin, cos,...) everything
works well. But for "two inputs" operations (Add, Multiply, Min,
Max,...) the pipeline browser does not show the connections between
the input images and the ImageMathematics filter. Note that updating
the pipeline produces the right output! The only problem is that I
cannot right-click and choose "change input". Another consequence is
that a python-scripted state is not able to rebuild the pipeline.

FYI, I already developed a two-image-inputs filter (image convolution
with a kernel represented by another vtkImageData:
http://github.com/jeromevelut/vtkKinship) for which this issue doesn't
occur. Could it be the way the input informations are provided at the
VTK side of the filter ?

Thanks a lot,
Jerome
<ServerManagerConfiguration>
   <ProxyGroup name="filters">
      <SourceProxy name="ImageMathematics1Input"
                   class="vtkImageMathematics"
                  label="Image Mathematics 1 Input">
         <Documentation
                      long_help="" 
                      short_help=""> 
         </Documentation>
         <InputProperty
                       name="Input"
                       command="SetInputConnection"
                       port_index="0">
            <ProxyGroupDomain name="groups">
               <Group name="sources"/>
               <Group name="filters"/>
            </ProxyGroupDomain>
            <DataTypeDomain name="input_type">
               <DataType value="vtkImageData"/>
            </DataTypeDomain>
            <Documentation>
               Set the input to the Image Mathematics filter.
            </Documentation>
         </InputProperty>
        
         <IntVectorProperty
                           name="Operation"
                           command="SetOperation"
                           number_of_elements="1"
                           default_values="4">
            
            <EnumerationDomain name="enum">
               <Entry value="4" text="Invert"/>
               <Entry value="5" text="Sin"/>
               <Entry value="6" text="Cos"/>
               <Entry value="7" text="Exp"/>
               <Entry value="8" text="Log"/>
               <Entry value="9" text="Abs"/>
               <Entry value="10" text="Sqr"/>
               <Entry value="11" text="Sqrt"/>
               <Entry value="14" text="Atan"/>
               <Entry value="15" text="Atan2"/>
               <Entry value="16" text="Multiply by k"/>
               <Entry value="17" text="Add c"/>
               <Entry value="18" text="Conjugate"/>
               <Entry value="20" text="Replace by k"/>
            </EnumerationDomain>
         </IntVectorProperty>
         
         <DoubleVectorProperty
                              name="ConstantK"
                              command="SetConstantK"
                              number_of_elements="1"
                              default_values="1">
         </DoubleVectorProperty>
         
         <DoubleVectorProperty
                              name="ConstantC"
                              command="SetConstantC"
                              number_of_elements="1"
                              default_values="0">
         </DoubleVectorProperty>
         
         <IntVectorProperty
                           name="DivideByZeroToC"
                           command="SetDivideByZeroToC"
                           number_of_elements="1"
                           default_values="1">
            <BooleanDomain name="boolean"/>
         </IntVectorProperty>
         <IntVectorProperty
                           name="ReleaseDataFlag"
                           command="SetReleaseDataFlag"
                           number_of_elements="1"
                           default_values="0"
                           animateable="0">
            <BooleanDomain name="boolean"/>
            <Documentation>
               
            </Documentation>
         </IntVectorProperty>
      </SourceProxy>
   </ProxyGroup> 
</ServerManagerConfiguration>
<ServerManagerConfiguration>
   <ProxyGroup name="filters">
      <SourceProxy name="ImageMathematics2Inputs"
                   class="vtkImageMathematics"
                  label="Image Mathematics 2 Inputs">
         <Documentation
                      long_help="" 
                      short_help=""> 
         </Documentation>
         <InputProperty
                       name="Input1"
                       command="SetInputConnection">
            <ProxyGroupDomain name="groups">
               <Group name="sources"/>
               <Group name="filters"/>
            </ProxyGroupDomain>
            <DataTypeDomain name="input_type">
               <DataType value="vtkImageData"/>
            </DataTypeDomain>
         </InputProperty>
         
         <InputProperty
                       name="Input2"
                       command="SetInputConnection"
		       port_index="1">
            <ProxyGroupDomain name="groups">
               <Group name="sources"/>
               <Group name="filters"/>
            </ProxyGroupDomain>
            <DataTypeDomain name="input_type">
               <DataType value="vtkImageData"/>
            </DataTypeDomain>
         </InputProperty>
         
         <IntVectorProperty
                           name="Operation"
                           command="SetOperation"
                           number_of_elements="1"
                           default_values="0">
            
            <EnumerationDomain name="enum">
               <Entry value="0" text="Add"/>
               <Entry value="1" text="Substract"/>
               <Entry value="2" text="Multiply"/>
               <Entry value="3" text="Divide"/>
               <Entry value="12" text="Min"/>
               <Entry value="13" text="Max"/>
               <Entry value="19" text="Complex multiply"/>
            </EnumerationDomain>
         </IntVectorProperty>
         
         <DoubleVectorProperty
                              name="ConstantK"
                              command="SetConstantK"
                              number_of_elements="1"
                              default_values="1">
         </DoubleVectorProperty>
         
         <DoubleVectorProperty
                              name="ConstantC"
                              command="SetConstantC"
                              number_of_elements="1"
                              default_values="0">
         </DoubleVectorProperty>
         
         <IntVectorProperty
                           name="DivideByZeroToC"
                           command="SetDivideByZeroToC"
                           number_of_elements="1"
                           default_values="1">
            <BooleanDomain name="boolean"/>
         </IntVectorProperty>
         <IntVectorProperty
                           name="ReleaseDataFlag"
                           command="SetReleaseDataFlag"
                           number_of_elements="1"
                           default_values="0"
                           animateable="0">
            <BooleanDomain name="boolean"/>
            <Documentation>
               
            </Documentation>
         </IntVectorProperty>
      </SourceProxy>
   </ProxyGroup> 
</ServerManagerConfiguration>
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview

Reply via email to