<html><head><style> body {height: 100%; color:#000000; font-size:12pt; font-family:Times New Roman;}</style></head><body>Hi everyone, <br> I'm searching a way to convert a class (developed by our laboratory) to ParaView plugin.<br> So, they have the vtkOtsuSphereSource.cxx and vtkOtsuSphereSource.h file as in the attachments.<br> With this class, they will be able to calculate the optimal threshold of an vtkImageData. The return value is this optimal threshold.<br> <br> I have some questions to ask you about how to convert this class so it can be used as ParaView plugin.<br> - What does it means <strong>"vtkStandardNewMacro(vtkOtsuSphereSource)"</strong> and does it mandatory?<br> - Error when compiling <strong>vtkOtsuSphereSourceClientServer.cxx:13:10: error: ‘New’ is not a member of ‘vtkOtsuSphereSource’</strong>, so, it's because I don't have <strong>static vtkOtsuSphereSource* New();</strong> in the .h file. So I want to ask : what is this?<br> - When I added this <strong>static vtkOtsuSphereSource* New();</strong> in the .h file. another compiling error :<strong> /vtkOtsuSphereSource/bin/vtkOtsuSphereSourceClientServer.cxx:13:35: error: cannot convert ‘vtkOtsuSphereSource*’ to ‘vtkObjectBase*’ in return</strong> so my class is not a vtkObjectBase, but how can we go through this error?<br> <br>The following lines indicate the compiling error with <strong>static vtkOtsuSphereSource* New(); </strong>in .h file<br> <em> /home/thtran/ParaViewPlugins/vtkOtsuSphereSource/bin/vtkOtsuSphereSourceClientServer.cxx: In function ‘int vtkOtsuSphereSourceCommand(vtkClientServerInterpreter*, vtkObjectBase*, const char*, const vtkClientServerStream&, vtkClientServerStream&)’:<br>/home/thtran/ParaViewPlugins/vtkOtsuSphereSource/bin/vtkOtsuSphereSourceClientServer.cxx:19:29: error: ‘SafeDownCast’ is not a member of ‘vtkOtsuSphereSource’<br>make[2]: *** [CMakeFiles/MyOtsuSphereSource.dir/vtkOtsuSphereSourceClientServer.o] Error 1<br>make[1]: *** [CMakeFiles/MyOtsuSphereSource.dir/all] Error 2</em><br> <br> Thank you very much in advance</body></html>