From arnd.baecker at web.de Fri Aug 1 03:21:55 2014 From: arnd.baecker at web.de (Arnd Baecker) Date: Fri, 1 Aug 2014 09:21:55 +0200 (CEST) Subject: [vtkusers] Status of VTK Python 3 wrapper support In-Reply-To: References: <1406810682351-5728034.post@n5.nabble.com> Message-ID: On Thu, 31 Jul 2014, David Gobbi wrote: > On Thu, Jul 31, 2014 at 6:44 AM, diego0020 wrote: >> >> But I am also looking forward to this. Is there anything we could do to push >> support for python 3 forward? > > There has been some discussion about converting all of the python > tests and examples, which is a part of the process where extra > manpower would be a big asset. I imagine that the conversion will > go something like this: > > 1) Someone will run 2to3 on all the python code, and then make > sure that it can be byte-compiled with python3 (it will be too early > at this stage to actually run the code, but making sure that it > byte-compiles will be a good first step). > > 2) Lots of people will then pick through the code to fix conversion > errors and to make sure that the code actually looks like good > python3 code. > > 3) Finally, someone will add some CMake magic to VTK so that if VTK > is built against python2, cmake will run 3to2 on all of these new python3 > files and put the equivalent python2 code into the VTK build > directory. This is the magic that is needed to make sure that VTK > will be able to support both python2 and python3. > > So any assistance with the above process would be a big help. In > particular, it would be very useful if someone could verify that item > (3) is even feasible: in the end it might be necessary to have hand- > written python2 and python3 exist side-by-side instead of using > automatic conversion. It _should_ be feasible, since the VTK > tests used automated tcl-to-python conversion for many years, > and python3 to python2 should be much easier than tcl to python. As a disclaimer ahead: I don't have any experience in porting to python 3. For my own projects I am just trying to follow pylint's suggestions about possible python 3 problems and using ``from __future__ import (division, print_function)`` at the beginning. According to https://docs.python.org/2/howto/pyporting.html it might be worth a try to run the examples/tests with the ``-3`` option to find out about possible compatibility problems. I tried this with some random examples and no problems were reported. So it might be that a lot of code is such that it would work fine both with python 2 and python 3. (Maybe someone from the numpy/scipy/... experts could also help with their experience in supporting both python 2 and 3). Unfortunately at the moment I won't have time to look into this further, but I will try to help, if needed. Best, Arnd From dov.grobgeld at gmail.com Fri Aug 1 04:41:20 2014 From: dov.grobgeld at gmail.com (Dov Grobgeld) Date: Fri, 1 Aug 2014 11:41:20 +0300 Subject: [vtkusers] Status of VTK Python 3 wrapper support In-Reply-To: References: <1406810682351-5728034.post@n5.nabble.com> Message-ID: Is there a conversion document describing how the "look and feel" of the new binding? The current binding is very non-pythonesque in various ways. E.g.: import vtk # identity transformation t = vtk.vtkTransform() in_point = (1,0,0) out_point = [0,0,0] t.TransformPoint(in_point,out_point) # would expect something like in_point = vtk.vtkPoint((1,0,0)) out_point = t.TransformPoint(in_point) There are lots of other examples as well that I encountered in the source. E.g. the use of gettattr() and a dispatcher, instead of just using the standard python list of class methods. Of course, such a drastic change this will break the current API. But you can always call it vtk6 and decide not to be backwards compatible. Regards, Dov On Fri, Aug 1, 2014 at 10:21 AM, Arnd Baecker wrote: > On Thu, 31 Jul 2014, David Gobbi wrote: > > On Thu, Jul 31, 2014 at 6:44 AM, diego0020 >> wrote: >> >>> >>> But I am also looking forward to this. Is there anything we could do to >>> push >>> support for python 3 forward? >>> >> >> There has been some discussion about converting all of the python >> tests and examples, which is a part of the process where extra >> manpower would be a big asset. I imagine that the conversion will >> go something like this: >> >> 1) Someone will run 2to3 on all the python code, and then make >> sure that it can be byte-compiled with python3 (it will be too early >> at this stage to actually run the code, but making sure that it >> byte-compiles will be a good first step). >> >> 2) Lots of people will then pick through the code to fix conversion >> errors and to make sure that the code actually looks like good >> python3 code. >> >> 3) Finally, someone will add some CMake magic to VTK so that if VTK >> is built against python2, cmake will run 3to2 on all of these new python3 >> files and put the equivalent python2 code into the VTK build >> directory. This is the magic that is needed to make sure that VTK >> will be able to support both python2 and python3. >> >> So any assistance with the above process would be a big help. In >> particular, it would be very useful if someone could verify that item >> (3) is even feasible: in the end it might be necessary to have hand- >> written python2 and python3 exist side-by-side instead of using >> automatic conversion. It _should_ be feasible, since the VTK >> tests used automated tcl-to-python conversion for many years, >> and python3 to python2 should be much easier than tcl to python. >> > > As a disclaimer ahead: I don't have any experience in porting > to python 3. For my own projects I am just trying to follow pylint's > suggestions about possible python 3 problems and using > ``from __future__ import (division, print_function)`` at the beginning. > > According to https://docs.python.org/2/howto/pyporting.html > it might be worth a try to run the examples/tests with the ``-3`` > option to find out about possible compatibility problems. > I tried this with some random examples and no problems were > reported. > So it might be that a lot of code is such > that it would work fine both with python 2 and python 3. > (Maybe someone from the numpy/scipy/... experts could > also help with their experience in supporting both python 2 and 3). > > Unfortunately at the moment I won't have time to look into this > further, but I will try to help, if needed. > > Best, Arnd > > > > > > > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nawijn at gmail.com Fri Aug 1 05:05:30 2014 From: nawijn at gmail.com (Marco Nawijn) Date: Fri, 1 Aug 2014 11:05:30 +0200 Subject: [vtkusers] Status of VTK Python 3 wrapper support In-Reply-To: References: <1406810682351-5728034.post@n5.nabble.com> Message-ID: Dear All, @David: I am more than happy to work on points (1: Run 2to3) and (2: fix errors/inconsistencies). About the CMake part, I am not an expert whatsoever, so although I als willing to assist here, it might not be very efficient due to my lack of experience with CMake. @Dov: Although I agree with you that some of the code in not so pythonic, my suggestion would be to first use have something (python 3 VTK binding + working set of examples). From there on, start iterating to improve what we have. I am not sure if this process is completely feasible though, because providing a pythonic interface might have a big impact on the wrapper code generation part. Probably David can provide a better look on this. One question is remaining for me. How do we organise this (creation of alpha version of wrapper, running 2to3 etc.)? Marco -------------- next part -------------- An HTML attachment was scrubbed... URL: From arnd.baecker at web.de Fri Aug 1 06:14:29 2014 From: arnd.baecker at web.de (Arnd Baecker) Date: Fri, 1 Aug 2014 12:14:29 +0200 (CEST) Subject: [vtkusers] Status of VTK Python 3 wrapper support In-Reply-To: References: <1406810682351-5728034.post@n5.nabble.com> Message-ID: On Fri, 1 Aug 2014, Dov Grobgeld wrote: > Is there a conversion document describing how the "look and feel" of the new > binding? > > The current binding is very non-pythonesque in various ways. E.g.: > > import vtk > > # identity transformation > t = vtk.vtkTransform() > in_point = (1,0,0) > out_point = [0,0,0] > t.TransformPoint(in_point,out_point) > > # would expect something like > in_point = vtk.vtkPoint((1,0,0)) > out_point = t.TransformPoint(in_point) > There are lots of other examples as well that I encountered in the source. > E.g. the use of gettattr() and a dispatcher, instead of just using the > standard python list of class methods. > > Of course, such a drastic change this will break the current API. But you > can always call it vtk6 and decide not to be backwards compatible. A more pythonic API to vtk is provided by TVTK (traited vtk, see: http://docs.enthought.com/mayavi/tvtk/README.html This is for example the basis of Mayavi http://docs.enthought.com/mayavi/mayavi/ for 3D scientific data visualization and plotting using python). Best, Arnd From berk.geveci at kitware.com Fri Aug 1 10:11:58 2014 From: berk.geveci at kitware.com (Berk Geveci) Date: Fri, 1 Aug 2014 10:11:58 -0400 Subject: [vtkusers] Status of VTK Python 3 wrapper support In-Reply-To: References: <1406810682351-5728034.post@n5.nabble.com> Message-ID: Hi David and others, I don't think that this workflow would work for us. Most of our collaborators, specially in the supercomputing community, are going to take a while longer to move to Python 3. So as a team, we need to continue to do our day-to-day work using Python 2. So having to go through a 3-to-2 conversion mechanism would be very cumbersome. We would have to regularly maintain 2 builds, do the development in 3 then move to the 2 build, test etc. I suggest taking smaller steps. Starting with porting of the core modules (not the tests) and seeing what will be involved in maintaining both 2 and 3 versions (or a 2-to-3 conversion on the fly) would be my suggestion. Once we can demonstrate the maintainability of this, I suspect that doing a 2-to-3 conversion on the fly for the tests would be pretty easy. Best, -berk On Thu, Jul 31, 2014 at 4:15 PM, David Gobbi wrote: > On Thu, Jul 31, 2014 at 6:44 AM, diego0020 > wrote: > > > > But I am also looking forward to this. Is there anything we could do to > push > > support for python 3 forward? > > There has been some discussion about converting all of the python > tests and examples, which is a part of the process where extra > manpower would be a big asset. I imagine that the conversion will > go something like this: > > 1) Someone will run 2to3 on all the python code, and then make > sure that it can be byte-compiled with python3 (it will be too early > at this stage to actually run the code, but making sure that it > byte-compiles will be a good first step). > > 2) Lots of people will then pick through the code to fix conversion > errors and to make sure that the code actually looks like good > python3 code. > > 3) Finally, someone will add some CMake magic to VTK so that if VTK > is built against python2, cmake will run 3to2 on all of these new python3 > files and put the equivalent python2 code into the VTK build > directory. This is the magic that is needed to make sure that VTK > will be able to support both python2 and python3. > > So any assistance with the above process would be a big help. In > particular, it would be very useful if someone could verify that item > (3) is even feasible: in the end it might be necessary to have hand- > written python2 and python3 exist side-by-side instead of using > automatic conversion. It _should_ be feasible, since the VTK > tests used automated tcl-to-python conversion for many years, > and python3 to python2 should be much easier than tcl to python. > > - David > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Fri Aug 1 11:30:48 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 1 Aug 2014 09:30:48 -0600 Subject: [vtkusers] Status of VTK Python 3 wrapper support In-Reply-To: References: <1406810682351-5728034.post@n5.nabble.com> Message-ID: Hi Berk, Thanks for the insight into how this will impact your customers. I wasn't suggesting the the conversion of the tests be done now, or even before the core. And, yes, you're probably right that 2-to-3 is the way to go until the major sites are ready to switch to python3. For myself, there are two major wrapper-related tasks that have far higher priority than py3k: 1) wrap enum types (so that enum types can be used as method args), and also wrap namespaces, since these are blockers for some code that I want to wrap. 2) eliminate the "PyVTKClass" type, which relies on an obsolete metaclass mechanism (search for "Don Beaudry hack" if you're curious) and instead use python's unified type/class extension system. For #2, I'll see if I can put up a wiki page with more detail. But I don't have time to move forward on either 1 or 2 until the fall. And you aren't going to see me pushing for py3k, because I still have no need for it myself. I just want to be involved when the conversion occurs, because wrapper stuff is fun. - David On Fri, Aug 1, 2014 at 8:11 AM, Berk Geveci wrote: > Hi David and others, > > I don't think that this workflow would work for us. Most of our > collaborators, specially in the supercomputing community, are going to take > a while longer to move to Python 3. So as a team, we need to continue to do > our day-to-day work using Python 2. So having to go through a 3-to-2 > conversion mechanism would be very cumbersome. We would have to regularly > maintain 2 builds, do the development in 3 then move to the 2 build, test > etc. > > I suggest taking smaller steps. Starting with porting of the core modules > (not the tests) and seeing what will be involved in maintaining both 2 and 3 > versions (or a 2-to-3 conversion on the fly) would be my suggestion. Once we > can demonstrate the maintainability of this, I suspect that doing a 2-to-3 > conversion on the fly for the tests would be pretty easy. > > Best, > -berk > > > On Thu, Jul 31, 2014 at 4:15 PM, David Gobbi wrote: >> >> On Thu, Jul 31, 2014 at 6:44 AM, diego0020 >> wrote: >> > >> > But I am also looking forward to this. Is there anything we could do to >> > push >> > support for python 3 forward? >> >> There has been some discussion about converting all of the python >> tests and examples, which is a part of the process where extra >> manpower would be a big asset. I imagine that the conversion will >> go something like this: >> >> 1) Someone will run 2to3 on all the python code, and then make >> sure that it can be byte-compiled with python3 (it will be too early >> at this stage to actually run the code, but making sure that it >> byte-compiles will be a good first step). >> >> 2) Lots of people will then pick through the code to fix conversion >> errors and to make sure that the code actually looks like good >> python3 code. >> >> 3) Finally, someone will add some CMake magic to VTK so that if VTK >> is built against python2, cmake will run 3to2 on all of these new python3 >> files and put the equivalent python2 code into the VTK build >> directory. This is the magic that is needed to make sure that VTK >> will be able to support both python2 and python3. >> >> So any assistance with the above process would be a big help. In >> particular, it would be very useful if someone could verify that item >> (3) is even feasible: in the end it might be necessary to have hand- >> written python2 and python3 exist side-by-side instead of using >> automatic conversion. It _should_ be feasible, since the VTK >> tests used automated tcl-to-python conversion for many years, >> and python3 to python2 should be much easier than tcl to python. >> >> - David From dlrdave at aol.com Fri Aug 1 14:38:36 2014 From: dlrdave at aol.com (David Cole) Date: Fri, 1 Aug 2014 14:38:36 -0400 (EDT) Subject: [vtkusers] Status of VTK Python 3 wrapper support Message-ID: <8D17BCEF03FAF94-1724-2A181@webmail-vm082.sysops.aol.com> > ... because I still have no need for it myself. I > just want to be involved when the conversion occurs, because wrapper > stuff is fun. You realize this is a kind of a sickness, right? ;-) (Just sayin'... I kind of have a bit of it myself...) From anuwat_boy at yahoo.com Sat Aug 2 01:16:16 2014 From: anuwat_boy at yahoo.com (Anuwat Dechvijankit) Date: Fri, 1 Aug 2014 22:16:16 -0700 Subject: [vtkusers] Wrong BoundaryEdge output from vtkFeatureEdges Message-ID: <1406956576.75135.YahooMailNeo@web121506.mail.ne1.yahoo.com> Hi all vtkusers, First post here. I have wrong output result from vtkFeatureEdges filtering BoundaryEdge only. (on vtk 6.1? x64 windows 8.1) here is sample code: #include #include #include #include #include #include int _tmain(int argc, _TCHAR* argv[]) { ??? vtkSmartPointer planeSource = vtkSmartPointer::New();??? ??? planeSource->SetXResolution(4); ??? planeSource->SetYResolution(4); ??? planeSource->SetCenter(0,0,0); ??? planeSource->SetNormal(0.0, 0.0, 1.0); ??? planeSource->Update();??? ??? vtkSmartPointer polydata =? planeSource->GetOutput(); ??? std::cout << "Total points:" <GetNumberOfPoints() << endl; ??? for (int i = 0; i < polydata->GetNumberOfPoints(); i++) ??? { ??? ??? double pt[3]; ??? ??? polydata->GetPoint(i , pt); ??? ??? std::cout << "Point:" < borderEdges = vtkSmartPointer::New(); ??? borderEdges->SetInputConnection(planeSource->GetOutputPort()); ??? borderEdges->FeatureEdgesOff();??? ??? borderEdges->ManifoldEdgesOff(); ??? borderEdges->NonManifoldEdgesOff(); ??? borderEdges->ColoringOff(); ??? borderEdges->BoundaryEdgesOn(); ??? borderEdges->Update();??? ??? vtkSmartPointer lines= borderEdges->GetOutput()->GetLines(); ??? int numBorderEdges = lines->GetNumberOfCells();??? ??? std::cout << "Total border edges:" <GetOutput()->GetCell(i));??? ??? ??? ??? int numID = line->GetPointIds()->GetNumberOfIds(); ??? ??? int id0 = line->GetPointIds()->GetId(0); ??? ??? int id1 = line->GetPointIds()->GetId(1); ??? ??? std::cout << "B-edge:" << i <<"\t"<< numID <<"(" < From thedlacko at gmail.com Sat Aug 2 06:24:44 2014 From: thedlacko at gmail.com (Lacko) Date: Sat, 2 Aug 2014 03:24:44 -0700 (PDT) Subject: [vtkusers] how to use SetSampleDistance Message-ID: <1406975084308-5728070.post@n5.nabble.com> hello. i'm new to vtk. i have a project about volume rendering and i want to be able to change sample distance for dataset. i understand that i should use SetSampleDistance but i can't understand how to use it. i would appreciate some help. here is my code: #include "vtkSmartPointer.h" #include "vtkSLCReader.h" #include "vtkExtractVOI.h" #include "vtkContourFilter.h" #include "vtkPolyDataMapper.h" #include "vtkActor.h" #include "vtkProperty.h" #include "vtkOutlineFilter.h" #include "vtkRenderer.h" #include "vtkRenderWindow.h" #include "vtkRenderWindowInteractor.h" #include "vtkInteractorStyleTrackballCamera.h" #include "pathconfig.h" #include "vtkStructuredPointsReader.h" #include "vtkLookupTable.h" #include "vtkImageMapToColors.h" #include "vtkImageAlgorithm.h" #include "vtkProbeFilter.h" #include "vtkVolumeRayCastMapper.h" #include "vtkPolyDataPointSampler.h" #include "vtkVolume.h" #include "vtkVolumeRayCastIsosurfaceFunction.h" #define VTK_CREATE(type ,name) vtkSmartPointer name = vtkSmartPointer::New() int main() { filePathBuilder fpath; VTK_CREATE(vtkStructuredPointsReader, reader); reader->SetFileName(fpath.filePath("mummy.128.vtk")); VTK_CREATE(vtkLookupTable, lut_bone); lut_bone->SetNumberOfColors(256); lut_bone->SetTableRange(0, 255); lut_bone->SetHueRange(0,1); lut_bone->SetSaturationRange(0, 0); lut_bone->SetValueRange (0.0, 1.0); lut_bone->SetAlphaRange(1,1); lut_bone->Build(); VTK_CREATE(vtkLookupTable, lut_skin); lut_skin->SetNumberOfColors(256); lut_skin->SetTableRange(0, 255); lut_skin->SetHueRange(0,0); lut_skin->SetSaturationRange(0, 1); lut_skin->SetValueRange (0.0, 1); lut_skin->SetAlphaRange(0.6, 0.6);//0,6 lut_skin->Build(); VTK_CREATE(vtkImageMapToColors, iMtc_bone); iMtc_bone->SetLookupTable(lut_bone); iMtc_bone->SetInputConnection(reader->GetOutputPort()); VTK_CREATE(vtkImageMapToColors, iMtc_skin); iMtc_skin->SetLookupTable(lut_skin); iMtc_skin->SetInputConnection(reader->GetOutputPort()); VTK_CREATE(vtkContourFilter, bone_filter); bone_filter->SetInputConnection(reader->GetOutputPort()); bone_filter->SetNumberOfContours(1); bone_filter->SetValue(0,110.0);//110 VTK_CREATE(vtkContourFilter, skin_filter); skin_filter->SetInputConnection(reader->GetOutputPort()); skin_filter->SetNumberOfContours(1); skin_filter->SetValue(0,95.0); VTK_CREATE(vtkProbeFilter, probe_bone); probe_bone->SetInputConnection(bone_filter->GetOutputPort()); probe_bone->SetSourceConnection(iMtc_bone->GetOutputPort()); VTK_CREATE(vtkProbeFilter, probe_skin); probe_skin->SetInputConnection(skin_filter->GetOutputPort()); probe_skin->SetSourceConnection(iMtc_skin->GetOutputPort()); VTK_CREATE(vtkPolyDataMapper, skin_mapper); skin_mapper->SetInputConnection(skin_filter->GetOutputPort()); skin_mapper->ScalarVisibilityOff(); VTK_CREATE(vtkPolyDataMapper, bone_mapper); bone_mapper->SetInputConnection(probe_bone->GetOutputPort()); bone_mapper->SetLookupTable(lut_bone); bone_mapper->SetColorModeToMapScalars(); VTK_CREATE(vtkPolyDataMapper, skin_mapper); skin_mapper->SetInputConnection(probe_skin->GetOutputPort()); skin_mapper->SetLookupTable(lut_skin); skin_mapper->SetColorModeToMapScalars(); VTK_CREATE(vtkActor, bone_actor); bone_actor->SetMapper(bone_mapper); VTK_CREATE(vtkActor, skin_actor); skin_actor->SetMapper(skin_mapper); VTK_CREATE(vtkRenderer,ren); ren->AddActor(bone_actor); ren->AddActor(skin_actor); ren->SetBackground(0.2,0.2,0.2); VTK_CREATE(vtkRenderWindow,renw); renw->AddRenderer(ren); renw->SetSize(800,600); VTK_CREATE(vtkInteractorStyleTrackballCamera, style); VTK_CREATE(vtkRenderWindowInteractor, iren); iren->SetRenderWindow(renw); iren->SetInteractorStyle(style); iren->Initialize(); iren->Start(); return 0; } -- View this message in context: http://vtk.1045678.n5.nabble.com/how-to-use-SetSampleDistance-tp5728070.html Sent from the VTK - Users mailing list archive at Nabble.com. From s.jung at etri.re.kr Mon Aug 4 03:53:59 2014 From: s.jung at etri.re.kr (=?ks_c_5601-1987?B?waS8+MO2?=) Date: Mon, 4 Aug 2014 07:53:59 +0000 Subject: [vtkusers] Can't pick a moved actor using the vtkAreaPicker Message-ID: <609B4F1A4C4DC84E9933BB5490999C681DD8E96D@SMTP1.etri.info> Hello everyone, I found a problem that the vtkAreaPicker couldn?t pick a moved actor in my project. And I tested vtkAreaPicker using the example HighlightSelectedPoints.cxx. A modified version of HighlightSelectedPoints.cxx was attached. Before ?renderer->AddActor(actor)?, I just added ?actor->SetPosition(0.5, 0.5, 0)?. In the original version, two points were selected when I dragged like Selecting.png. But in the modified version, any points were not selected. After tracing the source codes related to vtkAreaPicker::AreaPick(), I found that it doesn?t consider vtkProp3D?s matrix unlike vtkPicker. Is this a bug of vtkAreaPicker?? Best Regards, Soonchul Jung -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: modHighlightSelectedPoints.cpp URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: OriginalVersion.png Type: image/png Size: 25323 bytes Desc: OriginalVersion.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Selecting.png Type: image/png Size: 26059 bytes Desc: Selecting.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: MovingActorVersion.png Type: image/png Size: 25425 bytes Desc: MovingActorVersion.png URL: From matthew.brett at gmail.com Mon Aug 4 15:22:37 2014 From: matthew.brett at gmail.com (Matthew Brett) Date: Mon, 4 Aug 2014 12:22:37 -0700 Subject: [vtkusers] Help building Python wheels for VTK Message-ID: Hi, I am sorry if this a developer question, but I wanted to ask for some help in building a Python wheel to install VTK with Python bindings. For anyone not deep into the current state of Python packing, Python wheels are a very simple zip-based installation format [1]. We've recently had very good success building wheels for OSX, so we can install all the main scientific Python packages quickly on OSX without a compiler [2] I'm now trying to work out how to make a wheel for VTK. This is very easy for a project with a 'setup.py' file, but I believe this isn't the case for VTK, and I don't know the cmake VTK build system well. So - is there a good place to go, to ask for help with this? Thanks a lot, Matthew [1] http://wheel.readthedocs.org/en/latest/ [2] https://github.com/MacPython/wiki/wiki/Spinning-wheels From allen at sci.utah.edu Mon Aug 4 16:12:17 2014 From: allen at sci.utah.edu (Allen Sanderson) Date: Mon, 4 Aug 2014 16:12:17 -0400 Subject: [vtkusers] Incompatible library version issue Message-ID: I have built VTK with support with R. That build went fine. Now I am linking against it with my app (VisIt) under OS X. However, I start VisIt but then it hangs because of a library version issue. The VisIt viewer wants 6.1.0 of the vtkpng library but thinks it is getting 1.0.0. However, otool says vtkpng is 6.1.0. I am not sure why there is an issue but it is odd?? Could it be that internal to the library there is some other setting that is causing the issue? 132% bin/visit dyld: Library not loaded: /Projects/VisIt/trunk/visit/vtk-r/6.1.0/i386-apple-darwin12_gcc-4.2/lib/libvtkpng-6.1.1.dylib Referenced from: /Projects/VisIt/trunk/src/exe/viewer.app/Contents/MacOS/viewer Reason: Incompatible library version: viewer requires version 6.1.0 or later, but libvtkpng-6.1.1.dylib provides version 1.0.0 133% otool -L /Projects/VisIt/trunk/visit/vtk-r/6.1.0/i386-apple-darwin12_gcc-4.2/lib/libvtkpng-6.1.1.dylib /Projects/VisIt/trunk/visit/vtk-r/6.1.0/i386-apple-darwin12_gcc-4.2/lib/libvtkpng-6.1.1.dylib: /Projects/VisIt/trunk/visit/vtk-r/6.1.0/i386-apple-darwin12_gcc-4.2/lib/libvtkpng-6.1.1.dylib (compatibility version 6.1.0, current version 6.1.0) /Projects/VisIt/trunk/visit/vtk-r/6.1.0/i386-apple-darwin12_gcc-4.2/lib/libvtkzlib-6.1.1.dylib (compatibility version 6.1.0, current version 6.1.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0) I should note that I have built and used VTK without R support and did not have any issues. But at a loss on this issue. Any pointers would be helpful. Cheers, Allen Allen Sanderson SCI Institute University of Utah www.sci.utah.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: From allen at sci.utah.edu Mon Aug 4 17:10:39 2014 From: allen at sci.utah.edu (Allen Sanderson) Date: Mon, 4 Aug 2014 17:10:39 -0400 Subject: [vtkusers] Incompatible library version issue In-Reply-To: References: Message-ID: FWIW I found the issue ? When I built VTK with the R version, the VTK-6.1.0-build directory which was used previously without R should have blown away because it got corrupted. As such, the new version got installed into /usr/local/ which and had screwed up compatibility versions. I eventually did blow it away and build it correctly but the libs in /usr/local/ were taking precedence thus a mixed lib versions. Cheers, Allen Allen Sanderson SCI Institute University of Utah www.sci.utah.edu On Aug 4, 2014, at 4:12 PM, Allen Sanderson wrote: > I have built VTK with support with R. That build went fine. Now I am linking against it with my app (VisIt) under OS X. However, I start VisIt but then it hangs because of a library version issue. The VisIt viewer wants 6.1.0 of the vtkpng library but thinks it is getting 1.0.0. > > However, otool says vtkpng is 6.1.0. I am not sure why there is an issue but it is odd?? Could it be that internal to the library there is some other setting that is causing the issue? > > > 132% bin/visit > > dyld: Library not loaded: /Projects/VisIt/trunk/visit/vtk-r/6.1.0/i386-apple-darwin12_gcc-4.2/lib/libvtkpng-6.1.1.dylib > > Referenced from: /Projects/VisIt/trunk/src/exe/viewer.app/Contents/MacOS/viewer > > Reason: Incompatible library version: viewer requires version 6.1.0 or later, but libvtkpng-6.1.1.dylib provides version 1.0.0 > > > 133% otool -L /Projects/VisIt/trunk/visit/vtk-r/6.1.0/i386-apple-darwin12_gcc-4.2/lib/libvtkpng-6.1.1.dylib > > /Projects/VisIt/trunk/visit/vtk-r/6.1.0/i386-apple-darwin12_gcc-4.2/lib/libvtkpng-6.1.1.dylib: > > /Projects/VisIt/trunk/visit/vtk-r/6.1.0/i386-apple-darwin12_gcc-4.2/lib/libvtkpng-6.1.1.dylib (compatibility version 6.1.0, current version 6.1.0) > > /Projects/VisIt/trunk/visit/vtk-r/6.1.0/i386-apple-darwin12_gcc-4.2/lib/libvtkzlib-6.1.1.dylib (compatibility version 6.1.0, current version 6.1.0) > > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0) > > > I should note that I have built and used VTK without R support and did not have any issues. But at a loss on this issue. Any pointers would be helpful. > > Cheers, > > Allen > > > Allen Sanderson > SCI Institute > University of Utah > www.sci.utah.edu > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From kim.rosenbohm at posteo.de Tue Aug 5 08:28:37 2014 From: kim.rosenbohm at posteo.de (Kim Rosenbohm) Date: Tue, 05 Aug 2014 14:28:37 +0200 Subject: [vtkusers] vtkImageDataGeometryFilter problem Message-ID: <9d4fb259c5f8cca58467ceadefaf6c2b@posteo.de> Hi All. Though nobody responded to my previous question, I'll try again with a different problem: I have a pipeline for masking out areas in a 2D image and turning the image data into a 3D surface: ... vtkSmartPointer< vtkImageResample > m_surfaceResampled; vtkSmartPointer< vtkImageResample > m_maskResampled; vtkSmartPointer< vtkImageMask > m_maskMask; vtkSmartPointer< vtkImageDataGeometryFilter > m_surfaceGeoFilter; vtkSmartPointer< vtkWarpScalar > m_surfaceWarpFilter; //use a vtkImageMask to remove masked-out stuff from an image m_maskMask->SetInputConnection(0, m_surfaceResampled->GetOutputPort()); m_maskMask->SetInputConnection(1, m_maskResampled->GetOutputPort()); m_maskMask->SetMaskedOutputValue(-10000); //m_maskMask->SetMaskAlpha(0.0); //setup filter creating geometry from image/height data m_surfaceGeoFilter->SetInputConnection(m_maskMask->GetOutputPort()); //setup masking out of cells marked in mask m_surfaceGeoFilter->ThresholdCellsOn(); m_surfaceGeoFilter->SetThresholdValue(*m_maskMask->GetMaskedOutputValue()); m_surfaceGeoFilter->ThresholdValueOn(); //pass geometry to scale surface z-axis height m_surfaceWarpFilter->SetInputConnection(m_surfaceGeoFilter->GetOutputPort()); m_surfaceWarpFilter->SetScaleFactor(1.0); ... This works ok for positive values in m_surfaceResampled, but not if I only have negative values there. Then I get no surface at all... Why? Additionally an eleborate explanation of what ThresholdCELLS and ThresholdVALUE do and how they interact would be nice. The documentation is not dummy-proof enough for me there... Best Regards, Kim -------------- next part -------------- An HTML attachment was scrubbed... URL: From daroukh at cerfacs.fr Tue Aug 5 08:39:10 2014 From: daroukh at cerfacs.fr (Majd Daroukh) Date: Tue, 5 Aug 2014 14:39:10 +0200 Subject: [vtkusers] How to do a cut based on a surface of revolution with VTK? Message-ID: Hi everybody, I am a new VTK user and I would like to do a cut based on a surface of revolution. From a set of couples (x, r), I have to create the vtkImplicitFunction corresponding to the surface obtained by revolution from the line going through all these points. This vtkImplicitFunction will then be applied to cut my vtkDataObject. Does anybody have an idea of how to create this vtkImplicitFunction? Thanks in advance, Majd From martin.affolter at ntb.ch Tue Aug 5 10:02:17 2014 From: martin.affolter at ntb.ch (Affolter Martin) Date: Tue, 5 Aug 2014 14:02:17 +0000 Subject: [vtkusers] subclassing with VTK 6.1 Message-ID: <41A97F3464883247A39A022E96C3DD50925BF619@mail-server.ntb.ch> Hello vtkusers, I'm trying to get our projects up and running on vtk 6.1 (from 5.10.1). After successfully initializing the modules used to render with OpenGL (with the VTK_MODULE_INIT Macro) I am now having some issues with our own vtk subclasses and factories. I used to register an object factory to create my own actor type (CCOpenGLActor) instead of the vtkOpenGLActor, which used to work with 5.10.1. Now, an instance of vtkOpenGLActor is created instead. So far, I've tried to use the vtkObjectFactoryNewMacro instead of the vtkStandardNewMacro for my subclasses, which should create the object through my registered factory if I understood correctly. However, it doesn't change anything. Do I need to rebuild the vtk-binaries with the option VTK_ALL_NEW_OBJECT_FACTORY for it to work? Best regards, Martin Affolter MSc FHO in Engineering Wissenschaftlicher Mitarbeiter ___________________________________________ NTB Interstaatliche Hochschule f?r Technik Buchs Institut f?r Ingenieurinformatik Sch?nauweg 4 CH-9013 St. Gallen Tel: +41 81 755 32 49 Web: http://www.ntb.ch -------------- next part -------------- An HTML attachment was scrubbed... URL: From martin.affolter at ntb.ch Tue Aug 5 11:39:38 2014 From: martin.affolter at ntb.ch (Affolter Martin) Date: Tue, 5 Aug 2014 15:39:38 +0000 Subject: [vtkusers] subclassing with VTK 6.1 In-Reply-To: <41A97F3464883247A39A022E96C3DD50925BF619@mail-server.ntb.ch> References: <41A97F3464883247A39A022E96C3DD50925BF619@mail-server.ntb.ch> Message-ID: <41A97F3464883247A39A022E96C3DD50925BF64E@mail-server.ntb.ch> I've rebuilt the binaries with the option VTK_ALL_NEW_OBJECT_FACTORY activated and now my object-factory seems to work. Since this has to be activated, I wonder if there is a new/better way to create your own subclasses in VTK 6. Is there? Von: vtkusers [mailto:vtkusers-bounces at vtk.org] Im Auftrag von Affolter Martin Gesendet: Dienstag, 5. August 2014 16:08 An: VTK Users (vtkusers at vtk.org) Betreff: [vtkusers] subclassing with VTK 6.1 Hello vtkusers, I'm trying to get our projects up and running on vtk 6.1 (from 5.10.1). After successfully initializing the modules used to render with OpenGL (with the VTK_MODULE_INIT Macro) I am now having some issues with our own vtk subclasses and factories. I used to register an object factory to create my own actor type (CCOpenGLActor) instead of the vtkOpenGLActor, which used to work with 5.10.1. Now, an instance of vtkOpenGLActor is created instead. So far, I've tried to use the vtkObjectFactoryNewMacro instead of the vtkStandardNewMacro for my subclasses, which should create the object through my registered factory if I understood correctly. However, it doesn't change anything. Do I need to rebuild the vtk-binaries with the option VTK_ALL_NEW_OBJECT_FACTORY for it to work? Best regards, Martin Affolter MSc FHO in Engineering Wissenschaftlicher Mitarbeiter ___________________________________________ NTB Interstaatliche Hochschule f?r Technik Buchs Institut f?r Ingenieurinformatik Sch?nauweg 4 CH-9013 St. Gallen Tel: +41 81 755 32 49 Web: http://www.ntb.ch -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.hammons at inaf.cnrs-gif.fr Tue Aug 5 12:28:26 2014 From: mark.hammons at inaf.cnrs-gif.fr (Mark Edgar Hammons II) Date: Tue, 05 Aug 2014 18:28:26 +0200 Subject: [vtkusers] VTK and JavaFX? Message-ID: <2176973.Iq96Pn6YAV@localhost.localdomain> Has anyone tested vtk and javafx compatibility yet? I'm using 5.10, and nothing but the regular java swing components are rendered when I embed this class[1] into a javafx scene using SwingNode: > import javafx.application.Application; > import javafx.embed.swing.SwingNode; > import javafx.scene.Scene; > import javafx.scene.layout.StackPane; > import javafx.stage.Stage; > > import javax.swing.*; > > public class SwingFx extends Application { > > @Override > public void start(Stage stage) { > > final SwingNode swingNode = new SwingNode(); > createAndSetSwingContent(swingNode); > > StackPane pane = new StackPane(); > pane.getChildren().add(swingNode); > > stage.setScene(new Scene(pane, 100, 50)); > stage.show(); > } > > private void createAndSetSwingContent(final SwingNode swingNode) { > SwingUtilities.invokeLater(new Runnable() { > @Override > public void run() { > swingNode.setContent(new SimpleVTK()); > } > }); > } > > public static void main(String[] args) { > launch(args); > } > } I'm testing on my side with openJFX so I can't be sure that this doesn't work with javafx proper just yet. I'll try with the regular oracle jvm later today/tomorrow. Has there been any efforts to make vtkPanel and vtkCanvas work with javafx yet though? -------- [1] https://github.com/jeffbaumes/jeffbaumes-vtk/blob/master/Wrapping/Java/SimpleVTK.java -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.jourdain at kitware.com Tue Aug 5 13:59:24 2014 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Tue, 5 Aug 2014 11:59:24 -0600 Subject: [vtkusers] VTK and JavaFX? In-Reply-To: <2176973.Iq96Pn6YAV@localhost.localdomain> References: <2176973.Iq96Pn6YAV@localhost.localdomain> Message-ID: I've never played with JavaFX and VTK, but someone in the community may have... On Tue, Aug 5, 2014 at 10:28 AM, Mark Edgar Hammons II < mark.hammons at inaf.cnrs-gif.fr> wrote: > Has anyone tested vtk and javafx compatibility yet? I'm using 5.10, and > nothing but the regular java swing components are rendered when I embed this > class > > into a javafx scene using SwingNode: > > > > > import javafx.application.Application; > > > import javafx.embed.swing.SwingNode; > > > import javafx.scene.Scene; > > > import javafx.scene.layout.StackPane; > > > import javafx.stage.Stage; > > > > > > import javax.swing.*; > > > > > > public class SwingFx extends Application { > > > > > > @Override > > > public void start(Stage stage) { > > > > > > final SwingNode swingNode = new SwingNode(); > > > createAndSetSwingContent(swingNode); > > > > > > StackPane pane = new StackPane(); > > > pane.getChildren().add(swingNode); > > > > > > stage.setScene(new Scene(pane, 100, 50)); > > > stage.show(); > > > } > > > > > > private void createAndSetSwingContent(final SwingNode swingNode) { > > > SwingUtilities.invokeLater(new Runnable() { > > > @Override > > > public void run() { > > > swingNode.setContent(new SimpleVTK()); > > > } > > > }); > > > } > > > > > > public static void main(String[] args) { > > > launch(args); > > > } > > > } > > > > I'm testing on my side with openJFX so I can't be sure that this doesn't > work with javafx proper just yet. I'll try with the regular oracle jvm > later today/tomorrow. Has there been any efforts to make vtkPanel and > vtkCanvas work with javafx yet though? > > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From taylor at braun-jones.org Tue Aug 5 14:50:02 2014 From: taylor at braun-jones.org (Taylor Braun-Jones) Date: Tue, 5 Aug 2014 14:50:02 -0400 Subject: [vtkusers] Help building Python wheels for VTK In-Reply-To: References: Message-ID: I don't have an answer for you, but when you figure it out, would you be willing to share the wheels the build recipe so that the Python vtk package can be made available and maintained on PyPi (and installable via pip)? Thanks and good luck! Taylor On Mon, Aug 4, 2014 at 3:22 PM, Matthew Brett wrote: > Hi, > > I am sorry if this a developer question, but I wanted to ask for some > help in building a Python wheel to install VTK with Python bindings. > > For anyone not deep into the current state of Python packing, Python > wheels are a very simple zip-based installation format [1]. > > We've recently had very good success building wheels for OSX, so we > can install all the main scientific Python packages quickly on OSX > without a compiler [2] > > I'm now trying to work out how to make a wheel for VTK. This is very > easy for a project with a 'setup.py' file, but I believe this isn't > the case for VTK, and I don't know the cmake VTK build system well. > So - is there a good place to go, to ask for help with this? > > Thanks a lot, > > Matthew > > [1] http://wheel.readthedocs.org/en/latest/ > [2] https://github.com/MacPython/wiki/wiki/Spinning-wheels > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.hammons at inaf.cnrs-gif.fr Tue Aug 5 14:58:50 2014 From: mark.hammons at inaf.cnrs-gif.fr (Mark Edgar Hammons II) Date: Tue, 05 Aug 2014 20:58:50 +0200 Subject: [vtkusers] VTK and JavaFX? In-Reply-To: <2BD60224-2B0F-494B-B582-E9FA97B628A4@pasteur.fr> References: <2176973.Iq96Pn6YAV@localhost.localdomain> <2BD60224-2B0F-494B-B582-E9FA97B628A4@pasteur.fr> Message-ID: <70365181.9MZ1cpG9GF@localhost.localdomain> Yeah, on linux with openjfx, i'd get a blank grey square where the vtkpanel should be, and if I did certain operations (like when displaying a vtk, if I adjusted the slice shown), it'd crash with a segfault. I found this ticket on jogamp (https://jogamp.org/bugzilla/show_bug.cgi?id=607#c13). Maybe it can provide some insight into getting this working... On Tuesday, August 05, 2014 06:37:46 PM Alexandre Dufour wrote: Hi, For what it?s worth, I?ve tried running your code sample with Oracle?s JDK 8 on Mac, and it crashes just after the window opens. This is perhaps more a Mac-related issue though? JavaVM WARNING: JAWT_GetAWT must be called after loading a JVM JavaVM WARNING: JAWT_GetAWT must be called after loading a JVM JavaVM WARNING: JAWT_GetAWT must be called after loading a JVM JavaVM WARNING: JAWT_GetAWT must be called after loading a JVM JavaVM WARNING: JAWT_GetAWT must be called after loading a JVM JavaVM WARNING: JAWT_GetAWT must be called after loading a JVM Exception in thread "AppKit Thread" java.lang.StackOverflowError at vtk.vtkRenderWindow.Render_9(_Native Method_) at vtk.vtkRenderWindow.Render(_vtkRenderWindow.java:52_) at vtk.vtkPanel.Render(_vtkPanel.java:174_) at vtk.vtkPanel.paint(_vtkPanel.java:186_) at javax.swing.JComponent.paintChildren(_JComponent.java:900_) at javax.swing.JComponent.paint(_JComponent.java:1062_) at javax.swing.JComponent.paintChildren(_JComponent.java:886_) at javax.swing.JComponent.paint(_JComponent.java:1062_) at sun.swing.JLightweightFrame$3.paint(_JLightweightFrame.java:220_) at javax.swing.JComponent.paintChildren(_JComponent.java:886_) at javax.swing.JComponent.paint(_JComponent.java:1062_) at javax.swing.JLayeredPane.paint(_JLayeredPane.java:586_) at javax.swing.JComponent.paintChildren(_JComponent.java:886_) at javax.swing.JComponent.paint(_JComponent.java:1062_) at java.awt.GraphicsCallback$PaintCallback.run(_GraphicsCallback.java:39_) at sun.awt.SunGraphicsCallback.runOneComponent(_SunGraphicsCallback.java:79_) at sun.awt.SunGraphicsCallback.runComponents(_SunGraphicsCallback.java:116_) at java.awt.Container.paint(_Container.java:1973_) at java.awt.Window.paint(_Window.java:3901_) at java.awt.Container.update(_Container.java:1993_) at sun.awt.RepaintArea.updateComponent(_RepaintArea.java:255_) at sun.lwawt.LWRepaintArea.updateComponent(_LWRepaintArea.java:47_) at sun.awt.RepaintArea.paint(_RepaintArea.java:232_) at sun.lwawt.LWComponentPeer.handleJavaPaintEvent(_LWComponentPeer.java:1312_) at sun.lwawt.LWComponentPeer.handleEvent(_LWComponentPeer.java:1196_) at java.awt.Component.dispatchEventImpl(_Component.java:4959_) at java.awt.Container.dispatchEventImpl(_Container.java:2292_) at java.awt.Window.dispatchEventImpl(_Window.java:2739_) at java.awt.Component.dispatchEvent(_Component.java:4705_) at java.awt.EventQueue.dispatchEventImpl(_EventQueue.java:746_) at java.awt.EventQueue.access$400(_EventQueue.java:97_) at java.awt.EventQueue$3.run(_EventQueue.java:697_) at java.awt.EventQueue$3.run(_EventQueue.java:691_) at java.security.AccessController.doPrivileged(_Native Method_) at java.security.ProtectionDomain$1.doIntersectionPrivilege(_ProtectionDomain.java:75_) at java.security.ProtectionDomain$1.doIntersectionPrivilege(_ProtectionDomain.java:86_) at java.awt.EventQueue$4.run(_EventQueue.java:719_) at java.awt.EventQueue$4.run(_EventQueue.java:717_) at java.security.AccessController.doPrivileged(_Native Method_) at java.security.ProtectionDomain$1.doIntersectionPrivilege(_ProtectionDomain.java:75_) at java.awt.EventQueue.dispatchEvent(_EventQueue.java:716_) at java.awt.EventDispatchThread.pumpOneEventForFilters(_EventDispatchThread.java:201_) at java.awt.EventDispatchThread.pumpEventsForFilter(_EventDispatchThread.java:116_) at java.awt.EventDispatchThread.pumpEventsForHierarchy(_EventDispatchThread.java:105_) at java.awt.EventDispatchThread.pumpEvents(_EventDispatchThread.java:101_) at java.awt.EventDispatchThread.pumpEvents(_EventDispatchThread.java:93_) at java.awt.EventDispatchThread.run(_EventDispatchThread.java:82_) 2014-08-05 18:33:12.356 java[31807:c203] Apple AWT Internal Exception: *** Collection <__NSSetM: 0x7fba5368c5e0> was mutated while being enumerated. 2014-08-05 18:33:12.357 java[31807:c203] *** Terminating app due to uncaught exception 'NSGenericException', reason: '*** Collection <__NSSetM: 0x7fba5368c5e0> was mutated while being enumerated.' *** First throw call stack: ( 0 CoreFoundation 0x00007fff95e9c25c __exceptionPreprocess + 172 1 libobjc.A.dylib 0x00007fff90795e75 objc_exception_throw + 43 2 CoreFoundation 0x00007fff95e9bb64 __NSFastEnumerationMutationHandler + 164 3 AppKit 0x00007fff91b57c23 -[NSView trackingAreas] + 237 4 AppKit 0x00007fff91c77e0c -[NSView(NSInternal) _enableOrDisableTrackingAreas] + 93 5 AppKit 0x00007fff91c81fb1 -[NSView _windowChangedKeyState] + 850 6 AppKit 0x00007fff91c825a9 -[NSControl _windowChangedKeyState] + 47 7 AppKit 0x00007fff91c81d9e -[NSView _windowChangedKeyState] + 319 8 AppKit 0x00007fff91c81bcb -[NSFrameView _windowChangedKeyState] + 95 9 AppKit 0x00007fff91c8171b -[NSWindow _setFrameNeedsDisplay:] + 162 10 AppKit 0x00007fff91d7cc44 -[NSWindow resignMainWindow] + 180 11 AppKit 0x00007fff91c80266 -[NSWindow _changeKeyAndMainLimitedOK:] + 851 12 AppKit 0x00007fff91c78706 -[NSWindow _makeKeyRegardlessOfVisibility] + 100 13 AppKit 0x00007fff91c78670 -[NSWindow makeKeyAndOrderFront:] + 29 -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Tue Aug 5 14:52:44 2014 From: dave.demarle at kitware.com (David E DeMarle) Date: Tue, 5 Aug 2014 14:52:44 -0400 Subject: [vtkusers] Help building Python wheels for VTK In-Reply-To: References: Message-ID: +1 I don't have an answer yet either, but I will try and find some time to look on my side too. Simplification of the packaging and distribution hassles is an ongoing (but often neglected) goal here at Kitware. David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Tue, Aug 5, 2014 at 2:50 PM, Taylor Braun-Jones wrote: > I don't have an answer for you, but when you figure it out, would you be > willing to share the wheels the build recipe so that the Python vtk package > can be made available and maintained on PyPi (and installable via pip)? > > Thanks and good luck! > > Taylor > > > On Mon, Aug 4, 2014 at 3:22 PM, Matthew Brett > wrote: > >> Hi, >> >> I am sorry if this a developer question, but I wanted to ask for some >> help in building a Python wheel to install VTK with Python bindings. >> >> For anyone not deep into the current state of Python packing, Python >> wheels are a very simple zip-based installation format [1]. >> >> We've recently had very good success building wheels for OSX, so we >> can install all the main scientific Python packages quickly on OSX >> without a compiler [2] >> >> I'm now trying to work out how to make a wheel for VTK. This is very >> easy for a project with a 'setup.py' file, but I believe this isn't >> the case for VTK, and I don't know the cmake VTK build system well. >> So - is there a good place to go, to ask for help with this? >> >> Thanks a lot, >> >> Matthew >> >> [1] http://wheel.readthedocs.org/en/latest/ >> [2] https://github.com/MacPython/wiki/wiki/Spinning-wheels >> _______________________________________________ >> 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 >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> > > > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Tue Aug 5 16:52:10 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 5 Aug 2014 14:52:10 -0600 Subject: [vtkusers] Help building Python wheels for VTK In-Reply-To: References: Message-ID: What information does wheels need? Just a manifest? On Tue, Aug 5, 2014 at 12:52 PM, David E DeMarle wrote: > +1 > > I don't have an answer yet either, but I will try and find some time to look > on my side too. Simplification of the packaging and distribution hassles is > an ongoing (but often neglected) goal here at Kitware. > > > David E DeMarle > Kitware, Inc. > R&D Engineer > 21 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-881-4909 > > > On Tue, Aug 5, 2014 at 2:50 PM, Taylor Braun-Jones > wrote: >> >> I don't have an answer for you, but when you figure it out, would you be >> willing to share the wheels the build recipe so that the Python vtk package >> can be made available and maintained on PyPi (and installable via pip)? >> >> Thanks and good luck! >> >> Taylor >> >> >> On Mon, Aug 4, 2014 at 3:22 PM, Matthew Brett >> wrote: >>> >>> Hi, >>> >>> I am sorry if this a developer question, but I wanted to ask for some >>> help in building a Python wheel to install VTK with Python bindings. >>> >>> For anyone not deep into the current state of Python packing, Python >>> wheels are a very simple zip-based installation format [1]. >>> >>> We've recently had very good success building wheels for OSX, so we >>> can install all the main scientific Python packages quickly on OSX >>> without a compiler [2] >>> >>> I'm now trying to work out how to make a wheel for VTK. This is very >>> easy for a project with a 'setup.py' file, but I believe this isn't >>> the case for VTK, and I don't know the cmake VTK build system well. >>> So - is there a good place to go, to ask for help with this? >>> >>> Thanks a lot, >>> >>> Matthew >>> >>> [1] http://wheel.readthedocs.org/en/latest/ >>> [2] https://github.com/MacPython/wiki/wiki/Spinning-wheels From tottek at gmail.com Tue Aug 5 18:15:38 2014 From: tottek at gmail.com (Totte Karlsson) Date: Tue, 5 Aug 2014 15:15:38 -0700 (PDT) Subject: [vtkusers] Minimal Build Message-ID: <1407276938469-5728090.post@n5.nabble.com> Hi, How does one create a minimal VTK build? I have unchecked almost everything in CMake when creating build files, but even then it seems that almost everything is being built. Only thing I have checked is "vtk group rendering". For example geovis and infovis are unchecked but they are still being built. I'm using the borland CMake generator and are building static libs Cheers, Totte -- View this message in context: http://vtk.1045678.n5.nabble.com/Minimal-Build-tp5728090.html Sent from the VTK - Users mailing list archive at Nabble.com. From dave.demarle at kitware.com Tue Aug 5 18:23:38 2014 From: dave.demarle at kitware.com (David E DeMarle) Date: Tue, 5 Aug 2014 18:23:38 -0400 Subject: [vtkusers] Minimal Build In-Reply-To: <1407276938469-5728090.post@n5.nabble.com> References: <1407276938469-5728090.post@n5.nabble.com> Message-ID: BUILD_TESTING is off or on? VTK_WRAP_? is off or on? VTK_Group_StandAlone is off or on? David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Tue, Aug 5, 2014 at 6:15 PM, Totte Karlsson wrote: > Hi, > How does one create a minimal VTK build? > > I have unchecked almost everything in CMake when creating build files, but > even then it seems that almost everything is being built. > > Only thing I have checked is "vtk group rendering". > > For example geovis and infovis are unchecked but they are still being > built. > I'm using the borland CMake generator and are building static libs > > Cheers, > Totte > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Minimal-Build-tp5728090.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Tue Aug 5 18:40:18 2014 From: dave.demarle at kitware.com (David E DeMarle) Date: Tue, 5 Aug 2014 18:40:18 -0400 Subject: [vtkusers] Minimal Build In-Reply-To: References: <1407276938469-5728090.post@n5.nabble.com> Message-ID: Not sure how Infovis is sneaking in. When you configure your build, cmake spits out all the enabled modules and tells you why. Look there. Geovis is in Group_Rendering for some reason. So you have to turn off Group_Rendering too. Then in the advanced cmake options page turn on only the specific modules you are interested in. Definitely turn testing off as well. The regression tests (many of which do rendered image comparisons) bring in more modules. There is another cmake flag to prevent that but the name escapes me right now. David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Tue, Aug 5, 2014 at 6:23 PM, David E DeMarle wrote: > BUILD_TESTING is off or on? > VTK_WRAP_? is off or on? > VTK_Group_StandAlone is off or on? > > > David E DeMarle > Kitware, Inc. > R&D Engineer > 21 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-881-4909 > > > On Tue, Aug 5, 2014 at 6:15 PM, Totte Karlsson wrote: > >> Hi, >> How does one create a minimal VTK build? >> >> I have unchecked almost everything in CMake when creating build files, but >> even then it seems that almost everything is being built. >> >> Only thing I have checked is "vtk group rendering". >> >> For example geovis and infovis are unchecked but they are still being >> built. >> I'm using the borland CMake generator and are building static libs >> >> Cheers, >> Totte >> >> >> >> -- >> View this message in context: >> http://vtk.1045678.n5.nabble.com/Minimal-Build-tp5728090.html >> Sent from the VTK - Users mailing list archive at Nabble.com. >> _______________________________________________ >> 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 >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tottek at gmail.com Tue Aug 5 18:55:53 2014 From: tottek at gmail.com (Totte Karlsson) Date: Tue, 5 Aug 2014 15:55:53 -0700 (PDT) Subject: [vtkusers] Minimal Build In-Reply-To: References: <1407276938469-5728090.post@n5.nabble.com> Message-ID: <1407279352994-5728093.post@n5.nabble.com> Thanks for the feedback. BUILD_TESTING is off or on? OFF VTK_WRAP_? is off or on? OFF VTK_Group_StandAlone is off or on? OFF And thanks for the tip to turning OFF vtk group_rendering and then enabling individual modules. I thought for some reason the rendering groups was required. I believe this will help in getting a faster build experience :) I'll report back.. tk -- View this message in context: http://vtk.1045678.n5.nabble.com/Minimal-Build-tp5728090p5728093.html Sent from the VTK - Users mailing list archive at Nabble.com. From andrew.amaclean at gmail.com Tue Aug 5 19:32:03 2014 From: andrew.amaclean at gmail.com (Andrew Maclean) Date: Wed, 6 Aug 2014 09:32:03 +1000 Subject: [vtkusers] VTK Code Formatting Styles Message-ID: Has anyone got: 1) A code style for QT Creator for VTK? 2) Also one for Eclipse? If so would they be willing to share/put up in the Wiki? Thanks Andrew -- ___________________________________________ Andrew J. P. Maclean ___________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From tottek at gmail.com Tue Aug 5 20:35:24 2014 From: tottek at gmail.com (Totte Karlsson) Date: Tue, 5 Aug 2014 17:35:24 -0700 (PDT) Subject: [vtkusers] Minimal Build In-Reply-To: <1407279352994-5728093.post@n5.nabble.com> References: <1407276938469-5728090.post@n5.nabble.com> <1407279352994-5728093.post@n5.nabble.com> Message-ID: <1407285324996-5728096.post@n5.nabble.com> Following the advice in this thread considerably reduce compile time! That is, BUILD_TESTING - > off VTK_WRAP_ ->OFF VTK_Group_StandAlone -> Off and manually select needed modules -tk -- View this message in context: http://vtk.1045678.n5.nabble.com/Minimal-Build-tp5728090p5728096.html Sent from the VTK - Users mailing list archive at Nabble.com. From tottek at gmail.com Tue Aug 5 20:38:44 2014 From: tottek at gmail.com (Totte Karlsson) Date: Tue, 5 Aug 2014 17:38:44 -0700 (PDT) Subject: [vtkusers] Borland complain Message-ID: <1407285524319-5728097.post@n5.nabble.com> I'm trying to compile 6.1 with borland and is almost there I have a problem in vtkTypedArrayIterator.h at various places, e.g. line 127: vtkTypedDataArrayIterator operator++(int) { return vtkTypedDataArrayIterator(this->Data, this->Index++); } where I get the following error Error E2102 ..\Common\Core\vtkTypedDataArrayIterator.h 127: Cannot use template 'vtkTypedDataArrayIterator' without specifying specialization parameters in function operator vtkTypedDataArrayIterator::++(int) Anyone knowing if that can be fixed for the borland compiler?? -tk -- View this message in context: http://vtk.1045678.n5.nabble.com/Borland-complain-tp5728097.html Sent from the VTK - Users mailing list archive at Nabble.com. From dave.demarle at kitware.com Tue Aug 5 20:59:02 2014 From: dave.demarle at kitware.com (David E DeMarle) Date: Tue, 5 Aug 2014 20:59:02 -0400 Subject: [vtkusers] VTK Code Formatting Styles In-Reply-To: References: Message-ID: I use this for eclipse. David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Tue, Aug 5, 2014 at 7:32 PM, Andrew Maclean wrote: > Has anyone got: > 1) A code style for QT Creator for VTK? > 2) Also one for Eclipse? > If so would they be willing to share/put up in the Wiki? > > Thanks > Andrew > -- > ___________________________________________ > Andrew J. P. Maclean > > ___________________________________________ > > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: kw_eclipse_style.xml Type: text/xml Size: 17590 bytes Desc: not available URL: From andrew.amaclean at gmail.com Tue Aug 5 21:37:23 2014 From: andrew.amaclean at gmail.com (Andrew Maclean) Date: Wed, 6 Aug 2014 11:37:23 +1000 Subject: [vtkusers] VTK Code Formatting Styles In-Reply-To: References: Message-ID: Thanks David, This is much appreciated. Regards Andrew On Wed, Aug 6, 2014 at 10:59 AM, David E DeMarle wrote: > I use this for eclipse. > > > David E DeMarle > Kitware, Inc. > R&D Engineer > 21 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-881-4909 > > > On Tue, Aug 5, 2014 at 7:32 PM, Andrew Maclean > wrote: > >> Has anyone got: >> 1) A code style for QT Creator for VTK? >> 2) Also one for Eclipse? >> If so would they be willing to share/put up in the Wiki? >> >> Thanks >> Andrew >> -- >> ___________________________________________ >> Andrew J. P. Maclean >> >> ___________________________________________ >> >> _______________________________________________ >> 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 >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> > -- ___________________________________________ Andrew J. P. Maclean ___________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From lgazoni at gmail.com Tue Aug 5 22:09:11 2014 From: lgazoni at gmail.com (Leandro Gazoni) Date: Tue, 5 Aug 2014 23:09:11 -0300 Subject: [vtkusers] Get Id Ensigth Files (.case) Message-ID: Hello, I'd like read a Case file (ensigth) .case with parts and return any point id. Is There any example the follow? thanks. Leandro -------------- next part -------------- An HTML attachment was scrubbed... URL: From Alexander.Koeber at de.bosch.com Wed Aug 6 04:17:57 2014 From: Alexander.Koeber at de.bosch.com (Alex K.) Date: Wed, 6 Aug 2014 01:17:57 -0700 (PDT) Subject: [vtkusers] Set cursor to a vtkChart Message-ID: <1407313077244-5728103.post@n5.nabble.com> Hello, I am evaluating, if it is useful to create a software oscilloscope with VTK. Therefore I'd like to know, if it is possible to set a cursor in the vtkChartXY. The cursor should look something like this (the pink lines): https://documentation.devexpress.com/windowsforms/HelpResource.ashx%3Fhelp%3Dwindowsforms%26document%3Dimg17798.jpg If it is possible (it can be a "workaround solution" too) please let me know! Regards! Alex -- View this message in context: http://vtk.1045678.n5.nabble.com/Set-cursor-to-a-vtkChart-tp5728103.html Sent from the VTK - Users mailing list archive at Nabble.com. From francois.touvet at inria.fr Wed Aug 6 04:42:55 2014 From: francois.touvet at inria.fr (ftouvet) Date: Wed, 6 Aug 2014 01:42:55 -0700 (PDT) Subject: [vtkusers] Failed to update polydata - wxVTKRenderWindow.py In-Reply-To: <53CF7384.1050708@gmail.com> References: <53CF7384.1050708@gmail.com> Message-ID: <1407314575936-5728104.post@n5.nabble.com> Did you check you enter the if not self.GetUpdateRegion().IsEmpty() or self.__handle: loop in the Render() method? -- View this message in context: http://vtk.1045678.n5.nabble.com/Failed-to-update-polydata-wxVTKRenderWindow-py-tp5727947p5728104.html Sent from the VTK - Users mailing list archive at Nabble.com. From fabian.trobles at gmail.com Wed Aug 6 04:54:53 2014 From: fabian.trobles at gmail.com (Fabian Torres) Date: Wed, 6 Aug 2014 16:54:53 +0800 Subject: [vtkusers] Vtk Video Source Message-ID: Hi all I?ve connected a video frame grabber to my computer and I want to display the video using vtk. I notice there is a class called vtkVideoSource and I think this could be an option I can use. I have been looking for examples in the web but nothing seems to work for me. Is there any example that can be useful for what I want to do? Thanks -- Fabi?n Torres Robles Maestria en Ciencias en Ingenier?a Electr?nica Ingenier?a en Sistemas Electr?nicos tel. 58081280, 0445534661338 e-mail fabian.trobles at gmail.com, dae.wong at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From isimtic at gmail.com Wed Aug 6 07:11:28 2014 From: isimtic at gmail.com (=?UTF-8?B?QWhtZXQgRG/En2Fu?=) Date: Wed, 06 Aug 2014 14:11:28 +0300 Subject: [vtkusers] writing a filter with vtkPolyDataAlgorithm Message-ID: <53E20D60.6050209@gmail.com> hi, I can write filter with _*vtkPolyDataAlgorithm*__**__*. *_it checks input and if it is changed it call RequestData(). But what if I have another values that must be checked it it is changed or not then if it changed refresh output. how can I implement checking for my own values Kind Regards. Ahmet Do?an -------------- next part -------------- An HTML attachment was scrubbed... URL: From berk.geveci at kitware.com Wed Aug 6 07:25:51 2014 From: berk.geveci at kitware.com (Berk Geveci) Date: Wed, 6 Aug 2014 07:25:51 -0400 Subject: [vtkusers] Status of VTK Python 3 wrapper support In-Reply-To: References: <1406810682351-5728034.post@n5.nabble.com> Message-ID: Hi David, Sounds great. I am glad that you are hooked on the wrappers :-) You have done a lot of wonderful work on them and as a big Python fan I am very grateful. PS: Sorry for the late reply. I was on vacation. Best, -berk On Fri, Aug 1, 2014 at 11:30 AM, David Gobbi wrote: > Hi Berk, > > Thanks for the insight into how this will impact your customers. I wasn't > suggesting the the conversion of the tests be done now, or even before > the core. And, yes, you're probably right that 2-to-3 is the way to go > until > the major sites are ready to switch to python3. > > For myself, there are two major wrapper-related tasks that have far higher > priority than py3k: > > 1) wrap enum types (so that enum types can be used as method args), > and also wrap namespaces, since these are blockers for some code that > I want to wrap. > > 2) eliminate the "PyVTKClass" type, which relies on an obsolete metaclass > mechanism (search for "Don Beaudry hack" if you're curious) and instead > use python's unified type/class extension system. > > For #2, I'll see if I can put up a wiki page with more detail. But I > don't have > time to move forward on either 1 or 2 until the fall. And you aren't going > to see me pushing for py3k, because I still have no need for it myself. I > just want to be involved when the conversion occurs, because wrapper > stuff is fun. > > - David > > > On Fri, Aug 1, 2014 at 8:11 AM, Berk Geveci > wrote: > > Hi David and others, > > > > I don't think that this workflow would work for us. Most of our > > collaborators, specially in the supercomputing community, are going to > take > > a while longer to move to Python 3. So as a team, we need to continue to > do > > our day-to-day work using Python 2. So having to go through a 3-to-2 > > conversion mechanism would be very cumbersome. We would have to regularly > > maintain 2 builds, do the development in 3 then move to the 2 build, test > > etc. > > > > I suggest taking smaller steps. Starting with porting of the core modules > > (not the tests) and seeing what will be involved in maintaining both 2 > and 3 > > versions (or a 2-to-3 conversion on the fly) would be my suggestion. > Once we > > can demonstrate the maintainability of this, I suspect that doing a > 2-to-3 > > conversion on the fly for the tests would be pretty easy. > > > > Best, > > -berk > > > > > > On Thu, Jul 31, 2014 at 4:15 PM, David Gobbi > wrote: > >> > >> On Thu, Jul 31, 2014 at 6:44 AM, diego0020 > > >> wrote: > >> > > >> > But I am also looking forward to this. Is there anything we could do > to > >> > push > >> > support for python 3 forward? > >> > >> There has been some discussion about converting all of the python > >> tests and examples, which is a part of the process where extra > >> manpower would be a big asset. I imagine that the conversion will > >> go something like this: > >> > >> 1) Someone will run 2to3 on all the python code, and then make > >> sure that it can be byte-compiled with python3 (it will be too early > >> at this stage to actually run the code, but making sure that it > >> byte-compiles will be a good first step). > >> > >> 2) Lots of people will then pick through the code to fix conversion > >> errors and to make sure that the code actually looks like good > >> python3 code. > >> > >> 3) Finally, someone will add some CMake magic to VTK so that if VTK > >> is built against python2, cmake will run 3to2 on all of these new > python3 > >> files and put the equivalent python2 code into the VTK build > >> directory. This is the magic that is needed to make sure that VTK > >> will be able to support both python2 and python3. > >> > >> So any assistance with the above process would be a big help. In > >> particular, it would be very useful if someone could verify that item > >> (3) is even feasible: in the end it might be necessary to have hand- > >> written python2 and python3 exist side-by-side instead of using > >> automatic conversion. It _should_ be feasible, since the VTK > >> tests used automated tcl-to-python conversion for many years, > >> and python3 to python2 should be much easier than tcl to python. > >> > >> - David > -------------- next part -------------- An HTML attachment was scrubbed... URL: From christopher.mullins at kitware.com Wed Aug 6 09:46:06 2014 From: christopher.mullins at kitware.com (Christopher Mullins) Date: Wed, 6 Aug 2014 09:46:06 -0400 Subject: [vtkusers] Vtk Video Source In-Reply-To: References: Message-ID: The PLUS library for ultrasound acquisition [1] has done this using a class called vtkPlusDevice, but there might be simpler examples to look at. [1] https://www.assembla.com/spaces/plus/wiki On Wed, Aug 6, 2014 at 4:54 AM, Fabian Torres wrote: > Hi all > > I?ve connected a video frame grabber to my computer and I want to display > the video using vtk. > > I notice there is a class called vtkVideoSource and I think this could be > an option I can use. I have been looking for examples in the web but > nothing seems to work for me. > > Is there any example that can be useful for what I want to do? > > Thanks > > -- > Fabi?n Torres Robles > Maestria en Ciencias en Ingenier?a Electr?nica > Ingenier?a en Sistemas Electr?nicos > tel. 58081280, 0445534661338 > e-mail fabian.trobles at gmail.com, dae.wong at gmail.com > > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -- Christopher Mullins R&D Engineer Kitware Inc., 919.869.8871 -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdkhatami at gmail.com Wed Aug 6 09:52:39 2014 From: mdkhatami at gmail.com (Mohammad Khatami) Date: Wed, 6 Aug 2014 15:52:39 +0200 Subject: [vtkusers] problem in using map of structure with VTK library Message-ID: Hi all, In my program I need to use map in the following way, but it shows me a conflict between vtkoperator and my structure operator. struct bin3Dh{ int fbin; int gbin; int sbin; }; inline bool operator>(bin3Dh left, bin3Dh right) { if (left.fbin > right.fbin){ return true; } else if (left.fbin < right.fbin) { return false; } else if (left.gbin > right.gbin) { return true; } else if (left.gbin < right.gbin) { return false; } else if (left.sbin > right.sbin) { return true; } else if (left.sbin < right.sbin) { return false; } else{ return false; } } map mapHistogram3D; map::iterator it; void create3dh(double f,double g, double s){ bin3Dh tmphisto; tmphisto.fbin=int((f/frange)*256.0); tmphisto.gbin=int((g/grange)*256.0); tmphisto.sbin=int((s/srange)*256.0); if(mapHistogram3D.count(tmphisto)>0){ it=mapHistogram3D.find(tmphisto); it->second++; } else{ mapHistogram3D.insert(pair(tmphisto,1)); } } Do you have any idea about this problem and how can I define operator for my structure to use in map? Error list: no known conversion for argument 1 from ?const bin3Dh? to ?const vtkWeakPointerBase&? operator op (const vtkWeakPointerBase& l, const vtkWeakPointerBase& r) \ ^ note: vtkstd_bool operator<(const vtkWeakPointerBase&, vtkObjectBase*) operator op (const vtkWeakPointerBase& l, vtkObjectBase* r) \ ^ /usr/include/vtk-5.8/vtkWeakPointerBase.h:102:1: note: in expansion of macro ?VTK_WEAK_POINTER_BASE_DEFINE_OPERATOR? VTK_WEAK_POINTER_BASE_DEFINE_OPERATOR(<) Best Regards, Mohammad -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Wed Aug 6 11:17:23 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 6 Aug 2014 09:17:23 -0600 Subject: [vtkusers] Help building Python wheels for VTK In-Reply-To: <53e17def2dc65_48b93fd8b2693d48102957@shanghai.local.mail> References: <53e17def2dc65_48b93fd8b2693d48102957@shanghai.local.mail> Message-ID: On Tue, Aug 5, 2014 at 6:59 PM, Matthew Brett wrote: > On Tue, Aug 05, 2014 at 04:25 PM, David Gobbi wrote: >> On Tue, Aug 5, 2014 at 5:02 PM, Matthew Brett wrote: >>> Yes, in principle it's possible to create a directory with the correct >>> structure, then pack it into a zip file. Did you have a chance to look >>> at the wheel file format? Basically someone (oh dear is that me?) needs >>> to move all the files that need installing into that directory tree in >>> the correct places, and record the manifest etc in the RECORD, WHEEL and >>> METADATA sections, then zip it up with the right filename. Maybe if you >>> could come up with a list we can see if we can get somewhere... >> >> I glanced at the two PEPs. CMake can be told where to put the python >> modules via the VTK_INSTALL_PYTHON_MODULE_DIR variable, but >> that by itself is probably not sufficient. > > So the wheel usually consists of the package directory as it will be > copied into the Python installation - I guess VTK in your case, and then > a (say) VTK-.data directory with files that need to be copied > elsewhere in the file system, and then the housekeeping stuff like the > manifest and so on. So, if VTK only installs file into the VTK Python > package directory, then that would be almost enough. The relevant parts of VTK install tree look like this (on OS X): ${VTK_INSTALL_PYTHON_MODULE_DIR}/vtk/(*.py|*.pyc|*.so) share/vtk-6.2/vtkDomainsChemistry/elements.xml lib/*.dylib Let me look at the wheel structure more closely, and I'll get back to you with some info on how CMake can be coerced to make the job easier. >> One tricky thing, of course, is that the python modules depend upon the >> VTK dylibs, and I'm not clear on how relocation is to be handled. Do the >> wheel tools have the ability to change the loader path of shared objects? >> Will the dylibs always be placed at a known location relative to the >> installed python .so files? > > I wrote an OSX utility to copy / relocate dynamic libs for OSX called > delocate [1] - so we could at least handle OSX that way. > [1] https://pypi.python.org/pypi/delocate That could definitely be useful. CMake can also inject the path during the build process, if we end up with cmake building the wheel directly. - David From sean at rogue-research.com Wed Aug 6 11:22:34 2014 From: sean at rogue-research.com (Sean McBride) Date: Wed, 6 Aug 2014 11:22:34 -0400 Subject: [vtkusers] Borland complain In-Reply-To: <1407285524319-5728097.post@n5.nabble.com> References: <1407285524319-5728097.post@n5.nabble.com> Message-ID: <20140806152234.1897123739@mail.rogue-research.com> On Tue, 5 Aug 2014 17:38:44 -0700, Totte Karlsson said: >I'm trying to compile 6.1 with borland and is almost there What version of the Borland compiler exactly? VTK 6 deliberately no longer supports ancient versions for example. Cheers, -- ____________________________________________________________ Sean McBride, B. Eng sean at rogue-research.com Rogue Research www.rogue-research.com Mac Software Developer Montr?al, Qu?bec, Canada From kim.rosenbohm at posteo.de Wed Aug 6 12:25:35 2014 From: kim.rosenbohm at posteo.de (Kim Rosenbohm) Date: Wed, 06 Aug 2014 18:25:35 +0200 Subject: [vtkusers] vtkImageDataGeometryFilter problem In-Reply-To: <9d4fb259c5f8cca58467ceadefaf6c2b@posteo.de> References: <9d4fb259c5f8cca58467ceadefaf6c2b@posteo.de> Message-ID: <263cb4f1bc26c33e07236fafa1279de8@posteo.de> Answering my own question here: Apparently "ThresholdValueOn()" resolves to a Macro that takes a bool and sets the threshold value to the value "true" aka 1. Really misleading. Is this a bug or Feature?! The documentation lacks there. At least tell me != 0 is on (besides that I might like to use 0 as an actual threshold...) Please forgive my rant, but I notice the problem throughout VTK with the C++ interface: * Just take a look a "vtkCubeAxesActor". Theres such a load of functions that are basically "Set"/"On"/"Off": "SetXAxisVisibility(int)" <- Why an int?! "XAxisVisibilityOn()/Off()" <- You've now tripled the functions... Why not instead a simple "SetXAxisVisibility(bool)"?! ...as in turn there actually IS only one "Get"-function... * There's functions that take an int as a parameter, but actually expect an enum, e.g. "vtkCubeAxisActor::SetTickLocation(int)" There's no proper way of telling which are the expected input values. Why not use an actual enum?! * vtkImageData has "SetDimensions" marked as deprecated, but "SetExtent" uses width-1, height-1, plane-1... This is IMAGE data. If you actually USE it for images you now always have to do a +1 or -1... Just my 50ct about the library. My first 2-3 weeks have been pretty frustrating... Best Regards, Kim Am 05.08.2014 14:28 schrieb Kim Rosenbohm: > Hi All. > > Though nobody responded to my previous question, I'll try again with a > different problem: > I have a pipeline for masking out areas in a 2D image and turning the > image data into a 3D surface: > > ... > vtkSmartPointer< vtkImageResample > m_surfaceResampled; > vtkSmartPointer< vtkImageResample > m_maskResampled; > vtkSmartPointer< vtkImageMask > m_maskMask; > vtkSmartPointer< vtkImageDataGeometryFilter > m_surfaceGeoFilter; > vtkSmartPointer< vtkWarpScalar > m_surfaceWarpFilter; > > //use a vtkImageMask to remove masked-out stuff from an image > m_maskMask->SetInputConnection(0, > m_surfaceResampled->GetOutputPort()); > m_maskMask->SetInputConnection(1, m_maskResampled->GetOutputPort()); > m_maskMask->SetMaskedOutputValue(-10000); > //m_maskMask->SetMaskAlpha(0.0); > //setup filter creating geometry from image/height data > m_surfaceGeoFilter->SetInputConnection(m_maskMask->GetOutputPort()); > //setup masking out of cells marked in mask > m_surfaceGeoFilter->ThresholdCellsOn(); > m_surfaceGeoFilter->SetThresholdValue(*m_maskMask->GetMaskedOutputValue()); > m_surfaceGeoFilter->ThresholdValueOn(); > //pass geometry to scale surface z-axis height > m_surfaceWarpFilter->SetInputConnection(m_surfaceGeoFilter->GetOutputPort()); > m_surfaceWarpFilter->SetScaleFactor(1.0); > ... > > This works ok for positive values in m_surfaceResampled, but not if I > only have negative values there. > Then I get no surface at all... Why? > Additionally an eleborate explanation of what ThresholdCELLS and > ThresholdVALUE do > and how they interact would be nice. The documentation is not > dummy-proof > enough for me there... > > Best Regards, > > Kim > > _______________________________________________ > Powered by www.kitware.com [1] > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html [2] > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ [3] > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers [4] -- Kim Rosenbohm, Barf??erstr. 7, 37073 G?ttingen, 0163/8723172 Links: ------ [1] http://www.kitware.com [2] http://www.kitware.com/opensource/opensource.html [3] http://www.vtk.org/Wiki/VTK_FAQ [4] http://public.kitware.com/mailman/listinfo/vtkusers From tottek at gmail.com Wed Aug 6 13:13:24 2014 From: tottek at gmail.com (Totte Karlsson) Date: Wed, 6 Aug 2014 10:13:24 -0700 (PDT) Subject: [vtkusers] Borland complain In-Reply-To: <20140806152234.1897123739@mail.rogue-research.com> References: <1407285524319-5728097.post@n5.nabble.com> <20140806152234.1897123739@mail.rogue-research.com> Message-ID: <1407345204129-5728113.post@n5.nabble.com> Hi Sean, I am using Borlands XE3 compiler (its like 2 years old). However, I'm using their 32bit compiler that always have had big problems with templates. Currently I did manage to get what I needed to work in vtk with this compiler. However, there are some code, like the one I posted, that I needed to comment out in order to get a final library. Just curious if there is a fix that could be done for that code that would be OK for all compilers? Thanks, -totte -- View this message in context: http://vtk.1045678.n5.nabble.com/Borland-complain-tp5728097p5728113.html Sent from the VTK - Users mailing list archive at Nabble.com. From MEEHANBT at nv.doe.gov Wed Aug 6 13:13:57 2014 From: MEEHANBT at nv.doe.gov (Meehan, Bernard) Date: Wed, 6 Aug 2014 17:13:57 +0000 Subject: [vtkusers] building MATLAB MEX files with vtk 6.1? Message-ID: I've tried to get a couple of tutorials built using CMake and haven't had a whole lot of luck ... http://www.cmake.org/Wiki/CMake/MatlabMex http://www.mathworks.com/matlabcentral/fileexchange/19638-visualization-toolkit--vtk--mex-interface http://www.kitware.com/media/html/MATLABAndGNURIntegrationWithVTK.html I figured that I might try to do it by hand so to speak - just to prove to myself that I could get it to work. I used this as a test file (does nothing on purpose): #include "mex.h" #include #include #define VTK_CREATE(type, name) \ vtkSmartPointer name = vtkSmartPointer::New() void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { mexPrintf("Hi there!\n"); VTK_CREATE(vtkSphereSource, source); } And I tried to compile it with: #!/bin/sh MEX=/Applications/MATLAB_R2013b.app/bin/mex $MEX -I/Users/meehanbt/VTK/include/vtk-6.1/ hello.cxx -L/Users/meehanbt/VTK/lib/ -lvtkCommon -lvtkRendering Obviously, for VTK 6.1 - the libraries are much more finely grained ... and I just did a copy/paste from a webpage somewhere. Trying to build the simple program gives: ld: library not found for -lvtkCommon clang: error: linker command failed with exit code 1 (use -v to see invocation) mex: link of ' "hello.mexmaci64"' failed. Does anyone have any advice for how I would go about making a simple data display window or something like that as a MEX file? -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthew.brett at gmail.com Wed Aug 6 13:33:07 2014 From: matthew.brett at gmail.com (Matthew Brett) Date: Wed, 6 Aug 2014 10:33:07 -0700 Subject: [vtkusers] Status of VTK Python 3 wrapper support In-Reply-To: References: <1406810682351-5728034.post@n5.nabble.com> Message-ID: Hi, On Wed, Aug 6, 2014 at 4:25 AM, Berk Geveci wrote: > Hi David, > > Sounds great. I am glad that you are hooked on the wrappers :-) You have > done a lot of wonderful work on them and as a big Python fan I am very > grateful. > > PS: Sorry for the late reply. I was on vacation. > > Best, > -berk > > > On Fri, Aug 1, 2014 at 11:30 AM, David Gobbi wrote: >> >> Hi Berk, >> >> Thanks for the insight into how this will impact your customers. I wasn't >> suggesting the the conversion of the tests be done now, or even before >> the core. And, yes, you're probably right that 2-to-3 is the way to go >> until >> the major sites are ready to switch to python3. >> >> For myself, there are two major wrapper-related tasks that have far higher >> priority than py3k: >> >> 1) wrap enum types (so that enum types can be used as method args), >> and also wrap namespaces, since these are blockers for some code that >> I want to wrap. >> >> 2) eliminate the "PyVTKClass" type, which relies on an obsolete metaclass >> mechanism (search for "Don Beaudry hack" if you're curious) and instead >> use python's unified type/class extension system. >> >> For #2, I'll see if I can put up a wiki page with more detail. But I >> don't have >> time to move forward on either 1 or 2 until the fall. And you aren't >> going >> to see me pushing for py3k, because I still have no need for it myself. I >> just want to be involved when the conversion occurs, because wrapper >> stuff is fun. Just for reference, nearly all of the big scientific python projects (numpy, scipy, matplotlib, ipython, sympy) have switched to using a common code-base for Python 2 / Python 3. [1, 2]. This now seems to be the standard Python advice if you want to keep Python 2 compatibility [3] (in days gone past, the standard advice was to use 2to3). The numerical Python community is likely to start switching over to standardizing on Python 3 fairly soon (over the next couple of years), and all standard numerical packages now have Python 3 support. In general our experience has been that when we used a compatibility file such as that provided by the 'six' [6] project, and with good tests, porting to a Python 2 / 3 compatible code base was a lot easier than we had feared. Cheers, Matthew [1] http://ondrejcertik.blogspot.com/2013/08/how-to-support-both-python-2-and-3.html [2] http://asmeurersympy.wordpress.com/2013/08/22/python-3-single-codebase-vs-2to3 [3] https://docs.python.org/3/howto/pyporting.html [6] https://pypi.python.org/pypi/six From sbalderrama at eagle.org Wed Aug 6 15:47:07 2014 From: sbalderrama at eagle.org (Steve Balderrama) Date: Wed, 6 Aug 2014 19:47:07 +0000 Subject: [vtkusers] highlighting options.... Message-ID: What is the best way to highlight selections with VTK? Creating a separate mesh with just the selected cells a different color is not reliable because VTK doesn't allow polygon offset to be set independently. So sometimes the highlight cells show up and some times they end up obscured. Individually recoloring cells in the mesh seems inefficient and would probably require a full rebuild of the mesh rendering geometry, correct? Paraview I notice highlights cell edges by making the line widths bigger, probably for this very reason. I'd prefer the visual effect to be for cells to change color though. Any ideas? -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Wed Aug 6 16:14:37 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 6 Aug 2014 14:14:37 -0600 Subject: [vtkusers] building MATLAB MEX files with vtk 6.1? In-Reply-To: <20140806171343.DB4A651858@public.kitware.com> References: <20140806171343.DB4A651858@public.kitware.com> Message-ID: Hi Bernard, As you have rightly guessed, the libraries vtkCommon, vtkRendering, etc. no longer exist in VTK 6. The minimal set of libraries that you need for VTK 6 are probably the following: vtkCommonCore vtkCommonDataModel vtkRenderingCore vtkRenderingOpenGL vtkRenderingFreeTypeOpenGL vtkInteractionStyle - David On Wed, Aug 6, 2014 at 11:13 AM, Meehan, Bernard wrote: > I've tried to get a couple of tutorials built using CMake and haven't had a > whole lot of luck ... > > http://www.cmake.org/Wiki/CMake/MatlabMex > http://www.mathworks.com/matlabcentral/fileexchange/19638-visualization-toolkit--vtk--mex-interface > http://www.kitware.com/media/html/MATLABAndGNURIntegrationWithVTK.html > > I figured that I might try to do it by hand so to speak - just to prove to > myself that I could get it to work. I used this as a test file (does nothing > on purpose): > #include "mex.h" > > #include > #include > #define VTK_CREATE(type, name) \ > vtkSmartPointer name = vtkSmartPointer::New() > > void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) > { > mexPrintf("Hi there!\n"); > VTK_CREATE(vtkSphereSource, source); > } > > And I tried to compile it with: > #!/bin/sh > MEX=/Applications/MATLAB_R2013b.app/bin/mex > $MEX -I/Users/meehanbt/VTK/include/vtk-6.1/ hello.cxx > -L/Users/meehanbt/VTK/lib/ -lvtkCommon -lvtkRendering > > Obviously, for VTK 6.1 - the libraries are much more finely grained ... and > I just did a copy/paste from a webpage somewhere. Trying to build the simple > program gives: > ld: library not found for -lvtkCommon > clang: error: linker command failed with exit code 1 (use -v to see > invocation) > > mex: link of ' "hello.mexmaci64"' failed. > > Does anyone have any advice for how I would go about making a simple data > display window or something like that as a MEX file? From dave.demarle at kitware.com Wed Aug 6 16:27:35 2014 From: dave.demarle at kitware.com (David E DeMarle) Date: Wed, 6 Aug 2014 16:27:35 -0400 Subject: [vtkusers] building MATLAB MEX files with vtk 6.1? In-Reply-To: References: <20140806171343.DB4A651858@public.kitware.com> Message-ID: You will also be interested in this branch, in which Jameson restored VTK's matlab interface, which was lost in 6.0. * http://review.source.kitware.com/#/c/16043/ David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Wed, Aug 6, 2014 at 4:14 PM, David Gobbi wrote: > Hi Bernard, > > As you have rightly guessed, the libraries vtkCommon, vtkRendering, > etc. no longer exist in VTK 6. The minimal set of libraries that you > need for VTK 6 are probably the following: > > vtkCommonCore > vtkCommonDataModel > vtkRenderingCore > vtkRenderingOpenGL > vtkRenderingFreeTypeOpenGL > vtkInteractionStyle > > - David > > > On Wed, Aug 6, 2014 at 11:13 AM, Meehan, Bernard > wrote: > > I've tried to get a couple of tutorials built using CMake and haven't > had a > > whole lot of luck ... > > > > http://www.cmake.org/Wiki/CMake/MatlabMex > > > http://www.mathworks.com/matlabcentral/fileexchange/19638-visualization-toolkit--vtk--mex-interface > > http://www.kitware.com/media/html/MATLABAndGNURIntegrationWithVTK.html > > > > I figured that I might try to do it by hand so to speak - just to prove > to > > myself that I could get it to work. I used this as a test file (does > nothing > > on purpose): > > #include "mex.h" > > > > #include > > #include > > #define VTK_CREATE(type, name) \ > > vtkSmartPointer name = vtkSmartPointer::New() > > > > void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray > *prhs[]) > > { > > mexPrintf("Hi there!\n"); > > VTK_CREATE(vtkSphereSource, source); > > } > > > > And I tried to compile it with: > > #!/bin/sh > > MEX=/Applications/MATLAB_R2013b.app/bin/mex > > $MEX -I/Users/meehanbt/VTK/include/vtk-6.1/ hello.cxx > > -L/Users/meehanbt/VTK/lib/ -lvtkCommon -lvtkRendering > > > > Obviously, for VTK 6.1 - the libraries are much more finely grained ... > and > > I just did a copy/paste from a webpage somewhere. Trying to build the > simple > > program gives: > > ld: library not found for -lvtkCommon > > clang: error: linker command failed with exit code 1 (use -v to see > > invocation) > > > > mex: link of ' "hello.mexmaci64"' failed. > > > > Does anyone have any advice for how I would go about making a simple data > > display window or something like that as a MEX file? > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Wed Aug 6 16:38:28 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 6 Aug 2014 14:38:28 -0600 Subject: [vtkusers] building MATLAB MEX files with vtk 6.1? In-Reply-To: References: <20140806171343.DB4A651858@public.kitware.com> Message-ID: Also, though this is slightly off-topic, I'd also like to point out that it is possible (and not very difficult) to build mex files with cmake without using mex at all. After all, "mex" is just a shell script that calls the compiler. Cmake can do that and a whole lot more. - David On Wed, Aug 6, 2014 at 2:27 PM, David E DeMarle wrote: > You will also be interested in this branch, in which Jameson restored VTK's > matlab interface, which was lost in 6.0. > * http://review.source.kitware.com/#/c/16043/ > > On Wed, Aug 6, 2014 at 4:14 PM, David Gobbi wrote: >> >> Hi Bernard, >> >> As you have rightly guessed, the libraries vtkCommon, vtkRendering, >> etc. no longer exist in VTK 6. The minimal set of libraries that you >> need for VTK 6 are probably the following: >> >> vtkCommonCore >> vtkCommonDataModel >> vtkRenderingCore >> vtkRenderingOpenGL >> vtkRenderingFreeTypeOpenGL >> vtkInteractionStyle >> >> - David >> >> >> On Wed, Aug 6, 2014 at 11:13 AM, Meehan, Bernard >> wrote: >> > I've tried to get a couple of tutorials built using CMake and haven't >> > had a >> > whole lot of luck ... >> > >> > http://www.cmake.org/Wiki/CMake/MatlabMex >> > >> > http://www.mathworks.com/matlabcentral/fileexchange/19638-visualization-toolkit--vtk--mex-interface >> > http://www.kitware.com/media/html/MATLABAndGNURIntegrationWithVTK.html >> > >> > I figured that I might try to do it by hand so to speak - just to prove >> > to >> > myself that I could get it to work. I used this as a test file (does >> > nothing >> > on purpose): >> > #include "mex.h" >> > >> > #include >> > #include >> > #define VTK_CREATE(type, name) \ >> > vtkSmartPointer name = vtkSmartPointer::New() >> > >> > void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray >> > *prhs[]) >> > { >> > mexPrintf("Hi there!\n"); >> > VTK_CREATE(vtkSphereSource, source); >> > } >> > >> > And I tried to compile it with: >> > #!/bin/sh >> > MEX=/Applications/MATLAB_R2013b.app/bin/mex >> > $MEX -I/Users/meehanbt/VTK/include/vtk-6.1/ hello.cxx >> > -L/Users/meehanbt/VTK/lib/ -lvtkCommon -lvtkRendering >> > >> > Obviously, for VTK 6.1 - the libraries are much more finely grained ... >> > and >> > I just did a copy/paste from a webpage somewhere. Trying to build the >> > simple >> > program gives: >> > ld: library not found for -lvtkCommon >> > clang: error: linker command failed with exit code 1 (use -v to see >> > invocation) >> > >> > mex: link of ' "hello.mexmaci64"' failed. >> > >> > Does anyone have any advice for how I would go about making a simple >> > data >> > display window or something like that as a MEX file? From MEEHANBT at nv.doe.gov Wed Aug 6 16:58:59 2014 From: MEEHANBT at nv.doe.gov (Meehan, Bernard) Date: Wed, 6 Aug 2014 20:58:59 +0000 Subject: [vtkusers] building MATLAB MEX files with vtk 6.1? In-Reply-To: <7FFC4DE523W1073808-01@EMF_nv.doe.gov> References: <20140806171343.DB4A651858@public.kitware.com> <7FFC4DE523W1073808-01@EMF_nv.doe.gov> Message-ID: I'd much rather do this in cmake - I do have the "Mastering CMake" book (haven't yet mastered it, or mex for that matter). I think that the first problem I was having with the mex script was that the libraries needed to be specified with the version numbers? This seemed to get farther: #!/bin/sh MEX=/Applications/MATLAB_R2013b.app/bin/mex $MEX -largeArrayDims \ -I/Users/meehanbt/VTK/include/vtk-6.1/ \ hello.cxx \ -L/Users/meehanbt/VTK/lib/ \ -lvtkCommonCore-6.1 \ -lvtkCommonDataModel-6.1 \ -lvtkRenderingCore-6.1 \ -lvtkRenderingOpenGL-6.1 \ -lvtkRenderingFreeTypeOpenGL-6.1 \ -lvtkInteractionStyle-6.1 Which gave this error: Undefined symbols for architecture x86_64: "vtkSphereSource::New()", referenced from: _mexFunction in hello.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) mex: link of ' "hello.mexmaci64"' failed. On 8/6/14 1:38 PM, "David Gobbi" wrote: >Also, though this is slightly off-topic, I'd also like to point out that >it is >possible (and not very difficult) to build mex files with cmake without >using mex at all. After all, "mex" is just a shell script that calls the >compiler. Cmake can do that and a whole lot more. > > - David > > >On Wed, Aug 6, 2014 at 2:27 PM, David E DeMarle > wrote: >> You will also be interested in this branch, in which Jameson restored >>VTK's >> matlab interface, which was lost in 6.0. >> * http://review.source.kitware.com/#/c/16043/ >> >> On Wed, Aug 6, 2014 at 4:14 PM, David Gobbi >>wrote: >>> >>> Hi Bernard, >>> >>> As you have rightly guessed, the libraries vtkCommon, vtkRendering, >>> etc. no longer exist in VTK 6. The minimal set of libraries that you >>> need for VTK 6 are probably the following: >>> >>> vtkCommonCore >>> vtkCommonDataModel >>> vtkRenderingCore >>> vtkRenderingOpenGL >>> vtkRenderingFreeTypeOpenGL >>> vtkInteractionStyle >>> >>> - David >>> >>> >>> On Wed, Aug 6, 2014 at 11:13 AM, Meehan, Bernard >>> wrote: >>> > I've tried to get a couple of tutorials built using CMake and haven't >>> > had a >>> > whole lot of luck ... >>> > >>> > http://www.cmake.org/Wiki/CMake/MatlabMex >>> > >>> > >>>http://www.mathworks.com/matlabcentral/fileexchange/19638-visualization- >>>toolkit--vtk--mex-interface >>> > >>>http://www.kitware.com/media/html/MATLABAndGNURIntegrationWithVTK.html >>> > >>> > I figured that I might try to do it by hand so to speak - just to >>>prove >>> > to >>> > myself that I could get it to work. I used this as a test file (does >>> > nothing >>> > on purpose): >>> > #include "mex.h" >>> > >>> > #include >>> > #include >>> > #define VTK_CREATE(type, name) \ >>> > vtkSmartPointer name = vtkSmartPointer::New() >>> > >>> > void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray >>> > *prhs[]) >>> > { >>> > mexPrintf("Hi there!\n"); >>> > VTK_CREATE(vtkSphereSource, source); >>> > } >>> > >>> > And I tried to compile it with: >>> > #!/bin/sh >>> > MEX=/Applications/MATLAB_R2013b.app/bin/mex >>> > $MEX -I/Users/meehanbt/VTK/include/vtk-6.1/ hello.cxx >>> > -L/Users/meehanbt/VTK/lib/ -lvtkCommon -lvtkRendering >>> > >>> > Obviously, for VTK 6.1 - the libraries are much more finely grained >>>... >>> > and >>> > I just did a copy/paste from a webpage somewhere. Trying to build the >>> > simple >>> > program gives: >>> > ld: library not found for -lvtkCommon >>> > clang: error: linker command failed with exit code 1 (use -v to see >>> > invocation) >>> > >>> > mex: link of ' "hello.mexmaci64"' failed. >>> > >>> > Does anyone have any advice for how I would go about making a simple >>> > data >>> > display window or something like that as a MEX file? >_______________________________________________ >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 > >Follow this link to subscribe/unsubscribe: >http://public.kitware.com/mailman/listinfo/vtkusers > From david.gobbi at gmail.com Wed Aug 6 17:36:42 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 6 Aug 2014 15:36:42 -0600 Subject: [vtkusers] building MATLAB MEX files with vtk 6.1? In-Reply-To: <53e2970d.25188c0a.2799.ffffc602SMTPIN_ADDED_MISSING@mx.google.com> References: <20140806171343.DB4A651858@public.kitware.com> <7FFC4DE523W1073808-01@EMF_nv.doe.gov> <53e2970d.25188c0a.2799.ffffc602SMTPIN_ADDED_MISSING@mx.google.com> Message-ID: Add vtkFiltersSources to your list of libraries, it's the one that has the vtkSphereSource. On Wed, Aug 6, 2014 at 2:58 PM, Meehan, Bernard wrote: > I'd much rather do this in cmake - I do have the "Mastering CMake" book > (haven't yet mastered it, or mex for that matter). > > I think that the first problem I was having with the mex script was that > the libraries needed to be specified with the version numbers? > This seemed to get farther: > #!/bin/sh > MEX=/Applications/MATLAB_R2013b.app/bin/mex > $MEX -largeArrayDims \ > -I/Users/meehanbt/VTK/include/vtk-6.1/ \ > hello.cxx \ > -L/Users/meehanbt/VTK/lib/ \ > -lvtkCommonCore-6.1 \ > -lvtkCommonDataModel-6.1 \ > -lvtkRenderingCore-6.1 \ > -lvtkRenderingOpenGL-6.1 \ > -lvtkRenderingFreeTypeOpenGL-6.1 \ > -lvtkInteractionStyle-6.1 > > > > Which gave this error: > Undefined symbols for architecture x86_64: > "vtkSphereSource::New()", referenced from: > _mexFunction in hello.o > ld: symbol(s) not found for architecture x86_64 > clang: error: linker command failed with exit code 1 (use -v to see > invocation) > > mex: link of ' "hello.mexmaci64"' failed. > > > On 8/6/14 1:38 PM, "David Gobbi" wrote: > >>Also, though this is slightly off-topic, I'd also like to point out that >>it is >>possible (and not very difficult) to build mex files with cmake without >>using mex at all. After all, "mex" is just a shell script that calls the >>compiler. Cmake can do that and a whole lot more. >> >> - David >> >> >>On Wed, Aug 6, 2014 at 2:27 PM, David E DeMarle >> wrote: >>> You will also be interested in this branch, in which Jameson restored >>>VTK's >>> matlab interface, which was lost in 6.0. >>> * http://review.source.kitware.com/#/c/16043/ >>> >>> On Wed, Aug 6, 2014 at 4:14 PM, David Gobbi >>>wrote: >>>> >>>> Hi Bernard, >>>> >>>> As you have rightly guessed, the libraries vtkCommon, vtkRendering, >>>> etc. no longer exist in VTK 6. The minimal set of libraries that you >>>> need for VTK 6 are probably the following: >>>> >>>> vtkCommonCore >>>> vtkCommonDataModel >>>> vtkRenderingCore >>>> vtkRenderingOpenGL >>>> vtkRenderingFreeTypeOpenGL >>>> vtkInteractionStyle >>>> >>>> - David >>>> >>>> >>>> On Wed, Aug 6, 2014 at 11:13 AM, Meehan, Bernard >>>> wrote: >>>> > I've tried to get a couple of tutorials built using CMake and haven't >>>> > had a >>>> > whole lot of luck ... >>>> > >>>> > http://www.cmake.org/Wiki/CMake/MatlabMex >>>> > >>>> > >>>>http://www.mathworks.com/matlabcentral/fileexchange/19638-visualization- >>>>toolkit--vtk--mex-interface >>>> > >>>>http://www.kitware.com/media/html/MATLABAndGNURIntegrationWithVTK.html >>>> > >>>> > I figured that I might try to do it by hand so to speak - just to >>>>prove >>>> > to >>>> > myself that I could get it to work. I used this as a test file (does >>>> > nothing >>>> > on purpose): >>>> > #include "mex.h" >>>> > >>>> > #include >>>> > #include >>>> > #define VTK_CREATE(type, name) \ >>>> > vtkSmartPointer name = vtkSmartPointer::New() >>>> > >>>> > void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray >>>> > *prhs[]) >>>> > { >>>> > mexPrintf("Hi there!\n"); >>>> > VTK_CREATE(vtkSphereSource, source); >>>> > } >>>> > >>>> > And I tried to compile it with: >>>> > #!/bin/sh >>>> > MEX=/Applications/MATLAB_R2013b.app/bin/mex >>>> > $MEX -I/Users/meehanbt/VTK/include/vtk-6.1/ hello.cxx >>>> > -L/Users/meehanbt/VTK/lib/ -lvtkCommon -lvtkRendering >>>> > >>>> > Obviously, for VTK 6.1 - the libraries are much more finely grained >>>>... >>>> > and >>>> > I just did a copy/paste from a webpage somewhere. Trying to build the >>>> > simple >>>> > program gives: >>>> > ld: library not found for -lvtkCommon >>>> > clang: error: linker command failed with exit code 1 (use -v to see >>>> > invocation) >>>> > >>>> > mex: link of ' "hello.mexmaci64"' failed. >>>> > >>>> > Does anyone have any advice for how I would go about making a simple >>>> > data >>>> > display window or something like that as a MEX file? From dave.demarle at kitware.com Wed Aug 6 17:38:53 2014 From: dave.demarle at kitware.com (David E DeMarle) Date: Wed, 6 Aug 2014 17:38:53 -0400 Subject: [vtkusers] announce: 2014 HPCWire Reader's Choice Award nominations open Message-ID: HPCWire is holding their Annual Reader?s Choice Awards. Please take the time to nominate VTK and ParaView for this year?s awards. All you need to do is to submit the projects, products or solutions you feel should be honored by receiving an award to the appropriate (max of 3) categories before the deadline at: http://www.hpcwire.com/2014-hpcwire-readers-choice-awards/ Anyone may can nominate their project, collaboration, product or solution, and you do not need to fill the entire form out. Only the categories(s) for which you feel your organization is qualified to receive an award. You may submit as many nominations as you like. Those who make it past the nominations will move on to the September elections for selecting this year's finalists by our readers. Recent and near term user visible developments in the lands of VTK and ParaView include: *VTK* * vtkDax, vtkPiston and vtkSMP: bringing GPGPU and multicore speed to VTK. * vtkWeb - VTK based web services simply by enabling VTK_WRAP_PYTHON * vtk.numpy_interface - numpy processing moves beyond arrays into datasets * OpenGL2.1+ rendering - promising both render speed and extensibility improvements *ParaView* * vector graphics screen exports * parallel and composite SurfaceLIC representations of vector fields * streamlined properties and view options panels * the Python View allows just about any Python library to generate images in ParaView views. David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 -------------- next part -------------- An HTML attachment was scrubbed... URL: From taylor at braun-jones.org Wed Aug 6 17:40:56 2014 From: taylor at braun-jones.org (Taylor Braun-Jones) Date: Wed, 6 Aug 2014 17:40:56 -0400 Subject: [vtkusers] Help building Python wheels for VTK In-Reply-To: References: <53e17def2dc65_48b93fd8b2693d48102957@shanghai.local.mail> Message-ID: I believe SimpleITK uses cmake to build their python wheels. Might be worth checking out so you don't have to re-invent the *ahem* wheel :-) On Wed, Aug 6, 2014 at 11:17 AM, David Gobbi wrote: > On Tue, Aug 5, 2014 at 6:59 PM, Matthew Brett > wrote: > > On Tue, Aug 05, 2014 at 04:25 PM, David Gobbi > wrote: > >> On Tue, Aug 5, 2014 at 5:02 PM, Matthew Brett > wrote: > >>> Yes, in principle it's possible to create a directory with the correct > >>> structure, then pack it into a zip file. Did you have a chance to look > >>> at the wheel file format? Basically someone (oh dear is that me?) > needs > >>> to move all the files that need installing into that directory tree in > >>> the correct places, and record the manifest etc in the RECORD, WHEEL > and > >>> METADATA sections, then zip it up with the right filename. Maybe if > you > >>> could come up with a list we can see if we can get somewhere... > >> > >> I glanced at the two PEPs. CMake can be told where to put the python > >> modules via the VTK_INSTALL_PYTHON_MODULE_DIR variable, but > >> that by itself is probably not sufficient. > > > > So the wheel usually consists of the package directory as it will be > > copied into the Python installation - I guess VTK in your case, and then > > a (say) VTK-.data directory with files that need to be copied > > elsewhere in the file system, and then the housekeeping stuff like the > > manifest and so on. So, if VTK only installs file into the VTK Python > > package directory, then that would be almost enough. > > The relevant parts of VTK install tree look like this (on OS X): > > ${VTK_INSTALL_PYTHON_MODULE_DIR}/vtk/(*.py|*.pyc|*.so) > share/vtk-6.2/vtkDomainsChemistry/elements.xml > lib/*.dylib > > Let me look at the wheel structure more closely, and I'll get back to you > with some info on how CMake can be coerced to make the job easier. > > >> One tricky thing, of course, is that the python modules depend upon the > >> VTK dylibs, and I'm not clear on how relocation is to be handled. Do > the > >> wheel tools have the ability to change the loader path of shared > objects? > >> Will the dylibs always be placed at a known location relative to the > >> installed python .so files? > > > > I wrote an OSX utility to copy / relocate dynamic libs for OSX called > > delocate [1] - so we could at least handle OSX that way. > > [1] https://pypi.python.org/pypi/delocate > > That could definitely be useful. CMake can also inject the path during > the build process, if we end up with cmake building the wheel directly. > > - David > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Wed Aug 6 19:14:38 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 6 Aug 2014 17:14:38 -0600 Subject: [vtkusers] Help building Python wheels for VTK In-Reply-To: References: <53e17def2dc65_48b93fd8b2693d48102957@shanghai.local.mail> Message-ID: On Wed, Aug 6, 2014 at 3:40 PM, Taylor Braun-Jones wrote: > I believe SimpleITK uses cmake to build their python wheels. Might be worth > checking out so you don't have to re-invent the *ahem* wheel :-) It looks like SimpleITK does its wheel-building via setup.py. VTK has no setup.py. - David From pletzer at txcorp.com Wed Aug 6 18:57:36 2014 From: pletzer at txcorp.com (Alexander Pletzer) Date: Wed, 06 Aug 2014 16:57:36 -0600 Subject: [vtkusers] vtkTextureMapToSphere and PreventSeamOff not working as expected Message-ID: <53E2B2E0.6080309@txcorp.com> Hi, I'm trying to wrap the simple attached image around a sphere using vtkTextureMapToSphere and got some unexpected result -- the word "center" appears twice. Also the blue line is completely absent. There also appears to be a small gap at longitude 0 (see testOne.png). It looks as if the texture file was used twice. Does anyone know hoe to fix this? After some googling I found that some people had to write a custom vtkTextureMapToSphere class to deal with this problem. I'd like the texture to completely cover the sphere, each of the "nw", "sw", "se", "ne", and "center" texts should only appear once, each of the red, blue, white, and green should also appear only once. Thanks in advance. --Alex import vtk import sys filename1 = "one.png" # Create a render window ren = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren) renWin.SetSize(480,480) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) # Generate a sphere polydata sphere1 = vtk.vtkSphereSource() sphere1.SetThetaResolution(12) sphere1.SetPhiResolution(12) sphere1.SetStartTheta(0) sphere1.SetEndTheta(360) # Read the image data from file reader1 = vtk.vtkPNGReader() reader1.SetFileName(filename1) # Create texture object texture1 = vtk.vtkTexture() texture1.SetInputConnection(reader1.GetOutputPort()) # Map texture coordinates map_to_sphere1 = vtk.vtkTextureMapToSphere() map_to_sphere1.SetInputConnection(sphere1.GetOutputPort()) map_to_sphere1.PreventSeamOff() # Create mapper and set the mapped texture as input mapper1 = vtk.vtkPolyDataMapper() mapper1.SetInputConnection(map_to_sphere1.GetOutputPort()) # Create actor and set the mapper and the texture actor1 = vtk.vtkActor() actor1.SetMapper(mapper1) actor1.SetTexture(texture1) ren.AddActor(actor1) iren.Initialize() renWin.Render() iren.Start() -------------- next part -------------- A non-text attachment was scrubbed... Name: one.png Type: image/png Size: 5570 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: testOne.png Type: image/png Size: 52857 bytes Desc: not available URL: From shiti.91 at gmail.com Wed Aug 6 19:26:06 2014 From: shiti.91 at gmail.com (Shitikantha Dash) Date: Thu, 7 Aug 2014 04:56:06 +0530 Subject: [vtkusers] Installation Problrm Message-ID: Getting a error message while trying to install with CMake: CMake Error at CMake/FindPackageHandleStandardArgs.cmake:97 (MESSAGE): Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) Call Stack (most recent call first): CMake/FindPackageHandleStandardArgs.cmake:288 (_FPHSA_FAILURE_MESSAGE) CMake/FindPythonLibs.cmake:134 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMake/vtkPythonWrapping.cmake:1 (find_package) Wrapping/PythonCore/CMakeLists.txt:2 (include) Can anybody help with this ? thank you, Sipun From MEEHANBT at nv.doe.gov Wed Aug 6 20:52:16 2014 From: MEEHANBT at nv.doe.gov (Meehan, Bernard) Date: Thu, 7 Aug 2014 00:52:16 +0000 Subject: [vtkusers] vtkTextureMapToSphere and PreventSeamOff not working as expected In-Reply-To: <7FFC681A23W1084578-01@EMF_nv.doe.gov> References: <7FFC681A23W1084578-01@EMF_nv.doe.gov> Message-ID: I was trying to do the same thing last week. Try the vtkTexturedSphereSource instead: http://www.vtk.org/doc/nightly/html/classvtkTexturedSphereSource.html On 8/6/14 3:57 PM, "Alexander Pletzer" wrote: >Hi, > >I'm trying to wrap the simple attached image around a sphere using >vtkTextureMapToSphere and got some unexpected result -- the word >"center" appears twice. Also the blue line is completely absent. There >also appears to be a small gap at longitude 0 (see testOne.png). It >looks as if the texture file was used twice. > >Does anyone know hoe to fix this? After some googling I found that some >people had to write a custom vtkTextureMapToSphere class to deal with >this problem. I'd like the texture to completely cover the sphere, each >of the "nw", "sw", "se", "ne", and "center" texts should only appear >once, each of the red, blue, white, and green should also appear only >once. > >Thanks in advance. > >--Alex > > >import vtk >import sys > >filename1 = "one.png" > ># Create a render window >ren = vtk.vtkRenderer() >renWin = vtk.vtkRenderWindow() >renWin.AddRenderer(ren) >renWin.SetSize(480,480) >iren = vtk.vtkRenderWindowInteractor() >iren.SetRenderWindow(renWin) > ># Generate a sphere polydata >sphere1 = vtk.vtkSphereSource() >sphere1.SetThetaResolution(12) >sphere1.SetPhiResolution(12) >sphere1.SetStartTheta(0) >sphere1.SetEndTheta(360) > ># Read the image data from file >reader1 = vtk.vtkPNGReader() >reader1.SetFileName(filename1) > ># Create texture object >texture1 = vtk.vtkTexture() >texture1.SetInputConnection(reader1.GetOutputPort()) > ># Map texture coordinates >map_to_sphere1 = vtk.vtkTextureMapToSphere() >map_to_sphere1.SetInputConnection(sphere1.GetOutputPort()) >map_to_sphere1.PreventSeamOff() > ># Create mapper and set the mapped texture as input >mapper1 = vtk.vtkPolyDataMapper() >mapper1.SetInputConnection(map_to_sphere1.GetOutputPort()) > ># Create actor and set the mapper and the texture >actor1 = vtk.vtkActor() >actor1.SetMapper(mapper1) >actor1.SetTexture(texture1) > >ren.AddActor(actor1) > >iren.Initialize() >renWin.Render() >iren.Start() > From isimtic at gmail.com Thu Aug 7 01:03:33 2014 From: isimtic at gmail.com (=?UTF-8?B?QWhtZXQgRG/En2Fu?=) Date: Thu, 07 Aug 2014 08:03:33 +0300 Subject: [vtkusers] vtkGuiSupportQtOpengl Message-ID: <53E308A5.7030306@gmail.com> hi, when I was compiling vtk from source I saw an option apart from VTK_Group_Qt. it was module_vtkGuiSupportQtOpengl it has QVTKWidget2 like QVTKWidget. What is the differences between this two module? Kind Regards. From isimtic at gmail.com Thu Aug 7 02:06:50 2014 From: isimtic at gmail.com (=?UTF-8?B?QWhtZXQgRG/En2Fu?=) Date: Thu, 07 Aug 2014 09:06:50 +0300 Subject: [vtkusers] correct way of using VTK_MODULE_INIT with opengl2 Message-ID: <53E3177A.3050407@gmail.com> hi, I have swith to opengl2 for performance purposes. But when I was using opengl just I init rendering modules like #define vtkRenderingCore_AUTOINIT 4(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingFreeTypeOpenGL,vtkRenderingOpenGL) #define vtkRenderingVolume_AUTOINIT 1(vtkRenderingVolumeOpenGL) but after compiling vtk with opengl2 support some of them not using anymore than I tried to use with "autoint.h" like #include VTK_MODULE_INIT(vtkRenderingOpenGL2) after that I get warning : vtkInteractorStyleSwitchBase (00000000026CCE00): Warning: Link to vtkInteractionStyle for default style selection.Thus, what is the correct initialization for vtkRenderingCore and vtkRenderingVolume with opengl2 backend. Kind Regrads. Ahmet Dogan From mallikarjun49 at gmail.com Thu Aug 7 03:09:39 2014 From: mallikarjun49 at gmail.com (Mallikarjun K) Date: Thu, 7 Aug 2014 12:39:39 +0530 Subject: [vtkusers] vtkImageMathematics (A NOT B type Operation)? Message-ID: Hi All, Is there any Operation in vtkImageMathMatics which gives" only ImageData1 which is not intersecting with ImageData2" after subtracting ImageData2 from ImageData1. Thanks in Advance. -- *Regards:* Mallik -------------- next part -------------- An HTML attachment was scrubbed... URL: From kim.rosenbohm at posteo.de Thu Aug 7 03:32:56 2014 From: kim.rosenbohm at posteo.de (Kim Rosenbohm) Date: Thu, 07 Aug 2014 09:32:56 +0200 Subject: [vtkusers] vtkGuiSupportQtOpengl In-Reply-To: <53E308A5.7030306@gmail.com> References: <53E308A5.7030306@gmail.com> Message-ID: Hi Ahmet. Afair QVTKWidget2 uses a QGLWidget as a base and QVTKWidget a QWidget. I had problems here with QVTKWidget, but the "2"-version worked flawlessly... Best Regards, Kim Am 07.08.2014 07:03 schrieb Ahmet Do?an: > hi, > when I was compiling vtk from source I saw an option apart from > VTK_Group_Qt. it was module_vtkGuiSupportQtOpengl it has QVTKWidget2 > like QVTKWidget. > What is the differences between this two module? > > Kind Regards. > _______________________________________________ > Powered by www.kitware.com [1] > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html [2] > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ [3] > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers [4] -- Kim Rosenbohm, Barf??erstr. 7, 37073 G?ttingen, 0163/8723172 Links: ------ [1] http://www.kitware.com [2] http://www.kitware.com/opensource/opensource.html [3] http://www.vtk.org/Wiki/VTK_FAQ [4] http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From berk.geveci at kitware.com Thu Aug 7 09:20:39 2014 From: berk.geveci at kitware.com (Berk Geveci) Date: Thu, 7 Aug 2014 09:20:39 -0400 Subject: [vtkusers] Status of VTK Python 3 wrapper support In-Reply-To: References: <1406810682351-5728034.post@n5.nabble.com> Message-ID: Ondrej's blog is pretty scary :-) It re-emphasizes my thought that this is not a step to be taken lightly. It will take time to get a code base working on both 2.x and 3.x and we need to do it while continuing to support 2.x well. We also need to figure out what the minimum x in 2.x is. It sounds like it should be at least 6 but possibly 7 or higher. -berk On Wed, Aug 6, 2014 at 1:33 PM, Matthew Brett wrote: > Hi, > > On Wed, Aug 6, 2014 at 4:25 AM, Berk Geveci > wrote: > > Hi David, > > > > Sounds great. I am glad that you are hooked on the wrappers :-) You have > > done a lot of wonderful work on them and as a big Python fan I am very > > grateful. > > > > PS: Sorry for the late reply. I was on vacation. > > > > Best, > > -berk > > > > > > On Fri, Aug 1, 2014 at 11:30 AM, David Gobbi > wrote: > >> > >> Hi Berk, > >> > >> Thanks for the insight into how this will impact your customers. I > wasn't > >> suggesting the the conversion of the tests be done now, or even before > >> the core. And, yes, you're probably right that 2-to-3 is the way to go > >> until > >> the major sites are ready to switch to python3. > >> > >> For myself, there are two major wrapper-related tasks that have far > higher > >> priority than py3k: > >> > >> 1) wrap enum types (so that enum types can be used as method args), > >> and also wrap namespaces, since these are blockers for some code that > >> I want to wrap. > >> > >> 2) eliminate the "PyVTKClass" type, which relies on an obsolete > metaclass > >> mechanism (search for "Don Beaudry hack" if you're curious) and instead > >> use python's unified type/class extension system. > >> > >> For #2, I'll see if I can put up a wiki page with more detail. But I > >> don't have > >> time to move forward on either 1 or 2 until the fall. And you aren't > >> going > >> to see me pushing for py3k, because I still have no need for it myself. > I > >> just want to be involved when the conversion occurs, because wrapper > >> stuff is fun. > > Just for reference, nearly all of the big scientific python projects > (numpy, scipy, matplotlib, ipython, sympy) have switched to using a > common code-base for Python 2 / Python 3. [1, 2]. This now seems to > be the standard Python advice if you want to keep Python 2 > compatibility [3] (in days gone past, the standard advice was to use > 2to3). The numerical Python community is likely to start switching > over to standardizing on Python 3 fairly soon (over the next couple of > years), and all standard numerical packages now have Python 3 support. > In general our experience has been that when we used a compatibility > file such as that provided by the 'six' [6] project, and with good > tests, porting to a Python 2 / 3 compatible code base was a lot easier > than we had feared. > > Cheers, > > Matthew > > [1] > http://ondrejcertik.blogspot.com/2013/08/how-to-support-both-python-2-and-3.html > [2] > http://asmeurersympy.wordpress.com/2013/08/22/python-3-single-codebase-vs-2to3 > [3] https://docs.python.org/3/howto/pyporting.html > [6] https://pypi.python.org/pypi/six > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cedric.rotolo at oce.com Thu Aug 7 10:14:52 2014 From: cedric.rotolo at oce.com (Cedric R) Date: Thu, 7 Aug 2014 07:14:52 -0700 (PDT) Subject: [vtkusers] Binding a polydata to the ground Message-ID: <1407420892311-5728136.post@n5.nabble.com> Hello, I have a polydata that is an elevated terrain map. I need to add vertical faces to the polydata to "bind" it to the z=0 plane. I consider using vtkFeatureEdges to get the boundary edges of the polydata, create a copy of this contour and use vtkTransformFilter to project the copy to the z=0 plane. Then I have two questions: 1) How can I merge the contour and the projected contour into one single "wall" polydata 2) How can I merge the "wall" polydata with the terrain map polydata? Of course if someone knows a better/simpler way to do this, I am open to suggestions. Thanks Cedric -- View this message in context: http://vtk.1045678.n5.nabble.com/Binding-a-polydata-to-the-ground-tp5728136.html Sent from the VTK - Users mailing list archive at Nabble.com. From matthew.brett at gmail.com Thu Aug 7 13:17:28 2014 From: matthew.brett at gmail.com (Matthew Brett) Date: Thu, 7 Aug 2014 10:17:28 -0700 Subject: [vtkusers] Status of VTK Python 3 wrapper support In-Reply-To: References: <1406810682351-5728034.post@n5.nabble.com> Message-ID: Hi, On Thu, Aug 7, 2014 at 6:20 AM, Berk Geveci wrote: > Ondrej's blog is pretty scary :-) > > It re-emphasizes my thought that this is not a step to be taken lightly. It > will take time to get a code base working on both 2.x and 3.x and we need to > do it while continuing to support 2.x well. We also need to figure out what > the minimum x in 2.x is. It sounds like it should be at least 6 but possibly > 7 or higher. The big headache in porting is the unicode / bytes issue, because it involves thinking rather hard about whether a particular stream should be strings or bytes - but if there's not much of that, the porting work is usually pretty light. I can certainly help if you let me know how, I've done the port for a couple of code-bases. Python 2.6 is fine, but you might want to support only Python 3.3 or later, because this allows you to use b'my bytes' # Python 3, available in Python >= 2.6 u'my string' # Python 2, available in Python >=3.3 in Python 2 and Python 3, and that turns out to be very convenient. Cheers, Matthew From MEEHANBT at nv.doe.gov Thu Aug 7 13:48:23 2014 From: MEEHANBT at nv.doe.gov (Meehan, Bernard) Date: Thu, 7 Aug 2014 17:48:23 +0000 Subject: [vtkusers] vtkExtractArraysOverTime Message-ID: Are there any simple examples of using vtkExtractArraysOverTime? I didn't see any in the online documentation? http://www.vtk.org/doc/nightly/html/classvtkExtractArraysOverTime.html#details -------------- next part -------------- An HTML attachment was scrubbed... URL: From pletzer at txcorp.com Thu Aug 7 15:14:41 2014 From: pletzer at txcorp.com (Alex Pletzer) Date: Thu, 7 Aug 2014 12:14:41 -0700 (PDT) Subject: [vtkusers] vtkTextureMapToSphere and PreventSeamOff not working as expected In-Reply-To: <53E2B2E0.6080309@txcorp.com> References: <53E2B2E0.6080309@txcorp.com> Message-ID: <1407438881925-5728139.post@n5.nabble.com> All, One way to solve the above problem is to set the end theta coordinate to 360 - eps, where eps is ~ 1.e-4. eps = 1.e-4 sphere1.SetEndTheta(360. - eps) A very small gap remains visible but the topology is now correct. --Alex -- View this message in context: http://vtk.1045678.n5.nabble.com/vtkTextureMapToSphere-and-PreventSeamOff-not-working-as-expected-tp5728125p5728139.html Sent from the VTK - Users mailing list archive at Nabble.com. From pletzer at txcorp.com Thu Aug 7 15:26:23 2014 From: pletzer at txcorp.com (Alex Pletzer) Date: Thu, 7 Aug 2014 12:26:23 -0700 (PDT) Subject: [vtkusers] vtkTextureMapToSphere and PreventSeamOff not working as expected In-Reply-To: <20140807005202.C0FD751CD0@public.kitware.com> References: <53E2B2E0.6080309@txcorp.com> <20140807005202.C0FD751CD0@public.kitware.com> Message-ID: <1407439583493-5728140.post@n5.nabble.com> Thanks Bernard! Works! --Alex -- View this message in context: http://vtk.1045678.n5.nabble.com/vtkTextureMapToSphere-and-PreventSeamOff-not-working-as-expected-tp5728125p5728140.html Sent from the VTK - Users mailing list archive at Nabble.com. From aur.marsan at gmail.com Thu Aug 7 19:03:50 2014 From: aur.marsan at gmail.com (=?UTF-8?Q?Aur=C3=A9lien_Marsan?=) Date: Thu, 7 Aug 2014 19:03:50 -0400 Subject: [vtkusers] Split a surface by sharp edges Message-ID: Dear VTK users, Is there a way to split a surface by sharp edges using simple VTK filters ? (I am using python) Thanks in advance for your answer. Aur?lien Marsan -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Thu Aug 7 19:53:28 2014 From: dave.demarle at kitware.com (David E DeMarle) Date: Thu, 7 Aug 2014 19:53:28 -0400 Subject: [vtkusers] Split a surface by sharp edges In-Reply-To: References: Message-ID: PolyDataNormals followed by ConnectivityFilter was a suggested pipeline for that before. http://vtk.1045678.n5.nabble.com/Filter-to-split-surface-with-geometric-parameters-angle-td1250765.html David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Thu, Aug 7, 2014 at 7:03 PM, Aur?lien Marsan wrote: > Dear VTK users, > > Is there a way to split a surface by sharp edges using simple VTK filters > ? > (I am using python) > > Thanks in advance for your answer. > > Aur?lien Marsan > > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From 523853955 at qq.com Thu Aug 7 23:05:33 2014 From: 523853955 at qq.com (samuelhu) Date: Thu, 7 Aug 2014 20:05:33 -0700 (PDT) Subject: [vtkusers] Question with "AddObserver" from C# Kitware.VTK Message-ID: <1407467133995-5728144.post@n5.nabble.com> Hello: recently,i have an Question with "AddObserver" from C# Kitware.VTK. i want to make a pick operation, so i use the "AddObserver" command,but it's always show errors the following messages: error 16 parameter 2: can't translate ?methods? to ?Kitware.VTK.vtkCommand? D:\VTK\testVTK\Form1.cs 625 71 testVTK the program line like this: iren.AddObserver((uint)vtkCommand.EventIds.KeyPressEvent,KeyPressVtk, 0.01f); note: public void KeyPressVtk(vtkObject caller, uint eventId, object clientData, IntPtr callData) { string key = iren.GetKeySym(); switch (key.ToLower()) { case "h": if (listPickerActors != null) { if (listPickerActors.Count > 0) { .... } } break; case "c": //ClearPickers(); break; default: break; } iren.Render(); } but,i make it when i use the "VTK-5.0.1-wrap-1.1",it's also make program with C# so,can you tell me ,how to use the "AddObserver" in C# Kitware.VTK. and make pick operation -- View this message in context: http://vtk.1045678.n5.nabble.com/Question-with-AddObserver-from-C-Kitware-VTK-tp5728144.html Sent from the VTK - Users mailing list archive at Nabble.com. From dlrdave at aol.com Fri Aug 8 06:06:09 2014 From: dlrdave at aol.com (David Cole) Date: Fri, 8 Aug 2014 06:06:09 -0400 (EDT) Subject: [vtkusers] Question with "AddObserver" from C# Kitware.VTK In-Reply-To: <1407467133995-5728144.post@n5.nabble.com> References: <1407467133995-5728144.post@n5.nabble.com> Message-ID: <8D1810782BBDF9C-2CB8-513F@webmail-d212.sysops.aol.com> Are you using ActiViz .NET? The BoxWidget example that comes with ActiViz .NET shows how to sign up for VTK events like this: boxWidget.EndInteractionEvt += new vtkObject.vtkObjectEventHandler(SelectPolygons); public static void SelectPolygons(vtkObject sender, vtkObjectEventArgs e) { ... } So... you should be able to do something similar with "KeyPressEvt" on the "iren" object. Also, the EventMonitor example demonstrates how to hook/unhook events, and what types of variables you need to hold onto in order for events to work well from C#. HTH, David C. From francois.touvet at inria.fr Fri Aug 8 10:50:11 2014 From: francois.touvet at inria.fr (ftouvet) Date: Fri, 8 Aug 2014 07:50:11 -0700 (PDT) Subject: [vtkusers] Polydata Normals, once again Message-ID: <1407509411482-5728147.post@n5.nabble.com> Hello, I am facing a strange problem concerning the normals of a polydata: there are normals pointing both inside and outside! The thing is that it is not an usual polydata, it is generated from a 360? rotation of a contour on a plane. My guess is that it has not one but two surfaces. I tried to change parameters of the different filters but no good result came out; I also tried to recompute normals with vtkPolyDataNormals but I always get my double set of normals. My question now is: is it possible to delete a part of the normals? of the mesh? Here is a sample code to illustrate my question: plane = vtk.vtkPlane() plane.SetOrigin(0.0,0.0,0.0) plane.SetNormal(0.0, 1.0, 0.0) clipper = vtk.vtkClipPolyData() clipper.SetClipFunction(plane) clipper.InsideOutOn() clipper.SetInput(polyData) polyData=clipper.GetOutput() # rotational extrusion along z-direction extruder = vtk.vtkRotationalExtrusionFilter() extruder.SetAngle(360) extruder.SetInput(polyData) extruder.SetResolution(50) #extruder.SetCapping(1) polyData=extruder.GetOutput() [0] http://docs.scipy.org/doc/numpy/reference/generated/numpy.mgrid.html -- View this message in context: http://vtk.1045678.n5.nabble.com/Polydata-Normals-once-again-tp5728147.html Sent from the VTK - Users mailing list archive at Nabble.com. From pletzer at txcorp.com Fri Aug 8 11:33:54 2014 From: pletzer at txcorp.com (Alex Pletzer) Date: Fri, 8 Aug 2014 08:33:54 -0700 (PDT) Subject: [vtkusers] vtkTextureMapToSphere and PreventSeamOff not working as expected In-Reply-To: <20140807005202.C0FD751CD0@public.kitware.com> References: <53E2B2E0.6080309@txcorp.com> <20140807005202.C0FD751CD0@public.kitware.com> Message-ID: <1407512034479-5728148.post@n5.nabble.com> Below is the corrected code... import vtk """ How to add texture to a sphere """ filename1 = "one.png" # Create a render window ren = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren) renWin.SetSize(480,480) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) # Generate a sphere polydata sphere1 = vtk.vtkTexturedSphereSource() sphere1.SetThetaResolution(12) sphere1.SetPhiResolution(12) # co-latitude # Read the image data from file reader1 = vtk.vtkPNGReader() reader1.SetFileName(filename1) # Create texture object texture1 = vtk.vtkTexture() texture1.SetInputConnection(reader1.GetOutputPort()) # Create mapper and set the mapped texture as input mapper1 = vtk.vtkPolyDataMapper() mapper1.SetInputConnection(sphere1.GetOutputPort()) # Create actor and set the mapper and the texture actor1 = vtk.vtkActor() actor1.SetMapper(mapper1) actor1.SetTexture(texture1) ren.AddActor(actor1) iren.Initialize() renWin.Render() iren.Start() -- View this message in context: http://vtk.1045678.n5.nabble.com/vtkTextureMapToSphere-and-PreventSeamOff-not-working-as-expected-tp5728125p5728148.html Sent from the VTK - Users mailing list archive at Nabble.com. From david.gobbi at gmail.com Fri Aug 8 12:07:58 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 8 Aug 2014 10:07:58 -0600 Subject: [vtkusers] Help building Python wheels for VTK In-Reply-To: References: <53e17def2dc65_48b93fd8b2693d48102957@shanghai.local.mail> Message-ID: Okay, I've taken a long look at PEP 427 and I have an inkling of how a python VTK wheel can be built. First, a new CMake variable "VTK_BUILD_PYTHON_WHEEL" should be added, to turn on the wheel-building machinery. When this variable is set, the following should happen: 1) CMake should build a wheel-compatible vtk module directory, which will differ from the current vtk python module directory in the following ways: 1a) The .py files will not be compiled (no .pyc files) 1b) The directory will contain not only the extension modules (i.e. the .so/.pyd files), but it will also contain all of the VTK runtime libraries that the extension modules depend on. 1c) CMake will have to set the loader paths in all the shared objects so that they can find each other. 2) After CMake has built the module, the python wheel-building tools can hopefully do the rest: 2a) CMake will check that python has the "wheel" installed 2b) the python module directory that CMake built above becomes the wheel platlib subdir. 2c) "wheel" will create all the other necessary files and create the .whl I know how to do 1a and 1b, and can look into 1c (CMake should easily be able to do it for all platforms). I probably won't be able to do any work on this in the immediate future, though. - David From dave.demarle at kitware.com Fri Aug 8 12:15:46 2014 From: dave.demarle at kitware.com (David E DeMarle) Date: Fri, 8 Aug 2014 12:15:46 -0400 Subject: [vtkusers] Help building Python wheels for VTK In-Reply-To: References: <53e17def2dc65_48b93fd8b2693d48102957@shanghai.local.mail> Message-ID: Thanks Dave for laying it out. I'll try and steal some of my cycles too, but they likely won't come until the runup to the next release (a month or more from now). We do 1c for paraview and vtkpython binaries. The exact incantations vary per OS. Search for fixup bundle for reference material. David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Fri, Aug 8, 2014 at 12:07 PM, David Gobbi wrote: > Okay, I've taken a long look at PEP 427 and I have an inkling of how a > python VTK wheel can be built. > > First, a new CMake variable "VTK_BUILD_PYTHON_WHEEL" should be > added, to turn on the wheel-building machinery. When this variable is set, > the following should happen: > > > 1) CMake should build a wheel-compatible vtk module directory, > which will differ from the current vtk python module directory in the > following ways: > > 1a) The .py files will not be compiled (no .pyc files) > > 1b) The directory will contain not only the extension modules (i.e. > the .so/.pyd files), but it will also contain all of the VTK runtime > libraries that the extension modules depend on. > > 1c) CMake will have to set the loader paths in all the shared objects > so that they can find each other. > > > 2) After CMake has built the module, the python wheel-building tools > can hopefully do the rest: > > 2a) CMake will check that python has the "wheel" installed > > 2b) the python module directory that CMake built above becomes the > wheel platlib subdir. > > 2c) "wheel" will create all the other necessary files and create the .whl > > > I know how to do 1a and 1b, and can look into 1c (CMake should easily > be able to do it for all platforms). I probably won't be able to do > any work on this in the immediate future, though. > > - David > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tottek at gmail.com Fri Aug 8 15:06:39 2014 From: tottek at gmail.com (Totte Karlsson) Date: Fri, 8 Aug 2014 12:06:39 -0700 (PDT) Subject: [vtkusers] Creating a surface with three or more points Message-ID: <1407524799402-5728151.post@n5.nabble.com> Hi, I seem to got stuck on something seeming very basic. I need to create a surface (that I can render) from an arbitrary number of 3D points, typically less than 5-6 points. I'll use it to visualize 'planes' in molecular geometries. The first geometry I am trying out is just the faces of a cube, i.e from 8 points creating the 6 faces of the cube. But seem to get stuck.. I started to create each plane and was using delaunay2d (part of the problem I believe) Code looking like this vtkSmartPointer polydata = vtkSmartPointer::New(); polydata->SetPoints(mPoints); // Triangulate the grid points vtkSmartPointer delaunay = vtkSmartPointer::New(); delaunay->SetInputData(polydata); delaunay->Update(); // Create a mapper and actor vtkSmartPointer triangulatedMapper = GetMapper(); triangulatedMapper->SetInputConnection(delaunay->GetOutputPort()); vtkSmartPointer triangulatedActor = GetActor(); triangulatedActor->SetMapper(triangulatedMapper); where mPoints contain 4 points defining one cube face. However, the above only works for the planes that are perpendicular to the z axes. How to construct the other 4 planes? The ones parallel to the z-axes? I guess I should not need to use triangulation at all here, but I seem not be able to find a simple example on how to just create and render a plane from 4 points. -tk -- View this message in context: http://vtk.1045678.n5.nabble.com/Creating-a-surface-with-three-or-more-points-tp5728151.html Sent from the VTK - Users mailing list archive at Nabble.com. From akashgaurav89 at yahoo.in Fri Aug 8 16:39:31 2014 From: akashgaurav89 at yahoo.in (Akash Gaurav) Date: Sat, 9 Aug 2014 04:39:31 +0800 Subject: [vtkusers] Which vtk library used for 2D plots Message-ID: <1407530371.72940.YahooMailNeo@web193004.mail.sg3.yahoo.com> Hello All, I am new to vtk world, but i tried most of the example. I am looking for a way to plot 2-D (X vs Y) graph using vtk and also spectral plot. Can I anyone help me to figure out which library should I use and how?? Thank you. Akash? -------------- next part -------------- An HTML attachment was scrubbed... URL: From tottek at gmail.com Fri Aug 8 16:44:42 2014 From: tottek at gmail.com (Totte Karlsson) Date: Fri, 8 Aug 2014 13:44:42 -0700 (PDT) Subject: [vtkusers] Creating a surface with three or more points In-Reply-To: <1407524799402-5728151.post@n5.nabble.com> References: <1407524799402-5728151.post@n5.nabble.com> Message-ID: <1407530682170-5728153.post@n5.nabble.com> Well, I realized what may solve this simple(?) problem is to create a polygon, and I found a polygon example: http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/Polygon That should do it! Great. -- View this message in context: http://vtk.1045678.n5.nabble.com/Creating-a-surface-with-three-or-more-points-tp5728151p5728153.html Sent from the VTK - Users mailing list archive at Nabble.com. From matthew.brett at gmail.com Fri Aug 8 16:46:09 2014 From: matthew.brett at gmail.com (Matthew Brett) Date: Fri, 8 Aug 2014 13:46:09 -0700 Subject: [vtkusers] Help building Python wheels for VTK In-Reply-To: References: <53e17def2dc65_48b93fd8b2693d48102957@shanghai.local.mail> Message-ID: Hi, On Fri, Aug 8, 2014 at 9:15 AM, David E DeMarle wrote: > Thanks Dave for laying it out. > > I'll try and steal some of my cycles too, but they likely won't come until > the runup to the next release (a month or more from now). > > We do 1c for paraview and vtkpython binaries. The exact incantations vary > per OS. Search for fixup bundle for reference material. > > > > > David E DeMarle > Kitware, Inc. > R&D Engineer > 21 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-881-4909 > > > On Fri, Aug 8, 2014 at 12:07 PM, David Gobbi wrote: >> >> Okay, I've taken a long look at PEP 427 and I have an inkling of how a >> python VTK wheel can be built. >> >> First, a new CMake variable "VTK_BUILD_PYTHON_WHEEL" should be >> added, to turn on the wheel-building machinery. When this variable is >> set, >> the following should happen: >> >> >> 1) CMake should build a wheel-compatible vtk module directory, >> which will differ from the current vtk python module directory in the >> following ways: >> >> 1a) The .py files will not be compiled (no .pyc files) >> >> 1b) The directory will contain not only the extension modules (i.e. >> the .so/.pyd files), but it will also contain all of the VTK runtime >> libraries that the extension modules depend on. >> >> 1c) CMake will have to set the loader paths in all the shared objects >> so that they can find each other. >> >> >> 2) After CMake has built the module, the python wheel-building tools >> can hopefully do the rest: >> >> 2a) CMake will check that python has the "wheel" installed >> >> 2b) the python module directory that CMake built above becomes the >> wheel platlib subdir. >> >> 2c) "wheel" will create all the other necessary files and create the .whl >> >> >> I know how to do 1a and 1b, and can look into 1c (CMake should easily >> be able to do it for all platforms). I probably won't be able to do >> any work on this in the immediate future, though. >> >> - David Thanks for looking into this - it would be a huge win to be able to do 'pip install vtk'... If there is anything I can do to help, please let me know, Cheers, Matthew From mehrtash at bwh.harvard.edu Fri Aug 8 17:27:01 2014 From: mehrtash at bwh.harvard.edu (Alireza Mehrtash) Date: Fri, 8 Aug 2014 17:27:01 -0400 Subject: [vtkusers] Transparent Viewport Message-ID: Hi All, I have two renderers in a render window ?with one of them as a bottom left viewport (the code and the picture are attached). I want the viewport renderer to be transparent exactly like the vtk oreientation marker [1]. I would appreciate if you help me achieving this. Thanks, Alireza [1] http://www.itk.org/Wiki/VTK/Examples/Cxx/Widgets/OrientationMarkerWidget -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- cmake_minimum_required(VERSION 2.8) PROJECT(MultipleViewports) find_package(VTK REQUIRED) include(${VTK_USE_FILE}) add_executable(MultipleViewports MACOSX_BUNDLE MultipleViewports) if(VTK_LIBRARIES) target_link_libraries(MultipleViewports ${VTK_LIBRARIES}) else() target_link_libraries(MultipleViewports vtkHybrid vtkWidgets) endif() -------------- next part -------------- A non-text attachment was scrubbed... Name: Screenshot from 2014-08-08 15:34:56.png Type: image/png Size: 15949 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: MultipleViewports.cxx Type: text/x-c++src Size: 1761 bytes Desc: not available URL: From mehrtash at bwh.harvard.edu Fri Aug 8 17:59:11 2014 From: mehrtash at bwh.harvard.edu (Alireza Mehrtash) Date: Fri, 8 Aug 2014 17:59:11 -0400 Subject: [vtkusers] Transparent Viewport In-Reply-To: References: Message-ID: I tried that but it gives: vtkRendererCollection (0x8a6be0): Invalid layer for renderer: not rendered. On Fri, Aug 8, 2014 at 5:50 PM, David E DeMarle wrote: > Call SetLayer(1) on the overlay layer. > On Aug 8, 2014 5:27 PM, "Alireza Mehrtash" > wrote: > >> Hi All, >> >> I have two renderers in a render window ?with one of them as a bottom >> left viewport (the code and the picture are attached). I want the viewport >> renderer to be transparent exactly like the vtk oreientation marker [1]. I >> would appreciate if you help me achieving this. >> >> Thanks, >> Alireza >> >> >> [1] >> http://www.itk.org/Wiki/VTK/Examples/Cxx/Widgets/OrientationMarkerWidget >> >> _______________________________________________ >> 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 >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> The information in this e-mail is intended only for the person to whom > it is > addressed. If you believe this e-mail was sent to you in error and the > e-mail > contains patient information, please contact the Partners Compliance > HelpLine at > http://www.partners.org/complianceline . If the e-mail was sent to you in > error > but does not contain patient information, please contact the sender and > properly > dispose of the e-mail. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aur.marsan at gmail.com Fri Aug 8 18:16:14 2014 From: aur.marsan at gmail.com (=?UTF-8?Q?Aur=C3=A9lien_Marsan?=) Date: Fri, 8 Aug 2014 18:16:14 -0400 Subject: [vtkusers] Split a surface by sharp edges In-Reply-To: References: Message-ID: Thank you a lot David. I didn't had the good keywords for searching. Have a nice week-end, Aur?lien 2014-08-07 19:53 GMT-04:00 David E DeMarle : > PolyDataNormals followed by ConnectivityFilter was a suggested pipeline > for that before. > > > http://vtk.1045678.n5.nabble.com/Filter-to-split-surface-with-geometric-parameters-angle-td1250765.html > > David E DeMarle > Kitware, Inc. > R&D Engineer > 21 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-881-4909 > > > On Thu, Aug 7, 2014 at 7:03 PM, Aur?lien Marsan > wrote: > >> Dear VTK users, >> >> Is there a way to split a surface by sharp edges using simple VTK filters >> ? >> (I am using python) >> >> Thanks in advance for your answer. >> >> Aur?lien Marsan >> >> _______________________________________________ >> 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 >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sclaassens.ad at gmail.com Sat Aug 9 09:29:35 2014 From: sclaassens.ad at gmail.com (Sam Claassens) Date: Sat, 9 Aug 2014 08:29:35 -0500 Subject: [vtkusers] Inheriting vtkInteractorStyle Message-ID: Hi, I'm trying to create a class that manages a custom set of interactions in python and having some trouble hooking to key and mouse events. In the CustomInteraction.py example ( http://vtk.org/gitweb?p=VTK.git;a=blob_plain;f=Examples/GUI/Python/CustomInteraction.py) it is recommended that you should subclass vtkInteractorStyle to do this (instead of observers). I've built a test class called Interactor3rdPerson that should override the normal events, where at the moment I'm trying to catch the keyboard and mouse events at the 'i=0' places in debug: class Interactor3rdPerson(vtk.vtkInteractorStyleUser): # The tracked object. __trackedObject = None def __init__(self, trackedSceneObject): self.__trackedObject = trackedSceneObject i= 0 # Overridden update method def OnTimer(self): i = 0 def OnKeyPress(self): i = 0 def OnKeyRelease(self): i = 0 def OnLeftButtonDown(self): i = 0 In the main program I assign this to the render window interactor: ... # Change the interactor to the new camera interactor = Interactor3rdPerson.Interactor3rdPerson(axes) # axes is a scene object, but it isn't used yet # An interactor renderWindowInteractor = vtk.vtkRenderWindowInteractor() renderWindowInteractor.SetInteractorStyle(interactor) renderWindowInteractor.SetRenderWindow(renderWindow) # renderWindowInteractor.CreateTimer(0) interactor.EnabledOn() # Render an image (lights and cameras are created automatically) renderWindow.Render() # Begin mouse interaction renderWindowInteractor.Start() renderWindowInteractor.Initialize() The issue is that I don't seem to be catching any input events. The normal inputs are being triggered (I can pick and turn wireframes on) but I don't see any catches when putting breakpoints at the 'i=0' places in the custom interactor. Is there something that I'm missing or should be enabling? Thanks, Sam -------------- next part -------------- An HTML attachment was scrubbed... URL: From pletzer at txcorp.com Sat Aug 9 17:20:34 2014 From: pletzer at txcorp.com (Alexander Pletzer) Date: Sat, 09 Aug 2014 15:20:34 -0600 Subject: [vtkusers] faint png image Message-ID: <53E690A2.2010804@txcorp.com> Hello VTK'ians, I'm trying to display a png logo in the renderer. The result, for some reason, is very faint. I tried to set the layer number but had no effect. Also tried to change the size with SetWidth but that had no effect either (??) What am I doing wrong? Thanks in advance for any suggestion! --Alex import vtk reader = vtk.vtkPNGReader() mapper = vtk.vtkImageMapper() actor = vtk.vtkActor2D() reader.SetFileName('solarfs.png') mapper.SetInputConnection(reader.GetOutputPort()) actor.SetMapper(mapper) ren = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() iren = vtk.vtkRenderWindowInteractor() renWin.AddRenderer(ren) iren.SetRenderWindow(renWin) ren.SetBackground(1,1,1) renWin.SetSize(640, 640) actor.SetPosition2(50, 50) actor.SetWidth(0.1) # no effect ren.AddActor(actor) # very faint picture iren.Initialize() renWin.Render() iren.Start() -------------- next part -------------- A non-text attachment was scrubbed... Name: solarfs.png Type: image/png Size: 19489 bytes Desc: not available URL: From g.bogle at auckland.ac.nz Sat Aug 9 19:25:52 2014 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Sat, 9 Aug 2014 23:25:52 +0000 Subject: [vtkusers] Odd opacity issue Message-ID: Hi, I'm using vtkRenderWindowInteractor (VTK 5.10) in Qt, rendering spheres. I'm trying to implement a degree of transparency, like this: actor->GetProperty()->SetOpacity(opacity); applied to all the spheres. If opacity is less than 1 the image immediately changes in unexpected ways. See the two attached images, with opacity = 1.0 and 0.99. It looks as if spheres have had their positions and sizes changed. But when I rotate the scene it becomes apparent that something else is happening. Some of the "foreground" spheres move from left to right (for example) while others apparently in the foreground are moving right to left. It seems that the order of rendering of the spheres, which normally places the most remote first and the nearest last, has somehow been messed up, so that spheres at the back are being rendered last so that they appear to be the closest. Maybe the order has been simply reversed, but the visual effect is made more confusing by parallax - my brain is interpreting the bigger spheres as closer. Is this a well-known issue, and is there a simple way to fix it? Thanks Gib -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: opacity99.png Type: image/png Size: 97644 bytes Desc: opacity99.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: opacity100.png Type: image/png Size: 90768 bytes Desc: opacity100.png URL: From g.bogle at auckland.ac.nz Sat Aug 9 19:48:02 2014 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Sat, 9 Aug 2014 23:48:02 +0000 Subject: [vtkusers] Odd opacity issue In-Reply-To: References: Message-ID: The problem is simply demonstrated with the opacity example: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/Opacity Adding this line: sphereActor->SetPosition(1.0,0.0,0.0); and setting the opacity of both actors to 0.99 gives an unexpected and unattractive result. I see that there have been posts about problems with opacity/transparency as far back as 2006. Maybe there is a solution... ________________________________ From: vtkusers [vtkusers-bounces at vtk.org] on behalf of Gib Bogle [g.bogle at auckland.ac.nz] Sent: Sunday, 10 August 2014 11:25 a.m. To: vtkusers at vtk.org Subject: [vtkusers] Odd opacity issue Hi, I'm using vtkRenderWindowInteractor (VTK 5.10) in Qt, rendering spheres. I'm trying to implement a degree of transparency, like this: actor->GetProperty()->SetOpacity(opacity); applied to all the spheres. If opacity is less than 1 the image immediately changes in unexpected ways. See the two attached images, with opacity = 1.0 and 0.99. It looks as if spheres have had their positions and sizes changed. But when I rotate the scene it becomes apparent that something else is happening. Some of the "foreground" spheres move from left to right (for example) while others apparently in the foreground are moving right to left. It seems that the order of rendering of the spheres, which normally places the most remote first and the nearest last, has somehow been messed up, so that spheres at the back are being rendered last so that they appear to be the closest. Maybe the order has been simply reversed, but the visual effect is made more confusing by parallax - my brain is interpreting the bigger spheres as closer. Is this a well-known issue, and is there a simple way to fix it? Thanks Gib -------------- next part -------------- An HTML attachment was scrubbed... URL: From kim.rosenbohm at posteo.de Sat Aug 9 19:57:51 2014 From: kim.rosenbohm at posteo.de (Kim Rosenbohm) Date: Sun, 10 Aug 2014 01:57:51 +0200 Subject: [vtkusers] Odd opacity issue In-Reply-To: References: Message-ID: <53E6B57F.4020900@posteo.de> Hi Gib. Proper blending of transparent objects is only possible by rendering them in the correct order. This can be tricky and if objects or polygons overlap you even won't get away with sorting them... You probably want depth peeling for order-independent transparency: http://www.vtk.org/Wiki/VTK/Depth_Peeling Best Regards, Kim Am 10.08.2014 01:48, schrieb Gib Bogle: > The problem is simply demonstrated with the opacity example: > http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/Opacity > > Adding this line: > sphereActor->SetPosition(1.0,0.0,0.0); > and setting the opacity of both actors to 0.99 gives an unexpected and > unattractive result. > > I see that there have been posts about problems with > opacity/transparency as far back as 2006. Maybe there is a solution... > ------------------------------------------------------------------------ > *From:* vtkusers [vtkusers-bounces at vtk.org] on behalf of Gib Bogle > [g.bogle at auckland.ac.nz] > *Sent:* Sunday, 10 August 2014 11:25 a.m. > *To:* vtkusers at vtk.org > *Subject:* [vtkusers] Odd opacity issue > > Hi, > I'm using vtkRenderWindowInteractor (VTK 5.10) in Qt, rendering > spheres. I'm trying to implement a degree of transparency, like this: > > actor->GetProperty()->SetOpacity(opacity); > > applied to all the spheres. > > If opacity is less than 1 the image immediately changes in unexpected > ways. See the two attached images, with opacity = 1.0 and 0.99. It > looks as if spheres have had their positions and sizes changed. But > when I rotate the scene it becomes apparent that something else is > happening. Some of the "foreground" spheres move from left to right > (for example) while others apparently in the foreground are moving > right to left. It seems that the order of rendering of the spheres, > which normally places the most remote first and the nearest last, has > somehow been messed up, so that spheres at the back are being rendered > last so that they appear to be the closest. Maybe the order has been > simply reversed, but the visual effect is made more confusing by > parallax - my brain is interpreting the bigger spheres as closer. > > Is this a well-known issue, and is there a simple way to fix it? > > Thanks > Gib > > > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.bogle at auckland.ac.nz Sat Aug 9 21:17:03 2014 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Sun, 10 Aug 2014 01:17:03 +0000 Subject: [vtkusers] Odd opacity issue In-Reply-To: <53E6B57F.4020900@posteo.de> References: , <53E6B57F.4020900@posteo.de> Message-ID: I think I spoke too soon (again). In each time step, sphere actors change position and some are added to or removed from the vtkRenderer. Dealing with that would be a nuisance (I would have to remove all the actors and add them back in the required order each time step), but doable without too much of a performance hit. More serious is the need to reorder the actors when the user rotates the scene. I am not keen to do this. I will explore depth peeling, but my concern is that it might affect the smoothness of scene rotation. ________________________________ From: Kim Rosenbohm [kim.rosenbohm at posteo.de] Sent: Sunday, 10 August 2014 11:57 a.m. To: Gib Bogle; vtkusers at vtk.org Subject: Re: [vtkusers] Odd opacity issue Hi Gib. Proper blending of transparent objects is only possible by rendering them in the correct order. This can be tricky and if objects or polygons overlap you even won't get away with sorting them... You probably want depth peeling for order-independent transparency: http://www.vtk.org/Wiki/VTK/Depth_Peeling Best Regards, Kim Am 10.08.2014 01:48, schrieb Gib Bogle: The problem is simply demonstrated with the opacity example: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/Opacity Adding this line: sphereActor->SetPosition(1.0,0.0,0.0); and setting the opacity of both actors to 0.99 gives an unexpected and unattractive result. I see that there have been posts about problems with opacity/transparency as far back as 2006. Maybe there is a solution... ________________________________ From: vtkusers [vtkusers-bounces at vtk.org] on behalf of Gib Bogle [g.bogle at auckland.ac.nz] Sent: Sunday, 10 August 2014 11:25 a.m. To: vtkusers at vtk.org Subject: [vtkusers] Odd opacity issue Hi, I'm using vtkRenderWindowInteractor (VTK 5.10) in Qt, rendering spheres. I'm trying to implement a degree of transparency, like this: actor->GetProperty()->SetOpacity(opacity); applied to all the spheres. If opacity is less than 1 the image immediately changes in unexpected ways. See the two attached images, with opacity = 1.0 and 0.99. It looks as if spheres have had their positions and sizes changed. But when I rotate the scene it becomes apparent that something else is happening. Some of the "foreground" spheres move from left to right (for example) while others apparently in the foreground are moving right to left. It seems that the order of rendering of the spheres, which normally places the most remote first and the nearest last, has somehow been messed up, so that spheres at the back are being rendered last so that they appear to be the closest. Maybe the order has been simply reversed, but the visual effect is made more confusing by parallax - my brain is interpreting the bigger spheres as closer. Is this a well-known issue, and is there a simple way to fix it? Thanks Gib _______________________________________________ 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 Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From helios.corona at gmail.com Sat Aug 9 21:36:13 2014 From: helios.corona at gmail.com (Sunrise) Date: Sat, 09 Aug 2014 18:36:13 -0700 Subject: [vtkusers] Converting ASCII VTK to binary that contains multiple scalars Message-ID: <53E6CC8D.3040005@gmail.com> I am trying to convert an ascii VTK file to binary VTK or binary VTI. The file is image data with 3 scalar arrays and 3 vector arrays. I saved these data in POINT DATA (but not FIELD DATA). Since the file size is large, I should convert the file from ascii VTK to binary VTK in order to send it from cluster to my computer. The problem is that if all 3 scalar data are saved in point data, when I read and then write them to binary VTK, the output file only contains 1 scalar data in point data, while the other scalar data are ignored. I know if I saved the data as XML format at first, this does not happen. However I can not write data to XML as first point, because the code that generates data does not use VTK (there is no VTK lib on cluster indeed) and I can only write output numbers in legacy VTK file format using my own function. Is there any way to contain all scalars of point data in conversion to binary? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.bogle at auckland.ac.nz Sat Aug 9 21:47:56 2014 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Sun, 10 Aug 2014 01:47:56 +0000 Subject: [vtkusers] Odd opacity issue In-Reply-To: <53E6B57F.4020900@posteo.de> References: , <53E6B57F.4020900@posteo.de> Message-ID: Hi Kim, I added the code for depth peeling that was provided at that site, but found that depth peeling was not used by the renderer. Maybe my graphics card/driver does not support it. To find out how to determine my card's capabilities, I followed a link there to a program called GLview426.exe. I am reluctant to run it, though, having been burned before by free software like this. Do you know if this is still the right way to interrogate the graphics card on Windows? Thanks Gib ________________________________ From: Kim Rosenbohm [kim.rosenbohm at posteo.de] Sent: Sunday, 10 August 2014 11:57 a.m. To: Gib Bogle; vtkusers at vtk.org Subject: Re: [vtkusers] Odd opacity issue Hi Gib. Proper blending of transparent objects is only possible by rendering them in the correct order. This can be tricky and if objects or polygons overlap you even won't get away with sorting them... You probably want depth peeling for order-independent transparency: http://www.vtk.org/Wiki/VTK/Depth_Peeling Best Regards, Kim Am 10.08.2014 01:48, schrieb Gib Bogle: The problem is simply demonstrated with the opacity example: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/Opacity Adding this line: sphereActor->SetPosition(1.0,0.0,0.0); and setting the opacity of both actors to 0.99 gives an unexpected and unattractive result. I see that there have been posts about problems with opacity/transparency as far back as 2006. Maybe there is a solution... ________________________________ From: vtkusers [vtkusers-bounces at vtk.org] on behalf of Gib Bogle [g.bogle at auckland.ac.nz] Sent: Sunday, 10 August 2014 11:25 a.m. To: vtkusers at vtk.org Subject: [vtkusers] Odd opacity issue Hi, I'm using vtkRenderWindowInteractor (VTK 5.10) in Qt, rendering spheres. I'm trying to implement a degree of transparency, like this: actor->GetProperty()->SetOpacity(opacity); applied to all the spheres. If opacity is less than 1 the image immediately changes in unexpected ways. See the two attached images, with opacity = 1.0 and 0.99. It looks as if spheres have had their positions and sizes changed. But when I rotate the scene it becomes apparent that something else is happening. Some of the "foreground" spheres move from left to right (for example) while others apparently in the foreground are moving right to left. It seems that the order of rendering of the spheres, which normally places the most remote first and the nearest last, has somehow been messed up, so that spheres at the back are being rendered last so that they appear to be the closest. Maybe the order has been simply reversed, but the visual effect is made more confusing by parallax - my brain is interpreting the bigger spheres as closer. Is this a well-known issue, and is there a simple way to fix it? Thanks Gib _______________________________________________ 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 Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.bogle at auckland.ac.nz Sat Aug 9 22:37:58 2014 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Sun, 10 Aug 2014 02:37:58 +0000 Subject: [vtkusers] Odd opacity issue In-Reply-To: <53E6B57F.4020900@posteo.de> References: , <53E6B57F.4020900@posteo.de> Message-ID: My card uses OpenGL 4.1 and supports all the required extensions. Depth peeling does not work though. ________________________________ From: Kim Rosenbohm [kim.rosenbohm at posteo.de] Sent: Sunday, 10 August 2014 11:57 a.m. To: Gib Bogle; vtkusers at vtk.org Subject: Re: [vtkusers] Odd opacity issue Hi Gib. Proper blending of transparent objects is only possible by rendering them in the correct order. This can be tricky and if objects or polygons overlap you even won't get away with sorting them... You probably want depth peeling for order-independent transparency: http://www.vtk.org/Wiki/VTK/Depth_Peeling Best Regards, Kim Am 10.08.2014 01:48, schrieb Gib Bogle: The problem is simply demonstrated with the opacity example: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/Opacity Adding this line: sphereActor->SetPosition(1.0,0.0,0.0); and setting the opacity of both actors to 0.99 gives an unexpected and unattractive result. I see that there have been posts about problems with opacity/transparency as far back as 2006. Maybe there is a solution... ________________________________ From: vtkusers [vtkusers-bounces at vtk.org] on behalf of Gib Bogle [g.bogle at auckland.ac.nz] Sent: Sunday, 10 August 2014 11:25 a.m. To: vtkusers at vtk.org Subject: [vtkusers] Odd opacity issue Hi, I'm using vtkRenderWindowInteractor (VTK 5.10) in Qt, rendering spheres. I'm trying to implement a degree of transparency, like this: actor->GetProperty()->SetOpacity(opacity); applied to all the spheres. If opacity is less than 1 the image immediately changes in unexpected ways. See the two attached images, with opacity = 1.0 and 0.99. It looks as if spheres have had their positions and sizes changed. But when I rotate the scene it becomes apparent that something else is happening. Some of the "foreground" spheres move from left to right (for example) while others apparently in the foreground are moving right to left. It seems that the order of rendering of the spheres, which normally places the most remote first and the nearest last, has somehow been messed up, so that spheres at the back are being rendered last so that they appear to be the closest. Maybe the order has been simply reversed, but the visual effect is made more confusing by parallax - my brain is interpreting the bigger spheres as closer. Is this a well-known issue, and is there a simple way to fix it? Thanks Gib _______________________________________________ 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 Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From kim.rosenbohm at posteo.de Sun Aug 10 06:17:03 2014 From: kim.rosenbohm at posteo.de (Kim Rosenbohm) Date: Sun, 10 Aug 2014 12:17:03 +0200 Subject: [vtkusers] Odd opacity issue In-Reply-To: References: , <53E6B57F.4020900@posteo.de> Message-ID: <53E7469F.9010401@posteo.de> Hi Gib. I'm a newbie to VTK and haven't used the DepthPeeling class myself, so I probably can't help you much... :/ I guess if you used OpenGL rendering, get no errors and the class tells you that "renderer->GetLastRenderingUsedDepthPeeling();" it should work. Maybe you have to fiddle around with the settings a bit. Or the implementation in your VTK version is broken... Best of luck, Kim Am 10.08.2014 04:37, schrieb Gib Bogle: > My card uses OpenGL 4.1 and supports all the required extensions. > Depth peeling does not work though. > ------------------------------------------------------------------------ > *From:* Kim Rosenbohm [kim.rosenbohm at posteo.de] > *Sent:* Sunday, 10 August 2014 11:57 a.m. > *To:* Gib Bogle; vtkusers at vtk.org > *Subject:* Re: [vtkusers] Odd opacity issue > > Hi Gib. > > Proper blending of transparent objects is only possible by rendering > them in the correct order. > This can be tricky and if objects or polygons overlap you even won't > get away with sorting them... > You probably want depth peeling for order-independent transparency: > http://www.vtk.org/Wiki/VTK/Depth_Peeling > > > Best Regards, > > Kim > > Am 10.08.2014 01:48, schrieb Gib Bogle: >> The problem is simply demonstrated with the opacity example: >> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/Opacity >> >> Adding this line: >> sphereActor->SetPosition(1.0,0.0,0.0); >> and setting the opacity of both actors to 0.99 gives an unexpected >> and unattractive result. >> >> I see that there have been posts about problems with >> opacity/transparency as far back as 2006. Maybe there is a solution... >> ------------------------------------------------------------------------ >> *From:* vtkusers [vtkusers-bounces at vtk.org] on behalf of Gib Bogle >> [g.bogle at auckland.ac.nz] >> *Sent:* Sunday, 10 August 2014 11:25 a.m. >> *To:* vtkusers at vtk.org >> *Subject:* [vtkusers] Odd opacity issue >> >> Hi, >> I'm using vtkRenderWindowInteractor (VTK 5.10) in Qt, rendering >> spheres. I'm trying to implement a degree of transparency, like this: >> >> actor->GetProperty()->SetOpacity(opacity); >> >> applied to all the spheres. >> >> If opacity is less than 1 the image immediately changes in unexpected >> ways. See the two attached images, with opacity = 1.0 and 0.99. It >> looks as if spheres have had their positions and sizes changed. But >> when I rotate the scene it becomes apparent that something else is >> happening. Some of the "foreground" spheres move from left to right >> (for example) while others apparently in the foreground are moving >> right to left. It seems that the order of rendering of the spheres, >> which normally places the most remote first and the nearest last, has >> somehow been messed up, so that spheres at the back are being >> rendered last so that they appear to be the closest. Maybe the order >> has been simply reversed, but the visual effect is made more >> confusing by parallax - my brain is interpreting the bigger spheres >> as closer. >> >> Is this a well-known issue, and is there a simple way to fix it? >> >> Thanks >> Gib >> >> >> _______________________________________________ >> Powered bywww.kitware.com >> >> Visit other Kitware open-source projects athttp://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at:http://www.vtk.org/Wiki/VTK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Sun Aug 10 07:20:44 2014 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Sun, 10 Aug 2014 07:20:44 -0400 Subject: [vtkusers] Odd opacity issue In-Reply-To: <53E7469F.9010401@posteo.de> References: <53E6B57F.4020900@posteo.de> <53E7469F.9010401@posteo.de> Message-ID: Maybe this example will be useful: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/CorrectlyRenderingTranslucentGeometry Bill On Sun, Aug 10, 2014 at 6:17 AM, Kim Rosenbohm wrote: > Hi Gib. > > I'm a newbie to VTK and haven't used the DepthPeeling class myself, so I > probably can't help you much... :/ > I guess if you used OpenGL rendering, get no errors and the class tells you > that "renderer->GetLastRenderingUsedDepthPeeling();" it should work. > Maybe you have to fiddle around with the settings a bit. Or the > implementation in your VTK version is broken... > > Best of luck, > > Kim > > Am 10.08.2014 04:37, schrieb Gib Bogle: > > My card uses OpenGL 4.1 and supports all the required extensions. Depth > peeling does not work though. > ________________________________ > From: Kim Rosenbohm [kim.rosenbohm at posteo.de] > Sent: Sunday, 10 August 2014 11:57 a.m. > To: Gib Bogle; vtkusers at vtk.org > Subject: Re: [vtkusers] Odd opacity issue > > Hi Gib. > > Proper blending of transparent objects is only possible by rendering them in > the correct order. > This can be tricky and if objects or polygons overlap you even won't get > away with sorting them... > You probably want depth peeling for order-independent transparency: > http://www.vtk.org/Wiki/VTK/Depth_Peeling > > Best Regards, > > Kim > > Am 10.08.2014 01:48, schrieb Gib Bogle: > > The problem is simply demonstrated with the opacity example: > http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/Opacity > > Adding this line: > sphereActor->SetPosition(1.0,0.0,0.0); > and setting the opacity of both actors to 0.99 gives an unexpected and > unattractive result. > > I see that there have been posts about problems with opacity/transparency as > far back as 2006. Maybe there is a solution... > ________________________________ > From: vtkusers [vtkusers-bounces at vtk.org] on behalf of Gib Bogle > [g.bogle at auckland.ac.nz] > Sent: Sunday, 10 August 2014 11:25 a.m. > To: vtkusers at vtk.org > Subject: [vtkusers] Odd opacity issue > > Hi, > I'm using vtkRenderWindowInteractor (VTK 5.10) in Qt, rendering spheres. > I'm trying to implement a degree of transparency, like this: > > actor->GetProperty()->SetOpacity(opacity); > > applied to all the spheres. > > If opacity is less than 1 the image immediately changes in unexpected ways. > See the two attached images, with opacity = 1.0 and 0.99. It looks as if > spheres have had their positions and sizes changed. But when I rotate the > scene it becomes apparent that something else is happening. Some of the > "foreground" spheres move from left to right (for example) while others > apparently in the foreground are moving right to left. It seems that the > order of rendering of the spheres, which normally places the most remote > first and the nearest last, has somehow been messed up, so that spheres at > the back are being rendered last so that they appear to be the closest. > Maybe the order has been simply reversed, but the visual effect is made more > confusing by parallax - my brain is interpreting the bigger spheres as > closer. > > Is this a well-known issue, and is there a simple way to fix it? > > Thanks > Gib > > > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > > > > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Unpaid intern in BillsBasement at noware dot com From g.bogle at auckland.ac.nz Sun Aug 10 19:26:13 2014 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Sun, 10 Aug 2014 23:26:13 +0000 Subject: [vtkusers] Odd opacity issue In-Reply-To: References: <53E6B57F.4020900@posteo.de> <53E7469F.9010401@posteo.de>, Message-ID: Hi Bill, This example confirms that depth peeling is not supported. I wonder why, since my system apparently has the required openGL extensions. I was able to check this with an excellent tool, GLEW, the OpenGL Extension Wrangler Library: http://glew.sourceforge.net/ BTW, it would be useful if this link replaced the one to glview on this page: http://www.vtk.org/Wiki/VTK_FAQ#How_do_I_check_which_OpenGL_versions_or_extensions_are_supported_by_my_graphic_card_or_OpenGL_implementation.3F I can't see a convenient way to use the vtkDepthSortPolydata in my case without making significant changes to my code. Rather than a single actor, my scene has multiple actors, and I modify their positions each time step. If I understand correctly, what I would need to do is work with translucentGeometry input connections instead of with actors. I think I would need to remove all input connections then remake them after modifying the sphere center positions. Or is there a way to get the input connection info and modify the sphere center position without rebuilding everything? Apart from the probable performance implications of doing this scene reconstruction every time step, there is another drawback in my case. I want to be able to control actor opacity individually - by making some actors opaque while the rest are translucent I can highlight them. Best Gib ________________________________________ From: Bill Lorensen [bill.lorensen at gmail.com] Sent: Sunday, 10 August 2014 11:20 p.m. To: Kim Rosenbohm Cc: Gib Bogle; vtkusers at vtk.org Subject: Re: [vtkusers] Odd opacity issue Maybe this example will be useful: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/CorrectlyRenderingTranslucentGeometry Bill On Sun, Aug 10, 2014 at 6:17 AM, Kim Rosenbohm wrote: > Hi Gib. > > I'm a newbie to VTK and haven't used the DepthPeeling class myself, so I > probably can't help you much... :/ > I guess if you used OpenGL rendering, get no errors and the class tells you > that "renderer->GetLastRenderingUsedDepthPeeling();" it should work. > Maybe you have to fiddle around with the settings a bit. Or the > implementation in your VTK version is broken... > > Best of luck, > > Kim > > Am 10.08.2014 04:37, schrieb Gib Bogle: > > My card uses OpenGL 4.1 and supports all the required extensions. Depth > peeling does not work though. > ________________________________ > From: Kim Rosenbohm [kim.rosenbohm at posteo.de] > Sent: Sunday, 10 August 2014 11:57 a.m. > To: Gib Bogle; vtkusers at vtk.org > Subject: Re: [vtkusers] Odd opacity issue > > Hi Gib. > > Proper blending of transparent objects is only possible by rendering them in > the correct order. > This can be tricky and if objects or polygons overlap you even won't get > away with sorting them... > You probably want depth peeling for order-independent transparency: > http://www.vtk.org/Wiki/VTK/Depth_Peeling > > Best Regards, > > Kim > > Am 10.08.2014 01:48, schrieb Gib Bogle: > > The problem is simply demonstrated with the opacity example: > http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/Opacity > > Adding this line: > sphereActor->SetPosition(1.0,0.0,0.0); > and setting the opacity of both actors to 0.99 gives an unexpected and > unattractive result. > > I see that there have been posts about problems with opacity/transparency as > far back as 2006. Maybe there is a solution... > ________________________________ > From: vtkusers [vtkusers-bounces at vtk.org] on behalf of Gib Bogle > [g.bogle at auckland.ac.nz] > Sent: Sunday, 10 August 2014 11:25 a.m. > To: vtkusers at vtk.org > Subject: [vtkusers] Odd opacity issue > > Hi, > I'm using vtkRenderWindowInteractor (VTK 5.10) in Qt, rendering spheres. > I'm trying to implement a degree of transparency, like this: > > actor->GetProperty()->SetOpacity(opacity); > > applied to all the spheres. > > If opacity is less than 1 the image immediately changes in unexpected ways. > See the two attached images, with opacity = 1.0 and 0.99. It looks as if > spheres have had their positions and sizes changed. But when I rotate the > scene it becomes apparent that something else is happening. Some of the > "foreground" spheres move from left to right (for example) while others > apparently in the foreground are moving right to left. It seems that the > order of rendering of the spheres, which normally places the most remote > first and the nearest last, has somehow been messed up, so that spheres at > the back are being rendered last so that they appear to be the closest. > Maybe the order has been simply reversed, but the visual effect is made more > confusing by parallax - my brain is interpreting the bigger spheres as > closer. > > Is this a well-known issue, and is there a simple way to fix it? > > Thanks > Gib > > > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > > > > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Unpaid intern in BillsBasement at noware dot com From pletzer at txcorp.com Sun Aug 10 19:42:42 2014 From: pletzer at txcorp.com (Alex Pletzer) Date: Sun, 10 Aug 2014 16:42:42 -0700 (PDT) Subject: [vtkusers] faint png image In-Reply-To: <53E690A2.2010804@txcorp.com> References: <53E690A2.2010804@txcorp.com> Message-ID: <1407714162954-5728171.post@n5.nabble.com> I found that adding the following lines mapper.SetColorWindow(255) mapper.SetColorLevel(127.5) produces the desired effect. -- import vtk reader = vtk.vtkPNGReader() magn = vtk.vtkImageResize() mapper = vtk.vtkImageMapper() actor = vtk.vtkActor2D() mapper.SetColorWindow(255) mapper.SetColorLevel(127.5) reader.SetFileName('solarfs.png') magn.SetInputConnection(reader.GetOutputPort()) magn.SetOutputDimensions(200, 100, 100) magn.Update() mapper.SetInputConnection(magn.GetOutputPort()) actor.SetMapper(mapper) actor.GetPositionCoordinate().SetCoordinateSystemToNormalizedViewport() ren = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() iren = vtk.vtkRenderWindowInteractor() renWin.AddRenderer(ren) iren.SetRenderWindow(renWin) ren.SetBackground(1,1,1) renWin.SetSize(640, 640) actor.GetPositionCoordinate().SetValue(0.2, 0.3) ren.AddActor(actor) # very faint picture iren.Initialize() renWin.Render() iren.Start() -- View this message in context: http://vtk.1045678.n5.nabble.com/faint-png-image-tp5728160p5728171.html Sent from the VTK - Users mailing list archive at Nabble.com. From francois.touvet at inria.fr Mon Aug 11 06:23:03 2014 From: francois.touvet at inria.fr (ftouvet) Date: Mon, 11 Aug 2014 03:23:03 -0700 (PDT) Subject: [vtkusers] vtkImageMathematics (A NOT B type Operation)? In-Reply-To: References: Message-ID: <1407752583924-5728173.post@n5.nabble.com> not sure of what you are talking about and if my answer will be relevant, but this kind of operation can be done on polydatas with vtkBooleanOperationPolyDataFilter . -- View this message in context: http://vtk.1045678.n5.nabble.com/vtkImageMathematics-A-NOT-B-type-Operation-tp5728130p5728173.html Sent from the VTK - Users mailing list archive at Nabble.com. From mail at oliwe.com Mon Aug 11 06:38:33 2014 From: mail at oliwe.com (Oliver Weinheimer) Date: Mon, 11 Aug 2014 03:38:33 -0700 (PDT) Subject: [vtkusers] Problems with ComputeOBB - wrong OBB computed Message-ID: <1407753513395-5728174.post@n5.nabble.com> Hi all, I am using the following code to compute an OBB via vtkOBBTree for a set of points. Labeled points from my own data-structure are pushed in a vtkPoints instance and then ComputeOBB from the vtkOBBTree class is called. Sometimes the resulting OBB seems to be correct, sometimes even the value in OBB_corner is definitely wrong. Any Hints? Do I use the method ComputeOBB in a wrong way? Thx Oliver --- begin source code --- vtkOBBTree* OBBTree = vtkOBBTree::New(); vtkPoints* objectPoints = vtkPoints::New(); //push points of object in objectpoints double point[3]; for (int x=0;xcolumns();++x) for (int y=0;yrows();++y) for (int z=0;zslices();++z) { if (pdetectionvolume->getvalue(label,x,y,z)) { point[0]=(x*pdicomvolume->pixelspacingx()); point[1]=(y*pdicomvolume->pixelspacingy()); point[2]=(z*pdicomvolume->gapbetweenslices()); objectpoints->insertnextpoint(point); } } double OBB_corner[3]={-1,-1,-1}, OBB_max[3]={0,0,0}, OBB_mid[3]={0,0,0}, OBB_min[3]={0,0,0}, OBB_size[3]={0,0,0}; OBBTree->ComputeOBB(objectPoints,OBB_corner,OBB_max,OBB_mid, OBB_min,OBB_size); --- end source code --- -- View this message in context: http://vtk.1045678.n5.nabble.com/Problems-with-ComputeOBB-wrong-OBB-computed-tp5728174.html Sent from the VTK - Users mailing list archive at Nabble.com. From raah.souza at gmail.com Mon Aug 11 13:17:41 2014 From: raah.souza at gmail.com (Raissa Souza) Date: Mon, 11 Aug 2014 10:17:41 -0700 Subject: [vtkusers] Grab Webcam Opencv/vtk in java Message-ID: Hello I'm working in a project for overlay a preop Model into a real scene from the webcam. I found example how to syncronize webcam with vtk for C. I'm trying to do this for java. I found some people saying that does not exist the set necessary fro vtkImportImage. Someone already did this? And could help me? Thank in advance. *------------------------------------------------------------------------* *Ra?ssa Cristina de Souza* *4? Ano Bacharelado em Ci?ncia da Computa??o UNESP- FCT - Presidente Prudente / Studying Computer Science at Sao Paulo State University* *T?cnica em Informatica- Centro Paula Souza / Technique in Computer Science* -------------- next part -------------- An HTML attachment was scrubbed... URL: From kubalagwa at gmail.com Mon Aug 11 13:28:29 2014 From: kubalagwa at gmail.com (=?UTF-8?B?SmFrdWIgxYHEhWd3YQ==?=) Date: Mon, 11 Aug 2014 19:28:29 +0200 Subject: [vtkusers] Problem with Volume rendering inside Qt application. Message-ID: Hello everyone, I have a problem with rendering volume in my VTK+ITK+Qt application, which should visualize DICOM volumetric data in QVTKWidget. But when I create my volume pipeline firstly (as a non-part of Qt mechanism), and than setup Qt ui and run RenWin->Render() everything works fine. Unfortunatelly, I want to setup ui first, let the user choose the file to load and than render volume. Is it some kind of known issue? I work on Ubuntu 12.04 + VTK 5.8 + ITK 4.5. Thanks for your help in advance. JL -------------- next part -------------- An HTML attachment was scrubbed... URL: From beekmaarten at yahoo.com Mon Aug 11 13:49:48 2014 From: beekmaarten at yahoo.com (Maarten Beek) Date: Mon, 11 Aug 2014 10:49:48 -0700 Subject: [vtkusers] vtkTransform::Pop() and vtkTransform::Push() Message-ID: <1407779388.16813.YahooMailNeo@web121305.mail.ne1.yahoo.com> Hi all, I am trying to get some king of 'undo' feature in my interactor style, so that Ctrl-Z would undo the last transformation to the currently selected actor. I am currently looking at vtkTransform::Push()) and Pop(), but haven't been able to get something working. Any suggestions? Another way of phrasing my question would be: How am I supposed to use the Pop() and Push() functions? Thanks - Maarten -------------- next part -------------- An HTML attachment was scrubbed... URL: From MEEHANBT at nv.doe.gov Mon Aug 11 14:18:44 2014 From: MEEHANBT at nv.doe.gov (Meehan, Bernard) Date: Mon, 11 Aug 2014 18:18:44 +0000 Subject: [vtkusers] vtkTransform::Pop() and vtkTransform::Push() In-Reply-To: <7FF7DDEC23W1255310-01@EMF_nv.doe.gov> References: <7FF7DDEC23W1255310-01@EMF_nv.doe.gov> Message-ID: Are you pre-multiplying or post-multiplying your transformations? I got tangled up a bit before I realized that the default mode was premultiply ... which means that if you do this: xform = vtk.vtkTransform() xform.Push(A) xform.Push(B) xform.Push(C) you get the following matrix operation on the vector x: A B C x when you might have wanted: xform.PostMultiply() xform.Push(A) xform.Push(B) xform.Push(C) which would give you: C B A x From: Maarten Beek via vtkusers > Reply-To: Maarten Beek > Date: Monday, August 11, 2014 10:49 AM To: vtkusers > Subject: [vtkusers] vtkTransform::Pop() and vtkTransform::Push() Hi all, I am trying to get some king of 'undo' feature in my interactor style, so that Ctrl-Z would undo the last transformation to the currently selected actor. I am currently looking at vtkTransform::Push()) and Pop(), but haven't been able to get something working. Any suggestions? Another way of phrasing my question would be: How am I supposed to use the Pop() and Push() functions? Thanks - Maarten -------------- next part -------------- An HTML attachment was scrubbed... URL: From beekmaarten at yahoo.com Mon Aug 11 14:35:59 2014 From: beekmaarten at yahoo.com (Maarten Beek) Date: Mon, 11 Aug 2014 11:35:59 -0700 Subject: [vtkusers] vtkTransform::Pop() and vtkTransform::Push() In-Reply-To: <20140811181829.4E8EB60A32@public.kitware.com> References: <7FF7DDEC23W1255310-01@EMF_nv.doe.gov> <20140811181829.4E8EB60A32@public.kitware.com> Message-ID: <1407782159.6900.YahooMailNeo@web121303.mail.ne1.yahoo.com> Aaa So I wouldn't be using: vtkTransform* Y = vtkTransform::New(); < do stuff with Y > X->Concatenate(Y); X->Push(); Y->Delete(); (X would be the usertransform of the actor - Y the subtransformation created by interaction) Maarten On Monday, August 11, 2014 2:18:39 PM, "Meehan, Bernard" wrote: Are you pre-multiplying or post-multiplying your transformations? I got tangled up a bit before I realized that the default mode was premultiply ... which means that if you do this: xform = vtk.vtkTransform() xform.Push(A) xform.Push(B) xform.Push(C) you get the following matrix operation on the vector x: A B C x when you might have wanted: xform.PostMultiply() xform.Push(A) xform.Push(B) xform.Push(C) which would give you: C B A xFrom: Maarten Beek via vtkusers Reply-To: Maarten Beek Date: Monday, August 11, 2014 10:49 AM To: vtkusers Subject: [vtkusers] vtkTransform::Pop() and vtkTransform::Push() Hi all, I am trying to get some king of 'undo' feature in my interactor style, so that Ctrl-Z would undo the last transformation to the currently selected actor. I am currently looking at vtkTransform::Push()) and Pop(), but haven't been able to get something working. Any suggestions? Another way of phrasing my question would be: How am I supposed to use the Pop() and Push() functions? Thanks - Maarten _______________________________________________ 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 Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From MEEHANBT at nv.doe.gov Mon Aug 11 16:18:36 2014 From: MEEHANBT at nv.doe.gov (Meehan, Bernard) Date: Mon, 11 Aug 2014 20:18:36 +0000 Subject: [vtkusers] vtkTransform::Pop() and vtkTransform::Push() In-Reply-To: References: <7FF7DDEC23W1255310-01@EMF_nv.doe.gov> <20140811181829.4E8EB60A32@public.kitware.com> <7FF7D29D23W1259118-01@EMF_nv.doe.gov> Message-ID: forgot to hit reply all From: , Tim Meehan > Date: Monday, August 11, 2014 12:59 PM To: Maarten Beek > Subject: Re: [vtkusers] vtkTransform::Pop() and vtkTransform::Push() Most of the transforms that I end up messing with look similar to: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Widgets/AffineWidget I'm not entirely sure how to use the Push/Pop thing ... can't figure out what the transform stack is either. For the "undo" case, it seems like you could just copy the actors original transform. You then would operate directly on the actor's transform ... and if you decide that you liked it the way the old transform had it set up, just set the actors transform to be the stored copy. I haven't run or tested this, but perhaps something like: cone = vtk.vtkConeSource() mapper = vtk.vtkPolyDataMapper() mapper.SetInputConnection(cone.GetOutputPort()) actor = vtk.vtkActor() actor.SetMapper(mapper) old_transform = vtkTransform() if actor.GetUserTransform() is not None: old_transform.DeepCopy(actor.GetUserTransform()) actor.SetUserTransform(old_transform) From: Maarten Beek > Reply-To: Maarten Beek > Date: Monday, August 11, 2014 11:35 AM To: Tim Meehan >, vtkusers > Subject: Re: [vtkusers] vtkTransform::Pop() and vtkTransform::Push() Aaa So I wouldn't be using: vtkTransform* Y = vtkTransform::New(); < do stuff with Y > X->Concatenate(Y); X->Push(); Y->Delete(); (X would be the usertransform of the actor - Y the subtransformation created by interaction) Maarten On Monday, August 11, 2014 2:18:39 PM, "Meehan, Bernard" > wrote: Are you pre-multiplying or post-multiplying your transformations? I got tangled up a bit before I realized that the default mode was premultiply ... which means that if you do this: xform = vtk.vtkTransform() xform.Push(A) xform.Push(B) xform.Push(C) you get the following matrix operation on the vector x: A B C x when you might have wanted: xform.PostMultiply() xform.Push(A) xform.Push(B) xform.Push(C) which would give you: C B A x From: Maarten Beek via vtkusers > Reply-To: Maarten Beek > Date: Monday, August 11, 2014 10:49 AM To: vtkusers > Subject: [vtkusers] vtkTransform::Pop() and vtkTransform::Push() Hi all, I am trying to get some king of 'undo' feature in my interactor style, so that Ctrl-Z would undo the last transformation to the currently selected actor. I am currently looking at vtkTransform::Push()) and Pop(), but haven't been able to get something working. Any suggestions? Another way of phrasing my question would be: How am I supposed to use the Pop() and Push() functions? Thanks - Maarten _______________________________________________ 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 Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From beekmaarten at yahoo.com Mon Aug 11 17:09:11 2014 From: beekmaarten at yahoo.com (Maarten Beek) Date: Mon, 11 Aug 2014 14:09:11 -0700 Subject: [vtkusers] vtkTransform::Pop() and vtkTransform::Push() In-Reply-To: <20140811201822.2B31A60FFF@public.kitware.com> References: <7FF7DDEC23W1255310-01@EMF_nv.doe.gov> <20140811181829.4E8EB60A32@public.kitware.com> <7FF7D29D23W1259118-01@EMF_nv.doe.gov> <20140811201822.2B31A60FFF@public.kitware.com> Message-ID: <1407791351.94456.YahooMailNeo@web121305.mail.ne1.yahoo.com> I realize I could put a stack of transforms in my interactor style, but looking at the source code, I get the impression that the possibility is already built into vtkTransform and I would like to take advantage of this Maarten On Monday, August 11, 2014 4:18:29 PM, "Meehan, Bernard" wrote: forgot to hit reply all From: , Tim Meehan Date: Monday, August 11, 2014 12:59 PM To: Maarten Beek Subject: Re: [vtkusers] vtkTransform::Pop() and vtkTransform::Push() Most of the transforms that I end up messing with look similar to: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Widgets/AffineWidget I'm not entirely sure how to use the Push/Pop thing ... can't figure out what the transform stack is either. For the "undo" case, it seems like you could just copy the actors original transform. You then would operate directly on the actor's transform ... and if you decide that you liked it the way the old transform had it set up, just set the actors transform to be the stored copy. I haven't run or tested this, but perhaps something like: cone = vtk.vtkConeSource() mapper = vtk.vtkPolyDataMapper() mapper.SetInputConnection(cone.GetOutputPort()) actor = vtk.vtkActor() actor.SetMapper(mapper) old_transform = vtkTransform() if actor.GetUserTransform() is not None: ? old_transform.DeepCopy(actor.GetUserTransform()) actor.SetUserTransform(old_transform) From: Maarten Beek Reply-To: Maarten Beek Date: Monday, August 11, 2014 11:35 AM To: Tim Meehan , vtkusers Subject: Re: [vtkusers] vtkTransform::Pop() and vtkTransform::Push() Aaa So I wouldn't be using: vtkTransform* Y = vtkTransform::New(); < do stuff with Y > X->Concatenate(Y); X->Push(); Y->Delete(); (X would be the usertransform of the actor - Y the subtransformation created by interaction) Maarten On Monday, August 11, 2014 2:18:39 PM, "Meehan, Bernard" wrote: Are you pre-multiplying or post-multiplying your transformations? I got tangled up a bit before I realized that the default mode was premultiply ... which means that if you do this: xform = vtk.vtkTransform() xform.Push(A) xform.Push(B) xform.Push(C) you get the following matrix operation on the vector x: A B C x when you might have wanted: xform.PostMultiply() xform.Push(A) xform.Push(B) xform.Push(C) which would give you: C B A xFrom: Maarten Beek via vtkusers Reply-To: Maarten Beek Date: Monday, August 11, 2014 10:49 AM To: vtkusers Subject: [vtkusers] vtkTransform::Pop() and vtkTransform::Push() Hi all, I am trying to get some king of 'undo' feature in my interactor style, so that Ctrl-Z would undo the last transformation to the currently selected actor. I am currently looking at vtkTransform::Push()) and Pop(), but haven't been able to get something working. Any suggestions? Another way of phrasing my question would be: How am I supposed to use the Pop() and Push() functions? Thanks - Maarten _______________________________________________ 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 Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers _______________________________________________ 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 Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Mon Aug 11 18:14:57 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 11 Aug 2014 16:14:57 -0600 Subject: [vtkusers] vtkTransform::Pop() and vtkTransform::Push() In-Reply-To: <20140811181829.4E8EB60A32@public.kitware.com> References: <7FF7DDEC23W1255310-01@EMF_nv.doe.gov> <20140811181829.4E8EB60A32@public.kitware.com> Message-ID: On Mon, Aug 11, 2014 at 12:18 PM, Meehan, Bernard wrote: > > Are you pre-multiplying or post-multiplying your transformations? > I got tangled up a bit before I realized that the default mode was > premultiply ... which means that if you do this: > > xform = vtk.vtkTransform() > xform.Push(A) > xform.Push(B) > xform.Push(C) > > you get the following matrix operation on the vector x: > > A B C x > > when you might have wanted: > > xform.PostMultiply() > xform.Push(A) > xform.Push(B) > xform.Push(C) > > which would give you: > > C B A x I'm just going to jump in here and state, for the record, that this is _not_ what the vtkTransform Push() method does. All that Push() does is save a copy of the current transform so that you can retrieve it later with Pop(). -David From ruhu43 at qq.com Mon Aug 11 22:13:53 2014 From: ruhu43 at qq.com (ruhu) Date: Mon, 11 Aug 2014 19:13:53 -0700 (PDT) Subject: [vtkusers] how to combine x and y direction slices together Message-ID: <1407809633716-5728183.post@n5.nabble.com> Hi friends, I have a question that Puzzled for a long time. The original data is composed of X and Y two direction data, I use vtkimagedata to get the 3D data, then i want combine the X and Y slices together. But only the X *or* Y slice can be displayed ?How can display the combine slice of X *and* Y. could anyone help me ? the source code as follows : void CCBCTVRDoc::OnFileOpen() { CString FilePathName; CFileDialog dlg( TRUE, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, (LPCTSTR)_TEXT("segy Files (*.seg)|*.lte|All Files (*.*)|*.*||"), NULL ); if(dlg.DoModal()==IDOK) { FilePathName=dlg.GetPathName(); CFile file; file.Open(FilePathName,CFile::modeRead); vtkSmartPointer reader = vtkSmartPointer::New(); short* m_pOriginalData; m_pOriginalData=new short [1024*180*42];// file.Seek(1024,CFile::begin); file.Read(m_pOriginalData,1024*180*42*2);// vtkSmartPointerimg=vtkSmartPointer::New(); img->SetDimensions(180,21,1024); img->SetScalarTypeToUnsignedChar(); img->SetNumberOfScalarComponents(1); img->SetSpacing(2.8,24,0.5); img->AllocateScalars(); int index=0; for (int j=0;j<21;j++) { for (int i=0;i<180;i++) { for (int k=0;k<1024;k++) { unsigned char * pixel =(unsigned char*)img->GetScalarPointer(i,j , k); *pixel=m_pOriginalData[index++]/256+128; } } } vtkImageShrink3D* mask = vtkImageShrink3D::New(); mask->SetShrinkFactors(3,3,3); mask->SetInput(img); vtkSmartPointerimg1=vtkSmartPointer::New(); img1->SetDimensions(21,180,1024); img1->SetScalarTypeToUnsignedChar(); img1->SetNumberOfScalarComponents(1); img1->SetSpacing(24,2.8,0.5); img1->AllocateScalars(); for (int j=0;j<21;j++) { for (int i=0;i<180;i++) { for (int k=0;k<1024;k++) { unsigned char * pixel =(unsigned char*)img1->GetScalarPointer(j,i , k); *pixel=m_pOriginalData[index++]/256+128; } } } vtkImageShrink3D* mask1 = vtkImageShrink3D::New(); mask1->SetShrinkFactors(3,3,3); mask1->SetInput(img1); int extent[6]; double spacing[3]; double origin[3]; mask->GetOutput()->GetExtent(extent); mask->GetOutput()->GetSpacing(spacing); mask->GetOutput()->GetOrigin(origin); double center[3]; center[0] = origin[0] + spacing[0] * 0.5 * (extent[0] + extent[1]); center[1] = origin[1] + spacing[1] * 0.5 * (extent[2] + extent[3]); center[2] = origin[2] + spacing[2] * 0.5 * (extent[4] + extent[5]); static double axialElements[16] = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 }; vtkSmartPointer resliceAxes =vtkSmartPointer::New(); resliceAxes->DeepCopy(axialElements); resliceAxes->SetElement(0, 3, center[0]); resliceAxes->SetElement(1, 3, center[1]); resliceAxes->SetElement(2, 3, center[2]); int extent1[6]; double spacing1[3]; double origin1[3]; mask1->GetOutput()->GetExtent(extent1); mask1->GetOutput()->GetSpacing(spacing1); mask1->GetOutput()->GetOrigin(origin1); double center1[3]; center1[0] = origin1[0] + spacing1[0] * 0.5 * (extent1[0] + extent1[1]); center1[1] = origin1[1] + spacing1[1] * 0.5 * (extent1[2] + extent1[3]); center1[2] = origin1[2] + spacing1[2] * 0.5 * (extent1[4] + extent1[5]); static double axialElements1[16] = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 }; /* 1, 0, 0, 0, 0, 0, 1, 0, 0,-1, 0, 0, 0, 0, 0, 1 };*/ /*1, 0, 0, 0, 0, 0.866025, -0.5, 0, 0, 0.5, 0.866025, 0, 0, 0, 0, 1 }; */ vtkSmartPointer resliceAxes1 =vtkSmartPointer::New(); resliceAxes1->DeepCopy(axialElements1); resliceAxes1->SetElement(0, 3, center1[0]); resliceAxes1->SetElement(1, 3, center1[1]); resliceAxes1->SetElement(2, 3, center1[2]); vtkSmartPointer reslice =vtkSmartPointer::New(); vtkSmartPointer reslice1 =vtkSmartPointer::New(); reslice->SetInputConnection(mask->GetOutputPort()); reslice->SetOutputDimensionality(2); reslice->SetResliceAxes(resliceAxes); reslice->SetInterpolationModeToLinear(); reslice1->SetInputConnection(mask1->GetOutputPort()); reslice1->SetOutputDimensionality(2); reslice1->SetResliceAxes(resliceAxes); reslice1->SetInterpolationModeToLinear(); vtkSmartPointer colorTable =vtkSmartPointer::New(); colorTable->SetRange(0, 256); colorTable->SetValueRange(0.0, 255); colorTable->SetSaturationRange(0.0, 0.0); colorTable->SetRampToLinear(); colorTable->Build(); vtkSmartPointer colorMap = vtkSmartPointer::New(); colorMap->SetLookupTable(colorTable); colorMap->SetInputConnection(reslice->GetOutputPort()); vtkSmartPointer imgActor = vtkSmartPointer::New(); imgActor->SetInput(colorMap->GetOutput()); vtkSmartPointer renderer = vtkSmartPointer::New(); vtkSmartPointer colorTable1 =vtkSmartPointer::New(); colorTable1->SetRange(0, 256); colorTable1->SetValueRange(0.0, 255); colorTable1->SetSaturationRange(0.0, 0.0); colorTable1->SetRampToLinear(); colorTable1->Build(); vtkSmartPointer colorMap1= vtkSmartPointer::New(); colorMap1->SetLookupTable(colorTable1); colorMap1->SetInputConnection(reslice1->GetOutputPort()); vtkSmartPointer imgActor1 = vtkSmartPointer::New(); imgActor1->SetInput(colorMap1->GetOutput()); renderer->AddActor(imgActor); renderer->AddActor(imgActor1); renderer->SetBackground(.4, .5, .6); vtkSmartPointer renderWindow = vtkSmartPointer::New(); renderWindow->SetSize(500, 500); renderWindow->AddRenderer(renderer); vtkSmartPointer renderWindowInteractor = vtkSmartPointer::New(); vtkSmartPointer imagestyle = vtkSmartPointer::New(); vtkSmartPointer callback = vtkSmartPointer::New(); callback->SetImageReslice(reslice); callback->SetInteractor(renderWindowInteractor); imagestyle->AddObserver(vtkCommand::MouseMoveEvent, callback); imagestyle->AddObserver(vtkCommand::LeftButtonPressEvent, callback); imagestyle->AddObserver(vtkCommand::LeftButtonReleaseEvent, callback); renderWindowInteractor->SetInteractorStyle(imagestyle); renderWindowInteractor->SetRenderWindow(renderWindow); renderWindowInteractor->Initialize(); renderWindowInteractor->Start(); } } 1.jpg 2.jpg The target image 03.jpg Thanks!! -- View this message in context: http://vtk.1045678.n5.nabble.com/how-to-combine-x-and-y-direction-slices-together-tp5728183.html Sent from the VTK - Users mailing list archive at Nabble.com. From beekmaarten at yahoo.com Tue Aug 12 08:53:20 2014 From: beekmaarten at yahoo.com (Maarten Beek) Date: Tue, 12 Aug 2014 05:53:20 -0700 Subject: [vtkusers] vtkTransform::Pop() and vtkTransform::Push() In-Reply-To: References: <7FF7DDEC23W1255310-01@EMF_nv.doe.gov> <20140811181829.4E8EB60A32@public.kitware.com> Message-ID: <1407848000.4023.YahooMailNeo@web121303.mail.ne1.yahoo.com> That's what I intended to use it for and I got it more-or-less working (it crashes sometimes but that could be somewhere in my code, unrelated to Pop() and Push(). Got to find it though... :-( ). I noticed it's pushing too often when I use it each time Rotate(), Spin() etc. in the interactor style gets called. Now thinking of a new undo object that stores the current transform on its own stack when it receives a StartInteractionEvent.. Maarten On Monday, August 11, 2014 6:15:33 PM, David Gobbi wrote: On Mon, Aug 11, 2014 at 12:18 PM, Meehan, Bernard wrote: > > Are you pre-multiplying or post-multiplying your transformations? > I got tangled up a bit before I realized that the default mode was > premultiply ... which means that if you do this: > > xform = vtk.vtkTransform() > xform.Push(A) > xform.Push(B) > xform.Push(C) > > you get the following matrix operation on the vector x: > > A B C x > > when you might have wanted: > > xform.PostMultiply() > xform.Push(A) > xform.Push(B) > xform.Push(C) > > which would give you: > > C B A x I'm just going to jump in here and state, for the record, that this is _not_ what the vtkTransform Push() method does.? All that Push() does is save a copy of the current transform so that you can retrieve it later with Pop(). -David _______________________________________________ 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 Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From da.angulo39 at uniandes.edu.co Tue Aug 12 08:54:43 2014 From: da.angulo39 at uniandes.edu.co (diego0020) Date: Tue, 12 Aug 2014 05:54:43 -0700 (PDT) Subject: [vtkusers] Status of VTK Python 3 wrapper support In-Reply-To: References: <1406810682351-5728034.post@n5.nabble.com> Message-ID: <1407848083780-5728186.post@n5.nabble.com> While we are talking about the future of python wrappers... How hard would it be to add support for overriding virtual methods in inherited classes? -- View this message in context: http://vtk.1045678.n5.nabble.com/Status-of-VTK-Python-3-wrapper-support-tp5727990p5728186.html Sent from the VTK - Users mailing list archive at Nabble.com. From mail at oliwe.com Tue Aug 12 08:54:58 2014 From: mail at oliwe.com (Oliver Weinheimer) Date: Tue, 12 Aug 2014 05:54:58 -0700 (PDT) Subject: [vtkusers] Problems with ComputeOBB - wrong OBB computed In-Reply-To: <1407753513395-5728174.post@n5.nabble.com> References: <1407753513395-5728174.post@n5.nabble.com> Message-ID: <1407848098869-5728187.post@n5.nabble.com> Hi all, the problem with void vtkOBBTree::ComputeOBB(vtkPoints *pts, double corner[3], double max[3], double mid[3], double min[3], double size[3]) is a problem of the accuracy of floating point arithmetic. The objects I am dealing with contain several million points. This leads to problems with the mean value calculations in ComputeOBB. At two locations mean values are calculated in ComputeOBB, the second location introduced the greatest part of the errors in my case. I replaced the mean calculations with the method you can find in Knuth's Vol 2 of The Art of Computer Programming, 1998 edition, page 232. This solved at least my problems with the method! (1) I replaced --- source code begin for (pointId=0; pointId < numPts; pointId++ ) { pts->GetPoint(pointId, x); for (i=0; i < 3; i++) { mean[i] += x[i]; } } for (i=0; i < 3; i++) { mean[i] /= numPts; } --- source code end by these lines: --- source code begin for (pointId = 0; pointId < numPts; pointId++) { pts->GetPoint(pointId, x); for (i = 0; i < 3; i++){ mean[i] += (x[i] - mean[i])/(pointId+1); } } --- source code end (2) and I replaced --- source code begin for (pointId=0; pointId < numPts; pointId++ ) { pts->GetPoint(pointId, x); xp[0] = x[0] - mean[0]; xp[1] = x[1] - mean[1]; xp[2] = x[2] - mean[2]; for (i=0; i < 3; i++) { a0[i] += xp[0] * xp[i]; a1[i] += xp[1] * xp[i]; a2[i] += xp[2] * xp[i]; } }//for all points for (i=0; i < 3; i++) { a0[i] /= numPts; a1[i] /= numPts; a2[i] /= numPts; } --- source code end by --- source code begin for (pointId = 0; pointId < numPts; pointId++) { pts->GetPoint(pointId, x); xp[0] = x[0] - mean[0]; xp[1] = x[1] - mean[1]; xp[2] = x[2] - mean[2]; for (i = 0; i < 3; i++) { a0[i] += (xp[0] * xp[i] - a0[i])/(pointId+1); a1[i] += (xp[1] * xp[i] - a1[i])/(pointId+1); a2[i] += (xp[2] * xp[i] - a2[i])/(pointId+1); } } --- source code end Best Wishes, Oliver -- View this message in context: http://vtk.1045678.n5.nabble.com/Problems-with-ComputeOBB-wrong-OBB-computed-tp5728174p5728187.html Sent from the VTK - Users mailing list archive at Nabble.com. From mallikarjun49 at gmail.com Tue Aug 12 11:56:47 2014 From: mallikarjun49 at gmail.com (Mallikarjun K) Date: Tue, 12 Aug 2014 21:26:47 +0530 Subject: [vtkusers] vtkImageMathematics (A NOT B type Operation)? In-Reply-To: <1407752583924-5728173.post@n5.nabble.com> References: <1407752583924-5728173.post@n5.nabble.com> Message-ID: Hi ftouvet, Thanks for the reply and suggestion. Sorry for the confusion..Let me illustrate the question like this... vtkImageMathematics *maths = vtkImageMathematics::New(); maths -> SetOperationToSubtract(); maths -> SetInput1(ImageDataA); maths -> SetInput2(ImageDataB); maths -> Update(); When I use this subtract method ,I am getting the Output like this as shown in below fig(A XOR B). [image: Inline image 1] But the Output what I wanted is like this as shown in below fig(A NOT B). [image: Inline image 2] Somehow I make use of existing methods from this filter and pulled the output what I wanted. I did like this...Inverted ImageDataB and multiplied with ImageDataA. Output=multiply(ImageDataA,Invert(ImageDataB)). Thank you On Mon, Aug 11, 2014 at 3:53 PM, ftouvet wrote: > not sure of what you are talking about and if my answer will be relevant, > but > this kind of operation can be done on polydatas with > vtkBooleanOperationPolyDataFilter > < > http://www.vtk.org/doc/nightly/html/classvtkBooleanOperationPolyDataFilter.html > > > . > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/vtkImageMathematics-A-NOT-B-type-Operation-tp5728130p5728173.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- *Regards:* Mallik -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 21818 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 19108 bytes Desc: not available URL: From bill.lorensen at gmail.com Tue Aug 12 12:02:52 2014 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Tue, 12 Aug 2014 12:02:52 -0400 Subject: [vtkusers] vtkImageMathematics (A NOT B type Operation)? In-Reply-To: References: <1407752583924-5728173.post@n5.nabble.com> Message-ID: Did you look at vtkImageLogic? On Tue, Aug 12, 2014 at 11:56 AM, Mallikarjun K wrote: > Hi ftouvet, > Thanks for the reply and suggestion. > > Sorry for the confusion..Let me illustrate the question like this... > > vtkImageMathematics *maths = vtkImageMathematics::New(); > maths -> SetOperationToSubtract(); > maths -> SetInput1(ImageDataA); > maths -> SetInput2(ImageDataB); > maths -> Update(); > > When I use this subtract method ,I am getting the Output like this as > shown in below fig(A XOR B). > [image: Inline image 1] > But the Output what I wanted is like this as shown in below fig(A NOT B). > [image: Inline image 2] > > Somehow I make use of existing methods from this filter and pulled the > output what I wanted. > I did like this...Inverted ImageDataB and multiplied with ImageDataA. > > Output=multiply(ImageDataA,Invert(ImageDataB)). > > > Thank you > > > > > > > > > On Mon, Aug 11, 2014 at 3:53 PM, ftouvet wrote: > >> not sure of what you are talking about and if my answer will be relevant, >> but >> this kind of operation can be done on polydatas with >> vtkBooleanOperationPolyDataFilter >> < >> http://www.vtk.org/doc/nightly/html/classvtkBooleanOperationPolyDataFilter.html >> > >> . >> >> >> >> -- >> View this message in context: >> http://vtk.1045678.n5.nabble.com/vtkImageMathematics-A-NOT-B-type-Operation-tp5728130p5728173.html >> Sent from the VTK - Users mailing list archive at Nabble.com. >> _______________________________________________ >> 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 >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> > > > > -- > *Regards:* > Mallik > > > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -- Unpaid intern in BillsBasement at noware dot com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 19108 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 21818 bytes Desc: not available URL: From david.gobbi at gmail.com Tue Aug 12 12:15:56 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 12 Aug 2014 10:15:56 -0600 Subject: [vtkusers] Status of VTK Python 3 wrapper support In-Reply-To: <1407848083780-5728186.post@n5.nabble.com> References: <1406810682351-5728034.post@n5.nabble.com> <1407848083780-5728186.post@n5.nabble.com> Message-ID: On Tue, Aug 12, 2014 at 6:54 AM, diego0020 wrote: > While we are talking about the future of python wrappers... > > How hard would it be to add support for overriding virtual methods in > inherited classes? It would be hard, which is why it hasn't been done. Perhaps eventually it will be done for certain virtual methods, but to do it for every virtual method would add a lot of bulk and inefficiency to the wrappers. - David From mallikarjun49 at gmail.com Tue Aug 12 12:27:14 2014 From: mallikarjun49 at gmail.com (Mallikarjun K) Date: Tue, 12 Aug 2014 21:57:14 +0530 Subject: [vtkusers] vtkImageMathematics (A NOT B type Operation)? In-Reply-To: References: <1407752583924-5728173.post@n5.nabble.com> Message-ID: Thanks Bill, I haven't looked at vtkImageLogic. I will try this one. On Tue, Aug 12, 2014 at 9:32 PM, Bill Lorensen wrote: > Did you look at vtkImageLogic? > > > > On Tue, Aug 12, 2014 at 11:56 AM, Mallikarjun K > wrote: > >> Hi ftouvet, >> Thanks for the reply and suggestion. >> >> Sorry for the confusion..Let me illustrate the question like this... >> >> vtkImageMathematics *maths = vtkImageMathematics::New(); >> maths -> SetOperationToSubtract(); >> maths -> SetInput1(ImageDataA); >> maths -> SetInput2(ImageDataB); >> maths -> Update(); >> >> When I use this subtract method ,I am getting the Output like this as >> shown in below fig(A XOR B). >> [image: Inline image 1] >> But the Output what I wanted is like this as shown in below fig(A NOT B). >> [image: Inline image 2] >> >> Somehow I make use of existing methods from this filter and pulled the >> output what I wanted. >> I did like this...Inverted ImageDataB and multiplied with ImageDataA. >> >> Output=multiply(ImageDataA,Invert(ImageDataB)). >> >> >> Thank you >> >> >> >> >> >> >> >> >> On Mon, Aug 11, 2014 at 3:53 PM, ftouvet >> wrote: >> >>> not sure of what you are talking about and if my answer will be >>> relevant, but >>> this kind of operation can be done on polydatas with >>> vtkBooleanOperationPolyDataFilter >>> < >>> http://www.vtk.org/doc/nightly/html/classvtkBooleanOperationPolyDataFilter.html >>> > >>> . >>> >>> >>> >>> -- >>> View this message in context: >>> http://vtk.1045678.n5.nabble.com/vtkImageMathematics-A-NOT-B-type-Operation-tp5728130p5728173.html >>> Sent from the VTK - Users mailing list archive at Nabble.com. >>> _______________________________________________ >>> 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 >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/vtkusers >>> >> >> >> >> -- >> *Regards:* >> Mallik >> >> >> _______________________________________________ >> 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 >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> > > > -- > Unpaid intern in BillsBasement at noware dot com > -- *Regards:* Mallik -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 19108 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 21818 bytes Desc: not available URL: From samantrv at mail.uc.edu Tue Aug 12 12:28:00 2014 From: samantrv at mail.uc.edu (Samant, Rutuja (samantrv)) Date: Tue, 12 Aug 2014 16:28:00 +0000 Subject: [vtkusers] Unable to cmake 64 bit Message-ID: <1c8d898ae6b6421ba900e37433af6c3f@BN1PR01MB183.prod.exchangelabs.com> Hello, I am trying to configure vtk in cmake for VS 2010 64 bit. However I keep getting the error : LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt [C:\VTK\Bin\CMakeFiles\CMakeTmp\cmTryCompileExec1825641800.vcxproj] Could someone help me with my error? Regards, Rutuja Samant Graduate Student, Mechanical Engineering University of Cincinnati -------------- next part -------------- An HTML attachment was scrubbed... URL: From aur.marsan at gmail.com Tue Aug 12 12:33:59 2014 From: aur.marsan at gmail.com (=?UTF-8?Q?Aur=C3=A9lien_Marsan?=) Date: Tue, 12 Aug 2014 12:33:59 -0400 Subject: [vtkusers] Split a surface by sharp edges In-Reply-To: References: Message-ID: Dear David, One question more. For now, after having used the ConnectivityFilter, I use e Threshold in order to isolate the surface that I want. For exemple, for the surface with the index equal to one, I would do a Threshold between 0.5 and 1.5. Is this the appropriate way to do this ? Or is there a simpler way ? Many thanks, Regards, Aur?lien 2014-08-08 18:16 GMT-04:00 Aur?lien Marsan : > Thank you a lot David. I didn't had the good keywords for searching. > Have a nice week-end, > > Aur?lien > > > 2014-08-07 19:53 GMT-04:00 David E DeMarle : > > PolyDataNormals followed by ConnectivityFilter was a suggested pipeline >> for that before. >> >> >> http://vtk.1045678.n5.nabble.com/Filter-to-split-surface-with-geometric-parameters-angle-td1250765.html >> >> David E DeMarle >> Kitware, Inc. >> R&D Engineer >> 21 Corporate Drive >> Clifton Park, NY 12065-8662 >> Phone: 518-881-4909 >> >> >> On Thu, Aug 7, 2014 at 7:03 PM, Aur?lien Marsan >> wrote: >> >>> Dear VTK users, >>> >>> Is there a way to split a surface by sharp edges using simple VTK >>> filters ? >>> (I am using python) >>> >>> Thanks in advance for your answer. >>> >>> Aur?lien Marsan >>> >>> _______________________________________________ >>> 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 >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/vtkusers >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Tue Aug 12 12:44:53 2014 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Tue, 12 Aug 2014 12:44:53 -0400 Subject: [vtkusers] Split a surface by sharp edges In-Reply-To: References: Message-ID: Use ThresholdBetween(1,1) On Tue, Aug 12, 2014 at 12:33 PM, Aur?lien Marsan wrote: > Dear David, > > One question more. For now, after having used the ConnectivityFilter, I use > e Threshold in order to isolate the surface that I want. > For exemple, for the surface with the index equal to one, I would do a > Threshold between 0.5 and 1.5. > Is this the appropriate way to do this ? Or is there a simpler way ? > > Many thanks, > Regards, > > Aur?lien > > > 2014-08-08 18:16 GMT-04:00 Aur?lien Marsan : > >> Thank you a lot David. I didn't had the good keywords for searching. >> Have a nice week-end, >> >> Aur?lien >> >> >> 2014-08-07 19:53 GMT-04:00 David E DeMarle : >> >>> PolyDataNormals followed by ConnectivityFilter was a suggested pipeline >>> for that before. >>> >>> >>> http://vtk.1045678.n5.nabble.com/Filter-to-split-surface-with-geometric-parameters-angle-td1250765.html >>> >>> David E DeMarle >>> Kitware, Inc. >>> R&D Engineer >>> 21 Corporate Drive >>> Clifton Park, NY 12065-8662 >>> Phone: 518-881-4909 >>> >>> >>> On Thu, Aug 7, 2014 at 7:03 PM, Aur?lien Marsan >>> wrote: >>>> >>>> Dear VTK users, >>>> >>>> Is there a way to split a surface by sharp edges using simple VTK >>>> filters ? >>>> (I am using python) >>>> >>>> Thanks in advance for your answer. >>>> >>>> Aur?lien Marsan >>>> >>>> _______________________________________________ >>>> 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 >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://public.kitware.com/mailman/listinfo/vtkusers >>>> >>> >> > > > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Unpaid intern in BillsBasement at noware dot com From da.angulo39 at uniandes.edu.co Tue Aug 12 12:42:04 2014 From: da.angulo39 at uniandes.edu.co (Diego Andres Angulo Pabon) Date: Tue, 12 Aug 2014 16:42:04 +0000 Subject: [vtkusers] Status of VTK Python 3 wrapper support In-Reply-To: References: <1406810682351-5728034.post@n5.nabble.com> <1407848083780-5728186.post@n5.nabble.com>, Message-ID: <1407861716224.78243@uniandes.edu.co> Do you have any idea of how PyQt does it? It works very well ________________________________________ De: David Gobbi Enviado: martes, 12 de agosto de 2014 11:15 a. m. Para: Diego Andres Angulo Pabon Cc: VTK Users Asunto: Re: [vtkusers] Status of VTK Python 3 wrapper support On Tue, Aug 12, 2014 at 6:54 AM, diego0020 wrote: > While we are talking about the future of python wrappers... > > How hard would it be to add support for overriding virtual methods in > inherited classes? It would be hard, which is why it hasn't been done. Perhaps eventually it will be done for certain virtual methods, but to do it for every virtual method would add a lot of bulk and inefficiency to the wrappers. - David From raah.souza at gmail.com Tue Aug 12 12:58:42 2014 From: raah.souza at gmail.com (Raissa Souza) Date: Tue, 12 Aug 2014 09:58:42 -0700 Subject: [vtkusers] webcam/vtk and Java Message-ID: Someone know how to convert the Mat frame from opencv in vtkImageData to use in java. Thank in advance. *------------------------------------------------------------------------* *Ra?ssa Cristina de Souza* *4? Ano Bacharelado em Ci?ncia da Computa??o UNESP- FCT - Presidente Prudente / Studying Computer Science at Sao Paulo State University* *T?cnica em Informatica- Centro Paula Souza / Technique in Computer Science* -------------- next part -------------- An HTML attachment was scrubbed... URL: From sankhesh.jhaveri at kitware.com Tue Aug 12 14:18:36 2014 From: sankhesh.jhaveri at kitware.com (Sankhesh Jhaveri) Date: Tue, 12 Aug 2014 14:18:36 -0400 Subject: [vtkusers] =?utf-8?q?Problem_with_Volume_rendering_inside_Qt_appl?= =?utf-8?b?aWNhdGlvbi4g4oCL4oCL?= Message-ID: Hi JL, It doesn't matter whether you setup the VTK pipeline first or the Qt UI. All you need to do while creating the pipeline is to not provide the data to the mapper. Once you load the file/data, you can set that as the input data to the mapper and call Render on the RenderWindow. Hope that helps! Best Regards, ?Sankhesh Jhaveri? Research & Development Engineer Kitware, Inc. *Phone*: (518) 881 4417 *Fax*: (518) 371 4573 From: "Jakub ??gwa" > To: vtkusers at vtk.org > Cc: > Date: Mon, 11 Aug 2014 19:28:29 +0200 > Subject: [vtkusers] > ?? > Problem with Volume rendering inside Qt application. > ?? > > Hello everyone, > > I have a problem with rendering volume in my VTK+ITK+Qt application, which > should visualize DICOM volumetric data in QVTKWidget. But when I create my > volume pipeline firstly (as a non-part of Qt mechanism), and than setup Qt > ui and run RenWin->Render() everything works fine. Unfortunatelly, I want > to setup ui first, let the user choose the file to load and than render > volume. Is it some kind of known issue? I work on Ubuntu 12.04 + VTK 5.8 + > ITK 4.5. > > Thanks for your help in advance. > > JL > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cdavid.tran at gmail.com Tue Aug 12 22:11:27 2014 From: cdavid.tran at gmail.com (eternallite2) Date: Tue, 12 Aug 2014 19:11:27 -0700 (PDT) Subject: [vtkusers] correct way of using VTK_MODULE_INIT with opengl2 In-Reply-To: <53E3177A.3050407@gmail.com> References: <53E3177A.3050407@gmail.com> Message-ID: <1407895887214-5728199.post@n5.nabble.com> Hello, I got rid of the warning by adding the following line: VTK_MODULE_INIT(vtkInteractionStyle) -- View this message in context: http://vtk.1045678.n5.nabble.com/correct-way-of-using-VTK-MODULE-INIT-with-opengl2-tp5728129p5728199.html Sent from the VTK - Users mailing list archive at Nabble.com. From cdavid.tran at gmail.com Tue Aug 12 23:02:45 2014 From: cdavid.tran at gmail.com (eternallite2) Date: Tue, 12 Aug 2014 20:02:45 -0700 (PDT) Subject: [vtkusers] OpenGL2 Backend and vtkImageProcessingPass Message-ID: <1407898965598-5728200.post@n5.nabble.com> In a previous version of VTK (6.1.0), with the old OpenGL backend we were able to do multi-pass rendering and there were examples of how to do custom post-processing effects (like blurring, sobel edge detection, etc.) With OpenGL2 backend, is it possible to do these effects using FBOs? (If so, are there any examples yet of how to do this) Thanks for the help :) -- View this message in context: http://vtk.1045678.n5.nabble.com/OpenGL2-Backend-and-vtkImageProcessingPass-tp5728200.html Sent from the VTK - Users mailing list archive at Nabble.com. From cdavid.tran at gmail.com Wed Aug 13 00:58:00 2014 From: cdavid.tran at gmail.com (eternallite2) Date: Tue, 12 Aug 2014 21:58:00 -0700 (PDT) Subject: [vtkusers] How to add custom shaders in OpenGL2 backend Message-ID: <1407905880602-5728201.post@n5.nabble.com> Are there any examples yet of how to add custom vertex and fragment shaders to existing actors in the renderer? (Using the OpenGL2 backend) Thank you again -- View this message in context: http://vtk.1045678.n5.nabble.com/How-to-add-custom-shaders-in-OpenGL2-backend-tp5728201.html Sent from the VTK - Users mailing list archive at Nabble.com. From kim.rosenbohm at posteo.de Wed Aug 13 03:54:32 2014 From: kim.rosenbohm at posteo.de (Kim Rosenbohm) Date: Wed, 13 Aug 2014 09:54:32 +0200 Subject: [vtkusers] =?utf-8?q?Problem_with_Volume_rendering_inside_Qt_appl?= =?utf-8?b?aWNhdGlvbi4g4oCL4oCL?= In-Reply-To: References: Message-ID: Hi. I use QVTKWdget2, but in QVTKWidget you should be able to call "update()" to update the Qt widget / view too... Best Regards, Kim Am 12.08.2014 20:18 schrieb Sankhesh Jhaveri: > Hi JL, > > It doesn't matter whether you setup the VTK pipeline first or the Qt UI. > All you need to do while creating the pipeline is to not provide the data to the mapper. Once you load the file/data, you can set that as the input data to the mapper and call Render on the RenderWindow. > > Hope that helps! > > Best Regards, > > ?Sankhesh Jhaveri? Research & Development Engineer > Kitware, Inc. > PHONE: (518) 881 4417 > FAX: (518) 371 4573 > >> From: "Jakub ??gwa" >> To: vtkusers at vtk.org >> Cc: >> Date: Mon, 11 Aug 2014 19:28:29 +0200 >> Subject: [vtkusers] >> ?? Problem with Volume rendering inside Qt application. >> ?? >> >> Hello everyone, >> >> I have a problem with rendering volume in my VTK+ITK+Qt application, which should visualize DICOM volumetric data in QVTKWidget. But when I create my volume pipeline firstly (as a non-part of Qt mechanism), and than setup Qt ui and run RenWin->Render() everything works fine. Unfortunatelly, I want to setup ui first, let the user choose the file to load and than render volume. Is it some kind of known issue? I work on Ubuntu 12.04 + VTK 5.8 + ITK 4.5. >> >> Thanks for your help in advance. >> >> JL > > _______________________________________________ > Powered by www.kitware.com [1] > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html [2] > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ [3] > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers [4] -- Kim Rosenbohm, Barf??erstr. 7, 37073 G?ttingen, 0163/8723172 Links: ------ [1] http://www.kitware.com [2] http://www.kitware.com/opensource/opensource.html [3] http://www.vtk.org/Wiki/VTK_FAQ [4] http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From isimtic at gmail.com Wed Aug 13 04:29:08 2014 From: isimtic at gmail.com (=?UTF-8?B?QWhtZXQgRG/En2Fu?=) Date: Wed, 13 Aug 2014 11:29:08 +0300 Subject: [vtkusers] how to check if a polydata is changed or not Message-ID: <53EB21D4.2070301@gmail.com> hi, if a polydata is changed(i.e. points or cells) is there a special way(which is changed point or cell) or a signal(command) or a function like last change time(i.e. like file system) Kind Regards. Ahmet Dogan From goodwin.lawlor.lists at gmail.com Wed Aug 13 06:06:56 2014 From: goodwin.lawlor.lists at gmail.com (Goodwin Lawlor) Date: Wed, 13 Aug 2014 11:06:56 +0100 Subject: [vtkusers] Problems with ComputeOBB - wrong OBB computed In-Reply-To: <1407848098869-5728187.post@n5.nabble.com> References: <1407753513395-5728174.post@n5.nabble.com> <1407848098869-5728187.post@n5.nabble.com> Message-ID: Hi Oliver, That's a nice method - the mean is gradually accumulated, preserving the accuracy of the floating point value. I'm sure there are other places in VTK that would benefit from this code change... If you're familiar with Gerrit, could you submit this change? I'll have a poke around the code base to see if there are other similar mean calculations. Goodwin On Tue, Aug 12, 2014 at 1:54 PM, Oliver Weinheimer wrote: > Hi all, > > the problem with > > void vtkOBBTree::ComputeOBB(vtkPoints *pts, double corner[3], double > max[3], > double mid[3], double min[3], double size[3]) > > is a problem of the accuracy of floating point arithmetic. > The objects I am dealing with contain several million points. > This leads to problems with the mean value calculations in ComputeOBB. > At two locations mean values are calculated in ComputeOBB, the second > location introduced the greatest part of the errors in my case. > I replaced the mean calculations with the method you can find in Knuth's > Vol > 2 of The Art of Computer Programming, 1998 edition, page 232. > > This solved at least my problems with the method! > > (1) > I replaced > > --- source code begin > for (pointId=0; pointId < numPts; pointId++ ) > { > pts->GetPoint(pointId, x); > for (i=0; i < 3; i++) > { > mean[i] += x[i]; > } > } > for (i=0; i < 3; i++) > { > mean[i] /= numPts; > } > --- source code end > > by these lines: > > --- source code begin > for (pointId = 0; pointId < numPts; pointId++) > { > pts->GetPoint(pointId, x); > for (i = 0; i < 3; i++){ > mean[i] += (x[i] - mean[i])/(pointId+1); > } > } > > --- source code end > > (2) > > and I replaced > > --- source code begin > for (pointId=0; pointId < numPts; pointId++ ) > { > pts->GetPoint(pointId, x); > xp[0] = x[0] - mean[0]; xp[1] = x[1] - mean[1]; xp[2] = x[2] - > mean[2]; > for (i=0; i < 3; i++) > { > a0[i] += xp[0] * xp[i]; > a1[i] += xp[1] * xp[i]; > a2[i] += xp[2] * xp[i]; > } > }//for all points > > for (i=0; i < 3; i++) > { > a0[i] /= numPts; > a1[i] /= numPts; > a2[i] /= numPts; > } > --- source code end > > by > > --- source code begin > for (pointId = 0; pointId < numPts; pointId++) > { > pts->GetPoint(pointId, x); > xp[0] = x[0] - mean[0]; > xp[1] = x[1] - mean[1]; > xp[2] = x[2] - mean[2]; > for (i = 0; i < 3; i++) > { > a0[i] += (xp[0] * xp[i] - a0[i])/(pointId+1); > a1[i] += (xp[1] * xp[i] - a1[i])/(pointId+1); > a2[i] += (xp[2] * xp[i] - a2[i])/(pointId+1); > } > } > --- source code end > > Best Wishes, > Oliver > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Problems-with-ComputeOBB-wrong-OBB-computed-tp5728174p5728187.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fotosentido at gmail.com Wed Aug 13 06:56:10 2014 From: fotosentido at gmail.com (Marcos) Date: Wed, 13 Aug 2014 12:56:10 +0200 Subject: [vtkusers] Adding image writer to the pipeline gets itk reader fails Message-ID: Hi, I wonder if somebody could help me, I'm stuck with this. Sorry if this was asked before, I didn't find anything similar. I got a simple pipeline working, starting with a itk::ImageFileReader who connects to a vtkImageImport, passing through a vtkImageViewer and ending in a QVTKWidget. Great. I see an image in my QVTKWidget. Now, writing to a file. Let's say a JPEG file. I tried with a vtkWindowToImageFilter and a vtkJPEGWriter. And that's where the weird things take place: the itk::ImageFileReader fails trying to read the file; a segmentation fault in the Update() method. Why? It's the same file, and the new code is added after. I guess it is related to the pipeline, but I don't get how the end of pipeline affects the beginning. Well, I know the Update method from the first object could update the whole pipeline. So I tried isolating the last part in a method, which is called from a menu option: in my application, I "open" the file. I see a image in my viewer. Then, later, I choose to export the image I see to a file. It's not until that moment that I create the vtkWindowToImageFilter and vtkJPEGWriter objects. But itk::ImageFileReader fails again. If I comment the last lines, it works again. Here is the code, simplified (reader is a global variable: when I call connectVTKWidget, it has called successfully (before I added the writing part) the Update method and I can see a image in the widget): void DCMBase::connectVTKWidget(QVTKWidget* widget) { typedef itk::Image< signed short, 2 > TipoImagen; typedef itk::ImageFileReader< TipoImagen > Tiporeader; Tiporeader::Pointer reader; typedef itk::VTKImageExport< TipoImagen > TipoImagenExport; TipoImagenExport::Pointer exporter = TipoImagenExport::New(); exporter->SetInput(reader->GetOutput()); vtkImageImport *imageImport = vtkImageImport::New(); this->ConnectPipelines(exporter, imageImport); vtkImageViewer* imageViewer = vtkImageViewer::New(); imageViewer->SetInputConnection(imageImport->GetOutputPort()); widget->SetRenderWindow(imageViewer->GetRenderWindow()); // with this, itk::ImageFileReader fails! vtkWindowToImageFilter* filtroAImagen = vtkWindowToImageFilter::New(); filtroAImagen->SetInput(widget->GetRenderWindow()); vtkJPEGWriter* writer = vtkJPEGWriter::New(); writer->SetFileName("myfile.jpg"); // writer->SetInputConnection(alg->GetOutputPort()); try { writer->Update(); } catch (itk::ExceptionObject& e) { std::cerr << "Excepci?n en escritura:" <Render(); } Am I missing something? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at oliwe.com Wed Aug 13 09:40:40 2014 From: mail at oliwe.com (Oliver Weinheimer) Date: Wed, 13 Aug 2014 06:40:40 -0700 (PDT) Subject: [vtkusers] Problems with ComputeOBB - wrong OBB computed In-Reply-To: References: <1407753513395-5728174.post@n5.nabble.com> <1407848098869-5728187.post@n5.nabble.com> Message-ID: <1407937240013-5728206.post@n5.nabble.com> Hi Goodwin, yes I also think that this change can improve accuracy also in other places in VTK. In my case, the mean calculation errors built up extremly, so that the calculated OBB was unusable. No, I'm not familiar with Gerrit, but I will have a look on it. Thanks for your reply and help. Oliver Goodwin Lawlor-2 wrote > Hi Oliver, > > That's a nice method - the mean is gradually accumulated, preserving the > accuracy of the floating point value. I'm sure there are other places in > VTK that would benefit from this code change... > > If you're familiar with Gerrit, could you submit this change? I'll have a > poke around the code base to see if there are other similar mean > calculations. > > Goodwin -- View this message in context: http://vtk.1045678.n5.nabble.com/Problems-with-ComputeOBB-wrong-OBB-computed-tp5728174p5728206.html Sent from the VTK - Users mailing list archive at Nabble.com. From goodwin.lawlor.lists at gmail.com Wed Aug 13 10:53:56 2014 From: goodwin.lawlor.lists at gmail.com (Goodwin Lawlor) Date: Wed, 13 Aug 2014 15:53:56 +0100 Subject: [vtkusers] Problems with ComputeOBB - wrong OBB computed In-Reply-To: <1407937240013-5728206.post@n5.nabble.com> References: <1407753513395-5728174.post@n5.nabble.com> <1407848098869-5728187.post@n5.nabble.com> <1407937240013-5728206.post@n5.nabble.com> Message-ID: This wiki page should get you going: http://www.vtk.org/Wiki/VTK/Git/Develop Goodwin On Wed, Aug 13, 2014 at 2:40 PM, Oliver Weinheimer wrote: > Hi Goodwin, > > yes I also think that this change can improve accuracy also in other places > in VTK. > In my case, the mean calculation errors built up extremly, so that the > calculated OBB was unusable. > No, I'm not familiar with Gerrit, but I will have a look on it. > Thanks for your reply and help. > > Oliver > > > Goodwin Lawlor-2 wrote > > Hi Oliver, > > > > That's a nice method - the mean is gradually accumulated, preserving the > > accuracy of the floating point value. I'm sure there are other places in > > VTK that would benefit from this code change... > > > > If you're familiar with Gerrit, could you submit this change? I'll have a > > poke around the code base to see if there are other similar mean > > calculations. > > > > Goodwin > > > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Problems-with-ComputeOBB-wrong-OBB-computed-tp5728174p5728206.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean.larkin at lickenbrocktech.com Wed Aug 13 11:04:11 2014 From: sean.larkin at lickenbrocktech.com (Sean Larkin) Date: Wed, 13 Aug 2014 10:04:11 -0500 Subject: [vtkusers] Offscreen rendering set size of window causes error Message-ID: <000c01cfb707$d761d200$86257600$@lickenbrocktech.com> Hello all, I have a qt-vtk application that renders 3D data. The user interface contains a vtkRenderWindow that displays the combination of its own rendered data as well as a rendered mask from another offscreen vtkRenderWindow (The same data is rendered in both windows but with different settings, and then the offscreen rendered data is masked and then the masked portions replace the on screen data in the same portions). I want the two windows to render into the same size, so when I resize the displayed render window I get its size and then set the size of the offscreen render window to that same size. Then I call render() on the offscreen window, which causes the following error: ERROR: In ..\..\..\VTK Git Source 3-31-14 for build\Rendering\OpenGL\vtkShaderProgram2.cxx, line 471 vtkShaderProgram2 (00000000051076A0): failed at glAttachShader 1 OpenGL errors detected 0 : (1282) Invalid operation The source code in vtkShaderProgram2.cxx that generates this error is : // We compile all the shaders, even if one fails so that // we can get info logs for all shaders. bool compileDone = true; this->Shaders->InitTraversal(); vtkShader2 *s = this->Shaders->GetNextShader(); while (s) { // Propagate the context to the shader. s->SetContext(this->Context); s->Compile(); if (s->GetLastCompileStatus()) { vtkgl::AttachShader(progId, static_cast(s->GetId())); vtkOpenGLCheckErrorMacro("failed at glAttachShader"); } I have not tried to debug the source code yet, as my code links to a release build of vtk 6.1. My guess is that s->GetId() is returning a NULL or something erroneous. This has something to do with setting the window to do offscreen rendering. When I have the window render on screen I do not get this error when setting the size. Can anyone give me any clues as to why I am getting this error? Thanks, Sean -------------- next part -------------- An HTML attachment was scrubbed... URL: From goodwin.lawlor.lists at gmail.com Wed Aug 13 12:08:14 2014 From: goodwin.lawlor.lists at gmail.com (Goodwin Lawlor) Date: Wed, 13 Aug 2014 17:08:14 +0100 Subject: [vtkusers] Problems with ComputeOBB - wrong OBB computed In-Reply-To: References: <1407753513395-5728174.post@n5.nabble.com> <1407848098869-5728187.post@n5.nabble.com> <1407937240013-5728206.post@n5.nabble.com> Message-ID: Would methods like: static int vtkMath::GetMean3 (vtkDataArray *array, double mean[3]) static int vtkMath::GetCovarianceMatrix (vtkDataArray *array, double mean[3], double *covariance) be a better way? Goodwin cf. for VTK devs see http://vtk.markmail.org/search/?q=#query:%20list%3Aorg.vtk.vtkusers+page:1+mid:ppj3wtbusf537spk+state:results On Wed, Aug 13, 2014 at 3:53 PM, Goodwin Lawlor < goodwin.lawlor.lists at gmail.com> wrote: > This wiki page should get you going: > http://www.vtk.org/Wiki/VTK/Git/Develop > > Goodwin > > > On Wed, Aug 13, 2014 at 2:40 PM, Oliver Weinheimer wrote: > >> Hi Goodwin, >> >> yes I also think that this change can improve accuracy also in other >> places >> in VTK. >> In my case, the mean calculation errors built up extremly, so that the >> calculated OBB was unusable. >> No, I'm not familiar with Gerrit, but I will have a look on it. >> Thanks for your reply and help. >> >> Oliver >> >> >> Goodwin Lawlor-2 wrote >> > Hi Oliver, >> > >> > That's a nice method - the mean is gradually accumulated, preserving the >> > accuracy of the floating point value. I'm sure there are other places in >> > VTK that would benefit from this code change... >> > >> > If you're familiar with Gerrit, could you submit this change? I'll have >> a >> > poke around the code base to see if there are other similar mean >> > calculations. >> > >> > Goodwin >> >> >> >> >> >> -- >> View this message in context: >> http://vtk.1045678.n5.nabble.com/Problems-with-ComputeOBB-wrong-OBB-computed-tp5728174p5728206.html >> Sent from the VTK - Users mailing list archive at Nabble.com. >> _______________________________________________ >> 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 >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From beekmaarten at yahoo.com Wed Aug 13 12:29:41 2014 From: beekmaarten at yahoo.com (Maarten Beek) Date: Wed, 13 Aug 2014 09:29:41 -0700 Subject: [vtkusers] Getting pointer to currently picked actor Message-ID: <1407947381.61312.YahooMailNeo@web121306.mail.ne1.yahoo.com> Hi all, I noticed that getting the currently picked actor from the picker in the interactor doesn't always work. Some interactor styles and widgets (e.g. vtkInteractorstyleTrackballActor) have their own picker which is used for the picking but which is different from the one in the interactor. I wrote a class that has awareness of the interactor. I would like to use this->Interactor->GetPicker() to get access to the currently picked object. However this doesn't work with observers like vtkInteractorstyleTrackballActor. Using this->Interactor->GetInteractorStyle()->GetPicker() is also not an option because not all observers use their own picker (and a GetPicker() function does not exist in vtkInteractorstyleTrackballActor). The hack I made was to derive from vtkInteractorstyleTrackballActor and overload the SetInteractor()? function: void MyClass::SetInteractor(vtkRenderWindowInteractor* rwi) { ??? this->Superclass::SetInteractor(rwi); ??? if( this->Interactor != NULL ) ??? { ??? ??? vtkCellPicker* picker = vtkCellPicker::New; ??? ??? picker->SetTolerance(0.001); ??? ??? this->Interactor->SetPicker(picker); ??? ??? picker->Delete(); ??? } } This works. But I'd like to use MyClass with different observers w/o having to derive from all of them... I've also looked at the PickingManager class since all observers seems to register their pickers, but firstly it is not enabled by default and secondly to get the current selection I have to call GetAssemblyPath() which performs a pick which I don't want because this invokes a PickEvent.. I use the event in MyClass but only when I pick an object, not when I want the currently picked object. Giving vtkPickingManager a public SelectedPicker() function (like vtkPickingManager::Internal has) would do the trick here.. I guess my question is: How would a write code to get the currently picked object that works with various observers when I only have awareness of the interactor? Maarten -------------- next part -------------- An HTML attachment was scrubbed... URL: From carlinhosmp87 at gmail.com Wed Aug 13 13:52:38 2014 From: carlinhosmp87 at gmail.com (Carlos Martinez) Date: Wed, 13 Aug 2014 19:52:38 +0200 Subject: [vtkusers] How to add custom shaders in OpenGL2 backend In-Reply-To: <1407905880602-5728201.post@n5.nabble.com> References: <1407905880602-5728201.post@n5.nabble.com> Message-ID: Hi David, I think this solution should work for you: http://vtk.1045678.n5.nabble.com/GLSL-Shader-on-a-vtkActor-VTK-6-1-and-Qt-5-2-1-td5727788.html We solved it with the help of Kitware people! I hope it will help you. Carlos. 2014-08-13 6:58 GMT+02:00 eternallite2 : > Are there any examples yet of how to add custom vertex and fragment shaders > to existing actors in the renderer? (Using the OpenGL2 backend) > > Thank you again > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/How-to-add-custom-shaders-in-OpenGL2-backend-tp5728201.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdrahos at robodoc.com Wed Aug 13 15:57:36 2014 From: mdrahos at robodoc.com (Miro Drahos) Date: Wed, 13 Aug 2014 12:57:36 -0700 Subject: [vtkusers] Getting pointer to currently picked actor In-Reply-To: <1407947381.61312.YahooMailNeo@web121306.mail.ne1.yahoo.com> References: <1407947381.61312.YahooMailNeo@web121306.mail.ne1.yahoo.com> Message-ID: <53EBC330.8000505@robodoc.com> Hi Maarten, I would suggest creating a callback and registering it with the interactor's *ButtonPressEvent. The callback would manage its own picker. Something like: //================================================ class PickCallback : public vtkCommand { public : static PickCallback * New() { return new PickCallback; } void SetRenderer(vtkRenderer * r) { this->ren = r; } void Execute(vtkObject *caller, unsigned long event, void *) { if (this->ren == NULL) return; if (event == vtkCommand::LeftButtonPressEvent) { vtkRenderWindowInteractor * rwi = vtkRenderWindowInteractor::SafeDownCast(caller); if (rwi) { this->picker->Pick(x, y, this->ren); vtkAssemblyPath * path = this->picker->GetPath(); if (path) { // Something was picked for sure. vtkProp * pickedProp = path->GetLastNode()->GetViewProp(); // do something with the prop } } } } private : PickCallback() { this->picker = vtkSmartPointer::New(); this->ren = NULL; } vtkRenderer * ren; vtkSmartPointer picker; }; //--------------------------------------------------------------------- // How to use the callback: vtkSmartPointer cbk = vtkSmartPointer::New(); cbk->SetRenderer(ren); interactor->AddObserver(vtkCommand::LeftButtonPressEvent, cbk); //================================================ Hope this helps, Miro On 08/13/2014 09:29 AM, Maarten Beek via vtkusers wrote: > Hi all, > > I noticed that getting the currently picked actor from the picker in > the interactor doesn't always work. > Some interactor styles and widgets (e.g. > vtkInteractorstyleTrackballActor) have their own picker which is used > for the picking but which is different from the one in the interactor. > > I wrote a class that has awareness of the interactor. > I would like to use this->Interactor->GetPicker() to get access to the > currently picked object. However this doesn't work with observers like > vtkInteractorstyleTrackballActor. Using > this->Interactor->GetInteractorStyle()->GetPicker() is also not an > option because not all observers use their own picker (and a > GetPicker() function does not exist in vtkInteractorstyleTrackballActor). > > The hack I made was to derive from vtkInteractorstyleTrackballActor > and overload the SetInteractor() function: > > void MyClass::SetInteractor(vtkRenderWindowInteractor* rwi) > { > this->Superclass::SetInteractor(rwi); > if( this->Interactor != NULL ) > { > vtkCellPicker* picker = vtkCellPicker::New; > picker->SetTolerance(0.001); > this->Interactor->SetPicker(picker); > picker->Delete(); > } > } > > This works. But I'd like to use MyClass with different observers w/o > having to derive from all of them... > > I've also looked at the PickingManager class since all observers seems > to register their pickers, but firstly it is not enabled by default > and secondly to get the current selection I have to call > GetAssemblyPath() which performs a pick which I don't want because > this invokes a PickEvent.. I use the event in MyClass but only when I > pick an object, not when I want the currently picked object. Giving > vtkPickingManager a public SelectedPicker() function (like > vtkPickingManager::Internal has) would do the trick here.. > > I guess my question is: > How would a write code to get the currently picked object that works > with various observers when I only have awareness of the interactor? > > Maarten > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From beekmaarten at yahoo.com Wed Aug 13 16:45:08 2014 From: beekmaarten at yahoo.com (Maarten Beek) Date: Wed, 13 Aug 2014 13:45:08 -0700 Subject: [vtkusers] Getting pointer to currently picked actor In-Reply-To: <53EBC330.8000505@robodoc.com> References: <1407947381.61312.YahooMailNeo@web121306.mail.ne1.yahoo.com> <53EBC330.8000505@robodoc.com> Message-ID: <1407962708.42016.YahooMailNeo@web121304.mail.ne1.yahoo.com> Thanks for the suggestion, Miro. I actually implemented something similar. However, when I pick the actor I make it transparent. When I then want to get the picked actor, I have to use vtkRenderer::PickProp because that apparently also picks transparent props. However, it is really slow... Any suggestion here? Thanks - Maarten On Wednesday, August 13, 2014 4:10:03 PM, Miro Drahos wrote: Hi Maarten, I would suggest creating a callback and registering it with the interactor's *ButtonPressEvent. The callback would manage its own picker. Something like: //================================================ class PickCallback : public vtkCommand { public : ? static PickCallback * New() { return new PickCallback; } ? void SetRenderer(vtkRenderer * r) { this->ren = r; } ? void Execute(vtkObject *caller, unsigned long event, void *) ? { ??? if (this->ren == NULL) ????? return; ??? if (event ==? vtkCommand::LeftButtonPressEvent) ????? { ??????? vtkRenderWindowInteractor * rwi = vtkRenderWindowInteractor::SafeDownCast(caller); ??????? if (rwi) ????????? { ??????????? this->picker->Pick(x, y, this->ren); ??????????? vtkAssemblyPath * path = this->picker->GetPath(); ??????????? if (path) ????????????? { ??????????????? // Something was picked for sure. ??????????????? vtkProp * pickedProp = path->GetLastNode()->GetViewProp(); ??????????????? // do something with the prop ????????????? } ????????? } ????? } ? } private : ? PickCallback() { ??? this->picker = vtkSmartPointer::New(); ??? this->ren??? = NULL; ? } ? ? vtkRenderer?????????????????? * ren; ? vtkSmartPointer? picker; }; //--------------------------------------------------------------------- // How to use the callback: vtkSmartPointer cbk = vtkSmartPointer::New(); cbk->SetRenderer(ren); interactor->AddObserver(vtkCommand::LeftButtonPressEvent, cbk); //================================================ Hope this helps, Miro On 08/13/2014 09:29 AM, Maarten Beek via vtkusers wrote: Hi all, > > >I noticed that getting the currently picked actor from the picker in the interactor doesn't always work. >Some interactor styles and widgets (e.g. vtkInteractorstyleTrackballActor) have their own picker which is used for the picking but which is different from the one in the interactor. > > >I wrote a class that has awareness of the interactor. >I would like to use this->Interactor->GetPicker() to get access to the currently picked object. However this doesn't work with observers like vtkInteractorstyleTrackballActor. Using this->Interactor->GetInteractorStyle()->GetPicker() is also not an option because not all observers use their own picker (and a GetPicker() function does not exist in vtkInteractorstyleTrackballActor). > > >The hack I made was to derive from vtkInteractorstyleTrackballActor and overload the SetInteractor()? function: > > >void MyClass::SetInteractor(vtkRenderWindowInteractor* rwi) >{ >??? this->Superclass::SetInteractor(rwi); >??? if( this->Interactor != NULL ) >??? { >??? ??? vtkCellPicker* picker = vtkCellPicker::New; >??? ??? picker->SetTolerance(0.001); >??? ??? this->Interactor->SetPicker(picker); >??? ??? picker->Delete(); >??? } >} > > >This works. But I'd like to use MyClass with different observers w/o having to derive from all of them... > > >I've also looked at the PickingManager class since all observers seems to register their pickers, but firstly it is not enabled by default and secondly to get the current selection I have to call GetAssemblyPath() which performs a pick which I don't want because this invokes a PickEvent.. I use the event in MyClass but only when I pick an object, not when I want the currently picked object. Giving vtkPickingManager a public SelectedPicker() function (like >vtkPickingManager::Internal has) would do the trick here.. > > >I guess my question is: >How would a write code to get the currently picked object that works with various observers when I only have awareness of the interactor? > > >Maarten > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From samantrv at mail.uc.edu Wed Aug 13 18:34:14 2014 From: samantrv at mail.uc.edu (Samant, Rutuja (samantrv)) Date: Wed, 13 Aug 2014 22:34:14 +0000 Subject: [vtkusers] vtkVoxelModeller iterate through voxels Message-ID: <1478c03f584a43df81c8383c1d27b3e7@CO1PR01MB190.prod.exchangelabs.com> ?Hey, I am using vtkVoxelModeller and I need to iterate through the VTK bit data to identify which voxels are filled and which are empty. Can I get the bit data in an array of some sort which I can run through and extract the information? Regards, Rutuja Samant Graduate Student, Mechanical Engineering University of Cincinnati -------------- next part -------------- An HTML attachment was scrubbed... URL: From cdavid.tran at gmail.com Wed Aug 13 18:54:01 2014 From: cdavid.tran at gmail.com (eternallite2) Date: Wed, 13 Aug 2014 15:54:01 -0700 (PDT) Subject: [vtkusers] How to add custom shaders in OpenGL2 backend In-Reply-To: References: <1407905880602-5728201.post@n5.nabble.com> Message-ID: <1407970441723-5728216.post@n5.nabble.com> Hello thanks for the reply :) but I'm using VTK 6.2.0 with the OpenGL2 backend. OpenGL2 seems to be mutually exclusive of VTK 6.1.0's OpenGL 1.1 backend (like the vtkOpenGLProperty in OpenGL2 doesn't seem to have a "setPropProgram" function and the vtkShaderProgram2 and vtkShader2 classes don't exist either, and seem to be replaced with vtkglShaderProgram and vtkglShader. Hmm...also the rendering seems to be performed in vtkOpenGLPolyDataMapper itself where they are dynamically replacing commented lines in vertex/fragment shader programs to implementations. I'm wondering how to plug in custom shader code in this new backend. Thanks again for any replies (as it's still very new and experimental) -- View this message in context: http://vtk.1045678.n5.nabble.com/How-to-add-custom-shaders-in-OpenGL2-backend-tp5728201p5728216.html Sent from the VTK - Users mailing list archive at Nabble.com. From mail at oliwe.com Thu Aug 14 04:37:57 2014 From: mail at oliwe.com (Oliver Weinheimer) Date: Thu, 14 Aug 2014 01:37:57 -0700 (PDT) Subject: [vtkusers] Problems with ComputeOBB - wrong OBB computed In-Reply-To: References: <1407753513395-5728174.post@n5.nabble.com> <1407848098869-5728187.post@n5.nabble.com> <1407937240013-5728206.post@n5.nabble.com> Message-ID: <1408005477419-5728218.post@n5.nabble.com> Yes, it would be nice to have it in vtkMath. Variance calculation can easily be integrated in this calculation. static int vtkMath::GetMean(vtkDataArray *array, int dim, double* mean, double* variance) So variance can additionally calculated if variance!=0. I will have a look on Gerrit tomorrow . Oliver Goodwin Lawlor-2 wrote > Would methods like: > > static int vtkMath::GetMean3 (vtkDataArray *array, double mean[3]) > static int vtkMath::GetCovarianceMatrix (vtkDataArray *array, double > mean[3], double *covariance) > > be a better way? > > Goodwin -- View this message in context: http://vtk.1045678.n5.nabble.com/Problems-with-ComputeOBB-wrong-OBB-computed-tp5728174p5728218.html Sent from the VTK - Users mailing list archive at Nabble.com. From fotosentido at gmail.com Thu Aug 14 06:24:53 2014 From: fotosentido at gmail.com (Marcos) Date: Thu, 14 Aug 2014 12:24:53 +0200 Subject: [vtkusers] vtkImageViewer2 not rendering until I reset Message-ID: Hi, I've showed a dicom image successfully with vtkImageviewer. Then I realized that vtkImageviewer2 would be more suitable, as I needed interactors and load images with slices, maybe 3d, etc So I changed to vtkImageviewer2. Then I just see a white image. All white. But my surprise was that, adding the render window interactor, when I press r... the image appears! So I looked into the class code. I saw the reset event and how it sets color window and color level. I've tried doing this, with poor results. Why do I have to reset the window/level to see the image? I can do zoom, and rotate... around the white plane. I did a widget->Update() or a imageViewer->Render() with the same result. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcus.hanwell at kitware.com Thu Aug 14 11:06:17 2014 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Thu, 14 Aug 2014 11:06:17 -0400 Subject: [vtkusers] How to add custom shaders in OpenGL2 backend In-Reply-To: <1407905880602-5728201.post@n5.nabble.com> References: <1407905880602-5728201.post@n5.nabble.com> Message-ID: On Wed, Aug 13, 2014 at 12:58 AM, eternallite2 wrote: > Are there any examples yet of how to add custom vertex and fragment shaders > to existing actors in the renderer? (Using the OpenGL2 backend) > Not yet, we wanted to get this out there as soon as possible but there is very little in the way of custom shaders/extension of the rendering modes available at this stage. It is on our list, but as you may have seen the way rendering happens has changed quite extensively. Thanks for taking a look, we will publish an update when there is more API in this area. Marcus From marcus.hanwell at kitware.com Thu Aug 14 11:07:18 2014 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Thu, 14 Aug 2014 11:07:18 -0400 Subject: [vtkusers] OpenGL2 Backend and vtkImageProcessingPass In-Reply-To: <1407898965598-5728200.post@n5.nabble.com> References: <1407898965598-5728200.post@n5.nabble.com> Message-ID: On Tue, Aug 12, 2014 at 11:02 PM, eternallite2 wrote: > In a previous version of VTK (6.1.0), with the old OpenGL backend > we were able to do multi-pass rendering and there were examples of > how to do custom post-processing effects (like blurring, sobel edge > detection, etc.) > > With OpenGL2 backend, is it possible to do these effects using FBOs? (If so, > are there any examples yet of how to do this) > Same answer as in your other post to be honest, not yet but we are working on it. From marcus.hanwell at kitware.com Thu Aug 14 11:09:36 2014 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Thu, 14 Aug 2014 11:09:36 -0400 Subject: [vtkusers] correct way of using VTK_MODULE_INIT with opengl2 In-Reply-To: <53E3177A.3050407@gmail.com> References: <53E3177A.3050407@gmail.com> Message-ID: On Thu, Aug 7, 2014 at 2:06 AM, Ahmet Do?an wrote: > hi, > > I have swith to opengl2 for performance purposes. But when I was using > opengl just I init rendering modules like > > #define vtkRenderingCore_AUTOINIT > 4(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingFreeTypeOpenGL,vtkRenderingOpenGL) > #define vtkRenderingVolume_AUTOINIT 1(vtkRenderingVolumeOpenGL) > > but after compiling vtk with opengl2 support some of them not using anymore > than I tried to use with "autoint.h" like > > #include > VTK_MODULE_INIT(vtkRenderingOpenGL2) > > after that I get warning : vtkInteractorStyleSwitchBase (00000000026CCE00): > Warning: Link to vtkInteractionStyle for default style selection.Thus, what > is the correct initialization for vtkRenderingCore and vtkRenderingVolume > with opengl2 backend. > This is because vtkRenderingOpenGL2 replaces vtkRenderingOpenGL, but you will still need vtkInteractionStyle. I would encourage using the module init macros where possible as they are easier to understand, it then becomes an entry per implementation module in the file with the initialization code in it. Hope that helps. Marcus From marcus.hanwell at kitware.com Thu Aug 14 11:44:35 2014 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Thu, 14 Aug 2014 11:44:35 -0400 Subject: [vtkusers] Which vtk library used for 2D plots In-Reply-To: <1407530371.72940.YahooMailNeo@web193004.mail.sg3.yahoo.com> References: <1407530371.72940.YahooMailNeo@web193004.mail.sg3.yahoo.com> Message-ID: On Fri, Aug 8, 2014 at 4:39 PM, Akash Gaurav wrote: > Hello All, > > I am new to vtk world, but i tried most of the example. I am looking for a > way to plot 2-D (X vs Y) graph using vtk and also spectral plot. Can I > anyone help me to figure out which library should I use and how? > Not sure if it has all the plot types you want, but you can use vtkChartsCore, vtkChartXY has scatter, line, bar, and others. You can look at the tests for C++ and Python examples of their use (Charts/Core/Testing/[language]). Marcus From mdrahos at robodoc.com Thu Aug 14 14:29:23 2014 From: mdrahos at robodoc.com (Miro Drahos) Date: Thu, 14 Aug 2014 11:29:23 -0700 Subject: [vtkusers] Getting pointer to currently picked actor In-Reply-To: <1407962708.42016.YahooMailNeo@web121304.mail.ne1.yahoo.com> References: <1407947381.61312.YahooMailNeo@web121306.mail.ne1.yahoo.com> <53EBC330.8000505@robodoc.com> <1407962708.42016.YahooMailNeo@web121304.mail.ne1.yahoo.com> Message-ID: <53ED0003.5030009@robodoc.com> I am not sure I understand -- what do you mean by picking transparent prop? Can you elaborate a bit more? Post some code to illustrate the issue? If you are picking an opaque actor and then making it transparent after the pick, there should be no issues with that. Picking something that is not being rendered -- I have never done that but I would think you'd have to use a ray casting picker (such as cell picker). vtkPropPicker is faster than cell picker (hw accelerated), but doesn't give you tolerance and the prop you are picking must be visible. If you can live with that, definitely go with vtkPropPicker. Miro On 08/13/2014 01:45 PM, Maarten Beek wrote: > Thanks for the suggestion, Miro. > > I actually implemented something similar. > However, when I pick the actor I make it transparent. > > When I then want to get the picked actor, I have to use > vtkRenderer::PickProp because that apparently also picks transparent > props. However, it is really slow... Any suggestion here? > > Thanks - Maarten > > > On Wednesday, August 13, 2014 4:10:03 PM, Miro Drahos > wrote: > > > Hi Maarten, > I would suggest creating a callback and registering it with the > interactor's *ButtonPressEvent. The callback would manage its own > picker. Something like: > > //================================================ > class PickCallback : public vtkCommand > { > public : > static PickCallback * New() { return new PickCallback; } > void SetRenderer(vtkRenderer * r) { this->ren = r; } > void Execute(vtkObject *caller, unsigned long event, void *) > { > if (this->ren == NULL) > return; > > if (event == vtkCommand::LeftButtonPressEvent) > { > vtkRenderWindowInteractor * rwi = > vtkRenderWindowInteractor::SafeDownCast(caller); > if (rwi) > { > this->picker->Pick(x, y, this->ren); > vtkAssemblyPath * path = this->picker->GetPath(); > if (path) > { > // Something was picked for sure. > vtkProp * pickedProp = path->GetLastNode()->GetViewProp(); > > // do something with the prop > } > } > } > } > > private : > PickCallback() { > this->picker = vtkSmartPointer::New(); > this->ren = NULL; > } > > vtkRenderer * ren; > vtkSmartPointer picker; > }; > > //--------------------------------------------------------------------- > // How to use the callback: > vtkSmartPointer cbk = vtkSmartPointer::New(); > cbk->SetRenderer(ren); > interactor->AddObserver(vtkCommand::LeftButtonPressEvent, cbk); > //================================================ > > Hope this helps, > Miro > > > > On 08/13/2014 09:29 AM, Maarten Beek via vtkusers wrote: >> Hi all, >> >> I noticed that getting the currently picked actor from the picker in >> the interactor doesn't always work. >> Some interactor styles and widgets (e.g. >> vtkInteractorstyleTrackballActor) have their own picker which is used >> for the picking but which is different from the one in the interactor. >> >> I wrote a class that has awareness of the interactor. >> I would like to use this->Interactor->GetPicker() to get access to >> the currently picked object. However this doesn't work with observers >> like vtkInteractorstyleTrackballActor. Using >> this->Interactor->GetInteractorStyle()->GetPicker() is also not an >> option because not all observers use their own picker (and a >> GetPicker() function does not exist in vtkInteractorstyleTrackballActor). >> >> The hack I made was to derive from vtkInteractorstyleTrackballActor >> and overload the SetInteractor() function: >> >> void MyClass::SetInteractor(vtkRenderWindowInteractor* rwi) >> { >> this->Superclass::SetInteractor(rwi); >> if( this->Interactor != NULL ) >> { >> vtkCellPicker* picker = vtkCellPicker::New; >> picker->SetTolerance(0.001); >> this->Interactor->SetPicker(picker); >> picker->Delete(); >> } >> } >> >> This works. But I'd like to use MyClass with different observers w/o >> having to derive from all of them... >> >> I've also looked at the PickingManager class since all observers >> seems to register their pickers, but firstly it is not enabled by >> default and secondly to get the current selection I have to call >> GetAssemblyPath() which performs a pick which I don't want because >> this invokes a PickEvent.. I use the event in MyClass but only when I >> pick an object, not when I want the currently picked object. Giving >> vtkPickingManager a public SelectedPicker() function (like >> vtkPickingManager::Internal has) would do the trick here.. >> >> I guess my question is: >> How would a write code to get the currently picked object that works >> with various observers when I only have awareness of the interactor? >> >> Maarten >> >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cesarrmalaver at gmail.com Thu Aug 14 17:04:21 2014 From: cesarrmalaver at gmail.com (cesarrmamlaver) Date: Thu, 14 Aug 2014 14:04:21 -0700 (PDT) Subject: [vtkusers] renderWindowInteractor in vtkWidget Message-ID: <1408050261322-5728226.post@n5.nabble.com> Hi all, I'm a new user in VTK, i need put a renderWindowInteractor in the QVTKWidget of QTCreator. I have this: vtkSmartPointer renderer = vtkSmartPointer::New(); vtkSmartPointer renderWindow = vtkSmartPointer::New(); renderWindow->AddRenderer(renderer); vtkSmartPointer renderWindowInteractor = vtkSmartPointer::New(); renderWindowInteractor->SetRenderWindow(renderWindow); renderer->AddActor(actor); renderWindow->Render(); renderWindowInteractor->Initialize(); but how I can put RenderWindowInteractor in QVTKWidget?? I tried this but don't worked. this->qvtkWidget->GetRenderWindow()->AddRenderer(renderer); Sorry for my English, I from Colombia. -- View this message in context: http://vtk.1045678.n5.nabble.com/renderWindowInteractor-in-vtkWidget-tp5728226.html Sent from the VTK - Users mailing list archive at Nabble.com. From taron2000 at gmx.de Fri Aug 15 05:05:18 2014 From: taron2000 at gmx.de (Taron) Date: Fri, 15 Aug 2014 02:05:18 -0700 (PDT) Subject: [vtkusers] vtk becomes slow and consumes more and more memory. Message-ID: <1408093518320-5728227.post@n5.nabble.com> Hi there, this is a follow-up to my memory leak question, which in fact is not a "real" memory leak but something different. I'm using VTK 6.1 on Windows 7 x64 compiled Visual Studio 2012 in 64Bit. My problem is that everytime I create objects in vtk and call update on them it takes more and more memory and runs longer and longer. Consider this code: #include #include #include int main(int argc, char *argv[]) { int c=0; clock_t start; size_t iterations = 1000; while (c != '.'){ c = getchar(); start = clock(); for(size_t i=0; iSetExtent(0,1,0,1,0,1); test->AllocateScalars(VTK_FLOAT,1); pad->SetInputData(test); pad->SetOutputWholeExtent(0,2,0,2,0,2); pad->Update(); //this is what makes it bad pad->Delete(); test->Delete(); } std::cout << "Time for " << iterations << ": " << static_cast(clock() - start) / CLOCKS_PER_SEC << "sec" << std::endl; } return 0; } The output: Time for 1000: 0.816sec Time for 1000: 1.879sec Time for 1000: 3.454sec etc. It takes longer with every call to update and consumes more memory, but all instances are deleted in the for-scope. So this seems to create some sort of objects and puts into an update pipeline, but does not remove them later internally. Can anyone confirm this behavior and other platforms and, how to fix that? -- View this message in context: http://vtk.1045678.n5.nabble.com/vtk-becomes-slow-and-consumes-more-and-more-memory-tp5728227.html Sent from the VTK - Users mailing list archive at Nabble.com. From dzenanz at gmail.com Fri Aug 15 05:34:48 2014 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Fri, 15 Aug 2014 11:34:48 +0200 Subject: [vtkusers] Unable to cmake 64 bit In-Reply-To: <1c8d898ae6b6421ba900e37433af6c3f@BN1PR01MB183.prod.exchangelabs.com> References: <1c8d898ae6b6421ba900e37433af6c3f@BN1PR01MB183.prod.exchangelabs.com> Message-ID: Perhaps you need to disable incremental linking as per this thread ? On Tue, Aug 12, 2014 at 6:28 PM, Samant, Rutuja (samantrv) < samantrv at mail.uc.edu> wrote: > Hello, > > > > I am trying to configure vtk in cmake for VS 2010 64 bit. However I keep > getting the error : > > > > LINK : fatal error LNK1123: failure during conversion to COFF: file > invalid or corrupt > [C:\VTK\Bin\CMakeFiles\CMakeTmp\cmTryCompileExec1825641800.vcxproj] > > > > Could someone help me with my error? > > > > Regards, > > Rutuja Samant > > Graduate Student, Mechanical Engineering > > University of Cincinnati > > > > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fotosentido at gmail.com Fri Aug 15 07:03:46 2014 From: fotosentido at gmail.com (Marcos) Date: Fri, 15 Aug 2014 13:03:46 +0200 Subject: [vtkusers] Adding image writer to the pipeline gets itk reader fails In-Reply-To: References: Message-ID: Well, now I don't understand at all. The problem with itk ImageFileReader doesn't occur when I add the writer to the pipeline... it's when I create the vtkJPEGWriter!!!! The line: vtkJPEGWriter* writer = vtkJPEGWriter::New(); is the problem. Why?? It has nothing to do with the reading of the file!! It doesn't execute, it's in another function I don't use at that moment! I comment that line -and all the next with that object- I can read the file. I just add that line: itkImageFileReader fails!!! I'm just wasting a lot of time with this. 2014-08-13 12:56 GMT+02:00 Marcos : > Hi, > > I wonder if somebody could help me, I'm stuck with this. Sorry if this was > asked before, I didn't find anything similar. > > I got a simple pipeline working, starting with a itk::ImageFileReader who > connects to a vtkImageImport, passing through a vtkImageViewer and ending > in a QVTKWidget. > > Great. I see an image in my QVTKWidget. > > Now, writing to a file. Let's say a JPEG file. > > I tried with a vtkWindowToImageFilter and a vtkJPEGWriter. > > And that's where the weird things take place: the itk::ImageFileReader > fails trying to read the file; a segmentation fault in the Update() method. > > Why? It's the same file, and the new code is added after. > > I guess it is related to the pipeline, but I don't get how the end of > pipeline affects the beginning. Well, I know the Update method from the > first object could update the whole pipeline. > > So I tried isolating the last part in a method, which is called from a > menu option: in my application, I "open" the file. I see a image in my > viewer. Then, later, I choose to export the image I see to a file. It's not > until that moment that I create the vtkWindowToImageFilter and > vtkJPEGWriter objects. > > But itk::ImageFileReader fails again. If I comment the last lines, it > works again. > > Here is the code, simplified (reader is a global variable: when I call > connectVTKWidget, it has called successfully (before I added the writing > part) the Update method and I can see a image in the widget): > > void DCMBase::connectVTKWidget(QVTKWidget* widget) > { > typedef itk::Image< signed short, 2 > TipoImagen; > typedef itk::ImageFileReader< TipoImagen > Tiporeader; > Tiporeader::Pointer reader; > > typedef itk::VTKImageExport< TipoImagen > TipoImagenExport; > TipoImagenExport::Pointer exporter = TipoImagenExport::New(); > exporter->SetInput(reader->GetOutput()); > > vtkImageImport *imageImport = vtkImageImport::New(); > this->ConnectPipelines(exporter, imageImport); > > vtkImageViewer* imageViewer = vtkImageViewer::New(); > imageViewer->SetInputConnection(imageImport->GetOutputPort()); > widget->SetRenderWindow(imageViewer->GetRenderWindow()); > > // with this, itk::ImageFileReader fails! > vtkWindowToImageFilter* filtroAImagen = vtkWindowToImageFilter::New(); > filtroAImagen->SetInput(widget->GetRenderWindow()); > vtkJPEGWriter* writer = vtkJPEGWriter::New(); > writer->SetFileName("myfile.jpg"); > // writer->SetInputConnection(alg->GetOutputPort()); > > try > { > writer->Update(); > } > catch (itk::ExceptionObject& e) > { > std::cerr << "Excepci?n en escritura:" < std::cerr << e << std::endl; > } > > imageViewer->Render(); > } > > > > Am I missing something? Thanks in advance. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fotosentido at gmail.com Fri Aug 15 07:28:03 2014 From: fotosentido at gmail.com (Marcos) Date: Fri, 15 Aug 2014 13:28:03 +0200 Subject: [vtkusers] Adding image writer to the pipeline gets itk reader fails In-Reply-To: References: Message-ID: The problem is in the file. I don't know why it works with that file without that line. Really weird. I just don't get it. I will try with other files. 2014-08-15 13:03 GMT+02:00 Marcos : > Well, now I don't understand at all. > > The problem with itk ImageFileReader doesn't occur when I add the writer > to the pipeline... it's when I create the vtkJPEGWriter!!!! > > The line: > vtkJPEGWriter* writer = vtkJPEGWriter::New(); > > is the problem. > > Why?? It has nothing to do with the reading of the file!! It doesn't > execute, it's in another function I don't use at that moment! > > I comment that line -and all the next with that object- I can read the > file. > > I just add that line: itkImageFileReader fails!!! > > I'm just wasting a lot of time with this. > > > > 2014-08-13 12:56 GMT+02:00 Marcos : > > Hi, >> >> I wonder if somebody could help me, I'm stuck with this. Sorry if this >> was asked before, I didn't find anything similar. >> >> I got a simple pipeline working, starting with a itk::ImageFileReader who >> connects to a vtkImageImport, passing through a vtkImageViewer and ending >> in a QVTKWidget. >> >> Great. I see an image in my QVTKWidget. >> >> Now, writing to a file. Let's say a JPEG file. >> >> I tried with a vtkWindowToImageFilter and a vtkJPEGWriter. >> >> And that's where the weird things take place: the itk::ImageFileReader >> fails trying to read the file; a segmentation fault in the Update() method. >> >> Why? It's the same file, and the new code is added after. >> >> I guess it is related to the pipeline, but I don't get how the end of >> pipeline affects the beginning. Well, I know the Update method from the >> first object could update the whole pipeline. >> >> So I tried isolating the last part in a method, which is called from a >> menu option: in my application, I "open" the file. I see a image in my >> viewer. Then, later, I choose to export the image I see to a file. It's not >> until that moment that I create the vtkWindowToImageFilter and >> vtkJPEGWriter objects. >> >> But itk::ImageFileReader fails again. If I comment the last lines, it >> works again. >> >> Here is the code, simplified (reader is a global variable: when I call >> connectVTKWidget, it has called successfully (before I added the writing >> part) the Update method and I can see a image in the widget): >> >> void DCMBase::connectVTKWidget(QVTKWidget* widget) >> { >> typedef itk::Image< signed short, 2 > TipoImagen; >> typedef itk::ImageFileReader< TipoImagen > Tiporeader; >> Tiporeader::Pointer reader; >> >> typedef itk::VTKImageExport< TipoImagen > TipoImagenExport; >> TipoImagenExport::Pointer exporter = TipoImagenExport::New(); >> exporter->SetInput(reader->GetOutput()); >> >> vtkImageImport *imageImport = vtkImageImport::New(); >> this->ConnectPipelines(exporter, imageImport); >> >> vtkImageViewer* imageViewer = vtkImageViewer::New(); >> imageViewer->SetInputConnection(imageImport->GetOutputPort()); >> widget->SetRenderWindow(imageViewer->GetRenderWindow()); >> >> // with this, itk::ImageFileReader fails! >> vtkWindowToImageFilter* filtroAImagen = vtkWindowToImageFilter::New(); >> filtroAImagen->SetInput(widget->GetRenderWindow()); >> vtkJPEGWriter* writer = vtkJPEGWriter::New(); >> writer->SetFileName("myfile.jpg"); >> // writer->SetInputConnection(alg->GetOutputPort()); >> >> try >> { >> writer->Update(); >> } >> catch (itk::ExceptionObject& e) >> { >> std::cerr << "Excepci?n en escritura:" <> std::cerr << e << std::endl; >> } >> >> imageViewer->Render(); >> } >> >> >> >> Am I missing something? Thanks in advance. >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From da.angulo39 at uniandes.edu.co Fri Aug 15 11:23:04 2014 From: da.angulo39 at uniandes.edu.co (diego0020) Date: Fri, 15 Aug 2014 08:23:04 -0700 (PDT) Subject: [vtkusers] What is VTKData/combq.bin ? Message-ID: <1408116184130-5728231.post@n5.nabble.com> Hello I am interested in getting background information about the data set combq.bin found in VTKData and used in this example http://www.cmake.org/Wiki/VTK/Examples/Cxx/Visualization/StreamLines Does anyone knows where the data comes from? What does it represents? Thanks Diego A. -- View this message in context: http://vtk.1045678.n5.nabble.com/What-is-VTKData-combq-bin-tp5728231.html Sent from the VTK - Users mailing list archive at Nabble.com. From nil.goyette at imeka.ca Fri Aug 15 16:14:36 2014 From: nil.goyette at imeka.ca (Nil Goyette) Date: Fri, 15 Aug 2014 16:14:36 -0400 Subject: [vtkusers] PolyDataMapper Painter Message-ID: <53EE6A2C.9020302@imeka.ca> Hi all, I'm working with brain fibers (lines in a vtkPolyData) and I need to filter some fibers as fast as I can. Creating a new vtkPolyData or any trick like that is out of the question; I tested and it's too slow. I concluded that creating any kind of of data will always be too slow. I successfully modified the vtkPolyDataMapper to draw only a specified set of cells. It's working perfectly, in real-time. I tried to do the same with the 2D views (I'm working in MITK, but the vtkPolyDataMapper is the important part here) and I discovered something dark and complex: the painter. I read some articles [1, 2] to understand it what's going on. I think I get it, but I still have a question for you. I want to create my own vtkLinesPainter (mostly to add a std::set* and rewrite vtkDrawPrimsMacro). This is easy enough, but how do I plug this class with the rest of the Painter architecture? Who will tell vtk to use my class instead of the standard one? Moreover, is there a reason why the 3D mapper is defined in the "normal" mapper files (vtkPolyDataMapper and vtkOpenGLPolyDataMapper) and the 2D mapper use a Painter concept? For example, vtkDrawPrimsMacro is in the Mapper and in the Painter. Is it a WIP? Thanks for your help. Have a nice day. [1] http://www.paraview.org/ParaView/index.php/VTK_Painters [2] http://www.vtk.org/Wiki/VTK/Painters -- Logo Imeka Nil Goyette, M.Sc. www.imeka.ca -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Imeka.png Type: image/png Size: 6630 bytes Desc: not available URL: From dave.demarle at kitware.com Fri Aug 15 17:32:08 2014 From: dave.demarle at kitware.com (David E DeMarle) Date: Fri, 15 Aug 2014 17:32:08 -0400 Subject: [vtkusers] What is VTKData/combq.bin ? In-Reply-To: <1408116184130-5728231.post@n5.nabble.com> References: <1408116184130-5728231.post@n5.nabble.com> Message-ID: Unfortunately Ken's initial commit message was not very verbose. commit 9c76af74f6981a08e9e03abeffea191083d7ec52 Author: Ken Martin Date: Thu Jul 19 15:32:03 2001 -0400 some data files However, I've been told "comb" is short for combustor, and that this is one rotational segment of a jet engine. David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Fri, Aug 15, 2014 at 11:23 AM, diego0020 wrote: > Hello > > I am interested in getting background information about the data set > combq.bin found in VTKData and used in this example > > http://www.cmake.org/Wiki/VTK/Examples/Cxx/Visualization/StreamLines > > Does anyone knows where the data comes from? > What does it represents? > > Thanks > Diego A. > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/What-is-VTKData-combq-bin-tp5728231.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cdavid.tran at gmail.com Sat Aug 16 01:31:08 2014 From: cdavid.tran at gmail.com (eternallite2) Date: Fri, 15 Aug 2014 22:31:08 -0700 (PDT) Subject: [vtkusers] vtkUniformVariables memory leak Message-ID: <1408167068418-5728234.post@n5.nabble.com> I set up a shader for my vtkActor by calling the setPropProgram method of my actor's property (assigning it a vtkShaderProgram2): vtkOpenGLProperty::SafeDownCast(actor->GetProperty())->SetPropProgram(program); Then in a loop I am constantly updating a uniform variable (called time which increments as time goes by) in that shader by calling setUniformit: int time = 0; time += 1; if (time > 500) time = 0; vtkOpenGLProperty::SafeDownCast(actor->GetProperty())->GetPropProgram()->GetUniformVariables()->SetUniformft("time", 1, &time); I see the process in the Task Manager and since the time variable is constantly being incremented, the amount of memory used by the program keeps growing until it uses all the RAM. Is there a particular place where I should put the setUniform calls to avoid this memory leak; or is this a bug inside of vtk itself. Thanks again -- View this message in context: http://vtk.1045678.n5.nabble.com/vtkUniformVariables-memory-leak-tp5728234.html Sent from the VTK - Users mailing list archive at Nabble.com. From 376901333 at qq.com Sun Aug 17 06:26:01 2014 From: 376901333 at qq.com (Mitto) Date: Sun, 17 Aug 2014 03:26:01 -0700 (PDT) Subject: [vtkusers] how to change my vtk in my pyqt Message-ID: <1408271161461-5728238.post@n5.nabble.com> hello i am facing an problem code like this : when i click the button i want to change the vtk from PyQt4 import QtCore, QtGui from PyQt4.Qt import * from PyQt4.QtGui import QApplication import vtk from vtk.qt4.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor import sys try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(s): return s try: _encoding = QtGui.QApplication.UnicodeUTF8 def _translate(context, text, disambig): return QtGui.QApplication.translate(context, text, disambig, _encoding) except AttributeError: def _translate(context, text, disambig): return QtGui.QApplication.translate(context, text, disambig) class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName(_fromUtf8("MainWindow")) MainWindow.resize(802, 621) self.centralwidget = QtGui.QWidget(MainWindow) self.centralwidget.setObjectName(_fromUtf8("centralwidget")) MainWindow.setCentralWidget(self.centralwidget) self.vtkWidget = QVTKRenderWindowInteractor(self.centralwidget) self.Start= QtGui.QPushButton(self.centralwidget) self.Start.setGeometry(QtCore.QRect(650, 370, 98, 27)) self.Start.setObjectName(_fromUtf8("START")) QtCore.QObject.connect(self.Start, QtCore.SIGNAL(_fromUtf8("clicked()")), self.Change) def Change(self): print("start change") class SimpleView(QtGui.QMainWindow): def __init__(self, parent = None): QtGui.QMainWindow.__init__(self, parent) self.ui = Ui_MainWindow() self.ui.setupUi(self) self.ren = vtk.vtkRenderer() self.ui.vtkWidget.resize(370,340) self.ui.vtkWidget.move(20,20) self.ui.vtkWidget.GetRenderWindow().AddRenderer(self.ren) self.iren = self.ui.vtkWidget.GetRenderWindow().GetInteractor() # Create source filename="filename" reader = vtk.vtkPolyDataReader() reader.SetFileName(filename) # Create a mapper mapper = vtk.vtkPolyDataMapper() mapper.SetInputConnection(reader.GetOutputPort()) # Create an actor actor = vtk.vtkActor() actor.GetProperty().SetColor(0,1,0) actor.SetMapper(mapper) self.ren.AddActor(actor) if __name__ == "__main__": app = QApplication(sys.argv) window = SimpleView() window.show() window.iren.Initialize() sys.exit(app.exec_()) -- View this message in context: http://vtk.1045678.n5.nabble.com/how-to-change-my-vtk-in-my-pyqt-tp5728238.html Sent from the VTK - Users mailing list archive at Nabble.com. From isimtic at gmail.com Sun Aug 17 06:39:53 2014 From: isimtic at gmail.com (=?UTF-8?B?QWhtZXQgRG/En2Fu?=) Date: Sun, 17 Aug 2014 13:39:53 +0300 Subject: [vtkusers] what is the best efficient way to delete cells in polydata? Message-ID: <53F08679.3090601@gmail.com> hi, I tried to delete cells in polydata like this example http://www.paraview.org/Wiki/VTK/Examples/Cxx/Broken/PolyData/DeleteCells. Code is compiled and worked but it cannot delete any cells which are marked! I find another solution like this: / tempPData->Allocate(copyCellList->GetNumberOfIds()); tempPData->CopyCells(pDataOut,copyCellList); pointsOut->Reset(); pDataOut->Reset(); pDataOut->DeepCopy(tempPData); pointsOut=pDataOut->GetPoints(); tempPData->Delete(); copyCellList->Delete();/ here I copy all cells which aren't delete a temporary /polydata /then copy it again /pdataOut /but it seems very inefficient! Is there any working method apart from this inefficient way. Kind Regards. Ahmet Dogan -------------- next part -------------- An HTML attachment was scrubbed... URL: From vtk at sreitsma.nl Sun Aug 17 15:41:25 2014 From: vtk at sreitsma.nl (Sytse Reitsma) Date: Sun, 17 Aug 2014 21:41:25 +0200 Subject: [vtkusers] Delete highlighted points (extending HighlightSelectedPoints example) Message-ID: <53F10565.5060804@sreitsma.nl> Hi, I'm trying to extend the HighlightSelectedPoints (http://www.vtk.org/Wiki/VTK/Examples/Cxx/Picking/HighlightSelectedPoints) example to delete the selected points. So far I'm not very succesful. I manage to delete the points and update the view, but as soon as I switch back to the normal (rotate) mouse interaction all my points disappear after the first mouse click. Also the remaining points are highlighted once I deleted the points (still in select mode). The code I use can be found below (added to InteractorStyle class of the example). Does anyone know what I'm doing wrong? Am I taking the right approach at all? It does not seem a very efficient way of removing points. Thanks in advance. Regards, Sytse virtual void OnKeyPress() { vtkRenderWindowInteractor *rwi = this->Interactor; const char* ch = rwi->GetKeySym (); if (strcmp (ch, "Delete") == 0) { vtkPlanes* frustum = static_cast(this->GetInteractor()->GetPicker())->GetFrustum(); vtkSmartPointer extractGeometry = vtkSmartPointer::New(); extractGeometry->SetImplicitFunction(frustum); extractGeometry->SetInputData(this ->Points); extractGeometry->SetExtractInside(0); //We want all points outside the geometry extractGeometry->Update(); vtkSmartPointer glyphFilter = vtkSmartPointer::New(); glyphFilter->SetInputConnection(extractGeometry->GetOutputPort()); glyphFilter->Update(); vtkPolyData* selected = glyphFilter->GetOutput (); vtkIdTypeArray* ids = vtkIdTypeArray::SafeDownCast(selected->GetPointData()->GetArray("OriginalIds")); vtkSmartPointer newPoints = vtkSmartPointer::New(); for(vtkIdType i = 0; i < ids->GetNumberOfTu ples(); i++) { newPoints->InsertPoint(ids->GetValue(i), this->Points->GetPoint (ids->GetValue(i))); } this->Points->SetPoints (newPoints); this->GetInteractor()->GetRenderWindow()->Render(); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Sun Aug 17 16:56:35 2014 From: cory.quammen at kitware.com (Cory Quammen) Date: Sun, 17 Aug 2014 16:56:35 -0400 Subject: [vtkusers] vtk becomes slow and consumes more and more memory. In-Reply-To: <1408093518320-5728227.post@n5.nabble.com> References: <1408093518320-5728227.post@n5.nabble.com> Message-ID: Hi, I cannot confirm the behavior you report on either linux or using Visual Studio 2008 64-bit using VTK master in either Debug or Release mode: Time for 1000: 1.629sec Time for 1000: 1.601sec Time for 1000: 1.604sec Time for 1000: 1.595sec Time for 1000: 1.603sec Time for 1000: 1.606sec Can you try VTK master and see if that fixes the issues you report? Thanks, Cory On Fri, Aug 15, 2014 at 5:05 AM, Taron wrote: > Hi there, this is a follow-up to my memory leak question, which in fact is > not a "real" memory leak but something different. I'm using VTK 6.1 on > Windows 7 x64 compiled Visual Studio 2012 in 64Bit. > > My problem is that everytime I create objects in vtk and call update on them > it takes more and more memory and runs longer and longer. Consider this > code: > > #include > #include > #include > > int main(int argc, char *argv[]) > { > int c=0; > clock_t start; > size_t iterations = 1000; > while (c != '.'){ > c = getchar(); > start = clock(); > for(size_t i=0; i vtkImageConstantPad* pad = vtkImageConstantPad::New(); > vtkImageData* test = vtkImageData::New(); > test->SetExtent(0,1,0,1,0,1); > test->AllocateScalars(VTK_FLOAT,1); > pad->SetInputData(test); > pad->SetOutputWholeExtent(0,2,0,2,0,2); > pad->Update(); //this is what makes it bad > pad->Delete(); > test->Delete(); > } > std::cout << "Time for " << iterations << ": " << > static_cast(clock() - start) / CLOCKS_PER_SEC << "sec" << std::endl; > } > return 0; > } > > > The output: > > Time for 1000: 0.816sec > Time for 1000: 1.879sec > Time for 1000: 3.454sec > etc. > > It takes longer with every call to update and consumes more memory, but all > instances are deleted in the for-scope. So this seems to create some sort of > objects and puts into an update pipeline, but does not remove them later > internally. Can anyone confirm this behavior and other platforms and, how to > fix that? > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/vtk-becomes-slow-and-consumes-more-and-more-memory-tp5728227.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers From taron2000 at gmx.de Mon Aug 18 04:34:54 2014 From: taron2000 at gmx.de (Taron) Date: Mon, 18 Aug 2014 01:34:54 -0700 (PDT) Subject: [vtkusers] vtk becomes slow and consumes more and more memory. In-Reply-To: References: <1408093518320-5728227.post@n5.nabble.com> Message-ID: <1408350894336-5728243.post@n5.nabble.com> Hi Cory, cloned the master today, build it with Visual Studio 2012 in 64bit Release mode. The problem persists: Time for 1000: 0.686sec Time for 1000: 1.499sec Time for 1000: 2.268sec Time for 1000: 3.231sec Time for 1000: 4.431sec etc. Memory consume is also still an issue. -- View this message in context: http://vtk.1045678.n5.nabble.com/vtk-becomes-slow-and-consumes-more-and-more-memory-tp5728227p5728243.html Sent from the VTK - Users mailing list archive at Nabble.com. From taron2000 at gmx.de Mon Aug 18 06:01:15 2014 From: taron2000 at gmx.de (Taron) Date: Mon, 18 Aug 2014 03:01:15 -0700 (PDT) Subject: [vtkusers] vtk becomes slow and consumes more and more memory. In-Reply-To: <1408350894336-5728243.post@n5.nabble.com> References: <1408093518320-5728227.post@n5.nabble.com> <1408350894336-5728243.post@n5.nabble.com> Message-ID: <1408356075541-5728244.post@n5.nabble.com> Hi All, I found the issue. It seems that Bitdefender Antivirus software is somehow interferring with the program. Thanks a lot. -- View this message in context: http://vtk.1045678.n5.nabble.com/vtk-becomes-slow-and-consumes-more-and-more-memory-tp5728227p5728244.html Sent from the VTK - Users mailing list archive at Nabble.com. From wulihouxiaoshuai at 163.com Mon Aug 18 07:41:15 2014 From: wulihouxiaoshuai at 163.com (Emptystack) Date: Mon, 18 Aug 2014 04:41:15 -0700 (PDT) Subject: [vtkusers] vtklocal---Java wrap Message-ID: <1408362075391-5728245.post@n5.nabble.com> I am using VTK wrapped with Java, but I want to add my own class to the VTK source tree. For convenience, I tried to compile the attached example in vtk : vtkLocal, I have got the libvtkLocal.so and libVTKLocalJava.so(on linux OS),but I cannot find the .jar files like vtk.jar. Have anyone tried this before? I am looking forwarding to everyone's reply. Many Thanks. -- View this message in context: http://vtk.1045678.n5.nabble.com/vtklocal-Java-wrap-tp5728245.html Sent from the VTK - Users mailing list archive at Nabble.com. From cory.quammen at kitware.com Mon Aug 18 07:51:08 2014 From: cory.quammen at kitware.com (Cory Quammen) Date: Mon, 18 Aug 2014 07:51:08 -0400 Subject: [vtkusers] vtk becomes slow and consumes more and more memory. In-Reply-To: <1408356075541-5728244.post@n5.nabble.com> References: <1408093518320-5728227.post@n5.nabble.com> <1408350894336-5728243.post@n5.nabble.com> <1408356075541-5728244.post@n5.nabble.com> Message-ID: I'm glad you found it. - Cory On Mon, Aug 18, 2014 at 6:01 AM, Taron wrote: > Hi All, > > I found the issue. It seems that Bitdefender Antivirus software is somehow > interferring with the program. > Thanks a lot. > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/vtk-becomes-slow-and-consumes-more-and-more-memory-tp5728227p5728244.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers From xpelaox at gmail.com Mon Aug 18 08:49:10 2014 From: xpelaox at gmail.com (ferluduena) Date: Mon, 18 Aug 2014 05:49:10 -0700 (PDT) Subject: [vtkusers] Object reconstruction from stack of ROIs Message-ID: <1408366150852-5728247.post@n5.nabble.com> Hi! I've been working for a while with VTK in C#. What i've been trying to do is a software that will let the user capture medical images, and draw the Regions Of Interest of the organs he wishes to reconstruct. I've been using two different VTK functions, but i'm still not convinced, im sure there might be a better way. What i have is a Volume class, which lets me stack matrices with the ROIS (A simple linked list) and i also can add empty matrices in the middle of the rois, in order to make some kind of interpolation in the future. What i do is making matrices full of zeros, and filling with ones the ROI (I end up having circles of ones), then i get the 3d points and insert it into a vtkpolydata. One option is using Contour Filter, which shows potential for reconstructing with great detail, but i get strange things, like this: The other option is using Gaussian Splatter, which generates a nice volume... but too roundish and with almost no detail, and it always builds things with the same height, i'm not sure of how it works. finally, here is an image of what i'm aiming to build: So, any advice would be highly appreciated. Thanks a lot! -- View this message in context: http://vtk.1045678.n5.nabble.com/Object-reconstruction-from-stack-of-ROIs-tp5728247.html Sent from the VTK - Users mailing list archive at Nabble.com. From cory.quammen at kitware.com Mon Aug 18 09:57:57 2014 From: cory.quammen at kitware.com (Cory Quammen) Date: Mon, 18 Aug 2014 09:57:57 -0400 Subject: [vtkusers] vtkUniformVariables memory leak In-Reply-To: <1408167068418-5728234.post@n5.nabble.com> References: <1408167068418-5728234.post@n5.nabble.com> Message-ID: The short answer is that there shouldn't be any memory leaks, but it is always possible that there is a bug in VTK. Can you post a small example (.cxx file, CMakeLists.txt file) that exhibits this behavior? It will make it easier to help you debug. Thanks, Cory On Sat, Aug 16, 2014 at 1:31 AM, eternallite2 wrote: > I set up a shader for my vtkActor by calling the setPropProgram method of my > actor's property > (assigning it a vtkShaderProgram2): > > vtkOpenGLProperty::SafeDownCast(actor->GetProperty())->SetPropProgram(program); > > Then in a loop I am constantly updating a uniform variable (called time > which increments as time goes by) in that shader by calling setUniformit: > > int time = 0; > time += 1; > if (time > 500) > time = 0; > > vtkOpenGLProperty::SafeDownCast(actor->GetProperty())->GetPropProgram()->GetUniformVariables()->SetUniformft("time", > 1, &time); > > I see the process in the Task Manager and since the time variable is > constantly being incremented, the amount of memory used by the program keeps > growing until it uses all the RAM. > > Is there a particular place where I should put the setUniform calls to avoid > this memory leak; > or is this a bug inside of vtk itself. > > Thanks again > > > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/vtkUniformVariables-memory-leak-tp5728234.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers From MEEHANBT at nv.doe.gov Mon Aug 18 10:19:49 2014 From: MEEHANBT at nv.doe.gov (Meehan, Bernard) Date: Mon, 18 Aug 2014 14:19:49 +0000 Subject: [vtkusers] What is VTKData/combq.bin ? In-Reply-To: <7FF0F98123W1490983-01@EMF_nv.doe.gov> References: <7FF0F98123W1490983-01@EMF_nv.doe.gov> Message-ID: Here is a comment from warpComb.py: https://github.com/Kitware/VTK/blob/master/Examples/VisualizationAlgorithms /Python/warpComb.py # Here we read data from a annular combustor. A combustor burns fuel # and air in a gas turbine (e.g., a jet engine) and the hot gas # eventually makes its way to the turbine section. On 8/15/14 8:23 AM, "diego0020" wrote: >Hello > >I am interested in getting background information about the data set >combq.bin found in VTKData and used in this example > >http://www.cmake.org/Wiki/VTK/Examples/Cxx/Visualization/StreamLines > >Does anyone knows where the data comes from? >What does it represents? > >Thanks >Diego A. > > > >-- >View this message in context: >http://vtk.1045678.n5.nabble.com/What-is-VTKData-combq-bin-tp5728231.html >Sent from the VTK - Users mailing list archive at Nabble.com. >_______________________________________________ >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 > >Follow this link to subscribe/unsubscribe: >http://public.kitware.com/mailman/listinfo/vtkusers > From sebastien.jourdain at kitware.com Mon Aug 18 10:48:43 2014 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Mon, 18 Aug 2014 08:48:43 -0600 Subject: [vtkusers] vtklocal---Java wrap In-Reply-To: <1408362075391-5728245.post@n5.nabble.com> References: <1408362075391-5728245.post@n5.nabble.com> Message-ID: Your classes should then be available within the vtk.jar file. Seb On Mon, Aug 18, 2014 at 5:41 AM, Emptystack wrote: > I am using VTK wrapped with Java, but I want to add my own class to the > VTK > source tree. For convenience, I tried to compile the attached example in > vtk > : vtkLocal, I have got the libvtkLocal.so and libVTKLocalJava.so(on linux > OS),but I cannot find the .jar files like vtk.jar. Have anyone tried this > before? > > I am looking forwarding to everyone's reply. > Many Thanks. > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/vtklocal-Java-wrap-tp5728245.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From anka at bic.mni.mcgill.ca Mon Aug 18 11:39:35 2014 From: anka at bic.mni.mcgill.ca (Anka Kochanowska) Date: Mon, 18 Aug 2014 11:39:35 -0400 Subject: [vtkusers] VTK_ENCODESTRING_EXE in VTK 6.1 Message-ID: Hi! 1. Could someone help me to find and use vtkEncodeString command in VTK 6.1? In vtk 5.10 it was defined in VTKConfig.cmake as follows: # Other executables IF (NOT CMAKE_CROSSCOMPILING) SET(VTK_ENCODESTRING_EXE "${VTK_INSTALL_PREFIX}/bin/vtkEncodeString") ENDIF (NOT CMAKE_CROSSCOMPILING) Now, in the bin directory I see only vtkEncodeString-6.1, no variable VTK_ENCODESTRING_EXE defined anywhere. It was used in our project to encode cl files into a C string literals in header files. 2. Where are now defined all those variables that were set in VTKConfig.cmake, vtk 5.10? Example - I used to check if VTK_USE_QT was set in order to make sure that vtk was built with qt support. How do I check it now? Thanks Anka -------------- next part -------------- An HTML attachment was scrubbed... URL: From MEEHANBT at nv.doe.gov Mon Aug 18 12:23:20 2014 From: MEEHANBT at nv.doe.gov (Meehan, Bernard) Date: Mon, 18 Aug 2014 16:23:20 +0000 Subject: [vtkusers] add pictures to examples on the VTK wiki? Message-ID: This may not be the right place to ask this question, and if so, my apologies - How do you add pictures to the example pages on the Wiki, like the picture on this page: http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/ParametricObjectsDemo -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlrdave at aol.com Mon Aug 18 12:57:43 2014 From: dlrdave at aol.com (David Cole) Date: Mon, 18 Aug 2014 12:57:43 -0400 (EDT) Subject: [vtkusers] add pictures to examples on the VTK wiki? In-Reply-To: <20140818162259.786AF6F772@public.kitware.com> References: <20140818162259.786AF6F772@public.kitware.com> Message-ID: <8D1891CA9629B71-14B8-26C56@webmail-va052.sysops.aol.com> After an administrator adds a baseline image for the example, it will be uploaded/added to the wiki automatically. See http://www.vtk.org/Wiki/VTK/Examples/Instructions/ForAdministrators for details. Specifically, the http://www.vtk.org/Wiki/VTK/Examples/Instructions/ForAdministrators#Add_a_regression_baseline_image sub-section... HTH, David C. From marcus.hanwell at kitware.com Mon Aug 18 14:24:03 2014 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Mon, 18 Aug 2014 14:24:03 -0400 Subject: [vtkusers] PolyDataMapper Painter In-Reply-To: <53EE6A2C.9020302@imeka.ca> References: <53EE6A2C.9020302@imeka.ca> Message-ID: On Fri, Aug 15, 2014 at 4:14 PM, Nil Goyette wrote: > > Hi all, > > I'm working with brain fibers (lines in a vtkPolyData) and I need to filter some fibers as fast as I can. Creating a new vtkPolyData or any trick like that is out of the question; I tested and it's too slow. I concluded that creating any kind of of data will always be too slow. > > I successfully modified the vtkPolyDataMapper to draw only a specified set of cells. It's working perfectly, in real-time. I tried to do the same with the 2D views (I'm working in MITK, but the vtkPolyDataMapper is the important part here) and I discovered something dark and complex: the painter. I read some articles [1, 2] to understand it what's going on. I think I get it, but I still have a question for you. > The painters are in the process of being deprecated, and the new OpenGL 2+ rendering backend does not use painters for rendering. > I want to create my own vtkLinesPainter (mostly to add a std::set* and rewrite vtkDrawPrimsMacro). This is easy enough, but how do I plug this class with the rest of the Painter architecture? Who will tell vtk to use my class instead of the standard one? You can set things in the painter pipeline, I haven't done a lot of this but there is effectively a chain of painters and it is possible to add your own/override them. > > Moreover, is there a reason why the 3D mapper is defined in the "normal" mapper files (vtkPolyDataMapper and vtkOpenGLPolyDataMapper) and the 2D mapper use a Painter concept? For example, vtkDrawPrimsMacro is in the Mapper and in the Painter. Is it a WIP? The vtkOpenGLPolyDataMapper class has not been used for many years, and has been deprecated (it has caused similar confusion in the past). vtkPainterPolyDataMapper is the class that is used by default, you would need to modify the overrides to change that behavior. We are working on overhauling many aspects of the rendering in VTK, see http://www.kitware.com/source/home/post/144 for some background on early results there. This is not finished, and so may not have everything you need yet. We wanted to get it out early so that people could take a look, and give us feedback as we finish off other pieces. Hopefully that makes things clearer. Marcus From lizashr at outlook.com Mon Aug 18 14:39:31 2014 From: lizashr at outlook.com (liza) Date: Mon, 18 Aug 2014 11:39:31 -0700 (PDT) Subject: [vtkusers] vtkLinearExtrusionFilter does not cap Message-ID: <1408387171523-5728258.post@n5.nabble.com> Dear VTK Community, I am trying to read in a set of points that define a closed boundary and extrude it by supplying vector and finally cap it. I am getting a good extrusion but it is not getting capped. Capping seems to work well if I use a cross section of a sphere as input. But for my case, the polydata that I am reading in is not a surface. So my question is will capping work only if we extrude a surface and will not work for a boundary/polygon? Thanks, Liza Following is the excerpt of the pipeline where I am extruding. // Apply linear extrusion vtkSmartPointer extrude = vtkSmartPointer::New(); extrude->SetInputConnection( reader->GetOutputPort()); extrude->SetExtrusionTypeToVectorExtrusion(); extrude->SetVector(-0.502141, -0.685764,0.526861); extrude->SetScaleFactor (20); extrude->SetCapping(1); extrude->Update(); -- View this message in context: http://vtk.1045678.n5.nabble.com/vtkLinearExtrusionFilter-does-not-cap-tp5728258.html Sent from the VTK - Users mailing list archive at Nabble.com. From cdavid.tran at gmail.com Mon Aug 18 15:07:01 2014 From: cdavid.tran at gmail.com (eternallite2) Date: Mon, 18 Aug 2014 12:07:01 -0700 (PDT) Subject: [vtkusers] vtkUniformVariables memory leak In-Reply-To: References: <1408167068418-5728234.post@n5.nabble.com> Message-ID: <1408388821550-5728259.post@n5.nabble.com> Hello, here is a basic example demonstrating the process' memory usage increasing every second when the uniform variable, "timer" is incremented by 0.01 every frame and sent to the actor's propProgram (vtkShaderProgram2) Interestingly, if I set timer to a static value like 0.5 the memory used shown in the Task Manager doesn't change. It is only when I increment the timer variable (a float) by 0.01 every frame that the memory use increases. I've attached the .cxx and .frag (shader file) with a Visual Studio 2013 solution file in this post (along with the compiled binary) BasicVTK.zip But here is the code as well for convenience: //++++++++++++++++++++ shader.frag +++++++++++++++++++++++++++++++++ //++++++++++++++++++++ main.cpp +++++++++++++++++++++++++++++++++ #include VTK_MODULE_INIT(vtkInteractionStyle) VTK_MODULE_INIT(vtkRenderingOpenGL) #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // Set up a vector of vtkActors to render std::vector> actors; // vtkRenderWindow vtkSmartPointer renWin; // ***************** Timer callback ************************************* class vtkTimerCallback : public vtkCommand { public: static vtkTimerCallback *New() { vtkTimerCallback *cb = new vtkTimerCallback; return cb; } virtual void Execute(vtkObject *vtkNotUsed(caller), unsigned long eventId, void *vtkNotUsed(callData)) { // Update timer uniform variable (this line causes memory used by process in Task Manager to increase every second) timer += 0.01; // timer = 0.5; // Interestingly if you don't increment the variable, memory used by the process doesn't increase // Update the timer uniform variable for every vtkActor in the scene for (int i = 0; i < actors.size(); i++) { vtkOpenGLProperty::SafeDownCast(actors[i]->GetProperty())->GetPropProgram()->GetUniformVariables()->SetUniformf ("timer", 1, &timer); } renWin->Render(); } private: float timer; }; // ************ Return a sphere with a vtkShaderProgram2 attached ******************** vtkSmartPointer createSphere() { vtkSmartPointer sphere = vtkSmartPointer::New(); sphere->SetRadius(1); sphere->SetThetaResolution(3); // Use low resolution (since we'll be making 50) sphere->SetPhiResolution(3); sphere->Update(); vtkSmartPointer sphereMapper = vtkSmartPointer::New(); sphereMapper->SetInputData(sphere->GetOutput()); vtkSmartPointer sphereActor = vtkSmartPointer::New(); sphereActor->SetMapper(sphereMapper); // ------- Add Shader to Actor --------- std::ifstream file("shader.frag"); std::stringstream buffer; buffer << file.rdbuf(); vtkSmartPointer shader = vtkSmartPointer::New(); shader->SetSourceCode(buffer.str().c_str()); shader->SetType(VTK_SHADER_TYPE_FRAGMENT); vtkSmartPointer shaderProgram = vtkSmartPointer::New(); shaderProgram->GetShaders()->AddItem(shader); vtkOpenGLProperty::SafeDownCast(sphereActor->GetProperty())->SetPropProgram(shaderProgram); sphereActor->GetProperty()->ShadingOn(); // -------------------------------------- return sphereActor; } // ********** Main Function ************************************ void main() { renWin = vtkSmartPointer::New(); vtkSmartPointer ren = vtkSmartPointer::New(); vtkSmartPointer iren = vtkSmartPointer::New(); iren->SetRenderWindow(renWin); iren->Initialize(); renWin->SetSize(640, 480); renWin->SetWindowName("Setting Uniforms in Shaders"); renWin->AddRenderer(ren); // Add 50 sphere actors (each with a shader program attached) for (int i = 0; i < 50; i++) { vtkSmartPointer actor = createSphere(); actor->SetPosition(i, 0, 0); actors.push_back(actor); ren->AddActor(actor); } // Set up timer callback for updating uniform vtkSmartPointer cb = vtkSmartPointer::New(); iren->AddObserver(vtkCommand::TimerEvent, cb); iren->CreateRepeatingTimer(1000.0 / 60.0); // Executes 60 times per second renWin->Render(); iren->Start(); } -- View this message in context: http://vtk.1045678.n5.nabble.com/vtkUniformVariables-memory-leak-tp5728234p5728259.html Sent from the VTK - Users mailing list archive at Nabble.com. From bill.lorensen at gmail.com Mon Aug 18 15:50:35 2014 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Mon, 18 Aug 2014 15:50:35 -0400 Subject: [vtkusers] add pictures to examples on the VTK wiki? In-Reply-To: <20140818162259.AEB8661176@public.kitware.com> References: <20140818162259.AEB8661176@public.kitware.com> Message-ID: Bernard, Please feel free to add examples. Don't worry about the images. We monitor the nightly examples dashboard and we will try to fix up any issues. If you do add and example, please post to the users or developers list so we can help clean up any issues. Thanks, Bill On Mon, Aug 18, 2014 at 12:23 PM, Meehan, Bernard wrote: > This may not be the right place to ask this question, and if so, my > apologies - > > How do you add pictures to the example pages on the Wiki, like the picture > on this page: > http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/ParametricObjectsDemo > > > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Unpaid intern in BillsBasement at noware dot com From wulihouxiaoshuai at 163.com Mon Aug 18 21:49:53 2014 From: wulihouxiaoshuai at 163.com (Emptystack) Date: Mon, 18 Aug 2014 18:49:53 -0700 (PDT) Subject: [vtkusers] vtklocal---Java wrap In-Reply-To: References: <1408362075391-5728245.post@n5.nabble.com> Message-ID: <1408412993541-5728270.post@n5.nabble.com> Hi,Seb! Thanks for your reply! I have tried like what you said, but I cannot find the vtkLocal class in the vtk.jar file,I think maybe I make some mistakes in the process of building, can you explain it in detail ? Many thanks! -- View this message in context: http://vtk.1045678.n5.nabble.com/vtklocal-Java-wrap-tp5728245p5728270.html Sent from the VTK - Users mailing list archive at Nabble.com. From sebastien.jourdain at kitware.com Mon Aug 18 22:14:26 2014 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Mon, 18 Aug 2014 20:14:26 -0600 Subject: [vtkusers] vtklocal---Java wrap In-Reply-To: <1408412993541-5728270.post@n5.nabble.com> References: <1408362075391-5728245.post@n5.nabble.com> <1408412993541-5728270.post@n5.nabble.com> Message-ID: Did you create a new vtkModule ? What your CMakeLists.txt and module.cmake look like? Seb On Mon, Aug 18, 2014 at 7:49 PM, Emptystack wrote: > Hi,Seb! Thanks for your reply! I have tried like what you said, but I > cannot > find the vtkLocal class in the vtk.jar file,I think maybe I make some > mistakes in the process of building, can you explain it in detail ? > Many thanks! > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/vtklocal-Java-wrap-tp5728245p5728270.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Mon Aug 18 22:18:11 2014 From: dave.demarle at kitware.com (David E DeMarle) Date: Mon, 18 Aug 2014 22:18:11 -0400 Subject: [vtkusers] Transparent Viewport In-Reply-To: References: Message-ID: Looking at you code, I'm suspicious of the single mapper/actor going into two different renderers. Try splitting at the mapper level. Ie, one sphere source, feeds 2 mappers, each of which feeds its own actor, each goes into its own renderer. David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Fri, Aug 8, 2014 at 5:59 PM, Alireza Mehrtash wrote: > I tried that but it gives: > vtkRendererCollection (0x8a6be0): Invalid layer for renderer: not rendered. > > > > On Fri, Aug 8, 2014 at 5:50 PM, David E DeMarle > wrote: > >> Call SetLayer(1) on the overlay layer. >> On Aug 8, 2014 5:27 PM, "Alireza Mehrtash" >> wrote: >> >>> Hi All, >>> >>> I have two renderers in a render window ?with one of them as a bottom >>> left viewport (the code and the picture are attached). I want the viewport >>> renderer to be transparent exactly like the vtk oreientation marker [1]. I >>> would appreciate if you help me achieving this. >>> >>> Thanks, >>> Alireza >>> >>> >>> [1] >>> http://www.itk.org/Wiki/VTK/Examples/Cxx/Widgets/OrientationMarkerWidget >>> >>> _______________________________________________ >>> 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 >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/vtkusers >>> >>> The information in this e-mail is intended only for the person to whom >> it is >> addressed. If you believe this e-mail was sent to you in error and the >> e-mail >> contains patient information, please contact the Partners Compliance >> HelpLine at >> http://www.partners.org/complianceline . If the e-mail was sent to you >> in error >> but does not contain patient information, please contact the sender and >> properly >> dispose of the e-mail. >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wulihouxiaoshuai at 163.com Mon Aug 18 22:24:37 2014 From: wulihouxiaoshuai at 163.com (Emptystack) Date: Mon, 18 Aug 2014 19:24:37 -0700 (PDT) Subject: [vtkusers] vtklocal---Java wrap In-Reply-To: References: <1408362075391-5728245.post@n5.nabble.com> <1408412993541-5728270.post@n5.nabble.com> Message-ID: <1408415077331-5728273.post@n5.nabble.com> My building step is as the following website said: http://web.mit.edu/course/16/16.225/dv/VTK/Examples/Build/vtkLocal/README First I build the Whole VTK source, Then I build the vtkLocal example as previous example said, Is it correct! -- View this message in context: http://vtk.1045678.n5.nabble.com/vtklocal-Java-wrap-tp5728245p5728273.html Sent from the VTK - Users mailing list archive at Nabble.com. From moon at mpi-cbg.de Tue Aug 19 08:29:09 2014 From: moon at mpi-cbg.de (HongKee Moon) Date: Tue, 19 Aug 2014 14:29:09 +0200 Subject: [vtkusers] vtkJavaDesigner in github Message-ID: Hi, Recently, I have created a simple java editor for vtk programmers thanks to RSyntaxTextArea. The url is https://github.com/hkmoon/vtkJavaDesigner. It has dynamic runtime compilation. Once you edit some code, you can compile/run in runtime. It makes your development faster when you have a simple proof-of-concept validation. Hopefully, have a great time with vtk programming. Comments are always welcome! For the VTK compilation, I used JDK6 rather than JDK7 because I noticed that the RenderWindow is weirdly located when I run a sample vtk java program under JDK7. However, JDK6 does not have that problem. Cheers, HongKee -- HongKee Moon Software Engineer Scientific Computing Facility Max Planck Institute of Molecular Cell Biology and Genetics Pfotenhauerstr. 108 01307 Dresden Germany fon: +49 351 210 2740 fax: +49 351 210 1689 www.mpi-cbg.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.salatin at gmail.com Tue Aug 19 08:43:36 2014 From: marco.salatin at gmail.com (Marco Salatin) Date: Tue, 19 Aug 2014 14:43:36 +0200 Subject: [vtkusers] hollow object in file .stl Message-ID: Hi, i will ask if someone try to hollow a object in stl file. Can you help me? Thanks Marco -- --- www.salatin.eu -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Tue Aug 19 08:44:11 2014 From: dave.demarle at kitware.com (David E DeMarle) Date: Tue, 19 Aug 2014 08:44:11 -0400 Subject: [vtkusers] vtkJavaDesigner in github In-Reply-To: References: Message-ID: Very nice! David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Tue, Aug 19, 2014 at 8:29 AM, HongKee Moon wrote: > Hi, > > Recently, I have created a simple java editor for vtk programmers thanks > to RSyntaxTextArea. > The url is https://github.com/hkmoon/vtkJavaDesigner. > > [image: CodeCompletionScreenshot] > > It has dynamic runtime compilation. Once you edit some code, you can > compile/run in runtime. > It makes your development faster when you have a simple proof-of-concept > validation. > Hopefully, have a great time with vtk programming. > Comments are always welcome! > > For the VTK compilation, I used JDK6 rather than JDK7 because I noticed > that the RenderWindow is weirdly located when I run a sample vtk java > program under JDK7. However, JDK6 does not have that problem. > > Cheers, > HongKee > > -- > HongKee Moon > Software Engineer > Scientific Computing Facility > > Max Planck Institute of Molecular Cell Biology and Genetics > Pfotenhauerstr. 108 > 01307 Dresden > Germany > > fon: +49 351 210 2740 > fax: +49 351 210 1689 > www.mpi-cbg.de > > > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kim.rosenbohm at posteo.de Tue Aug 19 08:48:15 2014 From: kim.rosenbohm at posteo.de (Kim Rosenbohm) Date: Tue, 19 Aug 2014 14:48:15 +0200 Subject: [vtkusers] Problems with custom filter, points, cells, triangles strips Message-ID: Hi List. I'm writing an algorithm similar to vtkImageDataGeometryFilter that converts scalar image data to a 3D surface. It does "kindof" work though I get crashes releated to ComputeBounds() which are mentioned also here: http://vtk.1045678.n5.nabble.com/Handling-invalid-vtp-files-td1252488.html [1] I suspect the culprit to be how I handle the points and triangles strips. A sketch of what I do is: Pre-allocate some point and cell data to write to: vtkImageData * input = vtkImageData::SafeDownCast(inputInfo->Get(vtkDataObject::DATA_OBJECT())); vtkPolyData * output = vtkPolyData::SafeDownCast(outputInfo->Get(vtkDataObject::DATA_OBJECT())); const int * inputDims = input->GetDimensions(); vtkSmartPointer newPoints = vtkSmartPointer::New(); newPoints->Allocate(16*inputDims[0]); vtkSmartPointer newCells = vtkSmartPointer::New(); newCells->Allocate(inputDims[1]); vtkSmartPointer newStrip = vtkSmartPointer::New(); newStrip->GetPointIds()->Allocate(16*inputDims[0]); vtkIdList * newStripIds = newStrip->GetPointIds(); Add points to the point data: double point[3]; input->GetPoint(inputIndex, point); newIds[i] = newPoints->InsertNextPoint(point); Add point indices to the cells: //---loop newStripIds->Reset(); newStripIds->InsertNextId(newIds[i]); newStripIds->InsertNextId(newIds[i+1]); ... //strip finished, add it to cells newCells->InsertNextCell(newStrip); //DOES THIS TAKE OWNERSHIP OR DOES IT COPY?! Is using a vtkSmartPointer ok? //clear ids, proceed with next strip newStripIds->Reset(); //---loop Set the values in the ouput: output->SetPoints(newPoints); //DOES THIS TAKE OWNERSHIP OR DOES IT COPY?! Is using a vtkSmartPointer ok? output->SetStrips(newCells); return 1; Any hints on if this should work, or where the problem is would be great... Best Regards, Kim Links: ------ [1] http://vtk.1045678.n5.nabble.com/Handling-invalid-vtp-files-td1252488.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Tue Aug 19 09:45:44 2014 From: cory.quammen at kitware.com (Cory Quammen) Date: Tue, 19 Aug 2014 09:45:44 -0400 Subject: [vtkusers] vtkUniformVariables memory leak In-Reply-To: <1408388821550-5728259.post@n5.nabble.com> References: <1408167068418-5728234.post@n5.nabble.com> <1408388821550-5728259.post@n5.nabble.com> Message-ID: I was able to confirm an apparent memory leak on Visual Studio 2008 64-bit when incrementing the time variable, but no memory leak when keeping the time variable the same. I tried to see if this behavior occurs in linux, but shaders aren't supported on my virtual machine installation. Looking through the code, I didn't see anything obviously causing the leak. It would be great if someone could confirm this memory leak on Linux or Mac. Thanks, Cory On Mon, Aug 18, 2014 at 3:07 PM, eternallite2 wrote: > Hello, here is a basic example demonstrating the process' memory usage > increasing every second when the uniform variable, "timer" is incremented by > 0.01 every frame and sent to the actor's propProgram (vtkShaderProgram2) > > Interestingly, if I set timer to a static value like 0.5 the memory used > shown in the Task Manager doesn't change. It is only when I increment the > timer variable (a float) by 0.01 every frame that the memory use increases. > > I've attached the .cxx and .frag (shader file) with a Visual Studio 2013 > solution file in this post (along with the compiled binary) > > BasicVTK.zip > > But here is the code as well for convenience: > > //++++++++++++++++++++ shader.frag +++++++++++++++++++++++++++++++++ > > > //++++++++++++++++++++ main.cpp +++++++++++++++++++++++++++++++++ > > #include > VTK_MODULE_INIT(vtkInteractionStyle) > VTK_MODULE_INIT(vtkRenderingOpenGL) > > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > > #include > #include > > // Set up a vector of vtkActors to render > std::vector> actors; > > // vtkRenderWindow > vtkSmartPointer renWin; > > // ***************** Timer callback ************************************* > class vtkTimerCallback : public vtkCommand > { > public: > static vtkTimerCallback *New() > { > vtkTimerCallback *cb = new vtkTimerCallback; > return cb; > } > > virtual void Execute(vtkObject *vtkNotUsed(caller), unsigned long eventId, > void *vtkNotUsed(callData)) > { > // Update timer uniform variable (this line causes memory used by process > in Task Manager to increase every second) > timer += 0.01; > > // timer = 0.5; // Interestingly if you don't increment the variable, > memory used by the process doesn't increase > > // Update the timer uniform variable for every vtkActor in the scene > for (int i = 0; i < actors.size(); i++) > { > > vtkOpenGLProperty::SafeDownCast(actors[i]->GetProperty())->GetPropProgram()->GetUniformVariables()->SetUniformf > ("timer", 1, &timer); > } > renWin->Render(); > } > private: > float timer; > }; > > // ************ Return a sphere with a vtkShaderProgram2 attached > ******************** > vtkSmartPointer createSphere() > { > vtkSmartPointer sphere = > vtkSmartPointer::New(); > sphere->SetRadius(1); > sphere->SetThetaResolution(3); // Use low resolution (since we'll be making > 50) > sphere->SetPhiResolution(3); > sphere->Update(); > > vtkSmartPointer sphereMapper = > vtkSmartPointer::New(); > sphereMapper->SetInputData(sphere->GetOutput()); > > vtkSmartPointer sphereActor = vtkSmartPointer::New(); > sphereActor->SetMapper(sphereMapper); > > // ------- Add Shader to Actor --------- > std::ifstream file("shader.frag"); > std::stringstream buffer; > buffer << file.rdbuf(); > > vtkSmartPointer shader = vtkSmartPointer::New(); > shader->SetSourceCode(buffer.str().c_str()); > shader->SetType(VTK_SHADER_TYPE_FRAGMENT); > > vtkSmartPointer shaderProgram = > vtkSmartPointer::New(); > shaderProgram->GetShaders()->AddItem(shader); > > > vtkOpenGLProperty::SafeDownCast(sphereActor->GetProperty())->SetPropProgram(shaderProgram); > sphereActor->GetProperty()->ShadingOn(); > // -------------------------------------- > > return sphereActor; > } > > // ********** Main Function ************************************ > void main() > { > renWin = vtkSmartPointer::New(); > vtkSmartPointer ren = vtkSmartPointer::New(); > vtkSmartPointer iren = > vtkSmartPointer::New(); > > iren->SetRenderWindow(renWin); > iren->Initialize(); > > renWin->SetSize(640, 480); > renWin->SetWindowName("Setting Uniforms in Shaders"); > renWin->AddRenderer(ren); > > // Add 50 sphere actors (each with a shader program attached) > for (int i = 0; i < 50; i++) > { > vtkSmartPointer actor = createSphere(); > actor->SetPosition(i, 0, 0); > > actors.push_back(actor); > ren->AddActor(actor); > } > > // Set up timer callback for updating uniform > vtkSmartPointer cb = > vtkSmartPointer::New(); > iren->AddObserver(vtkCommand::TimerEvent, cb); > iren->CreateRepeatingTimer(1000.0 / 60.0); // Executes 60 times per second > > renWin->Render(); > iren->Start(); > } > > > > > > > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/vtkUniformVariables-memory-leak-tp5728234p5728259.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers From sebastien.jourdain at kitware.com Tue Aug 19 11:21:23 2014 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Tue, 19 Aug 2014 09:21:23 -0600 Subject: [vtkusers] vtklocal---Java wrap In-Reply-To: <1408415077331-5728273.post@n5.nabble.com> References: <1408362075391-5728245.post@n5.nabble.com> <1408412993541-5728270.post@n5.nabble.com> <1408415077331-5728273.post@n5.nabble.com> Message-ID: Easiest thing to do is to create your own directory inside VTK for your module, so your code will be build along with VTK. This is specially useful if you need to wrap your code in Java. Seb On Mon, Aug 18, 2014 at 8:24 PM, Emptystack wrote: > My building step is as the following website said: > http://web.mit.edu/course/16/16.225/dv/VTK/Examples/Build/vtkLocal/README > > > > First I build the Whole VTK source, Then I build the vtkLocal example as > previous example said, Is it correct! > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/vtklocal-Java-wrap-tp5728245p5728273.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From moon at mpi-cbg.de Tue Aug 19 11:35:32 2014 From: moon at mpi-cbg.de (HongKee Moon) Date: Tue, 19 Aug 2014 08:35:32 -0700 (PDT) Subject: [vtkusers] VTK class for scale bar line ? In-Reply-To: <1408452474463-5728279.post@n5.nabble.com> References: <1408452474463-5728279.post@n5.nabble.com> Message-ID: Maybe, you can use the below code. However, customization is necessary for your taste. vtkTextProperty tprop = new vtkTextProperty(); tprop.SetColor(1, 1, 1); tprop.ShadowOn(); vtkCubeAxesActor2D axes = new vtkCubeAxesActor2D(); axes.SetInputConnection(merge.GetOutputPort()); axes.SetCamera(renWin.GetRenderer().GetActiveCamera()); axes.SetLabelFormat("%6.4g"); axes.SetFlyModeToOuterEdges(); axes.SetFontFactor(0.8); axes.SetAxisTitleTextProperty(tprop); axes.SetAxisLabelTextProperty(tprop); renWin.GetRenderer().AddViewProp(axes); Cheers, HongKee On Aug 19, 2014, at 2:47 PM, flaviu2 [via VTK] wrote: > There is in VTK some class that can render an scale bar line, like in attached image ? > Untitled-1.jpg > Which one ? > > > If you reply to this email, your message will be added to the discussion below: > http://vtk.1045678.n5.nabble.com/VTK-class-for-scale-bar-line-tp5728279.html > To start a new topic under VTK - Users, email ml-node+s1045678n1224199h80 at n5.nabble.com > To unsubscribe from VTK, click here. > NAML -- HongKee Moon Software Engineer Scientific Computing Facility Max Planck Institute of Molecular Cell Biology and Genetics Pfotenhauerstr. 108 01307 Dresden Germany fon: +49 351 210 2740 fax: +49 351 210 1689 www.mpi-cbg.de -- View this message in context: http://vtk.1045678.n5.nabble.com/VTK-class-for-scale-bar-line-tp5728279p5728284.html Sent from the VTK - Users mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.salatin at gmail.com Tue Aug 19 15:01:21 2014 From: marco.salatin at gmail.com (Marco Salatin) Date: Tue, 19 Aug 2014 12:01:21 -0700 (PDT) Subject: [vtkusers] hollow object in file .stl In-Reply-To: References: Message-ID: <1408474881374-5728285.post@n5.nabble.com> I will hollow object using vtk: to Is possible? Thanks -- View this message in context: http://vtk.1045678.n5.nabble.com/hollow-object-in-file-stl-tp5728277p5728285.html Sent from the VTK - Users mailing list archive at Nabble.com. From bigvision82 at yahoo.com Tue Aug 19 15:34:09 2014 From: bigvision82 at yahoo.com (kwayeke) Date: Tue, 19 Aug 2014 12:34:09 -0700 (PDT) Subject: [vtkusers] VTK_USE_MATLAB_MEX VTK6 In-Reply-To: <1404496562621-5727751.post@n5.nabble.com> References: <1404259489077-5727707.post@n5.nabble.com> <1404329759347-5727723.post@n5.nabble.com> <1404349586808-5727727.post@n5.nabble.com> <1404356222108-5727729.post@n5.nabble.com> <1404490847718-5727750.post@n5.nabble.com> <1404496562621-5727751.post@n5.nabble.com> Message-ID: <1408476849602-5728286.post@n5.nabble.com> Has this new code been tested on any platform besides kubuntu? I can't get it to work on either mac or windows. It compiles successfully but unable to create neither mex file nor use the engine interface. -- View this message in context: http://vtk.1045678.n5.nabble.com/VTK-USE-MATLAB-MEX-VTK6-tp5727707p5728286.html Sent from the VTK - Users mailing list archive at Nabble.com. From jmerkow at gmail.com Tue Aug 19 15:40:04 2014 From: jmerkow at gmail.com (jmerkow) Date: Tue, 19 Aug 2014 12:40:04 -0700 (PDT) Subject: [vtkusers] VTK_USE_MATLAB_MEX VTK6 In-Reply-To: <1408476849602-5728286.post@n5.nabble.com> References: <1404259489077-5727707.post@n5.nabble.com> <1404329759347-5727723.post@n5.nabble.com> <1404349586808-5727727.post@n5.nabble.com> <1404356222108-5727729.post@n5.nabble.com> <1404490847718-5727750.post@n5.nabble.com> <1404496562621-5727751.post@n5.nabble.com> <1408476849602-5728286.post@n5.nabble.com> Message-ID: I have not tried it on other platforms yet. I don't have access to other versions of matlab currently. If you give me some more information, I may be able to help troubleshoot it. -Jameson On Tue, Aug 19, 2014 at 12:34 PM, kwayeke [via VTK] < ml-node+s1045678n5728286h22 at n5.nabble.com> wrote: > Has this new code been tested on any platform besides kubuntu? I can't get > it to work on either mac or windows. It compiles successfully but unable to > create neither mex file nor use the engine interface. > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://vtk.1045678.n5.nabble.com/VTK-USE-MATLAB-MEX-VTK6-tp5727707p5728286.html > To unsubscribe from VTK_USE_MATLAB_MEX VTK6, click here > > . > NAML > > -- View this message in context: http://vtk.1045678.n5.nabble.com/VTK-USE-MATLAB-MEX-VTK6-tp5727707p5728287.html Sent from the VTK - Users mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bigvision82 at yahoo.com Tue Aug 19 17:54:14 2014 From: bigvision82 at yahoo.com (kwayeke) Date: Tue, 19 Aug 2014 14:54:14 -0700 (PDT) Subject: [vtkusers] VTK_USE_MATLAB_MEX VTK6 In-Reply-To: References: <1404259489077-5727707.post@n5.nabble.com> <1404329759347-5727723.post@n5.nabble.com> <1404349586808-5727727.post@n5.nabble.com> <1404356222108-5727729.post@n5.nabble.com> <1404490847718-5727750.post@n5.nabble.com> <1404496562621-5727751.post@n5.nabble.com> <1408476849602-5728286.post@n5.nabble.com> Message-ID: <1408485254099-5728296.post@n5.nabble.com> Did you run this example http://www.kitware.com/media/html/MATLABAndGNURIntegrationWithVTK.html ? I am getting this output with nothing shown in the rendering window: ALGORITHM_AFTER_FORWARD: 1 FORWARD_DIRECTION: 0 FROM_OUTPUT_PORT: 0 I believe the "Normals" in ef->PutArray("Normals", "N") might be passing 0 to the function. #include ?vtkMatlabEngineFilter.h? #include ?vtkSphereSource.h? #include ?vtkWarpVector.h? int main() { vtkSmartPointer ss = vtkSmartPointer::New(); vtkSmartPointer ef =vtkSmartPointer::New(); vtkSmartPointer wv = vtkSmartPointer::New(); ss->SetThetaResolution(100); ss->SetPhiResolution(100); ef->SetInputConnection(ss->GetOutputPort()); vtkSmartPointer polydata = vtkSmartPointer::New(); ef->PutArray("Normals", "N"); ef->SetMatlabScript( "rv = randi([-1,1],size(N,1),1);\ N(:,1) = N(:,1).*rv;\ N(:,2) = N(:,2).*rv;\ N(:,3) = N(:,3).*rv;"); ef->GetArray("N", "N"); wv->SetInputData(ef->GetOutput()); wv->Update(); vtkSmartPointer Mapper = vtkSmartPointer::New(); Mapper->SetInputData(wv->GetPolyDataOutput()); vtkSmartPointer Actor = vtkSmartPointer::New(); Actor->SetMapper(Mapper); } I need an example to test if it's working . I have matlab 2014a on both mac and windows . -- View this message in context: http://vtk.1045678.n5.nabble.com/VTK-USE-MATLAB-MEX-VTK6-tp5727707p5728296.html Sent from the VTK - Users mailing list archive at Nabble.com. From wulihouxiaoshuai at 163.com Tue Aug 19 20:55:59 2014 From: wulihouxiaoshuai at 163.com (Emptystack) Date: Tue, 19 Aug 2014 17:55:59 -0700 (PDT) Subject: [vtkusers] vtklocal---Java wrap In-Reply-To: References: <1408362075391-5728245.post@n5.nabble.com> <1408412993541-5728270.post@n5.nabble.com> <1408415077331-5728273.post@n5.nabble.com> Message-ID: <1408496159725-5728298.post@n5.nabble.com> What I have forgotten to say is I am using 5.10.1(very sorry), and the vtk module structure(module.cmake) belongs to VTK 6. So I have tried to add my class(.Cxx,.h) which is derived from vtkImageAlgorithm to the VTK5.10.1/Imageing directory, and modified the CmakeLists in the directory(Adding the .Cxx to KIT_SRCS), then I build the whole VTK. unfortunately,I cannot found my class in the build directory. Does the official website have detailed description of adding class to VTK source tree? Many thanks! -- View this message in context: http://vtk.1045678.n5.nabble.com/vtklocal-Java-wrap-tp5728245p5728298.html Sent from the VTK - Users mailing list archive at Nabble.com. From marco.salatin at gmail.com Wed Aug 20 06:36:30 2014 From: marco.salatin at gmail.com (Marco Salatin) Date: Wed, 20 Aug 2014 03:36:30 -0700 (PDT) Subject: [vtkusers] Color edge of actor. Message-ID: <1408530990393-5728300.post@n5.nabble.com> Hi, how can i color edge of actor? Thanks -- View this message in context: http://vtk.1045678.n5.nabble.com/Color-edge-of-actor-tp5728300.html Sent from the VTK - Users mailing list archive at Nabble.com. From jothybasu at gmail.com Wed Aug 20 06:47:43 2014 From: jothybasu at gmail.com (Jothybasu Selvaraj) Date: Wed, 20 Aug 2014 12:47:43 +0200 Subject: [vtkusers] Color edge of actor. In-Reply-To: <1408530990393-5728300.post@n5.nabble.com> References: <1408530990393-5728300.post@n5.nabble.com> Message-ID: Actor->GetProperty()->SetEdgeColor(1,1,1); HTH Jothy Jothybasu K Selvaraj Post Doctoral Fellow Dept. of Radiotherapy Netherlands Cancer Institute-Antoni van Leeuwenhoek Amsterdam On Wed, Aug 20, 2014 at 12:36 PM, Marco Salatin wrote: > Hi, > how can i color edge of actor? > > Thanks > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Color-edge-of-actor-tp5728300.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.salatin at gmail.com Wed Aug 20 06:50:51 2014 From: marco.salatin at gmail.com (Marco Salatin) Date: Wed, 20 Aug 2014 12:50:51 +0200 Subject: [vtkusers] Color edge of actor. In-Reply-To: References: <1408530990393-5728300.post@n5.nabble.com> Message-ID: Thanks but it color not only the Edge of an object: [image: Immagine in linea 1] Can you help me? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: slice0024.png Type: image/png Size: 3448 bytes Desc: not available URL: From sebastien.jourdain at kitware.com Wed Aug 20 09:55:24 2014 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Wed, 20 Aug 2014 07:55:24 -0600 Subject: [vtkusers] vtklocal---Java wrap In-Reply-To: <1408496159725-5728298.post@n5.nabble.com> References: <1408362075391-5728245.post@n5.nabble.com> <1408412993541-5728270.post@n5.nabble.com> <1408415077331-5728273.post@n5.nabble.com> <1408496159725-5728298.post@n5.nabble.com> Message-ID: For VTK 5, you were on the right path of patching the source of VTK directly so your class can be taken as a first citizen. Don't have much more information, you should try it out... Seb On Tue, Aug 19, 2014 at 6:55 PM, Emptystack wrote: > What I have forgotten to say is I am using 5.10.1(very sorry), and the vtk > module structure(module.cmake) belongs to VTK 6. So I have tried to add my > class(.Cxx,.h) which is derived from vtkImageAlgorithm to the > VTK5.10.1/Imageing directory, and modified the CmakeLists in the > directory(Adding the .Cxx to KIT_SRCS), then I build the whole VTK. > unfortunately,I cannot found my class in the build directory. Does the > official website have detailed description of adding class to VTK source > tree? > Many thanks! > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/vtklocal-Java-wrap-tp5728245p5728298.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Wed Aug 20 10:15:48 2014 From: dave.demarle at kitware.com (David E DeMarle) Date: Wed, 20 Aug 2014 10:15:48 -0400 Subject: [vtkusers] announce: last call for 2014 HPCWire Reader's Choice Award nominations Message-ID: Vote for your favorite HPC applications, innovations, collaborations and practices. Especially VTK and ParaView of course! :) Nominations will close on August 22, 2014 at 11:59pm. Winners will be announced at IEEE SC14. cheers David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Wed, Aug 6, 2014 at 5:38 PM, David E DeMarle wrote: > HPCWire is holding their Annual Reader?s Choice Awards. Please take > the time to nominate VTK and ParaView for this year?s awards. > > All you need to do is to submit the projects, products or solutions > you feel should be honored by receiving an award to the appropriate > (max of 3) categories before the deadline at: > http://www.hpcwire.com/2014-hpcwire-readers-choice-awards/ > > Anyone may can nominate their project, collaboration, product or > solution, and you do not need to fill the entire form out. Only the > categories(s) for which you feel your organization is qualified to > receive an award. You may submit as many nominations as you like. > Those who make it past the nominations will move on to the September > elections for selecting this year's finalists by our readers. > > Recent and near term user visible developments in the lands of VTK and > ParaView include: > > > *VTK* > > > * vtkDax, vtkPiston and vtkSMP: bringing GPGPU and multicore speed to > VTK. > > * vtkWeb - VTK based web services simply by enabling VTK_WRAP_PYTHON > > * vtk.numpy_interface - numpy processing moves beyond arrays into datasets > > * OpenGL2.1+ rendering - promising both render speed and extensibility > improvements > > *ParaView* > > * vector graphics screen exports > * parallel and composite SurfaceLIC representations of vector fields > * streamlined properties and view options panels > * the Python View allows just about any Python library to generate images > in ParaView views. > > David E DeMarle > Kitware, Inc. > R&D Engineer > 21 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-881-4909 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From baptiste.gouygou6 at etu.univ-lorraine.fr Wed Aug 20 10:45:46 2014 From: baptiste.gouygou6 at etu.univ-lorraine.fr (bgouygou) Date: Wed, 20 Aug 2014 07:45:46 -0700 (PDT) Subject: [vtkusers] Save vtkimage data in an image file Message-ID: <1408545946562-5728308.post@n5.nabble.com> Hi everyone, I would like to know if there is a way to save a vtkdtaimage made of pixel infomations into a jpeg or a BMP file. I did not see any "Getoutput" functions on the vtkimagedata class, and a vtkimage data cannot be an attribute for the SetInputConnection function for an image writer class. So my question is, is there another way to save a vtkimagedata into a image file? Thank you. -- View this message in context: http://vtk.1045678.n5.nabble.com/Save-vtkimage-data-in-an-image-file-tp5728308.html Sent from the VTK - Users mailing list archive at Nabble.com. From vpai at g.clemson.edu Wed Aug 20 11:55:26 2014 From: vpai at g.clemson.edu (vipulraikar) Date: Wed, 20 Aug 2014 08:55:26 -0700 (PDT) Subject: [vtkusers] Correct coordinate transformations for DICOM data set. Message-ID: <1408550126948-5728309.post@n5.nabble.com> Coordinate transformations for DICOM data set. Hello everybody, Before I begin to explain my roadblock\problem, let me briefly put forward what I am trying to achieve. I am using VTK to handle the visualization in my work with Image-Guidance (IGS). At the current time I am trying to register a tracked tool (already done) to a data-set and render it correctly in 3D space on screen. To begin with I have extensively gone through the posts here on understanding how to visualize the 3D space in DICOM coordinate frame (Patient\Scanner\Reference). To begin with, I am generating a vtkMatrix4X4 with direction cosines and the origin from the dicom header of the first image in the dataset (LowerLeft is ON). I have then applied this as a user matrix to my vtkVolume, which according to my understanding from all the wonderful explanations here (Especially Dr Gobbi), will apply the DICOM coordinate frame to the rendering (for the lack of better way to word this). My questions are two fold. First: How to I now render a point, which is registered to this coordinate frame, correctly (in the form of a vtkActor)? Second: How to I move this object\actor in real-time? I have tried and failed to correctly do so by applying the same user transform to the actor. I am still quite new to this. I would very much appreciate any help I can get to move forward in the right direction. best regards, V -- View this message in context: http://vtk.1045678.n5.nabble.com/Correct-coordinate-transformations-for-DICOM-data-set-tp5728309.html Sent from the VTK - Users mailing list archive at Nabble.com. From baptiste.gouygou6 at etu.univ-lorraine.fr Wed Aug 20 12:04:02 2014 From: baptiste.gouygou6 at etu.univ-lorraine.fr (bgouygou) Date: Wed, 20 Aug 2014 09:04:02 -0700 (PDT) Subject: [vtkusers] Save vtkimage data in an image file In-Reply-To: <1408545946562-5728308.post@n5.nabble.com> References: <1408545946562-5728308.post@n5.nabble.com> Message-ID: <1408550642597-5728310.post@n5.nabble.com> Forgot it, I've found a solution, I did not see the "SetInputData" function. -- View this message in context: http://vtk.1045678.n5.nabble.com/Save-vtkimage-data-in-an-image-file-tp5728308p5728310.html Sent from the VTK - Users mailing list archive at Nabble.com. From david.gobbi at gmail.com Wed Aug 20 12:58:59 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 20 Aug 2014 10:58:59 -0600 Subject: [vtkusers] Correct coordinate transformations for DICOM data set. In-Reply-To: <1408550126948-5728309.post@n5.nabble.com> References: <1408550126948-5728309.post@n5.nabble.com> Message-ID: Hi V, I found the vtkDICOMImageReader to be so lacking in functionality that I wrote my own: http://dgobbi.github.io/vtk-dicom/ And, of course, many other people use ITK to read their DICOMs (though you have to be very careful or you will lose coord system fidelity when importing the image from ITK to VTK). Finally, there is also the vtkGDCMImageReader. But if you are using the vtkDICOMImageReader, here are a few tips: 1) The reader ignores FileLowerLeft, so turning it on does nothing 2) The reader always applies a vertical flip to the images (nearly all VTK image readers flip images when they read them). 3) The reader uses the "Image Position (Patient)" to sort the slices, but it reverses the order. It has to do this, because it has already done a "y" flip, and two flips in total are necessary to avoid having the volume become a mirror image of itself. 4) When you call reader->GetImagePositionPatient(), it returns the information from the last slice that it read. Since it reads the slices in reverse order (see #3), this actually means that it returns the information from the first slice. So, putting everything together, here is the code that I used to read images with the vtkDICOMImageReader (before I wrote my own reader): vtkSmartPointer reader = vtkSmartPointer::New(); reader->SetDirectoryName(directoryName); // flip the image in Y and Z directions vtkSmartPointer flip = vtkSmartPointer::New(); flip->SetInputConnection(reader->GetOutputPort()); flip->SetResliceAxesDirectionCosines( 1,0,0, 0,-1,0, 0,0,-1); flip->Update(); vtkSmartPointer image = flip->GetOutput(); // generate the matrix float *position = reader->GetImagePositionPatient(); float *orientation = reader->GetImageOrientationPatient(); float *xdir = &orientation[0]; float *ydir = &orientation[3]; float zdir[3]; vtkMath::Cross(xdir, ydir, zdir); vtkSmartPointer matrix = vtkSmartPointer::New(); for (int i = 0; i < 3; i++) { matrix->Element[i][0] = xdir[i]; matrix->Element[i][1] = ydir[i]; matrix->Element[i][2] = zdir[i]; matrix->Element[i][3] = position[i]; } Then you can attach the matrix to the vtkVolume with SetUserMatrix(matrix). If you have points that are already in the DICOM patient coordinate system, then you don't need to apply any transformations to those points. I'm not going to give detailed info about how to display points in VTK (you can probably find wiki examples), but my advice is to use vtkGlyph3D with vtkSphereSource. Just search for "VTK Glyph3D" and you'll find a suitable example. - David On Wed, Aug 20, 2014 at 9:55 AM, vipulraikar wrote: > Coordinate transformations for DICOM data set. > > Hello everybody, > > Before I begin to explain my roadblock\problem, let me briefly put forward > what I am trying to achieve. I am using VTK to handle the visualization in > my work with Image-Guidance (IGS). At the current time I am trying to > register a tracked tool (already done) to a data-set and render it correctly > in 3D space on screen. > > To begin with I have extensively gone through the posts here on > understanding how to visualize the 3D space in DICOM coordinate frame > (Patient\Scanner\Reference). To begin with, I am generating a vtkMatrix4X4 > with direction cosines and the origin from the dicom header of the first > image in the dataset (LowerLeft is ON). I have then applied this as a user > matrix to my vtkVolume, which according to my understanding from all the > wonderful explanations here (Especially Dr Gobbi), will apply the DICOM > coordinate frame to the rendering (for the lack of better way to word this). > > My questions are two fold. First: How to I now render a point, which is > registered to this coordinate frame, correctly (in the form of a vtkActor)? > Second: How to I move this object\actor in real-time? > > I have tried and failed to correctly do so by applying the same user > transform to the actor. I am still quite new to this. I would very much > appreciate any help I can get to move forward in the right direction. > > best regards, > > V From david.gobbi at gmail.com Wed Aug 20 13:17:11 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 20 Aug 2014 11:17:11 -0600 Subject: [vtkusers] Correct coordinate transformations for DICOM data set. In-Reply-To: References: <1408550126948-5728309.post@n5.nabble.com> Message-ID: About the code that I included in my previous email, I was sure that I would forget something, and I did! 5) The "Origin" of the vtkImageData that you get from the DICOM reader _must_ be (0,0,0) or else the matrix will not work. The matrix already has the position information from the DICOM header. The VTK "Origin" is not the same as the DICOM "Position", so you cannot get "Image Position (Patient)" from the DICOM header and then use that as your Origin! Likewise, if you ever import oriented ITK images into VTK, the ITK Origin and the VTK Origin are not the same thing! The ITK Origin is defined with respect to the oriented image (I.e. with respect to a rotated coordinate system), while the VTK Origin is defined with respect to an un-oriented image (i.e. with respect to a coordinate system where X, Y, and Z are aligned with the column, row, and slice directions). I hope this clarifies things, rather than just confusing them further! - David On Wed, Aug 20, 2014 at 10:58 AM, David Gobbi wrote: > Hi V, > > I found the vtkDICOMImageReader to be so lacking in functionality > that I wrote my own: http://dgobbi.github.io/vtk-dicom/ > > And, of course, many other people use ITK to read their DICOMs > (though you have to be very careful or you will lose coord system > fidelity when importing the image from ITK to VTK). Finally, there > is also the vtkGDCMImageReader. > > > But if you are using the vtkDICOMImageReader, here are a few tips: > > 1) The reader ignores FileLowerLeft, so turning it on does nothing > > 2) The reader always applies a vertical flip to the images (nearly all > VTK image readers flip images when they read them). > > 3) The reader uses the "Image Position (Patient)" to sort the slices, > but it reverses the order. It has to do this, because it has already > done a "y" flip, and two flips in total are necessary to avoid having > the volume become a mirror image of itself. > > 4) When you call reader->GetImagePositionPatient(), it returns the > information from the last slice that it read. Since it reads the > slices in reverse order (see #3), this actually means that it returns > the information from the first slice. > > > So, putting everything together, here is the code that I used to read > images with the vtkDICOMImageReader (before I wrote my own reader): > > vtkSmartPointer reader = > vtkSmartPointer::New(); > reader->SetDirectoryName(directoryName); > > // flip the image in Y and Z directions > vtkSmartPointer flip = > vtkSmartPointer::New(); > flip->SetInputConnection(reader->GetOutputPort()); > flip->SetResliceAxesDirectionCosines( > 1,0,0, 0,-1,0, 0,0,-1); > > flip->Update(); > vtkSmartPointer image = flip->GetOutput(); > > // generate the matrix > float *position = reader->GetImagePositionPatient(); > float *orientation = reader->GetImageOrientationPatient(); > float *xdir = &orientation[0]; > float *ydir = &orientation[3]; > float zdir[3]; > vtkMath::Cross(xdir, ydir, zdir); > > vtkSmartPointer matrix = > vtkSmartPointer::New(); > for (int i = 0; i < 3; i++) > { > matrix->Element[i][0] = xdir[i]; > matrix->Element[i][1] = ydir[i]; > matrix->Element[i][2] = zdir[i]; > matrix->Element[i][3] = position[i]; > } > > > Then you can attach the matrix to the vtkVolume with > SetUserMatrix(matrix). If you have points that are already in > the DICOM patient coordinate system, then you don't need to > apply any transformations to those points. I'm not going to give > detailed info about how to display points in VTK (you can probably > find wiki examples), but my advice is to use vtkGlyph3D with > vtkSphereSource. Just search for "VTK Glyph3D" and you'll > find a suitable example. > > - David > > > On Wed, Aug 20, 2014 at 9:55 AM, vipulraikar wrote: >> Coordinate transformations for DICOM data set. >> >> Hello everybody, >> >> Before I begin to explain my roadblock\problem, let me briefly put forward >> what I am trying to achieve. I am using VTK to handle the visualization in >> my work with Image-Guidance (IGS). At the current time I am trying to >> register a tracked tool (already done) to a data-set and render it correctly >> in 3D space on screen. >> >> To begin with I have extensively gone through the posts here on >> understanding how to visualize the 3D space in DICOM coordinate frame >> (Patient\Scanner\Reference). To begin with, I am generating a vtkMatrix4X4 >> with direction cosines and the origin from the dicom header of the first >> image in the dataset (LowerLeft is ON). I have then applied this as a user >> matrix to my vtkVolume, which according to my understanding from all the >> wonderful explanations here (Especially Dr Gobbi), will apply the DICOM >> coordinate frame to the rendering (for the lack of better way to word this). >> >> My questions are two fold. First: How to I now render a point, which is >> registered to this coordinate frame, correctly (in the form of a vtkActor)? >> Second: How to I move this object\actor in real-time? >> >> I have tried and failed to correctly do so by applying the same user >> transform to the actor. I am still quite new to this. I would very much >> appreciate any help I can get to move forward in the right direction. >> >> best regards, >> >> V From vpai at g.clemson.edu Wed Aug 20 13:21:19 2014 From: vpai at g.clemson.edu (Vipul Pai Raikar) Date: Wed, 20 Aug 2014 10:21:19 -0700 (PDT) Subject: [vtkusers] Correct coordinate transformations for DICOM data set. In-Reply-To: References: <1408550126948-5728309.post@n5.nabble.com> Message-ID: <1408555279508-5728313.post@n5.nabble.com> Thank you for your prompt and detailed response Dr Gobbi. I was just about to ask you about the origin. I shall try and implement these ideas and get back. Thank you very much! V -- View this message in context: http://vtk.1045678.n5.nabble.com/Correct-coordinate-transformations-for-DICOM-data-set-tp5728309p5728313.html Sent from the VTK - Users mailing list archive at Nabble.com. From david.gobbi at gmail.com Wed Aug 20 13:24:19 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 20 Aug 2014 11:24:19 -0600 Subject: [vtkusers] Correct coordinate transformations for DICOM data set. In-Reply-To: <1408555279508-5728313.post@n5.nabble.com> References: <1408550126948-5728309.post@n5.nabble.com> <1408555279508-5728313.post@n5.nabble.com> Message-ID: Just to be complete, here is a code block that includes a filter that forces the Origin to be (0,0,0), so that all positioning is done by the matrix: vtkSmartPointer reader = vtkSmartPointer::New(); reader->SetDirectoryName(directoryName); // flip the image in Y and Z directions vtkSmartPointer flip = vtkSmartPointer::New(); flip->SetInputConnection(reader->GetOutputPort()); flip->SetResliceAxesDirectionCosines( 1,0,0, 0,-1,0, 0,0,-1); // force the origin to be (0,0,0) since we set position in the matrix vtkSmartPointer change = vtkSmartPointer::New(); change->SetInputConnection(flip->GetOutputPort()); change->SetOutputOrigin(0,0,0); change->Update(); vtkSmartPointer image = change->GetOutput(); // generate the matrix float *position = reader->GetImagePositionPatient(); float *orientation = reader->GetImageOrientationPatient(); float *xdir = &orientation[0]; float *ydir = &orientation[3]; float zdir[3]; vtkMath::Cross(xdir, ydir, zdir); vtkSmartPointer matrix = vtkSmartPointer::New(); for (int i = 0; i < 3; i++) { matrix->Element[i][0] = xdir[i]; matrix->Element[i][1] = ydir[i]; matrix->Element[i][2] = zdir[i]; matrix->Element[i][3] = position[i]; } Definitely this is a lot of work just to read a DICOM image in the correct coordinate system! Let me know if this gives you the results that you need. - David On Wed, Aug 20, 2014 at 11:21 AM, Vipul Pai Raikar wrote: > Thank you for your prompt and detailed response Dr Gobbi. I was just about to > ask you about the origin. I shall try and implement these ideas and get > back. > > Thank you very much! > > V > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/Correct-coordinate-transformations-for-DICOM-data-set-tp5728309p5728313.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers From Martin.Raabe at BaSystem.de Wed Aug 20 13:16:40 2014 From: Martin.Raabe at BaSystem.de (Martin Raabe) Date: Wed, 20 Aug 2014 19:16:40 +0200 Subject: [vtkusers] vtk webbrowser plugin for FireFox available? Message-ID: <53F4D7F8.6070307@BaSystem.de> Hello folks, is there a vtk browser plugin to have vtk 3D rendering working from inside a Web browser like FireFox? I look for an alternative for the unity plugin. Any hint apreciated. Martin Raabe From sebastien.jourdain at kitware.com Wed Aug 20 14:52:07 2014 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Wed, 20 Aug 2014 12:52:07 -0600 Subject: [vtkusers] vtk webbrowser plugin for FireFox available? In-Reply-To: <53F4D7F8.6070307@BaSystem.de> References: <53F4D7F8.6070307@BaSystem.de> Message-ID: Vtk web does not require any plugin and allow you to render 3D scene inside a Web browser either by doing remote rendering or local rendering using the WebGL capability of your browser. Most of the documentation is available via the ParaView at the following URL: http://www.paraview.org/ParaView3/Doc/Nightly/www/js-doc/index.html Seb On Wed, Aug 20, 2014 at 11:16 AM, Martin Raabe wrote: > Hello folks, > is there a vtk browser plugin to have vtk 3D rendering working from > inside a Web browser like FireFox? > I look for an alternative for the unity plugin. > > Any hint apreciated. > > Martin Raabe > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ich_daniel at habmalnefrage.de Thu Aug 21 06:19:29 2014 From: ich_daniel at habmalnefrage.de (-Daniel-) Date: Thu, 21 Aug 2014 03:19:29 -0700 (PDT) Subject: [vtkusers] Color edge of actor. In-Reply-To: References: <1408530990393-5728300.post@n5.nabble.com> Message-ID: <1408616369364-5728319.post@n5.nabble.com> You use the method (/Actor->GetProperty()->SetEdgeColor(1,1,1);/) to color the edges of all object cells. Need rather this?: http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/Silhouette -- View this message in context: http://vtk.1045678.n5.nabble.com/Color-edge-of-actor-tp5728300p5728319.html Sent from the VTK - Users mailing list archive at Nabble.com. From marco.salatin at gmail.com Thu Aug 21 07:39:53 2014 From: marco.salatin at gmail.com (Marco Salatin) Date: Thu, 21 Aug 2014 04:39:53 -0700 (PDT) Subject: [vtkusers] Color edge of actor. In-Reply-To: <1408616369364-5728319.post@n5.nabble.com> References: <1408530990393-5728300.post@n5.nabble.com> <1408616369364-5728319.post@n5.nabble.com> Message-ID: <1408621193326-5728320.post@n5.nabble.com> Yes, but how it works? Thanks Marco -- View this message in context: http://vtk.1045678.n5.nabble.com/Color-edge-of-actor-tp5728300p5728320.html Sent from the VTK - Users mailing list archive at Nabble.com. From marco.salatin at gmail.com Thu Aug 21 07:48:07 2014 From: marco.salatin at gmail.com (Marco Salatin) Date: Thu, 21 Aug 2014 13:48:07 +0200 Subject: [vtkusers] Color edge of actor. In-Reply-To: <1408621193326-5728320.post@n5.nabble.com> References: <1408530990393-5728300.post@n5.nabble.com> <1408616369364-5728319.post@n5.nabble.com> <1408621193326-5728320.post@n5.nabble.com> Message-ID: *vtkPolyDataSilhouette* missing in *python*-vtk 2014-08-21 13:39 GMT+02:00 Marco Salatin : > Yes, but how it works? > > Thanks > > Marco > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Color-edge-of-actor-tp5728300p5728320.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- --- www.salatin.eu -------------- next part -------------- An HTML attachment was scrubbed... URL: From Gerrick.Bivins at halliburton.com Thu Aug 21 11:19:56 2014 From: Gerrick.Bivins at halliburton.com (Gerrick Bivins) Date: Thu, 21 Aug 2014 15:19:56 +0000 Subject: [vtkusers] Fill vtkCellArray fast/efficiently through wrappers Message-ID: Hi all, I have some large unstructured models that I've been profiling lately. The biggest bottleneck seems to be populating the vtkCellArray for the grid. I've tried things like pre-allocate the arrays to avoid resizing (I think) and still, the profiler is pointing out that vtkIdList.SetId in the JNI layer is the issue (see attached). I found this thread that gave me some hope: http://public.kitware.com/pipermail/vtkusers/2010-January/056542.html but I can't seem to find the right methods in the wrappers to "SetArray" on the vtkIdTypeArray. The float and double variants have the SetJavaArray method which I've been using, so the question is, is there a way to quickly/efficiently set the vtkCellArray through the "wrapped" APIs such as Java? Gerrick [Your Enterprise is Bigger than a Desktop] ---------------------------------------------------------------------- This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient. Any review, use, distribution, or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 134818 bytes Desc: image001.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ProfilerVTK.png Type: image/png Size: 31126 bytes Desc: ProfilerVTK.png URL: From vpai at g.clemson.edu Thu Aug 21 13:14:41 2014 From: vpai at g.clemson.edu (Vipul Pai Raikar) Date: Thu, 21 Aug 2014 10:14:41 -0700 (PDT) Subject: [vtkusers] Correct coordinate transformations for DICOM data set. In-Reply-To: References: <1408550126948-5728309.post@n5.nabble.com> <1408555279508-5728313.post@n5.nabble.com> Message-ID: <1408641281455-5728324.post@n5.nabble.com> Hello Dr Gobbi, Well as you explained, I implemented the solution. It works like a charm. I agree with you that its quite a few lines of code to get it to work, but it indeed helped my better grasp the concept. As well as it worked, there was however an issue with the rendering being flipped in the Y-direction. I approached this problem by manipulating the camera associated with the renderer. I remember from some of your earlier posts that I read here, you explicitly advise setting up the camera by your self. As a result the rendering is now oriented correctly. I was just wondering if this was a normal thing or is the flip the byproduct of something else? ; and if this approach is correct. I also can now correctly position my tracker data. best regards, V -- View this message in context: http://vtk.1045678.n5.nabble.com/Correct-coordinate-transformations-for-DICOM-data-set-tp5728309p5728324.html Sent from the VTK - Users mailing list archive at Nabble.com. From david.gobbi at gmail.com Thu Aug 21 13:51:50 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 21 Aug 2014 11:51:50 -0600 Subject: [vtkusers] Correct coordinate transformations for DICOM data set. In-Reply-To: <1408641281455-5728324.post@n5.nabble.com> References: <1408550126948-5728309.post@n5.nabble.com> <1408555279508-5728313.post@n5.nabble.com> <1408641281455-5728324.post@n5.nabble.com> Message-ID: Hi Vipul, For the default position of the VTK camera, X points right Y points up Z points out of the screen So, yes, if one simply tries to slap a DICOM image up on the screen with VTK, it will be displayed with the wrong orientation. After all, VTK is a general-purpose graphics library, so its default settings are not tuned specifically for DICOM. Setting up the camera properly, so that you get the desired view of your data, is a must. - David On Thu, Aug 21, 2014 at 11:14 AM, Vipul Pai Raikar wrote: > Hello Dr Gobbi, > > Well as you explained, I implemented the solution. It works like a charm. I > agree with you that its quite a few lines of code to get it to work, but it > indeed helped my better grasp the concept. > As well as it worked, there was however an issue with the rendering being > flipped in the Y-direction. I approached this problem by manipulating the > camera associated with the renderer. I remember from some of your earlier > posts that I read here, you explicitly advise setting up the camera by your > self. As a result the rendering is now oriented correctly. I was just > wondering if this was a normal thing or is the flip the byproduct of > something else? ; and if this approach is correct. > I also can now correctly position my tracker data. > > best regards, > > V > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/Correct-coordinate-transformations-for-DICOM-data-set-tp5728309p5728324.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers From marco.salatin at gmail.com Fri Aug 22 04:41:29 2014 From: marco.salatin at gmail.com (Marco Salatin) Date: Fri, 22 Aug 2014 01:41:29 -0700 (PDT) Subject: [vtkusers] Edge actor problem Message-ID: <1408696889773-5728326.post@n5.nabble.com> Hi, i try to color only the edge of an object using: Actor.GetProperty().SetEdgeColor(1,1,1) Actor.GetProperty().EdgeVisibilityOn() and it works bad: instead: The image have some empty triangles along the edge. Why? Is possible to round up them using some function? thanks -- View this message in context: http://vtk.1045678.n5.nabble.com/Edge-actor-problem-tp5728326.html Sent from the VTK - Users mailing list archive at Nabble.com. From marco.salatin at gmail.com Fri Aug 22 06:01:06 2014 From: marco.salatin at gmail.com (Marco Salatin) Date: Fri, 22 Aug 2014 03:01:06 -0700 (PDT) Subject: [vtkusers] Color edge of actor. In-Reply-To: <1408621193326-5728320.post@n5.nabble.com> References: <1408530990393-5728300.post@n5.nabble.com> <1408616369364-5728319.post@n5.nabble.com> <1408621193326-5728320.post@n5.nabble.com> Message-ID: <1408701666856-5728327.post@n5.nabble.com> i try Silhouette, thanks. it works bat no good. :( -- View this message in context: http://vtk.1045678.n5.nabble.com/Color-edge-of-actor-tp5728300p5728327.html Sent from the VTK - Users mailing list archive at Nabble.com. From beekmaarten at yahoo.com Fri Aug 22 10:04:44 2014 From: beekmaarten at yahoo.com (Maarten Beek) Date: Fri, 22 Aug 2014 07:04:44 -0700 Subject: [vtkusers] re-using allocated memory in image algorithm Message-ID: <1408716284.56640.YahooMailNeo@web121301.mail.ne1.yahoo.com> Hi all, Is there a way to preserve the allocate memory of the put of an image algorithm? Looking at the source code, I have the feeling that algorithms in vtk allocate memory for their output each time ExecuteData() is called. I created an image algorithm that updates almost continuously, but the image size doesn't change. So once the output is created and memory is allocated, I could just keep using this output (just calling output->Modified() after the data in the exiting memory is replaced). How would I do this? Thanks - Maarten -------------- next part -------------- An HTML attachment was scrubbed... URL: From vpai at g.clemson.edu Fri Aug 22 13:37:24 2014 From: vpai at g.clemson.edu (Vipul Pai Raikar) Date: Fri, 22 Aug 2014 10:37:24 -0700 (PDT) Subject: [vtkusers] Correct coordinate transformations for DICOM data set. In-Reply-To: References: <1408550126948-5728309.post@n5.nabble.com> <1408555279508-5728313.post@n5.nabble.com> <1408641281455-5728324.post@n5.nabble.com> Message-ID: <1408729044290-5728332.post@n5.nabble.com> Thank you very much for all the explanations. Setting up the camera correctly has done the trick. Best regards, V -- View this message in context: http://vtk.1045678.n5.nabble.com/Correct-coordinate-transformations-for-DICOM-data-set-tp5728309p5728332.html Sent from the VTK - Users mailing list archive at Nabble.com. From the.1.lily at hotmail.com Fri Aug 22 14:30:52 2014 From: the.1.lily at hotmail.com (the lily) Date: Fri, 22 Aug 2014 21:30:52 +0300 Subject: [vtkusers] vtkLookupTable displaying different colors in each run. Message-ID: Hi Everyone, I'm trying to set the lookup-table to give me blue for the minimum and red for the maximum value with linear interpolation between them. When I run my program it gives me different colors each time. Here is my code, can anyone help me to figure out what I'm doing wrong? vtkLookupTable *lut = vtkLookupTable::New();lut->SetNumberOfTableValues(256);vtkColorTransferFunction *TF = vtkColorTransferFunction::New();TF->SetColorSpaceToDiverging();TF->AddRGBPoint(reader->GetOutput()->GetScalarRange()[0],0.0,0.0,1.0);TF->AddRGBPoint(reader->GetOutput()->GetScalarRange()[1],1.0,0.0,0.0); TF->SetScaleToLinear(); double myValue; for(int i=0; i<256;i++) { myValue = GetLinearInterploation(i/1.0,0, 256, reader->GetOutput()->GetScalarRange()[0], reader->GetOutput()->GetScalarRange()[1]); lut->SetTableValue(myValue,TF->GetColor(myValue)); } lut->Build();SliceMapper->SetLookupTable(lut);SliceMapper->SetScalarRange(reader->GetOutput()->GetScalarRange()[0],reader->GetOutput()->GetScalarRange()[1]);vtkRenderer *ren = vtkRenderer::New();vtkRenderWindow *renwin = vtkRenderWindow::New();renwin->AddRenderer(ren); ren->AddActor(SliceActor);vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New(); iren->SetRenderWindow(renwin);renwin->Render();iren->Start(); Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Fri Aug 22 15:39:39 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 22 Aug 2014 13:39:39 -0600 Subject: [vtkusers] re-using allocated memory in image algorithm In-Reply-To: <1408716284.56640.YahooMailNeo@web121301.mail.ne1.yahoo.com> References: <1408716284.56640.YahooMailNeo@web121301.mail.ne1.yahoo.com> Message-ID: Hi Maarten, The VTK image algorithms automatically reuse their memory unless the data type or the size changes. For more info, look at the code for AllocateScalars in vtkImageData.cxx. Also, I recommend printing out the memory address after each Execute so that you can verify that it doesn't change. - David On Fri, Aug 22, 2014 at 8:04 AM, Maarten Beek via vtkusers wrote: > Hi all, > > Is there a way to preserve the allocate memory of the put of an image > algorithm? > > Looking at the source code, I have the feeling that algorithms in vtk > allocate memory for their output each time ExecuteData() is called. I > created an image algorithm that updates almost continuously, but the image > size doesn't change. So once the output is created and memory is allocated, > I could just keep using this output (just calling output->Modified() after > the data in the exiting memory is replaced). How would I do this? > > Thanks - Maarten From beekmaarten at yahoo.com Fri Aug 22 16:31:07 2014 From: beekmaarten at yahoo.com (Maarten Beek) Date: Fri, 22 Aug 2014 13:31:07 -0700 Subject: [vtkusers] re-using allocated memory in image algorithm In-Reply-To: References: <1408716284.56640.YahooMailNeo@web121301.mail.ne1.yahoo.com> Message-ID: <1408739467.45967.YahooMailNeo@web121302.mail.ne1.yahoo.com> Thanks David for your reply. I'll check allocateScalars() and also make sure this is the function used by my algorithm... Printing the memory address is of course a good check. Thanks - Maarten On Friday, August 22, 2014 3:39:59 PM, David Gobbi wrote: Hi Maarten, The VTK image algorithms automatically reuse their memory unless the data type or the size changes.? For more info, look at the code for AllocateScalars in vtkImageData.cxx.? Also, I recommend printing out the memory address after each Execute so that you can verify that it doesn't change. - David On Fri, Aug 22, 2014 at 8:04 AM, Maarten Beek via vtkusers wrote: > Hi all, > > Is there a way to preserve the allocate memory of the put of an image > algorithm? > > Looking at the source code, I have the feeling that algorithms in vtk > allocate memory for their output each time ExecuteData() is called. I > created an image algorithm that updates almost continuously, but the image > size doesn't change. So once the output is created and memory is allocated, > I could just keep using this output (just calling output->Modified() after > the data in the exiting memory is replaced). How would I do this? > > Thanks - Maarten -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris.marsh at usask.ca Fri Aug 22 16:14:00 2014 From: chris.marsh at usask.ca (Chris Marsh) Date: Fri, 22 Aug 2014 14:14:00 -0600 Subject: [vtkusers] Timestep name Message-ID: I have a timeseries of data that I am saving to a set of vtu files. These load in paraview nicely and play as an animation. However, each timestep corresponds to a date/time (e.g., Oct-01-2010 14:00:00) and I would like this to be displayed. For example, 'Timestep 758' isn't intuitive when dealing with realworld datetimes. I have tried making a pvd file, but it wasn't not clear how to rename a timestep. Is there a way of doing this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From joseignacio.prieto at gmail.com Fri Aug 22 19:45:37 2014 From: joseignacio.prieto at gmail.com (Jose Ignacio Prieto) Date: Fri, 22 Aug 2014 19:45:37 -0400 Subject: [vtkusers] 2D polygon stack to 3d mesh Message-ID: Hi all, I am dubious to which mail list use. I have an array of 2d snake segmentations for the left ventricle( a std vector of 20 rows with a closed convex 2d polygon each row) on ITK and I would like it to turn it into a mesh that can be visualized. Should I use QuadMeshEdge and then a Delaunay in ITk, or use Delaunay methods in VTK. Or maybe I should write an ad-hoc method given that the points are sorted so a triangle can be made with two consecutive polygon points and the closest one on the following slice. Thank you very much, Ignacio Prieto -- Ignacio Prieto Research Assistant Biomedical Imaging Center Pontificia Universidad Catolica de Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From madaramh at gmail.com Sat Aug 23 05:24:33 2014 From: madaramh at gmail.com (madz) Date: Sat, 23 Aug 2014 02:24:33 -0700 (PDT) Subject: [vtkusers] Mouse rotations with vtkGraphLayoutView Message-ID: <1408785873757-5728342.post@n5.nabble.com> I have this vtkMutableDirectedGraph which I need to rotate with mouse right click. How do I enable this function? Any help will be much apreciated. Thanks. Code- #include #include #include #include #include #include #include #include #include #include #include #include int main(int, char *[]) { // Create a graph vtkSmartPointer graph = vtkSmartPointer::New(); vtkIdType v1 = graph->AddVertex(); vtkIdType v2 = graph->AddVertex(); vtkIdType v3 = graph->AddVertex(); vtkIdType v4 = graph->AddVertex(); graph->AddEdge(v1,v2); graph->AddEdge(v2,v3); //graph->AddEdge(v2,v3); // Manually set the position of the vertices vtkSmartPointer points = vtkSmartPointer::New(); points->InsertNextPoint(-0.021752 ,0.0556542,0.133764); points->InsertNextPoint(-0.0297364,0.0530088,0.143996); points->InsertNextPoint(-0.0224155,0.0452271,0.139162); points->InsertNextPoint(-0.0151613,0.0582923,0.139686); graph->SetPoints(points); // Create the color array vtkSmartPointer vertexColors = vtkSmartPointer::New(); vertexColors->SetNumberOfComponents(1); vertexColors->SetName("Color"); vtkSmartPointer lookupTable = vtkSmartPointer::New(); lookupTable->SetNumberOfTableValues(4); lookupTable->SetTableValue(0, 1.0, 0.0, 0.0); // red lookupTable->SetTableValue(1, 1.0, 1.0, 1.0); // white lookupTable->SetTableValue(2, 0.0, 1.0, 0.0); // green lookupTable->SetTableValue(3, 0.0, 0.0, 1.0); // blue lookupTable->Build(); vertexColors->InsertNextValue(0); vertexColors->InsertNextValue(1); vertexColors->InsertNextValue(2); vertexColors->InsertNextValue(3); // Add the color array to the graph graph->GetVertexData()->AddArray(vertexColors); // Visualize vtkSmartPointer graphLayoutView = vtkSmartPointer::New(); graphLayoutView->AddRepresentationFromInput(graph); graphLayoutView->SetLayoutStrategyToPassThrough(); graphLayoutView->SetVertexColorArrayName("Color"); graphLayoutView->ColorVerticesOn(); vtkSmartPointer theme = vtkSmartPointer::New(); theme->SetPointLookupTable(lookupTable); graphLayoutView->ApplyViewTheme(theme); graphLayoutView->ResetCamera(); graphLayoutView->GetInteractor()->Initialize(); graphLayoutView->GetRenderer()->GetActiveCamera()->Zoom(0.8); graphLayoutView->GetInteractor()->Start(); return EXIT_SUCCESS; } -- View this message in context: http://vtk.1045678.n5.nabble.com/Mouse-rotations-with-vtkGraphLayoutView-tp5728342.html Sent from the VTK - Users mailing list archive at Nabble.com. From sistephan at gmail.com Sat Aug 23 13:37:17 2014 From: sistephan at gmail.com (Sam) Date: Sat, 23 Aug 2014 10:37:17 -0700 (PDT) Subject: [vtkusers] Building ActiViz .NET OpenSource Edition 6.1.0 Message-ID: <1408815437762-5728343.post@n5.nabble.com> Has anyone been successful in building ActiViz .NET OpenSource Edition 6.1.0? I've been trying to follow the instructions on http://www.kitware.com/opensource/avdownload.php and http://www.vtk.org/Wiki/VTK/CSharp/ActiViz/Build but need a bit more detail. -- View this message in context: http://vtk.1045678.n5.nabble.com/Building-ActiViz-NET-OpenSource-Edition-6-1-0-tp5728343.html Sent from the VTK - Users mailing list archive at Nabble.com. From julien.jomier at kitware.com Sun Aug 24 03:45:04 2014 From: julien.jomier at kitware.com (Julien Jomier) Date: Sun, 24 Aug 2014 09:45:04 +0200 Subject: [vtkusers] Building ActiViz .NET OpenSource Edition 6.1.0 In-Reply-To: <1408815437762-5728343.post@n5.nabble.com> References: <1408815437762-5728343.post@n5.nabble.com> Message-ID: <53F99800.4030008@kitware.com> The current source code of ActiViz only compiles with VTK 5.8. We plan to upgrade the source code later this year. Julien On 23/08/2014 19:37, Sam wrote: > Has anyone been successful in building ActiViz .NET OpenSource Edition 6.1.0? > I've been trying to follow the instructions on > http://www.kitware.com/opensource/avdownload.php and > http://www.vtk.org/Wiki/VTK/CSharp/ActiViz/Build but need a bit more detail. > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/Building-ActiViz-NET-OpenSource-Edition-6-1-0-tp5728343.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > From xypsilonx at web.de Sun Aug 24 07:41:27 2014 From: xypsilonx at web.de (mathew) Date: Sun, 24 Aug 2014 04:41:27 -0700 (PDT) Subject: [vtkusers] VTK 6.0.1 build problem Message-ID: <1408880487657-5728354.post@n5.nabble.com> Hello vtk users, After changing to Ubuntu 14.04.1 I am in trouble getting VTK- 6.1.0 to build. No matter what I do, I keep getting: Building CXX object Rendering/OpenGL/CMakeFiles/vtkRenderingOpenGL.dir/vtkXOpenGLRenderWindow.cxx.o In file included from /usr/include/GL/glx.h:333:0, from /usr/local/VTK/Rendering/OpenGL/vtkXOpenGLRenderWindow.cxx:31: /usr/include/GL/glxext.h:480:143: error: ?GLintptr? has not been declared typedef void ( *PFNGLXCOPYBUFFERSUBDATANVPROC) (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); ^ /usr/include/GL/glxext.h:480:164: error: ?GLintptr? has not been declared typedef void ( *PFNGLXCOPYBUFFERSUBDATANVPROC) (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); ^ /usr/include/GL/glxext.h:480:186: error: ?GLsizeiptr? has not been declared typedef void ( *PFNGLXCOPYBUFFERSUBDATANVPROC) (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); ^ /usr/include/GL/glxext.h:481:148: error: ?GLintptr? has not been declared typedef void ( *PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC) (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); ^ /usr/include/GL/glxext.h:481:169: error: ?GLintptr? has not been declared typedef void ( *PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC) (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); ^ /usr/include/GL/glxext.h:481:191: error: ?GLsizeiptr? has not been declared typedef void ( *PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC) (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); ^ make[2]: *** [Rendering/OpenGL/CMakeFiles/vtkRenderingOpenGL.dir/vtkXOpenGLRenderWindow.cxx.o] Error 1 make[1]: *** [Rendering/OpenGL/CMakeFiles/vtkRenderingOpenGL.dir/all] Error 2 make: *** [all] Error 2 Somehow, I belive it has to with my nvidia driver/settings. Using an old one (e.g. 304) didn't change anything? Any ideas? -- View this message in context: http://vtk.1045678.n5.nabble.com/VTK-6-0-1-build-problem-tp5728354.html Sent from the VTK - Users mailing list archive at Nabble.com. From bill.lorensen at gmail.com Sun Aug 24 16:35:40 2014 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Sun, 24 Aug 2014 16:35:40 -0400 Subject: [vtkusers] add pictures to examples on the VTK wiki? In-Reply-To: References: <20140818162259.AEB8661176@public.kitware.com> Message-ID: Bernard, Thanks for adding this example. As you can see from the diffs between your original and the current page, I really only needed to: 1) Add ==CubeAxesActor2D.cxx== This is important so the automated precess can detect the example. 2) Add ifdef's to allow VTK5 and VTK6 users to take advantage of your contribution, 3) I added a baseline. We don't expect contributors to be concerned about 2) and 3). Please as more examples as you learn more about VTK. Thanks again, Bill http://www.vtk.org/Wiki/index.php?title=VTK%2FExamples%2FCxx%2FVisualization%2FCubeAxesActor2D&action=historysubmit&diff=56681&oldid=56666 On Mon, Aug 18, 2014 at 3:50 PM, Bill Lorensen wrote: > Bernard, > > Please feel free to add examples. Don't worry about the images. We > monitor the nightly examples dashboard and we will try to fix up any > issues. If you do add and example, please post to the users or > developers list so we can help clean up any issues. > > Thanks, > > Bill > > > On Mon, Aug 18, 2014 at 12:23 PM, Meehan, Bernard wrote: >> This may not be the right place to ask this question, and if so, my >> apologies - >> >> How do you add pictures to the example pages on the Wiki, like the picture >> on this page: >> http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/ParametricObjectsDemo >> >> >> _______________________________________________ >> 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 >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> > > > > -- > Unpaid intern in BillsBasement at noware dot com -- Unpaid intern in BillsBasement at noware dot com From marco.salatin at gmail.com Mon Aug 25 03:41:45 2014 From: marco.salatin at gmail.com (Marco Salatin) Date: Mon, 25 Aug 2014 00:41:45 -0700 (PDT) Subject: [vtkusers] Edge size. Message-ID: <1408952505120-5728359.post@n5.nabble.com> Hello vtk users, there are some one who can help me to do a function that can increase offset (shell) of edge of a object? Thanks Marco -- View this message in context: http://vtk.1045678.n5.nabble.com/Edge-size-tp5728359.html Sent from the VTK - Users mailing list archive at Nabble.com. From joggingsong at gmail.com Mon Aug 25 04:39:40 2014 From: joggingsong at gmail.com (Jogging Song) Date: Mon, 25 Aug 2014 16:39:40 +0800 Subject: [vtkusers] How to use my our weights in vtkDijkstraGraphGeodesicPath Message-ID: Dear all, I am using the function vtkDijkstraGraphGeodesicPath to find shortest path between two vertices on one mesh. At first I don't turn on the switch UseScalarWeights. Then by calling the function SetUseScalarWeights, I can turn on the switch. The resultant shortest path is different. I have two questions about how to use the weights. I search over the internet about related materials, how fail to find any helpful information. 1. If I call the function SetUseScalarWeights, I don't know how the weights are calculated. When the weights are calculated, the value of the weight depends on input argument. 2. If I hope to write one function to calculate my own weights, what should I do? Thanks in advance. Regards Jogging Song -------------- next part -------------- An HTML attachment was scrubbed... URL: From kmorel at sandia.gov Mon Aug 25 08:12:41 2014 From: kmorel at sandia.gov (Moreland, Kenneth) Date: Mon, 25 Aug 2014 12:12:41 +0000 Subject: [vtkusers] Timestep name Message-ID: Chris, In the pvd file, which is just an XML metadata file, you will see tags named DataSet that point to the vtu files. The DataSet tag supports a timestep attribute that takes a number that represents the time value. These time values do not have to be integers and do not have to be regularly spaced. However, the timestep attribute does have to be a number. You will have to convert your time to some seconds/hours/days from some reference point. -Ken Kenneth Moreland Sandia National Laboratories email: kmorel at sandia.gov phone: (505) 844-8919 web: http://www.sandia.gov/~kmorel ________________________________ From: vtkusers on behalf of Chris Marsh Sent: Friday, August 22, 2014 2:14 PM To: vtkusers at vtk.org Subject: [EXTERNAL] [vtkusers] Timestep name I have a timeseries of data that I am saving to a set of vtu files. These load in paraview nicely and play as an animation. However, each timestep corresponds to a date/time (e.g., Oct-01-2010 14:00:00) and I would like this to be displayed. For example, 'Timestep 758' isn't intuitive when dealing with realworld datetimes. I have tried making a pvd file, but it wasn't not clear how to rename a timestep. Is there a way of doing this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From beekmaarten at yahoo.com Mon Aug 25 10:42:12 2014 From: beekmaarten at yahoo.com (Maarten Beek) Date: Mon, 25 Aug 2014 07:42:12 -0700 Subject: [vtkusers] re-using allocated memory in image algorithm In-Reply-To: <1408739467.45967.YahooMailNeo@web121302.mail.ne1.yahoo.com> References: <1408716284.56640.YahooMailNeo@web121301.mail.ne1.yahoo.com> <1408739467.45967.YahooMailNeo@web121302.mail.ne1.yahoo.com> Message-ID: <1408977732.8132.YahooMailNeo@web121303.mail.ne1.yahoo.com> Hi all, Problem solved: De memory address of the scalars did change but because the ReleaseData flag was On... What would be best practice in a pipeline of about 6 image algorithms that all update during interaction: ReleaseData flag On or Off? (because that must have been the reason to put the flag to on a couple of months ago). Thanks - Maarten On Friday, August 22, 2014 4:31:14 PM, Maarten Beek via vtkusers wrote: Thanks David for your reply. I'll check allocateScalars() and also make sure this is the function used by my algorithm... Printing the memory address is of course a good check. Thanks - Maarten On Friday, August 22, 2014 3:39:59 PM, David Gobbi wrote: Hi Maarten, The VTK image algorithms automatically reuse their memory unless the data type or the size changes.? For more info, look at the code for AllocateScalars in vtkImageData.cxx.? Also, I recommend printing out the memory address after each Execute so that you can verify that it doesn't change. - David On Fri, Aug 22, 2014 at 8:04 AM, Maarten Beek via vtkusers wrote: > Hi all, > > Is there a way to preserve the allocate memory of the put of an image > algorithm? > > Looking at the source code, I have the feeling that algorithms in vtk > allocate memory for their output each time ExecuteData() is called. I > created an image algorithm that updates almost continuously, but the image > size doesn't change. So once the output is created and memory is allocated, > I could just keep using this output (just calling output->Modified() after > the data in the exiting memory is replaced). How would I do this? > > Thanks - Maarten _______________________________________________ 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 Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Mon Aug 25 11:13:32 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 25 Aug 2014 09:13:32 -0600 Subject: [vtkusers] re-using allocated memory in image algorithm In-Reply-To: <1408977732.8132.YahooMailNeo@web121303.mail.ne1.yahoo.com> References: <1408716284.56640.YahooMailNeo@web121301.mail.ne1.yahoo.com> <1408739467.45967.YahooMailNeo@web121302.mail.ne1.yahoo.com> <1408977732.8132.YahooMailNeo@web121303.mail.ne1.yahoo.com> Message-ID: Unless you're short on memory, ReleaseDataFlagOff() should always give better performance. That's why it's the default ;) - David On Mon, Aug 25, 2014 at 8:42 AM, Maarten Beek wrote: > Hi all, > > Problem solved: De memory address of the scalars did change but because the > ReleaseData flag was On... > > What would be best practice in a pipeline of about 6 image algorithms that > all update during interaction: ReleaseData flag On or Off? > > (because that must have been the reason to put the flag to on a couple of > months ago). > > Thanks - Maarten > > > On Friday, August 22, 2014 4:31:14 PM, Maarten Beek via vtkusers > wrote: > > > Thanks David for your reply. > > I'll check allocateScalars() and also make sure this is the function used by > my algorithm... > Printing the memory address is of course a good check. > > Thanks - Maarten > > > On Friday, August 22, 2014 3:39:59 PM, David Gobbi > wrote: > > > Hi Maarten, > > The VTK image algorithms automatically reuse their memory unless the > data type or the size changes. For more info, look at the code for > AllocateScalars in vtkImageData.cxx. Also, I recommend printing out > the memory address after each Execute so that you can verify that it > doesn't change. > > - David > > > On Fri, Aug 22, 2014 at 8:04 AM, Maarten Beek via vtkusers > wrote: >> Hi all, >> >> Is there a way to preserve the allocate memory of the put of an image >> algorithm? >> >> Looking at the source code, I have the feeling that algorithms in vtk >> allocate memory for their output each time ExecuteData() is called. I >> created an image algorithm that updates almost continuously, but the image >> size doesn't change. So once the output is created and memory is >> allocated, >> I could just keep using this output (just calling output->Modified() after >> the data in the exiting memory is replaced). How would I do this? >> >> Thanks - Maarten From Joan.Hensen at outlook.de Mon Aug 25 14:54:57 2014 From: Joan.Hensen at outlook.de (Sky77) Date: Mon, 25 Aug 2014 11:54:57 -0700 (PDT) Subject: [vtkusers] Problem with "Compute Gaussian, Mean, Minm and Max Curvatures" example Message-ID: <1408992897546-5728377.post@n5.nabble.com> Hey guys, i have a problem with an example. Its name is Compute Gaussian, Mean, Min and Max Curvatures . Instead of using a vtp file as input, i use the following code to create a sphere and use the sphere as input: /* Create a sphere */ vtkSmartPointer sphereSource = vtkSmartPointer::New(); sphereSource->SetCenter(0.0, 0.0, 0.0); sphereSource->SetRadius(1.0); sphereSource->SetThetaResolution(50); sphereSource->SetPhiResolution(50); I also changed the following line curvaturesFilter->SetInputConnection(reader->GetOutputPort()); to curvaturesFilter->SetInputConnection(sphereSource ->GetOutputPort()); so that the algorithm works on the sphere. Here you can see the output. What did i do wrong? -- View this message in context: http://vtk.1045678.n5.nabble.com/Problem-with-Compute-Gaussian-Mean-Minm-and-Max-Curvatures-example-tp5728377.html Sent from the VTK - Users mailing list archive at Nabble.com. From bill.lorensen at gmail.com Mon Aug 25 16:58:44 2014 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Mon, 25 Aug 2014 16:58:44 -0400 Subject: [vtkusers] Problem with "Compute Gaussian, Mean, Minm and Max Curvatures" example In-Reply-To: <1408992897546-5728377.post@n5.nabble.com> References: <1408992897546-5728377.post@n5.nabble.com> Message-ID: Please post the entire C++ code. Thanks, Bill On Mon, Aug 25, 2014 at 2:54 PM, Sky77 wrote: > Hey guys, > > i have a problem with an example. Its name is Compute Gaussian, Mean, Min > and Max Curvatures > . Instead of > using a vtp file as input, i use the following code to create a sphere and > use the sphere as input: > > /* Create a sphere */ > vtkSmartPointer sphereSource = > vtkSmartPointer::New(); > sphereSource->SetCenter(0.0, 0.0, 0.0); > sphereSource->SetRadius(1.0); > sphereSource->SetThetaResolution(50); > sphereSource->SetPhiResolution(50); > > I also changed the following line > > curvaturesFilter->SetInputConnection(reader->GetOutputPort()); > > to > > curvaturesFilter->SetInputConnection(sphereSource ->GetOutputPort()); > > so that the algorithm works on the sphere. > > Here you can > see the output. What did i do wrong? > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/Problem-with-Compute-Gaussian-Mean-Minm-and-Max-Curvatures-example-tp5728377.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -- Unpaid intern in BillsBasement at noware dot com From Joan.Hensen at outlook.de Mon Aug 25 17:24:07 2014 From: Joan.Hensen at outlook.de (Sky77) Date: Mon, 25 Aug 2014 14:24:07 -0700 (PDT) Subject: [vtkusers] Problem with "Compute Gaussian, Mean, Minm and Max Curvatures" example In-Reply-To: References: <1408992897546-5728377.post@n5.nabble.com> Message-ID: <1409001847891-5728386.post@n5.nabble.com> Here is the adapted example: #include #include #include #include #include #include #include #include #include #include #include #include #include #include int main(int argc, char *argv[]) { /* Create a sphere */ vtkSmartPointer sphereSource = vtkSmartPointer::New(); sphereSource->SetCenter(0.0, 0.0, 0.0); sphereSource->SetRadius(1.0); sphereSource->SetThetaResolution(50); sphereSource->SetPhiResolution(50); vtkSmartPointer curvaturesFilter = vtkSmartPointer::New(); curvaturesFilter->SetInputConnection(sphereSource->GetOutputPort()); curvaturesFilter->SetCurvatureTypeToMinimum(); curvaturesFilter->SetCurvatureTypeToMaximum(); curvaturesFilter->SetCurvatureTypeToGaussian(); curvaturesFilter->SetCurvatureTypeToMean(); curvaturesFilter->Update(); // Get scalar range from command line if present, otherwise use // range of computed curvature double scalarRange[2]; if (argc >= 4) { scalarRange[0] = atof(argv[2]); scalarRange[1] = atof(argv[3]); } else { curvaturesFilter->GetOutput()->GetScalarRange(scalarRange); } int scheme = 16; if (argc >= 5) { scheme = atoi(argv[4]); } // Build a lookup table vtkSmartPointer colorSeries = vtkSmartPointer::New(); colorSeries->SetColorScheme(scheme); vtkSmartPointer lut = vtkSmartPointer::New(); lut->SetColorSpaceToHSV(); // Use a color series to create a transfer function int numColors = colorSeries->GetNumberOfColors(); for (int i = 0; i < numColors; i++) { vtkColor3ub color = colorSeries->GetColor(i); double dColor[3]; dColor[0] = static_cast (color[0]) / 255.0; dColor[1] = static_cast (color[1]) / 255.0; dColor[2] = static_cast (color[2]) / 255.0; double t = scalarRange[0] + (scalarRange[1] - scalarRange[0]) / (numColors - 1) * i; lut->AddRGBPoint(t, dColor[0], dColor[1], dColor[2]); } // Create a mapper and actor vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(curvaturesFilter->GetOutputPort()); mapper->SetLookupTable(lut); mapper->SetScalarRange(scalarRange); vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); // Create a scalar bar vtkSmartPointer scalarBar = vtkSmartPointer::New(); scalarBar->SetLookupTable(mapper->GetLookupTable()); scalarBar->SetTitle(curvaturesFilter->GetOutput()->GetPointData()->GetScalars()->GetName()); scalarBar->SetNumberOfLabels(5); // Create a renderer, render window, and interactor vtkSmartPointer renderer = vtkSmartPointer::New(); vtkSmartPointer renderWindow = vtkSmartPointer::New(); renderWindow->AddRenderer(renderer); vtkSmartPointer renderWindowInteractor = vtkSmartPointer::New(); renderWindowInteractor->SetRenderWindow(renderWindow); // Add the actors to the scene renderer->AddActor(actor); renderer->AddActor2D(scalarBar); renderer->SetBackground(.1, .2, .3); // Background color blue // Render and interact renderWindow->Render(); renderWindowInteractor->Start(); return EXIT_SUCCESS; } -- View this message in context: http://vtk.1045678.n5.nabble.com/Problem-with-Compute-Gaussian-Mean-Minm-and-Max-Curvatures-example-tp5728377p5728386.html Sent from the VTK - Users mailing list archive at Nabble.com. From joe.ott at imaginationsc.com Mon Aug 25 18:52:40 2014 From: joe.ott at imaginationsc.com (Jott) Date: Mon, 25 Aug 2014 15:52:40 -0700 (PDT) Subject: [vtkusers] Problem with "Compute Gaussian, Mean, Minm and Max Curvatures" example In-Reply-To: <1409001847891-5728386.post@n5.nabble.com> References: <1408992897546-5728377.post@n5.nabble.com> <1409001847891-5728386.post@n5.nabble.com> Message-ID: <1409007160854-5728387.post@n5.nabble.com> Sky77 I'm not sure what you expect the output to be. The example computes the curve in the image, but your input is a sphere which has a constant curvature. from the documenation: vtkCurvatures takes a polydata input and computes the curvature of the mesh at each point. >From the description I would expect that the results from a sphere would would be a constant value, pretty much what your results showed. To test this you can try to modify one point on the sphere, this will change the curvature around that point and should show up in your results. HTH -- View this message in context: http://vtk.1045678.n5.nabble.com/Problem-with-Compute-Gaussian-Mean-Minm-and-Max-Curvatures-example-tp5728377p5728387.html Sent from the VTK - Users mailing list archive at Nabble.com. From majcjc at gmail.com Tue Aug 26 02:59:03 2014 From: majcjc at gmail.com (Lin M) Date: Tue, 26 Aug 2014 14:59:03 +0800 Subject: [vtkusers] How to display multiple slices in one 3D scene? Message-ID: Hi all, I try to make a simple viewer consists of 4 views. Axial, Sagital, Coronal and a 3D view contains the previous 3 slices. I use 4 renderwindows and the slice viewer works fine but when I try to make them display in the 3D viewer, it cannot show correctly. m_3DImgRenderer->AddViewProp(m_AxialImgViewer->GetImageActor()); m_3DImgRenderer->AddViewProp(m_SagitalImgViewer->GetImageActor()); m_3DImgRenderer->AddViewProp(m_CoronalImgViewer->GetImageActor()); m_3DImgRenderer->ResetCamera(); m_3DViewer->GetRenderWindow()->Render(); I hope to display the 3 orthogonal slices in the 3D render window but it display 3 orthogonal slices of one plane. (I mean it should be 1 axial view, 1 sagital view and 1 coronal view but it displays like 3 axial in orthogonal...) Any ideas about that? Thank you! Best, Lin -------------- next part -------------- An HTML attachment was scrubbed... URL: From Joan.Hensen at outlook.de Tue Aug 26 05:42:22 2014 From: Joan.Hensen at outlook.de (Sky77) Date: Tue, 26 Aug 2014 02:42:22 -0700 (PDT) Subject: [vtkusers] Problem with "Compute Gaussian, Mean, Minm and Max Curvatures" example In-Reply-To: <1409007160854-5728387.post@n5.nabble.com> References: <1408992897546-5728377.post@n5.nabble.com> <1409001847891-5728386.post@n5.nabble.com> <1409007160854-5728387.post@n5.nabble.com> Message-ID: <1409046142855-5728392.post@n5.nabble.com> Hey HTH. You're right. The sphere alone is an unsuitable example to show that something isn't working when we are looking at the curvature. Therefore I have adapted the code. Now we are looking at the Gaussian curvature of two overlapping spheres. It is clear that the viusalization should show positive curvature everywhere execpt the area where they overlap. There it should be negative curvature. My resulting visualization has not changed (see here ). #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include int main(int argc, char *argv[]) { vtkSmartPointer input1 = vtkSmartPointer::New(); vtkSmartPointer input2 = vtkSmartPointer::New(); vtkSmartPointer sphereSource1 = vtkSmartPointer::New(); sphereSource1->SetRadius(5); sphereSource1->SetCenter(-2,0,0); sphereSource1->SetPhiResolution(15); sphereSource1->SetThetaResolution(15); sphereSource1->Update(); input1->ShallowCopy(sphereSource1->GetOutput()); vtkSmartPointer sphereSource2 = vtkSmartPointer::New(); sphereSource2->SetRadius(5); sphereSource2->SetCenter(2,0,0); sphereSource2->SetPhiResolution(15); sphereSource2->SetThetaResolution(15); sphereSource2->Update(); input2->ShallowCopy(sphereSource2->GetOutput()); //Append the two meshes vtkSmartPointer appendFilter = vtkSmartPointer::New(); appendFilter->AddInputConnection(input1->GetProducerPort()); appendFilter->AddInputConnection(input2->GetProducerPort()); appendFilter->Update(); // Remove any duplicate points. vtkSmartPointer cleanFilter = vtkSmartPointer::New(); cleanFilter->SetInputConnection(appendFilter->GetOutputPort()); cleanFilter->Update(); vtkSmartPointer curvaturesFilter = vtkSmartPointer::New(); curvaturesFilter->SetInputConnection(cleanFilter->GetOutputPort()); curvaturesFilter->SetCurvatureTypeToGaussian(); curvaturesFilter->Update(); // Get scalar range from command line if present, otherwise use // range of computed curvature double scalarRange[2]; if (argc >= 4) { scalarRange[0] = atof(argv[2]); scalarRange[1] = atof(argv[3]); } else { curvaturesFilter->GetOutput()->GetScalarRange(scalarRange); } int scheme = 16; if (argc >= 5) { scheme = atoi(argv[4]); } // Build a lookup table vtkSmartPointer colorSeries = vtkSmartPointer::New(); colorSeries->SetColorScheme(scheme); vtkSmartPointer lut = vtkSmartPointer::New(); lut->SetColorSpaceToHSV(); // Use a color series to create a transfer function int numColors = colorSeries->GetNumberOfColors(); for (int i = 0; i < numColors; i++) { vtkColor3ub color = colorSeries->GetColor(i); double dColor[3]; dColor[0] = static_cast (color[0]) / 255.0; dColor[1] = static_cast (color[1]) / 255.0; dColor[2] = static_cast (color[2]) / 255.0; double t = scalarRange[0] + (scalarRange[1] - scalarRange[0]) / (numColors - 1) * i; lut->AddRGBPoint(t, dColor[0], dColor[1], dColor[2]); } // Create a mapper and actor vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(curvaturesFilter->GetOutputPort()); mapper->SetLookupTable(lut); mapper->SetScalarRange(scalarRange); vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); // Create a scalar bar vtkSmartPointer scalarBar = vtkSmartPointer::New(); scalarBar->SetLookupTable(mapper->GetLookupTable()); scalarBar->SetTitle(curvaturesFilter->GetOutput()->GetPointData()->GetScalars()->GetName()); scalarBar->SetNumberOfLabels(5); // Create a renderer, render window, and interactor vtkSmartPointer renderer = vtkSmartPointer::New(); vtkSmartPointer renderWindow = vtkSmartPointer::New(); renderWindow->AddRenderer(renderer); vtkSmartPointer renderWindowInteractor = vtkSmartPointer::New(); renderWindowInteractor->SetRenderWindow(renderWindow); // Add the actors to the scene renderer->AddActor(actor); renderer->AddActor2D(scalarBar); renderer->SetBackground(.1, .2, .3); // Background color blue // Render and interact renderWindow->Render(); renderWindowInteractor->Start(); return EXIT_SUCCESS; } -- View this message in context: http://vtk.1045678.n5.nabble.com/Problem-with-Compute-Gaussian-Mean-Minm-and-Max-Curvatures-example-tp5728377p5728392.html Sent from the VTK - Users mailing list archive at Nabble.com. From sfaisal.ali91 at gmail.com Tue Aug 26 06:15:54 2014 From: sfaisal.ali91 at gmail.com (sfaisalali91) Date: Tue, 26 Aug 2014 03:15:54 -0700 (PDT) Subject: [vtkusers] Multiple renderes and interactor callback Message-ID: <1409048154305-5728393.post@n5.nabble.com> hey guys, I am trying to synchronize MPR view with Volume rendering view and to achieve this i am using multiple viewports (3 to display Mpr and 1 to display volume) and an interactor for overall interaction making use of vtkInteractorStyleSwitch and vtkInteractorStyleImage. Using a callback function and MouseMoveEvent i am able to achieve the desired i.e, volume renders independently (only at the first interaction) and as i move the 3d cursor to slice through different orientations the volume rotates accordingly, but i am facing a problem interacting and resetting the interactor of volume renderer after interacting with the MPR views as the camera of volume renderer is synchronized with other views. i tried to reset the camera, assign another camera and also tried calling another function to reinitialize interactor of volume renderer but everything in vain. Here is a snippet of my call back function. vtkRenderer *pokedRenderer = iren->FindPokedRenderer(currPos[0], currPos[1]); //mouse movement if (event == vtkCommand::MouseMoveEvent) { if (pokedRenderer == renn[0]) { iren->SetInteractorStyle(ImageIren); ImageRenderer->SetActiveCamera(renn[2]->GetActiveCamera()); } else if (pokedRenderer == renn[1]) { iren->SetInteractorStyle(ImageIren); ImageRenderer->SetActiveCamera(renn[0]->GetActiveCamera()); } else if (pokedRenderer == renn[2]) { iren->SetInteractorStyle(ImageIren); ImageRenderer->SetActiveCamera(renn[1]->GetActiveCamera()); } else if (pokedRenderer == ImageRenderer) //Volume Renderer { ImageIren->Delete(); iren->RemoveObserver(MouseMoveEvent); iren->SetInteractorStyle(VolumeIren); iren->ReInitialize(); VolumeIren->Rotate(); ImageRenderer->ResetCamera(); //ImageRenderer->ResetCameraClippingRange(); iren->Render(); } } }; I highly appreciate your help. Thanks & Regards Ali -- View this message in context: http://vtk.1045678.n5.nabble.com/Multiple-renderes-and-interactor-callback-tp5728393.html Sent from the VTK - Users mailing list archive at Nabble.com. From f.veronesi at scsitaly.com Tue Aug 26 06:32:28 2014 From: f.veronesi at scsitaly.com (Federico Veronesi) Date: Tue, 26 Aug 2014 12:32:28 +0200 Subject: [vtkusers] 2D isolines with labels Message-ID: Dear vtkusers, can you suggest me a way to implement a contour with label for 2D images. I would like to achieve a visualization similar to a cartographic map, in which each isoline is interrupted and a label is placed inline. Typically, this visualization is used for altitude map. have a look here: http://en.wikipedia.org/wiki/File:IGRF_2000_magnetic_declination.gif I have already tried vtkPointSetToLabelHierarchy and vtkLabelPlacementMapper, but results are poor, because the contours are not interrupted and the orientation of labels should depend by zoom factor. Thanks in advance for any suggestion Federico -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Tue Aug 26 07:48:13 2014 From: daviddoria at gmail.com (David Doria) Date: Tue, 26 Aug 2014 07:48:13 -0400 Subject: [vtkusers] Problem with "Compute Gaussian, Mean, Minm and Max Curvatures" example In-Reply-To: <1409046142855-5728392.post@n5.nabble.com> References: <1408992897546-5728377.post@n5.nabble.com> <1409001847891-5728386.post@n5.nabble.com> <1409007160854-5728387.post@n5.nabble.com> <1409046142855-5728392.post@n5.nabble.com> Message-ID: On Tue, Aug 26, 2014 at 5:42 AM, Sky77 wrote: > Hey HTH. > > You're right. The sphere alone is an unsuitable example to show that > something isn't working when we are looking at the curvature. Therefore I > have adapted the code. Now we are looking at the Gaussian curvature of two > overlapping spheres. It is clear that the viusalization should show > positive > curvature everywhere execpt the area where they overlap. There it should be > negative curvature. My resulting visualization has not changed (see here > ). > It works for me. I had to change appendFilter->AddInputConnection(input1->GetProducerPort()); appendFilter->AddInputConnection(input2->GetProducerPort()); to appendFilter->AddInputData(input1); appendFilter->AddInputData(input2); for VTK6 compatibility, but then I get the attached output. David -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: curvature.jpg Type: image/jpeg Size: 10496 bytes Desc: not available URL: From Joan.Hensen at outlook.de Tue Aug 26 09:00:27 2014 From: Joan.Hensen at outlook.de (Sky77) Date: Tue, 26 Aug 2014 06:00:27 -0700 (PDT) Subject: [vtkusers] Problem with "Compute Gaussian, Mean, Minm and Max Curvatures" example In-Reply-To: References: <1408992897546-5728377.post@n5.nabble.com> <1409001847891-5728386.post@n5.nabble.com> <1409007160854-5728387.post@n5.nabble.com> <1409046142855-5728392.post@n5.nabble.com> Message-ID: <1409058027955-5728397.post@n5.nabble.com> Hey David, i get the same result as you when i comment the following line out: // mapper->SetLookupTable(lut); It is not nice that the Gaussian curvature fall off to 0.0316. Also there should be an area with negative Gaussian curvature, which is missing completely. Maybe i did something wrong when i merge the two spheres? -- View this message in context: http://vtk.1045678.n5.nabble.com/Problem-with-Compute-Gaussian-Mean-Minm-and-Max-Curvatures-example-tp5728377p5728397.html Sent from the VTK - Users mailing list archive at Nabble.com. From daviddoria at gmail.com Tue Aug 26 09:09:04 2014 From: daviddoria at gmail.com (David Doria) Date: Tue, 26 Aug 2014 09:09:04 -0400 Subject: [vtkusers] Problem with "Compute Gaussian, Mean, Minm and Max Curvatures" example In-Reply-To: <1409058027955-5728397.post@n5.nabble.com> References: <1408992897546-5728377.post@n5.nabble.com> <1409001847891-5728386.post@n5.nabble.com> <1409007160854-5728387.post@n5.nabble.com> <1409046142855-5728392.post@n5.nabble.com> <1409058027955-5728397.post@n5.nabble.com> Message-ID: On Tue, Aug 26, 2014 at 9:00 AM, Sky77 wrote: > Hey David, > > i get the same result as you when i comment the following line out: > > // mapper->SetLookupTable(lut); > > It is not nice that the Gaussian curvature fall off to 0.0316. Also there > should be an area with negative Gaussian curvature, which is missing > completely. Maybe i did something wrong when i merge the two spheres? > The way you have "merged" the two spheres leaves pieces of the spheres inside of the surface that we can see. Try merging them using one of the capabilities of this filter: http://www.vtk.org/doc/nightly/html/classvtkBooleanOperationPolyDataFilter.html http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/BooleanOperationPolyDataFilter David -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Tue Aug 26 10:12:35 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 26 Aug 2014 08:12:35 -0600 Subject: [vtkusers] Multiple renderes and interactor callback In-Reply-To: <1409048154305-5728393.post@n5.nabble.com> References: <1409048154305-5728393.post@n5.nabble.com> Message-ID: Hi Ali, MPR synchronization can be tricky, and I don't know anyone who has done it successfully by only sharing cameras between the renderers. You might have better luck if you have independent cameras, and copy specific camera parameters (e.g. focal point, direction, etc) between the cameras. - David On Tue, Aug 26, 2014 at 4:15 AM, sfaisalali91 wrote: > hey guys, > > I am trying to synchronize MPR view with Volume rendering view and to > achieve this i am using multiple viewports (3 to display Mpr and 1 to > display volume) and an interactor for overall interaction making use of > vtkInteractorStyleSwitch and vtkInteractorStyleImage. > > Using a callback function and MouseMoveEvent i am able to achieve the > desired i.e, volume renders independently (only at the first interaction) > and as i move the 3d cursor to slice through different orientations the > volume rotates accordingly, but i am facing a problem interacting and > resetting the interactor of volume renderer after interacting with the MPR > views as the camera of volume renderer is synchronized with other views. i > tried to reset the camera, assign another camera and also tried calling > another function to reinitialize interactor of volume renderer but > everything in vain. > > Here is a snippet of my call back function. > > vtkRenderer *pokedRenderer = iren->FindPokedRenderer(currPos[0], > currPos[1]); //mouse movement > if (event == vtkCommand::MouseMoveEvent) > { > if (pokedRenderer == renn[0]) > { > iren->SetInteractorStyle(ImageIren); > ImageRenderer->SetActiveCamera(renn[2]->GetActiveCamera()); > } > else if (pokedRenderer == renn[1]) > { > iren->SetInteractorStyle(ImageIren); > ImageRenderer->SetActiveCamera(renn[0]->GetActiveCamera()); > } > else if (pokedRenderer == renn[2]) > { > iren->SetInteractorStyle(ImageIren); > ImageRenderer->SetActiveCamera(renn[1]->GetActiveCamera()); > } > else if (pokedRenderer == ImageRenderer) //Volume Renderer > { > ImageIren->Delete(); > iren->RemoveObserver(MouseMoveEvent); > iren->SetInteractorStyle(VolumeIren); > iren->ReInitialize(); > VolumeIren->Rotate(); > ImageRenderer->ResetCamera(); > //ImageRenderer->ResetCameraClippingRange(); > iren->Render(); > } > } > > }; > > I highly appreciate your help. > > Thanks & Regards > Ali From david.gobbi at gmail.com Tue Aug 26 10:16:40 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 26 Aug 2014 08:16:40 -0600 Subject: [vtkusers] How to display multiple slices in one 3D scene? In-Reply-To: References: Message-ID: Hi Lin, In VTK, you cannot use the same image actor in more than one renderer. You will need to make three new actors for the ortho view. - David On Tue, Aug 26, 2014 at 12:59 AM, Lin M wrote: > Hi all, > > I try to make a simple viewer consists of 4 views. Axial, Sagital, Coronal > and a 3D view contains the previous 3 slices. I use 4 renderwindows and the > slice viewer works fine but when I try to make them display in the 3D > viewer, it cannot show correctly. > > m_3DImgRenderer->AddViewProp(m_AxialImgViewer->GetImageActor()); > m_3DImgRenderer->AddViewProp(m_SagitalImgViewer->GetImageActor()); > m_3DImgRenderer->AddViewProp(m_CoronalImgViewer->GetImageActor()); > m_3DImgRenderer->ResetCamera(); > m_3DViewer->GetRenderWindow()->Render(); > > I hope to display the 3 orthogonal slices in the 3D render window but it > display 3 orthogonal slices of one plane. (I mean it should be 1 axial view, > 1 sagital view and 1 coronal view but it displays like 3 axial in > orthogonal...) > > Any ideas about that? Thank you! > > Best, > Lin From Joan.Hensen at outlook.de Tue Aug 26 10:35:48 2014 From: Joan.Hensen at outlook.de (Sky77) Date: Tue, 26 Aug 2014 07:35:48 -0700 (PDT) Subject: [vtkusers] Problem with "Compute Gaussian, Mean, Minm and Max Curvatures" example In-Reply-To: References: <1408992897546-5728377.post@n5.nabble.com> <1409001847891-5728386.post@n5.nabble.com> <1409007160854-5728387.post@n5.nabble.com> <1409046142855-5728392.post@n5.nabble.com> <1409058027955-5728397.post@n5.nabble.com> Message-ID: <1409063748852-5728401.post@n5.nabble.com> It seems that my version of VTK is to old. The header file vtkBooleanOperationPolyDataFilter.h can't be found. For this purpose, i have try something else to get an object with negative Gaussian curvature. A torus have positive Gaussian curvature on the outside and negative Gaussian curvature on the inside. I have created one with blender and import it as obj file. This ist the input file: torus.obj Here you can see my result. Also in this case no negative curvature is computed. Has someone of you experience with the curvature computation with vtk? I mean has someone used this functionality with success? #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include int main(int argc, char *argv[]) { // Parse command line arguments if(argc != 2) { std::cout << "Usage: " << argv[0] << " Filename(.obj)" << std::endl; return EXIT_FAILURE; } std::string filename = argv[1]; vtkSmartPointer reader = vtkSmartPointer::New(); reader->SetFileName(filename.c_str()); reader->Update(); vtkSmartPointer curvaturesFilter = vtkSmartPointer::New(); curvaturesFilter->SetInputConnection(reader->GetOutputPort()); curvaturesFilter->SetCurvatureTypeToGaussian(); curvaturesFilter->Update(); // Get scalar range from command line if present, otherwise use // range of computed curvature double scalarRange[2]; if (argc >= 4) { scalarRange[0] = atof(argv[2]); scalarRange[1] = atof(argv[3]); } else { curvaturesFilter->GetOutput()->GetScalarRange(scalarRange); } int scheme = 16; if (argc >= 5) { scheme = atoi(argv[4]); } // Build a lookup table vtkSmartPointer colorSeries = vtkSmartPointer::New(); colorSeries->SetColorScheme(scheme); vtkSmartPointer lut = vtkSmartPointer::New(); lut->SetColorSpaceToHSV(); // Use a color series to create a transfer function int numColors = colorSeries->GetNumberOfColors(); for (int i = 0; i < numColors; i++) { vtkColor3ub color = colorSeries->GetColor(i); double dColor[3]; dColor[0] = static_cast (color[0]) / 255.0; dColor[1] = static_cast (color[1]) / 255.0; dColor[2] = static_cast (color[2]) / 255.0; double t = scalarRange[0] + (scalarRange[1] - scalarRange[0]) / (numColors - 1) * i; lut->AddRGBPoint(t, dColor[0], dColor[1], dColor[2]); } // Create a mapper and actor vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(curvaturesFilter->GetOutputPort()); // mapper->SetLookupTable(lut); mapper->SetScalarRange(scalarRange); vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); // Create a scalar bar vtkSmartPointer scalarBar = vtkSmartPointer::New(); scalarBar->SetLookupTable(mapper->GetLookupTable()); scalarBar->SetTitle(curvaturesFilter->GetOutput()->GetPointData()->GetScalars()->GetName()); scalarBar->SetNumberOfLabels(5); // Create a renderer, render window, and interactor vtkSmartPointer renderer = vtkSmartPointer::New(); vtkSmartPointer renderWindow = vtkSmartPointer::New(); renderWindow->AddRenderer(renderer); vtkSmartPointer renderWindowInteractor = vtkSmartPointer::New(); renderWindowInteractor->SetRenderWindow(renderWindow); // Add the actors to the scene renderer->AddActor(actor); renderer->AddActor2D(scalarBar); renderer->SetBackground(.1, .2, .3); // Background color blue // Render and interact renderWindow->Render(); renderWindowInteractor->Start(); return EXIT_SUCCESS; } -- View this message in context: http://vtk.1045678.n5.nabble.com/Problem-with-Compute-Gaussian-Mean-Minm-and-Max-Curvatures-example-tp5728377p5728401.html Sent from the VTK - Users mailing list archive at Nabble.com. From joe.ott at imaginationsc.com Tue Aug 26 12:51:57 2014 From: joe.ott at imaginationsc.com (Jott) Date: Tue, 26 Aug 2014 09:51:57 -0700 (PDT) Subject: [vtkusers] Problem with "Compute Gaussian, Mean, Minm and Max Curvatures" example In-Reply-To: <1409046142855-5728392.post@n5.nabble.com> References: <1408992897546-5728377.post@n5.nabble.com> <1409001847891-5728386.post@n5.nabble.com> <1409007160854-5728387.post@n5.nabble.com> <1409046142855-5728392.post@n5.nabble.com> Message-ID: <1409071917178-5728402.post@n5.nabble.com> Sky77 I reviewed your code again and saw that you use a color scheme of 16. What version of VTK are you using? I currently am using 5.10 and a color scheme of 16 creates a custom scheme with only one color, which would explain your one color image. Try changing the color scheme to 0 (vtkColorSeries::SPECTRUM). I ran your code with color scheme 16 and got the same result you did. I change the color scheme to 0 and the results changed to what you would expect. Since I haven't used vtkCurvatures before I was mistaken in that a sphere would be flat HTH, Jott ps: HTH = hope this helps -- View this message in context: http://vtk.1045678.n5.nabble.com/Problem-with-Compute-Gaussian-Mean-Minm-and-Max-Curvatures-example-tp5728377p5728402.html Sent from the VTK - Users mailing list archive at Nabble.com. From nawijn at gmail.com Tue Aug 26 14:23:21 2014 From: nawijn at gmail.com (Marco Nawijn) Date: Tue, 26 Aug 2014 20:23:21 +0200 Subject: [vtkusers] VTK port to Google (portable) native client available? Message-ID: Dear All, I am in the process of creating a web application that could benefit from VTK libraries. I have played around with Google (portable) native client [1] for the past couple of days and are rather pleased with the results and performance. So the obvious next test is to see if I can use VTK. However, it seems that you specifically need to port libraries to this platform. I have no idea if this is straightforward or not. But to avoid inventing the wheel again, I thought I as here first. So the questions I have are the following: a.) Did anyone already try to port VTK to (P)NaCl. If so, is the this port available? b.) If the answer to (a) is no, is there anyone who can estimate the effort? Note that I am willing to do (part of) the work and release the result to the community. [1] https://developer.chrome.com/native-client Kind regards, Marco -------------- next part -------------- An HTML attachment was scrubbed... URL: From Joan.Hensen at outlook.de Tue Aug 26 14:42:55 2014 From: Joan.Hensen at outlook.de (Sky77) Date: Tue, 26 Aug 2014 11:42:55 -0700 (PDT) Subject: [vtkusers] Problem with "Compute Gaussian, Mean, Minm and Max Curvatures" example In-Reply-To: <1409071917178-5728402.post@n5.nabble.com> References: <1408992897546-5728377.post@n5.nabble.com> <1409001847891-5728386.post@n5.nabble.com> <1409007160854-5728387.post@n5.nabble.com> <1409046142855-5728392.post@n5.nabble.com> <1409071917178-5728402.post@n5.nabble.com> Message-ID: <1409078575281-5728405.post@n5.nabble.com> Hey Jott. Sorry, I thought that "HTH" is your nickname. I was reading to quickly. :-). Currently I'm using VTK 5.8. Your note also worked for me. Now the colormap is visible on the sphere. Do you also have an idea why the function doesn't compute negative Gaussian curvature for the torus? It seems strange. The function of VTK should really compute negative curvature on the inside of the torus (like it is shown here ). -- View this message in context: http://vtk.1045678.n5.nabble.com/Problem-with-Compute-Gaussian-Mean-Minm-and-Max-Curvatures-example-tp5728377p5728405.html Sent from the VTK - Users mailing list archive at Nabble.com. From bill.lorensen at gmail.com Tue Aug 26 15:15:55 2014 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Tue, 26 Aug 2014 15:15:55 -0400 Subject: [vtkusers] Problem with "Compute Gaussian, Mean, Minm and Max Curvatures" example In-Reply-To: <1409078575281-5728405.post@n5.nabble.com> References: <1408992897546-5728377.post@n5.nabble.com> <1409001847891-5728386.post@n5.nabble.com> <1409007160854-5728387.post@n5.nabble.com> <1409046142855-5728392.post@n5.nabble.com> <1409071917178-5728402.post@n5.nabble.com> <1409078575281-5728405.post@n5.nabble.com> Message-ID: Please provide the wikipedia link that points to that image. On Tue, Aug 26, 2014 at 2:42 PM, Sky77 wrote: > Hey Jott. > > Sorry, I thought that "HTH" is your nickname. I was reading to quickly. :-). > > Currently I'm using VTK 5.8. Your note also worked for me. Now the colormap > is visible on the sphere. > > Do you also have an idea why the function doesn't compute negative Gaussian > curvature for the torus? It seems strange. The function of VTK should really > compute negative curvature on the inside of the torus (like it is shown > here > > ). > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/Problem-with-Compute-Gaussian-Mean-Minm-and-Max-Curvatures-example-tp5728377p5728405.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -- Unpaid intern in BillsBasement at noware dot com From Joan.Hensen at outlook.de Tue Aug 26 15:37:31 2014 From: Joan.Hensen at outlook.de (Sky77) Date: Tue, 26 Aug 2014 12:37:31 -0700 (PDT) Subject: [vtkusers] Problem with "Compute Gaussian, Mean, Minm and Max Curvatures" example In-Reply-To: References: <1408992897546-5728377.post@n5.nabble.com> <1409001847891-5728386.post@n5.nabble.com> <1409007160854-5728387.post@n5.nabble.com> <1409046142855-5728392.post@n5.nabble.com> <1409071917178-5728402.post@n5.nabble.com> <1409078575281-5728405.post@n5.nabble.com> Message-ID: <1409081851035-5728409.post@n5.nabble.com> Unfortunately i haven't the wikipedia link. I searched with google for an appropriate visualization of the torus. But i have found something likely. You can find a similar visualization on page 2 of this pdf file . -- View this message in context: http://vtk.1045678.n5.nabble.com/Problem-with-Compute-Gaussian-Mean-Minm-and-Max-Curvatures-example-tp5728377p5728409.html Sent from the VTK - Users mailing list archive at Nabble.com. From dhoppes at mbfbioscience.com Tue Aug 26 15:36:48 2014 From: dhoppes at mbfbioscience.com (Doug Hoppes) Date: Tue, 26 Aug 2014 19:36:48 +0000 Subject: [vtkusers] OpenGL2 Message-ID: <46CB11F12B9DC24D860D4082451B318A12C24897@exchange3.microbrightfield.com> Hi all, In our application, we're working some extremely large image stacks and saw that there was some work for the latest OpenGL drivers. When we got the latest nightly build and tried to compile it by setting the VTK_RENDERING_OPENGL to use OpenGL2, the software compiles. However, there's a number of missing dlls errors when we try to run it. Is the OpenGL2 implementation finished? Doug -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Tue Aug 26 15:46:47 2014 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Tue, 26 Aug 2014 15:46:47 -0400 Subject: [vtkusers] Problem with "Compute Gaussian, Mean, Minm and Max Curvatures" example In-Reply-To: <1409081851035-5728409.post@n5.nabble.com> References: <1408992897546-5728377.post@n5.nabble.com> <1409001847891-5728386.post@n5.nabble.com> <1409007160854-5728387.post@n5.nabble.com> <1409046142855-5728392.post@n5.nabble.com> <1409071917178-5728402.post@n5.nabble.com> <1409078575281-5728405.post@n5.nabble.com> <1409081851035-5728409.post@n5.nabble.com> Message-ID: That is a good reference. So it seems the gaussian curvature in VTK may have a problem. On Tue, Aug 26, 2014 at 3:37 PM, Sky77 wrote: > Unfortunately i haven't the wikipedia link. I searched with google for an > appropriate visualization of the torus. But i have found something likely. > You can find a similar visualization on page 2 of this pdf file > > . > > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/Problem-with-Compute-Gaussian-Mean-Minm-and-Max-Curvatures-example-tp5728377p5728409.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -- Unpaid intern in BillsBasement at noware dot com From bill.lorensen at gmail.com Tue Aug 26 16:07:14 2014 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Tue, 26 Aug 2014 16:07:14 -0400 Subject: [vtkusers] Problem with "Compute Gaussian, Mean, Minm and Max Curvatures" example In-Reply-To: References: <1408992897546-5728377.post@n5.nabble.com> <1409001847891-5728386.post@n5.nabble.com> <1409007160854-5728387.post@n5.nabble.com> <1409046142855-5728392.post@n5.nabble.com> <1409071917178-5728402.post@n5.nabble.com> <1409078575281-5728405.post@n5.nabble.com> <1409081851035-5728409.post@n5.nabble.com> Message-ID: Try this. It uses a parametric torus. Something strange is going on with your torus: #include #include #include #include #include #include #include #include #include #include #include #include #include #include int main(int argc, char *argv[]) { vtkSmartPointer parametricObject = vtkSmartPointer::New(); parametricObject->SetRingRadius(0.5); parametricObject->SetCrossSectionRadius(.25); vtkSmartPointer parametricFunctionSource = vtkSmartPointer::New(); parametricFunctionSource->SetParametricFunction(parametricObject); parametricFunctionSource->Update(); // Create a polydata vtkSmartPointer curvaturesFilter = vtkSmartPointer::New(); curvaturesFilter->SetInputConnection(parametricFunctionSource->GetOutputPort()); curvaturesFilter->SetCurvatureTypeToGaussian(); curvaturesFilter->Update(); // Get scalar range from command line if present, otherwise use // range of computed curvature double scalarRange[2]; if (argc >= 4) { scalarRange[0] = atof(argv[2]); scalarRange[1] = atof(argv[3]); } else { curvaturesFilter->GetOutput()->GetScalarRange(scalarRange); } int scheme = 16; if (argc >= 5) { scheme = atoi(argv[4]); } // Build a lookup table vtkSmartPointer colorSeries = vtkSmartPointer::New(); colorSeries->SetColorScheme(scheme); std::cout << "Using color scheme #: " << colorSeries->GetColorScheme() << " is " << colorSeries->GetColorSchemeName() << std::endl; vtkSmartPointer lut = vtkSmartPointer::New(); lut->SetColorSpaceToHSV(); // Use a color series to create a transfer function int numColors = colorSeries->GetNumberOfColors(); for (int i = 0; i < numColors; i++) { vtkColor3ub color = colorSeries->GetColor(i); double dColor[3]; dColor[0] = static_cast (color[0]) / 255.0; dColor[1] = static_cast (color[1]) / 255.0; dColor[2] = static_cast (color[2]) / 255.0; double t = scalarRange[0] + (scalarRange[1] - scalarRange[0]) / (numColors - 1) * i; lut->AddRGBPoint(t, dColor[0], dColor[1], dColor[2]); } // Create a mapper and actor vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(curvaturesFilter->GetOutputPort()); mapper->SetLookupTable(lut); mapper->SetScalarRange(scalarRange); vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); // Create a scalar bar vtkSmartPointer scalarBar = vtkSmartPointer::New(); scalarBar->SetLookupTable(mapper->GetLookupTable()); scalarBar->SetTitle( curvaturesFilter->GetOutput()->GetPointData()->GetScalars()->GetName()); scalarBar->SetNumberOfLabels(5); // Create a renderer, render window, and interactor vtkSmartPointer renderer = vtkSmartPointer::New(); vtkSmartPointer renderWindow = vtkSmartPointer::New(); renderWindow->AddRenderer(renderer); vtkSmartPointer renderWindowInteractor = vtkSmartPointer::New(); renderWindowInteractor->SetRenderWindow(renderWindow); // Add the actors to the scene renderer->AddActor(actor); renderer->AddActor2D(scalarBar); renderer->SetBackground(.1, .2, .3); // Background color blue // Render and interact renderWindow->Render(); renderWindowInteractor->Start(); return EXIT_SUCCESS; } On Tue, Aug 26, 2014 at 3:46 PM, Bill Lorensen wrote: > That is a good reference. So it seems the gaussian curvature in VTK > may have a problem. > > > On Tue, Aug 26, 2014 at 3:37 PM, Sky77 wrote: >> Unfortunately i haven't the wikipedia link. I searched with google for an >> appropriate visualization of the torus. But i have found something likely. >> You can find a similar visualization on page 2 of this pdf file >> >> . >> >> >> >> >> -- >> View this message in context: http://vtk.1045678.n5.nabble.com/Problem-with-Compute-Gaussian-Mean-Minm-and-Max-Curvatures-example-tp5728377p5728409.html >> Sent from the VTK - Users mailing list archive at Nabble.com. >> _______________________________________________ >> 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 >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers > > > > -- > Unpaid intern in BillsBasement at noware dot com -- Unpaid intern in BillsBasement at noware dot com From berk.geveci at kitware.com Tue Aug 26 16:32:06 2014 From: berk.geveci at kitware.com (Berk Geveci) Date: Tue, 26 Aug 2014 16:32:06 -0400 Subject: [vtkusers] Proposal: Bug tracker hack-a-ton Message-ID: Hi folks, I propose a hack-a-ton to reduce the number of open issues in the bug tracker. It is like a yard that hasn't been mowed and weeded the whole summer. I propose a full day hack-a-ton. We can host some folks here at Kitware and others can join through a Google Hangout. I propose one in September. What do you think? Interested parties please send me an e-mail off the list with your preferred dates. This will have to be the first in a series. There are a lot of issues to go over. Best, -berk -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Tue Aug 26 16:43:13 2014 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Tue, 26 Aug 2014 16:43:13 -0400 Subject: [vtkusers] [vtk-developers] Proposal: Bug tracker hack-a-ton In-Reply-To: References: Message-ID: I will attend if possible. October is better for me, I will be away September 17-27. Mondays and Wednesdays are bad (golf). Sept 8,9,10 are bad. On Tue, Aug 26, 2014 at 4:32 PM, Berk Geveci wrote: > Hi folks, > > I propose a hack-a-ton to reduce the number of open issues in the bug > tracker. It is like a yard that hasn't been mowed and weeded the whole > summer. I propose a full day hack-a-ton. We can host some folks here at > Kitware and others can join through a Google Hangout. I propose one in > September. What do you think? Interested parties please send me an e-mail > off the list with your preferred dates. > > This will have to be the first in a series. There are a lot of issues to go > over. > > Best, > -berk > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtk-developers > > -- Unpaid intern in BillsBasement at noware dot com From MEEHANBT at nv.doe.gov Tue Aug 26 17:01:04 2014 From: MEEHANBT at nv.doe.gov (Meehan, Bernard) Date: Tue, 26 Aug 2014 21:01:04 +0000 Subject: [vtkusers] Problem with "Compute Gaussian, Mean, Minm and Max Curvatures" example In-Reply-To: <7FE2028E23W1943332-01@EMF_nv.doe.gov> References: <1408992897546-5728377.post@n5.nabble.com> <1409001847891-5728386.post@n5.nabble.com> <1409007160854-5728387.post@n5.nabble.com> <1409046142855-5728392.post@n5.nabble.com> <1409071917178-5728402.post@n5.nabble.com> <1409078575281-5728405.post@n5.nabble.com> <7FE2028E23W1943332-01@EMF_nv.doe.gov> Message-ID: I found the image at: http://commons.wikimedia.org/wiki/Category:Curvature http://commons.wikimedia.org/wiki/Category:Torus and couldn't find a Wikipedia page referencing it ... On 8/26/14 12:15 PM, "Bill Lorensen" wrote: >Please provide the wikipedia link that points to that image. > > >On Tue, Aug 26, 2014 at 2:42 PM, Sky77 wrote: >> Hey Jott. >> >> Sorry, I thought that "HTH" is your nickname. I was reading to quickly. >>:-). >> >> Currently I'm using VTK 5.8. Your note also worked for me. Now the >>colormap >> is visible on the sphere. >> >> Do you also have an idea why the function doesn't compute negative >>Gaussian >> curvature for the torus? It seems strange. The function of VTK should >>really >> compute negative curvature on the inside of the torus (like it is shown >> here >> >>>gative_curvature.png> >> ). >> >> >> >> -- >> View this message in context: >>http://vtk.1045678.n5.nabble.com/Problem-with-Compute-Gaussian-Mean-Minm- >>and-Max-Curvatures-example-tp5728377p5728405.html >> Sent from the VTK - Users mailing list archive at Nabble.com. >> _______________________________________________ >> 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 >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers > > > >-- >Unpaid intern in BillsBasement at noware dot com >_______________________________________________ >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 > >Follow this link to subscribe/unsubscribe: >http://public.kitware.com/mailman/listinfo/vtkusers > From joe.ott at imaginationsc.com Tue Aug 26 17:46:05 2014 From: joe.ott at imaginationsc.com (Jott) Date: Tue, 26 Aug 2014 14:46:05 -0700 (PDT) Subject: [vtkusers] Problem with "Compute Gaussian, Mean, Minm and Max Curvatures" example In-Reply-To: <1409078575281-5728405.post@n5.nabble.com> References: <1408992897546-5728377.post@n5.nabble.com> <1409001847891-5728386.post@n5.nabble.com> <1409007160854-5728387.post@n5.nabble.com> <1409046142855-5728392.post@n5.nabble.com> <1409071917178-5728402.post@n5.nabble.com> <1409078575281-5728405.post@n5.nabble.com> Message-ID: <1409089565302-5728427.post@n5.nabble.com> Sky77 I'm glad changing color scheme helped. I'm not sure why you aren't seeing negative curvatures, but Bill's post using the parametric Torus seems to work. Unfortunately I don't have any further insight for you. Jott -- View this message in context: http://vtk.1045678.n5.nabble.com/Problem-with-Compute-Gaussian-Mean-Minm-and-Max-Curvatures-example-tp5728377p5728427.html Sent from the VTK - Users mailing list archive at Nabble.com. From Joan.Hensen at outlook.de Tue Aug 26 17:53:57 2014 From: Joan.Hensen at outlook.de (Sky77) Date: Tue, 26 Aug 2014 14:53:57 -0700 (PDT) Subject: [vtkusers] Problem with "Compute Gaussian, Mean, Minm and Max Curvatures" example In-Reply-To: References: <1409001847891-5728386.post@n5.nabble.com> <1409007160854-5728387.post@n5.nabble.com> <1409046142855-5728392.post@n5.nabble.com> <1409071917178-5728402.post@n5.nabble.com> <1409078575281-5728405.post@n5.nabble.com> <1409081851035-5728409.post@n5.nabble.com> Message-ID: <1409090037532-5728428.post@n5.nabble.com> Hey Bill. With your provided code i get the expected result. Thank you! I still get an artefact, which you can see in the following image: (I created this image with Bill's provided code) Does someone knows how i can avoid it? @ Jott: Thank you for your help. -- View this message in context: http://vtk.1045678.n5.nabble.com/Problem-with-Compute-Gaussian-Mean-Minm-and-Max-Curvatures-example-tp5728377p5728428.html Sent from the VTK - Users mailing list archive at Nabble.com. From Grant.Windes at smith-nephew.com Tue Aug 26 17:59:58 2014 From: Grant.Windes at smith-nephew.com (Windes, Grant) Date: Tue, 26 Aug 2014 21:59:58 +0000 Subject: [vtkusers] Depth Peeling w/ Nvidia Quadro 2000 Message-ID: <4d478f080fc34f8bb98785eac467c7aa@BN1PR05MB263.namprd05.prod.outlook.com> Looking to implement a proper depth sort for semi-transparent objects. My research has shown that the vtkDepthSortPolyData is not sufficient as it is CPU bound. I've enabled depth peeling and it's worked great using Core i7 4770K (4600HD Integrated Graphics). However, it was slower than we liked and thus I tested an Nvidia Quadro 3000M and Quadro 2000. Both don't properly enable depth peeling as confirmed with a GetRenderLastUsedDepthPeeling() call. Note: Using pyVTK (vtk 5.10.1) on Windows 7 64bit with latest gpu Quadro drivers (9.18.13.4062) In my small test application I can get DepthPeeling to render properly on the Quadro 2000 by setting renderWindow.SetAlphaBitPlanes(1) renderWindow.SetMultiSamples(0) renderer.SetUseDepthPeeling(1) However, If I remove SetAlphaBitPlanes() and SetMultiSamples() depth peeling doesn't work properly and is not enabled. Any indication as to why depth peeling works fine on the Core i7 integrated graphics compared to a true GPU? Thanks, Grant -------------- next part -------------- An HTML attachment was scrubbed... URL: From MEEHANBT at nv.doe.gov Tue Aug 26 18:25:28 2014 From: MEEHANBT at nv.doe.gov (Meehan, Bernard) Date: Tue, 26 Aug 2014 22:25:28 +0000 Subject: [vtkusers] Edge size. In-Reply-To: <7FE4376623W1846016-01@EMF_nv.doe.gov> References: <7FE4376623W1846016-01@EMF_nv.doe.gov> Message-ID: Hi Marco - have you looked at these classes?: http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ImplicitModeller http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ImplicitPolyDataDistance http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ImplicitDataSetClipping In this python code, I was using the vtkImplicitPolyDataDistance object to find an isosurface that was a given distance away from the surface of a cone, and I then cut it to show a cross-section of the surface. I'm not sure what sort of offset surface you were looking to make, but this might do the trick for you: from vtk import * cone = vtkConeSource() cone.SetResolution(100) cone.Update() # You have to call update before the bounds of the object are valid. I am # increasing the bounds of the object by a fixed percentage in order to get a # volume that is larger than just the simple bounds of the object. bounds = list(1.2*s for s in cone.GetOutputDataObject(0).GetBounds()) # I also want the sample dimensions to be chosen such that the "voxels" will be # pretty much cubic. dx = bounds[1] - bounds[0] dy = bounds[3] - bounds[2] dz = bounds[5] - bounds[4] # I want to subdivide the minimum dimension into 20 parts, and the others # relative to this. s = min(dx, dy, dz) delta = s/20. # Given this minimum sample size, you can pick the correct number of x, y, and # z samples for the vtkSampleFunction. Nx, Ny, Nz = [int(s/delta) for s in (dx, dy, dz)] # This gives a field of minimum distances to the input vtkPolyData object. ipd = vtkImplicitPolyDataDistance() ipd.SetInput(cone.GetOutputDataObject(0)) sample = vtk.vtkSampleFunction() sample.SetSampleDimensions(Nx, Ny, Nz) sample.SetImplicitFunction(ipd) sample.SetModelBounds(*bounds) sample.Update() contour = vtk.vtkContourFilter() contour.SetInputConnection(sample.GetOutputPort()) contour.SetValue(0, 0.1) contour.Update() cutter_plane = vtk.vtkPlane() cutter_plane.SetOrigin(*cone.GetOutputDataObject(0).GetCenter()) cutter_plane.SetNormal(0., 0., 1.) cutter = vtk.vtkCutter() cutter.SetCutFunction(cutter_plane) cutter.SetInputConnection(contour.GetOutputPort()) cutter.Update() stripper = vtk.vtkStripper() stripper.SetInputConnection(cutter.GetOutputPort()) stripper.Update() mapper = vtk.vtkPolyDataMapper() # mapper.SetInputConnection(contour.GetOutputPort()) # mapper.SetInputConnection(cutter.GetOutputPort()) mapper.SetInputConnection(stripper.GetOutputPort()) mapper.ScalarVisibilityOff() cone_mapper = vtk.vtkPolyDataMapper() cone_mapper.SetInputConnection(cone.GetOutputPort()) actor = vtk.vtkActor() actor.SetMapper(mapper) # actor.GetProperty().SetColor(0.5, 0.2, 1.0) # actor.GetProperty().SetOpacity(0.2) cone_actor = vtk.vtkActor() cone_actor.SetMapper(cone_mapper) cone_actor.GetProperty().SetOpacity(0.5) ren = vtk.vtkRenderer() ren.AddActor(actor) ren.AddActor(cone_actor) ren.SetBackground(.2, .3, .4) renw = vtk.vtkRenderWindow() renw.AddRenderer(ren) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renw) ren.ResetCamera() renw.Render() iren.Start() On 8/25/14 12:41 AM, "Marco Salatin" wrote: >Hello vtk users, > there are some one who can help me to do a function >that can increase offset (shell) of edge of a object? > >Thanks > >Marco > > > >-- >View this message in context: >http://vtk.1045678.n5.nabble.com/Edge-size-tp5728359.html >Sent from the VTK - Users mailing list archive at Nabble.com. >_______________________________________________ >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 > >Follow this link to subscribe/unsubscribe: >http://public.kitware.com/mailman/listinfo/vtkusers > From MEEHANBT at nv.doe.gov Tue Aug 26 18:42:58 2014 From: MEEHANBT at nv.doe.gov (Meehan, Bernard) Date: Tue, 26 Aug 2014 22:42:58 +0000 Subject: [vtkusers] Color edge of actor. In-Reply-To: <7FEB030023W1728780-01@EMF_nv.doe.gov> References: <1408530990393-5728300.post@n5.nabble.com> <1408616369364-5728319.post@n5.nabble.com> <1408621193326-5728320.post@n5.nabble.com> <7FEB030023W1728780-01@EMF_nv.doe.gov> Message-ID: I'm using VTK 6.1.0, and I have that class available in Python ... Python 2.7.1 (r271:86832, Jul 31 2011, 19:30:53) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import vtk >>> s = vtk.vtkPolyDataSilhouette() >>> s (vtkPolyDataSilhouette)0x10a2468f0 From: Marco Salatin > Date: Thursday, August 21, 2014 4:48 AM To: VTK Mailing List > Subject: Re: [vtkusers] Color edge of actor. vtkPolyDataSilhouette missing in python-vtk 2014-08-21 13:39 GMT+02:00 Marco Salatin >: Yes, but how it works? Thanks Marco -- View this message in context: http://vtk.1045678.n5.nabble.com/Color-edge-of-actor-tp5728300p5728320.html Sent from the VTK - Users mailing list archive at Nabble.com. _______________________________________________ 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 Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -- --- www.salatin.eu -------------- next part -------------- An HTML attachment was scrubbed... URL: From franko at mixzon.com Tue Aug 26 18:55:51 2014 From: franko at mixzon.com (franko) Date: Tue, 26 Aug 2014 15:55:51 -0700 (PDT) Subject: [vtkusers] How to redistribute ActiViz/VTK dll's? Message-ID: <1409093751185-5728432.post@n5.nabble.com> We have a Windows .Net x86 project that has 2 executables in different directories. Due to the evolution of the project the executables can't be in the same directory. We would like to be able to install all the ActiViz/vtk dll's in one "bin" directory. The executables work fine as long as all the ActiViz/vtk dll's are included in the same directory as the executable. The executables fail when the dll's are not present in the same directory. Here are some things I tried: - Change the System Environment Variable "Path" to include the path to the directory with the dll's. The executables did not find the dll's. - regsvr32 Kitware.VTK.dll This reports the following error: The module "Kitware.VTK.dll" was loaded but the entry-point DllRegisterServer was not found. Make sure that "Kitware.VTK.dll" is a valid DLL or OCX file and then try again. Any suggestions? Thanks! -- View this message in context: http://vtk.1045678.n5.nabble.com/How-to-redistribute-ActiViz-VTK-dll-s-tp5728432.html Sent from the VTK - Users mailing list archive at Nabble.com. From andrew.amaclean at gmail.com Tue Aug 26 19:26:11 2014 From: andrew.amaclean at gmail.com (Andrew Maclean) Date: Wed, 27 Aug 2014 09:26:11 +1000 Subject: [vtkusers] Problem with "Compute Gaussian, Mean, Minm and Max Curvatures" example Message-ID: I was one of the original authors of this class. Some points to remember are: 1) Curvatures are calculated on a triangulated surface using the vertices of the triangles. 2) The ideal case would be a large number of small triangles across the surface. 3) If the surface is planar then the edges of the plane may have large values - especially at the corners so it is best to use a clip function after applying the filter. 4) If the surface is a deformed plane e.g. vtkParametricRandomHills then most of the gaussian curvatures will lie in the range -1 to 0.2 (say) with a few large values say 20 to 40 at the peaks of the hills. You may need to tailor your lookup table to account for this. Here is a beautiful example (in my opinion) I made using http://www.vtk.org/Wiki/VTK/Examples/Python/CurvaturesDemo and http://www.vtk.org/Wiki/VTK/Examples/Python/Visualization/ElevationBandsWithGlyphs It uses a torus and a banded polydata contour filter, I have also added normal glyphs to the surface. I will most likely add a C++ and Python example similar to this. Regards Andrew ---------- Forwarded message ---------- > From: Sky77 > To: vtkusers at vtk.org > Cc: > Date: Tue, 26 Aug 2014 07:35:48 -0700 (PDT) > Subject: Re: [vtkusers] Problem with "Compute Gaussian, Mean, Minm and Max > Curvatures" example > It seems that my version of VTK is to old. The header file > vtkBooleanOperationPolyDataFilter.h can't be found. For this purpose, i > have > try something else to get an object with negative Gaussian curvature. A > torus have positive Gaussian curvature on the outside and negative Gaussian > curvature on the inside. I have created one with blender and import it as > obj file. > > This ist the input file: torus.obj > > > Here you can > see my result. Also in this case no negative curvature is computed. > > Has someone of you experience with the curvature computation with vtk? I > mean has someone used this functionality with success? > > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > > int main(int argc, char *argv[]) > { > // Parse command line arguments > if(argc != 2) > { > std::cout << "Usage: " << argv[0] << " Filename(.obj)" << > std::endl; > return EXIT_FAILURE; > } > > std::string filename = argv[1]; > vtkSmartPointer reader = > vtkSmartPointer::New(); > reader->SetFileName(filename.c_str()); > reader->Update(); > > vtkSmartPointer curvaturesFilter = > vtkSmartPointer::New(); > curvaturesFilter->SetInputConnection(reader->GetOutputPort()); > curvaturesFilter->SetCurvatureTypeToGaussian(); > curvaturesFilter->Update(); > > // Get scalar range from command line if present, otherwise use > // range of computed curvature > double scalarRange[2]; > if (argc >= 4) > { > scalarRange[0] = atof(argv[2]); > scalarRange[1] = atof(argv[3]); > } > else > { > curvaturesFilter->GetOutput()->GetScalarRange(scalarRange); > } > > int scheme = 16; > if (argc >= 5) > { > scheme = atoi(argv[4]); > } > > // Build a lookup table > vtkSmartPointer colorSeries = > vtkSmartPointer::New(); > colorSeries->SetColorScheme(scheme); > > vtkSmartPointer lut = > vtkSmartPointer::New(); > lut->SetColorSpaceToHSV(); > > // Use a color series to create a transfer function > int numColors = colorSeries->GetNumberOfColors(); > for (int i = 0; i < numColors; i++) > { > vtkColor3ub color = colorSeries->GetColor(i); > double dColor[3]; > dColor[0] = static_cast (color[0]) / 255.0; > dColor[1] = static_cast (color[1]) / 255.0; > dColor[2] = static_cast (color[2]) / 255.0; > double t = scalarRange[0] + (scalarRange[1] - scalarRange[0]) / > (numColors - 1) * i; > lut->AddRGBPoint(t, dColor[0], dColor[1], dColor[2]); > } > > // Create a mapper and actor > vtkSmartPointer mapper = > vtkSmartPointer::New(); > mapper->SetInputConnection(curvaturesFilter->GetOutputPort()); > // mapper->SetLookupTable(lut); > mapper->SetScalarRange(scalarRange); > > vtkSmartPointer actor = vtkSmartPointer::New(); > actor->SetMapper(mapper); > > // Create a scalar bar > vtkSmartPointer scalarBar = > vtkSmartPointer::New(); > scalarBar->SetLookupTable(mapper->GetLookupTable()); > > > scalarBar->SetTitle(curvaturesFilter->GetOutput()->GetPointData()->GetScalars()->GetName()); > scalarBar->SetNumberOfLabels(5); > > // Create a renderer, render window, and interactor > vtkSmartPointer renderer = > vtkSmartPointer::New(); > vtkSmartPointer renderWindow = > vtkSmartPointer::New(); > renderWindow->AddRenderer(renderer); > vtkSmartPointer renderWindowInteractor = > vtkSmartPointer::New(); > renderWindowInteractor->SetRenderWindow(renderWindow); > > // Add the actors to the scene > renderer->AddActor(actor); > renderer->AddActor2D(scalarBar); > > renderer->SetBackground(.1, .2, .3); // Background color blue > > // Render and interact > renderWindow->Render(); > renderWindowInteractor->Start(); > > return EXIT_SUCCESS; > > } > -- > ___________________________________________ Andrew J. P. Maclean ___________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: CurvatureBandsWithGlyphs.zip Type: application/zip Size: 5384 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: CurvatureBandsWithGlyphs.png Type: image/png Size: 104633 bytes Desc: not available URL: From andrew.amaclean at gmail.com Tue Aug 26 19:37:47 2014 From: andrew.amaclean at gmail.com (Andrew Maclean) Date: Wed, 27 Aug 2014 09:37:47 +1000 Subject: [vtkusers] Problem with "Compute Gaussian, Mean, Minm and Max Curvatures" example Message-ID: Just to clarify, there is a picture and python code atttached to the previous message (reattached here). Andrew On Wed, Aug 27, 2014 at 9:26 AM, Andrew Maclean wrote: > I was one of the original authors of this class. > > Some points to remember are: > 1) Curvatures are calculated on a triangulated surface using the vertices > of the triangles. > 2) The ideal case would be a large number of small triangles across the > surface. > 3) If the surface is planar then the edges of the plane may have large > values - especially at the corners so it is best to use a clip function > after applying the filter. > 4) If the surface is a deformed plane e.g. vtkParametricRandomHills then > most of the gaussian curvatures will lie in the range -1 to 0.2 (say) with > a few large values say 20 to 40 at the peaks of the hills. You may need to > tailor your lookup table > to account for this. > > > Here is a beautiful example (in my opinion) I made using > http://www.vtk.org/Wiki/VTK/Examples/Python/CurvaturesDemo and > http://www.vtk.org/Wiki/VTK/Examples/Python/Visualization/ElevationBandsWithGlyphs > It uses a torus and a banded polydata contour filter, I have also added > normal glyphs to the surface. > > I will most likely add a C++ and Python example similar to this. > > > Regards > Andrew > > ---------- Forwarded message ---------- >> From: Sky77 >> To: vtkusers at vtk.org >> Cc: >> Date: Tue, 26 Aug 2014 07:35:48 -0700 (PDT) >> Subject: Re: [vtkusers] Problem with "Compute Gaussian, Mean, Minm and >> Max Curvatures" example >> It seems that my version of VTK is to old. The header file >> vtkBooleanOperationPolyDataFilter.h can't be found. For this purpose, i >> have >> try something else to get an object with negative Gaussian curvature. A >> torus have positive Gaussian curvature on the outside and negative >> Gaussian >> curvature on the inside. I have created one with blender and import it as >> obj file. >> >> This ist the input file: torus.obj >> >> >> Here you >> can >> see my result. Also in this case no negative curvature is computed. >> >> Has someone of you experience with the curvature computation with vtk? I >> mean has someone used this functionality with success? >> >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> >> int main(int argc, char *argv[]) >> { >> // Parse command line arguments >> if(argc != 2) >> { >> std::cout << "Usage: " << argv[0] << " Filename(.obj)" << >> std::endl; >> return EXIT_FAILURE; >> } >> >> std::string filename = argv[1]; >> vtkSmartPointer reader = >> vtkSmartPointer::New(); >> reader->SetFileName(filename.c_str()); >> reader->Update(); >> >> vtkSmartPointer curvaturesFilter = >> vtkSmartPointer::New(); >> curvaturesFilter->SetInputConnection(reader->GetOutputPort()); >> curvaturesFilter->SetCurvatureTypeToGaussian(); >> curvaturesFilter->Update(); >> >> // Get scalar range from command line if present, otherwise use >> // range of computed curvature >> double scalarRange[2]; >> if (argc >= 4) >> { >> scalarRange[0] = atof(argv[2]); >> scalarRange[1] = atof(argv[3]); >> } >> else >> { >> curvaturesFilter->GetOutput()->GetScalarRange(scalarRange); >> } >> >> int scheme = 16; >> if (argc >= 5) >> { >> scheme = atoi(argv[4]); >> } >> >> // Build a lookup table >> vtkSmartPointer colorSeries = >> vtkSmartPointer::New(); >> colorSeries->SetColorScheme(scheme); >> >> vtkSmartPointer lut = >> vtkSmartPointer::New(); >> lut->SetColorSpaceToHSV(); >> >> // Use a color series to create a transfer function >> int numColors = colorSeries->GetNumberOfColors(); >> for (int i = 0; i < numColors; i++) >> { >> vtkColor3ub color = colorSeries->GetColor(i); >> double dColor[3]; >> dColor[0] = static_cast (color[0]) / 255.0; >> dColor[1] = static_cast (color[1]) / 255.0; >> dColor[2] = static_cast (color[2]) / 255.0; >> double t = scalarRange[0] + (scalarRange[1] - scalarRange[0]) / >> (numColors - 1) * i; >> lut->AddRGBPoint(t, dColor[0], dColor[1], dColor[2]); >> } >> >> // Create a mapper and actor >> vtkSmartPointer mapper = >> vtkSmartPointer::New(); >> mapper->SetInputConnection(curvaturesFilter->GetOutputPort()); >> // mapper->SetLookupTable(lut); >> mapper->SetScalarRange(scalarRange); >> >> vtkSmartPointer actor = vtkSmartPointer::New(); >> actor->SetMapper(mapper); >> >> // Create a scalar bar >> vtkSmartPointer scalarBar = >> vtkSmartPointer::New(); >> scalarBar->SetLookupTable(mapper->GetLookupTable()); >> >> >> scalarBar->SetTitle(curvaturesFilter->GetOutput()->GetPointData()->GetScalars()->GetName()); >> scalarBar->SetNumberOfLabels(5); >> >> // Create a renderer, render window, and interactor >> vtkSmartPointer renderer = >> vtkSmartPointer::New(); >> vtkSmartPointer renderWindow = >> vtkSmartPointer::New(); >> renderWindow->AddRenderer(renderer); >> vtkSmartPointer renderWindowInteractor = >> vtkSmartPointer::New(); >> renderWindowInteractor->SetRenderWindow(renderWindow); >> >> // Add the actors to the scene >> renderer->AddActor(actor); >> renderer->AddActor2D(scalarBar); >> >> renderer->SetBackground(.1, .2, .3); // Background color blue >> >> // Render and interact >> renderWindow->Render(); >> renderWindowInteractor->Start(); >> >> return EXIT_SUCCESS; >> >> } >> -- >> > ___________________________________________ > Andrew J. P. Maclean > > ___________________________________________ > -- ___________________________________________ Andrew J. P. Maclean ___________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: CurvatureBandsWithGlyphs.png Type: image/png Size: 104633 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: CurvatureBandsWithGlyphs.zip Type: application/zip Size: 5384 bytes Desc: not available URL: From andrew.amaclean at gmail.com Tue Aug 26 19:53:41 2014 From: andrew.amaclean at gmail.com (Andrew Maclean) Date: Wed, 27 Aug 2014 09:53:41 +1000 Subject: [vtkusers] Problem with "Compute Gaussian, Mean, Minm and Max Curvatures" example Message-ID: The is an artefact where the tube forming the surface is joined. The torus is formed by taking a plane wrapping it into a cylinder and then joining the ends of the cylinder. So there can be discontinuities where the edges of the plane butt together. You could experiment with changing the parameters in vtkParametricFunction and/or vtkParametricFunctionSource (change resolution here). Rgeards Andrew > ---------- Forwarded message ---------- > From: Sky77 > To: vtkusers at vtk.org > Cc: > Date: Tue, 26 Aug 2014 14:53:57 -0700 (PDT) > Subject: Re: [vtkusers] Problem with "Compute Gaussian, Mean, Minm and Max > Curvatures" example > Hey Bill. > > With your provided code i get the expected result. Thank you! > > I still get an artefact, which you can see in the following image: > > > (I created this image with Bill's provided code) > > Does someone knows how i can avoid it? > > @ Jott: Thank you for your help. > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Problem-with-Compute-Gaussian-Mean-Minm-and-Max-Curvatures-example-tp5728377p5728428.html > Sent from the VTK - Users mailing list archive at Nabble.com. > > > -- > ___________________________________________ Andrew J. P. Maclean ___________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From berk.geveci at kitware.com Tue Aug 26 20:32:10 2014 From: berk.geveci at kitware.com (Berk Geveci) Date: Tue, 26 Aug 2014 20:32:10 -0400 Subject: [vtkusers] Depth Peeling w/ Nvidia Quadro 2000 In-Reply-To: <4d478f080fc34f8bb98785eac467c7aa@BN1PR05MB263.namprd05.prod.outlook.com> References: <4d478f080fc34f8bb98785eac467c7aa@BN1PR05MB263.namprd05.prod.outlook.com> Message-ID: Rather than trying to figure it out, I'd recommend trying out the new render code in VTK. It has a brand spanking new depth peeling implementation. See http://www.kitware.com/source/home/post/144 -berk On Tue, Aug 26, 2014 at 5:59 PM, Windes, Grant < Grant.Windes at smith-nephew.com> wrote: > Looking to implement a proper depth sort for semi-transparent objects. > My research has shown that the vtkDepthSortPolyData is not sufficient as it > is CPU bound. > > > > I?ve enabled depth peeling and it?s worked great using Core i7 4770K > (4600HD Integrated Graphics). However, it was slower than we liked and thus > I tested an Nvidia Quadro 3000M and Quadro 2000. Both don?t properly enable > depth peeling as confirmed with a GetRenderLastUsedDepthPeeling() call. > > > > Note: Using pyVTK (vtk 5.10.1) on Windows 7 64bit with latest gpu Quadro > drivers (9.18.13.4062) > > > > In my small test application I can get DepthPeeling to render properly on > the Quadro 2000 by setting > > > > renderWindow.SetAlphaBitPlanes(1) > > renderWindow.SetMultiSamples(0) > > renderer.SetUseDepthPeeling(1) > > > > However, If I remove SetAlphaBitPlanes() and SetMultiSamples() depth > peeling doesn?t work properly and is not enabled. > > > > Any indication as to why depth peeling works fine on the Core i7 > integrated graphics compared to a true GPU? > > > > Thanks, > > Grant > > > > > > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hongsongyang at 163.com Wed Aug 27 00:10:59 2014 From: hongsongyang at 163.com (hongsongyang) Date: Wed, 27 Aug 2014 12:10:59 +0800 Subject: [vtkusers] The differences about VTKData and VTK LargeData between VTK 5.10 and VTK 6.1 Message-ID: <006d01cfc1ac$e969e280$bc3da780$@163.com> Dear all VTK users: When we cmake the VTK 5.10 version, there are 2 selections about VTK_DATA_ROOT and VTK_LARGE_DATA_ROOT. Both of these 2 option need to set the data and large data folder path. However, when I cmake the vtk 6.1 version, there is no DATA_ROOT options, In contrast, there is only VTK_DATA_STORE, where I put the VTKData folder path into it. And I check the VTK_USE_LARGE_DATA option ON. My question is, How could I make my cmake known the path of my VTKLargeData Path, which I download according to GIT. VTKData source from : git clone git://vtk.org/VTKData.git VTKData VTKLargeData source from: git clone git://vtk.org/VTKLargeData.git Is there anyone who can answer my question? Thanks a lot. Hongsongyang -------------- next part -------------- An HTML attachment was scrubbed... URL: From sfaisal.ali91 at gmail.com Wed Aug 27 02:32:11 2014 From: sfaisal.ali91 at gmail.com (sfaisalali91) Date: Tue, 26 Aug 2014 23:32:11 -0700 (PDT) Subject: [vtkusers] Multiple renderes and interactor callback In-Reply-To: References: <1409048154305-5728393.post@n5.nabble.com> Message-ID: <1409121131703-5728440.post@n5.nabble.com> Hello David, Thanks for your reply. As you suggested i tried assigning separate cameras for the MPR and Volume view (One camera for the MPR slicing and another for Volume rendering). I succeeded in resetting the volume view but when i try rendering it, the volume renders outside the viewport. So i made use of getbounds() functionality and tried assigning the camera and related parameters (as you suggested) inside the respective Volume viewport bounds. Sadly i was not able to achieve the desired. As my viewer is based on MFC, it either crashes or hangs. Am i missing anything here? And as i am trying all the possible alternatives, lately i was working on the mouse events and i was trying to get a solution for it. I am making use of MouseMoveEvent in my call back and accordingly setting the camera of the Volumetric viewport, so based on this i tried implementing Rotate() functionality if ( pokedRenderer == ImageRenderer) { ImageIren->Rotate(); iren->Render(); } The volume and MPR slices render simultaneously as expected. But when i try the same with LeftButtonPressEvent (as shown in the snippet below) it fails and there is no interaction with the volume. please can you guide me. Thank you. if ( pokedRenderer == ImageRenderer) { if (event == vtkCommand::LeftButtonPressEvent) { iren->SetInteractorStyle(ImageIren); ImageRenderer->ResetCamera(); ImageIren->Rotate(); iren->Render(); } } -- View this message in context: http://vtk.1045678.n5.nabble.com/Multiple-renderes-and-interactor-callback-tp5728393p5728440.html Sent from the VTK - Users mailing list archive at Nabble.com. From marcus.hanwell at kitware.com Wed Aug 27 04:00:39 2014 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Wed, 27 Aug 2014 04:00:39 -0400 Subject: [vtkusers] OpenGL2 In-Reply-To: <46CB11F12B9DC24D860D4082451B318A12C24897@exchange3.microbrightfield.com> References: <46CB11F12B9DC24D860D4082451B318A12C24897@exchange3.microbrightfield.com> Message-ID: Hi, You would need to offer me a little more detail on the errors seen, but the basic rendering is working with some optional rendering backends you may be using not yet ported. It would help to know what was being linked, especially modules ending in OpenGL. It is most certainly a work in progress, but it should be possible to use it in many applications. We are working on rounding out more features, and one of the next major milestones will be getting ParaView compiled/linked as it uses so much of the VTK rendering. Hope that helps, Marcus On Tue, Aug 26, 2014 at 3:36 PM, Doug Hoppes wrote: > Hi all, > > > > In our application, we?re working some extremely large image > stacks and saw that there was some work for the latest OpenGL drivers. When > we got the latest nightly build and tried to compile it by setting the > VTK_RENDERING_OPENGL to use OpenGL2, the software compiles. However, > there?s a number of missing dlls errors when we try to run it. Is the > OpenGL2 implementation finished? > > > > Doug > > > > > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > From joggingsong at gmail.com Wed Aug 27 04:03:22 2014 From: joggingsong at gmail.com (Jogging Song) Date: Wed, 27 Aug 2014 16:03:22 +0800 Subject: [vtkusers] The color of the triangle mesh is affected after I call SetScalars Message-ID: Hi, all I read one triangle mesh file from the disk. The mesh itself contains color information. I can render the mesh correctly. The color of rendered mesh is from the color information of the mesh. To use the scalars, I call the function SetScalars. The color of the rendered mesh is changed and now the color is from scalars. However I hope to use the color of the mesh. I can find the answer from the internet. Can anyone help me? Regards Jogging Song -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Wed Aug 27 08:04:35 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 27 Aug 2014 06:04:35 -0600 Subject: [vtkusers] Multiple renderes and interactor callback In-Reply-To: <1409121131703-5728440.post@n5.nabble.com> References: <1409048154305-5728393.post@n5.nabble.com> <1409121131703-5728440.post@n5.nabble.com> Message-ID: Hi Ali, Usually ResetCamera() is only called on the first render, it should not be called every time the user clicks the mouse. - David On Wed, Aug 27, 2014 at 12:32 AM, sfaisalali91 wrote: > Hello David, Thanks for your reply. > > As you suggested i tried assigning separate cameras for the MPR and Volume > view (One camera for the MPR slicing and another for Volume rendering). I > succeeded in resetting the volume view but when i try rendering it, the > volume renders outside the viewport. So i made use of getbounds() > functionality and tried assigning the camera and related parameters (as you > suggested) inside the respective Volume viewport bounds. Sadly i was not > able to achieve the desired. As my viewer is based on MFC, it either crashes > or hangs. > Am i missing anything here? > > And as i am trying all the possible alternatives, lately i was working on > the mouse events and i was trying to get a solution for it. I am making use > of MouseMoveEvent in my call back and accordingly setting the camera of the > Volumetric viewport, so based on this i tried implementing Rotate() > functionality > > if ( pokedRenderer == ImageRenderer) > { > ImageIren->Rotate(); > iren->Render(); > > } > > The volume and MPR slices render simultaneously as expected. But when i try > the same with LeftButtonPressEvent (as shown in the snippet below) it fails > and there is no interaction with the volume. please can you guide me. Thank > you. > > if ( pokedRenderer == ImageRenderer) > { > if (event == vtkCommand::LeftButtonPressEvent) > { > iren->SetInteractorStyle(ImageIren); > ImageRenderer->ResetCamera(); > ImageIren->Rotate(); > iren->Render(); > } > > } > > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/Multiple-renderes-and-interactor-callback-tp5728393p5728440.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers From dlrdave at aol.com Wed Aug 27 08:01:25 2014 From: dlrdave at aol.com (David Cole) Date: Wed, 27 Aug 2014 08:01:25 -0400 (EDT) Subject: [vtkusers] How to redistribute ActiViz/VTK dll's? In-Reply-To: <1409093751185-5728432.post@n5.nabble.com> References: <1409093751185-5728432.post@n5.nabble.com> Message-ID: <8D19005C299FF5B-9F4-33727@webmail-vm086.sysops.aol.com> Could you make one of your executables just a forwarding stub executable that delegates its entire run to an executable in another directory...? It's easy enough to create sub-processes in a .NET app... Otherwise, I'm afraid you may have to duplicate the ActiViz/VTK dlls or get into building a custom ActiViz that can handle being loaded from PATH (not sure how easy that would be...). HTH, David C. From cory.quammen at kitware.com Wed Aug 27 08:57:44 2014 From: cory.quammen at kitware.com (Cory Quammen) Date: Wed, 27 Aug 2014 08:57:44 -0400 Subject: [vtkusers] The differences about VTKData and VTK LargeData between VTK 5.10 and VTK 6.1 In-Reply-To: <006d01cfc1ac$e969e280$bc3da780$@163.com> References: <006d01cfc1ac$e969e280$bc3da780$@163.com> Message-ID: Hi Hongsongyang, In VTK 6.1, you do not have to clone external repositories to get the testing data anymore. It will be downloaded automatically the first time you build VTK. The VTK_DATA_STORE path is where these files will be saved. See http://www.vtk.org/Wiki/VTK/Git/Develop/Data#Building for more details. Note that you can point several VTK builds to the same data directory so that you don't have to a). use up additional disk space and b). spend time download the data again. Hope that helps, Cory On Wed, Aug 27, 2014 at 12:10 AM, hongsongyang wrote: > Dear all VTK users: > > When we cmake the VTK 5.10 version, there are 2 selections about > > VTK_DATA_ROOT and VTK_LARGE_DATA_ROOT. Both of these 2 option need to > > set the data and large data folder path. > > > > However, when I cmake the vtk 6.1 version, there is no DATA_ROOT options, > > In contrast, there is only VTK_DATA_STORE, where I put the VTKData folder > path into it. > > And I check the VTK_USE_LARGE_DATA option ON. > > My question is, How could I make my cmake known the path of my VTKLargeData > > Path, which I download according to GIT. > > > > VTKData source from : git clone git://vtk.org/VTKData.git VTKData > > VTKLargeData source from: git clone git://vtk.org/VTKLargeData.git > > > > Is there anyone who can answer my question? > > > > Thanks a lot. > > > > Hongsongyang > > > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > From cory.quammen at kitware.com Wed Aug 27 09:01:41 2014 From: cory.quammen at kitware.com (Cory Quammen) Date: Wed, 27 Aug 2014 09:01:41 -0400 Subject: [vtkusers] The color of the triangle mesh is affected after I call SetScalars In-Reply-To: References: Message-ID: Jogging, Without seeing any code, it's tough to tell you where to make the change. I'll assume you have a vtkMapper (or subclass) somewhere in your code, and I'll assume C++. To disable coloring by the scalar value, call mapper->ScalarVisibilityOff(); I hope that helps, Cory On Wed, Aug 27, 2014 at 4:03 AM, Jogging Song wrote: > Hi, all > > I read one triangle mesh file from the disk. The mesh itself contains color > information. I can render the mesh correctly. The color of rendered mesh is > from the color information of the mesh. To use the scalars, I call the > function SetScalars. The color of the rendered mesh is changed and now the > color is from scalars. However I hope to use the color of the mesh. I can > find the answer from the internet. Can anyone help me? > > Regards > Jogging Song > > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > From friebel at izbi.uni-leipzig.de Wed Aug 27 09:28:58 2014 From: friebel at izbi.uni-leipzig.de (Adrian Friebel) Date: Wed, 27 Aug 2014 15:28:58 +0200 Subject: [vtkusers] Potential bug in graph pedigreeId handling / AbstractArray::LookupValue Message-ID: <53FDDD1A.7090705@izbi.uni-leipzig.de> Hey, so far I compiled my software against vtk 5.8. Recently I tried to compile it against 5.10.1 and noticed unexpected behaviour while adding vertices to a graph while passing pedigree ids. Below a minimal example and its output: #include #include #include #include #include #include int main(int argc, char **argv) { vtkSmartPointer graph = vtkSmartPointer::New(); vtkSmartPointer pedigreeIds = vtkSmartPointer::New(); pedigreeIds->Initialize(); pedigreeIds->SetName("Pedigree IDs"); graph->GetVertexData()->SetPedigreeIds(pedigreeIds); for(unsigned int i=0; i<10; ++i) { vtkIdType v = graph->AddVertex(i*100); std::cout << "i = " << i << ": v = " << v << ", graph->GetVertex[..]->GetVariantValue( " << v << ") = " << graph->GetVertexData()->GetPedigreeIds()->GetVariantValue(v) << ", graph->FindVertex(" << i << "*100) = " << graph->FindVertex(i*100) << std::endl; } return 0; } VTK-5.8: i = 0: v = 0, graph->GetVertex[..]->GetVariantValue( 0) = 0, graph->FindVertex(0*100) = 0 i = 1: v = 1, graph->GetVertex[..]->GetVariantValue( 1) = 100, graph->FindVertex(1*100) = 1 i = 2: v = 2, graph->GetVertex[..]->GetVariantValue( 2) = 200, graph->FindVertex(2*100) = 2 i = 3: v = 3, graph->GetVertex[..]->GetVariantValue( 3) = 300, graph->FindVertex(3*100) = 3 i = 4: v = 4, graph->GetVertex[..]->GetVariantValue( 4) = 400, graph->FindVertex(4*100) = 4 i = 5: v = 5, graph->GetVertex[..]->GetVariantValue( 5) = 500, graph->FindVertex(5*100) = 5 i = 6: v = 6, graph->GetVertex[..]->GetVariantValue( 6) = 600, graph->FindVertex(6*100) = 6 i = 7: v = 7, graph->GetVertex[..]->GetVariantValue( 7) = 700, graph->FindVertex(7*100) = 7 i = 8: v = 8, graph->GetVertex[..]->GetVariantValue( 8) = 800, graph->FindVertex(8*100) = 8 i = 9: v = 9, graph->GetVertex[..]->GetVariantValue( 9) = 900, graph->FindVertex(9*100) = 9 VTK-5.10.1: i = 0: v = 0, graph->GetVertex[..]->GetVariantValue( 0) = 0, graph->FindVertex(0*100) = 0 i = 1: v = 1, graph->GetVertex[..]->GetVariantValue( 1) = 100, graph->FindVertex(1*100) = 1 i = 2: v = 2, graph->GetVertex[..]->GetVariantValue( 2) = 200, graph->FindVertex(2*100) = -1 i = 3: v = 3, graph->GetVertex[..]->GetVariantValue( 3) = 300, graph->FindVertex(3*100) = 3 i = 4: v = 4, graph->GetVertex[..]->GetVariantValue( 4) = 400, graph->FindVertex(4*100) = -1 i = 5: v = 5, graph->GetVertex[..]->GetVariantValue( 5) = 500, graph->FindVertex(5*100) = -1 i = 6: v = 6, graph->GetVertex[..]->GetVariantValue( 6) = 600, graph->FindVertex(6*100) = -1 i = 7: v = 7, graph->GetVertex[..]->GetVariantValue( 7) = 700, graph->FindVertex(7*100) = 7 i = 8: v = 8, graph->GetVertex[..]->GetVariantValue( 8) = 800, graph->FindVertex(8*100) = -1 i = 9: v = 9, graph->GetVertex[..]->GetVariantValue( 9) = 900, graph->FindVertex(9*100) = -1 It seems that there is something wrong with the AbstractArray::LookupValue in 5.10.1, since the array entries value->pedId are made. I am aware that 6.1 was released some time ago. Maybe the issue was solved already, but since I couldn't find any reports on this I thought I might inform you guys. Or am I just missing some newly introduced update call? Best, Adrian. -- Dipl.-Inform. Adrian Friebel Research Group for Multicellular Systems Biology Interdisciplinary Centre for BioInformatics University of Leipzig Haertelstrasse 16-18 04107 Leipzig Germany Tel.: +49 341 97-16627 email: adrian.friebel at uni-leipzig.de From hongsongyang at 163.com Wed Aug 27 11:25:45 2014 From: hongsongyang at 163.com (hongsongyang) Date: Wed, 27 Aug 2014 23:25:45 +0800 Subject: [vtkusers] =?utf-8?b?562U5aSNOiAgVGhlIGRpZmZlcmVuY2VzIGFib3V0IFZU?= =?utf-8?q?KData_and_VTK_LargeData_between_VTK_5=2E10_and_VTK_6=2E1?= In-Reply-To: References: <006d01cfc1ac$e969e280$bc3da780$@163.com> Message-ID: <000001cfc20b$2ccb3f20$8661bd60$@163.com> Hi Cory, Thank you for your reply. I also use the same VTKData folder for different VTK version. But I means that since the VTK version 6 ,the data structure seems changed. Do you know what should I do to deal with the VTKLargeData? Thank you very much Best regards, Hongsongyang -----????----- ???: Cory Quammen [mailto:cory.quammen at kitware.com] ????: 2014?8?27? 20:58 ???: hongsongyang ??: vtkusers at vtk.org ??: Re: [vtkusers] The differences about VTKData and VTK LargeData between VTK 5.10 and VTK 6.1 Hi Hongsongyang, In VTK 6.1, you do not have to clone external repositories to get the testing data anymore. It will be downloaded automatically the first time you build VTK. The VTK_DATA_STORE path is where these files will be saved. See http://www.vtk.org/Wiki/VTK/Git/Develop/Data#Building for more details. Note that you can point several VTK builds to the same data directory so that you don't have to a). use up additional disk space and b). spend time download the data again. Hope that helps, Cory On Wed, Aug 27, 2014 at 12:10 AM, hongsongyang wrote: > Dear all VTK users: > > When we cmake the VTK 5.10 version, there are 2 selections about > > VTK_DATA_ROOT and VTK_LARGE_DATA_ROOT. Both of these 2 option need to > > set the data and large data folder path. > > > > However, when I cmake the vtk 6.1 version, there is no DATA_ROOT > options, > > In contrast, there is only VTK_DATA_STORE, where I put the VTKData > folder path into it. > > And I check the VTK_USE_LARGE_DATA option ON. > > My question is, How could I make my cmake known the path of my > VTKLargeData > > Path, which I download according to GIT. > > > > VTKData source from : git clone git://vtk.org/VTKData.git VTKData > > VTKLargeData source from: git clone git://vtk.org/VTKLargeData.git > > > > Is there anyone who can answer my question? > > > > Thanks a lot. > > > > Hongsongyang > > > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > From cory.quammen at kitware.com Wed Aug 27 11:40:33 2014 From: cory.quammen at kitware.com (Cory Quammen) Date: Wed, 27 Aug 2014 11:40:33 -0400 Subject: [vtkusers] =?utf-8?b?562U5aSNOiAgVGhlIGRpZmZlcmVuY2VzIGFib3V0IFZU?= =?utf-8?q?KData_and_VTK_LargeData_between_VTK_5=2E10_and_VTK_6=2E1?= In-Reply-To: <000001cfc20b$2ccb3f20$8661bd60$@163.com> References: <006d01cfc1ac$e969e280$bc3da780$@163.com> <000001cfc20b$2ccb3f20$8661bd60$@163.com> Message-ID: Hongsongyang, Someone should correct me if I'm wrong, but I think all you need to do to get the equivalent of VTKLargeData is to set the VTK_USE_LARGE_DATA option to ON in CMake. This will enable the large data tests and will cause the large data files to be downloaded during the build. Thanks, Cory On Wed, Aug 27, 2014 at 11:25 AM, hongsongyang wrote: > Hi Cory, > Thank you for your reply. > I also use the same VTKData folder for different VTK version. > But I means that since the VTK version 6 ,the data structure seems changed. > Do you know what should I do to deal with the VTKLargeData? > > Thank you very much > > Best regards, > Hongsongyang > > > -----????----- > ???: Cory Quammen [mailto:cory.quammen at kitware.com] > ????: 2014?8?27? 20:58 > ???: hongsongyang > ??: vtkusers at vtk.org > ??: Re: [vtkusers] The differences about VTKData and VTK LargeData between VTK 5.10 and VTK 6.1 > > Hi Hongsongyang, > > In VTK 6.1, you do not have to clone external repositories to get the testing data anymore. It will be downloaded automatically the first time you build VTK. The VTK_DATA_STORE path is where these files will be saved. See http://www.vtk.org/Wiki/VTK/Git/Develop/Data#Building > for more details. > > Note that you can point several VTK builds to the same data directory so that you don't have to a). use up additional disk space and b). > spend time download the data again. > > Hope that helps, > Cory > > On Wed, Aug 27, 2014 at 12:10 AM, hongsongyang wrote: >> Dear all VTK users: >> >> When we cmake the VTK 5.10 version, there are 2 selections about >> >> VTK_DATA_ROOT and VTK_LARGE_DATA_ROOT. Both of these 2 option need to >> >> set the data and large data folder path. >> >> >> >> However, when I cmake the vtk 6.1 version, there is no DATA_ROOT >> options, >> >> In contrast, there is only VTK_DATA_STORE, where I put the VTKData >> folder path into it. >> >> And I check the VTK_USE_LARGE_DATA option ON. >> >> My question is, How could I make my cmake known the path of my >> VTKLargeData >> >> Path, which I download according to GIT. >> >> >> >> VTKData source from : git clone git://vtk.org/VTKData.git VTKData >> >> VTKLargeData source from: git clone git://vtk.org/VTKLargeData.git >> >> >> >> Is there anyone who can answer my question? >> >> >> >> Thanks a lot. >> >> >> >> Hongsongyang >> >> >> _______________________________________________ >> 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 >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> > > From marco.salatin at gmail.com Wed Aug 27 16:45:37 2014 From: marco.salatin at gmail.com (Marco Salatin) Date: Wed, 27 Aug 2014 22:45:37 +0200 Subject: [vtkusers] Edge size. In-Reply-To: <20140826222511.3042475613@public.kitware.com> References: <7FE4376623W1846016-01@EMF_nv.doe.gov> <20140826222511.3042475613@public.kitware.com> Message-ID: WOW, thanks, nice! i use Actor.GetProperty().SetLineWidth(1) but if i set it to 20 instead 1, it will make a goo Edge. 2014-08-27 0:25 GMT+02:00 Meehan, Bernard : > Hi Marco - have you looked at these classes?: > > http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ImplicitModeller > http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ImplicitPolyDataDistance > http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ImplicitDataSetClipping > > In this python code, I was using the vtkImplicitPolyDataDistance object to > find an isosurface that was a given distance away from the surface of a > cone, and I then cut it to show a cross-section of the surface. I'm not > sure what sort of offset surface you were looking to make, but this might > do the trick for you: > > from vtk import * > > cone = vtkConeSource() > cone.SetResolution(100) > cone.Update() > # You have to call update before the bounds of the object are valid. I am > # increasing the bounds of the object by a fixed percentage in order to > get a > # volume that is larger than just the simple bounds of the object. > bounds = list(1.2*s for s in cone.GetOutputDataObject(0).GetBounds()) > > # I also want the sample dimensions to be chosen such that the "voxels" > will be > # pretty much cubic. > dx = bounds[1] - bounds[0] > dy = bounds[3] - bounds[2] > dz = bounds[5] - bounds[4] > > # I want to subdivide the minimum dimension into 20 parts, and the others > # relative to this. > s = min(dx, dy, dz) > delta = s/20. > > # Given this minimum sample size, you can pick the correct number of x, y, > and > # z samples for the vtkSampleFunction. > Nx, Ny, Nz = [int(s/delta) for s in (dx, dy, dz)] > > # This gives a field of minimum distances to the input vtkPolyData object. > ipd = vtkImplicitPolyDataDistance() > ipd.SetInput(cone.GetOutputDataObject(0)) > > sample = vtk.vtkSampleFunction() > sample.SetSampleDimensions(Nx, Ny, Nz) > sample.SetImplicitFunction(ipd) > sample.SetModelBounds(*bounds) > sample.Update() > > contour = vtk.vtkContourFilter() > contour.SetInputConnection(sample.GetOutputPort()) > contour.SetValue(0, 0.1) > contour.Update() > > cutter_plane = vtk.vtkPlane() > cutter_plane.SetOrigin(*cone.GetOutputDataObject(0).GetCenter()) > cutter_plane.SetNormal(0., 0., 1.) > > cutter = vtk.vtkCutter() > cutter.SetCutFunction(cutter_plane) > cutter.SetInputConnection(contour.GetOutputPort()) > cutter.Update() > > stripper = vtk.vtkStripper() > stripper.SetInputConnection(cutter.GetOutputPort()) > stripper.Update() > > mapper = vtk.vtkPolyDataMapper() > # mapper.SetInputConnection(contour.GetOutputPort()) > # mapper.SetInputConnection(cutter.GetOutputPort()) > mapper.SetInputConnection(stripper.GetOutputPort()) > mapper.ScalarVisibilityOff() > > cone_mapper = vtk.vtkPolyDataMapper() > cone_mapper.SetInputConnection(cone.GetOutputPort()) > > actor = vtk.vtkActor() > actor.SetMapper(mapper) > # actor.GetProperty().SetColor(0.5, 0.2, 1.0) > # actor.GetProperty().SetOpacity(0.2) > > cone_actor = vtk.vtkActor() > cone_actor.SetMapper(cone_mapper) > cone_actor.GetProperty().SetOpacity(0.5) > > ren = vtk.vtkRenderer() > ren.AddActor(actor) > ren.AddActor(cone_actor) > ren.SetBackground(.2, .3, .4) > > renw = vtk.vtkRenderWindow() > renw.AddRenderer(ren) > > iren = vtk.vtkRenderWindowInteractor() > iren.SetRenderWindow(renw) > > ren.ResetCamera() > renw.Render() > iren.Start() > > > > > > On 8/25/14 12:41 AM, "Marco Salatin" wrote: > > >Hello vtk users, > > there are some one who can help me to do a function > >that can increase offset (shell) of edge of a object? > > > >Thanks > > > >Marco > > > > > > > >-- > >View this message in context: > >http://vtk.1045678.n5.nabble.com/Edge-size-tp5728359.html > >Sent from the VTK - Users mailing list archive at Nabble.com. > >_______________________________________________ > >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 > > > >Follow this link to subscribe/unsubscribe: > >http://public.kitware.com/mailman/listinfo/vtkusers > > > > > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- --- www.salatin.eu -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeff.baumes at kitware.com Wed Aug 27 17:30:14 2014 From: jeff.baumes at kitware.com (Jeff Baumes) Date: Wed, 27 Aug 2014 17:30:14 -0400 Subject: [vtkusers] Potential bug in graph pedigreeId handling / AbstractArray::LookupValue In-Reply-To: <53FDDD1A.7090705@izbi.uni-leipzig.de> References: <53FDDD1A.7090705@izbi.uni-leipzig.de> Message-ID: It is unclear what changed exactly, but the current behavior is that for numeric arrays, setting data with SetValue() (which is what AddVertex ultimately does to the pedigree ID array), does not in fact invoke DataChanged() on the array which would signal the lookup to rebuild on the next LookupValue() call (which is what FindVertex() performs). This was done for performance reasons, and perhaps this change was made between 5.8 and 5.10. If you call pedigreeIds->DataChanged() just before the call to FindVertex(), the issue should be resolved. On Wed, Aug 27, 2014 at 9:28 AM, Adrian Friebel wrote: > Hey, > so far I compiled my software against vtk 5.8. Recently I tried to compile > it against 5.10.1 and noticed unexpected behaviour while adding vertices to > a graph while passing pedigree ids. > Below a minimal example and its output: > > #include > #include > > #include > #include > #include > #include > > int main(int argc, char **argv) > { > vtkSmartPointer graph = vtkSmartPointer< > vtkMutableUndirectedGraph>::New(); > > vtkSmartPointer pedigreeIds = vtkSmartPointer< > vtkUnsignedLongArray>::New(); > pedigreeIds->Initialize(); > pedigreeIds->SetName("Pedigree IDs"); > > graph->GetVertexData()->SetPedigreeIds(pedigreeIds); > > for(unsigned int i=0; i<10; ++i) { > vtkIdType v = graph->AddVertex(i*100); > std::cout << "i = " << i << ": v = " << v << > ", graph->GetVertex[..]->GetVariantValue( " << v << ") = > " << graph->GetVertexData()->GetPedigreeIds()->GetVariantValue(v) << > ", graph->FindVertex(" << i << "*100) = " << > graph->FindVertex(i*100) << std::endl; > } > return 0; > } > > VTK-5.8: > i = 0: v = 0, graph->GetVertex[..]->GetVariantValue( 0) = 0, > graph->FindVertex(0*100) = 0 > i = 1: v = 1, graph->GetVertex[..]->GetVariantValue( 1) = 100, > graph->FindVertex(1*100) = 1 > i = 2: v = 2, graph->GetVertex[..]->GetVariantValue( 2) = 200, > graph->FindVertex(2*100) = 2 > i = 3: v = 3, graph->GetVertex[..]->GetVariantValue( 3) = 300, > graph->FindVertex(3*100) = 3 > i = 4: v = 4, graph->GetVertex[..]->GetVariantValue( 4) = 400, > graph->FindVertex(4*100) = 4 > i = 5: v = 5, graph->GetVertex[..]->GetVariantValue( 5) = 500, > graph->FindVertex(5*100) = 5 > i = 6: v = 6, graph->GetVertex[..]->GetVariantValue( 6) = 600, > graph->FindVertex(6*100) = 6 > i = 7: v = 7, graph->GetVertex[..]->GetVariantValue( 7) = 700, > graph->FindVertex(7*100) = 7 > i = 8: v = 8, graph->GetVertex[..]->GetVariantValue( 8) = 800, > graph->FindVertex(8*100) = 8 > i = 9: v = 9, graph->GetVertex[..]->GetVariantValue( 9) = 900, > graph->FindVertex(9*100) = 9 > > VTK-5.10.1: > i = 0: v = 0, graph->GetVertex[..]->GetVariantValue( 0) = 0, > graph->FindVertex(0*100) = 0 > i = 1: v = 1, graph->GetVertex[..]->GetVariantValue( 1) = 100, > graph->FindVertex(1*100) = 1 > i = 2: v = 2, graph->GetVertex[..]->GetVariantValue( 2) = 200, > graph->FindVertex(2*100) = -1 > i = 3: v = 3, graph->GetVertex[..]->GetVariantValue( 3) = 300, > graph->FindVertex(3*100) = 3 > i = 4: v = 4, graph->GetVertex[..]->GetVariantValue( 4) = 400, > graph->FindVertex(4*100) = -1 > i = 5: v = 5, graph->GetVertex[..]->GetVariantValue( 5) = 500, > graph->FindVertex(5*100) = -1 > i = 6: v = 6, graph->GetVertex[..]->GetVariantValue( 6) = 600, > graph->FindVertex(6*100) = -1 > i = 7: v = 7, graph->GetVertex[..]->GetVariantValue( 7) = 700, > graph->FindVertex(7*100) = 7 > i = 8: v = 8, graph->GetVertex[..]->GetVariantValue( 8) = 800, > graph->FindVertex(8*100) = -1 > i = 9: v = 9, graph->GetVertex[..]->GetVariantValue( 9) = 900, > graph->FindVertex(9*100) = -1 > > > It seems that there is something wrong with the AbstractArray::LookupValue > in 5.10.1, since the array entries value->pedId are made. > I am aware that 6.1 was released some time ago. Maybe the issue was solved > already, but since I couldn't find any reports on this I thought I might > inform you guys. > Or am I just missing some newly introduced update call? > > Best, > Adrian. > > -- > Dipl.-Inform. Adrian Friebel > Research Group for Multicellular Systems Biology > Interdisciplinary Centre for BioInformatics > University of Leipzig > Haertelstrasse 16-18 > 04107 Leipzig > Germany > Tel.: +49 341 97-16627 > email: adrian.friebel at uni-leipzig.de > > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From berk.geveci at kitware.com Wed Aug 27 20:19:35 2014 From: berk.geveci at kitware.com (Berk Geveci) Date: Wed, 27 Aug 2014 20:19:35 -0400 Subject: [vtkusers] Potential bug in graph pedigreeId handling / AbstractArray::LookupValue In-Reply-To: References: <53FDDD1A.7090705@izbi.uni-leipzig.de> Message-ID: Ah interesting. Note that I plan to remove DataChanged() in the future. It is a serious performance bottleneck when multiple threads are setting different parts of an array because it causes all threads to write to the same memory location where that flag is stored. The right way of doing this is to call Modified() after doing a set of changes to notify whatever may depend on an array. Best, -berk On Wed, Aug 27, 2014 at 5:30 PM, Jeff Baumes wrote: > It is unclear what changed exactly, but the current behavior is that for > numeric arrays, setting data with SetValue() (which is what AddVertex > ultimately does to the pedigree ID array), does not in fact invoke > DataChanged() on the array which would signal the lookup to rebuild on the > next LookupValue() call (which is what FindVertex() performs). This was > done for performance reasons, and perhaps this change was made between 5.8 > and 5.10. > > If you call pedigreeIds->DataChanged() just before the call to > FindVertex(), the issue should be resolved. > > > On Wed, Aug 27, 2014 at 9:28 AM, Adrian Friebel < > friebel at izbi.uni-leipzig.de> wrote: > >> Hey, >> so far I compiled my software against vtk 5.8. Recently I tried to >> compile it against 5.10.1 and noticed unexpected behaviour while adding >> vertices to a graph while passing pedigree ids. >> Below a minimal example and its output: >> >> #include >> #include >> >> #include >> #include >> #include >> #include >> >> int main(int argc, char **argv) >> { >> vtkSmartPointer graph = vtkSmartPointer< >> vtkMutableUndirectedGraph>::New(); >> >> vtkSmartPointer pedigreeIds = vtkSmartPointer< >> vtkUnsignedLongArray>::New(); >> pedigreeIds->Initialize(); >> pedigreeIds->SetName("Pedigree IDs"); >> >> graph->GetVertexData()->SetPedigreeIds(pedigreeIds); >> >> for(unsigned int i=0; i<10; ++i) { >> vtkIdType v = graph->AddVertex(i*100); >> std::cout << "i = " << i << ": v = " << v << >> ", graph->GetVertex[..]->GetVariantValue( " << v << ") = >> " << graph->GetVertexData()->GetPedigreeIds()->GetVariantValue(v) << >> ", graph->FindVertex(" << i << "*100) = " << >> graph->FindVertex(i*100) << std::endl; >> } >> return 0; >> } >> >> VTK-5.8: >> i = 0: v = 0, graph->GetVertex[..]->GetVariantValue( 0) = 0, >> graph->FindVertex(0*100) = 0 >> i = 1: v = 1, graph->GetVertex[..]->GetVariantValue( 1) = 100, >> graph->FindVertex(1*100) = 1 >> i = 2: v = 2, graph->GetVertex[..]->GetVariantValue( 2) = 200, >> graph->FindVertex(2*100) = 2 >> i = 3: v = 3, graph->GetVertex[..]->GetVariantValue( 3) = 300, >> graph->FindVertex(3*100) = 3 >> i = 4: v = 4, graph->GetVertex[..]->GetVariantValue( 4) = 400, >> graph->FindVertex(4*100) = 4 >> i = 5: v = 5, graph->GetVertex[..]->GetVariantValue( 5) = 500, >> graph->FindVertex(5*100) = 5 >> i = 6: v = 6, graph->GetVertex[..]->GetVariantValue( 6) = 600, >> graph->FindVertex(6*100) = 6 >> i = 7: v = 7, graph->GetVertex[..]->GetVariantValue( 7) = 700, >> graph->FindVertex(7*100) = 7 >> i = 8: v = 8, graph->GetVertex[..]->GetVariantValue( 8) = 800, >> graph->FindVertex(8*100) = 8 >> i = 9: v = 9, graph->GetVertex[..]->GetVariantValue( 9) = 900, >> graph->FindVertex(9*100) = 9 >> >> VTK-5.10.1: >> i = 0: v = 0, graph->GetVertex[..]->GetVariantValue( 0) = 0, >> graph->FindVertex(0*100) = 0 >> i = 1: v = 1, graph->GetVertex[..]->GetVariantValue( 1) = 100, >> graph->FindVertex(1*100) = 1 >> i = 2: v = 2, graph->GetVertex[..]->GetVariantValue( 2) = 200, >> graph->FindVertex(2*100) = -1 >> i = 3: v = 3, graph->GetVertex[..]->GetVariantValue( 3) = 300, >> graph->FindVertex(3*100) = 3 >> i = 4: v = 4, graph->GetVertex[..]->GetVariantValue( 4) = 400, >> graph->FindVertex(4*100) = -1 >> i = 5: v = 5, graph->GetVertex[..]->GetVariantValue( 5) = 500, >> graph->FindVertex(5*100) = -1 >> i = 6: v = 6, graph->GetVertex[..]->GetVariantValue( 6) = 600, >> graph->FindVertex(6*100) = -1 >> i = 7: v = 7, graph->GetVertex[..]->GetVariantValue( 7) = 700, >> graph->FindVertex(7*100) = 7 >> i = 8: v = 8, graph->GetVertex[..]->GetVariantValue( 8) = 800, >> graph->FindVertex(8*100) = -1 >> i = 9: v = 9, graph->GetVertex[..]->GetVariantValue( 9) = 900, >> graph->FindVertex(9*100) = -1 >> >> >> It seems that there is something wrong with the >> AbstractArray::LookupValue in 5.10.1, since the array entries value->pedId >> are made. >> I am aware that 6.1 was released some time ago. Maybe the issue was >> solved already, but since I couldn't find any reports on this I thought I >> might inform you guys. >> Or am I just missing some newly introduced update call? >> >> Best, >> Adrian. >> >> -- >> Dipl.-Inform. Adrian Friebel >> Research Group for Multicellular Systems Biology >> Interdisciplinary Centre for BioInformatics >> University of Leipzig >> Haertelstrasse 16-18 >> 04107 Leipzig >> Germany >> Tel.: +49 341 97-16627 >> email: adrian.friebel at uni-leipzig.de >> >> _______________________________________________ >> 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 >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> > > > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dennis.juve at gmail.com Wed Aug 27 23:05:33 2014 From: dennis.juve at gmail.com (technOslerphile) Date: Wed, 27 Aug 2014 20:05:33 -0700 (PDT) Subject: [vtkusers] How to apply the camera pose transformation computed using EPnP to the VTK camera? Message-ID: <1409195133421-5728473.post@n5.nabble.com> For my augmented reality project, I have a 3D model viewed using VTK camera and a real object of the model viewed using a real camera. I used EPnP to estimate the extrinsic matrix of the real camera (this camera has already been calibrated before hand, so I know the internal parameters) by giving 3D points from VTK and its corresponding 2D points from real camera image and the internal parameters of the real camera for the EPnP algorithm to work. After that, I obtained a rotation and translation matrix with the elements -> R1, R2, R3, ....., R9 and t1, t2 and t3. So my extrinsic matrix of the real camera looks like this (let's call this extrinsicReal): *R1 R2 R3 T1 R4 R5 R6 T2 R7 R8 R9 T3 0 0 0 1* After this, I estimate the extrinsic matrix of my VTK camera using the following code: *vtkSmartPointer extrinsicVTK = vtkSmartPointer::New(); extrinsicVTK->DeepCopy(renderer->GetActiveCamera()->GetViewTransformMatrix());* To fuse the VTK camera 3D model with the real camera, the VTK camera should be set to a position which is same as that of the real camera position and the focal length of the VTK camera should be same as that of the real camera. Another important step is to apply the same extrinsic matrix of the real camera to the VTK camera. How do I do it? What I did was I took the inverse of the extrinsicReal and multiplied this with the extrinsicVTK to get a new 4*4 matrix (let's call it newMatrix). I applied this matrix for the transformation of VTK camera. *vtkSmartPointer newMatrix = vtkSmartPointer::New(); vtkMatrix4x4::Multiply4x4(extrinsicRealInvert,extrinsicVTK,newMatrix);* *vtkSmartPointer transform = vtkSmartPointer::New(); transform->SetMatrix(NewM); transform->Update(); renderer->GetActiveCamera()->ApplyTransform(transform);* I am not really sure if this is the correct method. But I checked the real camera position (which I got after EPnP) and the VTK camera position (after applying the transform above) and they are both exactly same. Also, the orientation of the real camera and the direction of projection of the VTK camera are also the same. The problem is that even after the above parameters are matching for both the VTK and the real camera, the 3D VTK model does not seem to be perfectly aligned to the real camera video. Can someone guide me step by step to debug the issue? -- View this message in context: http://vtk.1045678.n5.nabble.com/How-to-apply-the-camera-pose-transformation-computed-using-EPnP-to-the-VTK-camera-tp5728473.html Sent from the VTK - Users mailing list archive at Nabble.com. From joggingsong at gmail.com Wed Aug 27 23:19:35 2014 From: joggingsong at gmail.com (Jogging Song) Date: Thu, 28 Aug 2014 11:19:35 +0800 Subject: [vtkusers] The color of the triangle mesh is affected after I call SetScalars In-Reply-To: References: Message-ID: Thanks for your timely reply, Cory. After reading some code of VTK, maybe I find the reason. When VTK reads one ply mesh with color, the color information is stored in scalars field of vtkPointData. I hope to find the shortest path with weight on the mesh. In the implementation of vtkDijkstraGraphGeodesicPath, the weight is obtained from scalar field of the vtkPolyData. So when I set the scalars, the color information of the mesh is overwritten. I can only store color information or weight information, but not simultaneously. Is there one way to use the color information and weight information at the same time? Regards Jogging Song On Wed, Aug 27, 2014 at 9:01 PM, Cory Quammen wrote: > Jogging, > > Without seeing any code, it's tough to tell you where to make the > change. I'll assume you have a vtkMapper (or subclass) somewhere in > your code, and I'll assume C++. To disable coloring by the scalar > value, call > > mapper->ScalarVisibilityOff(); > > I hope that helps, > Cory > > On Wed, Aug 27, 2014 at 4:03 AM, Jogging Song > wrote: > > Hi, all > > > > I read one triangle mesh file from the disk. The mesh itself contains > color > > information. I can render the mesh correctly. The color of rendered > mesh is > > from the color information of the mesh. To use the scalars, I call the > > function SetScalars. The color of the rendered mesh is changed and now > the > > color is from scalars. However I hope to use the color of the mesh. I can > > find the answer from the internet. Can anyone help me? > > > > Regards > > Jogging Song > > > > _______________________________________________ > > 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 > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/vtkusers > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sfaisal.ali91 at gmail.com Thu Aug 28 00:55:29 2014 From: sfaisal.ali91 at gmail.com (sfaisalali91) Date: Wed, 27 Aug 2014 21:55:29 -0700 (PDT) Subject: [vtkusers] Multiple renderes and interactor callback In-Reply-To: References: <1409048154305-5728393.post@n5.nabble.com> <1409121131703-5728440.post@n5.nabble.com> Message-ID: <1409201729202-5728475.post@n5.nabble.com> Thank you david. -- View this message in context: http://vtk.1045678.n5.nabble.com/Multiple-renderes-and-interactor-callback-tp5728393p5728475.html Sent from the VTK - Users mailing list archive at Nabble.com. From flaviu2 at yahoo.com Thu Aug 28 03:49:38 2014 From: flaviu2 at yahoo.com (flaviu2) Date: Thu, 28 Aug 2014 00:49:38 -0700 (PDT) Subject: [vtkusers] vtkDistanceWidget behaviour In-Reply-To: <1409138652869-5728444.post@n5.nabble.com> References: <1409138652869-5728444.post@n5.nabble.com> Message-ID: <1409212178656-5728476.post@n5.nabble.com> Here is the sample picture: after I zoomed the image, the vtkDistanceWidget object has kept his position: Now, I had changed the position of a vtkDistanceWidget, and after I zoomed again, the vtkDistanceWidget object don't keep his position, like in image: -- View this message in context: http://vtk.1045678.n5.nabble.com/vtkDistanceWidget-behaviour-tp5728444p5728476.html Sent from the VTK - Users mailing list archive at Nabble.com. From friebel at izbi.uni-leipzig.de Thu Aug 28 07:21:47 2014 From: friebel at izbi.uni-leipzig.de (Adrian Friebel) Date: Thu, 28 Aug 2014 13:21:47 +0200 Subject: [vtkusers] Potential bug in graph pedigreeId handling / AbstractArray::LookupValue In-Reply-To: References: <53FDDD1A.7090705@izbi.uni-leipzig.de> Message-ID: <53FF10CB.9020204@izbi.uni-leipzig.de> Thank you for the clarification! Indeed I tried the Modified call on the graph object during my testing. Still no rebuild of lookup. I now just tried Modified calls on VertexData and directly on the PedigreeID Array after adding the vertices. Still no rebuild of lookup. The DataChanged() call did the job. (In 5.10.1) In any case, I think it would be preferable if the graph method AddVertex(pedId) would trigger the lookup rebuild. Or at least the graph->Modified() call. An update of the corresponding API docs should be considered also. Otherwise migration to newer vtk versions might give some people serious headaches. It took me half a day to track the strange behaviour of my graphs down to this change. ;) Best, Adrian. Am 28.08.2014 02:19, schrieb Berk Geveci: > Ah interesting. Note that I plan to remove DataChanged() in the > future. It is a serious performance bottleneck when multiple threads > are setting different parts of an array because it causes all threads > to write to the same memory location where that flag is stored. The > right way of doing this is to call Modified() after doing a set of > changes to notify whatever may depend on an array. > > Best, > -berk > > > On Wed, Aug 27, 2014 at 5:30 PM, Jeff Baumes > wrote: > > It is unclear what changed exactly, but the current behavior is > that for numeric arrays, setting data with SetValue() (which is > what AddVertex ultimately does to the pedigree ID array), does not > in fact invoke DataChanged() on the array which would signal the > lookup to rebuild on the next LookupValue() call (which is what > FindVertex() performs). This was done for performance reasons, and > perhaps this change was made between 5.8 and 5.10. > > If you call pedigreeIds->DataChanged() just before the call to > FindVertex(), the issue should be resolved. > > > On Wed, Aug 27, 2014 at 9:28 AM, Adrian Friebel > > > wrote: > > Hey, > so far I compiled my software against vtk 5.8. Recently I > tried to compile it against 5.10.1 and noticed unexpected > behaviour while adding vertices to a graph while passing > pedigree ids. > Below a minimal example and its output: > > #include > #include > > #include > #include > #include > #include > > int main(int argc, char **argv) > { > vtkSmartPointer graph = > vtkSmartPointer::New(); > > vtkSmartPointer pedigreeIds = > vtkSmartPointer::New(); > pedigreeIds->Initialize(); > pedigreeIds->SetName("Pedigree IDs"); > > graph->GetVertexData()->SetPedigreeIds(pedigreeIds); > > for(unsigned int i=0; i<10; ++i) { > vtkIdType v = graph->AddVertex(i*100); > std::cout << "i = " << i << ": v = " << v << > ", graph->GetVertex[..]->GetVariantValue( " << > v << ") = " << > graph->GetVertexData()->GetPedigreeIds()->GetVariantValue(v) << > ", graph->FindVertex(" << i << "*100) = " << > graph->FindVertex(i*100) << std::endl; > } > return 0; > } > > VTK-5.8: > i = 0: v = 0, graph->GetVertex[..]->GetVariantValue( 0) = 0, > graph->FindVertex(0*100) = 0 > i = 1: v = 1, graph->GetVertex[..]->GetVariantValue( 1) = 100, > graph->FindVertex(1*100) = 1 > i = 2: v = 2, graph->GetVertex[..]->GetVariantValue( 2) = 200, > graph->FindVertex(2*100) = 2 > i = 3: v = 3, graph->GetVertex[..]->GetVariantValue( 3) = 300, > graph->FindVertex(3*100) = 3 > i = 4: v = 4, graph->GetVertex[..]->GetVariantValue( 4) = 400, > graph->FindVertex(4*100) = 4 > i = 5: v = 5, graph->GetVertex[..]->GetVariantValue( 5) = 500, > graph->FindVertex(5*100) = 5 > i = 6: v = 6, graph->GetVertex[..]->GetVariantValue( 6) = 600, > graph->FindVertex(6*100) = 6 > i = 7: v = 7, graph->GetVertex[..]->GetVariantValue( 7) = 700, > graph->FindVertex(7*100) = 7 > i = 8: v = 8, graph->GetVertex[..]->GetVariantValue( 8) = 800, > graph->FindVertex(8*100) = 8 > i = 9: v = 9, graph->GetVertex[..]->GetVariantValue( 9) = 900, > graph->FindVertex(9*100) = 9 > > VTK-5.10.1: > i = 0: v = 0, graph->GetVertex[..]->GetVariantValue( 0) = 0, > graph->FindVertex(0*100) = 0 > i = 1: v = 1, graph->GetVertex[..]->GetVariantValue( 1) = 100, > graph->FindVertex(1*100) = 1 > i = 2: v = 2, graph->GetVertex[..]->GetVariantValue( 2) = 200, > graph->FindVertex(2*100) = -1 > i = 3: v = 3, graph->GetVertex[..]->GetVariantValue( 3) = 300, > graph->FindVertex(3*100) = 3 > i = 4: v = 4, graph->GetVertex[..]->GetVariantValue( 4) = 400, > graph->FindVertex(4*100) = -1 > i = 5: v = 5, graph->GetVertex[..]->GetVariantValue( 5) = 500, > graph->FindVertex(5*100) = -1 > i = 6: v = 6, graph->GetVertex[..]->GetVariantValue( 6) = 600, > graph->FindVertex(6*100) = -1 > i = 7: v = 7, graph->GetVertex[..]->GetVariantValue( 7) = 700, > graph->FindVertex(7*100) = 7 > i = 8: v = 8, graph->GetVertex[..]->GetVariantValue( 8) = 800, > graph->FindVertex(8*100) = -1 > i = 9: v = 9, graph->GetVertex[..]->GetVariantValue( 9) = 900, > graph->FindVertex(9*100) = -1 > > > It seems that there is something wrong with the > AbstractArray::LookupValue in 5.10.1, since the array entries > value->pedId are made. > I am aware that 6.1 was released some time ago. Maybe the > issue was solved already, but since I couldn't find any > reports on this I thought I might inform you guys. > Or am I just missing some newly introduced update call? > > Best, > Adrian. > > -- > Dipl.-Inform. Adrian Friebel > Research Group for Multicellular Systems Biology > Interdisciplinary Centre for BioInformatics > University of Leipzig > Haertelstrasse 16-18 > 04107 Leipzig > Germany > Tel.: +49 341 97-16627 > email: adrian.friebel at uni-leipzig.de > > > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > > > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From torque at live.com Thu Aug 28 08:21:56 2014 From: torque at live.com (Christian Nassif-Haynes) Date: Thu, 28 Aug 2014 05:21:56 -0700 (PDT) Subject: [vtkusers] Qt + VTK + Custom vtkInteractorStyle Subclass Message-ID: <1409228516356-5728481.post@n5.nabble.com> Hi guys, I've been trying to modify the ReadDICOMSeries example to work with Qt. The example works fine, but when I use a QVTKWidget, scrolling through the slices also reorients the image. The slice is reoriented such that higher slices appear closer or magnified compared to lower ones. The rotation, contrast, or anything else don't seem to change unexpectedly---just the magnification. I've attached all my code, but the important part is this ( Pastebin link here if you like syntax highlighting ):myVtkInteractorStyleImage is the same class used in the example. This is somewhat of a small problem in terms of aesthetics, but it shows a lack of understanding on my part that I'd really like to clear up here. Thanks! Project.zip -- View this message in context: http://vtk.1045678.n5.nabble.com/Qt-VTK-Custom-vtkInteractorStyle-Subclass-tp5728481.html Sent from the VTK - Users mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean at rogue-research.com Thu Aug 28 10:18:22 2014 From: sean at rogue-research.com (Sean McBride) Date: Thu, 28 Aug 2014 10:18:22 -0400 Subject: [vtkusers] [vtk-developers] Proposal: Bug tracker hack-a-ton In-Reply-To: References: Message-ID: <20140828141822.216694143@mail.rogue-research.com> On Tue, 26 Aug 2014 16:43:13 -0400, Bill Lorensen said: >I will attend if possible. October is better for me, I will be away >September 17-27. Mondays and Wednesdays are bad (golf). Sept 8,9,10 >are bad. I will also attend if possible. Always fun to meet up in person. October also better for me. I'm leaving for vacation for the next two weeks tonight (BTW: email support at rogue if one of our buildbots needs kicking) and will be busy catching up the week I'm back. Cheers, -- ____________________________________________________________ Sean McBride, B. Eng sean at rogue-research.com Rogue Research www.rogue-research.com Mac Software Developer Montr?al, Qu?bec, Canada From berk.geveci at kitware.com Thu Aug 28 10:21:39 2014 From: berk.geveci at kitware.com (Berk Geveci) Date: Thu, 28 Aug 2014 10:21:39 -0400 Subject: [vtkusers] Proposal: Bug tracker hack-a-ton In-Reply-To: References: Message-ID: Several people indicated a preference for October. How about October 2nd? Best, -berk On Tue, Aug 26, 2014 at 4:32 PM, Berk Geveci wrote: > Hi folks, > > I propose a hack-a-ton to reduce the number of open issues in the bug > tracker. It is like a yard that hasn't been mowed and weeded the whole > summer. I propose a full day hack-a-ton. We can host some folks here at > Kitware and others can join through a Google Hangout. I propose one in > September. What do you think? Interested parties please send me an e-mail > off the list with your preferred dates. > > This will have to be the first in a series. There are a lot of issues to > go over. > > Best, > -berk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.schussman at gmail.com Thu Aug 28 17:14:38 2014 From: greg.schussman at gmail.com (Greg Schussman) Date: Thu, 28 Aug 2014 14:14:38 -0700 Subject: [vtkusers] GetKeySym and GetKeyCode for QVTKRenderWindowInteractor Message-ID: Hi. I've got a working python vtk demo that uses a vtkRenderWindowInteractor, with the style set to vtkInteractorStyleTrackballCamera. I run into a problem when I try to embed this in Qt. I use interactor.AddObserver('KeyPressEvent', key_handler) to see key presses and act on them. In my key_handler function, I query the interactor (passed in as an argument to key_handler) about which key was pressed. In my working example: when I press 'b', interactor.GetKeyCode() gives 'b', and interactor.GetKeySym() give 'b'. when I press esc, interactor.GetKeyCode() gives an unprintable character, and interactor.GetKeySym() gives 'Escape'. In my non-working Qt example, I use QVTKRenderWindowInteractor(frame) instead (copied from the VTK/Examples/Python/Widgets/EmbedPyQt example). now, when I press 'b', interactor.GetKeyCode() gives 'b', and interactor.GetKeySym() gives None. when I press esc, interactor.GetKeyCode() gives an unprintable character, and interactor.GetKeySym() gives None. So, originally, I used GetKeySym(), but when switching to the QVTKRenderWindowInteractor, that stopped working (always returning None). I'm concerned about possible inconsistencies from one linux machine to another when using GetKeyCode, so I'm reluctant to use it. What should I do here? Is there any reason why the QTVTKRenderWindowInteractor would be giving None for the KeySym? For what it's worth, my demo code runs both with regular vtk and embedded in pyqt, and the mouse interaction is fine, and the '3' option does toggle stereo in both cases. But for some reason my observer can see the key with GetKeySym in regular vtk mode, but not in embedded pyqt mode. Thanks in advance for any help or suggestions. Greg -------------- next part -------------- An HTML attachment was scrubbed... URL: From aur.marsan at gmail.com Thu Aug 28 17:18:36 2014 From: aur.marsan at gmail.com (=?UTF-8?Q?Aur=C3=A9lien_Marsan?=) Date: Thu, 28 Aug 2014 17:18:36 -0400 Subject: [vtkusers] no vtkTriangularPrism class ? Message-ID: Dear vtk users, I am working with a mesh composed of tetra, and triangular prisms in the vicinity of the solid walls. Is that type of cell correctly handled in VTK ? And then : which type of cells does it correspond ? (http://www.vtk.org/doc/nightly/html/classvtkCell3D.html) Many thanks, Regards, Aur?lien -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.schussman at gmail.com Thu Aug 28 17:33:19 2014 From: greg.schussman at gmail.com (Greg Schussman) Date: Thu, 28 Aug 2014 14:33:19 -0700 Subject: [vtkusers] vtkPropAssembly and wireframe Message-ID: Hi. I'm using a vtkPropAssembly to gather together a number of things so that I can easily toggle their visibility as a group. This seems to work quite well. However, before using this approach, I could hit 'w' and the render window interactor would switch to displaying my items as wireframe. However, now that I'm using the vtkPropAssembly, that no longer works. What's the best thing to do here? Is there a way to make the wireframe toggle work with vtkPropAssembly? If not, is there a way I can dive down into that assembly and set the representation as wireframe for each item that allows it? Or should I give up on keeping things grouped in a vtkPropAssebly, and just manage all the individual visibility toggles myself? Or something else that I'm not thinking of? Thanks for any help. Greg -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.schussman at gmail.com Thu Aug 28 17:49:37 2014 From: greg.schussman at gmail.com (Greg Schussman) Date: Thu, 28 Aug 2014 14:49:37 -0700 Subject: [vtkusers] GetKeySym and GetKeyCode for QVTKRenderWindowInteractor In-Reply-To: References: Message-ID: Oops. I forgot to mention that I'm using python-2.6, vtk-5.10.1, and qt-4.6.1. Greg On Thu, Aug 28, 2014 at 2:14 PM, Greg Schussman wrote: > Hi. > > I've got a working python vtk demo that uses a vtkRenderWindowInteractor, > with the style set to vtkInteractorStyleTrackballCamera. I run into a > problem when I try to embed this in Qt. > > I use interactor.AddObserver('KeyPressEvent', key_handler) to see key > presses and act on them. > > In my key_handler function, I query the interactor (passed in as an > argument to key_handler) about which key was pressed. > > In my working example: > > when I press 'b', > interactor.GetKeyCode() gives 'b', and > interactor.GetKeySym() give 'b'. > > when I press esc, > interactor.GetKeyCode() gives an unprintable character, and > interactor.GetKeySym() gives 'Escape'. > > In my non-working Qt example, I use QVTKRenderWindowInteractor(frame) > instead (copied from the VTK/Examples/Python/Widgets/EmbedPyQt example). > > now, when I press 'b', > interactor.GetKeyCode() gives 'b', and > interactor.GetKeySym() gives None. > > when I press esc, > interactor.GetKeyCode() gives an unprintable character, and > interactor.GetKeySym() gives None. > > So, originally, I used GetKeySym(), but when switching to the > QVTKRenderWindowInteractor, that stopped working (always returning None). > I'm concerned about possible inconsistencies from one linux machine to > another when using GetKeyCode, so I'm reluctant to use it. > > What should I do here? Is there any reason why the > QTVTKRenderWindowInteractor would be giving None for the KeySym? > > For what it's worth, my demo code runs both with regular vtk and embedded > in pyqt, and the mouse interaction is fine, and the '3' option does toggle > stereo in both cases. But for some reason my observer can see the key with > GetKeySym in regular vtk mode, but not in embedded pyqt mode. > > Thanks in advance for any help or suggestions. > > Greg > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.schussman at gmail.com Thu Aug 28 17:50:13 2014 From: greg.schussman at gmail.com (Greg Schussman) Date: Thu, 28 Aug 2014 14:50:13 -0700 Subject: [vtkusers] vtkPropAssembly and wireframe In-Reply-To: References: Message-ID: Oops. I forgot to mention that I'm using python-2.6, vtk-5.10.1, and qt-4.6.1. Greg On Thu, Aug 28, 2014 at 2:33 PM, Greg Schussman wrote: > Hi. > > I'm using a vtkPropAssembly to gather together a number of things so that > I can easily toggle their visibility as a group. This seems to work quite > well. > > However, before using this approach, I could hit 'w' and the render window > interactor would switch to displaying my items as wireframe. However, now > that I'm using the vtkPropAssembly, that no longer works. > > What's the best thing to do here? > > Is there a way to make the wireframe toggle work with vtkPropAssembly? > If not, is there a way I can dive down into that assembly and set the > representation as wireframe for each item that allows it? > > Or should I give up on keeping things grouped in a vtkPropAssebly, and > just manage all the individual visibility toggles myself? > > Or something else that I'm not thinking of? > > Thanks for any help. > > Greg > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Thu Aug 28 18:14:07 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 28 Aug 2014 16:14:07 -0600 Subject: [vtkusers] GetKeySym and GetKeyCode for QVTKRenderWindowInteractor In-Reply-To: References: Message-ID: Hi Greg, I looked through QVTKRenderWindowInteractor.py and discovered this in its keyPressEvent() method: self._Iren.SetEventInformationFlipY(self.__saveX, self.__saveY, ctrl, shift, key, 0, None) Compare this with the arguments that the method expects (in vtkRenderWindowInteractor.h): void SetEventInformationFlipY(int x, int y, int ctrl, int shift, char keycode, int repeatcount, const char* keysym) As you can see, the author of this class was a bit lazy and passed None as the keysym, instead of getting the keysym from Qt and then passing it through to VTK. But to be fair, this code was written twelve years ago and maybe keysyms weren't the highest priority. If you can patch QVTKRenderWindowInteractor.py so that it passes the keysym strings from Qt to "self._Iren", then I can add your patch to the VTK master. - David On Thu, Aug 28, 2014 at 3:49 PM, Greg Schussman wrote: > Oops. > > I forgot to mention that I'm using python-2.6, vtk-5.10.1, and qt-4.6.1. > > Greg > > > > On Thu, Aug 28, 2014 at 2:14 PM, Greg Schussman > wrote: >> >> Hi. >> >> I've got a working python vtk demo that uses a vtkRenderWindowInteractor, >> with the style set to vtkInteractorStyleTrackballCamera. I run into a >> problem when I try to embed this in Qt. >> >> I use interactor.AddObserver('KeyPressEvent', key_handler) to see key >> presses and act on them. >> >> In my key_handler function, I query the interactor (passed in as an >> argument to key_handler) about which key was pressed. >> >> In my working example: >> >> when I press 'b', >> interactor.GetKeyCode() gives 'b', and >> interactor.GetKeySym() give 'b'. >> >> when I press esc, >> interactor.GetKeyCode() gives an unprintable character, and >> interactor.GetKeySym() gives 'Escape'. >> >> In my non-working Qt example, I use QVTKRenderWindowInteractor(frame) >> instead (copied from the VTK/Examples/Python/Widgets/EmbedPyQt example). >> >> now, when I press 'b', >> interactor.GetKeyCode() gives 'b', and >> interactor.GetKeySym() gives None. >> >> when I press esc, >> interactor.GetKeyCode() gives an unprintable character, and >> interactor.GetKeySym() gives None. >> >> So, originally, I used GetKeySym(), but when switching to the >> QVTKRenderWindowInteractor, that stopped working (always returning None). >> I'm concerned about possible inconsistencies from one linux machine to >> another when using GetKeyCode, so I'm reluctant to use it. >> >> What should I do here? Is there any reason why the >> QTVTKRenderWindowInteractor would be giving None for the KeySym? >> >> For what it's worth, my demo code runs both with regular vtk and embedded >> in pyqt, and the mouse interaction is fine, and the '3' option does toggle >> stereo in both cases. But for some reason my observer can see the key with >> GetKeySym in regular vtk mode, but not in embedded pyqt mode. >> >> Thanks in advance for any help or suggestions. >> >> Greg From asou at soum.co.jp Thu Aug 28 22:41:15 2014 From: asou at soum.co.jp (Masato Asou) Date: Fri, 29 Aug 2014 11:41:15 +0900 (JST) Subject: [vtkusers] TriangleArea() return the not correct value. Message-ID: <20140829.114115.128488439.asou@soum.co.jp> Hi, I have a probrem about vtkTriangle::TriangleArea(). I use VTK-5.10.1. The triangle to be calculated is what one side is very short. I calculate the area of the triangle in vtkTriangle::TriangleArea(), the result are different to that using the Heron's formula and cross products. I also calculate tha area is regarded as a rectanglar triangle, this value is also different vtkTriangle::TriangleArea() In addition, vtkTriangle::TriangleArea() return a different value when change the order of the vertices. This problem be resolved? My system as: $ cat /etc/redhat-release CentOS release 5.6 (Final) $ uname -m -r -s -v Linux 2.6.18-238.19.1.el5 #1 SMP Fri Jul 15 07:31:24 EDT 2011 x86_64 My program as below: $ cat triangle.cpp #include #include using namespace std; #include double lineLength(const double p0[3], const double p1[3]) { double len2 = 0.0; for(int i = 0; i < 3; i++) { len2 += (p0[i] - p1[i]) * (p0[i] - p1[i]); } return sqrt(len2); } double CrossProduct(double p1[3], double p2[3], double p3[3]) { double a[3], b[3], o[3], v[3]; // Create the vector a and b. a[0] = p2[0] - p1[0]; a[1] = p2[1] - p1[1]; a[2] = p2[2] - p1[2]; b[0] = p3[0] - p1[0]; b[1] = p3[1] - p1[1]; b[2] = p3[2] - p1[2]; // Calculate the cross product of vector a and b. o[0] = 0.0; o[1] = 0.0; o[2] = 0.0; v[0] = (a[1] * b[2]) - (a[2] * b[1]); v[1] = (a[2] * b[0]) - (a[0] * b[2]); v[2] = (a[0] * b[1]) - (a[1] * b[0]); return fabs(lineLength(o, v)) / 2; } double HeronsFormula(double p1[3], double p2[3], double p3[3]) { double a = lineLength(p1, p2); double b = lineLength(p2, p3); double c = lineLength(p3, p1); return sqrt((a+b+c) * (-a+b+c) * (a-b+c) * (a+b-c)) * 0.25; } int main(void) { double A[3] = {-3.58117425311239667707, -3.58117425311239667707, 1.0}; double B[3] = {-3.04058712655619833853, -3.04058712655619833853, 0.95}; double C[3] = {-3.04058712655619833853, -3.04058712655619789444, 0.95}; double a = lineLength(A, B); double b = lineLength(B, C); double c = lineLength(C, A); cout << fixed << setprecision(20); cout << "TriangleArea(A, B, C): " << vtkTriangle::TriangleArea(A, B, C) << endl; cout << "TriangleArea(B, C, A): " << vtkTriangle::TriangleArea(B, C, A) << endl; cout << "CrossProduct(A, B, C): " << CrossProduct(A, B, C) << endl; cout << "CrossProduct(B, C, A): " << CrossProduct(B, C, A) << endl; cout << "HeronsFormula(A, B, C): " << HeronsFormula(A, B, C) << endl; cout << "HeronsFormula(B, C, A): " << HeronsFormula(B, C, A) << endl; cout << "RectangularTriangle: " << (a * b / 2) << endl; cout << "line length: a: " << a << ", b: " << b << ", c: " << c << endl; return 0; } $ g++ -g -I../../src -I/home/asou/freesw/vtk-5.10.1/include/vtk-5.10 triangle.cpp -Xlinker -rpath -Xlinker ../../src -L/home/asou/freesw/vtk-5.10.1/lib/vtk-5.10 -lvtkCommon -lvtkWidgets -Xlinker -rpath -Xlinker /home/asou/freesw/vtk-5.10.1/lib/vtk-5.10 In file included from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/backward/strstream:51, from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkIOStream.h:108, from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkSystemIncludes.h:40, from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkIndent.h:24, from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkObjectBase.h:43, from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkObject.h:41, from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkCell.h:40, from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkTriangle.h:23, from triangle.cpp:4: /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the header for the header for C++ includes, or instead of the deprecated header . To disable this warning use -Wno-deprecated. $ ./a.out TriangleArea(A, B, C): 0.00000000526835606386 TriangleArea(B, C, A): 0.00000000000000009839 CrossProduct(A, B, C): 0.00000000000000011168 CrossProduct(B, C, A): 0.00000000000000012055 HeronsFormula(A, B, C): 0.00000000000000011252 HeronsFormula(B, C, A): 0.00000000000000011252 RectangularTriangle: 0.00000000000000017012 line length: a: 0.76613894483740641039, b: 0.00000000000000044409, c: 0.76613894483740674346 $ Thanks in advance any help or suggestions. -- ASOU Masato From cory.quammen at kitware.com Thu Aug 28 23:10:23 2014 From: cory.quammen at kitware.com (Cory Quammen) Date: Thu, 28 Aug 2014 23:10:23 -0400 Subject: [vtkusers] TriangleArea() return the not correct value. In-Reply-To: <20140829.114115.128488439.asou@soum.co.jp> References: <20140829.114115.128488439.asou@soum.co.jp> Message-ID: Masato, It looks like you are running into numerical precision problems because two of your points are extremely close, almost close enough to be indistinguishable by double precision. The inconsistencies that depend on the order the points are given are caused by which sides are considered in the cross product and area calculation. Heron's formula, which I wasn't aware of, seems to eliminate this inconsistency. We should consider using this in VTK, in particular the numerically more stable implementation: http://en.wikipedia.org/wiki/Heron's_formula#Numerical_stability I don't know if my answer helps, but thank you for pointing out Heron's formula. Thanks, Cory On Thu, Aug 28, 2014 at 10:41 PM, Masato Asou wrote: > Hi, > > I have a probrem about vtkTriangle::TriangleArea(). I use VTK-5.10.1. > > The triangle to be calculated is what one side is very short. > > I calculate the area of the triangle in vtkTriangle::TriangleArea(), > the result are different to that using the Heron's formula and cross > products. I also calculate tha area is regarded as a rectanglar triangle, > this value is also different vtkTriangle::TriangleArea() > > In addition, vtkTriangle::TriangleArea() return a different value when > change the order of the vertices. > > This problem be resolved? > > My system as: > > $ cat /etc/redhat-release > CentOS release 5.6 (Final) > $ uname -m -r -s -v > Linux 2.6.18-238.19.1.el5 #1 SMP Fri Jul 15 07:31:24 EDT 2011 x86_64 > > My program as below: > > $ cat triangle.cpp > #include > #include > using namespace std; > #include > > double > lineLength(const double p0[3], const double p1[3]) > { > double len2 = 0.0; > > for(int i = 0; i < 3; i++) { > len2 += (p0[i] - p1[i]) * (p0[i] - p1[i]); > } > return sqrt(len2); > } > > double > CrossProduct(double p1[3], double p2[3], double p3[3]) > { > double a[3], b[3], o[3], v[3]; > > // Create the vector a and b. > a[0] = p2[0] - p1[0]; > a[1] = p2[1] - p1[1]; > a[2] = p2[2] - p1[2]; > b[0] = p3[0] - p1[0]; > b[1] = p3[1] - p1[1]; > b[2] = p3[2] - p1[2]; > > // Calculate the cross product of vector a and b. > o[0] = 0.0; > o[1] = 0.0; > o[2] = 0.0; > v[0] = (a[1] * b[2]) - (a[2] * b[1]); > v[1] = (a[2] * b[0]) - (a[0] * b[2]); > v[2] = (a[0] * b[1]) - (a[1] * b[0]); > return fabs(lineLength(o, v)) / 2; > } > > double > HeronsFormula(double p1[3], double p2[3], double p3[3]) > { > double a = lineLength(p1, p2); > double b = lineLength(p2, p3); > double c = lineLength(p3, p1); > > return sqrt((a+b+c) * (-a+b+c) * (a-b+c) * (a+b-c)) * 0.25; > } > > int > main(void) > { > double A[3] = {-3.58117425311239667707, -3.58117425311239667707, 1.0}; > double B[3] = {-3.04058712655619833853, -3.04058712655619833853, 0.95}; > double C[3] = {-3.04058712655619833853, -3.04058712655619789444, 0.95}; > double a = lineLength(A, B); > double b = lineLength(B, C); > double c = lineLength(C, A); > > cout << fixed << setprecision(20); > cout << "TriangleArea(A, B, C): " << vtkTriangle::TriangleArea(A, B, C) << endl; > cout << "TriangleArea(B, C, A): " << vtkTriangle::TriangleArea(B, C, A) << endl; > cout << "CrossProduct(A, B, C): " << CrossProduct(A, B, C) << endl; > cout << "CrossProduct(B, C, A): " << CrossProduct(B, C, A) << endl; > cout << "HeronsFormula(A, B, C): " << HeronsFormula(A, B, C) << endl; > cout << "HeronsFormula(B, C, A): " << HeronsFormula(B, C, A) << endl; > cout << "RectangularTriangle: " << (a * b / 2) << endl; > cout << "line length: a: " << a << ", b: " << b << ", c: " << c << endl; > > return 0; > } > $ g++ -g -I../../src -I/home/asou/freesw/vtk-5.10.1/include/vtk-5.10 triangle.cpp -Xlinker -rpath -Xlinker ../../src -L/home/asou/freesw/vtk-5.10.1/lib/vtk-5.10 -lvtkCommon -lvtkWidgets -Xlinker -rpath -Xlinker /home/asou/freesw/vtk-5.10.1/lib/vtk-5.10 > In file included from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/backward/strstream:51, > from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkIOStream.h:108, > from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkSystemIncludes.h:40, > from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkIndent.h:24, > from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkObjectBase.h:43, > from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkObject.h:41, > from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkCell.h:40, > from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkTriangle.h:23, > from triangle.cpp:4: > /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the header for the header for C++ includes, or instead of the deprecated header . To disable this warning use -Wno-deprecated. > $ ./a.out > TriangleArea(A, B, C): 0.00000000526835606386 > TriangleArea(B, C, A): 0.00000000000000009839 > CrossProduct(A, B, C): 0.00000000000000011168 > CrossProduct(B, C, A): 0.00000000000000012055 > HeronsFormula(A, B, C): 0.00000000000000011252 > HeronsFormula(B, C, A): 0.00000000000000011252 > RectangularTriangle: 0.00000000000000017012 > line length: a: 0.76613894483740641039, b: 0.00000000000000044409, c: 0.76613894483740674346 > $ > > Thanks in advance any help or suggestions. > -- > ASOU Masato > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers From david.gobbi at gmail.com Thu Aug 28 23:19:08 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 28 Aug 2014 21:19:08 -0600 Subject: [vtkusers] TriangleArea() return the not correct value. In-Reply-To: References: <20140829.114115.128488439.asou@soum.co.jp> Message-ID: Note that there is a difference in efficiency, because Heron's formula requires applying sqrt() four times, while VTK's formula requires applying sqrt() only once. It might be worthwhile to use both Heron's formula and the current VTK formula, with a discriminator to choose which based on the quality of the triangle. - David On Thu, Aug 28, 2014 at 9:10 PM, Cory Quammen wrote: > Masato, > > It looks like you are running into numerical precision problems > because two of your points are extremely close, almost close enough to > be indistinguishable by double precision. > > The inconsistencies that depend on the order the points are given are > caused by which sides are considered in the cross product and area > calculation. Heron's formula, which I wasn't aware of, seems to > eliminate this inconsistency. We should consider using this in VTK, in > particular the numerically more stable implementation: > http://en.wikipedia.org/wiki/Heron's_formula#Numerical_stability > > I don't know if my answer helps, but thank you for pointing out Heron's formula. > > Thanks, > Cory > > On Thu, Aug 28, 2014 at 10:41 PM, Masato Asou wrote: >> Hi, >> >> I have a probrem about vtkTriangle::TriangleArea(). I use VTK-5.10.1. >> >> The triangle to be calculated is what one side is very short. >> >> I calculate the area of the triangle in vtkTriangle::TriangleArea(), >> the result are different to that using the Heron's formula and cross >> products. I also calculate tha area is regarded as a rectanglar triangle, >> this value is also different vtkTriangle::TriangleArea() >> >> In addition, vtkTriangle::TriangleArea() return a different value when >> change the order of the vertices. >> >> This problem be resolved? >> >> My system as: >> >> $ cat /etc/redhat-release >> CentOS release 5.6 (Final) >> $ uname -m -r -s -v >> Linux 2.6.18-238.19.1.el5 #1 SMP Fri Jul 15 07:31:24 EDT 2011 x86_64 >> >> My program as below: >> >> $ cat triangle.cpp >> #include >> #include >> using namespace std; >> #include >> >> double >> lineLength(const double p0[3], const double p1[3]) >> { >> double len2 = 0.0; >> >> for(int i = 0; i < 3; i++) { >> len2 += (p0[i] - p1[i]) * (p0[i] - p1[i]); >> } >> return sqrt(len2); >> } >> >> double >> CrossProduct(double p1[3], double p2[3], double p3[3]) >> { >> double a[3], b[3], o[3], v[3]; >> >> // Create the vector a and b. >> a[0] = p2[0] - p1[0]; >> a[1] = p2[1] - p1[1]; >> a[2] = p2[2] - p1[2]; >> b[0] = p3[0] - p1[0]; >> b[1] = p3[1] - p1[1]; >> b[2] = p3[2] - p1[2]; >> >> // Calculate the cross product of vector a and b. >> o[0] = 0.0; >> o[1] = 0.0; >> o[2] = 0.0; >> v[0] = (a[1] * b[2]) - (a[2] * b[1]); >> v[1] = (a[2] * b[0]) - (a[0] * b[2]); >> v[2] = (a[0] * b[1]) - (a[1] * b[0]); >> return fabs(lineLength(o, v)) / 2; >> } >> >> double >> HeronsFormula(double p1[3], double p2[3], double p3[3]) >> { >> double a = lineLength(p1, p2); >> double b = lineLength(p2, p3); >> double c = lineLength(p3, p1); >> >> return sqrt((a+b+c) * (-a+b+c) * (a-b+c) * (a+b-c)) * 0.25; >> } >> >> int >> main(void) >> { >> double A[3] = {-3.58117425311239667707, -3.58117425311239667707, 1.0}; >> double B[3] = {-3.04058712655619833853, -3.04058712655619833853, 0.95}; >> double C[3] = {-3.04058712655619833853, -3.04058712655619789444, 0.95}; >> double a = lineLength(A, B); >> double b = lineLength(B, C); >> double c = lineLength(C, A); >> >> cout << fixed << setprecision(20); >> cout << "TriangleArea(A, B, C): " << vtkTriangle::TriangleArea(A, B, C) << endl; >> cout << "TriangleArea(B, C, A): " << vtkTriangle::TriangleArea(B, C, A) << endl; >> cout << "CrossProduct(A, B, C): " << CrossProduct(A, B, C) << endl; >> cout << "CrossProduct(B, C, A): " << CrossProduct(B, C, A) << endl; >> cout << "HeronsFormula(A, B, C): " << HeronsFormula(A, B, C) << endl; >> cout << "HeronsFormula(B, C, A): " << HeronsFormula(B, C, A) << endl; >> cout << "RectangularTriangle: " << (a * b / 2) << endl; >> cout << "line length: a: " << a << ", b: " << b << ", c: " << c << endl; >> >> return 0; >> } >> $ g++ -g -I../../src -I/home/asou/freesw/vtk-5.10.1/include/vtk-5.10 triangle.cpp -Xlinker -rpath -Xlinker ../../src -L/home/asou/freesw/vtk-5.10.1/lib/vtk-5.10 -lvtkCommon -lvtkWidgets -Xlinker -rpath -Xlinker /home/asou/freesw/vtk-5.10.1/lib/vtk-5.10 >> In file included from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/backward/strstream:51, >> from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkIOStream.h:108, >> from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkSystemIncludes.h:40, >> from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkIndent.h:24, >> from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkObjectBase.h:43, >> from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkObject.h:41, >> from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkCell.h:40, >> from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkTriangle.h:23, >> from triangle.cpp:4: >> /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the header for the header for C++ includes, or instead of the deprecated header . To disable this warning use -Wno-deprecated. >> $ ./a.out >> TriangleArea(A, B, C): 0.00000000526835606386 >> TriangleArea(B, C, A): 0.00000000000000009839 >> CrossProduct(A, B, C): 0.00000000000000011168 >> CrossProduct(B, C, A): 0.00000000000000012055 >> HeronsFormula(A, B, C): 0.00000000000000011252 >> HeronsFormula(B, C, A): 0.00000000000000011252 >> RectangularTriangle: 0.00000000000000017012 >> line length: a: 0.76613894483740641039, b: 0.00000000000000044409, c: 0.76613894483740674346 >> $ >> >> Thanks in advance any help or suggestions. >> -- >> ASOU Masato >> _______________________________________________ >> 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 >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers From david.gobbi at gmail.com Thu Aug 28 23:37:41 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 28 Aug 2014 21:37:41 -0600 Subject: [vtkusers] TriangleArea() return the not correct value. In-Reply-To: References: <20140829.114115.128488439.asou@soum.co.jp> Message-ID: Thanks for the link, Cory. I see that VTK actually uses a variant of Heron's formula already, bit it is a version that is less stable than the one Masato gave, which is in turn less stable that the one that you linked to. Fun stuff. On Thu, Aug 28, 2014 at 9:19 PM, David Gobbi wrote: > Note that there is a difference in efficiency, because Heron's formula > requires applying sqrt() four times, while VTK's formula requires applying > sqrt() only once. > > It might be worthwhile to use both Heron's formula and the current VTK > formula, with a discriminator to choose which based on the quality of the > triangle. > > - David > > > On Thu, Aug 28, 2014 at 9:10 PM, Cory Quammen wrote: >> Masato, >> >> It looks like you are running into numerical precision problems >> because two of your points are extremely close, almost close enough to >> be indistinguishable by double precision. >> >> The inconsistencies that depend on the order the points are given are >> caused by which sides are considered in the cross product and area >> calculation. Heron's formula, which I wasn't aware of, seems to >> eliminate this inconsistency. We should consider using this in VTK, in >> particular the numerically more stable implementation: >> http://en.wikipedia.org/wiki/Heron's_formula#Numerical_stability >> >> I don't know if my answer helps, but thank you for pointing out Heron's formula. >> >> Thanks, >> Cory >> >> On Thu, Aug 28, 2014 at 10:41 PM, Masato Asou wrote: >>> Hi, >>> >>> I have a probrem about vtkTriangle::TriangleArea(). I use VTK-5.10.1. >>> >>> The triangle to be calculated is what one side is very short. >>> >>> I calculate the area of the triangle in vtkTriangle::TriangleArea(), >>> the result are different to that using the Heron's formula and cross >>> products. I also calculate tha area is regarded as a rectanglar triangle, >>> this value is also different vtkTriangle::TriangleArea() >>> >>> In addition, vtkTriangle::TriangleArea() return a different value when >>> change the order of the vertices. >>> >>> This problem be resolved? >>> >>> My system as: >>> >>> $ cat /etc/redhat-release >>> CentOS release 5.6 (Final) >>> $ uname -m -r -s -v >>> Linux 2.6.18-238.19.1.el5 #1 SMP Fri Jul 15 07:31:24 EDT 2011 x86_64 >>> >>> My program as below: >>> >>> $ cat triangle.cpp >>> #include >>> #include >>> using namespace std; >>> #include >>> >>> double >>> lineLength(const double p0[3], const double p1[3]) >>> { >>> double len2 = 0.0; >>> >>> for(int i = 0; i < 3; i++) { >>> len2 += (p0[i] - p1[i]) * (p0[i] - p1[i]); >>> } >>> return sqrt(len2); >>> } >>> >>> double >>> CrossProduct(double p1[3], double p2[3], double p3[3]) >>> { >>> double a[3], b[3], o[3], v[3]; >>> >>> // Create the vector a and b. >>> a[0] = p2[0] - p1[0]; >>> a[1] = p2[1] - p1[1]; >>> a[2] = p2[2] - p1[2]; >>> b[0] = p3[0] - p1[0]; >>> b[1] = p3[1] - p1[1]; >>> b[2] = p3[2] - p1[2]; >>> >>> // Calculate the cross product of vector a and b. >>> o[0] = 0.0; >>> o[1] = 0.0; >>> o[2] = 0.0; >>> v[0] = (a[1] * b[2]) - (a[2] * b[1]); >>> v[1] = (a[2] * b[0]) - (a[0] * b[2]); >>> v[2] = (a[0] * b[1]) - (a[1] * b[0]); >>> return fabs(lineLength(o, v)) / 2; >>> } >>> >>> double >>> HeronsFormula(double p1[3], double p2[3], double p3[3]) >>> { >>> double a = lineLength(p1, p2); >>> double b = lineLength(p2, p3); >>> double c = lineLength(p3, p1); >>> >>> return sqrt((a+b+c) * (-a+b+c) * (a-b+c) * (a+b-c)) * 0.25; >>> } >>> >>> int >>> main(void) >>> { >>> double A[3] = {-3.58117425311239667707, -3.58117425311239667707, 1.0}; >>> double B[3] = {-3.04058712655619833853, -3.04058712655619833853, 0.95}; >>> double C[3] = {-3.04058712655619833853, -3.04058712655619789444, 0.95}; >>> double a = lineLength(A, B); >>> double b = lineLength(B, C); >>> double c = lineLength(C, A); >>> >>> cout << fixed << setprecision(20); >>> cout << "TriangleArea(A, B, C): " << vtkTriangle::TriangleArea(A, B, C) << endl; >>> cout << "TriangleArea(B, C, A): " << vtkTriangle::TriangleArea(B, C, A) << endl; >>> cout << "CrossProduct(A, B, C): " << CrossProduct(A, B, C) << endl; >>> cout << "CrossProduct(B, C, A): " << CrossProduct(B, C, A) << endl; >>> cout << "HeronsFormula(A, B, C): " << HeronsFormula(A, B, C) << endl; >>> cout << "HeronsFormula(B, C, A): " << HeronsFormula(B, C, A) << endl; >>> cout << "RectangularTriangle: " << (a * b / 2) << endl; >>> cout << "line length: a: " << a << ", b: " << b << ", c: " << c << endl; >>> >>> return 0; >>> } >>> $ g++ -g -I../../src -I/home/asou/freesw/vtk-5.10.1/include/vtk-5.10 triangle.cpp -Xlinker -rpath -Xlinker ../../src -L/home/asou/freesw/vtk-5.10.1/lib/vtk-5.10 -lvtkCommon -lvtkWidgets -Xlinker -rpath -Xlinker /home/asou/freesw/vtk-5.10.1/lib/vtk-5.10 >>> In file included from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/backward/strstream:51, >>> from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkIOStream.h:108, >>> from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkSystemIncludes.h:40, >>> from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkIndent.h:24, >>> from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkObjectBase.h:43, >>> from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkObject.h:41, >>> from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkCell.h:40, >>> from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkTriangle.h:23, >>> from triangle.cpp:4: >>> /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the header for the header for C++ includes, or instead of the deprecated header . To disable this warning use -Wno-deprecated. >>> $ ./a.out >>> TriangleArea(A, B, C): 0.00000000526835606386 >>> TriangleArea(B, C, A): 0.00000000000000009839 >>> CrossProduct(A, B, C): 0.00000000000000011168 >>> CrossProduct(B, C, A): 0.00000000000000012055 >>> HeronsFormula(A, B, C): 0.00000000000000011252 >>> HeronsFormula(B, C, A): 0.00000000000000011252 >>> RectangularTriangle: 0.00000000000000017012 >>> line length: a: 0.76613894483740641039, b: 0.00000000000000044409, c: 0.76613894483740674346 >>> $ >>> >>> Thanks in advance any help or suggestions. >>> -- >>> ASOU Masato >>> _______________________________________________ >>> 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 >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/vtkusers >> _______________________________________________ >> 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 >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers From asou at soum.co.jp Fri Aug 29 02:16:59 2014 From: asou at soum.co.jp (Masato Asou) Date: Fri, 29 Aug 2014 15:16:59 +0900 (JST) Subject: [vtkusers] TriangleArea() return the not correct value. In-Reply-To: References: <20140829.114115.128488439.asou@soum.co.jp> Message-ID: <20140829.151659.260178414.asou@soum.co.jp> > It looks like you are running into numerical precision problems I understand. > We should consider using this in VTK, I hope so. Thanks. -- ASOU Masato From: Cory Quammen Date: Thu, 28 Aug 2014 23:10:23 -0400 > Masato, > > It looks like you are running into numerical precision problems > because two of your points are extremely close, almost close enough to > be indistinguishable by double precision. > > The inconsistencies that depend on the order the points are given are > caused by which sides are considered in the cross product and area > calculation. Heron's formula, which I wasn't aware of, seems to > eliminate this inconsistency. We should consider using this in VTK, in > particular the numerically more stable implementation: > http://en.wikipedia.org/wiki/Heron's_formula#Numerical_stability > > I don't know if my answer helps, but thank you for pointing out Heron's formula. > > Thanks, > Cory > > On Thu, Aug 28, 2014 at 10:41 PM, Masato Asou wrote: >> Hi, >> >> I have a probrem about vtkTriangle::TriangleArea(). I use VTK-5.10.1. >> >> The triangle to be calculated is what one side is very short. >> >> I calculate the area of the triangle in vtkTriangle::TriangleArea(), >> the result are different to that using the Heron's formula and cross >> products. I also calculate tha area is regarded as a rectanglar triangle, >> this value is also different vtkTriangle::TriangleArea() >> >> In addition, vtkTriangle::TriangleArea() return a different value when >> change the order of the vertices. >> >> This problem be resolved? >> >> My system as: >> >> $ cat /etc/redhat-release >> CentOS release 5.6 (Final) >> $ uname -m -r -s -v >> Linux 2.6.18-238.19.1.el5 #1 SMP Fri Jul 15 07:31:24 EDT 2011 x86_64 >> >> My program as below: >> >> $ cat triangle.cpp >> #include >> #include >> using namespace std; >> #include >> >> double >> lineLength(const double p0[3], const double p1[3]) >> { >> double len2 = 0.0; >> >> for(int i = 0; i < 3; i++) { >> len2 += (p0[i] - p1[i]) * (p0[i] - p1[i]); >> } >> return sqrt(len2); >> } >> >> double >> CrossProduct(double p1[3], double p2[3], double p3[3]) >> { >> double a[3], b[3], o[3], v[3]; >> >> // Create the vector a and b. >> a[0] = p2[0] - p1[0]; >> a[1] = p2[1] - p1[1]; >> a[2] = p2[2] - p1[2]; >> b[0] = p3[0] - p1[0]; >> b[1] = p3[1] - p1[1]; >> b[2] = p3[2] - p1[2]; >> >> // Calculate the cross product of vector a and b. >> o[0] = 0.0; >> o[1] = 0.0; >> o[2] = 0.0; >> v[0] = (a[1] * b[2]) - (a[2] * b[1]); >> v[1] = (a[2] * b[0]) - (a[0] * b[2]); >> v[2] = (a[0] * b[1]) - (a[1] * b[0]); >> return fabs(lineLength(o, v)) / 2; >> } >> >> double >> HeronsFormula(double p1[3], double p2[3], double p3[3]) >> { >> double a = lineLength(p1, p2); >> double b = lineLength(p2, p3); >> double c = lineLength(p3, p1); >> >> return sqrt((a+b+c) * (-a+b+c) * (a-b+c) * (a+b-c)) * 0.25; >> } >> >> int >> main(void) >> { >> double A[3] = {-3.58117425311239667707, -3.58117425311239667707, 1.0}; >> double B[3] = {-3.04058712655619833853, -3.04058712655619833853, 0.95}; >> double C[3] = {-3.04058712655619833853, -3.04058712655619789444, 0.95}; >> double a = lineLength(A, B); >> double b = lineLength(B, C); >> double c = lineLength(C, A); >> >> cout << fixed << setprecision(20); >> cout << "TriangleArea(A, B, C): " << vtkTriangle::TriangleArea(A, B, C) << endl; >> cout << "TriangleArea(B, C, A): " << vtkTriangle::TriangleArea(B, C, A) << endl; >> cout << "CrossProduct(A, B, C): " << CrossProduct(A, B, C) << endl; >> cout << "CrossProduct(B, C, A): " << CrossProduct(B, C, A) << endl; >> cout << "HeronsFormula(A, B, C): " << HeronsFormula(A, B, C) << endl; >> cout << "HeronsFormula(B, C, A): " << HeronsFormula(B, C, A) << endl; >> cout << "RectangularTriangle: " << (a * b / 2) << endl; >> cout << "line length: a: " << a << ", b: " << b << ", c: " << c << endl; >> >> return 0; >> } >> $ g++ -g -I../../src -I/home/asou/freesw/vtk-5.10.1/include/vtk-5.10 triangle.cpp -Xlinker -rpath -Xlinker ../../src -L/home/asou/freesw/vtk-5.10.1/lib/vtk-5.10 -lvtkCommon -lvtkWidgets -Xlinker -rpath -Xlinker /home/asou/freesw/vtk-5.10.1/lib/vtk-5.10 >> In file included from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/backward/strstream:51, >> from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkIOStream.h:108, >> from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkSystemIncludes.h:40, >> from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkIndent.h:24, >> from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkObjectBase.h:43, >> from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkObject.h:41, >> from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkCell.h:40, >> from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkTriangle.h:23, >> from triangle.cpp:4: >> /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the header for the header for C++ includes, or instead of the deprecated header . To disable this warning use -Wno-deprecated. >> $ ./a.out >> TriangleArea(A, B, C): 0.00000000526835606386 >> TriangleArea(B, C, A): 0.00000000000000009839 >> CrossProduct(A, B, C): 0.00000000000000011168 >> CrossProduct(B, C, A): 0.00000000000000012055 >> HeronsFormula(A, B, C): 0.00000000000000011252 >> HeronsFormula(B, C, A): 0.00000000000000011252 >> RectangularTriangle: 0.00000000000000017012 >> line length: a: 0.76613894483740641039, b: 0.00000000000000044409, c: 0.76613894483740674346 >> $ >> >> Thanks in advance any help or suggestions. >> -- >> ASOU Masato >> _______________________________________________ >> 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 >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers > From asou at soum.co.jp Fri Aug 29 02:18:07 2014 From: asou at soum.co.jp (Masato Asou) Date: Fri, 29 Aug 2014 15:18:07 +0900 (JST) Subject: [vtkusers] TriangleArea() return the not correct value. In-Reply-To: References: <20140829.114115.128488439.asou@soum.co.jp> Message-ID: <20140829.151807.82067791.asou@soum.co.jp> I didn't aware about efficiency. I hope that I can choose whichever efficiency or quality. Thanks. -- ASOU Masato > Note that there is a difference in efficiency, because Heron's formula > requires applying sqrt() four times, while VTK's formula requires applying > sqrt() only once. > It might be worthwhile to use both Heron's formula and the current VTK > formula, with a discriminator to choose which based on the quality of the > triangle. > - David > > > On Thu, Aug 28, 2014 at 9:10 PM, Cory Quammen wrote: >> Masato, >> >> It looks like you are running into numerical precision problems >> because two of your points are extremely close, almost close enough to >> be indistinguishable by double precision. >> >> The inconsistencies that depend on the order the points are given are >> caused by which sides are considered in the cross product and area >> calculation. Heron's formula, which I wasn't aware of, seems to >> eliminate this inconsistency. We should consider using this in VTK, in >> particular the numerically more stable implementation: >> http://en.wikipedia.org/wiki/Heron's_formula#Numerical_stability >> >> I don't know if my answer helps, but thank you for pointing out Heron's formula. >> >> Thanks, >> Cory >> >> On Thu, Aug 28, 2014 at 10:41 PM, Masato Asou wrote: >>> Hi, >>> >>> I have a probrem about vtkTriangle::TriangleArea(). I use VTK-5.10.1. >>> >>> The triangle to be calculated is what one side is very short. >>> >>> I calculate the area of the triangle in vtkTriangle::TriangleArea(), >>> the result are different to that using the Heron's formula and cross >>> products. I also calculate tha area is regarded as a rectanglar triangle, >>> this value is also different vtkTriangle::TriangleArea() >>> >>> In addition, vtkTriangle::TriangleArea() return a different value when >>> change the order of the vertices. >>> >>> This problem be resolved? >>> >>> My system as: >>> >>> $ cat /etc/redhat-release >>> CentOS release 5.6 (Final) >>> $ uname -m -r -s -v >>> Linux 2.6.18-238.19.1.el5 #1 SMP Fri Jul 15 07:31:24 EDT 2011 x86_64 >>> >>> My program as below: >>> >>> $ cat triangle.cpp >>> #include >>> #include >>> using namespace std; >>> #include >>> >>> double >>> lineLength(const double p0[3], const double p1[3]) >>> { >>> double len2 = 0.0; >>> >>> for(int i = 0; i < 3; i++) { >>> len2 += (p0[i] - p1[i]) * (p0[i] - p1[i]); >>> } >>> return sqrt(len2); >>> } >>> >>> double >>> CrossProduct(double p1[3], double p2[3], double p3[3]) >>> { >>> double a[3], b[3], o[3], v[3]; >>> >>> // Create the vector a and b. >>> a[0] = p2[0] - p1[0]; >>> a[1] = p2[1] - p1[1]; >>> a[2] = p2[2] - p1[2]; >>> b[0] = p3[0] - p1[0]; >>> b[1] = p3[1] - p1[1]; >>> b[2] = p3[2] - p1[2]; >>> >>> // Calculate the cross product of vector a and b. >>> o[0] = 0.0; >>> o[1] = 0.0; >>> o[2] = 0.0; >>> v[0] = (a[1] * b[2]) - (a[2] * b[1]); >>> v[1] = (a[2] * b[0]) - (a[0] * b[2]); >>> v[2] = (a[0] * b[1]) - (a[1] * b[0]); >>> return fabs(lineLength(o, v)) / 2; >>> } >>> >>> double >>> HeronsFormula(double p1[3], double p2[3], double p3[3]) >>> { >>> double a = lineLength(p1, p2); >>> double b = lineLength(p2, p3); >>> double c = lineLength(p3, p1); >>> >>> return sqrt((a+b+c) * (-a+b+c) * (a-b+c) * (a+b-c)) * 0.25; >>> } >>> >>> int >>> main(void) >>> { >>> double A[3] = {-3.58117425311239667707, -3.58117425311239667707, 1.0}; >>> double B[3] = {-3.04058712655619833853, -3.04058712655619833853, 0.95}; >>> double C[3] = {-3.04058712655619833853, -3.04058712655619789444, 0.95}; >>> double a = lineLength(A, B); >>> double b = lineLength(B, C); >>> double c = lineLength(C, A); >>> >>> cout << fixed << setprecision(20); >>> cout << "TriangleArea(A, B, C): " << vtkTriangle::TriangleArea(A, B, C) << endl; >>> cout << "TriangleArea(B, C, A): " << vtkTriangle::TriangleArea(B, C, A) << endl; >>> cout << "CrossProduct(A, B, C): " << CrossProduct(A, B, C) << endl; >>> cout << "CrossProduct(B, C, A): " << CrossProduct(B, C, A) << endl; >>> cout << "HeronsFormula(A, B, C): " << HeronsFormula(A, B, C) << endl; >>> cout << "HeronsFormula(B, C, A): " << HeronsFormula(B, C, A) << endl; >>> cout << "RectangularTriangle: " << (a * b / 2) << endl; >>> cout << "line length: a: " << a << ", b: " << b << ", c: " << c << endl; >>> >>> return 0; >>> } >>> $ g++ -g -I../../src -I/home/asou/freesw/vtk-5.10.1/include/vtk-5.10 triangle.cpp -Xlinker -rpath -Xlinker ../../src -L/home/asou/freesw/vtk-5.10.1/lib/vtk-5.10 -lvtkCommon -lvtkWidgets -Xlinker -rpath -Xlinker /home/asou/freesw/vtk-5.10.1/lib/vtk-5.10 >>> In file included from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/backward/strstream:51, >>> from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkIOStream.h:108, >>> from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkSystemIncludes.h:40, >>> from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkIndent.h:24, >>> from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkObjectBase.h:43, >>> from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkObject.h:41, >>> from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkCell.h:40, >>> from /home/asou/freesw/vtk-5.10.1/include/vtk-5.10/vtkTriangle.h:23, >>> from triangle.cpp:4: >>> /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the header for the header for C++ includes, or instead of the deprecated header . To disable this warning use -Wno-deprecated. >>> $ ./a.out >>> TriangleArea(A, B, C): 0.00000000526835606386 >>> TriangleArea(B, C, A): 0.00000000000000009839 >>> CrossProduct(A, B, C): 0.00000000000000011168 >>> CrossProduct(B, C, A): 0.00000000000000012055 >>> HeronsFormula(A, B, C): 0.00000000000000011252 >>> HeronsFormula(B, C, A): 0.00000000000000011252 >>> RectangularTriangle: 0.00000000000000017012 >>> line length: a: 0.76613894483740641039, b: 0.00000000000000044409, c: 0.76613894483740674346 >>> $ >>> >>> Thanks in advance any help or suggestions. >>> -- >>> ASOU Masato >>> _______________________________________________ >>> 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 >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/vtkusers >> _______________________________________________ >> 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 >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers > From sholzergr at gmail.com Fri Aug 29 03:49:51 2014 From: sholzergr at gmail.com (Severin Holzer-Graf) Date: Fri, 29 Aug 2014 09:49:51 +0200 Subject: [vtkusers] Fix Ubuntu 14.04 VTK 6.1 compiling issue Message-ID: Hi, I faced the same compiling issue on Ubuntu 14.04 as mathew here: http://www.vtk.org/pipermail/vtkusers/2014-August/084877.html Compiling fails, because "GLsizeiptr has not been declared". The issue is that "vtkgl.h" is included *after* "GL/glx.h" which needs the typedefs for the datatypes from "vtkgl.h". I simply swapped the two lines and VTK compiles. Appended a patch that shows the change. Interestingly on my ArchLinux system compiling VTK 6.1 works out of the box and this was not necessary. I didn't further investigate that, so I'm not sure if swapping the two lines is actually the correct fix. Best Severin -------------- next part -------------- A non-text attachment was scrubbed... Name: ubuntu1404compiling.patch Type: text/x-patch Size: 820 bytes Desc: not available URL: From m.brehler at dkfz-heidelberg.de Fri Aug 29 05:29:13 2014 From: m.brehler at dkfz-heidelberg.de (Brehler, Michael) Date: Fri, 29 Aug 2014 11:29:13 +0200 Subject: [vtkusers] ThinPlateSpline regression Message-ID: <57EE86D11538B44096C712532DBB6C5A0109F370169B@DKFZEX01.ad.dkfz-heidelberg.de> Hi, I am using VTK to find a best fitting hyperplane (or regression plane) for a given 3D point cloud (polydata surface) and was wondering if the ThinPlateSplineTransform could be of any help. Can I use an equally distributed 'grid' of points to calculate the matching hyperplane with the ThinPlateSplineTransform or is there a better way? Regards, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Fri Aug 29 07:21:54 2014 From: cory.quammen at kitware.com (Cory Quammen) Date: Fri, 29 Aug 2014 07:21:54 -0400 Subject: [vtkusers] Fix Ubuntu 14.04 VTK 6.1 compiling issue In-Reply-To: References: Message-ID: Severin, For what it's worth, I am compiling VTK master without issue on Ubuntu 14.04, so it appears to be fixed for VTK 6.2. Dave, Can the 6.1.0 release be patched with Severin's patch, or the appropriate patch in VTK master after 6.1 (I haven't identified one)? Thanks, Cory On Fri, Aug 29, 2014 at 3:49 AM, Severin Holzer-Graf wrote: > Hi, > > I faced the same compiling issue on Ubuntu 14.04 as mathew here: > http://www.vtk.org/pipermail/vtkusers/2014-August/084877.html > Compiling fails, because "GLsizeiptr has not been declared". > > The issue is that "vtkgl.h" is included *after* "GL/glx.h" which needs > the typedefs for the datatypes from "vtkgl.h". > I simply swapped the two lines and VTK compiles. Appended a patch that > shows the change. > > Interestingly on my ArchLinux system compiling VTK 6.1 works out of > the box and this was not necessary. I didn't further investigate that, > so I'm not sure if swapping the two lines is actually the correct fix. > > Best > Severin > > _______________________________________________ > 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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > From david.gobbi at gmail.com Fri Aug 29 10:58:17 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 29 Aug 2014 08:58:17 -0600 Subject: [vtkusers] ThinPlateSpline regression In-Reply-To: <57EE86D11538B44096C712532DBB6C5A0109F370169B@DKFZEX01.ad.dkfz-heidelberg.de> References: <57EE86D11538B44096C712532DBB6C5A0109F370169B@DKFZEX01.ad.dkfz-heidelberg.de> Message-ID: Hi Michael, No, I don't think that ThinPlateSplineTransform provides a way to do this. I see a ComputeBestFittingPlane() method in vtkDelaunay2D, but it is a protected method and, looking at the method that it uses, I don't think it computes the "best" plane, anyway. Hopefully other people who have used VTK to compute the best-fit plane can give you a better answer, but my suggestion is to search the internet for a method that computes the best plane via an eigenvalue decomposition (my suspicion is that for the best-fit plane, the eigenvector for the smallest eigenvalue is the normal of the plane, and the "origin" of the plane is the centre-of-mass). The vtkMath::Jacobi() function can compute the eigenvalues. - David On Fri, Aug 29, 2014 at 3:29 AM, Brehler, Michael wrote: > Hi, > > > > I am using VTK to find a best fitting hyperplane (or regression plane) for a > given 3D point cloud (polydata surface) and was wondering if the > ThinPlateSplineTransform could be of any help. Can I use an equally > distributed 'grid' of points to calculate the matching hyperplane with the > ThinPlateSplineTransform or is there a better way? > > > > Regards, > > Michael From da.angulo39 at uniandes.edu.co Fri Aug 29 12:30:35 2014 From: da.angulo39 at uniandes.edu.co (diego0020) Date: Fri, 29 Aug 2014 09:30:35 -0700 (PDT) Subject: [vtkusers] GetKeySym and GetKeyCode for QVTKRenderWindowInteractor In-Reply-To: References: Message-ID: <1409329835348-5728511.post@n5.nabble.com> I have also found this problem, and my solution wsa handling key presses in vtk. I am using a vtk event filter to stop key presses from going to vtk. Of course a patch would be a better a solution regards -- View this message in context: http://vtk.1045678.n5.nabble.com/GetKeySym-and-GetKeyCode-for-QVTKRenderWindowInteractor-tp5728494p5728511.html Sent from the VTK - Users mailing list archive at Nabble.com. From da.angulo39 at uniandes.edu.co Fri Aug 29 12:33:33 2014 From: da.angulo39 at uniandes.edu.co (diego0020) Date: Fri, 29 Aug 2014 09:33:33 -0700 (PDT) Subject: [vtkusers] GetKeySym and GetKeyCode for QVTKRenderWindowInteractor In-Reply-To: <1409329835348-5728511.post@n5.nabble.com> References: <1409329835348-5728511.post@n5.nabble.com> Message-ID: <1409330013562-5728512.post@n5.nabble.com> Sorry, I wrote too fast. Here is what I meant: I have also found this problem, and my solution was handling key presses in QT. I am using a QT event filter to stop key presses from going to vtk. This is nice also because you can handle the key no matter which widget has focus. Best regards Diego A. -- View this message in context: http://vtk.1045678.n5.nabble.com/GetKeySym-and-GetKeyCode-for-QVTKRenderWindowInteractor-tp5728494p5728512.html Sent from the VTK - Users mailing list archive at Nabble.com. From andy.john.parker at googlemail.com Fri Aug 29 13:17:21 2014 From: andy.john.parker at googlemail.com (Andrew Parker) Date: Fri, 29 Aug 2014 18:17:21 +0100 Subject: [vtkusers] Potential bug in vtkPolygon normal and area calculations Message-ID: Dear all, This is driving me round the bend. When I have a meshing coming from a rectilinear source, I get NANs from my normal and face area calculations. When all other input meshes are used, i.e. unstructured, the results are correct. To test this I've written the following test code which makes a single cell mesh and produces the NANs. I then demonstrate that by using the transform classes, with zero rotation, I can then extract the same mesh back as a structured grid, and the errors disappear. I can also apply a non-zero rotation and the errors disappear too. Note I apply a rotation, zero or otherwise, because my hypothesis having stepped through 6.1 in the debugger, is that the vtk_pixel cell type (axis aligned) coming from the rectilinear grid does not play well with the normal calculation. But I can't find the bug, only that all entries of the normal are zero and the rest of the function fails. Clearly, and more likely, is that I could also not be using the classes correctly, and if so please let me know?? Hope somebody can find the bug, I've got nowhere on this after a day of looking. Again, anything non-axis aligned and or non vtk_pixel would appear to work as expected. Help appreciated, Cheers again, Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- cmake_minimum_required(VERSION 2.8) PROJECT(weird) set(CMAKE_COLOR_MAKEFILE ON) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra -Wall -Wconversion -pedantic -Wuninitialized -std=c++11 -Wno-extra-semi") FIND_PACKAGE(VTK REQUIRED NO_MODULE) INCLUDE(${VTK_USE_FILE}) find_package(Qt5Widgets REQUIRED) set(SOURCES main.cxx) ADD_EXECUTABLE(weird ${SOURCES}) TARGET_LINK_LIBRARIES(weird ${VTK_LIBRARIES}) -------------- next part -------------- A non-text attachment was scrubbed... Name: main.cxx Type: text/x-c++src Size: 3883 bytes Desc: not available URL: From wumengda at gmail.com Fri Aug 29 13:23:54 2014 From: wumengda at gmail.com (Wei Xiong) Date: Fri, 29 Aug 2014 17:23:54 +0000 Subject: [vtkusers] From: Wei Xiong Message-ID: Hi vtkusers http://erzincanhotel.com/person.php?dubx3112tbe wumengda at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.schussman at gmail.com Fri Aug 29 13:59:30 2014 From: greg.schussman at gmail.com (Greg Schussman) Date: Fri, 29 Aug 2014 10:59:30 -0700 Subject: [vtkusers] GetKeySym and GetKeyCode for QVTKRenderWindowInteractor In-Reply-To: References: Message-ID: Hi, David. Thanks for the speedy reply. On looking closer, it appears to me that Qt doesn't exactly provide keysym strings. there is a .text() function, but that's already being used for key. Using it for keysym as well, would work for the 'a' to 'z' keys, but not for keys such as 'Escape'. Now, I see a qt_key_to_key_sym(Qt::Key) function defined in GUISupport/Qt/QVTKInteractorAdapter.cxx. This appears to do exactly what we want (converting a Qt key to a vtk keysym), but I'm not clear on how to call it from python. If you can provide a hint to get me unstuck here, I'd be happy to provide that patch. Thanks again. Greg On Thu, Aug 28, 2014 at 3:14 PM, David Gobbi wrote: > Hi Greg, > > I looked through QVTKRenderWindowInteractor.py and discovered > this in its keyPressEvent() method: > > self._Iren.SetEventInformationFlipY(self.__saveX, self.__saveY, > ctrl, shift, key, 0, None) > > Compare this with the arguments that the method expects > (in vtkRenderWindowInteractor.h): > > void SetEventInformationFlipY(int x, int y, int ctrl, int shift, > char keycode, int repeatcount, const char* keysym) > > As you can see, the author of this class was a bit lazy and passed > None as the keysym, instead of getting the keysym from Qt and > then passing it through to VTK. But to be fair, this code was written > twelve years ago and maybe keysyms weren't the highest priority. > > If you can patch QVTKRenderWindowInteractor.py so that it passes > the keysym strings from Qt to "self._Iren", then I can add your patch > to the VTK master. > > - David > > > On Thu, Aug 28, 2014 at 3:49 PM, Greg Schussman > wrote: > > Oops. > > > > I forgot to mention that I'm using python-2.6, vtk-5.10.1, and qt-4.6.1. > > > > Greg > > > > > > > > On Thu, Aug 28, 2014 at 2:14 PM, Greg Schussman < > greg.schussman at gmail.com> > > wrote: > >> > >> Hi. > >> > >> I've got a working python vtk demo that uses a > vtkRenderWindowInteractor, > >> with the style set to vtkInteractorStyleTrackballCamera. I run into a > >> problem when I try to embed this in Qt. > >> > >> I use interactor.AddObserver('KeyPressEvent', key_handler) to see key > >> presses and act on them. > >> > >> In my key_handler function, I query the interactor (passed in as an > >> argument to key_handler) about which key was pressed. > >> > >> In my working example: > >> > >> when I press 'b', > >> interactor.GetKeyCode() gives 'b', and > >> interactor.GetKeySym() give 'b'. > >> > >> when I press esc, > >> interactor.GetKeyCode() gives an unprintable character, and > >> interactor.GetKeySym() gives 'Escape'. > >> > >> In my non-working Qt example, I use QVTKRenderWindowInteractor(frame) > >> instead (copied from the VTK/Examples/Python/Widgets/EmbedPyQt example). > >> > >> now, when I press 'b', > >> interactor.GetKeyCode() gives 'b', and > >> interactor.GetKeySym() gives None. > >> > >> when I press esc, > >> interactor.GetKeyCode() gives an unprintable character, and > >> interactor.GetKeySym() gives None. > >> > >> So, originally, I used GetKeySym(), but when switching to the > >> QVTKRenderWindowInteractor, that stopped working (always returning > None). > >> I'm concerned about possible inconsistencies from one linux machine to > >> another when using GetKeyCode, so I'm reluctant to use it. > >> > >> What should I do here? Is there any reason why the > >> QTVTKRenderWindowInteractor would be giving None for the KeySym? > >> > >> For what it's worth, my demo code runs both with regular vtk and > embedded > >> in pyqt, and the mouse interaction is fine, and the '3' option does > toggle > >> stereo in both cases. But for some reason my observer can see the key > with > >> GetKeySym in regular vtk mode, but not in embedded pyqt mode. > >> > >> Thanks in advance for any help or suggestions. > >> > >> Greg > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Fri Aug 29 14:24:34 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 29 Aug 2014 12:24:34 -0600 Subject: [vtkusers] GetKeySym and GetKeyCode for QVTKRenderWindowInteractor In-Reply-To: References: Message-ID: Hi Greg, Originally the keysyms in VTK only worked on UNIX and Linux (i.e. only for the vtkXRenderWindowInteractor). But I needed them on other operating systems, so I looked up the documentation for all the other OS's and created the appropriate lookup tables to convert the raw keycodes for those OS's into keysyms. E.g. here is the one for Win32: http://vtk.org/gitweb?p=VTK.git;a=blob;f=Rendering/OpenGL/vtkWin32RenderWindowInteractor.cxx;h=43c278ba#l277 So of course, the same approach should be possible for Qt. If Qt doesn't provide the keysyms directly, then make a python "dict" that maps Qt's key codes into keysyms. In fact, I can even give you some code that does "roughly" what you need. For my own apps, I convert Qt key codes into my own "cbKey" codes. These aren't the same as keysyms, but the concept is identical. Here is my C++ code (in python, this should be even easier): --------------------------------- bool cbQtWidget::convertQtKeyEvent(QKeyEvent *qe) { // For conversion of certain keys to cbKey constants. static const cbKey::EnumType asciiToKey[] = { cbKey::Space, cbKey::Exclam, cbKey::QuoteDbl, cbKey::NumberSign, cbKey::Dollar, cbKey::Percent, cbKey::Ampersand, cbKey::QuoteRight, cbKey::ParenLeft, cbKey::ParenRight, cbKey::Asterisk, cbKey::Plus, cbKey::Comma, cbKey::Minus, cbKey::Period, cbKey::Slash, cbKey::Zero, cbKey::One, cbKey::Two, cbKey::Three, cbKey::Four, cbKey::Five, cbKey::Six, cbKey::Seven, cbKey::Eight, cbKey::Nine, cbKey::Colon, cbKey::Semicolon, cbKey::Less, cbKey::Equal, cbKey::Greater, cbKey::Question, cbKey::At, cbKey::A, cbKey::B, cbKey::C, cbKey::D, cbKey::E, cbKey::F, cbKey::G, cbKey::H, cbKey::I, cbKey::J, cbKey::K, cbKey::L, cbKey::M, cbKey::N, cbKey::O, cbKey::P, cbKey::Q, cbKey::R, cbKey::S, cbKey::T, cbKey::U, cbKey::V, cbKey::W, cbKey::X, cbKey::Y, cbKey::Z, cbKey::BracketLeft, cbKey::Backslash, cbKey::BracketRight, cbKey::AsciiCircum, cbKey::Underscore, cbKey::QuoteLeft, cbKey::A, cbKey::B, cbKey::C, cbKey::D, cbKey::E, cbKey::F, cbKey::G, cbKey::H, cbKey::I, cbKey::J, cbKey::K, cbKey::L, cbKey::M, cbKey::N, cbKey::O, cbKey::P, cbKey::Q, cbKey::R, cbKey::S, cbKey::T, cbKey::U, cbKey::V, cbKey::W, cbKey::X, cbKey::Y, cbKey::Z, cbKey::BraceLeft, cbKey::Bar, cbKey::BraceRight, cbKey::AsciiTilde, }; cbEventType type; switch (qe->type()) { case QEvent::KeyPress: type = cbEventType::KeyPress; break; case QEvent::KeyRelease: type = cbEventType::KeyRelease; break; default: return false; } saveQtKeyboardModifiers(qe->modifiers()); cbKey key; if (qe->key() >= ' ' && qe->key() <= '~') { key = asciiToKey[qe->key() - ' ']; } else switch(qe->key()) { case Qt::Key_Alt: key = cbKey::Alt; break; case Qt::Key_AltGr: key = cbKey::AltGraph; break; case Qt::Key_CapsLock: key = cbKey::CapsLock; break; case Qt::Key_Control: key = cbKey::Control; break; case Qt::Key_Meta: key = cbKey::Meta; break; case Qt::Key_NumLock: key = cbKey::NumLock; break; case Qt::Key_Shift: key = cbKey::Shift; break; case Qt::Key_Enter: key = cbKey::Enter; break; case Qt::Key_Tab: key = cbKey::Tab; break; case Qt::Key_Down: key = cbKey::ArrowDown; break; case Qt::Key_Left: key = cbKey::ArrowLeft; break; case Qt::Key_Right: key = cbKey::ArrowRight; break; case Qt::Key_Up: key = cbKey::ArrowUp; break; case Qt::Key_End: key = cbKey::End; break; case Qt::Key_Home: key = cbKey::Home; break; case Qt::Key_PageDown: key = cbKey::PageDown; break; case Qt::Key_PageUp: key = cbKey::PageUp; break; case Qt::Key_Backspace: key = cbKey::Backspace; break; case Qt::Key_Clear: key = cbKey::Clear; break; case Qt::Key_Copy: key = cbKey::Copy; break; case Qt::Key_Cut: key = cbKey::Cut; break; case Qt::Key_Delete: key = cbKey::Delete; break; case Qt::Key_Insert: key = cbKey::Insert; break; case Qt::Key_Paste: key = cbKey::Paste; break; case Qt::Key_Cancel: key = cbKey::Cancel; break; case Qt::Key_Menu: key = cbKey::ContextMenu; break; case Qt::Key_Escape: key = cbKey::Escape; break; case Qt::Key_Help: key = cbKey::Help; break; case Qt::Key_Pause: key = cbKey::Pause; break; case Qt::Key_Play: key = cbKey::Play; break; case Qt::Key_ScrollLock: key = cbKey::ScrollLock; break; case Qt::Key_ZoomIn: key = cbKey::ZoomIn; break; case Qt::Key_ZoomOut: key = cbKey::ZoomOut; break; case Qt::Key_Camera: key = cbKey::Camera; break; case Qt::Key_Eject: key = cbKey::Eject; break; case Qt::Key_LogOff: key = cbKey::LogOff; break; case Qt::Key_PowerOff: key = cbKey::PowerOff; break; case Qt::Key_Print: key = cbKey::PrintScreen; break; case Qt::Key_Hibernate: key = cbKey::Hibernate; break; case Qt::Key_Standby: key = cbKey::Standby; break; case Qt::Key_WakeUp: key = cbKey::WakeUp; break; case Qt::Key_F1: key = cbKey::F1; break; case Qt::Key_F2: key = cbKey::F2; break; case Qt::Key_F3: key = cbKey::F3; break; case Qt::Key_F4: key = cbKey::F4; break; case Qt::Key_F5: key = cbKey::F5; break; case Qt::Key_F6: key = cbKey::F6; break; case Qt::Key_F7: key = cbKey::F7; break; case Qt::Key_F8: key = cbKey::F8; break; case Qt::Key_F9: key = cbKey::F9; break; case Qt::Key_F10: key = cbKey::F10; break; case Qt::Key_F11: key = cbKey::F11; break; case Qt::Key_F12: key = cbKey::F12; break; default: key = cbKey::Any; break; } QByteArray text = qe->text().toUtf8(); cbKeyEvent e( type, cbEventXY(m_XY[0], m_XY[1]), cbGlobalXY(m_GlobalXY[0], m_GlobalXY[1]), key, text.data(), m_Modifiers); m_ViewFrame->ProcessEvent(&e); return e.GetProcessed(); } - David On Fri, Aug 29, 2014 at 11:59 AM, Greg Schussman wrote: > Hi, David. > > Thanks for the speedy reply. > > On looking closer, it appears to me that Qt doesn't exactly provide keysym > strings. there is a .text() function, but that's already being used for > key. Using it for keysym as well, would work for the 'a' to 'z' keys, but > not for keys such as 'Escape'. > > Now, I see a qt_key_to_key_sym(Qt::Key) function defined in > GUISupport/Qt/QVTKInteractorAdapter.cxx. This appears to do exactly what we > want (converting a Qt key to a vtk keysym), but I'm not clear on how to call > it from python. > > If you can provide a hint to get me unstuck here, I'd be happy to provide > that patch. > > Thanks again. > > Greg > > > > On Thu, Aug 28, 2014 at 3:14 PM, David Gobbi wrote: >> >> Hi Greg, >> >> I looked through QVTKRenderWindowInteractor.py and discovered >> this in its keyPressEvent() method: >> >> self._Iren.SetEventInformationFlipY(self.__saveX, self.__saveY, >> ctrl, shift, key, 0, None) >> >> Compare this with the arguments that the method expects >> (in vtkRenderWindowInteractor.h): >> >> void SetEventInformationFlipY(int x, int y, int ctrl, int shift, >> char keycode, int repeatcount, const char* keysym) >> >> As you can see, the author of this class was a bit lazy and passed >> None as the keysym, instead of getting the keysym from Qt and >> then passing it through to VTK. But to be fair, this code was written >> twelve years ago and maybe keysyms weren't the highest priority. >> >> If you can patch QVTKRenderWindowInteractor.py so that it passes >> the keysym strings from Qt to "self._Iren", then I can add your patch >> to the VTK master. >> >> - David >> >> >> On Thu, Aug 28, 2014 at 3:49 PM, Greg Schussman >> wrote: >> > Oops. >> > >> > I forgot to mention that I'm using python-2.6, vtk-5.10.1, and qt-4.6.1. >> > >> > Greg >> > >> > >> > >> > On Thu, Aug 28, 2014 at 2:14 PM, Greg Schussman >> > >> > wrote: >> >> >> >> Hi. >> >> >> >> I've got a working python vtk demo that uses a >> >> vtkRenderWindowInteractor, >> >> with the style set to vtkInteractorStyleTrackballCamera. I run into a >> >> problem when I try to embed this in Qt. >> >> >> >> I use interactor.AddObserver('KeyPressEvent', key_handler) to see key >> >> presses and act on them. >> >> >> >> In my key_handler function, I query the interactor (passed in as an >> >> argument to key_handler) about which key was pressed. >> >> >> >> In my working example: >> >> >> >> when I press 'b', >> >> interactor.GetKeyCode() gives 'b', and >> >> interactor.GetKeySym() give 'b'. >> >> >> >> when I press esc, >> >> interactor.GetKeyCode() gives an unprintable character, and >> >> interactor.GetKeySym() gives 'Escape'. >> >> >> >> In my non-working Qt example, I use QVTKRenderWindowInteractor(frame) >> >> instead (copied from the VTK/Examples/Python/Widgets/EmbedPyQt >> >> example). >> >> >> >> now, when I press 'b', >> >> interactor.GetKeyCode() gives 'b', and >> >> interactor.GetKeySym() gives None. >> >> >> >> when I press esc, >> >> interactor.GetKeyCode() gives an unprintable character, and >> >> interactor.GetKeySym() gives None. >> >> >> >> So, originally, I used GetKeySym(), but when switching to the >> >> QVTKRenderWindowInteractor, that stopped working (always returning >> >> None). >> >> I'm concerned about possible inconsistencies from one linux machine to >> >> another when using GetKeyCode, so I'm reluctant to use it. >> >> >> >> What should I do here? Is there any reason why the >> >> QTVTKRenderWindowInteractor would be giving None for the KeySym? >> >> >> >> For what it's worth, my demo code runs both with regular vtk and >> >> embedded >> >> in pyqt, and the mouse interaction is fine, and the '3' option does >> >> toggle >> >> stereo in both cases. But for some reason my observer can see the key >> >> with >> >> GetKeySym in regular vtk mode, but not in embedded pyqt mode. >> >> >> >> Thanks in advance for any help or suggestions. >> >> >> >> Greg > > From yuetian926 at 163.com Sun Aug 31 09:15:15 2014 From: yuetian926 at 163.com (Yuetian Liu) Date: Sun, 31 Aug 2014 21:15:15 +0800 (CST) Subject: [vtkusers] the pronlem of blending two volume by vtkImageBlend Message-ID: <2cd8271f.52f8.1482c348fc3.Coremail.yuetian926@163.com> Hi vtkusers, I want to blend the two volumes by vtkImageBlend. And I use vtkMetaImageReader to read two volumes(CT and MR) Then I use the vtkImageBlend to blend two volumes. And then I use the Ray Casting Algorithm to render the two volumes after blending. But the result has one color. And it is not the result that I want. My hoping result is that the CT volume is red and the MR volume was blue. How can I solve it. Please help me. And my code is attached. Thank you very much! Bset Yuetian #include #include #include #include #include #include #include "vtkMetaImageReader.h" #include #include "vtkPiecewiseFunction.h" #include "vtkColorTransferFunction.h" #include "vtkVolumeProperty.h" #include "vtkVolumeRayCastCompositeFunction.h" #include "vtkVolumeRayCastMapper.h" #include "vtkVolume.h" #include "vtkImageCast.h" #include int main ( int argc, char* argv[] ) { std::string input1Filename = argv[1]; std::string input2Filename = argv[2]; vtkSmartPointerReader1 = vtkSmartPointer::New(); Reader1->SetFileName ( input1Filename.c_str() ); vtkSmartPointer jReader2 = vtkSmartPointer::New(); Reader2->SetFileName ( input2Filename.c_str() ); vtkSmartPointer imgBlender = vtkSmartPointer::New(); imgBlender->SetOpacity( 0, 0.2 ); imgBlender->SetOpacity( 1, 0.6 ); imgBlender->AddInputConnection( Reader1->GetOutputPort() ); imgBlender->AddInputConnection( Reader2->GetOutputPort() ); vtkSmartPointer< vtkImageCast> readerImageCast = vtkSmartPointer< vtkImageCast>::New(); readerImageCast->SetInputConnection(imgBlender->GetOutputPort()); readerImageCast->SetOutputScalarTypeToUnsignedShort (); readerImageCast->ClampOverflowOn(); vtkSmartPointer< vtkPiecewiseFunction> opacityTransferFunction = vtkSmartPointer< vtkPiecewiseFunction>::New(); opacityTransferFunction->AddPoint(20, 0.0); opacityTransferFunction->AddPoint(255, 0.8); vtkSmartPointer< vtkColorTransferFunction > colorTransferFunction = vtkSmartPointer< vtkColorTransferFunction > ::New(); colorTransferFunction->AddRGBPoint(0,0.9,0.7,0.5); colorTransferFunction->AddRGBPoint(15,1,0.7,0.6); colorTransferFunction->AddRGBPoint(255,1,0,0); vtkSmartPointer volumeProperty = vtkSmartPointer::New(); volumeProperty->SetColor(colorTransferFunction); volumeProperty->SetScalarOpacity(opacityTransferFunction); volumeProperty->ShadeOn(); volumeProperty->SetInterpolationTypeToLinear(); volumeProperty->SetSpecular(0.1); volumeProperty->SetSpecularPower(8); volumeProperty->SetScalarOpacityUnitDistance(0.8919); vtkSmartPointer compositeFunction = vtkSmartPointer::New(); vtkSmartPointer< vtkVolumeRayCastMapper> volumeMapper = vtkSmartPointer< vtkVolumeRayCastMapper> ::New(); volumeMapper->SetVolumeRayCastFunction(compositeFunction); volumeMapper->SetInputConnection(readerImageCast->GetOutputPort()); volumeMapper->SetNumberOfThreads(3); vtkSmartPointer volume = vtkSmartPointer::New(); volume->SetMapper(volumeMapper); volume->SetProperty(volumeProperty); vtkSmartPointer renderer = vtkSmartPointer::New(); vtkSmartPointer renderWindow = vtkSmartPointer::New(); renderWindow->AddRenderer(renderer); vtkSmartPointer renderWindowInteractor = vtkSmartPointer::New(); renderWindowInteractor->SetRenderWindow(renderWindow); renderer->AddVolume(volume); renderWindow->Render(); renderWindowInteractor->Start(); return EXIT_SUCCESS; } -------------- next part -------------- An HTML attachment was scrubbed... URL: From yuetian926 at 163.com Sun Aug 31 09:05:01 2014 From: yuetian926 at 163.com (Yuetian Liu) Date: Sun, 31 Aug 2014 21:05:01 +0800 (CST) Subject: [vtkusers] the pronlem of blending two volume by vtkImageBlend Message-ID: <12b735e1.51b5.1482c2b3112.Coremail.yuetian926@163.com> Hi vtkusers, I want to blend the two volumes by vtkImageBlend. And I use vtkMetaImageReader to read two volumes(CT and MR) Then I use the vtkImageBlend to blend two volumes. And then I use the Ray Casting Algorithm to render the two volumes after blending. But the result has one color. And it is not the result that I want. My hoping result is that the CT volume is red and the MR volume was blue. How can I solve it. Please help me. And my code is attached. Thank you very much! Bset Yuetian #include #include #include #include #include #include #include "vtkMetaImageReader.h" #include #include "vtkPiecewiseFunction.h" #include "vtkColorTransferFunction.h" #include "vtkVolumeProperty.h" #include "vtkVolumeRayCastCompositeFunction.h" #include "vtkVolumeRayCastMapper.h" #include "vtkVolume.h" #include "vtkImageCast.h" #include int main ( int argc, char* argv[] ) { std::string input1Filename = argv[1]; std::string input2Filename = argv[2]; vtkSmartPointerReader1 = vtkSmartPointer::New(); Reader1->SetFileName ( input1Filename.c_str() ); vtkSmartPointer jReader2 = vtkSmartPointer::New(); Reader2->SetFileName ( input2Filename.c_str() ); vtkSmartPointer imgBlender = vtkSmartPointer::New(); imgBlender->SetOpacity( 0, 0.2 ); imgBlender->SetOpacity( 1, 0.6 ); imgBlender->AddInputConnection( Reader1->GetOutputPort() ); imgBlender->AddInputConnection( Reader2->GetOutputPort() ); vtkSmartPointer< vtkImageCast> readerImageCast = vtkSmartPointer< vtkImageCast>::New(); readerImageCast->SetInputConnection(imgBlender->GetOutputPort()); readerImageCast->SetOutputScalarTypeToUnsignedShort (); readerImageCast->ClampOverflowOn(); vtkSmartPointer< vtkPiecewiseFunction> opacityTransferFunction = vtkSmartPointer< vtkPiecewiseFunction>::New(); opacityTransferFunction->AddPoint(20, 0.0); opacityTransferFunction->AddPoint(255, 0.8); vtkSmartPointer< vtkColorTransferFunction > colorTransferFunction = vtkSmartPointer< vtkColorTransferFunction > ::New(); colorTransferFunction->AddRGBPoint(0,0.9,0.7,0.5); colorTransferFunction->AddRGBPoint(15,1,0.7,0.6); colorTransferFunction->AddRGBPoint(255,1,0,0); vtkSmartPointer volumeProperty = vtkSmartPointer::New(); volumeProperty->SetColor(colorTransferFunction); volumeProperty->SetScalarOpacity(opacityTransferFunction); volumeProperty->ShadeOn(); volumeProperty->SetInterpolationTypeToLinear(); volumeProperty->SetSpecular(0.1); volumeProperty->SetSpecularPower(8); volumeProperty->SetScalarOpacityUnitDistance(0.8919); vtkSmartPointer compositeFunction = vtkSmartPointer::New(); vtkSmartPointer< vtkVolumeRayCastMapper> volumeMapper = vtkSmartPointer< vtkVolumeRayCastMapper> ::New(); volumeMapper->SetVolumeRayCastFunction(compositeFunction); volumeMapper->SetInputConnection(readerImageCast->GetOutputPort()); volumeMapper->SetNumberOfThreads(3); vtkSmartPointer volume = vtkSmartPointer::New(); volume->SetMapper(volumeMapper); volume->SetProperty(volumeProperty); vtkSmartPointer renderer = vtkSmartPointer::New(); vtkSmartPointer renderWindow = vtkSmartPointer::New(); renderWindow->AddRenderer(renderer); vtkSmartPointer renderWindowInteractor = vtkSmartPointer::New(); renderWindowInteractor->SetRenderWindow(renderWindow); renderer->AddVolume(volume); renderWindow->Render(); renderWindowInteractor->Start(); return EXIT_SUCCESS; } -------------- next part -------------- An HTML attachment was scrubbed... URL: From yuetian926 at 163.com Sun Aug 31 21:07:16 2014 From: yuetian926 at 163.com (Yuetian Liu) Date: Mon, 1 Sep 2014 09:07:16 +0800 (CST) Subject: [vtkusers] blending two volume by vtkImageBlend and how to rendering them by different color Message-ID: <5475ef2e.181f.1482ec0708b.Coremail.yuetian926@163.com> Hi vtkusers, I want to blend the two volumes by vtkImageBlend. And I use vtkMetaImageReader to read two volumes(CT and MR) Then I use the vtkImageBlend to blend two volumes. And then I use the Ray Casting Algorithm to render the two volumes after blending. But the result has one color. And it is not the result that I want. My hoping result is that the CT volume is red and the MR volume was blue. How can I solve it. Please help me. And my code is attached. Thank you very much! Bset Yuetian #include #include #include #include #include #include #include "vtkMetaImageReader.h" #include #include "vtkPiecewiseFunction.h" #include "vtkColorTransferFunction.h" #include "vtkVolumeProperty.h" #include "vtkVolumeRayCastCompositeFunction.h" #include "vtkVolumeRayCastMapper.h" #include "vtkVolume.h" #include "vtkImageCast.h" #include int main ( int argc, char* argv[] ) { std::string input1Filename = argv[1]; std::string input2Filename = argv[2]; vtkSmartPointerReader1 = vtkSmartPointer::New(); Reader1->SetFileName ( input1Filename.c_str() ); vtkSmartPointer jReader2 = vtkSmartPointer::New(); Reader2->SetFileName ( input2Filename.c_str() ); vtkSmartPointer imgBlender = vtkSmartPointer::New(); imgBlender->SetOpacity( 0, 0.2 ); imgBlender->SetOpacity( 1, 0.6 ); imgBlender->AddInputConnection( Reader1->GetOutputPort() ); imgBlender->AddInputConnection( Reader2->GetOutputPort() ); vtkSmartPointer< vtkImageCast> readerImageCast = vtkSmartPointer< vtkImageCast>::New(); readerImageCast->SetInputConnection(imgBlender->GetOutputPort()); readerImageCast->SetOutputScalarTypeToUnsignedShort (); readerImageCast->ClampOverflowOn(); vtkSmartPointer< vtkPiecewiseFunction> opacityTransferFunction = vtkSmartPointer< vtkPiecewiseFunction>::New(); opacityTransferFunction->AddPoint(20, 0.0); opacityTransferFunction->AddPoint(255, 0.8); vtkSmartPointer< vtkColorTransferFunction > colorTransferFunction = vtkSmartPointer< vtkColorTransferFunction > ::New(); colorTransferFunction->AddRGBPoint(0,0.9,0.7,0.5); colorTransferFunction->AddRGBPoint(15,1,0.7,0.6); colorTransferFunction->AddRGBPoint(255,1,0,0); vtkSmartPointer volumeProperty = vtkSmartPointer::New(); volumeProperty->SetColor(colorTransferFunction); volumeProperty->SetScalarOpacity(opacityTransferFunction); volumeProperty->ShadeOn(); volumeProperty->SetInterpolationTypeToLinear(); volumeProperty->SetSpecular(0.1); volumeProperty->SetSpecularPower(8); volumeProperty->SetScalarOpacityUnitDistance(0.8919); vtkSmartPointer compositeFunction = vtkSmartPointer::New(); vtkSmartPointer< vtkVolumeRayCastMapper> volumeMapper = vtkSmartPointer< vtkVolumeRayCastMapper> ::New(); volumeMapper->SetVolumeRayCastFunction(compositeFunction); volumeMapper->SetInputConnection(readerImageCast->GetOutputPort()); volumeMapper->SetNumberOfThreads(3); vtkSmartPointer volume = vtkSmartPointer::New(); volume->SetMapper(volumeMapper); volume->SetProperty(volumeProperty); vtkSmartPointer renderer = vtkSmartPointer::New(); vtkSmartPointer renderWindow = vtkSmartPointer::New(); renderWindow->AddRenderer(renderer); vtkSmartPointer renderWindowInteractor = vtkSmartPointer::New(); renderWindowInteractor->SetRenderWindow(renderWindow); renderer->AddVolume(volume); renderWindow->Render(); renderWindowInteractor->Start(); return EXIT_SUCCESS; } -------------- next part -------------- An HTML attachment was scrubbed... URL: