[vtkusers] python wrapper for vtkPartialVolumeModeller

Dr. Roman Grothausmann grothausmann.roman at mh-hannover.de
Wed Jan 7 05:07:07 EST 2015


Hi Cory,


On 07/01/15 02:53, Cory Quammen wrote:> If you do that and the compiler 
complains that it can't find
 > vtkBoxClipDataSet.h, add vtkFiltersGeneral to the DEPENDENCIES list in
 > Imaging/Hybrid/module.cmake.

This was the info I lacked. Many thanks!
So in general for includes from other VTK subdirectories like e.g. 
Imaging/Hybrid/ I'd add vtkImagingHybrid to the DEPENDENCIES?

 > Let us know how it goes,

The way to use vtkSimpleCriticalSection seems to have changed. I had to modify 
the code to this:

diff --git a/Imaging/Hybrid/vtkPartialVolumeModeller.cxx 
b/Imaging/Hybrid/vtkPartialVolumeModeller.cxx
index eaa702b..3f1ab52 100644
--- a/Imaging/Hybrid/vtkPartialVolumeModeller.cxx
+++ b/Imaging/Hybrid/vtkPartialVolumeModeller.cxx
@@ -67,7 +67,7 @@ vtkPartialVolumeModeller::vtkPartialVolumeModeller()

    this->Threader        = vtkMultiThreader::New();
    this->NumberOfThreads = this->Threader->GetNumberOfThreads();
-  this->ProgressMutex = vtkSimpleCriticalSection::New();
+  this->ProgressMutex = new vtkSimpleCriticalSection;
  }

  //----------------------------------------------------------------------------
@@ -80,7 +80,7 @@ vtkPartialVolumeModeller::~vtkPartialVolumeModeller()

    if (this->ProgressMutex)
      {
-    this->ProgressMutex->Delete();
+    delete this->ProgressMutex;
      }
  }

Is that the correct way to do it now in VTK-6.1.0?

Again, many thanks for Your help.
Roman


> On Tue, Jan 6, 2015 at 3:50 AM, Dr. Roman Grothausmann
> <grothausmann.roman at mh-hannover.de> wrote:
>> Dear Cory,
>>
>>
>> Recently I wanted to use Your vtkPartialVolumeModeller in VTK-6.1.0 with
>> python (as before). However, the VTK directory structure has changed and I
>> could not find a directory to put it into to compile. Either
>> vtkBoxClipDataSet.h or vtkDataSetSurfaceFilter.h are not found. There is a
>> note in the CMakeLists.txt that they used to be in the same directory but
>> that was changed.
>> What could I do to get a python wrapping for vtkPartialVolumeModeller again
>> in VTK6?
>>
>> Thanks for any help or hints.
>> Roman
>>
>> On 11/07/12 16:46, Cory Quammen wrote:
>>>
>>> Okay, great, I'm glad you find it useful.
>>>
>>>   > I just tried this but although all compiles fine I get this error when
>>>   > python is about to include vtk:
>>>   >
>>>   > Error: /opt/vtk-5.10.0/lib/vtk-5.10/libvtkImaging.so.5.10: undefined
>>> symbol:
>>>   > _ZN17vtkBoxClipDataSet10SetBoxClipEdddddd.
>>>
>>> The linker error you are getting means that a required library is not
>>> being linked against for libvtkImaging. I would try to move
>>> vtkPartialVolumeModeller from VTK/Imaging to VTK/Graphics, then add
>>> vtkPartialVolumeModeller.cxx in the CMakeLists.txt file under
>>> VTK/Graphics instead of VTK/Imaging, just like you had it.
>>> libvtkGraphics may have the right libraries specified to eliminate the
>>> linker error.
>>>
>>>   > I added vtkPartialVolumeModeller in VTK/Imaging/CMakeLists.txt under
>>>   > Kit_SRCS:
>>>   >
>>>   > SET( Kit_SRCS
>>>   > vtkPartialVolumeModeller.cxx
>>>   > vtkBooleanTexture.cxx
>>>   > .
>>>   > .
>>>   > .
>>>   >
>>>   > Is that correct? There was no Module_SRCS and also no subdirectory
>>> Hybrid in
>>>   > VTK/Imaging/.
>>>
>>> Ah, my instructions were for the latest VTK in the git repository. I
>>> see now that you are using VTK 5.10. Yes, that is the right way to add
>>> the source file.
>>>
>>>   > Do You have any ideas how to fix the undefined symbol error?
>>>
>>> The linker error you are getting means that a required library is not
>>> being linked against for libvtkImaging. I would try to move
>>> vtkPartialVolumeModeller from VTK/Imaging to VTK/Graphics, then add
>>> vtkPartialVolumeModeller.cxx in the CMakeLists.txt file under
>>> VTK/Graphics instead of VTK/Imaging, just like you had it.
>>>
>>> Please let me know how that goes.
>>>
>>> Cory
>>>
>>> --
>>> Cory Quammen
>>> Research Associate
>>> Department of Computer Science
>>> The University of North Carolina at Chapel Hill
>>>
>>
>> --
>> Dr. Roman Grothausmann
>>
>> Tomographie und Digitale Bildverarbeitung
>> Tomography and Digital Image Analysis
>>
>> Institut für Funktionelle und Angewandte Anatomie, OE 4120
>> Medizinische Hochschule Hannover
>> Carl-Neuberg-Str. 1
>> D-30625 Hannover
>>
>> Tel. +49 511 532-9574
>> _______________________________________________
>> 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 VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/vtkusers
>
>
>

-- 
Dr. Roman Grothausmann

Tomographie und Digitale Bildverarbeitung
Tomography and Digital Image Analysis

Institut für Funktionelle und Angewandte Anatomie, OE 4120
Medizinische Hochschule Hannover
Carl-Neuberg-Str. 1
D-30625 Hannover

Tel. +49 511 532-9574


More information about the vtkusers mailing list