From richard.j.brown at live.co.uk Thu Jan 1 11:00:11 2015 From: richard.j.brown at live.co.uk (mbcx9rb9) Date: Thu, 1 Jan 2015 09:00:11 -0700 (MST) Subject: [vtkusers] vtkinteractor (point picker) in Qt In-Reply-To: <1419953055642-5729959.post@n5.nabble.com> References: <1419953055642-5729959.post@n5.nabble.com> Message-ID: <1420128011737-5729969.post@n5.nabble.com> In case someone has the problem in the future, the problem was solved by including empty PrintSelf, PrintTrailer and PrintHeader functions: void PrintSelf(ostream & os, vtkIndent indent){} void PrintHeader(ostream & os, vtkIndent indent){} void PrintTrailer(ostream & os, vtkIndent indent){} -- View this message in context: http://vtk.1045678.n5.nabble.com/vtkinteractor-point-picker-in-Qt-tp5729959p5729969.html Sent from the VTK - Users mailing list archive at Nabble.com. From lifestudent37 at gmail.com Thu Jan 1 19:29:53 2015 From: lifestudent37 at gmail.com (Student Life) Date: Fri, 2 Jan 2015 00:29:53 +0000 Subject: [vtkusers] Storing actors into memory C++ Message-ID: Hi, I am going to be using C++ to develop a software that allows the user to interact with multiple objects/actors on the screen. They should be able to move objects/actors independently from one another. The thing is, I need to store all of this in memory and so I have come up with this class structure to store objects in memory. I also have another class to handle the vtkPicker, i.e. if points are selected on the actor, then they stay there even if that object/actor is moved independently the points should move with it. I am thinking of using inheritance, this is my sort of class structure... Actor Class... class ScreenObjects { vtkActor (LinkedList); // I intend on using a linkedlist to store all the actors public: ScreenObjects(); // Constructor. Initializes vtkActor to null. void readSTLFile(); // Reads the STL File bool setObject(); // Sets current object, so you can only interact with the selected object void reset(); //Resets everything, including vtkActors } Picker Class... class PickerActor : class ScreenObjects { public: PickerActor(); } Would really appreciate it if you could give me some ideas or suggestions for my class structure. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.j.redmond at gmail.com Fri Jan 2 15:39:41 2015 From: michael.j.redmond at gmail.com (redmod79) Date: Fri, 2 Jan 2015 13:39:41 -0700 (MST) Subject: [vtkusers] triangulate a self-intersecting polygon Message-ID: <1420231181938-5729973.post@n5.nabble.com> Is it possible using VTK to triangulate a self-intersecting polygon? For example, a polygon shaped as a star, with the lines intersecting each other? I want to extract the triangles that would be considered inside the star using the ray intersection method where an even number of intersections is outside and an odd number is inside (resulting in the outside triangles of the star to be inside and the middle pentagram to be outside). Can I use vtkTriangleFilter for this? If so, how would I define the star? A vtkPolygon cannot be self-intersecting. Thanks. -- View this message in context: http://vtk.1045678.n5.nabble.com/triangulate-a-self-intersecting-polygon-tp5729973.html Sent from the VTK - Users mailing list archive at Nabble.com. From prashanth.dumpuri at gmail.com Fri Jan 2 20:31:41 2015 From: prashanth.dumpuri at gmail.com (Prashanth) Date: Fri, 2 Jan 2015 17:31:41 -0800 Subject: [vtkusers] explanation for four pane viewer example Message-ID: All, I'm trying to set up my code similar to the four pane viewer example and have trouble understanding how the 3D view is displayed (on top right). In my understanding, these 3 lines are responsible for the 3D view vtkSmartPointer< vtkRenderer > ren = vtkSmartPointer< vtkRenderer >::New(); this->ui->view4->GetRenderWindow()->AddRenderer(ren); vtkRenderWindowInteractor *iren = this->ui->view4->GetInteractor(); But I don't see inputs or actors to the renderer 'ren'. Can you please help me understand how the 3D view in top right corner is being generated and displayed? Thanks Prashanth -------------- next part -------------- An HTML attachment was scrubbed... URL: From castellanoslizan at gmail.com Sat Jan 3 10:51:06 2015 From: castellanoslizan at gmail.com (Lizeth Castellanos) Date: Sat, 3 Jan 2015 13:51:06 -0200 Subject: [vtkusers] PCA Message-ID: Hello vtk-users I have a structure in a 3D volume image, and I calculated 3 different arrays, each one contain a feature of these structure. I'm interested to using PCA for analyses these 3 vectors features. I saw the examples vtkPCAAnalysisFilter and vtkPCAStatistics , and for me is not clear which is more adequate class to my problem. Someone have any suggestion? Could someone tell me more details about your experience using those pca classes, please? Any help provided for this would be greatly appreciated! -Lizeth -------------- next part -------------- An HTML attachment was scrubbed... URL: From nadim.farhat at gmail.com Sat Jan 3 15:57:25 2015 From: nadim.farhat at gmail.com (Nadim Farhat) Date: Sat, 3 Jan 2015 12:57:25 -0800 Subject: [vtkusers] vtkrendering module Message-ID: Hi All, I have been trying to build VTK and run the first example in the tutorial, the cone , I copied the the Cone.cxx and CMakeLists to different directory from the git clone directory ( master branch). then i created a build directory for to build the executable. during cmake configure cmake is returning the following error CMake Error at C:/VTK/CMake/vtkModuleAPI.cmake:120 (message): Requested modules not available: vtkRendering Call Stack (most recent call first): C:/VTKBuild/VTKConfig.cmake:84 (vtk_module_config) CMakeLists.txt:11 (find_package) I am using Windows 8.1 , VS 12 ,Cmake 3.1 i selected the following options during the VTK build, I am using Qt 5.2.1 opengl Module_vtkFiltersMatlab Module_vtkGUISupportMFC Module_vtkRenderingParallel Module_vtkRenderingVolumeOpenGLNew VTK_Group_Imagaing VTK_Group_QT VTK_Group_Rendering VTK_GroupStandAlone Thanks Nadim -------------- next part -------------- An HTML attachment was scrubbed... URL: From hessenthaler at mechbau.uni-stuttgart.de Sat Jan 3 16:21:14 2015 From: hessenthaler at mechbau.uni-stuttgart.de (Andreas Hessenthaler) Date: Sat, 3 Jan 2015 22:21:14 +0100 (CET) Subject: [vtkusers] Holes on surface of clipped unstructured data set Message-ID: Hi there, I have an unstructured grid with scalar and vector data which I clip using vtkClipDataSet and vtkPlane: clippingPlaneF = vtk.vtkPlane() clippingPlaneF.SetOrigin(0.5*(minXF+maxXF), 0.5*(minYF+maxYF), 0.5*(minZF+maxZF)) clippingPlaneF.SetNormal(0.0, 1.0, 0.0) clipF = vtk.vtkClipDataSet() clipF.SetInput(meshF) clipF.SetClipFunction(clippingPlaneF) clipF.InsideOutOn() extractClipF = vtk.vtkGeometryFilter() extractClipF.SetInput(clipF.GetOutput()) linearSubdivisionClipF = vtk.vtkLinearSubdivisionFilter() linearSubdivisionClipF.SetInput(extractClipF.GetOutput()) linearSubdivisionClipF.SetNumberOfSubdivisions(2) clipMapperF = vtk.vtkDataSetMapper() Now, if I use clipMapperF.SetInputConnection(clipF.GetOutputPort()) the colors on the surface appear jagged. Thus, I tried the subdivision filter, i.e. clipMapperF.SetInputConnection(linearSubdivisionClipF.GetOutputPort()) which gives a nice result in terms of the color mapping, but introduces holes on the surface, that result from clipping the data set (complete data set is fine), see screenshot attached. Some background if helpful: the data set is a 3D unstructured grid with pressure and velocity field. The cells are of type vtkQuadraticTetra, though vtkTetra gives the same result. Attached screenshot shows velocity magnitude (components or pressure have same behavior). Any help is much appreciated! Cheers Andreas -------------- next part -------------- A non-text attachment was scrubbed... Name: vtk_clipping_volumes.png Type: image/png Size: 149525 bytes Desc: not available URL: From grothausmann.roman at mh-hannover.de Mon Jan 5 07:55:21 2015 From: grothausmann.roman at mh-hannover.de (Dr. Roman Grothausmann) Date: Mon, 05 Jan 2015 13:55:21 +0100 Subject: [vtkusers] Fixing vtkPolyDataToImageStencil In-Reply-To: References: <1412781275831-5729043.post@n5.nabble.com> <33A96CE7-11CE-4ED1-A032-B82AD8A05675@uab.edu> <1412788187655-5729049.post@n5.nabble.com> <1412790315356-5729052.post@n5.nabble.com> <1417709842689-5729677.post@n5.nabble.com> <1417717076869-5729685.post@n5.nabble.com> Message-ID: <54AA89B9.2010807@mh-hannover.de> Hi David, Many thanks for improving vtkPolyDataToImageStencil. I tested the git branch on 141229 in conjunction with my Voxelizer plug-in for Blender (http://www.midasjournal.org/browse/publication/882) and I still get some artifacts in the result (see first two slices of attached MHA) with e.g. an icosahedron (scale set to 100) as found in the attachment. Is that related to the bugs of vtkPolyDataToImageStencil? Kind regards, Roman On 15/12/14 17:20, David Gobbi wrote: > Hi Ricardo, > > Just a quick note, there was another bug with vtkPolyDataToImageStencil > (caused as a result of my fixes to earlier bugs). The fix for this new bug > was merged just last week: > http://review.source.kitware.com/#/c/18392/ > > - David > > > On Thu, Dec 4, 2014 at 11:17 AM, Ricardo A Corredor > wrote: > > > Well, actually it seems that it doesn't happen with every polydata or > polyline. I have some similar polylines and it works as it should; others > that has not the same result. Let me verify and I will share with you the > cases where it has this behavior. > > RaC > > > > _______________________________________________ > 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 > -- Dr. Roman Grothausmann Tomographie und Digitale Bildverarbeitung Tomography and Digital Image Analysis Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 Medizinische Hochschule Hannover Carl-Neuberg-Str. 1 D-30625 Hannover Tel. +49 511 532-9574 -------------- next part -------------- A non-text attachment was scrubbed... Name: icosahedron_10rx20ry30rz_01.stl Type: application/sla Size: 1084 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: voxelizer_out.mha Type: application/octet-stream Size: 87661 bytes Desc: not available URL: From david.gobbi at gmail.com Mon Jan 5 09:20:31 2015 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 5 Jan 2015 07:20:31 -0700 Subject: [vtkusers] Fixing vtkPolyDataToImageStencil In-Reply-To: <54AA89B9.2010807@mh-hannover.de> References: <1412781275831-5729043.post@n5.nabble.com> <33A96CE7-11CE-4ED1-A032-B82AD8A05675@uab.edu> <1412788187655-5729049.post@n5.nabble.com> <1412790315356-5729052.post@n5.nabble.com> <1417709842689-5729677.post@n5.nabble.com> <1417717076869-5729685.post@n5.nabble.com> <54AA89B9.2010807@mh-hannover.de> Message-ID: Hi Roman, The .mha file that you attached is giving me an error: MetaImage: M_ReadElementsData: data not read completely ideal = 1316134911 : actual = 87431 Can you try sending it again, or send the problem slices as png files? - David On Mon, Jan 5, 2015 at 5:55 AM, Dr. Roman Grothausmann < grothausmann.roman at mh-hannover.de> wrote: > Hi David, > > > Many thanks for improving vtkPolyDataToImageStencil. I tested the git > branch on 141229 in conjunction with my Voxelizer plug-in for Blender ( > http://www.midasjournal.org/browse/publication/882) and I still get some > artifacts in the result (see first two slices of attached MHA) with e.g. an > icosahedron (scale set to 100) as found in the attachment. Is that related > to the bugs of vtkPolyDataToImageStencil? > > Kind regards, > Roman > > On 15/12/14 17:20, David Gobbi wrote: > >> Hi Ricardo, >> >> Just a quick note, there was another bug with vtkPolyDataToImageStencil >> (caused as a result of my fixes to earlier bugs). The fix for this new >> bug >> was merged just last week: >> http://review.source.kitware.com/#/c/18392/ >> >> - David >> >> >> On Thu, Dec 4, 2014 at 11:17 AM, Ricardo A Corredor < >> ra.corredor at gmail.com >> > wrote: >> >> >> Well, actually it seems that it doesn't happen with every polydata or >> polyline. I have some similar polylines and it works as it should; >> others >> that has not the same result. Let me verify and I will share with you >> the >> cases where it has this behavior. >> >> RaC >> >> >> >> _______________________________________________ >> 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 >> >> > -- > Dr. Roman Grothausmann > > Tomographie und Digitale Bildverarbeitung > Tomography and Digital Image Analysis > > Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 > Medizinische Hochschule Hannover > Carl-Neuberg-Str. 1 > D-30625 Hannover > > Tel. +49 511 532-9574 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From grothausmann.roman at mh-hannover.de Mon Jan 5 09:33:10 2015 From: grothausmann.roman at mh-hannover.de (Dr. Roman Grothausmann) Date: Mon, 05 Jan 2015 15:33:10 +0100 Subject: [vtkusers] Fixing vtkPolyDataToImageStencil In-Reply-To: References: <1412781275831-5729043.post@n5.nabble.com> <33A96CE7-11CE-4ED1-A032-B82AD8A05675@uab.edu> <1412788187655-5729049.post@n5.nabble.com> <1412790315356-5729052.post@n5.nabble.com> <1417709842689-5729677.post@n5.nabble.com> <1417717076869-5729685.post@n5.nabble.com> <54AA89B9.2010807@mh-hannover.de> Message-ID: <54AAA0A6.1050800@mh-hannover.de> Hi David, On 05/01/15 15:20, David Gobbi wrote: > The .mha file that you attached is giving me an error: > > MetaImage: M_ReadElementsData: data not read completely > ideal = 1316134911 : actual = 87431 Sorry, it was compressed with my MHA plugin for fiji which does not recompute CompressedDataSize because ITK happily ignores any mismatches except for reporting;-) Attached the file compressed with ITK itself (possible because the data is less than 4GB, see https://issues.itk.org/jira/browse/ITK-3321). Just noticed: it also contains artifacts in slices 130 to 142. Many thanks for looking into this. Roman > On Mon, Jan 5, 2015 at 5:55 AM, Dr. Roman Grothausmann > > > wrote: > > Hi David, > > > Many thanks for improving vtkPolyDataToImageStencil. I tested the git branch > on 141229 in conjunction with my Voxelizer plug-in for Blender > (http://www.midasjournal.org/__browse/publication/882 > ) and I still get some > artifacts in the result (see first two slices of attached MHA) with e.g. an > icosahedron (scale set to 100) as found in the attachment. Is that related > to the bugs of vtkPolyDataToImageStencil? > > Kind regards, > Roman > > On 15/12/14 17:20, David Gobbi wrote: > > Hi Ricardo, > > Just a quick note, there was another bug with vtkPolyDataToImageStencil > (caused as a result of my fixes to earlier bugs). The fix for this new bug > was merged just last week: > http://review.source.kitware.__com/#/c/18392/ > > > - David > > > On Thu, Dec 4, 2014 at 11:17 AM, Ricardo A Corredor > > >__> wrote: > > > Well, actually it seems that it doesn't happen with every polydata or > polyline. I have some similar polylines and it works as it should; > others > that has not the same result. Let me verify and I will share with > you the > cases where it has this behavior. > > RaC > > > > _________________________________________________ > 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 > > > > -- > Dr. Roman Grothausmann > > Tomographie und Digitale Bildverarbeitung > Tomography and Digital Image Analysis > > Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 > Medizinische Hochschule Hannover > Carl-Neuberg-Str. 1 > D-30625 Hannover > > Tel. +49 511 532-9574 > > -- Dr. Roman Grothausmann Tomographie und Digitale Bildverarbeitung Tomography and Digital Image Analysis Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 Medizinische Hochschule Hannover Carl-Neuberg-Str. 1 D-30625 Hannover Tel. +49 511 532-9574 -------------- next part -------------- A non-text attachment was scrubbed... Name: voxelizer_out.mha Type: application/octet-stream Size: 87789 bytes Desc: not available URL: From david.gobbi at gmail.com Mon Jan 5 10:00:26 2015 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 5 Jan 2015 08:00:26 -0700 Subject: [vtkusers] Fixing vtkPolyDataToImageStencil In-Reply-To: <54AAA0A6.1050800@mh-hannover.de> References: <1412781275831-5729043.post@n5.nabble.com> <33A96CE7-11CE-4ED1-A032-B82AD8A05675@uab.edu> <1412788187655-5729049.post@n5.nabble.com> <1412790315356-5729052.post@n5.nabble.com> <1417709842689-5729677.post@n5.nabble.com> <1417717076869-5729685.post@n5.nabble.com> <54AA89B9.2010807@mh-hannover.de> <54AAA0A6.1050800@mh-hannover.de> Message-ID: Hi Roman, Do the attached images match the artifacts that you see? The output of vtkPolyDataToImageStencil is binary (each voxel is "on" or "off"), so it is impossible for it, on its own, to produce different shades of grey. What filters are you using downstream of vtkPolyDataToImageStencil? - David On Mon, Jan 5, 2015 at 7:33 AM, Dr. Roman Grothausmann < grothausmann.roman at mh-hannover.de> wrote: > Hi David, > > On 05/01/15 15:20, David Gobbi wrote: > > The .mha file that you attached is giving me an error: > > > > MetaImage: M_ReadElementsData: data not read completely > > ideal = 1316134911 : actual = 87431 > > Sorry, it was compressed with my MHA plugin for fiji which does not > recompute CompressedDataSize because ITK happily ignores any mismatches > except for reporting;-) > Attached the file compressed with ITK itself (possible because the data is > less than 4GB, see https://issues.itk.org/jira/browse/ITK-3321). > > Just noticed: it also contains artifacts in slices 130 to 142. > > Many thanks for looking into this. > Roman > > > On Mon, Jan 5, 2015 at 5:55 AM, Dr. Roman Grothausmann >> > hannover.de>> >> wrote: >> >> Hi David, >> >> >> Many thanks for improving vtkPolyDataToImageStencil. I tested the git >> branch >> on 141229 in conjunction with my Voxelizer plug-in for Blender >> (http://www.midasjournal.org/__browse/publication/882 >> ) and I still >> get some >> artifacts in the result (see first two slices of attached MHA) with >> e.g. an >> icosahedron (scale set to 100) as found in the attachment. Is that >> related >> to the bugs of vtkPolyDataToImageStencil? >> >> Kind regards, >> Roman >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: icosahedron_artifact.png Type: image/png Size: 2280 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: icosahedron_artifact_2.png Type: image/png Size: 25974 bytes Desc: not available URL: From julio.hoffimann at gmail.com Mon Jan 5 14:25:50 2015 From: julio.hoffimann at gmail.com (=?UTF-8?Q?J=C3=BAlio_Hoffimann?=) Date: Mon, 5 Jan 2015 11:25:50 -0800 Subject: [vtkusers] QVTKWidget segfault on Linux with Qt5, VTK6.2, GCC4.9, C++14 Message-ID: Dear VTKers, Attached is a testcase that reproduces the issue I'm having with QVTKWidget. If you download the zip, run CMake and run the program, it should simply show a VTK viewer inside the main window. If however you uncomment line 30 in vtkviewer.cpp, the program crashes whenever the cursor is over the QVTKWidget window. Could you please confirm that I'm not misusing the API? I appreciate if you can try to reproduce the issue. Sincerely, J?lio. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: vtkdebug.zip Type: application/zip Size: 3064 bytes Desc: not available URL: From totte at dunescientific.com Mon Jan 5 16:15:42 2015 From: totte at dunescientific.com (Totte Karlsson) Date: Mon, 05 Jan 2015 13:15:42 -0800 Subject: [vtkusers] How to monitor actor positions? Message-ID: <54AAFEFE.2050201@dunescientific.com> Hi, I wonder if there are any vtk help classes for detecting, monitoring objects relative positions? As a simple test I would like to place two spheres in space, and moving one of them close to the other, using the mouse, the feedback will be a change in color of the spheres, as a function of say distance between the spheres. Is that possible? I found a vtkCollisionDetectionFilter.cxx class on the web but it don't seem to have much of docs :( tk -- ......................... Totte Karlsson, Ph.D. Dune Scientific, LLC 425-296 1980 (office) 425-780 9648 (cell) www.dunescientific.com ......................... From cory.quammen at kitware.com Mon Jan 5 20:52:09 2015 From: cory.quammen at kitware.com (Cory Quammen) Date: Mon, 5 Jan 2015 20:52:09 -0500 Subject: [vtkusers] How to monitor actor positions? In-Reply-To: <54AAFEFE.2050201@dunescientific.com> References: <54AAFEFE.2050201@dunescientific.com> Message-ID: Hi Totte, You can use the vtkDistancePolyDataFilter to compute a signed distance between vtkPolyData: http://www.vtk.org/doc/nightly/html/classvtkDistancePolyDataFilter.html After the filter is updated, you can check whether any of the elements of the point data array named "Distance" are less than or equal to zero. If so, you have a collision. Hope that helps, Cory On Mon, Jan 5, 2015 at 4:15 PM, Totte Karlsson wrote: > Hi, > I wonder if there are any vtk help classes for detecting, monitoring objects > relative positions? > > As a simple test I would like to place two spheres in space, and moving one > of them close to the other, using the mouse, the feedback will be a change > in color of the spheres, as a function of say distance between the spheres. > Is that possible? > > I found a vtkCollisionDetectionFilter.cxx class on the web but it don't seem > to have much of docs :( > > tk > > > > -- > ......................... > Totte Karlsson, Ph.D. > Dune Scientific, LLC > 425-296 1980 (office) > 425-780 9648 (cell) > www.dunescientific.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 > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -- Cory Quammen R&D Engineer Kitware, Inc. From grothausmann.roman at mh-hannover.de Tue Jan 6 03:09:17 2015 From: grothausmann.roman at mh-hannover.de (Dr. Roman Grothausmann) Date: Tue, 06 Jan 2015 09:09:17 +0100 Subject: [vtkusers] using vtkGaussianSplatter to splat single voxels only Message-ID: <54AB982D.3020601@mh-hannover.de> Dear mailing list members, For a contribution to the Midas Journal I need a filter that splats single voxels at specific point positions. Basically, vtkGaussianSplatter with a Radius of 0. However, the output of vtkGaussianSplatter when setting the radius to 0 is always an empty image. Looking at the relevant code in vtkGaussianSplatter.cxx (ll230), I can't see a way to make SetScalar put a voxel in this case without any modifications to the code. Formerly I had applied a patch (see below) that handles the case of Radius == 0 specially. However, for the publication I'd like to avoid patching VTK, for simplicity and to make use of the automatic testing environment. So I tried a Radius that corresponds to 1 voxel, i.e. SetRadius(1.0/(SampleDimension+1)), but due to the use of floor and ceil for min and max of the footprint there are cases in which this yields more than one splat voxel for a given input point. What would be the best way to achieve single voxel splats without patching vtkGaussianSplatter? Or should I use another filter or include my modified vtkGaussianSplatter into the code of the publication? Any help or hints are very much appreciated Roman _____________________________ diff -aur VTK-6.1.0_orig/Imaging/Hybrid/vtkGaussianSplatter.cxx VTK-6.1.0/Imaging/Hybrid/vtkGaussianSplatter.cxx --- VTK-6.1.0_orig/Imaging/Hybrid/vtkGaussianSplatter.cxx 2014-01-22 16:55:41.000000000 +0100 +++ VTK-6.1.0/Imaging/Hybrid/vtkGaussianSplatter.cxx 2014-10-21 16:21:41.848542330 +0200 @@ -226,11 +226,29 @@ loc[i] = (this->P[i] - this->Origin[i]) / this->Spacing[i]; } + if (this->Radius == 0){ + char splatit= 1; // Determine splat footprint for (i=0; i<3; i++) { - min[i] = static_cast(floor(static_cast(loc[i])-this->SplatDistance[i])); - max[i] = static_cast(ceil(static_cast(loc[i])+this->SplatDistance[i])); + min[i] = static_cast(round(loc[i])); + if ( min[i] < 0 || min[i] >= this->SampleDimensions[i] ) + { + splatit= 0; + } + } + if (splatit){ + idx = min[0] + min[1]*this->SampleDimensions[0] + min[2]*sliceSize; + this->SetScalar(idx,0, newScalars); + } + } + + else { + // Determine splat footprint + for (i=0; i<3; i++) + { + min[i] = static_cast(round(loc[i] - this->SplatDistance[i])); + max[i] = static_cast(round(loc[i] + this->SplatDistance[i])); if ( min[i] < 0 ) { min[i] = 0; @@ -260,6 +278,7 @@ } } }//within splat footprint + } }//for all input points // If capping is turned on, set the distances of the outside of the volume @@ -513,7 +532,11 @@ void vtkGaussianSplatter::SetScalar(int idx, double dist2, vtkDoubleArray *newScalars) { - double v = (this->*SampleFactor)(this->S) * exp( + double v; + if (this->Radius2 == 0) + v = (this->*SampleFactor)(this->S); + else + v = (this->*SampleFactor)(this->S) * exp( static_cast (this->ExponentFactor*(dist2)/(this->Radius2))); -- Dr. Roman Grothausmann Tomographie und Digitale Bildverarbeitung Tomography and Digital Image Analysis Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 Medizinische Hochschule Hannover Carl-Neuberg-Str. 1 D-30625 Hannover Tel. +49 511 532-9574 From grothausmann.roman at mh-hannover.de Tue Jan 6 03:41:51 2015 From: grothausmann.roman at mh-hannover.de (Dr. Roman Grothausmann) Date: Tue, 06 Jan 2015 09:41:51 +0100 Subject: [vtkusers] Fixing vtkPolyDataToImageStencil In-Reply-To: References: <1412781275831-5729043.post@n5.nabble.com> <33A96CE7-11CE-4ED1-A032-B82AD8A05675@uab.edu> <1412788187655-5729049.post@n5.nabble.com> <1412790315356-5729052.post@n5.nabble.com> <1417709842689-5729677.post@n5.nabble.com> <1417717076869-5729685.post@n5.nabble.com> <54AA89B9.2010807@mh-hannover.de> <54AAA0A6.1050800@mh-hannover.de> Message-ID: <54AB9FCF.6020902@mh-hannover.de> Hi David, On 05/01/15 16:00, David Gobbi wrote: > Do the attached images match the artifacts that you see? Yes. > The output of vtkPolyDataToImageStencil is binary (each voxel is "on" or "off"), so > it is impossible for it, on its own, to produce different shades of grey. That's a good point, though I thought it only creates the stencil to pass to vtkImageStencil which then should only return a binary image. > What filters are you using downstream of vtkPolyDataToImageStencil? Well, basically only vtkImageStencil and the meta-image writer see below: def voxelizer_vol_naa(selection, scale): """ volume voxelization not anti-aliased """ # Get selection boundaries. (minX, maxX, minY, maxY, minZ, maxZ) = [int(x*scale) for x in selection.GetBounds()] #convert tuple of floats to ints (minX, maxX, minY, maxY, minZ, maxZ) = (minX-1, maxX+1, minY-1, maxY+1, minZ-1, maxZ+1) print_info(VERB, " Selection bounds are %s\n"%str((minX, maxX, minY, maxY, minZ, maxZ)) ) #dimensions of the resulting image ps1= 1.0/scale # pixel size for the stencil, make sure it's a float division! ps2= 1.0 # pixel size for the image ## Convert a surface mesh into an image stencil that can be used to mask an image with vtkImageStencil. polyToStencilFilter = vtk.vtkPolyDataToImageStencil() polyToStencilFilter.SetInputData(selection) polyToStencilFilter.SetOutputWholeExtent(minX, maxX, minY, maxY, minZ, maxZ) polyToStencilFilter.SetOutputSpacing(ps1, ps1, ps1) polyToStencilFilter.SetOutputOrigin(0.0, 0.0, 0.0) add_progress_observer(polyToStencilFilter) polyToStencilFilter.Update() # Create an empty (3D) image of appropriate size. image = vtk.vtkImageData(); image.SetSpacing(ps2, ps2, ps2); image.SetOrigin(0.0, 0.0, 0.0); image.SetExtent(minX, maxX, minY, maxY, minZ, maxZ); # image.SetScalarTypeToUnsignedChar(); # image.AllocateScalars(); # this causes blender to crash if not enough space can be allocated ##see patch: http://vtk.1045678.n5.nabble.com/Re-patch-for-turning-almost-all-VTK-errors-into-Python-exceptions-IMPROVED-td1251918.html image.AllocateScalars(vtk.VTK_UNSIGNED_CHAR, 1) #vtk-6.x # Mask the empty image with the image stencil. stencil = vtk.vtkImageStencil() stencil.SetInputData(image) #stencil.SetStencil(polyToStencilFilter.GetOutput()) stencil.SetStencilConnection(polyToStencilFilter.GetOutputPort()) #vtk-6.x stencil.ReverseStencilOn() stencil.SetBackgroundValue(255) add_progress_observer(stencil) stencil.Update() return stencil.GetOutput() The result is then passed to the writer: def write_image(image, filename): """Write vtk image data to file.""" aWriter = vtk.vtkMetaImageWriter() aWriter.SetInputData(image) aWriter.SetFileName(filename) aWriter.SetFileDimensionality(3) #blender only knows 3D aWriter.SetCompression(False) add_progress_observer(aWriter) aWriter.Write() Am I doing something inappropriate somewhere that could cause the varying grey values? Many thanks for looking into this. Roman > > On Mon, Jan 5, 2015 at 7:33 AM, Dr. Roman Grothausmann > > > wrote: > > Hi David, > > On 05/01/15 15:20, David Gobbi wrote: > > The .mha file that you attached is giving me an error: > > > > MetaImage: M_ReadElementsData: data not read completely > > ideal = 1316134911 : actual = 87431 > > Sorry, it was compressed with my MHA plugin for fiji which does not > recompute CompressedDataSize because ITK happily ignores any mismatches > except for reporting;-) > Attached the file compressed with ITK itself (possible because the data is > less than 4GB, see https://issues.itk.org/jira/__browse/ITK-3321 > ). > > Just noticed: it also contains artifacts in slices 130 to 142. > > Many thanks for looking into this. > Roman > > > On Mon, Jan 5, 2015 at 5:55 AM, Dr. Roman Grothausmann > > >> > wrote: > > Hi David, > > > Many thanks for improving vtkPolyDataToImageStencil. I tested the > git branch > on 141229 in conjunction with my Voxelizer plug-in for Blender > (http://www.midasjournal.org/____browse/publication/882 > > >) and I still get some > artifacts in the result (see first two slices of attached MHA) with > e.g. an > icosahedron (scale set to 100) as found in the attachment. Is that > related > to the bugs of vtkPolyDataToImageStencil? > > Kind regards, > Roman > -- Dr. Roman Grothausmann Tomographie und Digitale Bildverarbeitung Tomography and Digital Image Analysis Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 Medizinische Hochschule Hannover Carl-Neuberg-Str. 1 D-30625 Hannover Tel. +49 511 532-9574 From grothausmann.roman at mh-hannover.de Tue Jan 6 03:50:48 2015 From: grothausmann.roman at mh-hannover.de (Dr. Roman Grothausmann) Date: Tue, 06 Jan 2015 09:50:48 +0100 Subject: [vtkusers] python wrapper for vtkPartialVolumeModeller In-Reply-To: References: Message-ID: <54ABA1E8.7020101@mh-hannover.de> Dear Cory, Recently I wanted to use Your vtkPartialVolumeModeller in VTK-6.1.0 with python (as before). However, the VTK directory structure has changed and I could not find a directory to put it into to compile. Either vtkBoxClipDataSet.h or vtkDataSetSurfaceFilter.h are not found. There is a note in the CMakeLists.txt that they used to be in the same directory but that was changed. What could I do to get a python wrapping for vtkPartialVolumeModeller again in VTK6? Thanks for any help or hints. Roman On 11/07/12 16:46, Cory Quammen wrote: > Okay, great, I'm glad you find it useful. > > > I just tried this but although all compiles fine I get this error when > > python is about to include vtk: > > > > Error: /opt/vtk-5.10.0/lib/vtk-5.10/libvtkImaging.so.5.10: undefined symbol: > > _ZN17vtkBoxClipDataSet10SetBoxClipEdddddd. > > The linker error you are getting means that a required library is not > being linked against for libvtkImaging. I would try to move > vtkPartialVolumeModeller from VTK/Imaging to VTK/Graphics, then add > vtkPartialVolumeModeller.cxx in the CMakeLists.txt file under > VTK/Graphics instead of VTK/Imaging, just like you had it. > libvtkGraphics may have the right libraries specified to eliminate the > linker error. > > > I added vtkPartialVolumeModeller in VTK/Imaging/CMakeLists.txt under > > Kit_SRCS: > > > > SET( Kit_SRCS > > vtkPartialVolumeModeller.cxx > > vtkBooleanTexture.cxx > > . > > . > > . > > > > Is that correct? There was no Module_SRCS and also no subdirectory Hybrid in > > VTK/Imaging/. > > Ah, my instructions were for the latest VTK in the git repository. I > see now that you are using VTK 5.10. Yes, that is the right way to add > the source file. > > > Do You have any ideas how to fix the undefined symbol error? > > The linker error you are getting means that a required library is not > being linked against for libvtkImaging. I would try to move > vtkPartialVolumeModeller from VTK/Imaging to VTK/Graphics, then add > vtkPartialVolumeModeller.cxx in the CMakeLists.txt file under > VTK/Graphics instead of VTK/Imaging, just like you had it. > > Please let me know how that goes. > > Cory > > -- > Cory Quammen > Research Associate > Department of Computer Science > The University of North Carolina at Chapel Hill > -- Dr. Roman Grothausmann Tomographie und Digitale Bildverarbeitung Tomography and Digital Image Analysis Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 Medizinische Hochschule Hannover Carl-Neuberg-Str. 1 D-30625 Hannover Tel. +49 511 532-9574 From lifestudent37 at gmail.com Tue Jan 6 05:53:58 2015 From: lifestudent37 at gmail.com (Student Life) Date: Tue, 6 Jan 2015 10:53:58 +0000 Subject: [vtkusers] Best way to store multiple vtkActors using C++ Message-ID: Hi, I basically want to store multiple vtkActors within my render window so that the user can interact with them. I also want to group some vtkActors together I was thinking of using a linkedlist, to store each vtkActor. I was also thinking of grouping multiple vtkActors so that they can be interacted with and rotated in unison. I was thinking of doing this using a vtkAssembly, but I'm not too sure. I am new to VTK and would greatly appreciate some help/advice. Many thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Tue Jan 6 08:54:45 2015 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 6 Jan 2015 06:54:45 -0700 Subject: [vtkusers] Fixing vtkPolyDataToImageStencil In-Reply-To: <54AB9FCF.6020902@mh-hannover.de> References: <1412781275831-5729043.post@n5.nabble.com> <33A96CE7-11CE-4ED1-A032-B82AD8A05675@uab.edu> <1412788187655-5729049.post@n5.nabble.com> <1412790315356-5729052.post@n5.nabble.com> <1417709842689-5729677.post@n5.nabble.com> <1417717076869-5729685.post@n5.nabble.com> <54AA89B9.2010807@mh-hannover.de> <54AAA0A6.1050800@mh-hannover.de> <54AB9FCF.6020902@mh-hannover.de> Message-ID: Hi Roman, I think that the artifacts in the image are uninitialized memory. The vtkImageData::AllocateScalars method does not initialize the memory, it only allocates it. In VTK 6, you should be able to use the vtkImageStencilToImage filter instead of vtkImageStencil. I think that VTK really needs a simple vtkImageSource that creates a blank image, it is definitely something that a lot of people would use. I often create blank images with vtkImageGridSource: source = vtk.vtkImageGridSource() source.SetDataExtent(...) source.SetDataOrigin(...) source.SetDataSpacing(...) source.SetDataScalarTypeToUnsignedChar() source.SetFillValue(255) source.SetLineValue(255) (note: if source image is set to 255, then don't use ReverseStencilOn) Please let me know if one of these solutions fixes the issue. - David On Tue, Jan 6, 2015 at 1:41 AM, Dr. Roman Grothausmann < grothausmann.roman at mh-hannover.de> wrote: > Hi David, > > On 05/01/15 16:00, David Gobbi wrote: > >> Do the attached images match the artifacts that you see? >> > > Yes. > > The output of vtkPolyDataToImageStencil is binary (each voxel is "on" or >> "off"), so >> it is impossible for it, on its own, to produce different shades of grey. >> > > That's a good point, though I thought it only creates the stencil to pass > to vtkImageStencil which then should only return a binary image. > > What filters are you using downstream of vtkPolyDataToImageStencil? >> > > Well, basically only vtkImageStencil and the meta-image writer see below: > > > def voxelizer_vol_naa(selection, scale): > """ volume voxelization not anti-aliased """ > > # Get selection boundaries. > (minX, maxX, minY, maxY, minZ, maxZ) = [int(x*scale) for x in > selection.GetBounds()] #convert tuple of floats to ints > (minX, maxX, minY, maxY, minZ, maxZ) = (minX-1, maxX+1, minY-1, > maxY+1, minZ-1, maxZ+1) > print_info(VERB, " Selection bounds are %s\n"%str((minX, maxX, minY, > maxY, minZ, maxZ)) ) #dimensions of the resulting image > > ps1= 1.0/scale # pixel size for the stencil, make sure it's a float > division! > ps2= 1.0 # pixel size for the image > > ## Convert a surface mesh into an image stencil that can be used to > mask an image with vtkImageStencil. > polyToStencilFilter = vtk.vtkPolyDataToImageStencil() > polyToStencilFilter.SetInputData(selection) > polyToStencilFilter.SetOutputWholeExtent(minX, maxX, minY, maxY, > minZ, maxZ) > polyToStencilFilter.SetOutputSpacing(ps1, ps1, ps1) > polyToStencilFilter.SetOutputOrigin(0.0, 0.0, 0.0) > add_progress_observer(polyToStencilFilter) > polyToStencilFilter.Update() > > # Create an empty (3D) image of appropriate size. > image = vtk.vtkImageData(); > image.SetSpacing(ps2, ps2, ps2); > image.SetOrigin(0.0, 0.0, 0.0); > image.SetExtent(minX, maxX, minY, maxY, minZ, maxZ); > # image.SetScalarTypeToUnsignedChar(); > # image.AllocateScalars(); # this causes blender to crash if not > enough space can be allocated > ##see patch: http://vtk.1045678.n5.nabble.com/Re-patch-for-turning- > almost-all-VTK-errors-into-Python-exceptions-IMPROVED-td1251918.html > image.AllocateScalars(vtk.VTK_UNSIGNED_CHAR, 1) #vtk-6.x > # Mask the empty image with the image stencil. > stencil = vtk.vtkImageStencil() > stencil.SetInputData(image) > #stencil.SetStencil(polyToStencilFilter.GetOutput()) > stencil.SetStencilConnection(polyToStencilFilter.GetOutputPort()) > #vtk-6.x > stencil.ReverseStencilOn() > stencil.SetBackgroundValue(255) > > add_progress_observer(stencil) > stencil.Update() > > return stencil.GetOutput() > > > The result is then passed to the writer: > > > def write_image(image, filename): > """Write vtk image data to file.""" > aWriter = vtk.vtkMetaImageWriter() > aWriter.SetInputData(image) > aWriter.SetFileName(filename) > aWriter.SetFileDimensionality(3) #blender only knows 3D > aWriter.SetCompression(False) > add_progress_observer(aWriter) > aWriter.Write() > > > Am I doing something inappropriate somewhere that could cause the varying > grey values? > > Many thanks for looking into this. > Roman > > > >> On Mon, Jan 5, 2015 at 7:33 AM, Dr. Roman Grothausmann >> > hannover.de>> >> wrote: >> >> Hi David, >> >> On 05/01/15 15:20, David Gobbi wrote: >> > The .mha file that you attached is giving me an error: >> > >> > MetaImage: M_ReadElementsData: data not read completely >> > ideal = 1316134911 : actual = 87431 >> >> Sorry, it was compressed with my MHA plugin for fiji which does not >> recompute CompressedDataSize because ITK happily ignores any >> mismatches >> except for reporting;-) >> Attached the file compressed with ITK itself (possible because the >> data is >> less than 4GB, see https://issues.itk.org/jira/__browse/ITK-3321 >> ). >> >> Just noticed: it also contains artifacts in slices 130 to 142. >> >> Many thanks for looking into this. >> Roman >> >> >> On Mon, Jan 5, 2015 at 5:55 AM, Dr. Roman Grothausmann >> > >> > >> >> wrote: >> >> Hi David, >> >> >> Many thanks for improving vtkPolyDataToImageStencil. I >> tested the >> git branch >> on 141229 in conjunction with my Voxelizer plug-in for >> Blender >> (http://www.midasjournal.org/____browse/publication/882 >> >> > >) and I >> still get some >> artifacts in the result (see first two slices of attached >> MHA) with >> e.g. an >> icosahedron (scale set to 100) as found in the attachment. >> Is that >> related >> to the bugs of vtkPolyDataToImageStencil? >> >> Kind regards, >> Roman >> >> > -- > Dr. Roman Grothausmann > > Tomographie und Digitale Bildverarbeitung > Tomography and Digital Image Analysis > > Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 > Medizinische Hochschule Hannover > Carl-Neuberg-Str. 1 > D-30625 Hannover > > Tel. +49 511 532-9574 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Tue Jan 6 08:57:37 2015 From: daviddoria at gmail.com (David Doria) Date: Tue, 6 Jan 2015 08:57:37 -0500 Subject: [vtkusers] Best way to store multiple vtkActors using C++ In-Reply-To: References: Message-ID: On Tue, Jan 6, 2015 at 5:53 AM, Student Life wrote: > Hi, > > I basically want to store multiple vtkActors within my render window so > that the user can interact with them. I also want to group some vtkActors > together > > I was thinking of using a linkedlist, to store each vtkActor. > > I was also thinking of grouping multiple vtkActors so that they can be > interacted with and rotated in unison. I was thinking of doing this using a > vtkAssembly, but I'm not too sure. > > I am new to VTK and would greatly appreciate some help/advice. > > Many thanks > Yes, a vtkAssembly is what you want: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/Assembly Couple this with the vtkInteractorStyleTrackballActor: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/MoveActor and you should be in business. David -------------- next part -------------- An HTML attachment was scrubbed... URL: From arnaudgelas at gmail.com Tue Jan 6 09:07:14 2015 From: arnaudgelas at gmail.com (Arnaud Gelas) Date: Tue, 6 Jan 2015 15:07:14 +0100 Subject: [vtkusers] vtkConvexHull2D not in VTK installation any more? In-Reply-To: References: <547DAAA2.606@mh-hannover.de> <547DDDFE.6080706@mh-hannover.de> Message-ID: <06066CB4-342A-46BF-91CB-8D627517F676@gmail.com> Hi Bill, Happy new year! Can this patch (i.e. bac2c9cf7093ec2a82a6ddce4d7bfb7b08d284e2) be also applied onto the release branch? Thanks Arnaud > On 04 Dec 2014, at 20:05, Bill Lorensen wrote: > > I pushed a patch through gerrit. vtkConvexHull2D is now in the git repo master. > > > On Thu, Dec 4, 2014 at 11:51 AM, b.mayer1 > wrote: >> Just today I went to use vtkConvexHull2D for the first time and ran into >> this problem as well. >> >> On Tue, Dec 2, 2014 at 10:49 AM, Bill Lorensen >> wrote: >>> >>> Are you using vtkConvexHull2D? >>> >>> On Tue, Dec 2, 2014 at 10:42 AM, Dr. Roman Grothausmann >>> wrote: >>>> Many thanks Bill for the quick reply. It seems vtkConvexHull2D is barley >>>> used, as my old notes show this problem already existed around a year >>>> ago, I >>>> can't say though which VTK version I was using then. >>>> >>>> >>>> On 02/12/14 16:16, Bill Lorensen wrote: >>>>> >>>>> Roman, >>>>> >>>>> This is definitely a bug. There are other missing also. I'll look into >>>>> it. >>>>> >>>>> Thanks, >>>>> >>>>> Bill >>>>> >>>>> On Tue, Dec 2, 2014 at 7:03 AM, Dr. Roman Grothausmann >>>>> wrote: >>>>>> >>>>>> Dear mailing list members, >>>>>> >>>>>> >>>>>> To get vtkConvexHull2D into my VTK installation, I need to apply the >>>>>> following changes to cmake-files: >>>>>> >>>>>> diff -aur vtk-6.1.0_vanilla/Infovis/Core/CMakeLists.txt >>>>>> vtk-6.1.0_splat+vtkImplicitModeller-patch/Infovis/Core/CMakeLists.txt >>>>>> --- vtk-6.1.0_vanilla/Infovis/Core/CMakeLists.txt 2014-01-22 >>>>>> 16:55:41.000000000 +0100 >>>>>> +++ >>>>>> vtk-6.1.0_splat+vtkImplicitModeller-patch/Infovis/Core/CMakeLists.txt >>>>>> 2014-07-07 14:32:25.074469342 +0200 >>>>>> @@ -1,4 +1,5 @@ >>>>>> set(Module_SRCS >>>>>> + vtkConvexHull2D.cxx >>>>>> vtkAddMembershipArray.cxx >>>>>> vtkAdjacencyMatrixToEdgeTable.cxx >>>>>> vtkArrayNorm.cxx >>>>>> diff -aur vtk-6.1.0_vanilla/Infovis/Core/module.cmake >>>>>> vtk-6.1.0_splat+vtkImplicitModeller-patch/Infovis/Core/module.cmake >>>>>> --- vtk-6.1.0_vanilla/Infovis/Core/module.cmake 2014-01-22 >>>>>> 16:55:41.000000000 +0100 >>>>>> +++ >>>>>> vtk-6.1.0_splat+vtkImplicitModeller-patch/Infovis/Core/module.cmake >>>>>> 2014-07-07 14:39:59.525609602 +0200 >>>>>> @@ -2,6 +2,7 @@ >>>>>> GROUPS >>>>>> StandAlone >>>>>> DEPENDS >>>>>> + vtkRenderingCore >>>>>> vtkCommonDataModel >>>>>> vtkCommonSystem >>>>>> vtkFiltersExtraction >>>>>> >>>>>> Is there a reason vtkConvexHull2D is not included in the default >>>>>> installation with Infovis enabled or do I have to enable something >>>>>> else >>>>>> in >>>>>> cmake? >>>>>> >>>>>> Thanks for any help or hints. >>>>>> Roman >>>>>> >>>>>> >>>>>> -- >>>>>> Dr. Roman Grothausmann >>>>>> >>>>>> Tomographie und Digitale Bildverarbeitung >>>>>> Tomography and Digital Image Analysis >>>>>> >>>>>> Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 >>>>>> Medizinische Hochschule Hannover >>>>>> Carl-Neuberg-Str. 1 >>>>>> D-30625 Hannover >>>>>> >>>>>> Tel. +49 511 532-9574 >>>>>> _______________________________________________ >>>>>> Powered by www.kitware.com >>>>>> >>>>>> Visit other Kitware open-source projects at >>>>>> http://www.kitware.com/opensource/opensource.html >>>>>> >>>>>> Please keep messages on-topic and check the VTK FAQ at: >>>>>> http://www.vtk.org/Wiki/VTK_FAQ >>>>>> >>>>>> Follow this link to subscribe/unsubscribe: >>>>>> http://public.kitware.com/mailman/listinfo/vtkusers >>>>> >>>>> >>>>> >>>>> >>>> >>>> -- >>>> Dr. Roman Grothausmann >>>> >>>> Tomographie und Digitale Bildverarbeitung >>>> Tomography and Digital Image Analysis >>>> >>>> Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 >>>> Medizinische Hochschule Hannover >>>> Carl-Neuberg-Str. 1 >>>> D-30625 Hannover >>>> >>>> Tel. +49 511 532-9574 >>> >>> >>> >>> -- >>> 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 >> >> >> >> >> -- >> Brandon Mayer >> b.mayer1 at gmail.com >> 516.672.0551 > > > > -- > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From grothausmann.roman at mh-hannover.de Tue Jan 6 10:02:17 2015 From: grothausmann.roman at mh-hannover.de (Dr. Roman Grothausmann) Date: Tue, 06 Jan 2015 16:02:17 +0100 Subject: [vtkusers] Fixing vtkPolyDataToImageStencil In-Reply-To: References: <1412781275831-5729043.post@n5.nabble.com> <33A96CE7-11CE-4ED1-A032-B82AD8A05675@uab.edu> <1412788187655-5729049.post@n5.nabble.com> <1412790315356-5729052.post@n5.nabble.com> <1417709842689-5729677.post@n5.nabble.com> <1417717076869-5729685.post@n5.nabble.com> <54AA89B9.2010807@mh-hannover.de> <54AAA0A6.1050800@mh-hannover.de> <54AB9FCF.6020902@mh-hannover.de> Message-ID: <54ABF8F9.4080900@mh-hannover.de> Many thanks David, that seems to have been the problem. I didn't think of uninitialized memory as the artefacts not only appeared in the first few slides but also far within the images, and for some setting no artefacts appeared at all. Thank You very much for looking into this and for suggesting vtkImageStencilToImage which I must have overlooked at that time. It makes the whole cold much cleaner. Thanks again Roman On 06/01/15 14:54, David Gobbi wrote: > Hi Roman, > > I think that the artifacts in the image are uninitialized memory. The > vtkImageData::AllocateScalars method does not initialize the memory, > it only allocates it. > > In VTK 6, you should be able to use the vtkImageStencilToImage filter > instead of vtkImageStencil. > > I think that VTK really needs a simple vtkImageSource that creates a > blank image, it is definitely something that a lot of people would use. > I often create blank images with vtkImageGridSource: > > source = vtk.vtkImageGridSource() > source.SetDataExtent(...) > source.SetDataOrigin(...) > source.SetDataSpacing(...) > source.SetDataScalarTypeToUnsignedChar() > source.SetFillValue(255) > source.SetLineValue(255) > (note: if source image is set to 255, then don't use ReverseStencilOn) > > Please let me know if one of these solutions fixes the issue. > > - David > > On Tue, Jan 6, 2015 at 1:41 AM, Dr. Roman Grothausmann > > > wrote: > > Hi David, > > On 05/01/15 16:00, David Gobbi wrote: > > Do the attached images match the artifacts that you see? > > > Yes. > > The output of vtkPolyDataToImageStencil is binary (each voxel is "on" or > "off"), so > it is impossible for it, on its own, to produce different shades of grey. > > > That's a good point, though I thought it only creates the stencil to pass to > vtkImageStencil which then should only return a binary image. > > What filters are you using downstream of vtkPolyDataToImageStencil? > > > Well, basically only vtkImageStencil and the meta-image writer see below: > > > def voxelizer_vol_naa(selection, scale): > """ volume voxelization not anti-aliased """ > > # Get selection boundaries. > (minX, maxX, minY, maxY, minZ, maxZ) = [int(x*scale) for x in > selection.GetBounds()] #convert tuple of floats to ints > (minX, maxX, minY, maxY, minZ, maxZ) = (minX-1, maxX+1, minY-1, maxY+1, > minZ-1, maxZ+1) > print_info(VERB, " Selection bounds are %s\n"%str((minX, maxX, minY, > maxY, minZ, maxZ)) ) #dimensions of the resulting image > > ps1= 1.0/scale # pixel size for the stencil, make sure it's a float > division! > ps2= 1.0 # pixel size for the image > > ## Convert a surface mesh into an image stencil that can be used to > mask an image with vtkImageStencil. > polyToStencilFilter = vtk.vtkPolyDataToImageStencil(__) > polyToStencilFilter.__SetInputData(selection) > polyToStencilFilter.__SetOutputWholeExtent(minX, maxX, minY, maxY, > minZ, maxZ) > polyToStencilFilter.__SetOutputSpacing(ps1, ps1, ps1) > polyToStencilFilter.__SetOutputOrigin(0.0, 0.0, 0.0) > add_progress_observer(__polyToStencilFilter) > polyToStencilFilter.Update() > > # Create an empty (3D) image of appropriate size. > image = vtk.vtkImageData(); > image.SetSpacing(ps2, ps2, ps2); > image.SetOrigin(0.0, 0.0, 0.0); > image.SetExtent(minX, maxX, minY, maxY, minZ, maxZ); > # image.__SetScalarTypeToUnsignedChar(); > # image.AllocateScalars(); # this causes blender to crash if not enough > space can be allocated > ##see patch: > http://vtk.1045678.n5.nabble.__com/Re-patch-for-turning-__almost-all-VTK-errors-into-__Python-exceptions-IMPROVED-__td1251918.html > > image.AllocateScalars(vtk.VTK___UNSIGNED_CHAR, 1) #vtk-6.x > # Mask the empty image with the image stencil. > stencil = vtk.vtkImageStencil() > stencil.SetInputData(image) > #stencil.SetStencil(__polyToStencilFilter.GetOutput(__)) > stencil.SetStencilConnection(__polyToStencilFilter.__GetOutputPort()) > #vtk-6.x > stencil.ReverseStencilOn() > stencil.SetBackgroundValue(__255) > > add_progress_observer(stencil) > stencil.Update() > > return stencil.GetOutput() > > > The result is then passed to the writer: > > > def write_image(image, filename): > """Write vtk image data to file.""" > aWriter = vtk.vtkMetaImageWriter() > aWriter.SetInputData(image) > aWriter.SetFileName(filename) > aWriter.SetFileDimensionality(__3) #blender only knows 3D > aWriter.SetCompression(False) > add_progress_observer(aWriter) > aWriter.Write() > > > Am I doing something inappropriate somewhere that could cause the varying > grey values? > > Many thanks for looking into this. > Roman > > > > On Mon, Jan 5, 2015 at 7:33 AM, Dr. Roman Grothausmann > > >> > wrote: > > Hi David, > > On 05/01/15 15:20, David Gobbi wrote: > > The .mha file that you attached is giving me an error: > > > > MetaImage: M_ReadElementsData: data not read completely > > ideal = 1316134911 : actual = 87431 > > Sorry, it was compressed with my MHA plugin for fiji which does not > recompute CompressedDataSize because ITK happily ignores any mismatches > except for reporting;-) > Attached the file compressed with ITK itself (possible because the > data is > less than 4GB, see https://issues.itk.org/jira/____browse/ITK-3321 > > >). > > Just noticed: it also contains artifacts in slices 130 to 142. > > Many thanks for looking into this. > Roman > > > On Mon, Jan 5, 2015 at 5:55 AM, Dr. Roman Grothausmann > > > > > >>> > wrote: > > Hi David, > > > Many thanks for improving vtkPolyDataToImageStencil. I > tested the > git branch > on 141229 in conjunction with my Voxelizer plug-in for Blender > (http://www.midasjournal.org/______browse/publication/882 > > > > > >>) and I still get some > artifacts in the result (see first two slices of attached > MHA) with > e.g. an > icosahedron (scale set to 100) as found in the attachment. > Is that > related > to the bugs of vtkPolyDataToImageStencil? > > Kind regards, > Roman > > > -- > Dr. Roman Grothausmann > > Tomographie und Digitale Bildverarbeitung > Tomography and Digital Image Analysis > > Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 > Medizinische Hochschule Hannover > Carl-Neuberg-Str. 1 > D-30625 Hannover > > Tel. +49 511 532-9574 > > -- Dr. Roman Grothausmann Tomographie und Digitale Bildverarbeitung Tomography and Digital Image Analysis Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 Medizinische Hochschule Hannover Carl-Neuberg-Str. 1 D-30625 Hannover Tel. +49 511 532-9574 From totte at dunescientific.com Tue Jan 6 17:29:20 2015 From: totte at dunescientific.com (Totte Karlsson) Date: Tue, 06 Jan 2015 14:29:20 -0800 Subject: [vtkusers] How to monitor actor positions? In-Reply-To: References: <54AAFEFE.2050201@dunescientific.com> Message-ID: <54AC61C0.5000603@dunescientific.com> On 1/5/2015 5:52 PM, Cory Quammen wrote: > Hi Totte, > > You can use the vtkDistancePolyDataFilter to compute a signed distance > between vtkPolyData: > > http://www.vtk.org/doc/nightly/html/classvtkDistancePolyDataFilter.html > > After the filter is updated, you can check whether any of the elements > of the point data array named "Distance" are less than or equal to > zero. If so, you have a collision. > > Hope that helps, > Cory > www.dunescientific.com > ......................... Thanks for the pointer Cory! I'll check into if it can help me. tk From lifestudent37 at gmail.com Tue Jan 6 17:51:25 2015 From: lifestudent37 at gmail.com (Student Life) Date: Tue, 6 Jan 2015 22:51:25 +0000 Subject: [vtkusers] Best way to store multiple vtkActors using C++ In-Reply-To: References: Message-ID: Dear David Doria, Thank you for your response. I did some research into the* vtkAssembly* class and found that the method, *'void AddPart (vtkProp3D *)'* adds the part. However, it takes a *vtkProp3D* object as its parameter, but then *vtkActor *inherits from *vtkProp3D.* Would I be right in saying that this function would still work, as my objects are all declared as *vtkActor *and not *vtkProp3D?* The only sort of difficulty/concern I am having is storing more than one *vtkActor *in a *vtkRenderer.* So far, I intend on implementing an actor class in C++, and then another class called 'MultipleActors' which takes instances of the actor class and stores it as a linked list. However, I am not sure if this is a wise thing to do. Is there another way/data structure that I could use for storing multiple actors into memory in C++? Also, in regards to moving the actor independently, I want to make use of matrices? How do I incorporate this into my actor class/VTK? Finally, I am slightly confused about how the* vtkPolyDataMapper* works/is incorporated with *vtkActors*? Does every *vtkActor *have its own *vtkPolyDataMapper?* Are rotations and the mathematics behind the *vtkPolyDataMapper?* Thanks On Tue, Jan 6, 2015 at 1:57 PM, David Doria wrote: > On Tue, Jan 6, 2015 at 5:53 AM, Student Life > wrote: > >> Hi, >> >> I basically want to store multiple vtkActors within my render window so >> that the user can interact with them. I also want to group some vtkActors >> together >> >> I was thinking of using a linkedlist, to store each vtkActor. >> >> I was also thinking of grouping multiple vtkActors so that they can be >> interacted with and rotated in unison. I was thinking of doing this using a >> vtkAssembly, but I'm not too sure. >> >> I am new to VTK and would greatly appreciate some help/advice. >> >> Many thanks >> > > Yes, a vtkAssembly is what you want: > > http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/Assembly > > Couple this with the vtkInteractorStyleTrackballActor: > > http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/MoveActor > > and you should be in business. > > David > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jrpani at louisville.edu Tue Jan 6 18:59:15 2015 From: jrpani at louisville.edu (jrpani at louisville.edu) Date: Tue, 6 Jan 2015 23:59:15 +0000 Subject: [vtkusers] Best way to store multiple vtkActors using C++ In-Reply-To: References: , Message-ID: <241A5A2885558545B5AACE36BCCB5DA1D12759E7@EXMBX02.ad.louisville.edu> It sounds like this example may be of use to you for some of your questions (it was to me). http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/VectorOfActors Once your polydata are in actors, vtkActor has lots of methods for moving them individually (mostly inherited from vtkProp3D). http://www.vtk.org/doc/nightly/html/classvtkActor.html Best, John ________________________________ From: vtkusers [vtkusers-bounces at vtk.org] on behalf of Student Life [lifestudent37 at gmail.com] Sent: Tuesday, January 06, 2015 5:51 PM To: David Doria Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Best way to store multiple vtkActors using C++ Dear David Doria, Thank you for your response. I did some research into the vtkAssembly class and found that the method, 'void AddPart (vtkProp3D *)' adds the part. However, it takes a vtkProp3D object as its parameter, but then vtkActor inherits from vtkProp3D. Would I be right in saying that this function would still work, as my objects are all declared as vtkActor and not vtkProp3D? The only sort of difficulty/concern I am having is storing more than one vtkActor in a vtkRenderer. So far, I intend on implementing an actor class in C++, and then another class called 'MultipleActors' which takes instances of the actor class and stores it as a linked list. However, I am not sure if this is a wise thing to do. Is there another way/data structure that I could use for storing multiple actors into memory in C++? Also, in regards to moving the actor independently, I want to make use of matrices? How do I incorporate this into my actor class/VTK? Finally, I am slightly confused about how the vtkPolyDataMapper works/is incorporated with vtkActors? Does every vtkActor have its own vtkPolyDataMapper? Are rotations and the mathematics behind the vtkPolyDataMapper? Thanks On Tue, Jan 6, 2015 at 1:57 PM, David Doria > wrote: On Tue, Jan 6, 2015 at 5:53 AM, Student Life > wrote: Hi, I basically want to store multiple vtkActors within my render window so that the user can interact with them. I also want to group some vtkActors together I was thinking of using a linkedlist, to store each vtkActor. I was also thinking of grouping multiple vtkActors so that they can be interacted with and rotated in unison. I was thinking of doing this using a vtkAssembly, but I'm not too sure. I am new to VTK and would greatly appreciate some help/advice. Many thanks Yes, a vtkAssembly is what you want: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/Assembly Couple this with the vtkInteractorStyleTrackballActor: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/MoveActor and you should be in business. David -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Tue Jan 6 20:53:48 2015 From: cory.quammen at kitware.com (Cory Quammen) Date: Tue, 6 Jan 2015 20:53:48 -0500 Subject: [vtkusers] python wrapper for vtkPartialVolumeModeller In-Reply-To: <54ABA1E8.7020101@mh-hannover.de> References: <54ABA1E8.7020101@mh-hannover.de> Message-ID: Hi Roman, Maybe the easiest way to drop this into the current module structure of VTK is to add it to the Imaging/Hybrid module. If you do that and the compiler complains that it can't find vtkBoxClipDataSet.h, add vtkFiltersGeneral to the DEPENDENCIES list in Imaging/Hybrid/module.cmake. If the compiler can't find vtkDataSetSurfaceFilter.h, add vtkFiltersGeometry to the DEPENCIES list in Imaging/Hybrid/module.cmake. Let us know how it goes, Cory On Tue, Jan 6, 2015 at 3:50 AM, Dr. Roman Grothausmann wrote: > Dear Cory, > > > Recently I wanted to use Your vtkPartialVolumeModeller in VTK-6.1.0 with > python (as before). However, the VTK directory structure has changed and I > could not find a directory to put it into to compile. Either > vtkBoxClipDataSet.h or vtkDataSetSurfaceFilter.h are not found. There is a > note in the CMakeLists.txt that they used to be in the same directory but > that was changed. > What could I do to get a python wrapping for vtkPartialVolumeModeller again > in VTK6? > > Thanks for any help or hints. > Roman > > On 11/07/12 16:46, Cory Quammen wrote: >> >> Okay, great, I'm glad you find it useful. >> >> > I just tried this but although all compiles fine I get this error when >> > python is about to include vtk: >> > >> > Error: /opt/vtk-5.10.0/lib/vtk-5.10/libvtkImaging.so.5.10: undefined >> symbol: >> > _ZN17vtkBoxClipDataSet10SetBoxClipEdddddd. >> >> The linker error you are getting means that a required library is not >> being linked against for libvtkImaging. I would try to move >> vtkPartialVolumeModeller from VTK/Imaging to VTK/Graphics, then add >> vtkPartialVolumeModeller.cxx in the CMakeLists.txt file under >> VTK/Graphics instead of VTK/Imaging, just like you had it. >> libvtkGraphics may have the right libraries specified to eliminate the >> linker error. >> >> > I added vtkPartialVolumeModeller in VTK/Imaging/CMakeLists.txt under >> > Kit_SRCS: >> > >> > SET( Kit_SRCS >> > vtkPartialVolumeModeller.cxx >> > vtkBooleanTexture.cxx >> > . >> > . >> > . >> > >> > Is that correct? There was no Module_SRCS and also no subdirectory >> Hybrid in >> > VTK/Imaging/. >> >> Ah, my instructions were for the latest VTK in the git repository. I >> see now that you are using VTK 5.10. Yes, that is the right way to add >> the source file. >> >> > Do You have any ideas how to fix the undefined symbol error? >> >> The linker error you are getting means that a required library is not >> being linked against for libvtkImaging. I would try to move >> vtkPartialVolumeModeller from VTK/Imaging to VTK/Graphics, then add >> vtkPartialVolumeModeller.cxx in the CMakeLists.txt file under >> VTK/Graphics instead of VTK/Imaging, just like you had it. >> >> Please let me know how that goes. >> >> Cory >> >> -- >> Cory Quammen >> Research Associate >> Department of Computer Science >> The University of North Carolina at Chapel Hill >> > > -- > Dr. Roman Grothausmann > > Tomographie und Digitale Bildverarbeitung > Tomography and Digital Image Analysis > > Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 > Medizinische Hochschule Hannover > Carl-Neuberg-Str. 1 > D-30625 Hannover > > Tel. +49 511 532-9574 > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -- Cory Quammen R&D Engineer Kitware, Inc. From grothausmann.roman at mh-hannover.de Wed Jan 7 05:07:07 2015 From: grothausmann.roman at mh-hannover.de (Dr. Roman Grothausmann) Date: Wed, 07 Jan 2015 11:07:07 +0100 Subject: [vtkusers] python wrapper for vtkPartialVolumeModeller In-Reply-To: References: <54ABA1E8.7020101@mh-hannover.de> Message-ID: <54AD054B.9070903@mh-hannover.de> Hi Cory, On 07/01/15 02:53, Cory Quammen wrote:> If you do that and the compiler complains that it can't find > vtkBoxClipDataSet.h, add vtkFiltersGeneral to the DEPENDENCIES list in > Imaging/Hybrid/module.cmake. This was the info I lacked. Many thanks! So in general for includes from other VTK subdirectories like e.g. Imaging/Hybrid/ I'd add vtkImagingHybrid to the DEPENDENCIES? > Let us know how it goes, The way to use vtkSimpleCriticalSection seems to have changed. I had to modify the code to this: diff --git a/Imaging/Hybrid/vtkPartialVolumeModeller.cxx b/Imaging/Hybrid/vtkPartialVolumeModeller.cxx index eaa702b..3f1ab52 100644 --- a/Imaging/Hybrid/vtkPartialVolumeModeller.cxx +++ b/Imaging/Hybrid/vtkPartialVolumeModeller.cxx @@ -67,7 +67,7 @@ vtkPartialVolumeModeller::vtkPartialVolumeModeller() this->Threader = vtkMultiThreader::New(); this->NumberOfThreads = this->Threader->GetNumberOfThreads(); - this->ProgressMutex = vtkSimpleCriticalSection::New(); + this->ProgressMutex = new vtkSimpleCriticalSection; } //---------------------------------------------------------------------------- @@ -80,7 +80,7 @@ vtkPartialVolumeModeller::~vtkPartialVolumeModeller() if (this->ProgressMutex) { - this->ProgressMutex->Delete(); + delete this->ProgressMutex; } } Is that the correct way to do it now in VTK-6.1.0? Again, many thanks for Your help. Roman > On Tue, Jan 6, 2015 at 3:50 AM, Dr. Roman Grothausmann > wrote: >> Dear Cory, >> >> >> Recently I wanted to use Your vtkPartialVolumeModeller in VTK-6.1.0 with >> python (as before). However, the VTK directory structure has changed and I >> could not find a directory to put it into to compile. Either >> vtkBoxClipDataSet.h or vtkDataSetSurfaceFilter.h are not found. There is a >> note in the CMakeLists.txt that they used to be in the same directory but >> that was changed. >> What could I do to get a python wrapping for vtkPartialVolumeModeller again >> in VTK6? >> >> Thanks for any help or hints. >> Roman >> >> On 11/07/12 16:46, Cory Quammen wrote: >>> >>> Okay, great, I'm glad you find it useful. >>> >>> > I just tried this but although all compiles fine I get this error when >>> > python is about to include vtk: >>> > >>> > Error: /opt/vtk-5.10.0/lib/vtk-5.10/libvtkImaging.so.5.10: undefined >>> symbol: >>> > _ZN17vtkBoxClipDataSet10SetBoxClipEdddddd. >>> >>> The linker error you are getting means that a required library is not >>> being linked against for libvtkImaging. I would try to move >>> vtkPartialVolumeModeller from VTK/Imaging to VTK/Graphics, then add >>> vtkPartialVolumeModeller.cxx in the CMakeLists.txt file under >>> VTK/Graphics instead of VTK/Imaging, just like you had it. >>> libvtkGraphics may have the right libraries specified to eliminate the >>> linker error. >>> >>> > I added vtkPartialVolumeModeller in VTK/Imaging/CMakeLists.txt under >>> > Kit_SRCS: >>> > >>> > SET( Kit_SRCS >>> > vtkPartialVolumeModeller.cxx >>> > vtkBooleanTexture.cxx >>> > . >>> > . >>> > . >>> > >>> > Is that correct? There was no Module_SRCS and also no subdirectory >>> Hybrid in >>> > VTK/Imaging/. >>> >>> Ah, my instructions were for the latest VTK in the git repository. I >>> see now that you are using VTK 5.10. Yes, that is the right way to add >>> the source file. >>> >>> > Do You have any ideas how to fix the undefined symbol error? >>> >>> The linker error you are getting means that a required library is not >>> being linked against for libvtkImaging. I would try to move >>> vtkPartialVolumeModeller from VTK/Imaging to VTK/Graphics, then add >>> vtkPartialVolumeModeller.cxx in the CMakeLists.txt file under >>> VTK/Graphics instead of VTK/Imaging, just like you had it. >>> >>> Please let me know how that goes. >>> >>> Cory >>> >>> -- >>> Cory Quammen >>> Research Associate >>> Department of Computer Science >>> The University of North Carolina at Chapel Hill >>> >> >> -- >> Dr. Roman Grothausmann >> >> Tomographie und Digitale Bildverarbeitung >> Tomography and Digital Image Analysis >> >> Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 >> Medizinische Hochschule Hannover >> Carl-Neuberg-Str. 1 >> D-30625 Hannover >> >> Tel. +49 511 532-9574 >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers > > > -- Dr. Roman Grothausmann Tomographie und Digitale Bildverarbeitung Tomography and Digital Image Analysis Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 Medizinische Hochschule Hannover Carl-Neuberg-Str. 1 D-30625 Hannover Tel. +49 511 532-9574 From grothausmann.roman at mh-hannover.de Wed Jan 7 05:57:08 2015 From: grothausmann.roman at mh-hannover.de (Dr. Roman Grothausmann) Date: Wed, 07 Jan 2015 11:57:08 +0100 Subject: [vtkusers] python wrapper for vtkPartialVolumeModeller In-Reply-To: <54AD054B.9070903@mh-hannover.de> References: <54ABA1E8.7020101@mh-hannover.de> <54AD054B.9070903@mh-hannover.de> Message-ID: <54AD1104.7090407@mh-hannover.de> Hi Cory, On 07/01/15 11:07, Dr. Roman Grothausmann wrote: > > Let us know how it goes, > Is that the correct way to do it now in VTK-6.1.0? Just did some tests and the output is not completely empty but far from what I'd expect and what I used to get with vtkPartialVolumeModeller and VTK-5.10. Have You used vtkPartialVolumeModeller with VTK-6 before? Should it work as expected still? Best Roman >> On Tue, Jan 6, 2015 at 3:50 AM, Dr. Roman Grothausmann >> wrote: >>> Dear Cory, >>> >>> >>> Recently I wanted to use Your vtkPartialVolumeModeller in VTK-6.1.0 with >>> python (as before). However, the VTK directory structure has changed and I >>> could not find a directory to put it into to compile. Either >>> vtkBoxClipDataSet.h or vtkDataSetSurfaceFilter.h are not found. There is a >>> note in the CMakeLists.txt that they used to be in the same directory but >>> that was changed. >>> What could I do to get a python wrapping for vtkPartialVolumeModeller again >>> in VTK6? >>> >>> Thanks for any help or hints. >>> Roman >>> >>> On 11/07/12 16:46, Cory Quammen wrote: >>>> >>>> Okay, great, I'm glad you find it useful. >>>> >>>> > I just tried this but although all compiles fine I get this error when >>>> > python is about to include vtk: >>>> > >>>> > Error: /opt/vtk-5.10.0/lib/vtk-5.10/libvtkImaging.so.5.10: undefined >>>> symbol: >>>> > _ZN17vtkBoxClipDataSet10SetBoxClipEdddddd. >>>> >>>> The linker error you are getting means that a required library is not >>>> being linked against for libvtkImaging. I would try to move >>>> vtkPartialVolumeModeller from VTK/Imaging to VTK/Graphics, then add >>>> vtkPartialVolumeModeller.cxx in the CMakeLists.txt file under >>>> VTK/Graphics instead of VTK/Imaging, just like you had it. >>>> libvtkGraphics may have the right libraries specified to eliminate the >>>> linker error. >>>> >>>> > I added vtkPartialVolumeModeller in VTK/Imaging/CMakeLists.txt under >>>> > Kit_SRCS: >>>> > >>>> > SET( Kit_SRCS >>>> > vtkPartialVolumeModeller.cxx >>>> > vtkBooleanTexture.cxx >>>> > . >>>> > . >>>> > . >>>> > >>>> > Is that correct? There was no Module_SRCS and also no subdirectory >>>> Hybrid in >>>> > VTK/Imaging/. >>>> >>>> Ah, my instructions were for the latest VTK in the git repository. I >>>> see now that you are using VTK 5.10. Yes, that is the right way to add >>>> the source file. >>>> >>>> > Do You have any ideas how to fix the undefined symbol error? >>>> >>>> The linker error you are getting means that a required library is not >>>> being linked against for libvtkImaging. I would try to move >>>> vtkPartialVolumeModeller from VTK/Imaging to VTK/Graphics, then add >>>> vtkPartialVolumeModeller.cxx in the CMakeLists.txt file under >>>> VTK/Graphics instead of VTK/Imaging, just like you had it. >>>> >>>> Please let me know how that goes. >>>> >>>> Cory >>>> >>>> -- >>>> Cory Quammen >>>> Research Associate >>>> Department of Computer Science >>>> The University of North Carolina at Chapel Hill >>>> >>> >>> -- >>> Dr. Roman Grothausmann >>> >>> Tomographie und Digitale Bildverarbeitung >>> Tomography and Digital Image Analysis >>> >>> Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 >>> Medizinische Hochschule Hannover >>> Carl-Neuberg-Str. 1 >>> D-30625 Hannover >>> >>> Tel. +49 511 532-9574 >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/vtkusers >> >> >> > -- Dr. Roman Grothausmann Tomographie und Digitale Bildverarbeitung Tomography and Digital Image Analysis Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 Medizinische Hochschule Hannover Carl-Neuberg-Str. 1 D-30625 Hannover Tel. +49 511 532-9574 From daviddoria at gmail.com Wed Jan 7 08:21:56 2015 From: daviddoria at gmail.com (David Doria) Date: Wed, 7 Jan 2015 08:21:56 -0500 Subject: [vtkusers] Best way to store multiple vtkActors using C++ In-Reply-To: References: Message-ID: On Tue, Jan 6, 2015 at 5:51 PM, Student Life wrote: > Dear David Doria, > > Thank you for your response. > > I did some research into the* vtkAssembly* class and found that the > method, *'void AddPart (vtkProp3D *)'* adds the part. However, it takes a > *vtkProp3D* object as its parameter, but then *vtkActor *inherits from > *vtkProp3D.* Would I be right in saying that this function would still > work, as my objects are all declared as *vtkActor *and not *vtkProp3D?* > Yes, that's exactly how it is done in the example I sent. > The only sort of difficulty/concern I am having is storing more than one *vtkActor > *in a *vtkRenderer.* > > So far, I intend on implementing an actor class in C++, and then another > class called 'MultipleActors' which takes instances of the actor class and > stores it as a linked list. However, I am not sure if this is a wise thing > to do. Is there another way/data structure that I could use for storing > multiple actors into memory in C++? > Sure, you can do whatever you want with your pointers (such as store them in a std::vector, as John pointed out). > Also, in regards to moving the actor independently, I want to make use of > matrices? How do I incorporate this into my actor class/VTK? > You can set the "transform" (vtkActor::SetTransform) of an actor like this: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/TransformActor and you can use vtkTransform::SetMatrix to specify a transform matrix directly: http://www.vtk.org/doc/nightly/html/classvtkTransform.html Finally, I am slightly confused about how the* vtkPolyDataMapper* works/is > incorporated with *vtkActors*? Does every *vtkActor *have its own > *vtkPolyDataMapper?* Are rotations and the mathematics behind the > *vtkPolyDataMapper?* > Yes, every actor needs a mapper. I don't believe any transforms are applied in the mapper, but rather directly to the actor as I mentioned above. David -------------- next part -------------- An HTML attachment was scrubbed... URL: From trungnguyenduc1602 at gmail.com Wed Jan 7 09:57:45 2015 From: trungnguyenduc1602 at gmail.com (Ted Nguyen) Date: Wed, 7 Jan 2015 07:57:45 -0700 (MST) Subject: [vtkusers] Segmentation fault when using graph function (vtk 6.1, Qt5.3, Ubuntu) Message-ID: <1420642665350-5730011.post@n5.nabble.com> Dear mailing list members, I am working on a Qt 5.3 project and need to plot data in 2D and 3D coordinate systems. I've been looking into vtk 6.1 because it seems very powerful overall and I will also need to visualize image data at a later point. I have using Qvtkwidget smoothly with this example I have attached here. But when I tried to implement the graph example (/Examples/Charts/Cxx/QChartTable.cxx ), the program show Segmentation Fault errors. Attached is a testcase that reproduces the issue I'm having with I also describe the problem on stackoverflow.com http://stackoverflow.com/questions/27810886/segmentation-fault-when-using-graph-function-vtk-6-1-qt5-3-ubuntu Please take a look and give me some suggestions. Thank you guys very much. Sincerely, Ted Qvtk.zip SurfacePlot.zip -- View this message in context: http://vtk.1045678.n5.nabble.com/Segmentation-fault-when-using-graph-function-vtk-6-1-Qt5-3-Ubuntu-tp5730011.html Sent from the VTK - Users mailing list archive at Nabble.com. From amay.ms at gmail.com Wed Jan 7 11:30:45 2015 From: amay.ms at gmail.com (Amey) Date: Wed, 7 Jan 2015 09:30:45 -0700 (MST) Subject: [vtkusers] read a single tile from tiff file... Message-ID: <1420648245470-5730012.post@n5.nabble.com> Hello, I have a tiled tiff file. The size of the tiff file is very large and so I want to read it tile by tile. How I can achieve this using vtkTiffReader? Thank you for your help. -- View this message in context: http://vtk.1045678.n5.nabble.com/read-a-single-tile-from-tiff-file-tp5730012.html Sent from the VTK - Users mailing list archive at Nabble.com. From amay.ms at gmail.com Wed Jan 7 12:13:41 2015 From: amay.ms at gmail.com (Amey) Date: Wed, 7 Jan 2015 10:13:41 -0700 (MST) Subject: [vtkusers] creating vtkImageData from byte[] - Java Message-ID: <1420650821351-5730013.post@n5.nabble.com> Hello, I have a image data in byte[] which I am converting into vtkImageData as following: byte[] tileData = reader.getImageData(...); vtkUnsignedCharArray array = new vtkUnsignedCharArray(); array.SetJavaArray( tileData ); array.SetName( "scalars" ); vtkImageData imgData = new vtkImageData(); imgData.SetDimensions( reader.getWidth(), reader.getHeight(), 1 ); imgData.SetOrigin( 0, 0, 0 ); imgData.SetSpacing( 1.0, 1.0, 1.0 ); imgData.GetPointData().SetScalars( array ); vtkImageFlip imgFlip = new vtkImageFlip(); imgFlip.SetInputData( imgData ); imgFlip.SetFilteredAxis( 1 ); vtkImageMapper imgMapper = new vtkImageMapper(); imgMapper.SetInputConnection( imgFlip.GetOutputPort() ); imgMapper.SetColorWindow( 255.0 ); imgMapper.SetColorLevel( 127.5 ); vtkActor2D actor = new vtkActor2D(); actor.SetMapper( imgMapper ); ... When I render the actor, the image is displayed gray scale, but my data is 24 bit full colored image. Any clue what is missing here? Thank you for your help. -- View this message in context: http://vtk.1045678.n5.nabble.com/creating-vtkImageData-from-byte-Java-tp5730013.html Sent from the VTK - Users mailing list archive at Nabble.com. From christianmol at gmail.com Wed Jan 7 16:24:49 2015 From: christianmol at gmail.com (Christian Mol) Date: Wed, 7 Jan 2015 22:24:49 +0100 Subject: [vtkusers] Slice out of dataset Message-ID: Hi, Currently I am trying to display a dataset using VTK. It seems to work pretty well. A small problem though, is that using the code given below, scrolling beyond the actual data seems to be possible. When I use + right mouse button to scroll through the data it does not clip at the boundary of the data. Am I doing something wrong here, or is there more involved to accomplish the desired situation? int main(int, char *[]) { vtkSmartPointer r = vtkSmartPointer::New(); r->SetFileName("00000000.mhd"); r->Update(); vtkSmartPointer im = vtkSmartPointer::New(); im->SetInputConnection(r->GetOutputPort()); im->SliceFacesCameraOn(); im->SliceAtFocalPointOn(); im->BorderOn(); im->UpdateInformation(); vtkSmartPointer ip = vtkSmartPointer::New(); ip->SetColorWindow(2000); ip->SetColorLevel(1000); ip->SetAmbient(0.0); ip->SetDiffuse(1.0); ip->SetOpacity(1.0); ip->SetInterpolationTypeToLinear(); vtkSmartPointer ia = vtkSmartPointer::New(); ia->SetMapper(im); ia->SetProperty(ip); vtkSmartPointer stack = vtkSmartPointer::New(); stack->AddImage(ia); stack->SetActiveLayer(0); vtkSmartPointer renderer = vtkSmartPointer::New(); renderer->AddViewProp(stack); renderer->SetBackground(0.0, 1.0, 0.0); vtkSmartPointer renderWindow = vtkSmartPointer::New(); renderWindow->AddRenderer(renderer); vtkSmartPointer renderWindowInteractor = vtkSmartPointer::New(); renderWindowInteractor->SetRenderWindow(renderWindow); vtkSmartPointer style = vtkSmartPointer::New(); renderWindow->GetInteractor()->SetInteractorStyle(style); style->SetInteractionModeToImage3D(); renderer->GetActiveCamera()->ParallelProjectionOn(); renderer->ResetCameraClippingRange(); renderer->ResetCamera(); renderWindow->Render(); renderWindowInteractor->Start(); return EXIT_SUCCESS; } Kind regards, Christian Mol From ngoonee.talk at gmail.com Wed Jan 7 21:42:44 2015 From: ngoonee.talk at gmail.com (Oon-Ee Ng) Date: Thu, 8 Jan 2015 10:42:44 +0800 Subject: [vtkusers] Compilation error on Arch Linux 64-bit Message-ID: The current package of vtk in Arch Linux 64-bit was compiled by our maintainers on Dec 7th, 2014. I'm now trying to recompile it for QT5 support (rather than the default chosen by our maintainer, QT4), but am running into the following compilation error[1] which I can't seem to find anywhere else. Seems a simple template change, to my untrained eye. Any advise would be appreciated. In the past month we (Arch Linux) haven't had any significant package upgrades, some rebuilds (including of glibc and gcc) but maintaining the same version. If someone could point me to a direction for further investigation that would be appreciated. Yours truly, Ng Oon-Ee [1] - http://pastebin.com/t8Tu74pV From wulihouxiaoshuai at 163.com Wed Jan 7 22:14:28 2015 From: wulihouxiaoshuai at 163.com (Emptystack) Date: Wed, 7 Jan 2015 20:14:28 -0700 (MST) Subject: [vtkusers] Java servlet + Glassfish + volume rendering applications problem Message-ID: <1420686868240-5730017.post@n5.nabble.com> Hello everyone! I have developed a rendering engine (using vtk's java-wrapped classes) which can accept users' events like mouse coordinates and then generate the resulting image. It works well when it is run as pure java applications. But when I deployed it into glassfish web server by Java servlet technology, something unexpected happened. When I send the first request (from our developed HTML5 web-based medical image viewer) to the web server, everything works well and we can also get the rendering image. But when I send a request to the web server again, my web server stopped at the point of vtkRenderWindow::Render(). In a word, In a java servlet environment, the first request to this method works very well, but the second request failed. I have been tormented by this problem for a long time. Hope someone can help me! Best wishes! -- View this message in context: http://vtk.1045678.n5.nabble.com/Java-servlet-Glassfish-volume-rendering-applications-problem-tp5730017.html Sent from the VTK - Users mailing list archive at Nabble.com. From totte at dunescientific.com Wed Jan 7 23:14:04 2015 From: totte at dunescientific.com (Totte Karlsson) Date: Wed, 07 Jan 2015 20:14:04 -0800 Subject: [vtkusers] Subject- Observer and callbacks patterns Message-ID: <54AE040C.3010503@dunescientific.com> Hello, I wonder if someone have tips on a good approach on how to visualize a complex 'subject' with vtk, without mixing in vtk code into client code? What I'm looking for is how to efficiently separate the data (subject) with the presentation, vtk (observer) so to say. In my case, I'm having a model for a molecule (subject). My implemented molecule model do not have any vtk code. It has all internal data for atom positions, bond angles etc, and algorithms to translate, rotate and change geometry. I'm thinking of setting up a model where a "MoleculeObserver", contains all vtk objects, allowing the molecule to be rendered. The dataflow where the molecule updates the molecule observer seem pretty straightforward. The observer will get updates when anything subscribed to changes, resulting in a change in the vtk pipeline. And the dataflow in the vtk pipeline seem to be really well defined. But how to go the other way? Say I want a vtk user to be able to move or rotate the molecule by the mouse? Then the coordinates of atoms, each one having represented by its own actor and position, need to be transferred to the molecule model from the moleculeobserver (vtk code). How can one set that up? Can it be achieved using callbacks? -tk -- ......................... Totte Karlsson, Ph.D. Dune Scientific, LLC 425-296 1980 (office) 425-780 9648 (cell) www.dunescientific.com ......................... From ali.hadimogullari at netcad.com.tr Thu Jan 8 04:24:16 2015 From: ali.hadimogullari at netcad.com.tr (alihadim) Date: Thu, 8 Jan 2015 02:24:16 -0700 (MST) Subject: [vtkusers] vtk can write 3dmax format Message-ID: <1420709056032-5730021.post@n5.nabble.com> I know that vtk can read lot of diffirent file. I want to Write 3dmax vs. other 3d format file. is it possible? -- View this message in context: http://vtk.1045678.n5.nabble.com/vtk-can-write-3dmax-format-tp5730021.html Sent from the VTK - Users mailing list archive at Nabble.com. From abhishek at meddiff.com Thu Jan 8 12:36:52 2015 From: abhishek at meddiff.com (abhishek) Date: Thu, 8 Jan 2015 10:36:52 -0700 (MST) Subject: [vtkusers] VTK 6.1 & C# wrappers for WPF Application. Message-ID: <1420738612680-5730023.post@n5.nabble.com> Hello users, I have been working with VTK for last few months. Now, I am looking for C# Wrappers for VTK 6.1 so that I can plugin power of VTK with .NET Winforms & WPF UI . Activiz.NET site states, that wrappers are available under commercial support. Does, anyone has idea when will it be available for download under open source? Thanks, Abhishek -- View this message in context: http://vtk.1045678.n5.nabble.com/VTK-6-1-C-wrappers-for-WPF-Application-tp5730023.html Sent from the VTK - Users mailing list archive at Nabble.com. From julien.jomier at kitware.com Thu Jan 8 12:45:51 2015 From: julien.jomier at kitware.com (Julien Jomier) Date: Thu, 08 Jan 2015 18:45:51 +0100 Subject: [vtkusers] VTK 6.1 & C# wrappers for WPF Application. In-Reply-To: <1420738612680-5730023.post@n5.nabble.com> References: <1420738612680-5730023.post@n5.nabble.com> Message-ID: <54AEC24F.7040100@kitware.com> Hi Abhishek, It's been in our todo list for quite some time and we hope to get this done hopefully this month. Julien On 08/01/2015 18:36, abhishek wrote: > Hello users, I have been working with VTK for last few months. Now, I am > looking for C# Wrappers for VTK 6.1 so that I can plugin power of VTK with > .NET Winforms & WPF UI . Activiz.NET site states, that wrappers are > available under commercial support. > > Does, anyone has idea when will it be available for download under open > source? > > Thanks, > Abhishek > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/VTK-6-1-C-wrappers-for-WPF-Application-tp5730023.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 > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > From abhishek at meddiff.com Thu Jan 8 13:24:25 2015 From: abhishek at meddiff.com (abhishek) Date: Thu, 8 Jan 2015 11:24:25 -0700 (MST) Subject: [vtkusers] VTK 6.1 & C# wrappers for WPF Application. In-Reply-To: <54AEC24F.7040100@kitware.com> References: <1420738612680-5730023.post@n5.nabble.com> <54AEC24F.7040100@kitware.com> Message-ID: Thanks Julien. On Thu, Jan 8, 2015 at 11:16 PM, Julien Jomier [via VTK] < ml-node+s1045678n5730024h51 at n5.nabble.com> wrote: > Hi Abhishek, > > It's been in our todo list for quite some time and we hope to get this > done hopefully this month. > > Julien > > On 08/01/2015 18:36, abhishek wrote: > > > Hello users, I have been working with VTK for last few months. Now, I am > > looking for C# Wrappers for VTK 6.1 so that I can plugin power of VTK > with > > .NET Winforms & WPF UI . Activiz.NET site states, that wrappers are > > available under commercial support. > > > > Does, anyone has idea when will it be available for download under open > > source? > > > > Thanks, > > Abhishek > > > > > > > > -- > > View this message in context: > http://vtk.1045678.n5.nabble.com/VTK-6-1-C-wrappers-for-WPF-Application-tp5730023.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 > > > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > > > 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 > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://vtk.1045678.n5.nabble.com/VTK-6-1-C-wrappers-for-WPF-Application-tp5730023p5730024.html > To unsubscribe from VTK 6.1 & C# wrappers for WPF Application., click > here > > . > NAML > > -- View this message in context: http://vtk.1045678.n5.nabble.com/VTK-6-1-C-wrappers-for-WPF-Application-tp5730023p5730025.html Sent from the VTK - Users mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From DLRdave at aol.com Thu Jan 8 13:21:40 2015 From: DLRdave at aol.com (David Cole) Date: Thu, 8 Jan 2015 13:21:40 -0500 Subject: [vtkusers] VTK 6.1 & C# wrappers for WPF Application. In-Reply-To: <54AEC24F.7040100@kitware.com> References: <1420738612680-5730023.post@n5.nabble.com> <54AEC24F.7040100@kitware.com> Message-ID: Is anybody actively working on getting it done this month, or is this just a hopeful hope? ;-) On Thu, Jan 8, 2015 at 12:45 PM, Julien Jomier wrote: > Hi Abhishek, > > It's been in our todo list for quite some time and we hope to get this done > hopefully this month. > > Julien > > > On 08/01/2015 18:36, abhishek wrote: >> >> Hello users, I have been working with VTK for last few months. Now, I am >> looking for C# Wrappers for VTK 6.1 so that I can plugin power of VTK with >> .NET Winforms & WPF UI . Activiz.NET site states, that wrappers are >> available under commercial support. >> >> Does, anyone has idea when will it be available for download under open >> source? >> >> Thanks, >> Abhishek >> >> >> >> -- >> View this message in context: >> http://vtk.1045678.n5.nabble.com/VTK-6-1-C-wrappers-for-WPF-Application-tp5730023.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 >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> 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 > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers From sebastien.jourdain at kitware.com Thu Jan 8 13:31:03 2015 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Thu, 8 Jan 2015 13:31:03 -0500 Subject: [vtkusers] Java servlet + Glassfish + volume rendering applications problem In-Reply-To: <1420686868240-5730017.post@n5.nabble.com> References: <1420686868240-5730017.post@n5.nabble.com> Message-ID: Are you getting the same instance of the servlet, or did Glassfish instantiate another servlet to handle your second request? This might not be an issue with your design but it actually could be one. Also what happen when that servlet get GC? Just some random thought not knowing anything about your architecture. Seb On Wed, Jan 7, 2015 at 10:14 PM, Emptystack wrote: > Hello everyone! I have developed a rendering engine (using vtk's > java-wrapped classes) which can accept users' events like mouse coordinates > and then generate the resulting image. It works well when it is run as pure > java applications. But when I deployed it into glassfish web server by Java > servlet technology, something unexpected happened. When I send the first > request (from our developed HTML5 web-based medical image viewer) to the > web > server, everything works well and we can also get the rendering image. But > when I send a request to the web server again, my web server stopped at > the point of vtkRenderWindow::Render(). In a word, In a java servlet > environment, the first request to this method works very well, but the > second request failed. > > I have been tormented by this problem for a long time. Hope someone can > help > me! > > Best wishes! > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Java-servlet-Glassfish-volume-rendering-applications-problem-tp5730017.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 > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From DLRdave at aol.com Thu Jan 8 13:57:52 2015 From: DLRdave at aol.com (David Cole) Date: Thu, 8 Jan 2015 13:57:52 -0500 Subject: [vtkusers] VTK 6.1 & C# wrappers for WPF Application. In-Reply-To: References: <1420738612680-5730023.post@n5.nabble.com> <54AEC24F.7040100@kitware.com> Message-ID: I should mention, (in addition to being mildly flippant in my previous reply), that I am willing to chip in a few hours a week and help to bring this to availability. If the repository with the currently active work were public and people could contribute to it, I would be willing to contribute. At the very least, I could probably run a dashboard of some sort for it. And perhaps even help to fix failing tests or build warnings/errors... It is still open source, right? So why isn't any recent work publicly visible? Thanks, David C. On Thu, Jan 8, 2015 at 1:21 PM, David Cole wrote: > Is anybody actively working on getting it done this month, or is this > just a hopeful hope? > > ;-) > > > > On Thu, Jan 8, 2015 at 12:45 PM, Julien Jomier > wrote: >> Hi Abhishek, >> >> It's been in our todo list for quite some time and we hope to get this done >> hopefully this month. >> >> Julien >> >> >> On 08/01/2015 18:36, abhishek wrote: >>> >>> Hello users, I have been working with VTK for last few months. Now, I am >>> looking for C# Wrappers for VTK 6.1 so that I can plugin power of VTK with >>> .NET Winforms & WPF UI . Activiz.NET site states, that wrappers are >>> available under commercial support. >>> >>> Does, anyone has idea when will it be available for download under open >>> source? >>> >>> Thanks, >>> Abhishek >>> >>> >>> >>> -- >>> View this message in context: >>> http://vtk.1045678.n5.nabble.com/VTK-6-1-C-wrappers-for-WPF-Application-tp5730023.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 >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> 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 >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers From tavares at fe.up.pt Thu Jan 8 14:16:58 2015 From: tavares at fe.up.pt (=?utf-8?Q?=22Jo=C3=A3o_Manuel_R=2E_S=2E_Tavares=22?=) Date: Thu, 8 Jan 2015 19:16:58 +0000 Subject: [vtkusers] VipIMAGE 2015 - ANNOUNCEMENT & CALL FOR CONTRIBUTIONS References: <6C3A74D5-7A5B-4D4F-A0D4-DBF00AC49FC9@fe.up.pt> Message-ID: <95057425-D541-47F5-88FE-0F4C48F618FB@fe.up.pt> Dear Colleague, We are pleased to announce the International Conference VipIMAGE 2015 - V ECCOMAS THEMATIC CONFERENCE ON COMPUTATIONAL VISION AND MEDICAL IMAGE PROCESSING (www.fe.up.pt/~vipimage) to be held October 19-21, 2015, in H10 Costa Adeje Palace, Costa Adeje, Tenerife, Spain. Possible Topics (not limited to) - Signal and Image Processing - Computational Vision - Medical Imaging - Physics of Medical Imaging - Tracking and Analysis of Movement - Simulation and Modeling - Image Acquisition - Industrial Applications - Shape Reconstruction - Segmentation, Matching, Simulation - Data Interpolation, Registration, Acquisition and Compression - 3D Vision - Virtual Reality - Visual Inspection - Software Development for Image Processing and Analysis - Computer Aided Diagnosis, Surgery, Therapy, and Treatment - Computational Bioimaging and Visualization - Telemedicine Systems and Applications Invited Lecturers - Alexandre Xavier Falc?o, Universidade de Campinas, Brazil - Cristian A. Linte, Mayo Clinic, USA - Da-Chuan Cheng, China Medical University, Taiwan - Fiorella Sgallari, University of Bologna, Italy - Yongjie Zhang, Carnegie Mellon University, USA - Xue-cheng Tai, University of Bergen, Norway Thematic Sessions Proposals to organize Thematic Sessions under the auspicious of VipIMAGE Proposals for Thematic Sessions should be submitted by email to the conference co-chairs (tavares at fe.up.pt, rnatal at fe.up.pt). Publications Proceedings: The proceedings book will be published by the Taylor & Francis Group and indexed by Thomson Reuters Conference Proceedings Citation Index, IET Inspect and Elsevier Scopus. Springer Book: A book with 20 invited works from the ones presented in the conference will be published by Springer under the book series "Lecture Notes in Computational Vision and Biomechanics". Journal Publication: A dedicated special issue of the Taylor & Francis International Journal "Computer Methods in Biomechanics and Biomedical Engineering: Imaging & Visualization" will be published with extended versions of the best works presented in the conference. Important Dates - Deadline for Thematic Session Proposals: February 28, 2015 - Deadline for Extended Abstracts: March 15, 2015 - Authors Notification: April 15, 2015 - Deadline for Papers: June 15, 2015 We are looking forward to see you in Tenerife next October, Jo?o Manuel R. S. Tavares Renato Natal Jorge (VipIMAGE 2015 co-chairs) For further details, please, have a look in the conference website at: www.fe.up.pt/~vipimage, the Facebook page at: www.facebook.com/pages/Vipimage/237980719665456, or join the LinkedIn group at: http://www.linkedin.com/groups?gid=4752820&trk=hb_side_g. From david.gobbi at gmail.com Thu Jan 8 14:41:18 2015 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 8 Jan 2015 12:41:18 -0700 Subject: [vtkusers] Slice out of dataset In-Reply-To: References: Message-ID: On Wed, Jan 7, 2015 at 2:24 PM, Christian Mol wrote: > > > Currently I am trying to display a dataset using VTK. It seems to work > pretty well. A small problem though, is that using the code given > below, scrolling beyond the actual data seems to be possible. The interactor doesn't check the bounds of the dataset. There isn't any way to achieve what you want with vtkInteractorStyleImage (except perhaps by writing a set of callbacks, which could get messy). My suggestion would be to write a subclass of vtkInteractorStyleImage that does what you need. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From serhattural12 at gmail.com Thu Jan 8 16:38:51 2015 From: serhattural12 at gmail.com (serseri) Date: Thu, 8 Jan 2015 14:38:51 -0700 (MST) Subject: [vtkusers] VTK 6.1 & C# wrappers for WPF Application. In-Reply-To: References: <1420738612680-5730023.post@n5.nabble.com> <54AEC24F.7040100@kitware.com> Message-ID: <1420753131925-5730031.post@n5.nabble.com> Hi, I share the same thoughts with David. I can allow some time as a contributer. What is your plan? Thanks. -- View this message in context: http://vtk.1045678.n5.nabble.com/VTK-6-1-C-wrappers-for-WPF-Application-tp5730023p5730031.html Sent from the VTK - Users mailing list archive at Nabble.com. From marcus.hanwell at kitware.com Thu Jan 8 16:52:14 2015 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Thu, 8 Jan 2015 16:52:14 -0500 Subject: [vtkusers] Compilation error on Arch Linux 64-bit In-Reply-To: References: Message-ID: On Wed, Jan 7, 2015 at 9:42 PM, Oon-Ee Ng wrote: > The current package of vtk in Arch Linux 64-bit was compiled by our > maintainers on Dec 7th, 2014. > > I'm now trying to recompile it for QT5 support (rather than the > default chosen by our maintainer, QT4), but am running into the > following compilation error[1] which I can't seem to find anywhere > else. Seems a simple template change, to my untrained eye. > > Any advise would be appreciated. In the past month we (Arch Linux) > haven't had any significant package upgrades, some rebuilds (including > of glibc and gcc) but maintaining the same version. If someone could > point me to a direction for further investigation that would be > appreciated. > This looks like a change in the API of FreeType, tried with system library and could reproduce your compile failure. http://review.source.kitware.com/#/t/5259 is a patch that fixes it locally. Thanks for reporting. Marcus From ngoonee.talk at gmail.com Thu Jan 8 16:57:03 2015 From: ngoonee.talk at gmail.com (Oon-Ee Ng) Date: Fri, 9 Jan 2015 05:57:03 +0800 Subject: [vtkusers] Compilation error on Arch Linux 64-bit In-Reply-To: References: Message-ID: Ah and I had just sent my email to vtk-developers =). Thanks. On Fri, Jan 9, 2015 at 5:52 AM, Marcus D. Hanwell wrote: > On Wed, Jan 7, 2015 at 9:42 PM, Oon-Ee Ng wrote: >> The current package of vtk in Arch Linux 64-bit was compiled by our >> maintainers on Dec 7th, 2014. >> >> I'm now trying to recompile it for QT5 support (rather than the >> default chosen by our maintainer, QT4), but am running into the >> following compilation error[1] which I can't seem to find anywhere >> else. Seems a simple template change, to my untrained eye. >> >> Any advise would be appreciated. In the past month we (Arch Linux) >> haven't had any significant package upgrades, some rebuilds (including >> of glibc and gcc) but maintaining the same version. If someone could >> point me to a direction for further investigation that would be >> appreciated. >> > This looks like a change in the API of FreeType, tried with system > library and could reproduce your compile failure. > http://review.source.kitware.com/#/t/5259 is a patch that fixes it > locally. > > Thanks for reporting. > > Marcus From lifestudent37 at gmail.com Thu Jan 8 17:37:27 2015 From: lifestudent37 at gmail.com (Student Life) Date: Thu, 8 Jan 2015 22:37:27 +0000 Subject: [vtkusers] Best way to store multiple vtkActors using C++ In-Reply-To: References: Message-ID: Dear David Doria, John, Many thanks for your response. I sort of have a clear picture on what I want to achieve and how I am going to go about achieving it. I have a few questions, and I would really appreciate it if you could answer them or give me some suggestions. 1) Since I intend on using the* 'vtkInteractorStyleTrackballActor' *to interact with actors individually, I know that I will need to manually do the mathematics to allow the user to interact with the actor. I intend on using matrices, however I am not sure how to incorporate it into my class structure. At the moment, I have an *Actor* class, which basically stores a *vtkActor's* properties such as opacity, lighting and scale. The thing is, I am not sure if I should store the functions that the *vtkTransform* and *vtkMatrix4x4* offer in the *Actor *class. Should they be part of my *Actor* class, or should they be somewhere else? Because, ideally I want to apply transformations on each actor, but I am not sure if I should store each transformation in the *Actor *class. 2) In terms of data structure for handling multiple *vtkActors* and *vtkAssembly's*, I am not sure if I should opt for the *std::vector * data structure or use a *linked list*. Ideally, I want the user to load a few stl/obj files and then my software to store each stl/obj file into memory. I can't really use an array, because it is unknown how many *vtkActors*, the user wants on the screen. What is the best sort of way of storing each *vtkActor* into memory? As for *vtkAssemblys*, some actors can be grouped into parts, so there will definitely be more than one *vtkAssembly* but again, I am not sure which data structure to go for. Should I go for a *std::vector *or a *linked list?* 3) If I understand *vtkPolyDatas *correctly, they are basically the geometry and mesh behind a physical *vtkActor*? Should I have a separate class to handle *vtkPolyData*, because at the moment I have the *vtkPolyDataMapper* in my Actor class. 4) What is the difference between *vtkActorCollection* and *vtkAssembly*? Ideally, I want to 'group' some *vtkActors*, so that they can be interacted with and rotated in unison, but again I am not too sure which one to go for. After, you recommended the *vtkAssembly*, I did some research into it and it seems to be the more appropriate one, but now the *vtkActorCollection* is confusing me. Once again, thank you for answering my previous queries, it has meant a lot to me. I would really appreciate it if you could answer my questions. Thanks On Wed, Jan 7, 2015 at 1:21 PM, David Doria wrote: > On Tue, Jan 6, 2015 at 5:51 PM, Student Life > wrote: > >> Dear David Doria, >> >> Thank you for your response. >> >> I did some research into the* vtkAssembly* class and found that the >> method, *'void AddPart (vtkProp3D *)'* adds the part. However, it takes >> a *vtkProp3D* object as its parameter, but then *vtkActor *inherits from >> *vtkProp3D.* Would I be right in saying that this function would still >> work, as my objects are all declared as *vtkActor *and not *vtkProp3D?* >> > > Yes, that's exactly how it is done in the example I sent. > > >> The only sort of difficulty/concern I am having is storing more than one *vtkActor >> *in a *vtkRenderer.* >> >> So far, I intend on implementing an actor class in C++, and then another >> class called 'MultipleActors' which takes instances of the actor class and >> stores it as a linked list. However, I am not sure if this is a wise thing >> to do. Is there another way/data structure that I could use for storing >> multiple actors into memory in C++? >> > > Sure, you can do whatever you want with your pointers (such as store them > in a std::vector, as John pointed out). > > >> Also, in regards to moving the actor independently, I want to make use of >> matrices? How do I incorporate this into my actor class/VTK? >> > > You can set the "transform" (vtkActor::SetTransform) of an actor like this: > > http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/TransformActor > > and you can use vtkTransform::SetMatrix to specify a transform matrix > directly: > > http://www.vtk.org/doc/nightly/html/classvtkTransform.html > > Finally, I am slightly confused about how the* vtkPolyDataMapper* >> works/is incorporated with *vtkActors*? Does every *vtkActor *have its >> own *vtkPolyDataMapper?* Are rotations and the mathematics behind the >> *vtkPolyDataMapper?* >> > > Yes, every actor needs a mapper. I don't believe any transforms are > applied in the mapper, but rather directly to the actor as I mentioned > above. > > David > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From abhishek at meddiff.com Thu Jan 8 20:48:19 2015 From: abhishek at meddiff.com (abhishek) Date: Thu, 8 Jan 2015 18:48:19 -0700 (MST) Subject: [vtkusers] VTK 6.1 & C# wrappers for WPF Application. In-Reply-To: <1420753131925-5730031.post@n5.nabble.com> References: <1420738612680-5730023.post@n5.nabble.com> <54AEC24F.7040100@kitware.com> <1420753131925-5730031.post@n5.nabble.com> Message-ID: <1420768099186-5730036.post@n5.nabble.com> Hi, With my little experience with VTK. I can work with you guys to get this going. -- View this message in context: http://vtk.1045678.n5.nabble.com/VTK-6-1-C-wrappers-for-WPF-Application-tp5730023p5730036.html Sent from the VTK - Users mailing list archive at Nabble.com. From wulihouxiaoshuai at 163.com Thu Jan 8 20:52:56 2015 From: wulihouxiaoshuai at 163.com (Emptystack) Date: Thu, 8 Jan 2015 18:52:56 -0700 (MST) Subject: [vtkusers] Java servlet + Glassfish + volume rendering applications problem In-Reply-To: References: <1420686868240-5730017.post@n5.nabble.com> Message-ID: <1420768376754-5730037.post@n5.nabble.com> Many thanks for your reply. I can describe my architecture in detail. My system is based on client/server artichitecture. The client is exposed via an HTML5-based web interface. On the server side,we used vtk's java wrapped class to implement volume rendering and deployed it into glassfish by using java servlet technology. And the servlet's doGet method is override to process client's request and generate relevant response. The workflow of my system is as following. The client sends an HTTP request to the web server and the web server converts this request into an HTTPServletRequest object. This HTTPServletRequest object is delivered to my java servlet's doGet method. In this method, the renderin engine is invoked. (1)When the first HTTPServletRequest object arrived, the rendering engine loads the image data and initializes the relevant volume rendering pipeline, like vtkRenderer and vtkRenderWindow and so on. After this, the vtkRenderWindowInteractor's Render() method is called to performe volume rendering. And we can get the resulting pixel data by the vtkRenderWindow's GetPixelData() method. Then the pixel data is encoded into the HTTPServletResponse. The web server converts this object to an HTTP response and returns it to the client. And we can display the resulting image in our web interface in this first step. (2)When the user moves mouse in our HTML5 web interface, the relevant mouse coordinates is sent to web server and then passed to our servlet's method. After extracting mouse coordinates from HTTPServletRequest object, the vtkRenderWindowInteracor's setEventPositon method is called to respond the mouse moving event. But the web server stopped when the code ran at the point of vtkRenderWindow's Render() method. That's the place where my problem happened. Hope you can give me some suggestions! Best Wishes! -- View this message in context: http://vtk.1045678.n5.nabble.com/Java-servlet-Glassfish-volume-rendering-applications-problem-tp5730017p5730037.html Sent from the VTK - Users mailing list archive at Nabble.com. From abhishek at meddiff.com Thu Jan 8 23:46:59 2015 From: abhishek at meddiff.com (abhishek) Date: Thu, 8 Jan 2015 21:46:59 -0700 (MST) Subject: [vtkusers] VTK 6.1 & C# wrappers for WPF Application. In-Reply-To: <54AEC24F.7040100@kitware.com> References: <1420738612680-5730023.post@n5.nabble.com> <54AEC24F.7040100@kitware.com> Message-ID: <1420778819982-5730038.post@n5.nabble.com> Hello, I posted this query because of following problem that I have been assigned to work upon. "*I am looking for an approach to put output of volume rendering onto winforms or WPF application*". In past, when I had implemented MPR using vtkImageReslice. I was able to get handle of resultant vtkImageData & display it on winforms panel. Since, my current development stack is: VTK 6.1 with Visual studio 2013. Is, there any possible solution to my problem? I can work on till Activiz.Net for VTK 6.1 is available. Thanks, Abhishek. -- View this message in context: http://vtk.1045678.n5.nabble.com/VTK-6-1-C-wrappers-for-WPF-Application-tp5730023p5730038.html Sent from the VTK - Users mailing list archive at Nabble.com. From julio.hoffimann at gmail.com Thu Jan 8 23:55:00 2015 From: julio.hoffimann at gmail.com (=?UTF-8?Q?J=C3=BAlio_Hoffimann?=) Date: Thu, 8 Jan 2015 20:55:00 -0800 Subject: [vtkusers] Fwd: QVTKWidget segfault on Linux with Qt5, VTK6.2, GCC4.9, C++14 In-Reply-To: References: Message-ID: Someone on Windows could please reproduce the issue? -J?lio ---------- Forwarded message ---------- From: "J?lio Hoffimann" Date: Jan 5, 2015 11:25 AM Subject: QVTKWidget segfault on Linux with Qt5, VTK6.2, GCC4.9, C++14 To: "VTK Users" Cc: Dear VTKers, Attached is a testcase that reproduces the issue I'm having with QVTKWidget. If you download the zip, run CMake and run the program, it should simply show a VTK viewer inside the main window. If however you uncomment line 30 in vtkviewer.cpp, the program crashes whenever the cursor is over the QVTKWidget window. Could you please confirm that I'm not misusing the API? I appreciate if you can try to reproduce the issue. Sincerely, J?lio. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: vtkdebug.zip Type: application/zip Size: 3064 bytes Desc: not available URL: From abhishek at meddiff.com Fri Jan 9 00:10:31 2015 From: abhishek at meddiff.com (abhishek) Date: Thu, 8 Jan 2015 22:10:31 -0700 (MST) Subject: [vtkusers] How to render the 3d view? In-Reply-To: <1420709532372-5730022.post@n5.nabble.com> References: <1420709532372-5730022.post@n5.nabble.com> Message-ID: <1420780231241-5730040.post@n5.nabble.com> Hi, can you elaborate? -- View this message in context: http://vtk.1045678.n5.nabble.com/How-to-render-the-3d-view-tp5730022p5730040.html Sent from the VTK - Users mailing list archive at Nabble.com. From julien.jomier at kitware.com Fri Jan 9 02:22:19 2015 From: julien.jomier at kitware.com (Julien Jomier) Date: Fri, 09 Jan 2015 08:22:19 +0100 Subject: [vtkusers] VTK 6.1 & C# wrappers for WPF Application. In-Reply-To: References: <1420738612680-5730023.post@n5.nabble.com> <54AEC24F.7040100@kitware.com> Message-ID: <54AF81AB.8090203@kitware.com> We've done some progress over the past few months. I'll try to get this pushed soon. Julien On 08/01/2015 19:21, David Cole wrote: > Is anybody actively working on getting it done this month, or is this > just a hopeful hope? > > ;-) > > > > On Thu, Jan 8, 2015 at 12:45 PM, Julien Jomier > wrote: >> Hi Abhishek, >> >> It's been in our todo list for quite some time and we hope to get this done >> hopefully this month. >> >> Julien >> >> >> On 08/01/2015 18:36, abhishek wrote: >>> >>> Hello users, I have been working with VTK for last few months. Now, I am >>> looking for C# Wrappers for VTK 6.1 so that I can plugin power of VTK with >>> .NET Winforms & WPF UI . Activiz.NET site states, that wrappers are >>> available under commercial support. >>> >>> Does, anyone has idea when will it be available for download under open >>> source? >>> >>> Thanks, >>> Abhishek >>> >>> >>> >>> -- >>> View this message in context: >>> http://vtk.1045678.n5.nabble.com/VTK-6-1-C-wrappers-for-WPF-Application-tp5730023.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 >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> 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 >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers > From chasank at gmail.com Fri Jan 9 04:17:49 2015 From: chasank at gmail.com (chasank) Date: Fri, 9 Jan 2015 02:17:49 -0700 (MST) Subject: [vtkusers] Java servlet + Glassfish + volume rendering applications problem In-Reply-To: <1420768376754-5730037.post@n5.nabble.com> References: <1420686868240-5730017.post@n5.nabble.com> <1420768376754-5730037.post@n5.nabble.com> Message-ID: <1420795069171-5730042.post@n5.nabble.com> Hi, Where do you store your vtk instances? If they are instantiated inside of any method such as doGet. First request should work well as accepted. However at the second request your object's references will be changed. I suggest you to store all vtk instances including vtkImageData which store the source image in a web session scope. In other words. User logins with his account credentials to your web server and uploads source image data, from now on you are responsible to keep alive all vtk instances until user's web session ends. Best regards. -- View this message in context: http://vtk.1045678.n5.nabble.com/Java-servlet-Glassfish-volume-rendering-applications-problem-tp5730017p5730042.html Sent from the VTK - Users mailing list archive at Nabble.com. From richard.j.brown at live.co.uk Fri Jan 9 05:03:12 2015 From: richard.j.brown at live.co.uk (mbcx9rb9) Date: Fri, 9 Jan 2015 03:03:12 -0700 (MST) Subject: [vtkusers] add circles & sphere to DICOM slices & 3D viewer Message-ID: <1420797792171-5730043.post@n5.nabble.com> I currently have 3 orthogonal views and an isosurface 3D of a DICOM. I would like that when the user clicks on a point on one of the 3 orthogonal views, a sphere is created at that point. This would be displayed as circles on the 3 orthogonal views (naturally, the cirlces wouldn't be visible all the time, as one view could be looking at a different slice/section of the DICOM) and a sphere on the 3D viewer. So far, I have created a custom interactor which passes the x- y-coordinates (via GetEventPoisition()) to a function and the z-coordinate is obtained through imageViewer->getSlice(). After that, I create a circle/sphere with vtkRegularPolygonSources (with high number of sides) and vtkSphereSoure. They then get added to the render with ui->qvtkWidget->GetRenderWindow()->AddRenderer(circle or sphere renderer). All well and good, however, I have two problems: 1. the coordinates returned by the interactor use the Display coordinate system, so they depend on the window size, zoom, rotation, etc. of the viewer - can I get it to return the nearest DICOM world(?) coordinate such that, for a DICOM of 500 x 500 x 500 slices, I return x, y, z coordinates between 0 and 500? 2. When I draw the circle or sphere, it removes the previous slice or 3D render. I saw in this example , he added both actors at the same time. Short of redrawing everything I can't do that - it seems that adding one in later removes the previous render? Thanks in advance for the help! Richard -- View this message in context: http://vtk.1045678.n5.nabble.com/add-circles-sphere-to-DICOM-slices-3D-viewer-tp5730043.html Sent from the VTK - Users mailing list archive at Nabble.com. From chasank at gmail.com Fri Jan 9 06:45:02 2015 From: chasank at gmail.com (chasank) Date: Fri, 9 Jan 2015 04:45:02 -0700 (MST) Subject: [vtkusers] add circles & sphere to DICOM slices & 3D viewer In-Reply-To: <1420797792171-5730043.post@n5.nabble.com> References: <1420797792171-5730043.post@n5.nabble.com> Message-ID: <1420803902007-5730044.post@n5.nabble.com> Hi Richard 1) You may convert display coordinates into world coordinates using vtkCellPicker double *displayPoint = renderer->GetDisplayPoint(); vtkCellPicker *picker = vtkCellPicker::New(); picker->PickFromListOn(); picker->AddPickList(vtkPropInstance); picker->Pick(displayPoint[0], displayPoint[1], 0, renderer); double *worldCoordinates = picker->GetPickPosition(); 2) Use vtkImageProperty for opacity issues between overlapped planes. Play with ambient, diffuse and opacity vtkImagePropery *imageProperty = vtkImagePropery::New(); imageProperty->SetInterpolationTypeToLinear(); imageProperty->SetAmbient(1.0); imageProperty->SetDiffuse(1.0); imageProperty->SetOpacity(1.0); imageSlice->SetProperty(imageProperty); Best regards. -- View this message in context: http://vtk.1045678.n5.nabble.com/add-circles-sphere-to-DICOM-slices-3D-viewer-tp5730043p5730044.html Sent from the VTK - Users mailing list archive at Nabble.com. From chasank at gmail.com Fri Jan 9 07:11:03 2015 From: chasank at gmail.com (chasank) Date: Fri, 9 Jan 2015 05:11:03 -0700 (MST) Subject: [vtkusers] Subject- Observer and callbacks patterns In-Reply-To: <54AE040C.3010503@dunescientific.com> References: <54AE040C.3010503@dunescientific.com> Message-ID: <1420805463258-5730045.post@n5.nabble.com> Hi, if you are able to export your raw data into vtkImageData for representing your piece of molecule ( atom, proton, electron etc. ) in 3D world. 1) Read your pieces of molecule data into vtkImageData instances 2) Process your data with volume rendering to have vtkVolume instances 3) Add multiple vtkVolume instances to a vtkRenderer. 4) Write custom callbacks which inherits from vtkCommand to control user interaction with your 3D models. Best Regards. -- View this message in context: http://vtk.1045678.n5.nabble.com/Subject-Observer-and-callbacks-patterns-tp5730019p5730045.html Sent from the VTK - Users mailing list archive at Nabble.com. From chasank at gmail.com Fri Jan 9 08:00:13 2015 From: chasank at gmail.com (chasank) Date: Fri, 9 Jan 2015 06:00:13 -0700 (MST) Subject: [vtkusers] Storing actors into memory C++ In-Reply-To: References: Message-ID: <1420808413242-5730046.post@n5.nabble.com> Hi, Don't complicate your code for nothing. All you need is a simple data structure such as std::vector You may push and pop your actors easily with built-in iterators. -- View this message in context: http://vtk.1045678.n5.nabble.com/Storing-actors-into-memory-C-tp5729971p5730046.html Sent from the VTK - Users mailing list archive at Nabble.com. From david.gobbi at gmail.com Fri Jan 9 08:05:27 2015 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 9 Jan 2015 06:05:27 -0700 Subject: [vtkusers] add circles & sphere to DICOM slices & 3D viewer In-Reply-To: <1420797792171-5730043.post@n5.nabble.com> References: <1420797792171-5730043.post@n5.nabble.com> Message-ID: On Fri, Jan 9, 2015 at 3:03 AM, mbcx9rb9 wrote: > > 1. the coordinates returned by the interactor use the Display coordinate > system, so they depend on the window size, zoom, rotation, etc. of the > viewer - can I get it to return the nearest DICOM world(?) coordinate such > that, for a DICOM of 500 x 500 x 500 slices, I return x, y, z coordinates > between 0 and 500? > The vtkCellPicker can do this. With it, you can do a "Pick" at your display coordinates, and then you can call GetPointIJK() to get the i,j,k coordinates. The "IJK" coordinates are what VTK calls "structured coordinates" and they are what you want. 2. When I draw the circle or sphere, it removes the previous slice or 3D > render. I saw in this example > < > http://vtk.1045678.n5.nabble.com/render-a-sphere-at-a-point-in-a-volume-td1246875.html#a1246876 > > > , he added both actors at the same time. Short of redrawing everything I > can't do that - it seems that adding one in later removes the previous > render? > The way you are describing this suggests that you don't yet understand how VTK rendering works... drawing the sphere cannot "remove" the slice. All of the actors exist in the scene at the same time. If you can't see an actor, it probably just means that (a) it is hidden underneath another actor, or (b) it is not within the viewing frustum. I think that what you want to do is show just the outline of where the sphere intersects the slice. This can be done by applying vtkCutter to the sphere. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Fri Jan 9 08:22:32 2015 From: daviddoria at gmail.com (David Doria) Date: Fri, 9 Jan 2015 08:22:32 -0500 Subject: [vtkusers] Best way to store multiple vtkActors using C++ In-Reply-To: References: Message-ID: > > 1) Since I intend on using the* 'vtkInteractorStyleTrackballActor' *to > interact with actors individually, I know that I will need to manually do > the mathematics to allow the user to interact with the actor. I intend on > using matrices, however I am not sure how to incorporate it into my class > structure. At the moment, I have an *Actor* class, which basically stores > a *vtkActor's* properties such as opacity, lighting and scale. The thing > is, I am not sure if I should store the functions that the *vtkTransform* > and *vtkMatrix4x4* offer in the *Actor *class. Should they be part of my > *Actor* class, or should they be somewhere else? Because, ideally I want > to apply transformations on each actor, but I am not sure if I should store > each transformation in the *Actor *class. > It is not clear why you are trying to duplicate the VTK class structure/functionality? It sounds like all you need is to have a contain of these objects and use their functions (and NOT manually do the mathematics). > 2) In terms of data structure for handling multiple *vtkActors* and > *vtkAssembly's*, I am not sure if I should opt for the *std::vector * data > structure or use a *linked list*. Ideally, I want the user to load a few > stl/obj files and then my software to store each stl/obj file into memory. > I can't really use an array, because it is unknown how many *vtkActors*, > the user wants on the screen. What is the best sort of way of storing each > *vtkActor* into memory? As for *vtkAssemblys*, some actors can be grouped > into parts, so there will definitely be more than one *vtkAssembly* but > again, I am not sure which data structure to go for. Should I go for a *std::vector > *or a *linked list?* > The container you choose should only matter for the speed of insertions and removals. > 3) If I understand *vtkPolyDatas *correctly, they are basically the > geometry and mesh behind a physical *vtkActor*? Should I have a separate > class to handle *vtkPolyData*, because at the moment I have the > *vtkPolyDataMapper* in my Actor class. > Again, it's still not clear why you are duplicating the hierarchy. > 4) What is the difference between *vtkActorCollection* and *vtkAssembly*? > Ideally, I want to 'group' some *vtkActors*, so that they can be > interacted with and rotated in unison, but again I am not too sure which > one to go for. After, you recommended the *vtkAssembly*, I did some > research into it and it seems to be the more appropriate one, but now the > *vtkActorCollection* is confusing me. > I'm not too sure, but after a quick look it looks like vtkAssembly allows hierarchy to be encoded, whereas vtkActorCollection is more like your #2 above where it is simply a flat container to store a collection of actors. David -------------- next part -------------- An HTML attachment was scrubbed... URL: From ali.hadimogullari at netcad.com.tr Fri Jan 9 08:31:41 2015 From: ali.hadimogullari at netcad.com.tr (alihadim) Date: Fri, 9 Jan 2015 06:31:41 -0700 (MST) Subject: [vtkusers] vtkPolyData write STL file Message-ID: <1420810301919-5730049.post@n5.nabble.com> I run my code but I coundn't write STL file. ltempFile have been writing uses vtkPolyDataWriter class. Can you help me? vtkPolyDataReader rd = new vtkPolyDataReader(); rd.SetFileName(ltempFile); rd.Update(); vtk.vtkSTLWriter stl = new vtkSTLWriter(); stl.SetFileName("d:\\Example.stl"); stl.SetInputConnection(rd.GetOutputPort()); int cnt = stl.Write(); -- View this message in context: http://vtk.1045678.n5.nabble.com/vtkPolyData-write-STL-file-tp5730049.html Sent from the VTK - Users mailing list archive at Nabble.com. From ali.hadimogullari at netcad.com.tr Fri Jan 9 09:04:45 2015 From: ali.hadimogullari at netcad.com.tr (alihadim) Date: Fri, 9 Jan 2015 07:04:45 -0700 (MST) Subject: [vtkusers] Write Stl File Message-ID: <1420812285230-5730050.post@n5.nabble.com> I want to save it as STL data in attachment. I created using vtkxmlpolydatawrite. tmpA35F.tmp -- View this message in context: http://vtk.1045678.n5.nabble.com/Write-Stl-File-tp5730050.html Sent from the VTK - Users mailing list archive at Nabble.com. From dcg at magellium.fr Fri Jan 9 09:06:11 2015 From: dcg at magellium.fr (Denis42) Date: Fri, 9 Jan 2015 07:06:11 -0700 (MST) Subject: [vtkusers] Camera move when resizing QVTKWidget with multiples viewports of image slices Message-ID: <1420812371194-5730051.post@n5.nabble.com> Hello, this is my welcome post on this glorious list I need to display ten slices from a dicom file in a qvtk widget. To do that, I created a widget derivated from QVTKWidget. As a member of that class, a vector of 10 vtkRenderer was created and added to the vtkRenderWindow of the QVTKWidget. Each vtkRenderer has a specific viewport and they do not overlap. The pipe we use is: This first rendering is displayed correctly (see capture01.png) Then when we resize or click in the widget, images vanish from viewport but the interactor allow us to dezoom and find that they are in fact rendered outside the viewport in the far upper right corner. Below a capture of the display after dezooming, initialy the viewport was empty . (capture02.png) How can I keep the camera well placed to see the full slices in each viewport? Why does the resizing of the widget cause this? Thanks for your help Denis -- View this message in context: http://vtk.1045678.n5.nabble.com/Camera-move-when-resizing-QVTKWidget-with-multiples-viewports-of-image-slices-tp5730051.html Sent from the VTK - Users mailing list archive at Nabble.com. From aruopp at gmx.de Sat Jan 10 11:50:59 2015 From: aruopp at gmx.de (Andreas Ruopp) Date: Sat, 10 Jan 2015 17:50:59 +0100 Subject: [vtkusers] vtk to stl -> code is working, but with error mesage. why? Message-ID: <1519310.4KlC8nyygj@poppermobil2.site> Hello, in the framework of my project I need a stl-file out of an vtk-file. Since I couldn't find something ready to use. I took the vtk-library, looked into the vtk-doxygen and yes, it is a great library and the writer works. It compiles without any problems, the wished stl is written, but the programm complains, when I use the vtkUnstructuredGridReader class. Any help would be greatly appreciated! Best regards, fr ############################################## Run with: ./WriteSTL in.vtk out.stl ###ERROR Message Start ### ERROR: In /home/abuild/rpmbuild/BUILD/VTK5.10.1/Filtering/vtkStreamingDemandDrive nPipeline.cxx, line 934 vtkStreamingDemandDrivenPipeline (0x96cf30): No maximum number of pieces has been set in the information for output port 0 on algorithm vtkUnstructuredGridReader(0x9679c0). ERROR: In /home/abuild/rpmbuild/BUILD/VTK5.10.1/Filtering/vtkStreamingDemandDrive nPipeline.cxx, line 934 vtkStreamingDemandDrivenPipeline (0x96cf30): No maximum number of pieces has been set in the information for output port 0 on algorithm vtkUnstructuredGridReader(0x9679c0). ### ERROR Message End### Here is my peace of code: ###START CODE### #include #include #include #include #include #include #include #include #include #include #include #include #include #define VTK_CREATE(type, name) \ vtkSmartPointer name = vtkSmartPointer::New() int main(int argc, char *argv[]) { std::cout << "argc" << argc << std::endl; std::cout << "*argv[0]" << argv[0] << std::endl; std::cout << "*argv[1]" << argv[1] << std::endl; std::cout << "*argv[2]" << argv[2] << std::endl; if(argc != 3) { std::cout << "Required parameters: in.vtk and out.stl" << std::endl; return EXIT_FAILURE; } std::string filenamevtk = argv[1]; std::string filenamestl = argv[2]; // Create the reader for the data and read data VTK_CREATE(vtkUnstructuredGridReader, vtkreader); vtkreader->SetFileName(argv[1]); vtkreader->Update(); std::cout << "reading vtk done" << std::endl; VTK_CREATE(vtkUnstructuredGrid, unstructuredGrid); vtkreader->SetOutput(unstructuredGrid); unstructuredGrid->Update(); vtkSmartPointer surfaceFilter = vtkSmartPointer::New(); surfaceFilter->SetInput(unstructuredGrid); surfaceFilter->Update(); vtkPolyData* polydata = surfaceFilter->GetOutput(); polydata->Update(); vtkSmartPointer stlWriter = vtkSmartPointer::New(); stlWriter->SetFileName(filenamestl.c_str()); //stlWriter->SetInput(polydata);//works, since it needs a vtkPolyData... stlWriter->SetInputConnection(surfaceFilter->GetOutputPort());//works also and stl is identical to the other method //stlWriter->SetFileTypeToASCII(); stlWriter->Write(); return EXIT_SUCCESS; } ###END CODE### -------------- next part -------------- An HTML attachment was scrubbed... URL: From lifestudent37 at gmail.com Sat Jan 10 19:14:36 2015 From: lifestudent37 at gmail.com (Student Life) Date: Sun, 11 Jan 2015 00:14:36 +0000 Subject: [vtkusers] Best way to store multiple vtkActors using C++ In-Reply-To: References: Message-ID: Dear David Doria, Thank you for your response. I have an actor class which will store the properties of the actor on screen. For example, its opacity, colour etc. Basically, as I have previously mentioned, I only want to move the actor sometimes meaning that I would need to make use of the *'vtkInteractorStyleTrackballActor'. *However, this will mean that I will need to handle the mathematics behind it, so I am not sure where to store an actors transformation. Should I store it in the actor class or implement another class? As for the polydata and polydata mapper, should I keep it in the same class as the actor class? There is currently an example on YouTube, of a similar software that I am trying to implement. Basically, I want to group and ungroup objects on screen/memory, but I am not sure on how to implement the data structure. This is the link to the video - https://www.youtube.com/watch?v=iy0gTaN3BKI, I am trying to implement a feature similar to the one shown between 3:00 - 6:05 minutes of the video. I was thinking of using the vtkAssembly, but I am struggling with the memory management of all the vtkActors/objects on screen. I don't know if I should use a vector or linked list Would greatly appreciate it if you could give me ideas. On Fri, Jan 9, 2015 at 1:22 PM, David Doria wrote: > 1) Since I intend on using the* 'vtkInteractorStyleTrackballActor' *to >> interact with actors individually, I know that I will need to manually do >> the mathematics to allow the user to interact with the actor. I intend on >> using matrices, however I am not sure how to incorporate it into my class >> structure. At the moment, I have an *Actor* class, which basically >> stores a *vtkActor's* properties such as opacity, lighting and scale. >> The thing is, I am not sure if I should store the functions that the >> *vtkTransform* and *vtkMatrix4x4* offer in the *Actor *class. Should >> they be part of my *Actor* class, or should they be somewhere else? >> Because, ideally I want to apply transformations on each actor, but I am >> not sure if I should store each transformation in the *Actor *class. >> > > It is not clear why you are trying to duplicate the VTK class > structure/functionality? It sounds like all you need is to have a contain > of these objects and use their functions (and NOT manually do the > mathematics). > > >> 2) In terms of data structure for handling multiple *vtkActors* and >> *vtkAssembly's*, I am not sure if I should opt for the *std::vector * data >> structure or use a *linked list*. Ideally, I want the user to load a few >> stl/obj files and then my software to store each stl/obj file into memory. >> I can't really use an array, because it is unknown how many *vtkActors*, >> the user wants on the screen. What is the best sort of way of storing each >> *vtkActor* into memory? As for *vtkAssemblys*, some actors can be >> grouped into parts, so there will definitely be more than one >> *vtkAssembly* but again, I am not sure which data structure to go for. >> Should I go for a *std::vector *or a *linked list?* >> > > The container you choose should only matter for the speed of insertions > and removals. > > >> 3) If I understand *vtkPolyDatas *correctly, they are basically the >> geometry and mesh behind a physical *vtkActor*? Should I have a separate >> class to handle *vtkPolyData*, because at the moment I have the >> *vtkPolyDataMapper* in my Actor class. >> > > Again, it's still not clear why you are duplicating the hierarchy. > > >> 4) What is the difference between *vtkActorCollection* and *vtkAssembly*? >> Ideally, I want to 'group' some *vtkActors*, so that they can be >> interacted with and rotated in unison, but again I am not too sure which >> one to go for. After, you recommended the *vtkAssembly*, I did some >> research into it and it seems to be the more appropriate one, but now the >> *vtkActorCollection* is confusing me. >> > > I'm not too sure, but after a quick look it looks like vtkAssembly allows > hierarchy to be encoded, whereas vtkActorCollection is more like your #2 > above where it is simply a flat container to store a collection of actors. > > David > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lifestudent37 at gmail.com Sat Jan 10 19:29:00 2015 From: lifestudent37 at gmail.com (Student Life) Date: Sun, 11 Jan 2015 00:29:00 +0000 Subject: [vtkusers] Storing actors into memory C++ In-Reply-To: <1420808413242-5730046.post@n5.nabble.com> References: <1420808413242-5730046.post@n5.nabble.com> Message-ID: Dear chasank, Many thanks for your response. In terms of using a vector data structure, should I implement a separate class to handle and store multiple objects/vtk actors to memory? I have changed my class structures and they look a bit like this... *Actor Class...* *class Actor{ public: Actor(); // Constructor. * * ~Actor(); // Destructor. * * void reset(); // Resets all actor properties* * void setColour(); **// Sets colour to actor* * void opacity(); **// **Sets opacity to actor* *}* *Picker Class...* *class PickerActor : public Actor{* * public:* * PickerActor(); // Constructor. * * ~PickerActor(); // Destructor. }* *Multiple Actors Class...* *class ScreenObjects{ public: ScreenObjects(); // Constructor. * * ~ScreenObjects(); // Destructor.* * void addObject(); // Adds actor to memory* * void removeObject(); **// Removes actor from memory* *}* How can I improve my class/data structure? Thanks On Fri, Jan 9, 2015 at 1:00 PM, chasank wrote: > Hi, > > Don't complicate your code for nothing. All you need is a simple data > structure such as std::vector > You may push and pop your actors easily with built-in iterators. > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Storing-actors-into-memory-C-tp5729971p5730046.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 > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chasank at gmail.com Sat Jan 10 20:41:22 2015 From: chasank at gmail.com (chasank) Date: Sat, 10 Jan 2015 18:41:22 -0700 (MST) Subject: [vtkusers] Storing actors into memory C++ In-Reply-To: References: <1420808413242-5730046.post@n5.nabble.com> Message-ID: <1420940482324-5730062.post@n5.nabble.com> Hi again, You're welcome. First of all you did not have to write any class structure for storing vtkActor instances. I did not understand purpose of PickerClass I'll ignore it. With your structure you may improve your classes as follows class Actor { public: Actor(vtkProp* prop) { this.prop = prop; } // Control functions consider adding a method that takes vtkImageProperty reference. void reset(); void setColour(); void setOpacity(); double getOpacity(); .. protected: vtkProp* prop; } class ScreenObjects { public: ScreenObjects(); ~ScreenObjects(); void addObject(vtkProp* prop) { Actor* actor = new Actor(prop); this.actors.push_back(actor); } Actor* removeObject() { return this->actors.pop_back(); // Takes the reference of object and removes it from vector. } vtkPropCollection* getCollection() // get all of the actors as a collection { vtkPropCollection *collection = vtkPropCollection::New(); std::vector< Actor* >::iterator it = this->actors.begin(); for( it; it != this->actors.end(); ++it) { collection->AddItem(*it); } return collection; } protected: std::vector< Actor* > actors; } - In your main program you may cast dynamically to children objects of base vtkProp such as; vtkImageSlice* slice = dynamic_cast< vtkImageSlice* >(screenObjects->removeObject()); - For adding your actors to renderer; vtkPropCollection* collection = screenObjects->getCollection(); collection->InitTraversal(); vtkProp* prop; while (prop = collection->GetNextProp()) { renderer->AddViewProp(prop); } -- View this message in context: http://vtk.1045678.n5.nabble.com/Storing-actors-into-memory-C-tp5729971p5730062.html Sent from the VTK - Users mailing list archive at Nabble.com. From chasank at gmail.com Sat Jan 10 20:46:40 2015 From: chasank at gmail.com (chasank) Date: Sat, 10 Jan 2015 18:46:40 -0700 (MST) Subject: [vtkusers] Storing actors into memory C++ In-Reply-To: <1420940482324-5730062.post@n5.nabble.com> References: <1420808413242-5730046.post@n5.nabble.com> <1420940482324-5730062.post@n5.nabble.com> Message-ID: <1420940800774-5730063.post@n5.nabble.com> A small fix on code; for( it; it != this->actors.end(); ++it) { collection->AddItem((*it)->GetViewProp()); // Implement on Actor class } -- View this message in context: http://vtk.1045678.n5.nabble.com/Storing-actors-into-memory-C-tp5729971p5730063.html Sent from the VTK - Users mailing list archive at Nabble.com. From dcg at magellium.fr Sun Jan 11 06:45:57 2015 From: dcg at magellium.fr (Denis42) Date: Sun, 11 Jan 2015 04:45:57 -0700 (MST) Subject: [vtkusers] Camera move when resizing QVTKWidget with multiples viewports of image slices In-Reply-To: <1420812371194-5730051.post@n5.nabble.com> References: <1420812371194-5730051.post@n5.nabble.com> Message-ID: <1420976757728-5730064.post@n5.nabble.com> Hello I have found a solution: by using a QVTKWidget2 instead of a QVTKWidget, the problem disappeared. So problem solved :-) Denis -- View this message in context: http://vtk.1045678.n5.nabble.com/Camera-move-when-resizing-QVTKWidget-with-multiples-viewports-of-image-slices-tp5730051p5730064.html Sent from the VTK - Users mailing list archive at Nabble.com. From mattryan232 at gmail.com Sun Jan 11 07:02:21 2015 From: mattryan232 at gmail.com (Matt Ryan) Date: Sun, 11 Jan 2015 12:02:21 +0000 Subject: [vtkusers] Qt, QVTKWidget and Polydata Message-ID: <496A132B-A3CF-4170-9B75-A5DDFF3364A2@gmail.com> Hi All, I'm getting some odd behaviour when trying to render voxels from a polydata object in a QVTKWidget render window, specifically that each voxel appears to not have its full complement of polygon faces i.e. they appear clipped. To illustrate the problem I modified the RenderWindowUISingleInheritance.cxx example with the Cube.cxx DataManipulation (reproduced below). This is the output from the Cube.cxx example - the cubes have all their faces using the original Cube.cxx example: http://www.lightvesselautomatic.xyz/vtk/NormalVoxels_NoQVTKWidget.png This is the output from the RenderWindowUISingleInheritance.cxx - when exactly the same code is used with QVTKWidget, they appear clipped: http://www.lightvesselautomatic.xyz/vtk/ClippedVoxels_QVTKWidget.png I?m running VTK 6.0.1 and Qt 5.3.2. I?ve checked the contents of the point arrays and cell arrays defining the polydata object and they seem fine. If anyone has any insights as to why this clipping effect happens and how to overcome it, I'd be very grateful. Thanks very much for your time and help, Matt /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Modified RenderWindowUISingleInheritance.cxx #include "RenderWindowUISingleInheritance.h" // This is included here because it is forward declared in // RenderWindowUISingleInheritance.h #include "ui_RenderWindowUISingleInheritance.h" #include #include #include #include #include // #include #include "vtkCellArray.h" #include "vtkFloatArray.h" #include "vtkPointData.h" #include "vtkPoints.h" #include "vtkPolyData.h" // Constructor RenderWindowUISingleInheritance::RenderWindowUISingleInheritance() { this->ui = new Ui_RenderWindowUISingleInheritance; this->ui->setupUi(this); // Sphere vtkSmartPointer sphereSource = vtkSmartPointer::New(); sphereSource->Update(); vtkSmartPointer sphereMapper = vtkSmartPointer::New(); sphereMapper->SetInputConnection(sphereSource->GetOutputPort()); vtkSmartPointer sphereActor = vtkSmartPointer::New(); sphereActor->SetMapper(sphereMapper); // Use Cube.cxx method int i; static float x[16][3]={{0,0,0}, {1,0,0}, {1,1,0}, {0,1,0}, {0,0,1}, {1,0,1}, {1,1,1}, {0,1,1}, {1,1,1}, {2,1,1}, {2,2,1}, {1,2,1}, {1,1,2}, {2,1,2}, {2,2,2}, {1,2,2}}; static vtkIdType pts[12][4]={{0,1,2,3}, {4,5,6,7}, {0,1,5,4}, {1,2,6,5}, {2,3,7,6}, {3,0,4,7}, {8,9,10,11}, {12,13,14,15}, {8,9,13,12}, {9,10,14,13}, {10,11,15,14}, {11,8,12,15}}; // We'll create the building blocks of polydata including data attributes. vtkPolyData *cube = vtkPolyData::New(); vtkPoints *points = vtkPoints::New(); vtkCellArray *polys = vtkCellArray::New(); vtkFloatArray *scalars = vtkFloatArray::New(); // Load the point, cell, and data attributes. for (i=0; i<16; i++) points->InsertPoint(i,x[i]); for (i=0; i<12; i++) polys->InsertNextCell(4,pts[i]); for (i=0; i<16; i++) scalars->InsertTuple1(i,i); std::cout<<"NCells = " << polys->GetNumberOfCells() << "\n"; // We now assign the pieces to the vtkPolyData. cube->SetPoints(points); points->Delete(); cube->SetPolys(polys); polys->Delete(); vtkSmartPointer voxels_mapper = vtkSmartPointer::New(); voxels_mapper->SetInputData(cube); vtkSmartPointer voxels_actor = vtkSmartPointer::New(); voxels_actor->SetMapper(voxels_mapper); // VTK Renderer vtkSmartPointer renderer = vtkSmartPointer::New(); renderer->AddActor(voxels_actor); // VTK/Qt wedded this->ui->qvtkWidget->GetRenderWindow()->AddRenderer(renderer); // Set up action signals and slots connect(this->ui->actionExit, SIGNAL(triggered()), this, SLOT(slotExit())); } void RenderWindowUISingleInheritance::slotExit() { qApp->exit(); } From myk321 at gmail.com Sun Jan 11 07:47:29 2015 From: myk321 at gmail.com (Michael Arnold) Date: Sun, 11 Jan 2015 20:47:29 +0800 Subject: [vtkusers] Depth Peeling on Intel HD 4400 Message-ID: Hi, Am trying to get depth peeling to work to improve the display of a vtkPolyData surface resulting from a delaunay triangulation. Surfaces are often displayed in the wrong order. Have been unable to get depth peeling to work and applying depth sorting still results in a display with surfaces in the wrong order. VTK 6.10 Intel Core i5-4210U Intel HD Graphics 4400 OpenGL version string: 3.0 Mesa 10.3.5 Gnome Version 3.14.2 Fedora 21 Based on glxinfo (attached) and http://www.itk.org/Wiki/VTK/Depth_Peeling, I find all the relevant extensions are available for depth peeling. When experimenting with: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/CorrectlyRenderTranslucentGeometry Problem 1 Summary: calling renderWindow->SetOffScreenRendering(true), seems to break depth peeling and results in renderer->GetLastRenderingUsedDepthPeeling() and hence 'bool IsDepthPeelingSupported(...)' always returning false. Problem 1 Detail: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/CorrectlyRenderTranslucentGeometry As provided, always results in: DEPTH PEELING SUPPORT: NO CHOSEN MODE: *** DEPTH SORTING *** (A blank window is displayed under each of the 3 call scenarios on the web page. This same result is achieved under both x and wayland). But switching the parameter 'bool doitOffScreen' in the call to bool IsDepthPeelingSupported(...) from true to false, charges the result of IsDepthPeelingSupported(...) from false to true and results in the image being displayed correctly. Problem 2: Applying the above code under QVTKWidget, we still have the issue with GetLastRenderingUsedDepthPeeling(), but applying the workaround above and setting 'bool doitOffScreen' to false, results in new error message during rendering: ERROR: In /.../VTK-6.1.0/Rendering/OpenGL/vtkOpenGLRenderer.cxx, line 1068 vtkOpenGLRenderer (0x2c5a5e0): failed after RenderPeel 1 OpenGL errors detected 0 : (1282) Invalid operation Problem 2 Detail: According to Sebastien on this thread: http://comments.gmane.org/gmane.comp.lib.vtk.user/70699 We need to create a new a new render window and then attach it using QVTKWidget::SetRenderWindow(...) rather than using QVTKWidget::GetRenderWindow(...) Even after doing this and setting 'bool doitOffScreen' to false, we still get the error message above. Similar issues discussed for ATI: http://public.kitware.com/pipermail/vtkusers/2013-December/082236.html Any suggestions appreciated. Thanks and regards, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- name of display: :1 display: :1 screen: 0 direct rendering: Yes server glx vendor string: SGI server glx version string: 1.4 server glx extensions: GLX_ARB_multisample, GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer, GLX_OML_swap_method, GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, GLX_SGI_make_current_read client glx vendor string: Mesa Project and SGI client glx version string: 1.4 client glx extensions: GLX_ARB_create_context, GLX_ARB_create_context_profile, GLX_ARB_create_context_robustness, GLX_ARB_fbconfig_float, GLX_ARB_framebuffer_sRGB, GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_buffer_age, GLX_EXT_create_context_es2_profile, GLX_EXT_fbconfig_packed_float, GLX_EXT_framebuffer_sRGB, GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_INTEL_swap_event, GLX_MESA_copy_sub_buffer, GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer, GLX_MESA_swap_control, GLX_OML_swap_method, GLX_OML_sync_control, GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group, GLX_SGI_make_current_read, GLX_SGI_swap_control, GLX_SGI_video_sync GLX version: 1.4 GLX extensions: GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_buffer_age, GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer, GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer, GLX_MESA_swap_control, GLX_OML_swap_method, GLX_OML_sync_control, GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, GLX_SGI_make_current_read, GLX_SGI_video_sync OpenGL vendor string: Intel Open Source Technology Center OpenGL renderer string: Mesa DRI Intel(R) Haswell Mobile OpenGL version string: 3.0 Mesa 10.4.1 OpenGL shading language version string: 1.30 OpenGL context flags: (none) OpenGL extensions: GL_3DFX_texture_compression_FXT1, GL_AMD_conservative_depth, GL_AMD_draw_buffers_blend, GL_AMD_seamless_cubemap_per_texture, GL_AMD_shader_trinary_minmax, GL_ANGLE_texture_compression_dxt3, GL_ANGLE_texture_compression_dxt5, GL_APPLE_object_purgeable, GL_APPLE_packed_pixels, GL_APPLE_vertex_array_object, GL_ARB_ES2_compatibility, GL_ARB_ES3_compatibility, GL_ARB_blend_func_extended, GL_ARB_buffer_storage, GL_ARB_clear_buffer_object, GL_ARB_clear_texture, GL_ARB_color_buffer_float, GL_ARB_compressed_texture_pixel_storage, GL_ARB_conditional_render_inverted, GL_ARB_conservative_depth, GL_ARB_copy_buffer, GL_ARB_copy_image, GL_ARB_debug_output, GL_ARB_depth_buffer_float, GL_ARB_depth_clamp, GL_ARB_depth_texture, GL_ARB_derivative_control, GL_ARB_draw_buffers, GL_ARB_draw_buffers_blend, GL_ARB_draw_elements_base_vertex, GL_ARB_draw_instanced, GL_ARB_explicit_attrib_location, GL_ARB_explicit_uniform_location, GL_ARB_fragment_coord_conventions, GL_ARB_fragment_program, GL_ARB_fragment_program_shadow, GL_ARB_fragment_shader, GL_ARB_framebuffer_object, GL_ARB_framebuffer_sRGB, GL_ARB_get_program_binary, GL_ARB_half_float_pixel, GL_ARB_half_float_vertex, GL_ARB_instanced_arrays, GL_ARB_internalformat_query, GL_ARB_invalidate_subdata, GL_ARB_map_buffer_alignment, GL_ARB_map_buffer_range, GL_ARB_multi_bind, GL_ARB_multisample, GL_ARB_multitexture, GL_ARB_occlusion_query, GL_ARB_occlusion_query2, GL_ARB_pixel_buffer_object, GL_ARB_point_parameters, GL_ARB_point_sprite, GL_ARB_provoking_vertex, GL_ARB_robustness, GL_ARB_sample_shading, GL_ARB_sampler_objects, GL_ARB_seamless_cube_map, GL_ARB_seamless_cubemap_per_texture, GL_ARB_separate_shader_objects, GL_ARB_shader_atomic_counters, GL_ARB_shader_bit_encoding, GL_ARB_shader_objects, GL_ARB_shader_texture_lod, GL_ARB_shading_language_100, GL_ARB_shading_language_420pack, GL_ARB_shading_language_packing, GL_ARB_shadow, GL_ARB_sync, GL_ARB_texture_border_clamp, GL_ARB_texture_compression, GL_ARB_texture_compression_bptc, GL_ARB_texture_compression_rgtc, GL_ARB_texture_cube_map, GL_ARB_texture_cube_map_array, GL_ARB_texture_env_add, GL_ARB_texture_env_combine, GL_ARB_texture_env_crossbar, GL_ARB_texture_env_dot3, GL_ARB_texture_float, GL_ARB_texture_gather, GL_ARB_texture_mirror_clamp_to_edge, GL_ARB_texture_mirrored_repeat, GL_ARB_texture_multisample, GL_ARB_texture_non_power_of_two, GL_ARB_texture_query_levels, GL_ARB_texture_query_lod, GL_ARB_texture_rectangle, GL_ARB_texture_rg, GL_ARB_texture_rgb10_a2ui, GL_ARB_texture_storage, GL_ARB_texture_storage_multisample, GL_ARB_texture_swizzle, GL_ARB_texture_view, GL_ARB_timer_query, GL_ARB_transpose_matrix, GL_ARB_uniform_buffer_object, GL_ARB_vertex_array_bgra, GL_ARB_vertex_array_object, GL_ARB_vertex_attrib_binding, GL_ARB_vertex_buffer_object, GL_ARB_vertex_program, GL_ARB_vertex_shader, GL_ARB_vertex_type_10f_11f_11f_rev, GL_ARB_vertex_type_2_10_10_10_rev, GL_ARB_window_pos, GL_ATI_blend_equation_separate, GL_ATI_draw_buffers, GL_ATI_separate_stencil, GL_ATI_texture_env_combine3, GL_ATI_texture_float, GL_EXT_abgr, GL_EXT_bgra, GL_EXT_blend_color, GL_EXT_blend_equation_separate, GL_EXT_blend_func_separate, GL_EXT_blend_minmax, GL_EXT_blend_subtract, GL_EXT_compiled_vertex_array, GL_EXT_copy_texture, GL_EXT_draw_buffers2, GL_EXT_draw_instanced, GL_EXT_draw_range_elements, GL_EXT_fog_coord, GL_EXT_framebuffer_blit, GL_EXT_framebuffer_multisample, GL_EXT_framebuffer_multisample_blit_scaled, GL_EXT_framebuffer_object, GL_EXT_framebuffer_sRGB, GL_EXT_gpu_program_parameters, GL_EXT_multi_draw_arrays, GL_EXT_packed_depth_stencil, GL_EXT_packed_float, GL_EXT_packed_pixels, GL_EXT_pixel_buffer_object, GL_EXT_point_parameters, GL_EXT_polygon_offset, GL_EXT_provoking_vertex, GL_EXT_rescale_normal, GL_EXT_secondary_color, GL_EXT_separate_specular_color, GL_EXT_shader_integer_mix, GL_EXT_shadow_funcs, GL_EXT_stencil_two_side, GL_EXT_stencil_wrap, GL_EXT_subtexture, GL_EXT_texture, GL_EXT_texture3D, GL_EXT_texture_array, GL_EXT_texture_compression_dxt1, GL_EXT_texture_compression_rgtc, GL_EXT_texture_cube_map, GL_EXT_texture_edge_clamp, GL_EXT_texture_env_add, GL_EXT_texture_env_combine, GL_EXT_texture_env_dot3, GL_EXT_texture_filter_anisotropic, GL_EXT_texture_integer, GL_EXT_texture_lod_bias, GL_EXT_texture_object, GL_EXT_texture_rectangle, GL_EXT_texture_sRGB, GL_EXT_texture_sRGB_decode, GL_EXT_texture_shared_exponent, GL_EXT_texture_snorm, GL_EXT_texture_swizzle, GL_EXT_timer_query, GL_EXT_transform_feedback, GL_EXT_vertex_array, GL_EXT_vertex_array_bgra, GL_IBM_multimode_draw_arrays, GL_IBM_rasterpos_clip, GL_IBM_texture_mirrored_repeat, GL_INGR_blend_func_separate, GL_KHR_context_flush_control, GL_KHR_debug, GL_MESA_pack_invert, GL_MESA_texture_signed_rgba, GL_MESA_window_pos, GL_NV_blend_square, GL_NV_conditional_render, GL_NV_depth_clamp, GL_NV_light_max_exponent, GL_NV_packed_depth_stencil, GL_NV_primitive_restart, GL_NV_texgen_reflection, GL_NV_texture_env_combine4, GL_NV_texture_rectangle, GL_OES_EGL_image, GL_OES_read_format, GL_S3_s3tc, GL_SGIS_generate_mipmap, GL_SGIS_texture_border_clamp, GL_SGIS_texture_edge_clamp, GL_SGIS_texture_lod, GL_SUN_multi_draw_arrays 16 GLX Visuals visual x bf lv rg d st colorbuffer sr ax dp st accumbuffer ms cav id dep cl sp sz l ci b ro r g b a F gb bf th cl r g b a ns b eat ---------------------------------------------------------------------------- 0x024 24 tc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None 0x025 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None 0x0fa 24 tc 0 32 0 r . . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None 0x0fc 24 tc 0 32 0 r y . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None 0x0fe 24 tc 0 32 0 r y . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None 0x10c 24 tc 0 32 0 r . . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None 0x10e 24 tc 0 32 0 r y . 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 Slow 0x10f 24 tc 0 32 0 r y . 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 Slow 0x134 24 dc 0 32 0 r . . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None 0x136 24 dc 0 32 0 r y . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None 0x138 24 dc 0 32 0 r y . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None 0x146 24 dc 0 32 0 r . . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None 0x148 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 Slow 0x149 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None 0x14a 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 Slow 0x045 32 tc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None 38 GLXFBConfigs: visual x bf lv rg d st colorbuffer sr ax dp st accumbuffer ms cav id dep cl sp sz l ci b ro r g b a F gb bf th cl r g b a ns b eat ---------------------------------------------------------------------------- 0x046 24 tc 0 32 0 r . . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None 0x048 24 tc 0 32 0 r y . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None 0x04a 24 tc 0 32 0 r y . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None 0x058 24 tc 0 32 0 r . . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None 0x05a 24 tc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None 0x05b 24 tc 0 32 0 r y . 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 Slow 0x05c 32 tc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None 0x05d 24 tc 0 32 0 r y . 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 Slow 0x082 0 tc 0 16 0 r . . 5 6 5 0 . . 0 0 0 0 0 0 0 0 0 None 0x084 0 tc 0 16 0 r y . 5 6 5 0 . . 0 0 0 0 0 0 0 0 0 None 0x086 0 tc 0 16 0 r y . 5 6 5 0 . . 0 0 0 0 0 0 0 0 0 None 0x088 0 tc 0 16 0 r . . 5 6 5 0 . . 0 16 0 0 0 0 0 0 0 None 0x08a 0 tc 0 16 0 r y . 5 6 5 0 . . 0 16 0 0 0 0 0 0 0 None 0x08b 0 tc 0 16 0 r y . 5 6 5 0 . . 0 16 0 16 16 16 0 0 0 Slow 0x08c 0 tc 0 16 0 r y . 5 6 5 0 . . 0 16 0 0 0 0 0 0 0 None 0x08d 0 tc 0 16 0 r y . 5 6 5 0 . . 0 16 0 16 16 16 0 0 0 Slow 0x094 0 tc 0 16 0 r . . 5 6 5 0 . . 0 24 8 0 0 0 0 0 0 None 0x096 0 tc 0 16 0 r y . 5 6 5 0 . . 0 24 8 0 0 0 0 0 0 None 0x098 0 tc 0 16 0 r y . 5 6 5 0 . . 0 24 8 0 0 0 0 0 0 None 0x0a0 24 dc 0 32 0 r . . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None 0x0a2 24 dc 0 32 0 r y . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None 0x0a4 24 dc 0 32 0 r y . 8 8 8 8 . . 0 0 0 0 0 0 0 0 0 None 0x0b2 24 dc 0 32 0 r . . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None 0x0b4 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None 0x0b5 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 Slow 0x0b6 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None 0x0b7 24 dc 0 32 0 r y . 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 Slow 0x0dc 0 dc 0 16 0 r . . 5 6 5 0 . . 0 0 0 0 0 0 0 0 0 None 0x0de 0 dc 0 16 0 r y . 5 6 5 0 . . 0 0 0 0 0 0 0 0 0 None 0x0e0 0 dc 0 16 0 r y . 5 6 5 0 . . 0 0 0 0 0 0 0 0 0 None 0x0e2 0 dc 0 16 0 r . . 5 6 5 0 . . 0 16 0 0 0 0 0 0 0 None 0x0e4 0 dc 0 16 0 r y . 5 6 5 0 . . 0 16 0 0 0 0 0 0 0 None 0x0e5 0 dc 0 16 0 r y . 5 6 5 0 . . 0 16 0 16 16 16 0 0 0 Slow 0x0e6 0 dc 0 16 0 r y . 5 6 5 0 . . 0 16 0 0 0 0 0 0 0 None 0x0e7 0 dc 0 16 0 r y . 5 6 5 0 . . 0 16 0 16 16 16 0 0 0 Slow 0x0ee 0 dc 0 16 0 r . . 5 6 5 0 . . 0 24 8 0 0 0 0 0 0 None 0x0f0 0 dc 0 16 0 r y . 5 6 5 0 . . 0 24 8 0 0 0 0 0 0 None 0x0f2 0 dc 0 16 0 r y . 5 6 5 0 . . 0 24 8 0 0 0 0 0 0 None From lifestudent37 at gmail.com Sun Jan 11 10:39:36 2015 From: lifestudent37 at gmail.com (Student Life) Date: Sun, 11 Jan 2015 15:39:36 +0000 Subject: [vtkusers] Storing actors into memory C++ In-Reply-To: <1420940800774-5730063.post@n5.nabble.com> References: <1420808413242-5730046.post@n5.nabble.com> <1420940482324-5730062.post@n5.nabble.com> <1420940800774-5730063.post@n5.nabble.com> Message-ID: Dear Chasank, Thank you so much :), I really mean it. I just have a few questions, 1) In terms of memory management is it better to opt for a vector or a linked list? Because I see you are making use of vectors, and having done some research myself, I found that vectors have faster access time than linked lists. 2) I'm not sure if I have asked this question before, but basically I want to group some objects/vtk actors together so that they can move in unison whilst other actors stay where they are. Having done some research myself, I found that I may need to incorporate a vtkAssembly. There is currently an example on YouTube, of a similar software that I am trying to implement. Basically, I want to group and ungroup objects on screen/memory, but I am not sure on how to implement the data structure. This is the link to the video - https://www.youtube.com/watch?v=iy0gTaN3BKI, I am trying to implement a feature similar to the one shown between 3:00 - 6:05 minutes of the video. 3) What other properties, do you feel are essential to store in regards to a vtkActor. I would greatly appreciate it if you could answer my queries. Once again, thank you so much for answering my previous queries. On Sun, Jan 11, 2015 at 1:46 AM, chasank wrote: > A small fix on code; > > for( it; it != this->actors.end(); ++it) > { > collection->AddItem((*it)->GetViewProp()); // Implement on Actor class > } > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Storing-actors-into-memory-C-tp5729971p5730063.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 > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From burlen.loring at gmail.com Sun Jan 11 15:38:13 2015 From: burlen.loring at gmail.com (Burlen Loring) Date: Sun, 11 Jan 2015 12:38:13 -0800 Subject: [vtkusers] Depth Peeling on Intel HD 4400 In-Reply-To: References: Message-ID: <54B2DF35.7020402@gmail.com> Hi Michale, In the test program you pointed to, not all combinations of inputs are valid or will work everywhere. In your "Problem 1" you are identifying some scenarios that don't work on your system, but are valid use cases on other platforms. > Problem 1 Summary: calling renderWindow->SetOffScreenRendering(true), > seems to break depth peeling the run time selection of on or offscreen rendering doesn't work with modern Mesa drivers on Linux. It may work on other platforms/drivers (eg Windows). > switching the parameter 'bool doitOffScreen' in the call to bool > IsDepthPeelingSupported(...) from true to false, charges the result of > IsDepthPeelingSupported(...) from false to true and results in the > image being displayed correctly. Given that run time selection of offscreen rendering is not supported on your system, the behavior you're describing sounds correct. With your system/configuration you should just use on screen rendering. In your "Problem 2" you report an OpenGL error in the vtkOpenGLRenderer::RenderPeel. This is perhaps a bug in VTK's depth peeling code, but far more likely a bug in Mesa Intel driver itself. Someone (I can't do it because I don't have an hd 4400 linux system handy) needs to step through this section of code and see which GL call is the source of the error and see if there's an easy work around/bug fix for VTK and if not disbale depth peeling for this driver/hardware combo and report it to the Mesa developers. Burlen On 1/11/2015 4:47 AM, Michael Arnold wrote: > Hi, > > Am trying to get depth peeling to work to improve the display of a > vtkPolyData surface resulting from a delaunay triangulation. Surfaces > are often displayed in the wrong order. Have been unable to get depth > peeling to work and applying depth sorting still results in a display > with surfaces in the wrong order. > > VTK 6.10 > > Intel Core i5-4210U > Intel HD Graphics 4400 > OpenGL version string: 3.0 > Mesa 10.3.5 > Gnome Version 3.14.2 > Fedora 21 > > Based on glxinfo (attached) and > http://www.itk.org/Wiki/VTK/Depth_Peeling, I find all the relevant > extensions are available for depth peeling. > > When experimenting with: > http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/CorrectlyRenderTranslucentGeometry > > Problem 1 Summary: calling renderWindow->SetOffScreenRendering(true), > seems to break depth peeling and results in > renderer->GetLastRenderingUsedDepthPeeling() and hence 'bool > IsDepthPeelingSupported(...)' always returning false. > > Problem 1 Detail: > http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/CorrectlyRenderTranslucentGeometry > As provided, always results in: > > DEPTH PEELING SUPPORT: NO > > CHOSEN MODE: *** DEPTH SORTING *** > > (A blank window is displayed under each of the 3 call scenarios on the > web page. This same result is achieved under both x and wayland). > > But switching the parameter 'bool doitOffScreen' in the call to bool > IsDepthPeelingSupported(...) from true to false, charges the result of > IsDepthPeelingSupported(...) from false to true and results in the > image being displayed correctly. > > Problem 2: Applying the above code under QVTKWidget, we still have the > issue with GetLastRenderingUsedDepthPeeling(), but applying the > workaround above and setting 'bool doitOffScreen' to false, results in > new error message during rendering: > ERROR: In /.../VTK-6.1.0/Rendering/OpenGL/vtkOpenGLRenderer.cxx, > line 1068 > vtkOpenGLRenderer (0x2c5a5e0): failed after RenderPeel 1 OpenGL > errors detected > 0 : (1282) Invalid operation > > Problem 2 Detail: > > According to Sebastien on this thread: > http://comments.gmane.org/gmane.comp.lib.vtk.user/70699 > > We need to create a new a new render window and then attach it using > QVTKWidget::SetRenderWindow(...) rather than using > QVTKWidget::GetRenderWindow(...) > > Even after doing this and setting 'bool doitOffScreen' to false, we > still get the error message above. > > Similar issues discussed for ATI: > http://public.kitware.com/pipermail/vtkusers/2013-December/082236.html > > Any suggestions appreciated. > > Thanks and regards, > Michael > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From zafer.leylek at gmail.com Sun Jan 11 18:59:43 2015 From: zafer.leylek at gmail.com (zackster) Date: Sun, 11 Jan 2015 16:59:43 -0700 (MST) Subject: [vtkusers] Qt, QVTKWidget and Polydata In-Reply-To: <496A132B-A3CF-4170-9B75-A5DDFF3364A2@gmail.com> References: <496A132B-A3CF-4170-9B75-A5DDFF3364A2@gmail.com> Message-ID: <1421020783962-5730070.post@n5.nabble.com> Try voxels_actor->BackfaceCullingOn(); -- View this message in context: http://vtk.1045678.n5.nabble.com/Qt-QVTKWidget-and-Polydata-tp5730065p5730070.html Sent from the VTK - Users mailing list archive at Nabble.com. From zafer.leylek at gmail.com Sun Jan 11 19:08:21 2015 From: zafer.leylek at gmail.com (zackster) Date: Sun, 11 Jan 2015 17:08:21 -0700 (MST) Subject: [vtkusers] Qt, QVTKWidget gridActor always in front Message-ID: <1421021301074-5730071.post@n5.nabble.com> Hi, Below is a modified version of the SidebySideRenderWindowsQT example. I have added a structured/image actor to the renderwindow that contains the sphere. My problem is that the structured grid is always in front of the sphere. This is not the case when not using QVTKWidget. Any ideas?? #include "SideBySideRenderWindowsQt.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // Constructor SideBySideRenderWindowsQt::SideBySideRenderWindowsQt() { this->setupUi(this); // Sphere vtkSmartPointer sphereSource = vtkSmartPointer::New(); sphereSource->Update(); vtkSmartPointer sphereMapper = vtkSmartPointer::New(); sphereMapper->SetInputConnection(sphereSource->GetOutputPort()); vtkSmartPointer sphereActor = vtkSmartPointer::New(); sphereActor->SetMapper(sphereMapper); // Cube vtkSmartPointer cubeSource = vtkSmartPointer::New(); cubeSource->Update(); vtkSmartPointer cubeMapper = vtkSmartPointer::New(); cubeMapper->SetInputConnection(cubeSource->GetOutputPort()); vtkSmartPointer cubeActor = vtkSmartPointer::New(); cubeActor->SetMapper(cubeMapper); // VTK Renderer vtkSmartPointer leftRenderer = vtkSmartPointer::New(); leftRenderer->AddActor(sphereActor); vtkSmartPointer rightRenderer = vtkSmartPointer::New(); // Add Actor to renderer rightRenderer->AddActor(cubeActor); /* * Modification 1 */ sphereActor->GetProperty()->BackfaceCullingOn(); sphereActor->GetProperty()->SetColor(1,0,1); /* * Modification 2 */ vtkSmartPointer image =vtkSmartPointer::New(); image->SetDimensions(3,3,1); image->SetSpacing(1.0, 1.0, 0.0); image->SetOrigin(-1.5, -1.5, -2); vtkSmartPointer imageDataToPointSet =vtkSmartPointer::New(); #if VTK_MAJOR_VERSION <= 5 imageDataToPointSet->SetInputConnection(image->GetProducerPort()); #else imageDataToPointSet->SetInputData(image); #endif imageDataToPointSet->Update(); vtkSmartPointer imageGridMapper = vtkSmartPointer::New(); vtkSmartPointer imageGridActor = vtkSmartPointer::New(); imageGridMapper->SetInputConnection(imageDataToPointSet->GetOutputPort()); imageGridActor->SetMapper(imageGridMapper); imageGridActor->GetProperty()->SetColor(0,0,1); leftRenderer->AddActor(imageGridActor); // VTK/Qt wedded this->qvtkWidgetLeft->GetRenderWindow()->AddRenderer(leftRenderer); this->qvtkWidgetRight->GetRenderWindow()->AddRenderer(rightRenderer); // Set up action signals and slots connect(this->actionExit, SIGNAL(triggered()), this, SLOT(slotExit())); } void SideBySideRenderWindowsQt::slotExit() { qApp->exit(); } -- View this message in context: http://vtk.1045678.n5.nabble.com/Qt-QVTKWidget-gridActor-always-in-front-tp5730071.html Sent from the VTK - Users mailing list archive at Nabble.com. From zafer.leylek at gmail.com Sun Jan 11 19:38:57 2015 From: zafer.leylek at gmail.com (zackster) Date: Sun, 11 Jan 2015 17:38:57 -0700 (MST) Subject: [vtkusers] Qt, QVTKWidget gridActor always in front In-Reply-To: <1421021301074-5730071.post@n5.nabble.com> References: <1421021301074-5730071.post@n5.nabble.com> Message-ID: <1421023137029-5730072.post@n5.nabble.com> The system on which this fails is an Ubuntu 14.04 running in a virtualbox machine. When I tried the same code on a dedicated Ubuntu 14.04 machine this problem disappeared. What could be the cause and how can I fix it? -- View this message in context: http://vtk.1045678.n5.nabble.com/Qt-QVTKWidget-gridActor-always-in-front-tp5730071p5730072.html Sent from the VTK - Users mailing list archive at Nabble.com. From JesseSmith at my.unt.edu Mon Jan 12 00:17:39 2015 From: JesseSmith at my.unt.edu (Smith, Jesse) Date: Mon, 12 Jan 2015 05:17:39 +0000 Subject: [vtkusers] Having trouble opening exported OBJ files in other programs. Message-ID: <1421039855974.58942@my.unt.edu> In vtk I have exported a scene to .obj/.mtl using vtkOBJExporter. The vtkRenderWindow that is connected the vtkOBJExporter only contains 3 actors: two spheres and a cylinder (tube filter). I have been trying to open the obj in other software, but with varying luck. I have tried opening the file in Blender and meshlab where it fails (meshlab complains about "Bad texture coords index in face"). However, the file opens successfully in netfabb. On the other hand, if I union boolean (vtkBooleanOperationPolyDataFilter) the three polydata (2 spheres and cylinder) together, and create one actor for the resulting single polydata, the obj/mtl from that scene opens successfully in all three programs. Attached is the obj/mtl files that fail. What could be the issue here? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: test.mtl Type: application/octet-stream Size: 237 bytes Desc: test.mtl URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: test.obj Type: application/x-tgif Size: 90679 bytes Desc: test.obj URL: From wulihouxiaoshuai at 163.com Mon Jan 12 03:17:12 2015 From: wulihouxiaoshuai at 163.com (Emptystack) Date: Mon, 12 Jan 2015 01:17:12 -0700 (MST) Subject: [vtkusers] Java servlet + Glassfish + volume rendering applications problem In-Reply-To: <1420795069171-5730042.post@n5.nabble.com> References: <1420686868240-5730017.post@n5.nabble.com> <1420768376754-5730037.post@n5.nabble.com> <1420795069171-5730042.post@n5.nabble.com> Message-ID: <1421050632132-5730074.post@n5.nabble.com> Many thanks for your reply! But I cannot understand what you said. I have tried by using HttpSession and its setAttribute method to instantiate vtk instances! But the problem still existed! Can you describe it in detail or give me some piece of codes to illustrate how to store vtk instances in a web session scope? Best wishes! -- View this message in context: http://vtk.1045678.n5.nabble.com/Java-servlet-Glassfish-volume-rendering-applications-problem-tp5730017p5730074.html Sent from the VTK - Users mailing list archive at Nabble.com. From chasank at gmail.com Mon Jan 12 03:32:16 2015 From: chasank at gmail.com (chasank) Date: Mon, 12 Jan 2015 01:32:16 -0700 (MST) Subject: [vtkusers] Java servlet + Glassfish + volume rendering applications problem In-Reply-To: <1421050632132-5730074.post@n5.nabble.com> References: <1420686868240-5730017.post@n5.nabble.com> <1420768376754-5730037.post@n5.nabble.com> <1420795069171-5730042.post@n5.nabble.com> <1421050632132-5730074.post@n5.nabble.com> Message-ID: <1421051536488-5730075.post@n5.nabble.com> I don't know your current implementation. But you may extend your HttpSession class to put your vtk instances. Whenever user logins scope of web session and your vtk instances starts until user logs out. -- View this message in context: http://vtk.1045678.n5.nabble.com/Java-servlet-Glassfish-volume-rendering-applications-problem-tp5730017p5730075.html Sent from the VTK - Users mailing list archive at Nabble.com. From grothausmann.roman at mh-hannover.de Mon Jan 12 05:56:33 2015 From: grothausmann.roman at mh-hannover.de (Dr. Roman Grothausmann) Date: Mon, 12 Jan 2015 11:56:33 +0100 Subject: [vtkusers] making vtkGaussianSplatter multi-threaded Message-ID: <54B3A861.6060805@mh-hannover.de> Dear mailing list members, Since I already started to create and use a modified version of vtkGaussianSplatter I now wonder if it were possible to make vtkGaussianSplatter run multi-threaded. I'd expect that this is possible if getting and setting pixel values is thread-safe. In vtkGaussianSplatter pixel values are stored in a vtkDoubleArray and read with GetValue and written with SetTuple. There is no info in the docs whether SetTuple (in the way used) is thread-safe. Although GetValue seems to exist, I cannot find any hint in the docs that vtkDoubleArray offers this function, however a thread-safe version of GetTuple exists. So is there any reason vtkGaussianSplatter cannot be made multi-threaded with VTK6? I found vtkGaussianScalarSplatter in the MADAI Workbench (https://github.com/MADAI/MADAIWorkbench/tree/71086409933f5c7dbb4ad56e1cd79939325ee7cd/Plugins/GaussianScalarSplatter) which seems to be based on vtkGaussianSplatter and originally was multi-threaded (https://github.com/MADAI/MADAIWorkbench/commit/8a6d9eba7a1cddeac38a9af03ef6c3dd197308d7). As far as I understand the code, the output of that filter is different to that of vtkGaussianSplatter, as setting the model bounds is disabled and the function SetScalar is gone and replaced by vtkGaussianScalarSplatter_erf. Are there any other derivatives of vtkGaussianSplatter that are multi-threaded that I could use instead? Thanks for any help or hints. Roman -- Dr. Roman Grothausmann Tomographie und Digitale Bildverarbeitung Tomography and Digital Image Analysis Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 Medizinische Hochschule Hannover Carl-Neuberg-Str. 1 D-30625 Hannover Tel. +49 511 532-9574 From david.gobbi at gmail.com Mon Jan 12 08:55:33 2015 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 12 Jan 2015 06:55:33 -0700 Subject: [vtkusers] [Paraview] making vtkGaussianSplatter multi-threaded In-Reply-To: <54B3A861.6060805@mh-hannover.de> References: <54B3A861.6060805@mh-hannover.de> Message-ID: On Mon, Jan 12, 2015 at 3:56 AM, Dr. Roman Grothausmann < grothausmann.roman at mh-hannover.de> wrote: > Dear mailing list members, > > Since I already started to create and use a modified version of > vtkGaussianSplatter I now wonder if it were possible to make > vtkGaussianSplatter run multi-threaded. I'd expect that this is possible if > getting and setting pixel values is thread-safe. In vtkGaussianSplatter > pixel values are stored in a vtkDoubleArray and read with GetValue and > written with SetTuple. There is no info in the docs whether SetTuple (in > the way used) is thread-safe. Although GetValue seems to exist, I cannot > find any hint in the docs that vtkDoubleArray offers this function, however > a thread-safe version of GetTuple exists. > So is there any reason vtkGaussianSplatter cannot be made multi-threaded > with VTK6? > The SetTuple/GetTuple methods don't lock the array, so they equivalent to (but slower than) raw memory reads and writes. And writing memory is not thread safe if threads can write to the same memory address or (depending on alignment) to adjacent addresses. For vtkGaussianSplatter, any performance gains that could be had by multi-threading would depend on the threads all being able to write at the same time, therefore any sort of "lock" would kill the performance by essentially serializing the writes. Hence, in order for vtkGaussianSplatter to be properly multi-threaded, each thread must write to its own block of output memory. After the splatting is done these must be composited together. I wrote a multi-threaded splatting filter once (for ultrasound reconstruction), and in that case I divided my input points such that each thread would write to different (but adjacent) memory regions within the output. It performed well but wasn't completely thread-safe, because it was possible for memory collisions to occur on the border between the regions. In summary: properly multi-threading vtkGaussianSplatter would be a moderately difficult task. I haven't heard of anyone who has done it yet. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From richard.j.brown at live.co.uk Mon Jan 12 09:54:53 2015 From: richard.j.brown at live.co.uk (mbcx9rb9) Date: Mon, 12 Jan 2015 07:54:53 -0700 (MST) Subject: [vtkusers] add circles & sphere to DICOM slices & 3D viewer In-Reply-To: References: <1420797792171-5730043.post@n5.nabble.com> Message-ID: <1421074493281-5730081.post@n5.nabble.com> Chasank, David, Thanks for the advice. David, I think you're right about my lack of understanding of the rendering process - amongst many other aspects. The circle, for example, always appears in the centre of the rendered screen and is always the same size. If I go to the 0th slice and click the bottom left pixel, the circle then jumps up in the middle of the screen. Using the GetPointIJK structured coordinates, do I need to convert the selected point to a different coordinate system for the sphere/cutting plane? I also haven't managed to see both the circle and the DICOM image at the same time, despite what feels like every combination of setOpacity, setAmbient, etc. When I set the background of the newly cut circle to green, everything goes green, so I think it might be that the background of the circle is masking the DICOM slice, can I set it to have a transparent background? Lastly, when I can draw the circle in the correct place, the correct size and can see the DICOM underneath, I need to fill the middle of the circle in. I saw on this thread some suggestions, but neither vtkTriangleFilter nor vtkLinearExtrusionFilter did the trick for me. Any ideas? Thanks -- View this message in context: http://vtk.1045678.n5.nabble.com/add-circles-sphere-to-DICOM-slices-3D-viewer-tp5730043p5730081.html Sent from the VTK - Users mailing list archive at Nabble.com. From grothausmann.roman at mh-hannover.de Mon Jan 12 09:58:47 2015 From: grothausmann.roman at mh-hannover.de (Dr. Roman Grothausmann) Date: Mon, 12 Jan 2015 15:58:47 +0100 Subject: [vtkusers] [Paraview] making vtkGaussianSplatter multi-threaded In-Reply-To: References: <54B3A861.6060805@mh-hannover.de> Message-ID: <54B3E127.70000@mh-hannover.de> Dear David, Many thanks for Your reply and explanations. On 12/01/15 14:55, David Gobbi wrote: > On Mon, Jan 12, 2015 at 3:56 AM, Dr. Roman Grothausmann > serializing the writes. Hence, in order for vtkGaussianSplatter to be properly > multi-threaded, each thread must write to its own block of output memory. After > the splatting is done these must be composited together. So a simple way to make vtkGaussianSplatter multi-threaded would be to partition the input points into n groups and run vtkGaussianSplatter on each group, resulting in n fully sized outputs, which have to be combine together afterwards. The problem is that this will need n times the memory. > I wrote a multi-threaded splatting filter once (for ultrasound reconstruction), > and in that case I divided my input points such that each thread would write to > different (but adjacent) memory regions within the output. It performed well > but wasn't completely thread-safe, because it was possible for memory collisions > to occur on the border between the regions. Would it help and be possible to only lock access in these border regions? Many thanks again. Roman -- Dr. Roman Grothausmann Tomographie und Digitale Bildverarbeitung Tomography and Digital Image Analysis Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 Medizinische Hochschule Hannover Carl-Neuberg-Str. 1 D-30625 Hannover Tel. +49 511 532-9574 From Gerrick.Bivins at halliburton.com Mon Jan 12 09:46:40 2015 From: Gerrick.Bivins at halliburton.com (Gerrick Bivins) Date: Mon, 12 Jan 2015 14:46:40 +0000 Subject: [vtkusers] Setting up python development env Message-ID: Hello all, I'm trying to help a colleague get setup to do VTK/Python development using PyDev. Is this the most current doc: http://www.vtk.org/Wiki/VTK/PythonDevelopment#VTK_Eclipse.2FPydev Also, this looks like it requires the build to be on the machine, ie, I wouldn't be able to use the installer version to setup a dev environment. Is that correct? Gerrick ---------------------------------------------------------------------- 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: From david.gobbi at gmail.com Mon Jan 12 11:27:12 2015 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 12 Jan 2015 09:27:12 -0700 Subject: [vtkusers] add circles & sphere to DICOM slices & 3D viewer In-Reply-To: <1421074493281-5730081.post@n5.nabble.com> References: <1420797792171-5730043.post@n5.nabble.com> <1421074493281-5730081.post@n5.nabble.com> Message-ID: On Mon, Jan 12, 2015 at 7:54 AM, mbcx9rb9 wrote: > > The circle, for example, always appears in the centre of the rendered > screen > and is always the same size. If you don't set the FocalPoint, Position, ViewUp, and ViewAngle of the vtkCamera, then the vtkCamera will set these automatically so that the the actors are within view. To get an idea of what is going on, you should try setting these parameters manually. Also, search google for "opengl camera" because there are tons of well- written documents about the camera metaphor that is used for 3D graphics. If I go to the 0th slice and click the bottom > left pixel, the circle then jumps up in the middle of the screen. Using the > GetPointIJK structured coordinates, do I need to convert the selected point > to a different coordinate system for the sphere/cutting plane? > Get GetPointIJK gives the i,j,k (row, col, slice) indices into the image, i.e. integers. VTK uses floating-point x,y,z coords for its data coords, which implicitly use units of "mm" when dealing with DICOM files. The picker's GetMapperPosition() and GetPickPosition() methods return the latter. > I also haven't managed to see both the circle and the DICOM image at the > same time, despite what feels like every combination of setOpacity, > setAmbient, etc. When I set the background of the newly cut circle to > green, > everything goes green, so I think it might be that the background of the > circle is masking the DICOM slice, can I set it to have a transparent > background? > There is no way to set the background for a single actor, AFAIK the only way to set the background is in the vtkRenderer, in which case you are setting the background for everything, and the background will therefore be behind everything and cannot ever be in front of something. Can you explain in more detail what you are doing? Lastly, when I can draw the circle in the correct place, the correct size > and can see the DICOM underneath, I need to fill the middle of the circle > in. I saw on this > < > http://vtk.1045678.n5.nabble.com/Filling-vtkCutter-output-td1244798.html#a1244800 > > > thread some suggestions, but neither vtkTriangleFilter nor > vtkLinearExtrusionFilter did the trick for me. Any ideas? > Try vtkContourTriangulator. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From loic_luquet at yahoo.fr Mon Jan 12 12:00:11 2015 From: loic_luquet at yahoo.fr (loic luquet) Date: Mon, 12 Jan 2015 17:00:11 +0000 (UTC) Subject: [vtkusers] Abaqus and nastran readers Message-ID: <1869035199.1111957.1421082011164.JavaMail.yahoo@jws11163.mail.ir2.yahoo.com> ?Dear all,?I am a newUser of Paraview, we are supposed to create some post treatment onAbaqus/Nastran files.?The formatof Abaqus/Nastran should be respectively .inp / .bdf .dat?Currently,Paraview doesn?t allow to do this, but I read some exchanges between you andusers about plugins doing this.?Do you knowwhere could I find the sources of these plugins? ?Manythanks,?Bests,?Loic -------------- next part -------------- An HTML attachment was scrubbed... URL: From grothausmann.roman at mh-hannover.de Mon Jan 12 12:36:11 2015 From: grothausmann.roman at mh-hannover.de (Dr. Roman Grothausmann) Date: Mon, 12 Jan 2015 18:36:11 +0100 Subject: [vtkusers] realizing partial updates of filter-pipeline within a paraview plugin Message-ID: <54B4060B.20009@mh-hannover.de> Dear mailing list members, If a single paraview plugin consists of multiple connected vtk-fiters (like a mini-pipeline) and Apply is clicked again after some of its parameters have been changed in the Properties panel. Is it possible to only cause updates to specific filters in this pipeline, i.e. those for which e.g. a parameter was changed in the GUI? Thanks for any help or hints. Roman -- Dr. Roman Grothausmann Tomographie und Digitale Bildverarbeitung Tomography and Digital Image Analysis Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 Medizinische Hochschule Hannover Carl-Neuberg-Str. 1 D-30625 Hannover Tel. +49 511 532-9574 From rekha.pyage at gmail.com Tue Jan 13 02:09:56 2015 From: rekha.pyage at gmail.com (reks) Date: Tue, 13 Jan 2015 00:09:56 -0700 (MST) Subject: [vtkusers] vtk 5.10 to vtk6.1 migration Message-ID: <1421132996447-5730095.post@n5.nabble.com> Hello all, Currently I am using vtk 5.10 and now I want to move to new version of vtk 6.1.I have gone through the vtk 6.1 migration release notes and found there are many changes.I used SetInput function in my application modules of vtk5.10 version but it is changed to SetInputData in New release.In that case I have to change SetInput function to SetInputData function in many places(say 200-500 places ).Do I need to go to each line of my code and change the function or Is there any other way to do it?Please can any one suggest me... Thanks in advance reks -- View this message in context: http://vtk.1045678.n5.nabble.com/vtk-5-10-to-vtk6-1-migration-tp5730095.html Sent from the VTK - Users mailing list archive at Nabble.com. From julio.hoffimann at gmail.com Tue Jan 13 02:17:39 2015 From: julio.hoffimann at gmail.com (=?UTF-8?Q?J=C3=BAlio_Hoffimann?=) Date: Mon, 12 Jan 2015 23:17:39 -0800 Subject: [vtkusers] vtk 5.10 to vtk6.1 migration In-Reply-To: <1421132996447-5730095.post@n5.nabble.com> References: <1421132996447-5730095.post@n5.nabble.com> Message-ID: Use tools such as sed on Linux. -J?lio -------------- next part -------------- An HTML attachment was scrubbed... URL: From mattryan232 at gmail.com Tue Jan 13 08:09:38 2015 From: mattryan232 at gmail.com (mryan) Date: Tue, 13 Jan 2015 06:09:38 -0700 (MST) Subject: [vtkusers] Qt, QVTKWidget and Polydata In-Reply-To: <1421020783962-5730070.post@n5.nabble.com> References: <496A132B-A3CF-4170-9B75-A5DDFF3364A2@gmail.com> <1421020783962-5730070.post@n5.nabble.com> Message-ID: <1421154578988-5730099.post@n5.nabble.com> Hi zackster, Thanks, that helped. However, if I add another set of points, such that two cubes have adjacent faces, then I see the clipping effect again, even with BackfaceCullingOn(). Adjacent cubes, no QVTKWidget: http://www.lightvesselautomatic.xyz/vtk/NormalVoxels_SharedFace_NoQVTKWidget.png Adjacent Cubes in QVTKWidget: http://www.lightvesselautomatic.xyz/vtk/ClippedVoxels_SharedFace_QVTKWidget.png Below the modified RenderWindowUISingleInheritance.cxx with the additional cube. I don't see any obvious candidtaes, but are there any properties to set that would turn off this behaviour? Essentially what I'm trying to do is to represent data that I receive in the form of voxel vertices and scalar data i.e. x0,y0,z0,scalar_value0 x0,y0,z1,scalar_value1 etc. vtkPolyData seems to me to be the best representation for these, particularly for thresholding on the scalar data and annoyingly it works well without QVTKWidget, but I need this to be part of a wider app. Thanks again, Matt //////////////////////////////////////////////////////////////////////////////////////////////////////////// #include "RenderWindowUISingleInheritance.h" // This is included here because it is forward declared in // RenderWindowUISingleInheritance.h #include "ui_RenderWindowUISingleInheritance.h" #include #include #include #include #include #include #include "vtkCellArray.h" #include "vtkFloatArray.h" #include "vtkPointData.h" #include "vtkPoints.h" #include "vtkPolyData.h" #include "vtkProperty.h" // Constructor RenderWindowUISingleInheritance::RenderWindowUISingleInheritance() { this->ui = new Ui_RenderWindowUISingleInheritance; this->ui->setupUi(this); int i; static float x[24][3]={{0,0,0}, {1,0,0}, {1,1,0}, {0,1,0}, {0,0,1}, {1,0,1}, {1,1,1}, {0,1,1}, {1,1,1}, {2,1,1}, {2,2,1}, {1,2,1}, {1,1,2}, {2,1,2}, {2,2,2}, {1,2,2}, {1,0,0}, {2,0,0}, {2,1,0}, {1,1,0}, {1,0,1}, {2,0,1}, {2,1,1}, {1,1,1}}; static vtkIdType pts[18][4]={{0,1,2,3}, {4,5,6,7}, {0,1,5,4}, {1,2,6,5}, {2,3,7,6}, {3,0,4,7}, {8,9,10,11}, {12,13,14,15}, {8,9,13,12}, {9,10,14,13}, {10,11,15,14}, {11,8,12,15}, {16,17,18,19}, {20,21,22,23}, {16,17,21,20}, {17,18,22,21}, {18,19,23,22}, {19,16,20,23}}; // We'll create the building blocks of polydata including data attributes. vtkPolyData *cube = vtkPolyData::New(); vtkPoints *points = vtkPoints::New(); vtkCellArray *polys = vtkCellArray::New(); vtkFloatArray *scalars = vtkFloatArray::New(); // Load the point, cell, and data attributes. for (i=0; i<24; i++) points->InsertPoint(i,x[i]); for (i=0; i<18; i++) polys->InsertNextCell(4,pts[i]); for (i=0; i<24; i++) scalars->InsertTuple1(i,i); // We now assign the pieces to the vtkPolyData. cube->SetPoints(points); points->Delete(); cube->SetPolys(polys); polys->Delete(); vtkSmartPointer voxels_mapper = vtkSmartPointer::New(); voxels_mapper->SetInputData(cube); voxels_mapper->Update(); vtkSmartPointer voxels_actor = vtkSmartPointer::New(); voxels_actor->SetMapper(voxels_mapper); voxels_actor->GetProperty()->BackfaceCullingOn(); // VTK Renderer vtkSmartPointer renderer = vtkSmartPointer::New(); renderer->AddActor(voxels_actor); // VTK/Qt wedded this->ui->qvtkWidget->GetRenderWindow()->AddRenderer(renderer); this->ui->qvtkWidget->GetInteractor()->SetRenderWindow(this->ui->qvtkWidget->GetRenderWindow()); // Set up action signals and slots connect(this->ui->actionExit, SIGNAL(triggered()), this, SLOT(slotExit())); } void RenderWindowUISingleInheritance::slotExit() { qApp->exit(); } -- View this message in context: http://vtk.1045678.n5.nabble.com/Qt-QVTKWidget-and-Polydata-tp5730065p5730099.html Sent from the VTK - Users mailing list archive at Nabble.com. From richard.j.brown at live.co.uk Tue Jan 13 08:24:58 2015 From: richard.j.brown at live.co.uk (Richard Brown) Date: Tue, 13 Jan 2015 14:24:58 +0100 Subject: [vtkusers] add circles & sphere to DICOM slices & 3D viewer In-Reply-To: References: <1420797792171-5730043.post@n5.nabble.com> <1421074493281-5730081.post@n5.nabble.com> Message-ID: Thanks, vtkContourTriangulator worked well and I?ll continue to work my way through your first two points. For the third point: > I also haven't managed to see both the circle and the DICOM image at the > same time, despite what feels like every combination of setOpacity, > setAmbient, etc. When I set the background of the newly cut circle to green, > everything goes green, so I think it might be that the background of the > circle is masking the DICOM slice, can I set it to have a transparent > background? > > There is no way to set the background for a single actor, AFAIK the only way to > set the background is in the vtkRenderer, in which case you are setting the background > for everything, and the background will therefore be behind everything and cannot > ever be in front of something. Can you explain in more detail what you are doing? Beneath I?ve copied the code that I?ve been trying. worldCoords is the point returned by the user?s click using GetIJK (by the way, the difference between GetIJK and GetPickPosition & GetMapperPosition is IJK is the rounded to int, the values are otherwise the same?). I try to add the newly cut circle to the QVTKWidget already containing the DICOM slice using GetRenderindow()->AddRenderer(renderer) at the end, and the output is a semi-transparent red circle (because opacity is 40%) on a bright green background. I can?t for the life of me figure out where I need to point the camera to see the DICOM slice again. Cheers for the help, Richard P.S. I know the vtkCamera settings are nonsensical, I am just messing about with them at this stage. vtkSmartPointer sphere = vtkSmartPointer::New(); sphere->SetCenter(mmCoords); sphere->SetPhiResolution(30); sphere->SetThetaResolution(30); sphere->SetRadius(5); sphere->Update(); vtkSmartPointer plane = vtkSmartPointer::New(); plane->SetOrigin(worldCoords[0], worldCoords[1], worldCoords[2]); plane->SetNormal(0, 0, 1); vtkSmartPointer triangles = vtkSmartPointer::New(); triangles->SetInputConnection(sphereCutter->GetOutputPort()); // Visualize vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(triangles->GetOutputPort()); vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); actor->GetProperty()->SetColor(1.0, 0.0, 0.0); actor->GetProperty()->EdgeVisibilityOff(); actor->GetProperty()->SetAmbient(1.0); actor->GetProperty()->SetDiffuse(1.0); actor->GetProperty()->SetOpacity(0.4); vtkSmartPointer camera = vtkSmartPointer::New(); camera->SetPosition(worldCoords[0], worldCoords[1], worldCoords[2]+50); camera->SetFocalPoint(worldCoords[0], worldCoords[1], worldCoords[2]); vtkSmartPointer renderer = vtkSmartPointer::New(); renderer->AddActor(actor); renderer->SetBackground(0,1,0); renderer->SetActiveCamera(camera); ui->qvtk->GetRenderWindow()->AddRenderer(renderer); -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Tue Jan 13 09:35:48 2015 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 13 Jan 2015 07:35:48 -0700 Subject: [vtkusers] add circles & sphere to DICOM slices & 3D viewer In-Reply-To: References: <1420797792171-5730043.post@n5.nabble.com> <1421074493281-5730081.post@n5.nabble.com> Message-ID: Hi Richard, The "IJK" coordinates are not just data coordinates rounded to int. Pixel spacing must also be taken into account. To properly display images with VTK, you should become familiar with how VTK images utilize the Spacing and Origin information that is stored with the images. With regards to the your code, if the sphere and the image each has its own renderer, then that is the source of your problems. They should be in the same renderer, and getting them to coincide is going to require that you learn, in a fair bit of detail, (1) how VTK deals with coordinate systems, and (2) how DICOM deals with coordinate systems. - David On Tue, Jan 13, 2015 at 6:24 AM, Richard Brown wrote: > Thanks, vtkContourTriangulator worked well and I'll continue to work my > way through your first two points. > > For the third point: > > I also haven't managed to see both the circle and the DICOM image at the >> same time, despite what feels like every combination of setOpacity, >> setAmbient, etc. When I set the background of the newly cut circle to >> green, >> everything goes green, so I think it might be that the background of the >> circle is masking the DICOM slice, can I set it to have a transparent >> background? >> > > There is no way to set the background for a single actor, AFAIK the only > way to > set the background is in the vtkRenderer, in which case you are setting > the background > for everything, and the background will therefore be behind everything and > cannot > ever be in front of something. Can you explain in more detail what you > are doing? > > > Beneath I've copied the code that I've been trying. worldCoords is the > point returned by the user's click using GetIJK (by the way, the difference > between GetIJK and GetPickPosition & GetMapperPosition is IJK is the > rounded to int, the values are otherwise the same?). I try to add the newly > cut circle to the QVTKWidget already containing the DICOM slice using > GetRenderindow()->AddRenderer(renderer) at the end, and the output is a > semi-transparent red circle (because opacity is 40%) on a bright green > background. I can't for the life of me figure out where I need to point the > camera to see the DICOM slice again. > > Cheers for the help, > Richard > > P.S. I know the vtkCamera settings are nonsensical, I am just messing > about with them at this stage. > > vtkSmartPointer sphere = vtkSmartPointer::New(); > > sphere->SetCenter(mmCoords); > > sphere->SetPhiResolution(30); > > sphere->SetThetaResolution(30); > > sphere->SetRadius(5); > > sphere->Update(); > > > vtkSmartPointer plane = vtkSmartPointer::New(); > > plane->SetOrigin(worldCoords[0], worldCoords[1], worldCoords[2]); > > plane->SetNormal(0, 0, 1); > > > vtkSmartPointer triangles = vtkSmartPointer::New(); > > triangles->SetInputConnection(sphereCutter->GetOutputPort()); > > > // Visualize > > vtkSmartPointer mapper = vtkSmartPointer::New(); > > mapper->SetInputConnection(triangles->GetOutputPort()); > > > vtkSmartPointer actor = vtkSmartPointer::New(); > > actor->SetMapper(mapper); > > actor->GetProperty()->SetColor(1.0, 0.0, 0.0); > > actor->GetProperty()->EdgeVisibilityOff(); > > actor->GetProperty()->SetAmbient(1.0); > > actor->GetProperty()->SetDiffuse(1.0); > > actor->GetProperty()->SetOpacity(0.4); > > vtkSmartPointer camera = vtkSmartPointer::New(); > > camera->SetPosition(worldCoords[0], worldCoords[1], worldCoords[2]+50); > > camera->SetFocalPoint(worldCoords[0], worldCoords[1], worldCoords[2]); > > > vtkSmartPointer renderer = vtkSmartPointer::New(); > > renderer->AddActor(actor); > > renderer->SetBackground(0,1,0); > > renderer->SetActiveCamera(camera); > > > ui->qvtk->GetRenderWindow()->AddRenderer(renderer); > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luis.vieira at vektore.com Tue Jan 13 11:12:42 2015 From: luis.vieira at vektore.com (Luis Vieira) Date: Tue, 13 Jan 2015 11:12:42 -0500 Subject: [vtkusers] Stereograpic sphere Message-ID: <54B543FA.4070603@vektore.com> Dear VTKers, I am beginner in VTK and I am struggling to plot a Stereonet graph. I have been trying vtkPolydata , vtkPoints, vtkParametricSpline and vtkParametricFunctionSource. I have tried vtkCharXY. However I have no success. Any ideas to suggest where I could start and which vtk classes will help me to develop a semi-sphere? Thank you so much. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/png Size: 10036 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/png Size: 10252 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hfggjfca.png Type: image/png Size: 14514 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: idfdibda.png Type: image/png Size: 97134 bytes Desc: not available URL: From david.thompson at kitware.com Tue Jan 13 13:30:12 2015 From: david.thompson at kitware.com (David Thompson) Date: Tue, 13 Jan 2015 13:30:12 -0500 Subject: [vtkusers] Stereograpic sphere In-Reply-To: <54B543FA.4070603@vektore.com> References: <54B543FA.4070603@vektore.com> Message-ID: <6BD2152E-3917-4081-B434-A6A6CF692C1F@kitware.com> Hi Luis, > I am beginner in VTK and I am struggling to plot a Stereonet graph. I have been trying vtkPolydata , vtkPoints, vtkParametricSpline and vtkParametricFunctionSource. I have tried vtkCharXY. However I have no success. Any ideas to suggest where I could start and which vtk classes will help me to develop a semi-sphere? You might look at the examples in VTK/Geovis/Core/Testing/Cxx, specifically TestGeoGraticule.cxx. If you change the string assigned to pname in TestGeoGraticule.cxx you can obtain different projections, including the stereographic one. Run the TestGeoProjection test to get a list of valid string values. David From MEEHANBT at nv.doe.gov Tue Jan 13 18:15:12 2015 From: MEEHANBT at nv.doe.gov (Meehan, Bernard) Date: Tue, 13 Jan 2015 23:15:12 +0000 Subject: [vtkusers] Stereograpic sphere In-Reply-To: <78AB9A462C8561636-01@EMF_nv.doe.gov> References: <78AB9A462C8561636-01@EMF_nv.doe.gov> Message-ID: If you just wanted to display the Wulff net, this code would do it: #!/usr/bin/env python # This example creates a simple stereographic projection of a portion of a # sphere. I have taken a lot of the code from the "ExpCos.py" demo program on # the GitHub site: # https://github.com/Kitware/VTK/blob/master/Examples/Modelling/Python/expCos.py import sys, vtk from math import * #------------------------------------------------------------------------------# # set up a plane in the center of the view area # #------------------------------------------------------------------------------# plane = vtk.vtkPlaneSource() plane.SetXResolution(20) plane.SetYResolution(20) plane.SetCenter(0., -0.5, 0.) transform = vtk.vtkTransform() transform.Scale(pi, pi, 1) scale_transform = vtk.vtkTransformPolyDataFilter() scale_transform.SetInputConnection(plane.GetOutputPort()) scale_transform.SetTransform(transform) scale_transform.Update() # Perform the stereographic projection directly on the points in the plane # above. This assumes that the x coordinate is the azimuthal angle, and is in # the range (-pi, pi), and that the y coordinate is the altitude angle, in the # range (-pi/2, pi/2). input_pd = scale_transform.GetOutputDataObject(0) stereo_pd = vtk.vtkPolyData() stereo_pd.CopyStructure(input_pd) new_points = vtk.vtkPoints() for i in range(input_pd.GetNumberOfPoints()): location = input_pd.GetPoint(i) phi, theta = location[:2] x = sin(phi)*sin(theta)/(1 - cos(phi)*sin(theta)) y = cos(theta)/(1 - cos(phi)*sin(theta)) new_points.InsertPoint(i, x, y, 0.) stereo_pd.SetPoints(new_points) stereo_edges = vtk.vtkExtractEdges() stereo_edges.SetInputData(stereo_pd) stereo_edge_mapper = vtk.vtkPolyDataMapper() stereo_edge_mapper.SetInputConnection(stereo_edges.GetOutputPort()) stereo_map_mapper = vtk.vtkPolyDataMapper() stereo_map_mapper.SetInputData(stereo_pd) stereo_map_actor = vtk.vtkActor() stereo_map_actor.SetMapper(stereo_map_mapper) stereo_map_actor.GetProperty().SetColor(0.9020, 0.6627, 1.0000) stereo_map_actor.GetProperty().SetOpacity(0.4) stereo_edge_actor = vtk.vtkActor() stereo_edge_actor.SetMapper(stereo_edge_mapper) stereo_edge_actor.GetProperty().SetColor(0.1882, 0.1294, 1.0000) #------------------------------------------------------------------------------# # rendering stuff # #------------------------------------------------------------------------------# ren = vtk.vtkRenderer() ren.AddActor(stereo_map_actor) ren.AddActor(stereo_edge_actor) renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren) renWin.SetSize(500, 500) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) ren.ResetCamera() iren.Initialize() renWin.Render() iren.Start() From: Luis Vieira > Date: Tuesday, January 13, 2015 at 8:12 AM To: "vtkusers at vtk.org" > Subject: [vtkusers] Stereograpic sphere Dear VTKers, I am beginner in VTK and I am struggling to plot a Stereonet graph. I have been trying vtkPolydata , vtkPoints, vtkParametricSpline and vtkParametricFunctionSource. I have tried vtkCharXY. However I have no success. Any ideas to suggest where I could start and which vtk classes will help me to develop a semi-sphere? Thank you so much. [cid:part1.00090300.03070201 at vektore.com][cid:part2.01000209.04080907 at vektore.com] [cid:part3.00060700.04090401 at vektore.com][cid:part4.00080402.03030802 at vektore.com] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ATT00001.png Type: image/png Size: 10036 bytes Desc: ATT00001.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ATT00002.png Type: image/png Size: 10252 bytes Desc: ATT00002.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hfggjfca.png Type: image/png Size: 14514 bytes Desc: hfggjfca.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: idfdibda.png Type: image/png Size: 97134 bytes Desc: idfdibda.png URL: From totte at dunescientific.com Tue Jan 13 19:01:47 2015 From: totte at dunescientific.com (Totte Karlsson) Date: Tue, 13 Jan 2015 16:01:47 -0800 Subject: [vtkusers] Force rendering from a thread Message-ID: <54B5B1EB.5070302@dunescientific.com> Hello, I have created some data objects using a simple "observer-subject" pattern. The observer contains the code to render a 'subject' object using vtk. The update of internal data in the subject may be performed in a thread and I have now come across the fact that one can't call render() from such. Instead, one need to communicate that a render() is needed trough some data variable. This can be done but setting up a timer that checks every so often, and if the variable is 'set', do a render in the timer callback. But I never been a big fan of that kind of pulling. So I wonder if there is another, more direct way? I have noticed when I execute renderInteractive(), that vtk objects are indeed updated from their sources every time the mouse interactively generate a 'render' somewhere. Not sure how that works. Is it possible to tie in there somewhere? tk -- ......................... Totte Karlsson, Ph.D. Dune Scientific, LLC 425-296 1980 (office) 425-780 9648 (cell) www.dunescientific.com ......................... From david.gobbi at gmail.com Tue Jan 13 19:36:40 2015 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 13 Jan 2015 17:36:40 -0700 Subject: [vtkusers] Force rendering from a thread In-Reply-To: <54B5B1EB.5070302@dunescientific.com> References: <54B5B1EB.5070302@dunescientific.com> Message-ID: On Tue, Jan 13, 2015 at 5:01 PM, Totte Karlsson wrote: > > The update of internal data in the subject may be performed in a thread > and I have now come across the fact that one can't call render() from such. > Instead, one need to communicate that a render() is needed trough some data > variable. This can be done but setting up a timer that checks every so > often, and if the variable is 'set', do a render in the timer callback. But > I never been a big fan of that kind of pulling. So I wonder if there is > another, more direct way? > The rendering in VTK must be done from the main application thread (i.e. the thread that runs the application's main event loop), and in an application, polling is an excellent way for the main loop to check if any other threads require attention. So my advice is that you become a fan of polling. In this case, it's the right way forward. You could, instead, have your thread ask the operating system to send your application some kind of notification that the main loop could respond to, but that would probably be less efficient than polling (and it would be platform-specific). Or, in Qt, you could take advantage of an asynchronous signal-slot connection and let Qt take care of the details (Qt would either do polling internally, or would use an OS-level notification, I'm not sure which). I have noticed when I execute renderInteractive(), that vtk objects are > indeed updated from their sources every time the mouse interactively > generate a 'render' somewhere. Not sure how that works. Is it possible to > tie in there somewhere? > The mouse events are caught by the application's main loop, and the main application thread responds to these events (and performs the render at the end). So you won't find any insight there about how to do things in a multi-threaded fashion. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From totte at dunescientific.com Tue Jan 13 20:38:46 2015 From: totte at dunescientific.com (Totte Karlsson) Date: Tue, 13 Jan 2015 17:38:46 -0800 Subject: [vtkusers] Force rendering from a thread In-Reply-To: References: <54B5B1EB.5070302@dunescientific.com> Message-ID: <54B5C8A6.3070102@dunescientific.com> On 1/13/2015 4:36 PM, David Gobbi wrote: > > The rendering in VTK must be done from the main application thread > (i.e. the thread that runs the application's main event loop), and in > an application, polling is an excellent way for the main loop to check > if any other threads require attention. So my advice is that you > become a fan of polling. In this case, it's the right way forward. > I see. Currently I have a very simple polling timer, checking for an integer being set to 1 or 0. If the integer is set, I do a render. Works fine. Don't need a mutex for that I assume. > You could, instead, have your thread ask the operating system to send > your application some kind of notification that the main loop could > respond to, but that would probably be less efficient than polling > (and it would be platform-specific). Or, in Qt, you could take > advantage of an asynchronous signal-slot connection and let Qt take > care of the details (Qt would either do polling internally, or would > use an OS-level notification, I'm not sure which). > I'm not familiar with Qt slots, and I have not tried the polling in a ms windows application yet. But I guess one can post a custom user message, that is intercepted in the apps message loop (which is polling), and handle it there. Would just be a call to render(); Obviously I take your word for becoming a fan of polling! Thanks. > I have noticed when I execute renderInteractive(), that vtk > objects are indeed updated from their sources every time the mouse > interactively generate a 'render' somewhere. Not sure how that > works. Is it possible to tie in there somewhere? > > > The mouse events are caught by the application's main loop, and the > main application thread responds to these events (and performs the > render at the end). So you won't find any insight there about how to > do things in a multi-threaded fashion. > I assume it is so that the renderInteractive() call creates the "application loop", in a console application, since there is only one thread? tk -------------- next part -------------- An HTML attachment was scrubbed... URL: From ngoonee.talk at gmail.com Wed Jan 14 02:23:17 2015 From: ngoonee.talk at gmail.com (Oon-Ee Ng) Date: Wed, 14 Jan 2015 15:23:17 +0800 Subject: [vtkusers] Rendering XYZRGBA segfaults randomly while XYZ doesn't in qvtkwidget subclass Message-ID: I've subclassed QVtkWidget for use in my QT app displaying the sensor data from an ASUS Xtion Pro Live. I include in this email the full code I'm using. I have two overloaded showPointCloud functions, the one which handles PointXYZ works fine but the one which handles PointXYZRGBA segfaults most of the time. The rare times which it 'works' (no recompile, just keep running the same binary), I get visual (but not depth) artifacts. I attach two screenshots showing the artifacts [1] and the actual scene [2]. Artifacts are always at the 'top' of the image as shown in the screen shots. This seems to me to indicate some form of memory corruption to me. How can I fix this and/or further investigate? [1] - https://www.dropbox.com/s/0s9kle77zohy9b6/WithArtifact.png?dl=0 [2] - https://www.dropbox.com/s/bjvtoqlsg3ilt6g/NoArtifact.png?dl=0 #include #include #include #include class VTKPointCloudWidget : public QVTKWidget { Q_OBJECT public: explicit VTKPointCloudWidget(QWidget *parent = 0); ~VTKPointCloudWidget(); void showPointCloud(pcl::PointCloud::Ptr pc); void showPointCloud(pcl::PointCloud::Ptr pc); private: pcl::visualization::PCLVisualizer vis; }; VTKPointCloudWidget::VTKPointCloudWidget(QWidget *parent) : QVTKWidget(parent), vis("visor", false) { } VTKPointCloudWidget::~VTKPointCloudWidget() { } void VTKPointCloudWidget::showPointCloud(pcl::PointCloud::Ptr pc) { if (!vis.updatePointCloud(pc)) { vis.setBackgroundColor(0,0,0); vis.addPointCloud(pc); vis.initCameraParameters(); vtkSmartPointer renderwindow = vis.getRenderWindow(); this->SetRenderWindow(renderwindow); this->show(); } else { this->update(); } } void VTKPointCloudWidget::showPointCloud(pcl::PointCloud::Ptr pc) { pcl::visualization::PointCloudColorHandlerRGBField rgb(pc); if (!vis.updatePointCloud(pc, rgb)) { vis.setBackgroundColor(0,0,0); vis.addPointCloud(pc, rgb); vis.initCameraParameters(); vtkSmartPointer renderwindow = vis.getRenderWindow(); this->SetRenderWindow(renderwindow); this->show(); } else { this->update(); } } From ngoonee.talk at gmail.com Wed Jan 14 03:31:40 2015 From: ngoonee.talk at gmail.com (Oon-Ee Ng) Date: Wed, 14 Jan 2015 16:31:40 +0800 Subject: [vtkusers] Rendering XYZRGBA segfaults randomly while XYZ doesn't in qvtkwidget subclass In-Reply-To: References: Message-ID: Additional point to note from more testing today:- 1. Adding a half second delay between calls to showPointCloud(...) seems to alleviate the crashing as well as the artifacts. 2. Adding a mutex so data cannot be double-accessed in VTKPointCloudWidget does NOT alleviate the crashing or artifacts, but seems to help a bit (higher chance of running for more than 1 or 2 frames). 3. Removing NAN values from the point cloud does not seem to help appreciably From amay.ms at gmail.com Wed Jan 14 04:42:09 2015 From: amay.ms at gmail.com (Amey) Date: Wed, 14 Jan 2015 02:42:09 -0700 (MST) Subject: [vtkusers] how to know image scale from camera distance.... Message-ID: <1421228529082-5730113.post@n5.nabble.com> Hello, I have a large 2D image. To show it initially, I set the camera distance and focal point such that the image appears fit to screen. I do this as below: double centerX = imageWidth/2.0; double centerY = imageHeight/2.0 camera.setFocalPoint( centerX , centerY, 0); double angle = math.RadiansFromDegrees( camera.GetViewAngle() ); double distance = Math.max(centerX, centerY)/ Math.tan( angle * 0.5 ); camera.setPosition( centerX, centerY, distance); This shows the image correctly fit to screen. Now I have to display the scale of the image. So, I want to calculate the currently visible image scale based on the distance of the camera. Can you help me how to determine it? Thanks a lot for your help, Amay. -- View this message in context: http://vtk.1045678.n5.nabble.com/how-to-know-image-scale-from-camera-distance-tp5730113.html Sent from the VTK - Users mailing list archive at Nabble.com. From loic_luquet at yahoo.fr Wed Jan 14 05:08:57 2015 From: loic_luquet at yahoo.fr (loic luquet) Date: Wed, 14 Jan 2015 10:08:57 +0000 (UTC) Subject: [vtkusers] Abaqus and nastran readers In-Reply-To: <1869035199.1111957.1421082011164.JavaMail.yahoo@jws11163.mail.ir2.yahoo.com> References: <1869035199.1111957.1421082011164.JavaMail.yahoo@jws11163.mail.ir2.yahoo.com> Message-ID: <793831508.886472.1421230137311.JavaMail.yahoo@jws11103.mail.ir2.yahoo.com> ?Dear All, do you have any information on this? Could be really helpful bests, Loic Le Lundi 12 janvier 2015 18h03, loic luquet a ?crit : ?Dear all,?I am a newUser of Paraview, we are supposed to create some post treatment onAbaqus/Nastran files.?The formatof Abaqus/Nastran should be respectively .inp / .bdf .dat?Currently,Paraview doesn?t allow to do this, but I read some exchanges between you andusers about plugins doing this.?Do you knowwhere could I find the sources of these plugins? ?Manythanks,?Bests,?Loic _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From lifestudent37 at gmail.com Wed Jan 14 06:02:45 2015 From: lifestudent37 at gmail.com (Student Life) Date: Wed, 14 Jan 2015 11:02:45 +0000 Subject: [vtkusers] Adding a vtkAssembly onto another vtkAssembly? Is this possible? Message-ID: Hi, Basically, I want to store a vtkActor as well as any picked points on the actor into an assembly. I then want to add this assembly onto a new assembly Is this possible in vtk? -------------- next part -------------- An HTML attachment was scrubbed... URL: From lifestudent37 at gmail.com Wed Jan 14 06:10:08 2015 From: lifestudent37 at gmail.com (Student Life) Date: Wed, 14 Jan 2015 11:10:08 +0000 Subject: [vtkusers] Polydata mapper for multiple actors? Message-ID: Hi, I basically want to store multiple actors in my VTK render window, however I am not sure if I should link and put the polydata mapper in my Actors defined class or if I should create a separate class to handle the polydata. This is my intended actor class and it stores the properties of each vtkActor... *Class Actor* *{* * public* * setOpacity();* * setLighting();* * setColour();* * setPolyDataMapper(); //SHOULD I PUT THIS HERE?* * getOpacity();* * getLighting();* * getColour();* * }* -------------- next part -------------- An HTML attachment was scrubbed... URL: From mohamed.moussa89 at gmail.com Wed Jan 14 10:51:40 2015 From: mohamed.moussa89 at gmail.com (Mohamed Moussa) Date: Wed, 14 Jan 2015 16:51:40 +0100 Subject: [vtkusers] Quadratic quad - is it possible to see curved edges? Message-ID: Hi, I am using the quadratic quad just as an example, but in general any higher order element. Is it possible in paraview to see the correct curved edges? See file below for example. # vtk DataFile Version 2.0 Unstructured Grid Example ASCII DATASET UNSTRUCTURED_GRID POINTS 8 float 0.0 0.0 0.0 1.0 0.0 0.0 1.0 1.0 0.0 0.0 1.0 0.0 0.5 0.1 0.0 1.1 0.5 0.0 0.5 0.9 0.0 0.1 0.5 0.0 CELLS 1 9 8 0 1 2 3 4 5 6 7 CELL_TYPES 1 23 Kind regards, Mo -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.jourdain at kitware.com Wed Jan 14 11:08:38 2015 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Wed, 14 Jan 2015 09:08:38 -0700 Subject: [vtkusers] Quadratic quad - is it possible to see curved edges? In-Reply-To: References: Message-ID: Call the SetNonlinearSubdivisionLevel(4) method on your representation (see vtkGeometryRepresentation). On Wed, Jan 14, 2015 at 8:51 AM, Mohamed Moussa wrote: > Hi, > > I am using the quadratic quad just as an example, but in general any > higher order element. > Is it possible in paraview to see the correct curved edges? See file below > for example. > > # vtk DataFile Version 2.0 > Unstructured Grid Example > ASCII > DATASET UNSTRUCTURED_GRID > POINTS 8 float > 0.0 0.0 0.0 1.0 0.0 0.0 1.0 1.0 0.0 0.0 1.0 0.0 > 0.5 0.1 0.0 1.1 0.5 0.0 0.5 0.9 0.0 0.1 0.5 0.0 > CELLS 1 9 > 8 0 1 2 3 4 5 6 7 > CELL_TYPES 1 > 23 > > Kind regards, > > Mo > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.thompson at kitware.com Wed Jan 14 17:11:00 2015 From: david.thompson at kitware.com (David Thompson) Date: Wed, 14 Jan 2015 17:11:00 -0500 Subject: [vtkusers] Stereograpic sphere In-Reply-To: <54B6E878.1090008@vektore.com> References: <54B543FA.4070603@vektore.com> <6BD2152E-3917-4081-B434-A6A6CF692C1F@kitware.com> <54B6E878.1090008@vektore.com> Message-ID: <1E3C7335-B10A-4161-83A3-235B1F280C1C@kitware.com> Hi Luis, Please keep vtkusers included in replies so that others can benefit. > There are assigned const char* projName = "rouss"; rouss means? Sorry about that. Rouss is short for Roussilhe. See https://en.wikipedia.org/wiki/Roussilhe_oblique_stereographic_projection . If you build VTK with the geovis kit enabled and run TestGeoProjection, it will print a list of strings that can replace "rouss". They are other projection names. David From luis.vieira at vektore.com Wed Jan 14 17:15:13 2015 From: luis.vieira at vektore.com (Luis Vieira) Date: Wed, 14 Jan 2015 17:15:13 -0500 Subject: [vtkusers] Stereograpic sphere In-Reply-To: <1E3C7335-B10A-4161-83A3-235B1F280C1C@kitware.com> References: <54B543FA.4070603@vektore.com> <6BD2152E-3917-4081-B434-A6A6CF692C1F@kitware.com> <54B6E878.1090008@vektore.com> <1E3C7335-B10A-4161-83A3-235B1F280C1C@kitware.com> Message-ID: <54B6EA71.9070101@vektore.com> I am sorry. I just don't know well how to post into vtkusers. I have been trying addressing to vtk.org and some times I have issues with my mailbox. Sorry. On 1/14/15 5:11 PM, David Thompson wrote: > Hi Luis, > > Please keep vtkusers included in replies so that others can benefit. > >> There are assigned const char* projName = "rouss"; rouss means? Sorry about that. > Rouss is short for Roussilhe. See https://en.wikipedia.org/wiki/Roussilhe_oblique_stereographic_projection . > > If you build VTK with the geovis kit enabled and run TestGeoProjection, it will print a list of strings that can replace "rouss". They are other projection names. > > David > From ali.hadimogullari at netcad.com.tr Thu Jan 15 06:58:44 2015 From: ali.hadimogullari at netcad.com.tr (alihadim) Date: Thu, 15 Jan 2015 04:58:44 -0700 (MST) Subject: [vtkusers] vtk tube filter Message-ID: <1421323124707-5730141.post@n5.nabble.com> I'm using tube filter for vtk primitive. Can I use only cell base for this algorithm? Do you have a property for it? -- View this message in context: http://vtk.1045678.n5.nabble.com/vtk-tube-filter-tp5730141.html Sent from the VTK - Users mailing list archive at Nabble.com. From daviddoria at gmail.com Thu Jan 15 08:52:55 2015 From: daviddoria at gmail.com (David Doria) Date: Thu, 15 Jan 2015 08:52:55 -0500 Subject: [vtkusers] Adding a vtkAssembly onto another vtkAssembly? Is this possible? In-Reply-To: References: Message-ID: On Wed, Jan 14, 2015 at 6:02 AM, Student Life wrote: > Hi, > > Basically, I want to store a vtkActor as well as any picked points on the > actor into an assembly. > > I then want to add this assembly onto a new assembly > > Is this possible in vtk? > Typically, the first thing you could do is try it and see if it works. In this case, it looks like it should, because vtkAssembly is derived from vtkProp3D, and the AddPart function takes a vtkProp3D*: void vtkAssembly::AddPart(vtkProp3D *) http://www.vtk.org/doc/nightly/html/classvtkAssembly.html David -------------- next part -------------- An HTML attachment was scrubbed... URL: From dburenkov at outlook.com Thu Jan 15 17:28:52 2015 From: dburenkov at outlook.com (Dmytro Burenkov) Date: Thu, 15 Jan 2015 14:28:52 -0800 Subject: [vtkusers] VTK crashes when vtkWindowToImageFilter is used for saving window snapshots Message-ID: Hi! I am working on a feature that should save window snapshot(s) to a file. Environment: Linux, Qt. I used Screenshot.cxx example (http://www.cmake.org/Wiki/VTK/Examples/Cxx/Utilities/Screenshot) as a reference and the code generally works. My case is different from this example (and other examples that I could find) in that I need to be able to make multiple snapshots of the same window over time. To support this mode I had to call vtkWindowToImageFilter's Modified() method as recommended by documentation for vtkWindowToImageFilter class (otherwise the filter keeps rendering the first image again and again). The only problem I have is that if the window gets resized, an attempt to make a new snapshot causes a crash in vtkWindowToImageFilter::Update(). It would appear that he problem is that after initial connection is established (windowToImageFilter->SetInput(renderWindow)) filter allocates some memory buffer and its size does not get automatically updated when window size changes. I tried re-setting filter input (first to 0 and then back to renderWindow) prior to making each new snapshot but this did not help. The solution I use now is that I create a new vtkWindowToImageFilter object every time I need to produce a new snapshot. It works but I wonder if there is a way to re-sync existing filter and a render window after window size changes. I looked through the list of methods for vtkWindowToImageFilter and could not find anything to do the job. Thanks,Dmytro -------------- next part -------------- An HTML attachment was scrubbed... URL: From joachim.pouderoux at kitware.com Fri Jan 16 08:04:43 2015 From: joachim.pouderoux at kitware.com (Joachim Pouderoux) Date: Fri, 16 Jan 2015 14:04:43 +0100 Subject: [vtkusers] ANN: VTK and ParaView Training Courses in Lyon, France, February 3-4, 2015 Message-ID: Kitware will be holding VTK and ParaView courses on February 3-4, 2015 in Lyon, France. Please visit our web site for more information and registration details at either: http://training.kitware.fr/browse/83 http://training.kitware.fr/browse/84 or in French: http://formations.kitware.fr/browse/83 http://formations.kitware.fr/browse/84 Note that the course will be taught in English. If you have any question, please contact us at formations at http://www.kitware.fr Thank you, *Joachim Pouderoux* *PhD, Technical Expert* *Kitware SAS * -------------- next part -------------- An HTML attachment was scrubbed... URL: From Shahrokh.Kamali at Dal.Ca Fri Jan 16 10:33:57 2015 From: Shahrokh.Kamali at Dal.Ca (Shahrokh Kamali) Date: Fri, 16 Jan 2015 15:33:57 +0000 Subject: [vtkusers] Python Reading image voxels intensities in VTK Message-ID: <1421422438715.33300@Dal.Ca> ?? Hi, I am new to VTK and I want to read image voxels intensities in VTK by Python and have a copy in a 3D array. I am doing some medical image processing in 3D Slicer (www.slicer.org) and I have access to VTK classes. I would appreciate it, if someone can give me any advice/sample code. Best Regards, Shahrokh -------------- next part -------------- An HTML attachment was scrubbed... URL: From totte at dunescientific.com Fri Jan 16 16:19:54 2015 From: totte at dunescientific.com (Totte Karlsson) Date: Fri, 16 Jan 2015 13:19:54 -0800 Subject: [vtkusers] How to create a closed surface enclosing a set of 3D points Message-ID: <54B9807A.2070302@dunescientific.com> Hello, I'm working on creating a simple visual model of small molecules. A first simple representation (simpler than a ball and stick representation) that I would like to create is to have a single surface enclosing all the atoms. This surface would be created such that 1) all atoms are found inside the surface and 2) the surface should resemble the "shape" of the molecule. Any pointers on how one can create such a surface, from a set of 3D coordinates (the atoms)? A first approximation could be to create a sphere, with a diameter large enough to enclose all atoms. However, if one have a molecule that is more like a tube, a tube would look better. Perhaps there are some vtk algorithms one could use to get a custom shape, tailor made for any molecule?? tk -- ......................... Totte Karlsson, Ph.D. Dune Scientific, LLC 425-296 1980 (office) 425-780 9648 (cell) www.dunescientific.com ......................... From julio.hoffimann at gmail.com Fri Jan 16 16:23:43 2015 From: julio.hoffimann at gmail.com (=?UTF-8?Q?J=C3=BAlio_Hoffimann?=) Date: Fri, 16 Jan 2015 13:23:43 -0800 Subject: [vtkusers] How to create a closed surface enclosing a set of 3D points In-Reply-To: <54B9807A.2070302@dunescientific.com> References: <54B9807A.2070302@dunescientific.com> Message-ID: Are you looking for the convex hull? I'm not familiar with VTK yet, so I don't know if they have such implementation. -J?lio -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Fri Jan 16 16:26:39 2015 From: daviddoria at gmail.com (David Doria) Date: Fri, 16 Jan 2015 16:26:39 -0500 Subject: [vtkusers] How to create a closed surface enclosing a set of 3D points In-Reply-To: <54B9807A.2070302@dunescientific.com> References: <54B9807A.2070302@dunescientific.com> Message-ID: On Fri, Jan 16, 2015 at 4:19 PM, Totte Karlsson wrote: > Hello, > I'm working on creating a simple visual model of small molecules. A first > simple representation (simpler than a ball and stick representation) that I > would like to create is to have a single surface enclosing all the atoms. > This surface would be created such that 1) all atoms are found inside the > surface and 2) the surface should resemble the "shape" of the molecule. > > Any pointers on how one can create such a surface, from a set of 3D > coordinates (the atoms)? > > A first approximation could be to create a sphere, with a diameter large > enough to enclose all atoms. However, if one have a molecule that is more > like a tube, a tube would look better. > > Perhaps there are some vtk algorithms one could use to get a custom shape, > tailor made for any molecule?? > > tk > Here are a few native VTK options: http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ConvexHull_ShrinkWrap http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ConvexHull_vtkHull http://www.vtk.org/Wiki/VTK/Examples/Cxx/Modelling/Delaunay3D Or you could use Poisson Reconstruction: http://www.vtkjournal.org/browse/publication/718 https://github.com/daviddoria/PoissonReconstruction In both cases, I think your points will end up ON the surface, so you might need to do a little scaling/fudging after the fact if you truly want the points to be "inside". David -------------- next part -------------- An HTML attachment was scrubbed... URL: From totte at dunescientific.com Fri Jan 16 17:17:32 2015 From: totte at dunescientific.com (Totte Karlsson) Date: Fri, 16 Jan 2015 14:17:32 -0800 Subject: [vtkusers] How to create a closed surface enclosing a set of 3D points In-Reply-To: References: <54B9807A.2070302@dunescientific.com> Message-ID: <54B98DFC.2000301@dunescientific.com> On 1/16/2015 1:26 PM, David Doria wrote: > > Here are a few native VTK options: > > http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ConvexHull_ShrinkWrap > http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ConvexHull_vtkHull > http://www.vtk.org/Wiki/VTK/Examples/Cxx/Modelling/Delaunay3D > > Or you could use Poisson Reconstruction: > > http://www.vtkjournal.org/browse/publication/718 > https://github.com/daviddoria/PoissonReconstruction > > In both cases, I think your points will end up ON the surface, so you > might need to do a little scaling/fudging after the fact if you truly > want the points to be "inside". > Thanks very much for the pointers! Those ones looks promising for the problem. -- ......................... Totte Karlsson, Ph.D. Dune Scientific, LLC 425-296 1980 (office) 425-780 9648 (cell) www.dunescientific.com ......................... From lifestudent37 at gmail.com Fri Jan 16 18:50:23 2015 From: lifestudent37 at gmail.com (Student Life) Date: Fri, 16 Jan 2015 23:50:23 +0000 Subject: [vtkusers] Adding a vtkAssembly onto another vtkAssembly? Is this possible? In-Reply-To: References: Message-ID: Dear David, Thanks for your response. Yes, turns out you can add one vtkAssembly to another. Now, the question really is how can one store multiple copies/instances of vtkAssembly's? If the number of possible vtkAssembly's were known, I would have opted for a fixed size array, however I can only think of the C++ Vector. This is what I can think of as a data structure... *vector actorCombo* Are there better data structures for handling multiple vtkAssembly's? Also, I am having some difficulty storing multiple glyph's that are plotted on a vtkActor. Basically, I can store vtkActor's as *vector actors* but I don't know how to store and associate the multiple glyph's to each actor. If I were to use C Style arrays, I could opt for a 2D array, such that [i][j], where [i] would represent the index of the actor and [j] would represent each glyph object. How would I go about storing it as a vector? Also, in terms of memory management, what is better - linked lists or vectors? Would greatly appreciate it if you or anyone on this forum could answer my questions. It would really mean a lot to me. Many Thanks On Thu, Jan 15, 2015 at 1:52 PM, David Doria wrote: > On Wed, Jan 14, 2015 at 6:02 AM, Student Life > wrote: > >> Hi, >> >> Basically, I want to store a vtkActor as well as any picked points on the >> actor into an assembly. >> >> I then want to add this assembly onto a new assembly >> >> Is this possible in vtk? >> > > Typically, the first thing you could do is try it and see if it works. In > this case, it looks like it should, because vtkAssembly is derived from > vtkProp3D, and the AddPart function takes a vtkProp3D*: > > void vtkAssembly::AddPart(vtkProp3D *) > > http://www.vtk.org/doc/nightly/html/classvtkAssembly.html > > David > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdrahos at thinksurgical.com Fri Jan 16 19:42:37 2015 From: mdrahos at thinksurgical.com (Miroslav Drahos) Date: Fri, 16 Jan 2015 16:42:37 -0800 Subject: [vtkusers] regression testing In-Reply-To: References: Message-ID: Hi vtk folk, I have set up ctest/cdash testing framework (using vtk 5.10 as model), but one piece of puzzle I cannot figure out -- regression testing. If anyone could point me what I am missing, I would greatly appreciate it! I write the test, e.g. testMyWidget.cpp, containing the "main" function just as vtk tests do: int testMyWidget (int argc, char ** argv) { int retval = 0; // do stuff here, create rendering pipeline and draw into vtkRenderWindow retval = vtkRegressionTestImage(rw); if (retval == vtkRegressionTester::DO_INTERACTOR) iren->Start(); return retval; } I have a baseline image saved as ../../data/Baseline/testMyWidget.png. To run the test manually, I invoke: make && ./myCppTests testMyWidget -V Baseline/testMyWidget.png -T Temporary -D ../../data/ And always keep getting ImageError, although I just took a screenshot of the renderwindow (.png format -- see below) so it is current. Error is set to default 10. 0Standard0.0631258 My baseline screenshot was created like this: void ODVtkIO::screenshot(vtkRenderWindow * rw, const std::string& fname) { if (rw == NULL) return; VTK_CREATE(vtkWindowToImageFilter, w2i); w2i->SetInput(rw); w2i->ReadFrontBufferOff(); // added to match vtkTesting::RegressionTest(double thresh, ostream &os) rw->Render(); w2i->Modified(); // See doc http://www.vtk.org/doc/nightly/html/classvtkWindowToImageFilter.html#details VTK_CREATE(vtkPNGWriter, writer); writer->SetFileName(fname.c_str()); writer->SetInputConnection(w2i->GetOutputPort()); writer->Write(); } vtkTesting::RegressionTest(double, ostream&) takes screenshots same way. Yet, I am getting ImageError. Why? Cheers, Miro From bill.lorensen at gmail.com Fri Jan 16 20:29:51 2015 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Fri, 16 Jan 2015 20:29:51 -0500 Subject: [vtkusers] regression testing In-Reply-To: References: Message-ID: The reported image error is zero. The test passed. On Jan 16, 2015 7:51 PM, "Miroslav Drahos" wrote: > Hi vtk folk, > I have set up ctest/cdash testing framework (using vtk 5.10 as model), but > one piece of puzzle I cannot figure out -- regression testing. If anyone > could point me what I am missing, I would greatly appreciate it! > > I write the test, e.g. testMyWidget.cpp, containing the "main" function > just as vtk tests do: > > int testMyWidget (int argc, char ** argv) > { > int retval = 0; > // do stuff here, create rendering pipeline and draw into > vtkRenderWindow > > retval = vtkRegressionTestImage(rw); > if (retval == vtkRegressionTester::DO_INTERACTOR) > iren->Start(); > > return retval; > } > > I have a baseline image saved as ../../data/Baseline/testMyWidget.png. > To run the test manually, I invoke: > make && ./myCppTests testMyWidget -V Baseline/testMyWidget.png -T > Temporary -D ../../data/ > > And always keep getting ImageError, although I just took a screenshot of > the renderwindow (.png format -- see below) so it is current. Error is set > to default 10. > type="numeric/double">0 name="BaselineImage" > type="text/string">Standard name="WallTime" type="numeric/double">0.0631258 > > My baseline screenshot was created like this: > > void ODVtkIO::screenshot(vtkRenderWindow * rw, const std::string& fname) > { > if (rw == NULL) > return; > > VTK_CREATE(vtkWindowToImageFilter, w2i); > w2i->SetInput(rw); > w2i->ReadFrontBufferOff(); // added to match > vtkTesting::RegressionTest(double thresh, ostream &os) > rw->Render(); > w2i->Modified(); // See doc > http://www.vtk.org/doc/nightly/html/classvtkWindowToImageFilter.html#details > > VTK_CREATE(vtkPNGWriter, writer); > writer->SetFileName(fname.c_str()); > writer->SetInputConnection(w2i->GetOutputPort()); > writer->Write(); > } > > vtkTesting::RegressionTest(double, ostream&) takes screenshots same way. > Yet, I am getting ImageError. Why? > > Cheers, > Miro > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdrahos at thinksurgical.com Fri Jan 16 21:18:01 2015 From: mdrahos at thinksurgical.com (Miroslav Drahos) Date: Fri, 16 Jan 2015 18:18:01 -0800 Subject: [vtkusers] regression testing In-Reply-To: References: , Message-ID: I see it now. The ImageError is the value of the error metric, and indeed it is zero. The test was failing because I was returning the retval variable: retval = vtkRegressionTestImage(rw); if (retval == vtkRegressionTester::DO_INTERACTOR) iren->Start(); return retval; // Should be return !retval; where I should have been returning !retval... Duh... Thank you tons!! ________________________________________ From: Bill Lorensen [bill.lorensen at gmail.com] Sent: Friday, January 16, 2015 5:29 PM To: Miroslav Drahos Cc: VTK Users Subject: Re: [vtkusers] regression testing The reported image error is zero. The test passed. On Jan 16, 2015 7:51 PM, "Miroslav Drahos" > wrote: Hi vtk folk, I have set up ctest/cdash testing framework (using vtk 5.10 as model), but one piece of puzzle I cannot figure out -- regression testing. If anyone could point me what I am missing, I would greatly appreciate it! I write the test, e.g. testMyWidget.cpp, containing the "main" function just as vtk tests do: int testMyWidget (int argc, char ** argv) { int retval = 0; // do stuff here, create rendering pipeline and draw into vtkRenderWindow retval = vtkRegressionTestImage(rw); if (retval == vtkRegressionTester::DO_INTERACTOR) iren->Start(); return retval; } I have a baseline image saved as ../../data/Baseline/testMyWidget.png. To run the test manually, I invoke: make && ./myCppTests testMyWidget -V Baseline/testMyWidget.png -T Temporary -D ../../data/ And always keep getting ImageError, although I just took a screenshot of the renderwindow (.png format -- see below) so it is current. Error is set to default 10. 0Standard0.0631258 My baseline screenshot was created like this: void ODVtkIO::screenshot(vtkRenderWindow * rw, const std::string& fname) { if (rw == NULL) return; VTK_CREATE(vtkWindowToImageFilter, w2i); w2i->SetInput(rw); w2i->ReadFrontBufferOff(); // added to match vtkTesting::RegressionTest(double thresh, ostream &os) rw->Render(); w2i->Modified(); // See doc http://www.vtk.org/doc/nightly/html/classvtkWindowToImageFilter.html#details VTK_CREATE(vtkPNGWriter, writer); writer->SetFileName(fname.c_str()); writer->SetInputConnection(w2i->GetOutputPort()); writer->Write(); } vtkTesting::RegressionTest(double, ostream&) takes screenshots same way. Yet, I am getting ImageError. Why? Cheers, Miro _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers From matt.mccormick at kitware.com Sat Jan 17 10:46:40 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Sat, 17 Jan 2015 10:46:40 -0500 Subject: [vtkusers] Python Reading image voxels intensities in VTK In-Reply-To: <1421422438715.33300@Dal.Ca> References: <1421422438715.33300@Dal.Ca> Message-ID: Hi Shahrokh, There are some instructions on how to get a NumPy array in Slicer here: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Python_scripting HTH, Matt On Fri, Jan 16, 2015 at 10:33 AM, Shahrokh Kamali wrote: > ?? > Hi, > > I am new to VTK and I want to read image voxels intensities in VTK by > Python and have a copy in a 3D array. > > I am doing some medical image processing in 3D Slicer (www.slicer.org) and > I have access to VTK classes. > > I would appreciate it, if someone can give me any advice/sample code. > > > Best Regards, > > Shahrokh > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mnour.ai at hotmail.com Sat Jan 17 12:09:25 2015 From: mnour.ai at hotmail.com (Muhammad Nour) Date: Sat, 17 Jan 2015 17:09:25 +0000 Subject: [vtkusers] Render within VC++ form Message-ID: Hi dears, I am using MS visual studio 2008 and vtk 5.10 I have VC++ project and I want to render 3ds file on form, but rendered view was displayed on separate window What should I do to view output on required form? Thank you very much -------------- next part -------------- An HTML attachment was scrubbed... URL: From lifestudent37 at gmail.com Sat Jan 17 12:23:45 2015 From: lifestudent37 at gmail.com (Student Life) Date: Sat, 17 Jan 2015 17:23:45 +0000 Subject: [vtkusers] Storing multiple copies/instances of vtkAssembly's - Memory Management Message-ID: Hi, How can one store multiple copies/instances of vtkAssembly's? If the number of possible vtkAssembly's were known, I would have opted for a fixed size array, however I can only think of the C++ Vector. This is what I can think of as a data structure... *vector actorCombo* Are there better data structures for handling multiple vtkAssembly's? Also, I am having some difficulty storing multiple glyph's that are plotted on a vtkActor. Basically, I can store vtkActor's as *vector actors* but I don't know how to store and associate the multiple glyph's to each actor. If I were to use C Style arrays, I could opt for a 2D array, such that [i][j], where [i] would represent the index of the actor and [j] would represent each glyph object. How would I go about storing it as a vector? Also, in terms of memory management, what is better - linked lists or vectors? Would greatly appreciate it if you or anyone on this forum could answer my questions. It would really mean a lot to me. Many Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From 1danielcoelho at gmail.com Sun Jan 18 07:01:28 2015 From: 1danielcoelho at gmail.com (Daniel Coelho) Date: Sun, 18 Jan 2015 13:01:28 +0100 Subject: [vtkusers] Extract isosurfaces from a point cloud polydata with contourfilter Message-ID: Hello everyone! I have a point cloud in the form of a polydata, where I build vertices with vtkVertexGlyphFilter. That polydata has pointdata with scalars ranging from 0 to 255, and I'm trying to use vtkContourFilter to extract 5 planes, that ideally should cut through the data at the values corresponding to each plane. Just to make it clearer: The expected output should be 5 parallel planes, equidistant to each other, where each is an isosurface of a certain value, with respect to the scalars of the pointcloud. The problem is: I get absolutely no output. No points, no cell, nada. I've looked at every example I could find and the mailing list archive, but couldn't pinpoint the problem. Here is a short compilable example that shows this problem. You can also see outputs from print statements as comments: OBS: I use VTK 5.8 for some reasons, this is non-negotiable #include #include #include #include #include #include #include #include #include #define VTK_NEW(type, instance) \ ; \ vtkSmartPointer instance = vtkSmartPointer::New(); int main(int argc, char *argv[]) { VTK_NEW(vtkPoints, points); points->Allocate(100 * 100 * 100); VTK_NEW(vtkTypeUInt8Array, data_array); data_array->Allocate(100 * 100 * 100); for (int x = 0; x < 100; x++) { for (int y = 0; y < 100; ++y) { for (int z = 0; z < 100; ++z) { points->InsertNextPoint(x, y, z); data_array->InsertNextValue(z % 256); } } } VTK_NEW(vtkPolyData, polydata); polydata->SetPoints(points); polydata->GetPointData()->SetScalars(data_array); VTK_NEW(vtkVertexGlyphFilter, glyph_filter); glyph_filter->SetInput(polydata); glyph_filter->Update(); glyph_filter->GetOutput()->Print(std::cout << "Glyph filter: \n"); //Output here: //Number Of Points: 1000000 //Number Of Cells: 1000000 //Bounds look good, all good VTK_NEW(vtkContourFilter, cont_filt); cont_filt->SetInputConnection(glyph_filter->GetOutputPort()); double scalarRange[2]; polydata->GetPointData()->GetScalars()->GetRange(scalarRange); cont_filt->GenerateValues(5, scalarRange[0], scalarRange[1]); cont_filt->Update(); // Print the contours int num_contours = cont_filt->GetNumberOfContours(); double cont_values[num_contours]; cont_filt->GetValues(cont_values); std::cout << "Contours: "; for (int var = 0; var < num_contours; ++var) { std::cout << cont_values[var] << " "; } std::cout << std::endl; //Output here: //Contours: 0 24.75 49.5 74.25 99 cont_filt->GetOutput()->Print(std::cout << "Contour filter: \n"); //Output here: //No points, no cells, default bounds, no nothing VTK_NEW(vtkPolyDataMapper, mapper); mapper->SetInputConnection(cont_filt->GetOutputPort()); mapper->SetScalarVisibility(1); VTK_NEW(vtkActor, actor); actor->SetMapper(mapper); VTK_NEW(vtkRenderer, renderer); renderer->AddActor(actor); VTK_NEW(vtkRenderWindow, render_window) render_window->AddRenderer(renderer); render_window->SetSize(600, 600); VTK_NEW(vtkRenderWindowInteractor, interactor); interactor->SetRenderWindow(render_window); renderer->ResetCamera(); render_window->Render(); interactor->Start(); } -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Sun Jan 18 07:47:26 2015 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Sun, 18 Jan 2015 07:47:26 -0500 Subject: [vtkusers] Extract isosurfaces from a point cloud polydata with contourfilter In-Reply-To: References: Message-ID: VertexGlyphFilter generates vertex cells. These cells are points. You cannot contour vertices. You need to create cells that have area or volume. In your case, it your points are defined on a uniform lattice, you can create an ImageData that you can contour. On Sun, Jan 18, 2015 at 7:01 AM, Daniel Coelho <1danielcoelho at gmail.com> wrote: > Hello everyone! > > I have a point cloud in the form of a polydata, where I build vertices with > vtkVertexGlyphFilter. > > That polydata has pointdata with scalars ranging from 0 to 255, and I'm > trying to use vtkContourFilter to extract 5 planes, that ideally should cut > through the data at the values corresponding to each plane. > > Just to make it clearer: The expected output should be 5 parallel planes, > equidistant to each other, where each is an isosurface of a certain value, > with respect to the scalars of the pointcloud. > > The problem is: I get absolutely no output. No points, no cell, nada. I've > looked at every example I could find and the mailing list archive, but > couldn't pinpoint the problem. > > Here is a short compilable example that shows this problem. You can also see > outputs from print statements as comments: > OBS: I use VTK 5.8 for some reasons, this is non-negotiable > > #include > > #include > > #include > > #include > > #include > > #include > > #include > > #include > > #include > > > #define VTK_NEW(type, instance) \ > > ; \ > > vtkSmartPointer instance = vtkSmartPointer::New(); > > > int main(int argc, char *argv[]) { > > > VTK_NEW(vtkPoints, points); > > points->Allocate(100 * 100 * 100); > > > VTK_NEW(vtkTypeUInt8Array, data_array); > > data_array->Allocate(100 * 100 * 100); > > > for (int x = 0; x < 100; x++) { > > for (int y = 0; y < 100; ++y) { > > for (int z = 0; z < 100; ++z) { > > points->InsertNextPoint(x, y, z); > > data_array->InsertNextValue(z % 256); > > } > > } > > } > > > VTK_NEW(vtkPolyData, polydata); > > polydata->SetPoints(points); > > polydata->GetPointData()->SetScalars(data_array); > > > VTK_NEW(vtkVertexGlyphFilter, glyph_filter); > > glyph_filter->SetInput(polydata); > > glyph_filter->Update(); > > glyph_filter->GetOutput()->Print(std::cout << "Glyph filter: \n"); > > //Output here: > > //Number Of Points: 1000000 > > //Number Of Cells: 1000000 > > //Bounds look good, all good > > > VTK_NEW(vtkContourFilter, cont_filt); > > cont_filt->SetInputConnection(glyph_filter->GetOutputPort()); > > double scalarRange[2]; > > polydata->GetPointData()->GetScalars()->GetRange(scalarRange); > > cont_filt->GenerateValues(5, scalarRange[0], scalarRange[1]); > > cont_filt->Update(); > > > // Print the contours > > int num_contours = cont_filt->GetNumberOfContours(); > > double cont_values[num_contours]; > > cont_filt->GetValues(cont_values); > > std::cout << "Contours: "; > > for (int var = 0; var < num_contours; ++var) { > > std::cout << cont_values[var] << " "; > > } > > std::cout << std::endl; > > //Output here: > > //Contours: 0 24.75 49.5 74.25 99 > > > cont_filt->GetOutput()->Print(std::cout << "Contour filter: \n"); > > //Output here: > > //No points, no cells, default bounds, no nothing > > > VTK_NEW(vtkPolyDataMapper, mapper); > > mapper->SetInputConnection(cont_filt->GetOutputPort()); > > mapper->SetScalarVisibility(1); > > > VTK_NEW(vtkActor, actor); > > actor->SetMapper(mapper); > > > VTK_NEW(vtkRenderer, renderer); > > renderer->AddActor(actor); > > > VTK_NEW(vtkRenderWindow, render_window) > > render_window->AddRenderer(renderer); > > render_window->SetSize(600, 600); > > > VTK_NEW(vtkRenderWindowInteractor, interactor); > > interactor->SetRenderWindow(render_window); > > > renderer->ResetCamera(); > > render_window->Render(); > > interactor->Start(); > > } > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Unpaid intern in BillsBasement at noware dot com From 1danielcoelho at gmail.com Sun Jan 18 08:04:23 2015 From: 1danielcoelho at gmail.com (Daniel Coelho) Date: Sun, 18 Jan 2015 14:04:23 +0100 Subject: [vtkusers] Fwd: Re: Extract isosurfaces from a point cloud polydata with contourfilter In-Reply-To: References: Message-ID: ---------- Forwarded message ---------- From: "Daniel Coelho" <1danielcoelho at gmail.com> Date: Jan 18, 2015 2:03 PM Subject: Re: [vtkusers] Extract isosurfaces from a point cloud polydata with contourfilter To: "Bill Lorensen" Cc: Thanks for the quick reply! I use some polydata algorithms on this data, so it wouldn't be efficient to keep switching back and forth all the time. How could I make my cells then? Would it suffice to make them cubes, where the vertices are the vertices of each cube? I've never really understood how cells work. Even the VTK books don't really help, sadly On Jan 18, 2015 1:47 PM, "Bill Lorensen" wrote: > VertexGlyphFilter generates vertex cells. These cells are points. You > cannot contour vertices. You need to create cells that have area or > volume. In your case, it your points are defined on a uniform lattice, > you can create an ImageData that you can contour. > > > On Sun, Jan 18, 2015 at 7:01 AM, Daniel Coelho <1danielcoelho at gmail.com> > wrote: > > Hello everyone! > > > > I have a point cloud in the form of a polydata, where I build vertices > with > > vtkVertexGlyphFilter. > > > > That polydata has pointdata with scalars ranging from 0 to 255, and I'm > > trying to use vtkContourFilter to extract 5 planes, that ideally should > cut > > through the data at the values corresponding to each plane. > > > > Just to make it clearer: The expected output should be 5 parallel planes, > > equidistant to each other, where each is an isosurface of a certain > value, > > with respect to the scalars of the pointcloud. > > > > The problem is: I get absolutely no output. No points, no cell, nada. > I've > > looked at every example I could find and the mailing list archive, but > > couldn't pinpoint the problem. > > > > Here is a short compilable example that shows this problem. You can also > see > > outputs from print statements as comments: > > OBS: I use VTK 5.8 for some reasons, this is non-negotiable > > > > #include > > > > #include > > > > #include > > > > #include > > > > #include > > > > #include > > > > #include > > > > #include > > > > #include > > > > > > #define VTK_NEW(type, instance) \ > > > > ; \ > > > > vtkSmartPointer instance = vtkSmartPointer::New(); > > > > > > int main(int argc, char *argv[]) { > > > > > > VTK_NEW(vtkPoints, points); > > > > points->Allocate(100 * 100 * 100); > > > > > > VTK_NEW(vtkTypeUInt8Array, data_array); > > > > data_array->Allocate(100 * 100 * 100); > > > > > > for (int x = 0; x < 100; x++) { > > > > for (int y = 0; y < 100; ++y) { > > > > for (int z = 0; z < 100; ++z) { > > > > points->InsertNextPoint(x, y, z); > > > > data_array->InsertNextValue(z % 256); > > > > } > > > > } > > > > } > > > > > > VTK_NEW(vtkPolyData, polydata); > > > > polydata->SetPoints(points); > > > > polydata->GetPointData()->SetScalars(data_array); > > > > > > VTK_NEW(vtkVertexGlyphFilter, glyph_filter); > > > > glyph_filter->SetInput(polydata); > > > > glyph_filter->Update(); > > > > glyph_filter->GetOutput()->Print(std::cout << "Glyph filter: \n"); > > > > //Output here: > > > > //Number Of Points: 1000000 > > > > //Number Of Cells: 1000000 > > > > //Bounds look good, all good > > > > > > VTK_NEW(vtkContourFilter, cont_filt); > > > > cont_filt->SetInputConnection(glyph_filter->GetOutputPort()); > > > > double scalarRange[2]; > > > > polydata->GetPointData()->GetScalars()->GetRange(scalarRange); > > > > cont_filt->GenerateValues(5, scalarRange[0], scalarRange[1]); > > > > cont_filt->Update(); > > > > > > // Print the contours > > > > int num_contours = cont_filt->GetNumberOfContours(); > > > > double cont_values[num_contours]; > > > > cont_filt->GetValues(cont_values); > > > > std::cout << "Contours: "; > > > > for (int var = 0; var < num_contours; ++var) { > > > > std::cout << cont_values[var] << " "; > > > > } > > > > std::cout << std::endl; > > > > //Output here: > > > > //Contours: 0 24.75 49.5 74.25 99 > > > > > > cont_filt->GetOutput()->Print(std::cout << "Contour filter: \n"); > > > > //Output here: > > > > //No points, no cells, default bounds, no nothing > > > > > > VTK_NEW(vtkPolyDataMapper, mapper); > > > > mapper->SetInputConnection(cont_filt->GetOutputPort()); > > > > mapper->SetScalarVisibility(1); > > > > > > VTK_NEW(vtkActor, actor); > > > > actor->SetMapper(mapper); > > > > > > VTK_NEW(vtkRenderer, renderer); > > > > renderer->AddActor(actor); > > > > > > VTK_NEW(vtkRenderWindow, render_window) > > > > render_window->AddRenderer(renderer); > > > > render_window->SetSize(600, 600); > > > > > > VTK_NEW(vtkRenderWindowInteractor, interactor); > > > > interactor->SetRenderWindow(render_window); > > > > > > renderer->ResetCamera(); > > > > render_window->Render(); > > > > interactor->Start(); > > > > } > > > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Please keep messages on-topic and check the VTK FAQ at: > > http://www.vtk.org/Wiki/VTK_FAQ > > > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/vtkusers > > > > > > -- > Unpaid intern in BillsBasement at noware dot com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Sun Jan 18 08:23:50 2015 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Sun, 18 Jan 2015 08:23:50 -0500 Subject: [vtkusers] Fwd: Re: Extract isosurfaces from a point cloud polydata with contourfilter In-Reply-To: References: Message-ID: Cubes would work (vtkHexahedron). On Sun, Jan 18, 2015 at 8:04 AM, Daniel Coelho <1danielcoelho at gmail.com> wrote: > ---------- Forwarded message ---------- > From: "Daniel Coelho" <1danielcoelho at gmail.com> > Date: Jan 18, 2015 2:03 PM > Subject: Re: [vtkusers] Extract isosurfaces from a point cloud polydata with > contourfilter > To: "Bill Lorensen" > Cc: > > Thanks for the quick reply! > > I use some polydata algorithms on this data, so it wouldn't be efficient to > keep switching back and forth all the time. > > How could I make my cells then? Would it suffice to make them cubes, where > the vertices are the vertices of each cube? I've never really understood how > cells work. Even the VTK books don't really help, sadly > > On Jan 18, 2015 1:47 PM, "Bill Lorensen" wrote: >> >> VertexGlyphFilter generates vertex cells. These cells are points. You >> cannot contour vertices. You need to create cells that have area or >> volume. In your case, it your points are defined on a uniform lattice, >> you can create an ImageData that you can contour. >> >> >> On Sun, Jan 18, 2015 at 7:01 AM, Daniel Coelho <1danielcoelho at gmail.com> >> wrote: >> > Hello everyone! >> > >> > I have a point cloud in the form of a polydata, where I build vertices >> > with >> > vtkVertexGlyphFilter. >> > >> > That polydata has pointdata with scalars ranging from 0 to 255, and I'm >> > trying to use vtkContourFilter to extract 5 planes, that ideally should >> > cut >> > through the data at the values corresponding to each plane. >> > >> > Just to make it clearer: The expected output should be 5 parallel >> > planes, >> > equidistant to each other, where each is an isosurface of a certain >> > value, >> > with respect to the scalars of the pointcloud. >> > >> > The problem is: I get absolutely no output. No points, no cell, nada. >> > I've >> > looked at every example I could find and the mailing list archive, but >> > couldn't pinpoint the problem. >> > >> > Here is a short compilable example that shows this problem. You can also >> > see >> > outputs from print statements as comments: >> > OBS: I use VTK 5.8 for some reasons, this is non-negotiable >> > >> > #include >> > >> > #include >> > >> > #include >> > >> > #include >> > >> > #include >> > >> > #include >> > >> > #include >> > >> > #include >> > >> > #include >> > >> > >> > #define VTK_NEW(type, instance) \ >> > >> > ; \ >> > >> > vtkSmartPointer instance = vtkSmartPointer::New(); >> > >> > >> > int main(int argc, char *argv[]) { >> > >> > >> > VTK_NEW(vtkPoints, points); >> > >> > points->Allocate(100 * 100 * 100); >> > >> > >> > VTK_NEW(vtkTypeUInt8Array, data_array); >> > >> > data_array->Allocate(100 * 100 * 100); >> > >> > >> > for (int x = 0; x < 100; x++) { >> > >> > for (int y = 0; y < 100; ++y) { >> > >> > for (int z = 0; z < 100; ++z) { >> > >> > points->InsertNextPoint(x, y, z); >> > >> > data_array->InsertNextValue(z % 256); >> > >> > } >> > >> > } >> > >> > } >> > >> > >> > VTK_NEW(vtkPolyData, polydata); >> > >> > polydata->SetPoints(points); >> > >> > polydata->GetPointData()->SetScalars(data_array); >> > >> > >> > VTK_NEW(vtkVertexGlyphFilter, glyph_filter); >> > >> > glyph_filter->SetInput(polydata); >> > >> > glyph_filter->Update(); >> > >> > glyph_filter->GetOutput()->Print(std::cout << "Glyph filter: \n"); >> > >> > //Output here: >> > >> > //Number Of Points: 1000000 >> > >> > //Number Of Cells: 1000000 >> > >> > //Bounds look good, all good >> > >> > >> > VTK_NEW(vtkContourFilter, cont_filt); >> > >> > cont_filt->SetInputConnection(glyph_filter->GetOutputPort()); >> > >> > double scalarRange[2]; >> > >> > polydata->GetPointData()->GetScalars()->GetRange(scalarRange); >> > >> > cont_filt->GenerateValues(5, scalarRange[0], scalarRange[1]); >> > >> > cont_filt->Update(); >> > >> > >> > // Print the contours >> > >> > int num_contours = cont_filt->GetNumberOfContours(); >> > >> > double cont_values[num_contours]; >> > >> > cont_filt->GetValues(cont_values); >> > >> > std::cout << "Contours: "; >> > >> > for (int var = 0; var < num_contours; ++var) { >> > >> > std::cout << cont_values[var] << " "; >> > >> > } >> > >> > std::cout << std::endl; >> > >> > //Output here: >> > >> > //Contours: 0 24.75 49.5 74.25 99 >> > >> > >> > cont_filt->GetOutput()->Print(std::cout << "Contour filter: \n"); >> > >> > //Output here: >> > >> > //No points, no cells, default bounds, no nothing >> > >> > >> > VTK_NEW(vtkPolyDataMapper, mapper); >> > >> > mapper->SetInputConnection(cont_filt->GetOutputPort()); >> > >> > mapper->SetScalarVisibility(1); >> > >> > >> > VTK_NEW(vtkActor, actor); >> > >> > actor->SetMapper(mapper); >> > >> > >> > VTK_NEW(vtkRenderer, renderer); >> > >> > renderer->AddActor(actor); >> > >> > >> > VTK_NEW(vtkRenderWindow, render_window) >> > >> > render_window->AddRenderer(renderer); >> > >> > render_window->SetSize(600, 600); >> > >> > >> > VTK_NEW(vtkRenderWindowInteractor, interactor); >> > >> > interactor->SetRenderWindow(render_window); >> > >> > >> > renderer->ResetCamera(); >> > >> > render_window->Render(); >> > >> > interactor->Start(); >> > >> > } >> > >> > >> > _______________________________________________ >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at >> > http://www.kitware.com/opensource/opensource.html >> > >> > Please keep messages on-topic and check the VTK FAQ at: >> > http://www.vtk.org/Wiki/VTK_FAQ >> > >> > Search the list archives at: http://markmail.org/search/?q=vtkusers >> > >> > Follow this link to subscribe/unsubscribe: >> > http://public.kitware.com/mailman/listinfo/vtkusers >> > >> >> >> >> -- >> 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 > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Unpaid intern in BillsBasement at noware dot com From hessenthaler at mechbau.uni-stuttgart.de Sun Jan 18 11:30:36 2015 From: hessenthaler at mechbau.uni-stuttgart.de (Andreas Hessenthaler) Date: Sun, 18 Jan 2015 17:30:36 +0100 (CET) Subject: [vtkusers] Holes on surface of clipped unstructured data set In-Reply-To: References: Message-ID: Hi there, does anybody have any idea, why this happens? Cheers Andreas On Sat, January 3, 2015 10:21 pm, Andreas Hessenthaler wrote: Hi there, I have an unstructured grid with scalar and vector data which I clip using vtkClipDataSet and vtkPlane: clippingPlaneF = vtk.vtkPlane() clippingPlaneF.SetOrigin(0.5*(minXF+maxXF), 0.5*(minYF+maxYF), 0.5*(minZF+maxZF)) clippingPlaneF.SetNormal(0.0, 1.0, 0.0) clipF = vtk.vtkClipDataSet() clipF.SetInput(meshF) clipF.SetClipFunction(clippingPlaneF) clipF.InsideOutOn() extractClipF = vtk.vtkGeometryFilter() extractClipF.SetInput(clipF.GetOutput()) linearSubdivisionClipF = vtk.vtkLinearSubdivisionFilter() linearSubdivisionClipF.SetInput(extractClipF.GetOutput()) linearSubdivisionClipF.SetNumberOfSubdivisions(2) clipMapperF = vtk.vtkDataSetMapper() Now, if I use clipMapperF.SetInputConnection(clipF.GetOutputPort()) the colors on the surface appear jagged. Thus, I tried the subdivision filter, i.e. clipMapperF.SetInputConnection(linearSubdivisionClipF.GetOutputPort()) which gives a nice result in terms of the color mapping, but introduces holes on the surface, that result from clipping the data set (complete data set is fine), see screenshot attached. Some background if helpful: the data set is a 3D unstructured grid with pressure and velocity field. The cells are of type vtkQuadraticTetra, though vtkTetra gives the same result. Attached screenshot shows velocity magnitude (components or pressure have same behavior). Any help is much appreciated! Cheers Andreas_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers From ngoonee.talk at gmail.com Sun Jan 18 20:05:27 2015 From: ngoonee.talk at gmail.com (Oon-Ee Ng) Date: Mon, 19 Jan 2015 09:05:27 +0800 Subject: [vtkusers] Rendering XYZRGBA segfaults randomly while XYZ doesn't in qvtkwidget subclass In-Reply-To: References: Message-ID: Bump, anyone has comment? Obviously, if I record the stream to a bunch of .pcd files and read from them, the qvtkwidget subclass works fine, but I don't know enough about VTK's internals to try to debug what's going on with memory. From aruopp at gmx.de Mon Jan 19 08:45:59 2015 From: aruopp at gmx.de (Andreas Ruopp) Date: Mon, 19 Jan 2015 14:45:59 +0100 Subject: [vtkusers] vtk to stl -> code is working, but with error mesage. why? Message-ID: <3234526.RlDfkNgohZ@poppermobil2.site> Nobody with an idea? Is it too trivial? best regards, andy From joachim.pouderoux at kitware.com Mon Jan 19 11:42:42 2015 From: joachim.pouderoux at kitware.com (Joachim Pouderoux) Date: Mon, 19 Jan 2015 17:42:42 +0100 Subject: [vtkusers] ANN: VTK and ParaView Training Courses in Lyon, France, February 3-4, 2015 In-Reply-To: References: Message-ID: Errata: the previous links were bad, here are the correct one: http://training.kitware.fr/browse/83 http://training.kitware.fr/browse/84 or in French: http://formations.kitware.fr/browse/83 http://formations.kitware.fr/browse/84 Best regards, *Joachim Pouderoux* *PhD, Technical Expert* *Kitware SAS * 2015-01-16 14:04 GMT+01:00 Joachim Pouderoux : > Kitware will be holding VTK and ParaView courses on February 3-4, > 2015 in Lyon, France. > > Please visit our web site for more information and registration details at > either: > > http://training.kitware.fr/browse/83 > > http://training.kitware.fr/browse/84 > > or in French: > http://formations.kitware.fr/browse/83 > > http://formations.kitware.fr/browse/84 > > > Note that the course will be taught in English. If you have any question, > please contact us at formations at http://www.kitware.fr > > Thank you, > > *Joachim Pouderoux* > > *PhD, Technical Expert* > *Kitware SAS * > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From serge at infolytica.com Tue Jan 20 10:18:44 2015 From: serge at infolytica.com (Serge Lalonde) Date: Tue, 20 Jan 2015 10:18:44 -0500 Subject: [vtkusers] VTK 6.1 no longer supports ASCII characters > 128? (5.10.1 was ok) Message-ID: <54BE71D4.6010007@infolytica.com> An HTML attachment was scrubbed... URL: From sean at rogue-research.com Tue Jan 20 11:05:47 2015 From: sean at rogue-research.com (Sean McBride) Date: Tue, 20 Jan 2015 11:05:47 -0500 Subject: [vtkusers] VTK 6.1 no longer supports ASCII characters > 128? (5.10.1 was ok) In-Reply-To: <54BE71D4.6010007@infolytica.com> References: <54BE71D4.6010007@infolytica.com> Message-ID: <20150120160547.2004569427@mail.rogue-research.com> On Tue, 20 Jan 2015 10:18:44 -0500, Serge Lalonde said: >I'm upgrading from VTK 5.10.1 to VTK 6.1. All went smoothly until I ran >into an error rendering a vtkScalarBarActor whose title was set to "J (A/m2)". > >This worked fine in 5.10.1, but in 6.1, the vtkutf8::is_valid() method >called from vtkUnicodeString::from_utf8() returns false because the >value of "2" is 0xB2 (in the extended ASCII range) but the vtkutf8 code >internally stops at 0x80 (sequence_length() in core.h returns 0). That >in turn causes a debug message "vtkUnicodeString::from_utf8(): not a >valid UTF-8 string." to appear and then other problems with vtkTextActor >not being able to calculate its bounds and so on. I think you are a bit confused about character encodings (it's a confusing thing!). First, there are no ASCII characters above 127. ASCII is a 7 bit code. What you mean to refer to is ISO-8859-1 aka Latin1. In that encoding, the 'square' character does indeed seem to be 0xB2: 8859 is not part of Unicode at all and is not the same as UTF-8. There are many online Unicode tools, ex: Where you can see the Unicode code point for 'superscript two' is U+00B2, which encoded as UTF-8 is 'c2 b2' in hex. You might want to read this, which is a helpful classic: 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 serge at infolytica.com Tue Jan 20 12:03:01 2015 From: serge at infolytica.com (Serge Lalonde) Date: Tue, 20 Jan 2015 12:03:01 -0500 Subject: [vtkusers] VTK 6.1 no longer supports ASCII characters > 128? (5.10.1 was ok) In-Reply-To: <20150120160547.2004569427@mail.rogue-research.com> References: <54BE71D4.6010007@infolytica.com> <20150120160547.2004569427@mail.rogue-research.com> Message-ID: <54BE8A45.5050702@infolytica.com> An HTML attachment was scrubbed... URL: From serge at infolytica.com Tue Jan 20 12:41:34 2015 From: serge at infolytica.com (Serge Lalonde) Date: Tue, 20 Jan 2015 12:41:34 -0500 Subject: [vtkusers] VTK 6.1 no longer supports ASCII characters > 128? (5.10.1 was ok) In-Reply-To: <54BE8A45.5050702@infolytica.com> References: <54BE71D4.6010007@infolytica.com> <20150120160547.2004569427@mail.rogue-research.com> <54BE8A45.5050702@infolytica.com> Message-ID: <54BE934E.7090906@infolytica.com> An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Tue Jan 20 13:28:48 2015 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 20 Jan 2015 11:28:48 -0700 Subject: [vtkusers] VTK 6.1 no longer supports ASCII characters > 128? (5.10.1 was ok) In-Reply-To: <54BE934E.7090906@infolytica.com> References: <54BE71D4.6010007@infolytica.com> <20150120160547.2004569427@mail.rogue-research.com> <54BE8A45.5050702@infolytica.com> <54BE934E.7090906@infolytica.com> Message-ID: Hi Serge, I'm not sure if this will be useful to you, but here is a function that I wrote a while ago for converting Latin1 to utf8. A warning: even if utf8 works in some parts of VTK, it definitely doesn't work in all parts of VTK. In particular, I suspect that most readers and writers do not support utf8, or only support utf8 on certain operating systems. Also the following unicode library is pre-installed on many systems these days: http://site.icu-project.org/ - David std::string ConvertLatin1ToUtf8(const char *text, size_t l) { // compute expected size of the utf8 string and allocate it const char *cp = text; size_t m = l; for (size_t n = 0; n < l; n++) { // add one byte for each 8-bit character in the string m += static_cast(*cp++) >> 7; } s.resize(m); // encode each latin1 character as utf8 cp = text; size_t i = 0; while (i < m) { while (i < m && (*cp & 0x80) == 0) { // convert 7-bit character to one utf8 byte s[i++] = *cp++; } if (i < m) { // convert 8-bit character to two utf8 bytes int code = static_cast(*cp++); s[i++] = (0xC0 | (code >> 6)); s[i++] = (0x80 | (code & 0x3F)); } } return s; } On Tue, Jan 20, 2015 at 10:41 AM, Serge Lalonde wrote: > I realized that I was passing a TrueType font file instead of a FreeType > one. > So I downloaded the DejaVu fonts as recommended here: > http://vtkusers.public.kitware.narkive.com/5fy8hSRK/unicode-support > But it made no difference. > > I also looked at the TestChartUnicode and TextContextUnicode tests to see > how it's done there and I'm doing the same thing. > > So I don't see what's wrong. Anyone have any suggestions? > > Thanks. > > > On 1/20/2015 12:03 PM, Serge Lalonde wrote: > > Hi Sean, > > Thanks for the tips on encoding. I knew that I probably wasn't using the > right terminology and I'll read up on those soon. > > In the meantime, I'm no closer to being able to display "J (A/m2)" as the > title of a vtkScalarBarActor. > > I tried using these APIs on the TitleTextProperty of the vtkScalarBarActor > > m_VTKScalarBarActor->GetTitleTextProperty()->SetFontFamily(VTK_FONT_FILE); > m_VTKScalarBarActor->GetTitleTextProperty()->SetFontFile("C:\\Windows\\winsxs\\amd64_microsoft-windows-font-truetype-arial_31bf3856ad364e35_6.1.7601.18528_none_d0a29012c3ff391b\\arial.ttf"); > > and then encoding the string to be a sequence of hex escape sequences like > the example here: > > http://marc.info/?l=vtkusers&m=138868987612759&w=2) > > and it just spits out the string as-is, that is something like > "\x4A\x20\x28\x41\x2F\x6D\xC2\xB2\x29". > > Is there a tutorial or a wiki that shows how to use Unicode strings in > VTK? Ideally with the system fonts? What's the magic formula? ;-) > > Thanks. > > On 1/20/2015 11:05 AM, Sean McBride wrote: > > On Tue, 20 Jan 2015 10:18:44 -0500, Serge Lalonde said: > > > I'm upgrading from VTK 5.10.1 to VTK 6.1. All went smoothly until I ran > into an error rendering a vtkScalarBarActor whose title was set to "J (A/m2)". > > This worked fine in 5.10.1, but in 6.1, the vtkutf8::is_valid() method > called from vtkUnicodeString::from_utf8() returns false because the > value of "2" is 0xB2 (in the extended ASCII range) but the vtkutf8 code > internally stops at 0x80 (sequence_length() in core.h returns 0). That > in turn causes a debug message "vtkUnicodeString::from_utf8(): not a > valid UTF-8 string." to appear and then other problems with vtkTextActor > not being able to calculate its bounds and so on. > > I think you are a bit confused about character encodings (it's a confusing thing!). > > First, there are no ASCII characters above 127. ASCII is a 7 bit code. What you mean to refer to is ISO-8859-1 aka Latin1. In that encoding, the 'square' character does indeed seem to be 0xB2: > > > 8859 is not part of Unicode at all and is not the same as UTF-8. > > There are many online Unicode tools, ex: > > Where you can see the Unicode code point for 'superscript two' is U+00B2, which encoded as UTF-8 is 'c2 b2' in hex. > > You might want to read this, which is a helpful classic: > > > Cheers, > > > > -- > www.infolytica.com > 300 Leo Pariseau, Suite 2222, Montreal, QC, Canada, H2X 4B3 > (514) 849-8752 x236, Fax: (514) 849-4239 > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe:http://public.kitware.com/mailman/listinfo/vtkusers > > > -- > www.infolytica.com > 300 Leo Pariseau, Suite 2222, Montreal, QC, Canada, H2X 4B3 > (514) 849-8752 x236, Fax: (514) 849-4239 > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cameron.palmer at ntnu.no Tue Jan 20 14:23:58 2015 From: cameron.palmer at ntnu.no (Cameron Lowell Palmer) Date: Tue, 20 Jan 2015 19:23:58 +0000 Subject: [vtkusers] vtkSphereSource and VES Message-ID: As an experiment I?m simply trying to add a vtkSphereSource to a VES app running on the iPhone. How can you make this work? vtkSmartPointer sphereSource = vtkSmartPointer::New(); sphereSource->SetCenter(0.f, 0.f, 0.f); sphereSource->SetRadius(10.f); auto polyData = vtkSmartPointer::New(); polyData->SetInputConnection(sphereSource->GetOutputPort()); sphereSource->Update(); auto sphere = new vesKiwiImagePlaneDataRepresentation(); sphere->setPolyData(polyData->GetOutput()); this->CallbackRep.push_back(sphere); I SIGABRT at sphere->setPolyData. Thanks, Cameron Palmer -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Tue Jan 20 14:35:45 2015 From: cory.quammen at kitware.com (Cory Quammen) Date: Tue, 20 Jan 2015 14:35:45 -0500 Subject: [vtkusers] vtkSphereSource and VES In-Reply-To: References: Message-ID: Cameron, Try calling Update() on your vtkAppendPolyData filter prior to calling setPolyData(). - Cory On Tue, Jan 20, 2015 at 2:23 PM, Cameron Lowell Palmer < cameron.palmer at ntnu.no> wrote: > As an experiment I?m simply trying to add a vtkSphereSource to a VES app > running on the iPhone. How can you make this work? > > vtkSmartPointer sphereSource = vtkSmartPointer< > vtkSphereSource>::New(); > sphereSource->SetCenter(0.f, 0.f, 0.f); > sphereSource->SetRadius(10.f); > > auto polyData = vtkSmartPointer::New(); > polyData->SetInputConnection(sphereSource->GetOutputPort()); > sphereSource->Update(); > > auto sphere = new vesKiwiImagePlaneDataRepresentation(); > sphere->setPolyData(polyData->GetOutput()); > this->CallbackRep.push_back(sphere); > > I SIGABRT at sphere->setPolyData. > > > Thanks, > > Cameron Palmer > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -- Cory Quammen R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From serge at infolytica.com Tue Jan 20 14:43:26 2015 From: serge at infolytica.com (Serge Lalonde) Date: Tue, 20 Jan 2015 14:43:26 -0500 Subject: [vtkusers] VTK 6.1 no longer supports ASCII characters > 128? (5.10.1 was ok) In-Reply-To: References: <54BE71D4.6010007@infolytica.com> <20150120160547.2004569427@mail.rogue-research.com> <54BE8A45.5050702@infolytica.com> <54BE934E.7090906@infolytica.com> Message-ID: <54BEAFDE.3060100@infolytica.com> An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Tue Jan 20 15:43:44 2015 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 20 Jan 2015 13:43:44 -0700 Subject: [vtkusers] VTK 6.1 no longer supports ASCII characters > 128? (5.10.1 was ok) In-Reply-To: <54BEAFDE.3060100@infolytica.com> References: <54BE71D4.6010007@infolytica.com> <20150120160547.2004569427@mail.rogue-research.com> <54BE8A45.5050702@infolytica.com> <54BE934E.7090906@infolytica.com> <54BEAFDE.3060100@infolytica.com> Message-ID: On Tue, Jan 20, 2015 at 12:43 PM, Serge Lalonde wrote: > > Your function ConvertLatin1ToUtf8() works great and now I can at least get > the extended ASCII Latin1 encoded characters > You must have noticed that I forgot to declare the string variable "s" in my function :) My app is actually using managed C++ to glue together the C# GUI with the > C++ VTK. This works surprisingly well. > The "problem" (if you can call it that) is that C# strings are stored > internally in Unicode. Some of the text we'd like to display is not > available in the Latin1 encoding (ex: special unit symbols). > If I recall correctly, Windows uses UTF-16 as its native "unicode" encoding (always stored as wchar_t). So you need something to convert UTF-16 to UTF-8. Using vtkUnicodeString, the conversion will be a three-step process: 1) store the Windows unicode string in an "unsigned short" array 2) call from_utf16() to make a vtkUnicodeString 3) call utr8_str() to convert it to UTF--8 I hope this works. I've never tried it myself. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From mleung at lumerical.com Tue Jan 20 18:38:25 2015 From: mleung at lumerical.com (Mande Leung) Date: Tue, 20 Jan 2015 23:38:25 +0000 Subject: [vtkusers] Axis labels that are constantly facing the camera, not drawn on overlay, and have good quality fonts Message-ID: <1421796777325.45451@lumerical.com> I am using vtkCubeAxesActor to draw a 3D axis. I see three options to draw the titles and labels: vtkAxisFollower, vtkTextActor, or vtkTextActor3D. I need (1) the titles and labels to be constantly facing the camera, (2) not overlaid over the data, and (3) to have good quality fonts. I'm not sure how to best achieve these things. For vktTextActor, the fonts are rendered very nicely. However, since it is a 2D actor, it is always rendered as an overlay. When the axis is supposed to be behind the data (say, in "FURTHEST_TRIAD" mode), the axis lines and ticks would be rendered behind the data while the titles and label are rendered at front/on top, which looks awkward to me. Using vtkAxisFollower can avoid the above issue but the fonts are not rendered as nicely. Also, the titles and labels stay parallel with the axis but I need them to be constantly facing the camera. vtkTextActor3D also stays parallel to the axis, like vtkAxisFollower. The font quality is better than vtkAxisFollower, but I still prefer that of vtkTextActor. I considered creating a subclass of vtkAxisFollower with a different transform matrix (so that it will always be facing the camera). It also uses a vtkTexture/vtkImageData pair for font rendering (so that the font quality is similar to vtkTextActor). This would achieve the three goals I listed above. However: I am not sure how to incorporate this class within vtkCubeAxesActor (or vtkAxisActor). The vtkAxisFollower is a private member of vtkAxisActor with no set mutator. Any suggestions for how to proceed, either with this plan or perhaps a better one I am unaware of? Many thanks!? Mande ________________________ Mande Leung | Software Developer Lumerical Solutions, Inc. 300 - 535 Thurlow Street, Vancouver, Canada Tel: 1.604.733.9006 Ext. 312 www.lumerical.com mleung at lumerical.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From wulihouxiaoshuai at 163.com Wed Jan 21 00:43:26 2015 From: wulihouxiaoshuai at 163.com (Emptystack) Date: Tue, 20 Jan 2015 22:43:26 -0700 (MST) Subject: [vtkusers] Java servlet + Glassfish + volume rendering applications problem In-Reply-To: <1420795069171-5730042.post@n5.nabble.com> References: <1420686868240-5730017.post@n5.nabble.com> <1420768376754-5730037.post@n5.nabble.com> <1420795069171-5730042.post@n5.nabble.com> Message-ID: <1421819006962-5730190.post@n5.nabble.com> My Java servlet code is as following: package com.hou.service; import java.awt.image.BufferedImage; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import javax.imageio.ImageIO; import javax.servlet.ServletException; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import com.hou.core.RenderContext; import com.sun.image.codec.jpeg.JPEGCodec; import com.sun.image.codec.jpeg.JPEGImageEncoder; import vtk.vtkActor; import vtk.vtkConeSource; import vtk.vtkJPEGWriter; import vtk.vtkNativeLibrary; import vtk.vtkPolyDataMapper; import vtk.vtkRenderWindow; import vtk.vtkRenderWindowInteractor; import vtk.vtkRenderer; import vtk.vtkUnsignedCharArray; import vtk.vtkWindowToImageFilter; public class Image extends HttpServlet { /** * */ private static final long serialVersionUID = 1L; // private RenderContext renderContext; // Load VTK library and print which library was not properly loaded static { if (!vtkNativeLibrary.LoadAllNativeLibraries()) { for (vtkNativeLibrary lib : vtkNativeLibrary.values()) { if (!lib.IsLoaded()) { System.out.println(lib.GetLibraryName() + " not loaded"); } else { System.out.println(lib.GetLibraryName() + " loaded"); } } } else { System.out.println("All Libraries are loaded"); } vtkNativeLibrary.DisableOutputWindow(null); } @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { // TODO Auto-generated method stub // super.doGet(req, resp); HttpSession session = req.getSession(false); int count; vtkConeSource cone; vtkPolyDataMapper mapper; vtkActor actor; vtkRenderer renderer; vtkRenderWindow renderWindow; vtkRenderWindowInteractor interactor; String countKey = "count"; String coneKey = "cone"; String mapperKey = "mapper"; String actorKey = "actor"; String rendererKey = "renderer"; String renderWindowKey = "renderWindow"; String interactorKey = "interactor"; if (session == null) { session = req.getSession(true); count = 0; session.setAttribute(countKey, count); cone = new vtkConeSource(); cone.SetHeight(3.0); cone.SetRadius(1.0); cone.SetResolution(10); session.setAttribute(coneKey, cone); mapper = new vtkPolyDataMapper(); mapper.SetInputConnection(cone.GetOutputPort()); session.setAttribute(mapperKey, mapper); actor = new vtkActor(); actor.SetMapper(mapper); session.setAttribute(actorKey, actor); renderer = new vtkRenderer(); renderer.AddActor(actor); session.setAttribute(rendererKey, renderer); renderWindow = new vtkRenderWindow(); renderWindow.SetSize(300, 300); renderWindow.SetOffScreenRendering(1); renderWindow.AddRenderer(renderer); session.setAttribute(renderWindowKey, renderWindow); interactor = new vtkRenderWindowInteractor(); interactor.SetRenderWindow(renderWindow); session.setAttribute(interactorKey, interactor); interactor.Initialize(); interactor.Render(); } else { interactor = (vtkRenderWindowInteractor)session.getAttribute(interactorKey); renderWindow = (vtkRenderWindow)session.getAttribute(renderWindowKey); count = (int)session.getAttribute(countKey); count++; if (count == 1) { interactor.SetEventPosition(100, 100); interactor.SetLastEventPosition(100, 100); interactor.LeftButtonPressEvent(); } else { interactor.LeftButtonPressEvent(); interactor.SetEventPosition(110, 110); interactor.SetLastEventPosition(100, 100); interactor.MouseMoveEvent(); } session.setAttribute(countKey, count); } int[] size = renderWindow.GetSize(); vtkUnsignedCharArray pixelDataArray = new vtkUnsignedCharArray(); renderWindow.GetPixelData(0, 0, size[0] - 1, size[1] - 1, 1-renderWindow.GetDoubleBuffer(), pixelDataArray); // convert unsigned char to byte,note the range of each primitive type byte[] bytePixelData = pixelDataArray.GetJavaArray(); int[] RGBPixelData = new int[bytePixelData.length]; // convert byte to unsigned and stored in RGBPixelData array for (int i = 0; i < RGBPixelData.length; i++) { RGBPixelData[i] = bytePixelData[i] & 0xff; } int[] pixelData = new int[size[0] * size[1]]; int index = 0; int r, g, b; // The sequence of pixels is from left to right and from bottom to top, // so we need flip the RGB pixel // no A channel to avoid image distortion for (int row = size[1] - 1; row >= 0; row--) { for (int column = 0; column < size[0]; column++) { r = RGBPixelData[3 * (size[1] * row + column)]; g = RGBPixelData[3 * (size[1] * row + column) + 1]; b = RGBPixelData[3 * (size[1] * row + column) + 2]; if (r > 255) { r = 255; } if (r < 0) { r = 0; } if (g > 255) { g = 255; } if (g < 0) { g = 0; } if (b > 255) { b = 255; } if (b < 0) { b = 0; } pixelData[index] = ((r & 0xff) << 16) | ((g & 0xff) << 8) | ((b & 0xff)); index++; } } BufferedImage bi = new BufferedImage(size[0], size[1], BufferedImage.TYPE_INT_RGB); bi.getRaster().setDataElements(0, 0, size[0], size[1], pixelData); // get a ServletOutputStream for writing binary data ServletOutputStream so = resp.getOutputStream(); // This creates an instance of a JPEGImageEncoder // that can be used to encode image data as JPEG Data streams. JPEGImageEncoder jie = JPEGCodec.createJPEGEncoder(so); // Encode a BufferedImage as a JPEG data stream jie.encode(bi); so.flush(); } } I used a simple cone to test the rotation. And after several requests the cone can be rotated. So I replaced the code with the following volume rendering code : package com.hou.service; import java.awt.image.BufferedImage; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import javax.imageio.ImageIO; import javax.servlet.ServletException; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import com.hou.auxiliary.VolumeMapperType; import com.hou.convertor.DicomImageImport; import com.hou.core.RenderContext; import com.hou.prop.ViewProp; import com.sun.image.codec.jpeg.JPEGCodec; import com.sun.image.codec.jpeg.JPEGImageEncoder; import vtk.vtkActor; import vtk.vtkColorTransferFunction; import vtk.vtkConeSource; import vtk.vtkDICOMImageReader; import vtk.vtkGPUVolumeRayCastMapper; import vtk.vtkImageData; import vtk.vtkImageShiftScale; import vtk.vtkJPEGWriter; import vtk.vtkNativeLibrary; import vtk.vtkPiecewiseFunction; import vtk.vtkPlaneSource; import vtk.vtkPolyDataMapper; import vtk.vtkRenderWindow; import vtk.vtkRenderWindowInteractor; import vtk.vtkRenderer; import vtk.vtkSmartVolumeMapper; import vtk.vtkUnsignedCharArray; import vtk.vtkVolume; import vtk.vtkVolumeMapper; import vtk.vtkVolumeProperty; import vtk.vtkVolumeRayCastMIPFunction; import vtk.vtkVolumeRayCastMapper; import vtk.vtkWindowToImageFilter; public class Image extends HttpServlet { /** * */ private static final long serialVersionUID = 1L; // private RenderContext renderContext; // Load VTK library and print which library was not properly loaded static { if (!vtkNativeLibrary.LoadAllNativeLibraries()) { for (vtkNativeLibrary lib : vtkNativeLibrary.values()) { if (!lib.IsLoaded()) { System.out.println(lib.GetLibraryName() + " not loaded"); } else { System.out.println(lib.GetLibraryName() + " loaded"); } } } else { System.out.println("All Libraries are loaded"); } vtkNativeLibrary.DisableOutputWindow(null); } @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { // TODO Auto-generated method stub // super.doGet(req, resp); HttpSession session = req.getSession(false); int count; vtkDICOMImageReader reader; vtkGPUVolumeRayCastMapper mapper; vtkColorTransferFunction colorTransferFunction; vtkPiecewiseFunction opacityFunction; vtkVolumeProperty volumeProperty; vtkVolume volume; vtkRenderer renderer; vtkRenderWindow renderWindow; vtkRenderWindowInteractor interactor; String countKey = "count"; String readerKey = "reader"; String colorTFKey = "colorTF"; String opacityTFKey = "opacityTF"; String mapperKey = "mapper"; String volumePropertyKey = "volumeProperty"; String volumeKey = "volume"; String rendererKey = "renderer"; String renderWindowKey = "renderWindow"; String interactorKey = "interactor"; if (session == null) { session = req.getSession(true); reader = new vtkDICOMImageReader(); reader.SetDirectoryName("/home/garnett/image/CT"); reader.Update(); session.setAttribute(readerKey, reader); colorTransferFunction = new vtkColorTransferFunction(); colorTransferFunction.AddRGBPoint(-3024, 0.0, 0.0, 0.0); colorTransferFunction.AddRGBPoint(42.9, 0.55, 0.25, 0.15); colorTransferFunction.AddRGBPoint(184.4, 0.92, 0.64, 0.06); colorTransferFunction.AddRGBPoint(277.64, 1.0, 0.88, 0.62); colorTransferFunction.AddRGBPoint(1430, 1.0, 0.99, 0.95); session.setAttribute(colorTFKey, colorTransferFunction); opacityFunction = new vtkPiecewiseFunction(); opacityFunction.AddPoint(-3024, 0.0); opacityFunction.AddPoint(42.9, 0.0); opacityFunction.AddPoint(163.5, 0.429); opacityFunction.AddPoint(277.64, 0.777); opacityFunction.AddPoint(1430, 0.758); session.setAttribute(opacityTFKey, opacityFunction); volumeProperty = new vtkVolumeProperty(); volumeProperty.SetColor(colorTransferFunction); volumeProperty.SetScalarOpacity(opacityFunction); volumeProperty.SetInterpolationTypeToLinear(); volumeProperty.ShadeOn(); volumeProperty.SetAmbient(0.1); volumeProperty.SetDiffuse(0.9); volumeProperty.SetSpecular(0.2); volumeProperty.SetSpecularPower(10.0); volumeProperty.SetScalarOpacityUnitDistance(0.8919); session.setAttribute(volumePropertyKey, volumeProperty); mapper = new vtkGPUVolumeRayCastMapper(); mapper.SetBlendModeToComposite(); mapper.SetInput(reader.GetOutput()); mapper.Update(); session.setAttribute(mapperKey, mapper); volume = new vtkVolume(); volume.SetMapper(mapper); volume.SetProperty(volumeProperty); session.setAttribute(volumeKey, volume); count = 0; session.setAttribute(countKey, count); renderer = new vtkRenderer(); renderer.AddVolume(volume); session.setAttribute(rendererKey, renderer); renderWindow = new vtkRenderWindow(); renderWindow.SetSize(300, 300); renderWindow.SetOffScreenRendering(1); renderWindow.AddRenderer(renderer); session.setAttribute(renderWindowKey, renderWindow); interactor = new vtkRenderWindowInteractor(); interactor.SetRenderWindow(renderWindow); session.setAttribute(interactorKey, interactor); interactor.Initialize(); interactor.Render(); } else { interactor = (vtkRenderWindowInteractor)session.getAttribute(interactorKey); renderWindow = (vtkRenderWindow)session.getAttribute(renderWindowKey); count = (int)session.getAttribute(countKey); count++; if (count == 1) { interactor.SetEventPosition(100, 100); interactor.SetLastEventPosition(100, 100); interactor.LeftButtonPressEvent(); interactor.LeftButtonReleaseEvent(); } else { interactor.LeftButtonPressEvent(); interactor.SetEventPosition(110, 110); interactor.SetLastEventPosition(100, 100); interactor.MouseMoveEvent(); interactor.LeftButtonReleaseEvent(); } session.setAttribute(countKey, count); } int[] size = renderWindow.GetSize(); vtkUnsignedCharArray pixelDataArray = new vtkUnsignedCharArray(); renderWindow.GetPixelData(0, 0, size[0] - 1, size[1] - 1, 1-renderWindow.GetDoubleBuffer(), pixelDataArray); // convert unsigned char to byte,note the range of each primitive type byte[] bytePixelData = pixelDataArray.GetJavaArray(); int[] RGBPixelData = new int[bytePixelData.length]; // convert byte to unsigned and stored in RGBPixelData array for (int i = 0; i < RGBPixelData.length; i++) { RGBPixelData[i] = bytePixelData[i] & 0xff; } int[] pixelData = new int[size[0] * size[1]]; int index = 0; int r, g, b; // The sequence of pixels is from left to right and from bottom to top, // so we need flip the RGB pixel // no A channel to avoid image distortion for (int row = size[1] - 1; row >= 0; row--) { for (int column = 0; column < size[0]; column++) { r = RGBPixelData[3 * (size[1] * row + column)]; g = RGBPixelData[3 * (size[1] * row + column) + 1]; b = RGBPixelData[3 * (size[1] * row + column) + 2]; if (r > 255) { r = 255; } if (r < 0) { r = 0; } if (g > 255) { g = 255; } if (g < 0) { g = 0; } if (b > 255) { b = 255; } if (b < 0) { b = 0; } pixelData[index] = ((r & 0xff) << 16) | ((g & 0xff) << 8) | ((b & 0xff)); index++; } } BufferedImage bi = new BufferedImage(size[0], size[1], BufferedImage.TYPE_INT_RGB); bi.getRaster().setDataElements(0, 0, size[0], size[1], pixelData); // get a ServletOutputStream for writing binary data ServletOutputStream so = resp.getOutputStream(); // This creates an instance of a JPEGImageEncoder // that can be used to encode image data as JPEG Data streams. JPEGImageEncoder jie = JPEGCodec.createJPEGEncoder(so); // Encode a BufferedImage as a JPEG data stream jie.encode(bi); so.flush(); } } The first request still can get the image, but the second request failed. After some debugging works, I hav found that the problem happeneded at the interactor.MouseMoveEvent() method which invokes the vtkRenderWindowInteractor::Render() method. I don't know why it crashed at this place. Is there something wrong with my java servlet code? I have been confused with this problem for several months. Looking forward to your reply! Best fishes! -- View this message in context: http://vtk.1045678.n5.nabble.com/Java-servlet-Glassfish-volume-rendering-applications-problem-tp5730017p5730190.html Sent from the VTK - Users mailing list archive at Nabble.com. From cameron.palmer at ntnu.no Wed Jan 21 02:00:20 2015 From: cameron.palmer at ntnu.no (Cameron Lowell Palmer) Date: Wed, 21 Jan 2015 07:00:20 +0000 Subject: [vtkusers] VTK 6.1 no longer supports ASCII characters > 128? (5.10.1 was ok) In-Reply-To: References: <54BE71D4.6010007@infolytica.com> <20150120160547.2004569427@mail.rogue-research.com> <54BE8A45.5050702@infolytica.com> <54BE934E.7090906@infolytica.com> <54BEAFDE.3060100@infolytica.com> Message-ID: Don?t forget to check any datasets handed to you that advertise as UTF-16 or UTF-8 because people may have injected mixed codings into the dataset. I?ve encountered that more than once. Really gets you with Norwegian characters ?,?, and ?. Always good to review on this ugly topic http://www.joelonsoftware.com/articles/Unicode.html http://htmlpurifier.org/docs/enduser-utf8.html On 20. jan. 2015, at 21.43, David Gobbi > wrote: On Tue, Jan 20, 2015 at 12:43 PM, Serge Lalonde > wrote: Your function ConvertLatin1ToUtf8() works great and now I can at least get the extended ASCII Latin1 encoded characters You must have noticed that I forgot to declare the string variable "s" in my function :) My app is actually using managed C++ to glue together the C# GUI with the C++ VTK. This works surprisingly well. The "problem" (if you can call it that) is that C# strings are stored internally in Unicode. Some of the text we'd like to display is not available in the Latin1 encoding (ex: special unit symbols). If I recall correctly, Windows uses UTF-16 as its native "unicode" encoding (always stored as wchar_t). So you need something to convert UTF-16 to UTF-8. Using vtkUnicodeString, the conversion will be a three-step process: 1) store the Windows unicode string in an "unsigned short" array 2) call from_utf16() to make a vtkUnicodeString 3) call utr8_str() to convert it to UTF--8 I hope this works. I've never tried it myself. - 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 Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From cameron.palmer at ntnu.no Wed Jan 21 06:32:04 2015 From: cameron.palmer at ntnu.no (Cameron Lowell Palmer) Date: Wed, 21 Jan 2015 11:32:04 +0000 Subject: [vtkusers] Changing the projection matrix Message-ID: <4C0A9E1B-AD7A-4158-9415-D78D03B1A627@ntnu.no> I?m trying to use VES/VTK in support of an Augmented Reality app on iOS and I need to provide a new projection matrix that I generated using the Camera Calibration. Is this not supported or do I have to completely bypass VTK and handle it in the shader? From ich_daniel at habmalnefrage.de Wed Jan 21 10:13:28 2015 From: ich_daniel at habmalnefrage.de (-Daniel-) Date: Wed, 21 Jan 2015 08:13:28 -0700 (MST) Subject: [vtkusers] How can I set points on a contourline? Message-ID: <1421853208985-5730196.post@n5.nabble.com> Hi, I want to set points on a vtkActor, which create with vtkCutter->vtkPolyDataMapper->vtkActor. The result is an actor as a line respectively contour. I thought it would be easy to solve by convert this actor in a vtkPolyData and then pick out the points. But this don't work. How can I set points on this actor-line? -- View this message in context: http://vtk.1045678.n5.nabble.com/How-can-I-set-points-on-a-contourline-tp5730196.html Sent from the VTK - Users mailing list archive at Nabble.com. From sebastien.jourdain at kitware.com Wed Jan 21 11:17:20 2015 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Wed, 21 Jan 2015 09:17:20 -0700 Subject: [vtkusers] Java servlet + Glassfish + volume rendering applications problem In-Reply-To: <1421819006962-5730190.post@n5.nabble.com> References: <1420686868240-5730017.post@n5.nabble.com> <1420768376754-5730037.post@n5.nabble.com> <1420795069171-5730042.post@n5.nabble.com> <1421819006962-5730190.post@n5.nabble.com> Message-ID: You might run into a concurrency issue. VTK is not thread safe, and the way Glassfish is handling servlet may result in concurrency. You did not notice it before because the rendering was faster in surface mode. But for volume rendering, the server side might already be in a Render() call when a new one occurs. On a side note, why don't you use VTK Web or ParaViewWeb? Seb On Tue, Jan 20, 2015 at 10:43 PM, Emptystack wrote: > My Java servlet code is as following: > > package com.hou.service; > > import java.awt.image.BufferedImage; > import java.io.File; > import java.io.FileInputStream; > import java.io.FileNotFoundException; > import java.io.FileOutputStream; > import java.io.IOException; > > import javax.imageio.ImageIO; > import javax.servlet.ServletException; > import javax.servlet.ServletOutputStream; > import javax.servlet.http.HttpServlet; > import javax.servlet.http.HttpServletRequest; > import javax.servlet.http.HttpServletResponse; > import javax.servlet.http.HttpSession; > > import com.hou.core.RenderContext; > import com.sun.image.codec.jpeg.JPEGCodec; > import com.sun.image.codec.jpeg.JPEGImageEncoder; > > import vtk.vtkActor; > import vtk.vtkConeSource; > import vtk.vtkJPEGWriter; > import vtk.vtkNativeLibrary; > import vtk.vtkPolyDataMapper; > import vtk.vtkRenderWindow; > import vtk.vtkRenderWindowInteractor; > import vtk.vtkRenderer; > import vtk.vtkUnsignedCharArray; > import vtk.vtkWindowToImageFilter; > > public class Image extends HttpServlet { > > /** > * > */ > private static final long serialVersionUID = 1L; > > // private RenderContext renderContext; > > // Load VTK library and print which library was not properly loaded > static { > if (!vtkNativeLibrary.LoadAllNativeLibraries()) { > for (vtkNativeLibrary lib : > vtkNativeLibrary.values()) { > if (!lib.IsLoaded()) { > > System.out.println(lib.GetLibraryName() + " not loaded"); > } else { > > System.out.println(lib.GetLibraryName() + " loaded"); > } > } > } else { > System.out.println("All Libraries are loaded"); > } > vtkNativeLibrary.DisableOutputWindow(null); > } > > @Override > protected void doGet(HttpServletRequest req, HttpServletResponse > resp) > throws ServletException, IOException { > // TODO Auto-generated method stub > // super.doGet(req, resp); > > HttpSession session = req.getSession(false); > > int count; > > vtkConeSource cone; > vtkPolyDataMapper mapper; > vtkActor actor; > vtkRenderer renderer; > vtkRenderWindow renderWindow; > vtkRenderWindowInteractor interactor; > > String countKey = "count"; > > String coneKey = "cone"; > String mapperKey = "mapper"; > String actorKey = "actor"; > String rendererKey = "renderer"; > String renderWindowKey = "renderWindow"; > String interactorKey = "interactor"; > > if (session == null) { > session = req.getSession(true); > > count = 0; > session.setAttribute(countKey, count); > > cone = new vtkConeSource(); > cone.SetHeight(3.0); > cone.SetRadius(1.0); > cone.SetResolution(10); > session.setAttribute(coneKey, cone); > > mapper = new vtkPolyDataMapper(); > mapper.SetInputConnection(cone.GetOutputPort()); > session.setAttribute(mapperKey, mapper); > > actor = new vtkActor(); > actor.SetMapper(mapper); > session.setAttribute(actorKey, actor); > > renderer = new vtkRenderer(); > renderer.AddActor(actor); > session.setAttribute(rendererKey, renderer); > > renderWindow = new vtkRenderWindow(); > renderWindow.SetSize(300, 300); > renderWindow.SetOffScreenRendering(1); > renderWindow.AddRenderer(renderer); > session.setAttribute(renderWindowKey, > renderWindow); > > interactor = new vtkRenderWindowInteractor(); > interactor.SetRenderWindow(renderWindow); > session.setAttribute(interactorKey, interactor); > > interactor.Initialize(); > interactor.Render(); > } else { > interactor = > (vtkRenderWindowInteractor)session.getAttribute(interactorKey); > renderWindow = > (vtkRenderWindow)session.getAttribute(renderWindowKey); > > count = (int)session.getAttribute(countKey); > count++; > if (count == 1) { > interactor.SetEventPosition(100, 100); > interactor.SetLastEventPosition(100, 100); > interactor.LeftButtonPressEvent(); > } > else { > interactor.LeftButtonPressEvent(); > interactor.SetEventPosition(110, 110); > interactor.SetLastEventPosition(100, 100); > interactor.MouseMoveEvent(); > } > session.setAttribute(countKey, count); > } > > int[] size = renderWindow.GetSize(); > > vtkUnsignedCharArray pixelDataArray = new > vtkUnsignedCharArray(); > > renderWindow.GetPixelData(0, 0, size[0] - 1, size[1] - 1, > 1-renderWindow.GetDoubleBuffer(), > pixelDataArray); > > // convert unsigned char to byte,note the range of each > primitive type > byte[] bytePixelData = pixelDataArray.GetJavaArray(); > > int[] RGBPixelData = new int[bytePixelData.length]; > > // convert byte to unsigned and stored in RGBPixelData > array > for (int i = 0; i < RGBPixelData.length; i++) { > RGBPixelData[i] = bytePixelData[i] & 0xff; > } > int[] pixelData = new int[size[0] * size[1]]; > > int index = 0; > int r, g, b; > > // The sequence of pixels is from left to right and from > bottom to top, > // so we need flip the RGB pixel > // no A channel to avoid image distortion > for (int row = size[1] - 1; row >= 0; row--) { > for (int column = 0; column < size[0]; column++) { > r = RGBPixelData[3 * (size[1] * row + > column)]; > g = RGBPixelData[3 * (size[1] * row + > column) + 1]; > b = RGBPixelData[3 * (size[1] * row + > column) + 2]; > > if (r > 255) { > r = 255; > } > if (r < 0) { > r = 0; > } > if (g > 255) { > g = 255; > } > if (g < 0) { > g = 0; > } > if (b > 255) { > b = 255; > } > if (b < 0) { > b = 0; > } > > pixelData[index] = ((r & 0xff) << 16) | > ((g & 0xff) << 8) | ((b & > 0xff)); > index++; > } > > } > BufferedImage bi = new BufferedImage(size[0], size[1], > BufferedImage.TYPE_INT_RGB); > bi.getRaster().setDataElements(0, 0, size[0], size[1], > pixelData); > > // get a ServletOutputStream for writing binary data > ServletOutputStream so = resp.getOutputStream(); > // This creates an instance of a JPEGImageEncoder > // that can be used to encode image data as JPEG Data > streams. > JPEGImageEncoder jie = JPEGCodec.createJPEGEncoder(so); > // Encode a BufferedImage as a JPEG data stream > jie.encode(bi); > > so.flush(); > } > } > > I used a simple cone to test the rotation. And after several requests the > cone can be rotated. So I replaced the code with the following volume > rendering code : > > package com.hou.service; > > import java.awt.image.BufferedImage; > import java.io.File; > import java.io.FileInputStream; > import java.io.FileNotFoundException; > import java.io.FileOutputStream; > import java.io.IOException; > > import javax.imageio.ImageIO; > import javax.servlet.ServletException; > import javax.servlet.ServletOutputStream; > import javax.servlet.http.HttpServlet; > import javax.servlet.http.HttpServletRequest; > import javax.servlet.http.HttpServletResponse; > import javax.servlet.http.HttpSession; > > import com.hou.auxiliary.VolumeMapperType; > import com.hou.convertor.DicomImageImport; > import com.hou.core.RenderContext; > import com.hou.prop.ViewProp; > import com.sun.image.codec.jpeg.JPEGCodec; > import com.sun.image.codec.jpeg.JPEGImageEncoder; > > import vtk.vtkActor; > import vtk.vtkColorTransferFunction; > import vtk.vtkConeSource; > import vtk.vtkDICOMImageReader; > import vtk.vtkGPUVolumeRayCastMapper; > import vtk.vtkImageData; > import vtk.vtkImageShiftScale; > import vtk.vtkJPEGWriter; > import vtk.vtkNativeLibrary; > import vtk.vtkPiecewiseFunction; > import vtk.vtkPlaneSource; > import vtk.vtkPolyDataMapper; > import vtk.vtkRenderWindow; > import vtk.vtkRenderWindowInteractor; > import vtk.vtkRenderer; > import vtk.vtkSmartVolumeMapper; > import vtk.vtkUnsignedCharArray; > import vtk.vtkVolume; > import vtk.vtkVolumeMapper; > import vtk.vtkVolumeProperty; > import vtk.vtkVolumeRayCastMIPFunction; > import vtk.vtkVolumeRayCastMapper; > import vtk.vtkWindowToImageFilter; > > public class Image extends HttpServlet { > > /** > * > */ > private static final long serialVersionUID = 1L; > > // private RenderContext renderContext; > > // Load VTK library and print which library was not properly loaded > static { > if (!vtkNativeLibrary.LoadAllNativeLibraries()) { > for (vtkNativeLibrary lib : > vtkNativeLibrary.values()) { > if (!lib.IsLoaded()) { > > System.out.println(lib.GetLibraryName() + " not loaded"); > } else { > > System.out.println(lib.GetLibraryName() + " loaded"); > } > } > } else { > System.out.println("All Libraries are loaded"); > } > vtkNativeLibrary.DisableOutputWindow(null); > } > > @Override > protected void doGet(HttpServletRequest req, HttpServletResponse > resp) > throws ServletException, IOException { > // TODO Auto-generated method stub > // super.doGet(req, resp); > > HttpSession session = req.getSession(false); > > int count; > > vtkDICOMImageReader reader; > vtkGPUVolumeRayCastMapper mapper; > vtkColorTransferFunction colorTransferFunction; > vtkPiecewiseFunction opacityFunction; > vtkVolumeProperty volumeProperty; > vtkVolume volume; > vtkRenderer renderer; > vtkRenderWindow renderWindow; > vtkRenderWindowInteractor interactor; > > String countKey = "count"; > > String readerKey = "reader"; > String colorTFKey = "colorTF"; > String opacityTFKey = "opacityTF"; > String mapperKey = "mapper"; > String volumePropertyKey = "volumeProperty"; > String volumeKey = "volume"; > String rendererKey = "renderer"; > String renderWindowKey = "renderWindow"; > String interactorKey = "interactor"; > > if (session == null) { > session = req.getSession(true); > > reader = new vtkDICOMImageReader(); > reader.SetDirectoryName("/home/garnett/image/CT"); > reader.Update(); > session.setAttribute(readerKey, reader); > > > colorTransferFunction = new > vtkColorTransferFunction(); > colorTransferFunction.AddRGBPoint(-3024, 0.0, 0.0, > 0.0); > colorTransferFunction.AddRGBPoint(42.9, 0.55, > 0.25, 0.15); > colorTransferFunction.AddRGBPoint(184.4, 0.92, > 0.64, 0.06); > colorTransferFunction.AddRGBPoint(277.64, 1.0, > 0.88, 0.62); > colorTransferFunction.AddRGBPoint(1430, 1.0, 0.99, > 0.95); > session.setAttribute(colorTFKey, > colorTransferFunction); > > opacityFunction = new vtkPiecewiseFunction(); > opacityFunction.AddPoint(-3024, 0.0); > opacityFunction.AddPoint(42.9, 0.0); > opacityFunction.AddPoint(163.5, 0.429); > opacityFunction.AddPoint(277.64, 0.777); > opacityFunction.AddPoint(1430, 0.758); > session.setAttribute(opacityTFKey, > opacityFunction); > > volumeProperty = new vtkVolumeProperty(); > volumeProperty.SetColor(colorTransferFunction); > volumeProperty.SetScalarOpacity(opacityFunction); > volumeProperty.SetInterpolationTypeToLinear(); > volumeProperty.ShadeOn(); > volumeProperty.SetAmbient(0.1); > volumeProperty.SetDiffuse(0.9); > volumeProperty.SetSpecular(0.2); > volumeProperty.SetSpecularPower(10.0); > > volumeProperty.SetScalarOpacityUnitDistance(0.8919); > session.setAttribute(volumePropertyKey, > volumeProperty); > > mapper = new vtkGPUVolumeRayCastMapper(); > mapper.SetBlendModeToComposite(); > mapper.SetInput(reader.GetOutput()); > mapper.Update(); > session.setAttribute(mapperKey, mapper); > > volume = new vtkVolume(); > volume.SetMapper(mapper); > volume.SetProperty(volumeProperty); > session.setAttribute(volumeKey, volume); > > count = 0; > session.setAttribute(countKey, count); > > renderer = new vtkRenderer(); > renderer.AddVolume(volume); > session.setAttribute(rendererKey, renderer); > > renderWindow = new vtkRenderWindow(); > renderWindow.SetSize(300, 300); > renderWindow.SetOffScreenRendering(1); > renderWindow.AddRenderer(renderer); > session.setAttribute(renderWindowKey, > renderWindow); > > interactor = new vtkRenderWindowInteractor(); > interactor.SetRenderWindow(renderWindow); > session.setAttribute(interactorKey, interactor); > > interactor.Initialize(); > interactor.Render(); > } else { > interactor = > (vtkRenderWindowInteractor)session.getAttribute(interactorKey); > renderWindow = > (vtkRenderWindow)session.getAttribute(renderWindowKey); > > count = (int)session.getAttribute(countKey); > count++; > if (count == 1) { > interactor.SetEventPosition(100, 100); > interactor.SetLastEventPosition(100, 100); > interactor.LeftButtonPressEvent(); > interactor.LeftButtonReleaseEvent(); > } > else { > interactor.LeftButtonPressEvent(); > interactor.SetEventPosition(110, 110); > interactor.SetLastEventPosition(100, 100); > interactor.MouseMoveEvent(); > interactor.LeftButtonReleaseEvent(); > } > session.setAttribute(countKey, count); > } > > int[] size = renderWindow.GetSize(); > > vtkUnsignedCharArray pixelDataArray = new > vtkUnsignedCharArray(); > > renderWindow.GetPixelData(0, 0, size[0] - 1, size[1] - 1, > 1-renderWindow.GetDoubleBuffer(), > pixelDataArray); > > // convert unsigned char to byte,note the range of each > primitive type > byte[] bytePixelData = pixelDataArray.GetJavaArray(); > > int[] RGBPixelData = new int[bytePixelData.length]; > > // convert byte to unsigned and stored in RGBPixelData > array > for (int i = 0; i < RGBPixelData.length; i++) { > RGBPixelData[i] = bytePixelData[i] & 0xff; > } > int[] pixelData = new int[size[0] * size[1]]; > > int index = 0; > int r, g, b; > > // The sequence of pixels is from left to right and from > bottom to top, > // so we need flip the RGB pixel > // no A channel to avoid image distortion > for (int row = size[1] - 1; row >= 0; row--) { > for (int column = 0; column < size[0]; column++) { > r = RGBPixelData[3 * (size[1] * row + > column)]; > g = RGBPixelData[3 * (size[1] * row + > column) + 1]; > b = RGBPixelData[3 * (size[1] * row + > column) + 2]; > > if (r > 255) { > r = 255; > } > if (r < 0) { > r = 0; > } > if (g > 255) { > g = 255; > } > if (g < 0) { > g = 0; > } > if (b > 255) { > b = 255; > } > if (b < 0) { > b = 0; > } > > pixelData[index] = ((r & 0xff) << 16) | > ((g & 0xff) << 8) | ((b & > 0xff)); > index++; > } > > } > BufferedImage bi = new BufferedImage(size[0], size[1], > BufferedImage.TYPE_INT_RGB); > bi.getRaster().setDataElements(0, 0, size[0], size[1], > pixelData); > > // get a ServletOutputStream for writing binary data > ServletOutputStream so = resp.getOutputStream(); > // This creates an instance of a JPEGImageEncoder > // that can be used to encode image data as JPEG Data > streams. > JPEGImageEncoder jie = JPEGCodec.createJPEGEncoder(so); > // Encode a BufferedImage as a JPEG data stream > jie.encode(bi); > > so.flush(); > } > > > } > > The first request still can get the image, but the second request failed. > After some debugging works, I hav found that the problem happeneded at the > interactor.MouseMoveEvent() method which invokes the > vtkRenderWindowInteractor::Render() method. I don't know why it crashed at > this place. Is there something wrong with my java servlet code? I have > been > confused with this problem for several months. > Looking forward to your reply! > Best fishes! > > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Java-servlet-Glassfish-volume-rendering-applications-problem-tp5730017p5730190.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 > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean at rogue-research.com Wed Jan 21 12:10:08 2015 From: sean at rogue-research.com (Sean McBride) Date: Wed, 21 Jan 2015 12:10:08 -0500 Subject: [vtkusers] VTK 6.1 no longer supports ASCII characters > 128? (5.10.1 was ok) In-Reply-To: <54BE71D4.6010007@infolytica.com> References: <54BE71D4.6010007@infolytica.com> Message-ID: <20150121171008.678812161@mail.rogue-research.com> On Tue, 20 Jan 2015 10:18:44 -0500, Serge Lalonde said: >I'm upgrading from VTK 5.10.1 to VTK 6.1. All went smoothly until I ran >into an error rendering a vtkScalarBarActor whose title was set to "J (A/m2)". Also, after a quick check, it seems there is nothing about these character encoding changes here: Anyone know more about which classes changes exactly? 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 Wed Jan 21 12:44:24 2015 From: berk.geveci at kitware.com (Berk Geveci) Date: Wed, 21 Jan 2015 12:44:24 -0500 Subject: [vtkusers] ANNOUNCE: Kitware is hiring Message-ID: Hi folks, We are looking to hire visualization developers to our Scientific Computing team. If you are a talented visualization researcher and developer with strong C++ skills, please consider applying. You will join a great team and work on many interesting and challenging technical problems - always aiming to deliver robust and widely used software solutions. For the full posting see: http://tinyurl.com/l8sgvzw JOB DESCRIPTION Kitware is seeking to hire highly skilled Research and Development Engineers (R&D Engineers) to join our Scientific Computing team and contribute to our scientific and information visualization efforts. Candidates will work to develop and improve leading visualization software solutions. Kitware collaborates on a multitude of basic and applied research and development projects. Our collaborators include the top universities from around the world, national research labs, medical device manufacturers, car manufacturers, oil and gas companies, financial institutes, and many others. The projects range from extending our open source C++ libraries and applications, such as VTK, ParaView, and CMake, to developing proprietary domain-specific vertical applications for a wide array of platforms including web and mobile devices. By joining our team you will participate in a dynamic work environment with exceptionally talented and friendly coworkers who are committed to high-quality development practices. You will collaborate with esteemed researchers from around the world by: * Designing and developing scalable data analysis and visualization tools for use by researchers and professionals from various domains; * Solving a wide array of problems ranging from developing distributed memory parallel algorithms for data analysis, optimizing distributed parallel codes to compiling and maintaining software on supercomputers. * Designing and developing tools to improve scientific data analysis workflows; * Contributing to and supporting our dynamic open source communities built around several of our open source tools. -------------- next part -------------- An HTML attachment was scrubbed... URL: From serge at infolytica.com Wed Jan 21 15:26:14 2015 From: serge at infolytica.com (Serge Lalonde) Date: Wed, 21 Jan 2015 15:26:14 -0500 Subject: [vtkusers] VTK 6.1 no longer supports ASCII characters > 128? (5.10.1 was ok) In-Reply-To: <20150121171008.678812161@mail.rogue-research.com> References: <54BE71D4.6010007@infolytica.com> <20150121171008.678812161@mail.rogue-research.com> Message-ID: <54C00B66.2080807@infolytica.com> An HTML attachment was scrubbed... URL: From malyushytsky at gmail.com Wed Jan 21 15:51:43 2015 From: malyushytsky at gmail.com (Alex Malyushytsky) Date: Wed, 21 Jan 2015 12:51:43 -0800 Subject: [vtkusers] QVtkWidgets problem with Qt::PaintOnScreen attribute and Aero Message-ID: I have multiple QVtkWidgets in QMDiArea in a tabbed view. I found that switching tabs with such QVtkWidgets shows garbage for a noticeable time if Aero scheme on Windows is set. Removing Qt::PaintOnScreen attribute from QVtkWidget fixes the problem. But even though I do not see any side effects that does not mean they do not exist. At the same time Qt 4.8.6 states that this flag is only supported on X11. SO questions are: - what can go wrong with having double buffering of QVtkWidget? - Is there any other way to remove flickering during resize? Best regards, Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From beekmaarten at yahoo.com Wed Jan 21 16:16:12 2015 From: beekmaarten at yahoo.com (Maarten Beek) Date: Wed, 21 Jan 2015 21:16:12 +0000 (UTC) Subject: [vtkusers] vtkLODProp3D problem Message-ID: <2133148078.2822795.1421874972222.JavaMail.yahoo@jws10031.mail.ne1.yahoo.com> Hi all, I am trying to use the vtkLODProp3D class, but I cannot seem to get it to work. Is the appropriate level only selected when I rotate the camera around the object or interact with the object itself? I am interacting one actor which triggers an update in the pipeline of another actor. This is slow so I want to have different resolution levels in the pipeline that gets updated. The coarsest resolution would just be a bounding box, which would not update the pipeline at all. Thanks Maarten -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Wed Jan 21 16:22:47 2015 From: dave.demarle at kitware.com (David E DeMarle) Date: Wed, 21 Jan 2015 16:22:47 -0500 Subject: [vtkusers] VTK 6.1 no longer supports ASCII characters > 128? (5.10.1 was ok) In-Reply-To: <54C00B66.2080807@infolytica.com> References: <54BE71D4.6010007@infolytica.com> <20150121171008.678812161@mail.rogue-research.com> <54C00B66.2080807@infolytica.com> Message-ID: Thanks for posting a solution to the list Serge! Mind adding a note on the vtk wiki about it so this tidbit doesn't get forgotten? A short note containing a markmail url to your post somewhere on http://www.vtk.org/Wiki/VTK/Roadmap around the 6.0 transition pages will suffice. David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Wed, Jan 21, 2015 at 3:26 PM, Serge Lalonde wrote: > Dear VTK Users, > > So I finally got it working. Many thanks to all who replied, particularly > David Gobbi. > Here's the summary so that anyone trying to do this in the future will > find it easier. > > To pass a Unicode C++/CLI .NET string from a String^ to a VTK 6.1 UTF-8 > encoded string for display: > > m_VTKScalarBarActor->SetTitle(*vtkUnicodeString**::**from_utf16**((**const* *vtkTypeUInt16** *) **marshal_as**<**std**::**wstring**>(**colormap_title**).**c_str**()).**utf8_str**()*); > > Basically, marshal the .NET String^ to a std::wstring to get it in UCS-2 > Unicode for C++, cast its contents to vtkUInt16* (small cheat here, but VTK > or the UTF-8 lib should accept wchar_t* instead) and then pass that to > vtkUnicodeString which will convert it to UTF-8. Phew! > > Note that this also requires that the vtkTextProperty of the text being > drawn (in this case the Title of the vtkScalarBarActor) also needs to have > it's font family set to VTK_FONT_FILE and the font file must point to a > valid font: > > m_VTKScalarBarActor->GetTitleTextProperty()->SetFontFamily(VTK_FONT_FILE); > m_VTKScalarBarActor->GetTitleTextProperty()->SetFontFile("C:\\Windows\\winsxs\\amd64_microsoft-windows-font-truetype-arial_31bf3856ad364e35_6.1.7601.18528_none_d0a29012c3ff391b\\arial.ttf"); > > You can use system TTF files (like I did here) or free ones, like DejaVu > fonts. I'm still looking at how to get the font file automatically, since > this was used as a test, I just searched my C:\Windows folder to find an > Arial font to try out. I'll post again once I get this working. Note that I > did actually test the DejaVu fonts and they worked. > > If, on the other hand, you're happy with Latin1 encoded characters, you > can do this instead: > > m_VTKScalarBarActor->SetTitle(marshal_as(System::Text::Encoding::GetEncoding("ISO-8859-1")->GetString(System::Text::Encoding::UTF8->GetBytes(colormap_title))).c_str()); > > This can display fewer characters, but doesn't require that the font > family and font file be set. > > The same must be done to handle file names coming from a user in case it > also contains Unicode characters: > > pWriter->SetFileName(vtkUnicodeString::from_utf16((const vtkTypeUInt16 *) marshal_as(file_path).c_str()).utf8_str()); > > Unfortunately, the writers (and probably the readers) still use fopen() in > the internal code which can't handle UTF-8 encoded filenames. > So a filename like "C:\Users\serge\Desktop\Test ? ? ? ?.png" becomes > "C:\Users\serge\Desktop\Test ?? ?? ?? ? .png". Not great, but if you ignore > the conversion, you get errors and the file isn't written for writers or > (presumably) read for readers (you get Debug messages in the error > console). So it's still better to do the conversion and it will be ready > when this is improved in VTK. BTW, is this on the roadmap to be fixed? > > I hope that this will help others in the future. > -- > www.infolytica.com > 300 Leo Pariseau, Suite 2222, Montreal, QC, Canada, H2X 4B3 > (514) 849-8752 x236, Fax: (514) 849-4239 > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean at rogue-research.com Wed Jan 21 17:16:55 2015 From: sean at rogue-research.com (Sean McBride) Date: Wed, 21 Jan 2015 17:16:55 -0500 Subject: [vtkusers] VTK 6.1 no longer supports ASCII characters > 128? (5.10.1 was ok) In-Reply-To: <54C00B66.2080807@infolytica.com> References: <54BE71D4.6010007@infolytica.com> <20150121171008.678812161@mail.rogue-research.com> <54C00B66.2080807@infolytica.com> Message-ID: <20150121221655.2060156803@mail.rogue-research.com> On Wed, 21 Jan 2015 15:26:14 -0500, Serge Lalonde said: >The same must be done to handle file names coming from a user in case it >also contains Unicode characters: >???pWriter->SetFileName(vtkUnicodeStr >ing::from_utf16((const?vtkTypeUInt16? >*)?marshal_as(file_path).c_str()).utf8_str()); >Unfortunately, the writers (and probably the readers) still use fopen() >in the internal code which can't handle UTF-8 encoded filenames. Using fopen() isn't a problem. The question is: what character encoding does fopen() expect? Remember, it's char* parameter tells us _nothing_ about the expected encoding, it could expect ASCII, Latin1, UTF-8, UTF-16, or anything else. Only the documentation can tell us. And it could expect different things on different platforms. :( On probably all modern UNIX variants, it expects UTF-8. On Windows, it might expect something else, you'd have to check Microsoft's docs. From VTK's perspective, this means that the path argument expected by readers and writers should be in whatever encoding the host OS expects for APIs like fopen(). I can confirm for example that the vtkSTLReader on OS X can open filenames with emoji and other crazy stuff just fine. 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 david.gobbi at gmail.com Wed Jan 21 17:45:27 2015 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 21 Jan 2015 15:45:27 -0700 Subject: [vtkusers] VTK 6.1 no longer supports ASCII characters > 128? (5.10.1 was ok) In-Reply-To: <20150121221655.2060156803@mail.rogue-research.com> References: <54BE71D4.6010007@infolytica.com> <20150121171008.678812161@mail.rogue-research.com> <54C00B66.2080807@infolytica.com> <20150121221655.2060156803@mail.rogue-research.com> Message-ID: On Wed, Jan 21, 2015 at 3:16 PM, Sean McBride wrote: > On Wed, 21 Jan 2015 15:26:14 -0500, Serge Lalonde said: > > >Unfortunately, the writers (and probably the readers) still use fopen() > >in the internal code which can't handle UTF-8 encoded filenames. > > Using fopen() isn't a problem. > > The question is: what character encoding does fopen() expect? Remember, > it's char* parameter tells us _nothing_ about the expected encoding, it > could expect ASCII, Latin1, UTF-8, UTF-16, or anything else. Only the > documentation can tell us. And it could expect different things on > different platforms. :( > > On probably all modern UNIX variants, it expects UTF-8. On Windows, it > might expect something else, you'd have to check Microsoft's docs. > On Windows it depends on the country where you bought your copy of Windows. It can be configured, too, but hardly anyone does that. Windows provides UTF-16 variants for all functions, e.g. _wfopen(). In order to properly support Unicode on Windows, VTK should be using an adapter function that converts UTF-8 to UTF-16 and then calls _wfopen(). On UNIX, the adapter should ideally check the locale and do conversion if necessary. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From wulihouxiaoshuai at 163.com Wed Jan 21 20:39:56 2015 From: wulihouxiaoshuai at 163.com (Emptystack) Date: Wed, 21 Jan 2015 18:39:56 -0700 (MST) Subject: [vtkusers] Java servlet + Glassfish + volume rendering applications problem In-Reply-To: References: <1420686868240-5730017.post@n5.nabble.com> <1420768376754-5730037.post@n5.nabble.com> <1420795069171-5730042.post@n5.nabble.com> <1421819006962-5730190.post@n5.nabble.com> Message-ID: <1421890796578-5730207.post@n5.nabble.com> I only know a little about paraviewweb, Do you have some links about VTK-web or paraviewweb? Many Thanks! -- View this message in context: http://vtk.1045678.n5.nabble.com/Java-servlet-Glassfish-volume-rendering-applications-problem-tp5730017p5730207.html Sent from the VTK - Users mailing list archive at Nabble.com. From ich_daniel at habmalnefrage.de Thu Jan 22 04:06:05 2015 From: ich_daniel at habmalnefrage.de (-Daniel-) Date: Thu, 22 Jan 2015 02:06:05 -0700 (MST) Subject: [vtkusers] vtk to stl -> code is working, but with error mesage. why? In-Reply-To: <3234526.RlDfkNgohZ@poppermobil2.site> References: <3234526.RlDfkNgohZ@poppermobil2.site> Message-ID: <1421917565721-5730208.post@n5.nabble.com> Hi Andy, Maybe you try this (Java-Code): / vtkCleanPolyData clean = new vtkCleanPolyData(); clean.SetInputConnection(vtkreader.GetOutputPort()); vtkTriangleFilter triangles = new vtkTriangleFilter(); triangles.SetInputConnection(clean.GetOutputPort()); vtkSTLWriter writer = new vtkSTLWriter(); writer.SetInputConnection(triangles.GetOutputPort()); writer.SetFileName(file); writer.SetFileTypeToASCII(); writer.Write(); writer.Update(); / Of course you must convert this code to C++. ;) -- View this message in context: http://vtk.1045678.n5.nabble.com/Re-vtk-to-stl-code-is-working-but-with-error-mesage-why-tp5730175p5730208.html Sent from the VTK - Users mailing list archive at Nabble.com. From p.neher at dkfz-heidelberg.de Thu Jan 22 06:45:22 2015 From: p.neher at dkfz-heidelberg.de (Peter Neher) Date: Thu, 22 Jan 2015 12:45:22 +0100 Subject: [vtkusers] Render a lot of polylines Message-ID: <54C0E2D2.5020104@dkfz-heidelberg.de> Hi everyone, I want to render a lot of polylines. A lot here means about 50k to 1000k lines. Currently I use a huge polydata to render the lines, but this is rather slow. Does anyone know if there is a more efficient way to render such a large amount of polylines? Thank you for any advice! Cheers Peter From ich_daniel at habmalnefrage.de Thu Jan 22 07:38:31 2015 From: ich_daniel at habmalnefrage.de (-Daniel-) Date: Thu, 22 Jan 2015 05:38:31 -0700 (MST) Subject: [vtkusers] How can I set points on a contourline? In-Reply-To: <1421853208985-5730196.post@n5.nabble.com> References: <1421853208985-5730196.post@n5.nabble.com> Message-ID: <1421930311683-5730210.post@n5.nabble.com> It's solved. I use a second cut and calculate the points on the cross of both cuts. Then I changed the position of the plane and I get the next points. Not ideal but it works. -- View this message in context: http://vtk.1045678.n5.nabble.com/How-can-I-set-points-on-a-contourline-tp5730196p5730210.html Sent from the VTK - Users mailing list archive at Nabble.com. From sebastien.jourdain at kitware.com Thu Jan 22 14:42:17 2015 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Thu, 22 Jan 2015 12:42:17 -0700 Subject: [vtkusers] Java servlet + Glassfish + volume rendering applications problem In-Reply-To: <1421890796578-5730207.post@n5.nabble.com> References: <1420686868240-5730017.post@n5.nabble.com> <1420768376754-5730037.post@n5.nabble.com> <1420795069171-5730042.post@n5.nabble.com> <1421819006962-5730190.post@n5.nabble.com> <1421890796578-5730207.post@n5.nabble.com> Message-ID: This should be the official link http://www.paraview.org/ParaView3/Doc/Nightly/www/js-doc/index.html#!/guide But we still have to figure out why our automate process for generating and publishing that documentation fails once in a while. As backup, you can go here: http://pvw.kitware.com/#!/guide On Wed, Jan 21, 2015 at 6:39 PM, Emptystack wrote: > I only know a little about paraviewweb, Do you have some links about > VTK-web > or paraviewweb? > Many Thanks! > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Java-servlet-Glassfish-volume-rendering-applications-problem-tp5730017p5730207.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 > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From serge at infolytica.com Thu Jan 22 15:04:19 2015 From: serge at infolytica.com (Serge Lalonde) Date: Thu, 22 Jan 2015 15:04:19 -0500 Subject: [vtkusers] VTK 6.1 no longer supports ASCII characters > 128? (5.10.1 was ok) In-Reply-To: <54C00B66.2080807@infolytica.com> References: <54BE71D4.6010007@infolytica.com> <20150121171008.678812161@mail.rogue-research.com> <54C00B66.2080807@infolytica.com> Message-ID: <54C157C3.9050805@infolytica.com> An HTML attachment was scrubbed... URL: From beekmaarten at yahoo.com Thu Jan 22 18:26:37 2015 From: beekmaarten at yahoo.com (Maarten Beek) Date: Thu, 22 Jan 2015 23:26:37 +0000 (UTC) Subject: [vtkusers] vtkLODProp3D problem In-Reply-To: <2133148078.2822795.1421874972222.JavaMail.yahoo@jws10031.mail.ne1.yahoo.com> References: <2133148078.2822795.1421874972222.JavaMail.yahoo@jws10031.mail.ne1.yahoo.com> Message-ID: <1701678663.3229433.1421969197639.JavaMail.yahoo@jws100211.mail.ne1.yahoo.com> The progress I have made so far is that I think that the vtkLODProp3D class only considers the render time in its decision making. I don't think that rendering is the bottle neck in my application. So now my question is: how can I determine the time it takes to update the entire pipeline. So from the render call in the actor that propagates all these update requests down the pipeline until the eventual update of the input of this actor (i.e until its mapper is up-to-date)? Thanks - Maarten On Wednesday, January 21, 2015 5:34 PM, Maarten Beek via vtkusers wrote: Hi all, I am trying to use the vtkLODProp3D class, but I cannot seem to get it to work. Is the appropriate level only selected when I rotate the camera around the object or interact with the object itself? I am interacting one actor which triggers an update in the pipeline of another actor. This is slow so I want to have different resolution levels in the pipeline that gets updated. The coarsest resolution would just be a bounding box, which would not update the pipeline at all. 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 Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From malyushytsky at gmail.com Thu Jan 22 22:14:38 2015 From: malyushytsky at gmail.com (Alex Malyushytsky) Date: Thu, 22 Jan 2015 19:14:38 -0800 Subject: [vtkusers] QVtkWidgets problem with Qt::PaintOnScreen attribute and Aero In-Reply-To: References: Message-ID: QGLWidget produces the same behavior. It looks like QMdiArea approach to handle subwindows even in tabbed view mode requires double buffering to work properly. Otherwise all widgets with transparency ( using Aero ) display garbage when become active. At this point I could not find any solution to fix it other than removing Qt::PaintOnScreen attribute. Any suggestions? Best regards, Alex On Wed, Jan 21, 2015 at 12:51 PM, Alex Malyushytsky wrote: > I have multiple QVtkWidgets in QMDiArea in a tabbed view. > I found that switching tabs with such QVtkWidgets shows garbage for a > noticeable time if Aero scheme on Windows is set. > Removing Qt::PaintOnScreen attribute from QVtkWidget fixes the problem. > But even though I do not see any side effects that does not mean they do > not exist. > At the same time Qt 4.8.6 states that this flag is only supported on X11. > > SO questions are: > - what can go wrong with having double buffering of QVtkWidget? > - Is there any other way to remove flickering during resize? > > Best regards, > Alex > -------------- next part -------------- An HTML attachment was scrubbed... URL: From malyushytsky at gmail.com Thu Jan 22 22:17:28 2015 From: malyushytsky at gmail.com (Alex Malyushytsky) Date: Thu, 22 Jan 2015 19:17:28 -0800 Subject: [vtkusers] Render a lot of polylines In-Reply-To: <54C0E2D2.5020104@dkfz-heidelberg.de> References: <54C0E2D2.5020104@dkfz-heidelberg.de> Message-ID: I do not know the way to improve it. Placing them in different polydaty only can make it slower. On Thu, Jan 22, 2015 at 3:45 AM, Peter Neher wrote: > Hi everyone, > > I want to render a lot of polylines. A lot here means about 50k to 1000k > lines. Currently I use a huge polydata to render the lines, but this is > rather slow. Does anyone know if there is a more efficient way to render > such a large amount of polylines? Thank you for any advice! > > Cheers > Peter > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From maaschn at web.de Fri Jan 23 01:36:12 2015 From: maaschn at web.de (maaschn) Date: Thu, 22 Jan 2015 23:36:12 -0700 (MST) Subject: [vtkusers] crash because of renderevent while writing vertices Message-ID: <1421994972386-5730218.post@n5.nabble.com> Hello, i have got a process which is aquiring point data with a scanner. I am writing this data pointwise into a polydata by using pid[0]=_points->InsertNextPoint (point[0],point[1],point[2]); _vertices->InsertNextCell(1,pid); If I dont trigger a rerendering the process is working fine. But If I want to observe the aquisition process and move the scene my application crashes in the vtkCellArray because of a unvalid cell id while computing the bounds of the object or while getting the next cell. This is only happening sporadically after a random time. This is a strange behaviour because i am not doing the aquisition in a parallel thread so I dont understand why the id is not valid . Has anybody an idea why my application crashes? -- View this message in context: http://vtk.1045678.n5.nabble.com/crash-because-of-renderevent-while-writing-vertices-tp5730218.html Sent from the VTK - Users mailing list archive at Nabble.com. From p.neher at dkfz-heidelberg.de Fri Jan 23 02:56:24 2015 From: p.neher at dkfz-heidelberg.de (Peter Neher) Date: Fri, 23 Jan 2015 08:56:24 +0100 Subject: [vtkusers] Render a lot of polylines In-Reply-To: References: <54C0E2D2.5020104@dkfz-heidelberg.de> Message-ID: <54C1FEA8.3080202@dkfz-heidelberg.de> I thought about maybe using glyph3d. Don't know if this is faster or even possible. On 23.01.2015 04:17, Alex Malyushytsky wrote: > I do not know the way to improve it. > Placing them in different polydaty only can make it slower. > > On Thu, Jan 22, 2015 at 3:45 AM, Peter Neher > > wrote: > > Hi everyone, > > I want to render a lot of polylines. A lot here means about 50k to > 1000k lines. Currently I use a huge polydata to render the lines, > but this is rather slow. Does anyone know if there is a more > efficient way to render such a large amount of polylines? Thank > you for any advice! > > Cheers > Peter > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -- Dr. sc. hum. Peter F. Neher Division Medical and Biological Informatics Junior Group Medical Image Computing (MIC) German Cancer Research Center (DKFZ) Im Neuenheimer Feld 280 69120 Heidelberg Germany phone: +49 6221 42-3552 fax: +49 6221 42-2345 p.neher at dkfz.de http://www.dkfz.de/de/mbi/people/Peter_Neher.html Confidentiality Note: This message is intended only for the use of the named recipient(s) and may obtain confidential and/or privileged information. If you are not the intended recipient, please contact the sender and delete the message. Any unauthorized use of the information contained in this message is prohibited. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcplatt at dsl.pipex.com Fri Jan 23 04:55:17 2015 From: jcplatt at dsl.pipex.com (John Platt) Date: Fri, 23 Jan 2015 09:55:17 +0000 Subject: [vtkusers] QVtkWidgets problem with Qt::PaintOnScreen attribute and Aero In-Reply-To: References: Message-ID: <54C21A85.50107@dsl.pipex.com> Hi Alex, I have the same problem but regrettably no solution. When I switch tabs, tabs to the left are shown first then the active tab is drawn twice; firstly the image shifted to the top left and then finally in the correct position. I don't see garbage, just the hidden tabs. Others have also reported thishttps://bugreports.qt.io/browse/QTBUG-21077 Best regards John. On 23/01/2015 03:14, Alex Malyushytsky wrote: > QGLWidget produces the same behavior. It looks like QMdiArea approach > to handle subwindows even in tabbed view mode requires double > buffering to work properly. > Otherwise all widgets with transparency ( using Aero ) display garbage > when become active. > At this point I could not find any solution to fix it other than > removing Qt::PaintOnScreen attribute. > > Any suggestions? > Best regards, > Alex > > > > On Wed, Jan 21, 2015 at 12:51 PM, Alex Malyushytsky > > wrote: > > I have multiple QVtkWidgets in QMDiArea in a tabbed view. > I found that switching tabs with such QVtkWidgets shows garbage > for a noticeable time if Aero scheme on Windows is set. > Removing Qt::PaintOnScreen attribute from QVtkWidget fixes the > problem. > But even though I do not see any side effects that does not mean > they do not exist. > At the same time Qt 4.8.6 states that this flag is only supported > on X11. > > SO questions are: > - what can go wrong with having double buffering of QVtkWidget? > - Is there any other way to remove flickering during resize? > > Best regards, > Alex > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Fri Jan 23 10:40:29 2015 From: dave.demarle at kitware.com (David E DeMarle) Date: Fri, 23 Jan 2015 10:40:29 -0500 Subject: [vtkusers] Do you want your application mentioned on the vtk website? Message-ID: Greetings folks, If you've got an application that uses VTK, and you would like us to mention it on the VTK website, please drop an email to comm at kitware.com and cc me. I am asking because we are updating the VTK website, like we've already done for ParaView and CMake, and I am looking for candidates in the replacement for venerable http://vtk.org/VTK/project/casestudies.html and http://vtk.org/VTK/resources/applications.html. thanks! 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 luislacerda1989 at gmail.com Mon Jan 26 06:26:59 2015 From: luislacerda1989 at gmail.com (Luis Lacerda) Date: Mon, 26 Jan 2015 11:26:59 +0000 Subject: [vtkusers] Installing VTK on mac OSX Yosemite 10.10.1 Message-ID: Dear all, I have been trying to install VTK (version 6.0.0) in my mac for a while and unsuccessfully ... I have attached the error that I cannot get rid of (it stops at 81% when I am compiling): ld: 68 duplicate symbols for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [bin/vtkIOAMRCxxTests.app/Contents/MacOS/vtkIOAMRCxxTests] Error 1 make[1]: *** [IO/AMR/Testing/Cxx/CMakeFiles/vtkIOAMRCxxTests.dir/all] Error 2 make: *** [all] Error 2 ? I am not entirely sure of what parameters I have to change in the configuration file , prior to compilation.. Furthermore, if you have any comments / instructions on how to install vtk on a mac with OSX Yosemite 10.10.1 I would be very much appreciated. Thank you very much in advance, Best regards, Luis Lacerda -------------- next part -------------- An HTML attachment was scrubbed... URL: From cameron.palmer at ntnu.no Mon Jan 26 07:29:21 2015 From: cameron.palmer at ntnu.no (Cameron Lowell Palmer) Date: Mon, 26 Jan 2015 12:29:21 +0000 Subject: [vtkusers] vtkImageData Reflection Message-ID: <8095F680-E195-48CC-803A-A3DB1655F18D@ntnu.no> When receiving a camera frame I?m converting to vtkImageData like this: auto imageImport = vtkSmartPointer::New(); imageImport->SetDataSpacing(1.0f, 1.0f, 1.0f); imageImport->SetDataOrigin(0.f, 0.f, 0.f); imageImport->SetWholeExtent(0.f, videoFrame.width - 1.f, 0.f, videoFrame.height - 1.f, 0.f, 0.f); imageImport->SetDataExtentToWholeExtent(); imageImport->SetDataScalarTypeToUnsignedChar(); imageImport->SetNumberOfScalarComponents(4); imageImport->SetImportVoidPointer(videoFrame.rawPixelData); imageImport->Update(); vtkSmartPointer imageData = imageImport->GetOutput(); It works, but adding this to an image plane the image is mirrored across the Y-axis (right-left). Am I doing this image conversion correctly? cameron -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Mon Jan 26 08:45:17 2015 From: cory.quammen at kitware.com (Cory Quammen) Date: Mon, 26 Jan 2015 08:45:17 -0500 Subject: [vtkusers] vtkImageData Reflection In-Reply-To: <8095F680-E195-48CC-803A-A3DB1655F18D@ntnu.no> References: <8095F680-E195-48CC-803A-A3DB1655F18D@ntnu.no> Message-ID: Cameron, It looks like your camera's convention for image origin and VTK's disagree. You could correct it in the display by scaling the reversed axis of the actor that displays the image by -1, or you can flip the data after import with a vtkImageFlip filiter. HTH, Cory On Mon, Jan 26, 2015 at 7:29 AM, Cameron Lowell Palmer < cameron.palmer at ntnu.no> wrote: > When receiving a camera frame I?m converting to vtkImageData like this: > > auto imageImport = vtkSmartPointer::New(); > imageImport->SetDataSpacing(1.0f, 1.0f, 1.0f); > imageImport->SetDataOrigin(0.f, 0.f, 0.f); > imageImport->SetWholeExtent(0.f, videoFrame.width - 1.f, 0.f, > videoFrame.height - 1.f, 0.f, 0.f); > imageImport->SetDataExtentToWholeExtent(); > imageImport->SetDataScalarTypeToUnsignedChar(); > imageImport->SetNumberOfScalarComponents(4); > imageImport->SetImportVoidPointer(videoFrame.rawPixelData); > imageImport->Update(); > > vtkSmartPointer imageData = imageImport->GetOutput(); > > It works, but adding this to an image plane the image is mirrored across > the Y-axis (right-left). Am I doing this image conversion correctly? > > cameron > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -- Cory Quammen R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cameron.palmer at ntnu.no Mon Jan 26 08:49:35 2015 From: cameron.palmer at ntnu.no (Cameron Lowell Palmer) Date: Mon, 26 Jan 2015 13:49:35 +0000 Subject: [vtkusers] vtkImageData Reflection In-Reply-To: References: <8095F680-E195-48CC-803A-A3DB1655F18D@ntnu.no> Message-ID: On a scale of 1 to supremely bad idea, how about flipping the location of the camera and view up? I did precisely that by making the camera face the positive z-axis, this also required me to flip the Y-Axis by changing the view up. I thought the issue was that the camera facing the negative z-axis and therefore was seeing the backside of the image. cameron From: Cory Quammen > Date: mandag 26. januar 2015 14.45 To: Cameron Lowell Palmer > Cc: VTK Users > Subject: Re: [vtkusers] vtkImageData Reflection Cameron, It looks like your camera's convention for image origin and VTK's disagree. You could correct it in the display by scaling the reversed axis of the actor that displays the image by -1, or you can flip the data after import with a vtkImageFlip filiter. HTH, Cory On Mon, Jan 26, 2015 at 7:29 AM, Cameron Lowell Palmer > wrote: When receiving a camera frame I?m converting to vtkImageData like this: auto imageImport = vtkSmartPointer::New(); imageImport->SetDataSpacing(1.0f, 1.0f, 1.0f); imageImport->SetDataOrigin(0.f, 0.f, 0.f); imageImport->SetWholeExtent(0.f, videoFrame.width - 1.f, 0.f, videoFrame.height - 1.f, 0.f, 0.f); imageImport->SetDataExtentToWholeExtent(); imageImport->SetDataScalarTypeToUnsignedChar(); imageImport->SetNumberOfScalarComponents(4); imageImport->SetImportVoidPointer(videoFrame.rawPixelData); imageImport->Update(); vtkSmartPointer imageData = imageImport->GetOutput(); It works, but adding this to an image plane the image is mirrored across the Y-axis (right-left). Am I doing this image conversion correctly? cameron _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -- Cory Quammen R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Mon Jan 26 08:53:37 2015 From: cory.quammen at kitware.com (Cory Quammen) Date: Mon, 26 Jan 2015 08:53:37 -0500 Subject: [vtkusers] vtkImageData Reflection In-Reply-To: References: <8095F680-E195-48CC-803A-A3DB1655F18D@ntnu.no> Message-ID: I don't know if that's a supremely bad idea, but it may make life complicated if you want to display anything else besides the image :-) It might be safest to just flip the image with the vtkImageFlip filter or flip the order of pixels in the incoming image yourself. On Mon, Jan 26, 2015 at 8:49 AM, Cameron Lowell Palmer < cameron.palmer at ntnu.no> wrote: > On a scale of 1 to supremely bad idea, how about flipping the location > of the camera and view up? > > I did precisely that by making the camera face the positive z-axis, this > also required me to flip the Y-Axis by changing the view up. I thought the > issue was that the camera facing the negative z-axis and therefore was > seeing the backside of the image. > > cameron > > From: Cory Quammen > Date: mandag 26. januar 2015 14.45 > To: Cameron Lowell Palmer > Cc: VTK Users > Subject: Re: [vtkusers] vtkImageData Reflection > > Cameron, > > It looks like your camera's convention for image origin and VTK's > disagree. You could correct it in the display by scaling the reversed axis > of the actor that displays the image by -1, or you can flip the data after > import with a vtkImageFlip filiter. > > HTH, > Cory > > On Mon, Jan 26, 2015 at 7:29 AM, Cameron Lowell Palmer < > cameron.palmer at ntnu.no> wrote: > >> When receiving a camera frame I?m converting to vtkImageData like this: >> >> auto imageImport = vtkSmartPointer::New(); >> imageImport->SetDataSpacing(1.0f, 1.0f, 1.0f); >> imageImport->SetDataOrigin(0.f, 0.f, 0.f); >> imageImport->SetWholeExtent(0.f, videoFrame.width - 1.f, 0.f, >> videoFrame.height - 1.f, 0.f, 0.f); >> imageImport->SetDataExtentToWholeExtent(); >> imageImport->SetDataScalarTypeToUnsignedChar(); >> imageImport->SetNumberOfScalarComponents(4); >> imageImport->SetImportVoidPointer(videoFrame.rawPixelData); >> imageImport->Update(); >> >> vtkSmartPointer imageData = imageImport->GetOutput(); >> >> It works, but adding this to an image plane the image is mirrored >> across the Y-axis (right-left). Am I doing this image conversion correctly? >> >> cameron >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> > > > -- > Cory Quammen > R&D Engineer > Kitware, Inc. > -- Cory Quammen R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean at rogue-research.com Mon Jan 26 13:16:22 2015 From: sean at rogue-research.com (Sean McBride) Date: Mon, 26 Jan 2015 13:16:22 -0500 Subject: [vtkusers] Installing VTK on mac OSX Yosemite 10.10.1 In-Reply-To: References: Message-ID: <20150126181622.431333295@mail.rogue-research.com> On Mon, 26 Jan 2015 11:26:59 +0000, Luis Lacerda said: >Dear all, > >I have been trying to install VTK (version 6.0.0) in my mac for a while and >unsuccessfully ... I have attached the error that I cannot get rid of (it >stops at 81% when I am compiling): > >ld: 68 duplicate symbols for architecture x86_64 >clang: error: linker command failed with exit code 1 (use -v to see >invocation) >make[2]: *** [bin/vtkIOAMRCxxTests.app/Contents/MacOS/vtkIOAMRCxxTests] >Error 1 >make[1]: *** [IO/AMR/Testing/Cxx/CMakeFiles/vtkIOAMRCxxTests.dir/all] Error >2 >make: *** [all] Error 2 >? There's no much info there... what are the 68 duplicate symbols? >Furthermore, if you have any comments / instructions on how to install vtk on >a mac with OSX Yosemite 10.10.1 I would be very much appreciated. I'm not sure about 6.0 exactly, but git master builds fine with 10.10. You might try that instead. 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 alok.theanomaly at gmail.com Mon Jan 26 14:58:30 2015 From: alok.theanomaly at gmail.com (junior) Date: Mon, 26 Jan 2015 12:58:30 -0700 (MST) Subject: [vtkusers] Bugs in vtkAngleWidget Message-ID: <1422302310859-5730230.post@n5.nabble.com> Hello, I am using the vtkAngleWidget in a vtkRenderWindow and noticed a couple of bugs. the code goes like this vtkSmartPointer angleWidget = vtkAngleWidget::New(); angleWidget ->SetInteractor(winIntr); angleWidget ->SetRepresentation(angleWidgetRep); angleWidget ->CreateDefaultRepresentation(); // point1 : Vertical Axis double p1[3] = {0, 0, 40}; angleWidgetRep->GetPoint1Representation()->SetWorldPosition(p1); angleWidgetRep->GetPoint1Representation()->SetHandleSize(0.1); angleWidgetRep->GetRay1()->GetPosition2Coordinate()->SetValue(p1); angleWidgetRep->GetRay1()->SetArrowStyleToFilled(); angleWidgetRep->GetPoint1Representation()->DragableOff(); angleWidgetRep->GetPoint1Representation()->PickableOff(); // center double c[3] = {0, 0, 0}; /* similar code to initialize the center/vertex point */ angleWidget->SetWidgetStateToManipulate(); angleWidget->Off(); and then later I set the angleWidget to On 1) I am calling the the DragableOff() and PickableOff() methods on Point1 and Center handles since I don't want them to be user editable/draggable. However these are still editable. Has anyone noticed this behavior or am I doing something incorrectly? 2) When zooming in/out after the user has manipulated the widget from its default state, all the widget members do not get zoomed in/out specifically Point2 handle representation. So it looks disconnected to Ray 2 when zooming in/out. This gets fixed when the handle is edited. Again, is this is a known bug or something that I could be doing wrong All suggestions appreciated Thanks -- View this message in context: http://vtk.1045678.n5.nabble.com/Bugs-in-vtkAngleWidget-tp5730230.html Sent from the VTK - Users mailing list archive at Nabble.com. From Ryan.Young at seattlechildrens.org Mon Jan 26 20:29:01 2015 From: Ryan.Young at seattlechildrens.org (Young, Ryan) Date: Tue, 27 Jan 2015 01:29:01 +0000 Subject: [vtkusers] grid reslice Message-ID: <06D6E971FE505044A365F05BD51FFD830A45C2C7@PPWEXD01d.childrens.sea.kids> Hello, I have a vector field that has the displacement vector for each voxel in a volume. I am trying to apply this deformation and visualize the results. The difficulty I am have is that the deformation only exist for the voxels inside the volume, not globally in the whole space. If I set the displacement to zeros outside the volume I get poor results. My toy example is just do to a 10 voxel shift in the x direction The volume is padded with zeros so there is plenty of room. The result is an image missing about ten voxels. See attached picture. If I make a similar deformation that exist at all voxels, the result is as expect. Any advice. Also, a code snippet is below. Thanks in advanced Ryan grid=vtk.vtkGridTransform() grid.SetDisplacementGrid(defImporter.GetOutput()) grid.SetInterpolationModeToLinear() reslice=vtk.vtkImageReslice() reslice.SetWrap(1) reslice.SetResliceTransform(grid) reslice.SetInterpolationModeToLinear() reslice.SetOutputSpacing(1,1,1) reslice.SetOutputOrigin(0,0,0) reslice.SetInputConnection(volImporter.GetOutputPort()) CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information protected by law. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: deformed_volume.png Type: image/png Size: 14726 bytes Desc: deformed_volume.png URL: From david.gobbi at gmail.com Mon Jan 26 21:18:08 2015 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 26 Jan 2015 19:18:08 -0700 Subject: [vtkusers] grid reslice In-Reply-To: <06D6E971FE505044A365F05BD51FFD830A45C2C7@PPWEXD01d.childrens.sea.kids> References: <06D6E971FE505044A365F05BD51FFD830A45C2C7@PPWEXD01d.childrens.sea.kids> Message-ID: Hi Ryan, Can you attach your image both with and _without_ deformation? I looked at the image but couldn't make any sense of it. - David On Mon, Jan 26, 2015 at 6:29 PM, Young, Ryan < Ryan.Young at seattlechildrens.org> wrote: > Hello, > > I have a vector field that has the displacement vector for each voxel in a > volume. I am trying to apply this deformation and visualize the results. > The difficulty I am have is that the deformation only exist for the voxels > inside the volume, not globally in the whole space. If I set the > displacement to zeros outside the volume I get poor results. > > My toy example is just do to a 10 voxel shift in the x direction The > volume is padded with zeros so there is plenty of room. The result is an > image missing about ten voxels. See attached picture. If I make a similar > deformation that exist at all voxels, the result is as expect. Any advice. > Also, a code snippet is below. > > Thanks in advanced > Ryan > > grid=vtk.vtkGridTransform() > grid.SetDisplacementGrid(defImporter.GetOutput()) > grid.SetInterpolationModeToLinear() > > reslice=vtk.vtkImageReslice() > reslice.SetWrap(1) > reslice.SetResliceTransform(grid) > reslice.SetInterpolationModeToLinear() > reslice.SetOutputSpacing(1,1,1) > reslice.SetOutputOrigin(0,0,0) > reslice.SetInputConnection(volImporter.GetOutputPort()) > CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, > is for the sole use of the intended recipient(s) and may contain > confidential and privileged information protected by law. Any unauthorized > review, use, disclosure or distribution is prohibited. If you are not the > intended recipient, please contact the sender by reply e-mail and destroy > all copies of the original message. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vamshi2592 at gmail.com Tue Jan 27 02:42:57 2015 From: vamshi2592 at gmail.com (Vamshi Krishna) Date: Mon, 26 Jan 2015 23:42:57 -0800 Subject: [vtkusers] INSTALLING VTK Message-ID: I am an engineering student trying to work on building a model (antenna for GPR) in VTK. i have downloaded all the latest versions (6.1.0) of the softwares related to VTK from the website. I am unable to understand how to install and how it works. It seems very complex to me. please help me out in installing the software and give some outline on how to start building a model. thanking you in the anticipation of the reply -- *Vamshi Krishna,* *IVth Year Undergraduate,* *Department of Electronics & Electrical Communication Engg.,* *Indian Institute of Technology, Kharagpur.* -------------- next part -------------- An HTML attachment was scrubbed... URL: From jhlegarreta at vicomtech.org Tue Jan 27 03:25:49 2015 From: jhlegarreta at vicomtech.org (Jon Haitz Legarreta) Date: Tue, 27 Jan 2015 09:25:49 +0100 Subject: [vtkusers] INSTALLING VTK In-Reply-To: References: Message-ID: Dear Vamshi, VTK is a powerful, open-source software library for scientific visualization purposes. The first thing you need to do to start using VTK is to download and build the source code. Just in case you haven't done so, the source code is found here [1]. You will need a build system to generate the files needed in your build environment, i.e., the ones your compiler will need to build the binaries. For this purpose, CMake is used [2]. You will then need to choose your compiler, depending on the OS and the compiler you use. Once you have built the VTK binaries, you are set to use it from any software you may develop. A very useful resource is the class documentation, whose latest version can be found here [3]. Depending on the VTK version you use, you may also find legacy documentation here [4]. The VTK wiki [5] is also a useful resource. You will find tens of examples, tutorials and a FAQ section. I haven't got experience myself in visualizing radiocommunication models in VTK, but I guess, the first thing you need is to know what your model is, and what physical phenomenon you would like to render (in case you want to render more than just the transmitter/receiver). BTW, what do you mean by "all related software"? If you mean that you downloaded, for example, ParaView [6] or some other application using VTK, and if that is enough for your purposes, you do not need to download the VTK source code. HTH, JON HAITZ [1] http://www.vtk.org/VTK/resources/software.html [2] http://www.cmake.org/ [3] http://www.vtk.org/doc/nightly/html/ [4] http://www.vtk.org/VTK/help/documentation.html [5] http://www.vtk.org/Wiki/VTK [6] http://www.vtk.org/VTK/resources/applications.html On 27 January 2015 at 08:42, Vamshi Krishna wrote: > I am an engineering student trying to work on building a model (antenna > for GPR) in VTK. i have downloaded all the latest versions (6.1.0) of the > softwares related to VTK from the website. I am unable to understand how to > install and how it works. It seems very complex to me. please help me out > in installing the software and give some outline on how to start building a > model. > > thanking you in the anticipation of the reply > > -- > *Vamshi Krishna,* > *IVth Year Undergraduate,* > *Department of Electronics & Electrical Communication Engg.,* > *Indian Institute of Technology, Kharagpur.* > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cameron.palmer at ntnu.no Tue Jan 27 05:10:51 2015 From: cameron.palmer at ntnu.no (Cameron Lowell Palmer) Date: Tue, 27 Jan 2015 10:10:51 +0000 Subject: [vtkusers] vtkImageData Reflection In-Reply-To: References: <8095F680-E195-48CC-803A-A3DB1655F18D@ntnu.no> Message-ID: <0F7BA679-CA4E-4873-9DEC-82F5FAB17E9A@ntnu.no> OK, so I?m taking your advice and putting things back the way they were. I spent 45+ minutes trying to figure out how to make vtkImageData reflect using vtkImageFlip. So I gave up and just used the Accelerate Framework in iOS to get the job done which was trivial. Would be nice if someone could give an example that works within the context of VES, because the example I found was making calls into VTK actors and mappers that aren?t available (in an obvious way) to VES. void *rawPixelData = malloc(videoFrame.totalBytes); vImage_Buffer mirrorImageBuffer; mirrorImageBuffer.width = videoFrame.width; mirrorImageBuffer.height = videoFrame.height; mirrorImageBuffer.rowBytes = videoFrame.bytesPerRow; mirrorImageBuffer.data = rawPixelData; vImageVerticalReflect_ARGB8888(&rgbaImageBuffer, &mirrorImageBuffer, kvImageDoNotTile); ? free(rawPixelData); My thought was that within the vesKiwiImagePlaneDataRepresentation you could just flip the image in setImageData, but I felt to do it there I would be down to manipulating the shader per usual and I?m loath to do that. cameron. On 26. jan. 2015, at 14.53, Cory Quammen > wrote: I don't know if that's a supremely bad idea, but it may make life complicated if you want to display anything else besides the image :-) It might be safest to just flip the image with the vtkImageFlip filter or flip the order of pixels in the incoming image yourself. On Mon, Jan 26, 2015 at 8:49 AM, Cameron Lowell Palmer > wrote: On a scale of 1 to supremely bad idea, how about flipping the location of the camera and view up? I did precisely that by making the camera face the positive z-axis, this also required me to flip the Y-Axis by changing the view up. I thought the issue was that the camera facing the negative z-axis and therefore was seeing the backside of the image. cameron From: Cory Quammen > Date: mandag 26. januar 2015 14.45 To: Cameron Lowell Palmer > Cc: VTK Users > Subject: Re: [vtkusers] vtkImageData Reflection Cameron, It looks like your camera's convention for image origin and VTK's disagree. You could correct it in the display by scaling the reversed axis of the actor that displays the image by -1, or you can flip the data after import with a vtkImageFlip filiter. HTH, Cory On Mon, Jan 26, 2015 at 7:29 AM, Cameron Lowell Palmer > wrote: When receiving a camera frame I?m converting to vtkImageData like this: auto imageImport = vtkSmartPointer::New(); imageImport->SetDataSpacing(1.0f, 1.0f, 1.0f); imageImport->SetDataOrigin(0.f, 0.f, 0.f); imageImport->SetWholeExtent(0.f, videoFrame.width - 1.f, 0.f, videoFrame.height - 1.f, 0.f, 0.f); imageImport->SetDataExtentToWholeExtent(); imageImport->SetDataScalarTypeToUnsignedChar(); imageImport->SetNumberOfScalarComponents(4); imageImport->SetImportVoidPointer(videoFrame.rawPixelData); imageImport->Update(); vtkSmartPointer imageData = imageImport->GetOutput(); It works, but adding this to an image plane the image is mirrored across the Y-axis (right-left). Am I doing this image conversion correctly? cameron _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -- Cory Quammen R&D Engineer Kitware, Inc. -- Cory Quammen R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.edmunds at icr.ac.uk Tue Jan 27 07:05:31 2015 From: david.edmunds at icr.ac.uk (Dave Edmunds) Date: Tue, 27 Jan 2015 05:05:31 -0700 (MST) Subject: [vtkusers] Setting title position in vtkScalarBarActor Message-ID: <1422360331440-5730237.post@n5.nabble.com> Hello, I am using a vtkScalarBarActor to display a vertical scalar bar in my application. The default behaviour is for the scalar bar title to be orientated horizontally at the top of the scalar bar. This looks bad when the title contains a lot of text. Is there a way to orient the title vertically next to the vertical scalar bar instead? Kind regards, Dave Edmunds -- View this message in context: http://vtk.1045678.n5.nabble.com/Setting-title-position-in-vtkScalarBarActor-tp5730237.html Sent from the VTK - Users mailing list archive at Nabble.com. From jcplatt at dsl.pipex.com Tue Jan 27 07:28:40 2015 From: jcplatt at dsl.pipex.com (John Platt) Date: Tue, 27 Jan 2015 12:28:40 +0000 Subject: [vtkusers] Setting title position in vtkScalarBarActor In-Reply-To: <1422360331440-5730237.post@n5.nabble.com> References: <1422360331440-5730237.post@n5.nabble.com> Message-ID: <54C78478.2020706@dsl.pipex.com> Hi Dave, Not that I am aware of in VTK 5. You can break the title on to more than one line using '\n'. HTH John. On 27/01/2015 12:05, Dave Edmunds wrote: > Hello, > > I am using a vtkScalarBarActor to display a vertical scalar bar in my > application. The default behaviour is for the scalar bar title to be > orientated horizontally at the top of the scalar bar. This looks bad when > the title contains a lot of text. > > Is there a way to orient the title vertically next to the vertical scalar > bar instead? > > Kind regards, > > Dave Edmunds > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/Setting-title-position-in-vtkScalarBarActor-tp5730237.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 > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > From dave.demarle at kitware.com Tue Jan 27 09:37:42 2015 From: dave.demarle at kitware.com (David E DeMarle) Date: Tue, 27 Jan 2015 09:37:42 -0500 Subject: [vtkusers] INSTALLING VTK In-Reply-To: References: Message-ID: Also consider the vtkpython binaries, they are a middle ground between compiling VTK and coding up a visualization on your own and simply using ParaView. Like ParaView, the vtkpython binaries are something that you just download, install and start using. However, like the VTK library itself, you still have to do some coding, in the form of python scripting, to create visualizations with it. And I'll add to Jon's list the intro to VTK webinar [7] [7] http://vimeo.com/32232190 David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Tue, Jan 27, 2015 at 3:25 AM, Jon Haitz Legarreta < jhlegarreta at vicomtech.org> wrote: > Dear Vamshi, > > VTK is a powerful, open-source software library for scientific > visualization purposes. > > The first thing you need to do to start using VTK is to download and build > the source code. > Just in case you haven't done so, the source code is found here [1]. > > You will need a build system to generate the files needed in your build > environment, i.e., the ones your compiler will need to build the binaries. > For this purpose, CMake is used [2]. > > You will then need to choose your compiler, depending on the OS and the > compiler you use. > > Once you have built the VTK binaries, you are set to use it from any > software you may develop. > > A very useful resource is the class documentation, whose latest version > can be found here [3]. Depending on the VTK version you use, you may also > find legacy documentation here [4]. > > The VTK wiki [5] is also a useful resource. You will find tens of > examples, tutorials and a FAQ section. > > I haven't got experience myself in visualizing radiocommunication models > in VTK, but I guess, the first thing you need is to know what your model > is, and what physical phenomenon you would like to render (in case you want > to render more than just the transmitter/receiver). > > BTW, what do you mean by "all related software"? > > If you mean that you downloaded, for example, ParaView [6] or some other > application using VTK, and if that is enough for your purposes, you do not > need to download the VTK source code. > > HTH, > JON HAITZ > > > > > [1] http://www.vtk.org/VTK/resources/software.html > [2] http://www.cmake.org/ > [3] http://www.vtk.org/doc/nightly/html/ > [4] http://www.vtk.org/VTK/help/documentation.html > [5] http://www.vtk.org/Wiki/VTK > [6] http://www.vtk.org/VTK/resources/applications.html > > > > On 27 January 2015 at 08:42, Vamshi Krishna wrote: > >> I am an engineering student trying to work on building a model (antenna >> for GPR) in VTK. i have downloaded all the latest versions (6.1.0) of the >> softwares related to VTK from the website. I am unable to understand how to >> install and how it works. It seems very complex to me. please help me out >> in installing the software and give some outline on how to start building a >> model. >> >> thanking you in the anticipation of the reply >> >> -- >> *Vamshi Krishna,* >> *IVth Year Undergraduate,* >> *Department of Electronics & Electrical Communication Engg.,* >> *Indian Institute of Technology, Kharagpur.* >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cameron.palmer at ntnu.no Tue Jan 27 09:49:36 2015 From: cameron.palmer at ntnu.no (Cameron Lowell Palmer) Date: Tue, 27 Jan 2015 14:49:36 +0000 Subject: [vtkusers] Changing the projection matrix In-Reply-To: <4C0A9E1B-AD7A-4158-9415-D78D03B1A627@ntnu.no> References: <4C0A9E1B-AD7A-4158-9415-D78D03B1A627@ntnu.no> Message-ID: <3F47FE38-8767-49E7-88C5-5C3C677AFF89@ntnu.no> Maybe some more explanation is necessary? What I have: * Video camera calibration with intrinsics of the camera (i.e. focal length, center). * Framemarker tracking that returns a rotation/translation matrix that represent the marker in space. * VES/VTK app that loads the image plane and several other objects. * pose matrix, camera calibration, and streaming video frames are all available to VES/VTK The specific experiment I?m trying to complete is placing a logo over the framemarker in the image. When doing this with raw OpenGL I need to set the OpenGL projection matrix so that it conforms to the camera intrinsics. Then you draw the objects in the scene with the pose matrix loaded. However, translating this to VES/VTK is defeating me. Problems I think I have: * The camera image plane is now in 3-space. * I can?t directly apply the projection matrix to vesCamera. However, it seems I can set Focal Point and View Angle. * I need to translate objects into the coordinate space of camera image plane So, am I correctly identifying my problems? Are there problems I missed? Has anyone developed a working example of an augmented reality app using VES/VTK or even just VTK? Thanks, cameron. > On 21. jan. 2015, at 12.32, Cameron Lowell Palmer wrote: > > I?m trying to use VES/VTK in support of an Augmented Reality app on iOS and I need to provide a new projection matrix that I generated using the Camera Calibration. Is this not supported or do I have to completely bypass VTK and handle it in the shader? From Ryan.Young at seattlechildrens.org Tue Jan 27 16:33:28 2015 From: Ryan.Young at seattlechildrens.org (Young, Ryan) Date: Tue, 27 Jan 2015 21:33:28 +0000 Subject: [vtkusers] grid reslice In-Reply-To: References: <06D6E971FE505044A365F05BD51FFD830A45C2C7@PPWEXD01d.childrens.sea.kids>, Message-ID: <06D6E971FE505044A365F05BD51FFD830A45C30E@PPWEXD01d.childrens.sea.kids> Sure. I used a slight larger (15 voxel in the x direction) deformation so that the effect is drastic. Thanks again, Ryan ________________________________ From: David Gobbi [david.gobbi at gmail.com] Sent: Monday, January 26, 2015 6:18 PM To: Young, Ryan Cc: vtkusers at vtk.org Subject: Re: [vtkusers] grid reslice Hi Ryan, Can you attach your image both with and _without_ deformation? I looked at the image but couldn't make any sense of it. - David On Mon, Jan 26, 2015 at 6:29 PM, Young, Ryan > wrote: Hello, I have a vector field that has the displacement vector for each voxel in a volume. I am trying to apply this deformation and visualize the results. The difficulty I am have is that the deformation only exist for the voxels inside the volume, not globally in the whole space. If I set the displacement to zeros outside the volume I get poor results. My toy example is just do to a 10 voxel shift in the x direction The volume is padded with zeros so there is plenty of room. The result is an image missing about ten voxels. See attached picture. If I make a similar deformation that exist at all voxels, the result is as expect. Any advice. Also, a code snippet is below. Thanks in advanced Ryan grid=vtk.vtkGridTransform() grid.SetDisplacementGrid(defImporter.GetOutput()) grid.SetInterpolationModeToLinear() reslice=vtk.vtkImageReslice() reslice.SetWrap(1) reslice.SetResliceTransform(grid) reslice.SetInterpolationModeToLinear() reslice.SetOutputSpacing(1,1,1) reslice.SetOutputOrigin(0,0,0) reslice.SetInputConnection(volImporter.GetOutputPort()) CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information protected by law. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information protected by law. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: deformed_volume.png Type: image/png Size: 10356 bytes Desc: deformed_volume.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not_deformed.png Type: image/png Size: 20011 bytes Desc: not_deformed.png URL: From david.gobbi at gmail.com Tue Jan 27 16:49:07 2015 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 27 Jan 2015 14:49:07 -0700 Subject: [vtkusers] grid reslice In-Reply-To: <06D6E971FE505044A365F05BD51FFD830A45C30E@PPWEXD01d.childrens.sea.kids> References: <06D6E971FE505044A365F05BD51FFD830A45C2C7@PPWEXD01d.childrens.sea.kids> <06D6E971FE505044A365F05BD51FFD830A45C30E@PPWEXD01d.childrens.sea.kids> Message-ID: Hi Ryan, I still don't know what I'm looking at. Especially when the two images are at completely different scales (the deformed image is ridiculously small). Maybe you can annotate them? - David On Tue, Jan 27, 2015 at 2:33 PM, Young, Ryan < Ryan.Young at seattlechildrens.org> wrote: > > > Sure. I used a slight larger (15 voxel in the x direction) deformation so > that the effect is drastic. > > Thanks again, > Ryan > > ------------------------------ > *From:* David Gobbi [david.gobbi at gmail.com] > *Sent:* Monday, January 26, 2015 6:18 PM > *To:* Young, Ryan > *Cc:* vtkusers at vtk.org > *Subject:* Re: [vtkusers] grid reslice > > Hi Ryan, > > Can you attach your image both with and _without_ deformation? > I looked at the image but couldn't make any sense of it. > > - David > > > On Mon, Jan 26, 2015 at 6:29 PM, Young, Ryan < > Ryan.Young at seattlechildrens.org> wrote: > >> Hello, >> >> I have a vector field that has the displacement vector for each voxel in >> a volume. I am trying to apply this deformation and visualize the >> results. The difficulty I am have is that the deformation only exist for >> the voxels inside the volume, not globally in the whole space. If I set the >> displacement to zeros outside the volume I get poor results. >> >> My toy example is just do to a 10 voxel shift in the x direction The >> volume is padded with zeros so there is plenty of room. The result is an >> image missing about ten voxels. See attached picture. If I make a similar >> deformation that exist at all voxels, the result is as expect. Any advice. >> Also, a code snippet is below. >> >> Thanks in advanced >> Ryan >> >> grid=vtk.vtkGridTransform() >> grid.SetDisplacementGrid(defImporter.GetOutput()) >> grid.SetInterpolationModeToLinear() >> >> reslice=vtk.vtkImageReslice() >> reslice.SetWrap(1) >> reslice.SetResliceTransform(grid) >> reslice.SetInterpolationModeToLinear() >> reslice.SetOutputSpacing(1,1,1) >> reslice.SetOutputOrigin(0,0,0) >> reslice.SetInputConnection(volImporter.GetOutputPort()) >> CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, >> is for the sole use of the intended recipient(s) and may contain >> confidential and privileged information protected by law. Any unauthorized >> review, use, disclosure or distribution is prohibited. If you are not the >> intended recipient, please contact the sender by reply e-mail and destroy >> all copies of the original message. >> >> > CONFIDENTIALITY NOTICE: This e-mail message, including any > attachments, is for the sole use of the intended recipient(s) and may > contain confidential and privileged information protected by law. Any > unauthorized review, use, disclosure or distribution is prohibited. If you > are not the intended recipient, please contact the sender by reply e-mail > and destroy all copies of the original message. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From madaramh at gmail.com Wed Jan 28 01:51:14 2015 From: madaramh at gmail.com (madz) Date: Tue, 27 Jan 2015 23:51:14 -0700 (MST) Subject: [vtkusers] Read data from a .vtk file Message-ID: <1422427874476-5730244.post@n5.nabble.com> I'm trying to read array data from a .vtk file (see attachment). The code I've used is, #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include int main(int argc, char* argv[]) { std::string inputFilename = "Zone2.vtk"; // Read the file vtkSmartPointer reader =vtkSmartPointer::New(); reader->SetFileName(inputFilename.c_str()); reader->Update(); vtkSmartPointer geometryFilter = vtkSmartPointer::New(); geometryFilter->SetInputConnection(reader->GetOutputPort()); geometryFilter->Update(); vtkSmartPointer polydata = geometryFilter->GetOutput(); vtkSmartPointer arr1 = polydata->GetFieldData()->GetArray("EnergyStagnationDensity"); vtkSmartPointer arr2 = polydata->GetCellData()->GetArray("EnergyStagnationDensity"); vtkSmartPointer arr3 = polydata->GetPointData()->GetArray("EnergyStagnationDensity"); // Visualize vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInput(polydata); vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); actor->GetProperty()->SetRepresentationToSurface(); //actor->GetProperty()->SetRepresentationToPoints(); //actor->GetProperty()->SetRepresentationToWireframe(); vtkSmartPointer renderer = vtkSmartPointer::New(); renderer->AddActor(actor); vtkSmartPointer renderWindow = vtkSmartPointer::New(); renderWindow->AddRenderer(renderer); vtkSmartPointer renderWindowInteractor = vtkSmartPointer::New(); renderWindowInteractor->SetRenderWindow(renderWindow); renderer->Render(); renderer->SetBackground(1,1,1); renderWindow->Render(); renderWindowInteractor->Start(); return EXIT_SUCCESS; } When I view the file from paraView it displays 3 dataArrays. "Density", "EnergyStagnationDensity" and "Momentum". I can access both "Momentum" and "Density" how ever I cannot access "EnergyStagnationDensity". I tried this with vtkDataSetReader and got the same result. Is there a way to access all 3 dataArrays? If anyone can point out how paraView has accomplished this I'll be most grateful. file - Zone2.vtk -- View this message in context: http://vtk.1045678.n5.nabble.com/Read-data-from-a-vtk-file-tp5730244.html Sent from the VTK - Users mailing list archive at Nabble.com. From madaramh at gmail.com Wed Jan 28 04:14:12 2015 From: madaramh at gmail.com (madz) Date: Wed, 28 Jan 2015 02:14:12 -0700 (MST) Subject: [vtkusers] INSTALLING VTK In-Reply-To: References: Message-ID: <1422436452651-5730245.post@n5.nabble.com> These links are for older versions of VTK, but should still work. http://www.cs.uakron.edu/~xiao/visualization/VTK-Installation-Tutorial.html http://www.eecs.tufts.edu/~alauri02/install.htm -- View this message in context: http://vtk.1045678.n5.nabble.com/INSTALLING-VTK-tp5730234p5730245.html Sent from the VTK - Users mailing list archive at Nabble.com. From madaramh at gmail.com Wed Jan 28 04:25:02 2015 From: madaramh at gmail.com (madz) Date: Wed, 28 Jan 2015 02:25:02 -0700 (MST) Subject: [vtkusers] Setting title position in vtkScalarBarActor In-Reply-To: <1422360331440-5730237.post@n5.nabble.com> References: <1422360331440-5730237.post@n5.nabble.com> Message-ID: <1422437102833-5730246.post@n5.nabble.com> You could try, SetOrientationToVertical(); SetOrientationToHorizontal(); and to set the start and end positions use, GetPositionCoordinate()->SetValue(val1,val2); GetPosition2Coordinate()->SetValue(val3,val4); -- View this message in context: http://vtk.1045678.n5.nabble.com/Setting-title-position-in-vtkScalarBarActor-tp5730237p5730246.html Sent from the VTK - Users mailing list archive at Nabble.com. From simon.esneault at gmail.com Wed Jan 28 05:06:37 2015 From: simon.esneault at gmail.com (Simon ESNEAULT) Date: Wed, 28 Jan 2015 11:06:37 +0100 Subject: [vtkusers] imageViewer size within QVTKWidget In-Reply-To: References: <1417175172257-5729578.post@n5.nabble.com> <4B7FB8C0-759E-4A46-B274-8A0F5DAEA102@gmail.com> <1418220612046-5729776.post@n5.nabble.com> <1418221169126-5729777.post@n5.nabble.com> Message-ID: Hello Community, I'm trying to debug this problem with QVTKWidget on retina display (without success for now) Just wanted to share that there is a way to simulate an HiDPI display and to reproduce this bug on an OSX system with a "normal" screen - Launch this command in a terminal : sudo defaults write /Library/Preferences/com.apple.windowserver.plist DisplayResolutionEnabled -bool true - Log out/ log in - Go to preference -> display and you should have one additional resolution available looking like : 960x540 (HiDPI) And now launch a program with a QVTKWidget, Qt5, VTK 6.1 and HiDPI enabled (need NSHighResolutionCapable in the info.plist inside the .app) and the VTK viewport should fill only the bottom left quarter of the QVTKWidget. If any Qt/VTK skilled debugger has a hint on how to solve that particular problem ... Thanks, Simon 2014-12-10 15:46 GMT+01:00 David Gobbi : > Unfortunately, I don't have any systems with a retina display to run tests > on. I wonder, has this issue ever come up with ParaView on retina displays? > > On Wed, Dec 10, 2014 at 7:19 AM, mbcx9rb9 > wrote: > >> The only solution I've found so far is to run your program in low >> resolution >> mode: >> >> Right click on the *.app file >> Get Info >> Open in low resolution mode >> Close the Get Info window and run program >> >> see: >> >> http://vtk.1045678.n5.nabble.com/QVTKWidget-and-MacOS-problems-td5729620.html >> >> >> >> -- >> View this message in context: >> http://vtk.1045678.n5.nabble.com/imageViewer-size-within-QVTKWidget-tp5729578p5729777.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 > > -- ------------------------------------------------------------------ Simon Esneault Rennes, France ------------------------------------------------------------------ -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Wed Jan 28 08:09:00 2015 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Wed, 28 Jan 2015 08:09:00 -0500 Subject: [vtkusers] Can you help with this please? In-Reply-To: <1810404703.205164.1422449960584.JavaMail.administrator@msam.nabble.com> References: <1810404703.205164.1422449960584.JavaMail.administrator@msam.nabble.com> Message-ID: The resulting triangle do not have normals so changing the shading interpolation won't help. What is the source and precision of the original points? On Wed, Jan 28, 2015 at 7:59 AM, wrote: > Hi Bill, > > I am trying to make a model of human chest. I have some points of the chest that I send you the link (first link). I have used vtkDelaunay2D to put a surface on the points but the surface is not smooth. I used "SetInterpolationToPhong" property as well, but it did not worked for me. It seems that the results form Phong has no difference from Flat !!!! > Also I have used "vtkSurfaceReconstructionFilter", but it modify the points position very much and I don't want this much of modification. > I have copied my code at the end of the email. > > I appreciate if you can help me with this (to have a smooth surface). > > Cheers, > Vahid > > points of the chest: > https://drive.google.com/open?id=0BxUVE0cBp62XazgwWWJsMFFpa28&authuser=0 > > vtkDelaunay2D model: > https://drive.google.com/open?id=0BxUVE0cBp62Xc3pyeFQ0Zmh5MGM&authuser=0 > > > int main(int, char *[]) > { > > vtkSmartPointer points = > vtkSmartPointer::New(); > > int widthOffset = 241 , heightOffset = 178; > > readPoints(points, "extra_files/depth_chest19.png", heightOffset, widthOffset); > > vtkSmartPointer polydata = > vtkSmartPointer::New(); > polydata->SetPoints(points); > > // Triangulate the grid points > vtkSmartPointer delaunay = > vtkSmartPointer::New(); > delaunay->SetInputData(polydata); > delaunay->Update(); > > // Visualize > vtkSmartPointer meshMapper = > vtkSmartPointer::New(); > meshMapper->SetInputConnection(delaunay->GetOutputPort()); > > vtkSmartPointer meshActor = > vtkSmartPointer::New(); > meshActor->SetMapper(meshMapper); > //meshActor->GetProperty()->SetEdgeColor(0,0,1); // Why aren't the edges aren't visible unless we set the representation to wireframe? > //meshActor->GetProperty()->EdgeVisibilityOn(); > //meshActor->GetProperty()->SetDiffuseColor(0.0, 0.4, 0.8); > //meshActor->GetProperty()->SetInterpolationToFlat(); > //meshActor->GetProperty()->SetRepresentationToWireframe(); > //meshActor->GetProperty()->SetInterpolationToGouraud(); > meshActor->GetProperty()->SetInterpolationToPhong(); > > // Create a renderer, render window, and interactor > vtkSmartPointer renderer = > vtkSmartPointer::New(); > vtkSmartPointer renderWindow = > vtkSmartPointer::New(); > renderWindow->AddRenderer(renderer); > renderWindow->SetSize(600,600); > renderWindow->SetPosition(600,200); > > > vtkSmartPointer renderWindowInteractor = > vtkSmartPointer::New(); > renderWindowInteractor->SetRenderWindow(renderWindow); > > vtkSmartPointer mystyle = > vtkSmartPointer::New(); > mystyle->SetActor(meshActor); > > renderWindowInteractor->SetInteractorStyle( mystyle ); > > > // Add the actor to the scene > renderer->AddActor(meshActor); > //renderer->AddActor(boundaryActor); > renderer->SetBackground(.0, .1, .0); // Background color green > > // Render and interact > renderWindow->Render(); > renderWindow->SetWindowName("Chest wall: wired-form (denoised with gaussian filter)"); > renderWindowInteractor->Start(); > > return EXIT_SUCCESS; > } > > _____________________________________ > Sent from http://vtk.1045678.n5.nabble.com > -- Unpaid intern in BillsBasement at noware dot com From Ryan.Young at seattlechildrens.org Wed Jan 28 19:59:52 2015 From: Ryan.Young at seattlechildrens.org (Young, Ryan) Date: Thu, 29 Jan 2015 00:59:52 +0000 Subject: [vtkusers] grid reslice In-Reply-To: References: <06D6E971FE505044A365F05BD51FFD830A45C2C7@PPWEXD01d.childrens.sea.kids> <06D6E971FE505044A365F05BD51FFD830A45C30E@PPWEXD01d.childrens.sea.kids>, Message-ID: <06D6E971FE505044A365F05BD51FFD830A45D372@PPWEXD01d.childrens.sea.kids> Hey. I made a little pdf to hopefully clear things ups. Just to summarize, I have a vector field that is the displace of a volume. The test case is just a vector pointing 15 units in the x direction . It is only define for voxels within the volume. I am using a vtkGridTransform and vtkImageReslice to apply this transformation. The result should a the volume unchanged, but centred 15 voxels to the right. What I am seeing is that the left half of the volume is missing. If I define the transformation to exist every voxel, not just within the volume, it works as expect and the volume is moved to the rigth 15 units. I created a repo with two scripts that show this. Its at https://bitbucket.org/youngre/vtk_grid_transform/ Thanks again, Ryan ________________________________ From: David Gobbi [david.gobbi at gmail.com] Sent: Tuesday, January 27, 2015 1:49 PM To: Young, Ryan Cc: vtkusers at vtk.org Subject: Re: [vtkusers] grid reslice Hi Ryan, I still don't know what I'm looking at. Especially when the two images are at completely different scales (the deformed image is ridiculously small). Maybe you can annotate them? - David On Tue, Jan 27, 2015 at 2:33 PM, Young, Ryan > wrote: Sure. I used a slight larger (15 voxel in the x direction) deformation so that the effect is drastic. Thanks again, Ryan ________________________________ From: David Gobbi [david.gobbi at gmail.com] Sent: Monday, January 26, 2015 6:18 PM To: Young, Ryan Cc: vtkusers at vtk.org Subject: Re: [vtkusers] grid reslice Hi Ryan, Can you attach your image both with and _without_ deformation? I looked at the image but couldn't make any sense of it. - David On Mon, Jan 26, 2015 at 6:29 PM, Young, Ryan > wrote: Hello, I have a vector field that has the displacement vector for each voxel in a volume. I am trying to apply this deformation and visualize the results. The difficulty I am have is that the deformation only exist for the voxels inside the volume, not globally in the whole space. If I set the displacement to zeros outside the volume I get poor results. My toy example is just do to a 10 voxel shift in the x direction The volume is padded with zeros so there is plenty of room. The result is an image missing about ten voxels. See attached picture. If I make a similar deformation that exist at all voxels, the result is as expect. Any advice. Also, a code snippet is below. Thanks in advanced Ryan grid=vtk.vtkGridTransform() grid.SetDisplacementGrid(defImporter.GetOutput()) grid.SetInterpolationModeToLinear() reslice=vtk.vtkImageReslice() reslice.SetWrap(1) reslice.SetResliceTransform(grid) reslice.SetInterpolationModeToLinear() reslice.SetOutputSpacing(1,1,1) reslice.SetOutputOrigin(0,0,0) reslice.SetInputConnection(volImporter.GetOutputPort()) CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information protected by law. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information protected by law. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information protected by law. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: deformations.pdf Type: application/pdf Size: 42484 bytes Desc: deformations.pdf URL: From madaramh at gmail.com Wed Jan 28 23:05:38 2015 From: madaramh at gmail.com (madz) Date: Wed, 28 Jan 2015 21:05:38 -0700 (MST) Subject: [vtkusers] Read data from a .vtk file In-Reply-To: <1422427874476-5730244.post@n5.nabble.com> References: <1422427874476-5730244.post@n5.nabble.com> Message-ID: <1422504338857-5730250.post@n5.nabble.com> Does anyone have any idea on how this might happen (I have posted the .vtk file as well)? Any help would be greatly appreciated. -- View this message in context: http://vtk.1045678.n5.nabble.com/Read-data-from-a-vtk-file-tp5730244p5730250.html Sent from the VTK - Users mailing list archive at Nabble.com. From ysa0829 at gmail.com Thu Jan 29 03:15:19 2015 From: ysa0829 at gmail.com (ysa0829) Date: Thu, 29 Jan 2015 01:15:19 -0700 (MST) Subject: [vtkusers] vtkCutter scalars problems Message-ID: <1422519319329-5730251.post@n5.nabble.com> I have a cube that has 8 vertex. The vertex has own color like this picture. when I cut the cube , I get a contour like this picture Ths scalars is wrong ,I think the correct picture is how do I get the correct contour scalar ? Thank for help! -- View this message in context: http://vtk.1045678.n5.nabble.com/vtkCutter-scalars-problems-tp5730251.html Sent from the VTK - Users mailing list archive at Nabble.com. From franciscolopezdelafranca at gmail.com Thu Jan 29 03:35:05 2015 From: franciscolopezdelafranca at gmail.com (Francisco Lopez de la Franca) Date: Thu, 29 Jan 2015 09:35:05 +0100 Subject: [vtkusers] A point inside or outside a convex hull Message-ID: Hello everybody. I create a convex hull with either vtkDelaunay3D or vtkHull classes from an input data set (a 3D volume). What would it be the best way to know if an arbitrary 3D point is inside or outside the convex hull? Thanks a lot in advance. Kind regards. /Francisco -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Thu Jan 29 07:27:26 2015 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Thu, 29 Jan 2015 07:27:26 -0500 Subject: [vtkusers] Read data from a .vtk file In-Reply-To: <1422504338857-5730250.post@n5.nabble.com> References: <1422427874476-5730244.post@n5.nabble.com> <1422504338857-5730250.post@n5.nabble.com> Message-ID: How was the file Zone2.vtk created? On Wed, Jan 28, 2015 at 11:05 PM, madz wrote: > Does anyone have any idea on how this might happen (I have posted the .vtk > file as well)? > Any help would be greatly appreciated. > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/Read-data-from-a-vtk-file-tp5730244p5730250.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 > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > 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 Thu Jan 29 07:47:47 2015 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Thu, 29 Jan 2015 07:47:47 -0500 Subject: [vtkusers] Read data from a .vtk file In-Reply-To: References: <1422427874476-5730244.post@n5.nabble.com> <1422504338857-5730250.post@n5.nabble.com> Message-ID: There is something strange in this file. Try using vtkPDataSetReader rather than vtkDataSetReader. I'm not sure why one reader sees the 3 arrays whie the other only sees 2. Bill On Thu, Jan 29, 2015 at 7:27 AM, Bill Lorensen wrote: > How was the file Zone2.vtk created? > > On Wed, Jan 28, 2015 at 11:05 PM, madz wrote: >> Does anyone have any idea on how this might happen (I have posted the .vtk >> file as well)? >> Any help would be greatly appreciated. >> >> >> >> -- >> View this message in context: http://vtk.1045678.n5.nabble.com/Read-data-from-a-vtk-file-tp5730244p5730250.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 >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> 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 daviddoria at gmail.com Thu Jan 29 08:03:05 2015 From: daviddoria at gmail.com (David Doria) Date: Thu, 29 Jan 2015 08:03:05 -0500 Subject: [vtkusers] A point inside or outside a convex hull In-Reply-To: References: Message-ID: On Thu, Jan 29, 2015 at 3:35 AM, Francisco Lopez de la Franca < franciscolopezdelafranca at gmail.com> wrote: > Hello everybody. > I create a convex hull with either vtkDelaunay3D or vtkHull classes from > an input data set (a 3D volume). > > What would it be the best way to know if an arbitrary 3D point is inside > or outside the convex hull? > > Thanks a lot in advance. > Kind regards. > /Francisco > Here are a few options: http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PointInsideObject http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PointInsideObject2 http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/CellTreeLocator David -------------- next part -------------- An HTML attachment was scrubbed... URL: From 2130220212 at email.szu.edu.cn Thu Jan 29 08:54:10 2015 From: 2130220212 at email.szu.edu.cn (Jason) Date: Thu, 29 Jan 2015 06:54:10 -0700 (MST) Subject: [vtkusers] get a slice from a volume Message-ID: <1422539650521-5730256.post@n5.nabble.com> Hi, I am trying to get a slice from a volume. And I am using vtkImageReslice with: vtkSmartPointer resliceAxes = vtkSmartPointer::New(); resliceAxes->DeepCopy(axialElements); resliceAxes->SetElement(0, 3, Original[0]); //the original point is wrong resliceAxes->SetElement(1, 3, Original[1]); resliceAxes->SetElement(2, 3, Original[2]); vtkSmartPointer reslice = vtkSmartPointer::New(); reslice->SetInput(connector->GetOutput()); reslice->SetOutputDimensionality(2); reslice->SetResliceAxes(resliceAxes); reslice->SetInterpolationModeToLinear(); reslice->AutoCropOutputOn(); I cannot get the slice's original point. And I was wondering whether if I can get the point through the resliceAxes's axialElements infomation. Thanks for the help! Regards, Jason. -- View this message in context: http://vtk.1045678.n5.nabble.com/get-a-slice-from-a-volume-tp5730256.html Sent from the VTK - Users mailing list archive at Nabble.com. From julio.hoffimann at gmail.com Thu Jan 29 16:46:32 2015 From: julio.hoffimann at gmail.com (=?UTF-8?Q?J=C3=BAlio_Hoffimann?=) Date: Thu, 29 Jan 2015 13:46:32 -0800 Subject: [vtkusers] vtkImageData subview Message-ID: Dear all, Is it possible to get a subcube of a vtkImageData without writing a for loop myself? -J?lio -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Thu Jan 29 16:49:00 2015 From: daviddoria at gmail.com (David Doria) Date: Thu, 29 Jan 2015 16:49:00 -0500 Subject: [vtkusers] vtkImageData subview In-Reply-To: References: Message-ID: On Thu, Jan 29, 2015 at 4:46 PM, J?lio Hoffimann wrote: > Dear all, > > Is it possible to get a subcube of a vtkImageData without writing a for > loop myself? > > -J?lio > Is this what you're looking for? http://www.vtk.org/Wiki/VTK/Examples/Cxx/ImageData/ExtractVOI David -------------- next part -------------- An HTML attachment was scrubbed... URL: From julio.hoffimann at gmail.com Thu Jan 29 16:54:25 2015 From: julio.hoffimann at gmail.com (=?UTF-8?Q?J=C3=BAlio_Hoffimann?=) Date: Thu, 29 Jan 2015 13:54:25 -0800 Subject: [vtkusers] vtkImageData subview In-Reply-To: References: Message-ID: > > Is this what you're looking for? > > http://www.vtk.org/Wiki/VTK/Examples/Cxx/ImageData/ExtractVOI > > David > > Thanks David, seems to be exactly what I need. -J?lio -------------- next part -------------- An HTML attachment was scrubbed... URL: From royalmatador at gmail.com Thu Jan 29 20:01:09 2015 From: royalmatador at gmail.com (AIs) Date: Thu, 29 Jan 2015 18:01:09 -0700 (MST) Subject: [vtkusers] vtk FillHolesFilter Message-ID: <1422579669640-5730267.post@n5.nabble.com> Hi All, I have an image with only edges, which I converted into vtk PolyData using this example; to generate a contour http://www.vtk.org/Wiki/VTK/Examples/Cxx/ImageData/ImageDataGeometryFilter I have stack of such edges which I append to get a polydata object with a hole. I would then like to fill this hole using vtkFillHolesFilter, but for some reason I do not get any output just a blank screen. Also I do not get any error. I understand that vtkFillHoles filter will work only on a polydata, but why am I unable to get any output. On previously using this VTK function I never faced any problem. If anyone can please guide me on this. Cheers Isshaa -- View this message in context: http://vtk.1045678.n5.nabble.com/vtk-FillHolesFilter-tp5730267.html Sent from the VTK - Users mailing list archive at Nabble.com. From madaramh at gmail.com Thu Jan 29 22:53:46 2015 From: madaramh at gmail.com (madz) Date: Thu, 29 Jan 2015 20:53:46 -0700 (MST) Subject: [vtkusers] Read data from a .vtk file In-Reply-To: References: <1422427874476-5730244.post@n5.nabble.com> <1422504338857-5730250.post@n5.nabble.com> Message-ID: <1422590026710-5730268.post@n5.nabble.com> Hi Bill, Thanks for your answer, it worked! The file was created by a Software called CGNSview. -- View this message in context: http://vtk.1045678.n5.nabble.com/Read-data-from-a-vtk-file-tp5730244p5730268.html Sent from the VTK - Users mailing list archive at Nabble.com. From ysa0829 at gmail.com Fri Jan 30 01:20:22 2015 From: ysa0829 at gmail.com (ysa0829) Date: Thu, 29 Jan 2015 23:20:22 -0700 (MST) Subject: [vtkusers] Problem with color after using vtkClipPolyData In-Reply-To: References: Message-ID: <1422598822573-5730269.post@n5.nabble.com> hi guys, I have the same problem. My origin data is a vrml model that has own vertex color . here is my code for displaying origin model,and it is displaying right. ///////////////code for displaying origin model/////////////// vtkActor *actor = vtkActor::New(); vtkPolyDataMapper *mapper = vtkPolyDataMapper::New(); mapper->SetLookupTable(vrmlModel->lookupTable); mapper->SetScalarRange(vrmlModel->lookupTable->GetTableRange()); mapper->SetInputData(vrmlModel->polyData); renderer->AddActor(actor); ///////////////code for displaying origin model/////////////// I used a vtkTableBasedClipDataSet to clip the vrml model,and I found that the polyData output color is not correct like this picture. ///////////////code for displaying clip model/////////////// vtkPlane *plane = vtkPlane::New(); plane->SetOrigin(0, 0, 10); plane->SetNormal(0, 0, 1); vtkSmartPointer clipper = vtkSmartPointer::New(); clipper->SetInputData(vrmlModel->polyData); clipper->SetClipFunction(plane); clipper->SetGenerateClippedOutput(1); clipper->SetInsideOut(1); clipper->Update(); vtkSmartPointer clipMapper = vtkSmartPointer::New(); clipMapper->SetInputConnection(clipper->GetOutputPort()); clipMapper->ScalarVisibilityOn(); clipMapper->SetLookupTable(vrmlModel->lookupTable); clipMapper->SetScalarRange(vrmlModel->lookupTable->GetRange()); vtkSmartPointer clipActor = vtkSmartPointer::New(); clipActor->SetMapper(clipMapper); renderer->AddActor(clipActor); ///////////////code for displaying clip model/////////////// How do I get the clip polydata that has right color? I will appreciate any suggestion very much! -- View this message in context: http://vtk.1045678.n5.nabble.com/Problem-with-color-after-using-vtkClipPolyData-tp5717563p5730269.html Sent from the VTK - Users mailing list archive at Nabble.com. From andersd at riseup.net Fri Jan 30 04:26:52 2015 From: andersd at riseup.net (Anders Damsgaard) Date: Fri, 30 Jan 2015 10:26:52 +0100 Subject: [vtkusers] Writing a time-evolving scalar to a VTK file Message-ID: <20150130092652.GA1902@flaptop> Dear VTK users, how do I write a single time-evolving scalar to a vtk file? I have some simulations which create both unstructured grid files (vtu) and image grid files (vti), that I render together in Paraview. I would like to include a time-evolving parameter which should be shown as a text annotation. I've created a function to parse to the unstructured grid files myself, and used `python-vtk` to write the image grid files. If needed, the source code is available here: https://github.com/anders-dc/sphere/blob/master/python/sphere.py (look for the writeVTK and writeFluidVTK functions). I appreciate all pointers since I'm relatively new to VTK/ParaView. Thanks, Anders -- Anders Damsgaard Ph.D. student, Department of Geoscience, Aarhus University, Denmark anders.damsgaard at geo.au.dk (work), andersd at riseup.net (private) Contact info: https://cs.au.dk/~adc Blog: http://anders-dc.github.io Twitter: https://twitter.com/DamsgaardAnders PGP public key: https://cs.au.dk/~adc/adc.gpg (new key, 2013-02-14) -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 473 bytes Desc: Digital signature URL: From cameron.palmer at ntnu.no Fri Jan 30 06:05:56 2015 From: cameron.palmer at ntnu.no (cameron.palmer at ntnu.no) Date: Fri, 30 Jan 2015 11:05:56 +0000 Subject: [vtkusers] vtkImageData transform with vtkImageResample/Reslice Message-ID: <3827B593-5F79-4D4E-84E1-89319E6653C9@ntnu.no> I?ve seen a number of online examples using image reslice and resample that don?t seem to work for me. I simply want to scale the image so resample seems to be the way to go, but I always have trouble with the various Input methods. What is the correct formulation for using vtkImageData as input? vtkImageData* imageData; ... auto resample = vtkSmartPointer(); resample->SetInput(imageData); ... resample->Update(); -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Fri Jan 30 07:23:26 2015 From: daviddoria at gmail.com (David Doria) Date: Fri, 30 Jan 2015 07:23:26 -0500 Subject: [vtkusers] vtkImageData transform with vtkImageResample/Reslice In-Reply-To: <3827B593-5F79-4D4E-84E1-89319E6653C9@ntnu.no> References: <3827B593-5F79-4D4E-84E1-89319E6653C9@ntnu.no> Message-ID: On Fri, Jan 30, 2015 at 6:05 AM, cameron.palmer at ntnu.no < cameron.palmer at ntnu.no> wrote: > I?ve seen a number of online examples using image reslice and resample > that don?t seem to work for me. I simply want to scale the image so > resample seems to be the way to go, but I always have trouble with the > various Input methods. What is the correct formulation for using > vtkImageData as input? > > vtkImageData* imageData; > ... > auto resample = vtkSmartPointer(); > resample->SetInput(imageData); > ... > resample->Update(); > Please provide the smallest possible compilable example of what you're trying to do, along with an explanation of what is not working (Is there a compiler error? If so, what is it? Is there a runtime error? Does it crash? If so, where? etc.) Here is an example of a basic use of vtkImageSlice: http://www.vtk.org/Wiki/VTK/Examples/Cxx/ImageData/ImageReslice David -------------- next part -------------- An HTML attachment was scrubbed... URL: From cameron.palmer at ntnu.no Fri Jan 30 08:00:21 2015 From: cameron.palmer at ntnu.no (cameron.palmer at ntnu.no) Date: Fri, 30 Jan 2015 13:00:21 +0000 Subject: [vtkusers] vtkImageData transform with vtkImageResample/Reslice In-Reply-To: References: <3827B593-5F79-4D4E-84E1-89319E6653C9@ntnu.no> Message-ID: You just made me think of it. vtkSmartPointer. I?ve gotten so used to shared_ptr I forget the syntax is slightly different. Isn?t this correct? vtkSmartPointer::New() NOT vtkSmartPointer() Out of curiosity will this go away in favor of the standard library? From: David Doria > Date: fredag 30. januar 2015 13.23 To: Cameron Lowell Palmer > Cc: VTK Users > Subject: Re: [vtkusers] vtkImageData transform with vtkImageResample/Reslice On Fri, Jan 30, 2015 at 6:05 AM, cameron.palmer at ntnu.no > wrote: I?ve seen a number of online examples using image reslice and resample that don?t seem to work for me. I simply want to scale the image so resample seems to be the way to go, but I always have trouble with the various Input methods. What is the correct formulation for using vtkImageData as input? vtkImageData* imageData; ... auto resample = vtkSmartPointer(); resample->SetInput(imageData); ... resample->Update(); Please provide the smallest possible compilable example of what you're trying to do, along with an explanation of what is not working (Is there a compiler error? If so, what is it? Is there a runtime error? Does it crash? If so, where? etc.) Here is an example of a basic use of vtkImageSlice: http://www.vtk.org/Wiki/VTK/Examples/Cxx/ImageData/ImageReslice David -------------- next part -------------- An HTML attachment was scrubbed... URL: From pjozog at gmail.com Fri Jan 30 16:52:14 2015 From: pjozog at gmail.com (pjozog) Date: Fri, 30 Jan 2015 14:52:14 -0700 (MST) Subject: [vtkusers] GetCellNeighbors in for loop Message-ID: <1422654734438-5730274.post@n5.nabble.com> Hello, I am trying to compute a 2D delaunay triangulation and determine which triangles are on the "outside" of the mesh. By that I mean: a triangle is on the outside if one of its edges does not have a neighboring triangle. First of all, is there a quick way to do this? I couldn't find such a function, so I'm trying to write one myself. Eventually I'd like to iterate over each triangle, and then access that triangle's neighbors. I've written the following code, which just gets the neighbor of the first two vertices encountered on the first triangle. The problem I see is that once I call GetCellNeighbors(), the call to GetNextCell() immediately returns 0 and the loop only iterates once! If I take out the call to GetCellNeighbors(), the loop iterates as I would expect it to. vtkSmartPointer data = (read a mesh from disk) vtkSmartPointer polys = data->GetPolys (); vtkIdType npoints, *pointIds, polyId=0; for (polys->InitTraversal (); polys->GetNextCell (npoints, pointIds); ++polyId) { vtkSmartPointer vertexIds = vtkSmartPointer::New (); vertexIds->InsertNextId (pointIds[0]); vertexIds->InsertNextId (pointIds[1]); vtkSmartPointer neighIds = vtkSmartPointer::New (); cout << "BEFORE GetCellNeighbors" << endl; polys->PrintSelf (cout, vtkIndent (0)); data->GetCellNeighbors (polyId, vertexIds, neighIds); cout << "AFTER GetCellNeighbors" << endl; polys->PrintSelf (cout, vtkIndent (0)); } This is the relavent output of the program: BEFORE GetCellNeighbors () ... Traversal Location: 4 AFTER GetCellNeighbors () ... Traversal Location: 128 I've uploaded the mesh I've been using to test the above code. So what am I doing wrong? Thanks. square-4x4.obj -- View this message in context: http://vtk.1045678.n5.nabble.com/GetCellNeighbors-in-for-loop-tp5730274.html Sent from the VTK - Users mailing list archive at Nabble.com.