[Paraview-developers] Problem with plugins build from an inherited class

Joe Ping-Lin Hsiao phsiao at cs.unc.edu
Wed May 7 09:53:32 EDT 2014


I found a workaround.

I compiled vktITKImageFilter as a static library, and linked the plugins
with the library rather than included its source code.

This would avoid the crashing and allows me to load both plugins at the
beginning. But I'd get the following error when applying the plugins:


ERROR: In
..\..\..\..\..\src\ParaView\ParaViewCore\ServerImplementation\Core\vtkPVSessionCore.cxx,
line 389

vtkPVSessionCore (00000000044669B0): Object type:
vtkGaussianBlurImageFilter, could not find requested method:
"SetInputConnection"

or the method was called with incorrect arguments.


while processing

Message 0 = Invoke

Argument 0 = vtk_object_pointer {vtkGaussianBlurImageFilter
(000000000B70C310)}

Argument 1 = string_value {SetInputConnection}

Argument 2 = vtk_object_pointer {vtkAlgorithmOutput (000000000637B500)}


I had to explicitly implement the SetInputConnection() functions

void SetInputConnection(int port, vtkAlgorithmOutput* input)
{vtkImageAlgorithm::SetInputConnection(port, input);}
  void SetInputConnection(vtkAlgorithmOutput* input)
{vtkImageAlgorithm::SetInputConnection(input);}

inside my plugins' headers to avoid the error.

Joe


On Wed, May 7, 2014 at 7:02 AM, Utkarsh Ayachit <utkarsh.ayachit at kitware.com
> wrote:

> Maybe the easiest option here would be to just combine both plugins
> into one. A single plugin can provide multiple filters/features.
>
> Utkarsh
>
> On Tue, May 6, 2014 at 4:01 PM, Joe Ping-Lin Hsiao <phsiao at cs.unc.edu>
> wrote:
> > Yes, since vtkITKImageFilter is the base class of both plugins, it
> appears
> > in  ADD_PARAVIEW_PLUGIN() from both of them.
> >
> >
> > On Tue, May 6, 2014 at 2:27 PM, Utkarsh Ayachit
> > <utkarsh.ayachit at kitware.com> wrote:
> >>
> >> Yes vtkITKImageFilter sounds like the class being wrapped twice. Is
> >> vtkITKImageFilter.cxx added to both the plugins in
> >> ADD_PARAVIEW_PLUGIN() call?
> >>
> >> On Tue, May 6, 2014 at 11:45 AM, Joe Ping-Lin Hsiao <phsiao at cs.unc.edu>
> >> wrote:
> >> > I am not sure if this is the wrapped class that you mentioned, but I
> >> > checked
> >> > the code,
> >> >
> >> > within the CMake of the base class (vtkITKImageFilter), there is
> >> >
> >> > VTK_WRAP_ClientServer("ITKImageFilter"
> >> >   ParaViewITKPluginsWrappedSrcs "${ParaViewITKPluginsCommonSrcs}"
> >> > )
> >> >
> >> > and in the base class' header, there are a bunch of //BTX and //ETX
> >> > securing
> >> > ITK declarations.
> >> >
> >> > Within the pluings' headers, there are also a bunch of //BTX and //ETX
> >> > surrounding ITK code.
> >> >
> >> > I tried disabling them all above, but still get the same error.
> >> >
> >> >
> >> > One thing I noticed is that in Visual Studio under the projects of
> both
> >> > plugins, there is a vtkITKImageFilterClientServer.cxx created by
> >> > ParaView.
> >> > Could this be the duplicate copy of class?
> >> >
> >> >
> >> > On Tue, May 6, 2014 at 8:58 AM, Utkarsh Ayachit
> >> > <utkarsh.ayachit at kitware.com> wrote:
> >> >>
> >> >> Is it possible that both of the plugins have some wrapped class that
> >> >> is duplicated in the two?
> >> >>
> >> >> On Mon, May 5, 2014 at 1:32 PM, Joe Ping-Lin Hsiao <
> phsiao at cs.unc.edu>
> >> >> wrote:
> >> >> > I am having trouble loading my custom plugins, which have an
> internal
> >> >> > ITK
> >> >> > pipeline. Everything works fine if I only load one of them. As soon
> >> >> > as I
> >> >> > load a second one, the program crashes. The error message I get
> from
> >> >> > debug
> >> >> > mode is
> >> >> >
> >> >> > Unhandled exception at 0x000007feeb86275d
> (vtkClientServer-pv4.1.dll)
> >> >> > in
> >> >> > ImageSurfer2.exe: 0xC0000005: Access violation reading location
> >> >> > 0x0000000000000000.
> >> >> >
> >> >> >
> >> >> > The call stack:
> >> >> >
> >> >> >   vtkClientServer-pv4.1.dll!std::operator<<<std::char_traits<char>
> >> >> >>(std::basic_ostream<char,std::char_traits<char> > & _Ostr={...},
> >> >> >> const
> >> >> >> char
> >> >> > * _Val=0x000007feeb8aaec8)  Line 747 + 0x8 bytes C++
> >> >> >
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >>
> vtkClientServer-pv4.1.dll!vtkClientServerInterpreter::AddNewInstanceFunction(const
> >> >> >> char * name=0x000007feed4920d0, vtkObjectBase * (void *)*
> >> >> >> f=0x000007feed301cfd, void * ctx=0x0000000000000000, void (void
> *)*
> >> >> >> freeFunction=0x0000000000000000)  Line 851 + 0x1b bytes C++
> >> >> >
> >> >> >   Hessian3DToVesselnessMeasureImageFilter.dll!000007feed34e8c2()
> >> >> >
> >> >> >   [Frames below may be incorrect and/or missing, no symbols loaded
> >> >> > for
> >> >> > Hessian3DToVesselnessMeasureImageFilter.dll]
> >> >> >
> >> >> >   000000000480f170()
> >> >> >
> >> >> >   Hessian3DToVesselnessMeasureImageFilter.dll!000007feed4920d0()
> >> >> >
> >> >> >   Hessian3DToVesselnessMeasureImageFilter.dll!000007feed301cfd()
> >> >> >
> >> >> >
> >> >> >
> >> >> > Here is my class hierarchy:
> >> >> >
> >> >> >
> >> >> > vtkITKImageFilter  -> class inherits from vtkImageAlgorithm. Use
> >> >> > vtkImageExport, itk::VTKImageImport, itk::VTKImageExport, and
> >> >> > vtkImageImport
> >> >> > inside to convert between VTK and ITK.
> >> >> >
> >> >> >
> >> >> > MyITKFilter -> my ITK plugin inheriting from vtkITKImageFilter.
> >> >> >
> >> >> >
> >> >> >
> >> >> > I include source code from both classes in CMake:
> >> >> >
> >> >> >
> >> >> > ADD_PARAVIEW_PLUGIN(${PLUGIN} 1.0
> >> >> >
> >> >> >   SERVER_MANAGER_XML ${XML}
> >> >> >
> >> >> >   SERVER_MANAGER_SOURCES
> >> >> > vtkHessian3DToVesselnessMeasureImageFilter.cxx
> >> >> > ../Common/vtkITKImageFilter.cxx
> >> >> >
> >> >> >   SOURCES ${XML}
> >> >> >
> >> >> > )
> >> >> >
> >> >> >
> >> >> > and link the plugin with ITK
> >> >> >
> >> >> >
> >> >> > TARGET_LINK_LIBRARIES(${PLUGIN} ${ITK_LIBRARIES})
> >> >> >
> >> >> >
> >> >> > ITK was built in static.
> >> >> >
> >> >> >
> >> >> > Any idea what might cause the trouble?
> >> >> >
> >> >> >
> >> >> >
> >> >> > Thanks,
> >> >> >
> >> >> > Joe
> >> >> >
> >> >> >
> >> >> > _______________________________________________
> >> >> > Paraview-developers mailing list
> >> >> > Paraview-developers at paraview.org
> >> >> > http://public.kitware.com/mailman/listinfo/paraview-developers
> >> >> >
> >> >
> >> >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20140507/a27bad51/attachment.html>


More information about the Paraview-developers mailing list