From jaminus_jahnatos at freenet.de Sat Dec 1 04:58:11 2012 From: jaminus_jahnatos at freenet.de (=?ISO-8859-1?Q?Benjamin_J=E4hn?=) Date: Sat, 01 Dec 2012 10:58:11 +0100 Subject: [vtkusers] activiz vtkPolydataAlgorithm In-Reply-To: <1353752518721-5717263.post@n5.nabble.com> References: <1352652722221-5717071.post@n5.nabble.com> <50AFB7D7.2080400@freenet.de> <1353752518721-5717263.post@n5.nabble.com> Message-ID: <50B9D4B3.3070306@freenet.de> I found a topic where someone was able to inherit successfully from a Activiz/vtk class. [QUOTE] Note: All classes are static, that's the reason why you cannot inherit from any wrapped vtk class. But as I learned a few days ago there's a way to extent a static class. If you like I can show you how to do that. [/QUOTE] http://vtk.1045678.n5.nabble.com/vtkCallbackCommand-in-ActiveViz-td5714143.html#a5714197 And there is also an example how the guy managed it to do that. The example he wrote worked for me but I have tried it with another class and I get a InvalidCastException at the constructor. public class myCommand : vtkCommand { private vtkPolyData Points; public myCommand() { Points = vtkPolyData.New(); } //public override void Execute(vtkObject caller, uint eventId, IntPtr callData) //{ // base.Execute(caller, eventId, callData); // Console.WriteLine("Callback!"); //} } I did not understand so far why this not work and the other example works. Am 24.11.2012 11:21, schrieb I_like_activiz: > Basically you can write something like > > public class myFilter: vtkPolydataAlgorithm > > but if it would work to override any method, I can not say either. > I did not subclass any avtiviz class before. I tried it the first time, > but was not able to make it work and so I opened this topic. > > So maybe you are right. > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/activiz-vtkPolydataAlgorithm-tp5717071p5717263.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://www.vtk.org/mailman/listinfo/vtkusers From martin.buerger at aon.at Sat Dec 1 13:55:54 2012 From: martin.buerger at aon.at (I_like_activiz) Date: Sat, 1 Dec 2012 10:55:54 -0800 (PST) Subject: [vtkusers] activiz vtkPolydataAlgorithm In-Reply-To: <50B9D4B3.3070306@freenet.de> References: <1352652722221-5717071.post@n5.nabble.com> <50AFB7D7.2080400@freenet.de> <1353752518721-5717263.post@n5.nabble.com> <50B9D4B3.3070306@freenet.de> Message-ID: <17980125.347196.1354388092785.JavaMail.root@WARSBL213.highway.telekom.at> I think I will wait for the next release of activiz and hope that things will become better then. In between I will write my own filters by simply iterating over own vtkPolydata structures. I am very successfull with this although not getting the data processed in parallel. Meanwhile I tried paraview and python custom filters which is OK for prototyping purposes. Would be glad to stay in contact and get some news on this, if any... greets ----- Urspr?ngliche Nachricht ----- Von: "Benjamin J?hn [via VTK]" ml-node s1045678n5717361h83 at n5.nabble.com Erhalten: 01.12.2012 11:01 An: "I_like_activiz" martin.buerger at aon.at I found a topic where someone was able to inherit successfully from a Activiz/vtk class. [QUOTE] Note: All classes are static, that's the reason why you cannot inherit from any wrapped vtk class. But as I learned a few days ago there's a way to extent a static class. If you like I can show you how to do that. [/QUOTE] http://vtk.1045678.n5.nabble.com/vtkCallbackCommand-in-ActiveViz-td5714143.html#a5714197 And there is also an example how the guy managed it to do that. The example he wrote worked for me but I have tried it with another class and I get a InvalidCastException at the constructor. -- View this message in context: http://vtk.1045678.n5.nabble.com/activiz-vtkPolydataAlgorithm-tp5717071p5717362.html Sent from the VTK - Users mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From alan.mutka at gmail.com Sun Dec 2 08:07:17 2012 From: alan.mutka at gmail.com (amutka) Date: Sun, 2 Dec 2012 05:07:17 -0800 (PST) Subject: [vtkusers] Vertices with defined normal - visualization problem Message-ID: <1354453637246-5717365.post@n5.nabble.com> Dear All, i have problem with visualization of vtkPolyData which contains points(vertices). If I set normals for each point then in visualization I can see point only if the normal shows toward the camera. The backface culling effect cannot be disabled what ever I do. I have tried everything, changing the backface cooling parameters, adding additional scalars, changing all possible vtkActor propery and mapper parameters. Please help. Here is a simple example...based on online example adding normals to vertices http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PolyDataCellNormals Here is my example... ........................................................ /vtkSmartPointer points = vtkSmartPointer::New(); points->InsertNextPoint(1.0, 0.0, 0.0); points->InsertNextPoint(0.0, 0.0, 0.0); points->InsertNextPoint(0.0, 1.0, 0.0); vtkSmartPointer cloudCells=vtkSmartPointer::New(); for (vtkIdType i = 0; i < points->GetNumberOfPoints(); i++) { cloudCells->InsertNextCell(1, &i); } *// Add the points to a polydata* vtkSmartPointer polydata = vtkSmartPointer::New(); polydata->SetPoints(points); polydata->SetVerts(cloudCells);/ *///NOW CREATE NORMALS* vtkSmartPointer pointNormalsArray = vtkSmartPointer::New(); pointNormalsArray->SetNumberOfComponents(3); //3d normals (ie x,y,z) pointNormalsArray->SetNumberOfTuples(polydata->GetNumberOfPoints()); * // Construct the normal vectors* / double pN1[3] = {1.0, 0.0, 0.0}; double pN2[3] = {0.0, 1.0, 0.0}; double pN3[3] = {0.0, 0.0, 1.0};/ * // Add the data to the normals array* / pointNormalsArray->SetTuple(0, pN1) ; pointNormalsArray->SetTuple(1, pN2) ; pointNormalsArray->SetTuple(2, pN3) ;/ *//ADD NORMALS TO POLYDATA* /polydata->GetPointData()->SetNormals(pointNormalsArray); vtkPolyDataMapper * mapper = vtkPolyDataMapper::New(); mapper->SetInput(polydata); mapper->SetColorModeToMapScalars();/ * //RENDERING* / vtkActor * actor= vtkActor::New(); actor->GetProperty()->SetColor(1,1,0); actor->SetMapper(mapper); actor->GetProperty()->SetOpacity(0.8); vtkRenderWindowInteractor * iren1 = vtkRenderWindowInteractor::New(); vtkRenderer * ren1 = vtkRenderer::New(); vtkRenderWindow * renWin = vtkRenderWindow::New(); ren1->AddActor(actor); ren1->SetBackground(0,0,0); renWin->AddRenderer(ren1); iren1->SetRenderWindow(renWin); iren1->Initialize(); iren1->Start();/ -- View this message in context: http://vtk.1045678.n5.nabble.com/Vertices-with-defined-normal-visualization-problem-tp5717365.html Sent from the VTK - Users mailing list archive at Nabble.com. From daviddoria at gmail.com Sun Dec 2 11:10:58 2012 From: daviddoria at gmail.com (David Doria) Date: Sun, 2 Dec 2012 11:10:58 -0500 Subject: [vtkusers] Vertices with defined normal - visualization problem In-Reply-To: <1354453637246-5717365.post@n5.nabble.com> References: <1354453637246-5717365.post@n5.nabble.com> Message-ID: On Sun, Dec 2, 2012 at 8:07 AM, amutka wrote: > Dear All, > i have problem with visualization of vtkPolyData which contains > points(vertices). If I set normals for each point then in visualization I > can see point only if the normal shows toward the camera. The backface > culling effect cannot be disabled what ever I do. > I have tried everything, changing the backface cooling parameters, adding > additional scalars, changing all possible vtkActor propery and mapper > parameters. Please help. > > Here is a simple example...based on online example adding normals to > vertices > http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PolyDataCellNormals > > Here is my example... > ........................................................ > /vtkSmartPointer points = vtkSmartPointer::New(); > points->InsertNextPoint(1.0, 0.0, 0.0); > points->InsertNextPoint(0.0, 0.0, 0.0); > points->InsertNextPoint(0.0, 1.0, 0.0); > > vtkSmartPointer > cloudCells=vtkSmartPointer::New(); > for (vtkIdType i = 0; i < points->GetNumberOfPoints(); i++) > { > cloudCells->InsertNextCell(1, &i); > } > > *// Add the points to a polydata* > vtkSmartPointer polydata = > vtkSmartPointer::New(); > polydata->SetPoints(points); > polydata->SetVerts(cloudCells);/ > > *///NOW CREATE NORMALS* > vtkSmartPointer pointNormalsArray = > vtkSmartPointer::New(); > pointNormalsArray->SetNumberOfComponents(3); //3d normals (ie x,y,z) > pointNormalsArray->SetNumberOfTuples(polydata->GetNumberOfPoints()); > > * // Construct the normal vectors* > / double pN1[3] = {1.0, 0.0, 0.0}; > double pN2[3] = {0.0, 1.0, 0.0}; > double pN3[3] = {0.0, 0.0, 1.0};/ > > * // Add the data to the normals array* > / pointNormalsArray->SetTuple(0, pN1) ; > pointNormalsArray->SetTuple(1, pN2) ; > pointNormalsArray->SetTuple(2, pN3) ;/ > > *//ADD NORMALS TO POLYDATA* > > /polydata->GetPointData()->SetNormals(pointNormalsArray); > > vtkPolyDataMapper * mapper = vtkPolyDataMapper::New(); > mapper->SetInput(polydata); > mapper->SetColorModeToMapScalars();/ > > > * //RENDERING* > > / vtkActor * actor= vtkActor::New(); > actor->GetProperty()->SetColor(1,1,0); > actor->SetMapper(mapper); > actor->GetProperty()->SetOpacity(0.8); > > vtkRenderWindowInteractor * iren1 = vtkRenderWindowInteractor::New(); > vtkRenderer * ren1 = vtkRenderer::New(); > vtkRenderWindow * renWin = vtkRenderWindow::New(); > > ren1->AddActor(actor); > ren1->SetBackground(0,0,0); > > renWin->AddRenderer(ren1); > iren1->SetRenderWindow(renWin); > iren1->Initialize(); > iren1->Start();/ > > > You just need: actor->GetProperty()->SetInterpolationToFlat(); Also, when you post examples, make sure they don't have extra characters (/ and *) all around that have to be deleted, and include the include statements. This way we can copy+paste+compile to help you faster. David From matias at tailanian.com Sun Dec 2 12:37:26 2012 From: matias at tailanian.com (Matias Tailanian) Date: Sun, 2 Dec 2012 15:37:26 -0200 Subject: [vtkusers] Rotation not applied when importing VRML file. Message-ID: Dear all, I've been testing some examples about importing vrml files in vtk. I added an new example program to the VTK Wiki [1], where I show how to get an individual object from a a scene and its associated transform. The problem is that when importing the actor into vtk, it loses it's rotation. The traslation is correctly applied. The attached .wrl file was generated with 3d max10 and contains a teapot rotated 30? along x axis. [1] http://www.cmake.org/Wiki/VTK/Examples/Cxx/IO/individualVRML Thanks in advance. Best regards, Mat?as -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: teapot.WRL Type: model/vrml Size: 34938 bytes Desc: not available URL: From lobo.theslayer at gmail.com Sun Dec 2 20:26:25 2012 From: lobo.theslayer at gmail.com (Rodrigo Lovera) Date: Sun, 2 Dec 2012 20:26:25 -0500 Subject: [vtkusers] Problems Adding a contourwidget in a qvtkwidget Message-ID: Hello everyone, I'm trying to add a contourwidget as a tool to draw a contour over a medical image or volume im rendering. I need to add these with a pushbutton in my case, but haven't had any luck so far. I've tried these code http://www.vtk.org/Wiki/VTK/Examples/Cxx/Widgets/ContourWidget taking out some parts like the mouse events, but only draws 1 point at some part near my volume rendered and once I click over the qvtkwidget it just dissapers. I've done the same to a clean qvtkwdiget and it draws the full circle with the points, but doesn't allow me any kind of interaction. Same thing, the contour widget just dissapears as I click on th q vtkwidget. I need some guide in these plz. Any help 'd me appreciated, thx in advance. -- *Rodrigo * -------------- next part -------------- An HTML attachment was scrubbed... URL: From lobo.theslayer at gmail.com Mon Dec 3 00:02:29 2012 From: lobo.theslayer at gmail.com (Rodrigo Lovera) Date: Mon, 3 Dec 2012 00:02:29 -0500 Subject: [vtkusers] Comput the area contained by a contour (VTK C++) In-Reply-To: References: Message-ID: Hi Bouba, I was checking on the method you propose, but I don't get to set the input correctly for the triangle filter, considering i'm defining the 2D contour using the vtkContourWidget, so there is where im stucked atm. Checking vtkMassProperties I think surfacearea 'd suit well for computing area contained by the contour, hope you could give me an idea on how to connect the pipe between the contour widget and the triangle filter so I could test the rest. Thx in advance, Regards, Rodrigo 2012/11/29 Belaroussi, Boubakeur > Hi Rodrigo,**** > > ** ** > > For 2D contours, you can use the following pipeline:**** > > ** ** > > 1. Transform your contour points into triangles, using vtkTriangleFilter, > which creates triangle polygons from input polygons and triangle strips*** > * > > 2. Then, to get the area of your contour, among other features, you can > use the vtkMassProperties filter, which estimates volume, area, shape index > of triangle mesh.**** > > ** ** > > Hope it helps**** > > Regards,**** > > Bouba**** > > ** ** > > *From:* vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] *On > Behalf Of *Rodrigo Lovera > *Sent:* jeudi 29 novembre 2012 18:01 > *To:* VTK Users > *Subject:* [vtkusers] Comput the area contained by a contour (VTK C++)**** > > ** ** > > Hello everyone, > > I was wondering if any of you know a method to compute the area cointained > by a figure or maybe something like the contourwidget which shape can be > changed at will. > > What I need -d be some kind of implementation or code or guide on how to > perform that math operation, similar to the distance widget but what I need > to compute now is area. > > Id really appreciate any kind of help > > -- > *Rodrigo***** > -- > Confidentiality Notice: This e-mail transmission may contain confidential > or legally privileged information that is intended only for the individual > or entity named in the e-mail address. If you are not the intended > recipient, you are hereby notified that any disclosure, copying, > distribution, or reliance upon the contents of this e-mail is strictly > prohibited. If you have received this e-mail transmission in error, please > reply to the sender and then delete the message from your computer. Thank > you. > -- > -- *Rodrigo aka WarHearT* -------------- next part -------------- An HTML attachment was scrubbed... URL: From lobo.theslayer at gmail.com Mon Dec 3 01:24:21 2012 From: lobo.theslayer at gmail.com (Rodrigo Lovera) Date: Mon, 3 Dec 2012 01:24:21 -0500 Subject: [vtkusers] Getting vtkContourWidget into vtkTriangleFilter Message-ID: Hello everyone, I'm trying to get to measure the area contained inside a form made by vtkcontourwidget, now my problem is I can't get the connection into the vtktrianglefilter pipe. Does anyone know how to perform that?, so I can use vtkMassProperties to compute surface area. Regards, -- *Rodrigo* -------------- next part -------------- An HTML attachment was scrubbed... URL: From abhishek at meddiff.com Mon Dec 3 01:34:09 2012 From: abhishek at meddiff.com (abhishek) Date: Sun, 2 Dec 2012 22:34:09 -0800 (PST) Subject: [vtkusers] how to export volume? Message-ID: <1354516448762-5717372.post@n5.nabble.com> Hello Users, I have created VTK Volume from an array of 2D slices. I wish to export this volume. How can i do this? Regards Abhishek. -- View this message in context: http://vtk.1045678.n5.nabble.com/how-to-export-volume-tp5717372.html Sent from the VTK - Users mailing list archive at Nabble.com. From t_shinaji at chiba-u.jp Mon Dec 3 01:53:15 2012 From: t_shinaji at chiba-u.jp (shinaji) Date: Sun, 2 Dec 2012 22:53:15 -0800 (PST) Subject: [vtkusers] how to export volume? In-Reply-To: <1354516448762-5717372.post@n5.nabble.com> References: <1354516448762-5717372.post@n5.nabble.com> Message-ID: <1354517595145-5717373.post@n5.nabble.com> Hi Abhishek, If you want to get a volume data file, take try vtkXMLImageDataWriter. Here is an example. writer = vtk.vtkXMLImageDataWriter() writer.SetFileName(FileName) writer.SetInputConnection(imageData.GetProducerPort()) writer.Write() If you want to render a volume data, see http://vtk.org/gitweb?p=VTK.git;a=blob;f=Examples/VolumeRendering/Cxx/FixedPointVolumeRayCastMapperCT.cxx Regards Shinaji -- View this message in context: http://vtk.1045678.n5.nabble.com/how-to-export-volume-tp5717372p5717373.html Sent from the VTK - Users mailing list archive at Nabble.com. From abhishek at meddiff.com Mon Dec 3 01:57:40 2012 From: abhishek at meddiff.com (abhishek) Date: Sun, 2 Dec 2012 22:57:40 -0800 (PST) Subject: [vtkusers] how to export volume? In-Reply-To: <1354517595145-5717373.post@n5.nabble.com> References: <1354516448762-5717372.post@n5.nabble.com> <1354517595145-5717373.post@n5.nabble.com> Message-ID: Hello Shinaji, I'll try and load exported volume in iPAD using VES. On Mon, Dec 3, 2012 at 12:23 PM, shinaji [via VTK] < ml-node+s1045678n5717373h70 at n5.nabble.com> wrote: > Hi Abhishek, > > If you want to get a volume data file, take try vtkXMLImageDataWriter. > Here is an example. > > writer = vtk.vtkXMLImageDataWriter() > writer.SetFileName(FileName) > writer.SetInputConnection(imageData.GetProducerPort()) > writer.Write() > > If you want to render a volume data, see > > http://vtk.org/gitweb?p=VTK.git;a=blob;f=Examples/VolumeRendering/Cxx/FixedPointVolumeRayCastMapperCT.cxx > > Regards > Shinaji > > > > > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://vtk.1045678.n5.nabble.com/how-to-export-volume-tp5717372p5717373.html > To unsubscribe from how to export volume?, click here > . > NAML > -- Regards, *Abhishek Gupta* *Technical Lead* Meddiff Technologies Pvt. Ltd. Mobile: +91-9986919320 -- View this message in context: http://vtk.1045678.n5.nabble.com/how-to-export-volume-tp5717372p5717374.html Sent from the VTK - Users mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From wgt2050 at 163.com Mon Dec 3 04:01:52 2012 From: wgt2050 at 163.com (Guotai Wang) Date: Mon, 3 Dec 2012 01:01:52 -0800 (PST) Subject: [vtkusers] problem of re-rendering image that has been shrinked In-Reply-To: <1310979546427-4598678.post@n5.nabble.com> References: <1310979546427-4598678.post@n5.nabble.com> Message-ID: <1354525312500-5717376.post@n5.nabble.com> Hello shengwang: I am learning vtk recently and I am faced with the same problem as yours, so I wander if you had addressed this problem? How did you solve it? Thanks a lot~ -- View this message in context: http://vtk.1045678.n5.nabble.com/problem-of-re-rendering-image-that-has-been-shrinked-tp1237728p5717376.html Sent from the VTK - Users mailing list archive at Nabble.com. From abhishek at meddiff.com Mon Dec 3 04:35:48 2012 From: abhishek at meddiff.com (abhishek) Date: Mon, 3 Dec 2012 01:35:48 -0800 (PST) Subject: [vtkusers] Compiling VTK for iOS???? Message-ID: <1354527348093-5717378.post@n5.nabble.com> Hello Users, I want to use VTK libraries on iOS. As far as I know, VTK has a development branch named VES whose work is currently in progress and it does not come with most of the core VTK classes that I need to use. So i want to compile VTK for iOS. Someone who has done it, Please help. Regards Abhishek. -- View this message in context: http://vtk.1045678.n5.nabble.com/Compiling-VTK-for-iOS-tp5717378.html Sent from the VTK - Users mailing list archive at Nabble.com. From joachim.pouderoux at kitware.com Mon Dec 3 05:02:55 2012 From: joachim.pouderoux at kitware.com (Joachim Pouderoux) Date: Mon, 3 Dec 2012 11:02:55 +0100 Subject: [vtkusers] Compiling VTK for iOS???? In-Reply-To: <1354527348093-5717378.post@n5.nabble.com> References: <1354527348093-5717378.post@n5.nabble.com> Message-ID: Hi Abhishek, VTK as is will not compile on iOS because a lot of VTK code is based on the OpenGL rendering API which is not available on handhelds. VES provides a modified version of VTK where all the rendering modules are disabled. VES provides a rendering engine (based on OpenGL ES) which is totally different as the one implied in VTK for desktop. For now only geometric models are supported, and no volume rendering is available for use with OpenGL ES with VES (however I guess the CPU fixed raycasting engine - vtkFixedPointVolumeRayCastMapper - could work as is but you may expect slow rendering times...) Also think that OpenGL ES has many limitations, GPU volume rendering is computation intensive and handheld GPU are far having the same performances than desktop one. If you need to visualize large volume models, you may consider to use a remote rendering scheme as the one provided by ParaViewWeb. Regards, 2012/12/3 abhishek > Hello Users, > > I want to use VTK libraries on iOS. As far as I know, VTK has a development > branch named VES whose work is currently in progress and it does not come > with most of the core VTK classes that I need to use. > > So i want to compile VTK for iOS. Someone who has done it, Please help. > > Regards > Abhishek. > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Compiling-VTK-for-iOS-tp5717378.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://www.vtk.org/mailman/listinfo/vtkusers > -- *Joachim Pouderoux* *PhD, R&D Enginee*r *Kitware SAS * -------------- next part -------------- An HTML attachment was scrubbed... URL: From abhishek at meddiff.com Mon Dec 3 05:53:29 2012 From: abhishek at meddiff.com (Abhishek Gupta) Date: Mon, 3 Dec 2012 16:23:29 +0530 Subject: [vtkusers] Compiling VTK for iOS???? In-Reply-To: References: <1354527348093-5717378.post@n5.nabble.com> Message-ID: Hello Joachim, Target is to implement volume rendering application on iOS platform. If " vtkFixedPointVolumeRayCastMapper" can be used, could you please direct me to a suitable example? A quick question regarding paraview web. Will it work with iOS browsers? On Mon, Dec 3, 2012 at 3:32 PM, Joachim Pouderoux < joachim.pouderoux at kitware.com> wrote: > Hi Abhishek, > > VTK as is will not compile on iOS because a lot of VTK code is based on > the OpenGL rendering API which is not available on handhelds. > VES provides a modified version of VTK where all the rendering modules are > disabled. VES provides a rendering engine (based on OpenGL ES) > which is totally different as the one implied in VTK for desktop. > For now only geometric models are supported, and no volume rendering is > available for use with OpenGL ES > with VES (however I guess the CPU fixed raycasting engine - > vtkFixedPointVolumeRayCastMapper - could work as is but you may expect > slow rendering times...) Also think that OpenGL ES has many limitations, > GPU volume rendering is computation intensive and handheld GPU > are far having the same performances than desktop one. > If you need to visualize large volume models, you may consider to use a > remote rendering scheme as the one provided by ParaViewWeb. > > Regards, > > 2012/12/3 abhishek > >> Hello Users, >> >> I want to use VTK libraries on iOS. As far as I know, VTK has a >> development >> branch named VES whose work is currently in progress and it does not come >> with most of the core VTK classes that I need to use. >> >> So i want to compile VTK for iOS. Someone who has done it, Please help. >> >> Regards >> Abhishek. >> >> >> >> -- >> View this message in context: >> http://vtk.1045678.n5.nabble.com/Compiling-VTK-for-iOS-tp5717378.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://www.vtk.org/mailman/listinfo/vtkusers >> > > > > -- > *Joachim Pouderoux* > > *PhD, R&D Enginee*r > *Kitware SAS * > > > -- Regards, *Abhishek Gupta* *Technical Lead* Meddiff Technologies Pvt. Ltd. Mobile: +91-9986919320 -------------- next part -------------- An HTML attachment was scrubbed... URL: From joachim.pouderoux at kitware.com Mon Dec 3 06:41:00 2012 From: joachim.pouderoux at kitware.com (Joachim Pouderoux) Date: Mon, 3 Dec 2012 12:41:00 +0100 Subject: [vtkusers] Compiling VTK for iOS???? In-Reply-To: References: <1354527348093-5717378.post@n5.nabble.com> Message-ID: Sorry there is not suitable example because for now the vtkRenderingVolume module is not compiled and I could no tell yet if activating it could be done without any cascading issues... I will try soon and let you know. But once again, I do not know anything about what you are expecting but software volume rendering is slow and do not think to get real time interaction with it on real datasets... And yes, ParaViewWeb applications works well on iOS browsers! Joachim 2012/12/3 Abhishek Gupta > Hello Joachim, > > Target is to implement volume rendering application on iOS platform. If " > vtkFixedPointVolumeRayCastMapper" can be used, could you please direct me > to a suitable example? > > A quick question regarding paraview web. Will it work with iOS browsers? > > > > On Mon, Dec 3, 2012 at 3:32 PM, Joachim Pouderoux < > joachim.pouderoux at kitware.com> wrote: > >> Hi Abhishek, >> >> VTK as is will not compile on iOS because a lot of VTK code is based on >> the OpenGL rendering API which is not available on handhelds. >> VES provides a modified version of VTK where all the rendering modules >> are disabled. VES provides a rendering engine (based on OpenGL ES) >> which is totally different as the one implied in VTK for desktop. >> For now only geometric models are supported, and no volume rendering is >> available for use with OpenGL ES >> with VES (however I guess the CPU fixed raycasting engine - >> vtkFixedPointVolumeRayCastMapper - could work as is but you may expect >> slow rendering times...) Also think that OpenGL ES has many limitations, >> GPU volume rendering is computation intensive and handheld GPU >> are far having the same performances than desktop one. >> If you need to visualize large volume models, you may consider to use a >> remote rendering scheme as the one provided by ParaViewWeb. >> >> Regards, >> >> 2012/12/3 abhishek >> >>> Hello Users, >>> >>> I want to use VTK libraries on iOS. As far as I know, VTK has a >>> development >>> branch named VES whose work is currently in progress and it does not come >>> with most of the core VTK classes that I need to use. >>> >>> So i want to compile VTK for iOS. Someone who has done it, Please help. >>> >>> Regards >>> Abhishek. >>> >>> >>> >>> -- >>> View this message in context: >>> http://vtk.1045678.n5.nabble.com/Compiling-VTK-for-iOS-tp5717378.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://www.vtk.org/mailman/listinfo/vtkusers >>> >> >> >> >> -- >> *Joachim Pouderoux* >> >> *PhD, R&D Enginee*r >> *Kitware SAS * >> >> >> > > > -- > Regards, > *Abhishek Gupta* > *Technical Lead* > Meddiff Technologies Pvt. Ltd. > Mobile: +91-9986919320 > -- *Joachim Pouderoux* *PhD, R&D Enginee*r *Kitware SAS * -------------- next part -------------- An HTML attachment was scrubbed... URL: From aashish.chaudhary at kitware.com Mon Dec 3 11:15:34 2012 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Mon, 3 Dec 2012 11:15:34 -0500 Subject: [vtkusers] [Ves] Compiling VTK for iOS???? In-Reply-To: References: <1354527348093-5717378.post@n5.nabble.com> Message-ID: On Mon, Dec 3, 2012 at 5:53 AM, Abhishek Gupta wrote: > Hello Joachim, > > Target is to implement volume rendering application on iOS platform. If " > vtkFixedPointVolumeRayCastMapper" can be used, could you please direct me > to a suitable example? > > Abhishek, I think if you need something right now to support volume rendering, I would suggest ParaViewWeb. In there you can perform volume rendering on the server side, create an image, and have it delivered to the mobile system. In that you can still use all of your current code. > A quick question regarding paraview web. Will it work with iOS browsers? > > > > On Mon, Dec 3, 2012 at 3:32 PM, Joachim Pouderoux < > joachim.pouderoux at kitware.com> wrote: > >> Hi Abhishek, >> >> VTK as is will not compile on iOS because a lot of VTK code is based on >> the OpenGL rendering API which is not available on handhelds. >> VES provides a modified version of VTK where all the rendering modules >> are disabled. VES provides a rendering engine (based on OpenGL ES) >> which is totally different as the one implied in VTK for desktop. >> For now only geometric models are supported, and no volume rendering is >> available for use with OpenGL ES >> with VES (however I guess the CPU fixed raycasting engine - >> vtkFixedPointVolumeRayCastMapper - could work as is but you may expect >> slow rendering times...) Also think that OpenGL ES has many limitations, >> GPU volume rendering is computation intensive and handheld GPU >> are far having the same performances than desktop one. >> If you need to visualize large volume models, you may consider to use a >> remote rendering scheme as the one provided by ParaViewWeb. >> >> Regards, >> >> 2012/12/3 abhishek >> >>> Hello Users, >>> >>> I want to use VTK libraries on iOS. As far as I know, VTK has a >>> development >>> branch named VES whose work is currently in progress and it does not come >>> with most of the core VTK classes that I need to use. >>> >>> So i want to compile VTK for iOS. Someone who has done it, Please help. >>> >>> Regards >>> Abhishek. >>> >>> >>> >>> -- >>> View this message in context: >>> http://vtk.1045678.n5.nabble.com/Compiling-VTK-for-iOS-tp5717378.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://www.vtk.org/mailman/listinfo/vtkusers >>> >> >> >> >> -- >> *Joachim Pouderoux* >> >> *PhD, R&D Enginee*r >> *Kitware SAS * >> >> >> > > > -- > Regards, > *Abhishek Gupta* > *Technical Lead* > Meddiff Technologies Pvt. Ltd. > Mobile: +91-9986919320 > > _______________________________________________ > Ves mailing list > Ves at public.kitware.com > http://public.kitware.com/cgi-bin/mailman/listinfo/ves > > -- | Aashish Chaudhary | R&D Engineer | Kitware Inc. | www.kitware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From speisser at kappaeng.com Mon Dec 3 11:31:56 2012 From: speisser at kappaeng.com (=?ISO-8859-1?Q?Fr=E9d=E9ric_Speisser?=) Date: Mon, 3 Dec 2012 17:31:56 +0100 Subject: [vtkusers] color mapping Message-ID: <50BCD3FC.2070202@kappaeng.com> Hi all, I'm using /vtkLookupTable::SetTableRange/ to remap colors of a LUT to a custom range of a given scalar values. This works great but per default and as explained in API documentation : /Scalar values less than minimum range value are clamped to minimum range value. Scalar values greater than maximum range value are clamped to maximum range value. /So values out of range are displayed in minimum range value color (for those under custom range) and in maximum range value color (for those over custom range). I would like to display out-of-range values in a custom color, so that for example all values under and over custom range are displayed in black. I began to write a class /MyVtkLookupTable/ which inherits from /vtkLookupTable /and i tried to override /GetColor(double v, double rgb[3])/ and /MapValue(double v)/ to be able to override color displayed but it seems not to work. Is it possible to do that by overriding vtk classes ? If yes, which method/classes should I override ? Any clues are wellcome, thank you, Fr?d?ric -------------- next part -------------- An HTML attachment was scrubbed... URL: From alan.mutka at gmail.com Mon Dec 3 11:36:00 2012 From: alan.mutka at gmail.com (amutka) Date: Mon, 3 Dec 2012 08:36:00 -0800 (PST) Subject: [vtkusers] Vertices with defined normal - visualization problem In-Reply-To: <1354453637246-5717365.post@n5.nabble.com> References: <1354453637246-5717365.post@n5.nabble.com> Message-ID: <1354552560710-5717385.post@n5.nabble.com> Thank You, it's working! Best Regards Alan -- View this message in context: http://vtk.1045678.n5.nabble.com/Vertices-with-defined-normal-visualization-problem-tp5717365p5717385.html Sent from the VTK - Users mailing list archive at Nabble.com. From j.strecha at gmail.com Mon Dec 3 12:12:05 2012 From: j.strecha at gmail.com (Johannes Strecha) Date: Mon, 3 Dec 2012 18:12:05 +0100 Subject: [vtkusers] color mapping In-Reply-To: <50BCD3FC.2070202@kappaeng.com> References: <50BCD3FC.2070202@kappaeng.com> Message-ID: Hello, I can't give you a direct answer, but I think what you want can be done with the vtkClipDataSet filter (5.8). See the reference for details. I assume that adjusting the lookup table would work faster, though. When trying to realize a "filled contour plot" by adjusting the lookup table (to a series of steps) I experienced that some interpolation was performed nonetheless and I ended up with blurred filled contours. Maybe this would also happen in your case. Kind regards, Johannes Strecha. On Mon, Dec 3, 2012 at 5:31 PM, Fr?d?ric Speisser wrote: > Hi all, > > > I'm using *vtkLookupTable::SetTableRange* to remap colors of a LUT to a > custom range of a given scalar values. > > This works great but per default and as explained in API documentation : > *Scalar values less than minimum range value are clamped to minimum range > value. Scalar values greater than maximum range value are clamped to > maximum range value. > *So values out of range are displayed in minimum range value color (for > those under custom range) and in maximum range value color (for those over > custom range). > I would like to display out-of-range values in a custom color, so that for > example all values under and over custom range are displayed in black. > I began to write a class *MyVtkLookupTable* which inherits from *vtkLookupTable > *and i tried to override *GetColor(double v, double rgb[3])* and *MapValue(double > v)* to be able to override color displayed but it seems not to work. > Is it possible to do that by overriding vtk classes ? If yes, which > method/classes should I override ? > > Any clues are wellcome, thank you, > > > > Fr?d?ric > > _______________________________________________ > 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://www.vtk.org/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From speisser at kappaeng.com Mon Dec 3 12:20:25 2012 From: speisser at kappaeng.com (=?ISO-8859-1?Q?Fr=E9d=E9ric_Speisser?=) Date: Mon, 3 Dec 2012 18:20:25 +0100 Subject: [vtkusers] color mapping In-Reply-To: References: <50BCD3FC.2070202@kappaeng.com> Message-ID: <50BCDF59.8090609@kappaeng.com> Thank you Johannes for your answer, Yes, I know this algorithm, I also use it to filter data. But here my aim is not to filter data out-of-range but to keep these data visible but set in a custom color. Kind regards, Fr?d?ric Le 03/12/2012 18:12, Johannes Strecha a ?crit : > Hello, > > I can't give you a direct answer, but I think what you want can be > done with the vtkClipDataSet filter (5.8). See the reference for > details. I assume that adjusting the lookup table would work faster, > though. > > When trying to realize a "filled contour plot" by adjusting the lookup > table (to a series of steps) I experienced that some interpolation was > performed nonetheless and I ended up with blurred filled contours. > Maybe this would also happen in your case. > > Kind regards, > Johannes Strecha. > > > On Mon, Dec 3, 2012 at 5:31 PM, Fr?d?ric Speisser > > wrote: > > Hi all, > > > I'm using /vtkLookupTable::SetTableRange/ to remap colors of a LUT > to a custom range of a given scalar values. > > This works great but per default and as explained in API > documentation : > /Scalar values less than minimum range value are clamped to > minimum range value. Scalar values greater than maximum range > value are clamped to maximum range value. > /So values out of range are displayed in minimum range value color > (for those under custom range) and in maximum range value color > (for those over custom range). > I would like to display out-of-range values in a custom color, so > that for example all values under and over custom range are > displayed in black. > I began to write a class /MyVtkLookupTable/ which inherits from > /vtkLookupTable /and i tried to override /GetColor(double v, > double rgb[3])/ and /MapValue(double v)/ to be able to override > color displayed but it seems not to work. > Is it possible to do that by overriding vtk classes ? If yes, > which method/classes should I override ? > > Any clues are wellcome, thank you, > > > > Fr?d?ric > > _______________________________________________ > 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://www.vtk.org/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From abhishek at meddiff.com Mon Dec 3 12:30:05 2012 From: abhishek at meddiff.com (abhishek) Date: Mon, 3 Dec 2012 09:30:05 -0800 (PST) Subject: [vtkusers] [Ves] Compiling VTK for iOS???? In-Reply-To: References: <1354527348093-5717378.post@n5.nabble.com> Message-ID: Ashish, I have experience writing server apps using python. Since my current application's server side is completely in python, I would prefer coding server side in python. Today, I had a look at ParaViewWeb documentation & setup guide. It is entirely written in java. Is it possible to use, javascript rendered code and integrate it with python server? Regards Abhishek. On Mon, Dec 3, 2012 at 9:46 PM, Aashish Chaudhary-2 [via VTK] < ml-node+s1045678n5717383h80 at n5.nabble.com> wrote: > On Mon, Dec 3, 2012 at 5:53 AM, Abhishek Gupta <[hidden email] > > wrote: > >> Hello Joachim, >> >> Target is to implement volume rendering application on iOS platform. If " >> vtkFixedPointVolumeRayCastMapper" can be used, could you please direct >> me to a suitable example? >> >> > Abhishek, I think if you need something right now to support volume > rendering, I would suggest ParaViewWeb. In there you can perform volume > rendering on the server side, create an image, and have it delivered to the > mobile system. In that you can still use all of your current code. > > >> A quick question regarding paraview web. Will it work with iOS browsers? >> >> >> >> On Mon, Dec 3, 2012 at 3:32 PM, Joachim Pouderoux <[hidden email] >> > wrote: >> >>> Hi Abhishek, >>> >>> VTK as is will not compile on iOS because a lot of VTK code is based on >>> the OpenGL rendering API which is not available on handhelds. >>> VES provides a modified version of VTK where all the rendering modules >>> are disabled. VES provides a rendering engine (based on OpenGL ES) >>> which is totally different as the one implied in VTK for desktop. >>> For now only geometric models are supported, and no volume rendering is >>> available for use with OpenGL ES >>> with VES (however I guess the CPU fixed raycasting engine - >>> vtkFixedPointVolumeRayCastMapper - could work as is but you may expect >>> slow rendering times...) Also think that OpenGL ES has many limitations, >>> GPU volume rendering is computation intensive and handheld GPU >>> are far having the same performances than desktop one. >>> If you need to visualize large volume models, you may consider to use a >>> remote rendering scheme as the one provided by ParaViewWeb. >>> >>> Regards, >>> >>> 2012/12/3 abhishek <[hidden email] >>> > >>> >>> Hello Users, >>>> >>>> I want to use VTK libraries on iOS. As far as I know, VTK has a >>>> development >>>> branch named VES whose work is currently in progress and it does not >>>> come >>>> with most of the core VTK classes that I need to use. >>>> >>>> So i want to compile VTK for iOS. Someone who has done it, Please help. >>>> >>>> Regards >>>> Abhishek. >>>> >>>> >>>> >>>> -- >>>> View this message in context: >>>> http://vtk.1045678.n5.nabble.com/Compiling-VTK-for-iOS-tp5717378.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://www.vtk.org/mailman/listinfo/vtkusers >>>> >>> >>> >>> >>> -- >>> *Joachim Pouderoux* >>> >>> *PhD, R&D Enginee*r >>> *Kitware SAS * >>> >>> >>> >> >> >> -- >> Regards, >> *Abhishek Gupta* >> *Technical Lead* >> Meddiff Technologies Pvt. Ltd. >> Mobile: > target="_blank">+91-9986919320 >> >> _______________________________________________ >> Ves mailing list >> [hidden email] >> http://public.kitware.com/cgi-bin/mailman/listinfo/ves >> >> > > > -- > | Aashish Chaudhary > | R&D Engineer > | Kitware Inc. > | www.kitware.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://www.vtk.org/mailman/listinfo/vtkusers > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://vtk.1045678.n5.nabble.com/Compiling-VTK-for-iOS-tp5717378p5717383.html > To unsubscribe from Compiling VTK for iOS????, click here > . > NAML > -- Regards, *Abhishek Gupta* *Technical Lead* Meddiff Technologies Pvt. Ltd. Mobile: +91-9986919320 -- View this message in context: http://vtk.1045678.n5.nabble.com/Compiling-VTK-for-iOS-tp5717378p5717388.html Sent from the VTK - Users mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lobo.theslayer at gmail.com Mon Dec 3 14:00:37 2012 From: lobo.theslayer at gmail.com (Rodrigo Lovera) Date: Mon, 3 Dec 2012 14:00:37 -0500 Subject: [vtkusers] Problems with massProperties at getting area from ContourWidget Message-ID: Hello everyone, I've applied the vtkContourWidget in the same way the distancewidget is applied in the QT VTK FOUR PANE VIEW EXAMPLE so far everything is fine, but I'm trying now to compute the area so I connect the following code to an pushButton which 'll be activated after finishing drawing the contour. vtkSmartPointer< vtkTriangleFilter > triangleTrans = vtkSmartPointer< vtkTriangleFilter >::New(); triangleTrans->SetInput(contourRepresentation->GetContourRepresentationAsPolyData()); vtkSmartPointer< vtkMassProperties > massProp = vtkSmartPointer< vtkMassProperties >::New(); massProp->SetInput(triangleTrans->GetOutput()); massProp->GetSurfaceArea(); this->ui->surfaceAreaLabel->setNum(massProp->GetSurfaceArea()); What I'm trying to do is convert the contour in a triangle mesh so then I can apply vtkMassProperties and get the surface area which is my goal. Everythings build ok, but once in the gui when pushing the button... it gives me the following error: Warning: In C:\Users\RODRIGO LOVERA\Documents\PUCP\Tesis\VTK 5.10\VTK\Graphics\vtkMassProperties.cxx, line 120 vtkMassProperties (04C64588): Input data type must be VTK_TRIANGLE not 3 What I use to draw the contours is the following code: -- *Rodrigo Lovera* -------------- next part -------------- An HTML attachment was scrubbed... URL: From lobo.theslayer at gmail.com Mon Dec 3 14:01:35 2012 From: lobo.theslayer at gmail.com (Rodrigo Lovera) Date: Mon, 3 Dec 2012 14:01:35 -0500 Subject: [vtkusers] Problems with massProperties at getting area from ContourWidget In-Reply-To: References: Message-ID: //Agregar un nuevo widget this->ContourWidget[i] = vtkSmartPointer< vtkContourWidget >::New(); this->ContourWidget[i]->SetInteractor( this->riw[i]->GetResliceCursorWidget()->GetInteractor()); //Crear la Representacion Geometrica para el ContourWidget contourRepresentation =vtkSmartPointer< vtkOrientedGlyphContourRepresentation >::New(); contourRepresentation->GetProperty()->SetColor(0.25, 1.0, 0.25); vtkSmartPointer< vtkSphereSource > ss = vtkSmartPointer< vtkSphereSource >::New(); ss->SetRadius(0.5); contourRepresentation->SetActiveCursorShape(ss->GetOutput()); contourRepresentation->GetActiveProperty()->SetAmbient(0.1); contourRepresentation->GetActiveProperty()->SetDiffuse(0.9); contourRepresentation->GetActiveProperty()->SetSpecular(0.0); I really hope someone can help me correct these. Regards Rodrigo Lovera //Configurar la prioridad mayor a la del reslice this->ContourWidget[i]->SetPriority( this->riw[i]->GetResliceCursorWidget()->GetPriority() + 0.01); this->ContourWidget[i]->SetRepresentation(contourRepresentation); this->ContourWidget[i]->EnabledOn(); //this->ContourWidget[i]->ProcessEventsOn(); this->riw[i]->GetMeasurements()->AddItem(this->ContourWidget[i]); 2012/12/3 Rodrigo Lovera > Hello everyone, > > I've applied the vtkContourWidget in the same way the distancewidget is > applied in the QT VTK FOUR PANE VIEW EXAMPLE > > so far everything is fine, but I'm trying now to compute the area so I > connect the following code to an pushButton which 'll be activated after > finishing drawing the contour. > > vtkSmartPointer< vtkTriangleFilter > triangleTrans = > vtkSmartPointer< vtkTriangleFilter >::New(); > > triangleTrans->SetInput(contourRepresentation->GetContourRepresentationAsPolyData()); > vtkSmartPointer< vtkMassProperties > massProp = > vtkSmartPointer< vtkMassProperties >::New(); > massProp->SetInput(triangleTrans->GetOutput()); > massProp->GetSurfaceArea(); > this->ui->surfaceAreaLabel->setNum(massProp->GetSurfaceArea()); > > What I'm trying to do is convert the contour in a triangle mesh so then I > can apply vtkMassProperties and get the surface area which is my goal. > > Everythings build ok, but once in the gui when pushing the button... it > gives me the following error: > > Warning: In C:\Users\RODRIGO LOVERA\Documents\PUCP\Tesis\VTK > 5.10\VTK\Graphics\vtkMassProperties.cxx, line 120 > vtkMassProperties (04C64588): Input data type must be VTK_TRIANGLE not 3 > > What I use to draw the contours is the following code: > > > > > -- > *Rodrigo Lovera* > -- *Rodrigo aka WarHearT* -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Mon Dec 3 14:03:16 2012 From: daviddoria at gmail.com (David Doria) Date: Mon, 3 Dec 2012 14:03:16 -0500 Subject: [vtkusers] Problems with massProperties at getting area from ContourWidget In-Reply-To: References: Message-ID: On Mon, Dec 3, 2012 at 2:00 PM, Rodrigo Lovera wrote: > Hello everyone, > > I've applied the vtkContourWidget in the same way the distancewidget is > applied in the QT VTK FOUR PANE VIEW EXAMPLE > > so far everything is fine, but I'm trying now to compute the area so I > connect the following code to an pushButton which 'll be activated after > finishing drawing the contour. > > vtkSmartPointer< vtkTriangleFilter > triangleTrans = > vtkSmartPointer< vtkTriangleFilter >::New(); > > triangleTrans->SetInput(contourRepresentation->GetContourRepresentationAsPolyData()); > vtkSmartPointer< vtkMassProperties > massProp = > vtkSmartPointer< vtkMassProperties >::New(); > massProp->SetInput(triangleTrans->GetOutput()); > massProp->GetSurfaceArea(); > this->ui->surfaceAreaLabel->setNum(massProp->GetSurfaceArea()); > > What I'm trying to do is convert the contour in a triangle mesh so then I > can apply vtkMassProperties and get the surface area which is my goal. > > Everythings build ok, but once in the gui when pushing the button... it > gives me the following error: > > Warning: In C:\Users\RODRIGO LOVERA\Documents\PUCP\Tesis\VTK > 5.10\VTK\Graphics\vtkMassProperties.cxx, line 120 > vtkMassProperties (04C64588): Input data type must be VTK_TRIANGLE not 3 > > What I use to draw the contours is the following code: > As usual, I suggest you create a compilable example. It doesn't sound like this has anything to do with Qt, so it should be a single, self contained file (generate data similar to the data you are reading in your real code). David -------------- next part -------------- An HTML attachment was scrubbed... URL: From lobo.theslayer at gmail.com Mon Dec 3 14:07:40 2012 From: lobo.theslayer at gmail.com (Rodrigo Lovera) Date: Mon, 3 Dec 2012 14:07:40 -0500 Subject: [vtkusers] Comput the area contained by a contour (VTK C++) In-Reply-To: References: Message-ID: Well, I applied what you said but I'm getting these error: Warning: In C:\Users\RODRIGO LOVERA\Documents\PUCP\Tesis\VTK 5.10\VTK\Graphics\vtkMassProperties.cxx, line 120 vtkMassProperties (04C64588): Input data type must be VTK_TRIANGLE not 3 I'm taking as a base the FOUR PANE VIEWER VTK QT EXAMPLE that comes with the documentation. I applied the vtkContourWidget in a similar way the distancewidget is applied: void mainwindow::AddContourToView(int i) { // Remover widgets existentes if (this->ContourWidget[i]) { this->ContourWidget[i]->SetEnabled(0); this->ContourWidget[i] = NULL; } //Agregar un nuevo widget this->ContourWidget[i] = vtkSmartPointer< vtkContourWidget >::New(); this->ContourWidget[i]->SetInteractor( this->riw[i]->GetResliceCursorWidget()->GetInteractor()); //Crear la Representacion Geometrica para el ContourWidget contourRepresentation =vtkSmartPointer< vtkOrientedGlyphContourRepresentation >::New(); contourRepresentation->GetProperty()->SetColor(0.25, 1.0, 0.25); vtkSmartPointer< vtkSphereSource > ss = vtkSmartPointer< vtkSphereSource >::New(); ss->SetRadius(0.5); contourRepresentation->SetActiveCursorShape(ss->GetOutput()); contourRepresentation->GetActiveProperty()->SetAmbient(0.1); contourRepresentation->GetActiveProperty()->SetDiffuse(0.9); contourRepresentation->GetActiveProperty()->SetSpecular(0.0); //Configurar la prioridad mayor a la del reslice this->ContourWidget[i]->SetPriority( this->riw[i]->GetResliceCursorWidget()->GetPriority() + 0.01); this->ContourWidget[i]->SetRepresentation(contourRepresentation); this->ContourWidget[i]->EnabledOn(); //this->ContourWidget[i]->ProcessEventsOn(); this->riw[i]->GetMeasurements()->AddItem(this->ContourWidget[i]); } After that I got another button wich 'll be applied to compute the are with the method you mentioned, I wrote sth like: vtkSmartPointer< vtkTriangleFilter > triangleTrans = vtkSmartPointer< vtkTriangleFilter >::New(); triangleTrans->SetInput(contourRepresentation->GetContourRepresentationAsPolyData()); vtkSmartPointer< vtkMassProperties > massProp = vtkSmartPointer< vtkMassProperties >::New(); massProp->SetInput(triangleTrans->GetOutput()); massProp->GetSurfaceArea(); this->ui->surfaceAreaLabel->setNum(massProp->GetSurfaceArea()); But the problem is the one I mentioned at the start, hope you have a better idea on what to do. Thx in advance. Regards Rodrigo Lovera 2012/12/3 Rodrigo Lovera > Hi Bouba, > > I was checking on the method you propose, but I don't get to set the input > correctly for the triangle filter, considering i'm defining the 2D contour > using the vtkContourWidget, so there is where im stucked atm. > > Checking vtkMassProperties I think surfacearea 'd suit well for computing > area contained by the contour, hope you could give me an idea on how to > connect the pipe between the contour widget and the triangle filter so I > could test the rest. > > Thx in advance, > > Regards, > Rodrigo > > > 2012/11/29 Belaroussi, Boubakeur > > Hi Rodrigo,**** >> >> ** ** >> >> For 2D contours, you can use the following pipeline:**** >> >> ** ** >> >> 1. Transform your contour points into triangles, using vtkTriangleFilter, >> which creates triangle polygons from input polygons and triangle strips** >> ** >> >> 2. Then, to get the area of your contour, among other features, you can >> use the vtkMassProperties filter, which estimates volume, area, shape index >> of triangle mesh.**** >> >> ** ** >> >> Hope it helps**** >> >> Regards,**** >> >> Bouba**** >> >> ** ** >> >> *From:* vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] *On >> Behalf Of *Rodrigo Lovera >> *Sent:* jeudi 29 novembre 2012 18:01 >> *To:* VTK Users >> *Subject:* [vtkusers] Comput the area contained by a contour (VTK C++)*** >> * >> >> ** ** >> >> Hello everyone, >> >> I was wondering if any of you know a method to compute the area >> cointained by a figure or maybe something like the contourwidget which >> shape can be changed at will. >> >> What I need -d be some kind of implementation or code or guide on how to >> perform that math operation, similar to the distance widget but what I need >> to compute now is area. >> >> Id really appreciate any kind of help >> >> -- >> *Rodrigo***** >> -- >> Confidentiality Notice: This e-mail transmission may contain confidential >> or legally privileged information that is intended only for the individual >> or entity named in the e-mail address. If you are not the intended >> recipient, you are hereby notified that any disclosure, copying, >> distribution, or reliance upon the contents of this e-mail is strictly >> prohibited. If you have received this e-mail transmission in error, please >> reply to the sender and then delete the message from your computer. Thank >> you. >> -- >> > > > > -- > *Rodrigo aka WarHearT* > -- *Rodrigo aka WarHearT* -------------- next part -------------- An HTML attachment was scrubbed... URL: From lobo.theslayer at gmail.com Mon Dec 3 14:28:30 2012 From: lobo.theslayer at gmail.com (Rodrigo Lovera) Date: Mon, 3 Dec 2012 14:28:30 -0500 Subject: [vtkusers] Problems with massProperties at getting area from ContourWidget In-Reply-To: References: Message-ID: OK, these 'd be the example: #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include int main( int argc, char *argv[] ) { // Create the RenderWindow, Renderer and both Actors // vtkSmartPointer renderer = vtkSmartPointer::New(); vtkSmartPointer renderWindow = vtkSmartPointer::New(); renderWindow->AddRenderer(renderer); vtkSmartPointer interactor = vtkSmartPointer::New(); interactor->SetRenderWindow(renderWindow); renderer->SetBackground(0.1, 0.2, 0.4); renderWindow->SetSize(600, 600); vtkSmartPointer contourRep = vtkSmartPointer::New(); contourRep->GetLinesProperty()->SetColor(1, 0, 0); //set color to red vtkSmartPointer contourWidget = vtkSmartPointer::New(); contourWidget->SetInteractor(interactor); contourWidget->SetRepresentation(contourRep); contourWidget->On(); for (int i = 0; i < argc; i++) { if (strcmp("-Shift", argv[i]) == 0) { contourWidget->GetEventTranslator()->RemoveTranslation( vtkCommand::LeftButtonPressEvent ); contourWidget->GetEventTranslator()->SetTranslation( vtkCommand::LeftButtonPressEvent, vtkWidgetEvent::Translate ); } else if (strcmp("-Scale", argv[i]) == 0) { contourWidget->GetEventTranslator()->RemoveTranslation( vtkCommand::LeftButtonPressEvent ); contourWidget->GetEventTranslator()->SetTranslation( vtkCommand::LeftButtonPressEvent, vtkWidgetEvent::Scale ); } } vtkSmartPointer pd = vtkSmartPointer::New(); vtkSmartPointer points = vtkSmartPointer::New(); vtkSmartPointer lines = vtkSmartPointer::New(); vtkIdType* lineIndices = new vtkIdType[21]; for (int i = 0; i< 20; i++) { const double angle = 2.0*vtkMath::Pi()*i/20.0; points->InsertPoint(static_cast(i), 0.1*cos(angle), 0.1*sin(angle), 0.0 ); lineIndices[i] = static_cast(i); } lineIndices[20] = 0; lines->InsertNextCell(21,lineIndices); delete [] lineIndices; pd->SetPoints(points); pd->SetLines(lines); contourWidget->Initialize(pd); contourWidget->Render(); renderer->ResetCamera(); renderWindow->Render(); interactor->Initialize(); interactor->Start(); vtkSmartPointer< vtkTriangleFilter > triangles = vtkSmartPointer< vtkTriangleFilter >::New(); triangles->SetInput(contourRep->GetContourRepresentationAsPolyData()); vtkSmartPointer< vtkMassProperties > massProp = vtkSmartPointer< vtkMassProperties >::New(); massProp->SetInput(triangles->GetOutput()); double algo = massProp->GetSurfaceArea(); std::cout<< algo; contourWidget->Off(); return EXIT_SUCCESS; } There's is the contourwidget example but i'm adding the pipe I think 'd be necessary to compute the area. It still gives me same error as before at closing the renderwindow for some reason: Warning: In C:\Users\RODRIGO LOVERA\Documents\PUCP\Tesis\VTK 5.10\VTK\Graphics\vtkMassProperties.cxx, line 120 vtkMassProperties (04C64588): Input data type must be VTK_TRIANGLE not 3 Hope you can help me get throught these or maybe give some other advice on how to get the value of the area contained by a contourwidget created at will. Regards, Rodrigo Lovera 2012/12/3 David Doria > On Mon, Dec 3, 2012 at 2:00 PM, Rodrigo Lovera wrote: > >> Hello everyone, >> >> I've applied the vtkContourWidget in the same way the distancewidget is >> applied in the QT VTK FOUR PANE VIEW EXAMPLE >> >> so far everything is fine, but I'm trying now to compute the area so I >> connect the following code to an pushButton which 'll be activated after >> finishing drawing the contour. >> >> vtkSmartPointer< vtkTriangleFilter > triangleTrans = >> vtkSmartPointer< vtkTriangleFilter >::New(); >> >> triangleTrans->SetInput(contourRepresentation->GetContourRepresentationAsPolyData()); >> vtkSmartPointer< vtkMassProperties > massProp = >> vtkSmartPointer< vtkMassProperties >::New(); >> massProp->SetInput(triangleTrans->GetOutput()); >> massProp->GetSurfaceArea(); >> this->ui->surfaceAreaLabel->setNum(massProp->GetSurfaceArea()); >> >> What I'm trying to do is convert the contour in a triangle mesh so then I >> can apply vtkMassProperties and get the surface area which is my goal. >> >> Everythings build ok, but once in the gui when pushing the button... it >> gives me the following error: >> >> Warning: In C:\Users\RODRIGO LOVERA\Documents\PUCP\Tesis\VTK >> 5.10\VTK\Graphics\vtkMassProperties.cxx, line 120 >> vtkMassProperties (04C64588): Input data type must be VTK_TRIANGLE not 3 >> >> What I use to draw the contours is the following code: >> > > As usual, I suggest you create a compilable example. It doesn't sound like > this has anything to do with Qt, so it should be a single, self contained > file (generate data similar to the data you are reading in your real code). > > David > -- *Rodrigo aka WarHearT* -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Mon Dec 3 14:56:46 2012 From: daviddoria at gmail.com (David Doria) Date: Mon, 3 Dec 2012 14:56:46 -0500 Subject: [vtkusers] Problems with massProperties at getting area from ContourWidget In-Reply-To: References: Message-ID: This also has nothing to do with the widget. You can produce the same error with much simpler code (see below). You can see from here: http://www.vtk.org/doc/nightly/html/vtkCellType_8h_source.html that "3" means VTK_LINE, which makes sense, because you added lines to the polydata. The vtkTriangleFilter doesn't sound like it triangulates the area inside the contour, but rather only divides existing polygons into triangles: http://www.vtk.org/doc/nightly/html/classvtkTriangleFilter.html#details So what you have to do instead is make a polygon from your points, then it seems to work: #include #include #include #include #include #include #include #include int main() { vtkSmartPointer polydata = vtkSmartPointer::New(); vtkSmartPointer points = vtkSmartPointer::New(); vtkSmartPointer cellArray = vtkSmartPointer::New(); const unsigned int numberOfPoints = 21; // Create the polygon vtkSmartPointer polygon = vtkSmartPointer::New(); polygon->GetPointIds()->SetNumberOfIds(numberOfPoints); vtkIdType* lineIndices = new vtkIdType[numberOfPoints]; for (int i = 0; i < numberOfPoints; i++) { polygon->GetPointIds()->SetId(i, i); const double angle = 2.0*vtkMath::Pi()*i/static_cast(numberOfPoints); points->InsertPoint(static_cast(i), 0.1*cos(angle), 0.1*sin(angle), 0.0 ); lineIndices[i] = static_cast(i); } cellArray->InsertNextCell(polygon); polydata->SetPoints(points); polydata->SetPolys(cellArray); vtkSmartPointer< vtkTriangleFilter > triangles = vtkSmartPointer< vtkTriangleFilter >::New(); triangles->SetInputData(polydata); triangles->Update(); vtkSmartPointer< vtkMassProperties > massProp = vtkSmartPointer< vtkMassProperties >::New(); massProp->SetInputConnection(triangles->GetOutputPort()); massProp->Update(); double area = massProp->GetSurfaceArea(); std::cout << area; } David From lobo.theslayer at gmail.com Mon Dec 3 15:26:23 2012 From: lobo.theslayer at gmail.com (Rodrigo Lovera) Date: Mon, 3 Dec 2012 15:26:23 -0500 Subject: [vtkusers] Problems with massProperties at getting area from ContourWidget In-Reply-To: References: Message-ID: But, how could I get the polygon out of a contour?? I mean applying the contour widget lets you define points and you can close that to forma a 2D contour. Once that's finished how to get the polygon out of that contour?? 2012/12/3 David Doria > This also has nothing to do with the widget. You can produce the same > error with much simpler code (see below). > > You can see from here: > http://www.vtk.org/doc/nightly/html/vtkCellType_8h_source.html > > that "3" means VTK_LINE, which makes sense, because you added lines to > the polydata. The vtkTriangleFilter doesn't sound like it triangulates > the area inside the contour, but rather only divides existing polygons > into triangles: > http://www.vtk.org/doc/nightly/html/classvtkTriangleFilter.html#details > > So what you have to do instead is make a polygon from your points, > then it seems to work: > > #include > #include > #include > #include > #include > #include > #include > #include > > int main() > { > vtkSmartPointer polydata = > vtkSmartPointer::New(); > vtkSmartPointer points = vtkSmartPointer::New(); > vtkSmartPointer cellArray = > vtkSmartPointer::New(); > > const unsigned int numberOfPoints = 21; > // Create the polygon > vtkSmartPointer polygon = > vtkSmartPointer::New(); > polygon->GetPointIds()->SetNumberOfIds(numberOfPoints); > > vtkIdType* lineIndices = new vtkIdType[numberOfPoints]; > for (int i = 0; i < numberOfPoints; i++) > { > polygon->GetPointIds()->SetId(i, i); > > const double angle = > 2.0*vtkMath::Pi()*i/static_cast(numberOfPoints); > points->InsertPoint(static_cast(i), 0.1*cos(angle), > 0.1*sin(angle), 0.0 ); > lineIndices[i] = static_cast(i); > } > > cellArray->InsertNextCell(polygon); > polydata->SetPoints(points); > polydata->SetPolys(cellArray); > > vtkSmartPointer< vtkTriangleFilter > triangles = > vtkSmartPointer< vtkTriangleFilter >::New(); > triangles->SetInputData(polydata); > triangles->Update(); > > vtkSmartPointer< vtkMassProperties > massProp = > vtkSmartPointer< vtkMassProperties >::New(); > massProp->SetInputConnection(triangles->GetOutputPort()); > massProp->Update(); > double area = massProp->GetSurfaceArea(); > > std::cout << area; > > } > > David > -- *Rodrigo aka WarHearT* -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Mon Dec 3 15:30:12 2012 From: daviddoria at gmail.com (David Doria) Date: Mon, 3 Dec 2012 15:30:12 -0500 Subject: [vtkusers] Problems with massProperties at getting area from ContourWidget In-Reply-To: References: Message-ID: On Mon, Dec 3, 2012 at 3:26 PM, Rodrigo Lovera wrote: > But, how could I get the polygon out of a contour?? I mean applying the > contour widget lets you define points and you can close that to forma a 2D > contour. Once that's finished how to get the polygon out of that contour?? Like you had done, right? contourRep->GetContourRepresentationAsPolyData() David From lobo.theslayer at gmail.com Mon Dec 3 15:40:48 2012 From: lobo.theslayer at gmail.com (Rodrigo Lovera) Date: Mon, 3 Dec 2012 15:40:48 -0500 Subject: [vtkusers] Problems with massProperties at getting area from ContourWidget In-Reply-To: References: Message-ID: OK, I got that poly data but one I got that into the trianglefilter and then to the massproperties is where that error shows up, so what I don't get is that step between applying contourRep->GetContourRepresentationAsPolyData() and getting the poly into the trianglefilter. For example in these contourwidget code: #include #include #include #include #include #include #include #include #include int main(int, char *[]) { // Create a renderer and render window vtkSmartPointer renderer = vtkSmartPointer::New(); vtkSmartPointer renderWindow = vtkSmartPointer::New(); renderWindow->AddRenderer(renderer); // Create an interactor vtkSmartPointer renderWindowInteractor = vtkSmartPointer::New(); renderWindowInteractor->SetRenderWindow(renderWindow); vtkSmartPointer contourRep = vtkSmartPointer::New(); contourRep->GetLinesProperty()->SetColor(1, 0, 0); //set color to red // Create a contour widget vtkSmartPointer contourWidget = vtkSmartPointer::New(); contourWidget->SetInteractor(renderWindowInteractor); contourWidget->SetRepresentation(contourRep); renderWindow->Render(); renderWindowInteractor->Initialize(); renderWindow->Render(); contourWidget->On(); // Begin mouse interaction renderWindowInteractor->Start(); return EXIT_SUCCESS; } you start setting that points and defining the contour by mouse interaction. Im trying to achieve that once you're done you get that contour as a polygon so the surface area could be measured. I'm for sure missing something, but really can't see it what it is. Sorry to bother with my newbie questions but I really need to get these to work. vtkSmartPointer< vtkTriangleFilter > triangles = vtkSmartPointer< vtkTriangleFilter >::New(); triangles->SetInput(contourRep->GetContourRepresentationAsPolyData()); vtkSmartPointer< vtkMassProperties > massProp = vtkSmartPointer< vtkMassProperties >::New(); massProp->SetInput(triangles->GetOutput()); double area = massProp->GetSurfaceArea(); std::cout<< area; 2012/12/3 David Doria > On Mon, Dec 3, 2012 at 3:26 PM, Rodrigo Lovera > wrote: > > But, how could I get the polygon out of a contour?? I mean applying the > > contour widget lets you define points and you can close that to forma a > 2D > > contour. Once that's finished how to get the polygon out of that > contour?? > > Like you had done, right? > > contourRep->GetContourRepresentationAsPolyData() > > David > -- *Rodrigo aka WarHearT* -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Mon Dec 3 15:42:06 2012 From: daviddoria at gmail.com (David Doria) Date: Mon, 3 Dec 2012 15:42:06 -0500 Subject: [vtkusers] Problems with massProperties at getting area from ContourWidget In-Reply-To: References: Message-ID: On Mon, Dec 3, 2012 at 3:40 PM, Rodrigo Lovera wrote: > OK, I got that poly data but one I got that into the trianglefilter and then > to the massproperties is where that error shows up, so what I don't get is > that step between applying > > contourRep->GetContourRepresentationAsPolyData() > > and getting the poly into the trianglefilter. The easiest way would just be to read out the points from the line segments produced by the widget to create the polygon like I showed. David From lobo.theslayer at gmail.com Mon Dec 3 16:15:37 2012 From: lobo.theslayer at gmail.com (Rodrigo Lovera) Date: Mon, 3 Dec 2012 16:15:37 -0500 Subject: [vtkusers] Problems with massProperties at getting area from ContourWidget In-Reply-To: References: Message-ID: well, I tried to do what you told, I thought that GetContourRepresentationAsPolyData() 'd be enough to get the polygon but following the chode you showed I got to these: #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include int main( int argc, char *argv[] ) { // Create the RenderWindow, Renderer and both Actors // vtkSmartPointer renderer = vtkSmartPointer::New(); vtkSmartPointer renderWindow = vtkSmartPointer::New(); renderWindow->AddRenderer(renderer); vtkSmartPointer interactor = vtkSmartPointer::New(); interactor->SetRenderWindow(renderWindow); renderer->SetBackground(0.1, 0.2, 0.4); renderWindow->SetSize(600, 600); vtkSmartPointer contourRep = vtkSmartPointer::New(); contourRep->GetLinesProperty()->SetColor(1, 0, 0); //set color to red vtkSmartPointer contourWidget = vtkSmartPointer::New(); contourWidget->SetInteractor(interactor); contourWidget->SetRepresentation(contourRep); contourWidget->On(); for (int i = 0; i < argc; i++) { if (strcmp("-Shift", argv[i]) == 0) { contourWidget->GetEventTranslator()->RemoveTranslation( vtkCommand::LeftButtonPressEvent ); contourWidget->GetEventTranslator()->SetTranslation( vtkCommand::LeftButtonPressEvent, vtkWidgetEvent::Translate ); } else if (strcmp("-Scale", argv[i]) == 0) { contourWidget->GetEventTranslator()->RemoveTranslation( vtkCommand::LeftButtonPressEvent ); contourWidget->GetEventTranslator()->SetTranslation( vtkCommand::LeftButtonPressEvent, vtkWidgetEvent::Scale ); } } vtkSmartPointer pd = vtkSmartPointer::New(); vtkSmartPointer points = vtkSmartPointer::New(); vtkSmartPointer lines = vtkSmartPointer::New(); vtkIdType* lineIndices = new vtkIdType[21]; for (int i = 0; i< 20; i++) { const double angle = 2.0*vtkMath::Pi()*i/20.0; points->InsertPoint(static_cast(i), 0.1*cos(angle), 0.1*sin(angle), 0.0 ); lineIndices[i] = static_cast(i); } lineIndices[20] = 0; lines->InsertNextCell(21,lineIndices); delete [] lineIndices; pd->SetPoints(points); pd->SetLines(lines); contourWidget->Initialize(pd); contourWidget->Render(); renderer->ResetCamera(); renderWindow->Render(); interactor->Initialize(); interactor->Start(); vtkSmartPointer< vtkPolygon > polygon = vtkSmartPointer< vtkPolygon >::New(); vtkSmartPointer< vtkPolyData > poly = vtkSmartPointer< vtkPolyData >::New(); vtkSmartPointer< vtkCellArray > cellArray = vtkSmartPointer< vtkCellArray >::New(); int numOfPoints = contourRep->GetContourRepresentationAsPolyData()->GetNumberOfPoints(); polygon->GetPointIds()->SetNumberOfIds(numOfPoints); for (int i = 0; i < numOfPoints; i++) { polygon->GetPointIds()->SetId(i, i); } cellArray->InsertNextCell(polygon); poly->SetPoints(contourRep->GetContourRepresentationAsPolyData()->GetPoints()); poly->SetPolys(cellArray); vtkSmartPointer< vtkTriangleFilter > triangles = vtkSmartPointer< vtkTriangleFilter >::New(); //triangles->SetInput(contourRep->GetContourRepresentationAsPolyData()); triangles->SetInput(poly); vtkSmartPointer< vtkMassProperties > massProp = vtkSmartPointer< vtkMassProperties >::New(); massProp->SetInput(triangles->GetOutput()); double area = massProp->GetSurfaceArea(); std::cout<< area; contourWidget->Off(); return EXIT_SUCCESS; } I see area changes as I modified the form of the contour and close the render window, correct me if there's something wrong please and if you give me some guide on that GetContourRepresentationAsPolyData() if there's a way to use it in a more direct way. Thx for your help Regards, Rodrigo 2012/12/3 David Doria > On Mon, Dec 3, 2012 at 3:40 PM, Rodrigo Lovera > wrote: > > OK, I got that poly data but one I got that into the trianglefilter and > then > > to the massproperties is where that error shows up, so what I don't get > is > > that step between applying > > > > contourRep->GetContourRepresentationAsPolyData() > > > > and getting the poly into the trianglefilter. > > The easiest way would just be to read out the points from the line > segments produced by the widget to create the polygon like I showed. > > David > -- *Rodrigo aka WarHearT* -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Mon Dec 3 16:30:23 2012 From: daviddoria at gmail.com (David Doria) Date: Mon, 3 Dec 2012 16:30:23 -0500 Subject: [vtkusers] Problems with massProperties at getting area from ContourWidget In-Reply-To: References: Message-ID: On Mon, Dec 3, 2012 at 4:15 PM, Rodrigo Lovera wrote: > I see area changes as I modified the form of the contour and close the > render window, correct me if there's something wrong please and if you give > me some guide on that GetContourRepresentationAsPolyData() if there's a way > to use it in a more direct way. > > Thx for your help > > Regards, Rodrigo You need to handle an event of the widget to output the answer interactive. It almost never makes sense to place code after the interactor->Start(); call. http://www.vtk.org/doc/nightly/html/classvtkContourWidget.html#details Perhaps something like this will get you started: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Widgets/SphereWidgetEvents David From lobo.theslayer at gmail.com Mon Dec 3 16:40:36 2012 From: lobo.theslayer at gmail.com (Rodrigo Lovera) Date: Mon, 3 Dec 2012 16:40:36 -0500 Subject: [vtkusers] Problems with massProperties at getting area from ContourWidget In-Reply-To: References: Message-ID: I 'd do it with some button and shown in a label once I got the code to my qtvtk project. I have one more question and these 'd be on how does it measure the area, the dimensions are in pixels or mm2 maybe?? how can I know that and maybe even set that? 2012/12/3 David Doria > On Mon, Dec 3, 2012 at 4:15 PM, Rodrigo Lovera > wrote: > > I see area changes as I modified the form of the contour and close the > > render window, correct me if there's something wrong please and if you > give > > me some guide on that GetContourRepresentationAsPolyData() if there's a > way > > to use it in a more direct way. > > > > Thx for your help > > > > Regards, Rodrigo > > You need to handle an event of the widget to output the answer > interactive. It almost never makes sense to place code after the > interactor->Start(); call. > > http://www.vtk.org/doc/nightly/html/classvtkContourWidget.html#details > > Perhaps something like this will get you started: > http://www.vtk.org/Wiki/VTK/Examples/Cxx/Widgets/SphereWidgetEvents > > David > -- *Rodrigo aka WarHearT* -------------- next part -------------- An HTML attachment was scrubbed... URL: From martin.ennemoser at gmx.at Mon Dec 3 18:27:49 2012 From: martin.ennemoser at gmx.at (Martin Ennemoser) Date: Tue, 04 Dec 2012 00:27:49 +0100 Subject: [vtkusers] BSP-Tree Message-ID: <20121203232749.198650@gmx.net> Hi, I know that vtk features a ModifiedBSPTree. AFAIK, this tree only supports axis aligned splitting planes (like kd-trees). However, I need a more "classical" BSP tree that uses polygon based splitting planes. Does vtk supoorts that? Regards, Martin From daviddoria at gmail.com Mon Dec 3 21:16:47 2012 From: daviddoria at gmail.com (David Doria) Date: Mon, 3 Dec 2012 21:16:47 -0500 Subject: [vtkusers] Problems with massProperties at getting area from ContourWidget In-Reply-To: References: Message-ID: On Mon, Dec 3, 2012 at 4:40 PM, Rodrigo Lovera wrote: > I 'd do it with some button and shown in a label once I got the code to my > qtvtk project. I have one more question and these 'd be on how does it > measure the area, the dimensions are in pixels or mm2 maybe?? how can I > know that and maybe even set that? You can't set that. VTK works in unit-less dimensions, so you can interpret the units however you want. David -------------- next part -------------- An HTML attachment was scrubbed... URL: From lobo.theslayer at gmail.com Mon Dec 3 21:19:26 2012 From: lobo.theslayer at gmail.com (Rodrigo Lovera) Date: Mon, 3 Dec 2012 21:19:26 -0500 Subject: [vtkusers] Problems with massProperties at getting area from ContourWidget In-Reply-To: References: Message-ID: Oh i see, I did that question because I found that you could give some format to the distance widget for example like writing units or coloring the letters of the measurement, I think there's no similar option for surface area right? 2012/12/3 David Doria > On Mon, Dec 3, 2012 at 4:40 PM, Rodrigo Lovera wrote: > >> I 'd do it with some button and shown in a label once I got the code to >> my qtvtk project. I have one more question and these 'd be on how does it >> measure the area, the dimensions are in pixels or mm2 maybe?? how can I >> know that and maybe even set that? > > > You can't set that. VTK works in unit-less dimensions, so you can > interpret the units however you want. > > David > -- *Rodrigo aka WarHearT* -------------- next part -------------- An HTML attachment was scrubbed... URL: From lobo.theslayer at gmail.com Tue Dec 4 00:27:27 2012 From: lobo.theslayer at gmail.com (Rodrigo Lovera) Date: Tue, 4 Dec 2012 00:27:27 -0500 Subject: [vtkusers] QT VTK Four Pane Viewer example C++ Message-ID: Hello everyone, I was taking a look at the QT VTK FourPaneViewer GUI example at vtk source: http://vtk.org/gitweb?p=VTK.git;a=tree;f=Examples/GUI/Qt/FourPaneViewer and I was wondering if there's a way to = - show on its qvtkwidget the numer of slice out of the total for each plane - have a tool like a slider maybe to control the movement through slices instead of the mousewheel. - When you left click and move on the planes views it seems to be that the dinamic range of values (color of image) change, I'd like that set to off and instead of that interaction add another slider to control that event. Hope any of you know about these and could guide me on how to achieve those interactions I'd like to implement and also where in the original code to check for make the modificationes I'd like to get. Thanks in advance. Regards*,* * * *Rodrigo* -------------- next part -------------- An HTML attachment was scrubbed... URL: From dstone at medis.nl Tue Dec 4 03:57:12 2012 From: dstone at medis.nl (Deric Stone) Date: Tue, 4 Dec 2012 09:57:12 +0100 Subject: [vtkusers] color mapping In-Reply-To: <50BCDF59.8090609@kappaeng.com> References: <50BCD3FC.2070202@kappaeng.com> <50BCDF59.8090609@kappaeng.com> Message-ID: Where are you using the lookup table? Can you use vtkColorTransferFunction or vtkDiscretizableColorTransferFunction instead? There you would be able to specify ranges. Note that GetColor(...) and MapValue(...) are not declared virtual in the vtkLookupTable class so cannot be overridden. Kind regards, Deric Stone From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of Fr?d?ric Speisser Sent: Monday, December 03, 2012 6:20 PM To: Johannes Strecha Cc: vtkusers at vtk.org Subject: Re: [vtkusers] color mapping Thank you Johannes for your answer, Yes, I know this algorithm, I also use it to filter data. But here my aim is not to filter data out-of-range but to keep these data visible but set in a custom color. Kind regards, Fr?d?ric Le 03/12/2012 18:12, Johannes Strecha a ?crit : Hello, I can't give you a direct answer, but I think what you want can be done with the vtkClipDataSet filter (5.8). See the reference for details. I assume that adjusting the lookup table would work faster, though. When trying to realize a "filled contour plot" by adjusting the lookup table (to a series of steps) I experienced that some interpolation was performed nonetheless and I ended up with blurred filled contours. Maybe this would also happen in your case. Kind regards, Johannes Strecha. On Mon, Dec 3, 2012 at 5:31 PM, Fr?d?ric Speisser wrote: Hi all, I'm using vtkLookupTable::SetTableRange to remap colors of a LUT to a custom range of a given scalar values. This works great but per default and as explained in API documentation : Scalar values less than minimum range value are clamped to minimum range value. Scalar values greater than maximum range value are clamped to maximum range value. So values out of range are displayed in minimum range value color (for those under custom range) and in maximum range value color (for those over custom range). I would like to display out-of-range values in a custom color, so that for example all values under and over custom range are displayed in black. I began to write a class MyVtkLookupTable which inherits from vtkLookupTable and i tried to override GetColor(double v, double rgb[3]) and MapValue(double v) to be able to override color displayed but it seems not to work. Is it possible to do that by overriding vtk classes ? If yes, which method/classes should I override ? Any clues are wellcome, thank you, Fr?d?ric _______________________________________________ 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://www.vtk.org/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From huangz2350 at 163.com Tue Dec 4 03:59:27 2012 From: huangz2350 at 163.com (huangz2350) Date: Tue, 4 Dec 2012 16:59:27 +0800 (CST) Subject: [vtkusers] SetLineWidth's Problem Message-ID: <57e88802.1fbff.13b65242ce5.Coremail.huangz2350@163.com> Hi, I have drawed a line in an Image?JPEGReader->ImageActor?,I chang the line's Property->SetLineWidth(2). When I ZoomIn or ZoomOut, the Line is missing. how to solve this problem ?Thanks The SourceCode? #include #include #include #include #include #include #include #include #include #include #include int main(int argc, char* argv[]) { // Verify input arguments if ( argc != 2 ) { std::cout << "Usage: " << argv[0] << " Filename(.jpeg)" << std::endl; return EXIT_FAILURE; } // Read the image vtkSmartPointer jpegReader = vtkSmartPointer::New(); if(!jpegReader->CanReadFile(argv[1])) { std::cout << argv[0] << ": Error reading file " << argv[1] << std::endl << " Exiting..." << std::endl; return EXIT_FAILURE; } jpegReader->SetFileName ( argv[1] ); // Visualize vtkSmartPointer imageViewer = vtkSmartPointer::New(); imageViewer->SetInputConnection( jpegReader->GetOutputPort() ); imageViewer->GetRenderWindow()->SetSize( 500, 500 ); imageViewer->GetRenderer()->ResetCamera(); // Set up an interactor that does not respond to mouse events vtkSmartPointer renderWindowInteractor = vtkSmartPointer::New(); imageViewer->GetRenderWindow()->SetInteractor( renderWindowInteractor ); vtkInteractorStyleTrackballCamera *style = vtkInteractorStyleTrackballCamera::New(); renderWindowInteractor->SetInteractorStyle( style ); vtkSmartPointer pvtkLine_Move = vtkSmartPointer::New(); vtkSmartPointer m_MoveActor = vtkSmartPointer::New(); pvtkLine_Move->SetPoint1(0,0,0); pvtkLine_Move->SetPoint2(50,50,0); pvtkLine_Move->Update(); vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(pvtkLine_Move->GetOutputPort()); m_MoveActor->SetMapper(mapper); vtkProperty *pProperty = m_MoveActor->GetProperty (); pProperty->SetColor(1,0,0); pProperty->SetLineWidth (2); //The Line Maybe Miss... m_MoveActor->VisibilityOn(); imageViewer->GetRenderer()->AddActor(m_MoveActor); imageViewer->Render(); // Start the event loop renderWindowInteractor->Initialize(); renderWindowInteractor->Start(); return EXIT_SUCCESS; } Phoniex -------------- next part -------------- An HTML attachment was scrubbed... URL: From huangz2350 at 163.com Tue Dec 4 03:46:38 2012 From: huangz2350 at 163.com (huangz2350) Date: Tue, 4 Dec 2012 16:46:38 +0800 (CST) Subject: [vtkusers] SetLineWidth's Problem Message-ID: <5796eabf.1f609.13b65187020.Coremail.huangz2350@163.com> Hi, I have drawed a line in an Image?JPEGReader->ImageActor?,I chang the line's Property->SetLineWidth(2). When I ZoomIn or ZoomOut, the Line is missing. how to solve this problem ?Thanks The SourceCode? #include #include #include #include #include #include #include #include #include #include #include int main(int argc, char* argv[]) { // Verify input arguments if ( argc != 2 ) { std::cout << "Usage: " << argv[0] << " Filename(.jpeg)" << std::endl; return EXIT_FAILURE; } // Read the image vtkSmartPointer jpegReader = vtkSmartPointer::New(); if(!jpegReader->CanReadFile(argv[1])) { std::cout << argv[0] << ": Error reading file " << argv[1] << std::endl << " Exiting..." << std::endl; return EXIT_FAILURE; } jpegReader->SetFileName ( argv[1] ); // Visualize vtkSmartPointer imageViewer = vtkSmartPointer::New(); imageViewer->SetInputConnection( jpegReader->GetOutputPort() ); imageViewer->GetRenderWindow()->SetSize( 500, 500 ); imageViewer->GetRenderer()->ResetCamera(); // Set up an interactor that does not respond to mouse events vtkSmartPointer renderWindowInteractor = vtkSmartPointer::New(); imageViewer->GetRenderWindow()->SetInteractor( renderWindowInteractor ); vtkInteractorStyleTrackballCamera *style = vtkInteractorStyleTrackballCamera::New(); renderWindowInteractor->SetInteractorStyle( style ); vtkSmartPointer pvtkLine_Move = vtkSmartPointer::New(); vtkSmartPointer m_MoveActor = vtkSmartPointer::New(); pvtkLine_Move->SetPoint1(0,0,0); pvtkLine_Move->SetPoint2(50,50,0); pvtkLine_Move->Update(); vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(pvtkLine_Move->GetOutputPort()); m_MoveActor->SetMapper(mapper); vtkProperty *pProperty = m_MoveActor->GetProperty (); pProperty->SetColor(1,0,0); pProperty->SetLineWidth (2); //The Line Maybe Miss... m_MoveActor->VisibilityOn(); imageViewer->GetRenderer()->AddActor(m_MoveActor); imageViewer->Render(); // Start the event loop renderWindowInteractor->Initialize(); renderWindowInteractor->Start(); return EXIT_SUCCESS; } Phoniex -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.strecha at gmail.com Tue Dec 4 04:27:01 2012 From: j.strecha at gmail.com (Johannes Strecha) Date: Tue, 4 Dec 2012 10:27:01 +0100 Subject: [vtkusers] color mapping In-Reply-To: References: <50BCD3FC.2070202@kappaeng.com> <50BCDF59.8090609@kappaeng.com> Message-ID: Hello, the vtk reference says that the vtkClipDataSet filter can be configured to produce a second output, namely the part that was clipped away. A pipeline with two clip-filters (for upper and lower bounds) that produce the clipped part as second outputs and three mappers with suitably set color transfer functions should produce the desired results. However, I also think that one should be able to achieve this result with a more simple setup. Kind regards, Johannes Strecha. On Tue, Dec 4, 2012 at 9:57 AM, Deric Stone wrote: > Where are you using the lookup table? Can you use vtkColorTransferFunction > or vtkDiscretizableColorTransferFunction instead? There you would be able > to specify ranges.**** > > ** ** > > Note that GetColor(?) and MapValue(?) are not declared virtual in the > vtkLookupTable class so cannot be overridden.**** > > ** ** > > Kind regards,**** > > Deric Stone**** > > ** ** > > *From:* vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] *On > Behalf Of *Fr?d?ric Speisser > *Sent:* Monday, December 03, 2012 6:20 PM > *To:* Johannes Strecha > *Cc:* vtkusers at vtk.org > *Subject:* Re: [vtkusers] color mapping**** > > ** ** > > Thank you Johannes for your answer, > > Yes, I know this algorithm, I also use it to filter data. > But here my aim is not to filter data out-of-range but to keep these data > visible but set in a custom color. > > Kind regards, > Fr?d?ric > > Le 03/12/2012 18:12, Johannes Strecha a ?crit :**** > > Hello, > > I can't give you a direct answer, but I think what you want can be done > with the vtkClipDataSet filter (5.8). See the reference for details. I > assume that adjusting the lookup table would work faster, though. > > When trying to realize a "filled contour plot" by adjusting the lookup > table (to a series of steps) I experienced that some interpolation was > performed nonetheless and I ended up with blurred filled contours. Maybe > this would also happen in your case. > > Kind regards, > Johannes Strecha.**** > > ** ** > > On Mon, Dec 3, 2012 at 5:31 PM, Fr?d?ric Speisser > wrote:**** > > Hi all, > > > I'm using *vtkLookupTable::SetTableRange* to remap colors of a LUT to a > custom range of a given scalar values. > > This works great but per default and as explained in API documentation : > *Scalar values less than minimum range value are clamped to minimum range > value. Scalar values greater than maximum range value are clamped to > maximum range value. > *So values out of range are displayed in minimum range value color (for > those under custom range) and in maximum range value color (for those over > custom range). > I would like to display out-of-range values in a custom color, so that for > example all values under and over custom range are displayed in black. > I began to write a class *MyVtkLookupTable* which inherits from *vtkLookupTable > *and i tried to override *GetColor(double v, double rgb[3])* and *MapValue(double > v)* to be able to override color displayed but it seems not to work. > Is it possible to do that by overriding vtk classes ? If yes, which > method/classes should I override ? > > Any clues are wellcome, thank you, > > > > Fr?d?ric **** > > > _______________________________________________ > 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://www.vtk.org/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://www.vtk.org/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.danewitz at web.de Tue Dec 4 04:39:59 2012 From: d.danewitz at web.de (web-Dmitri web-Danewitz) Date: Tue, 4 Dec 2012 10:39:59 +0100 (CET) Subject: [vtkusers] Shining light Message-ID: An HTML attachment was scrubbed... URL: From notinmyhead at gmail.com Tue Dec 4 07:02:29 2012 From: notinmyhead at gmail.com (Alessandro) Date: Tue, 4 Dec 2012 13:02:29 +0100 Subject: [vtkusers] RGB Greyscale from Scalare Message-ID: <9A1320EE-013A-4EEB-8DE0-77642150F0A8@gmail.com> Hello, I need to apply a vtkImageBlend to a Scalare image and a RGBA image. I'd like result to be a RGBA image too. Is there a simple way to move the Scalar image into a RGBA one maintaining all original greyscale values? Otherwise the vtkImageBlend shows an error since the two images have different type. Thanks, Ale From daviddoria at gmail.com Tue Dec 4 07:24:03 2012 From: daviddoria at gmail.com (David Doria) Date: Tue, 4 Dec 2012 07:24:03 -0500 Subject: [vtkusers] SetLineWidth's Problem In-Reply-To: <5796eabf.1f609.13b65187020.Coremail.huangz2350@163.com> References: <5796eabf.1f609.13b65187020.Coremail.huangz2350@163.com> Message-ID: On Tue, Dec 4, 2012 at 3:46 AM, huangz2350 wrote: > > Hi, I have drawed a line in an Image?JPEGReader->ImageActor?,I chang the > line's Property->SetLineWidth(2). > When I ZoomIn or ZoomOut, the Line is missing. > how to solve this problem ?Thanks > The line behaves as expected for me. David -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Tue Dec 4 07:35:14 2012 From: daviddoria at gmail.com (David Doria) Date: Tue, 4 Dec 2012 07:35:14 -0500 Subject: [vtkusers] SetLineWidth's Problem In-Reply-To: <737804d0.2257b.13b65e6018e.Coremail.huangz2350@163.com> References: <5796eabf.1f609.13b65187020.Coremail.huangz2350@163.com> <737804d0.2257b.13b65e6018e.Coremail.huangz2350@163.com> Message-ID: On Tue, Dec 4, 2012 at 7:31 AM, huangz2350 wrote: > > but When the mouseWheel Events happening,the line is glitter....you don't? Nope, it works fine. The only thing I would suggest is to change the line to slightly in front of the image: pvtkLine_Move->SetPoint1(0,0,1); pvtkLine_Move->SetPoint2(50,50,1); You are probably getting z-fighting issues. David From huangz2350 at 163.com Tue Dec 4 07:31:10 2012 From: huangz2350 at 163.com (huangz2350) Date: Tue, 4 Dec 2012 20:31:10 +0800 (CST) Subject: [vtkusers] SetLineWidth's Problem In-Reply-To: References: <5796eabf.1f609.13b65187020.Coremail.huangz2350@163.com> Message-ID: <737804d0.2257b.13b65e6018e.Coremail.huangz2350@163.com> but When the mouseWheel Events happening,the line is glitter....you don't? ? 2012-12-04 20:24:03?"David Doria" ??? On Tue, Dec 4, 2012 at 3:46 AM, huangz2350 wrote: Hi, I have drawed a line in an Image?JPEGReader->ImageActor?,I chang the line's Property->SetLineWidth(2). When I ZoomIn or ZoomOut, the Line is missing. how to solve this problem ?Thanks The line behaves as expected for me. David -------------- next part -------------- An HTML attachment was scrubbed... URL: From huangz2350 at 163.com Tue Dec 4 07:48:28 2012 From: huangz2350 at 163.com (huangz2350) Date: Tue, 4 Dec 2012 20:48:28 +0800 (CST) Subject: [vtkusers] SetLineWidth's Problem In-Reply-To: References: <5796eabf.1f609.13b65187020.Coremail.huangz2350@163.com> <737804d0.2257b.13b65e6018e.Coremail.huangz2350@163.com> Message-ID: <56022a8b.22830.13b65f5d62a.Coremail.huangz2350@163.com> I Check for you way,it's good,thank you! ^_^ At 2012-12-04 20:35:14,"David Doria" wrote: >On Tue, Dec 4, 2012 at 7:31 AM, huangz2350 wrote: >> >> but When the mouseWheel Events happening,the line is glitter....you don't? > >Nope, it works fine. The only thing I would suggest is to change the >line to slightly in front of the image: > > pvtkLine_Move->SetPoint1(0,0,1); > pvtkLine_Move->SetPoint2(50,50,1); > >You are probably getting z-fighting issues. > >David -------------- next part -------------- An HTML attachment was scrubbed... URL: From yxp233 at postech.ac.kr Tue Dec 4 08:00:50 2012 From: yxp233 at postech.ac.kr (Xiaopeng Yang) Date: Tue, 4 Dec 2012 22:00:50 +0900 Subject: [vtkusers] Two questions regarding ITK Gradient Magnitude Recursive Gaussian Image Filter Message-ID: <014b01cdd21f$630ae550$2920aff0$@ac.kr> Hello everyone, I have two questions regarding ITK Gradient Magnitude Recursive Gaussian Image Filter: 1) In this filter, as far as we know, a finite difference approach is used to calculate gradient magnitude of an image. My question is what formula is used by the finite difference approach implemented in this filter? 2) The ITK Software Guide tells us that the computation process of this filter is equivalent to first smoothing the image by convolving it with a Gaussian kernel and then applying a differential operator. My question is that is there a way to get an output of the smoothed image? I want to visualize the computation process. If any of you have any idea regarding the two questions, it would be very appreciated if you share it with me. Thank you in advance. Best regards, Yang -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.danewitz at web.de Tue Dec 4 10:44:35 2012 From: d.danewitz at web.de (web-Dmitri web-Danewitz) Date: Tue, 4 Dec 2012 16:44:35 +0100 (CET) Subject: [vtkusers] Shining light In-Reply-To: References: , Message-ID: An HTML attachment was scrubbed... URL: From boyeggplant110 at gmail.com Tue Dec 4 10:49:05 2012 From: boyeggplant110 at gmail.com (boyeggplant110) Date: Tue, 4 Dec 2012 09:49:05 -0600 Subject: [vtkusers] How to convert point data into proper datatype in vtk? Message-ID: <000f01cdd236$e48cebc0$ada6c340$@gmail.com> Hi all, I have a problem about how to convert point data to proper data type in vtk. I have a dataset including stock prices. So I have 3 variables: stock price, time, and stock index. I want visualize the dataset but it doesn't work when I want to construct a structured grid vtk file(as following). I wonder if my method to convert the data is right. Example : # vtk DataFile Version 2.0 test data ASCII DATASET STRUCUTURED_GRID DIMENSIONS 30 30 30 POINTS 30 float 1 1 36.32 1 2 36.61 1 3 36.48 1 4 36.64 1 5 35.78 1 6 35.94 1 7 37.04 1 8 36.97 1 9 37.65 1 10 37.63 2 1 76.78 2 2 75.58 2 3 79.05 2 4 80.28 2 5 78.64 2 6 78.95 2 7 82.58 The first column is stock index, second is time, third is price. Thanks in advance! JIE -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.strecha at gmail.com Tue Dec 4 14:03:50 2012 From: j.strecha at gmail.com (Johannes Strecha) Date: Tue, 4 Dec 2012 20:03:50 +0100 Subject: [vtkusers] How to convert point data into proper datatype in vtk? In-Reply-To: <000f01cdd236$e48cebc0$ada6c340$@gmail.com> References: <000f01cdd236$e48cebc0$ada6c340$@gmail.com> Message-ID: Hello, sorry, haven't got the time to check your specific file. Here is a description of the legacy vtk file format: http://www.vtk.org/VTK/img/file-formats.pdf I try to avoid constructing such files by hand. If you know (or want to learn) python you can construct your dataset in memory (by calling *.InsertNextPoint(...) or so, depends on your data structure). On the plus-side you get to know the vtk data structures really well and you can use one of the numerous writer-classes to write your datafiles as xml or legacy-files, with or without compression, ... 3 things: there's a surplus U in structured_grid & I'm not too sure how stock prices can be visualized by a structured grid, but maybe you thought of something special. Have you had a look at gnuplot or matplotlib? They can do simple visualizations very good, maybe using vtk is a bit of an overkill. Kind regards, Johannes Strecha. On Tue, Dec 4, 2012 at 4:49 PM, boyeggplant110 wrote: > Hi all,**** > > I have a problem about how to convert point data to proper data type in > vtk. I have a dataset including stock prices. So I have 3 variables: stock > price, time, and stock index. I want visualize the dataset but it doesn?t > work when I want to construct a structured grid vtk file(as following). I > wonder if my method to convert the data is right.**** > > Example :**** > > # vtk DataFile Version 2.0**** > > test data**** > > ASCII**** > > DATASET STRUCUTURED_GRID**** > > DIMENSIONS 30 30 30**** > > POINTS 30 float**** > > **** > > 1 1 36.32 **** > > 1 2 36.61 **** > > 1 3 36.48 **** > > 1 4 36.64 **** > > 1 5 35.78 **** > > 1 6 35.94 **** > > 1 7 37.04 **** > > 1 8 36.97 **** > > 1 9 37.65 **** > > 1 10 37.63 **** > > 2 1 76.78 **** > > 2 2 75.58 **** > > 2 3 79.05 **** > > 2 4 80.28 **** > > 2 5 78.64 **** > > 2 6 78.95 **** > > 2 7 82.58 **** > > ** ** > > The first column is stock index, second is time, third is price.**** > > ** ** > > Thanks in advance!**** > > ** ** > > *JIE ***** > > ** ** > > _______________________________________________ > 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://www.vtk.org/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lobo.theslayer at gmail.com Tue Dec 4 15:58:30 2012 From: lobo.theslayer at gmail.com (Rodrigo Lovera) Date: Tue, 4 Dec 2012 15:58:30 -0500 Subject: [vtkusers] vtkImageShrink3D Message-ID: Hello everyone, I was wondering how does exactly the vtkImageShrink3D works? I know it sub-samples an image, in my case I used it for a volume, but does anyone know exactly how does exactly works and about the factor of data lose when you apply these? Regards, -- *Rodrigo* -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Tue Dec 4 16:12:11 2012 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 4 Dec 2012 14:12:11 -0700 Subject: [vtkusers] vtkImageShrink3D In-Reply-To: References: Message-ID: Hi Rodrigo, The shrink factor must be an integer. A block of input voxels are combined together to create each output voxel. You can select whether the output voxel is set to mean, median, maximum, or minimum of the input voxels. Or, you can use AveragingOff() to simply decimate the image (i.e. to use nearest-neighbor). For VTK 5.10, I wrote a replacement called vtkImageResize. This new filter will, by default, perform band-limited sinc interpolation on the image. In other words, it will blur the image just enough to avoid aliasing artifacts, which minimizes the data loss. - David On Tue, Dec 4, 2012 at 1:58 PM, Rodrigo Lovera wrote: > Hello everyone, > > I was wondering how does exactly the vtkImageShrink3D works? I know it > sub-samples an image, in my case I used it for a volume, but does anyone > know exactly how does exactly works and about the factor of data lose when > you apply these? > > > Regards, > > -- > Rodrigo From drouin.simon at gmail.com Tue Dec 4 17:37:06 2012 From: drouin.simon at gmail.com (Simon Drouin) Date: Tue, 4 Dec 2012 17:37:06 -0500 Subject: [vtkusers] vtkImageStack and masking Message-ID: Hi All, Is it possible to define a mask for a vtkImageStack so that every slice in the stack will appear transparent outside the mask? Seems like it is only possible to "occlude" some parts of a slice by overlaying another slice that contains the mask. But the masked areas are still opaque. I understand that for the masking technique I'm suggesting to work, I would need to be able to use some kind of multi-pass technique in order to mask the images in a temporary color buffer before writing to the main framebuffer. Is there any way to do that with vtk? s. -------------- next part -------------- An HTML attachment was scrubbed... URL: From martin.ennemoser at gmx.at Tue Dec 4 18:20:25 2012 From: martin.ennemoser at gmx.at (Martin) Date: Tue, 4 Dec 2012 15:20:25 -0800 (PST) Subject: [vtkusers] BSP-Tree In-Reply-To: <20121203232749.198650@gmx.net> References: <20121203232749.198650@gmx.net> Message-ID: <1354663225073-5717426.post@n5.nabble.com> Has nobody an answer? -- View this message in context: http://vtk.1045678.n5.nabble.com/BSP-Tree-tp5717404p5717426.html Sent from the VTK - Users mailing list archive at Nabble.com. From huangz2350 at 163.com Tue Dec 4 22:53:48 2012 From: huangz2350 at 163.com (huangz2350) Date: Wed, 5 Dec 2012 11:53:48 +0800 Subject: [vtkusers] The vtkVectorText's Problem Message-ID: <201212051153441567086@163.com> Hi I have a trouble in the vtkVectorText Class. I want to set vtkVectorText's FontSize,FontType(overstriking,italic....) and Font-style,I can't find these methods. How to solve this problem? thanks for anying. Phoniex -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.strecha at gmail.com Wed Dec 5 03:08:14 2012 From: j.strecha at gmail.com (Johannes Strecha) Date: Wed, 5 Dec 2012 09:08:14 +0100 Subject: [vtkusers] How to convert point data into proper datatype in vtk? In-Reply-To: <002b01cdd26a$20496660$60dc3320$@gmail.com> References: <000f01cdd236$e48cebc0$ada6c340$@gmail.com> <002b01cdd26a$20496660$60dc3320$@gmail.com> Message-ID: Hello again, What do you mean by "not ideal", doesn't it look like expected, or doesn't it work? I'm not sure if you need the Delauny triangulation if you start with a structured grid. I think the points in the grid should have coordinates time/index/0, the stock price should go as an array into the pointdata if you want to use warpscalar. I never worked with structured grids before (only unstructured) so I can only guess. Try to read the reference (http://www.vtk.org/doc/release/5.8/html/) to get an idea what you need to specify. I think if you do not really know how your data structure should look like it's easier to construct it in memory and then use a writer class instead of constructing the datafile by hand. Kind regards, Johannes Strecha. On Tue, Dec 4, 2012 at 10:55 PM, boyeggplant110 wrote: > Hi,**** > > Thanks for your reply.**** > > I want to use vtk to construct a program to visualize the stock price. The > stock price is static here, not time varying. I want to do something like > the attachment. I want to order the stock by x-coordinates so the > x-coordinates is stock index(or stock name),y-coodinates is time, and > z-coordinates is price. **** > > I want to use height field to implement this.**** > > I use vtkDelaunay2D and vtkWarpScalar to handle my dataset but the result > is not ideal**** > > Do you have any suggestions?**** > > **** > > ** ** > > *JIE LI***** > > *Master of Science in Statistics***** > > *Division of Statistics + Scientific Computation ***** > > *The University of Texas at Austin| 1 University Station G2500| Austin, > TX 78712* **** > > ** ** > > *From:* Johannes Strecha [mailto:j.strecha at gmail.com] > *Sent:* 2012?12?4? 13:04 > *To:* boyeggplant110; vtkusers at vtk.org > *Subject:* Re: [vtkusers] How to convert point data into proper datatype > in vtk?**** > > ** ** > > Hello, > > sorry, haven't got the time to check your specific file. Here is a > description of the legacy vtk file format: > http://www.vtk.org/VTK/img/file-formats.pdf > > I try to avoid constructing such files by hand. If you know (or want to > learn) python you can construct your dataset in memory (by calling > *.InsertNextPoint(...) or so, depends on your data structure). On the > plus-side you get to know the vtk data structures really well and you can > use one of the numerous writer-classes to write your datafiles as xml or > legacy-files, with or without compression, ... > > 3 things: there's a surplus U in structured_grid & I'm not too sure how > stock prices can be visualized by a structured grid, but maybe you thought > of something special. Have you had a look at gnuplot or matplotlib? They > can do simple visualizations very good, maybe using vtk is a bit of an > overkill. > > Kind regards, > Johannes Strecha.**** > > ** ** > > On Tue, Dec 4, 2012 at 4:49 PM, boyeggplant110 > wrote:**** > > Hi all,**** > > I have a problem about how to convert point data to proper data type in > vtk. I have a dataset including stock prices. So I have 3 variables: stock > price, time, and stock index. I want visualize the dataset but it doesn?t > work when I want to construct a structured grid vtk file(as following). I > wonder if my method to convert the data is right.**** > > Example :**** > > # vtk DataFile Version 2.0**** > > test data**** > > ASCII**** > > DATASET STRUCUTURED_GRID**** > > DIMENSIONS 30 30 30**** > > POINTS 30 float**** > > 1 1 36.32 **** > > 1 2 36.61 **** > > 1 3 36.48 **** > > 1 4 36.64 **** > > 1 5 35.78 **** > > 1 6 35.94 **** > > 1 7 37.04 **** > > 1 8 36.97 **** > > 1 9 37.65 **** > > 1 10 37.63 **** > > 2 1 76.78 **** > > 2 2 75.58 **** > > 2 3 79.05 **** > > 2 4 80.28 **** > > 2 5 78.64 **** > > 2 6 78.95 **** > > 2 7 82.58 **** > > **** > > The first column is stock index, second is time, third is price.**** > > **** > > Thanks in advance!**** > > **** > > *JIE ***** > > **** > > > _______________________________________________ > 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://www.vtk.org/mailman/listinfo/vtkusers**** > > ** ** > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/jpeg Size: 26557 bytes Desc: not available URL: From adrian.gabriel at 4plus.de Wed Dec 5 03:10:45 2012 From: adrian.gabriel at 4plus.de (Najzero) Date: Wed, 5 Dec 2012 00:10:45 -0800 (PST) Subject: [vtkusers] The vtkVectorText's Problem In-Reply-To: <201212051153441567086@163.com> References: <201212051153441567086@163.com> Message-ID: <1354695045711-5717429.post@n5.nabble.com> Ah, the joy of vtkVectorText... to my knownledge there are only 4 standard font-glyphs available and only one is "hard" coded into vtk for vtkVectorText. It is possible for you to supply different fonts via those pre-rendered glyphs yourself, but getting a neat "setItalic()" (or any other stuff) into vtkVectorText is just not worth the hassle. Have a look into http://vtk.1045678.n5.nabble.com/vtkVectorText-beyond-ASCII-solution-td1252891.html Michail Vidiassov was extremely helpfull to enable more than pure ASCII fonts for me some time ago. All links supplied by Michail are still working if you append a 2 to the www[2 here]. ( e.g. www2.iaas.msu.ru/tmp/NewVectorText.wrl ) With his functionality you can use nearly every ttf font (I used the ones used by linux distributions because it had the most glyphs aka non-ascii letters) For your problem, you should consider a 2d-text pipeline and render it on the overlay instead - I believe somewhere around 5.x the unicode support got into that classes too. Have a look here( http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/DisplayText ) Nearly every vtkVectorText usages are used as "faceToCamera" (aka vtkFollower example), and by that pretty useless as 3d-objects in vtk itself. Best Regards Adrian -- View this message in context: http://vtk.1045678.n5.nabble.com/The-vtkVectorText-s-Problem-tp5717427p5717429.html Sent from the VTK - Users mailing list archive at Nabble.com. From jean-michel.rouet at philips.com Wed Dec 5 03:54:40 2012 From: jean-michel.rouet at philips.com (ROUET, Jean Michel) Date: Wed, 5 Dec 2012 08:54:40 +0000 Subject: [vtkusers] Adding a vtkTextActor during a EndPickEvent callback command hangs the renderer (Visual Studio 2012) Message-ID: Dear all, I recently upgraded from visual studio 2010 to the latest visual studio 2012 (a.k.a. VS11). Compilation of VTK 5.10.1 as static libraries went fine. However, I observed an application hang or freeze when trying to add a vtkTextActor to the scene from within a pick event callback. The freeze only occur in Release builds, when the debugger is _not_ attached to the vtk application process. When the freeze occur, it seems to be related to some openGL operations. If I disable the double buffering from the renderwindow, it does not hang anymore. Attached, is a modified version of Cone5.cxx example that reproduces the described bug. Can anybody reproduce this bug? Am I doing something wrong? is it a real compiler bug or a weakness in VTK? Looking forward to some comments or hints. Best regards, -- Jean-Michel PS: just in case, I also put below the output of renWin->ReportCapabilities() OpenGL vendor string: NVIDIA Corporation OpenGL renderer string: Quadro 600/PCIe/SSE2 OpenGL version string: 4.2.0 OpenGL extensions: GL_AMD_multi_draw_indirect GL_ARB_base_instance GL_ARB_blend_func_extended GL_ARB_color_buffer_float GL_ARB_compatibility GL_ARB_compressed_texture_pixel_storage GL_ARB_conservative_depth GL_ARB_copy_buffer GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_draw_buffers GL_ARB_draw_buffers_blend GL_ARB_draw_indirect GL_ARB_draw_elements_base_vertex GL_ARB_draw_instanced GL_ARB_ES2_compatibility GL_ARB_explicit_attrib_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_geometry_shader4 GL_ARB_get_program_binary GL_ARB_gpu_shader5 GL_ARB_gpu_shader_fp64 GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_imaging GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_map_buffer_alignment GL_ARB_map_buffer_range 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_separate_shader_objects GL_ARB_shader_atomic_counters GL_ARB_shader_bit_encoding GL_ARB_shader_image_load_store GL_ARB_shader_objects GL_ARB_shader_precision GL_ARB_shader_subroutine GL_ARB_shader_texture_lod GL_ARB_shading_language_100 GL_ARB_shading_language_420pack GL_ARB_shading_language_include GL_ARB_shading_language_packing GL_ARB_shadow GL_ARB_sync GL_ARB_tessellation_shader GL_ARB_texture_border_clamp GL_ARB_texture_buffer_object GL_ARB_texture_buffer_object_rgb32 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_mirrored_repeat GL_ARB_texture_multisample GL_ARB_texture_non_power_of_two 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_swizzle GL_ARB_timer_query GL_ARB_transform_feedback2 GL_ARB_transform_feedback3 GL_ARB_transform_feedback_instanced GL_ARB_transpose_matrix GL_ARB_uniform_buffer_object GL_ARB_vertex_array_bgra GL_ARB_vertex_array_object GL_ARB_vertex_attrib_64bit GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_vertex_type_2_10_10_10_rev GL_ARB_viewport_array GL_ARB_window_pos GL_ATI_draw_buffers GL_ATI_texture_float GL_ATI_texture_mirror_once GL_S3_s3tc GL_EXT_texture_env_add GL_EXT_abgr GL_EXT_bgra GL_EXT_bindable_uniform 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_Cg_shader GL_EXT_depth_bounds_test GL_EXT_direct_state_access 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_EXTX_framebuffer_mixed_formats GL_EXT_framebuffer_object GL_EXT_framebuffer_sRGB GL_EXT_geometry_shader4 GL_EXT_gpu_program_parameters GL_EXT_gpu_shader4 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_provoking_vertex GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_shader_objects GL_EXT_separate_specular_color GL_EXT_shader_image_load_store GL_EXT_shadow_funcs GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_texture3D GL_EXT_texture_array GL_EXT_texture_buffer_object GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_latc GL_EXT_texture_compression_rgtc GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map GL_EXT_texture_edge_clamp GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_format_BGRA8888 GL_EXT_texture_integer GL_EXT_texture_lod GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp GL_EXT_texture_object GL_EXT_texture_shared_exponent GL_EXT_texture_sRGB GL_EXT_texture_sRGB_decode GL_EXT_texture_storage GL_EXT_texture_swizzle GL_EXT_texture_type_2_10_10_10_REV GL_EXT_timer_query GL_EXT_transform_feedback2 GL_EXT_vertex_array GL_EXT_vertex_array_bgra GL_EXT_vertex_attrib_64bit GL_EXT_import_sync_object GL_IBM_rasterpos_clip GL_IBM_texture_mirrored_repeat GL_KTX_buffer_region GL_NV_alpha_test GL_NV_blend_minmax GL_NV_blend_square GL_NV_complex_primitives GL_NV_conditional_render GL_NV_copy_depth_to_color GL_NV_copy_image GL_NV_depth_buffer_float GL_NV_depth_clamp GL_NV_ES1_1_compatibility GL_NV_explicit_multisample GL_NV_fbo_color_attachments GL_NV_fence GL_NV_float_buffer GL_NV_fog_distance GL_NV_fragdepth GL_NV_fragment_program GL_NV_fragment_program_option GL_NV_fragment_program2 GL_NV_framebuffer_multisample_coverage GL_NV_geometry_shader4 GL_NV_gpu_program4 GL_NV_gpu_program4_1 GL_NV_gpu_program5 GL_NV_gpu_program_fp64 GL_NV_gpu_shader5 GL_NV_half_float GL_NV_light_max_exponent GL_NV_multisample_coverage GL_NV_multisample_filter_hint GL_NV_occlusion_query GL_NV_packed_depth_stencil GL_NV_parameter_buffer_object GL_NV_parameter_buffer_object2 GL_NV_path_rendering GL_NV_pixel_data_range GL_NV_point_sprite GL_NV_primitive_restart GL_NV_register_combiners GL_NV_register_combiners2 GL_NV_shader_atomic_counters GL_NV_shader_atomic_float GL_NV_shader_buffer_load GL_NV_texgen_reflection GL_NV_texture_barrier GL_NV_texture_compression_vtc GL_NV_texture_env_combine4 GL_NV_texture_expand_normal GL_NV_texture_lod_clamp GL_NV_texture_multisample GL_NV_texture_rectangle GL_NV_texture_shader GL_NV_texture_shader2 GL_NV_texture_shader3 GL_NV_transform_feedback GL_NV_transform_feedback2 GL_NV_vertex_array_range GL_NV_vertex_array_range2 GL_NV_vertex_attrib_integer_64bit GL_NV_vertex_buffer_unified_memory GL_NV_vertex_program GL_NV_vertex_program1_1 GL_NV_vertex_program2 GL_NV_vertex_program2_option GL_NV_vertex_program3 GL_NVX_conditional_render GL_NVX_gpu_memory_info GL_OES_compressed_paletted_texture GL_OES_depth24 GL_OES_depth32 GL_OES_depth_texture GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_get_program_binary GL_OES_mapbuffer GL_OES_packed_depth_stencil GL_OES_point_size_array GL_OES_point_sprite GL_OES_rgb8_rgba8 GL_OES_read_format GL_OES_standard_derivatives GL_OES_texture_3D GL_OES_texture_float GL_OES_texture_float_linear GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_vertex_array_object GL_OES_vertex_half_float GL_SGIS_generate_mipmap GL_SGIS_texture_lod GL_SGIX_depth_texture GL_SGIX_shadow GL_SUN_slice_accum GL_WIN_swap_hint WGL_EXT_swap_control PixelFormat Descriptor: depth: 24 class: TrueColor buffer size: 32 level: 0 renderType: rgba double buffer: True stereo: False hardware acceleration: True rgba: redSize=8 greenSize=8blueSize=8alphaSize=0 aux buffers: 4 depth size: 24 stencil size: 0 accum: redSize=16 greenSize=16blueSize=16alphaSize=16 ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return 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: Cone5.cxx Type: application/octet-stream Size: 7112 bytes Desc: Cone5.cxx URL: From speisser at kappaeng.com Wed Dec 5 04:18:45 2012 From: speisser at kappaeng.com (=?windows-1252?Q?Fr=E9d=E9ric_Speisser?=) Date: Wed, 5 Dec 2012 10:18:45 +0100 Subject: [vtkusers] color mapping In-Reply-To: References: <50BCD3FC.2070202@kappaeng.com> <50BCDF59.8090609@kappaeng.com> Message-ID: <50BF1175.7010609@kappaeng.com> Thank you all, Finally, I found a way to achieve what I wanted to do in overriding function /MapScalars/ of /vtkLookupTable/, so i'm now be able to manage custom color mapping. Kind regards, Fr?d?ric Le 04/12/2012 10:27, Johannes Strecha a ?crit : > Hello, > > the vtk reference says that the vtkClipDataSet filter can be > configured to produce a second output, namely the part that was > clipped away. A pipeline with two clip-filters (for upper and lower > bounds) that produce the clipped part as second outputs and three > mappers with suitably set color transfer functions should produce the > desired results. > > However, I also think that one should be able to achieve this result > with a more simple setup. > > Kind regards, > Johannes Strecha. > > > On Tue, Dec 4, 2012 at 9:57 AM, Deric Stone > wrote: > > Where are you using the lookup table? Can you use > vtkColorTransferFunction or vtkDiscretizableColorTransferFunction > instead? There you would be able to specify ranges. > > Note that GetColor(?) and MapValue(?) are not declared virtual in > the vtkLookupTable class so cannot be overridden. > > Kind regards, > > Deric Stone > > *From:*vtkusers-bounces at vtk.org > [mailto:vtkusers-bounces at vtk.org > ] *On Behalf Of *Fr?d?ric Speisser > *Sent:* Monday, December 03, 2012 6:20 PM > *To:* Johannes Strecha > *Cc:* vtkusers at vtk.org > *Subject:* Re: [vtkusers] color mapping > > Thank you Johannes for your answer, > > Yes, I know this algorithm, I also use it to filter data. > But here my aim is not to filter data out-of-range but to keep > these data visible but set in a custom color. > > Kind regards, > Fr?d?ric > > Le 03/12/2012 18:12, Johannes Strecha a ?crit : > > Hello, > > I can't give you a direct answer, but I think what you want > can be done with the vtkClipDataSet filter (5.8). See the > reference for details. I assume that adjusting the lookup > table would work faster, though. > > When trying to realize a "filled contour plot" by adjusting > the lookup table (to a series of steps) I experienced that > some interpolation was performed nonetheless and I ended up > with blurred filled contours. Maybe this would also happen in > your case. > > Kind regards, > Johannes Strecha. > > On Mon, Dec 3, 2012 at 5:31 PM, Fr?d?ric Speisser > > wrote: > > Hi all, > > > I'm using /vtkLookupTable::SetTableRange/ to remap colors of a > LUT to a custom range of a given scalar values. > > This works great but per default and as explained in API > documentation : > /Scalar values less than minimum range value are clamped to > minimum range value. Scalar values greater than maximum range > value are clamped to maximum range value. > /So values out of range are displayed in minimum range value > color (for those under custom range) and in maximum range > value color (for those over custom range). > I would like to display out-of-range values in a custom color, > so that for example all values under and over custom range are > displayed in black. > I began to write a class /MyVtkLookupTable/ which inherits > from /vtkLookupTable /and i tried to override /GetColor(double > v, double rgb[3])/ and /MapValue(double v)/ to be able to > override color displayed but it seems not to work. > Is it possible to do that by overriding vtk classes ? If yes, > which method/classes should I override ? > > Any clues are wellcome, thank you, > > > > Fr?d?ric > > > _______________________________________________ > 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://www.vtk.org/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://www.vtk.org/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zctzzy2008 at 163.com Wed Dec 5 04:13:45 2012 From: zctzzy2008 at 163.com (Zhang Chuanting) Date: Wed, 5 Dec 2012 17:13:45 +0800 (CST) Subject: [vtkusers] about the vtkDICOMImageReader Message-ID: <7da2566d.12473.13b6a579e53.Coremail.zctzzy2008@163.com> Hi vtkusers, I want to use the vtkDICOMImageReader to open this dicom file. But I met an error when I using the following code: int main() { //vtkStringArray *stringArray = vtkStringArray::New(); vtkDICOMImageReader *dicomReader = vtkDICOMImageReader::New(); //dicomReader->SetFileName("DICOM7_000152.dcm"); dicomReader->SetFileName("IM-0001-0002.dcm"); //dicomReader->SetFileNames(); dicomReader->Update(); vtkImageViewer *viewer = vtkImageViewer::New(); viewer->SetInput(dicomReader->GetOutput()); viewer->Render(); vtkRenderWindowInteractor *interactor = vtkRenderWindowInteractor::New(); viewer->SetupInteractor(interactor); interactor->Initialize(); interactor->Start(); dicomReader->Delete(); viewer->Delete(); interactor->Delete(); return 0; } can anybody use vtk to open the file? Thanks a lot for anybody help me. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: IM-0001-0001.dcm Type: application/octet-stream Size: 99686 bytes Desc: not available URL: From gongweixue at sina.com Wed Dec 5 03:58:18 2012 From: gongweixue at sina.com (gongweixue) Date: Wed, 5 Dec 2012 16:58:18 +0800 Subject: [vtkusers] something wrong when I using vtkTableBasedClipDataSet. Message-ID: hi,all i want to show the data on the screen ,and to seem like been exploded in pieces,like a cake been cut in several times and split with each other. so i use some clipper like vtkClipPolyData, vtkClipDataSet and vtkGenericClip. but when i clipped a polydata with these clipper, colors on the actor is not right, some white thing on it. So is this the bug of the vtkClipDataSet when clipping a PolyData? so I used vtkTableBasedClipDataSet. And yeah, the color is right. But, when I use the GenerateClippedOn(), and invoke the GetClippedOutPut(), there is nothing. So, can anybody tell me, how to get the clipped Output and make the color right when clip a vtkDataSet. And why the vtkTableBasedClipDataSet's ClippedOutput has nothing? Thanks!!! -------------- next part -------------- An HTML attachment was scrubbed... URL: From sergio.vera at alma3d.com Wed Dec 5 04:53:41 2012 From: sergio.vera at alma3d.com (Sergio Vera) Date: Wed, 5 Dec 2012 10:53:41 +0100 Subject: [vtkusers] Setting interactor views (coronal, sagital, axial) Message-ID: Hello all I'm implementing a medical image viewer with the typical 3+1 windows (axial, coronal sagittal and 3d) layout. Each window has his vtkRenderWindowInteractor and vtkIntractorStyleImage I setup the interactor styles views vectors (right & up) for each slice view (axial, coronal, sagital) with SetZViewRightVector() and SetZViewUpVector(). However, my views don't change, no matter how hard I try to update the window / renderer / renderwindow /camera (I believe I've tested almost all, if not all possibilities) The only way is to manually click "x" "z" or "y" keys on each window to obtain the desired point of view in the images. Anyone knows how to automatically set my views to the desired way without having to press keys? By the wai I use ctkVTKRenderView not a regular vtkRenderWindow but I believe this is not related to CTK. Best regards -- Sergio Vera Alma IT Systems C/ Vilana, 4B, 4? 1? 08022 Barcelona T. (+34) 932 380 592 www.alma3d.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Wed Dec 5 07:16:39 2012 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 5 Dec 2012 05:16:39 -0700 Subject: [vtkusers] Setting interactor views (coronal, sagital, axial) In-Reply-To: References: Message-ID: Hi Sergio, The view will change if you call SetImageOrientation(). For example: style->SetImageOrientation(style->GetZViewRightVector(), style->GetZViewUpVector()); Or you can use code like this: double vector1[3] = { 1.0, 0.0, 0.0 }; double vector2[3] = { 0.0, 0.0, -1.0 }; style->SetImageOrientation(vector1, vector2); - David On Wed, Dec 5, 2012 at 2:53 AM, Sergio Vera wrote: > Hello all > I'm implementing a medical image viewer with the typical 3+1 windows (axial, > coronal sagittal and 3d) layout. > > Each window has his vtkRenderWindowInteractor and vtkIntractorStyleImage > > I setup the interactor styles views vectors (right & up) for each slice view > (axial, coronal, sagital) with > SetZViewRightVector() and SetZViewUpVector(). > > However, my views don't change, no matter how hard I try to update the > window / renderer / renderwindow /camera (I believe I've tested almost all, > if not all possibilities) > > The only way is to manually click "x" "z" or "y" keys on each window to > obtain the desired point of view in the images. > > Anyone knows how to automatically set my views to the desired way without > having to press keys? > > By the wai I use ctkVTKRenderView not a regular vtkRenderWindow but I > believe this is not related to CTK. > > Best regards > -- > Sergio Vera > > Alma IT Systems > C/ Vilana, 4B, 4? 1? > 08022 Barcelona > T. (+34) 932 380 592 > www.alma3d.com From dzenanz at gmail.com Wed Dec 5 07:21:41 2012 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Wed, 5 Dec 2012 13:21:41 +0100 Subject: [vtkusers] Two questions regarding ITK Gradient Magnitude Recursive Gaussian Image Filter In-Reply-To: <014b01cdd21f$630ae550$2920aff0$@ac.kr> References: <014b01cdd21f$630ae550$2920aff0$@ac.kr> Message-ID: You cannot access intermediate image used in a filter. You would have to modify the code of the filter in order to visualize the computation process. In order to figure out the actual formula used, you need to take a look at the GenerateData method in this file: ITK4\Modules\Filtering\ImageGradient\include\itkGradientMagnitudeRecursiveGaussianImageFilter.hxx On Tue, Dec 4, 2012 at 2:00 PM, Xiaopeng Yang wrote: > Hello everyone,**** > > ** ** > > I have two questions regarding ITK Gradient Magnitude Recursive Gaussian > Image Filter:**** > > ** ** > > **1) **In this filter, as far as we know, a *finite difference approach > * is used to calculate gradient magnitude of an image. My question is *what > formula is used* by the finite difference approach implemented in this > filter?**** > > **2) **The ITK Software Guide tells us that the computation process of > this filter is equivalent to first *smoothing the image *by convolving it > with a Gaussian kernel and then applying a differential operator. My > question is that is there a way to get *an output of the smoothed image*? > I want to visualize the computation process.**** > > ** ** > > If any of you have any idea regarding the two questions, it would be very > appreciated if you share it with me. Thank you in advance.**** > > ** ** > > Best regards,**** > > Yang**** > > _______________________________________________ > 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://www.vtk.org/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From huangz2350 at 163.com Wed Dec 5 07:58:27 2012 From: huangz2350 at 163.com (huangz2350) Date: Wed, 5 Dec 2012 20:58:27 +0800 (CST) Subject: [vtkusers] the Texture's Class Using Problem Message-ID: <1f6209db.120e3.13b6b255870.Coremail.huangz2350@163.com> Dear Can you recommend to me the Texture's Class,it can set Font-Context(Font-Style, Font-type and Font-Size) and respond to ZoomIn,ZoomOut and pan(vtkInteractorStyle),thank you. PS: I found vtkTextActor it can set Font-Style, Font-type and Font-Size,but it can't respond to ZoomIn,ZoomOut and pan(vtkInteractorStyle), also the another vtkVectorText can't seting the respond to ZoomIn,ZoomOut and pan(vtkInteractorStyle) ,but it can't set Font-Style, Font-type and Font-Size. If such the class exists, can you give me some code for understanding. thank you. Phoenix -------------- next part -------------- An HTML attachment was scrubbed... URL: From huangz2350 at 163.com Wed Dec 5 07:58:55 2012 From: huangz2350 at 163.com (huangz2350) Date: Wed, 5 Dec 2012 20:58:55 +0800 (CST) Subject: [vtkusers] the Texture's Class Using Problem Message-ID: <7a5dbc89.12100.13b6b25c669.Coremail.huangz2350@163.com> Dear Can you recommend to me the Texture's Class,it can set Font-Context(Font-Style, Font-type and Font-Size) and respond to ZoomIn,ZoomOut and pan(vtkInteractorStyle),thank you. PS: I found vtkTextActor it can set Font-Style, Font-type and Font-Size,but it can't respond to ZoomIn,ZoomOut and pan(vtkInteractorStyle), also the another vtkVectorText can't seting the respond to ZoomIn,ZoomOut and pan(vtkInteractorStyle) ,but it can't set Font-Style, Font-type and Font-Size. If such the class exists, can you give me some code for understanding. thank you. Phoenix -------------- next part -------------- An HTML attachment was scrubbed... URL: From sergio.vera at alma3d.com Wed Dec 5 10:15:28 2012 From: sergio.vera at alma3d.com (Sergio Vera) Date: Wed, 5 Dec 2012 16:15:28 +0100 Subject: [vtkusers] Setting interactor views (coronal, sagital, axial) In-Reply-To: References: Message-ID: Hi David, It's not working :( here is the snippet of my code: void SliceRenderView::SetView( ViewType a_view) { d_view = a_view; switch (d_view) { case eAxial: { d_interactorStyle->SetZViewRightVector(1,0,0); d_interactorStyle->SetZViewUpVector(0,1,0); } break; case eSagittal: { d_interactorStyle->SetXViewRightVector(0,1,0); d_interactorStyle->SetXViewUpVector(0,0,1); } break; case eCoronal: { d_interactorStyle->SetYViewRightVector(1,0,0); d_interactorStyle->SetYViewUpVector(0,0,1); } break; case eOblique: default: std::cout << "Unimplemented" << std::endl; } this->setCornerAnnotationText(d_ViewText[d_view]); this->renderer()->ResetCamera(); d_interactorStyle->SetImageOrientation(d_interactorStyle->GetZViewRightVector(), d_interactorStyle->GetZViewUpVector()); /* this->renderWindow()->Render(); this->renderWindow()->GetInteractor()->Render(); this->repaint(); */ } It gets called when the image has been loaded void SliceRenderView::setImageData( VolumeData* a_data) { std::cout << __FUNCTION__ << std::endl; d_image = a_data->GetImage(); d_imgResliceMapper->SetInput(d_image); d_imgSlice->SetMapper(d_imgResliceMapper); d_imgSlice->SetProperty(d_imgProp); this->SetView(d_view); this->renderWindow()->Render(); this->renderer()->ResetCameraClippingRange(); } Any hints on what can be wrong? On Wed, Dec 5, 2012 at 1:16 PM, David Gobbi wrote: > Hi Sergio, > > The view will change if you call SetImageOrientation(). For example: > > style->SetImageOrientation(style->GetZViewRightVector(), > style->GetZViewUpVector()); > > Or you can use code like this: > > double vector1[3] = { 1.0, 0.0, 0.0 }; > double vector2[3] = { 0.0, 0.0, -1.0 }; > style->SetImageOrientation(vector1, vector2); > > - David > > On Wed, Dec 5, 2012 at 2:53 AM, Sergio Vera > wrote: > > Hello all > > I'm implementing a medical image viewer with the typical 3+1 windows > (axial, > > coronal sagittal and 3d) layout. > > > > Each window has his vtkRenderWindowInteractor and vtkIntractorStyleImage > > > > I setup the interactor styles views vectors (right & up) for each slice > view > > (axial, coronal, sagital) with > > SetZViewRightVector() and SetZViewUpVector(). > > > > However, my views don't change, no matter how hard I try to update the > > window / renderer / renderwindow /camera (I believe I've tested almost > all, > > if not all possibilities) > > > > The only way is to manually click "x" "z" or "y" keys on each window to > > obtain the desired point of view in the images. > > > > Anyone knows how to automatically set my views to the desired way without > > having to press keys? > > > > By the wai I use ctkVTKRenderView not a regular vtkRenderWindow but I > > believe this is not related to CTK. > > > > Best regards > > -- > > Sergio Vera > > > > Alma IT Systems > > C/ Vilana, 4B, 4? 1? > > 08022 Barcelona > > T. (+34) 932 380 592 > > www.alma3d.com > -- Sergio Vera Alma IT Systems C/ Vilana, 4B, 4? 1? 08022 Barcelona T. (+34) 932 380 592 www.alma3d.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From nspx.roronoa at gmail.com Wed Dec 5 12:20:02 2012 From: nspx.roronoa at gmail.com (NsPx) Date: Wed, 05 Dec 2012 18:20:02 +0100 Subject: [vtkusers] Propagate transformation from vtkActor to vtkPolydata Message-ID: <50BF8242.5050403@gmail.com> Hi all, After moving a vtkActor, I want to propagate the transformation to its vtkPolydata. My code : vtkMatrix4x4* matrix = actor->GetMatrix(); vtkSmartPointer transform = vtkSmartPointer::New(); transform->SetMatrix( matrix ); vtkSmartPointer filter= vtkSmartPointer::New(); filter->SetTransform( transform); filter->SetInput(polyData); filter->Update(); polyData->DeepCopy( filter->GetOutput()); How can I prevent the actor from being updated again ? I tried to apply the reverse matrix to the actor but I failed, I'm a little bit confused about which function I have to call, ( PokeMatrix() ? Set/AddPosition() ? ... ). Thanks by advance for helping me. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Massinissa.Bandou at USherbrooke.ca Wed Dec 5 12:40:05 2012 From: Massinissa.Bandou at USherbrooke.ca (Massinissa Bandou) Date: Wed, 5 Dec 2012 09:40:05 -0800 (PST) Subject: [vtkusers] how to create/use a Lookup table for opacity/color transferfunction In-Reply-To: References: Message-ID: <1354729205757-5717441.post@n5.nabble.com> Hi Rodrigo, I'm not sure you can set your lookup table in OpacityTransferfunction or ColorTransferFunction. A default lookup table is created by the mapper. So you can create your own table and call it from vtkPolyDataMapper for example. Massi -- View this message in context: http://vtk.1045678.n5.nabble.com/how-to-create-use-a-Lookup-table-for-opacity-color-transferfunction-tp5716426p5717441.html Sent from the VTK - Users mailing list archive at Nabble.com. From juan.cardelino at gmail.com Wed Dec 5 14:40:19 2012 From: juan.cardelino at gmail.com (Juan Cardelino) Date: Wed, 5 Dec 2012 17:40:19 -0200 Subject: [vtkusers] Rotation not applied when importing VRML file. In-Reply-To: References: Message-ID: Dear all, Does anyone has a clue about this? We are kind of stuck with this. Apart from understanding the behavior of VTK with VRML files we are interested in importing complete scenes from the most common modelers (3D max, Blender, etc). Blender only exports x3d which as far as I understood is less supported than VRML in VTK. Any thoughts will be appreciated. Thanks in advance. Best regards, Juan On Sun, Dec 2, 2012 at 3:37 PM, Matias Tailanian wrote: > Dear all, > I've been testing some examples about importing vrml files in vtk. I added > an new example program to the VTK Wiki [1], where I show how to get an > individual object from a a scene and its associated transform. The problem > is that when importing the actor into vtk, it loses it's rotation. The > traslation is correctly applied. > > The attached .wrl file was generated with 3d max10 and contains a teapot > rotated 30? along x axis. > > [1] http://www.cmake.org/Wiki/VTK/Examples/Cxx/IO/individualVRML > > > Thanks in advance. > Best regards, > Mat?as > > > _______________________________________________ > 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://www.vtk.org/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dhope at ara.com Wed Dec 5 17:11:23 2012 From: dhope at ara.com (David Hope ARA/SED) Date: Wed, 5 Dec 2012 22:11:23 +0000 Subject: [vtkusers] Questions about vtkWarpLens, Cameras, and Interactors Message-ID: <3ABB173489F4794EA8EB3AEC898B2960010DCA451D@mail-west-1.exchange2.ara.wan> Can anyone help me with vtkWarpLens? What I am trying to do is implement a distortion pattern on the camera to modify how the data is seen. Here is the meat of the code (it's in C#, I'm using Activis) vtkPolyData pd = vtkPolyData.New(); CreateFromFile(pd); // this creates a triangle representation of a height field double [] sr = pd.GetScalarRange(); vtkLookupTable lut = vtkLookupTable.New(); lut.SetNumberOfColors(16); lut.SetHueRange(0.667, 0.0); lut.Build(); wl = vtkWarpLens.New(); wl.SetInputConnection(pd.GetProducerPort()); wl.SetPrincipalPoint(0.5, 0.5); wl.SetFormatWidth(1); wl.SetFormatHeight(1); wl.SetImageWidth(1000); wl.SetImageHeight(1000); wl.SetK1(0.01307); wl.SetK2(0.0003102); wl.SetP1(1.953e-005); wl.SetP2(-9.655e-005); vtkDataSetMapper dsmDistorted = vtkDataSetMapper.New(); dsmDistorted.SetInputConnection(wl.GetOutputPort()); dsmDistorted.SetLookupTable(lut); dsmDistorted.SetScalarRange(sr[0]+20, sr[1]); vtkActor dsDistortedActor = vtkActor.New(); dsDistortedActor.SetMapper(dsmDistorted); m_renDistorted.AddActor(dsDistortedActor); m_renWin.SetDesiredUpdateRate(0); m_renWin.Render(); m_renDistorted.ResetCamera(); So, basically, I am creating a terrain representation using polygons, passing it through the warplens, passing that through a dataset mapper to give it pretty colors, then displaying it. The issue is that the "warp" appears to be static to the terrain, not to the camera. I'm pretty new to VTK, so it's possible that I don't understand how the Interactor and the Camera are related. Can someone help? Thanks, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From boyeggplant110 at gmail.com Wed Dec 5 19:02:17 2012 From: boyeggplant110 at gmail.com (boyeggplant110) Date: Wed, 5 Dec 2012 18:02:17 -0600 Subject: [vtkusers] height field from point data Message-ID: <003501cdd344$f509cef0$df1d6cd0$@gmail.com> Hi all, I try to construct a height field with VTK. My data is point data stored in csv files. I read the data and use vtkDelaunay2D to triangulate the dataset and vtkGeometryFilter to extract geometry . But my result just show a plane. Does anyone know how to add the height? I attach my code: First part --read data: the data read from csv file and is stored in vtkpoints object ([x,y,0]) and the height is stored in vtkFloatarray. Both objects are imported to vtkploydata object Second part ----heightfield: use vtkDelaunay2D and vtkGeometryFilter def readdata(filename): dataset1=vtkPolyData() newpoints=vtkPoints() newscalars=vtkFloatArray() l=len(filename) for j in range(1,l) : data_csv=csv.reader(open(filename[j])) data_csv.next() data_array_temp=[0,0,0] index=1 for row in data_csv: data_array_temp[0]=j*5 data_array_temp[1]=index #data_array_temp[2]=float(row[4]) newpoints.InsertNextPoint(data_array_temp) newscalars.InsertNextValue (float(row[4])) index=index+1 dataset1.SetPoints(newpoints) dataset1.GetPointData().SetScalars(newscalars) return dataset1 ef heightfield(dataset): del2=vtkDelaunay2D() #del2.SetTolerance(0.01) del2.SetAlpha(0) del2.SetInput(dataset) print('1') #hf=vtkGreedyTerrainDecimation() #hf.SetInput(del2.GetOutput()) geometry=vtkGeometryFilter() geometry.SetInput(del2.GetOutput()) warp=vtkWarpScalar() warp.SetInput(geometry.GetOutput()) warp.SetScaleFactor(1) warp.XYPlaneOn() warp.UseNormalOn() warp.SetNormal(0,0,2) lut =vtkLookupTable() lut.SetNumberOfColors(100) lut.SetHueRange(0.2, 0.97) lut.SetSaturationRange(-1, 1) lut.Build() merge=vtkMergeFilter() merge.SetGeometry(warp.GetOutput()) merge.SetScalars(dataset) mapper=vtkPolyDataMapper() mapper.SetLookupTable(lut) mapper.SetInput(merge.GetOutput()) actor=vtkActor() actor.SetMapper(mapper) renderer=vtkRenderer() renderer.AddActor(actor) renderwindow=vtkRenderWindow() renderwindow.AddRenderer(renderer) renderwindow.SetSize(200,200) interactor=vtkRenderWindowInteractor() interactor.SetRenderWindow(renderwindow) interactor.Initialize() renderwindow.Render() interactor.Start() return thanks in advance! JIE -------------- next part -------------- An HTML attachment was scrubbed... URL: From huangz2350 at 163.com Wed Dec 5 20:17:52 2012 From: huangz2350 at 163.com (huangz2350) Date: Wed, 5 Dec 2012 17:17:52 -0800 (PST) Subject: [vtkusers] the Texture's Class Using Problem In-Reply-To: <7a5dbc89.12100.13b6b25c669.Coremail.huangz2350@163.com> References: <7a5dbc89.12100.13b6b25c669.Coremail.huangz2350@163.com> Message-ID: <1354756672209-5717446.post@n5.nabble.com> Who Can Help me?thanks... I wait for onLine -- View this message in context: http://vtk.1045678.n5.nabble.com/the-Texture-s-Class-Using-Problem-tp5717438p5717446.html Sent from the VTK - Users mailing list archive at Nabble.com. From huangz2350 at 163.com Wed Dec 5 20:29:41 2012 From: huangz2350 at 163.com (huangz2350) Date: Wed, 5 Dec 2012 17:29:41 -0800 (PST) Subject: [vtkusers] The vtkVectorText's Problem In-Reply-To: <1354695045711-5717429.post@n5.nabble.com> References: <201212051153441567086@163.com> <1354695045711-5717429.post@n5.nabble.com> Message-ID: <1354757381519-5717447.post@n5.nabble.com> Thanks for you Help. but I want append text to a 3d-object (append textcan respond to ZoomIn,ZoomOut and move(vtkInteractorStyle's Action)) but i test the vtkTextActor,it can't do this. also the another one vtkVectorText can't be set Font-Context(Font-Style, Font-type and Font-Size). you give me the url ,it seem not solve my problem... Can you recommend to me the Texture's Class,it can be set Font-Context(Font-Style, Font-type and Font-Size) and respond to ZoomIn,ZoomOut and move(vtkInteractorStyle's Action),thank you very much. -- View this message in context: http://vtk.1045678.n5.nabble.com/The-vtkVectorText-s-Problem-tp5717427p5717447.html Sent from the VTK - Users mailing list archive at Nabble.com. From daviddoria at gmail.com Wed Dec 5 20:45:01 2012 From: daviddoria at gmail.com (David Doria) Date: Wed, 5 Dec 2012 20:45:01 -0500 Subject: [vtkusers] height field from point data In-Reply-To: <003501cdd344$f509cef0$df1d6cd0$@gmail.com> References: <003501cdd344$f509cef0$df1d6cd0$@gmail.com> Message-ID: On Wed, Dec 5, 2012 at 7:02 PM, boyeggplant110 wrote: > Hi all,**** > > I try to construct a height field with VTK. My data is point data stored > in csv files. I read the data and use vtkDelaunay2D to triangulate the > dataset and vtkGeometryFilter to extract geometry . But my result just show > a plane. Does anyone know how to add the height? > You say your data is (x,y,0) - just make it (x,y,z) and you will get your height. David -------------- next part -------------- An HTML attachment was scrubbed... URL: From boyeggplant110 at gmail.com Wed Dec 5 20:52:09 2012 From: boyeggplant110 at gmail.com (Jie Li) Date: Wed, 5 Dec 2012 19:52:09 -0600 Subject: [vtkusers] height field from point data In-Reply-To: References: <003501cdd344$f509cef0$df1d6cd0$@gmail.com> Message-ID: thanks very much! it works! And would you mind giving more suggestions? I want to use different colors to show the magnitude of height. I add a lookup table but I just get a red solid volume. JIE 2012/12/5 David Doria > On Wed, Dec 5, 2012 at 7:02 PM, boyeggplant110 wrote: > >> Hi all,**** >> >> I try to construct a height field with VTK. My data is point data stored >> in csv files. I read the data and use vtkDelaunay2D to triangulate the >> dataset and vtkGeometryFilter to extract geometry . But my result just show >> a plane. Does anyone know how to add the height? >> > > You say your data is (x,y,0) - just make it (x,y,z) and you will get your > height. > > David > -- * JIE LI Master of Science in Statistics Division of Statistics + Scientific Computation The University of Texas at Austin| 1 University Station G2500| Austin, TX 78712 * -------------- next part -------------- An HTML attachment was scrubbed... URL: From abhishek at meddiff.com Wed Dec 5 23:56:18 2012 From: abhishek at meddiff.com (abhishek) Date: Wed, 5 Dec 2012 20:56:18 -0800 (PST) Subject: [vtkusers] Rotate VTK Volume in OffScreenRendering Mode. Message-ID: <1354769778160-5717451.post@n5.nabble.com> Hello Users,I am writing a program which performs off screen volume rendering and export the visible plane as PNG image using vtkWindowToImageFilter and vtkPNGWriter.This works for the initial plane. Now, i want to animate the volume by rotating it by 1 degree along x-axis every second. For this, I am using /RotateX/ method available in vtkVolume. But, I am not able to export rotated frame as PNG image.Any idea, on how can i solve my problem.Here's the VTK Pipeline being used:1. vtkDicomImageReader --> Reads DICOM dataset2. vtkFixedPointVolumeRayCastMapper --> Output of vtkDicomImageReader is set as input.3. vtkColorTransferFunction, vtkPiecewiseFunction, vtkVolumeProperty4. vtkVolume --> Assign vtkFixedPointVolumeRayCastMapper as volume's mapper5. vtkRenderer --> Add volume to renderer6. vtkRendererWindow --> Add renderer to window, set renderer window for OffScreenRendering7. vtkWindowToImageFilter --> Set renderer window as input.8. vtkPNGWriter --> Set output port from Win2Img filter as input and write output to a PNG.RegardsAbhishek. -- View this message in context: http://vtk.1045678.n5.nabble.com/Rotate-VTK-Volume-in-OffScreenRendering-Mode-tp5717451.html Sent from the VTK - Users mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.gabriel at 4plus.de Thu Dec 6 02:58:31 2012 From: adrian.gabriel at 4plus.de (Najzero) Date: Wed, 5 Dec 2012 23:58:31 -0800 (PST) Subject: [vtkusers] The vtkVectorText's Problem In-Reply-To: <1354757381519-5717447.post@n5.nabble.com> References: <201212051153441567086@163.com> <1354695045711-5717429.post@n5.nabble.com> <1354757381519-5717447.post@n5.nabble.com> Message-ID: <1354780711313-5717452.post@n5.nabble.com> Hello again, sorry to hear, and this is a difficult topic. Whenever someone asks about the vtkVectorText there are rarely answers on the mailing list and I believe not very many programmers are using the vtkVectorText class. This might be due the fact that they simply display the textual information on the rest of the gui and not within the 3d/widget/windows itself. The only way I could imagine you can get this 3d results would be using the vector text but supplying the glyphs yourself. This will require alot of effort, since you would need to use a 3rd Party libary to generate the glyphs/points/vectors on the fly ( e.g. http://www.njph.f2s.com/dxfontutils/ ). This is really brute force and depending on how often you change the look of the font itself very slow. I am too very interested on how vtk volks display the kind of text you require for your program. Because the given class is very limited (it only supports ascii codes from 31 to 126 in default ;-) ) Best regards Adrian -- View this message in context: http://vtk.1045678.n5.nabble.com/The-vtkVectorText-s-Problem-tp5717427p5717452.html Sent from the VTK - Users mailing list archive at Nabble.com. From nico.schloemer at gmail.com Thu Dec 6 03:41:02 2012 From: nico.schloemer at gmail.com (=?ISO-8859-1?Q?Nico_Schl=F6mer?=) Date: Thu, 6 Dec 2012 09:41:02 +0100 Subject: [vtkusers] quadratic (or higher-order) elements on linear triangles Message-ID: Hi all, using point_data, I can easily store continuous piecewise-linear functions on a (triangular) mesh. Is there a default way to store higher-order elements, i.e., continuous, piecewise-quadratic function on a (triangular mesh? Cheers, Nico From qt.itk.vtk.help at gmail.com Thu Dec 6 04:05:57 2012 From: qt.itk.vtk.help at gmail.com (qt.itk.vtk.help) Date: Thu, 6 Dec 2012 01:05:57 -0800 Subject: [vtkusers] Problem in instaling QVTKWidgetPlugin Message-ID: Hie, I am new to VTK.I want to use QVTKPluginWidget in Qt designer. I am using Visual Studio 2008 with MSVC compiler CMake- 2.8.10.1 Qt Version -4.8.3 VTK - 5.0 As per VTK User's Guide we have to configure VTK Lib with Cmake with setting few options like, VTK_USE_GUISUPPORT=Turn On configure Desired Qt version cmake take itself configure then set qt_qmake_executable ON Build Example configure after doing this i am getting this warning in Cmake CMake Warning (dev) at GUISupport/Qt/CMakeLists.txt:113 (ADD_LIBRARY): Policy CMP0003 should be set before this line. Add code such as if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) as early as possible but after the most recent call to cmake_minimum_required or cmake_policy(VERSION). This warning appears because target "QVTKWidgetPlugin" links to some libraries for which the linker must search: vfw32, opengl32 and other libraries with known full path: C:/Qt/4.8.3/lib/QtGuid4.lib E:/DebugLibrary/VtkBin/bin/Debug/vtkRendering.lib CMake is adding directories in the second list to the linker search path in case they are needed to find libraries from the first list (for backwards compatibility with CMake 2.4). Set policy CMP0003 to OLD or NEW to enable or disable this behavior explicitly. Run "cmake --help-policy CMP0003" for more information. This warning is for project developers. Use -Wno-dev to suppress it. Generating done Then have to build this library in Visual studio then Copy the QVTKPluginWidget.dll in Plugin/Designer Folder. Then we should get QVTKWidget in designer But i am not getting that in designer after doing this process.Kindly help me. -------------- next part -------------- An HTML attachment was scrubbed... URL: From frese at heidenhain.de Thu Dec 6 04:36:11 2012 From: frese at heidenhain.de (Frese Daniel Dr.) Date: Thu, 6 Dec 2012 10:36:11 +0100 Subject: [vtkusers] Questions on vtkLookupTable, SetIndexedLookup in connection with graph display Message-ID: <758150D667C235458DE231BB50B9A2B3159A98C135@de01ex07.GLOBAL.JHCN.NET> Hi, nobody knows what's going on ? Or is my question not clear enough ? Does anybody have any experience with line lookupTable->SetIndexedLookup() ? For my concrete application, I found work arounds for the most pressing issues, but still I'd really like to understand what's happening... Daniel Von: Frese Daniel Dr. Gesendet: Montag, 26. November 2012 14:47 An: vtkusers at vtk.org Betreff: Questions on vtkLookupTable, SetIndexedLookup in connection with graph display Hello list, I try to display a graph with vertices in three different colors, as defined by a LookupTable. Reading the vtk 6.0 specs I thought that the SetIndexedLookup method would be the right thing to use, but somehow I can't get it working. Most probably I don't understand something very fundamental regarding this graph stuff - it would be great if somebody could shine some light on this. I put together a small piece of self containing, compilable code, to illustrate my questions. Not, that you might have to replace vtkWin32OpenGLRenderWindow by some class appropriate to your system (I work with Visual Studio 2008 on Windows 7, 64 bit; using a git snapshot a few days old). Here we go with the code : #include #include "vtkWin32OpenGLRenderWindow.h" #include "vtkRenderWindow.h" #include "vtkWin32RenderWindowInteractor.h" #include "vtkGraphLayoutView.h" #include "vtkViewTheme.h" #include "vtkLookupTable.h" #include "vtkMutableDirectedGraph.h" #include "vtkTree.h" #include "vtkIntArray.h" #include "vtkStringArray.h" #include "vtkDataRepresentation.h" #include "vtkRenderedGraphRepresentation.h" #include "vtkDataSetAttributes.h" void main() { vtkGraphLayoutView* view = vtkGraphLayoutView::New(); vtkWin32OpenGLRenderWindow* RenderWindow = vtkWin32OpenGLRenderWindow::SafeDownCast(view->GetRenderWindow()); // Construction of the lookup table, and debug output of GetColor vtkLookupTable* lookupTable = vtkLookupTable::New(); lookupTable->SetNumberOfTableValues(3); lookupTable->SetTableValue(0, 1.0, 0.0, 0.0); // red lookupTable->SetTableValue(1, 0.0, 0.0, 1.0); // blue lookupTable->SetTableValue(2, 1.0, 1.0, 1.0); // white lookupTable->SetIndexedLookup(1); lookupTable->SetTableRange(0,2); // this is ignored, if IndexedLookup = true lookupTable->Build(); double rgb[4]; for (int i=0; i<3; i++) { lookupTable->GetColor(i,rgb); cout << "Color " << i << " : " << rgb[0] << " " << rgb[1] << " " << rgb[2] << endl; } // construct view, theme and simple graph to display vertex colors vtkViewTheme *theme = vtkViewTheme::New(); theme->SetPointLookupTable(lookupTable); view->ApplyViewTheme(theme); vtkMutableDirectedGraph *vtkg = vtkMutableDirectedGraph::New(); // array to encode the vertex colors vtkIntArray *vertexColors = vtkIntArray::New(); vertexColors->SetNumberOfComponents(1); vertexColors->SetName("Vertex Color"); vertexColors->InsertNextValue(0); vertexColors->InsertNextValue(1); vertexColors->InsertNextValue(2); // array to encode vertex names vtkStringArray *names = vtkStringArray::New(); names->SetName("Vertex Name"); names->InsertNextValue("0"); names->InsertNextValue("1"); names->InsertNextValue("2"); // construct graph and add color/name arrays vtkIdType vtkvertex; cout << "vertex 0 : " << (int) (vtkvertex = vtkg->AddVertex()) << endl; cout << "vertex 1 : " << (int) vtkg->AddChild(vtkvertex) << endl; cout << "vertex 2 : " << (int) vtkg->AddChild(vtkvertex) << endl; vtkg->GetVertexData()->AddArray(vertexColors); view->SetVertexColorArrayName("Vertex Color"); vtkg->GetVertexData()->AddArray(names); view->SetVertexLabelArrayName("Vertex Name"); view->SetVertexLabelVisibility(true); vtkTree* vtktree = vtkTree::New(); vtktree->CheckedShallowCopy(vtkg); vtkDataRepresentation* rep = view->SetRepresentationFromInput(vtktree); vtkRenderedGraphRepresentation::SafeDownCast(view->GetRepresentation())->ColorVerticesByArrayOn(); view->Render(); view->ResetCamera(); view->GetInteractor()->Initialize(); view->GetInteractor()->Start(); } The output in a DOS window is : Color 0 : 0.501961 0 0 Color 1 : 0.501961 0 0 Color 2 : 0.501961 0 0 vertex 0 : 0 vertex 1 : 1 vertex 2 : 2 The output in a graphical window shows three connected vertices with the following coloring (see attached png) : Vertex 0 (middle vertex) : blue Vertex 1 (right vertex) : green Vertex 2 (left vertex): red This output is different from the one I expect. Here are my questions: 1) Why does the output of lookupTable->GetColor() return these strange values ? I would expect, that it returns e.g. for Color 0 the values 1 0 0 (=red). By the way, it behaves as I expect, when I comment the line lookupTable->SetIndexedLookup(1) ... 2) Why does the graphical output shows vertices in the mentioned colors ? I did not define green at all; I would rather expect the following color scheme: Vertex 0 (middle vertex) : red Vertex 1 (right vertex) : blue Vertex 2 (left vertex): white The "wrong" coloring in the output window occurs regardless whether I call lookupTable->SetIndexedLookup(1) or not. It feels somehow, as if the graph wouldn't care at all about my lookuptable. Am I doing something entirely wrong here ? 3) In the code example above would it have been necessary to call lookupTable->Build() ? It doesn't seem to make a difference, when I try to omit it. I would appreciate any help on this. Thanks, Daniel ------------------------------------------------------------------------------------------------------ Registergericht: Traunstein / Registry Court: HRB 275 - Sitz / Head Office: Traunreut Aufsichtsratsvorsitzender / Chairman of Supervisory Board: Rainer Burkhard Gesch?ftsf?hrung / Management Board: Thomas Sesselmann (Vorsitzender / Chairman), Michael Grimm, Matthias Fauser, Sebastian Tondorf E-Mail Haftungsausschluss / E-Mail Disclaimer -------------- next part -------------- An HTML attachment was scrubbed... URL: From notinmyhead at gmail.com Thu Dec 6 05:32:28 2012 From: notinmyhead at gmail.com (Alessandro) Date: Thu, 6 Dec 2012 11:32:28 +0100 Subject: [vtkusers] Questions on vtkLookupTable, SetIndexedLookup in connection with graph display In-Reply-To: <758150D667C235458DE231BB50B9A2B3159A98C135@de01ex07.GLOBAL.JHCN.NET> References: <758150D667C235458DE231BB50B9A2B3159A98C135@de01ex07.GLOBAL.JHCN.NET> Message-ID: <83015CD8-0A54-4904-92EA-15E04A2053A4@gmail.com> Hi... looking at you code I really don't see the point... have you tried without that line...? Il giorno 06/dic/2012, alle ore 10.36, Frese Daniel Dr. ha scritto: > Hi, > > nobody knows what?s going on ? Or is my question not clear enough ? > Does anybody have any experience with line lookupTable->SetIndexedLookup() ? For my concrete application, I found work arounds for the most pressing issues, but still I?d really like to understand what?s happening? > > Daniel > > Von: Frese Daniel Dr. > Gesendet: Montag, 26. November 2012 14:47 > An: vtkusers at vtk.org > Betreff: Questions on vtkLookupTable, SetIndexedLookup in connection with graph display > > Hello list, > > I try to display a graph with vertices in three different colors, as defined by a LookupTable. Reading the vtk 6.0 specs I thought that the SetIndexedLookup method would be the right thing to use, but somehow I can?t get it working. Most probably I don?t understand something very fundamental regarding this graph stuff ? it would be great if somebody could shine some light on this. > > I put together a small piece of self containing, compilable code, to illustrate my questions. Not, that you might have to replace vtkWin32OpenGLRenderWindow by some class appropriate to your system (I work with Visual Studio 2008 on Windows 7, 64 bit; using a git snapshot a few days old). Here we go with the code : > > #include > > #include "vtkWin32OpenGLRenderWindow.h" > #include "vtkRenderWindow.h" > #include "vtkWin32RenderWindowInteractor.h" > #include "vtkGraphLayoutView.h" > #include "vtkViewTheme.h" > #include "vtkLookupTable.h" > #include "vtkMutableDirectedGraph.h" > #include "vtkTree.h" > #include "vtkIntArray.h" > #include "vtkStringArray.h" > #include "vtkDataRepresentation.h" > #include "vtkRenderedGraphRepresentation.h" > #include "vtkDataSetAttributes.h" > > void main() { > vtkGraphLayoutView* view = vtkGraphLayoutView::New(); > vtkWin32OpenGLRenderWindow* RenderWindow = vtkWin32OpenGLRenderWindow::SafeDownCast(view->GetRenderWindow()); > > // Construction of the lookup table, and debug output of GetColor > vtkLookupTable* lookupTable = vtkLookupTable::New(); > lookupTable->SetNumberOfTableValues(3); > lookupTable->SetTableValue(0, 1.0, 0.0, 0.0); // red > lookupTable->SetTableValue(1, 0.0, 0.0, 1.0); // blue > lookupTable->SetTableValue(2, 1.0, 1.0, 1.0); // white > lookupTable->SetIndexedLookup(1); > lookupTable->SetTableRange(0,2); // this is ignored, if IndexedLookup = true > lookupTable->Build(); > > double rgb[4]; > for (int i=0; i<3; i++) { > lookupTable->GetColor(i,rgb); > cout << "Color " << i << " : " << rgb[0] << " " << rgb[1] << " " << rgb[2] << endl; > } > > // construct view, theme and simple graph to display vertex colors > vtkViewTheme *theme = vtkViewTheme::New(); > theme->SetPointLookupTable(lookupTable); > view->ApplyViewTheme(theme); > vtkMutableDirectedGraph *vtkg = vtkMutableDirectedGraph::New(); > > // array to encode the vertex colors > vtkIntArray *vertexColors = vtkIntArray::New(); > vertexColors->SetNumberOfComponents(1); > vertexColors->SetName("Vertex Color"); > vertexColors->InsertNextValue(0); > vertexColors->InsertNextValue(1); > vertexColors->InsertNextValue(2); > > // array to encode vertex names > vtkStringArray *names = vtkStringArray::New(); > names->SetName("Vertex Name"); > names->InsertNextValue("0"); > names->InsertNextValue("1"); > names->InsertNextValue("2"); > > // construct graph and add color/name arrays > vtkIdType vtkvertex; > cout << "vertex 0 : " << (int) (vtkvertex = vtkg->AddVertex()) << endl; > cout << "vertex 1 : " << (int) vtkg->AddChild(vtkvertex) << endl; > cout << "vertex 2 : " << (int) vtkg->AddChild(vtkvertex) << endl; > > vtkg->GetVertexData()->AddArray(vertexColors); > view->SetVertexColorArrayName("Vertex Color"); > vtkg->GetVertexData()->AddArray(names); > view->SetVertexLabelArrayName("Vertex Name"); > view->SetVertexLabelVisibility(true); > > vtkTree* vtktree = vtkTree::New(); > vtktree->CheckedShallowCopy(vtkg); > vtkDataRepresentation* rep = view->SetRepresentationFromInput(vtktree); > vtkRenderedGraphRepresentation::SafeDownCast(view->GetRepresentation())->ColorVerticesByArrayOn(); > > view->Render(); > view->ResetCamera(); > view->GetInteractor()->Initialize(); > view->GetInteractor()->Start(); > } > > The output in a DOS window is : > Color 0 : 0.501961 0 0 > Color 1 : 0.501961 0 0 > Color 2 : 0.501961 0 0 > vertex 0 : 0 > vertex 1 : 1 > vertex 2 : 2 > > The output in a graphical window shows three connected vertices with the following coloring (see attached png) : > Vertex 0 (middle vertex) : blue > Vertex 1 (right vertex) : green > Vertex 2 (left vertex): red > > This output is different from the one I expect. Here are my questions: > 1) Why does the output of lookupTable->GetColor() return these strange values ? I would expect, that it returns e.g. for Color 0 the values 1 0 0 (=red). By the way, it behaves as I expect, when I comment the line lookupTable->SetIndexedLookup(1) ? > 2) Why does the graphical output shows vertices in the mentioned colors ? I did not define green at all; I would rather expect the following color scheme: > Vertex 0 (middle vertex) : red > Vertex 1 (right vertex) : blue > Vertex 2 (left vertex): white > The ?wrong? coloring in the output window occurs regardless whether I call lookupTable->SetIndexedLookup(1) or not. > It feels somehow, as if the graph wouldn?t care at all about my lookuptable. Am I doing something entirely wrong here ? > 3) In the code example above would it have been necessary to call lookupTable->Build() ? It doesn?t seem to make a difference, when I try to omit it. > > I would appreciate any help on this. > Thanks, > Daniel > > ------------------------------------------------------------------------------------------------------ > Registergericht: Traunstein / Registry Court: HRB 275 - Sitz / Head Office: Traunreut > Aufsichtsratsvorsitzender / Chairman of Supervisory Board: Rainer Burkhard > Gesch?ftsf?hrung / Management Board: Thomas Sesselmann (Vorsitzender / Chairman), > Michael Grimm, Matthias Fauser, Sebastian Tondorf > > E-Mail Haftungsausschluss / E-Mail Disclaimer > > _______________________________________________ > 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://www.vtk.org/mailman/listinfo/vtkusers From frese at heidenhain.de Thu Dec 6 05:49:43 2012 From: frese at heidenhain.de (Frese Daniel Dr.) Date: Thu, 6 Dec 2012 11:49:43 +0100 Subject: [vtkusers] Questions on vtkLookupTable, SetIndexedLookup in connection with graph display In-Reply-To: <83015CD8-0A54-4904-92EA-15E04A2053A4@gmail.com> References: <758150D667C235458DE231BB50B9A2B3159A98C135@de01ex07.GLOBAL.JHCN.NET> <83015CD8-0A54-4904-92EA-15E04A2053A4@gmail.com> Message-ID: <758150D667C235458DE231BB50B9A2B3159A98C2A6@de01ex07.GLOBAL.JHCN.NET> Hi, thanks you for your answer. I guess you talk about the line "lookupTable->SetIndexedLookup(1);". The general point is, that in my main application (the provided code being a strongly shortened version) I have vertices that I want to display in different colors within a graph, depending on the user interaction. Now initially I just use two colors out of e.g. three colors defined in the lookupTable - let's say I want to display initially colors 0 and 1, whereas the lookupTable contains colors 0, 1, 2. Now unfortunately the colors get scaled to the actually used range and I end up with color 0 displayed as color 0, but color 1 displayed as color 2. From the docs, I got the impression that this scaling is avoided when I use SetIndexedLookup(1). Maybe I am wrong with this ? So I started playing with it, but that led to even more questions. As I tried to explain below the code, turning IndexedLookup = true gave indefinite colors (I assume, for reasons I don't understand vtk uses NaNcolor ?), while turning it off, it shows altogether different colors than I want it to. Note, that in the output it colors a vertex green, whereas the only colors I define are red, blue and white. Daniel -----Urspr?ngliche Nachricht----- Von: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] Im Auftrag von Alessandro Gesendet: Donnerstag, 6. Dezember 2012 11:32 An: VTK Users Betreff: Re: [vtkusers] Questions on vtkLookupTable, SetIndexedLookup in connection with graph display Hi... looking at you code I really don't see the point... have you tried without that line...? Il giorno 06/dic/2012, alle ore 10.36, Frese Daniel Dr. ha scritto: > Hi, > > nobody knows what's going on ? Or is my question not clear enough ? > Does anybody have any experience with line > lookupTable->SetIndexedLookup() ? For my concrete application, I found > work arounds for the most pressing issues, but still I'd really like > to understand what's happening. > > Daniel > > Von: Frese Daniel Dr. > Gesendet: Montag, 26. November 2012 14:47 > An: vtkusers at vtk.org > Betreff: Questions on vtkLookupTable, SetIndexedLookup in connection > with graph display > > Hello list, > > I try to display a graph with vertices in three different colors, as defined by a LookupTable. Reading the vtk 6.0 specs I thought that the SetIndexedLookup method would be the right thing to use, but somehow I can't get it working. Most probably I don't understand something very fundamental regarding this graph stuff - it would be great if somebody could shine some light on this. > > I put together a small piece of self containing, compilable code, to illustrate my questions. Not, that you might have to replace vtkWin32OpenGLRenderWindow by some class appropriate to your system (I work with Visual Studio 2008 on Windows 7, 64 bit; using a git snapshot a few days old). Here we go with the code : > > #include > > #include "vtkWin32OpenGLRenderWindow.h" > #include "vtkRenderWindow.h" > #include "vtkWin32RenderWindowInteractor.h" > #include "vtkGraphLayoutView.h" > #include "vtkViewTheme.h" > #include "vtkLookupTable.h" > #include "vtkMutableDirectedGraph.h" > #include "vtkTree.h" > #include "vtkIntArray.h" > #include "vtkStringArray.h" > #include "vtkDataRepresentation.h" > #include "vtkRenderedGraphRepresentation.h" > #include "vtkDataSetAttributes.h" > > void main() { > vtkGraphLayoutView* view = vtkGraphLayoutView::New(); > vtkWin32OpenGLRenderWindow* RenderWindow = > vtkWin32OpenGLRenderWindow::SafeDownCast(view->GetRenderWindow()); > > // Construction of the lookup table, and debug output of GetColor > vtkLookupTable* lookupTable = vtkLookupTable::New(); > lookupTable->SetNumberOfTableValues(3); > lookupTable->SetTableValue(0, 1.0, 0.0, 0.0); // red > lookupTable->SetTableValue(1, 0.0, 0.0, 1.0); // blue > lookupTable->SetTableValue(2, 1.0, 1.0, 1.0); // white > lookupTable->SetIndexedLookup(1); > lookupTable->SetTableRange(0,2); // this is ignored, if IndexedLookup = true > lookupTable->Build(); > > double rgb[4]; > for (int i=0; i<3; i++) { > lookupTable->GetColor(i,rgb); > cout << "Color " << i << " : " << rgb[0] << " " << rgb[1] << " " << rgb[2] << endl; > } > > // construct view, theme and simple graph to display vertex colors > vtkViewTheme *theme = vtkViewTheme::New(); > theme->SetPointLookupTable(lookupTable); > view->ApplyViewTheme(theme); > vtkMutableDirectedGraph *vtkg = vtkMutableDirectedGraph::New(); > > // array to encode the vertex colors > vtkIntArray *vertexColors = vtkIntArray::New(); > vertexColors->SetNumberOfComponents(1); > vertexColors->SetName("Vertex Color"); > vertexColors->InsertNextValue(0); > vertexColors->InsertNextValue(1); > vertexColors->InsertNextValue(2); > > // array to encode vertex names > vtkStringArray *names = vtkStringArray::New(); > names->SetName("Vertex Name"); > names->InsertNextValue("0"); > names->InsertNextValue("1"); > names->InsertNextValue("2"); > > // construct graph and add color/name arrays > vtkIdType vtkvertex; > cout << "vertex 0 : " << (int) (vtkvertex = vtkg->AddVertex()) << endl; > cout << "vertex 1 : " << (int) vtkg->AddChild(vtkvertex) << endl; > cout << "vertex 2 : " << (int) vtkg->AddChild(vtkvertex) << > endl; > > vtkg->GetVertexData()->AddArray(vertexColors); > view->SetVertexColorArrayName("Vertex Color"); > vtkg->GetVertexData()->AddArray(names); > view->SetVertexLabelArrayName("Vertex Name"); > view->SetVertexLabelVisibility(true); > > vtkTree* vtktree = vtkTree::New(); > vtktree->CheckedShallowCopy(vtkg); > vtkDataRepresentation* rep = view->SetRepresentationFromInput(vtktree); > > vtkRenderedGraphRepresentation::SafeDownCast(view->GetRepresentation() > )->ColorVerticesByArrayOn(); > > view->Render(); > view->ResetCamera(); > view->GetInteractor()->Initialize(); > view->GetInteractor()->Start(); > } > > The output in a DOS window is : > Color 0 : 0.501961 0 0 > Color 1 : 0.501961 0 0 > Color 2 : 0.501961 0 0 > vertex 0 : 0 > vertex 1 : 1 > vertex 2 : 2 > > The output in a graphical window shows three connected vertices with the following coloring (see attached png) : > Vertex 0 (middle vertex) : blue > Vertex 1 (right vertex) : green > Vertex 2 (left vertex): red > > This output is different from the one I expect. Here are my questions: > 1) Why does the output of lookupTable->GetColor() return these strange values ? I would expect, that it returns e.g. for Color 0 the values 1 0 0 (=red). By the way, it behaves as I expect, when I comment the line lookupTable->SetIndexedLookup(1) . > 2) Why does the graphical output shows vertices in the mentioned colors ? I did not define green at all; I would rather expect the following color scheme: > Vertex 0 (middle vertex) : red > Vertex 1 (right vertex) : blue > Vertex 2 (left vertex): white > The "wrong" coloring in the output window occurs regardless whether I call lookupTable->SetIndexedLookup(1) or not. > It feels somehow, as if the graph wouldn't care at all about my lookuptable. Am I doing something entirely wrong here ? > 3) In the code example above would it have been necessary to call lookupTable->Build() ? It doesn't seem to make a difference, when I try to omit it. > > I would appreciate any help on this. > Thanks, > Daniel > > ---------------------------------------------------------------------- > -------------------------------- > Registergericht: Traunstein / Registry Court: HRB 275 - Sitz / Head > Office: Traunreut Aufsichtsratsvorsitzender / Chairman of Supervisory > Board: Rainer Burkhard Gesch?ftsf?hrung / Management Board: Thomas > Sesselmann (Vorsitzender / Chairman), Michael Grimm, Matthias Fauser, > Sebastian Tondorf > > E-Mail Haftungsausschluss / E-Mail Disclaimer > > _______________________________________________ > 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://www.vtk.org/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://www.vtk.org/mailman/listinfo/vtkusers From daviddoria at gmail.com Thu Dec 6 07:20:10 2012 From: daviddoria at gmail.com (David Doria) Date: Thu, 6 Dec 2012 07:20:10 -0500 Subject: [vtkusers] height field from point data In-Reply-To: References: <003501cdd344$f509cef0$df1d6cd0$@gmail.com> Message-ID: On Wed, Dec 5, 2012 at 8:52 PM, Jie Li wrote: > thanks very much! it works! > And would you mind giving more suggestions? I want to use different colors > to show the magnitude of height. I add a lookup table but I just get a red > solid volume. > JIE > Please check out the many examples here: http://www.vtk.org/Wiki/VTK/Examples/Cxx If you do a ctrl+f search for "height", you will find two methods for doing this sort of coloring: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Meshes/Color_a_mesh_by_height http://www.vtk.org/Wiki/VTK/Examples/Cxx/Meshes/ElevationFilter David -------------- next part -------------- An HTML attachment was scrubbed... URL: From hobbsk at ohio.edu Thu Dec 6 08:50:37 2012 From: hobbsk at ohio.edu (Kevin H. Hobbs) Date: Thu, 06 Dec 2012 08:50:37 -0500 Subject: [vtkusers] Rotate VTK Volume in OffScreenRendering Mode. In-Reply-To: <1354769778160-5717451.post@n5.nabble.com> References: <1354769778160-5717451.post@n5.nabble.com> Message-ID: <50C0A2AD.10102@ohio.edu> This is what I have rattling around in my file system. -------------- next part -------------- A non-text attachment was scrubbed... Name: rotate.sh Type: application/x-shellscript Size: 751 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: OSMIPVolumeRender.cxx Type: text/x-c++src Size: 3974 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 253 bytes Desc: OpenPGP digital signature URL: From notinmyhead at gmail.com Thu Dec 6 09:15:40 2012 From: notinmyhead at gmail.com (Alessandro) Date: Thu, 6 Dec 2012 15:15:40 +0100 Subject: [vtkusers] Questions on vtkLookupTable, SetIndexedLookup in connection with graph display In-Reply-To: <758150D667C235458DE231BB50B9A2B3159A98C2A6@de01ex07.GLOBAL.JHCN.NET> References: <758150D667C235458DE231BB50B9A2B3159A98C135@de01ex07.GLOBAL.JHCN.NET> <83015CD8-0A54-4904-92EA-15E04A2053A4@gmail.com> <758150D667C235458DE231BB50B9A2B3159A98C2A6@de01ex07.GLOBAL.JHCN.NET> Message-ID: <55F0C6CE-AC4A-401D-9FFD-01506C547E13@gmail.com> Hi, I'm not a "total" expert but: Il giorno 06/dic/2012, alle ore 11.49, Frese Daniel Dr. ha scritto: > Hi, > > thanks you for your answer. > I guess you talk about the line "lookupTable->SetIndexedLookup(1);". > > The general point is, that in my main application (the provided code being a strongly shortened version) I have vertices that I want to display in different colors within a graph, depending on the user interaction. Now initially I just use two colors out of e.g. three colors defined in the lookupTable - let's say I want to display initially colors 0 and 1, whereas the lookupTable contains colors 0, 1, 2. Now unfortunately the colors get scaled to the actually used range and I end up with color 0 displayed as color 0, but color 1 displayed as color 2. From the docs, I got the impression that this scaling is avoided when I use SetIndexedLookup(1). Maybe I am wrong with this ? why don't simply go through the SetTable to change the table dynamically? > > So I started playing with it, but that led to even more questions. As I tried to explain below the code, turning IndexedLookup = true gave indefinite colors (I assume, for reasons I don't understand vtk uses NaNcolor ?), Never happend to me but I'm guessing the NAN color is in case you put some NAN element as input of filters that mach up data and the lut... Hope it helps... Ale From martin.ennemoser at gmx.at Thu Dec 6 10:14:32 2012 From: martin.ennemoser at gmx.at (Martin Ennemoser) Date: Thu, 6 Dec 2012 15:14:32 +0000 (UTC) Subject: [vtkusers] BSP-Tree Message-ID: Hi, I know that vtk features a ModifiedBSPTree. The hyperplanes of this tree used to partition the space are axis aligned. I wanted to ask if it is possible to define hyperplanes for the ModifiedBSPTree that have arbitrary orientation to partition the space. Best regards, Martin From heiland at indiana.edu Thu Dec 6 10:27:11 2012 From: heiland at indiana.edu (Randy Heiland) Date: Thu, 6 Dec 2012 10:27:11 -0500 Subject: [vtkusers] vtkChartXY, QVTKRenderWindowInteractor, PyQt4 In-Reply-To: References: <42713B3D-EDA5-4918-A43F-DE0DB64BFAEE@indiana.edu> <432AF2AE-6F96-4D4B-B2E9-13C4CA92534B@indiana.edu> <2F463CDD-C08F-44FC-9397-E7C209FB99F2@indiana.edu> <6F38120E-024D-4F7E-B65A-E98E3F9CE7A0@indiana.edu> <9A82494E-17AA-4D98-B671-F2DB6F76DC83@indiana.edu> <641F2349-5764-4E5E-9D0C-235A9EC8421E@indiana.edu> Message-ID: <1D4C7B2F-94F5-47EA-BEB7-C07C24563A35@indiana.edu> Continuing in my quest to use charts in our app, is it possible to arrange multiple markers/labels in a legend so that they appear side-by-side (horiz) instead of top-to-bottom? I've attached a simple Python example. thanks, Randy -------------- next part -------------- A non-text attachment was scrubbed... Name: legend.py Type: text/x-python-script Size: 1080 bytes Desc: not available URL: From david.thompson at kitware.com Thu Dec 6 10:43:08 2012 From: david.thompson at kitware.com (David Thompson) Date: Thu, 6 Dec 2012 10:43:08 -0500 Subject: [vtkusers] quadratic (or higher-order) elements on linear triangles In-Reply-To: References: Message-ID: <5B2F83D7-BC3A-4625-A4F0-A05AFD7135ED@kitware.com> Hi Nico, > ... using point_data, I can easily store continuous piecewise-linear > functions on a (triangular) mesh. > Is there a default way to store higher-order elements, i.e., > continuous, piecewise-quadratic function on a (triangular mesh? Not in vtkUnstructuredGrid; all of VTK's higher order elements are isoparametric (i.e., they use the same basis functions for geometric and attribute interpolation). So, you must create additional points (linearly interpolated along edges) and additional connectivity entries for the higher order cells. Only then will the vtkPointData have the correct number of entries for storing quadratic attributes. The vtkGenericDataSet class allows for non-isoparametric elements, but the filters for it are not widely used and tested; nor is it a simple task to subclass the dataset and implement your own cells with a custom interpolant. David From david.lonie at kitware.com Thu Dec 6 10:57:15 2012 From: david.lonie at kitware.com (David Lonie) Date: Thu, 6 Dec 2012 10:57:15 -0500 Subject: [vtkusers] The vtkVectorText's Problem In-Reply-To: <1354757381519-5717447.post@n5.nabble.com> References: <201212051153441567086@163.com> <1354695045711-5717429.post@n5.nabble.com> <1354757381519-5717447.post@n5.nabble.com> Message-ID: On Wed, Dec 5, 2012 at 8:29 PM, huangz2350 wrote: > Thanks for you Help. > but I want append text to a 3d-object > (append textcan respond to ZoomIn,ZoomOut and move(vtkInteractorStyle's > Action)) > but i test the vtkTextActor,it can't do this. > also the another one vtkVectorText can't be set Font-Context(Font-Style, > Font-type and Font-Size). Have you tried vtkTextActor3D? http://www.vtk.org/doc/nightly/html/classvtkTextActor3D.html It provides similar functionality as vtkVectorText (it is rendered as a 3D prop in the scene, rather than an overlay like vtkTextActor), and allows font formatting through vtkTextProperty. The drawback of using vtkTextActor3D in place of vtkVectorText is that vtkVectorText generates polydata, while vtkTextActor3D renders to a textured quad, but this is only an issue if you really need polydata for the pipeline. HTH, Dave From mark.perrego at gmail.com Thu Dec 6 11:02:15 2012 From: mark.perrego at gmail.com (Mark Perrego) Date: Thu, 6 Dec 2012 11:02:15 -0500 Subject: [vtkusers] Cursors on VTK charts Message-ID: Hello, I am currently evaluating VTK for some charting and possible visualization work. From what I've read here the Charts API is the recommended API for doing this work. Does the Charts API support cursors (vtkCursor2D or otherwise)? My attempts to combine the example programs has failed, but there is a strong chance that this is due to my lack of understanding. There does seem to be a bit of a split between the charts and the rest of VTK in the sense that vtkChart does not derive from vtkProp or vtkActor, so I am concerned that the standard VTK cursors will not work with the Charts API. Thank you, - Mark From marcus.hanwell at kitware.com Thu Dec 6 11:17:32 2012 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Thu, 6 Dec 2012 11:17:32 -0500 Subject: [vtkusers] vtkChartXY, QVTKRenderWindowInteractor, PyQt4 In-Reply-To: <1D4C7B2F-94F5-47EA-BEB7-C07C24563A35@indiana.edu> References: <42713B3D-EDA5-4918-A43F-DE0DB64BFAEE@indiana.edu> <432AF2AE-6F96-4D4B-B2E9-13C4CA92534B@indiana.edu> <2F463CDD-C08F-44FC-9397-E7C209FB99F2@indiana.edu> <6F38120E-024D-4F7E-B65A-E98E3F9CE7A0@indiana.edu> <9A82494E-17AA-4D98-B671-F2DB6F76DC83@indiana.edu> <641F2349-5764-4E5E-9D0C-235A9EC8421E@indiana.edu> <1D4C7B2F-94F5-47EA-BEB7-C07C24563A35@indiana.edu> Message-ID: On Thu, Dec 6, 2012 at 10:27 AM, Randy Heiland wrote: > Continuing in my quest to use charts in our app, is it possible to arrange multiple markers/labels in a legend so that they appear side-by-side (horiz) instead of top-to-bottom? I've attached a simple Python example. > I think you found one we don't have yet ;-) We can draw the legend inline, or outside the chart but we don't have a property to draw the symbols side-by-side. It could probably be added if it was useful, and we had some time. Marcus From marcus.hanwell at kitware.com Thu Dec 6 11:20:30 2012 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Thu, 6 Dec 2012 11:20:30 -0500 Subject: [vtkusers] Cursors on VTK charts In-Reply-To: References: Message-ID: On Thu, Dec 6, 2012 at 11:02 AM, Mark Perrego wrote: > Hello, > > I am currently evaluating VTK for some charting and possible > visualization work. From what I've read here the Charts API is the > recommended API for doing this work. Does the Charts API support > cursors (vtkCursor2D or otherwise)? My attempts to combine the > example programs has failed, but there is a strong chance that this is > due to my lack of understanding. There does seem to be a bit of a > split between the charts and the rest of VTK in the sense that > vtkChart does not derive from vtkProp or vtkActor, so I am concerned > that the standard VTK cursors will not work with the Charts API. > We don't have cursors in the chart API right now. It probably wouldn't be hard to add a scene element that could be placed and moved around by the user, but there is no work in that area that I am aware of. Marcus From lobo.theslayer at gmail.com Thu Dec 6 12:19:37 2012 From: lobo.theslayer at gmail.com (Rodrigo Lovera) Date: Thu, 6 Dec 2012 12:19:37 -0500 Subject: [vtkusers] Problem in instaling QVTKWidgetPlugin In-Reply-To: References: Message-ID: Hi, Once you build vtk in cmake with the gui support on and the qt checked as well, you go wether if you build it as debug or release to the folder where you build your VTK, there you'll find your QVTKWidget.dll u take that and paste it into the Qt plugin folder, that 'd add the qvtkwidget into your qt designer window as a widget to add into your gui. Take in consideration that you have to put: Shared Libs ON Regards, Rodrigo 2012/12/6 qt.itk.vtk.help > Hie, > I am new to VTK.I want to use QVTKPluginWidget in Qt designer. > I am using Visual Studio 2008 with MSVC compiler > CMake- 2.8.10.1 > Qt Version -4.8.3 > VTK - 5.0 > > As per VTK User's Guide we have to configure VTK Lib with Cmake with > setting > few options like, > > VTK_USE_GUISUPPORT=Turn On > configure > Desired Qt version cmake take itself > configure > then > set qt_qmake_executable > ON Build Example > configure > > > after doing this i am getting this warning in Cmake > CMake Warning (dev) at GUISupport/Qt/CMakeLists.txt:113 (ADD_LIBRARY): > Policy CMP0003 should be set before this line. Add code such as > > if(COMMAND cmake_policy) > cmake_policy(SET CMP0003 NEW) > endif(COMMAND cmake_policy) > > as early as possible but after the most recent call to > cmake_minimum_required or cmake_policy(VERSION). This warning appears > because target "QVTKWidgetPlugin" links to some libraries for which the > linker must search: > > vfw32, opengl32 > > and other libraries with known full path: > > C:/Qt/4.8.3/lib/QtGuid4.lib > E:/DebugLibrary/VtkBin/bin/Debug/vtkRendering.lib > > CMake is adding directories in the second list to the linker search path > in > case they are needed to find libraries from the first list (for backwards > compatibility with CMake 2.4). Set policy CMP0003 to OLD or NEW to > enable > or disable this behavior explicitly. Run "cmake --help-policy CMP0003" > for > more information. > This warning is for project developers. Use -Wno-dev to suppress it. > > Generating done > > > Then have to build this library in Visual studio then Copy the > QVTKPluginWidget.dll in Plugin/Designer Folder. > Then we should get QVTKWidget in designer > > > But i am not getting that in designer after doing this process.Kindly help > me. > _______________________________________________ > 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://www.vtk.org/mailman/listinfo/vtkusers > > -- *Rodrigo aka WarHearT* -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.thompson at kitware.com Thu Dec 6 14:39:51 2012 From: david.thompson at kitware.com (David Thompson) Date: Thu, 6 Dec 2012 14:39:51 -0500 Subject: [vtkusers] Questions on vtkLookupTable, SetIndexedLookup in connection with graph display In-Reply-To: <758150D667C235458DE231BB50B9A2B3159A98C135@de01ex07.GLOBAL.JHCN.NET> References: <758150D667C235458DE231BB50B9A2B3159A98C135@de01ex07.GLOBAL.JHCN.NET> Message-ID: Hi Daniel, > nobody knows what?s going on ? Or is my question not clear enough ? > Does anybody have any experience with line lookupTable->SetIndexedLookup() ? For my concrete application, I found work arounds for the most pressing issues, but still I?d really like to understand what?s happening? Sorry for the slow response. There are 3 changes you must make for the program below to work. 1. You must apply the view theme *after* creating representations. This is because the ApplyViewTheme() immediately visits each representation of the view and sets the lookup table; the representation must already be present for its theme to be changed. 2. You should not call Build() on the lookup table after manually setting table entries. vtkLookupTable::Build() overwrites the table entries with a linear ramp of colors. 3. In IndexedLookup mode, only annotated values are assigned colors from the lookup table; all other values are assigned the NaN color. So, in addition to calling lookupTable->SetTableValue(i, r, g, b), you must also for (int i = 0; i < 3; ++i) lookupTable->SetAnnotation(vtkVariant(i),"") Note that the second argument annotation may be any string; if you create a vtkScalarBarActor to draw a legend for vertex colors, these strings will be displayed next to the color swatch in the legend. Attached is a modified version of the code that works for me. David -------------- next part -------------- A non-text attachment was scrubbed... Name: idxlkup.cxx Type: application/octet-stream Size: 3423 bytes Desc: not available URL: -------------- next part -------------- > > Von: Frese Daniel Dr. > Gesendet: Montag, 26. November 2012 14:47 > An: vtkusers at vtk.org > Betreff: Questions on vtkLookupTable, SetIndexedLookup in connection with graph display > > Hello list, > > I try to display a graph with vertices in three different colors, as defined by a LookupTable. Reading the vtk 6.0 specs I thought that the SetIndexedLookup method would be the right thing to use, but somehow I can?t get it working. Most probably I don?t understand something very fundamental regarding this graph stuff ? it would be great if somebody could shine some light on this. > > I put together a small piece of self containing, compilable code, to illustrate my questions. Not, that you might have to replace vtkWin32OpenGLRenderWindow by some class appropriate to your system (I work with Visual Studio 2008 on Windows 7, 64 bit; using a git snapshot a few days old). Here we go with the code : > > #include > > #include "vtkWin32OpenGLRenderWindow.h" > #include "vtkRenderWindow.h" > #include "vtkWin32RenderWindowInteractor.h" > #include "vtkGraphLayoutView.h" > #include "vtkViewTheme.h" > #include "vtkLookupTable.h" > #include "vtkMutableDirectedGraph.h" > #include "vtkTree.h" > #include "vtkIntArray.h" > #include "vtkStringArray.h" > #include "vtkDataRepresentation.h" > #include "vtkRenderedGraphRepresentation.h" > #include "vtkDataSetAttributes.h" > > void main() { > vtkGraphLayoutView* view = vtkGraphLayoutView::New(); > vtkWin32OpenGLRenderWindow* RenderWindow = vtkWin32OpenGLRenderWindow::SafeDownCast(view->GetRenderWindow()); > > // Construction of the lookup table, and debug output of GetColor > vtkLookupTable* lookupTable = vtkLookupTable::New(); > lookupTable->SetNumberOfTableValues(3); > lookupTable->SetTableValue(0, 1.0, 0.0, 0.0); // red > lookupTable->SetTableValue(1, 0.0, 0.0, 1.0); // blue > lookupTable->SetTableValue(2, 1.0, 1.0, 1.0); // white > lookupTable->SetIndexedLookup(1); > lookupTable->SetTableRange(0,2); // this is ignored, if IndexedLookup = true > lookupTable->Build(); > > double rgb[4]; > for (int i=0; i<3; i++) { > lookupTable->GetColor(i,rgb); > cout << "Color " << i << " : " << rgb[0] << " " << rgb[1] << " " << rgb[2] << endl; > } > > // construct view, theme and simple graph to display vertex colors > vtkViewTheme *theme = vtkViewTheme::New(); > theme->SetPointLookupTable(lookupTable); > view->ApplyViewTheme(theme); > vtkMutableDirectedGraph *vtkg = vtkMutableDirectedGraph::New(); > > // array to encode the vertex colors > vtkIntArray *vertexColors = vtkIntArray::New(); > vertexColors->SetNumberOfComponents(1); > vertexColors->SetName("Vertex Color"); > vertexColors->InsertNextValue(0); > vertexColors->InsertNextValue(1); > vertexColors->InsertNextValue(2); > > // array to encode vertex names > vtkStringArray *names = vtkStringArray::New(); > names->SetName("Vertex Name"); > names->InsertNextValue("0"); > names->InsertNextValue("1"); > names->InsertNextValue("2"); > > // construct graph and add color/name arrays > vtkIdType vtkvertex; > cout << "vertex 0 : " << (int) (vtkvertex = vtkg->AddVertex()) << endl; > cout << "vertex 1 : " << (int) vtkg->AddChild(vtkvertex) << endl; > cout << "vertex 2 : " << (int) vtkg->AddChild(vtkvertex) << endl; > > vtkg->GetVertexData()->AddArray(vertexColors); > view->SetVertexColorArrayName("Vertex Color"); > vtkg->GetVertexData()->AddArray(names); > view->SetVertexLabelArrayName("Vertex Name"); > view->SetVertexLabelVisibility(true); > > vtkTree* vtktree = vtkTree::New(); > vtktree->CheckedShallowCopy(vtkg); > vtkDataRepresentation* rep = view->SetRepresentationFromInput(vtktree); > vtkRenderedGraphRepresentation::SafeDownCast(view->GetRepresentation())->ColorVerticesByArrayOn(); > > view->Render(); > view->ResetCamera(); > view->GetInteractor()->Initialize(); > view->GetInteractor()->Start(); > } > > The output in a DOS window is : > Color 0 : 0.501961 0 0 > Color 1 : 0.501961 0 0 > Color 2 : 0.501961 0 0 > vertex 0 : 0 > vertex 1 : 1 > vertex 2 : 2 > > The output in a graphical window shows three connected vertices with the following coloring (see attached png) : > Vertex 0 (middle vertex) : blue > Vertex 1 (right vertex) : green > Vertex 2 (left vertex): red > > This output is different from the one I expect. Here are my questions: > 1) Why does the output of lookupTable->GetColor() return these strange values ? I would expect, that it returns e.g. for Color 0 the values 1 0 0 (=red). By the way, it behaves as I expect, when I comment the line lookupTable->SetIndexedLookup(1) ? > 2) Why does the graphical output shows vertices in the mentioned colors ? I did not define green at all; I would rather expect the following color scheme: > Vertex 0 (middle vertex) : red > Vertex 1 (right vertex) : blue > Vertex 2 (left vertex): white > The ?wrong? coloring in the output window occurs regardless whether I call lookupTable->SetIndexedLookup(1) or not. > It feels somehow, as if the graph wouldn?t care at all about my lookuptable. Am I doing something entirely wrong here ? > 3) In the code example above would it have been necessary to call lookupTable->Build() ? It doesn?t seem to make a difference, when I try to omit it. > > I would appreciate any help on this. > Thanks, > Daniel > > ------------------------------------------------------------------------------------------------------ > Registergericht: Traunstein / Registry Court: HRB 275 - Sitz / Head Office: Traunreut > Aufsichtsratsvorsitzender / Chairman of Supervisory Board: Rainer Burkhard > Gesch?ftsf?hrung / Management Board: Thomas Sesselmann (Vorsitzender / Chairman), > Michael Grimm, Matthias Fauser, Sebastian Tondorf > > E-Mail Haftungsausschluss / E-Mail Disclaimer > > _______________________________________________ > 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://www.vtk.org/mailman/listinfo/vtkusers From martin.buerger at aon.at Thu Dec 6 14:56:37 2012 From: martin.buerger at aon.at (I_like_activiz) Date: Thu, 6 Dec 2012 11:56:37 -0800 (PST) Subject: [vtkusers] Questions on vtkLookupTable, SetIndexedLookup in connection with graph display In-Reply-To: <758150D667C235458DE231BB50B9A2B3159A98C135@de01ex07.GLOBAL.JHCN.NET> References: <758150D667C235458DE231BB50B9A2B3159A98C135@de01ex07.GLOBAL.JHCN.NET> Message-ID: <1354823797480-5717474.post@n5.nabble.com> I think you should use vtkColorTransferFunction instead. There you can add RGB values like: AddRGBPoint(0, 1, 0, 0); // red AddRGBPoint(1, 0, 0, 1); // blue AddRGBPoint(2, 1, 1, 1); // white and then you can query color values by: GetColor(0) \\ 1,0,0 GetColor(1) \\ 0,0,1 GetColor(2) \\ 1,1,1 GetColor(-100) \\ 1,0,0 GetColor(100) \\ 1,1,1 GetColor(1.5) \\ 0.5, 0, 0.5 Values between two defined colors will be interpolated. You could add a special color for each value below or above a certain threshold e.g. AddRGBPoint(-0.001, 0, 1, 0) //green for all values < -0,001 AddRGBPoint(2.001, 0, 1, 0) // green for all values > 2.001 -- View this message in context: http://vtk.1045678.n5.nabble.com/Questions-on-vtkLookupTable-SetIndexedLookup-in-connection-with-graph-display-tp5717456p5717474.html Sent from the VTK - Users mailing list archive at Nabble.com. From david.thompson at kitware.com Thu Dec 6 15:37:57 2012 From: david.thompson at kitware.com (David Thompson) Date: Thu, 6 Dec 2012 15:37:57 -0500 Subject: [vtkusers] Questions on vtkLookupTable, SetIndexedLookup in connection with graph display In-Reply-To: <1354823797480-5717474.post@n5.nabble.com> References: <758150D667C235458DE231BB50B9A2B3159A98C135@de01ex07.GLOBAL.JHCN.NET> <1354823797480-5717474.post@n5.nabble.com> Message-ID: <51903AB6-5B8F-4BE0-9E09-5AE35E174513@kitware.com> Martin wrote: > I think you should use vtkColorTransferFunction instead. > ... Values between two defined colors will be interpolated. That approach should work as well. David From gaurav.gogri83 at gmail.com Thu Dec 6 18:59:27 2012 From: gaurav.gogri83 at gmail.com (Gaurav Gogri) Date: Fri, 7 Dec 2012 05:29:27 +0530 Subject: [vtkusers] rendering a coloured model Message-ID: Hi, I have a triangulated model (vertices with colours and the mesh). I am trying to render the 3d model with the colour. Is there a way to do this in VTK. I don't have the texture file to map it on to the rendering. Do I have to parameterize and create a texture file? thanks in advance, Gaurav -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexmalvtk at gmail.com Thu Dec 6 20:19:52 2012 From: alexmalvtk at gmail.com (Alex Malyushytskyy) Date: Thu, 6 Dec 2012 17:19:52 -0800 Subject: [vtkusers] rendering a coloured model In-Reply-To: References: Message-ID: Depending on your situation different approaches might be required. As for coloring none of them require textures. You need to decide which data set type you are going to use first. In case of irregular mesh you would probably want to use vtkPolydata dataset. in general color can be set per actor, per element or per node Color can be specified directly or obtained using lookup table and scalar array. For example direct color (as RGB) per element: http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/ColoredLines Alex On Thu, Dec 6, 2012 at 3:59 PM, Gaurav Gogri wrote: > Hi, > I have a triangulated model (vertices with colours and the mesh). I am > trying to render the 3d model with the colour. Is there a way to do this in > VTK. I don't have the texture file to map it on to the rendering. Do I have > to parameterize and create a texture file? > thanks in advance, > Gaurav > > _______________________________________________ > 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://www.vtk.org/mailman/listinfo/vtkusers > From alexmalvtk at gmail.com Thu Dec 6 20:34:37 2012 From: alexmalvtk at gmail.com (Alex Malyushytskyy) Date: Thu, 6 Dec 2012 17:34:37 -0800 Subject: [vtkusers] Propagate transformation from vtkActor to vtkPolydata In-Reply-To: <50BF8242.5050403@gmail.com> References: <50BF8242.5050403@gmail.com> Message-ID: I would keep transformation instead and polydata unchanged until you need either re-create an actor or access transformed polydata. Problem is that you change polydata and it is immediately affect pypeline. You may for example store transformation matrix within polydata as a custom data, Alex On Wed, Dec 5, 2012 at 9:20 AM, NsPx wrote: > Hi all, > > After moving a vtkActor, I want to propagate the transformation to its > vtkPolydata. > > My code : > > vtkMatrix4x4* matrix = actor->GetMatrix(); > > vtkSmartPointer transform = > vtkSmartPointer::New(); > transform->SetMatrix( matrix ); > > vtkSmartPointer filter= > vtkSmartPointer::New(); > filter->SetTransform( transform); > filter->SetInput( polyData); > filter->Update(); > > polyData->DeepCopy( filter->GetOutput()); > > How can I prevent the actor from being updated again ? > I tried to apply the reverse matrix to the actor but I failed, I'm a little > bit confused about which function I have to call, ( PokeMatrix() ? > Set/AddPosition() ? ... ). > > Thanks by advance for helping me. > > > _______________________________________________ > 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://www.vtk.org/mailman/listinfo/vtkusers > From huangz2350 at 163.com Fri Dec 7 05:01:36 2012 From: huangz2350 at 163.com (huangz2350) Date: Fri, 7 Dec 2012 18:01:36 +0800 Subject: [vtkusers] The vtkVectorText's Problem References: <201212051153441567086@163.com> <1354695045711-5717429.post@n5.nabble.com> <1354757381519-5717447.post@n5.nabble.com>, <1354780711313-5717452.post@n5.nabble.com> Message-ID: <2012120718013645344535@163.com> Hi All Thanks for yours help, I am inspired by yours idea. I have some preliminary thoughts based on your recommendations. I hope your can give me more good ideas. Thanks Before explanation My demands: I want Insert on a vtkImageActor(e.g:a Jpeg Reader's actor),When I pick,ZoomIn,ZoomOut and pan,they(vtkImageActor and Insert's Texture) can be responsed. My thinking Solve's Way: 1. Use vtkTextWitgets: The Class can chang size and move,But it is a 2D-Object(vtkTextActor 's subClass), it can't be response to ZoomIn,ZoomOut and pan ,So I want create a callback for mouseWheel Event By interactorStyle.Is this way feasible? 2. According to Dave recommendations to use vtkTextActor3D:I used it before,but it seems to be a experimental Class.What questions do use? Can it respond to pick,ZoomIn,ZoomOut and pan? I tried it ,it seem can't be picked(I use vtkCellPicker). I wonder if you have any good suggestions, give me some inspiration. I wish yours good idea. Thanks again. From: Najzero [via VTK] Date: 2012-12-06 15:58 To: huangz2350 Subject: Re: Re:Re: The vtkVectorText's Problem Hello again, sorry to hear, and this is a difficult topic. Whenever someone asks about the vtkVectorText there are rarely answers on the mailing list and I believe not very many programmers are using the vtkVectorText class. This might be due the fact that they simply display the textual information on the rest of the gui and not within the 3d/widget/windows itself. The only way I could imagine you can get this 3d results would be using the vector text but supplying the glyphs yourself. This will require alot of effort, since you would need to use a 3rd Party libary to generate the glyphs/points/vectors on the fly ( e.g. http://www.njph.f2s.com/dxfontutils/ ). This is really brute force and depending on how often you change the look of the font itself very slow. I am too very interested on how vtk volks display the kind of text you require for your program. Because the given class is very limited (it only supports ascii codes from 31 to 126 in default ;-) ) Best regards Adrian If you reply to this email, your message will be added to the discussion below: http://vtk.1045678.n5.nabble.com/The-vtkVectorText-s-Problem-tp5717427p5717452.html To unsubscribe from The vtkVectorText's Problem, click here. NAML -------------- next part -------------- An HTML attachment was scrubbed... URL: From huangz2350 at 163.com Fri Dec 7 05:02:01 2012 From: huangz2350 at 163.com (huangz2350) Date: Fri, 7 Dec 2012 02:02:01 -0800 (PST) Subject: [vtkusers] The vtkVectorText's Problem In-Reply-To: <1354780711313-5717452.post@n5.nabble.com> References: <201212051153441567086@163.com> <1354695045711-5717429.post@n5.nabble.com> <1354757381519-5717447.post@n5.nabble.com> <1354780711313-5717452.post@n5.nabble.com> Message-ID: <2012120718013645344535@163.com> Hi All Thanks for yours help, I am inspired by yours idea. I have some preliminary thoughts based on your recommendations. I hope your can give me more good ideas. Thanks Before explanation My demands: I want Insert on a vtkImageActor(e.g:a Jpeg Reader's actor),When I pick,ZoomIn,ZoomOut and pan,they(vtkImageActor and Insert's Texture) can be responsed. My thinking Solve's Way: 1. Use vtkTextWitgets: The Class can chang size and move,But it is a 2D-Object(vtkTextActor 's subClass), it can't be response to ZoomIn,ZoomOut and pan ,So I want create a callback for mouseWheel Event By interactorStyle.Is this way feasible? 2. According to Dave recommendations to use vtkTextActor3D:I used it before,but it seems to be a experimental Class.What questions do use? Can it respond to pick,ZoomIn,ZoomOut and pan? I tried it ,it seem can't be picked(I use vtkCellPicker). I wonder if you have any good suggestions, give me some inspiration. I wish yours good idea. Thanks again. From: Najzero [via VTK] Date: 2012-12-06 15:58 To: huangz2350 Subject: Re: Re:Re: The vtkVectorText's Problem Hello again, sorry to hear, and this is a difficult topic. Whenever someone asks about the vtkVectorText there are rarely answers on the mailing list and I believe not very many programmers are using the vtkVectorText class. This might be due the fact that they simply display the textual information on the rest of the gui and not within the 3d/widget/windows itself. The only way I could imagine you can get this 3d results would be using the vector text but supplying the glyphs yourself. This will require alot of effort, since you would need to use a 3rd Party libary to generate the glyphs/points/vectors on the fly ( e.g. http://www.njph.f2s.com/dxfontutils/ ). This is really brute force and depending on how often you change the look of the font itself very slow. I am too very interested on how vtk volks display the kind of text you require for your program. Because the given class is very limited (it only supports ascii codes from 31 to 126 in default ;-) ) Best regards Adrian If you reply to this email, your message will be added to the discussion below: http://vtk.1045678.n5.nabble.com/The-vtkVectorText-s-Problem-tp5717427p5717452.html To unsubscribe from The vtkVectorText's Problem, click here. NAML -- View this message in context: http://vtk.1045678.n5.nabble.com/The-vtkVectorText-s-Problem-tp5717427p5717479.html Sent from the VTK - Users mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From frese at heidenhain.de Fri Dec 7 05:23:24 2012 From: frese at heidenhain.de (Frese Daniel Dr.) Date: Fri, 7 Dec 2012 11:23:24 +0100 Subject: [vtkusers] Questions on vtkLookupTable, SetIndexedLookup in connection with graph display In-Reply-To: References: <758150D667C235458DE231BB50B9A2B3159A98C135@de01ex07.GLOBAL.JHCN.NET> Message-ID: <758150D667C235458DE231BB50B9A2B3159AAB5673@de01ex07.GLOBAL.JHCN.NET> Thanks a lot to all who responded. Some things have become much clearer now. As I wrote, I had some workarounds in place, which were similar to Alessandro's suggestion to modify the table dynamically, but this feels somewhat like a hack, especially if there is method available which seems to be designed to achieve exactly what I am looking for. Therefore I'd really like to get David's example working. And it starts to get working - which one or two caveats remaining. The code as it is produces the expexted output now (vertices colored in red, blue and white), but after minor modifications, things look strange again. If I define the colors as (which is unchanged from David's code) lookupTable->SetTableValue(0, 1.0, 0.0, 0.0); // red lookupTable->SetTableValue(1, 0.0, 0.0, 1.0); // blue lookupTable->SetTableValue(2, 1.0, 1.0, 1.0); // white and the vertex coloring as vertexColors->InsertNextValue(0); vertexColors->InsertNextValue(1); vertexColors->InsertNextValue(1); // modification from original code, where we had vertexColors->InsertNextValue(2); I would expect here three vertices; one colored in red and two colored in blue. In fact, the output gives one vertex colored red and two white ones... If I additionally comment the line lookupTable->SetTableRange(0,2); it gives me the expected behavior - although the docs on the web says, that this command should be ignored in case of IndexedLookup = true. That does not feel right, does it ? Another similar thing is, that if I omit the line lookupTable->SetTableRange(0,2); with the same vertexColors array as in David's code (i.e. using colors 0, 1, 2 without the modification above), the third vertex is drawn in NaNColor again. Which again does not feel correct. I'd really appreciate any further hints. Daniel -----Urspr?ngliche Nachricht----- Von: David Thompson [mailto:david.thompson at kitware.com] Gesendet: Donnerstag, 6. Dezember 2012 20:40 An: Frese Daniel Dr. Cc: vtkusers at vtk.org Betreff: Re: [vtkusers] Questions on vtkLookupTable, SetIndexedLookup in connection with graph display Hi Daniel, > nobody knows what's going on ? Or is my question not clear enough ? > Does anybody have any experience with line lookupTable->SetIndexedLookup() ? For my concrete application, I found work arounds for the most pressing issues, but still I'd really like to understand what's happening. Sorry for the slow response. There are 3 changes you must make for the program below to work. 1. You must apply the view theme *after* creating representations. This is because the ApplyViewTheme() immediately visits each representation of the view and sets the lookup table; the representation must already be present for its theme to be changed. 2. You should not call Build() on the lookup table after manually setting table entries. vtkLookupTable::Build() overwrites the table entries with a linear ramp of colors. 3. In IndexedLookup mode, only annotated values are assigned colors from the lookup table; all other values are assigned the NaN color. So, in addition to calling lookupTable->SetTableValue(i, r, g, b), you must also for (int i = 0; i < 3; ++i) lookupTable->SetAnnotation(vtkVariant(i),"") Note that the second argument annotation may be any string; if you create a vtkScalarBarActor to draw a legend for vertex colors, these strings will be displayed next to the color swatch in the legend. Attached is a modified version of the code that works for me. David ------------------------------------------------------------------------------------------------------ Registergericht: Traunstein / Registry Court: HRB 275 - Sitz / Head Office: Traunreut Aufsichtsratsvorsitzender / Chairman of Supervisory Board: Rainer Burkhard Gesch?ftsf?hrung / Management Board: Thomas Sesselmann (Vorsitzender / Chairman), Michael Grimm, Matthias Fauser, Sebastian Tondorf E-Mail Haftungsausschluss / E-Mail Disclaimer From jean-michel.rouet at philips.com Fri Dec 7 09:37:24 2012 From: jean-michel.rouet at philips.com (ROUET, Jean Michel) Date: Fri, 7 Dec 2012 14:37:24 +0000 Subject: [vtkusers] Adding a vtkTextActor during a EndPickEvent callback command hangs the renderer (Visual Studio 2012) In-Reply-To: References: Message-ID: Hi, Anybody with visual studio 2012 around ? I have a text example, derived from Cone5.cxx which crashes/hangs when a vtkTextActor is added to the scene during a pick callback. Can anybody confirm this behavior behavior before I submit it as a bug ? Best regards, Jean-Michel // First include the required header files for the VTK classes we are using. #include "vtkConeSource.h" #include "vtkPolyDataMapper.h" #include "vtkRenderWindow.h" #include "vtkRenderWindowInteractor.h" #include "vtkCamera.h" #include "vtkActor.h" #include "vtkRenderer.h" #include "vtkInteractorStyleTrackballCamera.h" #include "vtkCallbackCommand.h" #include "vtkCellPicker.h" #include "vtkTextActor.h" #include "vtkTextProperty.h" // ----------------------------------------------------------------------- // define a callbackcommand subclass to react to picking events. // here we simply add a vtkTextActor to the scene when the user picks // the cone object, and remove it when the user picks outside of it. // class myPickCallbackCommand : public vtkCommand { private: vtkRenderer* mRenderer; vtkRenderWindowInteractor* mRenderWindowInteractor; vtkTextActor* mTextActor; public: static myPickCallbackCommand *New() { return new myPickCallbackCommand; } myPickCallbackCommand() : mRenderer(0x0), mRenderWindowInteractor(0x0), mTextActor(0x0) {} virtual void Execute(vtkObject *caller, unsigned long eid, void*) { if( eid != vtkCommand::EndPickEvent ) return; if( !mRenderer || !mRenderWindowInteractor ) return; vtkCellPicker *picker = reinterpret_cast(caller); vtkProp* picked = picker->GetViewProp(); if ( picked != NULL ) { cout << "Picked: " << endl; if(mTextActor == NULL) { std::cout << "adding a text actor" << std::endl; mTextActor = vtkTextActor::New(); mTextActor->SetInput("this is a test"); mTextActor->SetDisplayPosition(0.2,0.2); mRenderer->AddActor2D( mTextActor ); mTextActor->Delete(); } } else { cout << "nothing picked\n"; if(mTextActor != NULL) { mRenderer->RemoveActor2D(mTextActor); mTextActor = NULL; } } mRenderWindowInteractor->Render(); } void SetRenderer(vtkRenderer* ren) { this->mRenderer = ren; } void SetRenderWindowInteractor(vtkRenderWindowInteractor* iren) { this->mRenderWindowInteractor = iren; } }; int main() { vtkConeSource *cone = vtkConeSource::New(); cone->SetHeight( 3.0 ); cone->SetRadius( 1.0 ); cone->SetResolution( 10 ); vtkPolyDataMapper *coneMapper = vtkPolyDataMapper::New(); coneMapper->SetInputConnection( cone->GetOutputPort() ); vtkActor *coneActor = vtkActor::New(); coneActor->SetMapper( coneMapper ); vtkRenderer *ren1= vtkRenderer::New(); ren1->AddActor( coneActor ); ren1->SetBackground( 0.1, 0.2, 0.4 ); vtkRenderWindow *renWin = vtkRenderWindow::New(); renWin->AddRenderer( ren1 ); renWin->SetSize( 300, 300 ); vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New(); iren->SetRenderWindow(renWin); vtkInteractorStyleTrackballCamera *style = vtkInteractorStyleTrackballCamera::New(); iren->SetInteractorStyle(style); // add a cell picker with pickCallbackFunction; vtkCellPicker* cellpicker = vtkCellPicker::New(); cellpicker->SetTolerance(0.1); cellpicker->PickFromListOff(); iren->SetPicker(cellpicker); myPickCallbackCommand* pickercbc = myPickCallbackCommand::New(); pickercbc->SetRenderer(ren1); pickercbc->SetRenderWindowInteractor(iren); cellpicker->AddObserver(vtkCommand::EndPickEvent,pickercbc); pickercbc->Delete(); iren->Initialize(); iren->Start(); cellpicker->Delete(); cone->Delete(); coneMapper->Delete(); coneActor->Delete(); ren1->Delete(); renWin->Delete(); iren->Delete(); style->Delete(); return 0; } ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From massimo.bortolato at gmail.com Fri Dec 7 11:35:55 2012 From: massimo.bortolato at gmail.com (Massimo Bortolato) Date: Fri, 7 Dec 2012 17:35:55 +0100 Subject: [vtkusers] How to catch events from vtkContourWidget? Message-ID: <00E8DBFBB86647EC81657EA91D63EFAE@MassimoPC> Hi all, I need to dynamically compute (and display) the perimeter of a vtkContourWidget, basically the same way as vtkDistanceWidget works. So I?d like to sniff the events generated by the widget, but it seems that there aren?t specific events associated with vtkContourWidget, or vtkContourRepresentation. Does anyones of you know how I can do? Thanks in advance Massimo -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexmalvtk at gmail.com Fri Dec 7 17:28:20 2012 From: alexmalvtk at gmail.com (Alex Malyushytskyy) Date: Fri, 7 Dec 2012 14:28:20 -0800 Subject: [vtkusers] How to catch events from vtkContourWidget? In-Reply-To: <00E8DBFBB86647EC81657EA91D63EFAE@MassimoPC> References: <00E8DBFBB86647EC81657EA91D63EFAE@MassimoPC> Message-ID: all events vtkContourWidget handles can be found in the source code constructor You can see related vtkCommand and vtkWidgetEvent below. // These are the event callbacks supported by this widget this->CallbackMapper->SetCallbackMethod(vtkCommand::LeftButtonPressEvent, vtkWidgetEvent::Select, this, vtkContourWidget::SelectAction); this->CallbackMapper->SetCallbackMethod(vtkCommand::RightButtonPressEvent, vtkWidgetEvent::AddFinalPoint, this, vtkContourWidget::AddFinalPointAction); this->CallbackMapper->SetCallbackMethod(vtkCommand::MouseMoveEvent, vtkWidgetEvent::Move, this, vtkContourWidget::MoveAction); this->CallbackMapper->SetCallbackMethod(vtkCommand::LeftButtonReleaseEvent, vtkWidgetEvent::EndSelect, this, vtkContourWidget::EndSelectAction); this->CallbackMapper->SetCallbackMethod(vtkCommand::KeyPressEvent, vtkEvent::NoModifier, 127, 1, "Delete", vtkWidgetEvent::Delete, this, vtkContourWidget::DeleteAction); this->CallbackMapper->SetCallbackMethod(vtkCommand::KeyPressEvent, vtkEvent::ShiftModifier, 127, 1, "Delete", vtkWidgetEvent::Reset, this, vtkContourWidget::ResetAction); this->CallbackMapper->SetCallbackMethod(vtkCommand::MiddleButtonPressEvent, vtkWidgetEvent::Translate, this, vtkContourWidget::TranslateContourAction); this->CallbackMapper->SetCallbackMethod(vtkCommand::MiddleButtonReleaseEvent, vtkWidgetEvent::EndTranslate, this, vtkContourWidget::EndSelectAction); this->CallbackMapper->SetCallbackMethod(vtkCommand::RightButtonPressEvent, vtkWidgetEvent::Scale, this, vtkContourWidget::ScaleContourAction); this->CallbackMapper->SetCallbackMethod(vtkCommand::RightButtonReleaseEvent, vtkWidgetEvent::EndScale, this, vtkContourWidget::EndSelectAction); I have not done this, so it might be better ways, but I would probably just subclass and add my own even handler doing extra things you need to be done and call original vtkContourWidget static class methods if necessary. In constructor: this->CallbackMapper->SetCallbackMethod(vtkCommand::LeftButtonPressEvent, vtkWidgetEvent::Select, this, myVtkContourWidget::MySelectAction); void myVtkContourWidgetSelectAction( vtkAbstractWidget *w ) { .... doo smth vtkContourWidget::SelectAction( w ); .... doo smth } On Fri, Dec 7, 2012 at 8:35 AM, Massimo Bortolato wrote: > Hi all, > > I need to dynamically compute (and display) the perimeter of a > vtkContourWidget, basically the same way as vtkDistanceWidget works. > So I?d like to sniff the events generated by the widget, but it seems that > there aren?t specific events associated with vtkContourWidget, or > vtkContourRepresentation. > > Does anyones of you know how I can do? > > Thanks in advance > Massimo > > > _______________________________________________ > 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://www.vtk.org/mailman/listinfo/vtkusers > From hanene-jeder at hotmail.fr Sat Dec 8 04:51:28 2012 From: hanene-jeder at hotmail.fr (Tasnim) Date: Sat, 8 Dec 2012 01:51:28 -0800 (PST) Subject: [vtkusers] boundary points Message-ID: <1354960288627-5717488.post@n5.nabble.com> Hi all, I'm trying to find the Mesh's boundary points. I tried with the BoundaryEdges example : http://www.vtk.org/Wiki/VTK/Examples/Cxx/Meshes/BoundaryEdges . But this example gives me the boundaryCells, so i got points which are on ne boundary and other points which aren't in the mesh's boundary. Is there any suggestion about how to retrieve just points that are in the boundary, and not cells!!! thanks -- View this message in context: http://vtk.1045678.n5.nabble.com/boundary-points-tp5717488.html Sent from the VTK - Users mailing list archive at Nabble.com. From daviddoria at gmail.com Sat Dec 8 08:26:20 2012 From: daviddoria at gmail.com (David Doria) Date: Sat, 8 Dec 2012 08:26:20 -0500 Subject: [vtkusers] boundary points In-Reply-To: <1354960288627-5717488.post@n5.nabble.com> References: <1354960288627-5717488.post@n5.nabble.com> Message-ID: On Sat, Dec 8, 2012 at 4:51 AM, Tasnim wrote: > Hi all, > I'm trying to find the Mesh's boundary points. I tried with the > BoundaryEdges example : > http://www.vtk.org/Wiki/VTK/Examples/Cxx/Meshes/BoundaryEdges > . But > this > example gives me the boundaryCells, so i got points which are on ne > boundary > and other points which aren't in the mesh's boundary. Is there any > suggestion about how to retrieve just points that are in the boundary, and > not cells!!! > thanks > That just gives you edges, which should contain only points on the boundary, no? Can you give a small, self-contained example of it returning points that are not on the boundary? David -------------- next part -------------- An HTML attachment was scrubbed... URL: From mikejf at gmail.com Sat Dec 8 10:32:45 2012 From: mikejf at gmail.com (Michael Frankham) Date: Sun, 9 Dec 2012 02:32:45 +1100 Subject: [vtkusers] Mike Says Stuff Into Darkness In-Reply-To: References: Message-ID: You know what'd be cool? If GoG teamed up with Desura so you could have the option of adding your GoG account to it and it'd list your GoG games in the games list. Yeah I just bought myst 5 on gog and just know I'll probably forget I own it at some point. On Fri, Dec 7, 2012 at 9:53 PM, Matt Giuca wrote: > Yes, good idea :) > > I have been frustrated in the past few months also with the lack of Apache > Commons in Java. > > > On Fri, Dec 7, 2012 at 3:03 PM, Michael Frankham wrote: > >> Oh here's an idea I suppose use a better language. >> >> >> On Fri, Dec 7, 2012 at 2:54 PM, Michael Frankham wrote: >> >>> I'm sure apache would be happy to give them >>> >>> >>> On Fri, Dec 7, 2012 at 2:53 PM, Michael Frankham wrote: >>> >>>> I may have whined that before >>>> >>>> >>>> On Fri, Dec 7, 2012 at 2:53 PM, Michael Frankham wrote: >>>> >>>>> why won't they just integrate the apache commons into the standard >>>>> libraries already I mean come on >>>>> >>>>> >>>>> On Sun, Dec 2, 2012 at 5:03 PM, Michael Frankham wrote: >>>>> >>>>>> Not to mention more $$ for the smaller indie titles that go with the >>>>>> big pseudo-indies. >>>>>> >>>>>> >>>>>> On Sun, Dec 2, 2012 at 4:55 PM, Michael Frankham wrote: >>>>>> >>>>>>> I'm fine with Humble Bundles having indie-developed but >>>>>>> major-published games like Psychonauts and Bastion in the Indie bundles as >>>>>>> long as they don't become the majority of the bundle. I suspect in effect >>>>>>> what it does is push it to a much wider audience and let the actual indie >>>>>>> stuff get seen by many more people now that they happen to incidentally own >>>>>>> it. >>>>>>> >>>>>>> >>>>>>> On Sun, Dec 2, 2012 at 4:53 PM, Michael Frankham wrote: >>>>>>> >>>>>>>> Oh, they were the publishers of Stacking and Costume Quest. Double >>>>>>>> Fine was a bit of a risk at that point after the (retail) flops of >>>>>>>> Psychonauts and Brutal Legend. >>>>>>>> >>>>>>>> I'm just ascribing human values to a soulless corporation there, >>>>>>>> though. >>>>>>>> >>>>>>>> >>>>>>>> On Sun, Dec 2, 2012 at 4:47 PM, Matt Giuca wrote: >>>>>>>> >>>>>>>>> What did they do with Double Fine? >>>>>>>>> >>>>>>>>> Oh yeah, you could make similar claims about the Double Fine >>>>>>>>> Amnesia bundle. I'm not trying to make any such claims. Humble Bundle is a >>>>>>>>> commercial business and they can do whatever side bundles they like (as >>>>>>>>> long as the real "Indie Bundles" are actually indie, which is dubious >>>>>>>>> anyway given that they've had Psychonauts, which is not really indie, and >>>>>>>>> Bastion and Shank, both of which were published by major publishers). I >>>>>>>>> supported the Amnesia because I think Double Fine is cool. Not supporting >>>>>>>>> THQ just because I'm not particularly interested in their games. >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> On Sun, Dec 2, 2012 at 4:37 PM, Michael Frankham >>>>>>>> > wrote: >>>>>>>>> >>>>>>>>>> Plus they've been good to Double Fine. :P >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On Sun, Dec 2, 2012 at 4:31 PM, Michael Frankham < >>>>>>>>>> mikejf at gmail.com> wrote: >>>>>>>>>> >>>>>>>>>>> Really? I didn't realise either. Although I think ultrabook's >>>>>>>>>>> hit about the same level of generic use as netbook has, despite the >>>>>>>>>>> technical trademark. >>>>>>>>>>> >>>>>>>>>>> Oh, there's been a lot of people going "Grr they are not indie >>>>>>>>>>> THQ are just trying to take advantage of the bundles!" If you don't want >>>>>>>>>>> the games then fair enough, I suppose, although honestly I was happy to >>>>>>>>>>> support THQ, for reasons mentioned beforehand. They tend to pair up >>>>>>>>>>> profit-generating shovelware on one side with taking a few risks and trying >>>>>>>>>>> to innovate on the other side, and unfortunately they just had a few risks >>>>>>>>>>> smack them in the arse and just about kill them. >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> On Sun, Dec 2, 2012 at 4:24 PM, Matt Giuca < >>>>>>>>>>> eatmyshortz at gmail.com> wrote: >>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> Yeah, true, but that's not something you can blame on this >>>>>>>>>>>>> being targeted at developers, rather than just on the general laptop space >>>>>>>>>>>>> at the moment. People like ultrabooks, and they chose to parallel one of >>>>>>>>>>>>> their most popular windows models in specs. >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> I just checked: I didn't realise that "ultrabook" was a >>>>>>>>>>>> trademark of Intel and it refers specifically to Intel machines that meet >>>>>>>>>>>> certain specs. That makes it much less useful as a generic description of a >>>>>>>>>>>> type of machine (like "netbook" used to be back when those were popular). >>>>>>>>>>>> >>>>>>>>>>>> Yeah, this bundle is a humble bundle but not a humble indie >>>>>>>>>>>>> bundle. Won't get that value off GoG for a dollar, though. :P Anyways, I >>>>>>>>>>>>> don't mind; THQ is generally a good company that's had some crappy luck and >>>>>>>>>>>>> is on the edge right now, and a professional company being willing to do >>>>>>>>>>>>> something like this is worth some respect. Plus, SR3 is worth $5 by itself. >>>>>>>>>>>>> There's been a lot of backlash against >>>>>>>>>>>>> >>>>>>>>>>>> THQ for your reasons with this and it's mostly unjustified in >>>>>>>>>>>>> my opinion. >>>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> For what reasons? I'm not trying to backlash against anybody. >>>>>>>>>>>> I'm just not really interested in those games, and I don't feel like going >>>>>>>>>>>> and committing to this bundle like I usually do because I want to support >>>>>>>>>>>> indies. (Also I don't like paying $1 for these, I will usually give about >>>>>>>>>>>> $10 and I don't think I'll ever get around to playing them so it's not >>>>>>>>>>>> worth it.) >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan.irvin at gmail.com Sun Dec 9 14:05:20 2012 From: ryan.irvin at gmail.com (Ryan Irvin) Date: Sun, 9 Dec 2012 12:05:20 -0700 Subject: [vtkusers] Python vtkSphere Subclass Message-ID: I'm trying to create a custom implicit surface function to represent a conic asphere and my approach was to try and subclass vtkSphere. I had previously tried to subclass vtkImplicitFunction without success and saw some posts about not being able to subclass abstract classes in Python (I don't know if this is still true). The subclass I've put together is shown below, where the attribute surf_obj is a python class representing the conic asphere and contains methods for evaluating the surface function and gradient. When I run my full script, the result is that the default vtkSphere is always rendered. It's pretty apparent that I'm not understanding the proper approach to this problem and/or am not properly subclassing vtkSphere. I will be happy to provide the full *.py file which contains all of the code but wasn't sure of the protocol and have not provided it with this post. If anyone has any suggestions about the correct way to approach this problem or can provide some advice for properly subclassing, I would very much appreciate it. -Ryan class VtkImplicitConic( vtk.vtkSphere ): def __init__( self, con_surf ): self.surf_obj = con_surf self.SetRadius( self.surf_obj.GetRadius() ) def EvaluateFunction( self, x, y, z ): return self.surf_obj.EvaluateFunction( x, y, z ) def EvaluateGradient( self, x, n ): n[0],n[1],n[2] = self.surf_obj.EvaluateGradient( x[0], x[1], x[2] ) def GetRadius( self ): return self.surf_obj.GetRadius() def SetRadius( self, radius ): self.surf_obj.SetRadius( radius ) -------------- next part -------------- An HTML attachment was scrubbed... URL: From jd379252 at gmail.com Sun Dec 9 14:16:43 2012 From: jd379252 at gmail.com (pof) Date: Sun, 09 Dec 2012 20:16:43 +0100 Subject: [vtkusers] Bug in vtkStripper on a very simple case ? Message-ID: <50C4E39B.9030400@gmail.com> Hi all, I get a strange result (which may be a bug) using vtk stripper, i.e. it does not merge LINES as polylines as it is expected to. In this example (see below an extract of the polydata produced by vtkStripper), only 2 polylines should be obtained, but vtkStripper forgot to merge the first and the third line together, though they obviously share point with Id=0 (btw, the fact that only Id 0 remains unmerged might not be pure luck). LINES 3 24 9 0 1 2 3 4 5 19 6 7 10 9 8 17 13 12 15 14 11 10 16 2 18 0 Does anybody have an idea or an explanation? Thanks JD PS: Here below is the complete source file that generates these data and in which vtkStripper is used. ////////////////////////////////////////////////////// // Example modified from IntersectionPolyDataFilter.cxx ////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include #include #include int main(int argc, char *argv[]) { vtkSmartPointer sphereSource1 = vtkSmartPointer::New(); sphereSource1->SetCenter(0.0, 0.0, 0.0); sphereSource1->SetRadius(2.0f); sphereSource1->SetPhiResolution(20); sphereSource1->SetThetaResolution(20); sphereSource1->Update(); vtkSmartPointer sphere1Mapper = vtkSmartPointer::New(); sphere1Mapper->SetInputConnection( sphereSource1->GetOutputPort() ); sphere1Mapper->ScalarVisibilityOff(); vtkSmartPointer sphere1Actor = vtkSmartPointer::New(); sphere1Actor->SetMapper( sphere1Mapper ); sphere1Actor->GetProperty()->SetOpacity(.3); sphere1Actor->GetProperty()->SetColor(1,0,0); ///////////////////////// // BEGIN MODIFICATIONS // ///////////////////////// // Create a planar object // Define 4 vertices vtkSmartPointer PlanePoints = vtkSmartPointer::New(); vtkSmartPointer PlaneCells = vtkSmartPointer::New(); PlanePoints->InsertNextPoint(-3, -1, 0); PlanePoints->InsertNextPoint(3, -1, 0); PlanePoints->InsertNextPoint(-3, 1, 0); PlanePoints->InsertNextPoint(3, 1, 0); // Create 2 trianglar faces PlaneCells->InsertNextCell(3); PlaneCells->InsertCellPoint(0); PlaneCells->InsertCellPoint(1); PlaneCells->InsertCellPoint(2); PlaneCells->InsertNextCell(3); PlaneCells->InsertCellPoint(1); PlaneCells->InsertCellPoint(3); PlaneCells->InsertCellPoint(2); // Create the polydata from points and faces vtkSmartPointer ProtectionWall = vtkSmartPointer::New(); ProtectionWall->SetPoints(PlanePoints); ProtectionWall->SetPolys(PlaneCells); ///////////////////////// // END MODIFICATIONS // ///////////////////////// vtkSmartPointer planeMapper = vtkSmartPointer::New(); planeMapper->SetInputConnection( ProtectionWall->GetProducerPort() ); planeMapper->ScalarVisibilityOff(); vtkSmartPointer planeActor = vtkSmartPointer::New(); planeActor->SetMapper( planeMapper ); planeActor->GetProperty()->SetOpacity(.3); planeActor->GetProperty()->SetColor(0,1,0); // Get intersection segments (LINES) using the vtkIntersectionPolyDataFilter vtkSmartPointer intersectionPolyDataFilter = vtkSmartPointer::New(); intersectionPolyDataFilter->SplitFirstOutputOff(); intersectionPolyDataFilter->SplitSecondOutputOff(); intersectionPolyDataFilter->SetInputConnection( 0, sphereSource1->GetOutputPort() ); intersectionPolyDataFilter->SetInputConnection( 1, ProtectionWall->GetProducerPort() ); intersectionPolyDataFilter->Update(); ///////////////////////// // BEGIN MODIFICATIONS // ///////////////////////// // Try to get the polylines (there should be 2) from the segments (LINES) vtkSmartPointer stripper = vtkSmartPointer::New(); stripper->SetInputConnection(intersectionPolyDataFilter->GetOutputPort()); stripper->Update(); // Save resulting polydata on a file, in which we see that there are 3 polylines (actually the second polyline is ok, // but the first and third polylines should have been further merged vtkSmartPointer wr = vtkSmartPointer::New(); wr->SetFileName("polylines.txt"); wr->SetInputConnection(stripper->GetOutputPort()); wr->Write(); /////////////////////// // END MODIFICATIONS // /////////////////////// vtkSmartPointer intersectionMapper = vtkSmartPointer::New(); intersectionMapper->SetInputConnection( stripper->GetOutputPort() ); intersectionMapper->ScalarVisibilityOff(); vtkSmartPointer intersectionActor = vtkSmartPointer::New(); intersectionActor->SetMapper( intersectionMapper ); vtkSmartPointer renderer = vtkSmartPointer::New(); renderer->AddViewProp(sphere1Actor); renderer->AddViewProp(planeActor); renderer->AddViewProp(intersectionActor); vtkSmartPointer renderWindow = vtkSmartPointer::New(); renderWindow->AddRenderer( renderer ); vtkSmartPointer renWinInteractor = vtkSmartPointer::New(); renWinInteractor->SetRenderWindow( renderWindow ); renderWindow->Render(); renderWindow->SetSize(600, 600); renderer->SetBackground(0.1, 0.2, 0.4); renWinInteractor->Start(); return EXIT_SUCCESS; } From mehdiesteghamat at gmail.com Sun Dec 9 14:38:03 2012 From: mehdiesteghamat at gmail.com (Mehdi Esteghamatian) Date: Sun, 9 Dec 2012 14:38:03 -0500 Subject: [vtkusers] Static Link VTK Message-ID: Hello Everyone, I just have a question that I have been trying to find the answer on the net already, but could not find. I am trying to build an standalone application, a single exe file using VTK in such a way that I do not need to put the dlls in the same folder. Please let me know how I can compile against static libraries. I just do not know where I can get the vtk static libs in the vtk-build folder. Thanks in advance, Mehdi -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Sun Dec 9 14:58:41 2012 From: daviddoria at gmail.com (David Doria) Date: Sun, 9 Dec 2012 14:58:41 -0500 Subject: [vtkusers] Static Link VTK In-Reply-To: References: Message-ID: On Sun, Dec 9, 2012 at 2:38 PM, Mehdi Esteghamatian < mehdiesteghamat at gmail.com> wrote: > Hello Everyone, > > I just have a question that I have been trying to find the answer on the > net already, but could not find. > > I am trying to build an standalone application, a single exe file using > VTK in such a way that I do not need to put the dlls in the same folder. > > Please let me know how I can compile against static libraries. > > I just do not know where I can get the vtk static libs in the vtk-build > folder. > > Thanks in advance, > > Mehdi > You need to build VTK with BUILD_SHARED_LIBS=OFF David -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Sun Dec 9 15:05:30 2012 From: david.gobbi at gmail.com (David Gobbi) Date: Sun, 9 Dec 2012 13:05:30 -0700 Subject: [vtkusers] Bug in vtkStripper on a very simple case ? In-Reply-To: <50C4E39B.9030400@gmail.com> References: <50C4E39B.9030400@gmail.com> Message-ID: Hi JD, It could only merge those two lines if it joined them with a "T". A polyline cannot have any branches. - David On Sun, Dec 9, 2012 at 12:16 PM, pof wrote: > Hi all, > > I get a strange result (which may be a bug) using vtk stripper, i.e. it does > not merge LINES as polylines as it is expected to. > In this example (see below an extract of the polydata produced by > vtkStripper), only 2 polylines should be obtained, but vtkStripper forgot to > merge the first and the third line together, though they obviously share > point with Id=0 (btw, the fact that only Id 0 remains unmerged might not be > pure luck). > > LINES 3 24 > 9 0 1 2 3 4 5 19 6 7 > 10 9 8 17 13 12 15 14 11 10 16 > 2 18 0 > Does anybody have an idea or an explanation? > Thanks > JD > > PS: Here below is the complete source file that generates these data and in > which vtkStripper is used. > > ////////////////////////////////////////////////////// > // Example modified from IntersectionPolyDataFilter.cxx > ////////////////////////////////////////////////////// > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > > int main(int argc, char *argv[]) > { > vtkSmartPointer sphereSource1 = > vtkSmartPointer::New(); > sphereSource1->SetCenter(0.0, 0.0, 0.0); > sphereSource1->SetRadius(2.0f); > sphereSource1->SetPhiResolution(20); > sphereSource1->SetThetaResolution(20); > sphereSource1->Update(); > vtkSmartPointer sphere1Mapper = > vtkSmartPointer::New(); > sphere1Mapper->SetInputConnection( sphereSource1->GetOutputPort() ); > sphere1Mapper->ScalarVisibilityOff(); > vtkSmartPointer sphere1Actor = vtkSmartPointer::New(); > sphere1Actor->SetMapper( sphere1Mapper ); > sphere1Actor->GetProperty()->SetOpacity(.3); > sphere1Actor->GetProperty()->SetColor(1,0,0); > > ///////////////////////// > // BEGIN MODIFICATIONS // > ///////////////////////// > // Create a planar object > // Define 4 vertices > vtkSmartPointer PlanePoints = > vtkSmartPointer::New(); > vtkSmartPointer PlaneCells = > vtkSmartPointer::New(); > PlanePoints->InsertNextPoint(-3, -1, 0); > PlanePoints->InsertNextPoint(3, -1, 0); > PlanePoints->InsertNextPoint(-3, 1, 0); > PlanePoints->InsertNextPoint(3, 1, 0); > // Create 2 trianglar faces > PlaneCells->InsertNextCell(3); > PlaneCells->InsertCellPoint(0); > PlaneCells->InsertCellPoint(1); > PlaneCells->InsertCellPoint(2); > PlaneCells->InsertNextCell(3); > PlaneCells->InsertCellPoint(1); > PlaneCells->InsertCellPoint(3); > PlaneCells->InsertCellPoint(2); > // Create the polydata from points and faces > vtkSmartPointer ProtectionWall = > vtkSmartPointer::New(); > ProtectionWall->SetPoints(PlanePoints); > ProtectionWall->SetPolys(PlaneCells); > ///////////////////////// > // END MODIFICATIONS // > ///////////////////////// > > vtkSmartPointer planeMapper = > vtkSmartPointer::New(); > planeMapper->SetInputConnection( ProtectionWall->GetProducerPort() ); > planeMapper->ScalarVisibilityOff(); > > vtkSmartPointer planeActor = vtkSmartPointer::New(); > planeActor->SetMapper( planeMapper ); > planeActor->GetProperty()->SetOpacity(.3); > planeActor->GetProperty()->SetColor(0,1,0); > > // Get intersection segments (LINES) using the > vtkIntersectionPolyDataFilter > vtkSmartPointer intersectionPolyDataFilter > = vtkSmartPointer::New(); > intersectionPolyDataFilter->SplitFirstOutputOff(); > intersectionPolyDataFilter->SplitSecondOutputOff(); > intersectionPolyDataFilter->SetInputConnection( 0, > sphereSource1->GetOutputPort() ); > intersectionPolyDataFilter->SetInputConnection( 1, > ProtectionWall->GetProducerPort() ); > intersectionPolyDataFilter->Update(); > > ///////////////////////// > // BEGIN MODIFICATIONS // > ///////////////////////// > // Try to get the polylines (there should be 2) from the segments (LINES) > vtkSmartPointer stripper = > vtkSmartPointer::New(); > stripper->SetInputConnection(intersectionPolyDataFilter->GetOutputPort()); > stripper->Update(); > // Save resulting polydata on a file, in which we see that there are 3 > polylines (actually the second polyline is ok, > // but the first and third polylines should have been further merged > vtkSmartPointer wr = > vtkSmartPointer::New(); > wr->SetFileName("polylines.txt"); > wr->SetInputConnection(stripper->GetOutputPort()); > wr->Write(); > /////////////////////// > // END MODIFICATIONS // > /////////////////////// > > vtkSmartPointer intersectionMapper = > vtkSmartPointer::New(); > intersectionMapper->SetInputConnection( stripper->GetOutputPort() ); > intersectionMapper->ScalarVisibilityOff(); > > vtkSmartPointer intersectionActor = > vtkSmartPointer::New(); > intersectionActor->SetMapper( intersectionMapper ); > > vtkSmartPointer renderer = > vtkSmartPointer::New(); > renderer->AddViewProp(sphere1Actor); > renderer->AddViewProp(planeActor); > renderer->AddViewProp(intersectionActor); > > vtkSmartPointer renderWindow = > vtkSmartPointer::New(); > renderWindow->AddRenderer( renderer ); > > vtkSmartPointer renWinInteractor = > vtkSmartPointer::New(); > renWinInteractor->SetRenderWindow( renderWindow ); > > renderWindow->Render(); > renderWindow->SetSize(600, 600); > renderer->SetBackground(0.1, 0.2, 0.4); > renWinInteractor->Start(); > > return EXIT_SUCCESS; > } From jd379252 at gmail.com Sun Dec 9 15:12:53 2012 From: jd379252 at gmail.com (pof) Date: Sun, 09 Dec 2012 21:12:53 +0100 Subject: [vtkusers] Bug in vtkStripper on a very simple case ? In-Reply-To: References: <50C4E39B.9030400@gmail.com> Message-ID: <50C4F0C5.8000800@gmail.com> Hi David the first polyline being: 9 0 1 2 3 4 5 19 6 7 and the third polyline (actually it is a segment) being: 2 18 0 I don't see why they shoud not merge together as (unless I misunderstand something): 10 18 0 1 2 3 4 5 19 6 7 Am I wrong? Le 09/12/2012 21:05, David Gobbi a ?crit : > Hi JD, > > It could only merge those two lines if it joined them with a "T". > A polyline cannot have any branches. > > - David > > > On Sun, Dec 9, 2012 at 12:16 PM, pof wrote: >> Hi all, >> >> I get a strange result (which may be a bug) using vtk stripper, i.e. it does >> not merge LINES as polylines as it is expected to. >> In this example (see below an extract of the polydata produced by >> vtkStripper), only 2 polylines should be obtained, but vtkStripper forgot to >> merge the first and the third line together, though they obviously share >> point with Id=0 (btw, the fact that only Id 0 remains unmerged might not be >> pure luck). >> >> LINES 3 24 >> 9 0 1 2 3 4 5 19 6 7 >> 10 9 8 17 13 12 15 14 11 10 16 >> 2 18 0 >> Does anybody have an idea or an explanation? >> Thanks >> JD >> >> PS: Here below is the complete source file that generates these data and in >> which vtkStripper is used. >> >> ////////////////////////////////////////////////////// >> // Example modified from IntersectionPolyDataFilter.cxx >> ////////////////////////////////////////////////////// >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> >> int main(int argc, char *argv[]) >> { >> vtkSmartPointer sphereSource1 = >> vtkSmartPointer::New(); >> sphereSource1->SetCenter(0.0, 0.0, 0.0); >> sphereSource1->SetRadius(2.0f); >> sphereSource1->SetPhiResolution(20); >> sphereSource1->SetThetaResolution(20); >> sphereSource1->Update(); >> vtkSmartPointer sphere1Mapper = >> vtkSmartPointer::New(); >> sphere1Mapper->SetInputConnection( sphereSource1->GetOutputPort() ); >> sphere1Mapper->ScalarVisibilityOff(); >> vtkSmartPointer sphere1Actor = vtkSmartPointer::New(); >> sphere1Actor->SetMapper( sphere1Mapper ); >> sphere1Actor->GetProperty()->SetOpacity(.3); >> sphere1Actor->GetProperty()->SetColor(1,0,0); >> >> ///////////////////////// >> // BEGIN MODIFICATIONS // >> ///////////////////////// >> // Create a planar object >> // Define 4 vertices >> vtkSmartPointer PlanePoints = >> vtkSmartPointer::New(); >> vtkSmartPointer PlaneCells = >> vtkSmartPointer::New(); >> PlanePoints->InsertNextPoint(-3, -1, 0); >> PlanePoints->InsertNextPoint(3, -1, 0); >> PlanePoints->InsertNextPoint(-3, 1, 0); >> PlanePoints->InsertNextPoint(3, 1, 0); >> // Create 2 trianglar faces >> PlaneCells->InsertNextCell(3); >> PlaneCells->InsertCellPoint(0); >> PlaneCells->InsertCellPoint(1); >> PlaneCells->InsertCellPoint(2); >> PlaneCells->InsertNextCell(3); >> PlaneCells->InsertCellPoint(1); >> PlaneCells->InsertCellPoint(3); >> PlaneCells->InsertCellPoint(2); >> // Create the polydata from points and faces >> vtkSmartPointer ProtectionWall = >> vtkSmartPointer::New(); >> ProtectionWall->SetPoints(PlanePoints); >> ProtectionWall->SetPolys(PlaneCells); >> ///////////////////////// >> // END MODIFICATIONS // >> ///////////////////////// >> >> vtkSmartPointer planeMapper = >> vtkSmartPointer::New(); >> planeMapper->SetInputConnection( ProtectionWall->GetProducerPort() ); >> planeMapper->ScalarVisibilityOff(); >> >> vtkSmartPointer planeActor = vtkSmartPointer::New(); >> planeActor->SetMapper( planeMapper ); >> planeActor->GetProperty()->SetOpacity(.3); >> planeActor->GetProperty()->SetColor(0,1,0); >> >> // Get intersection segments (LINES) using the >> vtkIntersectionPolyDataFilter >> vtkSmartPointer intersectionPolyDataFilter >> = vtkSmartPointer::New(); >> intersectionPolyDataFilter->SplitFirstOutputOff(); >> intersectionPolyDataFilter->SplitSecondOutputOff(); >> intersectionPolyDataFilter->SetInputConnection( 0, >> sphereSource1->GetOutputPort() ); >> intersectionPolyDataFilter->SetInputConnection( 1, >> ProtectionWall->GetProducerPort() ); >> intersectionPolyDataFilter->Update(); >> >> ///////////////////////// >> // BEGIN MODIFICATIONS // >> ///////////////////////// >> // Try to get the polylines (there should be 2) from the segments (LINES) >> vtkSmartPointer stripper = >> vtkSmartPointer::New(); >> stripper->SetInputConnection(intersectionPolyDataFilter->GetOutputPort()); >> stripper->Update(); >> // Save resulting polydata on a file, in which we see that there are 3 >> polylines (actually the second polyline is ok, >> // but the first and third polylines should have been further merged >> vtkSmartPointer wr = >> vtkSmartPointer::New(); >> wr->SetFileName("polylines.txt"); >> wr->SetInputConnection(stripper->GetOutputPort()); >> wr->Write(); >> /////////////////////// >> // END MODIFICATIONS // >> /////////////////////// >> >> vtkSmartPointer intersectionMapper = >> vtkSmartPointer::New(); >> intersectionMapper->SetInputConnection( stripper->GetOutputPort() ); >> intersectionMapper->ScalarVisibilityOff(); >> >> vtkSmartPointer intersectionActor = >> vtkSmartPointer::New(); >> intersectionActor->SetMapper( intersectionMapper ); >> >> vtkSmartPointer renderer = >> vtkSmartPointer::New(); >> renderer->AddViewProp(sphere1Actor); >> renderer->AddViewProp(planeActor); >> renderer->AddViewProp(intersectionActor); >> >> vtkSmartPointer renderWindow = >> vtkSmartPointer::New(); >> renderWindow->AddRenderer( renderer ); >> >> vtkSmartPointer renWinInteractor = >> vtkSmartPointer::New(); >> renWinInteractor->SetRenderWindow( renderWindow ); >> >> renderWindow->Render(); >> renderWindow->SetSize(600, 600); >> renderer->SetBackground(0.1, 0.2, 0.4); >> renWinInteractor->Start(); >> >> return EXIT_SUCCESS; >> } From david.gobbi at gmail.com Sun Dec 9 15:25:03 2012 From: david.gobbi at gmail.com (David Gobbi) Date: Sun, 9 Dec 2012 13:25:03 -0700 Subject: [vtkusers] Python vtkSphere Subclass In-Reply-To: References: Message-ID: Hi Ryan, This won't work, because your EvaluateFunction() and EvalutateGradient() methods will never get called. Overriding virtual methods through python doesn't work in the VTK wrappers. Maybe it will work at some point in the future. For sources and filters, people use vtkProgrammableSource and vtkProgrammableFilter to do what you are trying to do. You could use these as an example and write a vtkProgrammableImplicitFunction (in C++) that you could then use as a "hook" to write implicit functions in python. - David On Sun, Dec 9, 2012 at 12:05 PM, Ryan Irvin wrote: > I'm trying to create a custom implicit surface function to represent a conic > asphere and my approach was to try and subclass vtkSphere. I had previously > tried to subclass vtkImplicitFunction without success and saw some posts > about not being able to subclass abstract classes in Python (I don't know if > this is still true). > > The subclass I've put together is shown below, where the attribute surf_obj > is a python class representing the conic asphere and contains methods for > evaluating the surface function and gradient. > > When I run my full script, the result is that the default vtkSphere is > always rendered. It's pretty apparent that I'm not understanding the proper > approach to this problem and/or am not properly subclassing vtkSphere. > > I will be happy to provide the full *.py file which contains all of the code > but wasn't sure of the protocol and have not provided it with this post. > > If anyone has any suggestions about the correct way to approach this problem > or can provide some advice for properly subclassing, I would very much > appreciate it. > > -Ryan > > > class VtkImplicitConic( vtk.vtkSphere ): > > def __init__( self, con_surf ): > self.surf_obj = con_surf > self.SetRadius( self.surf_obj.GetRadius() ) > > > def EvaluateFunction( self, x, y, z ): > return self.surf_obj.EvaluateFunction( x, y, z ) > > > def EvaluateGradient( self, x, n ): > n[0],n[1],n[2] = self.surf_obj.EvaluateGradient( x[0], x[1], x[2] ) > > > def GetRadius( self ): > return self.surf_obj.GetRadius() > > > def SetRadius( self, radius ): > self.surf_obj.SetRadius( radius ) From david.gobbi at gmail.com Sun Dec 9 15:33:50 2012 From: david.gobbi at gmail.com (David Gobbi) Date: Sun, 9 Dec 2012 13:33:50 -0700 Subject: [vtkusers] Bug in vtkStripper on a very simple case ? In-Reply-To: <50C4F0C5.8000800@gmail.com> References: <50C4E39B.9030400@gmail.com> <50C4F0C5.8000800@gmail.com> Message-ID: Then where would the "9" go? The stripper uses a simple algorithm, it just chooses a starting point, goes as far as it can in each direction to create the first polyline, and then repeats this procedure until all the line segments are accounted for. It doesn't exhaustively search though all permutations to see which one gives the smallest number of output polylines... that would cause the algorithm to run many times slower. On Sun, Dec 9, 2012 at 1:12 PM, pof wrote: > Hi David > > the first polyline being: > > 9 0 1 2 3 4 5 19 6 7 > and the third polyline (actually it is a segment) being: > 2 18 0 > I don't see why they shoud not merge together as (unless I misunderstand > something): > 10 18 0 1 2 3 4 5 19 6 7 > > Am I wrong? > > > Le 09/12/2012 21:05, David Gobbi a ?crit : > >> Hi JD, >> >> It could only merge those two lines if it joined them with a "T". >> A polyline cannot have any branches. >> >> - David >> >> >> On Sun, Dec 9, 2012 at 12:16 PM, pof wrote: >>> >>> Hi all, >>> >>> I get a strange result (which may be a bug) using vtk stripper, i.e. it >>> does >>> not merge LINES as polylines as it is expected to. >>> In this example (see below an extract of the polydata produced by >>> vtkStripper), only 2 polylines should be obtained, but vtkStripper forgot >>> to >>> merge the first and the third line together, though they obviously share >>> point with Id=0 (btw, the fact that only Id 0 remains unmerged might not >>> be >>> pure luck). >>> >>> LINES 3 24 >>> 9 0 1 2 3 4 5 19 6 7 >>> 10 9 8 17 13 12 15 14 11 10 16 >>> 2 18 0 >>> Does anybody have an idea or an explanation? >>> Thanks >>> JD >>> >>> PS: Here below is the complete source file that generates these data and >>> in >>> which vtkStripper is used. >>> >>> ////////////////////////////////////////////////////// >>> // Example modified from IntersectionPolyDataFilter.cxx >>> ////////////////////////////////////////////////////// >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> >>> int main(int argc, char *argv[]) >>> { >>> vtkSmartPointer sphereSource1 = >>> vtkSmartPointer::New(); >>> sphereSource1->SetCenter(0.0, 0.0, 0.0); >>> sphereSource1->SetRadius(2.0f); >>> sphereSource1->SetPhiResolution(20); >>> sphereSource1->SetThetaResolution(20); >>> sphereSource1->Update(); >>> vtkSmartPointer sphere1Mapper = >>> vtkSmartPointer::New(); >>> sphere1Mapper->SetInputConnection( sphereSource1->GetOutputPort() ); >>> sphere1Mapper->ScalarVisibilityOff(); >>> vtkSmartPointer sphere1Actor = >>> vtkSmartPointer::New(); >>> sphere1Actor->SetMapper( sphere1Mapper ); >>> sphere1Actor->GetProperty()->SetOpacity(.3); >>> sphere1Actor->GetProperty()->SetColor(1,0,0); >>> >>> ///////////////////////// >>> // BEGIN MODIFICATIONS // >>> ///////////////////////// >>> // Create a planar object >>> // Define 4 vertices >>> vtkSmartPointer PlanePoints = >>> vtkSmartPointer::New(); >>> vtkSmartPointer PlaneCells = >>> vtkSmartPointer::New(); >>> PlanePoints->InsertNextPoint(-3, -1, 0); >>> PlanePoints->InsertNextPoint(3, -1, 0); >>> PlanePoints->InsertNextPoint(-3, 1, 0); >>> PlanePoints->InsertNextPoint(3, 1, 0); >>> // Create 2 trianglar faces >>> PlaneCells->InsertNextCell(3); >>> PlaneCells->InsertCellPoint(0); >>> PlaneCells->InsertCellPoint(1); >>> PlaneCells->InsertCellPoint(2); >>> PlaneCells->InsertNextCell(3); >>> PlaneCells->InsertCellPoint(1); >>> PlaneCells->InsertCellPoint(3); >>> PlaneCells->InsertCellPoint(2); >>> // Create the polydata from points and faces >>> vtkSmartPointer ProtectionWall = >>> vtkSmartPointer::New(); >>> ProtectionWall->SetPoints(PlanePoints); >>> ProtectionWall->SetPolys(PlaneCells); >>> ///////////////////////// >>> // END MODIFICATIONS // >>> ///////////////////////// >>> >>> vtkSmartPointer planeMapper = >>> vtkSmartPointer::New(); >>> planeMapper->SetInputConnection( ProtectionWall->GetProducerPort() ); >>> planeMapper->ScalarVisibilityOff(); >>> >>> vtkSmartPointer planeActor = >>> vtkSmartPointer::New(); >>> planeActor->SetMapper( planeMapper ); >>> planeActor->GetProperty()->SetOpacity(.3); >>> planeActor->GetProperty()->SetColor(0,1,0); >>> >>> // Get intersection segments (LINES) using the >>> vtkIntersectionPolyDataFilter >>> vtkSmartPointer >>> intersectionPolyDataFilter >>> = vtkSmartPointer::New(); >>> intersectionPolyDataFilter->SplitFirstOutputOff(); >>> intersectionPolyDataFilter->SplitSecondOutputOff(); >>> intersectionPolyDataFilter->SetInputConnection( 0, >>> sphereSource1->GetOutputPort() ); >>> intersectionPolyDataFilter->SetInputConnection( 1, >>> ProtectionWall->GetProducerPort() ); >>> intersectionPolyDataFilter->Update(); >>> >>> ///////////////////////// >>> // BEGIN MODIFICATIONS // >>> ///////////////////////// >>> // Try to get the polylines (there should be 2) from the segments >>> (LINES) >>> vtkSmartPointer stripper = >>> vtkSmartPointer::New(); >>> >>> stripper->SetInputConnection(intersectionPolyDataFilter->GetOutputPort()); >>> stripper->Update(); >>> // Save resulting polydata on a file, in which we see that there are 3 >>> polylines (actually the second polyline is ok, >>> // but the first and third polylines should have been further merged >>> vtkSmartPointer wr = >>> vtkSmartPointer::New(); >>> wr->SetFileName("polylines.txt"); >>> wr->SetInputConnection(stripper->GetOutputPort()); >>> wr->Write(); >>> /////////////////////// >>> // END MODIFICATIONS // >>> /////////////////////// >>> >>> vtkSmartPointer intersectionMapper = >>> vtkSmartPointer::New(); >>> intersectionMapper->SetInputConnection( stripper->GetOutputPort() ); >>> intersectionMapper->ScalarVisibilityOff(); >>> >>> vtkSmartPointer intersectionActor = >>> vtkSmartPointer::New(); >>> intersectionActor->SetMapper( intersectionMapper ); >>> >>> vtkSmartPointer renderer = >>> vtkSmartPointer::New(); >>> renderer->AddViewProp(sphere1Actor); >>> renderer->AddViewProp(planeActor); >>> renderer->AddViewProp(intersectionActor); >>> >>> vtkSmartPointer renderWindow = >>> vtkSmartPointer::New(); >>> renderWindow->AddRenderer( renderer ); >>> >>> vtkSmartPointer renWinInteractor = >>> vtkSmartPointer::New(); >>> renWinInteractor->SetRenderWindow( renderWindow ); >>> >>> renderWindow->Render(); >>> renderWindow->SetSize(600, 600); >>> renderer->SetBackground(0.1, 0.2, 0.4); >>> renWinInteractor->Start(); >>> >>> return EXIT_SUCCESS; >>> } > > From jd379252 at gmail.com Sun Dec 9 15:37:17 2012 From: jd379252 at gmail.com (pof) Date: Sun, 09 Dec 2012 21:37:17 +0100 Subject: [vtkusers] Bug in vtkStripper on a very simple case ? In-Reply-To: References: <50C4E39B.9030400@gmail.com> <50C4F0C5.8000800@gmail.com> Message-ID: <50C4F67D.4090205@gmail.com> Hum I see. (from what I understand), the first integer of each line is simply the number of points of the corresponding LINE Le 09/12/2012 21:33, David Gobbi a ?crit : > Then where would the "9" go? > > The stripper uses a simple algorithm, it just chooses a starting > point, goes as far as it can in each direction to create the first > polyline, and then repeats this procedure until all the line segments > are accounted for. It doesn't exhaustively search though all > permutations to see which one gives the smallest number of output > polylines... that would cause the algorithm to run many times slower. > > > > > On Sun, Dec 9, 2012 at 1:12 PM, pof wrote: >> Hi David >> >> the first polyline being: >> >> 9 0 1 2 3 4 5 19 6 7 >> and the third polyline (actually it is a segment) being: >> 2 18 0 >> I don't see why they shoud not merge together as (unless I misunderstand >> something): >> 10 18 0 1 2 3 4 5 19 6 7 >> >> Am I wrong? >> >> >> Le 09/12/2012 21:05, David Gobbi a ?crit : >> >>> Hi JD, >>> >>> It could only merge those two lines if it joined them with a "T". >>> A polyline cannot have any branches. >>> >>> - David >>> >>> >>> On Sun, Dec 9, 2012 at 12:16 PM, pof wrote: >>>> Hi all, >>>> >>>> I get a strange result (which may be a bug) using vtk stripper, i.e. it >>>> does >>>> not merge LINES as polylines as it is expected to. >>>> In this example (see below an extract of the polydata produced by >>>> vtkStripper), only 2 polylines should be obtained, but vtkStripper forgot >>>> to >>>> merge the first and the third line together, though they obviously share >>>> point with Id=0 (btw, the fact that only Id 0 remains unmerged might not >>>> be >>>> pure luck). >>>> >>>> LINES 3 24 >>>> 9 0 1 2 3 4 5 19 6 7 >>>> 10 9 8 17 13 12 15 14 11 10 16 >>>> 2 18 0 >>>> Does anybody have an idea or an explanation? >>>> Thanks >>>> JD >>>> >>>> PS: Here below is the complete source file that generates these data and >>>> in >>>> which vtkStripper is used. >>>> >>>> ////////////////////////////////////////////////////// >>>> // Example modified from IntersectionPolyDataFilter.cxx >>>> ////////////////////////////////////////////////////// >>>> #include >>>> #include >>>> #include >>>> #include >>>> #include >>>> #include >>>> #include >>>> #include >>>> #include >>>> #include >>>> #include >>>> #include >>>> >>>> int main(int argc, char *argv[]) >>>> { >>>> vtkSmartPointer sphereSource1 = >>>> vtkSmartPointer::New(); >>>> sphereSource1->SetCenter(0.0, 0.0, 0.0); >>>> sphereSource1->SetRadius(2.0f); >>>> sphereSource1->SetPhiResolution(20); >>>> sphereSource1->SetThetaResolution(20); >>>> sphereSource1->Update(); >>>> vtkSmartPointer sphere1Mapper = >>>> vtkSmartPointer::New(); >>>> sphere1Mapper->SetInputConnection( sphereSource1->GetOutputPort() ); >>>> sphere1Mapper->ScalarVisibilityOff(); >>>> vtkSmartPointer sphere1Actor = >>>> vtkSmartPointer::New(); >>>> sphere1Actor->SetMapper( sphere1Mapper ); >>>> sphere1Actor->GetProperty()->SetOpacity(.3); >>>> sphere1Actor->GetProperty()->SetColor(1,0,0); >>>> >>>> ///////////////////////// >>>> // BEGIN MODIFICATIONS // >>>> ///////////////////////// >>>> // Create a planar object >>>> // Define 4 vertices >>>> vtkSmartPointer PlanePoints = >>>> vtkSmartPointer::New(); >>>> vtkSmartPointer PlaneCells = >>>> vtkSmartPointer::New(); >>>> PlanePoints->InsertNextPoint(-3, -1, 0); >>>> PlanePoints->InsertNextPoint(3, -1, 0); >>>> PlanePoints->InsertNextPoint(-3, 1, 0); >>>> PlanePoints->InsertNextPoint(3, 1, 0); >>>> // Create 2 trianglar faces >>>> PlaneCells->InsertNextCell(3); >>>> PlaneCells->InsertCellPoint(0); >>>> PlaneCells->InsertCellPoint(1); >>>> PlaneCells->InsertCellPoint(2); >>>> PlaneCells->InsertNextCell(3); >>>> PlaneCells->InsertCellPoint(1); >>>> PlaneCells->InsertCellPoint(3); >>>> PlaneCells->InsertCellPoint(2); >>>> // Create the polydata from points and faces >>>> vtkSmartPointer ProtectionWall = >>>> vtkSmartPointer::New(); >>>> ProtectionWall->SetPoints(PlanePoints); >>>> ProtectionWall->SetPolys(PlaneCells); >>>> ///////////////////////// >>>> // END MODIFICATIONS // >>>> ///////////////////////// >>>> >>>> vtkSmartPointer planeMapper = >>>> vtkSmartPointer::New(); >>>> planeMapper->SetInputConnection( ProtectionWall->GetProducerPort() ); >>>> planeMapper->ScalarVisibilityOff(); >>>> >>>> vtkSmartPointer planeActor = >>>> vtkSmartPointer::New(); >>>> planeActor->SetMapper( planeMapper ); >>>> planeActor->GetProperty()->SetOpacity(.3); >>>> planeActor->GetProperty()->SetColor(0,1,0); >>>> >>>> // Get intersection segments (LINES) using the >>>> vtkIntersectionPolyDataFilter >>>> vtkSmartPointer >>>> intersectionPolyDataFilter >>>> = vtkSmartPointer::New(); >>>> intersectionPolyDataFilter->SplitFirstOutputOff(); >>>> intersectionPolyDataFilter->SplitSecondOutputOff(); >>>> intersectionPolyDataFilter->SetInputConnection( 0, >>>> sphereSource1->GetOutputPort() ); >>>> intersectionPolyDataFilter->SetInputConnection( 1, >>>> ProtectionWall->GetProducerPort() ); >>>> intersectionPolyDataFilter->Update(); >>>> >>>> ///////////////////////// >>>> // BEGIN MODIFICATIONS // >>>> ///////////////////////// >>>> // Try to get the polylines (there should be 2) from the segments >>>> (LINES) >>>> vtkSmartPointer stripper = >>>> vtkSmartPointer::New(); >>>> >>>> stripper->SetInputConnection(intersectionPolyDataFilter->GetOutputPort()); >>>> stripper->Update(); >>>> // Save resulting polydata on a file, in which we see that there are 3 >>>> polylines (actually the second polyline is ok, >>>> // but the first and third polylines should have been further merged >>>> vtkSmartPointer wr = >>>> vtkSmartPointer::New(); >>>> wr->SetFileName("polylines.txt"); >>>> wr->SetInputConnection(stripper->GetOutputPort()); >>>> wr->Write(); >>>> /////////////////////// >>>> // END MODIFICATIONS // >>>> /////////////////////// >>>> >>>> vtkSmartPointer intersectionMapper = >>>> vtkSmartPointer::New(); >>>> intersectionMapper->SetInputConnection( stripper->GetOutputPort() ); >>>> intersectionMapper->ScalarVisibilityOff(); >>>> >>>> vtkSmartPointer intersectionActor = >>>> vtkSmartPointer::New(); >>>> intersectionActor->SetMapper( intersectionMapper ); >>>> >>>> vtkSmartPointer renderer = >>>> vtkSmartPointer::New(); >>>> renderer->AddViewProp(sphere1Actor); >>>> renderer->AddViewProp(planeActor); >>>> renderer->AddViewProp(intersectionActor); >>>> >>>> vtkSmartPointer renderWindow = >>>> vtkSmartPointer::New(); >>>> renderWindow->AddRenderer( renderer ); >>>> >>>> vtkSmartPointer renWinInteractor = >>>> vtkSmartPointer::New(); >>>> renWinInteractor->SetRenderWindow( renderWindow ); >>>> >>>> renderWindow->Render(); >>>> renderWindow->SetSize(600, 600); >>>> renderer->SetBackground(0.1, 0.2, 0.4); >>>> renWinInteractor->Start(); >>>> >>>> return EXIT_SUCCESS; >>>> } >> From david.gobbi at gmail.com Sun Dec 9 15:41:17 2012 From: david.gobbi at gmail.com (David Gobbi) Date: Sun, 9 Dec 2012 13:41:17 -0700 Subject: [vtkusers] Bug in vtkStripper on a very simple case ? In-Reply-To: <50C4F67D.4090205@gmail.com> References: <50C4E39B.9030400@gmail.com> <50C4F0C5.8000800@gmail.com> <50C4F67D.4090205@gmail.com> Message-ID: Is it? Maybe it is. When you wrote the numbers, I assumed that all of the numbers that you listed were just point indices. On Sun, Dec 9, 2012 at 1:37 PM, pof wrote: > Hum I see. > (from what I understand), the first integer of each line is simply the > number of points of the corresponding LINE > > Le 09/12/2012 21:33, David Gobbi a ?crit : > >> Then where would the "9" go? >> >> The stripper uses a simple algorithm, it just chooses a starting >> point, goes as far as it can in each direction to create the first >> polyline, and then repeats this procedure until all the line segments >> are accounted for. It doesn't exhaustively search though all >> permutations to see which one gives the smallest number of output >> polylines... that would cause the algorithm to run many times slower. >> >> >> >> >> On Sun, Dec 9, 2012 at 1:12 PM, pof wrote: >>> >>> Hi David >>> >>> the first polyline being: >>> >>> 9 0 1 2 3 4 5 19 6 7 >>> and the third polyline (actually it is a segment) being: >>> 2 18 0 >>> I don't see why they shoud not merge together as (unless I misunderstand >>> something): >>> 10 18 0 1 2 3 4 5 19 6 7 >>> >>> Am I wrong? >>> >>> >>> Le 09/12/2012 21:05, David Gobbi a ?crit : >>> >>>> Hi JD, >>>> >>>> It could only merge those two lines if it joined them with a "T". >>>> A polyline cannot have any branches. >>>> >>>> - David >>>> >>>> >>>> On Sun, Dec 9, 2012 at 12:16 PM, pof wrote: >>>>> >>>>> Hi all, >>>>> >>>>> I get a strange result (which may be a bug) using vtk stripper, i.e. it >>>>> does >>>>> not merge LINES as polylines as it is expected to. >>>>> In this example (see below an extract of the polydata produced by >>>>> vtkStripper), only 2 polylines should be obtained, but vtkStripper >>>>> forgot >>>>> to >>>>> merge the first and the third line together, though they obviously >>>>> share >>>>> point with Id=0 (btw, the fact that only Id 0 remains unmerged might >>>>> not >>>>> be >>>>> pure luck). >>>>> >>>>> LINES 3 24 >>>>> 9 0 1 2 3 4 5 19 6 7 >>>>> 10 9 8 17 13 12 15 14 11 10 16 >>>>> 2 18 0 >>>>> Does anybody have an idea or an explanation? >>>>> Thanks >>>>> JD >>>>> >>>>> PS: Here below is the complete source file that generates these data >>>>> and >>>>> in >>>>> which vtkStripper is used. >>>>> >>>>> ////////////////////////////////////////////////////// >>>>> // Example modified from IntersectionPolyDataFilter.cxx >>>>> ////////////////////////////////////////////////////// >>>>> #include >>>>> #include >>>>> #include >>>>> #include >>>>> #include >>>>> #include >>>>> #include >>>>> #include >>>>> #include >>>>> #include >>>>> #include >>>>> #include >>>>> >>>>> int main(int argc, char *argv[]) >>>>> { >>>>> vtkSmartPointer sphereSource1 = >>>>> vtkSmartPointer::New(); >>>>> sphereSource1->SetCenter(0.0, 0.0, 0.0); >>>>> sphereSource1->SetRadius(2.0f); >>>>> sphereSource1->SetPhiResolution(20); >>>>> sphereSource1->SetThetaResolution(20); >>>>> sphereSource1->Update(); >>>>> vtkSmartPointer sphere1Mapper = >>>>> vtkSmartPointer::New(); >>>>> sphere1Mapper->SetInputConnection( sphereSource1->GetOutputPort() >>>>> ); >>>>> sphere1Mapper->ScalarVisibilityOff(); >>>>> vtkSmartPointer sphere1Actor = >>>>> vtkSmartPointer::New(); >>>>> sphere1Actor->SetMapper( sphere1Mapper ); >>>>> sphere1Actor->GetProperty()->SetOpacity(.3); >>>>> sphere1Actor->GetProperty()->SetColor(1,0,0); >>>>> >>>>> ///////////////////////// >>>>> // BEGIN MODIFICATIONS // >>>>> ///////////////////////// >>>>> // Create a planar object >>>>> // Define 4 vertices >>>>> vtkSmartPointer PlanePoints = >>>>> vtkSmartPointer::New(); >>>>> vtkSmartPointer PlaneCells = >>>>> vtkSmartPointer::New(); >>>>> PlanePoints->InsertNextPoint(-3, -1, 0); >>>>> PlanePoints->InsertNextPoint(3, -1, 0); >>>>> PlanePoints->InsertNextPoint(-3, 1, 0); >>>>> PlanePoints->InsertNextPoint(3, 1, 0); >>>>> // Create 2 trianglar faces >>>>> PlaneCells->InsertNextCell(3); >>>>> PlaneCells->InsertCellPoint(0); >>>>> PlaneCells->InsertCellPoint(1); >>>>> PlaneCells->InsertCellPoint(2); >>>>> PlaneCells->InsertNextCell(3); >>>>> PlaneCells->InsertCellPoint(1); >>>>> PlaneCells->InsertCellPoint(3); >>>>> PlaneCells->InsertCellPoint(2); >>>>> // Create the polydata from points and faces >>>>> vtkSmartPointer ProtectionWall = >>>>> vtkSmartPointer::New(); >>>>> ProtectionWall->SetPoints(PlanePoints); >>>>> ProtectionWall->SetPolys(PlaneCells); >>>>> ///////////////////////// >>>>> // END MODIFICATIONS // >>>>> ///////////////////////// >>>>> >>>>> vtkSmartPointer planeMapper = >>>>> vtkSmartPointer::New(); >>>>> planeMapper->SetInputConnection( ProtectionWall->GetProducerPort() >>>>> ); >>>>> planeMapper->ScalarVisibilityOff(); >>>>> >>>>> vtkSmartPointer planeActor = >>>>> vtkSmartPointer::New(); >>>>> planeActor->SetMapper( planeMapper ); >>>>> planeActor->GetProperty()->SetOpacity(.3); >>>>> planeActor->GetProperty()->SetColor(0,1,0); >>>>> >>>>> // Get intersection segments (LINES) using the >>>>> vtkIntersectionPolyDataFilter >>>>> vtkSmartPointer >>>>> intersectionPolyDataFilter >>>>> = vtkSmartPointer::New(); >>>>> intersectionPolyDataFilter->SplitFirstOutputOff(); >>>>> intersectionPolyDataFilter->SplitSecondOutputOff(); >>>>> intersectionPolyDataFilter->SetInputConnection( 0, >>>>> sphereSource1->GetOutputPort() ); >>>>> intersectionPolyDataFilter->SetInputConnection( 1, >>>>> ProtectionWall->GetProducerPort() ); >>>>> intersectionPolyDataFilter->Update(); >>>>> >>>>> ///////////////////////// >>>>> // BEGIN MODIFICATIONS // >>>>> ///////////////////////// >>>>> // Try to get the polylines (there should be 2) from the segments >>>>> (LINES) >>>>> vtkSmartPointer stripper = >>>>> vtkSmartPointer::New(); >>>>> >>>>> >>>>> stripper->SetInputConnection(intersectionPolyDataFilter->GetOutputPort()); >>>>> stripper->Update(); >>>>> // Save resulting polydata on a file, in which we see that there >>>>> are 3 >>>>> polylines (actually the second polyline is ok, >>>>> // but the first and third polylines should have been further >>>>> merged >>>>> vtkSmartPointer wr = >>>>> vtkSmartPointer::New(); >>>>> wr->SetFileName("polylines.txt"); >>>>> wr->SetInputConnection(stripper->GetOutputPort()); >>>>> wr->Write(); >>>>> /////////////////////// >>>>> // END MODIFICATIONS // >>>>> /////////////////////// >>>>> >>>>> vtkSmartPointer intersectionMapper = >>>>> vtkSmartPointer::New(); >>>>> intersectionMapper->SetInputConnection( stripper->GetOutputPort() >>>>> ); >>>>> intersectionMapper->ScalarVisibilityOff(); >>>>> >>>>> vtkSmartPointer intersectionActor = >>>>> vtkSmartPointer::New(); >>>>> intersectionActor->SetMapper( intersectionMapper ); >>>>> >>>>> vtkSmartPointer renderer = >>>>> vtkSmartPointer::New(); >>>>> renderer->AddViewProp(sphere1Actor); >>>>> renderer->AddViewProp(planeActor); >>>>> renderer->AddViewProp(intersectionActor); >>>>> >>>>> vtkSmartPointer renderWindow = >>>>> vtkSmartPointer::New(); >>>>> renderWindow->AddRenderer( renderer ); >>>>> >>>>> vtkSmartPointer renWinInteractor = >>>>> vtkSmartPointer::New(); >>>>> renWinInteractor->SetRenderWindow( renderWindow ); >>>>> >>>>> renderWindow->Render(); >>>>> renderWindow->SetSize(600, 600); >>>>> renderer->SetBackground(0.1, 0.2, 0.4); >>>>> renWinInteractor->Start(); >>>>> >>>>> return EXIT_SUCCESS; >>>>> } >>> >>> > From ryan.irvin at gmail.com Sun Dec 9 15:59:16 2012 From: ryan.irvin at gmail.com (Ryan Irvin) Date: Sun, 9 Dec 2012 13:59:16 -0700 Subject: [vtkusers] Python vtkSphere Subclass In-Reply-To: References: Message-ID: David, Thanks for the clarification and the suggestion regarding vtkProgrammableSource. I'll look into that option. -Ryan On Sun, Dec 9, 2012 at 1:25 PM, David Gobbi wrote: > Hi Ryan, > > This won't work, because your EvaluateFunction() and EvalutateGradient() > methods will never get called. Overriding virtual methods through python > doesn't work in the VTK wrappers. Maybe it will work at some point in > the future. > > For sources and filters, people use vtkProgrammableSource and > vtkProgrammableFilter to do what you are trying to do. You could use > these as an example and write a vtkProgrammableImplicitFunction > (in C++) that you could then use as a "hook" to write implicit functions > in python. > > - David > > On Sun, Dec 9, 2012 at 12:05 PM, Ryan Irvin wrote: > > I'm trying to create a custom implicit surface function to represent a > conic > > asphere and my approach was to try and subclass vtkSphere. I had > previously > > tried to subclass vtkImplicitFunction without success and saw some posts > > about not being able to subclass abstract classes in Python (I don't > know if > > this is still true). > > > > The subclass I've put together is shown below, where the attribute > surf_obj > > is a python class representing the conic asphere and contains methods for > > evaluating the surface function and gradient. > > > > When I run my full script, the result is that the default vtkSphere is > > always rendered. It's pretty apparent that I'm not understanding the > proper > > approach to this problem and/or am not properly subclassing vtkSphere. > > > > I will be happy to provide the full *.py file which contains all of the > code > > but wasn't sure of the protocol and have not provided it with this post. > > > > If anyone has any suggestions about the correct way to approach this > problem > > or can provide some advice for properly subclassing, I would very much > > appreciate it. > > > > -Ryan > > > > > > class VtkImplicitConic( vtk.vtkSphere ): > > > > def __init__( self, con_surf ): > > self.surf_obj = con_surf > > self.SetRadius( self.surf_obj.GetRadius() ) > > > > > > def EvaluateFunction( self, x, y, z ): > > return self.surf_obj.EvaluateFunction( x, y, z ) > > > > > > def EvaluateGradient( self, x, n ): > > n[0],n[1],n[2] = self.surf_obj.EvaluateGradient( x[0], x[1], > x[2] ) > > > > > > def GetRadius( self ): > > return self.surf_obj.GetRadius() > > > > > > def SetRadius( self, radius ): > > self.surf_obj.SetRadius( radius ) > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mehdiesteghamat at gmail.com Sun Dec 9 15:59:34 2012 From: mehdiesteghamat at gmail.com (Mehdi Esteghamatian) Date: Sun, 9 Dec 2012 15:59:34 -0500 Subject: [vtkusers] Static Link VTK In-Reply-To: References: Message-ID: Sure! I CCed the conversation. ---------- Forwarded message ---------- From: David Doria Date: Sun, Dec 9, 2012 at 3:55 PM Subject: Re: [vtkusers] Static Link VTK To: Mehdi Esteghamatian Perhaps, I'm not sure what to do in that case. Please keep the discussion on the mailing list, someone there might know. David On Sun, Dec 9, 2012 at 3:38 PM, Mehdi Esteghamatian < mehdiesteghamat at gmail.com> wrote: > Thanks David for the quick response. > > Yes I already did that but the thing is that I am using QT as well for GUI > stuff and as I turn off BUILD_SHARED_LIBS it dose not compile QVTK.lib > which I guess it is because the my QT was compiled dynamically. > > Might that be correct? > > Thanks > Mehdi > > > On Sun, Dec 9, 2012 at 2:58 PM, David Doria wrote: > >> On Sun, Dec 9, 2012 at 2:38 PM, Mehdi Esteghamatian < >> mehdiesteghamat at gmail.com> wrote: >> >>> Hello Everyone, >>> >>> I just have a question that I have been trying to find the answer on the >>> net already, but could not find. >>> >>> I am trying to build an standalone application, a single exe file using >>> VTK in such a way that I do not need to put the dlls in the same folder. >>> >>> Please let me know how I can compile against static libraries. >>> >>> I just do not know where I can get the vtk static libs in the vtk-build >>> folder. >>> >>> Thanks in advance, >>> >>> Mehdi >>> >> >> You need to build VTK with BUILD_SHARED_LIBS=OFF >> >> David >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jd379252 at gmail.com Sun Dec 9 16:48:40 2012 From: jd379252 at gmail.com (pof) Date: Sun, 09 Dec 2012 22:48:40 +0100 Subject: [vtkusers] Bug in vtkStripper on a very simple case ? In-Reply-To: References: <50C4E39B.9030400@gmail.com> <50C4F0C5.8000800@gmail.com> <50C4F67D.4090205@gmail.com> Message-ID: <50C50738.4030109@gmail.com> yes this is the way LINES objects are written on vtk files. Ok, so I understand now the point you were making about the "T", which was uncorrect. So back to the problem, why this vtkStripper is not able to merge those 2 lines? Le 09/12/2012 21:41, David Gobbi a ?crit : > Is it? Maybe it is. When you wrote the numbers, I assumed that > all of the numbers that you listed were just point indices. > > > On Sun, Dec 9, 2012 at 1:37 PM, pof wrote: >> Hum I see. >> (from what I understand), the first integer of each line is simply the >> number of points of the corresponding LINE >> >> Le 09/12/2012 21:33, David Gobbi a ?crit : >> >>> Then where would the "9" go? >>> >>> The stripper uses a simple algorithm, it just chooses a starting >>> point, goes as far as it can in each direction to create the first >>> polyline, and then repeats this procedure until all the line segments >>> are accounted for. It doesn't exhaustively search though all >>> permutations to see which one gives the smallest number of output >>> polylines... that would cause the algorithm to run many times slower. >>> >>> >>> >>> >>> On Sun, Dec 9, 2012 at 1:12 PM, pof wrote: >>>> Hi David >>>> >>>> the first polyline being: >>>> >>>> 9 0 1 2 3 4 5 19 6 7 >>>> and the third polyline (actually it is a segment) being: >>>> 2 18 0 >>>> I don't see why they shoud not merge together as (unless I misunderstand >>>> something): >>>> 10 18 0 1 2 3 4 5 19 6 7 >>>> >>>> Am I wrong? >>>> >>>> >>>> Le 09/12/2012 21:05, David Gobbi a ?crit : >>>> >>>>> Hi JD, >>>>> >>>>> It could only merge those two lines if it joined them with a "T". >>>>> A polyline cannot have any branches. >>>>> >>>>> - David >>>>> >>>>> >>>>> On Sun, Dec 9, 2012 at 12:16 PM, pof wrote: >>>>>> Hi all, >>>>>> >>>>>> I get a strange result (which may be a bug) using vtk stripper, i.e. it >>>>>> does >>>>>> not merge LINES as polylines as it is expected to. >>>>>> In this example (see below an extract of the polydata produced by >>>>>> vtkStripper), only 2 polylines should be obtained, but vtkStripper >>>>>> forgot >>>>>> to >>>>>> merge the first and the third line together, though they obviously >>>>>> share >>>>>> point with Id=0 (btw, the fact that only Id 0 remains unmerged might >>>>>> not >>>>>> be >>>>>> pure luck). >>>>>> >>>>>> LINES 3 24 >>>>>> 9 0 1 2 3 4 5 19 6 7 >>>>>> 10 9 8 17 13 12 15 14 11 10 16 >>>>>> 2 18 0 >>>>>> Does anybody have an idea or an explanation? >>>>>> Thanks >>>>>> JD >>>>>> >>>>>> PS: Here below is the complete source file that generates these data >>>>>> and >>>>>> in >>>>>> which vtkStripper is used. >>>>>> >>>>>> ////////////////////////////////////////////////////// >>>>>> // Example modified from IntersectionPolyDataFilter.cxx >>>>>> ////////////////////////////////////////////////////// >>>>>> #include >>>>>> #include >>>>>> #include >>>>>> #include >>>>>> #include >>>>>> #include >>>>>> #include >>>>>> #include >>>>>> #include >>>>>> #include >>>>>> #include >>>>>> #include >>>>>> >>>>>> int main(int argc, char *argv[]) >>>>>> { >>>>>> vtkSmartPointer sphereSource1 = >>>>>> vtkSmartPointer::New(); >>>>>> sphereSource1->SetCenter(0.0, 0.0, 0.0); >>>>>> sphereSource1->SetRadius(2.0f); >>>>>> sphereSource1->SetPhiResolution(20); >>>>>> sphereSource1->SetThetaResolution(20); >>>>>> sphereSource1->Update(); >>>>>> vtkSmartPointer sphere1Mapper = >>>>>> vtkSmartPointer::New(); >>>>>> sphere1Mapper->SetInputConnection( sphereSource1->GetOutputPort() >>>>>> ); >>>>>> sphere1Mapper->ScalarVisibilityOff(); >>>>>> vtkSmartPointer sphere1Actor = >>>>>> vtkSmartPointer::New(); >>>>>> sphere1Actor->SetMapper( sphere1Mapper ); >>>>>> sphere1Actor->GetProperty()->SetOpacity(.3); >>>>>> sphere1Actor->GetProperty()->SetColor(1,0,0); >>>>>> >>>>>> ///////////////////////// >>>>>> // BEGIN MODIFICATIONS // >>>>>> ///////////////////////// >>>>>> // Create a planar object >>>>>> // Define 4 vertices >>>>>> vtkSmartPointer PlanePoints = >>>>>> vtkSmartPointer::New(); >>>>>> vtkSmartPointer PlaneCells = >>>>>> vtkSmartPointer::New(); >>>>>> PlanePoints->InsertNextPoint(-3, -1, 0); >>>>>> PlanePoints->InsertNextPoint(3, -1, 0); >>>>>> PlanePoints->InsertNextPoint(-3, 1, 0); >>>>>> PlanePoints->InsertNextPoint(3, 1, 0); >>>>>> // Create 2 trianglar faces >>>>>> PlaneCells->InsertNextCell(3); >>>>>> PlaneCells->InsertCellPoint(0); >>>>>> PlaneCells->InsertCellPoint(1); >>>>>> PlaneCells->InsertCellPoint(2); >>>>>> PlaneCells->InsertNextCell(3); >>>>>> PlaneCells->InsertCellPoint(1); >>>>>> PlaneCells->InsertCellPoint(3); >>>>>> PlaneCells->InsertCellPoint(2); >>>>>> // Create the polydata from points and faces >>>>>> vtkSmartPointer ProtectionWall = >>>>>> vtkSmartPointer::New(); >>>>>> ProtectionWall->SetPoints(PlanePoints); >>>>>> ProtectionWall->SetPolys(PlaneCells); >>>>>> ///////////////////////// >>>>>> // END MODIFICATIONS // >>>>>> ///////////////////////// >>>>>> >>>>>> vtkSmartPointer planeMapper = >>>>>> vtkSmartPointer::New(); >>>>>> planeMapper->SetInputConnection( ProtectionWall->GetProducerPort() >>>>>> ); >>>>>> planeMapper->ScalarVisibilityOff(); >>>>>> >>>>>> vtkSmartPointer planeActor = >>>>>> vtkSmartPointer::New(); >>>>>> planeActor->SetMapper( planeMapper ); >>>>>> planeActor->GetProperty()->SetOpacity(.3); >>>>>> planeActor->GetProperty()->SetColor(0,1,0); >>>>>> >>>>>> // Get intersection segments (LINES) using the >>>>>> vtkIntersectionPolyDataFilter >>>>>> vtkSmartPointer >>>>>> intersectionPolyDataFilter >>>>>> = vtkSmartPointer::New(); >>>>>> intersectionPolyDataFilter->SplitFirstOutputOff(); >>>>>> intersectionPolyDataFilter->SplitSecondOutputOff(); >>>>>> intersectionPolyDataFilter->SetInputConnection( 0, >>>>>> sphereSource1->GetOutputPort() ); >>>>>> intersectionPolyDataFilter->SetInputConnection( 1, >>>>>> ProtectionWall->GetProducerPort() ); >>>>>> intersectionPolyDataFilter->Update(); >>>>>> >>>>>> ///////////////////////// >>>>>> // BEGIN MODIFICATIONS // >>>>>> ///////////////////////// >>>>>> // Try to get the polylines (there should be 2) from the segments >>>>>> (LINES) >>>>>> vtkSmartPointer stripper = >>>>>> vtkSmartPointer::New(); >>>>>> >>>>>> >>>>>> stripper->SetInputConnection(intersectionPolyDataFilter->GetOutputPort()); >>>>>> stripper->Update(); >>>>>> // Save resulting polydata on a file, in which we see that there >>>>>> are 3 >>>>>> polylines (actually the second polyline is ok, >>>>>> // but the first and third polylines should have been further >>>>>> merged >>>>>> vtkSmartPointer wr = >>>>>> vtkSmartPointer::New(); >>>>>> wr->SetFileName("polylines.txt"); >>>>>> wr->SetInputConnection(stripper->GetOutputPort()); >>>>>> wr->Write(); >>>>>> /////////////////////// >>>>>> // END MODIFICATIONS // >>>>>> /////////////////////// >>>>>> >>>>>> vtkSmartPointer intersectionMapper = >>>>>> vtkSmartPointer::New(); >>>>>> intersectionMapper->SetInputConnection( stripper->GetOutputPort() >>>>>> ); >>>>>> intersectionMapper->ScalarVisibilityOff(); >>>>>> >>>>>> vtkSmartPointer intersectionActor = >>>>>> vtkSmartPointer::New(); >>>>>> intersectionActor->SetMapper( intersectionMapper ); >>>>>> >>>>>> vtkSmartPointer renderer = >>>>>> vtkSmartPointer::New(); >>>>>> renderer->AddViewProp(sphere1Actor); >>>>>> renderer->AddViewProp(planeActor); >>>>>> renderer->AddViewProp(intersectionActor); >>>>>> >>>>>> vtkSmartPointer renderWindow = >>>>>> vtkSmartPointer::New(); >>>>>> renderWindow->AddRenderer( renderer ); >>>>>> >>>>>> vtkSmartPointer renWinInteractor = >>>>>> vtkSmartPointer::New(); >>>>>> renWinInteractor->SetRenderWindow( renderWindow ); >>>>>> >>>>>> renderWindow->Render(); >>>>>> renderWindow->SetSize(600, 600); >>>>>> renderer->SetBackground(0.1, 0.2, 0.4); >>>>>> renWinInteractor->Start(); >>>>>> >>>>>> return EXIT_SUCCESS; >>>>>> } >>>> From david.gobbi at gmail.com Sun Dec 9 17:51:16 2012 From: david.gobbi at gmail.com (David Gobbi) Date: Sun, 9 Dec 2012 15:51:16 -0700 Subject: [vtkusers] Bug in vtkStripper on a very simple case ? In-Reply-To: <50C50738.4030109@gmail.com> References: <50C4E39B.9030400@gmail.com> <50C4F0C5.8000800@gmail.com> <50C4F67D.4090205@gmail.com> <50C50738.4030109@gmail.com> Message-ID: Insert vtkTriangleFilter before vtkStripper. This will break any input polylines into line segments. I don't know if it will help, but it might. - David On Sun, Dec 9, 2012 at 2:48 PM, pof wrote: > yes this is the way LINES objects are written on vtk files. > Ok, so I understand now the point you were making about the "T", which was > uncorrect. > > So back to the problem, why this vtkStripper is not able to merge those 2 > lines? > > Le 09/12/2012 21:41, David Gobbi a ?crit : >> >> Is it? Maybe it is. When you wrote the numbers, I assumed that >> >> all of the numbers that you listed were just point indices. >> >> >> On Sun, Dec 9, 2012 at 1:37 PM, pof wrote: >>> >>> Hum I see. >>> (from what I understand), the first integer of each line is simply the >>> number of points of the corresponding LINE >>> >>> Le 09/12/2012 21:33, David Gobbi a ?crit : >>> >>>> Then where would the "9" go? >>>> >>>> The stripper uses a simple algorithm, it just chooses a starting >>>> point, goes as far as it can in each direction to create the first >>>> polyline, and then repeats this procedure until all the line segments >>>> are accounted for. It doesn't exhaustively search though all >>>> permutations to see which one gives the smallest number of output >>>> polylines... that would cause the algorithm to run many times slower. >>>> >>>> >>>> >>>> >>>> On Sun, Dec 9, 2012 at 1:12 PM, pof wrote: >>>>> >>>>> Hi David >>>>> >>>>> the first polyline being: >>>>> >>>>> 9 0 1 2 3 4 5 19 6 7 >>>>> and the third polyline (actually it is a segment) being: >>>>> 2 18 0 >>>>> I don't see why they shoud not merge together as (unless I >>>>> misunderstand >>>>> something): >>>>> 10 18 0 1 2 3 4 5 19 6 7 >>>>> >>>>> Am I wrong? >>>>> >>>>> >>>>> Le 09/12/2012 21:05, David Gobbi a ?crit : >>>>> >>>>>> Hi JD, >>>>>> >>>>>> It could only merge those two lines if it joined them with a "T". >>>>>> A polyline cannot have any branches. >>>>>> >>>>>> - David >>>>>> >>>>>> >>>>>> On Sun, Dec 9, 2012 at 12:16 PM, pof wrote: >>>>>>> >>>>>>> Hi all, >>>>>>> >>>>>>> I get a strange result (which may be a bug) using vtk stripper, i.e. >>>>>>> it >>>>>>> does >>>>>>> not merge LINES as polylines as it is expected to. >>>>>>> In this example (see below an extract of the polydata produced by >>>>>>> vtkStripper), only 2 polylines should be obtained, but vtkStripper >>>>>>> forgot >>>>>>> to >>>>>>> merge the first and the third line together, though they obviously >>>>>>> share >>>>>>> point with Id=0 (btw, the fact that only Id 0 remains unmerged might >>>>>>> not >>>>>>> be >>>>>>> pure luck). >>>>>>> >>>>>>> LINES 3 24 >>>>>>> 9 0 1 2 3 4 5 19 6 7 >>>>>>> 10 9 8 17 13 12 15 14 11 10 16 >>>>>>> 2 18 0 >>>>>>> Does anybody have an idea or an explanation? >>>>>>> Thanks >>>>>>> JD >>>>>>> >>>>>>> PS: Here below is the complete source file that generates these data >>>>>>> and >>>>>>> in >>>>>>> which vtkStripper is used. >>>>>>> >>>>>>> ////////////////////////////////////////////////////// >>>>>>> // Example modified from IntersectionPolyDataFilter.cxx >>>>>>> ////////////////////////////////////////////////////// >>>>>>> #include >>>>>>> #include >>>>>>> #include >>>>>>> #include >>>>>>> #include >>>>>>> #include >>>>>>> #include >>>>>>> #include >>>>>>> #include >>>>>>> #include >>>>>>> #include >>>>>>> #include >>>>>>> >>>>>>> int main(int argc, char *argv[]) >>>>>>> { >>>>>>> vtkSmartPointer sphereSource1 = >>>>>>> vtkSmartPointer::New(); >>>>>>> sphereSource1->SetCenter(0.0, 0.0, 0.0); >>>>>>> sphereSource1->SetRadius(2.0f); >>>>>>> sphereSource1->SetPhiResolution(20); >>>>>>> sphereSource1->SetThetaResolution(20); >>>>>>> sphereSource1->Update(); >>>>>>> vtkSmartPointer sphere1Mapper = >>>>>>> vtkSmartPointer::New(); >>>>>>> sphere1Mapper->SetInputConnection( >>>>>>> sphereSource1->GetOutputPort() >>>>>>> ); >>>>>>> sphere1Mapper->ScalarVisibilityOff(); >>>>>>> vtkSmartPointer sphere1Actor = >>>>>>> vtkSmartPointer::New(); >>>>>>> sphere1Actor->SetMapper( sphere1Mapper ); >>>>>>> sphere1Actor->GetProperty()->SetOpacity(.3); >>>>>>> sphere1Actor->GetProperty()->SetColor(1,0,0); >>>>>>> >>>>>>> ///////////////////////// >>>>>>> // BEGIN MODIFICATIONS // >>>>>>> ///////////////////////// >>>>>>> // Create a planar object >>>>>>> // Define 4 vertices >>>>>>> vtkSmartPointer PlanePoints = >>>>>>> vtkSmartPointer::New(); >>>>>>> vtkSmartPointer PlaneCells = >>>>>>> vtkSmartPointer::New(); >>>>>>> PlanePoints->InsertNextPoint(-3, -1, 0); >>>>>>> PlanePoints->InsertNextPoint(3, -1, 0); >>>>>>> PlanePoints->InsertNextPoint(-3, 1, 0); >>>>>>> PlanePoints->InsertNextPoint(3, 1, 0); >>>>>>> // Create 2 trianglar faces >>>>>>> PlaneCells->InsertNextCell(3); >>>>>>> PlaneCells->InsertCellPoint(0); >>>>>>> PlaneCells->InsertCellPoint(1); >>>>>>> PlaneCells->InsertCellPoint(2); >>>>>>> PlaneCells->InsertNextCell(3); >>>>>>> PlaneCells->InsertCellPoint(1); >>>>>>> PlaneCells->InsertCellPoint(3); >>>>>>> PlaneCells->InsertCellPoint(2); >>>>>>> // Create the polydata from points and faces >>>>>>> vtkSmartPointer ProtectionWall = >>>>>>> vtkSmartPointer::New(); >>>>>>> ProtectionWall->SetPoints(PlanePoints); >>>>>>> ProtectionWall->SetPolys(PlaneCells); >>>>>>> ///////////////////////// >>>>>>> // END MODIFICATIONS // >>>>>>> ///////////////////////// >>>>>>> >>>>>>> vtkSmartPointer planeMapper = >>>>>>> vtkSmartPointer::New(); >>>>>>> planeMapper->SetInputConnection( >>>>>>> ProtectionWall->GetProducerPort() >>>>>>> ); >>>>>>> planeMapper->ScalarVisibilityOff(); >>>>>>> >>>>>>> vtkSmartPointer planeActor = >>>>>>> vtkSmartPointer::New(); >>>>>>> planeActor->SetMapper( planeMapper ); >>>>>>> planeActor->GetProperty()->SetOpacity(.3); >>>>>>> planeActor->GetProperty()->SetColor(0,1,0); >>>>>>> >>>>>>> // Get intersection segments (LINES) using the >>>>>>> vtkIntersectionPolyDataFilter >>>>>>> vtkSmartPointer >>>>>>> intersectionPolyDataFilter >>>>>>> = vtkSmartPointer::New(); >>>>>>> intersectionPolyDataFilter->SplitFirstOutputOff(); >>>>>>> intersectionPolyDataFilter->SplitSecondOutputOff(); >>>>>>> intersectionPolyDataFilter->SetInputConnection( 0, >>>>>>> sphereSource1->GetOutputPort() ); >>>>>>> intersectionPolyDataFilter->SetInputConnection( 1, >>>>>>> ProtectionWall->GetProducerPort() ); >>>>>>> intersectionPolyDataFilter->Update(); >>>>>>> >>>>>>> ///////////////////////// >>>>>>> // BEGIN MODIFICATIONS // >>>>>>> ///////////////////////// >>>>>>> // Try to get the polylines (there should be 2) from the >>>>>>> segments >>>>>>> (LINES) >>>>>>> vtkSmartPointer stripper = >>>>>>> vtkSmartPointer::New(); >>>>>>> >>>>>>> >>>>>>> >>>>>>> stripper->SetInputConnection(intersectionPolyDataFilter->GetOutputPort()); >>>>>>> stripper->Update(); >>>>>>> // Save resulting polydata on a file, in which we see that there >>>>>>> are 3 >>>>>>> polylines (actually the second polyline is ok, >>>>>>> // but the first and third polylines should have been further >>>>>>> merged >>>>>>> vtkSmartPointer wr = >>>>>>> vtkSmartPointer::New(); >>>>>>> wr->SetFileName("polylines.txt"); >>>>>>> wr->SetInputConnection(stripper->GetOutputPort()); >>>>>>> wr->Write(); >>>>>>> /////////////////////// >>>>>>> // END MODIFICATIONS // >>>>>>> /////////////////////// >>>>>>> >>>>>>> vtkSmartPointer intersectionMapper = >>>>>>> vtkSmartPointer::New(); >>>>>>> intersectionMapper->SetInputConnection( >>>>>>> stripper->GetOutputPort() >>>>>>> ); >>>>>>> intersectionMapper->ScalarVisibilityOff(); >>>>>>> >>>>>>> vtkSmartPointer intersectionActor = >>>>>>> vtkSmartPointer::New(); >>>>>>> intersectionActor->SetMapper( intersectionMapper ); >>>>>>> >>>>>>> vtkSmartPointer renderer = >>>>>>> vtkSmartPointer::New(); >>>>>>> renderer->AddViewProp(sphere1Actor); >>>>>>> renderer->AddViewProp(planeActor); >>>>>>> renderer->AddViewProp(intersectionActor); >>>>>>> >>>>>>> vtkSmartPointer renderWindow = >>>>>>> vtkSmartPointer::New(); >>>>>>> renderWindow->AddRenderer( renderer ); >>>>>>> >>>>>>> vtkSmartPointer renWinInteractor = >>>>>>> vtkSmartPointer::New(); >>>>>>> renWinInteractor->SetRenderWindow( renderWindow ); >>>>>>> >>>>>>> renderWindow->Render(); >>>>>>> renderWindow->SetSize(600, 600); >>>>>>> renderer->SetBackground(0.1, 0.2, 0.4); >>>>>>> renWinInteractor->Start(); >>>>>>> >>>>>>> return EXIT_SUCCESS; >>>>>>> } >>>>> >>>>> > From drescherjm at gmail.com Sun Dec 9 20:29:52 2012 From: drescherjm at gmail.com (John Drescher) Date: Sun, 9 Dec 2012 20:29:52 -0500 Subject: [vtkusers] Static Link VTK In-Reply-To: References: Message-ID: >> Yes I already did that but the thing is that I am using QT as well for GUI >> stuff and as I turn off BUILD_SHARED_LIBS it dose not compile QVTK.lib which >> I guess it is because the my QT was compiled dynamically. QVTK.lib will work fine without shared libraries. I have been using that this way for over 4 years (up to vtk-5.10.0 and Qt-4.8.4). John From lobo.theslayer at gmail.com Sun Dec 9 21:40:52 2012 From: lobo.theslayer at gmail.com (Rodrigo Lovera) Date: Sun, 9 Dec 2012 21:40:52 -0500 Subject: [vtkusers] Problems with FourPaneQVTKViewer Example Message-ID: Hello everyone, I've been trying to use a base for my own gui, the example that comes into VTK Source /examples/gui/qt/ the 4panel viewer. At default, it's coded to open a directory with dicom files, I test that and everything OK, im trying to build a gui for 3D ultrasound visualization, and got no ultrasound dicom data set, so I've been trying to do it with some ultrasound data taken in jpg format. I'm considering jpg images of 400x300 and a total of 20 slices for example, at the beggining everything seems ok except of the 3 planes crossed in the upper right view which seems not to be centered, and then after applying reslice mode on it just don't show anything at all. If anyone know a way to solve these or make me help me understand what could be wrong with it 'd be much appreciated. Thx in advance Regards, -- *Rodrigo* -------------- next part -------------- An HTML attachment was scrubbed... URL: From gongweixue at sina.com Sun Dec 9 21:20:06 2012 From: gongweixue at sina.com (gongweixue) Date: Mon, 10 Dec 2012 10:20:06 +0800 Subject: [vtkusers] dose anyone know how to convert dataset into polydata? Message-ID: I want to use vtkUnstructuredGridToPolyDataFilter,but it's a abstract class. and can you guys tell me which filter i should use? i used a DataSetReader as an input of TableBasedClipDataSet. The Output is also DataSet, and then i want to convert DataSet to PolyData, is there any information in DataSet lost? I will really appreciate any suggestion! 2012/12/10 gongweixue at sina.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mehdiesteghamat at gmail.com Sun Dec 9 22:05:04 2012 From: mehdiesteghamat at gmail.com (Mehdi Esteghamatian) Date: Sun, 9 Dec 2012 22:05:04 -0500 Subject: [vtkusers] dose anyone know how to convert dataset into polydata? In-Reply-To: References: Message-ID: The best way is to use marching cube algorithm to extract iso-surfaces from you ImageDatat. check this I should help http://www.vtk.org/doc/nightly/html/classvtkMarchingCubes.html Mehdi On Sun, Dec 9, 2012 at 9:20 PM, gongweixue wrote: > I want to use vtkUnstructuredGridToPolyDataFilter,but it's a abstract > class. > and can you guys tell me which filter i should use? > > i used a DataSetReader as an input of TableBasedClipDataSet. The Output is > also DataSet, and then i want to convert DataSet to PolyData, is there any > information in DataSet lost? > > I will really appreciate any suggestion! > > 2012/12/10 > gongweixue at sina.com > ____________________________________________ > *DreamMail* - ??????? www.dreammail.org > > _______________________________________________ > 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://www.vtk.org/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Sun Dec 9 22:05:19 2012 From: daviddoria at gmail.com (David Doria) Date: Sun, 9 Dec 2012 22:05:19 -0500 Subject: [vtkusers] dose anyone know how to convert dataset into polydata? In-Reply-To: References: Message-ID: On Sun, Dec 9, 2012 at 9:20 PM, gongweixue wrote: > I want to use vtkUnstructuredGridToPolyDataFilter,but it's a abstract > class. > and can you guys tell me which filter i should use? > > i used a DataSetReader as an input of TableBasedClipDataSet. The Output is > also DataSet, and then i want to convert DataSet to PolyData, is there any > information in DataSet lost? > > I will really appreciate any suggestion! > You can't convert a PolyData to a DataSet, a PolyData IS a DataSet. To convert an UnstructuredGrid to a PolyData, you can use: http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/DataSetSurfaceFilter ("Surface" filter, because an UnstructuredGrid can have 3D cells (like tetrahedra), but a PolyData can only have 2D cells (like polygons) ). David -------------- next part -------------- An HTML attachment was scrubbed... URL: From mehdiesteghamat at gmail.com Mon Dec 10 00:59:10 2012 From: mehdiesteghamat at gmail.com (Mehdi Esteghamatian) Date: Mon, 10 Dec 2012 00:59:10 -0500 Subject: [vtkusers] Static Link VTK In-Reply-To: References: Message-ID: Yes your right it should be fine although I am not getting it right yet. My previous qt was compiled dynamically. So, I still had to put QT dlls in the target folder. Now I compiled the qt statically which is a bit confusing because It did not create separate folders for statics and dynamic libraries, so now things look like below in lib folder (D:\...\QT\4.8.4\lib). For every library I have 4 versions. for example for QTCore I have the followings QtCore.lib -> static release QtCored.lib -> static debug QtCore.lib -> dynamic rlease QtCore.lib -> dynamic debug *NOW *the problem is that I am getting redefinition link errors as below which is probably because Visual Studio (2010) still tries to compile the target dynamically which should no longer be the case. I guess I need to somehow tell the VS to stick to static libraries only either directly or through CMakeLists.txt (which I am not good at). Please let me know if there is any suggestions. Regards, Mehdi 1>------ Build started: Project: SimpleView, Configuration: Debug Win32 ------ 1>QtGuid4.lib(QtGuid4.dll) : error LNK2005: "public: __thiscall QSizePolicy::QSizePolicy(enum QSizePolicy::Policy,enum QSizePolicy::Policy)" (??0QSizePolicy@@QAE at W4Policy@0 at 0@Z) already defined in SimpleView.obj 1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: __thiscall QString::~QString(void)" (??1QString@@QAE at XZ) already defined in SimpleView.obj 1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: int __thiscall QSize::width(void)const " (?width at QSize@@QBEHXZ) already defined in SimpleView.obj 1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: int __thiscall QSize::height(void)const " (?height at QSize@@QBEHXZ) already defined in SimpleView.obj 1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: bool __thiscall QBasicAtomicInt::deref(void)" (?deref at QBasicAtomicInt@@QAE_NXZ) already defined in SimpleView.obj 1>SimpleView.obj : error LNK2001: unresolved external symbol "private: static class QCoreApplication * QCoreApplication::self" (?self at QCoreApplication@@0PAV1 at A) 1>moc_SimpleView.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const QMainWindow::staticMetaObject" (?staticMetaObject at QMainWindow@@2UQMetaObject@@B) 1>D:\Research\SampleCodes\SimpleView\winbin\Debug\SimpleView.exe : fatal error LNK1120: 2 unresolved externals ========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ========== On Sun, Dec 9, 2012 at 8:29 PM, John Drescher wrote: > >> Yes I already did that but the thing is that I am using QT as well for > GUI > >> stuff and as I turn off BUILD_SHARED_LIBS it dose not compile QVTK.lib > which > >> I guess it is because the my QT was compiled dynamically. > > QVTK.lib will work fine without shared libraries. I have been using > that this way for over 4 years (up to vtk-5.10.0 and Qt-4.8.4). > > John > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ob1.owk at gmail.com Mon Dec 10 01:46:34 2012 From: ob1.owk at gmail.com (Obadiah) Date: Mon, 10 Dec 2012 16:46:34 +1000 Subject: [vtkusers] QVTK Examples -- Segmentation Fault Message-ID: Hello I'm going off the QVTK RenderWindowUISingleInheritance example on the VTK page, as followed by this link http://www.vtk.org/Wiki/VTK/Examples/Cxx/Qt/RenderWindowUISingleInheritance I've built it exactly as it is, the only things changed are in the CMakeLists.txt file, where in the line TARGET_LINK_LIBRARIES( RenderWindowUI ${VTK_LIBRARIES} ) I've changed it to TARGET_LINK_LIBRARIES( RenderWindowUISingleInheritance ${VTK_LIBRARIES} ${QT_LIBRARIES} QVTK) So that it would compile. Except now, upon running the application, I get a segmentation fault. I have no idea what's going on, this is my first introduction to VTK. Any ideas? Thanks Obi -------------- next part -------------- An HTML attachment was scrubbed... URL: From ob1.owk at gmail.com Mon Dec 10 01:57:04 2012 From: ob1.owk at gmail.com (Obadiah) Date: Mon, 10 Dec 2012 16:57:04 +1000 Subject: [vtkusers] QVTK Examples -- Segmentation Fault In-Reply-To: References: Message-ID: Apologies, I'm running it on Ubuntu 11.10 On Mon, Dec 10, 2012 at 4:46 PM, Obadiah wrote: > Hello > > I'm going off the QVTK RenderWindowUISingleInheritance example on the VTK > page, as followed by this link > > http://www.vtk.org/Wiki/VTK/Examples/Cxx/Qt/RenderWindowUISingleInheritance > > I've built it exactly as it is, the only things changed are in the > CMakeLists.txt file, where in the line > > TARGET_LINK_LIBRARIES( RenderWindowUI ${VTK_LIBRARIES} ) > > I've changed it to > > TARGET_LINK_LIBRARIES( RenderWindowUISingleInheritance ${VTK_LIBRARIES} > ${QT_LIBRARIES} QVTK) > > So that it would compile. Except now, upon running the application, I get > a segmentation fault. I have no idea what's going on, this is my first > introduction to VTK. Any ideas? > > Thanks > Obi > -------------- next part -------------- An HTML attachment was scrubbed... URL: From massimo.bortolato at gmail.com Mon Dec 10 02:36:21 2012 From: massimo.bortolato at gmail.com (Massimo Bortolato) Date: Mon, 10 Dec 2012 08:36:21 +0100 Subject: [vtkusers] How to catch events from vtkContourWidget? In-Reply-To: References: Message-ID: <8BA239B5B6A647AAA118B892691C74E4@MassimoPC> Hi Alex, thank you, it works! I had already taken a look at the source code of vtkContourWidget, but what I initially tried to do was to sniff those events in a manner like this: vtkContourWidget *countour = vtkContourWidget::New(); do smth... contour->addObserver(vtkWidgetEvent::Select, myCallback); but it didn't work (and I still can't understand why...) Instead your way works fine! Thanks again, Massimo Message: 1 Date: Fri, 7 Dec 2012 14:28:20 -0800 From: Alex Malyushytskyy Subject: Re: [vtkusers] How to catch events from vtkContourWidget? To: vtkusers at vtk.org Message-ID: Content-Type: text/plain; charset=windows-1252 all events vtkContourWidget handles can be found in the source code constructor You can see related vtkCommand and vtkWidgetEvent below. // These are the event callbacks supported by this widget this->CallbackMapper->SetCallbackMethod(vtkCommand::LeftButtonPressEvent, vtkWidgetEvent::Select, this, vtkContourWidget::SelectAction); this->CallbackMapper->SetCallbackMethod(vtkCommand::RightButtonPressEvent, vtkWidgetEvent::AddFinalPoint, this, vtkContourWidget::AddFinalPointAction); this->CallbackMapper->SetCallbackMethod(vtkCommand::MouseMoveEvent, vtkWidgetEvent::Move, this, vtkContourWidget::MoveAction); this->CallbackMapper->SetCallbackMethod(vtkCommand::LeftButtonReleaseEvent, vtkWidgetEvent::EndSelect, this, vtkContourWidget::EndSelectAction); this->CallbackMapper->SetCallbackMethod(vtkCommand::KeyPressEvent, vtkEvent::NoModifier, 127, 1, "Delete", vtkWidgetEvent::Delete, this, vtkContourWidget::DeleteAction); this->CallbackMapper->SetCallbackMethod(vtkCommand::KeyPressEvent, vtkEvent::ShiftModifier, 127, 1, "Delete", vtkWidgetEvent::Reset, this, vtkContourWidget::ResetAction); this->CallbackMapper->SetCallbackMethod(vtkCommand::MiddleButtonPressEvent, vtkWidgetEvent::Translate, this, vtkContourWidget::TranslateContourAction); this->CallbackMapper->SetCallbackMethod(vtkCommand::MiddleButtonReleaseEvent, vtkWidgetEvent::EndTranslate, this, vtkContourWidget::EndSelectAction); this->CallbackMapper->SetCallbackMethod(vtkCommand::RightButtonPressEvent, vtkWidgetEvent::Scale, this, vtkContourWidget::ScaleContourAction); this->CallbackMapper->SetCallbackMethod(vtkCommand::RightButtonReleaseEvent, vtkWidgetEvent::EndScale, this, vtkContourWidget::EndSelectAction); I have not done this, so it might be better ways, but I would probably just subclass and add my own even handler doing extra things you need to be done and call original vtkContourWidget static class methods if necessary. In constructor: this->CallbackMapper->SetCallbackMethod(vtkCommand::LeftButtonPressEvent, vtkWidgetEvent::Select, this, myVtkContourWidget::MySelectAction); void myVtkContourWidgetSelectAction( vtkAbstractWidget *w ) { .... doo smth vtkContourWidget::SelectAction( w ); .... doo smth } On Fri, Dec 7, 2012 at 8:35 AM, Massimo Bortolato wrote: > Hi all, > > I need to dynamically compute (and display) the perimeter of a > vtkContourWidget, basically the same way as vtkDistanceWidget works. > So I?d like to sniff the events generated by the widget, but it seems that > there aren?t specific events associated with vtkContourWidget, or > vtkContourRepresentation. > > Does anyones of you know how I can do? > > Thanks in advance > Massimo From qt.itk.vtk.help at gmail.com Mon Dec 10 04:27:50 2012 From: qt.itk.vtk.help at gmail.com (qt.itk.vtk.help) Date: Mon, 10 Dec 2012 01:27:50 -0800 Subject: [vtkusers] Problem in reading JPEG sequence Message-ID: Hi, I am working on reading Jpeg Sequence. I have referred this post http://vtk.1045678.n5.nabble.com/Trying-to-read-a-set-of-jpg-slices-td5716283.html and modified my code as: reader->SetFilePattern("%s"); reader->SetFileDimensionality(3); reader->SetDataExtent(0,572,0,329,0,219); reader->SetFilePrefix(QFileDialog::getOpenFileName().toStdString().c_str()); reader->SetDataSpacing(3.2,3.2,20); reader->SetDataOrigin(0,0,0); reader->Update(); myInteractorStyle->SetImageViewer(imageViewer); myInteractorStyle->SetStatusMapper(sliceTextMapper); imageViewer->SetupInteractor(renderWindowInteractor); renderWindowInteractor->SetInteractorStyle(myInteractorStyle); imageViewer->GetRenderer()->AddActor2D(sliceTextActor); imageViewer->Render(); imageViewer->GetRenderer()->ResetCamera(); imageViewer->Render(); renderWindowInteractor->Start(); its reading only one image. Please help. -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Mon Dec 10 08:09:13 2012 From: daviddoria at gmail.com (David Doria) Date: Mon, 10 Dec 2012 08:09:13 -0500 Subject: [vtkusers] QVTK Examples -- Segmentation Fault In-Reply-To: References: Message-ID: >> I'm going off the QVTK RenderWindowUISingleInheritance example on the VTK >> page, as followed by this link >> >> >> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Qt/RenderWindowUISingleInheritance >> >> I've built it exactly as it is, the only things changed are in the >> CMakeLists.txt file, where in the line >> >> TARGET_LINK_LIBRARIES( RenderWindowUI ${VTK_LIBRARIES} ) >> >> I've changed it to >> >> TARGET_LINK_LIBRARIES( RenderWindowUISingleInheritance ${VTK_LIBRARIES} >> ${QT_LIBRARIES} QVTK) >> >> So that it would compile. Except now, upon running the application, I get >> a segmentation fault. I have no idea what's going on, this is my first >> introduction to VTK. Any ideas? Welcome to VTK! Which version of VTK are you using? I would suggest starting with a non-Qt example, like this one: http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/Sphere If it runs fine for you, then we'll know that there is no problem with your VTK install. David From acsantome at gmail.com Mon Dec 10 08:15:53 2012 From: acsantome at gmail.com (Adri CS) Date: Mon, 10 Dec 2012 14:15:53 +0100 Subject: [vtkusers] About threads Message-ID: Hello everyone, I have two questions regarding threads and the VTK library. 1. I'm using the PCL library and its visualization module (specifically, the PCLVisualizer class) runs over VTK. When instantiating a new PCLVisualizer object, does the VTK underlying create a new thread to run that object or everything happens in the main thread?. 2. If a new thread is created, is there a way to access that thread and manipulate it?. Thanks!. -------------- next part -------------- An HTML attachment was scrubbed... URL: From drescherjm at gmail.com Mon Dec 10 08:54:31 2012 From: drescherjm at gmail.com (John Drescher) Date: Mon, 10 Dec 2012 08:54:31 -0500 Subject: [vtkusers] Static Link VTK In-Reply-To: References: Message-ID: On Mon, Dec 10, 2012 at 12:59 AM, Mehdi Esteghamatian wrote: > Yes your right it should be fine although I am not getting it right yet. My > previous qt was compiled dynamically. So, I still had to put QT dlls in the > target folder. > > Now I compiled the qt statically which is a bit confusing because It did not > create separate folders for statics and dynamic libraries, so now things > look like below in lib folder (D:\...\QT\4.8.4\lib). For every library I > have 4 versions. for example for QTCore I have the followings > > QtCore.lib -> static release > QtCored.lib -> static debug > QtCore.lib -> dynamic rlease > QtCore.lib -> dynamic debug > > NOW the problem is that I am getting redefinition link errors as below which > is probably because Visual Studio (2010) still tries to compile the target > dynamically which should no longer be the case. > > I guess I need to somehow tell the VS to stick to static libraries only > either directly or through CMakeLists.txt (which I am not good at). > > Please let me know if there is any suggestions. > > Regards, > > Mehdi > > > 1>------ Build started: Project: SimpleView, Configuration: Debug Win32 > ------ > 1>QtGuid4.lib(QtGuid4.dll) : error LNK2005: "public: __thiscall > QSizePolicy::QSizePolicy(enum QSizePolicy::Policy,enum QSizePolicy::Policy)" > (??0QSizePolicy@@QAE at W4Policy@0 at 0@Z) already defined in SimpleView.obj > 1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: __thiscall > QString::~QString(void)" (??1QString@@QAE at XZ) already defined in > SimpleView.obj > 1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: int __thiscall > QSize::width(void)const " (?width at QSize@@QBEHXZ) already defined in > SimpleView.obj > 1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: int __thiscall > QSize::height(void)const " (?height at QSize@@QBEHXZ) already defined in > SimpleView.obj > 1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: bool __thiscall > QBasicAtomicInt::deref(void)" (?deref at QBasicAtomicInt@@QAE_NXZ) already > defined in SimpleView.obj > 1>SimpleView.obj : error LNK2001: unresolved external symbol "private: > static class QCoreApplication * QCoreApplication::self" > (?self at QCoreApplication@@0PAV1 at A) > 1>moc_SimpleView.obj : error LNK2001: unresolved external symbol "public: > static struct QMetaObject const QMainWindow::staticMetaObject" > (?staticMetaObject at QMainWindow@@2UQMetaObject@@B) > 1>D:\Research\SampleCodes\SimpleView\winbin\Debug\SimpleView.exe : fatal > error LNK1120: 2 unresolved externals > ========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ========== Did you clean you build and also regenerate the visual studio solution using CMake-gui? John From craig.henderson at intelligentultrasound.com Mon Dec 10 09:01:57 2012 From: craig.henderson at intelligentultrasound.com (Craig Henderson) Date: Mon, 10 Dec 2012 14:01:57 -0000 Subject: [vtkusers] Mouse interaction with Reslice Cursor in multiple viewports Message-ID: <007401cdd6de$eb660d30$c2322790$@intelligentultrasound.com> I have a single window divided into 4 equally-size viewports. Three viewports are used to display image planes with a Reslice Cursor Widget and associated classes to provide plane lines and reslicing functionality. All is working nicely except for when plane lines in two adjacent viewports are aligned. In this case, the cursor hittest picks up the plane line in the "first" viewport (in creation order), even if the mouse is in the other viewport. The line is cropped correctly to the viewport. The wrong plane reslice then results. Do I need to set a viewport on the widget, line representation or other? It seems the hittest is on the plane line representation and not the plane line segment displayed in the viewport. Any suggestion welcomed. Many thanks -- Craig -------------- next part -------------- An HTML attachment was scrubbed... URL: From mehdiesteghamat at gmail.com Mon Dec 10 10:07:20 2012 From: mehdiesteghamat at gmail.com (Mehdi Esteghamatian) Date: Mon, 10 Dec 2012 10:07:20 -0500 Subject: [vtkusers] Static Link VTK In-Reply-To: References: Message-ID: Yes many times. On Mon, Dec 10, 2012 at 8:54 AM, John Drescher wrote: > On Mon, Dec 10, 2012 at 12:59 AM, Mehdi Esteghamatian > wrote: > > Yes your right it should be fine although I am not getting it right yet. > My > > previous qt was compiled dynamically. So, I still had to put QT dlls in > the > > target folder. > > > > Now I compiled the qt statically which is a bit confusing because It did > not > > create separate folders for statics and dynamic libraries, so now things > > look like below in lib folder (D:\...\QT\4.8.4\lib). For every library I > > have 4 versions. for example for QTCore I have the followings > > > > QtCore.lib -> static release > > QtCored.lib -> static debug > > QtCore.lib -> dynamic rlease > > QtCore.lib -> dynamic debug > > > > NOW the problem is that I am getting redefinition link errors as below > which > > is probably because Visual Studio (2010) still tries to compile the > target > > dynamically which should no longer be the case. > > > > I guess I need to somehow tell the VS to stick to static libraries only > > either directly or through CMakeLists.txt (which I am not good at). > > > > Please let me know if there is any suggestions. > > > > Regards, > > > > Mehdi > > > > > > 1>------ Build started: Project: SimpleView, Configuration: Debug Win32 > > ------ > > 1>QtGuid4.lib(QtGuid4.dll) : error LNK2005: "public: __thiscall > > QSizePolicy::QSizePolicy(enum QSizePolicy::Policy,enum > QSizePolicy::Policy)" > > (??0QSizePolicy@@QAE at W4Policy@0 at 0@Z) already defined in SimpleView.obj > > 1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: __thiscall > > QString::~QString(void)" (??1QString@@QAE at XZ) already defined in > > SimpleView.obj > > 1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: int __thiscall > > QSize::width(void)const " (?width at QSize@@QBEHXZ) already defined in > > SimpleView.obj > > 1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: int __thiscall > > QSize::height(void)const " (?height at QSize@@QBEHXZ) already defined in > > SimpleView.obj > > 1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: bool __thiscall > > QBasicAtomicInt::deref(void)" (?deref at QBasicAtomicInt@@QAE_NXZ) already > > defined in SimpleView.obj > > 1>SimpleView.obj : error LNK2001: unresolved external symbol "private: > > static class QCoreApplication * QCoreApplication::self" > > (?self at QCoreApplication@@0PAV1 at A) > > 1>moc_SimpleView.obj : error LNK2001: unresolved external symbol "public: > > static struct QMetaObject const QMainWindow::staticMetaObject" > > (?staticMetaObject at QMainWindow@@2UQMetaObject@@B) > > 1>D:\Research\SampleCodes\SimpleView\winbin\Debug\SimpleView.exe : fatal > > error LNK1120: 2 unresolved externals > > ========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped > ========== > > Did you clean you build and also regenerate the visual studio solution > using CMake-gui? > > John > -------------- next part -------------- An HTML attachment was scrubbed... URL: From acsantome at gmail.com Mon Dec 10 12:51:26 2012 From: acsantome at gmail.com (a.c.sant) Date: Mon, 10 Dec 2012 09:51:26 -0800 (PST) Subject: [vtkusers] About threads In-Reply-To: References: Message-ID: <1355161886388-5717522.post@n5.nabble.com> Hello?. This is really important!!. Please! -- View this message in context: http://vtk.1045678.n5.nabble.com/About-threads-tp5717517p5717522.html Sent from the VTK - Users mailing list archive at Nabble.com. From akini at synapticon.com Mon Dec 10 13:57:01 2012 From: akini at synapticon.com (Anup Kini) Date: Mon, 10 Dec 2012 19:57:01 +0100 Subject: [vtkusers] Cross Compiling VTK 5.0.8 with Code Sourcery Toolchain for ARM A9! Message-ID: Dear All, I am trying to cross compile VTK for ARM Cortex A9. I end up with the following error. [ 0%] Built target vtksys [ 0%] Building C object Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/adler32.c.o [ 0%] Building C object Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/compress.c.o [ 0%] Building C object Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/crc32.c.o [ 0%] Building C object Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/deflate.c.o [ 0%] Building C object Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/gzio.c.o [ 0%] Building C object Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/inffast.c.o [ 0%] Building C object Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/inflate.c.o [ 0%] Building C object Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/inftrees.c.o [ 0%] Building C object Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/trees.c.o [ 0%] Building C object Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/uncompr.c.o [ 1%] Building C object Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/zutil.c.o Linking C static library ../../bin/libvtkzlib.a [ 1%] Built target vtkzlib [ 1%] Building C object Utilities/vtkhdf5/src/CMakeFiles/H5detect.dir/H5detect.c.o Linking C executable ../../../bin/H5detect [ 1%] Built target H5detect [ 1%] Building C object Utilities/vtkhdf5/src/CMakeFiles/H5make_libsettings.dir/H5make_libsettings.c.o Linking C executable ../../../bin/H5make_libsettings [ 1%] Built target H5make_libsettings [ 1%] Generating ../H5lib_settings.c *../../../bin/H5make_libsettings: 1: ../../../bin/H5make_libsettings: Syntax error: word unexpected (expecting ")")* *make[2]: *** [Utilities/vtkhdf5/H5lib_settings.c] Error 2* *make[1]: *** [Utilities/vtkhdf5/src/CMakeFiles/vtkhdf5.dir/all] Error 2* *make: *** [all] Error 2* Kindly let me know if there is any solution for the above error. -- *Anup Kini *Systems Engineer**** * ------------------------------ * *Synapticon** * | Cyber-Physical System Solutions **** Direct:**** +49 7335 / 186 999 17**** Fax:**** +49 7335 / 186 999 19**** **** **** synapticon.com | @synapticon_co **** Synapticon GmbH | Hohlbachweg 2 | 73344 Gruibingen, DE Secretary +49 7335 / 186 999 0 | General Manager: Nikolai Ensslen Registry Court Ulm HRB 725114 | USt-ID DE271647127**** This message and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. Please notify the sender immediately if you have received this e-mail by mistake and delete it from your system. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan.kushnar at gmail.com Mon Dec 10 15:21:51 2012 From: ivan.kushnar at gmail.com (IvanKushnar) Date: Mon, 10 Dec 2012 12:21:51 -0800 (PST) Subject: [vtkusers] How to set colors for contour edges? In-Reply-To: References: <1329382079768-5488892.post@n5.nabble.com> Message-ID: <1355170911434-5717524.post@n5.nabble.com> Jothy wrote > I don't know how to set different colors to different parts of the > contour, > but you could set the edge color like this > > Actor->GetProperty()->EdgeVisibilityOn(); > > *Actor->GetProperty()->SetEdgeColor(1,0,1); > > Jothy > * Thank you. Could you tell please how set edge color that it remains the same in wireframe mode. for example: solid - red edges - white. With this methods in wireframe mode edges get red color. I'd like that they stay white, -- View this message in context: http://vtk.1045678.n5.nabble.com/How-to-set-colors-for-contour-edges-tp5488892p5717524.html Sent from the VTK - Users mailing list archive at Nabble.com. From david.gobbi at gmail.com Mon Dec 10 15:39:35 2012 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 10 Dec 2012 13:39:35 -0700 Subject: [vtkusers] Cross Compiling VTK 5.0.8 with Code Sourcery Toolchain for ARM A9! In-Reply-To: References: Message-ID: Hi Anup, Cross compilation of VTK is a very advanced topic. I've never cross-compiled VTK myself, so I definitely won't have all the answers, but I can give some pointers. You can see the reason for the failure here: Linking C executable ../../../bin/H5make_libsettings [ 1%] Built target H5make_libsettings [ 1%] Generating ../H5lib_settings.c *../../../bin/H5make_libsettings: 1: ../../../bin/H5make_libsettings: Syntax error: word unexpected (expecting ")")* CMake is building an executable "H5make_libsettings" and is then trying to run it on your host... but of course this executable was compiled for your target and cannot run on your host. The VTK build uses a few of these little custom executables as part of its build process. To do a cross-compile, you first need to do a native compile on your host machine to compile all of these little build tools. Don't ask me to list them all... I don't have such a list. Then, when you do your cross-compile (after you've done the native compile), you need to make sure that the natively-built executables that are needed during the build used in place of the cross-compiled ones. The following web page might help: http://www.vtk.org/Wiki/CMake_Cross_Compiling That's about all the help I can give... good luck. - David On Mon, Dec 10, 2012 at 11:57 AM, Anup Kini wrote: > Dear All, > > I am trying to cross compile VTK for ARM Cortex A9. > I end up with the following error. > > [ 0%] Built target vtksys > [ 0%] Building C object > Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/adler32.c.o > [ 0%] Building C object > Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/compress.c.o > [ 0%] Building C object Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/crc32.c.o > [ 0%] Building C object > Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/deflate.c.o > [ 0%] Building C object Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/gzio.c.o > [ 0%] Building C object > Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/inffast.c.o > [ 0%] Building C object > Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/inflate.c.o > [ 0%] Building C object > Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/inftrees.c.o > [ 0%] Building C object Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/trees.c.o > [ 0%] Building C object > Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/uncompr.c.o > [ 1%] Building C object Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/zutil.c.o > Linking C static library ../../bin/libvtkzlib.a > [ 1%] Built target vtkzlib > [ 1%] Building C object > Utilities/vtkhdf5/src/CMakeFiles/H5detect.dir/H5detect.c.o > Linking C executable ../../../bin/H5detect > [ 1%] Built target H5detect > [ 1%] Building C object > Utilities/vtkhdf5/src/CMakeFiles/H5make_libsettings.dir/H5make_libsettings.c.o > Linking C executable ../../../bin/H5make_libsettings > [ 1%] Built target H5make_libsettings > [ 1%] Generating ../H5lib_settings.c > *../../../bin/H5make_libsettings: 1: ../../../bin/H5make_libsettings: > Syntax error: word unexpected (expecting ")")* > *make[2]: *** [Utilities/vtkhdf5/H5lib_settings.c] Error 2* > *make[1]: *** [Utilities/vtkhdf5/src/CMakeFiles/vtkhdf5.dir/all] Error 2* > *make: *** [all] Error 2* > > > Kindly let me know if there is any solution for the above error. > > -- > > *Anup Kini > *Systems Engineer**** > * > ------------------------------ > * > > *Synapticon** * | Cyber-Physical System Solutions **** > > Direct:**** > > +49 7335 / 186 999 17**** > > Fax:**** > > +49 7335 / 186 999 19**** > > **** > > **** > > synapticon.com | @synapticon_co > **** > > Synapticon GmbH | Hohlbachweg 2 | 73344 Gruibingen, DE > Secretary +49 7335 / 186 999 0 | General Manager: Nikolai Ensslen > Registry Court Ulm HRB 725114 | USt-ID DE271647127**** > > This message and any files transmitted with it are confidential and > intended > solely for the use of the individual or entity to whom they are addressed. > Please notify the sender immediately if you have received this e-mail by > mistake and delete it from your system. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ferlandm at sonatest.com Mon Dec 10 16:25:14 2012 From: ferlandm at sonatest.com (Marc Ferland) Date: Mon, 10 Dec 2012 16:25:14 -0500 Subject: [vtkusers] Cross Compiling VTK 5.0.8 with Code Sourcery Toolchain for ARM A9! In-Reply-To: (David Gobbi's message of "Mon, 10 Dec 2012 13:39:35 -0700") References: Message-ID: <87a9tlwqf9.fsf@sonatest.com> David Gobbi writes: > Hi Anup, > > > Cross compilation of VTK is a very advanced topic. ?I've > never?cross-compiled VTK myself, so I definitely won't have all the > answers, but I can give some pointers. > > You can see the reason for the failure here: > > Linking C executable ../../../bin/H5make_libsettings > [ ?1%] Built target H5make_libsettings > [ ?1%] Generating ../H5lib_settings.c > ../../../bin/H5make_libsettings: 1: ../../../bin/H5make_libsettings: > Syntax error: word unexpected (expecting ")") > > CMake is building an executable "H5make_libsettings" and is then > trying to run it on your host... but of course this executable was > compiled for your target and cannot run on your host. ?The VTK build > uses a few of these little custom executables as part of its build > process. > > To do a cross-compile, you first need to do a native compile on your > host machine to compile all of these little build tools. ?Don't ask me > to list them all... I don't have such a list. ?Then, when you do your > cross-compile (after you've done the native compile), you need to make > sure that the natively-built executables that are needed during the > build used in place of the cross-compiled ones. ?The following web > page might help: > > http://www.vtk.org/Wiki/CMake_Cross_Compiling > > That's about all the help I can give... good luck. > I think the tools are: lproj ProcessShader vtkEncodeString vtkmkg3states H5detect H5make_libsettings vtkParseOGLExt vtksysEncodeExecutable As David said you'll first have to do a native build. To make building these tools a little easier you could try this patch: http://www.vtk.org/Bug/view.php?id=12686 Also, if you happen to be using yocto or openembedded I have recipe files that can cross-compile vtk. Cheers, Marc From jd379252 at gmail.com Mon Dec 10 17:04:14 2012 From: jd379252 at gmail.com (pof) Date: Mon, 10 Dec 2012 23:04:14 +0100 Subject: [vtkusers] Bug in vtkStripper on a very simple case ? (confirmed) Message-ID: <50C65C5E.2020206@gmail.com> Dear vtk'ers, I confirm that I found a bug in vtkStripper, which in some cases does not produce the expected result. In this simple example (polydata0.vtk file), 5 segments are defined, and they do define unambiguously a single polyline: /////// # vtk DataFile Version 3.0 vtk output ASCII DATASET POLYDATA POINTS 6 float 1.7 0.5 0 2 0 0 1.7 -0.5 0 1.6 -1 0 1.8 -0.2 0 1.6 1 0 LINES 5 15 2 0 1 2 2 3 2 4 2 2 1 4 2 5 0 /////// When this polydata is processed through the vtkStripper, the first four segments are merged, but the last segment remains unmerged (see the last section of the polydata1.vtk file below) : LINES 2 9 5 0 1 4 2 3 2 5 0 Strangely, if the polydata is modified by defining the segment (2 5 0) as the first segment, then vtkStripper succeed to merge the 5 segments (see the last section below) : LINES 1 7 6 5 0 1 4 2 3 Herebelow is the code used to reproduce this data and the described bug. Any idea why vtkStripper does not behave correctly in this case? Thanks JD -------------------------------------- #include #include #include #include #include int main(int argc, char *argv[]) { vtkSmartPointer Points = vtkSmartPointer::New(); // Create 6 points Points->InsertNextPoint(1.7, 0.5, 0); Points->InsertNextPoint(2.0, 0, 0); Points->InsertNextPoint(1.7, -0.5, 0); Points->InsertNextPoint(1.6, -1, 0); Points->InsertNextPoint(1.8, -0.2, 0); Points->InsertNextPoint(1.6, 1, 0); vtkSmartPointer Segments = vtkSmartPointer::New(); // Create line segment #0 Segments->InsertNextCell(2); Segments->InsertCellPoint(0); Segments->InsertCellPoint(1); // Create line segment #1 Segments->InsertNextCell(2); Segments->InsertCellPoint(2); Segments->InsertCellPoint(3); // Create line segment #2 Segments->InsertNextCell(2); Segments->InsertCellPoint(4); Segments->InsertCellPoint(2); // Create line segment #3 Segments->InsertNextCell(2); Segments->InsertCellPoint(1); Segments->InsertCellPoint(4); // Create line segment #4 Segments->InsertNextCell(2); Segments->InsertCellPoint(5); Segments->InsertCellPoint(0); // Create the polydata from points and faces vtkSmartPointer SegPD = vtkSmartPointer::New(); SegPD->SetPoints(Points); SegPD->SetLines(Segments); SegPD->Update(); // Try to get the polyline (there should be 1) from the segments vtkSmartPointer stripper = vtkSmartPointer::New(); stripper->SetInputConnection(SegPD->GetProducerPort()); stripper->Update(); vtkSmartPointer wr = vtkSmartPointer::New(); // Save the original polydata on a vtk file wr->SetFileName("D:\\polylines0.vtk"); wr->SetInputConnection(SegPD->GetProducerPort()); wr->Write(); // Save the filtered polydata on a vtk file wr->SetFileName("D:\\polylines1.vtk"); wr->SetInputConnection(stripper->GetOutputPort()); wr->Write(); return EXIT_SUCCESS; } -------------------------------------- From alexmalvtk at gmail.com Mon Dec 10 18:44:57 2012 From: alexmalvtk at gmail.com (Alex Malyushytskyy) Date: Mon, 10 Dec 2012 15:44:57 -0800 Subject: [vtkusers] About threads In-Reply-To: <1355161886388-5717522.post@n5.nabble.com> References: <1355161886388-5717522.post@n5.nabble.com> Message-ID: Hello? You are expecting too much from public list. Consider hiring someone knowledgeable in the area if you want quick answers. But even so I am sure that your question less important for me than my lunch I can tell you that vtk does not create any additional threats itself. I do not think PCLVisualizer is part of vtk, even if it was using vtk (which I have no idea about) you will have to look in the different place for help related to it. Alex On Mon, Dec 10, 2012 at 9:51 AM, a.c.sant wrote: > Hello?. This is really important!!. Please! > > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/About-threads-tp5717517p5717522.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://www.vtk.org/mailman/listinfo/vtkusers From alexmalvtk at gmail.com Mon Dec 10 19:05:02 2012 From: alexmalvtk at gmail.com (Alex Malyushytskyy) Date: Mon, 10 Dec 2012 16:05:02 -0800 Subject: [vtkusers] Static Link VTK In-Reply-To: References: Message-ID: Possible problem - "Static" Qt build is mostly likely using CRT dlls unless you manually edited project options. This means you can't link static VTK (using static CRTs with suck Qt). In fact you still have to link VTK as dlls. I do no think nice solution exists. Some people claim that they were able to link Qt vs static CRTs. I personally tried this hard with Qt 4.5 and even though my application was running I had some problems with some cases ( from the top of my head setting specific item in combobox was giving access violation) But if you manage to do this and would not have any problem with Qt you can build static version of vtk and you will get wehat you want. Otherwise all you can get rid of - Qt dlls. Even though QT is build as 'static' libraries it will be linked against dynamic CRTs which will force you to provide such CRTs as dependencies and unless you can link static VTK vs dynamic CRTS ( I am not sure how easy is it) you will have to build vtk as dlls. Alex On Mon, Dec 10, 2012 at 7:07 AM, Mehdi Esteghamatian wrote: > Yes many times. > > On Mon, Dec 10, 2012 at 8:54 AM, John Drescher wrote: >> >> On Mon, Dec 10, 2012 at 12:59 AM, Mehdi Esteghamatian >> wrote: >> > Yes your right it should be fine although I am not getting it right yet. >> > My >> > previous qt was compiled dynamically. So, I still had to put QT dlls in >> > the >> > target folder. >> > >> > Now I compiled the qt statically which is a bit confusing because It did >> > not >> > create separate folders for statics and dynamic libraries, so now >> > things >> > look like below in lib folder (D:\...\QT\4.8.4\lib). For every library I >> > have 4 versions. for example for QTCore I have the followings >> > >> > QtCore.lib -> static release >> > QtCored.lib -> static debug >> > QtCore.lib -> dynamic rlease >> > QtCore.lib -> dynamic debug >> > >> > NOW the problem is that I am getting redefinition link errors as below >> > which >> > is probably because Visual Studio (2010) still tries to compile the >> > target >> > dynamically which should no longer be the case. >> > >> > I guess I need to somehow tell the VS to stick to static libraries only >> > either directly or through CMakeLists.txt (which I am not good at). >> > >> > Please let me know if there is any suggestions. >> > >> > Regards, >> > >> > Mehdi >> > >> > >> > 1>------ Build started: Project: SimpleView, Configuration: Debug Win32 >> > ------ >> > 1>QtGuid4.lib(QtGuid4.dll) : error LNK2005: "public: __thiscall >> > QSizePolicy::QSizePolicy(enum QSizePolicy::Policy,enum >> > QSizePolicy::Policy)" >> > (??0QSizePolicy@@QAE at W4Policy@0 at 0@Z) already defined in SimpleView.obj >> > 1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: __thiscall >> > QString::~QString(void)" (??1QString@@QAE at XZ) already defined in >> > SimpleView.obj >> > 1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: int __thiscall >> > QSize::width(void)const " (?width at QSize@@QBEHXZ) already defined in >> > SimpleView.obj >> > 1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: int __thiscall >> > QSize::height(void)const " (?height at QSize@@QBEHXZ) already defined in >> > SimpleView.obj >> > 1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: bool __thiscall >> > QBasicAtomicInt::deref(void)" (?deref at QBasicAtomicInt@@QAE_NXZ) already >> > defined in SimpleView.obj >> > 1>SimpleView.obj : error LNK2001: unresolved external symbol "private: >> > static class QCoreApplication * QCoreApplication::self" >> > (?self at QCoreApplication@@0PAV1 at A) >> > 1>moc_SimpleView.obj : error LNK2001: unresolved external symbol >> > "public: >> > static struct QMetaObject const QMainWindow::staticMetaObject" >> > (?staticMetaObject at QMainWindow@@2UQMetaObject@@B) >> > 1>D:\Research\SampleCodes\SimpleView\winbin\Debug\SimpleView.exe : fatal >> > error LNK1120: 2 unresolved externals >> > ========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped >> > ========== >> >> Did you clean you build and also regenerate the visual studio solution >> using CMake-gui? >> >> John > > > > _______________________________________________ > 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://www.vtk.org/mailman/listinfo/vtkusers > From ob1.owk at gmail.com Mon Dec 10 19:48:15 2012 From: ob1.owk at gmail.com (Obadiah) Date: Tue, 11 Dec 2012 10:48:15 +1000 Subject: [vtkusers] QVTK Examples -- Segmentation Fault In-Reply-To: References: Message-ID: Thanks for the reply! I'm using VTK 5.10, the latest version as downloaded from the website. The Sphere example works fine, but the QVTK single (and multiple) inheritance examples still give segmentation faults. I'm going off these examples because I need to use QVTK to merge Qt and PCL Visualizer (but I'm still pretty new so it's a learning process) On Mon, Dec 10, 2012 at 11:09 PM, David Doria wrote: > >> I'm going off the QVTK RenderWindowUISingleInheritance example on the > VTK > >> page, as followed by this link > >> > >> > >> > http://www.vtk.org/Wiki/VTK/Examples/Cxx/Qt/RenderWindowUISingleInheritance > >> > >> I've built it exactly as it is, the only things changed are in the > >> CMakeLists.txt file, where in the line > >> > >> TARGET_LINK_LIBRARIES( RenderWindowUI ${VTK_LIBRARIES} ) > >> > >> I've changed it to > >> > >> TARGET_LINK_LIBRARIES( RenderWindowUISingleInheritance ${VTK_LIBRARIES} > >> ${QT_LIBRARIES} QVTK) > >> > >> So that it would compile. Except now, upon running the application, I > get > >> a segmentation fault. I have no idea what's going on, this is my first > >> introduction to VTK. Any ideas? > > Welcome to VTK! > > Which version of VTK are you using? > > I would suggest starting with a non-Qt example, like this one: > http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/Sphere > > If it runs fine for you, then we'll know that there is no problem with > your VTK install. > > David > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mehdiesteghamat at gmail.com Mon Dec 10 21:06:14 2012 From: mehdiesteghamat at gmail.com (Mehdi Esteghamatian) Date: Mon, 10 Dec 2012 21:06:14 -0500 Subject: [vtkusers] Static Link VTK In-Reply-To: References: Message-ID: Dear Alex, Thanks for the response. I did not know about CRTs I am not too sure it can affect the static compilations. Is it recommended for Win32 machines because I am running it on Vista and MSVC 2010. I will probably clean up everthing do it again see if I can understand what is going on :) Cheers, Mehdi On Mon, Dec 10, 2012 at 7:05 PM, Alex Malyushytskyy wrote: > Possible problem - "Static" Qt build is mostly likely using CRT dlls > unless you manually edited project options. This means you can't link > static VTK (using static CRTs with suck Qt). In fact you still have to > link VTK as dlls. > > I do no think nice solution exists. Some people claim that they were > able to link Qt vs static CRTs. I personally tried this hard with Qt > 4.5 > and even though my application was running I had some problems with > some cases ( from the top of my head setting specific item in combobox > was giving access violation) > > But if you manage to do this and would not have any problem with Qt > you can build static version of vtk and you will get wehat you want. > Otherwise all you can get rid of - Qt dlls. Even though QT is build as > 'static' libraries it will be linked against dynamic CRTs which will > force you to provide such CRTs as dependencies and unless you can link > static VTK vs dynamic CRTS ( I am not sure how easy is it) you will > have to build vtk as dlls. > > Alex > > On Mon, Dec 10, 2012 at 7:07 AM, Mehdi Esteghamatian > wrote: > > Yes many times. > > > > On Mon, Dec 10, 2012 at 8:54 AM, John Drescher > wrote: > >> > >> On Mon, Dec 10, 2012 at 12:59 AM, Mehdi Esteghamatian > >> wrote: > >> > Yes your right it should be fine although I am not getting it right > yet. > >> > My > >> > previous qt was compiled dynamically. So, I still had to put QT dlls > in > >> > the > >> > target folder. > >> > > >> > Now I compiled the qt statically which is a bit confusing because It > did > >> > not > >> > create separate folders for statics and dynamic libraries, so now > >> > things > >> > look like below in lib folder (D:\...\QT\4.8.4\lib). For every > library I > >> > have 4 versions. for example for QTCore I have the followings > >> > > >> > QtCore.lib -> static release > >> > QtCored.lib -> static debug > >> > QtCore.lib -> dynamic rlease > >> > QtCore.lib -> dynamic debug > >> > > >> > NOW the problem is that I am getting redefinition link errors as below > >> > which > >> > is probably because Visual Studio (2010) still tries to compile the > >> > target > >> > dynamically which should no longer be the case. > >> > > >> > I guess I need to somehow tell the VS to stick to static libraries > only > >> > either directly or through CMakeLists.txt (which I am not good at). > >> > > >> > Please let me know if there is any suggestions. > >> > > >> > Regards, > >> > > >> > Mehdi > >> > > >> > > >> > 1>------ Build started: Project: SimpleView, Configuration: Debug > Win32 > >> > ------ > >> > 1>QtGuid4.lib(QtGuid4.dll) : error LNK2005: "public: __thiscall > >> > QSizePolicy::QSizePolicy(enum QSizePolicy::Policy,enum > >> > QSizePolicy::Policy)" > >> > (??0QSizePolicy@@QAE at W4Policy@0 at 0@Z) already defined in > SimpleView.obj > >> > 1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: __thiscall > >> > QString::~QString(void)" (??1QString@@QAE at XZ) already defined in > >> > SimpleView.obj > >> > 1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: int __thiscall > >> > QSize::width(void)const " (?width at QSize@@QBEHXZ) already defined in > >> > SimpleView.obj > >> > 1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: int __thiscall > >> > QSize::height(void)const " (?height at QSize@@QBEHXZ) already defined in > >> > SimpleView.obj > >> > 1>QtCored4.lib(QtCored4.dll) : error LNK2005: "public: bool __thiscall > >> > QBasicAtomicInt::deref(void)" (?deref at QBasicAtomicInt@@QAE_NXZ) > already > >> > defined in SimpleView.obj > >> > 1>SimpleView.obj : error LNK2001: unresolved external symbol "private: > >> > static class QCoreApplication * QCoreApplication::self" > >> > (?self at QCoreApplication@@0PAV1 at A) > >> > 1>moc_SimpleView.obj : error LNK2001: unresolved external symbol > >> > "public: > >> > static struct QMetaObject const QMainWindow::staticMetaObject" > >> > (?staticMetaObject at QMainWindow@@2UQMetaObject@@B) > >> > 1>D:\Research\SampleCodes\SimpleView\winbin\Debug\SimpleView.exe : > fatal > >> > error LNK1120: 2 unresolved externals > >> > ========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped > >> > ========== > >> > >> Did you clean you build and also regenerate the visual studio solution > >> using CMake-gui? > >> > >> John > > > > > > > > _______________________________________________ > > 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://www.vtk.org/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://www.vtk.org/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From drescherjm at gmail.com Mon Dec 10 21:39:02 2012 From: drescherjm at gmail.com (John Drescher) Date: Mon, 10 Dec 2012 21:39:02 -0500 Subject: [vtkusers] Static Link VTK In-Reply-To: References: Message-ID: > Thanks for the response. I did not know about CRTs I am not too sure it can > affect the static compilations. > I can tell you that I have never used static Qt with my static vtk because the open source Qt license prohibits you from compiling Qt statically. Well at least it did the last time I checked. > Is it recommended for Win32 machines because I am running it on Vista and > MSVC 2010. > > I will probably clean up everthing do it again see if I can understand what > is going on :) Did you ever execute the INSTALL target for VTK? If so make sure CMake is finding the correct VTK_DIR. John From daviddoria at gmail.com Mon Dec 10 22:13:39 2012 From: daviddoria at gmail.com (David Doria) Date: Mon, 10 Dec 2012 22:13:39 -0500 Subject: [vtkusers] QVTK Examples -- Segmentation Fault In-Reply-To: References: Message-ID: On Mon, Dec 10, 2012 at 7:48 PM, Obadiah wrote: > because I need to use QVTK to Work on this has probably already been done (see http://www.pointclouds.org/blog/gsoc12/jpapon/index.php). You might want to check that out before you reinvent the wheel. Also, can you please step through the example code with a debugger and tell us where it is segfaulting. David From ob1.owk at gmail.com Mon Dec 10 23:25:51 2012 From: ob1.owk at gmail.com (Obadiah) Date: Tue, 11 Dec 2012 14:25:51 +1000 Subject: [vtkusers] QVTK Examples -- Segmentation Fault In-Reply-To: References: Message-ID: I was using the example so I could have something to base my actual code off, but while working on something else I had to fix some problem and it took me right back to this. So I put something vaguely similar in my own code and had a segmentation error again but it turned out to be: QHBoxLayout *hlayout; had to be QHBoxLayout *hlayout = new QHBoxLayout(); instead. So it should be all fixed now, but thanks for the assistance. And thank you for that link, I'll look through it now. Best regards Obi On Tue, Dec 11, 2012 at 1:13 PM, David Doria wrote: > On Mon, Dec 10, 2012 at 7:48 PM, Obadiah wrote: > > because I need to use QVTK to > > Work on this has probably already been done (see > http://www.pointclouds.org/blog/gsoc12/jpapon/index.php). You might > want to check that out before you reinvent the wheel. > > Also, can you please step through the example code with a debugger and > tell us where it is segfaulting. > > David > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.gabriel at 4plus.de Tue Dec 11 02:58:47 2012 From: adrian.gabriel at 4plus.de (Najzero) Date: Mon, 10 Dec 2012 23:58:47 -0800 (PST) Subject: [vtkusers] About threads In-Reply-To: <1355161886388-5717522.post@n5.nabble.com> References: <1355161886388-5717522.post@n5.nabble.com> Message-ID: <1355212727900-5717536.post@n5.nabble.com> Well, because its important, its in the FAQ: http://www.vtk.org/Wiki/VTK/FAQ#Is_VTK_thread-safe_.3F VTK is not thread safe, and by that its not pretty common for vtk to spawn more than one threads then. But that is only my small (never had a thread problem) knownlegde about threads in vtk (reading it once in the faq) Best regards Adrian -- View this message in context: http://vtk.1045678.n5.nabble.com/About-threads-tp5717517p5717536.html Sent from the VTK - Users mailing list archive at Nabble.com. From henry.lehmann at informatik.tu-freiberg.de Tue Dec 11 03:07:31 2012 From: henry.lehmann at informatik.tu-freiberg.de (Henry Lehmann) Date: Tue, 11 Dec 2012 09:07:31 +0100 Subject: [vtkusers] vtkSmartPointer ReferenceCount Behavior In-Reply-To: References: Message-ID: <50C6E9C3.8010607@informatik.tu-freiberg.de> Hello all, i am using vtkSmartPointer and am encountering a strange problem. to illustrate the problem i wrote following code. please correct my comments, if they are wrong. --- #include #include #include #include #include #include int main(int argc, char* args[]) { using namespace std; vtkNew source; vtkNew sink; sink->SetFileName("abc.vtp"); vtkSmartPointer pass_ptr; { // create new instance with refcount 1 vtkNew pass; cout << pass->GetReferenceCount() << endl; // 1 // increase refcount by assiging to smartptr pass_ptr = pass.GetPointer(); cout << pass_ptr->GetReferenceCount() << endl; // 2 } // vtkNew instance goes out of scope and decreases refcounter cout << pass_ptr->GetReferenceCount() << endl; // 1 // connect object to pipeline increases refcounter pass_ptr->SetInputConnection(source->GetOutputPort()); cout << pass_ptr->GetReferenceCount() << endl; // 2 // connect object to pipeline increases refcounter sink->SetInputConnection(pass_ptr->GetOutputPort()); cout << pass_ptr->GetReferenceCount() << endl; // 2, why not 3? // disconnect object from pipeline decreases refcounter, but does not do it pass_ptr->RemoveAllInputConnections(0); cout << pass_ptr->GetReferenceCount() << endl; // 2 // disconnect object from pipeline decreases refcounter, but does not do it sink->RemoveAllInputConnections(0); cout << pass_ptr->GetReferenceCount() << endl; // 2, why not 1? // is the object deleted with refcount 2? return 0; } --- i want to create a vtk object anywhere in my code and connect it to the pipeline. if the object is not used anymore it shall be deleted. i create new objects using vtkNew. afterwards they are added to a pipeline, which increases refcount and the vtkNew instance can go out of scope and the object is not deleted. however, i do not get an example, which mimics this behavior since i do not understand the behavior of refcounting. Best regards, Henry From acsantome at gmail.com Tue Dec 11 03:53:10 2012 From: acsantome at gmail.com (a.c.sant) Date: Tue, 11 Dec 2012 00:53:10 -0800 (PST) Subject: [vtkusers] About threads In-Reply-To: <1355212727900-5717536.post@n5.nabble.com> References: <1355161886388-5717522.post@n5.nabble.com> <1355212727900-5717536.post@n5.nabble.com> Message-ID: Hello everyone, I meant no disrespect. My aoologies if anyone was/is offended!. I'm in such a hurry because this is the first time I'm working with VTk and I'ven been tasked with it. :( Thanks for your replies!. 2012/12/11 Najzero [via VTK] > Well, because its important, its in the FAQ: > http://www.vtk.org/Wiki/VTK/FAQ#Is_VTK_thread-safe_.3F > > VTK is not thread safe, and by that its not pretty common for vtk to spawn > more than one threads then. > > But that is only my small (never had a thread problem) knownlegde about > threads in vtk (reading it once in the faq) > > Best regards > Adrian > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > http://vtk.1045678.n5.nabble.com/About-threads-tp5717517p5717536.html > To unsubscribe from About threads, click here > . > NAML > -- View this message in context: http://vtk.1045678.n5.nabble.com/About-threads-tp5717517p5717539.html Sent from the VTK - Users mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lobo.theslayer at gmail.com Tue Dec 11 04:07:08 2012 From: lobo.theslayer at gmail.com (Rodrigo Lovera) Date: Tue, 11 Dec 2012 04:07:08 -0500 Subject: [vtkusers] How to get processing time and memory use Message-ID: Hi, I'm kind of new on these VTK use in C++ environment (Visual Studio), and im developing a 3d visualization gui using VTK + QT. In order to do some testing I'll need to measure the processing time and memory use but got no idea on how to do it. Maybe to get the processing time of each pipeline im adding into the gui. Hope you can give me any clue in order to perform these evaluation Thanks in advance. Regards, -- *Rodrigo* -------------- next part -------------- An HTML attachment was scrubbed... URL: From massimo.bortolato at gmail.com Tue Dec 11 05:11:20 2012 From: massimo.bortolato at gmail.com (Massimo Bortolato) Date: Tue, 11 Dec 2012 11:11:20 +0100 Subject: [vtkusers] How to estimate render time Message-ID: <4A3F0A898DFA4369BAAE8EA5EB360049@MassimoPC> Hi all, I have my program slow in executing vtkRenderWindow::Render() (or maybe vtkRenderer::Render() ??) so I wonder if there is any event I can listen to to avoid the application looking freezed (for example I?d like to show a progress bar...) Thankyou in advance! Massimo -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Tue Dec 11 07:34:43 2012 From: daviddoria at gmail.com (David Doria) Date: Tue, 11 Dec 2012 07:34:43 -0500 Subject: [vtkusers] How to get processing time and memory use In-Reply-To: References: Message-ID: On Tue, Dec 11, 2012 at 4:07 AM, Rodrigo Lovera wrote: > Hi, > > I'm kind of new on these VTK use in C++ environment (Visual Studio), and im > developing a 3d visualization gui using VTK + QT. > > In order to do some testing I'll need to measure the processing time and > memory use but got no idea on how to do it. Maybe to get the processing time > of each pipeline im adding into the gui. > > Hope you can give me any clue in order to perform these evaluation > > Thanks in advance. > > Regards, > -- > Rodrigo For timing, you could look into: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/TimerLog http://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/TimeStamp Personally, I would use: http://programmingexamples.net/wiki/CPP/Boost/Timer ITK has a MemoryProbe: http://www.itk.org/Doxygen/html/classitk_1_1MemoryProbe.html (There is no example of it's use, but it should be similar to the TimeProbe: http://www.itk.org/Wiki/ITK/Examples/Utilities/TimeProbe). I'm sure you don't want to include ITK in your project just for this, but I'm not aware of a VTK equivalent. David From daviddoria at gmail.com Tue Dec 11 07:38:16 2012 From: daviddoria at gmail.com (David Doria) Date: Tue, 11 Dec 2012 07:38:16 -0500 Subject: [vtkusers] How to estimate render time In-Reply-To: <4A3F0A898DFA4369BAAE8EA5EB360049@MassimoPC> References: <4A3F0A898DFA4369BAAE8EA5EB360049@MassimoPC> Message-ID: On Tue, Dec 11, 2012 at 5:11 AM, Massimo Bortolato wrote: > Hi all, > > I have my program slow in executing vtkRenderWindow::Render() (or maybe > vtkRenderer::Render() ??) so I wonder if there is any event I can listen to > to avoid the application looking freezed (for example I?d like to show a > progress bar...) > > Thankyou in advance! > Massimo In vtkFrameRateWidget that we wrote a long time ago: https://github.com/daviddoria/vtkFrameRateWidget/blob/master/vtkFrameRateWidget.cxx there are some clues as to how you can do this. The renderer's EndEvent can be connected to a function. this->Renderer->AddObserver(vtkCommand::EndEvent , this, &vtkFrameRateWidget::RenderCallback); Then I would use a Qt progress bar in "marquee" mode (just scrolling back and forth until you tell it to stop, http://programmingexamples.net/wiki/Qt/Widgets/ProgressBarMarquee) since I don't think you can know how long it will actually take. Good luck, David From jmrbcu at gmail.com Tue Dec 11 09:45:27 2012 From: jmrbcu at gmail.com (=?UTF-8?Q?Jos=C3=A9_M=2E_Rodriguez_Bacallao?=) Date: Tue, 11 Dec 2012 09:45:27 -0500 Subject: [vtkusers] image moved afer an orientation change Message-ID: hi folks, I am trying to implement a MPR viewer, so far so good. I am using the new image classes, this is test code: #!/usr/bin/env python import os import gdcm, vtkgdcm, vtk def key_press(sender, event): key = interactor.GetKeySym() style.SetCurrentRenderer(renderer) if key == 'a': print 'axial' style.SetImageOrientation( style.GetZViewRightVector(), style.GetZViewUpVector() ) elif key == 'c': print 'coronal' style.SetImageOrientation( style.GetYViewRightVector(), style.GetYViewUpVector() ) elif key == 's': print 'axial' style.SetImageOrientation( style.GetXViewRightVector(), style.GetXViewUpVector() ) render_window.Render() interactor = vtk.vtkRenderWindowInteractor() render_window = vtk.vtkRenderWindow() render_window.SetSize(400, 400) interactor.SetRenderWindow(render_window) style = vtk.vtkInteractorStyleImage() style.SetInteractionModeToImageSlicing() interactor.SetInteractorStyle(style) style.AddObserver('CharEvent', key_press) print 'sorting files...' path = '/home/jmrbcu/pictures/workpictures/dicom/BRAIN/' files = [os.path.join(path, x) for x in os.listdir(path)] ipp = gdcm.IPPSorter() ipp.SetComputeZSpacing(True) ipp.SetZSpacingTolerance(1e-3) result = ipp.Sort(files) sorted_files, zspacing = files, 0 if result: sorted_files = ipp.GetFilenames() zspacing = ipp.GetZSpacing() print 'files sorted, z spacing is: %s' % zspacing else: print 'cannot sort files, this is not a valid volume' vtk_files = vtk.vtkStringArray() map(vtk_files.InsertNextValue, sorted_files) reader = vtkgdcm.vtkGDCMImageReader() reader.FileLowerLeftOn() reader.SetFileNames(vtk_files) reader.Update() spacing = reader.GetOutput().GetSpacing() change = vtk.vtkImageChangeInformation() change.SetInputConnection(reader.GetOutputPort()) change.SetOutputSpacing(spacing[0], spacing[1], zspacing) im = vtk.vtkImageResliceMapper() im.SetInputConnection(change.GetOutputPort()) im.SliceFacesCameraOn() im.SliceAtFocalPointOn() im.BorderOff() ip = vtk.vtkImageProperty() ip.SetColorWindow(255) ip.SetColorLevel(128) ip.SetAmbient(0.0) ip.SetDiffuse(1.0) ip.SetOpacity(1.0) ip.SetInterpolationTypeToLinear() ia = vtk.vtkImageSlice() ia.SetMapper(im) ia.SetProperty(ip) renderer = vtk.vtkRenderer() renderer.AddViewProp(ia) renderer.SetBackground(0 , 0, 0) render_window.AddRenderer(renderer) style.SetCurrentRenderer(renderer) style.SetZViewRightVector((1, 0, 0)) style.SetZViewUpVector((0, -1, 0)) style.SetXViewRightVector((0, 1, 0)) style.SetXViewUpVector((0, 0, 1)) style.SetYViewRightVector((1, 0, 0)) style.SetYViewUpVector((0, 0, 1)) style.SetImageOrientation(style.GetZViewRightVector(), style.GetZViewUpVector()) # render the image renderer.ResetCamera() renderer.GetActiveCamera().ParallelProjectionOn() renderer.ResetCameraClippingRange() render_window.Render() interactor.Initialize() interactor.Start() the problems arise in this sequence: 1- initially display the image: ok 2- slice the image to a different slice with ctrl + mosue left: ok 3- change the orientation to a different one (sagital or coronal, doesn't matter): this is the problem, orientation of the image is changed fine to the new one but the image is panned to a different position in the render window/renderer, not the center of it and in a different slice (the middle slice of the whole image) how can I avoid this, I mean, keep the image centered in the render window/renderer when the image orientation is changed and in the correct slice location? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Tue Dec 11 09:52:14 2012 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Tue, 11 Dec 2012 09:52:14 -0500 Subject: [vtkusers] How to estimate render time In-Reply-To: <4A3F0A898DFA4369BAAE8EA5EB360049@MassimoPC> References: <4A3F0A898DFA4369BAAE8EA5EB360049@MassimoPC> Message-ID: Perhaps this wiki example will help http://vtk.org/Wiki/VTK/Examples/Cxx/Utilities/FrameRate On Tue, Dec 11, 2012 at 5:11 AM, Massimo Bortolato wrote: > Hi all, > > I have my program slow in executing vtkRenderWindow::Render() (or maybe > vtkRenderer::Render() ??) so I wonder if there is any event I can listen to > to avoid the application looking freezed (for example I?d like to show a > progress bar...) > > Thankyou in advance! > Massimo > > > _______________________________________________ > 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://www.vtk.org/mailman/listinfo/vtkusers > -- Unpaid intern in BillsBasement at noware dot com From massimo.bortolato at gmail.com Tue Dec 11 10:01:34 2012 From: massimo.bortolato at gmail.com (Massimo Bortolato) Date: Tue, 11 Dec 2012 16:01:34 +0100 Subject: [vtkusers] How to estimate render time In-Reply-To: References: <4A3F0A898DFA4369BAAE8EA5EB360049@MassimoPC> Message-ID: Thank you! Very useful! Massimo -----Messaggio originale----- From: David Doria Sent: Tuesday, December 11, 2012 1:38 PM To: Massimo Bortolato Cc: vtkusers at vtk.org Subject: Re: [vtkusers] How to estimate render time On Tue, Dec 11, 2012 at 5:11 AM, Massimo Bortolato wrote: > Hi all, > > I have my program slow in executing vtkRenderWindow::Render() (or maybe > vtkRenderer::Render() ??) so I wonder if there is any event I can listen > to > to avoid the application looking freezed (for example I?d like to show a > progress bar...) > > Thankyou in advance! > Massimo In vtkFrameRateWidget that we wrote a long time ago: https://github.com/daviddoria/vtkFrameRateWidget/blob/master/vtkFrameRateWidget.cxx there are some clues as to how you can do this. The renderer's EndEvent can be connected to a function. this->Renderer->AddObserver(vtkCommand::EndEvent , this, &vtkFrameRateWidget::RenderCallback); Then I would use a Qt progress bar in "marquee" mode (just scrolling back and forth until you tell it to stop, http://programmingexamples.net/wiki/Qt/Widgets/ProgressBarMarquee) since I don't think you can know how long it will actually take. Good luck, David From massimo.bortolato at gmail.com Tue Dec 11 10:01:53 2012 From: massimo.bortolato at gmail.com (Massimo Bortolato) Date: Tue, 11 Dec 2012 16:01:53 +0100 Subject: [vtkusers] How to estimate render time In-Reply-To: References: <4A3F0A898DFA4369BAAE8EA5EB360049@MassimoPC> Message-ID: <32E5BF1E8346459AA9B3B6FFC415E057@MassimoPC> Thank you! Very useful! Massimo -----Messaggio originale----- From: Bill Lorensen Sent: Tuesday, December 11, 2012 3:52 PM To: Massimo Bortolato Cc: vtkusers at vtk.org Subject: Re: [vtkusers] How to estimate render time Perhaps this wiki example will help http://vtk.org/Wiki/VTK/Examples/Cxx/Utilities/FrameRate On Tue, Dec 11, 2012 at 5:11 AM, Massimo Bortolato wrote: > Hi all, > > I have my program slow in executing vtkRenderWindow::Render() (or maybe > vtkRenderer::Render() ??) so I wonder if there is any event I can listen > to > to avoid the application looking freezed (for example I?d like to show a > progress bar...) > > Thankyou in advance! > Massimo > > > _______________________________________________ > 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://www.vtk.org/mailman/listinfo/vtkusers > -- Unpaid intern in BillsBasement at noware dot com From 600gestures at gmail.com Tue Dec 11 10:14:39 2012 From: 600gestures at gmail.com (Gestuality us) Date: Tue, 11 Dec 2012 10:14:39 -0500 Subject: [vtkusers] Make install error for VTK Message-ID: Hi, I am trying to install vtk and use it along with python on my ubuntu machine. I installed VTK and i was able to configure and generate, then I did a 'sudo make install', this is giving me the following error, I am not sure which path has to be set and how to make python read .pth files from that folder, I am new to both VTK and Python, so any advice would be of great help. Thanks, Shripad D make install error: Checking .pth file support in /usr/local/lib/python2.7/site-packages/ /opt/bitnami/python/bin/.python2.7.bin -E -c pass TEST FAILED: /usr/local/lib/python2.7/site-packages/ does NOT support .pth files error: bad install directory or PYTHONPATH You are attempting to install a package to a directory that is not on PYTHONPATH and which Python does not read ".pth" files from. The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was: /usr/local/lib/python2.7/site-packages/ and your PYTHONPATH environment variable currently contains: '/opt/bitnami/apps/django/lib/python2.7/site-packages:/opt/bitnami/subversion/lib/svn-python::/opt/bitnami/apps/django/lib/python2.7/site-packages:/opt/bitnami/subversion/lib/svn-python::' Here are some of your options for correcting the problem: * You can choose a different installation directory, i.e., one that is on PYTHONPATH or supports .pth files * You can add the installation directory to the PYTHONPATH environment variable. (It must then also be on PYTHONPATH whenever you run Python and want to use the package(s) you are installing.) * You can set up the installation directory to support ".pth" files by using one of the approaches described here: http://packages.python.org/distribute/easy_install.html#custom-installation-locations Please make the appropriate changes for your system and try again. -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.vanee at convergent.ca Tue Dec 11 11:26:14 2012 From: david.vanee at convergent.ca (David vanEe) Date: Tue, 11 Dec 2012 08:26:14 -0800 Subject: [vtkusers] vtkCellPicker failing to pick vtkPolyLine (using Python and wx) Message-ID: <75E3C47D9F67634F939FA0668CDF1D0B8602B7A376@MAIL4.exchange.electric.net> Hi all, I've recently updated my VTK from 5.4 to 5.10.1, and some old vtkCellPicker code isn't doing what I want anymore. This 'simple' example works fine in 5.4 (both the blue and red actor highlight when you mouse-over them), but in 5.10.1 only the blue (quad) actor works. The only difference between the two actors (aside from coordinates and colors) is the cellType of vtk.VTK_POLY_LINE vs vtk.VTK_QUAD. I've tried looking for changes in the pick routine, but vtkCellPicker.cxx has undergone substantial changes and I was unable to locate the cause. Any suggestions for getting the picker to pick the polyline? Thanks in advance, Dave import wx import vtk from vtk.wx.wxVTKRenderWindowInteractor import wxVTKRenderWindowInteractor class myVTKInteractor(wxVTKRenderWindowInteractor): def __init__(self, parent): wxVTKRenderWindowInteractor.__init__(self, parent, -1) self.Enable(1) self.AddObserver("ExitEvent", lambda o,e,f=self: f.Close()) self.ren = vtk.vtkRenderer() self.GetRenderWindow().AddRenderer(self.ren) # simple point coords used by both actors coords = [(0.0, 0.0), (1.0, 0.0), (1.0, 1.0), (0.0, 1.0)] self.actorData = [(1.0, vtk.VTK_POLY_LINE, (0.5,0.0,0.0), (1.0, 0.0, 0.0)), (0.0, vtk.VTK_QUAD, (0.0, 0.0, 0.5), (0.0, 0.0, 1.0))] self.actorList = [] for data in self.actorData: (zValue, cellType, dimColor, brightColor) = data points = vtk.vtkPoints() for (pointIndex, coord) in enumerate(coords): points.InsertPoint(pointIndex, coord[0], coord[1], zValue) idList = vtk.vtkIdList() idList.SetNumberOfIds(len(coords)) for pointIndex in range(len(coords)): idList.SetId(pointIndex, pointIndex) cells = vtk.vtkCellArray() cells.InsertNextCell(idList) grid = vtk.vtkUnstructuredGrid() grid.SetPoints(points) grid.SetCells(cellType, cells) mapper = vtk.vtkDataSetMapper() mapper.SetInput(grid) actor = vtk.vtkActor() actor.SetMapper(mapper) actor.GetProperty().SetRepresentation(1) actor.GetProperty().SetLineWidth(5.0) actor.GetProperty().SetDiffuseColor(*dimColor) self.ren.AddActor(actor) self.actorList.append(actor) self.cellPicker = vtk.vtkCellPicker() def OnMotion(self, event): # invert Y value actualY = self.ren.GetSize()[1] - event.GetY() # dim all actors for (index, actor) in enumerate(self.actorList): (zValue, cellType, dimColor, brightColor) = self.actorData[index] actor.GetProperty().SetDiffuseColor(*dimColor) self.cellPicker.Pick(event.GetX(), actualY, 0, self.ren) dataSet = self.cellPicker.GetDataSet() if dataSet is not None: # highlight picked actor for (index, actor) in enumerate(self.actorList): if actor.GetMapper().GetInput() == dataSet: (zOffset, cellType, dimColor, brightColor) = self.actorData[index] actor.GetProperty().SetDiffuseColor(*brightColor) self.Render() def wxVTKRenderWindowInteractorExample(): app = wx.PySimpleApp() frame = wx.Frame(None, -1, "wxVTKRenderWindowInteractor", size=(400,400)) widget = myVTKInteractor(frame) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(widget, 1, wx.EXPAND) frame.SetSizer(sizer) frame.Layout() frame.Show() app.MainLoop() if __name__ == "__main__": wxVTKRenderWindowInteractorExample() -- David A. Van Ee, BASc, EIT Convergent Manufacturing Technologies Inc. 6190 Agronomy Rd, Suite 403 Vancouver BC Canada V6T 1Z3 Email: david.vanee at convergent.ca | Tel: 604-822-9682 x103 WWW: http://www.convergent.ca | Fax: 604-822-9659 CONFIDENTIALITY NOTICE This e-mail contains privileged and confidential information which is the property of Convergent, intended only for the use of the intended recipient(s). Unauthorized use or disclosure of this information is prohibited. If you are not an intended recipient, please immediately notify Convergent and destroy any copies of this email. Receipt of this e-mail shall not be deemed a waiver by Convergent of any privilege or the confidential nature of the information. -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Tue Dec 11 12:07:40 2012 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 11 Dec 2012 10:07:40 -0700 Subject: [vtkusers] vtkCellPicker failing to pick vtkPolyLine (using Python and wx) In-Reply-To: <75E3C47D9F67634F939FA0668CDF1D0B8602B7A376@MAIL4.exchange.electric.net> References: <75E3C47D9F67634F939FA0668CDF1D0B8602B7A376@MAIL4.exchange.electric.net> Message-ID: Hi David, I was the one who made the changes to the vtkCellPicker code, and I'd be glad to investigate to see why the behavior changed. Can you send me an example that uses just python, i.e. no wx? - David On Tue, Dec 11, 2012 at 9:26 AM, David vanEe wrote: > Hi all, > > > > I?ve recently updated my VTK from 5.4 to 5.10.1, and some old vtkCellPicker > code isn?t doing what I want anymore. This ?simple? example works fine in > 5.4 (both the blue and red actor highlight when you mouse-over them), but in > 5.10.1 only the blue (quad) actor works. The only difference between the > two actors (aside from coordinates and colors) is the cellType of > vtk.VTK_POLY_LINE vs vtk.VTK_QUAD. > > > > I?ve tried looking for changes in the pick routine, but vtkCellPicker.cxx > has undergone substantial changes and I was unable to locate the cause. Any > suggestions for getting the picker to pick the polyline? > > > > Thanks in advance, > > Dave > > > > > > import wx > > import vtk > > > > from vtk.wx.wxVTKRenderWindowInteractor import wxVTKRenderWindowInteractor > > > > class myVTKInteractor(wxVTKRenderWindowInteractor): > > def __init__(self, parent): > > wxVTKRenderWindowInteractor.__init__(self, parent, -1) > > > > self.Enable(1) > > self.AddObserver("ExitEvent", lambda o,e,f=self: f.Close()) > > > > self.ren = vtk.vtkRenderer() > > self.GetRenderWindow().AddRenderer(self.ren) > > > > # simple point coords used by both actors > > coords = [(0.0, 0.0), > > (1.0, 0.0), > > (1.0, 1.0), > > (0.0, 1.0)] > > > > self.actorData = [(1.0, vtk.VTK_POLY_LINE, (0.5,0.0,0.0), (1.0, 0.0, > 0.0)), > > (0.0, vtk.VTK_QUAD, (0.0, 0.0, 0.5), (0.0, 0.0, > 1.0))] > > > > self.actorList = [] > > for data in self.actorData: > > (zValue, cellType, dimColor, brightColor) = data > > > > points = vtk.vtkPoints() > > for (pointIndex, coord) in enumerate(coords): > > points.InsertPoint(pointIndex, coord[0], coord[1], zValue) > > > > idList = vtk.vtkIdList() > > idList.SetNumberOfIds(len(coords)) > > for pointIndex in range(len(coords)): > > idList.SetId(pointIndex, pointIndex) > > cells = vtk.vtkCellArray() > > cells.InsertNextCell(idList) > > > > grid = vtk.vtkUnstructuredGrid() > > grid.SetPoints(points) > > grid.SetCells(cellType, cells) > > > > mapper = vtk.vtkDataSetMapper() > > mapper.SetInput(grid) > > > > actor = vtk.vtkActor() > > actor.SetMapper(mapper) > > actor.GetProperty().SetRepresentation(1) > > actor.GetProperty().SetLineWidth(5.0) > > actor.GetProperty().SetDiffuseColor(*dimColor) > > > > self.ren.AddActor(actor) > > self.actorList.append(actor) > > > > self.cellPicker = vtk.vtkCellPicker() > > > > > > def OnMotion(self, event): > > > > # invert Y value > > actualY = self.ren.GetSize()[1] - event.GetY() > > > > # dim all actors > > for (index, actor) in enumerate(self.actorList): > > (zValue, cellType, dimColor, brightColor) = > self.actorData[index] > > actor.GetProperty().SetDiffuseColor(*dimColor) > > > > self.cellPicker.Pick(event.GetX(), actualY, 0, self.ren) > > dataSet = self.cellPicker.GetDataSet() > > > > if dataSet is not None: > > # highlight picked actor > > for (index, actor) in enumerate(self.actorList): > > if actor.GetMapper().GetInput() == dataSet: > > (zOffset, cellType, dimColor, brightColor) = > self.actorData[index] > > actor.GetProperty().SetDiffuseColor(*brightColor) > > > > self.Render() > > > > > > def wxVTKRenderWindowInteractorExample(): > > app = wx.PySimpleApp() > > > > frame = wx.Frame(None, -1, "wxVTKRenderWindowInteractor", > size=(400,400)) > > > > widget = myVTKInteractor(frame) > > sizer = wx.BoxSizer(wx.VERTICAL) > > sizer.Add(widget, 1, wx.EXPAND) > > frame.SetSizer(sizer) > > frame.Layout() > > > > frame.Show() > > > > app.MainLoop() > > > > if __name__ == "__main__": > > wxVTKRenderWindowInteractorExample() > > > > > > > > -- > > David A. Van Ee, BASc, EIT > > Convergent Manufacturing Technologies Inc. > > 6190 Agronomy Rd, Suite 403 > > Vancouver BC Canada V6T 1Z3 > > > > Email: david.vanee at convergent.ca | Tel: 604-822-9682 x103 > > WWW: http://www.convergent.ca | Fax: 604-822-9659 From sean at rogue-research.com Tue Dec 11 12:49:42 2012 From: sean at rogue-research.com (Sean McBride) Date: Tue, 11 Dec 2012 12:49:42 -0500 Subject: [vtkusers] How to get processing time and memory use In-Reply-To: References: Message-ID: <20121211174942.1098648275@mail.rogue-research.com> On Tue, 11 Dec 2012 04:07:08 -0500, Rodrigo Lovera said: >I'm kind of new on these VTK use in C++ environment (Visual Studio), and im >developing a 3d visualization gui using VTK + QT. > >In order to do some testing I'll need to measure the processing time and >memory use but got no idea on how to do it. Maybe to get the processing >time of each pipeline im adding into the gui. > >Hope you can give me any clue in order to perform these evaluation You need a profiler: I don't use Windows, but a quick googling suggests this: 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.vanee at convergent.ca Tue Dec 11 12:51:00 2012 From: david.vanee at convergent.ca (David vanEe) Date: Tue, 11 Dec 2012 09:51:00 -0800 Subject: [vtkusers] vtkCellPicker failing to pick vtkPolyLine (using Python and wx) In-Reply-To: References: <75E3C47D9F67634F939FA0668CDF1D0B8602B7A376@MAIL4.exchange.electric.net> Message-ID: <75E3C47D9F67634F939FA0668CDF1D0B8602B7A377@MAIL4.exchange.electric.net> Sure, this version will work with just python/vtk. Thanks for taking a look. import vtk class MyInteractorStyle(vtk.vtkInteractorStyleTrackballCamera): def __init__(self, actorData, actorList): self.actorData = actorData self.actorList = actorList self.cellPicker = vtk.vtkCellPicker() self.AddObserver("MouseMoveEvent", self.OnMotion) def OnMotion(self, obj, event): iren = obj.GetInteractor() renwin = iren.GetRenderWindow() ren = renwin.GetRenderers().GetFirstRenderer() x, y = iren.GetEventPosition() # invert Y value actualY = ren.GetSize()[1] - y # dim all actors for (index, actor) in enumerate(self.actorList): (zValue, cellType, dimColor, brightColor) = self.actorData[index] actor.GetProperty().SetDiffuseColor(*dimColor) self.cellPicker.Pick(x, actualY, 0, ren) dataSet = self.cellPicker.GetDataSet() if dataSet is not None: # highlight picked actor for (index, actor) in enumerate(self.actorList): if actor.GetMapper().GetInput() == dataSet: (zOffset, cellType, dimColor, brightColor) = self.actorData[index] actor.GetProperty().SetDiffuseColor(*brightColor) renwin.Render() # simple point coords used by both actors coords = [(0.0, 0.0), (1.0, 0.0), (1.0, 1.0), (0.0, 1.0)] actorData = [(1.0, vtk.VTK_POLY_LINE, (0.5,0.0,0.0), (1.0, 0.0, 0.0)), (0.0, vtk.VTK_QUAD, (0.0, 0.0, 0.5), (0.0, 0.0, 1.0))] ren = vtk.vtkRenderer() renwin = vtk.vtkRenderWindow() renwin.AddRenderer(ren) actorList = [] for data in actorData: (zValue, cellType, dimColor, brightColor) = data points = vtk.vtkPoints() for (pointIndex, coord) in enumerate(coords): points.InsertPoint(pointIndex, coord[0], coord[1], zValue) idList = vtk.vtkIdList() idList.SetNumberOfIds(len(coords)) for pointIndex in range(len(coords)): idList.SetId(pointIndex, pointIndex) cells = vtk.vtkCellArray() cells.InsertNextCell(idList) grid = vtk.vtkUnstructuredGrid() grid.SetPoints(points) grid.SetCells(cellType, cells) mapper = vtk.vtkDataSetMapper() mapper.SetInput(grid) actor = vtk.vtkActor() actor.SetMapper(mapper) actor.GetProperty().SetRepresentation(1) actor.GetProperty().SetLineWidth(5.0) actor.GetProperty().SetDiffuseColor(*dimColor) ren.AddActor(actor) actorList.append(actor) interactor = vtk.vtkRenderWindowInteractor() interactor.SetInteractorStyle(MyInteractorStyle(actorData, actorList)) interactor.SetRenderWindow(renwin) interactor.Initialize() interactor.Start() -----Original Message----- From: David Gobbi [mailto:david.gobbi at gmail.com] Sent: Tuesday, December 11, 2012 9:08 AM To: David vanEe Cc: vtkusers at vtk.org Subject: Re: [vtkusers] vtkCellPicker failing to pick vtkPolyLine (using Python and wx) Hi David, I was the one who made the changes to the vtkCellPicker code, and I'd be glad to investigate to see why the behavior changed. Can you send me an example that uses just python, i.e. no wx? - David On Tue, Dec 11, 2012 at 9:26 AM, David vanEe wrote: > Hi all, > > > > I've recently updated my VTK from 5.4 to 5.10.1, and some old > vtkCellPicker code isn't doing what I want anymore. This 'simple' > example works fine in > 5.4 (both the blue and red actor highlight when you mouse-over them), > but in > 5.10.1 only the blue (quad) actor works. The only difference between > the two actors (aside from coordinates and colors) is the cellType of > vtk.VTK_POLY_LINE vs vtk.VTK_QUAD. > > > > I've tried looking for changes in the pick routine, but > vtkCellPicker.cxx has undergone substantial changes and I was unable > to locate the cause. Any suggestions for getting the picker to pick the polyline? > > > > Thanks in advance, > > Dave > > > > > > import wx > > import vtk > > > > from vtk.wx.wxVTKRenderWindowInteractor import > wxVTKRenderWindowInteractor > > > > class myVTKInteractor(wxVTKRenderWindowInteractor): > > def __init__(self, parent): > > wxVTKRenderWindowInteractor.__init__(self, parent, -1) > > > > self.Enable(1) > > self.AddObserver("ExitEvent", lambda o,e,f=self: f.Close()) > > > > self.ren = vtk.vtkRenderer() > > self.GetRenderWindow().AddRenderer(self.ren) > > > > # simple point coords used by both actors > > coords = [(0.0, 0.0), > > (1.0, 0.0), > > (1.0, 1.0), > > (0.0, 1.0)] > > > > self.actorData = [(1.0, vtk.VTK_POLY_LINE, (0.5,0.0,0.0), > (1.0, 0.0, 0.0)), > > (0.0, vtk.VTK_QUAD, (0.0, 0.0, 0.5), (0.0, > 0.0, 1.0))] > > > > self.actorList = [] > > for data in self.actorData: > > (zValue, cellType, dimColor, brightColor) = data > > > > points = vtk.vtkPoints() > > for (pointIndex, coord) in enumerate(coords): > > points.InsertPoint(pointIndex, coord[0], coord[1], > zValue) > > > > idList = vtk.vtkIdList() > > idList.SetNumberOfIds(len(coords)) > > for pointIndex in range(len(coords)): > > idList.SetId(pointIndex, pointIndex) > > cells = vtk.vtkCellArray() > > cells.InsertNextCell(idList) > > > > grid = vtk.vtkUnstructuredGrid() > > grid.SetPoints(points) > > grid.SetCells(cellType, cells) > > > > mapper = vtk.vtkDataSetMapper() > > mapper.SetInput(grid) > > > > actor = vtk.vtkActor() > > actor.SetMapper(mapper) > > actor.GetProperty().SetRepresentation(1) > > actor.GetProperty().SetLineWidth(5.0) > > actor.GetProperty().SetDiffuseColor(*dimColor) > > > > self.ren.AddActor(actor) > > self.actorList.append(actor) > > > > self.cellPicker = vtk.vtkCellPicker() > > > > > > def OnMotion(self, event): > > > > # invert Y value > > actualY = self.ren.GetSize()[1] - event.GetY() > > > > # dim all actors > > for (index, actor) in enumerate(self.actorList): > > (zValue, cellType, dimColor, brightColor) = > self.actorData[index] > > actor.GetProperty().SetDiffuseColor(*dimColor) > > > > self.cellPicker.Pick(event.GetX(), actualY, 0, self.ren) > > dataSet = self.cellPicker.GetDataSet() > > > > if dataSet is not None: > > # highlight picked actor > > for (index, actor) in enumerate(self.actorList): > > if actor.GetMapper().GetInput() == dataSet: > > (zOffset, cellType, dimColor, brightColor) = > self.actorData[index] > > actor.GetProperty().SetDiffuseColor(*brightColor) > > > > self.Render() > > > > > > def wxVTKRenderWindowInteractorExample(): > > app = wx.PySimpleApp() > > > > frame = wx.Frame(None, -1, "wxVTKRenderWindowInteractor", > size=(400,400)) > > > > widget = myVTKInteractor(frame) > > sizer = wx.BoxSizer(wx.VERTICAL) > > sizer.Add(widget, 1, wx.EXPAND) > > frame.SetSizer(sizer) > > frame.Layout() > > > > frame.Show() > > > > app.MainLoop() > > > > if __name__ == "__main__": > > wxVTKRenderWindowInteractorExample() > > > > > > > > -- > > David A. Van Ee, BASc, EIT > > Convergent Manufacturing Technologies Inc. > > 6190 Agronomy Rd, Suite 403 > > Vancouver BC Canada V6T 1Z3 > > > > Email: david.vanee at convergent.ca | Tel: 604-822-9682 x103 > > WWW: http://www.convergent.ca | Fax: 604-822-9659 From david.gobbi at gmail.com Tue Dec 11 13:26:55 2012 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 11 Dec 2012 11:26:55 -0700 Subject: [vtkusers] vtkCellPicker failing to pick vtkPolyLine (using Python and wx) In-Reply-To: <75E3C47D9F67634F939FA0668CDF1D0B8602B7A377@MAIL4.exchange.electric.net> References: <75E3C47D9F67634F939FA0668CDF1D0B8602B7A376@MAIL4.exchange.electric.net> <75E3C47D9F67634F939FA0668CDF1D0B8602B7A377@MAIL4.exchange.electric.net> Message-ID: Hi David, You can get the polyline picking to work by increasing the tolerance: self.cellPicker.SetTolerance(0.005) I'll continue looking through the code to see why the new code behaves differently from the old, though. I suspect there have been minor changes to the way that tolerances are applied. - David On Tue, Dec 11, 2012 at 10:51 AM, David vanEe wrote: > Sure, this version will work with just python/vtk. Thanks for taking a look. > > > import vtk > > class MyInteractorStyle(vtk.vtkInteractorStyleTrackballCamera): > def __init__(self, actorData, actorList): > > self.actorData = actorData > self.actorList = actorList > self.cellPicker = vtk.vtkCellPicker() > > self.AddObserver("MouseMoveEvent", self.OnMotion) > > def OnMotion(self, obj, event): > > iren = obj.GetInteractor() > renwin = iren.GetRenderWindow() > ren = renwin.GetRenderers().GetFirstRenderer() > > x, y = iren.GetEventPosition() > > # invert Y value > actualY = ren.GetSize()[1] - y > > # dim all actors > for (index, actor) in enumerate(self.actorList): > (zValue, cellType, dimColor, brightColor) = self.actorData[index] > actor.GetProperty().SetDiffuseColor(*dimColor) > > self.cellPicker.Pick(x, actualY, 0, ren) > dataSet = self.cellPicker.GetDataSet() > > if dataSet is not None: > # highlight picked actor > for (index, actor) in enumerate(self.actorList): > if actor.GetMapper().GetInput() == dataSet: > (zOffset, cellType, dimColor, brightColor) = self.actorData[index] > actor.GetProperty().SetDiffuseColor(*brightColor) > > renwin.Render() > > # simple point coords used by both actors > coords = [(0.0, 0.0), > (1.0, 0.0), > (1.0, 1.0), > (0.0, 1.0)] > > actorData = [(1.0, vtk.VTK_POLY_LINE, (0.5,0.0,0.0), (1.0, 0.0, 0.0)), > (0.0, vtk.VTK_QUAD, (0.0, 0.0, 0.5), (0.0, 0.0, 1.0))] > > ren = vtk.vtkRenderer() > > renwin = vtk.vtkRenderWindow() > renwin.AddRenderer(ren) > > actorList = [] > for data in actorData: > (zValue, cellType, dimColor, brightColor) = data > > points = vtk.vtkPoints() > for (pointIndex, coord) in enumerate(coords): > points.InsertPoint(pointIndex, coord[0], coord[1], zValue) > > idList = vtk.vtkIdList() > idList.SetNumberOfIds(len(coords)) > for pointIndex in range(len(coords)): > idList.SetId(pointIndex, pointIndex) > cells = vtk.vtkCellArray() > cells.InsertNextCell(idList) > > grid = vtk.vtkUnstructuredGrid() > grid.SetPoints(points) > grid.SetCells(cellType, cells) > > mapper = vtk.vtkDataSetMapper() > mapper.SetInput(grid) > > actor = vtk.vtkActor() > actor.SetMapper(mapper) > actor.GetProperty().SetRepresentation(1) > actor.GetProperty().SetLineWidth(5.0) > actor.GetProperty().SetDiffuseColor(*dimColor) > > ren.AddActor(actor) > actorList.append(actor) > > interactor = vtk.vtkRenderWindowInteractor() > interactor.SetInteractorStyle(MyInteractorStyle(actorData, actorList)) > interactor.SetRenderWindow(renwin) > > interactor.Initialize() > interactor.Start() > > > > -----Original Message----- > From: David Gobbi [mailto:david.gobbi at gmail.com] > Sent: Tuesday, December 11, 2012 9:08 AM > To: David vanEe > Cc: vtkusers at vtk.org > Subject: Re: [vtkusers] vtkCellPicker failing to pick vtkPolyLine (using Python and wx) > > Hi David, > > I was the one who made the changes to the vtkCellPicker code, and I'd be glad to investigate to see why the behavior changed. > > Can you send me an example that uses just python, i.e. no wx? > > - David > > On Tue, Dec 11, 2012 at 9:26 AM, David vanEe wrote: >> Hi all, >> >> >> >> I've recently updated my VTK from 5.4 to 5.10.1, and some old >> vtkCellPicker code isn't doing what I want anymore. This 'simple' >> example works fine in >> 5.4 (both the blue and red actor highlight when you mouse-over them), >> but in >> 5.10.1 only the blue (quad) actor works. The only difference between >> the two actors (aside from coordinates and colors) is the cellType of >> vtk.VTK_POLY_LINE vs vtk.VTK_QUAD. >> >> >> >> I've tried looking for changes in the pick routine, but >> vtkCellPicker.cxx has undergone substantial changes and I was unable >> to locate the cause. Any suggestions for getting the picker to pick the polyline? >> >> >> >> Thanks in advance, >> >> Dave >> >> >> >> >> >> import wx >> >> import vtk >> >> >> >> from vtk.wx.wxVTKRenderWindowInteractor import >> wxVTKRenderWindowInteractor >> >> >> >> class myVTKInteractor(wxVTKRenderWindowInteractor): >> >> def __init__(self, parent): >> >> wxVTKRenderWindowInteractor.__init__(self, parent, -1) >> >> >> >> self.Enable(1) >> >> self.AddObserver("ExitEvent", lambda o,e,f=self: f.Close()) >> >> >> >> self.ren = vtk.vtkRenderer() >> >> self.GetRenderWindow().AddRenderer(self.ren) >> >> >> >> # simple point coords used by both actors >> >> coords = [(0.0, 0.0), >> >> (1.0, 0.0), >> >> (1.0, 1.0), >> >> (0.0, 1.0)] >> >> >> >> self.actorData = [(1.0, vtk.VTK_POLY_LINE, (0.5,0.0,0.0), >> (1.0, 0.0, 0.0)), >> >> (0.0, vtk.VTK_QUAD, (0.0, 0.0, 0.5), (0.0, >> 0.0, 1.0))] >> >> >> >> self.actorList = [] >> >> for data in self.actorData: >> >> (zValue, cellType, dimColor, brightColor) = data >> >> >> >> points = vtk.vtkPoints() >> >> for (pointIndex, coord) in enumerate(coords): >> >> points.InsertPoint(pointIndex, coord[0], coord[1], >> zValue) >> >> >> >> idList = vtk.vtkIdList() >> >> idList.SetNumberOfIds(len(coords)) >> >> for pointIndex in range(len(coords)): >> >> idList.SetId(pointIndex, pointIndex) >> >> cells = vtk.vtkCellArray() >> >> cells.InsertNextCell(idList) >> >> >> >> grid = vtk.vtkUnstructuredGrid() >> >> grid.SetPoints(points) >> >> grid.SetCells(cellType, cells) >> >> >> >> mapper = vtk.vtkDataSetMapper() >> >> mapper.SetInput(grid) >> >> >> >> actor = vtk.vtkActor() >> >> actor.SetMapper(mapper) >> >> actor.GetProperty().SetRepresentation(1) >> >> actor.GetProperty().SetLineWidth(5.0) >> >> actor.GetProperty().SetDiffuseColor(*dimColor) >> >> >> >> self.ren.AddActor(actor) >> >> self.actorList.append(actor) >> >> >> >> self.cellPicker = vtk.vtkCellPicker() >> >> >> >> >> >> def OnMotion(self, event): >> >> >> >> # invert Y value >> >> actualY = self.ren.GetSize()[1] - event.GetY() >> >> >> >> # dim all actors >> >> for (index, actor) in enumerate(self.actorList): >> >> (zValue, cellType, dimColor, brightColor) = >> self.actorData[index] >> >> actor.GetProperty().SetDiffuseColor(*dimColor) >> >> >> >> self.cellPicker.Pick(event.GetX(), actualY, 0, self.ren) >> >> dataSet = self.cellPicker.GetDataSet() >> >> >> >> if dataSet is not None: >> >> # highlight picked actor >> >> for (index, actor) in enumerate(self.actorList): >> >> if actor.GetMapper().GetInput() == dataSet: >> >> (zOffset, cellType, dimColor, brightColor) = >> self.actorData[index] >> >> actor.GetProperty().SetDiffuseColor(*brightColor) >> >> >> >> self.Render() >> >> >> >> >> >> def wxVTKRenderWindowInteractorExample(): >> >> app = wx.PySimpleApp() >> >> >> >> frame = wx.Frame(None, -1, "wxVTKRenderWindowInteractor", >> size=(400,400)) >> >> >> >> widget = myVTKInteractor(frame) >> >> sizer = wx.BoxSizer(wx.VERTICAL) >> >> sizer.Add(widget, 1, wx.EXPAND) >> >> frame.SetSizer(sizer) >> >> frame.Layout() >> >> >> >> frame.Show() >> >> >> >> app.MainLoop() >> >> >> >> if __name__ == "__main__": >> >> wxVTKRenderWindowInteractorExample() >> >> >> >> >> >> >> >> -- >> >> David A. Van Ee, BASc, EIT >> >> Convergent Manufacturing Technologies Inc. >> >> 6190 Agronomy Rd, Suite 403 >> >> Vancouver BC Canada V6T 1Z3 >> >> >> >> Email: david.vanee at convergent.ca | Tel: 604-822-9682 x103 >> >> WWW: http://www.convergent.ca | Fax: 604-822-9659 From akini at synapticon.com Tue Dec 11 13:44:45 2012 From: akini at synapticon.com (Anup Kini) Date: Tue, 11 Dec 2012 19:44:45 +0100 Subject: [vtkusers] Cross Compiling VTK 5.0.8 with Code Sourcery Toolchain for ARM A9! In-Reply-To: References: Message-ID: Hi Marc, I am trying to build PCL for Xilinx ZYNQ Board. As a dependency i am building VTK also. if possible, kindly share the recipes also. Let me know what u used to cross compile ? CMAKE or some other tools. I have Code Sourcery toolchain for ARM. I have tried compiling both on windows7 and ubuntu. Let me know which platform u have used so that i can get things up a bit faster. On 10 December 2012 21:39, David Gobbi wrote: > Hi Anup, > > Cross compilation of VTK is a very advanced topic. I've > never cross-compiled VTK myself, so I definitely won't have all the > answers, but I can give some pointers. > > You can see the reason for the failure here: > > Linking C executable ../../../bin/H5make_libsettings > [ 1%] Built target H5make_libsettings > [ 1%] Generating ../H5lib_settings.c > *../../../bin/H5make_libsettings: 1: ../../../bin/H5make_libsettings: > Syntax error: word unexpected (expecting ")")* > > CMake is building an executable "H5make_libsettings" and is then trying to > run it on your host... but of course this executable was compiled for your > target and cannot run on your host. The VTK build uses a few of these > little custom executables as part of its build process. > > To do a cross-compile, you first need to do a native compile on your host > machine to compile all of these little build tools. Don't ask me to list > them all... I don't have such a list. Then, when you do your cross-compile > (after you've done the native compile), you need to make sure that the > natively-built executables that are needed during the build used in place > of the cross-compiled ones. The following web page might help: > > http://www.vtk.org/Wiki/CMake_Cross_Compiling > > That's about all the help I can give... good luck. > > - David > > > On Mon, Dec 10, 2012 at 11:57 AM, Anup Kini wrote: > >> Dear All, >> >> I am trying to cross compile VTK for ARM Cortex A9. >> I end up with the following error. >> >> [ 0%] Built target vtksys >> [ 0%] Building C object >> Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/adler32.c.o >> [ 0%] Building C object >> Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/compress.c.o >> [ 0%] Building C object >> Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/crc32.c.o >> [ 0%] Building C object >> Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/deflate.c.o >> [ 0%] Building C object Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/gzio.c.o >> [ 0%] Building C object >> Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/inffast.c.o >> [ 0%] Building C object >> Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/inflate.c.o >> [ 0%] Building C object >> Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/inftrees.c.o >> [ 0%] Building C object >> Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/trees.c.o >> [ 0%] Building C object >> Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/uncompr.c.o >> [ 1%] Building C object >> Utilities/vtkzlib/CMakeFiles/vtkzlib.dir/zutil.c.o >> Linking C static library ../../bin/libvtkzlib.a >> [ 1%] Built target vtkzlib >> [ 1%] Building C object >> Utilities/vtkhdf5/src/CMakeFiles/H5detect.dir/H5detect.c.o >> Linking C executable ../../../bin/H5detect >> [ 1%] Built target H5detect >> [ 1%] Building C object >> Utilities/vtkhdf5/src/CMakeFiles/H5make_libsettings.dir/H5make_libsettings.c.o >> Linking C executable ../../../bin/H5make_libsettings >> [ 1%] Built target H5make_libsettings >> [ 1%] Generating ../H5lib_settings.c >> *../../../bin/H5make_libsettings: 1: ../../../bin/H5make_libsettings: >> Syntax error: word unexpected (expecting ")")* >> *make[2]: *** [Utilities/vtkhdf5/H5lib_settings.c] Error 2* >> *make[1]: *** [Utilities/vtkhdf5/src/CMakeFiles/vtkhdf5.dir/all] Error 2* >> *make: *** [all] Error 2* >> >> >> Kindly let me know if there is any solution for the above error. >> >> -- >> >> *Anup Kini >> *Systems Engineer**** >> * >> ------------------------------ >> * >> >> *Synapticon** * | Cyber-Physical System Solutions **** >> >> Direct:**** >> >> +49 7335 / 186 999 17**** >> >> Fax:**** >> >> +49 7335 / 186 999 19**** >> >> **** >> >> **** >> >> synapticon.com | @synapticon_co >> **** >> >> Synapticon GmbH | Hohlbachweg 2 | 73344 Gruibingen, DE >> Secretary +49 7335 / 186 999 0 | General Manager: Nikolai Ensslen >> Registry Court Ulm HRB 725114 | USt-ID DE271647127**** >> >> This message and any files transmitted with it are confidential and >> intended >> solely for the use of the individual or entity to whom they are >> addressed. >> Please notify the sender immediately if you have received this e-mail by >> mistake and delete it from your system. >> > -- *Anup Kini *Systems Engineer**** * ------------------------------ * *Synapticon** * | Cyber-Physical System Solutions **** Direct:**** +49 7335 / 186 999 17**** Fax:**** +49 7335 / 186 999 19**** **** **** synapticon.com | @synapticon_co **** Synapticon GmbH | Hohlbachweg 2 | 73344 Gruibingen, DE Secretary +49 7335 / 186 999 0 | General Manager: Nikolai Ensslen Registry Court Ulm HRB 725114 | USt-ID DE271647127**** This message and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. Please notify the sender immediately if you have received this e-mail by mistake and delete it from your system. -------------- next part -------------- An HTML attachment was scrubbed... URL: From craig.henderson at intelligentultrasound.com Tue Dec 11 14:12:32 2012 From: craig.henderson at intelligentultrasound.com (Craig Henderson) Date: Tue, 11 Dec 2012 19:12:32 +0000 Subject: [vtkusers] vtkCellPicker failing to pick vtkPolyLine (using Python and wx) In-Reply-To: References: <75E3C47D9F67634F939FA0668CDF1D0B8602B7A376@MAIL4.exchange.electric.net> <75E3C47D9F67634F939FA0668CDF1D0B8602B7A377@MAIL4.exchange.electric.net> Message-ID: <-7482591407968221053@unknownmsgid> Hi, Could this be related to the problem I asked about a few days ago? I haven't had any responses. http://www.vtk.org/pipermail/vtkusers/2012-December/126783.html Thanks Craig On 11 Dec 2012, at 18:27, David Gobbi wrote: Hi David, You can get the polyline picking to work by increasing the tolerance: self.cellPicker.SetTolerance(0.005) I'll continue looking through the code to see why the new code behaves differently from the old, though. I suspect there have been minor changes to the way that tolerances are applied. - David On Tue, Dec 11, 2012 at 10:51 AM, David vanEe wrote: Sure, this version will work with just python/vtk. Thanks for taking a look. import vtk class MyInteractorStyle(vtk.vtkInteractorStyleTrackballCamera): def __init__(self, actorData, actorList): self.actorData = actorData self.actorList = actorList self.cellPicker = vtk.vtkCellPicker() self.AddObserver("MouseMoveEvent", self.OnMotion) def OnMotion(self, obj, event): iren = obj.GetInteractor() renwin = iren.GetRenderWindow() ren = renwin.GetRenderers().GetFirstRenderer() x, y = iren.GetEventPosition() # invert Y value actualY = ren.GetSize()[1] - y # dim all actors for (index, actor) in enumerate(self.actorList): (zValue, cellType, dimColor, brightColor) = self.actorData[index] actor.GetProperty().SetDiffuseColor(*dimColor) self.cellPicker.Pick(x, actualY, 0, ren) dataSet = self.cellPicker.GetDataSet() if dataSet is not None: # highlight picked actor for (index, actor) in enumerate(self.actorList): if actor.GetMapper().GetInput() == dataSet: (zOffset, cellType, dimColor, brightColor) = self.actorData[index] actor.GetProperty().SetDiffuseColor(*brightColor) renwin.Render() # simple point coords used by both actors coords = [(0.0, 0.0), (1.0, 0.0), (1.0, 1.0), (0.0, 1.0)] actorData = [(1.0, vtk.VTK_POLY_LINE, (0.5,0.0,0.0), (1.0, 0.0, 0.0)), (0.0, vtk.VTK_QUAD, (0.0, 0.0, 0.5), (0.0, 0.0, 1.0))] ren = vtk.vtkRenderer() renwin = vtk.vtkRenderWindow() renwin.AddRenderer(ren) actorList = [] for data in actorData: (zValue, cellType, dimColor, brightColor) = data points = vtk.vtkPoints() for (pointIndex, coord) in enumerate(coords): points.InsertPoint(pointIndex, coord[0], coord[1], zValue) idList = vtk.vtkIdList() idList.SetNumberOfIds(len(coords)) for pointIndex in range(len(coords)): idList.SetId(pointIndex, pointIndex) cells = vtk.vtkCellArray() cells.InsertNextCell(idList) grid = vtk.vtkUnstructuredGrid() grid.SetPoints(points) grid.SetCells(cellType, cells) mapper = vtk.vtkDataSetMapper() mapper.SetInput(grid) actor = vtk.vtkActor() actor.SetMapper(mapper) actor.GetProperty().SetRepresentation(1) actor.GetProperty().SetLineWidth(5.0) actor.GetProperty().SetDiffuseColor(*dimColor) ren.AddActor(actor) actorList.append(actor) interactor = vtk.vtkRenderWindowInteractor() interactor.SetInteractorStyle(MyInteractorStyle(actorData, actorList)) interactor.SetRenderWindow(renwin) interactor.Initialize() interactor.Start() -----Original Message----- From: David Gobbi [mailto:david.gobbi at gmail.com ] Sent: Tuesday, December 11, 2012 9:08 AM To: David vanEe Cc: vtkusers at vtk.org Subject: Re: [vtkusers] vtkCellPicker failing to pick vtkPolyLine (using Python and wx) Hi David, I was the one who made the changes to the vtkCellPicker code, and I'd be glad to investigate to see why the behavior changed. Can you send me an example that uses just python, i.e. no wx? - David On Tue, Dec 11, 2012 at 9:26 AM, David vanEe wrote: Hi all, I've recently updated my VTK from 5.4 to 5.10.1, and some old vtkCellPicker code isn't doing what I want anymore. This 'simple' example works fine in 5.4 (both the blue and red actor highlight when you mouse-over them), but in 5.10.1 only the blue (quad) actor works. The only difference between the two actors (aside from coordinates and colors) is the cellType of vtk.VTK_POLY_LINE vs vtk.VTK_QUAD. I've tried looking for changes in the pick routine, but vtkCellPicker.cxx has undergone substantial changes and I was unable to locate the cause. Any suggestions for getting the picker to pick the polyline? Thanks in advance, Dave import wx import vtk from vtk.wx.wxVTKRenderWindowInteractor import wxVTKRenderWindowInteractor class myVTKInteractor(wxVTKRenderWindowInteractor): def __init__(self, parent): wxVTKRenderWindowInteractor.__init__(self, parent, -1) self.Enable(1) self.AddObserver("ExitEvent", lambda o,e,f=self: f.Close()) self.ren = vtk.vtkRenderer() self.GetRenderWindow().AddRenderer(self.ren) # simple point coords used by both actors coords = [(0.0, 0.0), (1.0, 0.0), (1.0, 1.0), (0.0, 1.0)] self.actorData = [(1.0, vtk.VTK_POLY_LINE, (0.5,0.0,0.0), (1.0, 0.0, 0.0)), (0.0, vtk.VTK_QUAD, (0.0, 0.0, 0.5), (0.0, 0.0, 1.0))] self.actorList = [] for data in self.actorData: (zValue, cellType, dimColor, brightColor) = data points = vtk.vtkPoints() for (pointIndex, coord) in enumerate(coords): points.InsertPoint(pointIndex, coord[0], coord[1], zValue) idList = vtk.vtkIdList() idList.SetNumberOfIds(len(coords)) for pointIndex in range(len(coords)): idList.SetId(pointIndex, pointIndex) cells = vtk.vtkCellArray() cells.InsertNextCell(idList) grid = vtk.vtkUnstructuredGrid() grid.SetPoints(points) grid.SetCells(cellType, cells) mapper = vtk.vtkDataSetMapper() mapper.SetInput(grid) actor = vtk.vtkActor() actor.SetMapper(mapper) actor.GetProperty().SetRepresentation(1) actor.GetProperty().SetLineWidth(5.0) actor.GetProperty().SetDiffuseColor(*dimColor) self.ren.AddActor(actor) self.actorList.append(actor) self.cellPicker = vtk.vtkCellPicker() def OnMotion(self, event): # invert Y value actualY = self.ren.GetSize()[1] - event.GetY() # dim all actors for (index, actor) in enumerate(self.actorList): (zValue, cellType, dimColor, brightColor) = self.actorData[index] actor.GetProperty().SetDiffuseColor(*dimColor) self.cellPicker.Pick(event.GetX(), actualY, 0, self.ren) dataSet = self.cellPicker.GetDataSet() if dataSet is not None: # highlight picked actor for (index, actor) in enumerate(self.actorList): if actor.GetMapper().GetInput() == dataSet: (zOffset, cellType, dimColor, brightColor) = self.actorData[index] actor.GetProperty().SetDiffuseColor(*brightColor) self.Render() def wxVTKRenderWindowInteractorExample(): app = wx.PySimpleApp() frame = wx.Frame(None, -1, "wxVTKRenderWindowInteractor", size=(400,400)) widget = myVTKInteractor(frame) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(widget, 1, wx.EXPAND) frame.SetSizer(sizer) frame.Layout() frame.Show() app.MainLoop() if __name__ == "__main__": wxVTKRenderWindowInteractorExample() -- David A. Van Ee, BASc, EIT Convergent Manufacturing Technologies Inc. 6190 Agronomy Rd, Suite 403 Vancouver BC Canada V6T 1Z3 Email: david.vanee at convergent.ca | Tel: 604-822-9682 x103 WWW: http://www.convergent.ca | Fax: 604-822-9659 _______________________________________________ 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://www.vtk.org/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From lobo.theslayer at gmail.com Tue Dec 11 14:17:18 2012 From: lobo.theslayer at gmail.com (Rodrigo Lovera) Date: Tue, 11 Dec 2012 14:17:18 -0500 Subject: [vtkusers] Question on vtkContourWidget Message-ID: Hello everyone, I've applied the contour widget into the 4paneviewer example into VTK Source directory. It's applied on QT+VTK. My question is on how can I make it to draw the contour over every single slice of a volume. I noticed it only appear over the first slice and I need it to appear over every single slice so I could draw contour over any of the other slices and get area computing. If anyone can help me solve these problem with the contour widget or what option to apply to get to work on all planes 'd be much appreciate. Thx in advance, Regards -- *Rodrigo* -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Tue Dec 11 14:35:54 2012 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 11 Dec 2012 12:35:54 -0700 Subject: [vtkusers] vtkCellPicker failing to pick vtkPolyLine (using Python and wx) In-Reply-To: <-7482591407968221053@unknownmsgid> References: <75E3C47D9F67634F939FA0668CDF1D0B8602B7A376@MAIL4.exchange.electric.net> <75E3C47D9F67634F939FA0668CDF1D0B8602B7A377@MAIL4.exchange.electric.net> <-7482591407968221053@unknownmsgid> Message-ID: Hi Craig, The Pick() method takes the renderer (i.e. the viewport) as a parameter, so it is up to whichever code is calling the picker to determine what viewport the mouse is interacting with. Hence the problem you are seeing cannot be related to the picker, it must be related to the widget/representation/interactor. - David On Tue, Dec 11, 2012 at 12:12 PM, Craig Henderson wrote: > Hi, > Could this be related to the problem I asked about a few days ago? I haven't > had any responses. > http://www.vtk.org/pipermail/vtkusers/2012-December/126783.html > > Thanks > Craig > > On 11 Dec 2012, at 18:27, David Gobbi wrote: > > Hi David, > > You can get the polyline picking to work by increasing the tolerance: > > self.cellPicker.SetTolerance(0.005) > > I'll continue looking through the code to see why the new code > behaves differently from the old, though. I suspect there have > been minor changes to the way that tolerances are applied. > > - David > > > On Tue, Dec 11, 2012 at 10:51 AM, David vanEe > wrote: > > Sure, this version will work with just python/vtk. Thanks for taking a > look. > > > > import vtk > > > class MyInteractorStyle(vtk.vtkInteractorStyleTrackballCamera): > > def __init__(self, actorData, actorList): > > > self.actorData = actorData > > self.actorList = actorList > > self.cellPicker = vtk.vtkCellPicker() > > > self.AddObserver("MouseMoveEvent", self.OnMotion) > > > def OnMotion(self, obj, event): > > > iren = obj.GetInteractor() > > renwin = iren.GetRenderWindow() > > ren = renwin.GetRenderers().GetFirstRenderer() > > > x, y = iren.GetEventPosition() > > > # invert Y value > > actualY = ren.GetSize()[1] - y > > > # dim all actors > > for (index, actor) in enumerate(self.actorList): > > (zValue, cellType, dimColor, brightColor) = self.actorData[index] > > actor.GetProperty().SetDiffuseColor(*dimColor) > > > self.cellPicker.Pick(x, actualY, 0, ren) > > dataSet = self.cellPicker.GetDataSet() > > > if dataSet is not None: > > # highlight picked actor > > for (index, actor) in enumerate(self.actorList): > > if actor.GetMapper().GetInput() == dataSet: > > (zOffset, cellType, dimColor, brightColor) = > self.actorData[index] > > actor.GetProperty().SetDiffuseColor(*brightColor) > > > renwin.Render() > > > # simple point coords used by both actors > > coords = [(0.0, 0.0), > > (1.0, 0.0), > > (1.0, 1.0), > > (0.0, 1.0)] > > > actorData = [(1.0, vtk.VTK_POLY_LINE, (0.5,0.0,0.0), (1.0, 0.0, 0.0)), > > (0.0, vtk.VTK_QUAD, (0.0, 0.0, 0.5), (0.0, 0.0, 1.0))] > > > ren = vtk.vtkRenderer() > > > renwin = vtk.vtkRenderWindow() > > renwin.AddRenderer(ren) > > > actorList = [] > > for data in actorData: > > (zValue, cellType, dimColor, brightColor) = data > > > points = vtk.vtkPoints() > > for (pointIndex, coord) in enumerate(coords): > > points.InsertPoint(pointIndex, coord[0], coord[1], zValue) > > > idList = vtk.vtkIdList() > > idList.SetNumberOfIds(len(coords)) > > for pointIndex in range(len(coords)): > > idList.SetId(pointIndex, pointIndex) > > cells = vtk.vtkCellArray() > > cells.InsertNextCell(idList) > > > grid = vtk.vtkUnstructuredGrid() > > grid.SetPoints(points) > > grid.SetCells(cellType, cells) > > > mapper = vtk.vtkDataSetMapper() > > mapper.SetInput(grid) > > > actor = vtk.vtkActor() > > actor.SetMapper(mapper) > > actor.GetProperty().SetRepresentation(1) > > actor.GetProperty().SetLineWidth(5.0) > > actor.GetProperty().SetDiffuseColor(*dimColor) > > > ren.AddActor(actor) > > actorList.append(actor) > > > interactor = vtk.vtkRenderWindowInteractor() > > interactor.SetInteractorStyle(MyInteractorStyle(actorData, actorList)) > > interactor.SetRenderWindow(renwin) > > > interactor.Initialize() > > interactor.Start() > > > > > -----Original Message----- > > From: David Gobbi [mailto:david.gobbi at gmail.com] > > Sent: Tuesday, December 11, 2012 9:08 AM > > To: David vanEe > > Cc: vtkusers at vtk.org > > Subject: Re: [vtkusers] vtkCellPicker failing to pick vtkPolyLine (using > Python and wx) > > > Hi David, > > > I was the one who made the changes to the vtkCellPicker code, and I'd be > glad to investigate to see why the behavior changed. > > > Can you send me an example that uses just python, i.e. no wx? > > > - David > > > On Tue, Dec 11, 2012 at 9:26 AM, David vanEe > wrote: > > Hi all, > > > > > I've recently updated my VTK from 5.4 to 5.10.1, and some old > > vtkCellPicker code isn't doing what I want anymore. This 'simple' > > example works fine in > > 5.4 (both the blue and red actor highlight when you mouse-over them), > > but in > > 5.10.1 only the blue (quad) actor works. The only difference between > > the two actors (aside from coordinates and colors) is the cellType of > > vtk.VTK_POLY_LINE vs vtk.VTK_QUAD. > > > > > I've tried looking for changes in the pick routine, but > > vtkCellPicker.cxx has undergone substantial changes and I was unable > > to locate the cause. Any suggestions for getting the picker to pick the > polyline? > > > > > Thanks in advance, > > > Dave > > > > > > > import wx > > > import vtk > > > > > from vtk.wx.wxVTKRenderWindowInteractor import > > wxVTKRenderWindowInteractor > > > > > class myVTKInteractor(wxVTKRenderWindowInteractor): > > > def __init__(self, parent): > > > wxVTKRenderWindowInteractor.__init__(self, parent, -1) > > > > > self.Enable(1) > > > self.AddObserver("ExitEvent", lambda o,e,f=self: f.Close()) > > > > > self.ren = vtk.vtkRenderer() > > > self.GetRenderWindow().AddRenderer(self.ren) > > > > > # simple point coords used by both actors > > > coords = [(0.0, 0.0), > > > (1.0, 0.0), > > > (1.0, 1.0), > > > (0.0, 1.0)] > > > > > self.actorData = [(1.0, vtk.VTK_POLY_LINE, (0.5,0.0,0.0), > > (1.0, 0.0, 0.0)), > > > (0.0, vtk.VTK_QUAD, (0.0, 0.0, 0.5), (0.0, > > 0.0, 1.0))] > > > > > self.actorList = [] > > > for data in self.actorData: > > > (zValue, cellType, dimColor, brightColor) = data > > > > > points = vtk.vtkPoints() > > > for (pointIndex, coord) in enumerate(coords): > > > points.InsertPoint(pointIndex, coord[0], coord[1], > > zValue) > > > > > idList = vtk.vtkIdList() > > > idList.SetNumberOfIds(len(coords)) > > > for pointIndex in range(len(coords)): > > > idList.SetId(pointIndex, pointIndex) > > > cells = vtk.vtkCellArray() > > > cells.InsertNextCell(idList) > > > > > grid = vtk.vtkUnstructuredGrid() > > > grid.SetPoints(points) > > > grid.SetCells(cellType, cells) > > > > > mapper = vtk.vtkDataSetMapper() > > > mapper.SetInput(grid) > > > > > actor = vtk.vtkActor() > > > actor.SetMapper(mapper) > > > actor.GetProperty().SetRepresentation(1) > > > actor.GetProperty().SetLineWidth(5.0) > > > actor.GetProperty().SetDiffuseColor(*dimColor) > > > > > self.ren.AddActor(actor) > > > self.actorList.append(actor) > > > > > self.cellPicker = vtk.vtkCellPicker() > > > > > > > def OnMotion(self, event): > > > > > # invert Y value > > > actualY = self.ren.GetSize()[1] - event.GetY() > > > > > # dim all actors > > > for (index, actor) in enumerate(self.actorList): > > > (zValue, cellType, dimColor, brightColor) = > > self.actorData[index] > > > actor.GetProperty().SetDiffuseColor(*dimColor) > > > > > self.cellPicker.Pick(event.GetX(), actualY, 0, self.ren) > > > dataSet = self.cellPicker.GetDataSet() > > > > > if dataSet is not None: > > > # highlight picked actor > > > for (index, actor) in enumerate(self.actorList): > > > if actor.GetMapper().GetInput() == dataSet: > > > (zOffset, cellType, dimColor, brightColor) = > > self.actorData[index] > > > actor.GetProperty().SetDiffuseColor(*brightColor) > > > > > self.Render() > > > > > > > def wxVTKRenderWindowInteractorExample(): > > > app = wx.PySimpleApp() > > > > > frame = wx.Frame(None, -1, "wxVTKRenderWindowInteractor", > > size=(400,400)) > > > > > widget = myVTKInteractor(frame) > > > sizer = wx.BoxSizer(wx.VERTICAL) > > > sizer.Add(widget, 1, wx.EXPAND) > > > frame.SetSizer(sizer) > > > frame.Layout() > > > > > frame.Show() > > > > > app.MainLoop() > > > > > if __name__ == "__main__": > > > wxVTKRenderWindowInteractorExample() > > > > > > > > > -- > > > David A. Van Ee, BASc, EIT > > > Convergent Manufacturing Technologies Inc. > > > 6190 Agronomy Rd, Suite 403 > > > Vancouver BC Canada V6T 1Z3 > > > > > Email: david.vanee at convergent.ca | Tel: 604-822-9682 x103 > > > WWW: http://www.convergent.ca | Fax: 604-822-9659 From Gergely.Debreczeni at cern.ch Tue Dec 11 16:34:38 2012 From: Gergely.Debreczeni at cern.ch (Gergely Debreczeni) Date: Tue, 11 Dec 2012 21:34:38 +0000 Subject: [vtkusers] visualizing 2d surface as a collection of 1d graph Message-ID: <3BC77CF193B3DD4BAEBD9FEC04715DE351F66249@CERNXCHG31.cern.ch> Hello, I have a grid as a result of simulation x,y,z. I want to visualize it in a way that for every y value a solid line as a function of of x,z is plotted. With other words I'd like to visualize the x,y,z surface but interpolating only in the x direction, so that graphs belonging to different y value can be distinguished from each other despite being close. What is the best VYK object and visualisation method to use for the purpose ? DensArray ? PointCloud ? thanks a lot for your help in advance, Gergely From daviddoria at gmail.com Tue Dec 11 16:41:59 2012 From: daviddoria at gmail.com (David Doria) Date: Tue, 11 Dec 2012 16:41:59 -0500 Subject: [vtkusers] visualizing 2d surface as a collection of 1d graph In-Reply-To: <3BC77CF193B3DD4BAEBD9FEC04715DE351F66249@CERNXCHG31.cern.ch> References: <3BC77CF193B3DD4BAEBD9FEC04715DE351F66249@CERNXCHG31.cern.ch> Message-ID: On Tue, Dec 11, 2012 at 4:34 PM, Gergely Debreczeni < Gergely.Debreczeni at cern.ch> wrote: > Hello, > > I have a grid as a result of simulation x,y,z. > > I want to visualize it in a way that for every y value a > solid line as a function of of x,z is plotted. > > With other words I'd like to visualize the x,y,z surface > but interpolating only in the x direction, so that graphs > belonging to different y value can be distinguished from > each other despite being close. > > What is the best VYK object and visualisation method > to use for the purpose ? DensArray ? PointCloud ? > > thanks a lot for your help in advance, > Gergely > I would loop over the rows of your grid and create polylines with the points being your (x,z) values and the y coordinate being a counter (which of course you should scale so the spacing makes sense relative to the magnitude of your data). You can create the polylines like this: http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/PolyLine). You could even do something like alternate the color of every other polyline so they are easier to distinguish. Hope that helps, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From Gergely.Debreczeni at cern.ch Tue Dec 11 16:57:20 2012 From: Gergely.Debreczeni at cern.ch (Gergely Debreczeni) Date: Tue, 11 Dec 2012 21:57:20 +0000 Subject: [vtkusers] visualizing 2d surface as a collection of 1d graph In-Reply-To: References: <3BC77CF193B3DD4BAEBD9FEC04715DE351F66249@CERNXCHG31.cern.ch>, Message-ID: <3BC77CF193B3DD4BAEBD9FEC04715DE351F662C6@CERNXCHG31.cern.ch> Thanks a lot for the prompt help ! I'll have a look to this suggestions ! Best, Gergely ________________________________ From: David Doria [daviddoria at gmail.com] Sent: 11 December 2012 22:41 To: Gergely Debreczeni Cc: vtkusers at vtk.org Subject: Re: [vtkusers] visualizing 2d surface as a collection of 1d graph On Tue, Dec 11, 2012 at 4:34 PM, Gergely Debreczeni > wrote: Hello, I have a grid as a result of simulation x,y,z. I want to visualize it in a way that for every y value a solid line as a function of of x,z is plotted. With other words I'd like to visualize the x,y,z surface but interpolating only in the x direction, so that graphs belonging to different y value can be distinguished from each other despite being close. What is the best VYK object and visualisation method to use for the purpose ? DensArray ? PointCloud ? thanks a lot for your help in advance, Gergely I would loop over the rows of your grid and create polylines with the points being your (x,z) values and the y coordinate being a counter (which of course you should scale so the spacing makes sense relative to the magnitude of your data). You can create the polylines like this: http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/PolyLine). You could even do something like alternate the color of every other polyline so they are easier to distinguish. Hope that helps, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From srikanthviit at gmail.com Tue Dec 11 18:49:52 2012 From: srikanthviit at gmail.com (srikanth bhattad) Date: Tue, 11 Dec 2012 18:49:52 -0500 Subject: [vtkusers] Blinking/Glowing an actor In-Reply-To: References: Message-ID: Hi, I am a newbie in VTK coding. I have VTK 5.10 installed on my PC running windows XP.. I am trying to develop an application where I need to blink or glow or change the color of an actor. I am trying out on one of the demo example cone4 that came with the source code. My apologies if its a stupid question but I was wondering if I can change the properties of actor like color while it is rendered and running the window-interactor. Since from what I have understood, once the interactor runs, the actor can be moved but I cant seem to change its properties since it continues the interactor loop. I have a snippet of the code I am running, may be it might help to understand what I intend to do. The cone moves and changes color at every iteration (2 second per iteration). But if I also simultaneously want to interact which I try to do by uncommenting the highlighted text, it wont serve the purpose. Any thoughts of how I can accomplish this blinking actor. I would really appreciate your help. Thanks, Srikanth for (i = 1; i < 360; i++) { if (i % 2 ==0) // if i is even number { coneActor2->GetProperty()->SetColor(0.2, 0.63, 0.79);}// change to color 1 else // if is odd number { coneActor2->GetProperty()->SetColor(0.7, 0.2, 0.19);} // change to color 2 // render the image renWin->Render(); //iren->Initialize(); //iren->Start(); // rotate the active camera by one degree ren1->GetActiveCamera()->Azimuth( 10 ); Sleep(2000); } -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexmalvtk at gmail.com Tue Dec 11 20:17:47 2012 From: alexmalvtk at gmail.com (Alex Malyushytskyy) Date: Tue, 11 Dec 2012 17:17:47 -0800 Subject: [vtkusers] Static Link VTK In-Reply-To: References: Message-ID: On Mon, Dec 10, 2012 at 6:39 PM, John Drescher wrote: > I can tell you that I have never used static Qt with my static vtk > because the open source Qt license prohibits you from compiling Qt > statically. Well at least it did the last time I checked. ... > > John It is not a problem if you own a commercial license. And even in case of LGPL it this is not true., You could provide your object files, if you do not want to provide source code. All point in restricting is to allow user to be able to update Qt to newer version. As for me I find this restriction stupid, cause even upgrading compiler will result in fail to link the code. But this should be discussed at instead of this forum, not here. Alex From gongweixue at sina.com Wed Dec 12 01:18:03 2012 From: gongweixue at sina.com (gongweixue) Date: Wed, 12 Dec 2012 14:18:03 +0800 Subject: [vtkusers] Problem with color after using vtkClipPolyData Message-ID: hi guys, I used a vtkClipPolyData to clip polydata, and I found that the color of surfaces after clipping is changed. So,dose anybody know the reason? here is my code. //////////////////////code///////////////////////////// vtkPolyDataReader *reader=vtkPolyDataReader::New(); reader->SetFileName(FILENAME); reader->Update(); vtkClipPolyData * clipper=vtkClipPolyData::New(); clipper->SetInput(normals->GetOutput()); vtkPlane * plane = vtkPlane::New(); plane->SetOrigin(0.5,0,0); plane->SetNormal(1,1,1); clipper->SetClipFunction(plane); clipper->SetValue(0.5); clipper->SetInsideOut(1); clipper->Update(); vtkPolyDataMapper *mapper=vtkPolyDataMapper::New(); mapper->SetInput(clipper->GetOutput()); vtkActor *actor=vtkActor::New(); actor->SetMapper(mapper); vtkRenderer *ren1= vtkRenderer::New(); ren1->AddActor( actor ); ren1->SetBackground( 0.1, 0.2, 0.4 ); vtkRenderWindow *renWin = vtkRenderWindow::New(); renWin->AddRenderer( ren1 ); renWin->SetSize( 600, 600 ); vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New(); iren->SetRenderWindow(renWin); vtkInteractorStyleTrackballCamera *style = vtkInteractorStyleTrackballCamera::New(); iren->SetInteractorStyle(style); iren->Initialize(); iren->Start(); /////////////////////////////////////////////// And here is the pic: http://p13.freep.cn/p.aspx?u=v20_p13_photo_1212121410379520_0.jpg I will appreciate any suggestion very much! -------------- next part -------------- An HTML attachment was scrubbed... URL: From Saneesh at ddd.co.jp Wed Dec 12 04:03:32 2012 From: Saneesh at ddd.co.jp (saneeshnair) Date: Wed, 12 Dec 2012 01:03:32 -0800 (PST) Subject: [vtkusers] vtkUnstructuredGrid* from a dll Message-ID: <1355303012325-5717564.post@n5.nabble.com> Hi All, I have a dll which reads a STL file, apply vtkDelaunay3D filter and return vtkUnstructuredGrid*.Then in my application when I try to display the vtkUnstructuredGrid* it fails. Nothing is displayed.But if I try to display the vtkUnstructuredGrid* inside the dll itself it is working. SampleStlLoader.cpp SampleStlLoader.h these are my dll source.If I try to implement the display method outside the dll it fails.Regards,Saneesh -- View this message in context: http://vtk.1045678.n5.nabble.com/vtkUnstructuredGrid-from-a-dll-tp5717564.html Sent from the VTK - Users mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Gergely.Debreczeni at cern.ch Wed Dec 12 04:22:26 2012 From: Gergely.Debreczeni at cern.ch (Gergely Debreczeni) Date: Wed, 12 Dec 2012 09:22:26 +0000 Subject: [vtkusers] visualizing 2d surface as a collection of 1d graph In-Reply-To: References: <3BC77CF193B3DD4BAEBD9FEC04715DE351F66249@CERNXCHG31.cern.ch>, Message-ID: <3BC77CF193B3DD4BAEBD9FEC04715DE351F66408@CERNXCHG31.cern.ch> Hi David ! I had a look to this link. The way as it creates the PolyLine seems slow for me for my problem I have a grid like 2000 x 1000, i.e. I want to plot 1000 polyline of 2000 element long. Is there a faster way for this ? I need min 10 fps but 20-25 would be better. (Time dependent simulation.) thans, Gergely ________________________________ From: David Doria [daviddoria at gmail.com] Sent: 11 December 2012 22:41 To: Gergely Debreczeni Cc: vtkusers at vtk.org Subject: Re: [vtkusers] visualizing 2d surface as a collection of 1d graph On Tue, Dec 11, 2012 at 4:34 PM, Gergely Debreczeni > wrote: Hello, I have a grid as a result of simulation x,y,z. I want to visualize it in a way that for every y value a solid line as a function of of x,z is plotted. With other words I'd like to visualize the x,y,z surface but interpolating only in the x direction, so that graphs belonging to different y value can be distinguished from each other despite being close. What is the best VYK object and visualisation method to use for the purpose ? DensArray ? PointCloud ? thanks a lot for your help in advance, Gergely I would loop over the rows of your grid and create polylines with the points being your (x,z) values and the y coordinate being a counter (which of course you should scale so the spacing makes sense relative to the magnitude of your data). You can create the polylines like this: http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/PolyLine). You could even do something like alternate the color of every other polyline so they are easier to distinguish. Hope that helps, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From thiebault at artenum.com Wed Dec 12 04:03:37 2012 From: thiebault at artenum.com (=?iso-8859-1?Q?Beno=EEt_Thi=E9bault?=) Date: Wed, 12 Dec 2012 10:03:37 +0100 Subject: [vtkusers] Fwd: [CMake] CMAKE_MAKE_PROGRAM is not set - Win7 and Visual Studio 10 References: <404B71B8-F346-4B85-B958-A97657F1D945@artenum.com> Message-ID: Hi everyone, I sent this question on CMake mailing list a week ago and never had any answer. As it deals with compiling VTK, I'm thinking maybe some of you have a solution. Kind regards, Beno?t D?but du message r?exp?di? : > De : Beno?t Thi?bault > Date : 5 d?cembre 2012 14:21:23 HNEC > ? : cmake at cmake.org > Objet : [CMake] CMAKE_MAKE_PROGRAM is not set - Win7 and Visual Studio 10 > > Hi everyone, > > I am trying to compile VTK on Windows 7 64bits with Visual Studio 10. > > But when I click on "configure" in CMake, it shows the following error message: > > CMake Error: CMake was unable to find a build program corresponding to "Visual Studio 10 Win64". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool. > CMake Error: Could not find cmake module file:C:/Users/artenum/Downloads/vtk-5.8.0/build/CMakeFiles/2.8.10.2/CMakeCCompiler.cmake > CMake Error: Could not find cmake module file:C:/Users/artenum/Downloads/vtk-5.8.0/build/CMakeFiles/2.8.10.2/CMakeCXXCompiler.cmake > Configuring incomplete, errors occurred! > > I looked at the CMakeVS10FindMake.cmake file located in C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules and found the following command: > > find_program(CMAKE_MAKE_PROGRAM > NAMES devenv > HINTS > [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;EnvironmentDirectory] > [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup;Dbghelp_path] > "$ENV{ProgramFiles}/Microsoft Visual Studio 10.0/Common7/IDE" > "$ENV{ProgramFiles}/Microsoft Visual Studio10.0/Common7/IDE" > "$ENV{ProgramFiles}/Microsoft Visual Studio 10/Common7/IDE" > "$ENV{ProgramFiles}/Microsoft Visual Studio10/Common7/IDE" > "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 10.0/Common7/IDE" > "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio10.0/Common7/IDE" > "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 10/Common7/IDE" > "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio10/Common7/IDE" > "/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/" > "/Program Files/Microsoft Visual Studio 10/Common7/IDE/" > ) > > Here a copy/paste of the path of my Visual Studio 10 installation (and in particular the IDE folder): > C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE > > I should add that my Windows 7 installation is in French. This means that the "Program Files" folder is named "Programmes" (in French) but "Progam Files (x86)" is in english. > > I have added the two following lines in the command to be sure, but it still does not work: > "/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/" > "/Program Files (x86)/Microsoft Visual Studio 10/Common7/IDE/" > > What should I do? > > Kind regards, > > Ben -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.strecha at gmail.com Wed Dec 12 06:02:58 2012 From: j.strecha at gmail.com (Johannes Strecha) Date: Wed, 12 Dec 2012 12:02:58 +0100 Subject: [vtkusers] vtk nightly build options for multiprocessor usage Message-ID: Hello everyone, I compiled vtk-sources from the git repository. I observed that vtk5.8 from the debian repository uses 4 cores to render an image but doesn't use the GPU (vtkRenderWindow.isDirect shows 0). My own build uses the GPU but only one CPU-core. What options do I have to set to use 4 cores? I already enabled some mpi-related options, but not mrmpi (because there seems to be an error in the makefiles, some source-files are not found - at least that was the case three weeks ago when I last built vtk). Kind regards, Johannes Strecha. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmrbcu at gmail.com Wed Dec 12 07:24:46 2012 From: jmrbcu at gmail.com (=?UTF-8?Q?Jos=C3=A9_M=2E_Rodriguez_Bacallao?=) Date: Wed, 12 Dec 2012 07:24:46 -0500 Subject: [vtkusers] image moved afer an orientation change In-Reply-To: References: Message-ID: no one please, is this normal? On Tue, Dec 11, 2012 at 9:45 AM, Jos? M. Rodriguez Bacallao < jmrbcu at gmail.com> wrote: > hi folks, I am trying to implement a MPR viewer, so far so good. I am > using the new image classes, this is test code: > > #!/usr/bin/env python > > import os > import gdcm, vtkgdcm, vtk > > > def key_press(sender, event): > key = interactor.GetKeySym() > style.SetCurrentRenderer(renderer) > if key == 'a': > print 'axial' > style.SetImageOrientation( > style.GetZViewRightVector(), > style.GetZViewUpVector() > ) > elif key == 'c': > print 'coronal' > style.SetImageOrientation( > style.GetYViewRightVector(), > style.GetYViewUpVector() > ) > elif key == 's': > print 'axial' > style.SetImageOrientation( > style.GetXViewRightVector(), > style.GetXViewUpVector() > ) > render_window.Render() > > > > interactor = vtk.vtkRenderWindowInteractor() > render_window = vtk.vtkRenderWindow() > render_window.SetSize(400, 400) > interactor.SetRenderWindow(render_window) > > style = vtk.vtkInteractorStyleImage() > style.SetInteractionModeToImageSlicing() > interactor.SetInteractorStyle(style) > style.AddObserver('CharEvent', key_press) > > print 'sorting files...' > path = '/home/jmrbcu/pictures/workpictures/dicom/BRAIN/' > files = [os.path.join(path, x) for x in os.listdir(path)] > > ipp = gdcm.IPPSorter() > ipp.SetComputeZSpacing(True) > ipp.SetZSpacingTolerance(1e-3) > result = ipp.Sort(files) > > sorted_files, zspacing = files, 0 > if result: > sorted_files = ipp.GetFilenames() > zspacing = ipp.GetZSpacing() > print 'files sorted, z spacing is: %s' % zspacing > else: > print 'cannot sort files, this is not a valid volume' > > vtk_files = vtk.vtkStringArray() > map(vtk_files.InsertNextValue, sorted_files) > > reader = vtkgdcm.vtkGDCMImageReader() > reader.FileLowerLeftOn() > reader.SetFileNames(vtk_files) > reader.Update() > > spacing = reader.GetOutput().GetSpacing() > change = vtk.vtkImageChangeInformation() > change.SetInputConnection(reader.GetOutputPort()) > change.SetOutputSpacing(spacing[0], spacing[1], zspacing) > > im = vtk.vtkImageResliceMapper() > im.SetInputConnection(change.GetOutputPort()) > im.SliceFacesCameraOn() > im.SliceAtFocalPointOn() > im.BorderOff() > > ip = vtk.vtkImageProperty() > ip.SetColorWindow(255) > ip.SetColorLevel(128) > ip.SetAmbient(0.0) > ip.SetDiffuse(1.0) > ip.SetOpacity(1.0) > ip.SetInterpolationTypeToLinear() > > ia = vtk.vtkImageSlice() > ia.SetMapper(im) > ia.SetProperty(ip) > > renderer = vtk.vtkRenderer() > renderer.AddViewProp(ia) > renderer.SetBackground(0 , 0, 0) > render_window.AddRenderer(renderer) > > style.SetCurrentRenderer(renderer) > style.SetZViewRightVector((1, 0, 0)) > style.SetZViewUpVector((0, -1, 0)) > > style.SetXViewRightVector((0, 1, 0)) > style.SetXViewUpVector((0, 0, 1)) > > style.SetYViewRightVector((1, 0, 0)) > style.SetYViewUpVector((0, 0, 1)) > style.SetImageOrientation(style.GetZViewRightVector(), > style.GetZViewUpVector()) > > # render the image > renderer.ResetCamera() > renderer.GetActiveCamera().ParallelProjectionOn() > renderer.ResetCameraClippingRange() > render_window.Render() > > interactor.Initialize() > interactor.Start() > > the problems arise in this sequence: > > 1- initially display the image: ok > 2- slice the image to a different slice with ctrl + mosue left: ok > 3- change the orientation to a different one (sagital or coronal, doesn't > matter): this is the problem, orientation of the image is changed fine to > the new one but the image is panned to a different position in the render > window/renderer, not the center of it and in a different slice (the middle > slice of the whole image) > > how can I avoid this, I mean, keep the image centered in the render > window/renderer when the image orientation is changed and in the correct > slice location? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Wed Dec 12 08:00:32 2012 From: daviddoria at gmail.com (David Doria) Date: Wed, 12 Dec 2012 08:00:32 -0500 Subject: [vtkusers] Blinking/Glowing an actor In-Reply-To: References: Message-ID: On Tue, Dec 11, 2012 at 6:49 PM, srikanth bhattad wrote: > > Hi, I am a newbie in VTK coding. I have VTK 5.10 installed on my PC > running windows XP.. I am trying to develop an application where I need to > blink or glow or change the color of an actor. I am trying out on one of > the demo example cone4 that came with the source code. My apologies if its > a stupid question but I was wondering if I can change the properties of > actor like color while it is rendered and running the window-interactor. > Since from what I have understood, once the interactor runs, the actor can > be moved but I cant seem to change its properties since it continues the > interactor loop. I have a snippet of the code I am running, may be it might > help to understand what I intend to do. The cone moves and changes color at > every iteration (2 second per iteration). But if I also simultaneously want > to interact which I try to do by uncommenting the highlighted text, it wont > serve the purpose. Any thoughts of how I can accomplish this blinking > actor. I would really appreciate your help. > > Thanks, > Srikanth > You should almost never have code after the interactor->Start() call. You need to use callbacks/events. Here is an example of using a timer to call a callback function: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/Animation . Inside the callback you can do whatever you want, including change the color of an actor (http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/ColorAnActor). David -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Wed Dec 12 08:51:42 2012 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 12 Dec 2012 06:51:42 -0700 Subject: [vtkusers] image moved afer an orientation change In-Reply-To: References: Message-ID: The slicing and the panning are both controlled via the camera's focal point. So slicing through the axial images causes the camera's FocalPoint to move in and out along the Z axis. Then, when you switch to a new orientation, this "Z" position is centered in the window. If you want to avoid this, you should save the FocalPoint for each view orientation. Then, you can restore the focal point before you call SetImageOrientation, e.g. camera.SetFocalPoint(focal_point_for_axial_view) camera.SetImageOrientation(orientation_for_axial_view) - David On Wed, Dec 12, 2012 at 5:24 AM, Jos? M. Rodriguez Bacallao wrote: > no one please, is this normal? > > > On Tue, Dec 11, 2012 at 9:45 AM, Jos? M. Rodriguez Bacallao > wrote: >> >> hi folks, I am trying to implement a MPR viewer, so far so good. I am >> using the new image classes, this is test code: >> >> #!/usr/bin/env python >> >> import os >> import gdcm, vtkgdcm, vtk >> >> >> def key_press(sender, event): >> key = interactor.GetKeySym() >> style.SetCurrentRenderer(renderer) >> if key == 'a': >> print 'axial' >> style.SetImageOrientation( >> style.GetZViewRightVector(), >> style.GetZViewUpVector() >> ) >> elif key == 'c': >> print 'coronal' >> style.SetImageOrientation( >> style.GetYViewRightVector(), >> style.GetYViewUpVector() >> ) >> elif key == 's': >> print 'axial' >> style.SetImageOrientation( >> style.GetXViewRightVector(), >> style.GetXViewUpVector() >> ) >> render_window.Render() >> >> >> >> interactor = vtk.vtkRenderWindowInteractor() >> render_window = vtk.vtkRenderWindow() >> render_window.SetSize(400, 400) >> interactor.SetRenderWindow(render_window) >> >> style = vtk.vtkInteractorStyleImage() >> style.SetInteractionModeToImageSlicing() >> interactor.SetInteractorStyle(style) >> style.AddObserver('CharEvent', key_press) >> >> print 'sorting files...' >> path = '/home/jmrbcu/pictures/workpictures/dicom/BRAIN/' >> files = [os.path.join(path, x) for x in os.listdir(path)] >> >> ipp = gdcm.IPPSorter() >> ipp.SetComputeZSpacing(True) >> ipp.SetZSpacingTolerance(1e-3) >> result = ipp.Sort(files) >> >> sorted_files, zspacing = files, 0 >> if result: >> sorted_files = ipp.GetFilenames() >> zspacing = ipp.GetZSpacing() >> print 'files sorted, z spacing is: %s' % zspacing >> else: >> print 'cannot sort files, this is not a valid volume' >> >> vtk_files = vtk.vtkStringArray() >> map(vtk_files.InsertNextValue, sorted_files) >> >> reader = vtkgdcm.vtkGDCMImageReader() >> reader.FileLowerLeftOn() >> reader.SetFileNames(vtk_files) >> reader.Update() >> >> spacing = reader.GetOutput().GetSpacing() >> change = vtk.vtkImageChangeInformation() >> change.SetInputConnection(reader.GetOutputPort()) >> change.SetOutputSpacing(spacing[0], spacing[1], zspacing) >> >> im = vtk.vtkImageResliceMapper() >> im.SetInputConnection(change.GetOutputPort()) >> im.SliceFacesCameraOn() >> im.SliceAtFocalPointOn() >> im.BorderOff() >> >> ip = vtk.vtkImageProperty() >> ip.SetColorWindow(255) >> ip.SetColorLevel(128) >> ip.SetAmbient(0.0) >> ip.SetDiffuse(1.0) >> ip.SetOpacity(1.0) >> ip.SetInterpolationTypeToLinear() >> >> ia = vtk.vtkImageSlice() >> ia.SetMapper(im) >> ia.SetProperty(ip) >> >> renderer = vtk.vtkRenderer() >> renderer.AddViewProp(ia) >> renderer.SetBackground(0 , 0, 0) >> render_window.AddRenderer(renderer) >> >> style.SetCurrentRenderer(renderer) >> style.SetZViewRightVector((1, 0, 0)) >> style.SetZViewUpVector((0, -1, 0)) >> >> style.SetXViewRightVector((0, 1, 0)) >> style.SetXViewUpVector((0, 0, 1)) >> >> style.SetYViewRightVector((1, 0, 0)) >> style.SetYViewUpVector((0, 0, 1)) >> style.SetImageOrientation(style.GetZViewRightVector(), >> style.GetZViewUpVector()) >> >> # render the image >> renderer.ResetCamera() >> renderer.GetActiveCamera().ParallelProjectionOn() >> renderer.ResetCameraClippingRange() >> render_window.Render() >> >> interactor.Initialize() >> interactor.Start() >> >> the problems arise in this sequence: >> >> 1- initially display the image: ok >> 2- slice the image to a different slice with ctrl + mosue left: ok >> 3- change the orientation to a different one (sagital or coronal, doesn't >> matter): this is the problem, orientation of the image is changed fine to >> the new one but the image is panned to a different position in the render >> window/renderer, not the center of it and in a different slice (the middle >> slice of the whole image) >> >> how can I avoid this, I mean, keep the image centered in the render >> window/renderer when the image orientation is changed and in the correct >> slice location? From david.gobbi at gmail.com Wed Dec 12 08:53:15 2012 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 12 Dec 2012 06:53:15 -0700 Subject: [vtkusers] image moved afer an orientation change In-Reply-To: References: Message-ID: On Wed, Dec 12, 2012 at 6:51 AM, David Gobbi wrote: > The slicing and the panning are both controlled via the camera's focal > point. So slicing through the axial images causes the camera's > FocalPoint to move in and out along the Z axis. Then, when you switch > to a new orientation, this "Z" position is centered in the window. > > If you want to avoid this, you should save the FocalPoint for each > view orientation. Then, you can restore the focal point before you > call SetImageOrientation, e.g. > > camera.SetFocalPoint(focal_point_for_axial_view) > camera.SetImageOrientation(orientation_for_axial_view) Typo, it should be: camera.SetFocalPoint(focal_point_for_axial_view) camera.SetImageOrientation(orientation_for_axial_view) > - David > > On Wed, Dec 12, 2012 at 5:24 AM, Jos? M. Rodriguez Bacallao > wrote: >> no one please, is this normal? >> >> >> On Tue, Dec 11, 2012 at 9:45 AM, Jos? M. Rodriguez Bacallao >> wrote: >>> >>> hi folks, I am trying to implement a MPR viewer, so far so good. I am >>> using the new image classes, this is test code: >>> >>> #!/usr/bin/env python >>> >>> import os >>> import gdcm, vtkgdcm, vtk >>> >>> >>> def key_press(sender, event): >>> key = interactor.GetKeySym() >>> style.SetCurrentRenderer(renderer) >>> if key == 'a': >>> print 'axial' >>> style.SetImageOrientation( >>> style.GetZViewRightVector(), >>> style.GetZViewUpVector() >>> ) >>> elif key == 'c': >>> print 'coronal' >>> style.SetImageOrientation( >>> style.GetYViewRightVector(), >>> style.GetYViewUpVector() >>> ) >>> elif key == 's': >>> print 'axial' >>> style.SetImageOrientation( >>> style.GetXViewRightVector(), >>> style.GetXViewUpVector() >>> ) >>> render_window.Render() >>> >>> >>> >>> interactor = vtk.vtkRenderWindowInteractor() >>> render_window = vtk.vtkRenderWindow() >>> render_window.SetSize(400, 400) >>> interactor.SetRenderWindow(render_window) >>> >>> style = vtk.vtkInteractorStyleImage() >>> style.SetInteractionModeToImageSlicing() >>> interactor.SetInteractorStyle(style) >>> style.AddObserver('CharEvent', key_press) >>> >>> print 'sorting files...' >>> path = '/home/jmrbcu/pictures/workpictures/dicom/BRAIN/' >>> files = [os.path.join(path, x) for x in os.listdir(path)] >>> >>> ipp = gdcm.IPPSorter() >>> ipp.SetComputeZSpacing(True) >>> ipp.SetZSpacingTolerance(1e-3) >>> result = ipp.Sort(files) >>> >>> sorted_files, zspacing = files, 0 >>> if result: >>> sorted_files = ipp.GetFilenames() >>> zspacing = ipp.GetZSpacing() >>> print 'files sorted, z spacing is: %s' % zspacing >>> else: >>> print 'cannot sort files, this is not a valid volume' >>> >>> vtk_files = vtk.vtkStringArray() >>> map(vtk_files.InsertNextValue, sorted_files) >>> >>> reader = vtkgdcm.vtkGDCMImageReader() >>> reader.FileLowerLeftOn() >>> reader.SetFileNames(vtk_files) >>> reader.Update() >>> >>> spacing = reader.GetOutput().GetSpacing() >>> change = vtk.vtkImageChangeInformation() >>> change.SetInputConnection(reader.GetOutputPort()) >>> change.SetOutputSpacing(spacing[0], spacing[1], zspacing) >>> >>> im = vtk.vtkImageResliceMapper() >>> im.SetInputConnection(change.GetOutputPort()) >>> im.SliceFacesCameraOn() >>> im.SliceAtFocalPointOn() >>> im.BorderOff() >>> >>> ip = vtk.vtkImageProperty() >>> ip.SetColorWindow(255) >>> ip.SetColorLevel(128) >>> ip.SetAmbient(0.0) >>> ip.SetDiffuse(1.0) >>> ip.SetOpacity(1.0) >>> ip.SetInterpolationTypeToLinear() >>> >>> ia = vtk.vtkImageSlice() >>> ia.SetMapper(im) >>> ia.SetProperty(ip) >>> >>> renderer = vtk.vtkRenderer() >>> renderer.AddViewProp(ia) >>> renderer.SetBackground(0 , 0, 0) >>> render_window.AddRenderer(renderer) >>> >>> style.SetCurrentRenderer(renderer) >>> style.SetZViewRightVector((1, 0, 0)) >>> style.SetZViewUpVector((0, -1, 0)) >>> >>> style.SetXViewRightVector((0, 1, 0)) >>> style.SetXViewUpVector((0, 0, 1)) >>> >>> style.SetYViewRightVector((1, 0, 0)) >>> style.SetYViewUpVector((0, 0, 1)) >>> style.SetImageOrientation(style.GetZViewRightVector(), >>> style.GetZViewUpVector()) >>> >>> # render the image >>> renderer.ResetCamera() >>> renderer.GetActiveCamera().ParallelProjectionOn() >>> renderer.ResetCameraClippingRange() >>> render_window.Render() >>> >>> interactor.Initialize() >>> interactor.Start() >>> >>> the problems arise in this sequence: >>> >>> 1- initially display the image: ok >>> 2- slice the image to a different slice with ctrl + mosue left: ok >>> 3- change the orientation to a different one (sagital or coronal, doesn't >>> matter): this is the problem, orientation of the image is changed fine to >>> the new one but the image is panned to a different position in the render >>> window/renderer, not the center of it and in a different slice (the middle >>> slice of the whole image) >>> >>> how can I avoid this, I mean, keep the image centered in the render >>> window/renderer when the image orientation is changed and in the correct >>> slice location? From david.gobbi at gmail.com Wed Dec 12 08:54:57 2012 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 12 Dec 2012 06:54:57 -0700 Subject: [vtkusers] image moved afer an orientation change In-Reply-To: References: Message-ID: Arrgh. Another typo. The code should be: camera.SetFocalPoint(focal_point_for_axial_view) style.SetImageOrientation(orientation_for_axial_view) And of course you should save the focal point for the previous orientation at the same time. - David On Wed, Dec 12, 2012 at 6:53 AM, David Gobbi wrote: > On Wed, Dec 12, 2012 at 6:51 AM, David Gobbi wrote: >> The slicing and the panning are both controlled via the camera's focal >> point. So slicing through the axial images causes the camera's >> FocalPoint to move in and out along the Z axis. Then, when you switch >> to a new orientation, this "Z" position is centered in the window. >> >> If you want to avoid this, you should save the FocalPoint for each >> view orientation. Then, you can restore the focal point before you >> call SetImageOrientation, e.g. >> >> camera.SetFocalPoint(focal_point_for_axial_view) >> camera.SetImageOrientation(orientation_for_axial_view) >> >> - David >> >> On Wed, Dec 12, 2012 at 5:24 AM, Jos? M. Rodriguez Bacallao >> wrote: >>> no one please, is this normal? >>> >>> >>> On Tue, Dec 11, 2012 at 9:45 AM, Jos? M. Rodriguez Bacallao >>> wrote: >>>> >>>> hi folks, I am trying to implement a MPR viewer, so far so good. I am >>>> using the new image classes, this is test code: >>>> >>>> #!/usr/bin/env python >>>> >>>> import os >>>> import gdcm, vtkgdcm, vtk >>>> >>>> >>>> def key_press(sender, event): >>>> key = interactor.GetKeySym() >>>> style.SetCurrentRenderer(renderer) >>>> if key == 'a': >>>> print 'axial' >>>> style.SetImageOrientation( >>>> style.GetZViewRightVector(), >>>> style.GetZViewUpVector() >>>> ) >>>> elif key == 'c': >>>> print 'coronal' >>>> style.SetImageOrientation( >>>> style.GetYViewRightVector(), >>>> style.GetYViewUpVector() >>>> ) >>>> elif key == 's': >>>> print 'axial' >>>> style.SetImageOrientation( >>>> style.GetXViewRightVector(), >>>> style.GetXViewUpVector() >>>> ) >>>> render_window.Render() >>>> >>>> >>>> >>>> interactor = vtk.vtkRenderWindowInteractor() >>>> render_window = vtk.vtkRenderWindow() >>>> render_window.SetSize(400, 400) >>>> interactor.SetRenderWindow(render_window) >>>> >>>> style = vtk.vtkInteractorStyleImage() >>>> style.SetInteractionModeToImageSlicing() >>>> interactor.SetInteractorStyle(style) >>>> style.AddObserver('CharEvent', key_press) >>>> >>>> print 'sorting files...' >>>> path = '/home/jmrbcu/pictures/workpictures/dicom/BRAIN/' >>>> files = [os.path.join(path, x) for x in os.listdir(path)] >>>> >>>> ipp = gdcm.IPPSorter() >>>> ipp.SetComputeZSpacing(True) >>>> ipp.SetZSpacingTolerance(1e-3) >>>> result = ipp.Sort(files) >>>> >>>> sorted_files, zspacing = files, 0 >>>> if result: >>>> sorted_files = ipp.GetFilenames() >>>> zspacing = ipp.GetZSpacing() >>>> print 'files sorted, z spacing is: %s' % zspacing >>>> else: >>>> print 'cannot sort files, this is not a valid volume' >>>> >>>> vtk_files = vtk.vtkStringArray() >>>> map(vtk_files.InsertNextValue, sorted_files) >>>> >>>> reader = vtkgdcm.vtkGDCMImageReader() >>>> reader.FileLowerLeftOn() >>>> reader.SetFileNames(vtk_files) >>>> reader.Update() >>>> >>>> spacing = reader.GetOutput().GetSpacing() >>>> change = vtk.vtkImageChangeInformation() >>>> change.SetInputConnection(reader.GetOutputPort()) >>>> change.SetOutputSpacing(spacing[0], spacing[1], zspacing) >>>> >>>> im = vtk.vtkImageResliceMapper() >>>> im.SetInputConnection(change.GetOutputPort()) >>>> im.SliceFacesCameraOn() >>>> im.SliceAtFocalPointOn() >>>> im.BorderOff() >>>> >>>> ip = vtk.vtkImageProperty() >>>> ip.SetColorWindow(255) >>>> ip.SetColorLevel(128) >>>> ip.SetAmbient(0.0) >>>> ip.SetDiffuse(1.0) >>>> ip.SetOpacity(1.0) >>>> ip.SetInterpolationTypeToLinear() >>>> >>>> ia = vtk.vtkImageSlice() >>>> ia.SetMapper(im) >>>> ia.SetProperty(ip) >>>> >>>> renderer = vtk.vtkRenderer() >>>> renderer.AddViewProp(ia) >>>> renderer.SetBackground(0 , 0, 0) >>>> render_window.AddRenderer(renderer) >>>> >>>> style.SetCurrentRenderer(renderer) >>>> style.SetZViewRightVector((1, 0, 0)) >>>> style.SetZViewUpVector((0, -1, 0)) >>>> >>>> style.SetXViewRightVector((0, 1, 0)) >>>> style.SetXViewUpVector((0, 0, 1)) >>>> >>>> style.SetYViewRightVector((1, 0, 0)) >>>> style.SetYViewUpVector((0, 0, 1)) >>>> style.SetImageOrientation(style.GetZViewRightVector(), >>>> style.GetZViewUpVector()) >>>> >>>> # render the image >>>> renderer.ResetCamera() >>>> renderer.GetActiveCamera().ParallelProjectionOn() >>>> renderer.ResetCameraClippingRange() >>>> render_window.Render() >>>> >>>> interactor.Initialize() >>>> interactor.Start() >>>> >>>> the problems arise in this sequence: >>>> >>>> 1- initially display the image: ok >>>> 2- slice the image to a different slice with ctrl + mosue left: ok >>>> 3- change the orientation to a different one (sagital or coronal, doesn't >>>> matter): this is the problem, orientation of the image is changed fine to >>>> the new one but the image is panned to a different position in the render >>>> window/renderer, not the center of it and in a different slice (the middle >>>> slice of the whole image) >>>> >>>> how can I avoid this, I mean, keep the image centered in the render >>>> window/renderer when the image orientation is changed and in the correct >>>> slice location? From Gerrick.Bivins at halliburton.com Wed Dec 12 09:01:06 2012 From: Gerrick.Bivins at halliburton.com (Gerrick Bivins) Date: Wed, 12 Dec 2012 14:01:06 +0000 Subject: [vtkusers] Java, SWT and SetInputConnection vs SetInput Message-ID: Hello, I'm in the process of evaluating vtk in an Eclipse RCP application. I've successfully used vtk in NetBeans RCP applications so I'm hoping for a similarly successful out come! Anyway, while experimenting with SWT, I've run into an issue where my SWT component that embeds a vtkPanel brings the entire application down if I setup my pipeline using SetInputConnection. If I switch it to SetInput, it works fine. I've seen similar behavoir with Swing and it had to do with threading. I'm new to SWT so it's not clear to me, if I want to use SetInputConnection/GetOutputPort for my pipeline setup, where is it "safe" to make these calls? @Override protected void createViewContent(Composite parent) { // TODO Auto-generated method stub Composite composite = new Composite(parent, SWT.EMBEDDED); parent.setLayout(new FillLayout()); Frame frame = SWT_AWT.new_Frame(composite); panel = new vtk.vtkPanel(); final vtkConeSource cone = new vtkConeSource(); cone.SetResolution(16); vtkPolyDataMapper coneMapper = new vtkPolyDataMapper(); coneMapper.SetInput(cone.GetOutput());//works //THIS crashes in the jvm and exits the application!!! // coneMapper.SetInputConnection(cone.GetOutputPort()); vtkActor coneActor = new vtkActor(); coneActor.SetMapper(coneMapper); panel.GetRenderer().AddActor(coneActor); frame.add(panel); frame.setBackground(Color.BLUE); } -------------- next part -------------- An HTML attachment was scrubbed... URL: From heiland at indiana.edu Wed Dec 12 09:43:28 2012 From: heiland at indiana.edu (Randy Heiland) Date: Wed, 12 Dec 2012 09:43:28 -0500 Subject: [vtkusers] Fwd: vtkChartXY, QVTKRenderWindowInteractor, PyQt4 References: Message-ID: <108DA403-A358-4AC6-9936-AFE544E688B0@indiana.edu> Forgot to cc list... Begin forwarded message: > From: Randy Heiland > Subject: Re: [vtkusers] vtkChartXY, QVTKRenderWindowInteractor, PyQt4 > Date: December 10, 2012 3:33:10 PM EST > To: "Marcus D. Hanwell" > > Hi Marcus, > > Moving on to barcharts? is it possible to specify the x-positioning and the width of bars? For example, at http://old.compucell3d.org/mediawiki1.7/index.php/Vtk_barcharts , I've specified 2 tables of values - the 1st having 2, the 2nd having 3. It seems the 1st is left-adjusted, i.e. each bar has its right-hand edge positioned on the x-coord; whereas the 2nd table of values is right-adjusted. Why is that? Is the API spelled out online? > > thanks! > -Randy > > > On Dec 6, 2012, at 11:17 AM, Marcus D. Hanwell wrote: > >> On Thu, Dec 6, 2012 at 10:27 AM, Randy Heiland wrote: >>> Continuing in my quest to use charts in our app, is it possible to arrange multiple markers/labels in a legend so that they appear side-by-side (horiz) instead of top-to-bottom? I've attached a simple Python example. >>> >> I think you found one we don't have yet ;-) We can draw the legend >> inline, or outside the chart but we don't have a property to draw the >> symbols side-by-side. It could probably be added if it was useful, and >> we had some time. >> >> Marcus > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Gerrick.Bivins at halliburton.com Wed Dec 12 09:43:07 2012 From: Gerrick.Bivins at halliburton.com (Gerrick Bivins) Date: Wed, 12 Dec 2012 14:43:07 +0000 Subject: [vtkusers] Java, SWT and SetInputConnection vs SetInput In-Reply-To: References: Message-ID: After a cup of coffee, I realized the problem. I had a version mismatch...the version of VTK used to generate the vtk.jar in my bundle was 5.7 and the dll's in my fragment were 5.10... Resolved that issue and things work as expected! ;) From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of Gerrick Bivins Sent: Wednesday, December 12, 2012 8:01 AM To: vtkusers at vtk.org Subject: [vtkusers] Java, SWT and SetInputConnection vs SetInput Hello, I'm in the process of evaluating vtk in an Eclipse RCP application. I've successfully used vtk in NetBeans RCP applications so I'm hoping for a similarly successful out come! Anyway, while experimenting with SWT, I've run into an issue where my SWT component that embeds a vtkPanel brings the entire application down if I setup my pipeline using SetInputConnection. If I switch it to SetInput, it works fine. I've seen similar behavoir with Swing and it had to do with threading. I'm new to SWT so it's not clear to me, if I want to use SetInputConnection/GetOutputPort for my pipeline setup, where is it "safe" to make these calls? @Override protected void createViewContent(Composite parent) { // TODO Auto-generated method stub Composite composite = new Composite(parent, SWT.EMBEDDED); parent.setLayout(new FillLayout()); Frame frame = SWT_AWT.new_Frame(composite); panel = new vtk.vtkPanel(); final vtkConeSource cone = new vtkConeSource(); cone.SetResolution(16); vtkPolyDataMapper coneMapper = new vtkPolyDataMapper(); coneMapper.SetInput(cone.GetOutput());//works //THIS crashes in the jvm and exits the application!!! // coneMapper.SetInputConnection(cone.GetOutputPort()); vtkActor coneActor = new vtkActor(); coneActor.SetMapper(coneMapper); panel.GetRenderer().AddActor(coneActor); frame.add(panel); frame.setBackground(Color.BLUE); } -------------- next part -------------- An HTML attachment was scrubbed... URL: From msotaquira at gmail.com Wed Dec 12 10:05:18 2012 From: msotaquira at gmail.com (Miguel Sotaquira) Date: Wed, 12 Dec 2012 16:05:18 +0100 Subject: [vtkusers] Fast N-ring neighbors computation on polydata Message-ID: Hi everyone, I have a 3D triangular mesh (vtkPolyData) and what I want to do is to compute the N-ring neighbors of each vertex in the mesh. By N-ring of neighbors I mean the set of neighbors within a distance of N (integer) edges from the vertex being evaluated. I've already came up with an implementation (Python) that comprises two steps: 1. First get the set of 1-ring neighbors of each vertex, using GetPointCells and GetCellPoints methods of vtkPolyData. This implementation is really fast. 2. To compute the N-ring neighbors I simply iterate on each vertex and its set of 1-ring neighbors and repeat the procedure until I obtain the complete set of N-ring neighbors. Step 2 uses nested loops and depending on the value of N and the size of the mesh it can take quite A LOT. So my question is: is there any implementation, or vtk class, that allows the FAST computation of such N-ring neighborhood? Thanks for any suggestion, Miguel -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmrbcu at gmail.com Wed Dec 12 11:21:25 2012 From: jmrbcu at gmail.com (=?UTF-8?Q?Jos=C3=A9_M=2E_Rodriguez_Bacallao?=) Date: Wed, 12 Dec 2012 11:21:25 -0500 Subject: [vtkusers] image moved afer an orientation change In-Reply-To: References: Message-ID: hi David: saving the focal point did the trick!!! thanks very much another question, how do I know the current slice number given the camera parameters, for example, if my image have the following dimensions: (0, 256, 0, 256, 0, 199), the vtkInteractorStyleImage put the initial view in the center using an axial orientation, this is the slice: 99. If I want the user of my class can call a function named, for example: set_slice(slice_number) where slice_number will be the number of the desired slice to view, in this example a number between 0 and 199, how do I do that? On Wed, Dec 12, 2012 at 8:54 AM, David Gobbi wrote: > Arrgh. Another typo. The code should be: > > camera.SetFocalPoint(focal_point_for_axial_view) > style.SetImageOrientation(orientation_for_axial_view) > > And of course you should save the focal point for the > previous orientation at the same time. > > - David > > On Wed, Dec 12, 2012 at 6:53 AM, David Gobbi > wrote: > > On Wed, Dec 12, 2012 at 6:51 AM, David Gobbi > wrote: > >> The slicing and the panning are both controlled via the camera's focal > >> point. So slicing through the axial images causes the camera's > >> FocalPoint to move in and out along the Z axis. Then, when you switch > >> to a new orientation, this "Z" position is centered in the window. > >> > >> If you want to avoid this, you should save the FocalPoint for each > >> view orientation. Then, you can restore the focal point before you > >> call SetImageOrientation, e.g. > >> > >> camera.SetFocalPoint(focal_point_for_axial_view) > >> camera.SetImageOrientation(orientation_for_axial_view) > >> > >> - David > >> > >> On Wed, Dec 12, 2012 at 5:24 AM, Jos? M. Rodriguez Bacallao > >> wrote: > >>> no one please, is this normal? > >>> > >>> > >>> On Tue, Dec 11, 2012 at 9:45 AM, Jos? M. Rodriguez Bacallao > >>> wrote: > >>>> > >>>> hi folks, I am trying to implement a MPR viewer, so far so good. I am > >>>> using the new image classes, this is test code: > >>>> > >>>> #!/usr/bin/env python > >>>> > >>>> import os > >>>> import gdcm, vtkgdcm, vtk > >>>> > >>>> > >>>> def key_press(sender, event): > >>>> key = interactor.GetKeySym() > >>>> style.SetCurrentRenderer(renderer) > >>>> if key == 'a': > >>>> print 'axial' > >>>> style.SetImageOrientation( > >>>> style.GetZViewRightVector(), > >>>> style.GetZViewUpVector() > >>>> ) > >>>> elif key == 'c': > >>>> print 'coronal' > >>>> style.SetImageOrientation( > >>>> style.GetYViewRightVector(), > >>>> style.GetYViewUpVector() > >>>> ) > >>>> elif key == 's': > >>>> print 'axial' > >>>> style.SetImageOrientation( > >>>> style.GetXViewRightVector(), > >>>> style.GetXViewUpVector() > >>>> ) > >>>> render_window.Render() > >>>> > >>>> > >>>> > >>>> interactor = vtk.vtkRenderWindowInteractor() > >>>> render_window = vtk.vtkRenderWindow() > >>>> render_window.SetSize(400, 400) > >>>> interactor.SetRenderWindow(render_window) > >>>> > >>>> style = vtk.vtkInteractorStyleImage() > >>>> style.SetInteractionModeToImageSlicing() > >>>> interactor.SetInteractorStyle(style) > >>>> style.AddObserver('CharEvent', key_press) > >>>> > >>>> print 'sorting files...' > >>>> path = '/home/jmrbcu/pictures/workpictures/dicom/BRAIN/' > >>>> files = [os.path.join(path, x) for x in os.listdir(path)] > >>>> > >>>> ipp = gdcm.IPPSorter() > >>>> ipp.SetComputeZSpacing(True) > >>>> ipp.SetZSpacingTolerance(1e-3) > >>>> result = ipp.Sort(files) > >>>> > >>>> sorted_files, zspacing = files, 0 > >>>> if result: > >>>> sorted_files = ipp.GetFilenames() > >>>> zspacing = ipp.GetZSpacing() > >>>> print 'files sorted, z spacing is: %s' % zspacing > >>>> else: > >>>> print 'cannot sort files, this is not a valid volume' > >>>> > >>>> vtk_files = vtk.vtkStringArray() > >>>> map(vtk_files.InsertNextValue, sorted_files) > >>>> > >>>> reader = vtkgdcm.vtkGDCMImageReader() > >>>> reader.FileLowerLeftOn() > >>>> reader.SetFileNames(vtk_files) > >>>> reader.Update() > >>>> > >>>> spacing = reader.GetOutput().GetSpacing() > >>>> change = vtk.vtkImageChangeInformation() > >>>> change.SetInputConnection(reader.GetOutputPort()) > >>>> change.SetOutputSpacing(spacing[0], spacing[1], zspacing) > >>>> > >>>> im = vtk.vtkImageResliceMapper() > >>>> im.SetInputConnection(change.GetOutputPort()) > >>>> im.SliceFacesCameraOn() > >>>> im.SliceAtFocalPointOn() > >>>> im.BorderOff() > >>>> > >>>> ip = vtk.vtkImageProperty() > >>>> ip.SetColorWindow(255) > >>>> ip.SetColorLevel(128) > >>>> ip.SetAmbient(0.0) > >>>> ip.SetDiffuse(1.0) > >>>> ip.SetOpacity(1.0) > >>>> ip.SetInterpolationTypeToLinear() > >>>> > >>>> ia = vtk.vtkImageSlice() > >>>> ia.SetMapper(im) > >>>> ia.SetProperty(ip) > >>>> > >>>> renderer = vtk.vtkRenderer() > >>>> renderer.AddViewProp(ia) > >>>> renderer.SetBackground(0 , 0, 0) > >>>> render_window.AddRenderer(renderer) > >>>> > >>>> style.SetCurrentRenderer(renderer) > >>>> style.SetZViewRightVector((1, 0, 0)) > >>>> style.SetZViewUpVector((0, -1, 0)) > >>>> > >>>> style.SetXViewRightVector((0, 1, 0)) > >>>> style.SetXViewUpVector((0, 0, 1)) > >>>> > >>>> style.SetYViewRightVector((1, 0, 0)) > >>>> style.SetYViewUpVector((0, 0, 1)) > >>>> style.SetImageOrientation(style.GetZViewRightVector(), > >>>> style.GetZViewUpVector()) > >>>> > >>>> # render the image > >>>> renderer.ResetCamera() > >>>> renderer.GetActiveCamera().ParallelProjectionOn() > >>>> renderer.ResetCameraClippingRange() > >>>> render_window.Render() > >>>> > >>>> interactor.Initialize() > >>>> interactor.Start() > >>>> > >>>> the problems arise in this sequence: > >>>> > >>>> 1- initially display the image: ok > >>>> 2- slice the image to a different slice with ctrl + mosue left: ok > >>>> 3- change the orientation to a different one (sagital or coronal, > doesn't > >>>> matter): this is the problem, orientation of the image is changed > fine to > >>>> the new one but the image is panned to a different position in the > render > >>>> window/renderer, not the center of it and in a different slice (the > middle > >>>> slice of the whole image) > >>>> > >>>> how can I avoid this, I mean, keep the image centered in the render > >>>> window/renderer when the image orientation is changed and in the > correct > >>>> slice location? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Wed Dec 12 11:39:12 2012 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 12 Dec 2012 09:39:12 -0700 Subject: [vtkusers] image moved afer an orientation change In-Reply-To: References: Message-ID: Hi Jos?, You have to compute the slice number from the focal point. The focal point defines a position (x,y,z) in World coords. Compute the closest voxel to that point, and you have the slice. - David On Wed, Dec 12, 2012 at 9:21 AM, Jos? M. Rodriguez Bacallao wrote: > hi David: > > saving the focal point did the trick!!! thanks very much > another question, how do I know the current slice number given the camera > parameters, for example, if my image have the following dimensions: (0, 256, > 0, 256, 0, 199), the vtkInteractorStyleImage put the initial view in the > center using an axial orientation, this is the slice: 99. If I want the user > of my class can call a function named, for example: set_slice(slice_number) > where slice_number will be the number of the desired slice to view, in this > example a number between 0 and 199, how do I do that? > > > On Wed, Dec 12, 2012 at 8:54 AM, David Gobbi wrote: >> >> Arrgh. Another typo. The code should be: >> >> camera.SetFocalPoint(focal_point_for_axial_view) >> style.SetImageOrientation(orientation_for_axial_view) >> >> And of course you should save the focal point for the >> previous orientation at the same time. >> >> - David >> >> On Wed, Dec 12, 2012 at 6:53 AM, David Gobbi >> wrote: >> > On Wed, Dec 12, 2012 at 6:51 AM, David Gobbi >> > wrote: >> >> The slicing and the panning are both controlled via the camera's focal >> >> point. So slicing through the axial images causes the camera's >> >> FocalPoint to move in and out along the Z axis. Then, when you switch >> >> to a new orientation, this "Z" position is centered in the window. >> >> >> >> If you want to avoid this, you should save the FocalPoint for each >> >> view orientation. Then, you can restore the focal point before you >> >> call SetImageOrientation, e.g. >> >> >> >> camera.SetFocalPoint(focal_point_for_axial_view) >> >> camera.SetImageOrientation(orientation_for_axial_view) >> >> >> >> - David >> >> >> >> On Wed, Dec 12, 2012 at 5:24 AM, Jos? M. Rodriguez Bacallao >> >> wrote: >> >>> no one please, is this normal? >> >>> >> >>> >> >>> On Tue, Dec 11, 2012 at 9:45 AM, Jos? M. Rodriguez Bacallao >> >>> wrote: >> >>>> >> >>>> hi folks, I am trying to implement a MPR viewer, so far so good. I am >> >>>> using the new image classes, this is test code: >> >>>> >> >>>> #!/usr/bin/env python >> >>>> >> >>>> import os >> >>>> import gdcm, vtkgdcm, vtk >> >>>> >> >>>> >> >>>> def key_press(sender, event): >> >>>> key = interactor.GetKeySym() >> >>>> style.SetCurrentRenderer(renderer) >> >>>> if key == 'a': >> >>>> print 'axial' >> >>>> style.SetImageOrientation( >> >>>> style.GetZViewRightVector(), >> >>>> style.GetZViewUpVector() >> >>>> ) >> >>>> elif key == 'c': >> >>>> print 'coronal' >> >>>> style.SetImageOrientation( >> >>>> style.GetYViewRightVector(), >> >>>> style.GetYViewUpVector() >> >>>> ) >> >>>> elif key == 's': >> >>>> print 'axial' >> >>>> style.SetImageOrientation( >> >>>> style.GetXViewRightVector(), >> >>>> style.GetXViewUpVector() >> >>>> ) >> >>>> render_window.Render() >> >>>> >> >>>> >> >>>> >> >>>> interactor = vtk.vtkRenderWindowInteractor() >> >>>> render_window = vtk.vtkRenderWindow() >> >>>> render_window.SetSize(400, 400) >> >>>> interactor.SetRenderWindow(render_window) >> >>>> >> >>>> style = vtk.vtkInteractorStyleImage() >> >>>> style.SetInteractionModeToImageSlicing() >> >>>> interactor.SetInteractorStyle(style) >> >>>> style.AddObserver('CharEvent', key_press) >> >>>> >> >>>> print 'sorting files...' >> >>>> path = '/home/jmrbcu/pictures/workpictures/dicom/BRAIN/' >> >>>> files = [os.path.join(path, x) for x in os.listdir(path)] >> >>>> >> >>>> ipp = gdcm.IPPSorter() >> >>>> ipp.SetComputeZSpacing(True) >> >>>> ipp.SetZSpacingTolerance(1e-3) >> >>>> result = ipp.Sort(files) >> >>>> >> >>>> sorted_files, zspacing = files, 0 >> >>>> if result: >> >>>> sorted_files = ipp.GetFilenames() >> >>>> zspacing = ipp.GetZSpacing() >> >>>> print 'files sorted, z spacing is: %s' % zspacing >> >>>> else: >> >>>> print 'cannot sort files, this is not a valid volume' >> >>>> >> >>>> vtk_files = vtk.vtkStringArray() >> >>>> map(vtk_files.InsertNextValue, sorted_files) >> >>>> >> >>>> reader = vtkgdcm.vtkGDCMImageReader() >> >>>> reader.FileLowerLeftOn() >> >>>> reader.SetFileNames(vtk_files) >> >>>> reader.Update() >> >>>> >> >>>> spacing = reader.GetOutput().GetSpacing() >> >>>> change = vtk.vtkImageChangeInformation() >> >>>> change.SetInputConnection(reader.GetOutputPort()) >> >>>> change.SetOutputSpacing(spacing[0], spacing[1], zspacing) >> >>>> >> >>>> im = vtk.vtkImageResliceMapper() >> >>>> im.SetInputConnection(change.GetOutputPort()) >> >>>> im.SliceFacesCameraOn() >> >>>> im.SliceAtFocalPointOn() >> >>>> im.BorderOff() >> >>>> >> >>>> ip = vtk.vtkImageProperty() >> >>>> ip.SetColorWindow(255) >> >>>> ip.SetColorLevel(128) >> >>>> ip.SetAmbient(0.0) >> >>>> ip.SetDiffuse(1.0) >> >>>> ip.SetOpacity(1.0) >> >>>> ip.SetInterpolationTypeToLinear() >> >>>> >> >>>> ia = vtk.vtkImageSlice() >> >>>> ia.SetMapper(im) >> >>>> ia.SetProperty(ip) >> >>>> >> >>>> renderer = vtk.vtkRenderer() >> >>>> renderer.AddViewProp(ia) >> >>>> renderer.SetBackground(0 , 0, 0) >> >>>> render_window.AddRenderer(renderer) >> >>>> >> >>>> style.SetCurrentRenderer(renderer) >> >>>> style.SetZViewRightVector((1, 0, 0)) >> >>>> style.SetZViewUpVector((0, -1, 0)) >> >>>> >> >>>> style.SetXViewRightVector((0, 1, 0)) >> >>>> style.SetXViewUpVector((0, 0, 1)) >> >>>> >> >>>> style.SetYViewRightVector((1, 0, 0)) >> >>>> style.SetYViewUpVector((0, 0, 1)) >> >>>> style.SetImageOrientation(style.GetZViewRightVector(), >> >>>> style.GetZViewUpVector()) >> >>>> >> >>>> # render the image >> >>>> renderer.ResetCamera() >> >>>> renderer.GetActiveCamera().ParallelProjectionOn() >> >>>> renderer.ResetCameraClippingRange() >> >>>> render_window.Render() >> >>>> >> >>>> interactor.Initialize() >> >>>> interactor.Start() >> >>>> >> >>>> the problems arise in this sequence: >> >>>> >> >>>> 1- initially display the image: ok >> >>>> 2- slice the image to a different slice with ctrl + mosue left: ok >> >>>> 3- change the orientation to a different one (sagital or coronal, >> >>>> doesn't >> >>>> matter): this is the problem, orientation of the image is changed >> >>>> fine to >> >>>> the new one but the image is panned to a different position in the >> >>>> render >> >>>> window/renderer, not the center of it and in a different slice (the >> >>>> middle >> >>>> slice of the whole image) >> >>>> >> >>>> how can I avoid this, I mean, keep the image centered in the render >> >>>> window/renderer when the image orientation is changed and in the >> >>>> correct >> >>>> slice location? > > From massimo.bortolato at gmail.com Wed Dec 12 11:57:52 2012 From: massimo.bortolato at gmail.com (Massimo Bortolato) Date: Wed, 12 Dec 2012 17:57:52 +0100 Subject: [vtkusers] How to flip a 2D image? Message-ID: Hi all, I am trying to flip a 2D image displayed using vtkResliceWidget (i.e. via a vtkImageActor) by means of calling the method vtkCamera::Azimuth(180). It works initially, but whenever I enter the window with the mouse cursor, the image is flipped back to the original position. Does anyone know where is the error? Thank you very much! Massimo -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.vanee at convergent.ca Wed Dec 12 12:04:58 2012 From: david.vanee at convergent.ca (David vanEe) Date: Wed, 12 Dec 2012 09:04:58 -0800 Subject: [vtkusers] vtkCellPicker failing to pick vtkPolyLine (using Python and wx) In-Reply-To: References: <75E3C47D9F67634F939FA0668CDF1D0B8602B7A376@MAIL4.exchange.electric.net> <75E3C47D9F67634F939FA0668CDF1D0B8602B7A377@MAIL4.exchange.electric.net> Message-ID: <75E3C47D9F67634F939FA0668CDF1D0B8602B7A378@MAIL4.exchange.electric.net> Thanks David, that fixes things (in my full program as well). I feel pretty foolish for not trying that. -Dave -----Original Message----- From: David Gobbi [mailto:david.gobbi at gmail.com] Sent: Tuesday, December 11, 2012 10:27 AM To: David vanEe Cc: vtkusers at vtk.org Subject: Re: [vtkusers] vtkCellPicker failing to pick vtkPolyLine (using Python and wx) Hi David, You can get the polyline picking to work by increasing the tolerance: self.cellPicker.SetTolerance(0.005) I'll continue looking through the code to see why the new code behaves differently from the old, though. I suspect there have been minor changes to the way that tolerances are applied. - David On Tue, Dec 11, 2012 at 10:51 AM, David vanEe wrote: > Sure, this version will work with just python/vtk. Thanks for taking a look. > > > import vtk > > class MyInteractorStyle(vtk.vtkInteractorStyleTrackballCamera): > def __init__(self, actorData, actorList): > > self.actorData = actorData > self.actorList = actorList > self.cellPicker = vtk.vtkCellPicker() > > self.AddObserver("MouseMoveEvent", self.OnMotion) > > def OnMotion(self, obj, event): > > iren = obj.GetInteractor() > renwin = iren.GetRenderWindow() > ren = renwin.GetRenderers().GetFirstRenderer() > > x, y = iren.GetEventPosition() > > # invert Y value > actualY = ren.GetSize()[1] - y > > # dim all actors > for (index, actor) in enumerate(self.actorList): > (zValue, cellType, dimColor, brightColor) = self.actorData[index] > actor.GetProperty().SetDiffuseColor(*dimColor) > > self.cellPicker.Pick(x, actualY, 0, ren) > dataSet = self.cellPicker.GetDataSet() > > if dataSet is not None: > # highlight picked actor > for (index, actor) in enumerate(self.actorList): > if actor.GetMapper().GetInput() == dataSet: > (zOffset, cellType, dimColor, brightColor) = self.actorData[index] > actor.GetProperty().SetDiffuseColor(*brightColor) > > renwin.Render() > > # simple point coords used by both actors coords = [(0.0, 0.0), > (1.0, 0.0), > (1.0, 1.0), > (0.0, 1.0)] > > actorData = [(1.0, vtk.VTK_POLY_LINE, (0.5,0.0,0.0), (1.0, 0.0, 0.0)), > (0.0, vtk.VTK_QUAD, (0.0, 0.0, 0.5), (0.0, 0.0, 1.0))] > > ren = vtk.vtkRenderer() > > renwin = vtk.vtkRenderWindow() > renwin.AddRenderer(ren) > > actorList = [] > for data in actorData: > (zValue, cellType, dimColor, brightColor) = data > > points = vtk.vtkPoints() > for (pointIndex, coord) in enumerate(coords): > points.InsertPoint(pointIndex, coord[0], coord[1], zValue) > > idList = vtk.vtkIdList() > idList.SetNumberOfIds(len(coords)) > for pointIndex in range(len(coords)): > idList.SetId(pointIndex, pointIndex) > cells = vtk.vtkCellArray() > cells.InsertNextCell(idList) > > grid = vtk.vtkUnstructuredGrid() > grid.SetPoints(points) > grid.SetCells(cellType, cells) > > mapper = vtk.vtkDataSetMapper() > mapper.SetInput(grid) > > actor = vtk.vtkActor() > actor.SetMapper(mapper) > actor.GetProperty().SetRepresentation(1) > actor.GetProperty().SetLineWidth(5.0) > actor.GetProperty().SetDiffuseColor(*dimColor) > > ren.AddActor(actor) > actorList.append(actor) > > interactor = vtk.vtkRenderWindowInteractor() > interactor.SetInteractorStyle(MyInteractorStyle(actorData, actorList)) > interactor.SetRenderWindow(renwin) > > interactor.Initialize() > interactor.Start() > > > > -----Original Message----- > From: David Gobbi [mailto:david.gobbi at gmail.com] > Sent: Tuesday, December 11, 2012 9:08 AM > To: David vanEe > Cc: vtkusers at vtk.org > Subject: Re: [vtkusers] vtkCellPicker failing to pick vtkPolyLine > (using Python and wx) > > Hi David, > > I was the one who made the changes to the vtkCellPicker code, and I'd be glad to investigate to see why the behavior changed. > > Can you send me an example that uses just python, i.e. no wx? > > - David > > On Tue, Dec 11, 2012 at 9:26 AM, David vanEe wrote: >> Hi all, >> >> >> >> I've recently updated my VTK from 5.4 to 5.10.1, and some old >> vtkCellPicker code isn't doing what I want anymore. This 'simple' >> example works fine in >> 5.4 (both the blue and red actor highlight when you mouse-over them), >> but in >> 5.10.1 only the blue (quad) actor works. The only difference between >> the two actors (aside from coordinates and colors) is the cellType of >> vtk.VTK_POLY_LINE vs vtk.VTK_QUAD. >> >> >> >> I've tried looking for changes in the pick routine, but >> vtkCellPicker.cxx has undergone substantial changes and I was unable >> to locate the cause. Any suggestions for getting the picker to pick the polyline? >> >> >> >> Thanks in advance, >> >> Dave >> >> >> >> >> >> import wx >> >> import vtk >> >> >> >> from vtk.wx.wxVTKRenderWindowInteractor import >> wxVTKRenderWindowInteractor >> >> >> >> class myVTKInteractor(wxVTKRenderWindowInteractor): >> >> def __init__(self, parent): >> >> wxVTKRenderWindowInteractor.__init__(self, parent, -1) >> >> >> >> self.Enable(1) >> >> self.AddObserver("ExitEvent", lambda o,e,f=self: f.Close()) >> >> >> >> self.ren = vtk.vtkRenderer() >> >> self.GetRenderWindow().AddRenderer(self.ren) >> >> >> >> # simple point coords used by both actors >> >> coords = [(0.0, 0.0), >> >> (1.0, 0.0), >> >> (1.0, 1.0), >> >> (0.0, 1.0)] >> >> >> >> self.actorData = [(1.0, vtk.VTK_POLY_LINE, (0.5,0.0,0.0), >> (1.0, 0.0, 0.0)), >> >> (0.0, vtk.VTK_QUAD, (0.0, 0.0, 0.5), (0.0, >> 0.0, 1.0))] >> >> >> >> self.actorList = [] >> >> for data in self.actorData: >> >> (zValue, cellType, dimColor, brightColor) = data >> >> >> >> points = vtk.vtkPoints() >> >> for (pointIndex, coord) in enumerate(coords): >> >> points.InsertPoint(pointIndex, coord[0], coord[1], >> zValue) >> >> >> >> idList = vtk.vtkIdList() >> >> idList.SetNumberOfIds(len(coords)) >> >> for pointIndex in range(len(coords)): >> >> idList.SetId(pointIndex, pointIndex) >> >> cells = vtk.vtkCellArray() >> >> cells.InsertNextCell(idList) >> >> >> >> grid = vtk.vtkUnstructuredGrid() >> >> grid.SetPoints(points) >> >> grid.SetCells(cellType, cells) >> >> >> >> mapper = vtk.vtkDataSetMapper() >> >> mapper.SetInput(grid) >> >> >> >> actor = vtk.vtkActor() >> >> actor.SetMapper(mapper) >> >> actor.GetProperty().SetRepresentation(1) >> >> actor.GetProperty().SetLineWidth(5.0) >> >> actor.GetProperty().SetDiffuseColor(*dimColor) >> >> >> >> self.ren.AddActor(actor) >> >> self.actorList.append(actor) >> >> >> >> self.cellPicker = vtk.vtkCellPicker() >> >> >> >> >> >> def OnMotion(self, event): >> >> >> >> # invert Y value >> >> actualY = self.ren.GetSize()[1] - event.GetY() >> >> >> >> # dim all actors >> >> for (index, actor) in enumerate(self.actorList): >> >> (zValue, cellType, dimColor, brightColor) = >> self.actorData[index] >> >> actor.GetProperty().SetDiffuseColor(*dimColor) >> >> >> >> self.cellPicker.Pick(event.GetX(), actualY, 0, self.ren) >> >> dataSet = self.cellPicker.GetDataSet() >> >> >> >> if dataSet is not None: >> >> # highlight picked actor >> >> for (index, actor) in enumerate(self.actorList): >> >> if actor.GetMapper().GetInput() == dataSet: >> >> (zOffset, cellType, dimColor, brightColor) = >> self.actorData[index] >> >> actor.GetProperty().SetDiffuseColor(*brightColor) >> >> >> >> self.Render() >> >> >> >> >> >> def wxVTKRenderWindowInteractorExample(): >> >> app = wx.PySimpleApp() >> >> >> >> frame = wx.Frame(None, -1, "wxVTKRenderWindowInteractor", >> size=(400,400)) >> >> >> >> widget = myVTKInteractor(frame) >> >> sizer = wx.BoxSizer(wx.VERTICAL) >> >> sizer.Add(widget, 1, wx.EXPAND) >> >> frame.SetSizer(sizer) >> >> frame.Layout() >> >> >> >> frame.Show() >> >> >> >> app.MainLoop() >> >> >> >> if __name__ == "__main__": >> >> wxVTKRenderWindowInteractorExample() >> >> >> >> >> >> >> >> -- >> >> David A. Van Ee, BASc, EIT >> >> Convergent Manufacturing Technologies Inc. >> >> 6190 Agronomy Rd, Suite 403 >> >> Vancouver BC Canada V6T 1Z3 >> >> >> >> Email: david.vanee at convergent.ca | Tel: 604-822-9682 x103 >> >> WWW: http://www.convergent.ca | Fax: 604-822-9659 From acsantome at gmail.com Wed Dec 12 12:05:38 2012 From: acsantome at gmail.com (a.c.sant) Date: Wed, 12 Dec 2012 09:05:38 -0800 (PST) Subject: [vtkusers] RemoveObserver isn't working. Message-ID: <1355331938554-5717581.post@n5.nabble.com> Hi!! I'm not able to remove an observer from the a vtkRenderWindow instance. I have searched the list a while and found several questions similar to this one, but unanswered, so here's come a new one. Maybe this time we're lucky!. I have added an observer with for the /vtkCommand::EndEvent/ in the /vtkRenderWindow/ object, so it would print some info upon render completion. That works fine. Once the event is satisfied, I don't need the observer anymore, so I use the /RemoveObserver/ method from the vtkRenderWindow to get rid of it. However this don't work, as the observer keeps printing info whenever I interact with the scene. Here's the code: Where the callback is used: What am I doing wrong?. Cheers!. -- View this message in context: http://vtk.1045678.n5.nabble.com/RemoveObserver-isn-t-working-tp5717581.html Sent from the VTK - Users mailing list archive at Nabble.com. From jmrbcu at gmail.com Wed Dec 12 12:10:27 2012 From: jmrbcu at gmail.com (=?UTF-8?Q?Jos=C3=A9_M=2E_Rodriguez_Bacallao?=) Date: Wed, 12 Dec 2012 12:10:27 -0500 Subject: [vtkusers] image moved afer an orientation change In-Reply-To: References: Message-ID: sorry for my ineptitude, how do I do that? On Wed, Dec 12, 2012 at 11:39 AM, David Gobbi wrote: > Hi Jos?, > > You have to compute the slice number from the focal point. > The focal point defines a position (x,y,z) in World coords. > Compute the closest voxel to that point, and you have the slice. > > - David > > > On Wed, Dec 12, 2012 at 9:21 AM, Jos? M. Rodriguez Bacallao > wrote: > > hi David: > > > > saving the focal point did the trick!!! thanks very much > > another question, how do I know the current slice number given the camera > > parameters, for example, if my image have the following dimensions: (0, > 256, > > 0, 256, 0, 199), the vtkInteractorStyleImage put the initial view in the > > center using an axial orientation, this is the slice: 99. If I want the > user > > of my class can call a function named, for example: > set_slice(slice_number) > > where slice_number will be the number of the desired slice to view, in > this > > example a number between 0 and 199, how do I do that? > > > > > > On Wed, Dec 12, 2012 at 8:54 AM, David Gobbi > wrote: > >> > >> Arrgh. Another typo. The code should be: > >> > >> camera.SetFocalPoint(focal_point_for_axial_view) > >> style.SetImageOrientation(orientation_for_axial_view) > >> > >> And of course you should save the focal point for the > >> previous orientation at the same time. > >> > >> - David > >> > >> On Wed, Dec 12, 2012 at 6:53 AM, David Gobbi > >> wrote: > >> > On Wed, Dec 12, 2012 at 6:51 AM, David Gobbi > >> > wrote: > >> >> The slicing and the panning are both controlled via the camera's > focal > >> >> point. So slicing through the axial images causes the camera's > >> >> FocalPoint to move in and out along the Z axis. Then, when you > switch > >> >> to a new orientation, this "Z" position is centered in the window. > >> >> > >> >> If you want to avoid this, you should save the FocalPoint for each > >> >> view orientation. Then, you can restore the focal point before you > >> >> call SetImageOrientation, e.g. > >> >> > >> >> camera.SetFocalPoint(focal_point_for_axial_view) > >> >> camera.SetImageOrientation(orientation_for_axial_view) > >> >> > >> >> - David > >> >> > >> >> On Wed, Dec 12, 2012 at 5:24 AM, Jos? M. Rodriguez Bacallao > >> >> wrote: > >> >>> no one please, is this normal? > >> >>> > >> >>> > >> >>> On Tue, Dec 11, 2012 at 9:45 AM, Jos? M. Rodriguez Bacallao > >> >>> wrote: > >> >>>> > >> >>>> hi folks, I am trying to implement a MPR viewer, so far so good. I > am > >> >>>> using the new image classes, this is test code: > >> >>>> > >> >>>> #!/usr/bin/env python > >> >>>> > >> >>>> import os > >> >>>> import gdcm, vtkgdcm, vtk > >> >>>> > >> >>>> > >> >>>> def key_press(sender, event): > >> >>>> key = interactor.GetKeySym() > >> >>>> style.SetCurrentRenderer(renderer) > >> >>>> if key == 'a': > >> >>>> print 'axial' > >> >>>> style.SetImageOrientation( > >> >>>> style.GetZViewRightVector(), > >> >>>> style.GetZViewUpVector() > >> >>>> ) > >> >>>> elif key == 'c': > >> >>>> print 'coronal' > >> >>>> style.SetImageOrientation( > >> >>>> style.GetYViewRightVector(), > >> >>>> style.GetYViewUpVector() > >> >>>> ) > >> >>>> elif key == 's': > >> >>>> print 'axial' > >> >>>> style.SetImageOrientation( > >> >>>> style.GetXViewRightVector(), > >> >>>> style.GetXViewUpVector() > >> >>>> ) > >> >>>> render_window.Render() > >> >>>> > >> >>>> > >> >>>> > >> >>>> interactor = vtk.vtkRenderWindowInteractor() > >> >>>> render_window = vtk.vtkRenderWindow() > >> >>>> render_window.SetSize(400, 400) > >> >>>> interactor.SetRenderWindow(render_window) > >> >>>> > >> >>>> style = vtk.vtkInteractorStyleImage() > >> >>>> style.SetInteractionModeToImageSlicing() > >> >>>> interactor.SetInteractorStyle(style) > >> >>>> style.AddObserver('CharEvent', key_press) > >> >>>> > >> >>>> print 'sorting files...' > >> >>>> path = '/home/jmrbcu/pictures/workpictures/dicom/BRAIN/' > >> >>>> files = [os.path.join(path, x) for x in os.listdir(path)] > >> >>>> > >> >>>> ipp = gdcm.IPPSorter() > >> >>>> ipp.SetComputeZSpacing(True) > >> >>>> ipp.SetZSpacingTolerance(1e-3) > >> >>>> result = ipp.Sort(files) > >> >>>> > >> >>>> sorted_files, zspacing = files, 0 > >> >>>> if result: > >> >>>> sorted_files = ipp.GetFilenames() > >> >>>> zspacing = ipp.GetZSpacing() > >> >>>> print 'files sorted, z spacing is: %s' % zspacing > >> >>>> else: > >> >>>> print 'cannot sort files, this is not a valid volume' > >> >>>> > >> >>>> vtk_files = vtk.vtkStringArray() > >> >>>> map(vtk_files.InsertNextValue, sorted_files) > >> >>>> > >> >>>> reader = vtkgdcm.vtkGDCMImageReader() > >> >>>> reader.FileLowerLeftOn() > >> >>>> reader.SetFileNames(vtk_files) > >> >>>> reader.Update() > >> >>>> > >> >>>> spacing = reader.GetOutput().GetSpacing() > >> >>>> change = vtk.vtkImageChangeInformation() > >> >>>> change.SetInputConnection(reader.GetOutputPort()) > >> >>>> change.SetOutputSpacing(spacing[0], spacing[1], zspacing) > >> >>>> > >> >>>> im = vtk.vtkImageResliceMapper() > >> >>>> im.SetInputConnection(change.GetOutputPort()) > >> >>>> im.SliceFacesCameraOn() > >> >>>> im.SliceAtFocalPointOn() > >> >>>> im.BorderOff() > >> >>>> > >> >>>> ip = vtk.vtkImageProperty() > >> >>>> ip.SetColorWindow(255) > >> >>>> ip.SetColorLevel(128) > >> >>>> ip.SetAmbient(0.0) > >> >>>> ip.SetDiffuse(1.0) > >> >>>> ip.SetOpacity(1.0) > >> >>>> ip.SetInterpolationTypeToLinear() > >> >>>> > >> >>>> ia = vtk.vtkImageSlice() > >> >>>> ia.SetMapper(im) > >> >>>> ia.SetProperty(ip) > >> >>>> > >> >>>> renderer = vtk.vtkRenderer() > >> >>>> renderer.AddViewProp(ia) > >> >>>> renderer.SetBackground(0 , 0, 0) > >> >>>> render_window.AddRenderer(renderer) > >> >>>> > >> >>>> style.SetCurrentRenderer(renderer) > >> >>>> style.SetZViewRightVector((1, 0, 0)) > >> >>>> style.SetZViewUpVector((0, -1, 0)) > >> >>>> > >> >>>> style.SetXViewRightVector((0, 1, 0)) > >> >>>> style.SetXViewUpVector((0, 0, 1)) > >> >>>> > >> >>>> style.SetYViewRightVector((1, 0, 0)) > >> >>>> style.SetYViewUpVector((0, 0, 1)) > >> >>>> style.SetImageOrientation(style.GetZViewRightVector(), > >> >>>> style.GetZViewUpVector()) > >> >>>> > >> >>>> # render the image > >> >>>> renderer.ResetCamera() > >> >>>> renderer.GetActiveCamera().ParallelProjectionOn() > >> >>>> renderer.ResetCameraClippingRange() > >> >>>> render_window.Render() > >> >>>> > >> >>>> interactor.Initialize() > >> >>>> interactor.Start() > >> >>>> > >> >>>> the problems arise in this sequence: > >> >>>> > >> >>>> 1- initially display the image: ok > >> >>>> 2- slice the image to a different slice with ctrl + mosue left: ok > >> >>>> 3- change the orientation to a different one (sagital or coronal, > >> >>>> doesn't > >> >>>> matter): this is the problem, orientation of the image is changed > >> >>>> fine to > >> >>>> the new one but the image is panned to a different position in the > >> >>>> render > >> >>>> window/renderer, not the center of it and in a different slice (the > >> >>>> middle > >> >>>> slice of the whole image) > >> >>>> > >> >>>> how can I avoid this, I mean, keep the image centered in the render > >> >>>> window/renderer when the image orientation is changed and in the > >> >>>> correct > >> >>>> slice location? > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From massimo.bortolato at gmail.com Wed Dec 12 12:31:15 2012 From: massimo.bortolato at gmail.com (Massimo Bortolato) Date: Wed, 12 Dec 2012 18:31:15 +0100 Subject: [vtkusers] Blinking text in vtkAngleWidget Message-ID: Hi all, I am using a vtkAngleWidget with a vtkAngleRepresentation3D passed to it, but I am experiencing a problem because the text actor displaying the angular value appears and disappears as I zoom the image. (?zoom? not ?reslice?, consider that I am displaying a 2D image using vtkResliceCursorWidget) Does anyone of you know where there may be the issue? Thanks in advance! Massimo -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Wed Dec 12 12:32:53 2012 From: daviddoria at gmail.com (David Doria) Date: Wed, 12 Dec 2012 12:32:53 -0500 Subject: [vtkusers] RemoveObserver isn't working. In-Reply-To: <1355331938554-5717581.post@n5.nabble.com> References: <1355331938554-5717581.post@n5.nabble.com> Message-ID: On Wed, Dec 12, 2012 at 12:05 PM, a.c.sant wrote: > Hi!! > I'm not able to remove an observer from the a vtkRenderWindow instance. I > have searched the list a while and found several questions similar to this > one, but unanswered, so here's come a new one. Maybe this time we're > lucky!. > > I have added an observer with for the /vtkCommand::EndEvent/ in the > /vtkRenderWindow/ object, so it would print some info upon render > completion. That works fine. > > Once the event is satisfied, I don't need the observer anymore, so I use > the > /RemoveObserver/ method from the vtkRenderWindow to get rid of it. However > this don't work, as the observer keeps printing info whenever I interact > with the scene. > > Here's the code: > > > Where the callback is used: > > > What am I doing wrong?. > > Cheers! > Can you please make a fully compilable example of this behavior? Perhaps something like when the mouse is clicked, an event is triggered (perform an output to stdout) and the observer is removed. Then on the next click we'd expect to see nothing, but you're saying it would show the output again. David -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Wed Dec 12 12:35:45 2012 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 12 Dec 2012 10:35:45 -0700 Subject: [vtkusers] image moved afer an orientation change In-Reply-To: References: Message-ID: Do you have a copy of the VTK source code, specifically the file vtkImageData.cxx? Take a look at the C++ code for the following method: vtkIdType vtkImageData::FindPoint(double x[3]) This code takes a point in data coords, computes the ijk structured coords (i.e. the voxel), and then computes a point index. You've been dealing with images in VTK for long enough that all the code inside this method should be 100% obvious to you... if it isn't, then study it until it DOES become obvious. - David On Wed, Dec 12, 2012 at 10:10 AM, Jos? M. Rodriguez Bacallao wrote: > sorry for my ineptitude, how do I do that? > > > On Wed, Dec 12, 2012 at 11:39 AM, David Gobbi wrote: >> >> Hi Jos?, >> >> You have to compute the slice number from the focal point. >> The focal point defines a position (x,y,z) in World coords. >> Compute the closest voxel to that point, and you have the slice. >> >> - David >> >> >> On Wed, Dec 12, 2012 at 9:21 AM, Jos? M. Rodriguez Bacallao >> wrote: >> > hi David: >> > >> > saving the focal point did the trick!!! thanks very much >> > another question, how do I know the current slice number given the >> > camera >> > parameters, for example, if my image have the following dimensions: (0, >> > 256, >> > 0, 256, 0, 199), the vtkInteractorStyleImage put the initial view in the >> > center using an axial orientation, this is the slice: 99. If I want the >> > user >> > of my class can call a function named, for example: >> > set_slice(slice_number) >> > where slice_number will be the number of the desired slice to view, in >> > this >> > example a number between 0 and 199, how do I do that? >> > >> > >> > On Wed, Dec 12, 2012 at 8:54 AM, David Gobbi >> > wrote: >> >> >> >> Arrgh. Another typo. The code should be: >> >> >> >> camera.SetFocalPoint(focal_point_for_axial_view) >> >> style.SetImageOrientation(orientation_for_axial_view) >> >> >> >> And of course you should save the focal point for the >> >> previous orientation at the same time. >> >> >> >> - David >> >> >> >> On Wed, Dec 12, 2012 at 6:53 AM, David Gobbi >> >> wrote: >> >> > On Wed, Dec 12, 2012 at 6:51 AM, David Gobbi >> >> > wrote: >> >> >> The slicing and the panning are both controlled via the camera's >> >> >> focal >> >> >> point. So slicing through the axial images causes the camera's >> >> >> FocalPoint to move in and out along the Z axis. Then, when you >> >> >> switch >> >> >> to a new orientation, this "Z" position is centered in the window. >> >> >> >> >> >> If you want to avoid this, you should save the FocalPoint for each >> >> >> view orientation. Then, you can restore the focal point before you >> >> >> call SetImageOrientation, e.g. >> >> >> >> >> >> camera.SetFocalPoint(focal_point_for_axial_view) >> >> >> camera.SetImageOrientation(orientation_for_axial_view) >> >> >> >> >> >> - David >> >> >> >> >> >> On Wed, Dec 12, 2012 at 5:24 AM, Jos? M. Rodriguez Bacallao >> >> >> wrote: >> >> >>> no one please, is this normal? >> >> >>> >> >> >>> >> >> >>> On Tue, Dec 11, 2012 at 9:45 AM, Jos? M. Rodriguez Bacallao >> >> >>> wrote: >> >> >>>> >> >> >>>> hi folks, I am trying to implement a MPR viewer, so far so good. I >> >> >>>> am >> >> >>>> using the new image classes, this is test code: >> >> >>>> >> >> >>>> #!/usr/bin/env python >> >> >>>> >> >> >>>> import os >> >> >>>> import gdcm, vtkgdcm, vtk >> >> >>>> >> >> >>>> >> >> >>>> def key_press(sender, event): >> >> >>>> key = interactor.GetKeySym() >> >> >>>> style.SetCurrentRenderer(renderer) >> >> >>>> if key == 'a': >> >> >>>> print 'axial' >> >> >>>> style.SetImageOrientation( >> >> >>>> style.GetZViewRightVector(), >> >> >>>> style.GetZViewUpVector() >> >> >>>> ) >> >> >>>> elif key == 'c': >> >> >>>> print 'coronal' >> >> >>>> style.SetImageOrientation( >> >> >>>> style.GetYViewRightVector(), >> >> >>>> style.GetYViewUpVector() >> >> >>>> ) >> >> >>>> elif key == 's': >> >> >>>> print 'axial' >> >> >>>> style.SetImageOrientation( >> >> >>>> style.GetXViewRightVector(), >> >> >>>> style.GetXViewUpVector() >> >> >>>> ) >> >> >>>> render_window.Render() >> >> >>>> >> >> >>>> >> >> >>>> >> >> >>>> interactor = vtk.vtkRenderWindowInteractor() >> >> >>>> render_window = vtk.vtkRenderWindow() >> >> >>>> render_window.SetSize(400, 400) >> >> >>>> interactor.SetRenderWindow(render_window) >> >> >>>> >> >> >>>> style = vtk.vtkInteractorStyleImage() >> >> >>>> style.SetInteractionModeToImageSlicing() >> >> >>>> interactor.SetInteractorStyle(style) >> >> >>>> style.AddObserver('CharEvent', key_press) >> >> >>>> >> >> >>>> print 'sorting files...' >> >> >>>> path = '/home/jmrbcu/pictures/workpictures/dicom/BRAIN/' >> >> >>>> files = [os.path.join(path, x) for x in os.listdir(path)] >> >> >>>> >> >> >>>> ipp = gdcm.IPPSorter() >> >> >>>> ipp.SetComputeZSpacing(True) >> >> >>>> ipp.SetZSpacingTolerance(1e-3) >> >> >>>> result = ipp.Sort(files) >> >> >>>> >> >> >>>> sorted_files, zspacing = files, 0 >> >> >>>> if result: >> >> >>>> sorted_files = ipp.GetFilenames() >> >> >>>> zspacing = ipp.GetZSpacing() >> >> >>>> print 'files sorted, z spacing is: %s' % zspacing >> >> >>>> else: >> >> >>>> print 'cannot sort files, this is not a valid volume' >> >> >>>> >> >> >>>> vtk_files = vtk.vtkStringArray() >> >> >>>> map(vtk_files.InsertNextValue, sorted_files) >> >> >>>> >> >> >>>> reader = vtkgdcm.vtkGDCMImageReader() >> >> >>>> reader.FileLowerLeftOn() >> >> >>>> reader.SetFileNames(vtk_files) >> >> >>>> reader.Update() >> >> >>>> >> >> >>>> spacing = reader.GetOutput().GetSpacing() >> >> >>>> change = vtk.vtkImageChangeInformation() >> >> >>>> change.SetInputConnection(reader.GetOutputPort()) >> >> >>>> change.SetOutputSpacing(spacing[0], spacing[1], zspacing) >> >> >>>> >> >> >>>> im = vtk.vtkImageResliceMapper() >> >> >>>> im.SetInputConnection(change.GetOutputPort()) >> >> >>>> im.SliceFacesCameraOn() >> >> >>>> im.SliceAtFocalPointOn() >> >> >>>> im.BorderOff() >> >> >>>> >> >> >>>> ip = vtk.vtkImageProperty() >> >> >>>> ip.SetColorWindow(255) >> >> >>>> ip.SetColorLevel(128) >> >> >>>> ip.SetAmbient(0.0) >> >> >>>> ip.SetDiffuse(1.0) >> >> >>>> ip.SetOpacity(1.0) >> >> >>>> ip.SetInterpolationTypeToLinear() >> >> >>>> >> >> >>>> ia = vtk.vtkImageSlice() >> >> >>>> ia.SetMapper(im) >> >> >>>> ia.SetProperty(ip) >> >> >>>> >> >> >>>> renderer = vtk.vtkRenderer() >> >> >>>> renderer.AddViewProp(ia) >> >> >>>> renderer.SetBackground(0 , 0, 0) >> >> >>>> render_window.AddRenderer(renderer) >> >> >>>> >> >> >>>> style.SetCurrentRenderer(renderer) >> >> >>>> style.SetZViewRightVector((1, 0, 0)) >> >> >>>> style.SetZViewUpVector((0, -1, 0)) >> >> >>>> >> >> >>>> style.SetXViewRightVector((0, 1, 0)) >> >> >>>> style.SetXViewUpVector((0, 0, 1)) >> >> >>>> >> >> >>>> style.SetYViewRightVector((1, 0, 0)) >> >> >>>> style.SetYViewUpVector((0, 0, 1)) >> >> >>>> style.SetImageOrientation(style.GetZViewRightVector(), >> >> >>>> style.GetZViewUpVector()) >> >> >>>> >> >> >>>> # render the image >> >> >>>> renderer.ResetCamera() >> >> >>>> renderer.GetActiveCamera().ParallelProjectionOn() >> >> >>>> renderer.ResetCameraClippingRange() >> >> >>>> render_window.Render() >> >> >>>> >> >> >>>> interactor.Initialize() >> >> >>>> interactor.Start() >> >> >>>> >> >> >>>> the problems arise in this sequence: >> >> >>>> >> >> >>>> 1- initially display the image: ok >> >> >>>> 2- slice the image to a different slice with ctrl + mosue left: >> >> >>>> ok >> >> >>>> 3- change the orientation to a different one (sagital or coronal, >> >> >>>> doesn't >> >> >>>> matter): this is the problem, orientation of the image is changed >> >> >>>> fine to >> >> >>>> the new one but the image is panned to a different position in the >> >> >>>> render >> >> >>>> window/renderer, not the center of it and in a different slice >> >> >>>> (the >> >> >>>> middle >> >> >>>> slice of the whole image) >> >> >>>> >> >> >>>> how can I avoid this, I mean, keep the image centered in the >> >> >>>> render >> >> >>>> window/renderer when the image orientation is changed and in the >> >> >>>> correct >> >> >>>> slice location? >> > >> > > > From ivan.kushnar at gmail.com Wed Dec 12 14:12:28 2012 From: ivan.kushnar at gmail.com (IvanKushnar) Date: Wed, 12 Dec 2012 11:12:28 -0800 (PST) Subject: [vtkusers] Camera movement Message-ID: <1355339548422-5717587.post@n5.nabble.com> Hello, I'd like to translate camera in its local coordinate system.But I didn't find any function to do this. Should I you some matrix tranformations? Or maybe exist some simpler way? Thank you -- View this message in context: http://vtk.1045678.n5.nabble.com/Camera-movement-tp5717587.html Sent from the VTK - Users mailing list archive at Nabble.com. From daviddoria at gmail.com Wed Dec 12 14:15:37 2012 From: daviddoria at gmail.com (David Doria) Date: Wed, 12 Dec 2012 14:15:37 -0500 Subject: [vtkusers] Camera movement In-Reply-To: <1355339548422-5717587.post@n5.nabble.com> References: <1355339548422-5717587.post@n5.nabble.com> Message-ID: On Wed, Dec 12, 2012 at 2:12 PM, IvanKushnar wrote: > Hello, > I'd like to translate camera in its local coordinate system.But I didn't > find any function to do this. > Should I you some matrix tranformations? Or maybe exist some simpler way > Can you just use SetPosition(GetPosition() + yourTranslation)? http://www.vtk.org/doc/nightly/html/classvtkCamera.html#a6735b97c80941b8fd118b94ac207a921 David -------------- next part -------------- An HTML attachment was scrubbed... URL: From joachim.pouderoux at kitware.com Wed Dec 12 16:26:07 2012 From: joachim.pouderoux at kitware.com (Joachim Pouderoux) Date: Wed, 12 Dec 2012 22:26:07 +0100 Subject: [vtkusers] Java, SWT and SetInputConnection vs SetInput In-Reply-To: References: Message-ID: <7503250033494683634@unknownmsgid> For your information, I will commit in the next days a set of new java classes for vtk and one of them is a pure SWT rendering panel (no more awt bridge needed). Joachim Le 12 d?c. 2012 ? 16:02, Gerrick Bivins a ?crit : After a cup of coffee, I realized the problem. I had a version mismatch?the version of VTK used to generate the vtk.jar in my bundle was 5.7 and the dll?s in my fragment were 5.10? Resolved that issue and things work as expected! ;) *From:* vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] *On Behalf Of *Gerrick Bivins *Sent:* Wednesday, December 12, 2012 8:01 AM *To:* vtkusers at vtk.org *Subject:* [vtkusers] Java, SWT and SetInputConnection vs SetInput Hello, I?m in the process of evaluating vtk in an Eclipse RCP application. I?ve successfully used vtk in NetBeans RCP applications so I?m hoping for a similarly successful out come! Anyway, while experimenting with SWT, I?ve run into an issue where my SWT component that embeds a vtkPanel brings the entire application down if I setup my pipeline using SetInputConnection. If I switch it to SetInput, it works fine. I?ve seen similar behavoir with Swing and it had to do with threading. I?m new to SWT so it?s not clear to me, if I want to use SetInputConnection/GetOutputPort for my pipeline setup, where is it ?safe? to make these calls? @Override *protected* *void* createViewContent(Composite parent) { // *TODO* Auto-generated method stub Composite composite = *new* Composite(parent, SWT.*EMBEDDED*); parent.setLayout(*new* FillLayout()); Frame frame = SWT_AWT.*new_Frame*(composite); panel = *new* vtk.vtkPanel(); *final* vtkConeSource cone = *new* vtkConeSource(); cone.SetResolution(16); vtkPolyDataMapper coneMapper = *new* vtkPolyDataMapper(); coneMapper.SetInput(cone.GetOutput());//works //THIS crashes in the jvm and exits the application!!! // coneMapper.SetInputConnection(cone.GetOutputPort()); vtkActor coneActor = *new* vtkActor(); coneActor.SetMapper(coneMapper); panel.GetRenderer().AddActor(coneActor); frame.add(panel); frame.setBackground(Color.*BLUE*); } _______________________________________________ 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://www.vtk.org/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan.kushnar at gmail.com Wed Dec 12 16:39:33 2012 From: ivan.kushnar at gmail.com (IvanKushnar) Date: Wed, 12 Dec 2012 13:39:33 -0800 (PST) Subject: [vtkusers] Camera movement In-Reply-To: References: <1355339548422-5717587.post@n5.nabble.com> Message-ID: <1355348373831-5717590.post@n5.nabble.com> But they get/set in world coordinate system. I'd like to move my camera in its coordinate system. So as I get right, the only way is matrix multiplication/transformation. -- View this message in context: http://vtk.1045678.n5.nabble.com/Camera-movement-tp5717587p5717590.html Sent from the VTK - Users mailing list archive at Nabble.com. From joachim.pouderoux at kitware.com Wed Dec 12 18:01:31 2012 From: joachim.pouderoux at kitware.com (Joachim Pouderoux) Date: Thu, 13 Dec 2012 00:01:31 +0100 Subject: [vtkusers] Fwd: [CMake] CMAKE_MAKE_PROGRAM is not set - Win7 and Visual Studio 10 In-Reply-To: References: <404B71B8-F346-4B85-B958-A97657F1D945@artenum.com> Message-ID: <3315082122939397449@unknownmsgid> Hi Benoit, Are you sure that your Vs2010 installation provides a x64 toolchain ? It may not have been installed by default and for instance, the Express edition does not provide it. Are you able to compile in x86 mode? Regards, Joachim Le 12 d?c. 2012 ? 10:31, "Beno?t Thi?bault" a ?crit : Hi everyone, I sent this question on CMake mailing list a week ago and never had any answer. As it deals with compiling VTK, I'm thinking maybe some of you have a solution. Kind regards, Beno?t D?but du message r?exp?di? : *De : *Beno?t Thi?bault *Date : *5 d?cembre 2012 14:21:23 HNEC *? : *cmake at cmake.org *Objet : **[CMake] CMAKE_MAKE_PROGRAM is not set - Win7 and Visual Studio 10 * Hi everyone, I am trying to compile VTK on Windows 7 64bits with Visual Studio 10. But when I click on "configure" in CMake, it shows the following error message: CMake Error: CMake was unable to find a build program corresponding to "Visual Studio 10 Win64". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool. CMake Error: Could not find cmake module file:C:/Users/artenum/Downloads/vtk-5.8.0/build/CMakeFiles/ 2.8.10.2/CMakeCCompiler.cmake CMake Error: Could not find cmake module file:C:/Users/artenum/Downloads/vtk-5.8.0/build/CMakeFiles/ 2.8.10.2/CMakeCXXCompiler.cmake Configuring incomplete, errors occurred! I looked at the CMakeVS10FindMake.cmake file located in C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules and found the following command: find_program(CMAKE_MAKE_PROGRAM NAMES devenv HINTS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;EnvironmentDirectory] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup;Dbghelp_path] "$ENV{ProgramFiles}/Microsoft Visual Studio 10.0/Common7/IDE" "$ENV{ProgramFiles}/Microsoft Visual Studio10.0/Common7/IDE" "$ENV{ProgramFiles}/Microsoft Visual Studio 10/Common7/IDE" "$ENV{ProgramFiles}/Microsoft Visual Studio10/Common7/IDE" "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 10.0/Common7/IDE" "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio10.0/Common7/IDE" "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 10/Common7/IDE" "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio10/Common7/IDE" "/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/" "/Program Files/Microsoft Visual Studio 10/Common7/IDE/" ) Here a copy/paste of the path of my Visual Studio 10 installation (and in particular the IDE folder): C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE I should add that my Windows 7 installation is in French. This means that the "Program Files" folder is named "Programmes" (in French) but "Progam Files (x86)" is in english. I have added the two following lines in the command to be sure, but it still does not work: "/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/" "/Program Files (x86)/Microsoft Visual Studio 10/Common7/IDE/" What should I do? Kind regards, Ben _______________________________________________ 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://www.vtk.org/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexmalvtk at gmail.com Wed Dec 12 18:34:12 2012 From: alexmalvtk at gmail.com (Alex Malyushytskyy) Date: Wed, 12 Dec 2012 15:34:12 -0800 Subject: [vtkusers] Problem with color after using vtkClipPolyData In-Reply-To: References: Message-ID: Self-sufficient example would help. As is I can only guess that you probably did not want to clip normal as you currently do and wanted to clip read polydata: clipper->SetInput(reader->GetOutput()); Alex On Tue, Dec 11, 2012 at 10:18 PM, gongweixue wrote: > hi guys, > I used a vtkClipPolyData to clip polydata, and I found that the color of > surfaces after clipping is changed. > So,dose anybody know the reason? > here is my code. > > //////////////////////code///////////////////////////// > vtkPolyDataReader *reader=vtkPolyDataReader::New(); > reader->SetFileName(FILENAME); > reader->Update(); > > vtkClipPolyData * clipper=vtkClipPolyData::New(); > clipper->SetInput(normals->GetOutput()); > vtkPlane * plane = vtkPlane::New(); > plane->SetOrigin(0.5,0,0); > plane->SetNormal(1,1,1); > clipper->SetClipFunction(plane); > clipper->SetValue(0.5); > clipper->SetInsideOut(1); > clipper->Update(); > > vtkPolyDataMapper *mapper=vtkPolyDataMapper::New(); > mapper->SetInput(clipper->GetOutput()); > vtkActor *actor=vtkActor::New(); > actor->SetMapper(mapper); > vtkRenderer *ren1= vtkRenderer::New(); > ren1->AddActor( actor ); > ren1->SetBackground( 0.1, 0.2, 0.4 ); > vtkRenderWindow *renWin = vtkRenderWindow::New(); > renWin->AddRenderer( ren1 ); > renWin->SetSize( 600, 600 ); > vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New(); > iren->SetRenderWindow(renWin); > vtkInteractorStyleTrackballCamera *style = > vtkInteractorStyleTrackballCamera::New(); > iren->SetInteractorStyle(style); > iren->Initialize(); > iren->Start(); > /////////////////////////////////////////////// > And here is the pic: > http://p13.freep.cn/p.aspx?u=v20_p13_photo_1212121410379520_0.jpg > > I will appreciate any suggestion very much! > > > _______________________________________________ > 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://www.vtk.org/mailman/listinfo/vtkusers > From benoitscherrer at gmail.com Wed Dec 12 20:27:32 2012 From: benoitscherrer at gmail.com (Benoit Scherrer) Date: Wed, 12 Dec 2012 20:27:32 -0500 Subject: [vtkusers] vtkFreeTypeUtilities.h includes FTGL.h? In-Reply-To: <20111104195932.1890731735@mail.rogue-research.com> References: <20111104195932.1890731735@mail.rogue-research.com> Message-ID: Hi, I just tried again with the last version of VTK on the repository and nothing has not changed about that. It seems that anybody wanting to use vtkFreeTypeUtilities.h cannot compile their application with an install version of VTK. Isn t it a major bug? Or are we not supposed to use vtkFreeTypeUtilities.h ? Thanks a lot! B On Fri, Nov 4, 2011 at 3:59 PM, Sean McBride wrote: > On Fri, 4 Nov 2011 15:22:04 -0400, Benoit Scherrer said: > > >I just pulled the new version of VTK today and compiled it: no problem. > >However my program using VTK was not compiling anymore. > > > >The problem comes from i'm using vtkFreeTypeUtilities.h . > >This file now includes FTGL.h, which is not in the 'Install' output of VTK > >(but in Utilities/ftgl of the source of VTK). > > > >I just commented the line '#include ' in vtkFreeTypeUtilities.h > >and it seems it was not necessary, everything works fine. > > My guess is vtkFreeTypeUtilities.h includes FTGL.h because it's FTGL.h > that #defines FTGL_USE_NAMESPACE, and vtkFreeTypeUtilities.h tests if it is > defined. So it may still compile after you removed it, but it's probably > compiling something different. > > Maybe FTGL.h should be installed, I dunno. > > -- > ____________________________________________________________ > Sean McBride, B. Eng sean at rogue-research.com > Rogue Research www.rogue-research.com > Mac Software Developer Montr?al, Qu?bec, Canada > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gongweixue at sina.com Wed Dec 12 20:54:45 2012 From: gongweixue at sina.com (gongweixue) Date: Thu, 13 Dec 2012 09:54:45 +0800 Subject: [vtkusers] Problem with color after using vtkClipPolyData References: Message-ID: Thanks for your answer. Yes, I also have tried to clip polydata, not normals. But the result's color is just not same as the original model. So I think maybe it is my model's problem,because the model is converted from a vrml model. I used vtkTableBasedClipDataSet, and the color is right. I was confused. And when treat it as a DataSet with normals, the color is right. Do you know the reason? Thank you very much! 2012/12/13 gongweixue at sina.com ----- Original Message ----- From: Alex Malyushytskyy To: vtkusers Date: 2012-12-13, 07:34:12 Subject: Re: [vtkusers] Problem with color after using vtkClipPolyData Self-sufficient example would help. As is I can only guess that you probably did not want to clip normal as you currently do and wanted to clip read polydata: clipper->SetInput(reader->GetOutput()); Alex On Tue, Dec 11, 2012 at 10:18 PM, gongweixue wrote: > hi guys, > I used a vtkClipPolyData to clip polydata, and I found that the color of > surfaces after clipping is changed. > So,dose anybody know the reason? > here is my code. > > //////////////////////code///////////////////////////// > vtkPolyDataReader *reader=vtkPolyDataReader::New(); > reader->SetFileName(FILENAME); > reader->Update(); > > vtkClipPolyData * clipper=vtkClipPolyData::New(); > clipper->SetInput(normals->GetOutput()); > vtkPlane * plane = vtkPlane::New(); > plane->SetOrigin(0.5,0,0); > plane->SetNormal(1,1,1); > clipper->SetClipFunction(plane); > clipper->SetValue(0.5); > clipper->SetInsideOut(1); > clipper->Update(); > > vtkPolyDataMapper *mapper=vtkPolyDataMapper::New(); > mapper->SetInput(clipper->GetOutput()); > vtkActor *actor=vtkActor::New(); > actor->SetMapper(mapper); > vtkRenderer *ren1= vtkRenderer::New(); > ren1->AddActor( actor ); > ren1->SetBackground( 0.1, 0.2, 0.4 ); > vtkRenderWindow *renWin = vtkRenderWindow::New(); > renWin->AddRenderer( ren1 ); > renWin->SetSize( 600, 600 ); > vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New(); > iren->SetRenderWindow(renWin); > vtkInteractorStyleTrackballCamera *style = > vtkInteractorStyleTrackballCamera::New(); > iren->SetInteractorStyle(style); > iren->Initialize(); > iren->Start(); > /////////////////////////////////////////////// > And here is the pic: > http://p13.freep.cn/p.aspx?u=v20_p13_photo_1212121410379520_0.jpg > > I will appreciate any suggestion very much! > > > _______________________________________________ > 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://www.vtk.org/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://www.vtk.org/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcus.hanwell at kitware.com Wed Dec 12 21:54:36 2012 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Wed, 12 Dec 2012 21:54:36 -0500 Subject: [vtkusers] vtkFreeTypeUtilities.h includes FTGL.h? In-Reply-To: References: <20111104195932.1890731735@mail.rogue-research.com> Message-ID: On Wed, Dec 12, 2012 at 8:27 PM, Benoit Scherrer wrote: > I just tried again with the last version of VTK on the repository and > nothing has not changed about that. > It seems that anybody wanting to use vtkFreeTypeUtilities.h cannot compile > their application with an install > version of VTK. Isn t it a major bug? Or are we not supposed to use > vtkFreeTypeUtilities.h ? > If you take a look at the class documentation, http://www.vtk.org/doc/nightly/html/classvtkFreeTypeUtilities.html#details It clearly marks it as for internal use only, it has been marked as such for as long as I can remember. Thanks, Marcus From thiebault at artenum.com Thu Dec 13 03:23:16 2012 From: thiebault at artenum.com (=?iso-8859-1?Q?Beno=EEt_Thi=E9bault?=) Date: Thu, 13 Dec 2012 09:23:16 +0100 Subject: [vtkusers] Fwd: [CMake] CMAKE_MAKE_PROGRAM is not set - Win7 and Visual Studio 10 In-Reply-To: <3315082122939397449@unknownmsgid> References: <404B71B8-F346-4B85-B958-A97657F1D945@artenum.com> <3315082122939397449@unknownmsgid> Message-ID: <06EE54FF-BA79-4A59-BC5B-008E03C6EB69@artenum.com> > Are you sure that your Vs2010 installation provides a x64 toolchain ? Nope, I'm not sure :-) And I don't know how to check that I'm more a Linux/Mac guy > Are you able to compile in x86 mode? What do you mean? When I click on the "configure" button for the first time, it asks me what generator I want. I have several choices for VS: - Visual Studio 10 - Visual Studio 10 Win64 - Visual Studio 10 IA64 It seems I have a 32 bits version, so I selected "Visual Studio 10" and "Use default native compilers". This should compile in x86 mode, right? I did not have the time to try configuring the compilers manually as John suggested. I will try to install Visual Studio 10 (not Express) and see if it works better Kind regards, Ben Le 13 d?c. 2012 ? 00:01, Joachim Pouderoux a ?crit : > Hi Benoit, > > Are you sure that your Vs2010 installation provides a x64 toolchain ? It may not have been installed by default and for instance, the Express edition does not provide it. > Are you able to compile in x86 mode? > > Regards, > > Joachim > > Le 12 d?c. 2012 ? 10:31, "Beno?t Thi?bault" a ?crit : > >> Hi everyone, >> >> I sent this question on CMake mailing list a week ago and never had any answer. >> >> As it deals with compiling VTK, I'm thinking maybe some of you have a solution. >> >> Kind regards, >> >> Beno?t >> >> D?but du message r?exp?di? : >> >>> De : Beno?t Thi?bault >>> Date : 5 d?cembre 2012 14:21:23 HNEC >>> ? : cmake at cmake.org >>> Objet : [CMake] CMAKE_MAKE_PROGRAM is not set - Win7 and Visual Studio 10 >>> >>> Hi everyone, >>> >>> I am trying to compile VTK on Windows 7 64bits with Visual Studio 10. >>> >>> But when I click on "configure" in CMake, it shows the following error message: >>> >>> CMake Error: CMake was unable to find a build program corresponding to "Visual Studio 10 Win64". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool. >>> CMake Error: Could not find cmake module file:C:/Users/artenum/Downloads/vtk-5.8.0/build/CMakeFiles/2.8.10.2/CMakeCCompiler.cmake >>> CMake Error: Could not find cmake module file:C:/Users/artenum/Downloads/vtk-5.8.0/build/CMakeFiles/2.8.10.2/CMakeCXXCompiler.cmake >>> Configuring incomplete, errors occurred! >>> >>> I looked at the CMakeVS10FindMake.cmake file located in C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules and found the following command: >>> >>> find_program(CMAKE_MAKE_PROGRAM >>> NAMES devenv >>> HINTS >>> [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;EnvironmentDirectory] >>> [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup;Dbghelp_path] >>> "$ENV{ProgramFiles}/Microsoft Visual Studio 10.0/Common7/IDE" >>> "$ENV{ProgramFiles}/Microsoft Visual Studio10.0/Common7/IDE" >>> "$ENV{ProgramFiles}/Microsoft Visual Studio 10/Common7/IDE" >>> "$ENV{ProgramFiles}/Microsoft Visual Studio10/Common7/IDE" >>> "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 10.0/Common7/IDE" >>> "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio10.0/Common7/IDE" >>> "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 10/Common7/IDE" >>> "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio10/Common7/IDE" >>> "/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/" >>> "/Program Files/Microsoft Visual Studio 10/Common7/IDE/" >>> ) >>> >>> Here a copy/paste of the path of my Visual Studio 10 installation (and in particular the IDE folder): >>> C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE >>> >>> I should add that my Windows 7 installation is in French. This means that the "Program Files" folder is named "Programmes" (in French) but "Progam Files (x86)" is in english. >>> >>> I have added the two following lines in the command to be sure, but it still does not work: >>> "/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/" >>> "/Program Files (x86)/Microsoft Visual Studio 10/Common7/IDE/" >>> >>> What should I do? >>> >>> Kind regards, >>> >>> Ben >> >> >> _______________________________________________ >> 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://www.vtk.org/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From acsantome at gmail.com Thu Dec 13 04:00:35 2012 From: acsantome at gmail.com (a.c.sant) Date: Thu, 13 Dec 2012 01:00:35 -0800 (PST) Subject: [vtkusers] RemoveObserver isn't working. In-Reply-To: References: <1355331938554-5717581.post@n5.nabble.com> Message-ID: <1355389235735-5717597.post@n5.nabble.com> Hi David, in the end I managed to find out what was wrong. I didn't realized that the /AddObserver()/ function returned the tag of the new observer. Thus, I changed a bit the code: Hope this helps others as well!. Cheers!. -- View this message in context: http://vtk.1045678.n5.nabble.com/RemoveObserver-isn-t-working-tp5717581p5717597.html Sent from the VTK - Users mailing list archive at Nabble.com. From agatakrason at gmail.com Thu Dec 13 04:40:56 2012 From: agatakrason at gmail.com (agatte) Date: Thu, 13 Dec 2012 01:40:56 -0800 (PST) Subject: [vtkusers] Problem dispaly image dicom series Message-ID: <1355391656808-5717598.post@n5.nabble.com> Hi, I followed example ReadDICOMSeries : http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/ReadDICOMSeries I can't display my dicom series. It compiled well but I received only window with black background without iimage. I received errors : ERROR: In /user/home/Documents//VTK/sources/IO/vtkDICOMImageReader.cxx, line 346 vtkDICOMImageReader (0x24c33c0): There was a problem retrieving data from: //user//home//Documents//ExampleVTKSwiss//ProgramVTK//build//hip///1.3.12.2.1107.5.6.1.69020.30000112061911190750000002302 ERROR: In /user/home/Documents/VTK/sources/Filtering/vtkExecutive.cxx, line 756 vtkStreamingDemandDrivenPipeline (0x24c4340): Algorithm vtkDICOMImageReader(0x24c33c0) returned failure for request: vtkInformation (0x24cbd30) Debug: Off Modified Time: 108 Reference Count: 1 Registered Events: (none) Request: REQUEST_DATA FROM_OUTPUT_PORT: 0 FORWARD_DIRECTION: 0 ALGORITHM_AFTER_FORWARD: 1 I would appreciate for any help. I don't have any idea what I should do now. agatte -- View this message in context: http://vtk.1045678.n5.nabble.com/Problem-dispaly-image-dicom-series-tp5717598.html Sent from the VTK - Users mailing list archive at Nabble.com. From agarin at ceit.es Thu Dec 13 05:00:10 2012 From: agarin at ceit.es (Garin, Alba) Date: Thu, 13 Dec 2012 11:00:10 +0100 Subject: [vtkusers] Problem dispaly image dicom series In-Reply-To: <1355391656808-5717598.post@n5.nabble.com> References: <1355391656808-5717598.post@n5.nabble.com> Message-ID: <7A107805A3E03C4383EE831B1C11244D6FCAE56D7D@MAILCLUSTER.tecnun.es> Looks like an error with the path, no? // //user//home//Documents//ExampleVTKSwiss//ProgramVTK//build//hip///1.3.12.2.1107.5.6.1.69020.30000112061911190750000002302 But just my opinion, 'cause happened to me few times. Regards, Alba Alba Garin Muga Computer Science PhD Student Applied Mechanics Department Paseo Manuel Lardizabal, 15 20018 Donostia-San Sebastian. Spain Tel. +34 943 212 800 (Ext. 2111) Fax: +34 943 213 076 Web: www.ceit.es Antes de imprimir este e-mail piense bien si es necesario hacerlo. El medioambiente es cosa de todos. Before printing this e-mail ask yourself if you really need a hard copy. We are all responsible for the environment. -----Original Message----- From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of agatte Sent: jueves, 13 de diciembre de 2012 10:41 To: vtkusers at vtk.org Subject: [vtkusers] Problem dispaly image dicom series Hi, I followed example ReadDICOMSeries : http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/ReadDICOMSeries I can't display my dicom series. It compiled well but I received only window with black background without iimage. I received errors : ERROR: In /user/home/Documents//VTK/sources/IO/vtkDICOMImageReader.cxx, line 346 vtkDICOMImageReader (0x24c33c0): There was a problem retrieving data from: //user//home//Documents//ExampleVTKSwiss//ProgramVTK//build//hip///1.3.12.2.1107.5.6.1.69020.30000112061911190750000002302 ERROR: In /user/home/Documents/VTK/sources/Filtering/vtkExecutive.cxx, line 756 vtkStreamingDemandDrivenPipeline (0x24c4340): Algorithm vtkDICOMImageReader(0x24c33c0) returned failure for request: vtkInformation (0x24cbd30) Debug: Off Modified Time: 108 Reference Count: 1 Registered Events: (none) Request: REQUEST_DATA FROM_OUTPUT_PORT: 0 FORWARD_DIRECTION: 0 ALGORITHM_AFTER_FORWARD: 1 I would appreciate for any help. I don't have any idea what I should do now. agatte -- View this message in context: http://vtk.1045678.n5.nabble.com/Problem-dispaly-image-dicom-series-tp5717598.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://www.vtk.org/mailman/listinfo/vtkusers From agatakrason at gmail.com Thu Dec 13 07:31:50 2012 From: agatakrason at gmail.com (agatte) Date: Thu, 13 Dec 2012 04:31:50 -0800 (PST) Subject: [vtkusers] Problem dispaly image dicom series In-Reply-To: <7A107805A3E03C4383EE831B1C11244D6FCAE56D7D@MAILCLUSTER.tecnun.es> References: <1355391656808-5717598.post@n5.nabble.com> <7A107805A3E03C4383EE831B1C11244D6FCAE56D7D@MAILCLUSTER.tecnun.es> Message-ID: <1355401910704-5717600.post@n5.nabble.com> Path is good. Starting /home/Documents/agata/ExampleVTK/ProgramVTK/build/ProgramVTK... ERROR: In /user/home/Documents/agata/VTK/sources/IO/vtkDICOMImageReader.cxx, line 346 vtkDICOMImageReader (0xed63c0): There was a problem retrieving data from: //user//home//Documents//agata//ExampleVTK//ProgramVTK//build//ankle/1.3.12.2.1107.5.6.1.69020.30000112061911190750000003378 ERROR: In /user/home/Documents/agata/VTK/sources/Filtering/vtkExecutive.cxx, line 756 vtkStreamingDemandDrivenPipeline (0xed7340): Algorithm vtkDICOMImageReader(0xed63c0) returned failure for request: vtkInformation (0xedf6d0) Debug: Off Modified Time: 108 Reference Count: 1 Registered Events: (none) Request: REQUEST_DATA ALGORITHM_AFTER_FORWARD: 1 FROM_OUTPUT_PORT: 0 FORWARD_DIRECTION: 0 Slice: Min = 0, Max = 30 MoveSliceForward::Slice = 1 MoveSliceForward::Slice = 2 MoveSliceForward::Slice = 3 MoveSliceForward::Slice = 4 MoveSliceForward::Slice = 5 MoveSliceForward::Slice = 6 MoveSliceForward::Slice = 7 MoveSliceForward::Slice = 8 MoveSliceForward::Slice = 9 MoveSliceForward::Slice = 10 MoveSliceForward::Slice = 11 MoveSliceForward::Slice = 12 MoveSliceForward::Slice = 13 MoveSliceForward::Slice = 14 MoveSliceForward::Slice = 15 MoveSliceBackward::Slice = 1 MoveSliceBackward::Slice = 1 MoveSliceBackward::Slice = 1 MoveSliceBackward::Slice = 1 MoveSliceBackward::Slice = 1 MoveSliceBackward::Slice = 1 MoveSliceBackward::Slice = 1 MoveSliceBackward::Slice = 1 MoveSliceForward::Slice = 2 MoveSliceForward::Slice = 3 MoveSliceForward::Slice = 4 MoveSliceForward::Slice = 5 MoveSliceForward::Slice = 6 MoveSliceForward::Slice = 7 MoveSliceForward::Slice = 8 MoveSliceForward::Slice = 9 MoveSliceForward::Slice = 10 MoveSliceForward::Slice = 11 MoveSliceForward::Slice = 12 MoveSliceForward::Slice = 13 MoveSliceForward::Slice = 14 MoveSliceForward::Slice = 15 MoveSliceForward::Slice = 16 MoveSliceForward::Slice = 17 MoveSliceForward::Slice = 18 MoveSliceForward::Slice = 19 MoveSliceForward::Slice = 20 MoveSliceForward::Slice = 21 MoveSliceForward::Slice = 22 MoveSliceForward::Slice = 23 MoveSliceForward::Slice = 24 MoveSliceForward::Slice = 25 MoveSliceForward::Slice = 26 MoveSliceForward::Slice = 27 MoveSliceForward::Slice = 28 MoveSliceForward::Slice = 29 MoveSliceForward::Slice = 30 /home/Documents/agata/ExampleVTK/ProgramVTK/build/ProgramVTK exited with code 0 I don't know why I can't display this series in vtk. When I try with dicom series from example It works well, but when I try with this one.. It doesn't work ;// I would appreciate for any help please :) -- View this message in context: http://vtk.1045678.n5.nabble.com/Problem-dispaly-image-dicom-series-tp5717598p5717600.html Sent from the VTK - Users mailing list archive at Nabble.com. From Gerrick.Bivins at halliburton.com Thu Dec 13 07:16:09 2012 From: Gerrick.Bivins at halliburton.com (Gerrick Bivins) Date: Thu, 13 Dec 2012 12:16:09 +0000 Subject: [vtkusers] Java, SWT and SetInputConnection vs SetInput In-Reply-To: <7503250033494683634@unknownmsgid> References: <7503250033494683634@unknownmsgid> Message-ID: Fantastic!! From: Joachim Pouderoux [mailto:joachim.pouderoux at kitware.com] Sent: Wednesday, December 12, 2012 3:26 PM To: Gerrick Bivins Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Java, SWT and SetInputConnection vs SetInput For your information, I will commit in the next days a set of new java classes for vtk and one of them is a pure SWT rendering panel (no more awt bridge needed). Joachim Le 12 d?c. 2012 ? 16:02, Gerrick Bivins > a ?crit : After a cup of coffee, I realized the problem. I had a version mismatch...the version of VTK used to generate the vtk.jar in my bundle was 5.7 and the dll's in my fragment were 5.10... Resolved that issue and things work as expected! ;) From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of Gerrick Bivins Sent: Wednesday, December 12, 2012 8:01 AM To: vtkusers at vtk.org Subject: [vtkusers] Java, SWT and SetInputConnection vs SetInput Hello, I'm in the process of evaluating vtk in an Eclipse RCP application. I've successfully used vtk in NetBeans RCP applications so I'm hoping for a similarly successful out come! Anyway, while experimenting with SWT, I've run into an issue where my SWT component that embeds a vtkPanel brings the entire application down if I setup my pipeline using SetInputConnection. If I switch it to SetInput, it works fine. I've seen similar behavoir with Swing and it had to do with threading. I'm new to SWT so it's not clear to me, if I want to use SetInputConnection/GetOutputPort for my pipeline setup, where is it "safe" to make these calls? @Override protected void createViewContent(Composite parent) { // TODO Auto-generated method stub Composite composite = new Composite(parent, SWT.EMBEDDED); parent.setLayout(new FillLayout()); Frame frame = SWT_AWT.new_Frame(composite); panel = new vtk.vtkPanel(); final vtkConeSource cone = new vtkConeSource(); cone.SetResolution(16); vtkPolyDataMapper coneMapper = new vtkPolyDataMapper(); coneMapper.SetInput(cone.GetOutput());//works //THIS crashes in the jvm and exits the application!!! // coneMapper.SetInputConnection(cone.GetOutputPort()); vtkActor coneActor = new vtkActor(); coneActor.SetMapper(coneMapper); panel.GetRenderer().AddActor(coneActor); frame.add(panel); frame.setBackground(Color.BLUE); } _______________________________________________ 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://www.vtk.org/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From metty87 at googlemail.com Thu Dec 13 09:31:56 2012 From: metty87 at googlemail.com (=?ISO-8859-15?Q?Matthias_H=E4rtel?=) Date: Thu, 13 Dec 2012 15:31:56 +0100 Subject: [vtkusers] Extension GL_VERSION_1_4 could not be loaded Message-ID: <50C9E6DC.7070009@googlemail.com> Hey, iam working on a parallel rendering program. Everything works fine. But sometimes, i get this error: "Extension GL_VERSION_1_4 could not be loaded." For the parallel Rendering, i create 12 threads. Each of them create a own renderer and renderWindow. Then, a thread catches a new frame from a manager-class (mutex locked) and render this frame. But in some case, the thread gets after renderWindow creation this error and gets terminated. Did anyone know this error? Regards, Matthias From imanolm at lsi.upc.edu Thu Dec 13 11:39:10 2012 From: imanolm at lsi.upc.edu (=?ISO-8859-1?Q?Imanol_Mu=F1oz_Pandiella?=) Date: Thu, 13 Dec 2012 17:39:10 +0100 Subject: [vtkusers] Moving a sphere through the 3D space Message-ID: <50CA04AE.3040507@lsi.upc.edu> Hello, in my vtk application i am visualizing a sphere in the space. I would like to move the sphere with the mouse along the x and y axis of the camera's reference frame. I mean, i don't want to modify the position in the z axis of the camera's reference frame. In this way, I'm using the following code during the mouse movement to obtain the new position of the sphere after an interaction with the mouse: double point[3]; mCellPicker->Pick(mStyle->GetInteractor()->GetEventPosition()[0], mStyle->GetInteractor()->GetEventPosition()[1], 0, mStyle->GetInteractor()->GetRenderWindow()->GetRenderers()->GetFirstRenderer()); mCellPicker->GetPickPosition(point); mSphere->SetCenter(point[0],point[1],point[2]); where mCellPicker and mStle are declared as follows: vtkCellPicker *mCellPicker; vtkInteractorStyleTrackballCamera* mStyle; The problem is the position of the sphere is modified in the x and y axis of the camera's reference frame and also, in the z axis. In this axis the sphere is placed in the middle of the zMin and zMax of the volume space. To ensure that the picker is not interacting with the rest of the actors of the scene, i use the following code whe the mouse button is pressed down without setting the actor list of the picker supposing that the picker will use an empty actor's list: mCellPicker->PickFromListOn(); and the following code when the mouse button is released: mCellPicker->PickFromListOff(); I have seen in another application that it can be done with a vtkPointWidget, and the translation works fine. The problem is I need this functionality to spheres, cylinders, semi-spheres, ... What am I doing wrong? How can I translate the sphere through the volume space without modifying the position of it in the z axis of the camera's reference frame? Thank you very much for your help! -- Imanol Mu?oz i Pandiella. From jmrbcu at gmail.com Thu Dec 13 15:14:49 2012 From: jmrbcu at gmail.com (=?UTF-8?Q?Jos=C3=A9_M=2E_Rodriguez_Bacallao?=) Date: Thu, 13 Dec 2012 15:14:49 -0500 Subject: [vtkusers] QVTKWidget and Qt4 layouts Message-ID: Hello folks, does anyone know how to reorganize a bunch of QVTKWidgets in a grid layout without flickering? I have a bunch of viewer widgets in a QGridLayout, the viewer widget is composed of a titlebar (a custom widget) and a QVTKWidget in a QVBoxLayout. Those viewers are arranged in a grid layout. What I am trying to do is to change the number of rows and columns in the layout. The problem is that when I add more widgets, the main widget (the one with the QGridLayout) flicker. I have set the attribute WA_NativeWindow to the viewer widget, the QVTKWidget and I still getting a flicker. -------------- next part -------------- An HTML attachment was scrubbed... URL: From christophe.petit09 at gmail.com Thu Dec 13 15:26:42 2012 From: christophe.petit09 at gmail.com (chris_123) Date: Thu, 13 Dec 2012 12:26:42 -0800 (PST) Subject: [vtkusers] xtk volume rendering with .vtk file created from matlab Message-ID: <1355430402475-5717605.post@n5.nabble.com> I am beginning with XTK. I would like to load a .vtk file in order to make volume rendering into XTK. This .vtk file has been created with a matlab function which saves a 3D data array (voxel) into vtk format : function savevtk(array, filename) % savevtk Save a 3-D scalar array in VTK format. % savevtk(array, filename) saves a 3-D array of any size to % filename in VTK format. [nx, ny, nz] = size(array); fid = fopen(filename, 'wt'); fprintf(fid, '# vtk DataFile Version 2.0\n'); fprintf(fid, 'Comment goes here\n'); fprintf(fid, 'ASCII\n'); fprintf(fid, '\n'); fprintf(fid, 'DATASET STRUCTURED_POINTS\n'); fprintf(fid, 'DIMENSIONS %d %d %d\n', nx, ny, nz); fprintf(fid, '\n'); fprintf(fid, 'ORIGIN 0.000 0.000 0.000\n'); fprintf(fid, 'SPACING 1.000 1.000 1.000\n'); fprintf(fid, '\n'); fprintf(fid, 'POINT_DATA %d\n', nx*ny*nz); fprintf(fid, 'SCALARS scalars float\n'); fprintf(fid, 'LOOKUP_TABLE default\n'); fprintf(fid, '\n'); for a=1:nx for b=1:ny for c=1:nz fprintf(fid, '%d ', array(a,b,c)); end fprintf(fid, '\n'); end end fclose(fid); return Once the `'output.vtk'` file is created, I try to load it this way : window.onload = function() { var r = new X.renderer3D(); r.init(); // create a mesh from a .vtk file var skull = new X.mesh(); skull.file = 'output.vtk'; // add the object r.add(skull); // .. and render it r.render(); }; But nothing displays in the browser. Is my 'output.vtk' is not a valid .vtk file for volume rendering ? How to load into XTK this kind of file ? -- View this message in context: http://vtk.1045678.n5.nabble.com/xtk-volume-rendering-with-vtk-file-created-from-matlab-tp5717605.html Sent from the VTK - Users mailing list archive at Nabble.com. From lobo.theslayer at gmail.com Thu Dec 13 15:30:18 2012 From: lobo.theslayer at gmail.com (Rodrigo Lovera) Date: Thu, 13 Dec 2012 15:30:18 -0500 Subject: [vtkusers] Question on vtkPipelineSize Message-ID: Hello all vtkusers, Can anyone explain me the correct way to apply vtkPipelineSize in order to evaluate performance of a pipeline of vtk in Visual Studio C++ environment?? Thx in advance -- *Rodrigo* -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan.kushnar at gmail.com Thu Dec 13 16:13:41 2012 From: ivan.kushnar at gmail.com (IvanKushnar) Date: Thu, 13 Dec 2012 13:13:41 -0800 (PST) Subject: [vtkusers] Camera movement In-Reply-To: <1355348373831-5717590.post@n5.nabble.com> References: <1355339548422-5717587.post@n5.nabble.com> <1355348373831-5717590.post@n5.nabble.com> Message-ID: <1355433221553-5717607.post@n5.nabble.com> I almost did it (the focus point still the same=(). So I get rotation instead of translation=( virtual void OnKeyDown() { vtkRenderWindowInteractor *rwi = this->Interactor; vtkSmartPointer camera; std::string key = rwi->GetKeySym(); if(key == "Up") { double p[3]; double loc[3]={0,0,-5}; vtkSmartPointer tr=vtkSmartPointer::New(); tr->Identity(); tr->SetMatrix(camera->GetModelViewTransformObject()->GetMatrix()); tr->Inverse(); tr->TransformPoint(loc,p); camera->SetPosition(p); rwi->Render(); } } -- View this message in context: http://vtk.1045678.n5.nabble.com/Camera-movement-tp5717587p5717607.html Sent from the VTK - Users mailing list archive at Nabble.com. From ivan.kushnar at gmail.com Thu Dec 13 17:18:53 2012 From: ivan.kushnar at gmail.com (IvanKushnar) Date: Thu, 13 Dec 2012 14:18:53 -0800 (PST) Subject: [vtkusers] Camera movement In-Reply-To: <1355433221553-5717607.post@n5.nabble.com> References: <1355339548422-5717587.post@n5.nabble.com> <1355348373831-5717590.post@n5.nabble.com> <1355433221553-5717607.post@n5.nabble.com> Message-ID: <1355437133614-5717608.post@n5.nabble.com> ta-daaaa! void CamMove(double loc[3]) { double p[3]; //double loc[3]={5,0,0}; vtkSmartPointer tr=vtkSmartPointer::New(); //GetModelViewTransformObject()-??????? ?????????????? ?? ?????????? ? ??????/????????? tr->Identity(); tr->SetMatrix(camera->GetModelViewTransformObject()->GetMatrix()); tr->Inverse(); tr->TransformPoint(loc,p); //cout<GetPosition(); //cout<GetPosition(); //cout<GetFocalPoint(camfoc); for (int i=0;i<3;i++) camfoc[i]+=p[i]-hzc[i]; camera->SetPosition(p); camera->SetFocalPoint(camfoc); }; // Define interaction style class MouseInteractorStyleDoubleClick : public vtkInteractorStyleTrackballCamera { public: static MouseInteractorStyleDoubleClick* New(); vtkTypeMacro(MouseInteractorStyleDoubleClick, vtkInteractorStyleTrackballCamera); MouseInteractorStyleDoubleClick() : NumberOfClicks(0), ResetPixelDistance(5) { this->PreviousPosition[0] = 0; this->PreviousPosition[1] = 0; } virtual void OnKeyDown() { // Get the keypress vtkRenderWindowInteractor *rwi = this->Interactor; std::string key = rwi->GetKeySym(); if(key == "Up") { double loc[3]={0,0,+delta_move}; CamMove(loc); rwi->Render(); } } } -- View this message in context: http://vtk.1045678.n5.nabble.com/Camera-movement-tp5717587p5717608.html Sent from the VTK - Users mailing list archive at Nabble.com. From daviddoria at gmail.com Thu Dec 13 18:23:07 2012 From: daviddoria at gmail.com (David Doria) Date: Thu, 13 Dec 2012 18:23:07 -0500 Subject: [vtkusers] Camera movement In-Reply-To: <1355437133614-5717608.post@n5.nabble.com> References: <1355339548422-5717587.post@n5.nabble.com> <1355348373831-5717590.post@n5.nabble.com> <1355433221553-5717607.post@n5.nabble.com> <1355437133614-5717608.post@n5.nabble.com> Message-ID: On Thu, Dec 13, 2012 at 5:18 PM, IvanKushnar wrote: > ta-daaaa > Great. Would you please create a wiki example of this? It seems useful. David -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexmalvtk at gmail.com Thu Dec 13 20:49:50 2012 From: alexmalvtk at gmail.com (Alex Malyushytskyy) Date: Thu, 13 Dec 2012 17:49:50 -0800 Subject: [vtkusers] Problem with color after using vtkClipPolyData In-Reply-To: References: Message-ID: It is difficult to say without looking in the data and code. Normal for example can change color significant due to possible change which side of polygon is counted as inner surface. But it might be hundred of other reasons and I am not sure I can list all. Alex On Wed, Dec 12, 2012 at 5:54 PM, gongweixue wrote: > Thanks for your answer. > Yes, I also have tried to clip polydata, not normals. > But the result's color is just not same as the original model. > So I think maybe it is my model's problem,because the model is converted > from a vrml model. > I used vtkTableBasedClipDataSet, and the color is right. I was confused. > And when treat it as a DataSet with normals, the color is right. > Do you know the reason? > > Thank you very much! > 2012/12/13 > gongweixue at sina.com > > ----- Original Message ----- > From: Alex Malyushytskyy > To: vtkusers > Date: 2012-12-13, 07:34:12 > Subject: Re: [vtkusers] Problem with color after using vtkClipPolyData > > Self-sufficient example would help. > As is I can only guess that you probably did not want to clip normal > as you currently do > and wanted to clip read polydata: > > clipper->SetInput(reader->GetOutput()); > > Alex > > On Tue, Dec 11, 2012 at 10:18 PM, gongweixue wrote: >> hi guys, >> I used a vtkClipPolyData to clip polydata, and I found that the color of >> surfaces after clipping is changed. >> So,dose anybody know the reason? >> here is my code. >> >> //////////////////////code///////////////////////////// >> vtkPolyDataReader *reader=vtkPolyDataReader::New(); >> reader->SetFileName(FILENAME); >> reader->Update(); >> >> vtkClipPolyData * clipper=vtkClipPolyData::New(); >> clipper->SetInput(normals->GetOutput()); >> vtkPlane * plane = vtkPlane::New(); >> plane->SetOrigin(0.5,0,0); >> plane->SetNormal(1,1,1); >> clipper->SetClipFunction(plane); >> clipper->SetValue(0.5); >> clipper->SetInsideOut(1); >> clipper->Update(); >> >> vtkPolyDataMapper *mapper=vtkPolyDataMapper::New(); >> mapper->SetInput(clipper->GetOutput()); >> vtkActor *actor=vtkActor::New(); >> actor->SetMapper(mapper); >> vtkRenderer *ren1= vtkRenderer::New(); >> ren1->AddActor( actor ); >> ren1->SetBackground( 0.1, 0.2, 0.4 ); >> vtkRenderWindow *renWin = vtkRenderWindow::New(); >> renWin->AddRenderer( ren1 ); >> renWin->SetSize( 600, 600 ); >> vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New(); >> iren->SetRenderWindow(renWin); >> vtkInteractorStyleTrackballCamera *style = >> vtkInteractorStyleTrackballCamera::New(); >> iren->SetInteractorStyle(style); >> iren->Initialize(); >> iren->Start(); >> /////////////////////////////////////////////// >> And here is the pic: >> http://p13.freep.cn/p.aspx?u=v20_p13_photo_1212121410379520_0.jpg >> >> I will appreciate any suggestion very much! >> >> >> _______________________________________________ >> 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://www.vtk.org/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://www.vtk.org/mailman/listinfo/vtkusers > From alexmalvtk at gmail.com Thu Dec 13 20:57:08 2012 From: alexmalvtk at gmail.com (Alex Malyushytskyy) Date: Thu, 13 Dec 2012 17:57:08 -0800 Subject: [vtkusers] QVTKWidget and Qt4 layouts In-Reply-To: References: Message-ID: This question has nothing to do with vtk and should be asked on interest at qt-project.org. I would suggest to try to disable update before changing layout to the widget with grid layout. setUpdatesEnabled(false); change layout,,,,, setUpdatesEnabled(true); If this does not help, post it on the proper place. Alex On Thu, Dec 13, 2012 at 12:14 PM, Jos? M. Rodriguez Bacallao wrote: > Hello folks, does anyone know how to reorganize a bunch of QVTKWidgets in a > grid layout without flickering? > > I have a bunch of viewer widgets in a QGridLayout, the viewer widget is > composed of a titlebar (a custom widget) and a QVTKWidget in a QVBoxLayout. > Those viewers are arranged in a grid layout. What I am trying to do is to > change the number of rows and columns in the layout. The problem is that > when I add more widgets, the main widget (the one with the QGridLayout) > flicker. I have set the attribute WA_NativeWindow to the viewer widget, the > QVTKWidget and I still getting a flicker. > > _______________________________________________ > 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://www.vtk.org/mailman/listinfo/vtkusers > From seyyah776 at gmail.com Thu Dec 13 22:47:14 2012 From: seyyah776 at gmail.com (seyyah776 seyyah776) Date: Fri, 14 Dec 2012 05:47:14 +0200 Subject: [vtkusers] =?iso-8859-9?q?Reference_=DDmage_problem?= Message-ID: this image syngo fastview opened vtk As the image is not opened yellow lines wants to open up the image of dicom images in series that is, or fails to fold This problem disappears when the image disappear series please help me > my code private void ReadDICOMSeries() { try { > vtkTesting test = vtkTesting.New(); string root = test.GetDataRoot(); vtkStringArray f = vtkStringArray.New(); > > > vtkDICOMImageReader reader = vtkDICOMImageReader.New(); reader.SetDirectoryName(@"C:\Users\dr > who\Desktop\YEDEK2\a\"); > double[] spacing = reader.GetOutput().GetSpacing(); > > reader.Update(); // Visualize _ImageViewer = vtkImageViewer2.New(); _ImageViewer.SetInput(reader.GetOutput()); // get range of slices (min is the first index, max is the > last index) _ImageViewer.GetSliceRange(ref _MinSlice, ref _MaxSlice); > > // slice status message vtkTextProperty sliceTextProp = vtkTextProperty.New(); sliceTextProp.SetFontFamilyToCourier(); sliceTextProp.SetFontSize(20); sliceTextProp.SetVerticalJustificationToBottom(); sliceTextProp.SetJustificationToLeft(); > _SliceStatusMapper = vtkTextMapper.New(); > _SliceStatusMapper.SetProgressText("Y?kleniyor"); _SliceStatusMapper.SetInput("Slice No " + (_Slice + > 1).ToString() + "/" + (_MaxSlice + 1).ToString()); _SliceStatusMapper.SetTextProperty(sliceTextProp); > vtkActor2D sliceStatusActor = vtkActor2D.New(); sliceStatusActor.SetMapper(_SliceStatusMapper); sliceStatusActor.SetPosition(15, 10); > // usage hint message vtkTextProperty usageTextProp = vtkTextProperty.New(); usageTextProp.SetFontFamilyToCourier(); usageTextProp.SetFontSize(14); usageTextProp.SetVerticalJustificationToTop(); usageTextProp.SetJustificationToLeft(); > vtkTextMapper usageTextMapper = vtkTextMapper.New(); usageTextMapper.SetInput("Slice with mouse wheel\nor > Up/Down-Key"); usageTextMapper.SetTextProperty(usageTextProp); > vtkActor2D usageTextActor = vtkActor2D.New(); usageTextActor.SetMapper(usageTextMapper); > usageTextActor.GetPositionCoordinate().SetCoordinateSystemToNormalizedDisplay(); usageTextActor.GetPositionCoordinate().SetValue(0.05, 0.95); > vtkRenderWindow renderWindow = > renderWindowControl1.RenderWindow; > > vtkInteractorStyleImage interactorStyle = > vtkInteractorStyleImage.New(); > interactorStyle.MouseWheelForwardEvt += new > vtkObject.vtkObjectEventHandler(interactor_MouseWheelForwardEvt); interactorStyle.MouseWheelBackwardEvt += new > vtkObject.vtkObjectEventHandler(interactor_MouseWheelBackwardEvt); > > renderWindow.GetInteractor().SetInteractorStyle(interactorStyle); renderWindow.GetRenderers().InitTraversal(); > > > //vtkRenderer ren; //while ((ren = renderWindow.GetRenderers().GetNextItem()) > != null) // ren.SetBackground(0.20, 0.0, 0.0); > _ImageViewer.SetRenderWindow(renderWindow); _ImageViewer.GetRenderer().AddActor2D(sliceStatusActor); _ImageViewer.GetRenderer().AddActor2D(usageTextActor); _ImageViewer.SetSlice(_MinSlice); > > renderWindowControl1.AutoScroll = true; _ImageViewer.Render(); } catch { } } -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 02744768.jpg Type: image/jpeg Size: 136389 bytes Desc: not available URL: From lobo.theslayer at gmail.com Fri Dec 14 01:55:41 2012 From: lobo.theslayer at gmail.com (Rodrigo Lovera) Date: Fri, 14 Dec 2012 01:55:41 -0500 Subject: [vtkusers] memory usage in vtk Message-ID: Hello all vtk users, I was wondering ifany of you know a method to get memory usage by vtk pipelines??. Need to evaluate a pipeline with different options in filters. Thx in advance, Regards, -- *Rodrigo* -------------- next part -------------- An HTML attachment was scrubbed... URL: From agatakrason at gmail.com Fri Dec 14 04:59:45 2012 From: agatakrason at gmail.com (agatte) Date: Fri, 14 Dec 2012 01:59:45 -0800 (PST) Subject: [vtkusers] Crop image Message-ID: <1355479185972-5717614.post@n5.nabble.com> Hi all VTK Users, Maybe Do You know any vtk filter to crop an image ? I would appreciate for any help please. best, agatte -- View this message in context: http://vtk.1045678.n5.nabble.com/Crop-image-tp5717614.html Sent from the VTK - Users mailing list archive at Nabble.com. From Gerrick.Bivins at halliburton.com Fri Dec 14 08:28:18 2012 From: Gerrick.Bivins at halliburton.com (Gerrick Bivins) Date: Fri, 14 Dec 2012 13:28:18 +0000 Subject: [vtkusers] Problem with color after using vtkClipPolyData In-Reply-To: References: Message-ID: I had a similar issue and ended up abandoning vtkClipPolyData and instead clipping the source with vtkClipDataSet. http://www.vtk.org/pipermail/vtkusers/2008-July/096200.html This was a while ago and I seem to remember digging through vtkClipPolyData source to find the problem but to no avail. I think there is a bug but having made things work with vtkClipDataSet, I moved on. Gerrick -----Original Message----- From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of Alex Malyushytskyy Sent: Thursday, December 13, 2012 7:50 PM To: vtkusers Subject: Re: [vtkusers] Problem with color after using vtkClipPolyData It is difficult to say without looking in the data and code. Normal for example can change color significant due to possible change which side of polygon is counted as inner surface. But it might be hundred of other reasons and I am not sure I can list all. Alex On Wed, Dec 12, 2012 at 5:54 PM, gongweixue wrote: > Thanks for your answer. > Yes, I also have tried to clip polydata, not normals. > But the result's color is just not same as the original model. > So I think maybe it is my model's problem,because the model is > converted from a vrml model. > I used vtkTableBasedClipDataSet, and the color is right. I was confused. > And when treat it as a DataSet with normals, the color is right. > Do you know the reason? > > Thank you very much! > 2012/12/13 > gongweixue at sina.com > > ----- Original Message ----- > From: Alex Malyushytskyy > To: vtkusers > Date: 2012-12-13, 07:34:12 > Subject: Re: [vtkusers] Problem with color after using vtkClipPolyData > > Self-sufficient example would help. > As is I can only guess that you probably did not want to clip normal > as you currently do and wanted to clip read polydata: > > clipper->SetInput(reader->GetOutput()); > > Alex > > On Tue, Dec 11, 2012 at 10:18 PM, gongweixue wrote: >> hi guys, >> I used a vtkClipPolyData to clip polydata, and I found that the color >> of surfaces after clipping is changed. >> So,dose anybody know the reason? >> here is my code. >> >> //////////////////////code///////////////////////////// >> vtkPolyDataReader *reader=vtkPolyDataReader::New(); >> reader->SetFileName(FILENAME); >> reader->Update(); >> >> vtkClipPolyData * clipper=vtkClipPolyData::New(); >> clipper->SetInput(normals->GetOutput()); >> vtkPlane * plane = vtkPlane::New(); >> plane->SetOrigin(0.5,0,0); >> plane->SetNormal(1,1,1); >> clipper->SetClipFunction(plane); >> clipper->SetValue(0.5); >> clipper->SetInsideOut(1); >> clipper->Update(); >> >> vtkPolyDataMapper *mapper=vtkPolyDataMapper::New(); >> mapper->SetInput(clipper->GetOutput()); >> vtkActor *actor=vtkActor::New(); >> actor->SetMapper(mapper); >> vtkRenderer *ren1= vtkRenderer::New(); >> ren1->AddActor( actor ); >> ren1->SetBackground( 0.1, 0.2, 0.4 ); >> vtkRenderWindow *renWin = vtkRenderWindow::New(); >> renWin->AddRenderer( ren1 ); >> renWin->SetSize( 600, 600 ); >> vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New(); >> iren->SetRenderWindow(renWin); >> vtkInteractorStyleTrackballCamera *style = >> vtkInteractorStyleTrackballCamera::New(); >> iren->SetInteractorStyle(style); >> iren->Initialize(); >> iren->Start(); >> /////////////////////////////////////////////// >> And here is the pic: >> http://p13.freep.cn/p.aspx?u=v20_p13_photo_1212121410379520_0.jpg >> >> I will appreciate any suggestion very much! >> >> >> _______________________________________________ >> 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://www.vtk.org/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://www.vtk.org/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://www.vtk.org/mailman/listinfo/vtkusers From david.gobbi at gmail.com Fri Dec 14 09:18:03 2012 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 14 Dec 2012 07:18:03 -0700 Subject: [vtkusers] Problem with color after using vtkClipPolyData In-Reply-To: References: Message-ID: Clipping a data set adds scalars to the data set. By default, if a data set has scalars, then VTK mapper uses the scalars to color the data. Just do the following: mapper->ScalarVisibilityOff(); Then VTK will ignore the scalars and use the vtkProperty color instead. - David On Fri, Dec 14, 2012 at 6:28 AM, Gerrick Bivins wrote: > I had a similar issue and ended up abandoning vtkClipPolyData and instead clipping the source with vtkClipDataSet. > http://www.vtk.org/pipermail/vtkusers/2008-July/096200.html > > This was a while ago and I seem to remember digging through vtkClipPolyData source to find the problem but to no avail. > I think there is a bug but having made things work with vtkClipDataSet, I moved on. > Gerrick > > -----Original Message----- > From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of Alex Malyushytskyy > Sent: Thursday, December 13, 2012 7:50 PM > To: vtkusers > Subject: Re: [vtkusers] Problem with color after using vtkClipPolyData > > It is difficult to say without looking in the data and code. > Normal for example can change color significant due to possible change which side of polygon is counted as inner surface. > > But it might be hundred of other reasons and I am not sure I can list all. > > Alex > > On Wed, Dec 12, 2012 at 5:54 PM, gongweixue wrote: >> Thanks for your answer. >> Yes, I also have tried to clip polydata, not normals. >> But the result's color is just not same as the original model. >> So I think maybe it is my model's problem,because the model is >> converted from a vrml model. >> I used vtkTableBasedClipDataSet, and the color is right. I was confused. >> And when treat it as a DataSet with normals, the color is right. >> Do you know the reason? >> >> Thank you very much! >> 2012/12/13 >> gongweixue at sina.com >> >> ----- Original Message ----- >> From: Alex Malyushytskyy >> To: vtkusers >> Date: 2012-12-13, 07:34:12 >> Subject: Re: [vtkusers] Problem with color after using vtkClipPolyData >> >> Self-sufficient example would help. >> As is I can only guess that you probably did not want to clip normal >> as you currently do and wanted to clip read polydata: >> >> clipper->SetInput(reader->GetOutput()); >> >> Alex >> >> On Tue, Dec 11, 2012 at 10:18 PM, gongweixue wrote: >>> hi guys, >>> I used a vtkClipPolyData to clip polydata, and I found that the color >>> of surfaces after clipping is changed. >>> So,dose anybody know the reason? >>> here is my code. >>> >>> //////////////////////code///////////////////////////// >>> vtkPolyDataReader *reader=vtkPolyDataReader::New(); >>> reader->SetFileName(FILENAME); >>> reader->Update(); >>> >>> vtkClipPolyData * clipper=vtkClipPolyData::New(); >>> clipper->SetInput(normals->GetOutput()); >>> vtkPlane * plane = vtkPlane::New(); >>> plane->SetOrigin(0.5,0,0); >>> plane->SetNormal(1,1,1); >>> clipper->SetClipFunction(plane); >>> clipper->SetValue(0.5); >>> clipper->SetInsideOut(1); >>> clipper->Update(); >>> >>> vtkPolyDataMapper *mapper=vtkPolyDataMapper::New(); >>> mapper->SetInput(clipper->GetOutput()); >>> vtkActor *actor=vtkActor::New(); >>> actor->SetMapper(mapper); >>> vtkRenderer *ren1= vtkRenderer::New(); >>> ren1->AddActor( actor ); >>> ren1->SetBackground( 0.1, 0.2, 0.4 ); >>> vtkRenderWindow *renWin = vtkRenderWindow::New(); >>> renWin->AddRenderer( ren1 ); >>> renWin->SetSize( 600, 600 ); >>> vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New(); >>> iren->SetRenderWindow(renWin); >>> vtkInteractorStyleTrackballCamera *style = >>> vtkInteractorStyleTrackballCamera::New(); >>> iren->SetInteractorStyle(style); >>> iren->Initialize(); >>> iren->Start(); >>> /////////////////////////////////////////////// >>> And here is the pic: >>> http://p13.freep.cn/p.aspx?u=v20_p13_photo_1212121410379520_0.jpg >>> >>> I will appreciate any suggestion very much! >>> >>> >>> _______________________________________________ >>> 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://www.vtk.org/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://www.vtk.org/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://www.vtk.org/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://www.vtk.org/mailman/listinfo/vtkusers From cyrille.faucheux at etu.univ-tours.fr Fri Dec 14 09:35:54 2012 From: cyrille.faucheux at etu.univ-tours.fr (Cyrille Faucheux) Date: Fri, 14 Dec 2012 15:35:54 +0100 Subject: [vtkusers] Crop image In-Reply-To: <1355479185972-5717614.post@n5.nabble.com> References: <1355479185972-5717614.post@n5.nabble.com> Message-ID: <50CB394A.3000601@etu.univ-tours.fr> http://www.vtk.org/Wiki/ITK/Examples/ImageProcessing/CropImageFilter Le 14/12/2012 10:59, agatte a ?crit : > Hi all VTK Users, > > > Maybe Do You know any vtk filter to crop an image ? > > I would appreciate for any help please. > > > > best, > agatte > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/Crop-image-tp5717614.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://www.vtk.org/mailman/listinfo/vtkusers > > From Gerrick.Bivins at halliburton.com Fri Dec 14 09:55:08 2012 From: Gerrick.Bivins at halliburton.com (Gerrick Bivins) Date: Fri, 14 Dec 2012 14:55:08 +0000 Subject: [vtkusers] Get "vertex color array" from vtkPolyData Message-ID: Hi all, I'm trying to hook VTK up to a different rendering engine. I've made it so far as to setup and execute my pipeline and using the vtkPolyData, create the geometry in the rendering engine. My issue now is that I want add per vertex color and normal information to it. If I use VTK to render, ie vtkActor, everything works as expected. However I don't see how to extract the "color" array from the mapper or the polydata. Is this possible? In a very old version of vtk, there was a way to get the colors assigned to vertex data as an array from the mapper. Something like: vtkActor actor =...; vtkPolyDataMapper mapper = ...; actor.SetMapper(mapper); mapper.getInput().Update(); ... double opacity = actor.GetProperty().GetOpacity(); colorArray = mapper.MapScalars(opacity); ... There was also a vtkMapper::GetColors() method but that is gone as well. Gerrick -------------- next part -------------- An HTML attachment was scrubbed... URL: From mlokida at yahoo.fr Fri Dec 14 10:35:29 2012 From: mlokida at yahoo.fr (R M) Date: Fri, 14 Dec 2012 15:35:29 +0000 (GMT) Subject: [vtkusers] Cameras Link Problems Message-ID: <1355499329.39831.YahooMailNeo@web172205.mail.ir2.yahoo.com> Hi, I used vtk 5.8.0 and pcl 1.5.1. Here 's my problem: I have 2 views that displays 2 objects that represent the same objet scanned from differents points of view. I need to place them in the same point of view. Like this when I rotate/ or move the camera in one view I can see the 2 objects moving/rotating exactly the same. For this, i do: -------------------- an init method when i link the 2 cameras: vtkSmartPointer cam1 = renderer1->GetActiveCamera(); vtkSmartPointer cam2 = renderer2->GetActiveCamera(); matrixCam1->DeepCopy( cam1->GetViewTransformObject()->GetMatrix() ); matrixCam2->DeepCopy( cam2->GetViewTransformObject()->GetMatrix() ); ??? ??? vtkSmartPointer mat1Invert = vtkMatrix4x4::New(); vtkMatrix4x4::Invert( matrixCam1, mat1Invert); vtkMatrix4x4::Multiply4x4(mat1Invert, matrixCam2, deltaMat); vtkMatrix4x4::Invert( deltaMat, deltaMatInv); Then during mouse event I do: // Get the 2 cam vtkSmartPointer cam1 = renderer1->GetActiveCamera(); vtkSmartPointer cam2 = renderer2->GetActiveCamera(); vtkSmartPointer camTo = vtkMatrix4x4::New(); vtkMatrix4x4::Multiply4x4(matrixCam1, deltaMat, camTo ); ??? cam2->GetViewTransformObject()->SetMatrix( camTo ); cam2->Modified(); Renderer2->GetRenderWindow()->Render(); -------------------- When using this on my view1 (move/rotate the camera), the display on view2 is ok and updates well. But when I move/rotate from view2? the update in? view1 is wrong,? I recover an older view matrix whereas, I modify both matrix in my code. Any ideas ? Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From tavares at fe.up.pt Fri Dec 14 10:41:45 2012 From: tavares at fe.up.pt (=?iso-8859-1?Q?Jo=E3o_Manuel_R._S._Tavares?=) Date: Fri, 14 Dec 2012 15:41:45 -0000 Subject: [vtkusers] IV ECCOMAS Thematic Conference VipIMAGE 2013: FIRST ANNOUNCEMENT & CALL FOR CONTRIBUTIONS Message-ID: <021301cdda11$85d09130$9171b390$@fe.up.pt> Dear Colleague, We are pleased to announce the International Conference VipIMAGE 2013 - IV ECCOMAS THEMATIC CONFERENCE ON COMPUTATIONAL VISION AND MEDICAL IMAGE PROCESSING (www.fe.up.pt/~vipimage) to be held October 14-16, 2013, in Melia Madeira Mare Hotel, Madeira Island, Funchal, Portugal. 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 ? Objects 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 their Applications Invited Lecturers ? Daniel Rueckert - Imperial College London, UK ? Dimitris N. Metaxas - Rutgers University, USA ? Durval C. Costa - Champalimaud Foundation, Portugal ? James S Duncan - Yale School of Medicine, USA ? Milan Sonka - The University of Iowa, USA ? Richard Bowden - University of Surrey, UK Thematic Sessions Proposals to organize Thematic Session under the auspicious of VipIMAGE 2013 are welcome. The organizers of the selected thematic sessions will be included in the conference scientific committee and will have a reduced registration fee. Additionally, they will be responsible for the dissemination of their thematic session, may invite expertise researchers to have invited keynotes during their session and will participate in the review process of the submitted contributions. Proposal for Thematic Sessions should be submitted by email to the conference co-chairs (tavares at fe.up.pt, rnatal at fe.up.pt) until March 1, 2013. Publications Proceedings: The proceedings book will be published by the Taylor & Francis Group (www.balkema.nl/instructions.asp) 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? (www.springer.com/series/8910). Journal Publication: A dedicated special issue of the Taylor & Francis International Journal ?Computer Methods in Biomechanics and Biomedical Engineering: Imaging & Visualization? (www.tandfonline.com/tciv) will be published with extended versions of the best works presented in the conference. Important dates ? Deadline for Thematic Session Proposals: March 1, 2013 ? Deadline for Extended Abstracts: April 15, 2013 ? Authors Notification: May 1, 2013 ? Deadline for Lectures and Papers: July 1, 2013 We are looking forward to see you in Funchal next October. Kind regards, Jo?o Manuel R. S. Tavares Renato Natal Jorge (conference co-chairs) PS. For further details please have a look in the conference website at: www.fe.up.pt/~vipimage, or the Facebook page at: www.facebook.com/pages/Vipimage/237980719665456 From lewes_infor at hotmail.com Fri Dec 14 11:48:04 2012 From: lewes_infor at hotmail.com (liulewes) Date: Fri, 14 Dec 2012 11:48:04 -0500 Subject: [vtkusers] image scalar range problem Message-ID: I'm tring to create an image and assign scalars manually. I think I should get a scalar range of [1,1] for the following code, but I get [1,52680] instead. Is it the problem of the assignment part or the GetScalarRange function or anything else? vtkImageData* temp = vtkImageData::New(); temp->SetScalarTypeToUnsignedShort(); temp->SetSpacing(1,1,0); temp->SetOrigin(0,0,0); temp->SetExtent(0,511,0,511,0,1); temp->SetNumberOfScalarComponents(1); temp->AllocateScalars(); for (int i = 0 ; i < 512 ; ++i) { for (int j = 0 ; j < 512 ; ++j) { *(static_cast(temp->GetScalarPointer(i,j,0))) = 1; } } temp->Modified(); temp->GetPointData()->GetScalars()->Modified(); double dtrangetemp[2]; temp->GetScalarRange(dtrangetemp); -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebimail at ymail.com Fri Dec 14 11:55:08 2012 From: sebimail at ymail.com (Sebastian Klein) Date: Fri, 14 Dec 2012 08:55:08 -0800 (PST) Subject: [vtkusers] Problem with displaying data (vtkSmartVolumeMapper and Qt4) Message-ID: <1355504108.10411.YahooMailNeo@web114420.mail.gq1.yahoo.com> Hello, I'm writing a MIP-Viewer (I use vtkSmartVolumeMapper). The result of it should be displayed in a qt window. I use Qt 4.8.0 and VTK 5.10. There are three classes: - MIP-Viewer (VTK only) - QVTKMIPViewer (widget that displays the MIP content) - MainWindow (small application to illustrate my problem) The MIP viewer is initialized with a placeholder object for the vtkSmartVolumeMapper. After clicking on a button (buttonLoadDicom) a dicom data set should be displayed instead of the placeholder. This does not work and I don't know why. I wrote three small classes listed below to illustrate the problem in my application. Calling SetInput(...) inside of the MainWindow constructor works but not outside of it. Any idea why the dicom content is not displayed after clicking on the button? CODE: ----- MainWindow ----- //////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// MainWindow::MainWindow(QWidget *parent) : QWidget(parent) { ??? m_pDicomData = vtkDICOMImageReader::New(); ??? this->resize(800,600); ??? m_pQVTKMIPViewer = new QVTKMIPViewer(this); ??? m_pDicomData->SetDirectoryName("C:/dicom"); ??? m_pDicomData->Update(); ??? SetupUi(); ??? ??? //m_pQVTKMIPViewer->SetInput(m_pDicomData->GetOutput()); <- THIS WORKS: DICOM CONTENT IS DISPLAYED } //////////////////////////////////////////////////////////////////////////////////// void MainWindow::SetupUi() { ??? buttonLoadDicom = new QPushButton("load DICOM", this); ??? connect(buttonLoadDicom, SIGNAL(clicked()), this, SLOT(OnLoadDicom())); ??? //layout ??? QVBoxLayout *mainLayout = new QVBoxLayout(this); ??? QHBoxLayout *hLayout = new QHBoxLayout(this); ??? hLayout->addWidget(buttonLoadDicom); ??? mainLayout->addWidget(m_pQVTKMIPViewer); ??? mainLayout->addLayout(hLayout); ??? this->setLayout(mainLayout); } //////////////////////////////////////////////////////////////////////////////////// void MainWindow::OnLoadDicom() //slot { ??? m_pQVTKMIPViewer->SetInput(m_pDicomData->GetOutput()); // <- THIS DOES NOT WORK: DICOM CONTENT IS NOT DISPLAYED (command is executed after clicking...) } //////////////////////////////////////////////////////////////////////////////////// ----- QVTKMIPViewer ----- //////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// QVTKMIPViewer::QVTKMIPViewer(QWidget *parent) : QWidget(parent), m_pMIPViewer(NULL), m_pInteractor(NULL), m_pQVTKWidget(NULL), m_pRenderer(NULL), m_pRenderWindow(NULL), m_pImageData(NULL) { ??? m_pMIPViewer = MIPViewer::New(); ??? m_pQVTKWidget = new QVTKWidget(this); ??? m_pQVTKWidget->setMinimumSize(300,300); ??? m_pQVTKWidget->SetRenderWindow(m_pMIPViewer->GetRenderWindow()); } //////////////////////////////////////////////////////////////////////////////////// void QVTKMIPViewer::SetInput(vtkImageData* pImageData) { ??? m_pMIPViewer->SetInput(pImageData); } //////////////////////////////////////////////////////////////////////////////////// ----- MIPVIEWER ----- //////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// MIPViewer::MIPViewer():vtkObject(), m_dInitialLevel(2048), m_dInitialWindow(4096) { ??? this->m_pColorFunc = vtkColorTransferFunction::New(); ??? this->m_pOpacityFunc = vtkPiecewiseFunction::New(); ??? this->m_pVolumeMapper = vtkSmartVolumeMapper::New(); ??? this->m_pVolume = vtkVolume::New(); ??? this->m_pVolumeProperty = vtkVolumeProperty::New(); ??? this->m_pRenderer = NULL; ??? this->m_pRenderWindow = NULL; ??? this->m_pImageData = NULL; ??? vtkRenderWindow *renWin = vtkRenderWindow::New(); ??? this->SetRenderWindow(renWin); ??? renWin->Delete(); ??? vtkRenderer *ren = vtkRenderer::New(); ??? this->SetRenderer(ren); ??? ren->Delete();??????? ??? //set dummy data ??? m_pDummyImage = vtkImageData::New(); ??? m_pDummyImage->SetDimensions(2,2,2); ??? m_pDummyImage->SetScalarTypeToUnsignedShort(); ??? m_pDummyImage->AllocateScalars(); // allocate storage for image data ??? unsigned short * VolPtr = (unsigned short *) m_pDummyImage->GetScalarPointer(); ??? for(int i=0; i<2*2*2; i++ ) ??? { ??????? *VolPtr= 900; ??????? *VolPtr++; ??? } ??? m_pDummyImage->Update(); ??? m_pColorFunc->AddRGBSegment(0.0, 1.0, 1.0, 1.0, 255.0, 1.0, 1.0, 1.0 ); ??? m_pOpacityFunc->AddSegment( m_dInitialLevel - 0.5 * m_dInitialWindow, 0.0, m_dInitialLevel + 0.5 * m_dInitialWindow, 1.0 ); ??? m_pVolumeProperty->SetColor( m_pColorFunc ); ??? m_pVolumeProperty->SetScalarOpacity( m_pOpacityFunc ); ??? m_pVolume->SetProperty( m_pVolumeProperty ); ??? m_pVolumeMapper->SetBlendModeToMaximumIntensity(); ??? this->SetInput(m_pDummyImage); ??? this->m_pVolume->SetMapper(this->m_pVolumeMapper); } //////////////////////////////////////////////////////////////////////////////////// void MIPViewer::SetRenderWindow(vtkRenderWindow *renWin) { ??? if (this->m_pRenderWindow == renWin) ??? { ??????? return; ??? } ??? if (this->m_pRenderWindow) ??? { ??????? this->m_pRenderWindow->UnRegister(this); ??? } ??? this->m_pRenderWindow = renWin; ??? if (this->m_pRenderWindow) ??? { ??????? this->m_pRenderWindow->Register(this); ??? } } //////////////////////////////////////////////////////////////////////////////////// void MIPViewer::SetRenderer(vtkRenderer *ren) { ??? if (this->m_pRenderer == ren) ??? { ??????? return; ??? } ??? if(m_pRenderWindow && m_pRenderer) ??? { ??????? this->m_pRenderWindow->RemoveRenderer(this->m_pRenderer); ??? } ??? if (this->m_pRenderer) ??? { ??????? this->m_pRenderer->UnRegister(this); ??? } ??? this->m_pRenderer = ren; ??? if (this->m_pRenderer) ??? { ??????? this->m_pRenderer->Register(this); ??? } ??? this->m_pRenderWindow->AddRenderer(this->m_pRenderer); ??? this->m_pRenderer->AddViewProp(this->m_pVolume); } //////////////////////////////////////////////////////////////////////////////////// void MIPViewer::SetInput(vtkImageData *pImageData) { ??? m_pImageData = pImageData; ??? if(pImageData) ??? { ??????? if(m_pVolumeMapper->GetInput()) ??????? { ??????????? m_pVolumeMapper->RemoveAllInputs(); ??????? } ??????? m_pVolumeMapper->SetInput(m_pImageData); ??? } } //////////////////////////////////////////////////////////////////////////////////// vtkImageData* MIPViewer::GetInput() { ??? return m_pVolumeMapper->GetInput(); } //////////////////////////////////////////////////////////////////////////////////// -------------- next part -------------- An HTML attachment was scrubbed... URL: From lewes_infor at hotmail.com Fri Dec 14 12:24:40 2012 From: lewes_infor at hotmail.com (liulewes) Date: Fri, 14 Dec 2012 12:24:40 -0500 Subject: [vtkusers] image scalar range problem[solved] In-Reply-To: References: Message-ID: Just figured out that temp->SetExtent(0,511,0,511,0,1); should be temp->SetExtent(0,511,0,511,0,0); in order to have just one slice. From: lewes_infor at hotmail.com To: vtkusers at vtk.org Date: Fri, 14 Dec 2012 11:48:04 -0500 Subject: [vtkusers] image scalar range problem I'm tring to create an image and assign scalars manually. I think I should get a scalar range of [1,1] for the following code, but I get [1,52680] instead. Is it the problem of the assignment part or the GetScalarRange function or anything else? vtkImageData* temp = vtkImageData::New(); temp->SetScalarTypeToUnsignedShort(); temp->SetSpacing(1,1,0); temp->SetOrigin(0,0,0); temp->SetExtent(0,511,0,511,0,1); temp->SetNumberOfScalarComponents(1); temp->AllocateScalars(); for (int i = 0 ; i < 512 ; ++i) { for (int j = 0 ; j < 512 ; ++j) { *(static_cast(temp->GetScalarPointer(i,j,0))) = 1; } } temp->Modified(); temp->GetPointData()->GetScalars()->Modified(); double dtrangetemp[2]; temp->GetScalarRange(dtrangetemp); _______________________________________________ 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://www.vtk.org/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From 600gestures at gmail.com Fri Dec 14 15:34:28 2012 From: 600gestures at gmail.com (Gestuality us) Date: Fri, 14 Dec 2012 15:34:28 -0500 Subject: [vtkusers] Make install error with VTK Message-ID: Hi, I am trying to install vtk and use it along with python on my ubuntu machine. I installed VTK and i was able to configure and generate, then I did a 'sudo make install', this is giving me the following error, I am not sure which path has to be set and how to make python read .pth files from that folder, I am new to both VTK and Python, so any advice would be of great help. Thanks, Shripad D make install error: Checking .pth file support in /usr/local/lib/python2.7/site-packages/ /opt/bitnami/python/bin/.python2.7.bin -E -c pass TEST FAILED: /usr/local/lib/python2.7/site-packages/ does NOT support .pth files error: bad install directory or PYTHONPATH You are attempting to install a package to a directory that is not on PYTHONPATH and which Python does not read ".pth" files from. The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was: /usr/local/lib/python2.7/site-packages/ and your PYTHONPATH environment variable currently contains: '/opt/bitnami/apps/django/lib/python2.7/site-packages:/opt/bitnami/subversion/lib/svn-python::/opt/bitnami/apps/django/lib/python2.7/site-packages:/opt/bitnami/subversion/lib/svn-python::' Here are some of your options for correcting the problem: * You can choose a different installation directory, i.e., one that is on PYTHONPATH or supports .pth files * You can add the installation directory to the PYTHONPATH environment variable. (It must then also be on PYTHONPATH whenever you run Python and want to use the package(s) you are installing.) * You can set up the installation directory to support ".pth" files by using one of the approaches described here: http://packages.python.org/distribute/easy_install.html#custom-installation-locations Please make the appropriate changes for your system and try again. -------------- next part -------------- An HTML attachment was scrubbed... URL: From heiland at indiana.edu Fri Dec 14 16:16:08 2012 From: heiland at indiana.edu (Randy Heiland) Date: Fri, 14 Dec 2012 16:16:08 -0500 Subject: [vtkusers] magnify vtkChartXY image Message-ID: Is there some way to magnify (or set the resolution of) a rendered chart, in order to generate a higher-res image from a Writer? e.g. I attempted the following simple Python script, which did indeed generate a magnified (x 2) .png image, but it was not what I expected. thanks, Randy from vtk import * table = vtkTable() arrX = vtkFloatArray() arrX.SetName("X") table.AddColumn(arrX) arrY = vtkFloatArray() arrY.SetName("Y") table.AddColumn(arrY) table.SetNumberOfRows(2) table.SetValue(0, 0, 0.0) table.SetValue(1, 0, 1.0) table.SetValue(0, 1, 0.0) table.SetValue(1, 1, 1.0) view = vtkContextView() chart = vtkChartXY() view.GetScene().AddItem(chart) line = chart.AddPlot(vtkChart.LINE) line.SetInput(table, 0, 1) view.GetInteractor().Initialize() view.GetRenderWindow().SetSize(200,200) imgFilter = vtkWindowToImageFilter() imgFilter.SetInput(view.GetRenderWindow()) imgFilter.SetMagnification(2) writer=vtkPNGWriter() writer.SetFileName("chart.png") writer.SetInputConnection(imgFilter.GetOutputPort()) writer.Write() #view.GetInteractor().Start() From thiebault at artenum.com Sat Dec 15 01:57:10 2012 From: thiebault at artenum.com (=?iso-8859-1?Q?Beno=EEt_Thi=E9bault?=) Date: Sat, 15 Dec 2012 07:57:10 +0100 Subject: [vtkusers] Fwd: [CMake] CMAKE_MAKE_PROGRAM is not set - Win7 and Visual Studio 10 In-Reply-To: <06EE54FF-BA79-4A59-BC5B-008E03C6EB69@artenum.com> References: <404B71B8-F346-4B85-B958-A97657F1D945@artenum.com> <3315082122939397449@unknownmsgid> <06EE54FF-BA79-4A59-BC5B-008E03C6EB69@artenum.com> Message-ID: Hi list, I have installed Visual Studio 10 (not the express version, the full one), with x64 support. However, when selecting Visual Studio 10 or Visual Studio 10 Win64 and choosing the default native compilers, I have the following errors. The C compiler identification is unknown The CXX compiler identification is unknown Performing Test Support for 64 bit file systems CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCXXInformation.cmake:37 (get_filename_component): get_filename_component called with incorrect number of arguments Call Stack (most recent call first): CMakeLists.txt:3 (PROJECT) CMake Error: Internal CMake error, TryCompile configure of cmake failed Performing Test Support for 64 bit file systems - Failed Performing Test VTK_CONST_REVERSE_ITERATOR_COMPARISON CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCXXInformation.cmake:37 (get_filename_component): get_filename_component called with incorrect number of arguments Call Stack (most recent call first): CMakeLists.txt:3 (PROJECT) CMake Error: Internal CMake error, TryCompile configure of cmake failed Performing Test VTK_CONST_REVERSE_ITERATOR_COMPARISON - Failed CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCXXInformation.cmake:37 (get_filename_component): get_filename_component called with incorrect number of arguments Call Stack (most recent call first): CMakeLists.txt:3 (PROJECT) CMake Error: Internal CMake error, TryCompile configure of cmake failed Looking for sys/types.h CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 (get_filename_component): get_filename_component called with incorrect number of arguments Call Stack (most recent call first): CMakeLists.txt:3 (PROJECT) CMake Error: Internal CMake error, TryCompile configure of cmake failed Looking for sys/types.h - not found Looking for stdint.h CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 (get_filename_component): get_filename_component called with incorrect number of arguments Call Stack (most recent call first): CMakeLists.txt:3 (PROJECT) CMake Error: Internal CMake error, TryCompile configure of cmake failed Looking for stdint.h - not found Looking for stddef.h CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 (get_filename_component): get_filename_component called with incorrect number of arguments Call Stack (most recent call first): CMakeLists.txt:3 (PROJECT) CMake Error: Internal CMake error, TryCompile configure of cmake failed Looking for stddef.h - not found Check size of int CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 (get_filename_component): get_filename_component called with incorrect number of arguments Call Stack (most recent call first): CMakeLists.txt:3 (PROJECT) CMake Error: Internal CMake error, TryCompile configure of cmake failed Check size of int - failed Check size of long CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 (get_filename_component): get_filename_component called with incorrect number of arguments Call Stack (most recent call first): CMakeLists.txt:3 (PROJECT) CMake Error: Internal CMake error, TryCompile configure of cmake failed Check size of long - failed Check size of void* CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 (get_filename_component): get_filename_component called with incorrect number of arguments Call Stack (most recent call first): CMakeLists.txt:3 (PROJECT) CMake Error: Internal CMake error, TryCompile configure of cmake failed Check size of void* - failed Check size of char CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 (get_filename_component): get_filename_component called with incorrect number of arguments Call Stack (most recent call first): CMakeLists.txt:3 (PROJECT) CMake Error: Internal CMake error, TryCompile configure of cmake failed Check size of char - failed Check size of short CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 (get_filename_component): get_filename_component called with incorrect number of arguments Call Stack (most recent call first): CMakeLists.txt:3 (PROJECT) CMake Error: Internal CMake error, TryCompile configure of cmake failed Check size of short - failed Check size of float CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 (get_filename_component): get_filename_component called with incorrect number of arguments Call Stack (most recent call first): CMakeLists.txt:3 (PROJECT) CMake Error: Internal CMake error, TryCompile configure of cmake failed Check size of float - failed Check size of double CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 (get_filename_component): get_filename_component called with incorrect number of arguments Call Stack (most recent call first): CMakeLists.txt:3 (PROJECT) CMake Error: Internal CMake error, TryCompile configure of cmake failed Check size of double - failed Looking for include file limits.h CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 (get_filename_component): get_filename_component called with incorrect number of arguments Call Stack (most recent call first): CMakeLists.txt:3 (PROJECT) CMake Error: Internal CMake error, TryCompile configure of cmake failed Looking for include file limits.h - not found Looking for include file unistd.h CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 (get_filename_component): get_filename_component called with incorrect number of arguments Call Stack (most recent call first): CMakeLists.txt:3 (PROJECT) CMake Error: Internal CMake error, TryCompile configure of cmake failed Looking for include file unistd.h - not found Looking for include file pthread.h CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 (get_filename_component): get_filename_component called with incorrect number of arguments Call Stack (most recent call first): CMakeLists.txt:3 (PROJECT) CMake Error: Internal CMake error, TryCompile configure of cmake failed Looking for include file pthread.h - not found Looking for include files sys/types.h, sys/prctl.h CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 (get_filename_component): get_filename_component called with incorrect number of arguments Call Stack (most recent call first): CMakeLists.txt:3 (PROJECT) CMake Error: Internal CMake error, TryCompile configure of cmake failed Looking for include files sys/types.h, sys/prctl.h - not found Check if the system is big endian Searching 16 bit integer Check size of unsigned short CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 (get_filename_component): get_filename_component called with incorrect number of arguments Call Stack (most recent call first): CMakeLists.txt:3 (PROJECT) CMake Error: Internal CMake error, TryCompile configure of cmake failed Check size of unsigned short - failed Check size of unsigned int CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 (get_filename_component): get_filename_component called with incorrect number of arguments Call Stack (most recent call first): CMakeLists.txt:3 (PROJECT) CMake Error: Internal CMake error, TryCompile configure of cmake failed Check size of unsigned int - failed Check size of unsigned long CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 (get_filename_component): get_filename_component called with incorrect number of arguments Call Stack (most recent call first): CMakeLists.txt:3 (PROJECT) CMake Error: Internal CMake error, TryCompile configure of cmake failed Check size of unsigned long - failed CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/TestBigEndian.cmake:44 (message): no suitable type found Call Stack (most recent call first): CMake/CMakeBackwardCompatibilityC.cmake:31 (TEST_BIG_ENDIAN) CMakeLists.txt:496 (INCLUDE) Configuring incomplete, errors occurred! Le 13 d?c. 2012 ? 09:23, Beno?t Thi?bault a ?crit : >> Are you sure that your Vs2010 installation provides a x64 toolchain ? > > Nope, I'm not sure :-) > And I don't know how to check that > I'm more a Linux/Mac guy > >> Are you able to compile in x86 mode? > > What do you mean? > When I click on the "configure" button for the first time, it asks me what generator I want. I have several choices for VS: > - Visual Studio 10 > - Visual Studio 10 Win64 > - Visual Studio 10 IA64 > > It seems I have a 32 bits version, so I selected "Visual Studio 10" and "Use default native compilers". This should compile in x86 mode, right? > > I did not have the time to try configuring the compilers manually as John suggested. > > I will try to install Visual Studio 10 (not Express) and see if it works better > > Kind regards, > > Ben > > Le 13 d?c. 2012 ? 00:01, Joachim Pouderoux a ?crit : > >> Hi Benoit, >> >> Are you sure that your Vs2010 installation provides a x64 toolchain ? It may not have been installed by default and for instance, the Express edition does not provide it. >> Are you able to compile in x86 mode? >> >> Regards, >> >> Joachim >> >> Le 12 d?c. 2012 ? 10:31, "Beno?t Thi?bault" a ?crit : >> >>> Hi everyone, >>> >>> I sent this question on CMake mailing list a week ago and never had any answer. >>> >>> As it deals with compiling VTK, I'm thinking maybe some of you have a solution. >>> >>> Kind regards, >>> >>> Beno?t >>> >>> D?but du message r?exp?di? : >>> >>>> De : Beno?t Thi?bault >>>> Date : 5 d?cembre 2012 14:21:23 HNEC >>>> ? : cmake at cmake.org >>>> Objet : [CMake] CMAKE_MAKE_PROGRAM is not set - Win7 and Visual Studio 10 >>>> >>>> Hi everyone, >>>> >>>> I am trying to compile VTK on Windows 7 64bits with Visual Studio 10. >>>> >>>> But when I click on "configure" in CMake, it shows the following error message: >>>> >>>> CMake Error: CMake was unable to find a build program corresponding to "Visual Studio 10 Win64". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool. >>>> CMake Error: Could not find cmake module file:C:/Users/artenum/Downloads/vtk-5.8.0/build/CMakeFiles/2.8.10.2/CMakeCCompiler.cmake >>>> CMake Error: Could not find cmake module file:C:/Users/artenum/Downloads/vtk-5.8.0/build/CMakeFiles/2.8.10.2/CMakeCXXCompiler.cmake >>>> Configuring incomplete, errors occurred! >>>> >>>> I looked at the CMakeVS10FindMake.cmake file located in C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules and found the following command: >>>> >>>> find_program(CMAKE_MAKE_PROGRAM >>>> NAMES devenv >>>> HINTS >>>> [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;EnvironmentDirectory] >>>> [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup;Dbghelp_path] >>>> "$ENV{ProgramFiles}/Microsoft Visual Studio 10.0/Common7/IDE" >>>> "$ENV{ProgramFiles}/Microsoft Visual Studio10.0/Common7/IDE" >>>> "$ENV{ProgramFiles}/Microsoft Visual Studio 10/Common7/IDE" >>>> "$ENV{ProgramFiles}/Microsoft Visual Studio10/Common7/IDE" >>>> "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 10.0/Common7/IDE" >>>> "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio10.0/Common7/IDE" >>>> "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 10/Common7/IDE" >>>> "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio10/Common7/IDE" >>>> "/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/" >>>> "/Program Files/Microsoft Visual Studio 10/Common7/IDE/" >>>> ) >>>> >>>> Here a copy/paste of the path of my Visual Studio 10 installation (and in particular the IDE folder): >>>> C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE >>>> >>>> I should add that my Windows 7 installation is in French. This means that the "Program Files" folder is named "Programmes" (in French) but "Progam Files (x86)" is in english. >>>> >>>> I have added the two following lines in the command to be sure, but it still does not work: >>>> "/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/" >>>> "/Program Files (x86)/Microsoft Visual Studio 10/Common7/IDE/" >>>> >>>> What should I do? >>>> >>>> Kind regards, >>>> >>>> Ben >>> >>> >>> _______________________________________________ >>> 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://www.vtk.org/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://www.vtk.org/mailman/listinfo/vtkusers -- Dr Beno?t Thi?bault Project Manager Artenum Toulouse - Science & Groupware http://www.artenum.com B?timent Calfocenter 10, rue Marguerite-Long 31320 Castanet-Tolosan France Phone: +33 (0)5 82 95 19 00 -------------- next part -------------- An HTML attachment was scrubbed... URL: From lobo.theslayer at gmail.com Sat Dec 15 14:36:10 2012 From: lobo.theslayer at gmail.com (Rodrigo Lovera) Date: Sat, 15 Dec 2012 14:36:10 -0500 Subject: [vtkusers] Color/opacity values for ultrasound 3D visualization Message-ID: Hello everyone, I was wondering if anyone could help me on these. I've done some ultrasound 3d rendering with vtk, but i'd like to work with values for color and opacity commony used in ultrasound, I really don't hae much idea on these so any help 'd be apreciated. Regards, -- *Rodrigo* -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Sat Dec 15 17:35:14 2012 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Sat, 15 Dec 2012 17:35:14 -0500 Subject: [vtkusers] Fwd: [CMake] CMAKE_MAKE_PROGRAM is not set - Win7 and Visual Studio 10 In-Reply-To: References: <404B71B8-F346-4B85-B958-A97657F1D945@artenum.com> <3315082122939397449@unknownmsgid> <06EE54FF-BA79-4A59-BC5B-008E03C6EB69@artenum.com> Message-ID: Did you install the compiler in the default location? CMake should work just fine with your configuration. It is a common one. On Sat, Dec 15, 2012 at 1:57 AM, Beno?t Thi?bault wrote: > Hi list, > > I have installed Visual Studio 10 (not the express version, the full one), > with x64 support. However, when selecting Visual Studio 10 or Visual Studio > 10 Win64 and choosing the default native compilers, I have the following > errors. > > The C compiler identification is unknown > The CXX compiler identification is unknown > Performing Test Support for 64 bit file systems > CMake Error at C:/Program Files (x86)/CMake > 2.8/share/cmake-2.8/Modules/CMakeCXXInformation.cmake:37 > (get_filename_component): > get_filename_component called with incorrect number of arguments > Call Stack (most recent call first): > CMakeLists.txt:3 (PROJECT) > > > CMake Error: Internal CMake error, TryCompile configure of cmake failed > Performing Test Support for 64 bit file systems - Failed > Performing Test VTK_CONST_REVERSE_ITERATOR_COMPARISON > CMake Error at C:/Program Files (x86)/CMake > 2.8/share/cmake-2.8/Modules/CMakeCXXInformation.cmake:37 > (get_filename_component): > get_filename_component called with incorrect number of arguments > Call Stack (most recent call first): > CMakeLists.txt:3 (PROJECT) > > > CMake Error: Internal CMake error, TryCompile configure of cmake failed > Performing Test VTK_CONST_REVERSE_ITERATOR_COMPARISON - Failed > CMake Error at C:/Program Files (x86)/CMake > 2.8/share/cmake-2.8/Modules/CMakeCXXInformation.cmake:37 > (get_filename_component): > get_filename_component called with incorrect number of arguments > Call Stack (most recent call first): > CMakeLists.txt:3 (PROJECT) > > > CMake Error: Internal CMake error, TryCompile configure of cmake failed > Looking for sys/types.h > CMake Error at C:/Program Files (x86)/CMake > 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 > (get_filename_component): > get_filename_component called with incorrect number of arguments > Call Stack (most recent call first): > CMakeLists.txt:3 (PROJECT) > > > CMake Error: Internal CMake error, TryCompile configure of cmake failed > Looking for sys/types.h - not found > Looking for stdint.h > CMake Error at C:/Program Files (x86)/CMake > 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 > (get_filename_component): > get_filename_component called with incorrect number of arguments > Call Stack (most recent call first): > CMakeLists.txt:3 (PROJECT) > > > CMake Error: Internal CMake error, TryCompile configure of cmake failed > Looking for stdint.h - not found > Looking for stddef.h > CMake Error at C:/Program Files (x86)/CMake > 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 > (get_filename_component): > get_filename_component called with incorrect number of arguments > Call Stack (most recent call first): > CMakeLists.txt:3 (PROJECT) > > > CMake Error: Internal CMake error, TryCompile configure of cmake failed > Looking for stddef.h - not found > Check size of int > CMake Error at C:/Program Files (x86)/CMake > 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 > (get_filename_component): > get_filename_component called with incorrect number of arguments > Call Stack (most recent call first): > CMakeLists.txt:3 (PROJECT) > > > CMake Error: Internal CMake error, TryCompile configure of cmake failed > Check size of int - failed > Check size of long > CMake Error at C:/Program Files (x86)/CMake > 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 > (get_filename_component): > get_filename_component called with incorrect number of arguments > Call Stack (most recent call first): > CMakeLists.txt:3 (PROJECT) > > > CMake Error: Internal CMake error, TryCompile configure of cmake failed > Check size of long - failed > Check size of void* > CMake Error at C:/Program Files (x86)/CMake > 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 > (get_filename_component): > get_filename_component called with incorrect number of arguments > Call Stack (most recent call first): > CMakeLists.txt:3 (PROJECT) > > > CMake Error: Internal CMake error, TryCompile configure of cmake failed > Check size of void* - failed > Check size of char > CMake Error at C:/Program Files (x86)/CMake > 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 > (get_filename_component): > get_filename_component called with incorrect number of arguments > Call Stack (most recent call first): > CMakeLists.txt:3 (PROJECT) > > > CMake Error: Internal CMake error, TryCompile configure of cmake failed > Check size of char - failed > Check size of short > CMake Error at C:/Program Files (x86)/CMake > 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 > (get_filename_component): > get_filename_component called with incorrect number of arguments > Call Stack (most recent call first): > CMakeLists.txt:3 (PROJECT) > > > CMake Error: Internal CMake error, TryCompile configure of cmake failed > Check size of short - failed > Check size of float > CMake Error at C:/Program Files (x86)/CMake > 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 > (get_filename_component): > get_filename_component called with incorrect number of arguments > Call Stack (most recent call first): > CMakeLists.txt:3 (PROJECT) > > > CMake Error: Internal CMake error, TryCompile configure of cmake failed > Check size of float - failed > Check size of double > CMake Error at C:/Program Files (x86)/CMake > 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 > (get_filename_component): > get_filename_component called with incorrect number of arguments > Call Stack (most recent call first): > CMakeLists.txt:3 (PROJECT) > > > CMake Error: Internal CMake error, TryCompile configure of cmake failed > Check size of double - failed > Looking for include file limits.h > CMake Error at C:/Program Files (x86)/CMake > 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 > (get_filename_component): > get_filename_component called with incorrect number of arguments > Call Stack (most recent call first): > CMakeLists.txt:3 (PROJECT) > > > CMake Error: Internal CMake error, TryCompile configure of cmake failed > Looking for include file limits.h - not found > Looking for include file unistd.h > CMake Error at C:/Program Files (x86)/CMake > 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 > (get_filename_component): > get_filename_component called with incorrect number of arguments > Call Stack (most recent call first): > CMakeLists.txt:3 (PROJECT) > > > CMake Error: Internal CMake error, TryCompile configure of cmake failed > Looking for include file unistd.h - not found > Looking for include file pthread.h > CMake Error at C:/Program Files (x86)/CMake > 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 > (get_filename_component): > get_filename_component called with incorrect number of arguments > Call Stack (most recent call first): > CMakeLists.txt:3 (PROJECT) > > > CMake Error: Internal CMake error, TryCompile configure of cmake failed > Looking for include file pthread.h - not found > Looking for include files sys/types.h, sys/prctl.h > CMake Error at C:/Program Files (x86)/CMake > 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 > (get_filename_component): > get_filename_component called with incorrect number of arguments > Call Stack (most recent call first): > CMakeLists.txt:3 (PROJECT) > > > CMake Error: Internal CMake error, TryCompile configure of cmake failed > Looking for include files sys/types.h, sys/prctl.h - not found > Check if the system is big endian > Searching 16 bit integer > Check size of unsigned short > CMake Error at C:/Program Files (x86)/CMake > 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 > (get_filename_component): > get_filename_component called with incorrect number of arguments > Call Stack (most recent call first): > CMakeLists.txt:3 (PROJECT) > > > CMake Error: Internal CMake error, TryCompile configure of cmake failed > Check size of unsigned short - failed > Check size of unsigned int > CMake Error at C:/Program Files (x86)/CMake > 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 > (get_filename_component): > get_filename_component called with incorrect number of arguments > Call Stack (most recent call first): > CMakeLists.txt:3 (PROJECT) > > > CMake Error: Internal CMake error, TryCompile configure of cmake failed > Check size of unsigned int - failed > Check size of unsigned long > CMake Error at C:/Program Files (x86)/CMake > 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:37 > (get_filename_component): > get_filename_component called with incorrect number of arguments > Call Stack (most recent call first): > CMakeLists.txt:3 (PROJECT) > > > CMake Error: Internal CMake error, TryCompile configure of cmake failed > Check size of unsigned long - failed > CMake Error at C:/Program Files (x86)/CMake > 2.8/share/cmake-2.8/Modules/TestBigEndian.cmake:44 (message): > no suitable type found > Call Stack (most recent call first): > CMake/CMakeBackwardCompatibilityC.cmake:31 (TEST_BIG_ENDIAN) > CMakeLists.txt:496 (INCLUDE) > > > Configuring incomplete, errors occurred! > > > Le 13 d?c. 2012 ? 09:23, Beno?t Thi?bault a ?crit : > > Are you sure that your Vs2010 installation provides a x64 toolchain ? > > > Nope, I'm not sure :-) > And I don't know how to check that > I'm more a Linux/Mac guy > > Are you able to compile in x86 mode? > > > What do you mean? > When I click on the "configure" button for the first time, it asks me what > generator I want. I have several choices for VS: > - Visual Studio 10 > - Visual Studio 10 Win64 > - Visual Studio 10 IA64 > > It seems I have a 32 bits version, so I selected "Visual Studio 10" and "Use > default native compilers". This should compile in x86 mode, right? > > I did not have the time to try configuring the compilers manually as John > suggested. > > I will try to install Visual Studio 10 (not Express) and see if it works > better > > Kind regards, > > Ben > > Le 13 d?c. 2012 ? 00:01, Joachim Pouderoux a ?crit : > > Hi Benoit, > > Are you sure that your Vs2010 installation provides a x64 toolchain ? It may > not have been installed by default and for instance, the Express edition > does not provide it. > Are you able to compile in x86 mode? > > Regards, > > Joachim > > Le 12 d?c. 2012 ? 10:31, "Beno?t Thi?bault" a ?crit > : > > Hi everyone, > > I sent this question on CMake mailing list a week ago and never had any > answer. > > As it deals with compiling VTK, I'm thinking maybe some of you have a > solution. > > Kind regards, > > Beno?t > > D?but du message r?exp?di? : > > De : Beno?t Thi?bault > Date : 5 d?cembre 2012 14:21:23 HNEC > ? : cmake at cmake.org > Objet : [CMake] CMAKE_MAKE_PROGRAM is not set - Win7 and Visual Studio 10 > > Hi everyone, > > I am trying to compile VTK on Windows 7 64bits with Visual Studio 10. > > But when I click on "configure" in CMake, it shows the following error > message: > > CMake Error: CMake was unable to find a build program corresponding to > "Visual Studio 10 Win64". CMAKE_MAKE_PROGRAM is not set. You probably need > to select a different build tool. > CMake Error: Could not find cmake module > file:C:/Users/artenum/Downloads/vtk-5.8.0/build/CMakeFiles/2.8.10.2/CMakeCCompiler.cmake > CMake Error: Could not find cmake module > file:C:/Users/artenum/Downloads/vtk-5.8.0/build/CMakeFiles/2.8.10.2/CMakeCXXCompiler.cmake > Configuring incomplete, errors occurred! > > I looked at the CMakeVS10FindMake.cmake file located in C:\Program Files > (x86)\CMake 2.8\share\cmake-2.8\Modules and found the following command: > > find_program(CMAKE_MAKE_PROGRAM > NAMES devenv > HINTS > > [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;EnvironmentDirectory] > > [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup;Dbghelp_path] > "$ENV{ProgramFiles}/Microsoft Visual Studio 10.0/Common7/IDE" > "$ENV{ProgramFiles}/Microsoft Visual Studio10.0/Common7/IDE" > "$ENV{ProgramFiles}/Microsoft Visual Studio 10/Common7/IDE" > "$ENV{ProgramFiles}/Microsoft Visual Studio10/Common7/IDE" > "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 10.0/Common7/IDE" > "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio10.0/Common7/IDE" > "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 10/Common7/IDE" > "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio10/Common7/IDE" > "/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/" > "/Program Files/Microsoft Visual Studio 10/Common7/IDE/" > ) > > Here a copy/paste of the path of my Visual Studio 10 installation (and in > particular the IDE folder): > C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE > > I should add that my Windows 7 installation is in French. This means that > the "Program Files" folder is named "Programmes" (in French) but "Progam > Files (x86)" is in english. > > I have added the two following lines in the command to be sure, but it still > does not work: > "/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/" > "/Program Files (x86)/Microsoft Visual Studio 10/Common7/IDE/" > > What should I do? > > Kind regards, > > Ben > > > _______________________________________________ > 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://www.vtk.org/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://www.vtk.org/mailman/listinfo/vtkusers > > > -- > Dr Beno?t Thi?bault > Project Manager > > Artenum Toulouse - Science & Groupware > http://www.artenum.com > > B?timent Calfocenter > 10, rue Marguerite-Long > 31320 Castanet-Tolosan > France > Phone: +33 (0)5 82 95 19 00 > > > > _______________________________________________ > 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://www.vtk.org/mailman/listinfo/vtkusers > -- Unpaid intern in BillsBasement at noware dot com From huangz2350 at 163.com Sun Dec 16 06:27:39 2012 From: huangz2350 at 163.com (huangz2350) Date: Sun, 16 Dec 2012 19:27:39 +0800 (CST) Subject: [vtkusers] About witgets' pick event Message-ID: Hi EveryBody I have a trouble on the use of the witgets class. When I use the vtkAngleWitget(vtkDistanceWitget...),I found they can't be picked.I used vtkCellPicker. I read this Url(http://vtk.1045678.n5.nabble.com/Interactor-on-vtkWidget-td2848124.html#a2848445) According to Dean Inglis' way Wrote the following code: this->pvtkCellPicker->PickFromListOn(); vtkDistanceWidget *pDistanceWidget = NULL;int i = 0; for(i = this->CArrWitGets_Distance.GetSize()-1; i >= 0; i--) { pDistanceWidget = CArrWitGets_Distance.GetAt(i); vtkSmartPointer collection = vtkSmartPointer::New(); vtkDistanceRepresentation::SafeDownCast(pDistanceWidget->GetRepresentation())->GetActors(collection); collection->InitTraversal(); int r = collection->GetNumberOfItems(); for(vtkIdType i=0; iGetNumberOfItems(); i++) { vtkActor* pActor = vtkActor::SafeDownCast(collection->GetNextProp()); this->pvtkCellPicker->AddPickList(pActor); } pDistanceWidget->Off(); //this->pvtkCellPicker->AddPickList(vtkDistanceRepresentation2D::SafeDownCast(pDistanceWidget->GetRepresentation())->GetAxis()); } I found i can't find anything in pDistanceWidget(collection->GetNumberOfItems() is zero),Who can tell me where I was wrong? Is The Dean Inglis' way right? have any other ways? PS:How to get the class-type of "actor->GetMapper()->GetInput()"? [IsTypeOf] function? if it can,can you give me some example's codes? Thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: From wgt2050 at 163.com Sun Dec 16 07:13:21 2012 From: wgt2050 at 163.com (Guotai Wang) Date: Sun, 16 Dec 2012 04:13:21 -0800 (PST) Subject: [vtkusers] How to get the coordinate in the volume data by mouse click? Message-ID: <1355660001475-5717630.post@n5.nabble.com> Hello, I have a volume data(3D medical image) and visualize one slice by VTK, I want to edit that slice by user interaction, i.e., the user can click certain point in the render window, and the corrdinate of of the corresponding pixel in the volume data can be calculated and then the pixel value can be edited. But how to get the corresponding coordinate of the pixel by mouse click? -- View this message in context: http://vtk.1045678.n5.nabble.com/How-to-get-the-coordinate-in-the-volume-data-by-mouse-click-tp5717630.html Sent from the VTK - Users mailing list archive at Nabble.com. From wgt2050 at 163.com Sun Dec 16 08:04:12 2012 From: wgt2050 at 163.com (Guotai Wang) Date: Sun, 16 Dec 2012 05:04:12 -0800 (PST) Subject: [vtkusers] How to get the coordinate in the volume data by mouse click? In-Reply-To: <1355660001475-5717630.post@n5.nabble.com> References: <1355660001475-5717630.post@n5.nabble.com> Message-ID: <1355663052579-5717631.post@n5.nabble.com> I have addressed this problem, one solution is: double image_position[3]; render->SetDisplayPoint(position[0], position[1], 0); render->DisplayToWorld(); render->GetWorldPoint(image_position); -- View this message in context: http://vtk.1045678.n5.nabble.com/How-to-get-the-coordinate-in-the-volume-data-by-mouse-click-tp5717630p5717631.html Sent from the VTK - Users mailing list archive at Nabble.com. From wgt2050 at 163.com Mon Dec 17 03:26:11 2012 From: wgt2050 at 163.com (Guotai Wang) Date: Mon, 17 Dec 2012 00:26:11 -0800 (PST) Subject: [vtkusers] Y coordinate convert error in display to World coord In-Reply-To: References: Message-ID: <1355732771322-5717632.post@n5.nabble.com> Hi, Have anybody addressed this problem? I'm also a QVTKWidget user,I find a problem like this: when I set the position camera along z axix so that the viewport show the x-y plane of the vome data, the code works well and the result of coordinate convertion is correct. However, when the y-z plane or x-z plane is shown in viewport, the convertion result is not right. I don't know the reasion and how to deal with it, is there anyone who can help me? Following is the code: render->SetDisplayPoint(image_position[0], image_position[1],image_position[2]); render->DisplayToWorld(); render->GetWorldPoint(image_position); -- View this message in context: http://vtk.1045678.n5.nabble.com/Y-coordinate-convert-error-in-display-to-World-coord-tp5714439p5717632.html Sent from the VTK - Users mailing list archive at Nabble.com. From oystein.skotheim at tecnalia.com Mon Dec 17 10:55:10 2012 From: oystein.skotheim at tecnalia.com (Skotheim, Oystein) Date: Mon, 17 Dec 2012 15:55:10 +0000 Subject: [vtkusers] Re-rendering the scene from an external callback function Message-ID: <4B55AE1038EEB14C865001D912FDAB99D4DFDD@EXCSRVGAV02.tri.lan> Hello. I am working on a Python application where I want to display 3D meshes on top of live video images. I have currently implemented this by using a vtkImageActor (with the image) along with a normal vtkActor (with the 3D data). Perhaps this is not the correct way of doing it, but it seems to work fine. The application is developed within the ROS framework, and I receive images by subscribing to image messages on a ROS topic. This means that every time a new image comes in, I have a ROS callback function that converts the incoming image data to vtkImageData format via the vtkImageImport class, and then I attempt to re-render the scene. However, it seems like the Render() function does nothing when called from such a callback function. (I have tried to call Render() both on the vtkRenderWindowInteractor and on the vtkRenderWindow). When I run Render() from the interactive Python prompt, however, the scene is correctly re-rendered. So my question is: How can I force the system to re-render the scene from an (external) callback function? Or how can I otherwise resolve this issue? Best regards, -- ?ystein Skotheim Senior Researcher TECNALIA Department of Robotics. Industry & Transport Division -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Mon Dec 17 12:18:33 2012 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Mon, 17 Dec 2012 12:18:33 -0500 Subject: [vtkusers] magnify vtkChartXY image In-Reply-To: References: Message-ID: Randy, Have you tried vtkRenderLargeImage: http://vtk.org/Wiki/VTK/Examples/Cxx/Visualization/RenderLargeImage I have not tried it with a chart, but it's worth a shot. Regards, Bill On Fri, Dec 14, 2012 at 4:16 PM, Randy Heiland wrote: > Is there some way to magnify (or set the resolution of) a rendered chart, in order to generate a higher-res image from a Writer? e.g. I attempted the following simple Python script, which did indeed generate a magnified (x 2) .png image, but it was not what I expected. > > thanks, Randy > > from vtk import * > > table = vtkTable() > arrX = vtkFloatArray() > arrX.SetName("X") > table.AddColumn(arrX) > arrY = vtkFloatArray() > arrY.SetName("Y") > table.AddColumn(arrY) > > table.SetNumberOfRows(2) > table.SetValue(0, 0, 0.0) > table.SetValue(1, 0, 1.0) > table.SetValue(0, 1, 0.0) > table.SetValue(1, 1, 1.0) > > view = vtkContextView() > > chart = vtkChartXY() > view.GetScene().AddItem(chart) > line = chart.AddPlot(vtkChart.LINE) > line.SetInput(table, 0, 1) > > view.GetInteractor().Initialize() > view.GetRenderWindow().SetSize(200,200) > > imgFilter = vtkWindowToImageFilter() > imgFilter.SetInput(view.GetRenderWindow()) > imgFilter.SetMagnification(2) > > writer=vtkPNGWriter() > writer.SetFileName("chart.png") > writer.SetInputConnection(imgFilter.GetOutputPort()) > writer.Write() > > #view.GetInteractor().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 > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers -- Unpaid intern in BillsBasement at noware dot com From bill.lorensen at gmail.com Mon Dec 17 14:42:57 2012 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Mon, 17 Dec 2012 14:42:57 -0500 Subject: [vtkusers] magnify vtkChartXY image In-Reply-To: References: Message-ID: I just tried it also. For some reason it just replicates the chart. On Mon, Dec 17, 2012 at 1:42 PM, Gerrick Bivins wrote: > Just an FYI, > I've tried to use that in the past and it didn't capture the render properly: > http://vtk.1045678.n5.nabble.com/vtkRenderLargeImage-and-multiple-renders-td1240248.html > > I remember looking into it but I don't think I figured out what was wrong, something with multiple renderers was the issue for me I think. > It may be fixed now because that was a couple of years and version of vtk ago > Gerrick > > > -----Original Message----- > From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of Bill Lorensen > Sent: Monday, December 17, 2012 11:19 AM > To: Randy Heiland > Cc: vtkusers at vtk.org > Subject: Re: [vtkusers] magnify vtkChartXY image > > Randy, > > Have you tried vtkRenderLargeImage: > http://vtk.org/Wiki/VTK/Examples/Cxx/Visualization/RenderLargeImage > > I have not tried it with a chart, but it's worth a shot. > > Regards, > > Bill > > On Fri, Dec 14, 2012 at 4:16 PM, Randy Heiland wrote: >> Is there some way to magnify (or set the resolution of) a rendered chart, in order to generate a higher-res image from a Writer? e.g. I attempted the following simple Python script, which did indeed generate a magnified (x 2) .png image, but it was not what I expected. >> >> thanks, Randy >> >> from vtk import * >> >> table = vtkTable() >> arrX = vtkFloatArray() >> arrX.SetName("X") >> table.AddColumn(arrX) >> arrY = vtkFloatArray() >> arrY.SetName("Y") >> table.AddColumn(arrY) >> >> table.SetNumberOfRows(2) >> table.SetValue(0, 0, 0.0) >> table.SetValue(1, 0, 1.0) >> table.SetValue(0, 1, 0.0) >> table.SetValue(1, 1, 1.0) >> >> view = vtkContextView() >> >> chart = vtkChartXY() >> view.GetScene().AddItem(chart) >> line = chart.AddPlot(vtkChart.LINE) >> line.SetInput(table, 0, 1) >> >> view.GetInteractor().Initialize() >> view.GetRenderWindow().SetSize(200,200) >> >> imgFilter = vtkWindowToImageFilter() >> imgFilter.SetInput(view.GetRenderWindow()) >> imgFilter.SetMagnification(2) >> >> writer=vtkPNGWriter() >> writer.SetFileName("chart.png") >> writer.SetInputConnection(imgFilter.GetOutputPort()) >> writer.Write() >> >> #view.GetInteractor().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 >> >> Follow this link to subscribe/unsubscribe: >> http://www.vtk.org/mailman/listinfo/vtkusers > > > > -- > Unpaid intern in BillsBasement at noware dot com _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers -- Unpaid intern in BillsBasement at noware dot com From Gerrick.Bivins at halliburton.com Mon Dec 17 13:42:03 2012 From: Gerrick.Bivins at halliburton.com (Gerrick Bivins) Date: Mon, 17 Dec 2012 18:42:03 +0000 Subject: [vtkusers] magnify vtkChartXY image In-Reply-To: References: Message-ID: Just an FYI, I've tried to use that in the past and it didn't capture the render properly: http://vtk.1045678.n5.nabble.com/vtkRenderLargeImage-and-multiple-renders-td1240248.html I remember looking into it but I don't think I figured out what was wrong, something with multiple renderers was the issue for me I think. It may be fixed now because that was a couple of years and version of vtk ago Gerrick -----Original Message----- From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of Bill Lorensen Sent: Monday, December 17, 2012 11:19 AM To: Randy Heiland Cc: vtkusers at vtk.org Subject: Re: [vtkusers] magnify vtkChartXY image Randy, Have you tried vtkRenderLargeImage: http://vtk.org/Wiki/VTK/Examples/Cxx/Visualization/RenderLargeImage I have not tried it with a chart, but it's worth a shot. Regards, Bill On Fri, Dec 14, 2012 at 4:16 PM, Randy Heiland wrote: > Is there some way to magnify (or set the resolution of) a rendered chart, in order to generate a higher-res image from a Writer? e.g. I attempted the following simple Python script, which did indeed generate a magnified (x 2) .png image, but it was not what I expected. > > thanks, Randy > > from vtk import * > > table = vtkTable() > arrX = vtkFloatArray() > arrX.SetName("X") > table.AddColumn(arrX) > arrY = vtkFloatArray() > arrY.SetName("Y") > table.AddColumn(arrY) > > table.SetNumberOfRows(2) > table.SetValue(0, 0, 0.0) > table.SetValue(1, 0, 1.0) > table.SetValue(0, 1, 0.0) > table.SetValue(1, 1, 1.0) > > view = vtkContextView() > > chart = vtkChartXY() > view.GetScene().AddItem(chart) > line = chart.AddPlot(vtkChart.LINE) > line.SetInput(table, 0, 1) > > view.GetInteractor().Initialize() > view.GetRenderWindow().SetSize(200,200) > > imgFilter = vtkWindowToImageFilter() > imgFilter.SetInput(view.GetRenderWindow()) > imgFilter.SetMagnification(2) > > writer=vtkPNGWriter() > writer.SetFileName("chart.png") > writer.SetInputConnection(imgFilter.GetOutputPort()) > writer.Write() > > #view.GetInteractor().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 > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers -- Unpaid intern in BillsBasement at noware dot com _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://www.vtk.org/mailman/listinfo/vtkusers From jmrbcu at gmail.com Mon Dec 17 16:34:25 2012 From: jmrbcu at gmail.com (=?UTF-8?Q?Jos=C3=A9_M=2E_Rodriguez_Bacallao?=) Date: Mon, 17 Dec 2012 16:34:25 -0500 Subject: [vtkusers] differences in window/level Message-ID: hello, while I was testing a dicom viewer I am developing I noticed differences in window leveling from the pipeline I am using with respect to one of the viewers I use as reference. I attached the snapshot, the left window is my viewer and the right is one of my reference viewers. Both have the same window/level: 1995/998, but the image displayed at left is darker than right, here is part of the pipeline I use: vtk_image = image.vtk_image self.view = vtk.QVTKWidget(self) self.view.setFocusProxy(self) # add the view to the internal layout self.setUpdatesEnabled(False) self.layout().takeAt(1) self.layout().addWidget(self.view) self.setUpdatesEnabled(True) # create the main interactor style style = vtk.vtkInteractorStyleImage() style.SetInteractionModeToImageSlicing() self.view.GetRenderWindow().GetInteractor().SetInteractorStyle(style) # the axial orientation style.SetZViewRightVector((1, 0, 0)) style.SetZViewUpVector((0, -1, 0)) # the sagital orientation style.SetXViewRightVector((0, 1, 0)) style.SetXViewUpVector((0, 0, 1)) # the coronal orientation style.SetYViewRightVector((1, 0, 0)) style.SetYViewUpVector((0, 0, 1)) image_mapper = vtk.vtkImageResliceMapper() image_mapper.SliceFacesCameraOn() image_mapper.SliceAtFocalPointOn() image_mapper.JumpToNearestSliceOn() image_mapper.BorderOff() self.image_mapper = image_mapper format = image.image_format if format in (vtkgdcm.VTK_LOOKUP_TABLE, vtkgdcm.VTK_INVERSE_LUMINANCE): lut = vtk_image.GetPointData().GetScalars().GetLookupTable() if isinstance(lut, vtkgdcm.vtkLookupTable16): color_filter = vtkgdcm.vtkImageMapToColors16() else: color_filter = vtk.vtkImageMapToColors() color_filter.SetInputConnection(vtk_image.GetProducerPort()) color_filter.SetLookupTable(lut) if format == vtkgdcm.VTK_LOOKUP_TABLE: color_filter.SetOutputFormatToRGB() elif format == vtkgdcm.VTK_INVERSE_LUMINANCE: color_filter.SetOutputFormatToLuminance() color_filter.Update() scalar_range = color_filter.GetOutput().GetScalarRange() image_mapper.SetInputConnection(color_filter.GetOutputPort()) del color_filter elif format == vtkgdcm.VTK_YBR: color_filter = vtkgdcm.vtkImageYBRToRGB() color_filter.SetInputConnection(vtk_image.GetProducerPort()) color_filter.Update() scalar_range = color_filter.GetOutput().GetScalarRange() image_mapper.SetInputConnection(color_filter.GetOutputPort()) del color_filter else: scalar_range = vtk_image.GetScalarRange() image_mapper.SetInput(vtk_image) try: # here the window width will be: 1995 and window level: 998 level = image.window_level[0] window = image.window_width[0] except KeyError, IndexError: window = scalar_range[1] - scalar_range[0] level = 0.5 * (scalar_range[1] + scalar_range[0]) image_property = vtk.vtkImageProperty() image_property.SetColorWindow(window) image_property.SetColorLevel(level) image_property.SetAmbient(0.0) image_property.SetDiffuse(1.0) image_property.SetOpacity(1.0) image_property.SetInterpolationTypeToLinear() self.image_property = image_property image_actor = vtk.vtkImageSlice() image_actor.SetMapper(image_mapper) image_actor.SetProperty(image_property) self.image_actor = image_actor image_renderer = vtk.vtkRenderer() image_renderer.SetBackground(0, 0, 0) self.image_renderer = image_renderer image_renderer.AddViewProp(image_actor) image_renderer.ResetCamera() image_renderer.GetActiveCamera().ParallelProjectionOn() self.render_window().AddRenderer(image_renderer) self.set_orientation('AXIAL') self.render() -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmrbcu at gmail.com Mon Dec 17 16:48:41 2012 From: jmrbcu at gmail.com (=?UTF-8?Q?Jos=C3=A9_M=2E_Rodriguez_Bacallao?=) Date: Mon, 17 Dec 2012 16:48:41 -0500 Subject: [vtkusers] differences in window/leveling (new, no so big, attachment) Message-ID: sorry, the attachment was a little big so I had to scale it down, here is again: hello, while I was testing a dicom viewer I am developing I noticed differences in window leveling from the pipeline I am using with respect to one of the viewers I use as reference. I attached the snapshot, the left window is my viewer and the right is one of my reference viewers. Both have the same window/level: 1995/998, but the image displayed at left is darker than right, here is part of the pipeline I use: vtk_image = image.vtk_image self.view = vtk.QVTKWidget(self) self.view.setFocusProxy(self) # add the view to the internal layout self.setUpdatesEnabled(False) self.layout().takeAt(1) self.layout().addWidget(self.view) self.setUpdatesEnabled(True) # create the main interactor style style = vtk.vtkInteractorStyleImage() style.SetInteractionModeToImageSlicing() self.view.GetRenderWindow().GetInteractor().SetInteractorStyle(style) # the axial orientation style.SetZViewRightVector((1, 0, 0)) style.SetZViewUpVector((0, -1, 0)) # the sagital orientation style.SetXViewRightVector((0, 1, 0)) style.SetXViewUpVector((0, 0, 1)) # the coronal orientation style.SetYViewRightVector((1, 0, 0)) style.SetYViewUpVector((0, 0, 1)) image_mapper = vtk.vtkImageResliceMapper() image_mapper.SliceFacesCameraOn() image_mapper.SliceAtFocalPointOn() image_mapper.JumpToNearestSliceOn() image_mapper.BorderOff() self.image_mapper = image_mapper format = image.image_format if format in (vtkgdcm.VTK_LOOKUP_TABLE, vtkgdcm.VTK_INVERSE_LUMINANCE): lut = vtk_image.GetPointData().GetScalars().GetLookupTable() if isinstance(lut, vtkgdcm.vtkLookupTable16): color_filter = vtkgdcm.vtkImageMapToColors16() else: color_filter = vtk.vtkImageMapToColors() color_filter.SetInputConnection(vtk_image.GetProducerPort()) color_filter.SetLookupTable(lut) if format == vtkgdcm.VTK_LOOKUP_TABLE: color_filter.SetOutputFormatToRGB() elif format == vtkgdcm.VTK_INVERSE_LUMINANCE: color_filter.SetOutputFormatToLuminance() color_filter.Update() scalar_range = color_filter.GetOutput().GetScalarRange() image_mapper.SetInputConnection(color_filter.GetOutputPort()) del color_filter elif format == vtkgdcm.VTK_YBR: color_filter = vtkgdcm.vtkImageYBRToRGB() color_filter.SetInputConnection(vtk_image.GetProducerPort()) color_filter.Update() scalar_range = color_filter.GetOutput().GetScalarRange() image_mapper.SetInputConnection(color_filter.GetOutputPort()) del color_filter else: scalar_range = vtk_image.GetScalarRange() image_mapper.SetInput(vtk_image) try: # here the window width will be: 1995 and window level: 998 level = image.window_level[0] window = image.window_width[0] except KeyError, IndexError: window = scalar_range[1] - scalar_range[0] level = 0.5 * (scalar_range[1] + scalar_range[0]) image_property = vtk.vtkImageProperty() image_property.SetColorWindow(window) image_property.SetColorLevel(level) image_property.SetAmbient(0.0) image_property.SetDiffuse(1.0) image_property.SetOpacity(1.0) image_property.SetInterpolationTypeToLinear() self.image_property = image_property image_actor = vtk.vtkImageSlice() image_actor.SetMapper(image_mapper) image_actor.SetProperty(image_property) self.image_actor = image_actor image_renderer = vtk.vtkRenderer() image_renderer.SetBackground(0, 0, 0) self.image_renderer = image_renderer image_renderer.AddViewProp(image_actor) image_renderer.ResetCamera() image_renderer.GetActiveCamera().ParallelProjectionOn() self.render_window().AddRenderer(image_renderer) self.set_orientation('AXIAL') self.render() -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: wl.png Type: image/png Size: 159787 bytes Desc: not available URL: From JamesJ at motionview3d.com Mon Dec 17 16:53:31 2012 From: JamesJ at motionview3d.com (James Johnston) Date: Mon, 17 Dec 2012 21:53:31 -0000 Subject: [vtkusers] Was vtkWidgetSet never finished...? Message-ID: <02aa01cddca0$f5700610$e0501230$@motionview3d.com> Hi, Was vtkWidgetSet never finished? Tracing file history in Git shows that nothing substantial has been modified in it ever since the first commit that created it in the first place, 4 - 5 years ago. My reason for concern is that vtkWidgetSet seems very closely coupled to vtkParallelopipedWidget and is not usable with any other kind of widget - which seems to greatly limit the scope of the class far beyond what the original author seemed to intend. 1. The vtkWidgetSet.cxx implementation file contains the following: #include "vtkParallelopipedWidget.h" // REMOVE I do not know why this "generic" class should be including any very specific header file other than widget base class headers. This seems clear since the original author left the "// REMOVE" comment. 2. The vtkWidgetSet::AddWidget implementation contains the following: // TODO : Won't be necessary if we move this to the AbstractWidget.. superclass static_cast(w)->WidgetSet = this; The code is again suggestive that the original implementation was never finished. In this case, the code ensures that any program attempting to use vtkWidgetSet with any other kind of widget will corrupt the widgets memory and eventually crash the program. 3. The vtkWidgetSet::RemoveWidget implementation again contains the following: static_cast(w)->WidgetSet = NULL; similar problems as noted in #2 4. The vtkParallelopipedWidget class declares that vtkWidgetSet is a friend class - again, creating what appears to be poor coupling: friend class vtkWidgetSet; The reason I would like to use this class, of course, is to "share" widgets across renderers. But I'm not using vtkParallelopipedWidget. Best regards, James Johnston From david.gobbi at gmail.com Mon Dec 17 17:24:53 2012 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 17 Dec 2012 15:24:53 -0700 Subject: [vtkusers] differences in window/leveling (new, no so big, attachment) In-Reply-To: References: Message-ID: Your image is dark because you are applying the window/level _after_ you have converted the image to RGB. After the image is RGB, it has values in the range [0,255]. So of course if you apply a window/level of 1995/998 to such an image, the result is going to be very dark. To summarize: you can apply the window/level with vtkImageMapToColors, or you can apply the window/level with vtkImageProperty, but _not with both_. Two ways to fix: Option #1: Apply window/level with vtkImageMapToColors lut.SetRange(level-0.5*window, level+0.5*window) image_property.SetColorWindow(255.0) image_property.SetColorLevel(127.5) Option #2: Apply window/level with vtkImageProperty: Remove vtkImageMapToColors from your pipeline (completely!) image_property.SetColorWindow(window) image_property.SetColorLevel(level) image_property.SetLookupTable(lut) # optional - David On Mon, Dec 17, 2012 at 2:48 PM, Jos? M. Rodriguez Bacallao wrote: > sorry, the attachment was a little big so I had to scale it down, here is > again: > > hello, while I was testing a dicom viewer I am developing I noticed > differences in window leveling from the pipeline I am using with respect to > one of the viewers I use as reference. I attached the snapshot, the left > window is my viewer and the right is one of my reference viewers. Both have > the same window/level: 1995/998, but the image displayed at left is darker > than right, here is part of the pipeline I use: > > vtk_image = image.vtk_image > self.view = vtk.QVTKWidget(self) > self.view.setFocusProxy(self) > # add the view to the internal layout > self.setUpdatesEnabled(False) > self.layout().takeAt(1) > self.layout().addWidget(self.view) > self.setUpdatesEnabled(True) > > # create the main interactor style > style = vtk.vtkInteractorStyleImage() > style.SetInteractionModeToImageSlicing() > > self.view.GetRenderWindow().GetInteractor().SetInteractorStyle(style) > > # the axial orientation > style.SetZViewRightVector((1, 0, 0)) > style.SetZViewUpVector((0, -1, 0)) > > # the sagital orientation > style.SetXViewRightVector((0, 1, 0)) > style.SetXViewUpVector((0, 0, 1)) > > # the coronal orientation > style.SetYViewRightVector((1, 0, 0)) > style.SetYViewUpVector((0, 0, 1)) > > image_mapper = vtk.vtkImageResliceMapper() > image_mapper.SliceFacesCameraOn() > image_mapper.SliceAtFocalPointOn() > image_mapper.JumpToNearestSliceOn() > image_mapper.BorderOff() > self.image_mapper = image_mapper > > format = image.image_format > if format in (vtkgdcm.VTK_LOOKUP_TABLE, > vtkgdcm.VTK_INVERSE_LUMINANCE): > lut = vtk_image.GetPointData().GetScalars().GetLookupTable() > > if isinstance(lut, vtkgdcm.vtkLookupTable16): > color_filter = vtkgdcm.vtkImageMapToColors16() > else: > color_filter = vtk.vtkImageMapToColors() > > color_filter.SetInputConnection(vtk_image.GetProducerPort()) > color_filter.SetLookupTable(lut) > > if format == vtkgdcm.VTK_LOOKUP_TABLE: > color_filter.SetOutputFormatToRGB() > elif format == vtkgdcm.VTK_INVERSE_LUMINANCE: > color_filter.SetOutputFormatToLuminance() > > color_filter.Update() > scalar_range = color_filter.GetOutput().GetScalarRange() > image_mapper.SetInputConnection(color_filter.GetOutputPort()) > del color_filter > elif format == vtkgdcm.VTK_YBR: > color_filter = vtkgdcm.vtkImageYBRToRGB() > color_filter.SetInputConnection(vtk_image.GetProducerPort()) > color_filter.Update() > scalar_range = color_filter.GetOutput().GetScalarRange() > image_mapper.SetInputConnection(color_filter.GetOutputPort()) > del color_filter > else: > scalar_range = vtk_image.GetScalarRange() > image_mapper.SetInput(vtk_image) > > try: > # here the window width will be: 1995 and window level: 998 > level = image.window_level[0] > window = image.window_width[0] > except KeyError, IndexError: > window = scalar_range[1] - scalar_range[0] > level = 0.5 * (scalar_range[1] + scalar_range[0]) > > image_property = vtk.vtkImageProperty() > image_property.SetColorWindow(window) > image_property.SetColorLevel(level) > image_property.SetAmbient(0.0) > image_property.SetDiffuse(1.0) > image_property.SetOpacity(1.0) > image_property.SetInterpolationTypeToLinear() > self.image_property = image_property > > image_actor = vtk.vtkImageSlice() > image_actor.SetMapper(image_mapper) > image_actor.SetProperty(image_property) > self.image_actor = image_actor > > image_renderer = vtk.vtkRenderer() > image_renderer.SetBackground(0, 0, 0) > self.image_renderer = image_renderer > image_renderer.AddViewProp(image_actor) > image_renderer.ResetCamera() > image_renderer.GetActiveCamera().ParallelProjectionOn() > self.render_window().AddRenderer(image_renderer) > > self.set_orientation('AXIAL') > self.render() From heiland at indiana.edu Mon Dec 17 18:38:00 2012 From: heiland at indiana.edu (Randy Heiland) Date: Mon, 17 Dec 2012 18:38:00 -0500 Subject: [vtkusers] magnify vtkChartXY image In-Reply-To: References: Message-ID: <1DF2338A-498B-433F-9A24-1BF849EFE874@indiana.edu> Sorry for the late reply - yes, I had tried it too and also got replicated charts. But thanks for the follow-up! On Dec 17, 2012, at 2:42 PM, Bill Lorensen wrote: > I just tried it also. For some reason it just replicates the chart. > > > > On Mon, Dec 17, 2012 at 1:42 PM, Gerrick Bivins > wrote: >> Just an FYI, >> I've tried to use that in the past and it didn't capture the render properly: >> http://vtk.1045678.n5.nabble.com/vtkRenderLargeImage-and-multiple-renders-td1240248.html >> >> I remember looking into it but I don't think I figured out what was wrong, something with multiple renderers was the issue for me I think. >> It may be fixed now because that was a couple of years and version of vtk ago >> Gerrick >> >> >> -----Original Message----- >> From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of Bill Lorensen >> Sent: Monday, December 17, 2012 11:19 AM >> To: Randy Heiland >> Cc: vtkusers at vtk.org >> Subject: Re: [vtkusers] magnify vtkChartXY image >> >> Randy, >> >> Have you tried vtkRenderLargeImage: >> http://vtk.org/Wiki/VTK/Examples/Cxx/Visualization/RenderLargeImage >> >> I have not tried it with a chart, but it's worth a shot. >> >> Regards, >> >> Bill >> >> On Fri, Dec 14, 2012 at 4:16 PM, Randy Heiland wrote: >>> Is there some way to magnify (or set the resolution of) a rendered chart, in order to generate a higher-res image from a Writer? e.g. I attempted the following simple Python script, which did indeed generate a magnified (x 2) .png image, but it was not what I expected. >>> >>> thanks, Randy >>> >>> from vtk import * >>> >>> table = vtkTable() >>> arrX = vtkFloatArray() >>> arrX.SetName("X") >>> table.AddColumn(arrX) >>> arrY = vtkFloatArray() >>> arrY.SetName("Y") >>> table.AddColumn(arrY) >>> >>> table.SetNumberOfRows(2) >>> table.SetValue(0, 0, 0.0) >>> table.SetValue(1, 0, 1.0) >>> table.SetValue(0, 1, 0.0) >>> table.SetValue(1, 1, 1.0) >>> >>> view = vtkContextView() >>> >>> chart = vtkChartXY() >>> view.GetScene().AddItem(chart) >>> line = chart.AddPlot(vtkChart.LINE) >>> line.SetInput(table, 0, 1) >>> >>> view.GetInteractor().Initialize() >>> view.GetRenderWindow().SetSize(200,200) >>> >>> imgFilter = vtkWindowToImageFilter() >>> imgFilter.SetInput(view.GetRenderWindow()) >>> imgFilter.SetMagnification(2) >>> >>> writer=vtkPNGWriter() >>> writer.SetFileName("chart.png") >>> writer.SetInputConnection(imgFilter.GetOutputPort()) >>> writer.Write() >>> >>> #view.GetInteractor().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 >>> >>> Follow this link to subscribe/unsubscribe: >>> http://www.vtk.org/mailman/listinfo/vtkusers >> >> >> >> -- >> Unpaid intern in BillsBasement at noware dot com _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://www.vtk.org/mailman/listinfo/vtkusers > > > > -- > Unpaid intern in BillsBasement at noware dot com From danimede at tiscali.it Tue Dec 18 07:54:50 2012 From: danimede at tiscali.it (danimede) Date: Tue, 18 Dec 2012 04:54:50 -0800 (PST) Subject: [vtkusers] degenerate cells transformation in vtkPolyDataNormals Message-ID: <1355835290656-5717647.post@n5.nabble.com> Hi All, I working with vtkPolyDataNormals with the aim to obtain a normal vector for each point in a points cloud (vtkPolyData). All works fine, but for my purpose I need to understand how vtkPolyDataNormals transforms degenerate cells (i.e point A is present in two triangular polygons: A-B-C and A-C-B... the same polygon!). Thanks in advance, Daniele -- View this message in context: http://vtk.1045678.n5.nabble.com/degenerate-cells-transformation-in-vtkPolyDataNormals-tp5717647.html Sent from the VTK - Users mailing list archive at Nabble.com. From jmrbcu at gmail.com Tue Dec 18 08:20:35 2012 From: jmrbcu at gmail.com (=?UTF-8?Q?Jos=C3=A9_M=2E_Rodriguez_Bacallao?=) Date: Tue, 18 Dec 2012 08:20:35 -0500 Subject: [vtkusers] differences in window/leveling (new, no so big, attachment) In-Reply-To: References: Message-ID: thanks david, I understand what you mean and this apply to tow path of the pipeline: format in (vtkgdcm.VTK_LOOKUP_TABLE, vtkgdcm.VTK_INVERSE_LUMINANCE) and format == vtkgdcm.VTK_YBR but the format of the image I am displaying is: VTK_LUMINANCE so, it goes for this path: else: scalar_range = vtk_image.GetScalarRange() image_mapper.SetInput(vtk_image) so, there is no vtkImageMapToColors involved, just the vtkImageProperty and the image is dark with this path any suggestions? also, when the image format type is VTK_LOOKUP_TABLE, if I only use vtkImageProperty and set the property lookup table to the lookup table of the image, the colors of the displayed image are wrong. On Mon, Dec 17, 2012 at 5:24 PM, David Gobbi wrote: > Your image is dark because you are applying the window/level > _after_ you have converted the image to RGB. After the image > is RGB, it has values in the range [0,255]. So of course if you > apply a window/level of 1995/998 to such an image, the result > is going to be very dark. > > To summarize: you can apply the window/level with > vtkImageMapToColors, or you can apply the window/level > with vtkImageProperty, but _not with both_. > > Two ways to fix: > > > Option #1: Apply window/level with vtkImageMapToColors > > lut.SetRange(level-0.5*window, level+0.5*window) > image_property.SetColorWindow(255.0) > image_property.SetColorLevel(127.5) > > > Option #2: Apply window/level with vtkImageProperty: > > Remove vtkImageMapToColors from your pipeline (completely!) > image_property.SetColorWindow(window) > image_property.SetColorLevel(level) > image_property.SetLookupTable(lut) # optional > > - David > > > On Mon, Dec 17, 2012 at 2:48 PM, Jos? M. Rodriguez Bacallao > wrote: > > sorry, the attachment was a little big so I had to scale it down, here is > > again: > > > > hello, while I was testing a dicom viewer I am developing I noticed > > differences in window leveling from the pipeline I am using with respect > to > > one of the viewers I use as reference. I attached the snapshot, the left > > window is my viewer and the right is one of my reference viewers. Both > have > > the same window/level: 1995/998, but the image displayed at left is > darker > > than right, here is part of the pipeline I use: > > > > vtk_image = image.vtk_image > > self.view = vtk.QVTKWidget(self) > > self.view.setFocusProxy(self) > > # add the view to the internal layout > > self.setUpdatesEnabled(False) > > self.layout().takeAt(1) > > self.layout().addWidget(self.view) > > self.setUpdatesEnabled(True) > > > > # create the main interactor style > > style = vtk.vtkInteractorStyleImage() > > style.SetInteractionModeToImageSlicing() > > > > self.view.GetRenderWindow().GetInteractor().SetInteractorStyle(style) > > > > # the axial orientation > > style.SetZViewRightVector((1, 0, 0)) > > style.SetZViewUpVector((0, -1, 0)) > > > > # the sagital orientation > > style.SetXViewRightVector((0, 1, 0)) > > style.SetXViewUpVector((0, 0, 1)) > > > > # the coronal orientation > > style.SetYViewRightVector((1, 0, 0)) > > style.SetYViewUpVector((0, 0, 1)) > > > > image_mapper = vtk.vtkImageResliceMapper() > > image_mapper.SliceFacesCameraOn() > > image_mapper.SliceAtFocalPointOn() > > image_mapper.JumpToNearestSliceOn() > > image_mapper.BorderOff() > > self.image_mapper = image_mapper > > > > format = image.image_format > > if format in (vtkgdcm.VTK_LOOKUP_TABLE, > > vtkgdcm.VTK_INVERSE_LUMINANCE): > > lut = vtk_image.GetPointData().GetScalars().GetLookupTable() > > > > if isinstance(lut, vtkgdcm.vtkLookupTable16): > > color_filter = vtkgdcm.vtkImageMapToColors16() > > else: > > color_filter = vtk.vtkImageMapToColors() > > > > color_filter.SetInputConnection(vtk_image.GetProducerPort()) > > color_filter.SetLookupTable(lut) > > > > if format == vtkgdcm.VTK_LOOKUP_TABLE: > > color_filter.SetOutputFormatToRGB() > > elif format == vtkgdcm.VTK_INVERSE_LUMINANCE: > > color_filter.SetOutputFormatToLuminance() > > > > color_filter.Update() > > scalar_range = color_filter.GetOutput().GetScalarRange() > > image_mapper.SetInputConnection(color_filter.GetOutputPort()) > > del color_filter > > elif format == vtkgdcm.VTK_YBR: > > color_filter = vtkgdcm.vtkImageYBRToRGB() > > color_filter.SetInputConnection(vtk_image.GetProducerPort()) > > color_filter.Update() > > scalar_range = color_filter.GetOutput().GetScalarRange() > > image_mapper.SetInputConnection(color_filter.GetOutputPort()) > > del color_filter > > else: > > scalar_range = vtk_image.GetScalarRange() > > image_mapper.SetInput(vtk_image) > > > > try: > > # here the window width will be: 1995 and window level: 998 > > level = image.window_level[0] > > window = image.window_width[0] > > except KeyError, IndexError: > > window = scalar_range[1] - scalar_range[0] > > level = 0.5 * (scalar_range[1] + scalar_range[0]) > > > > image_property = vtk.vtkImageProperty() > > image_property.SetColorWindow(window) > > image_property.SetColorLevel(level) > > image_property.SetAmbient(0.0) > > image_property.SetDiffuse(1.0) > > image_property.SetOpacity(1.0) > > image_property.SetInterpolationTypeToLinear() > > self.image_property = image_property > > > > image_actor = vtk.vtkImageSlice() > > image_actor.SetMapper(image_mapper) > > image_actor.SetProperty(image_property) > > self.image_actor = image_actor > > > > image_renderer = vtk.vtkRenderer() > > image_renderer.SetBackground(0, 0, 0) > > self.image_renderer = image_renderer > > image_renderer.AddViewProp(image_actor) > > image_renderer.ResetCamera() > > image_renderer.GetActiveCamera().ParallelProjectionOn() > > self.render_window().AddRenderer(image_renderer) > > > > self.set_orientation('AXIAL') > > self.render() > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Gerrick.Bivins at halliburton.com Tue Dec 18 08:40:18 2012 From: Gerrick.Bivins at halliburton.com (Gerrick Bivins) Date: Tue, 18 Dec 2012 13:40:18 +0000 Subject: [vtkusers] CompositeDataPipeline with vtkGradientFilter Message-ID: Hello, I'm having trouble debugging a pipeline that has a multiblockdataset as it's source. The dataset has a scalar pointdata set for which I'd like to compute the gradient of. The issue is, whenever I instantiate a vtkGradientFilter I receive the following: ERROR: In D:\dev\research\VTK\VTK5.10.1\Filtering\vtkExecutive.cxx, line 756 vtkCompositeDataPipeline (0000000000434DC0): Algorithm vtkGradientFilter(00000000249501D0) returned failure for request: vtkInformation (000000002652FD20) Debug: Off Modified Time: 58525 Reference Count: 1 Registered Events: (none) Request: REQUEST_DATA_OBJECT ALGORITHM_AFTER_FORWARD: 1 FORWARD_DIRECTION: 0 This is before using it, only trying to create it. Any ideas on what could be wrong? Here is my setup: vtkMultiBlockDataSet multiblockDataSet = vtkModel.getRoot(); String colorByScalar = "p"; vtkAssignAttribute scalarToCalculateGradient = new vtkAssignAttribute(); scalarToCalculateGradient.SetExecutive(executive); scalarToCalculateGradient.SetInputConnection(multiblockDataSet.GetProducerPort()); scalarToCalculateGradient.Assign(colorByScalar, 0, 0); scalarToCalculateGradient.DebugOn(); scalarToCalculateGradient.Update(); // the gradient vtkDataSetGradient gradient = new vtkDataSetGradient(); //error window pops up!!! Gerrick -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcus.hanwell at kitware.com Tue Dec 18 09:32:31 2012 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Tue, 18 Dec 2012 09:32:31 -0500 Subject: [vtkusers] magnify vtkChartXY image In-Reply-To: <1DF2338A-498B-433F-9A24-1BF849EFE874@indiana.edu> References: <1DF2338A-498B-433F-9A24-1BF849EFE874@indiana.edu> Message-ID: Let me double check how this is done in ParaView, I had been meaning to add a VTK test for this - I will add it to me todo. Marcus On Mon, Dec 17, 2012 at 6:38 PM, Randy Heiland wrote: > Sorry for the late reply - yes, I had tried it too and also got replicated charts. But thanks for the follow-up! > > On Dec 17, 2012, at 2:42 PM, Bill Lorensen wrote: > >> I just tried it also. For some reason it just replicates the chart. >> >> >> >> On Mon, Dec 17, 2012 at 1:42 PM, Gerrick Bivins >> wrote: >>> Just an FYI, >>> I've tried to use that in the past and it didn't capture the render properly: >>> http://vtk.1045678.n5.nabble.com/vtkRenderLargeImage-and-multiple-renders-td1240248.html >>> >>> I remember looking into it but I don't think I figured out what was wrong, something with multiple renderers was the issue for me I think. >>> It may be fixed now because that was a couple of years and version of vtk ago >>> Gerrick >>> >>> >>> -----Original Message----- >>> From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of Bill Lorensen >>> Sent: Monday, December 17, 2012 11:19 AM >>> To: Randy Heiland >>> Cc: vtkusers at vtk.org >>> Subject: Re: [vtkusers] magnify vtkChartXY image >>> >>> Randy, >>> >>> Have you tried vtkRenderLargeImage: >>> http://vtk.org/Wiki/VTK/Examples/Cxx/Visualization/RenderLargeImage >>> >>> I have not tried it with a chart, but it's worth a shot. >>> >>> Regards, >>> >>> Bill >>> >>> On Fri, Dec 14, 2012 at 4:16 PM, Randy Heiland wrote: >>>> Is there some way to magnify (or set the resolution of) a rendered chart, in order to generate a higher-res image from a Writer? e.g. I attempted the following simple Python script, which did indeed generate a magnified (x 2) .png image, but it was not what I expected. >>>> >>>> thanks, Randy >>>> >>>> from vtk import * >>>> >>>> table = vtkTable() >>>> arrX = vtkFloatArray() >>>> arrX.SetName("X") >>>> table.AddColumn(arrX) >>>> arrY = vtkFloatArray() >>>> arrY.SetName("Y") >>>> table.AddColumn(arrY) >>>> >>>> table.SetNumberOfRows(2) >>>> table.SetValue(0, 0, 0.0) >>>> table.SetValue(1, 0, 1.0) >>>> table.SetValue(0, 1, 0.0) >>>> table.SetValue(1, 1, 1.0) >>>> >>>> view = vtkContextView() >>>> >>>> chart = vtkChartXY() >>>> view.GetScene().AddItem(chart) >>>> line = chart.AddPlot(vtkChart.LINE) >>>> line.SetInput(table, 0, 1) >>>> >>>> view.GetInteractor().Initialize() >>>> view.GetRenderWindow().SetSize(200,200) >>>> >>>> imgFilter = vtkWindowToImageFilter() >>>> imgFilter.SetInput(view.GetRenderWindow()) >>>> imgFilter.SetMagnification(2) >>>> >>>> writer=vtkPNGWriter() >>>> writer.SetFileName("chart.png") >>>> writer.SetInputConnection(imgFilter.GetOutputPort()) >>>> writer.Write() >>>> >>>> #view.GetInteractor().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 >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://www.vtk.org/mailman/listinfo/vtkusers >>> >>> >>> >>> -- >>> Unpaid intern in BillsBasement at noware dot com _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Follow this link to subscribe/unsubscribe: >>> http://www.vtk.org/mailman/listinfo/vtkusers >> >> >> >> -- >> Unpaid intern in BillsBasement at noware dot com > From jcplatt at dsl.pipex.com Tue Dec 18 13:07:20 2012 From: jcplatt at dsl.pipex.com (John Platt) Date: Tue, 18 Dec 2012 18:07:20 -0000 Subject: [vtkusers] vtkChart - difficulty changing title colour and font size Message-ID: <51DAA08410844BF9B0685DEA504177A9@pafec5> Hi, I'm having trouble changing the text colour and font size of the chart & axes titles. They will change when bold or italic is toggled and also after a lot of zooming in the chart. Maybe there is some issue with caching. Has anybody else had problems? VTK 5.8.0, Qt 4.6.2, Win XP, VS 2008 Thanks, John. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcplatt at dsl.pipex.com Tue Dec 18 16:12:02 2012 From: jcplatt at dsl.pipex.com (John Platt) Date: Tue, 18 Dec 2012 21:12:02 -0000 Subject: [vtkusers] vtkChart - difficulty changing title colour and font size References: <51DAA08410844BF9B0685DEA504177A9@pafec5> Message-ID: <410A622765E547F28A324ACD63C839A7@pafec5> Hi Arnaud, Thanks for your suggestion but it does not change the behaviour. Here is my code for changing the chart title colour ... vtkTextProperty* txtProp = myChart->GetTitleProperties(); txtProp->SetColor( r, g, b ); myChart->GetScene()->SetDirty( true ); Thanks for your help. John. ----- Original Message ----- From: Arnaud BARRE To: John Platt Sent: Tuesday, December 18, 2012 6:19 PM Subject: Re: [vtkusers] vtkChart - difficulty changing title colour and font size How do you modify these properties? You can use the method vtkScene::SetDirty. For example chart->GetScene()->SetDirty(true); This should update your modifications in the next rendering. Arnaud On Tue, Dec 18, 2012 at 7:07 PM, John Platt wrote: Hi, I'm having trouble changing the text colour and font size of the chart & axes titles. They will change when bold or italic is toggled and also after a lot of zooming in the chart. Maybe there is some issue with caching. Has anybody else had problems? VTK 5.8.0, Qt 4.6.2, Win XP, VS 2008 Thanks, John. _______________________________________________ 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://www.vtk.org/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From arnaud.barre at gmail.com Tue Dec 18 16:46:01 2012 From: arnaud.barre at gmail.com (Arnaud BARRE) Date: Tue, 18 Dec 2012 22:46:01 +0100 Subject: [vtkusers] vtkChart - difficulty changing title colour and font size In-Reply-To: <410A622765E547F28A324ACD63C839A7@pafec5> References: <51DAA08410844BF9B0685DEA504177A9@pafec5> <410A622765E547F28A324ACD63C839A7@pafec5> Message-ID: Hi John, You may need to set the chart as modified: myChart->Modified(); It this doesn't work, could you write a minimal example to able to replicate your problem? Arnaud On Tue, Dec 18, 2012 at 10:12 PM, John Platt wrote: > ** > Hi Arnaud, > > Thanks for your suggestion but it does not change the behaviour. > Here is my code for changing the chart title colour ... > > vtkTextProperty* txtProp = myChart->GetTitleProperties(); > txtProp->SetColor( r, g, b ); > myChart->GetScene()->SetDirty( true ); > > Thanks for your help. > > John. > > ----- Original Message ----- > > *From:* Arnaud BARRE > *To:* John Platt > *Sent:* Tuesday, December 18, 2012 6:19 PM > *Subject:* Re: [vtkusers] vtkChart - difficulty changing title colour and > font size > > How do you modify these properties? You can use the method > vtkScene::SetDirty. For example chart->GetScene()->SetDirty(true); This > should update your modifications in the next rendering. > > Arnaud > > > On Tue, Dec 18, 2012 at 7:07 PM, John Platt wrote: > >> ** >> Hi, >> >> I'm having trouble changing the text colour and font size of the chart & >> axes titles. They will change when bold or italic is toggled and also after >> a lot of zooming in the chart. Maybe there is some issue with caching. Has >> anybody else had problems? >> >> VTK 5.8.0, Qt 4.6.2, Win XP, VS 2008 >> >> Thanks, >> >> John. >> >> _______________________________________________ >> 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://www.vtk.org/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://www.vtk.org/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcplatt at dsl.pipex.com Tue Dec 18 18:00:55 2012 From: jcplatt at dsl.pipex.com (John Platt) Date: Tue, 18 Dec 2012 23:00:55 -0000 Subject: [vtkusers] vtkChart - difficulty changing title colour and font size References: <51DAA08410844BF9B0685DEA504177A9@pafec5><410A622765E547F28A324ACD63C839A7@pafec5> Message-ID: <1F218D62A9704F4295546384F4247FC9@pafec5> Hi Arnaud, Unfortunately this has no effect either. I looked into the code and vtkOpenGLContextDevice2D::DrawString() searches a cache for previously rendered strings (I think). The key for the search is composed of an Id created by vtkFreeTypeTools::MapTextPropertyToId() plus the string. The Id does not use the text colour (just family, bold, italic & angle). So it keeps finding the old string. Thanks for your help. John. ----- Original Message ----- From: Arnaud BARRE To: John Platt Cc: vtkusers Sent: Tuesday, December 18, 2012 9:46 PM Subject: Re: [vtkusers] vtkChart - difficulty changing title colour and font size Hi John, You may need to set the chart as modified: myChart->Modified(); It this doesn't work, could you write a minimal example to able to replicate your problem? Arnaud On Tue, Dec 18, 2012 at 10:12 PM, John Platt wrote: Hi Arnaud, Thanks for your suggestion but it does not change the behaviour. Here is my code for changing the chart title colour ... vtkTextProperty* txtProp = myChart->GetTitleProperties(); txtProp->SetColor( r, g, b ); myChart->GetScene()->SetDirty( true ); Thanks for your help. John. ----- Original Message ----- From: Arnaud BARRE To: John Platt Sent: Tuesday, December 18, 2012 6:19 PM Subject: Re: [vtkusers] vtkChart - difficulty changing title colour and font size How do you modify these properties? You can use the method vtkScene::SetDirty. For example chart->GetScene()->SetDirty(true); This should update your modifications in the next rendering. Arnaud On Tue, Dec 18, 2012 at 7:07 PM, John Platt wrote: Hi, I'm having trouble changing the text colour and font size of the chart & axes titles. They will change when bold or italic is toggled and also after a lot of zooming in the chart. Maybe there is some issue with caching. Has anybody else had problems? VTK 5.8.0, Qt 4.6.2, Win XP, VS 2008 Thanks, John. _______________________________________________ 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://www.vtk.org/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://www.vtk.org/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcus.hanwell at kitware.com Tue Dec 18 21:33:54 2012 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Tue, 18 Dec 2012 21:33:54 -0500 Subject: [vtkusers] vtkChart - difficulty changing title colour and font size In-Reply-To: <1F218D62A9704F4295546384F4247FC9@pafec5> References: <51DAA08410844BF9B0685DEA504177A9@pafec5> <410A622765E547F28A324ACD63C839A7@pafec5> <1F218D62A9704F4295546384F4247FC9@pafec5> Message-ID: On Tue, Dec 18, 2012 at 6:00 PM, John Platt wrote: > Hi Arnaud, > > Unfortunately this has no effect either. I looked into the code and > > vtkOpenGLContextDevice2D::DrawString() > > searches a cache for previously rendered strings (I think). The key for the > search is composed of an Id created by > > vtkFreeTypeTools::MapTextPropertyToId() > > plus the string. The Id does not use the text colour (just family, bold, > italic & angle). So it keeps finding the old string. > This is a bug I fixed quite some time ago - I think if you upgrade to VTK 5.10 the fix is present, and master, along with a new test to verify functionality. I don't think the fix was ever backported to VTK 5.8. Marcus From ilan.tal at gmail.com Wed Dec 19 03:26:18 2012 From: ilan.tal at gmail.com (Ilan) Date: Wed, 19 Dec 2012 00:26:18 -0800 (PST) Subject: [vtkusers] wrap java on Mac Air Message-ID: <1355905578648-5717659.post@n5.nabble.com> I have a Mac Air OSX 10.8.2 with Xcode 4.5.2 which I am trying to wrap VTK so I can use it within a Java program. This works on both Linux and Windows and I want to extend it to the Mac. I use CMake 2.8.9 to Configure and Generate. I get the message that Filter ZLIB is ON which I assume is perfectly OK. Then I use Xcode on VTK.xcodeproj which tries to compile the project. I get errors like Run custom shell script 'CMake PostBuild Rules' where CMakeScripts/vtkWrapJava_postBuildPhase.makeDebug doesn't exist. This is indeed correct, so such file by that name exists. So how do I get around the problem? How do I tell it that I don't want a post build? Another problem: can anyone tell me where I should expect to see the compiled files? Clearly within vtkBuild, but what subdirectory? Thanks, Ilan -- View this message in context: http://vtk.1045678.n5.nabble.com/wrap-java-on-Mac-Air-tp5717659.html Sent from the VTK - Users mailing list archive at Nabble.com. From goodwin.lawlor.lists at gmail.com Wed Dec 19 04:04:37 2012 From: goodwin.lawlor.lists at gmail.com (Goodwin Lawlor) Date: Wed, 19 Dec 2012 13:04:37 +0400 Subject: [vtkusers] Bug in vtkStripper on a very simple case ? In-Reply-To: References: <50C4E39B.9030400@gmail.com> <50C4F0C5.8000800@gmail.com> <50C4F67D.4090205@gmail.com> <50C50738.4030109@gmail.com> Message-ID: I think vtkStripper was originally written to quickly produce vtkTriangleStrip/vtkPolyLine primitives that would render faster, not a computational geometry type class that would produce the longest possible polylines... it is a visualization library after all. The seed point is arbitrary so you may not get the outcome you were looking for. See this 2002 post, that contains a patch which may help: http://vtk.org/pipermail/vtkusers/2002-January/009372.html There was a bug report too: http://www.vtk.org/Bug/print_bug_page.php?bug_id=832 hth Goodwin On Mon, Dec 10, 2012 at 2:51 AM, David Gobbi wrote: > Insert vtkTriangleFilter before vtkStripper. This will break any > input polylines into line segments. I don't know if it will help, > but it might. > > - David > > On Sun, Dec 9, 2012 at 2:48 PM, pof wrote: > > yes this is the way LINES objects are written on vtk files. > > Ok, so I understand now the point you were making about the "T", which > was > > uncorrect. > > > > So back to the problem, why this vtkStripper is not able to merge those 2 > > lines? > > > > Le 09/12/2012 21:41, David Gobbi a ?crit : > >> > >> Is it? Maybe it is. When you wrote the numbers, I assumed that > >> > >> all of the numbers that you listed were just point indices. > >> > >> > >> On Sun, Dec 9, 2012 at 1:37 PM, pof wrote: > >>> > >>> Hum I see. > >>> (from what I understand), the first integer of each line is simply the > >>> number of points of the corresponding LINE > >>> > >>> Le 09/12/2012 21:33, David Gobbi a ?crit : > >>> > >>>> Then where would the "9" go? > >>>> > >>>> The stripper uses a simple algorithm, it just chooses a starting > >>>> point, goes as far as it can in each direction to create the first > >>>> polyline, and then repeats this procedure until all the line segments > >>>> are accounted for. It doesn't exhaustively search though all > >>>> permutations to see which one gives the smallest number of output > >>>> polylines... that would cause the algorithm to run many times slower. > >>>> > >>>> > >>>> > >>>> > >>>> On Sun, Dec 9, 2012 at 1:12 PM, pof wrote: > >>>>> > >>>>> Hi David > >>>>> > >>>>> the first polyline being: > >>>>> > >>>>> 9 0 1 2 3 4 5 19 6 7 > >>>>> and the third polyline (actually it is a segment) being: > >>>>> 2 18 0 > >>>>> I don't see why they shoud not merge together as (unless I > >>>>> misunderstand > >>>>> something): > >>>>> 10 18 0 1 2 3 4 5 19 6 7 > >>>>> > >>>>> Am I wrong? > >>>>> > >>>>> > >>>>> Le 09/12/2012 21:05, David Gobbi a ?crit : > >>>>> > >>>>>> Hi JD, > >>>>>> > >>>>>> It could only merge those two lines if it joined them with a "T". > >>>>>> A polyline cannot have any branches. > >>>>>> > >>>>>> - David > >>>>>> > >>>>>> > >>>>>> On Sun, Dec 9, 2012 at 12:16 PM, pof wrote: > >>>>>>> > >>>>>>> Hi all, > >>>>>>> > >>>>>>> I get a strange result (which may be a bug) using vtk stripper, > i.e. > >>>>>>> it > >>>>>>> does > >>>>>>> not merge LINES as polylines as it is expected to. > >>>>>>> In this example (see below an extract of the polydata produced by > >>>>>>> vtkStripper), only 2 polylines should be obtained, but vtkStripper > >>>>>>> forgot > >>>>>>> to > >>>>>>> merge the first and the third line together, though they obviously > >>>>>>> share > >>>>>>> point with Id=0 (btw, the fact that only Id 0 remains unmerged > might > >>>>>>> not > >>>>>>> be > >>>>>>> pure luck). > >>>>>>> > >>>>>>> LINES 3 24 > >>>>>>> 9 0 1 2 3 4 5 19 6 7 > >>>>>>> 10 9 8 17 13 12 15 14 11 10 16 > >>>>>>> 2 18 0 > >>>>>>> Does anybody have an idea or an explanation? > >>>>>>> Thanks > >>>>>>> JD > >>>>>>> > >>>>>>> PS: Here below is the complete source file that generates these > data > >>>>>>> and > >>>>>>> in > >>>>>>> which vtkStripper is used. > >>>>>>> > >>>>>>> ////////////////////////////////////////////////////// > >>>>>>> // Example modified from IntersectionPolyDataFilter.cxx > >>>>>>> ////////////////////////////////////////////////////// > >>>>>>> #include > >>>>>>> #include > >>>>>>> #include > >>>>>>> #include > >>>>>>> #include > >>>>>>> #include > >>>>>>> #include > >>>>>>> #include > >>>>>>> #include > >>>>>>> #include > >>>>>>> #include > >>>>>>> #include > >>>>>>> > >>>>>>> int main(int argc, char *argv[]) > >>>>>>> { > >>>>>>> vtkSmartPointer sphereSource1 = > >>>>>>> vtkSmartPointer::New(); > >>>>>>> sphereSource1->SetCenter(0.0, 0.0, 0.0); > >>>>>>> sphereSource1->SetRadius(2.0f); > >>>>>>> sphereSource1->SetPhiResolution(20); > >>>>>>> sphereSource1->SetThetaResolution(20); > >>>>>>> sphereSource1->Update(); > >>>>>>> vtkSmartPointer sphere1Mapper = > >>>>>>> vtkSmartPointer::New(); > >>>>>>> sphere1Mapper->SetInputConnection( > >>>>>>> sphereSource1->GetOutputPort() > >>>>>>> ); > >>>>>>> sphere1Mapper->ScalarVisibilityOff(); > >>>>>>> vtkSmartPointer sphere1Actor = > >>>>>>> vtkSmartPointer::New(); > >>>>>>> sphere1Actor->SetMapper( sphere1Mapper ); > >>>>>>> sphere1Actor->GetProperty()->SetOpacity(.3); > >>>>>>> sphere1Actor->GetProperty()->SetColor(1,0,0); > >>>>>>> > >>>>>>> ///////////////////////// > >>>>>>> // BEGIN MODIFICATIONS // > >>>>>>> ///////////////////////// > >>>>>>> // Create a planar object > >>>>>>> // Define 4 vertices > >>>>>>> vtkSmartPointer PlanePoints = > >>>>>>> vtkSmartPointer::New(); > >>>>>>> vtkSmartPointer PlaneCells = > >>>>>>> vtkSmartPointer::New(); > >>>>>>> PlanePoints->InsertNextPoint(-3, -1, 0); > >>>>>>> PlanePoints->InsertNextPoint(3, -1, 0); > >>>>>>> PlanePoints->InsertNextPoint(-3, 1, 0); > >>>>>>> PlanePoints->InsertNextPoint(3, 1, 0); > >>>>>>> // Create 2 trianglar faces > >>>>>>> PlaneCells->InsertNextCell(3); > >>>>>>> PlaneCells->InsertCellPoint(0); > >>>>>>> PlaneCells->InsertCellPoint(1); > >>>>>>> PlaneCells->InsertCellPoint(2); > >>>>>>> PlaneCells->InsertNextCell(3); > >>>>>>> PlaneCells->InsertCellPoint(1); > >>>>>>> PlaneCells->InsertCellPoint(3); > >>>>>>> PlaneCells->InsertCellPoint(2); > >>>>>>> // Create the polydata from points and faces > >>>>>>> vtkSmartPointer ProtectionWall = > >>>>>>> vtkSmartPointer::New(); > >>>>>>> ProtectionWall->SetPoints(PlanePoints); > >>>>>>> ProtectionWall->SetPolys(PlaneCells); > >>>>>>> ///////////////////////// > >>>>>>> // END MODIFICATIONS // > >>>>>>> ///////////////////////// > >>>>>>> > >>>>>>> vtkSmartPointer planeMapper = > >>>>>>> vtkSmartPointer::New(); > >>>>>>> planeMapper->SetInputConnection( > >>>>>>> ProtectionWall->GetProducerPort() > >>>>>>> ); > >>>>>>> planeMapper->ScalarVisibilityOff(); > >>>>>>> > >>>>>>> vtkSmartPointer planeActor = > >>>>>>> vtkSmartPointer::New(); > >>>>>>> planeActor->SetMapper( planeMapper ); > >>>>>>> planeActor->GetProperty()->SetOpacity(.3); > >>>>>>> planeActor->GetProperty()->SetColor(0,1,0); > >>>>>>> > >>>>>>> // Get intersection segments (LINES) using the > >>>>>>> vtkIntersectionPolyDataFilter > >>>>>>> vtkSmartPointer > >>>>>>> intersectionPolyDataFilter > >>>>>>> = vtkSmartPointer::New(); > >>>>>>> intersectionPolyDataFilter->SplitFirstOutputOff(); > >>>>>>> intersectionPolyDataFilter->SplitSecondOutputOff(); > >>>>>>> intersectionPolyDataFilter->SetInputConnection( 0, > >>>>>>> sphereSource1->GetOutputPort() ); > >>>>>>> intersectionPolyDataFilter->SetInputConnection( 1, > >>>>>>> ProtectionWall->GetProducerPort() ); > >>>>>>> intersectionPolyDataFilter->Update(); > >>>>>>> > >>>>>>> ///////////////////////// > >>>>>>> // BEGIN MODIFICATIONS // > >>>>>>> ///////////////////////// > >>>>>>> // Try to get the polylines (there should be 2) from the > >>>>>>> segments > >>>>>>> (LINES) > >>>>>>> vtkSmartPointer stripper = > >>>>>>> vtkSmartPointer::New(); > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> > stripper->SetInputConnection(intersectionPolyDataFilter->GetOutputPort()); > >>>>>>> stripper->Update(); > >>>>>>> // Save resulting polydata on a file, in which we see that > there > >>>>>>> are 3 > >>>>>>> polylines (actually the second polyline is ok, > >>>>>>> // but the first and third polylines should have been further > >>>>>>> merged > >>>>>>> vtkSmartPointer wr = > >>>>>>> vtkSmartPointer::New(); > >>>>>>> wr->SetFileName("polylines.txt"); > >>>>>>> wr->SetInputConnection(stripper->GetOutputPort()); > >>>>>>> wr->Write(); > >>>>>>> /////////////////////// > >>>>>>> // END MODIFICATIONS // > >>>>>>> /////////////////////// > >>>>>>> > >>>>>>> vtkSmartPointer intersectionMapper = > >>>>>>> vtkSmartPointer::New(); > >>>>>>> intersectionMapper->SetInputConnection( > >>>>>>> stripper->GetOutputPort() > >>>>>>> ); > >>>>>>> intersectionMapper->ScalarVisibilityOff(); > >>>>>>> > >>>>>>> vtkSmartPointer intersectionActor = > >>>>>>> vtkSmartPointer::New(); > >>>>>>> intersectionActor->SetMapper( intersectionMapper ); > >>>>>>> > >>>>>>> vtkSmartPointer renderer = > >>>>>>> vtkSmartPointer::New(); > >>>>>>> renderer->AddViewProp(sphere1Actor); > >>>>>>> renderer->AddViewProp(planeActor); > >>>>>>> renderer->AddViewProp(intersectionActor); > >>>>>>> > >>>>>>> vtkSmartPointer renderWindow = > >>>>>>> vtkSmartPointer::New(); > >>>>>>> renderWindow->AddRenderer( renderer ); > >>>>>>> > >>>>>>> vtkSmartPointer renWinInteractor = > >>>>>>> vtkSmartPointer::New(); > >>>>>>> renWinInteractor->SetRenderWindow( renderWindow ); > >>>>>>> > >>>>>>> renderWindow->Render(); > >>>>>>> renderWindow->SetSize(600, 600); > >>>>>>> renderer->SetBackground(0.1, 0.2, 0.4); > >>>>>>> renWinInteractor->Start(); > >>>>>>> > >>>>>>> return EXIT_SUCCESS; > >>>>>>> } > >>>>> > >>>>> > > > _______________________________________________ > 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://www.vtk.org/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.jourdain at kitware.com Wed Dec 19 05:13:44 2012 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Wed, 19 Dec 2012 05:13:44 -0500 Subject: [vtkusers] wrap java on Mac Air In-Reply-To: <1355905578648-5717659.post@n5.nabble.com> References: <1355905578648-5717659.post@n5.nabble.com> Message-ID: Could you try to build vtk with "make" ? I managed to build everything on my Mac lately, but I never use Xcode. Seb On Wed, Dec 19, 2012 at 3:26 AM, Ilan wrote: > I have a Mac Air OSX 10.8.2 with Xcode 4.5.2 which I am trying to wrap VTK > so > I can use it within a Java program. This works on both Linux and Windows > and > I want to extend it to the Mac. > I use CMake 2.8.9 to Configure and Generate. I get the message that Filter > ZLIB is ON which I assume is perfectly OK. Then I use Xcode on > VTK.xcodeproj > which tries to compile the project. I get errors like > Run custom shell script 'CMake PostBuild Rules' where > CMakeScripts/vtkWrapJava_postBuildPhase.makeDebug doesn't exist. > This is indeed correct, so such file by that name exists. So how do I get > around the problem? How do I tell it that I don't want a post build? > Another problem: can anyone tell me where I should expect to see the > compiled files? Clearly within vtkBuild, but what subdirectory? > > Thanks, > Ilan > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/wrap-java-on-Mac-Air-tp5717659.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://www.vtk.org/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ilan.tal at gmail.com Wed Dec 19 05:39:18 2012 From: ilan.tal at gmail.com (Ilan) Date: Wed, 19 Dec 2012 02:39:18 -0800 (PST) Subject: [vtkusers] wrap java on Mac Air In-Reply-To: References: <1355905578648-5717659.post@n5.nabble.com> Message-ID: <1355913558456-5717662.post@n5.nabble.com> Hi Seb, Thanks for the reply. I'm not a Mac expert. I am using CMake 2.8.9. What exactly do I need to do in order to make vtk without using xcode? Is there a make which replaces CMake? Thanks, Ilan -- View this message in context: http://vtk.1045678.n5.nabble.com/wrap-java-on-Mac-Air-tp5717659p5717662.html Sent from the VTK - Users mailing list archive at Nabble.com. From sebastien.jourdain at kitware.com Wed Dec 19 07:50:51 2012 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Wed, 19 Dec 2012 07:50:51 -0500 Subject: [vtkusers] wrap java on Mac Air In-Reply-To: <1355913558456-5717662.post@n5.nabble.com> References: <1355905578648-5717659.post@n5.nabble.com> <1355913558456-5717662.post@n5.nabble.com> Message-ID: $ mkdir vtk $ cd vtk $ git clone http://vtk.org:VTK.git src $ mkdir build install $ cd build $ ccmake ../src BUILD_DOCUMENTATION OFF BUILD_EXAMPLES OFF BUILD_SHARED_LIBS ON BUILD_TESTING OFF CMAKE_BUILD_TYPE Release CMAKE_INSTALL_PREFIX /.../vtk/install VTK_Group_Imaging OFF VTK_Group_MPI OFF VTK_Group_Qt OFF VTK_Group_Rendering ON VTK_Group_StandAlone ON VTK_Group_Tk OFF VTK_Group_Views OFF VTK_WRAP_JAVA ON VTK_WRAP_PYTHON OFF VTK_WRAP_TCL OFF hit keys [c] [c] [g] $ make $ make install On Wed, Dec 19, 2012 at 5:39 AM, Ilan wrote: > Hi Seb, > Thanks for the reply. I'm not a Mac expert. I am using CMake 2.8.9. What > exactly do I need to do in order to make vtk without using xcode? Is there > a > make which replaces CMake? > > Thanks, > Ilan > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/wrap-java-on-Mac-Air-tp5717659p5717662.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://www.vtk.org/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan.irvin at gmail.com Wed Dec 19 08:41:58 2012 From: ryan.irvin at gmail.com (Ryan Irvin) Date: Wed, 19 Dec 2012 06:41:58 -0700 Subject: [vtkusers] Elliptical Cylinder Cutter Message-ID: I've got a model setup where I use a vtkCylinder as a cutter on the output of a vtkContourFilter to form a surface with a circular aperture. I would like to extend the aperture shape to be generally elliptical rather than just circular. Can anyone recommend an efficient way of setting this up? Thanks, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: From juk124 at psu.edu Wed Dec 19 08:28:16 2012 From: juk124 at psu.edu (Josh) Date: Wed, 19 Dec 2012 08:28:16 -0500 Subject: [vtkusers] Python wrapping on Scientific Linux 6.3 Message-ID: <50D1C0F0.9050105@psu.edu> Hi VTK Users, Has anyone been able to get VTK built with Python wrappings using SIP on Scientific Linux 6.3? Whenever I start up either Python or vtkpython and try "import vtk", I get a segmentation fault and Python shuts down. My TCL wrapping seems to work fine as I am able to run the TCL scripts included with VTK. Also, I've successfully built VTK before under Ubuntu and have gotten the Python SIP wrappings to work just fine. Any advice would be much appreciated. Thanks! Josh From sean at rogue-research.com Wed Dec 19 11:10:21 2012 From: sean at rogue-research.com (Sean McBride) Date: Wed, 19 Dec 2012 11:10:21 -0500 Subject: [vtkusers] wrap java on Mac Air In-Reply-To: <1355913558456-5717662.post@n5.nabble.com> References: <1355905578648-5717659.post@n5.nabble.com> <1355913558456-5717662.post@n5.nabble.com> Message-ID: <20121219161021.189742522@mail.rogue-research.com> On Wed, 19 Dec 2012 02:39:18 -0800, Ilan said: >Thanks for the reply. I'm not a Mac expert. I am using CMake 2.8.9. You really should install CMake 2.8.10.2 (the newest), it contains important fixes for recent Xcodes. >What >exactly do I need to do in order to make vtk without using xcode? Is there a >make which replaces CMake? These days, Xcode.app is a standalone application that does not install command line tools in the usual places that are present in your PATH. But you can install the command line tools from Xcode's preferences or a separate install: 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 mlokida at yahoo.fr Wed Dec 19 11:15:20 2012 From: mlokida at yahoo.fr (R M) Date: Wed, 19 Dec 2012 16:15:20 +0000 (GMT) Subject: [vtkusers] vtkOBJExporter, vtkVRMLExporter and vtkPolyDataWriter problem Message-ID: <1355933720.69160.YahooMailNeo@web172204.mail.ir2.yahoo.com> Hi, I use vtk 5.8 with Linux Centos 6. My problem is when I use vtkOBJExporter, vtkVRMLExporter and vtkPolyDataWriter, files are created but I can't open them anymore. It seems that I have a probem with the format.? I have ","? instead of "." as numbers separators. So, I have change the locals of my system.? It only works for the vtk output but I have still problems with obj and wrl that I have exported. I have this message: I can't open them anymore with my application. I have a reading error (Error reading ascii data. Possible mismatch of datasize with declaration.) Any idea in order to save and open them correctly ? Thanks ! -------------- next part -------------- An HTML attachment was scrubbed... URL: From msotaquira at gmail.com Wed Dec 19 11:58:46 2012 From: msotaquira at gmail.com (Miguel Sotaquira) Date: Wed, 19 Dec 2012 17:58:46 +0100 Subject: [vtkusers] Cut open surface with a polyline Message-ID: Hi everyone, I have a 3D open surface represented as an instance of vtkPolyData (see this figure: http://tinypic.com/r/2gtu5wg/6). What I want to do is to cut it in two parts, by manually tracing a line on the rendered mesh. Up to now I've managed to manually trace such line (green line the figure), and thus I know the set of mesh points/edges (a polyline) that belong to the path. However, I don't know which VTK class can I use for cutting this mesh. I've considered using vtkSelectPolyData or vtkImplicitSelectionLoop but in both cases I need a closed loop to perform the cutting (and in my case I have a polyline). I actually don't need to establish the cells/points inside the loop, instead I need to determine the cells/points on each side of the traced line. Thanks for any suggestions! Miguel -------------- next part -------------- An HTML attachment was scrubbed... URL: From joachim.pouderoux at kitware.com Wed Dec 19 12:01:20 2012 From: joachim.pouderoux at kitware.com (Joachim Pouderoux) Date: Wed, 19 Dec 2012 18:01:20 +0100 Subject: [vtkusers] vtkOBJExporter, vtkVRMLExporter and vtkPolyDataWriter problem In-Reply-To: <1355933720.69160.YahooMailNeo@web172204.mail.ir2.yahoo.com> References: <1355933720.69160.YahooMailNeo@web172204.mail.ir2.yahoo.com> Message-ID: Hi Mickael, This is a "classical" locale issue with french configurations. Try to add setlocale(LC_ALL, "C"); or std::setlocale(LC_ALL, "C"); in the first line of your main function. Joachim 2012/12/19 R M > Hi, > > I use vtk 5.8 with Linux Centos 6. > My problem is when I use vtkOBJExporter, vtkVRMLExporter and > vtkPolyDataWriter, files are created but I can't open them anymore. > It seems that I have a probem with the format. I have "," instead of "." > as numbers separators. > So, I have change the locals of my system. It only works for the vtk > output but I have still problems with obj and wrl that I have exported. > I have this message: > > I can't open them anymore with my application. I have a reading error (Error > reading ascii data. Possible mismatch of datasize with declaration.) > > Any idea in order to save and open them correctly ? > > Thanks ! > > > _______________________________________________ > 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://www.vtk.org/mailman/listinfo/vtkusers > > -- *Joachim Pouderoux* *PhD, R&D Enginee*r *Kitware SAS * -------------- next part -------------- An HTML attachment was scrubbed... URL: From jd379252 at gmail.com Wed Dec 19 15:42:17 2012 From: jd379252 at gmail.com (pof) Date: Wed, 19 Dec 2012 21:42:17 +0100 Subject: [vtkusers] Bug in vtkStripper on a very simple case ? In-Reply-To: References: <50C4E39B.9030400@gmail.com> <50C4F0C5.8000800@gmail.com> <50C4F67D.4090205@gmail.com> <50C50738.4030109@gmail.com> Message-ID: <50D226A9.5050409@gmail.com> Goodwin, I tested the patch on the following simple case (5 segments) # vtk DataFile Version 3.0 vtk output ASCII DATASET POLYDATA POINTS 6 float 1.7 0.5 0 2 0 0 1.7 -0.5 0 1.6 -1 0 1.8 -0.2 0 1.6 1 0 LINES 5 15 2 0 1 2 2 3 2 4 2 2 1 4 2 5 0 without the patch, 2 polylines are obtained from the vtkStripper LINES 2 9 5 0 1 4 2 3 2 5 0 whereas with the patch a single polyline is obained LINES 1 8 7 5 0 0 1 4 2 3 Things are of course better, though a duplicate of one point (point 0 in this case) is obtained, which should obviously have been avoided. So it looks there's stil some space to improve the patch. In any case, I thank you for sharing this information with me. JD Le 19/12/2012 10:04, Goodwin Lawlor a ?crit : > I think vtkStripper was originally written to quickly produce > vtkTriangleStrip/vtkPolyLine primitives that would render faster, not > a computational geometry type class that would produce the longest > possible polylines... it is a visualization library after all. > > The seed point is arbitrary so you may not get the outcome you were > looking for. > > See this 2002 post, that contains a patch which may help: > http://vtk.org/pipermail/vtkusers/2002-January/009372.html > > There was a bug report too: > http://www.vtk.org/Bug/print_bug_page.php?bug_id=832 > > hth > > Goodwin > > > On Mon, Dec 10, 2012 at 2:51 AM, David Gobbi > wrote: > > Insert vtkTriangleFilter before vtkStripper. This will break any > input polylines into line segments. I don't know if it will help, > but it might. > > - David > > On Sun, Dec 9, 2012 at 2:48 PM, pof > wrote: > > yes this is the way LINES objects are written on vtk files. > > Ok, so I understand now the point you were making about the "T", > which was > > uncorrect. > > > > So back to the problem, why this vtkStripper is not able to > merge those 2 > > lines? > > > > Le 09/12/2012 21:41, David Gobbi a ?crit : > >> > >> Is it? Maybe it is. When you wrote the numbers, I assumed that > >> > >> all of the numbers that you listed were just point indices. > >> > >> > >> On Sun, Dec 9, 2012 at 1:37 PM, pof > wrote: > >>> > >>> Hum I see. > >>> (from what I understand), the first integer of each line is > simply the > >>> number of points of the corresponding LINE > >>> > >>> Le 09/12/2012 21:33, David Gobbi a ?crit : > >>> > >>>> Then where would the "9" go? > >>>> > >>>> The stripper uses a simple algorithm, it just chooses a starting > >>>> point, goes as far as it can in each direction to create the > first > >>>> polyline, and then repeats this procedure until all the line > segments > >>>> are accounted for. It doesn't exhaustively search though all > >>>> permutations to see which one gives the smallest number of output > >>>> polylines... that would cause the algorithm to run many times > slower. > >>>> > >>>> > >>>> > >>>> > >>>> On Sun, Dec 9, 2012 at 1:12 PM, pof > wrote: > >>>>> > >>>>> Hi David > >>>>> > >>>>> the first polyline being: > >>>>> > >>>>> 9 0 1 2 3 4 5 19 6 7 > >>>>> and the third polyline (actually it is a segment) being: > >>>>> 2 18 0 > >>>>> I don't see why they shoud not merge together as (unless I > >>>>> misunderstand > >>>>> something): > >>>>> 10 18 0 1 2 3 4 5 19 6 7 > >>>>> > >>>>> Am I wrong? > >>>>> > >>>>> > >>>>> Le 09/12/2012 21:05, David Gobbi a ?crit : > >>>>> > >>>>>> Hi JD, > >>>>>> > >>>>>> It could only merge those two lines if it joined them with > a "T". > >>>>>> A polyline cannot have any branches. > >>>>>> > >>>>>> - David > >>>>>> > >>>>>> > >>>>>> On Sun, Dec 9, 2012 at 12:16 PM, pof > wrote: > >>>>>>> > >>>>>>> Hi all, > >>>>>>> > >>>>>>> I get a strange result (which may be a bug) using vtk > stripper, i.e. > >>>>>>> it > >>>>>>> does > >>>>>>> not merge LINES as polylines as it is expected to. > >>>>>>> In this example (see below an extract of the polydata > produced by > >>>>>>> vtkStripper), only 2 polylines should be obtained, but > vtkStripper > >>>>>>> forgot > >>>>>>> to > >>>>>>> merge the first and the third line together, though they > obviously > >>>>>>> share > >>>>>>> point with Id=0 (btw, the fact that only Id 0 remains > unmerged might > >>>>>>> not > >>>>>>> be > >>>>>>> pure luck). > >>>>>>> > >>>>>>> LINES 3 24 > >>>>>>> 9 0 1 2 3 4 5 19 6 7 > >>>>>>> 10 9 8 17 13 12 15 14 11 10 16 > >>>>>>> 2 18 0 > >>>>>>> Does anybody have an idea or an explanation? > >>>>>>> Thanks > >>>>>>> JD > >>>>>>> > >>>>>>> PS: Here below is the complete source file that generates > these data > >>>>>>> and > >>>>>>> in > >>>>>>> which vtkStripper is used. > >>>>>>> > >>>>>>> ////////////////////////////////////////////////////// > >>>>>>> // Example modified from IntersectionPolyDataFilter.cxx > >>>>>>> ////////////////////////////////////////////////////// > >>>>>>> #include > >>>>>>> #include > >>>>>>> #include > >>>>>>> #include > >>>>>>> #include > >>>>>>> #include > >>>>>>> #include > >>>>>>> #include > >>>>>>> #include > >>>>>>> #include > >>>>>>> #include > >>>>>>> #include > >>>>>>> > >>>>>>> int main(int argc, char *argv[]) > >>>>>>> { > >>>>>>> vtkSmartPointer sphereSource1 = > >>>>>>> vtkSmartPointer::New(); > >>>>>>> sphereSource1->SetCenter(0.0, 0.0, 0.0); > >>>>>>> sphereSource1->SetRadius(2.0f); > >>>>>>> sphereSource1->SetPhiResolution(20); > >>>>>>> sphereSource1->SetThetaResolution(20); > >>>>>>> sphereSource1->Update(); > >>>>>>> vtkSmartPointer sphere1Mapper = > >>>>>>> vtkSmartPointer::New(); > >>>>>>> sphere1Mapper->SetInputConnection( > >>>>>>> sphereSource1->GetOutputPort() > >>>>>>> ); > >>>>>>> sphere1Mapper->ScalarVisibilityOff(); > >>>>>>> vtkSmartPointer sphere1Actor = > >>>>>>> vtkSmartPointer::New(); > >>>>>>> sphere1Actor->SetMapper( sphere1Mapper ); > >>>>>>> sphere1Actor->GetProperty()->SetOpacity(.3); > >>>>>>> sphere1Actor->GetProperty()->SetColor(1,0,0); > >>>>>>> > >>>>>>> ///////////////////////// > >>>>>>> // BEGIN MODIFICATIONS // > >>>>>>> ///////////////////////// > >>>>>>> // Create a planar object > >>>>>>> // Define 4 vertices > >>>>>>> vtkSmartPointer PlanePoints = > >>>>>>> vtkSmartPointer::New(); > >>>>>>> vtkSmartPointer PlaneCells = > >>>>>>> vtkSmartPointer::New(); > >>>>>>> PlanePoints->InsertNextPoint(-3, -1, 0); > >>>>>>> PlanePoints->InsertNextPoint(3, -1, 0); > >>>>>>> PlanePoints->InsertNextPoint(-3, 1, 0); > >>>>>>> PlanePoints->InsertNextPoint(3, 1, 0); > >>>>>>> // Create 2 trianglar faces > >>>>>>> PlaneCells->InsertNextCell(3); > >>>>>>> PlaneCells->InsertCellPoint(0); > >>>>>>> PlaneCells->InsertCellPoint(1); > >>>>>>> PlaneCells->InsertCellPoint(2); > >>>>>>> PlaneCells->InsertNextCell(3); > >>>>>>> PlaneCells->InsertCellPoint(1); > >>>>>>> PlaneCells->InsertCellPoint(3); > >>>>>>> PlaneCells->InsertCellPoint(2); > >>>>>>> // Create the polydata from points and faces > >>>>>>> vtkSmartPointer ProtectionWall = > >>>>>>> vtkSmartPointer::New(); > >>>>>>> ProtectionWall->SetPoints(PlanePoints); > >>>>>>> ProtectionWall->SetPolys(PlaneCells); > >>>>>>> ///////////////////////// > >>>>>>> // END MODIFICATIONS // > >>>>>>> ///////////////////////// > >>>>>>> > >>>>>>> vtkSmartPointer planeMapper = > >>>>>>> vtkSmartPointer::New(); > >>>>>>> planeMapper->SetInputConnection( > >>>>>>> ProtectionWall->GetProducerPort() > >>>>>>> ); > >>>>>>> planeMapper->ScalarVisibilityOff(); > >>>>>>> > >>>>>>> vtkSmartPointer planeActor = > >>>>>>> vtkSmartPointer::New(); > >>>>>>> planeActor->SetMapper( planeMapper ); > >>>>>>> planeActor->GetProperty()->SetOpacity(.3); > >>>>>>> planeActor->GetProperty()->SetColor(0,1,0); > >>>>>>> > >>>>>>> // Get intersection segments (LINES) using the > >>>>>>> vtkIntersectionPolyDataFilter > >>>>>>> vtkSmartPointer > >>>>>>> intersectionPolyDataFilter > >>>>>>> = vtkSmartPointer::New(); > >>>>>>> intersectionPolyDataFilter->SplitFirstOutputOff(); > >>>>>>> intersectionPolyDataFilter->SplitSecondOutputOff(); > >>>>>>> intersectionPolyDataFilter->SetInputConnection( 0, > >>>>>>> sphereSource1->GetOutputPort() ); > >>>>>>> intersectionPolyDataFilter->SetInputConnection( 1, > >>>>>>> ProtectionWall->GetProducerPort() ); > >>>>>>> intersectionPolyDataFilter->Update(); > >>>>>>> > >>>>>>> ///////////////////////// > >>>>>>> // BEGIN MODIFICATIONS // > >>>>>>> ///////////////////////// > >>>>>>> // Try to get the polylines (there should be 2) from the > >>>>>>> segments > >>>>>>> (LINES) > >>>>>>> vtkSmartPointer stripper = > >>>>>>> vtkSmartPointer::New(); > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> > stripper->SetInputConnection(intersectionPolyDataFilter->GetOutputPort()); > >>>>>>> stripper->Update(); > >>>>>>> // Save resulting polydata on a file, in which we see > that there > >>>>>>> are 3 > >>>>>>> polylines (actually the second polyline is ok, > >>>>>>> // but the first and third polylines should have been > further > >>>>>>> merged > >>>>>>> vtkSmartPointer wr = > >>>>>>> vtkSmartPointer::New(); > >>>>>>> wr->SetFileName("polylines.txt"); > >>>>>>> wr->SetInputConnection(stripper->GetOutputPort()); > >>>>>>> wr->Write(); > >>>>>>> /////////////////////// > >>>>>>> // END MODIFICATIONS // > >>>>>>> /////////////////////// > >>>>>>> > >>>>>>> vtkSmartPointer intersectionMapper = > >>>>>>> vtkSmartPointer::New(); > >>>>>>> intersectionMapper->SetInputConnection( > >>>>>>> stripper->GetOutputPort() > >>>>>>> ); > >>>>>>> intersectionMapper->ScalarVisibilityOff(); > >>>>>>> > >>>>>>> vtkSmartPointer intersectionActor = > >>>>>>> vtkSmartPointer::New(); > >>>>>>> intersectionActor->SetMapper( intersectionMapper ); > >>>>>>> > >>>>>>> vtkSmartPointer renderer = > >>>>>>> vtkSmartPointer::New(); > >>>>>>> renderer->AddViewProp(sphere1Actor); > >>>>>>> renderer->AddViewProp(planeActor); > >>>>>>> renderer->AddViewProp(intersectionActor); > >>>>>>> > >>>>>>> vtkSmartPointer renderWindow = > >>>>>>> vtkSmartPointer::New(); > >>>>>>> renderWindow->AddRenderer( renderer ); > >>>>>>> > >>>>>>> vtkSmartPointer renWinInteractor = > >>>>>>> vtkSmartPointer::New(); > >>>>>>> renWinInteractor->SetRenderWindow( renderWindow ); > >>>>>>> > >>>>>>> renderWindow->Render(); > >>>>>>> renderWindow->SetSize(600, 600); > >>>>>>> renderer->SetBackground(0.1, 0.2, 0.4); > >>>>>>> renWinInteractor->Start(); > >>>>>>> > >>>>>>> return EXIT_SUCCESS; > >>>>>>> } > >>>>> > >>>>> > > > _______________________________________________ > 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://www.vtk.org/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Gerrick.Bivins at halliburton.com Wed Dec 19 16:04:40 2012 From: Gerrick.Bivins at halliburton.com (Gerrick Bivins) Date: Wed, 19 Dec 2012 21:04:40 +0000 Subject: [vtkusers] extract or select cells of a certain type or dimension Message-ID: Hi all, Is there a way (filter) that will extract all cells of a certain type or dimension from a dataset? For instance, if I have a dataset with a mix of 1d,2d and 3d cell types is there a way to filter out the 1d and 2d cells Leaving only the 3d cells? Gerrick -------------- next part -------------- An HTML attachment was scrubbed... URL: From ilan.tal at gmail.com Thu Dec 20 03:02:12 2012 From: ilan.tal at gmail.com (Ilan) Date: Thu, 20 Dec 2012 00:02:12 -0800 (PST) Subject: [vtkusers] wrap java on Mac Air In-Reply-To: References: <1355905578648-5717659.post@n5.nabble.com> <1355913558456-5717662.post@n5.nabble.com> Message-ID: <1355990532290-5717675.post@n5.nabble.com> Thanks for you reply which very much helped. The first thing I did was throw everything to the Trash and start fresh. BTW I couldn't get a new CMake 2.8.10. All I can do is go to the Apps store and see what is available - this looks like the equivalent of the repository in Ubuntu. So I stayed with CMake 2.8-9. Likewise the Mac doesn't recognize ccmake in the terminal. Even though I installed the Unix tools under Xcode it seems that not everything is actually there. Your suggestions on what to check and uncheck were worth gold. For example I don't think I had BUILD_SHARE_LIBS checked, which I clearly need to do. It was nice to get rid of BUILD_DOCUMENTATION, BUILD_EXAMPLES and BUILD_TESTING - I want the simplest thing I can get. None of the VTK_Group entries appear in CMake so I couldn't do anything about them, but it did compile and generate. Then I went to Xcode and for about 20 minutes it compiled away. Finally it hit vtkRenderingJava and there the build came to a grinding halt with 20 errors. I looked at the modules and it isn't obvious what is wrong, but I have no interest in debugging vtk source code. If only I could find a precompiled version I would just use that and be done with it. For the moment I am stuck trying to figure out what Xcode finds offensive. -- View this message in context: http://vtk.1045678.n5.nabble.com/wrap-java-on-Mac-Air-tp5717659p5717675.html Sent from the VTK - Users mailing list archive at Nabble.com. From ilan.tal at gmail.com Thu Dec 20 03:25:35 2012 From: ilan.tal at gmail.com (Ilan) Date: Thu, 20 Dec 2012 00:25:35 -0800 (PST) Subject: [vtkusers] wrap java on Mac Air In-Reply-To: <1355990532290-5717675.post@n5.nabble.com> References: <1355905578648-5717659.post@n5.nabble.com> <1355913558456-5717662.post@n5.nabble.com> <1355990532290-5717675.post@n5.nabble.com> Message-ID: <1355991935733-5717676.post@n5.nabble.com> I found some error messages. It looks like they are connected to something inside Xcode: clang: warning: argument unused during compilation: '-ObjC++' In file included from /Users/geraldkolodny/ilan/vtk/../vtkBuild/Rendering/vtkRenderWindowJava.cxx:1405: In file included from /Users/geraldkolodny/ilan/vtk/Common/vtkJavaAwt.h:16: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/JavaVM.framework/Headers/jawt_md.h:11: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSView.h:8: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSResponder.h:8: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:5: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:409:1: error: expected unqualified-id @class NSString, Protocol; ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:411:19: error: unknown type name 'NSString' FOUNDATION_EXPORT NSString *NSStringFromSelector(SEL aSelector); -- View this message in context: http://vtk.1045678.n5.nabble.com/wrap-java-on-Mac-Air-tp5717659p5717676.html Sent from the VTK - Users mailing list archive at Nabble.com. From goodwin.lawlor.lists at gmail.com Thu Dec 20 11:05:32 2012 From: goodwin.lawlor.lists at gmail.com (Goodwin Lawlor) Date: Thu, 20 Dec 2012 20:05:32 +0400 Subject: [vtkusers] Bug in vtkStripper on a very simple case ? In-Reply-To: <50D226A9.5050409@gmail.com> References: <50C4E39B.9030400@gmail.com> <50C4F0C5.8000800@gmail.com> <50C4F67D.4090205@gmail.com> <50C50738.4030109@gmail.com> <50D226A9.5050409@gmail.com> Message-ID: JD, Pass the final polyline through vtkCleanPolyData with 0.0 tolerance (the default) and it should remove the coincident points. hth Goodwin On Thu, Dec 20, 2012 at 12:42 AM, pof wrote: > Goodwin, > > I tested the patch on the following simple case (5 segments) > # vtk DataFile Version 3.0 > vtk output > ASCII > DATASET POLYDATA > POINTS 6 float > 1.7 0.5 0 2 0 0 1.7 -0.5 0 > 1.6 -1 0 1.8 -0.2 0 1.6 1 0 > LINES 5 15 > 2 0 1 > 2 2 3 > 2 4 2 > 2 1 4 > 2 5 0 > > without the patch, 2 polylines are obtained from the vtkStripper > LINES 2 9 > 5 0 1 4 2 3 > 2 5 0 > > whereas with the patch a single polyline is obained > LINES 1 8 > 7 5 0 0 1 4 2 3 > > Things are of course better, though a duplicate of one point (point 0 in > this case) is obtained, which should obviously have been avoided. > So it looks there's stil some space to improve the patch. > > In any case, I thank you for sharing this information with me. > JD > > > Le 19/12/2012 10:04, Goodwin Lawlor a ?crit : > > I think vtkStripper was originally written to quickly produce > vtkTriangleStrip/vtkPolyLine primitives that would render faster, not a > computational geometry type class that would produce the longest possible > polylines... it is a visualization library after all. > > The seed point is arbitrary so you may not get the outcome you were > looking for. > > See this 2002 post, that contains a patch which may help: > http://vtk.org/pipermail/vtkusers/2002-January/009372.html > > There was a bug report too: > http://www.vtk.org/Bug/print_bug_page.php?bug_id=832 > > hth > > Goodwin > > > On Mon, Dec 10, 2012 at 2:51 AM, David Gobbi wrote: > >> Insert vtkTriangleFilter before vtkStripper. This will break any >> input polylines into line segments. I don't know if it will help, >> but it might. >> >> - David >> >> On Sun, Dec 9, 2012 at 2:48 PM, pof wrote: >> > yes this is the way LINES objects are written on vtk files. >> > Ok, so I understand now the point you were making about the "T", which >> was >> > uncorrect. >> > >> > So back to the problem, why this vtkStripper is not able to merge those >> 2 >> > lines? >> > >> > Le 09/12/2012 21:41, David Gobbi a ?crit : >> >> >> >> Is it? Maybe it is. When you wrote the numbers, I assumed that >> >> >> >> all of the numbers that you listed were just point indices. >> >> >> >> >> >> On Sun, Dec 9, 2012 at 1:37 PM, pof wrote: >> >>> >> >>> Hum I see. >> >>> (from what I understand), the first integer of each line is simply the >> >>> number of points of the corresponding LINE >> >>> >> >>> Le 09/12/2012 21:33, David Gobbi a ?crit : >> >>> >> >>>> Then where would the "9" go? >> >>>> >> >>>> The stripper uses a simple algorithm, it just chooses a starting >> >>>> point, goes as far as it can in each direction to create the first >> >>>> polyline, and then repeats this procedure until all the line segments >> >>>> are accounted for. It doesn't exhaustively search though all >> >>>> permutations to see which one gives the smallest number of output >> >>>> polylines... that would cause the algorithm to run many times slower. >> >>>> >> >>>> >> >>>> >> >>>> >> >>>> On Sun, Dec 9, 2012 at 1:12 PM, pof wrote: >> >>>>> >> >>>>> Hi David >> >>>>> >> >>>>> the first polyline being: >> >>>>> >> >>>>> 9 0 1 2 3 4 5 19 6 7 >> >>>>> and the third polyline (actually it is a segment) being: >> >>>>> 2 18 0 >> >>>>> I don't see why they shoud not merge together as (unless I >> >>>>> misunderstand >> >>>>> something): >> >>>>> 10 18 0 1 2 3 4 5 19 6 7 >> >>>>> >> >>>>> Am I wrong? >> >>>>> >> >>>>> >> >>>>> Le 09/12/2012 21:05, David Gobbi a ?crit : >> >>>>> >> >>>>>> Hi JD, >> >>>>>> >> >>>>>> It could only merge those two lines if it joined them with a "T". >> >>>>>> A polyline cannot have any branches. >> >>>>>> >> >>>>>> - David >> >>>>>> >> >>>>>> >> >>>>>> On Sun, Dec 9, 2012 at 12:16 PM, pof wrote: >> >>>>>>> >> >>>>>>> Hi all, >> >>>>>>> >> >>>>>>> I get a strange result (which may be a bug) using vtk stripper, >> i.e. >> >>>>>>> it >> >>>>>>> does >> >>>>>>> not merge LINES as polylines as it is expected to. >> >>>>>>> In this example (see below an extract of the polydata produced by >> >>>>>>> vtkStripper), only 2 polylines should be obtained, but vtkStripper >> >>>>>>> forgot >> >>>>>>> to >> >>>>>>> merge the first and the third line together, though they obviously >> >>>>>>> share >> >>>>>>> point with Id=0 (btw, the fact that only Id 0 remains unmerged >> might >> >>>>>>> not >> >>>>>>> be >> >>>>>>> pure luck). >> >>>>>>> >> >>>>>>> LINES 3 24 >> >>>>>>> 9 0 1 2 3 4 5 19 6 7 >> >>>>>>> 10 9 8 17 13 12 15 14 11 10 16 >> >>>>>>> 2 18 0 >> >>>>>>> Does anybody have an idea or an explanation? >> >>>>>>> Thanks >> >>>>>>> JD >> >>>>>>> >> >>>>>>> PS: Here below is the complete source file that generates these >> data >> >>>>>>> and >> >>>>>>> in >> >>>>>>> which vtkStripper is used. >> >>>>>>> >> >>>>>>> ////////////////////////////////////////////////////// >> >>>>>>> // Example modified from IntersectionPolyDataFilter.cxx >> >>>>>>> ////////////////////////////////////////////////////// >> >>>>>>> #include >> >>>>>>> #include >> >>>>>>> #include >> >>>>>>> #include >> >>>>>>> #include >> >>>>>>> #include >> >>>>>>> #include >> >>>>>>> #include >> >>>>>>> #include >> >>>>>>> #include >> >>>>>>> #include >> >>>>>>> #include >> >>>>>>> >> >>>>>>> int main(int argc, char *argv[]) >> >>>>>>> { >> >>>>>>> vtkSmartPointer sphereSource1 = >> >>>>>>> vtkSmartPointer::New(); >> >>>>>>> sphereSource1->SetCenter(0.0, 0.0, 0.0); >> >>>>>>> sphereSource1->SetRadius(2.0f); >> >>>>>>> sphereSource1->SetPhiResolution(20); >> >>>>>>> sphereSource1->SetThetaResolution(20); >> >>>>>>> sphereSource1->Update(); >> >>>>>>> vtkSmartPointer sphere1Mapper = >> >>>>>>> vtkSmartPointer::New(); >> >>>>>>> sphere1Mapper->SetInputConnection( >> >>>>>>> sphereSource1->GetOutputPort() >> >>>>>>> ); >> >>>>>>> sphere1Mapper->ScalarVisibilityOff(); >> >>>>>>> vtkSmartPointer sphere1Actor = >> >>>>>>> vtkSmartPointer::New(); >> >>>>>>> sphere1Actor->SetMapper( sphere1Mapper ); >> >>>>>>> sphere1Actor->GetProperty()->SetOpacity(.3); >> >>>>>>> sphere1Actor->GetProperty()->SetColor(1,0,0); >> >>>>>>> >> >>>>>>> ///////////////////////// >> >>>>>>> // BEGIN MODIFICATIONS // >> >>>>>>> ///////////////////////// >> >>>>>>> // Create a planar object >> >>>>>>> // Define 4 vertices >> >>>>>>> vtkSmartPointer PlanePoints = >> >>>>>>> vtkSmartPointer::New(); >> >>>>>>> vtkSmartPointer PlaneCells = >> >>>>>>> vtkSmartPointer::New(); >> >>>>>>> PlanePoints->InsertNextPoint(-3, -1, 0); >> >>>>>>> PlanePoints->InsertNextPoint(3, -1, 0); >> >>>>>>> PlanePoints->InsertNextPoint(-3, 1, 0); >> >>>>>>> PlanePoints->InsertNextPoint(3, 1, 0); >> >>>>>>> // Create 2 trianglar faces >> >>>>>>> PlaneCells->InsertNextCell(3); >> >>>>>>> PlaneCells->InsertCellPoint(0); >> >>>>>>> PlaneCells->InsertCellPoint(1); >> >>>>>>> PlaneCells->InsertCellPoint(2); >> >>>>>>> PlaneCells->InsertNextCell(3); >> >>>>>>> PlaneCells->InsertCellPoint(1); >> >>>>>>> PlaneCells->InsertCellPoint(3); >> >>>>>>> PlaneCells->InsertCellPoint(2); >> >>>>>>> // Create the polydata from points and faces >> >>>>>>> vtkSmartPointer ProtectionWall = >> >>>>>>> vtkSmartPointer::New(); >> >>>>>>> ProtectionWall->SetPoints(PlanePoints); >> >>>>>>> ProtectionWall->SetPolys(PlaneCells); >> >>>>>>> ///////////////////////// >> >>>>>>> // END MODIFICATIONS // >> >>>>>>> ///////////////////////// >> >>>>>>> >> >>>>>>> vtkSmartPointer planeMapper = >> >>>>>>> vtkSmartPointer::New(); >> >>>>>>> planeMapper->SetInputConnection( >> >>>>>>> ProtectionWall->GetProducerPort() >> >>>>>>> ); >> >>>>>>> planeMapper->ScalarVisibilityOff(); >> >>>>>>> >> >>>>>>> vtkSmartPointer planeActor = >> >>>>>>> vtkSmartPointer::New(); >> >>>>>>> planeActor->SetMapper( planeMapper ); >> >>>>>>> planeActor->GetProperty()->SetOpacity(.3); >> >>>>>>> planeActor->GetProperty()->SetColor(0,1,0); >> >>>>>>> >> >>>>>>> // Get intersection segments (LINES) using the >> >>>>>>> vtkIntersectionPolyDataFilter >> >>>>>>> vtkSmartPointer >> >>>>>>> intersectionPolyDataFilter >> >>>>>>> = vtkSmartPointer::New(); >> >>>>>>> intersectionPolyDataFilter->SplitFirstOutputOff(); >> >>>>>>> intersectionPolyDataFilter->SplitSecondOutputOff(); >> >>>>>>> intersectionPolyDataFilter->SetInputConnection( 0, >> >>>>>>> sphereSource1->GetOutputPort() ); >> >>>>>>> intersectionPolyDataFilter->SetInputConnection( 1, >> >>>>>>> ProtectionWall->GetProducerPort() ); >> >>>>>>> intersectionPolyDataFilter->Update(); >> >>>>>>> >> >>>>>>> ///////////////////////// >> >>>>>>> // BEGIN MODIFICATIONS // >> >>>>>>> ///////////////////////// >> >>>>>>> // Try to get the polylines (there should be 2) from the >> >>>>>>> segments >> >>>>>>> (LINES) >> >>>>>>> vtkSmartPointer stripper = >> >>>>>>> vtkSmartPointer::New(); >> >>>>>>> >> >>>>>>> >> >>>>>>> >> >>>>>>> >> stripper->SetInputConnection(intersectionPolyDataFilter->GetOutputPort()); >> >>>>>>> stripper->Update(); >> >>>>>>> // Save resulting polydata on a file, in which we see that >> there >> >>>>>>> are 3 >> >>>>>>> polylines (actually the second polyline is ok, >> >>>>>>> // but the first and third polylines should have been further >> >>>>>>> merged >> >>>>>>> vtkSmartPointer wr = >> >>>>>>> vtkSmartPointer::New(); >> >>>>>>> wr->SetFileName("polylines.txt"); >> >>>>>>> wr->SetInputConnection(stripper->GetOutputPort()); >> >>>>>>> wr->Write(); >> >>>>>>> /////////////////////// >> >>>>>>> // END MODIFICATIONS // >> >>>>>>> /////////////////////// >> >>>>>>> >> >>>>>>> vtkSmartPointer intersectionMapper = >> >>>>>>> vtkSmartPointer::New(); >> >>>>>>> intersectionMapper->SetInputConnection( >> >>>>>>> stripper->GetOutputPort() >> >>>>>>> ); >> >>>>>>> intersectionMapper->ScalarVisibilityOff(); >> >>>>>>> >> >>>>>>> vtkSmartPointer intersectionActor = >> >>>>>>> vtkSmartPointer::New(); >> >>>>>>> intersectionActor->SetMapper( intersectionMapper ); >> >>>>>>> >> >>>>>>> vtkSmartPointer renderer = >> >>>>>>> vtkSmartPointer::New(); >> >>>>>>> renderer->AddViewProp(sphere1Actor); >> >>>>>>> renderer->AddViewProp(planeActor); >> >>>>>>> renderer->AddViewProp(intersectionActor); >> >>>>>>> >> >>>>>>> vtkSmartPointer renderWindow = >> >>>>>>> vtkSmartPointer::New(); >> >>>>>>> renderWindow->AddRenderer( renderer ); >> >>>>>>> >> >>>>>>> vtkSmartPointer renWinInteractor = >> >>>>>>> vtkSmartPointer::New(); >> >>>>>>> renWinInteractor->SetRenderWindow( renderWindow ); >> >>>>>>> >> >>>>>>> renderWindow->Render(); >> >>>>>>> renderWindow->SetSize(600, 600); >> >>>>>>> renderer->SetBackground(0.1, 0.2, 0.4); >> >>>>>>> renWinInteractor->Start(); >> >>>>>>> >> >>>>>>> return EXIT_SUCCESS; >> >>>>>>> } >> >>>>> >> >>>>> >> > >> _______________________________________________ >> 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://www.vtk.org/mailman/listinfo/vtkusers >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean at rogue-research.com Thu Dec 20 11:22:01 2012 From: sean at rogue-research.com (Sean McBride) Date: Thu, 20 Dec 2012 11:22:01 -0500 Subject: [vtkusers] wrap java on Mac Air In-Reply-To: <1355990532290-5717675.post@n5.nabble.com> References: <1355905578648-5717659.post@n5.nabble.com> <1355913558456-5717662.post@n5.nabble.com> <1355990532290-5717675.post@n5.nabble.com> Message-ID: <20121220162201.172448119@mail.rogue-research.com> On Thu, 20 Dec 2012 00:02:12 -0800, Ilan said: >BTW I couldn't get a new CMake >2.8.10. All I can do is go to the Apps store and see what is available mmm, what? why? You can get CMake 2.8.10.2 here: How did you get CMake 2.8.9? >Likewise the Mac doesn't recognize ccmake in the terminal. The cmake installer will offer to install command line tools; either let it, or add /Applications/CMake.app/Content/etc. to your PATH. 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 ilan.tal at gmail.com Thu Dec 20 11:43:12 2012 From: ilan.tal at gmail.com (Ilan) Date: Thu, 20 Dec 2012 08:43:12 -0800 (PST) Subject: [vtkusers] wrap java on Mac Air In-Reply-To: <20121220162201.172448119@mail.rogue-research.com> References: <1355905578648-5717659.post@n5.nabble.com> <1355913558456-5717662.post@n5.nabble.com> <1355990532290-5717675.post@n5.nabble.com> <20121220162201.172448119@mail.rogue-research.com> Message-ID: > mmm, what? why? You can get CMake 2.8.10.2 here: > > > > How did you get CMake 2.8.9? > I must have received it from the app store. Today I saw in the store that I could do an upgrade, so I did it. I assumed that would update CMake if an upgrade was available. I'm very new to the Mac so there may be obvious things which I am missing. > > >Likewise the Mac doesn't recognize ccmake in the terminal. > > The cmake installer will offer to install command line tools; either let > it, or add /Applications/CMake.app/Content/etc. to your PATH. > > I sort of remember that I got the tools via Xcode - that is what was written when I was looking around. Seb suggested using ccmake which probably is different from cmake. Not all of what he suggested was available in CMake. The Mac isn't mine, so I'll have to wait until I can get control back to play again. I just hope that either the improvements in CMake 2.8.10 will make xcode work properly or Seb's ccmake and other terminal commands will do the job. I just want to get on with it. Thanks for your help, Ilan > Cheers, > > -- > ____________________________________________________________ > Sean McBride, B. Eng [hidden email] > Rogue Research www.rogue-research.com > Mac Software Developer Montr?al, Qu?bec, Canada > > > _______________________________________________ > 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://www.vtk.org/mailman/listinfo/vtkusers > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://vtk.1045678.n5.nabble.com/wrap-java-on-Mac-Air-tp5717659p5717681.html > To unsubscribe from wrap java on Mac Air, click here > . > NAML > -- View this message in context: http://vtk.1045678.n5.nabble.com/wrap-java-on-Mac-Air-tp5717659p5717682.html Sent from the VTK - Users mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From danimede at tiscali.it Thu Dec 20 11:45:46 2012 From: danimede at tiscali.it (danimede) Date: Thu, 20 Dec 2012 08:45:46 -0800 (PST) Subject: [vtkusers] Bug in vtkPolyDataNormals? Message-ID: <1356021946780-5717683.post@n5.nabble.com> Hi All, I have found a weird computation in vtkPolyDataNormals.cpp. The issue is in the follow piece of code: for (i=0; i < numNewPts; i++) { newNormals->GetTuple(i, vertNormal); length = vtkMath::Norm(vertNormal); if (length != 0.0) { for (j=0; j < 3; j++) { n[j] = vertNormal[j] / length * flipDirection; } } newNormals->SetTuple(i,n); } In the code if we have a length equal to zero we set in the i-th tuple the normal values of the (i-th)-1 point! Is it a bug or maybe there are some hypothesis like consecutive index points can have the same normal vector? Probably the solution is to set the normal to {0.0 , 0.0 , 0.0} if we have a length equal to zero. Regards, Daniele -- View this message in context: http://vtk.1045678.n5.nabble.com/Bug-in-vtkPolyDataNormals-tp5717683.html Sent from the VTK - Users mailing list archive at Nabble.com. From jd379252 at gmail.com Thu Dec 20 13:11:25 2012 From: jd379252 at gmail.com (pof) Date: Thu, 20 Dec 2012 19:11:25 +0100 Subject: [vtkusers] Bug in vtkStripper on a very simple case ? In-Reply-To: References: <50C4E39B.9030400@gmail.com> <50C4F0C5.8000800@gmail.com> <50C4F67D.4090205@gmail.com> <50C50738.4030109@gmail.com> <50D226A9.5050409@gmail.com> Message-ID: <50D354CD.80401@gmail.com> Goodwin, this is strange... I tried yesterday and I found it did not work (I must have done something with my testing). I tested again, and this works. Great and thanks JD Le 20/12/2012 17:05, Goodwin Lawlor a ?crit : > JD, > > Pass the final polyline through vtkCleanPolyData with 0.0 tolerance > (the default) and it should remove the coincident points. > > hth > > Goodwin > > On Thu, Dec 20, 2012 at 12:42 AM, pof > wrote: > > Goodwin, > > I tested the patch on the following simple case (5 segments) > # vtk DataFile Version 3.0 > vtk output > ASCII > DATASET POLYDATA > POINTS 6 float > 1.7 0.5 0 2 0 0 1.7 -0.5 0 > 1.6 -1 0 1.8 -0.2 0 1.6 1 0 > LINES 5 15 > 2 0 1 > 2 2 3 > 2 4 2 > 2 1 4 > 2 5 0 > > without the patch, 2 polylines are obtained from the vtkStripper > LINES 2 9 > 5 0 1 4 2 3 > 2 5 0 > > whereas with the patch a single polyline is obained > LINES 1 8 > 7 5 0 0 1 4 2 3 > > Things are of course better, though a duplicate of one point > (point 0 in this case) is obtained, which should obviously have > been avoided. > So it looks there's stil some space to improve the patch. > > In any case, I thank you for sharing this information with me. > JD > > > Le 19/12/2012 10:04, Goodwin Lawlor a ?crit : >> I think vtkStripper was originally written to quickly produce >> vtkTriangleStrip/vtkPolyLine primitives that would render faster, >> not a computational geometry type class that would produce the >> longest possible polylines... it is a visualization library after >> all. >> >> The seed point is arbitrary so you may not get the outcome you >> were looking for. >> >> See this 2002 post, that contains a patch which may help: >> http://vtk.org/pipermail/vtkusers/2002-January/009372.html >> >> There was a bug report too: >> http://www.vtk.org/Bug/print_bug_page.php?bug_id=832 >> >> hth >> >> Goodwin >> >> >> On Mon, Dec 10, 2012 at 2:51 AM, David Gobbi >> > wrote: >> >> Insert vtkTriangleFilter before vtkStripper. This will break any >> input polylines into line segments. I don't know if it will >> help, >> but it might. >> >> - David >> >> On Sun, Dec 9, 2012 at 2:48 PM, pof > > wrote: >> > yes this is the way LINES objects are written on vtk files. >> > Ok, so I understand now the point you were making about the >> "T", which was >> > uncorrect. >> > >> > So back to the problem, why this vtkStripper is not able to >> merge those 2 >> > lines? >> > >> > Le 09/12/2012 21:41, David Gobbi a ?crit : >> >> >> >> Is it? Maybe it is. When you wrote the numbers, I >> assumed that >> >> >> >> all of the numbers that you listed were just point indices. >> >> >> >> >> >> On Sun, Dec 9, 2012 at 1:37 PM, pof > > wrote: >> >>> >> >>> Hum I see. >> >>> (from what I understand), the first integer of each line >> is simply the >> >>> number of points of the corresponding LINE >> >>> >> >>> Le 09/12/2012 21:33, David Gobbi a ?crit : >> >>> >> >>>> Then where would the "9" go? >> >>>> >> >>>> The stripper uses a simple algorithm, it just chooses a >> starting >> >>>> point, goes as far as it can in each direction to create >> the first >> >>>> polyline, and then repeats this procedure until all the >> line segments >> >>>> are accounted for. It doesn't exhaustively search >> though all >> >>>> permutations to see which one gives the smallest number >> of output >> >>>> polylines... that would cause the algorithm to run many >> times slower. >> >>>> >> >>>> >> >>>> >> >>>> >> >>>> On Sun, Dec 9, 2012 at 1:12 PM, pof > > wrote: >> >>>>> >> >>>>> Hi David >> >>>>> >> >>>>> the first polyline being: >> >>>>> >> >>>>> 9 0 1 2 3 4 5 19 6 7 >> >>>>> and the third polyline (actually it is a segment) being: >> >>>>> 2 18 0 >> >>>>> I don't see why they shoud not merge together as (unless I >> >>>>> misunderstand >> >>>>> something): >> >>>>> 10 18 0 1 2 3 4 5 19 6 7 >> >>>>> >> >>>>> Am I wrong? >> >>>>> >> >>>>> >> >>>>> Le 09/12/2012 21:05, David Gobbi a ?crit : >> >>>>> >> >>>>>> Hi JD, >> >>>>>> >> >>>>>> It could only merge those two lines if it joined them >> with a "T". >> >>>>>> A polyline cannot have any branches. >> >>>>>> >> >>>>>> - David >> >>>>>> >> >>>>>> >> >>>>>> On Sun, Dec 9, 2012 at 12:16 PM, pof >> > wrote: >> >>>>>>> >> >>>>>>> Hi all, >> >>>>>>> >> >>>>>>> I get a strange result (which may be a bug) using vtk >> stripper, i.e. >> >>>>>>> it >> >>>>>>> does >> >>>>>>> not merge LINES as polylines as it is expected to. >> >>>>>>> In this example (see below an extract of the polydata >> produced by >> >>>>>>> vtkStripper), only 2 polylines should be obtained, >> but vtkStripper >> >>>>>>> forgot >> >>>>>>> to >> >>>>>>> merge the first and the third line together, though >> they obviously >> >>>>>>> share >> >>>>>>> point with Id=0 (btw, the fact that only Id 0 remains >> unmerged might >> >>>>>>> not >> >>>>>>> be >> >>>>>>> pure luck). >> >>>>>>> >> >>>>>>> LINES 3 24 >> >>>>>>> 9 0 1 2 3 4 5 19 6 7 >> >>>>>>> 10 9 8 17 13 12 15 14 11 10 16 >> >>>>>>> 2 18 0 >> >>>>>>> Does anybody have an idea or an explanation? >> >>>>>>> Thanks >> >>>>>>> JD >> >>>>>>> >> >>>>>>> PS: Here below is the complete source file that >> generates these data >> >>>>>>> and >> >>>>>>> in >> >>>>>>> which vtkStripper is used. >> >>>>>>> >> >>>>>>> ////////////////////////////////////////////////////// >> >>>>>>> // Example modified from IntersectionPolyDataFilter.cxx >> >>>>>>> ////////////////////////////////////////////////////// >> >>>>>>> #include >> >>>>>>> #include >> >>>>>>> #include >> >>>>>>> #include >> >>>>>>> #include >> >>>>>>> #include >> >>>>>>> #include >> >>>>>>> #include >> >>>>>>> #include >> >>>>>>> #include >> >>>>>>> #include >> >>>>>>> #include >> >>>>>>> >> >>>>>>> int main(int argc, char *argv[]) >> >>>>>>> { >> >>>>>>> vtkSmartPointer sphereSource1 = >> >>>>>>> vtkSmartPointer::New(); >> >>>>>>> sphereSource1->SetCenter(0.0, 0.0, 0.0); >> >>>>>>> sphereSource1->SetRadius(2.0f); >> >>>>>>> sphereSource1->SetPhiResolution(20); >> >>>>>>> sphereSource1->SetThetaResolution(20); >> >>>>>>> sphereSource1->Update(); >> >>>>>>> vtkSmartPointer sphere1Mapper = >> >>>>>>> vtkSmartPointer::New(); >> >>>>>>> sphere1Mapper->SetInputConnection( >> >>>>>>> sphereSource1->GetOutputPort() >> >>>>>>> ); >> >>>>>>> sphere1Mapper->ScalarVisibilityOff(); >> >>>>>>> vtkSmartPointer sphere1Actor = >> >>>>>>> vtkSmartPointer::New(); >> >>>>>>> sphere1Actor->SetMapper( sphere1Mapper ); >> >>>>>>> sphere1Actor->GetProperty()->SetOpacity(.3); >> >>>>>>> sphere1Actor->GetProperty()->SetColor(1,0,0); >> >>>>>>> >> >>>>>>> ///////////////////////// >> >>>>>>> // BEGIN MODIFICATIONS // >> >>>>>>> ///////////////////////// >> >>>>>>> // Create a planar object >> >>>>>>> // Define 4 vertices >> >>>>>>> vtkSmartPointer PlanePoints = >> >>>>>>> vtkSmartPointer::New(); >> >>>>>>> vtkSmartPointer PlaneCells = >> >>>>>>> vtkSmartPointer::New(); >> >>>>>>> PlanePoints->InsertNextPoint(-3, -1, 0); >> >>>>>>> PlanePoints->InsertNextPoint(3, -1, 0); >> >>>>>>> PlanePoints->InsertNextPoint(-3, 1, 0); >> >>>>>>> PlanePoints->InsertNextPoint(3, 1, 0); >> >>>>>>> // Create 2 trianglar faces >> >>>>>>> PlaneCells->InsertNextCell(3); >> >>>>>>> PlaneCells->InsertCellPoint(0); >> >>>>>>> PlaneCells->InsertCellPoint(1); >> >>>>>>> PlaneCells->InsertCellPoint(2); >> >>>>>>> PlaneCells->InsertNextCell(3); >> >>>>>>> PlaneCells->InsertCellPoint(1); >> >>>>>>> PlaneCells->InsertCellPoint(3); >> >>>>>>> PlaneCells->InsertCellPoint(2); >> >>>>>>> // Create the polydata from points and faces >> >>>>>>> vtkSmartPointer ProtectionWall = >> >>>>>>> vtkSmartPointer::New(); >> >>>>>>> ProtectionWall->SetPoints(PlanePoints); >> >>>>>>> ProtectionWall->SetPolys(PlaneCells); >> >>>>>>> ///////////////////////// >> >>>>>>> // END MODIFICATIONS // >> >>>>>>> ///////////////////////// >> >>>>>>> >> >>>>>>> vtkSmartPointer planeMapper = >> >>>>>>> vtkSmartPointer::New(); >> >>>>>>> planeMapper->SetInputConnection( >> >>>>>>> ProtectionWall->GetProducerPort() >> >>>>>>> ); >> >>>>>>> planeMapper->ScalarVisibilityOff(); >> >>>>>>> >> >>>>>>> vtkSmartPointer planeActor = >> >>>>>>> vtkSmartPointer::New(); >> >>>>>>> planeActor->SetMapper( planeMapper ); >> >>>>>>> planeActor->GetProperty()->SetOpacity(.3); >> >>>>>>> planeActor->GetProperty()->SetColor(0,1,0); >> >>>>>>> >> >>>>>>> // Get intersection segments (LINES) using the >> >>>>>>> vtkIntersectionPolyDataFilter >> >>>>>>> vtkSmartPointer >> >>>>>>> intersectionPolyDataFilter >> >>>>>>> = vtkSmartPointer::New(); >> >>>>>>> intersectionPolyDataFilter->SplitFirstOutputOff(); >> >>>>>>> intersectionPolyDataFilter->SplitSecondOutputOff(); >> >>>>>>> intersectionPolyDataFilter->SetInputConnection( 0, >> >>>>>>> sphereSource1->GetOutputPort() ); >> >>>>>>> intersectionPolyDataFilter->SetInputConnection( 1, >> >>>>>>> ProtectionWall->GetProducerPort() ); >> >>>>>>> intersectionPolyDataFilter->Update(); >> >>>>>>> >> >>>>>>> ///////////////////////// >> >>>>>>> // BEGIN MODIFICATIONS // >> >>>>>>> ///////////////////////// >> >>>>>>> // Try to get the polylines (there should be 2) >> from the >> >>>>>>> segments >> >>>>>>> (LINES) >> >>>>>>> vtkSmartPointer stripper = >> >>>>>>> vtkSmartPointer::New(); >> >>>>>>> >> >>>>>>> >> >>>>>>> >> >>>>>>> >> stripper->SetInputConnection(intersectionPolyDataFilter->GetOutputPort()); >> >>>>>>> stripper->Update(); >> >>>>>>> // Save resulting polydata on a file, in which >> we see that there >> >>>>>>> are 3 >> >>>>>>> polylines (actually the second polyline is ok, >> >>>>>>> // but the first and third polylines should have >> been further >> >>>>>>> merged >> >>>>>>> vtkSmartPointer wr = >> >>>>>>> vtkSmartPointer::New(); >> >>>>>>> wr->SetFileName("polylines.txt"); >> >>>>>>> wr->SetInputConnection(stripper->GetOutputPort()); >> >>>>>>> wr->Write(); >> >>>>>>> /////////////////////// >> >>>>>>> // END MODIFICATIONS // >> >>>>>>> /////////////////////// >> >>>>>>> >> >>>>>>> vtkSmartPointer intersectionMapper = >> >>>>>>> vtkSmartPointer::New(); >> >>>>>>> intersectionMapper->SetInputConnection( >> >>>>>>> stripper->GetOutputPort() >> >>>>>>> ); >> >>>>>>> intersectionMapper->ScalarVisibilityOff(); >> >>>>>>> >> >>>>>>> vtkSmartPointer intersectionActor = >> >>>>>>> vtkSmartPointer::New(); >> >>>>>>> intersectionActor->SetMapper( intersectionMapper ); >> >>>>>>> >> >>>>>>> vtkSmartPointer renderer = >> >>>>>>> vtkSmartPointer::New(); >> >>>>>>> renderer->AddViewProp(sphere1Actor); >> >>>>>>> renderer->AddViewProp(planeActor); >> >>>>>>> renderer->AddViewProp(intersectionActor); >> >>>>>>> >> >>>>>>> vtkSmartPointer renderWindow = >> >>>>>>> vtkSmartPointer::New(); >> >>>>>>> renderWindow->AddRenderer( renderer ); >> >>>>>>> >> >>>>>>> vtkSmartPointer >> renWinInteractor = >> >>>>>>> vtkSmartPointer::New(); >> >>>>>>> renWinInteractor->SetRenderWindow( renderWindow ); >> >>>>>>> >> >>>>>>> renderWindow->Render(); >> >>>>>>> renderWindow->SetSize(600, 600); >> >>>>>>> renderer->SetBackground(0.1, 0.2, 0.4); >> >>>>>>> renWinInteractor->Start(); >> >>>>>>> >> >>>>>>> return EXIT_SUCCESS; >> >>>>>>> } >> >>>>> >> >>>>> >> > >> _______________________________________________ >> 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://www.vtk.org/mailman/listinfo/vtkusers >> >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean at rogue-research.com Thu Dec 20 14:18:44 2012 From: sean at rogue-research.com (Sean McBride) Date: Thu, 20 Dec 2012 14:18:44 -0500 Subject: [vtkusers] wrap java on Mac Air In-Reply-To: References: <1355905578648-5717659.post@n5.nabble.com> <1355913558456-5717662.post@n5.nabble.com> <1355990532290-5717675.post@n5.nabble.com> <20121220162201.172448119@mail.rogue-research.com> Message-ID: <20121220191844.126735706@mail.rogue-research.com> On Thu, 20 Dec 2012 08:43:12 -0800, Ilan said: >> mmm, what? why? You can get CMake 2.8.10.2 here: >> >> >> >> How did you get CMake 2.8.9? >> >I must have received it from the app store. Today I saw in the store that I >could do an upgrade, so I did it. I assumed that would update CMake if an >upgrade was available. I'm very new to the Mac so there may be obvious >things which I am missing. I'm pretty sure CMake is not in the Mac App Store. As you're new to Mac, perhaps you're not aware that the store is thankfully not mandatory like it is with iOS? >The Mac isn't mine, so I'll have to wait until I can get control back to >play again. I just hope that either the improvements in CMake 2.8.10 will >make xcode work properly or Seb's ccmake and other terminal commands will >do the job. I just want to get on with it. Once you update your CMake, I'd start by doing a simple build of VTK, without Java wrappings, to see if at least that works. 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 fpaulico1 at gmail.com Thu Dec 20 14:28:49 2012 From: fpaulico1 at gmail.com (Fabiano Stange) Date: Thu, 20 Dec 2012 17:28:49 -0200 Subject: [vtkusers] doubts about vtkVRMLImporter Message-ID: Hi! I have some doubts about vtkVRMLImporter. I am using VTK version 5.4 and Visual Studio C++ 2008 to import a wrl file. But it is not working very well. If the wrl file has more then one DEF node, vtk only visualizes the first DEF node. For example, a solid model like a building can be writing in wrl format using a DEF node for which object (foundations, columns, beams, slabs, walls and roofs). Here is a part of the wrl file i like to visualize in vtk: #VRML V2.0 utf8 DEF Structural_Columns_ Transform { translation -10700 4650 -17490 children DEF Structural_Columns__0 Transform { translation 0 0 0 children Shape { appearance Appearance { material Material {diffuseColor 1 0 1} texture ImageTexture { url " http://t3.gstatic.com/images?q=tbn:ANd9GcSNUBcHJyaWrODD9_EyOSBRAvBB_3dRhTlocB1S6qEk5Mz3XW9x2w " repeatS TRUE repeatT TRUE } } geometry DEF Structural_Columns__0-FACES IndexedFaceSet { ccw TRUE solid TRUE coord DEF Structural_Columns__0-COORD Coordinate {point [...]} coordIndex [ ... ] } } } } DEF Structural_Columns__01 Transform { translation -5204 7750 -17490 children DEF Structural_Columns__02 Transform { translation 0 0 0 children Shape { appearance Appearance {material Material {diffuseColor 1 0 1}} geometry DEF Structural_Columns__02-FACES IndexedFaceSet { ccw TRUE solid TRUE coord DEF Structural_Columns__02-COORD Coordinate {point [...} coordIndex [...] } } } } ... Even if i use the group node vtk still visualizes the first DEF node. And there is more problems. The first DEF node that vtk visualizes does not read the Appearance node, the Material node and the Color node. I am using the example in http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/VRML. Is something wrong or the vtkVRMLImporter works like that? Thanks, Fabiano Stange -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexmalvtk at gmail.com Thu Dec 20 16:45:58 2012 From: alexmalvtk at gmail.com (Alex Malyushytskyy) Date: Thu, 20 Dec 2012 13:45:58 -0800 Subject: [vtkusers] Bug in vtkPolyDataNormals? In-Reply-To: <1356021946780-5717683.post@n5.nabble.com> References: <1356021946780-5717683.post@n5.nabble.com> Message-ID: AFAS I understand Normal length must not be 0. If it is 0 it can be any, cause it means unexpected problem in the code. I would probably set it to the OX. But your suggestion is worse than current, cause it may break other code which expects a well defined vector as a normal. Alex On Thu, Dec 20, 2012 at 8:45 AM, danimede wrote: > Hi All, > > I have found a weird computation in vtkPolyDataNormals.cpp. The issue is in > the follow piece of code: > > for (i=0; i < numNewPts; i++) { > newNormals->GetTuple(i, vertNormal); > length = vtkMath::Norm(vertNormal); > if (length != 0.0) { > for (j=0; j < 3; j++) { > n[j] = vertNormal[j] / length * flipDirection; > } > } > newNormals->SetTuple(i,n); > } > > In the code if we have a length equal to zero we set in the i-th tuple the > normal values of the (i-th)-1 point! > Is it a bug or maybe there are some hypothesis like consecutive index points > can have the same normal vector? > Probably the solution is to set the normal to {0.0 , 0.0 , 0.0} if we have a > length equal to zero. > > Regards, > Daniele > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/Bug-in-vtkPolyDataNormals-tp5717683.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://www.vtk.org/mailman/listinfo/vtkusers From ilan.tal at gmail.com Fri Dec 21 02:53:56 2012 From: ilan.tal at gmail.com (Ilan) Date: Thu, 20 Dec 2012 23:53:56 -0800 (PST) Subject: [vtkusers] wrap java on Mac Air In-Reply-To: <20121220191844.126735706@mail.rogue-research.com> References: <1355905578648-5717659.post@n5.nabble.com> <1355913558456-5717662.post@n5.nabble.com> <1355990532290-5717675.post@n5.nabble.com> <20121220162201.172448119@mail.rogue-research.com> <20121220191844.126735706@mail.rogue-research.com> Message-ID: Hi Sean, > > Once you update your CMake, I'd start by doing a simple build of VTK, > without Java wrappings, to see if at least that works. > > > The initial build without the Java wrappings is an excellent idea. I've always been for KISS (Keep It Simple, Stupid). Thanks, Ilan -- View this message in context: http://vtk.1045678.n5.nabble.com/wrap-java-on-Mac-Air-tp5717659p5717689.html Sent from the VTK - Users mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From danimede at tiscali.it Fri Dec 21 04:08:40 2012 From: danimede at tiscali.it (danimede) Date: Fri, 21 Dec 2012 01:08:40 -0800 (PST) Subject: [vtkusers] Bug in vtkPolyDataNormals? In-Reply-To: References: <1356021946780-5717683.post@n5.nabble.com> Message-ID: <1356080920763-5717690.post@n5.nabble.com> Hi Alex, if Normal length must not be 0, the IF condition is useless, or not? And if I have two polygons that represent the same one, i.e. A-B-C (first triangular polygon) and A-C-B, when I compute the normal for point A is correct to have a normal vector equal to 0.0, due to the two polygonal normals are the same vector but with opposite sign. Maybe a check in the initial stage can be helpful to avoid this scenario. Regards, Daniele Alex Malyushytskyy wrote > AFAS I understand Normal length must not be 0. > If it is 0 it can be any, cause it means unexpected problem in the code. > I would probably set it to the OX. But your suggestion is worse than > current, > cause it may break other code which expects a well defined vector as a > normal. > > Alex > > On Thu, Dec 20, 2012 at 8:45 AM, danimede < > danimede@ > > wrote: >> Hi All, >> >> I have found a weird computation in vtkPolyDataNormals.cpp. The issue is >> in >> the follow piece of code: >> >> for (i=0; i < numNewPts; i++) { >> newNormals->GetTuple(i, vertNormal); >> length = vtkMath::Norm(vertNormal); >> if (length != 0.0) { >> for (j=0; j < 3; j++) { >> n[j] = vertNormal[j] / length * flipDirection; >> } >> } >> newNormals->SetTuple(i,n); >> } >> >> In the code if we have a length equal to zero we set in the i-th tuple >> the >> normal values of the (i-th)-1 point! >> Is it a bug or maybe there are some hypothesis like consecutive index >> points >> can have the same normal vector? >> Probably the solution is to set the normal to {0.0 , 0.0 , 0.0} if we >> have a >> length equal to zero. >> >> Regards, >> Daniele -- View this message in context: http://vtk.1045678.n5.nabble.com/Bug-in-vtkPolyDataNormals-tp5717683p5717690.html Sent from the VTK - Users mailing list archive at Nabble.com. From ali.hadimogullari at netcad.com.tr Fri Dec 21 05:08:30 2012 From: ali.hadimogullari at netcad.com.tr (alihadim) Date: Fri, 21 Dec 2012 02:08:30 -0800 (PST) Subject: [vtkusers] Tube Filter Message-ID: <1356084510103-5717691.post@n5.nabble.com> I can use Tube algorithm and drawing polydata. This screen is 1.png. this is original data (not use tube alg.). After I added tube algorithm and this screen is 2.png. I want to pick coordinat on original data(1.png) while added on tube algorithm data. is this possible in VTK. -- View this message in context: http://vtk.1045678.n5.nabble.com/Tube-Filter-tp5717691.html Sent from the VTK - Users mailing list archive at Nabble.com. From Veena.M at hcl.com Fri Dec 21 06:04:30 2012 From: Veena.M at hcl.com (Veena M) Date: Fri, 21 Dec 2012 16:34:30 +0530 Subject: [vtkusers] MFC with ITK 3.10.1 and VTK 5.2 application is running fine in debug mode, crashing in release mode Message-ID: <079F6BF18B503642B1D9FF50379A901C1C6101F3CB@CHN-HCLT-EVS17.HCLT.CORP.HCL.IN> Hi all, I am using MFC with ITK 3.10.1 and VTK 5.2 The application is running fine in debug mode. Its breaking in release mode in the file gdcmDictSet.cxx std::string DictSet::BuildDictPath() { std::string resultPath; const char *envPath; envPath = getenv("GDCM_DICT_PATH"); if (envPath && (strlen(envPath) != 0)) { resultPath = envPath; gdcmWarningMacro( "Dictionary path set from environnement"); } else { resultPath = PUB_DICT_PATH; // breaking here } if ( resultPath.length() && resultPath[resultPath.length()-1] != '/' ) { resultPath += '/'; } return resultPath; } Please help me to resolve this . Thanks in advance Veena ::DISCLAIMER:: ---------------------------------------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents (with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of authorized representative of HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any email and/or attachments, please check them for viruses and other defects. ---------------------------------------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From craig.henderson at intelligentultrasound.com Fri Dec 21 06:10:06 2012 From: craig.henderson at intelligentultrasound.com (Craig Henderson) Date: Fri, 21 Dec 2012 11:10:06 +0000 Subject: [vtkusers] MFC with ITK 3.10.1 and VTK 5.2 application is running fine in debug mode, crashing in release mode In-Reply-To: <079F6BF18B503642B1D9FF50379A901C1C6101F3CB@CHN-HCLT-EVS17.HCLT.CORP.HCL.IN> References: <079F6BF18B503642B1D9FF50379A901C1C6101F3CB@CHN-HCLT-EVS17.HCLT.CORP.HCL.IN> Message-ID: <630A9ECA-11E5-4798-9002-7048B9C07CAB@intelligentultrasound.com> Have a look at the call stack to determine where it is crashing. It's likely to be in the memory allocation during assignment to the string. A common cause of this is linking the Release build if your app to the ITK Debug library. Craig Sent from my iPhone On 21 Dec 2012, at 11:04, Veena M wrote: > debug From sebastien.jourdain at kitware.com Fri Dec 21 09:21:08 2012 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Fri, 21 Dec 2012 09:21:08 -0500 Subject: [vtkusers] doubts about vtkVRMLImporter In-Reply-To: References: Message-ID: It might be some limitation of the importer itself. On Thu, Dec 20, 2012 at 2:28 PM, Fabiano Stange wrote: > Hi! > I have some doubts about vtkVRMLImporter. > I am using VTK version 5.4 and Visual Studio C++ 2008 to import a wrl file. > But it is not working very well. > If the wrl file has more then one DEF node, vtk only visualizes the first > DEF node. > > For example, a solid model like a building can be writing in wrl format > using a DEF node for which object (foundations, columns, beams, slabs, > walls and roofs). > Here is a part of the wrl file i like to visualize in vtk: > > #VRML V2.0 utf8 > > DEF Structural_Columns_ Transform { > translation -10700 4650 -17490 > children DEF Structural_Columns__0 > Transform { > translation 0 0 0 > children Shape { > appearance Appearance { > material Material {diffuseColor 1 0 1} > texture ImageTexture { > url " > http://t3.gstatic.com/images?q=tbn:ANd9GcSNUBcHJyaWrODD9_EyOSBRAvBB_3dRhTlocB1S6qEk5Mz3XW9x2w > " > repeatS TRUE > repeatT TRUE > } > } > geometry DEF > Structural_Columns__0-FACES > IndexedFaceSet { > ccw TRUE > solid TRUE > coord DEF > Structural_Columns__0-COORD > Coordinate {point [...]} > coordIndex [ ... ] > } > } > } > } > > DEF Structural_Columns__01 > Transform { > translation -5204 7750 -17490 > children DEF > Structural_Columns__02 Transform { > translation 0 0 0 > children Shape { > appearance Appearance {material Material {diffuseColor 1 0 1}} > geometry DEF > Structural_Columns__02-FACES > IndexedFaceSet { > ccw TRUE > solid TRUE > coord DEF > Structural_Columns__02-COORD > Coordinate {point [...} > coordIndex [...] > } > } > } > } > ... > > Even if i use the group node vtk still visualizes the first DEF node. > And there is more problems. > The first DEF node that vtk visualizes does not read the Appearance node, > the Material node and the Color node. > > I am using the example in http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/VRML > . > Is something wrong or the vtkVRMLImporter works like that? > > Thanks, > Fabiano Stange > > _______________________________________________ > 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://www.vtk.org/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From acsantome at gmail.com Fri Dec 21 11:38:42 2012 From: acsantome at gmail.com (a.c.sant) Date: Fri, 21 Dec 2012 08:38:42 -0800 (PST) Subject: [vtkusers] Hide/show viewports Message-ID: <1356107922784-5717695.post@n5.nabble.com> Hi! I'm trying to set multiple viewports in a window and having the user choose which viewport view at each moment. For example, starting with viewport #1, if the user clicks a button, hide #1 and show #2. Currently, I'm playing with Renderer::SetViewport and Renderer::GetViewport but still can't make this work. Maybe it's not possible? I would like to hear your opinions. Cheers! -- View this message in context: http://vtk.1045678.n5.nabble.com/Hide-show-viewports-tp5717695.html Sent from the VTK - Users mailing list archive at Nabble.com. From jd379252 at gmail.com Fri Dec 21 12:56:08 2012 From: jd379252 at gmail.com (pof) Date: Fri, 21 Dec 2012 18:56:08 +0100 Subject: [vtkusers] Bug in vtkStripper on a very simple case ? In-Reply-To: References: <50C4E39B.9030400@gmail.com> <50C4F0C5.8000800@gmail.com> <50C4F67D.4090205@gmail.com> <50C50738.4030109@gmail.com> <50D226A9.5050409@gmail.com> <50D354CD.80401@gmail.com> Message-ID: <50D4A2B8.1060508@gmail.com> It could be worth including this patch in the next vtk release, don't you think? Maybe some people from Kitware have an opinion on this. JD Le 21/12/2012 18:39, Goodwin Lawlor a ?crit : > That's great. Best of luck with your project. > > Goodwin > > On Thu, Dec 20, 2012 at 10:11 PM, pof > wrote: > > Goodwin, > this is strange... I tried yesterday and I found it did not work > (I must have done something with my testing). > I tested again, and this works. > Great and thanks > JD > > Le 20/12/2012 17:05, Goodwin Lawlor a ?crit : >> JD, >> >> Pass the final polyline through vtkCleanPolyData with 0.0 >> tolerance (the default) and it should remove the coincident points. >> >> hth >> >> Goodwin >> >> On Thu, Dec 20, 2012 at 12:42 AM, pof > > wrote: >> >> Goodwin, >> >> I tested the patch on the following simple case (5 segments) >> # vtk DataFile Version 3.0 >> vtk output >> ASCII >> DATASET POLYDATA >> POINTS 6 float >> 1.7 0.5 0 2 0 0 1.7 -0.5 0 >> 1.6 -1 0 1.8 -0.2 0 1.6 1 0 >> LINES 5 15 >> 2 0 1 >> 2 2 3 >> 2 4 2 >> 2 1 4 >> 2 5 0 >> >> without the patch, 2 polylines are obtained from the vtkStripper >> LINES 2 9 >> 5 0 1 4 2 3 >> 2 5 0 >> >> whereas with the patch a single polyline is obained >> LINES 1 8 >> 7 5 0 0 1 4 2 3 >> >> Things are of course better, though a duplicate of one point >> (point 0 in this case) is obtained, which should obviously >> have been avoided. >> So it looks there's stil some space to improve the patch. >> >> In any case, I thank you for sharing this information with me. >> JD >> >> >> Le 19/12/2012 10:04, Goodwin Lawlor a ?crit : >>> I think vtkStripper was originally written to quickly >>> produce vtkTriangleStrip/vtkPolyLine primitives that would >>> render faster, not a computational geometry type class that >>> would produce the longest possible polylines... it is a >>> visualization library after all. >>> >>> The seed point is arbitrary so you may not get the outcome >>> you were looking for. >>> >>> See this 2002 post, that contains a patch which may help: >>> http://vtk.org/pipermail/vtkusers/2002-January/009372.html >>> >>> There was a bug report too: >>> http://www.vtk.org/Bug/print_bug_page.php?bug_id=832 >>> >>> hth >>> >>> Goodwin >>> >>> >>> On Mon, Dec 10, 2012 at 2:51 AM, David Gobbi >>> > wrote: >>> >>> Insert vtkTriangleFilter before vtkStripper. This will >>> break any >>> input polylines into line segments. I don't know if it >>> will help, >>> but it might. >>> >>> - David >>> >>> On Sun, Dec 9, 2012 at 2:48 PM, pof >> > wrote: >>> > yes this is the way LINES objects are written on vtk >>> files. >>> > Ok, so I understand now the point you were making >>> about the "T", which was >>> > uncorrect. >>> > >>> > So back to the problem, why this vtkStripper is not >>> able to merge those 2 >>> > lines? >>> > >>> > Le 09/12/2012 21:41, David Gobbi a ?crit : >>> >> >>> >> Is it? Maybe it is. When you wrote the numbers, I >>> assumed that >>> >> >>> >> all of the numbers that you listed were just point >>> indices. >>> >> >>> >> >>> >> On Sun, Dec 9, 2012 at 1:37 PM, pof >>> > wrote: >>> >>> >>> >>> Hum I see. >>> >>> (from what I understand), the first integer of each >>> line is simply the >>> >>> number of points of the corresponding LINE >>> >>> >>> >>> Le 09/12/2012 21:33, David Gobbi a ?crit : >>> >>> >>> >>>> Then where would the "9" go? >>> >>>> >>> >>>> The stripper uses a simple algorithm, it just >>> chooses a starting >>> >>>> point, goes as far as it can in each direction to >>> create the first >>> >>>> polyline, and then repeats this procedure until all >>> the line segments >>> >>>> are accounted for. It doesn't exhaustively search >>> though all >>> >>>> permutations to see which one gives the smallest >>> number of output >>> >>>> polylines... that would cause the algorithm to run >>> many times slower. >>> >>>> >>> >>>> >>> >>>> >>> >>>> >>> >>>> On Sun, Dec 9, 2012 at 1:12 PM, pof >>> > wrote: >>> >>>>> >>> >>>>> Hi David >>> >>>>> >>> >>>>> the first polyline being: >>> >>>>> >>> >>>>> 9 0 1 2 3 4 5 19 6 7 >>> >>>>> and the third polyline (actually it is a segment) >>> being: >>> >>>>> 2 18 0 >>> >>>>> I don't see why they shoud not merge together as >>> (unless I >>> >>>>> misunderstand >>> >>>>> something): >>> >>>>> 10 18 0 1 2 3 4 5 19 6 7 >>> >>>>> >>> >>>>> Am I wrong? >>> >>>>> >>> >>>>> >>> >>>>> Le 09/12/2012 21:05, David Gobbi a ?crit : >>> >>>>> >>> >>>>>> Hi JD, >>> >>>>>> >>> >>>>>> It could only merge those two lines if it joined >>> them with a "T". >>> >>>>>> A polyline cannot have any branches. >>> >>>>>> >>> >>>>>> - David >>> >>>>>> >>> >>>>>> >>> >>>>>> On Sun, Dec 9, 2012 at 12:16 PM, pof >>> > wrote: >>> >>>>>>> >>> >>>>>>> Hi all, >>> >>>>>>> >>> >>>>>>> I get a strange result (which may be a bug) >>> using vtk stripper, i.e. >>> >>>>>>> it >>> >>>>>>> does >>> >>>>>>> not merge LINES as polylines as it is expected to. >>> >>>>>>> In this example (see below an extract of the >>> polydata produced by >>> >>>>>>> vtkStripper), only 2 polylines should be >>> obtained, but vtkStripper >>> >>>>>>> forgot >>> >>>>>>> to >>> >>>>>>> merge the first and the third line together, >>> though they obviously >>> >>>>>>> share >>> >>>>>>> point with Id=0 (btw, the fact that only Id 0 >>> remains unmerged might >>> >>>>>>> not >>> >>>>>>> be >>> >>>>>>> pure luck). >>> >>>>>>> >>> >>>>>>> LINES 3 24 >>> >>>>>>> 9 0 1 2 3 4 5 19 6 7 >>> >>>>>>> 10 9 8 17 13 12 15 14 11 10 16 >>> >>>>>>> 2 18 0 >>> >>>>>>> Does anybody have an idea or an explanation? >>> >>>>>>> Thanks >>> >>>>>>> JD >>> >>>>>>> >>> >>>>>>> PS: Here below is the complete source file that >>> generates these data >>> >>>>>>> and >>> >>>>>>> in >>> >>>>>>> which vtkStripper is used. >>> >>>>>>> >>> >>>>>>> >>> ////////////////////////////////////////////////////// >>> >>>>>>> // Example modified from >>> IntersectionPolyDataFilter.cxx >>> >>>>>>> >>> ////////////////////////////////////////////////////// >>> >>>>>>> #include >>> >>>>>>> #include >>> >>>>>>> #include >>> >>>>>>> #include >>> >>>>>>> #include >>> >>>>>>> #include >>> >>>>>>> #include >>> >>>>>>> #include >>> >>>>>>> #include >>> >>>>>>> #include >>> >>>>>>> #include >>> >>>>>>> #include >>> >>>>>>> >>> >>>>>>> int main(int argc, char *argv[]) >>> >>>>>>> { >>> >>>>>>> vtkSmartPointer sphereSource1 = >>> >>>>>>> vtkSmartPointer::New(); >>> >>>>>>> sphereSource1->SetCenter(0.0, 0.0, 0.0); >>> >>>>>>> sphereSource1->SetRadius(2.0f); >>> >>>>>>> sphereSource1->SetPhiResolution(20); >>> >>>>>>> sphereSource1->SetThetaResolution(20); >>> >>>>>>> sphereSource1->Update(); >>> >>>>>>> vtkSmartPointer sphere1Mapper = >>> >>>>>>> vtkSmartPointer::New(); >>> >>>>>>> sphere1Mapper->SetInputConnection( >>> >>>>>>> sphereSource1->GetOutputPort() >>> >>>>>>> ); >>> >>>>>>> sphere1Mapper->ScalarVisibilityOff(); >>> >>>>>>> vtkSmartPointer sphere1Actor = >>> >>>>>>> vtkSmartPointer::New(); >>> >>>>>>> sphere1Actor->SetMapper( sphere1Mapper ); >>> >>>>>>> sphere1Actor->GetProperty()->SetOpacity(.3); >>> >>>>>>> sphere1Actor->GetProperty()->SetColor(1,0,0); >>> >>>>>>> >>> >>>>>>> ///////////////////////// >>> >>>>>>> // BEGIN MODIFICATIONS // >>> >>>>>>> ///////////////////////// >>> >>>>>>> // Create a planar object >>> >>>>>>> // Define 4 vertices >>> >>>>>>> vtkSmartPointer PlanePoints = >>> >>>>>>> vtkSmartPointer::New(); >>> >>>>>>> vtkSmartPointer PlaneCells = >>> >>>>>>> vtkSmartPointer::New(); >>> >>>>>>> PlanePoints->InsertNextPoint(-3, -1, 0); >>> >>>>>>> PlanePoints->InsertNextPoint(3, -1, 0); >>> >>>>>>> PlanePoints->InsertNextPoint(-3, 1, 0); >>> >>>>>>> PlanePoints->InsertNextPoint(3, 1, 0); >>> >>>>>>> // Create 2 trianglar faces >>> >>>>>>> PlaneCells->InsertNextCell(3); >>> >>>>>>> PlaneCells->InsertCellPoint(0); >>> >>>>>>> PlaneCells->InsertCellPoint(1); >>> >>>>>>> PlaneCells->InsertCellPoint(2); >>> >>>>>>> PlaneCells->InsertNextCell(3); >>> >>>>>>> PlaneCells->InsertCellPoint(1); >>> >>>>>>> PlaneCells->InsertCellPoint(3); >>> >>>>>>> PlaneCells->InsertCellPoint(2); >>> >>>>>>> // Create the polydata from points and faces >>> >>>>>>> vtkSmartPointer ProtectionWall = >>> >>>>>>> vtkSmartPointer::New(); >>> >>>>>>> ProtectionWall->SetPoints(PlanePoints); >>> >>>>>>> ProtectionWall->SetPolys(PlaneCells); >>> >>>>>>> ///////////////////////// >>> >>>>>>> // END MODIFICATIONS // >>> >>>>>>> ///////////////////////// >>> >>>>>>> >>> >>>>>>> vtkSmartPointer planeMapper = >>> >>>>>>> vtkSmartPointer::New(); >>> >>>>>>> planeMapper->SetInputConnection( >>> >>>>>>> ProtectionWall->GetProducerPort() >>> >>>>>>> ); >>> >>>>>>> planeMapper->ScalarVisibilityOff(); >>> >>>>>>> >>> >>>>>>> vtkSmartPointer planeActor = >>> >>>>>>> vtkSmartPointer::New(); >>> >>>>>>> planeActor->SetMapper( planeMapper ); >>> >>>>>>> planeActor->GetProperty()->SetOpacity(.3); >>> >>>>>>> planeActor->GetProperty()->SetColor(0,1,0); >>> >>>>>>> >>> >>>>>>> // Get intersection segments (LINES) using the >>> >>>>>>> vtkIntersectionPolyDataFilter >>> >>>>>>> vtkSmartPointer >>> >>>>>>> intersectionPolyDataFilter >>> >>>>>>> = >>> vtkSmartPointer::New(); >>> >>>>>>> intersectionPolyDataFilter->SplitFirstOutputOff(); >>> >>>>>>> intersectionPolyDataFilter->SplitSecondOutputOff(); >>> >>>>>>> intersectionPolyDataFilter->SetInputConnection( 0, >>> >>>>>>> sphereSource1->GetOutputPort() ); >>> >>>>>>> intersectionPolyDataFilter->SetInputConnection( 1, >>> >>>>>>> ProtectionWall->GetProducerPort() ); >>> >>>>>>> intersectionPolyDataFilter->Update(); >>> >>>>>>> >>> >>>>>>> ///////////////////////// >>> >>>>>>> // BEGIN MODIFICATIONS // >>> >>>>>>> ///////////////////////// >>> >>>>>>> // Try to get the polylines (there should >>> be 2) from the >>> >>>>>>> segments >>> >>>>>>> (LINES) >>> >>>>>>> vtkSmartPointer stripper = >>> >>>>>>> vtkSmartPointer::New(); >>> >>>>>>> >>> >>>>>>> >>> >>>>>>> >>> >>>>>>> >>> stripper->SetInputConnection(intersectionPolyDataFilter->GetOutputPort()); >>> >>>>>>> stripper->Update(); >>> >>>>>>> // Save resulting polydata on a file, in >>> which we see that there >>> >>>>>>> are 3 >>> >>>>>>> polylines (actually the second polyline is ok, >>> >>>>>>> // but the first and third polylines should >>> have been further >>> >>>>>>> merged >>> >>>>>>> vtkSmartPointer wr = >>> >>>>>>> vtkSmartPointer::New(); >>> >>>>>>> wr->SetFileName("polylines.txt"); >>> >>>>>>> wr->SetInputConnection(stripper->GetOutputPort()); >>> >>>>>>> wr->Write(); >>> >>>>>>> /////////////////////// >>> >>>>>>> // END MODIFICATIONS // >>> >>>>>>> /////////////////////// >>> >>>>>>> >>> >>>>>>> vtkSmartPointer >>> intersectionMapper = >>> >>>>>>> vtkSmartPointer::New(); >>> >>>>>>> intersectionMapper->SetInputConnection( >>> >>>>>>> stripper->GetOutputPort() >>> >>>>>>> ); >>> >>>>>>> intersectionMapper->ScalarVisibilityOff(); >>> >>>>>>> >>> >>>>>>> vtkSmartPointer intersectionActor = >>> >>>>>>> vtkSmartPointer::New(); >>> >>>>>>> intersectionActor->SetMapper( intersectionMapper ); >>> >>>>>>> >>> >>>>>>> vtkSmartPointer renderer = >>> >>>>>>> vtkSmartPointer::New(); >>> >>>>>>> renderer->AddViewProp(sphere1Actor); >>> >>>>>>> renderer->AddViewProp(planeActor); >>> >>>>>>> renderer->AddViewProp(intersectionActor); >>> >>>>>>> >>> >>>>>>> vtkSmartPointer renderWindow = >>> >>>>>>> vtkSmartPointer::New(); >>> >>>>>>> renderWindow->AddRenderer( renderer ); >>> >>>>>>> >>> >>>>>>> vtkSmartPointer >>> renWinInteractor = >>> >>>>>>> vtkSmartPointer::New(); >>> >>>>>>> renWinInteractor->SetRenderWindow( renderWindow ); >>> >>>>>>> >>> >>>>>>> renderWindow->Render(); >>> >>>>>>> renderWindow->SetSize(600, 600); >>> >>>>>>> renderer->SetBackground(0.1, 0.2, 0.4); >>> >>>>>>> renWinInteractor->Start(); >>> >>>>>>> >>> >>>>>>> return EXIT_SUCCESS; >>> >>>>>>> } >>> >>>>> >>> >>>>> >>> > >>> _______________________________________________ >>> 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://www.vtk.org/mailman/listinfo/vtkusers >>> >>> >> >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From benjamin-berkowitz at uiowa.edu Fri Dec 21 13:18:26 2012 From: benjamin-berkowitz at uiowa.edu (bberkowi) Date: Fri, 21 Dec 2012 10:18:26 -0800 (PST) Subject: [vtkusers] Mac/VTK/Qt problems In-Reply-To: <415758d20906240713t95f5cb3p737d56e17cbccf64@mail.gmail.com> References: <415758d20906161151k3c283ee8w89848fc282e4a305@mail.gmail.com> <20090616225818.1164164797@76.65.240.2> <415758d20906181045o3dac33d5qc3734ad3dee07874@mail.gmail.com> <4A40F169.2020300@elemtech.com> <4A40FAC7.3010609@elemtech.com> <415758d20906240713t95f5cb3p737d56e17cbccf64@mail.gmail.com> Message-ID: <1356113906174-5717697.post@n5.nabble.com> I realize this thread is old, but I'm having problems building the examples also. I'm using Mac 10.8 with Qt 4.8.4 and VTK 5.10. When I run make, I get the following error: Linking CXX executable EventQtSlotConnect.app/Contents/MacOS/EventQtSlotConnect Undefined symbols for architecture x86_64: "QVTKWidget::QVTKWidget(QWidget*, QFlags)", referenced from: Ui_EventQtSlotConnect::setupUi(QMainWindow*) in EventQtSlotConnect.cxx.o "vtkEventQtSlotConnect::New()", referenced from: vtkSmartPointer::New() in EventQtSlotConnect.cxx.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [EventQtSlotConnect.app/Contents/MacOS/EventQtSlotConnect] Error 1 make[1]: *** [CMakeFiles/EventQtSlotConnect.dir/all] Error 2 make: *** [all] Error 2 Is this an issue with VTK or do I maybe have something installed incorrectly? -- View this message in context: http://vtk.1045678.n5.nabble.com/Mac-VTK-Qt-problems-tp1246044p5717697.html Sent from the VTK - Users mailing list archive at Nabble.com. From goodwin.lawlor.lists at gmail.com Fri Dec 21 13:19:46 2012 From: goodwin.lawlor.lists at gmail.com (Goodwin Lawlor) Date: Fri, 21 Dec 2012 22:19:46 +0400 Subject: [vtkusers] Bug in vtkStripper on a very simple case ? In-Reply-To: <50D4A2B8.1060508@gmail.com> References: <50C4E39B.9030400@gmail.com> <50C4F0C5.8000800@gmail.com> <50C4F67D.4090205@gmail.com> <50C50738.4030109@gmail.com> <50D226A9.5050409@gmail.com> <50D354CD.80401@gmail.com> <50D4A2B8.1060508@gmail.com> Message-ID: As you saw, it's been through the bug tracker before... perhaps it was decided that the extra overhead wasn't worth solving what is probably an edge case for most people. This time around you could add a flag to the class to do the extra "joining up", but set the default to the old behaviour. You could push a branch to Gerrit for review. http://www.vtk.org/Wiki/VTK/Git/Develop Goodwin On Fri, Dec 21, 2012 at 9:56 PM, pof wrote: > It could be worth including this patch in the next vtk release, don't > you think? > Maybe some people from Kitware have an opinion on this. > JD > > Le 21/12/2012 18:39, Goodwin Lawlor a ?crit : > > That's great. Best of luck with your project. > > Goodwin > > On Thu, Dec 20, 2012 at 10:11 PM, pof wrote: > >> Goodwin, >> this is strange... I tried yesterday and I found it did not work (I must >> have done something with my testing). >> I tested again, and this works. >> Great and thanks >> JD >> >> Le 20/12/2012 17:05, Goodwin Lawlor a ?crit : >> >> JD, >> >> Pass the final polyline through vtkCleanPolyData with 0.0 tolerance >> (the default) and it should remove the coincident points. >> >> hth >> >> Goodwin >> >> On Thu, Dec 20, 2012 at 12:42 AM, pof wrote: >> >>> Goodwin, >>> >>> I tested the patch on the following simple case (5 segments) >>> # vtk DataFile Version 3.0 >>> vtk output >>> ASCII >>> DATASET POLYDATA >>> POINTS 6 float >>> 1.7 0.5 0 2 0 0 1.7 -0.5 0 >>> 1.6 -1 0 1.8 -0.2 0 1.6 1 0 >>> LINES 5 15 >>> 2 0 1 >>> 2 2 3 >>> 2 4 2 >>> 2 1 4 >>> 2 5 0 >>> >>> without the patch, 2 polylines are obtained from the vtkStripper >>> LINES 2 9 >>> 5 0 1 4 2 3 >>> 2 5 0 >>> >>> whereas with the patch a single polyline is obained >>> LINES 1 8 >>> 7 5 0 0 1 4 2 3 >>> >>> Things are of course better, though a duplicate of one point (point 0 in >>> this case) is obtained, which should obviously have been avoided. >>> So it looks there's stil some space to improve the patch. >>> >>> In any case, I thank you for sharing this information with me. >>> JD >>> >>> >>> Le 19/12/2012 10:04, Goodwin Lawlor a ?crit : >>> >>> I think vtkStripper was originally written to quickly produce >>> vtkTriangleStrip/vtkPolyLine primitives that would render faster, not a >>> computational geometry type class that would produce the longest possible >>> polylines... it is a visualization library after all. >>> >>> The seed point is arbitrary so you may not get the outcome you were >>> looking for. >>> >>> See this 2002 post, that contains a patch which may help: >>> http://vtk.org/pipermail/vtkusers/2002-January/009372.html >>> >>> There was a bug report too: >>> http://www.vtk.org/Bug/print_bug_page.php?bug_id=832 >>> >>> hth >>> >>> Goodwin >>> >>> >>> On Mon, Dec 10, 2012 at 2:51 AM, David Gobbi wrote: >>> >>>> Insert vtkTriangleFilter before vtkStripper. This will break any >>>> input polylines into line segments. I don't know if it will help, >>>> but it might. >>>> >>>> - David >>>> >>>> On Sun, Dec 9, 2012 at 2:48 PM, pof wrote: >>>> > yes this is the way LINES objects are written on vtk files. >>>> > Ok, so I understand now the point you were making about the "T", >>>> which was >>>> > uncorrect. >>>> > >>>> > So back to the problem, why this vtkStripper is not able to merge >>>> those 2 >>>> > lines? >>>> > >>>> > Le 09/12/2012 21:41, David Gobbi a ?crit : >>>> >> >>>> >> Is it? Maybe it is. When you wrote the numbers, I assumed that >>>> >> >>>> >> all of the numbers that you listed were just point indices. >>>> >> >>>> >> >>>> >> On Sun, Dec 9, 2012 at 1:37 PM, pof wrote: >>>> >>> >>>> >>> Hum I see. >>>> >>> (from what I understand), the first integer of each line is simply >>>> the >>>> >>> number of points of the corresponding LINE >>>> >>> >>>> >>> Le 09/12/2012 21:33, David Gobbi a ?crit : >>>> >>> >>>> >>>> Then where would the "9" go? >>>> >>>> >>>> >>>> The stripper uses a simple algorithm, it just chooses a starting >>>> >>>> point, goes as far as it can in each direction to create the first >>>> >>>> polyline, and then repeats this procedure until all the line >>>> segments >>>> >>>> are accounted for. It doesn't exhaustively search though all >>>> >>>> permutations to see which one gives the smallest number of output >>>> >>>> polylines... that would cause the algorithm to run many times >>>> slower. >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> On Sun, Dec 9, 2012 at 1:12 PM, pof wrote: >>>> >>>>> >>>> >>>>> Hi David >>>> >>>>> >>>> >>>>> the first polyline being: >>>> >>>>> >>>> >>>>> 9 0 1 2 3 4 5 19 6 7 >>>> >>>>> and the third polyline (actually it is a segment) being: >>>> >>>>> 2 18 0 >>>> >>>>> I don't see why they shoud not merge together as (unless I >>>> >>>>> misunderstand >>>> >>>>> something): >>>> >>>>> 10 18 0 1 2 3 4 5 19 6 7 >>>> >>>>> >>>> >>>>> Am I wrong? >>>> >>>>> >>>> >>>>> >>>> >>>>> Le 09/12/2012 21:05, David Gobbi a ?crit : >>>> >>>>> >>>> >>>>>> Hi JD, >>>> >>>>>> >>>> >>>>>> It could only merge those two lines if it joined them with a "T". >>>> >>>>>> A polyline cannot have any branches. >>>> >>>>>> >>>> >>>>>> - David >>>> >>>>>> >>>> >>>>>> >>>> >>>>>> On Sun, Dec 9, 2012 at 12:16 PM, pof wrote: >>>> >>>>>>> >>>> >>>>>>> Hi all, >>>> >>>>>>> >>>> >>>>>>> I get a strange result (which may be a bug) using vtk stripper, >>>> i.e. >>>> >>>>>>> it >>>> >>>>>>> does >>>> >>>>>>> not merge LINES as polylines as it is expected to. >>>> >>>>>>> In this example (see below an extract of the polydata produced >>>> by >>>> >>>>>>> vtkStripper), only 2 polylines should be obtained, but >>>> vtkStripper >>>> >>>>>>> forgot >>>> >>>>>>> to >>>> >>>>>>> merge the first and the third line together, though they >>>> obviously >>>> >>>>>>> share >>>> >>>>>>> point with Id=0 (btw, the fact that only Id 0 remains unmerged >>>> might >>>> >>>>>>> not >>>> >>>>>>> be >>>> >>>>>>> pure luck). >>>> >>>>>>> >>>> >>>>>>> LINES 3 24 >>>> >>>>>>> 9 0 1 2 3 4 5 19 6 7 >>>> >>>>>>> 10 9 8 17 13 12 15 14 11 10 16 >>>> >>>>>>> 2 18 0 >>>> >>>>>>> Does anybody have an idea or an explanation? >>>> >>>>>>> Thanks >>>> >>>>>>> JD >>>> >>>>>>> >>>> >>>>>>> PS: Here below is the complete source file that generates these >>>> data >>>> >>>>>>> and >>>> >>>>>>> in >>>> >>>>>>> which vtkStripper is used. >>>> >>>>>>> >>>> >>>>>>> ////////////////////////////////////////////////////// >>>> >>>>>>> // Example modified from IntersectionPolyDataFilter.cxx >>>> >>>>>>> ////////////////////////////////////////////////////// >>>> >>>>>>> #include >>>> >>>>>>> #include >>>> >>>>>>> #include >>>> >>>>>>> #include >>>> >>>>>>> #include >>>> >>>>>>> #include >>>> >>>>>>> #include >>>> >>>>>>> #include >>>> >>>>>>> #include >>>> >>>>>>> #include >>>> >>>>>>> #include >>>> >>>>>>> #include >>>> >>>>>>> >>>> >>>>>>> int main(int argc, char *argv[]) >>>> >>>>>>> { >>>> >>>>>>> vtkSmartPointer sphereSource1 = >>>> >>>>>>> vtkSmartPointer::New(); >>>> >>>>>>> sphereSource1->SetCenter(0.0, 0.0, 0.0); >>>> >>>>>>> sphereSource1->SetRadius(2.0f); >>>> >>>>>>> sphereSource1->SetPhiResolution(20); >>>> >>>>>>> sphereSource1->SetThetaResolution(20); >>>> >>>>>>> sphereSource1->Update(); >>>> >>>>>>> vtkSmartPointer sphere1Mapper = >>>> >>>>>>> vtkSmartPointer::New(); >>>> >>>>>>> sphere1Mapper->SetInputConnection( >>>> >>>>>>> sphereSource1->GetOutputPort() >>>> >>>>>>> ); >>>> >>>>>>> sphere1Mapper->ScalarVisibilityOff(); >>>> >>>>>>> vtkSmartPointer sphere1Actor = >>>> >>>>>>> vtkSmartPointer::New(); >>>> >>>>>>> sphere1Actor->SetMapper( sphere1Mapper ); >>>> >>>>>>> sphere1Actor->GetProperty()->SetOpacity(.3); >>>> >>>>>>> sphere1Actor->GetProperty()->SetColor(1,0,0); >>>> >>>>>>> >>>> >>>>>>> ///////////////////////// >>>> >>>>>>> // BEGIN MODIFICATIONS // >>>> >>>>>>> ///////////////////////// >>>> >>>>>>> // Create a planar object >>>> >>>>>>> // Define 4 vertices >>>> >>>>>>> vtkSmartPointer PlanePoints = >>>> >>>>>>> vtkSmartPointer::New(); >>>> >>>>>>> vtkSmartPointer PlaneCells = >>>> >>>>>>> vtkSmartPointer::New(); >>>> >>>>>>> PlanePoints->InsertNextPoint(-3, -1, 0); >>>> >>>>>>> PlanePoints->InsertNextPoint(3, -1, 0); >>>> >>>>>>> PlanePoints->InsertNextPoint(-3, 1, 0); >>>> >>>>>>> PlanePoints->InsertNextPoint(3, 1, 0); >>>> >>>>>>> // Create 2 trianglar faces >>>> >>>>>>> PlaneCells->InsertNextCell(3); >>>> >>>>>>> PlaneCells->InsertCellPoint(0); >>>> >>>>>>> PlaneCells->InsertCellPoint(1); >>>> >>>>>>> PlaneCells->InsertCellPoint(2); >>>> >>>>>>> PlaneCells->InsertNextCell(3); >>>> >>>>>>> PlaneCells->InsertCellPoint(1); >>>> >>>>>>> PlaneCells->InsertCellPoint(3); >>>> >>>>>>> PlaneCells->InsertCellPoint(2); >>>> >>>>>>> // Create the polydata from points and faces >>>> >>>>>>> vtkSmartPointer ProtectionWall = >>>> >>>>>>> vtkSmartPointer::New(); >>>> >>>>>>> ProtectionWall->SetPoints(PlanePoints); >>>> >>>>>>> ProtectionWall->SetPolys(PlaneCells); >>>> >>>>>>> ///////////////////////// >>>> >>>>>>> // END MODIFICATIONS // >>>> >>>>>>> ///////////////////////// >>>> >>>>>>> >>>> >>>>>>> vtkSmartPointer planeMapper = >>>> >>>>>>> vtkSmartPointer::New(); >>>> >>>>>>> planeMapper->SetInputConnection( >>>> >>>>>>> ProtectionWall->GetProducerPort() >>>> >>>>>>> ); >>>> >>>>>>> planeMapper->ScalarVisibilityOff(); >>>> >>>>>>> >>>> >>>>>>> vtkSmartPointer planeActor = >>>> >>>>>>> vtkSmartPointer::New(); >>>> >>>>>>> planeActor->SetMapper( planeMapper ); >>>> >>>>>>> planeActor->GetProperty()->SetOpacity(.3); >>>> >>>>>>> planeActor->GetProperty()->SetColor(0,1,0); >>>> >>>>>>> >>>> >>>>>>> // Get intersection segments (LINES) using the >>>> >>>>>>> vtkIntersectionPolyDataFilter >>>> >>>>>>> vtkSmartPointer >>>> >>>>>>> intersectionPolyDataFilter >>>> >>>>>>> = vtkSmartPointer::New(); >>>> >>>>>>> intersectionPolyDataFilter->SplitFirstOutputOff(); >>>> >>>>>>> intersectionPolyDataFilter->SplitSecondOutputOff(); >>>> >>>>>>> intersectionPolyDataFilter->SetInputConnection( 0, >>>> >>>>>>> sphereSource1->GetOutputPort() ); >>>> >>>>>>> intersectionPolyDataFilter->SetInputConnection( 1, >>>> >>>>>>> ProtectionWall->GetProducerPort() ); >>>> >>>>>>> intersectionPolyDataFilter->Update(); >>>> >>>>>>> >>>> >>>>>>> ///////////////////////// >>>> >>>>>>> // BEGIN MODIFICATIONS // >>>> >>>>>>> ///////////////////////// >>>> >>>>>>> // Try to get the polylines (there should be 2) from the >>>> >>>>>>> segments >>>> >>>>>>> (LINES) >>>> >>>>>>> vtkSmartPointer stripper = >>>> >>>>>>> vtkSmartPointer::New(); >>>> >>>>>>> >>>> >>>>>>> >>>> >>>>>>> >>>> >>>>>>> >>>> stripper->SetInputConnection(intersectionPolyDataFilter->GetOutputPort()); >>>> >>>>>>> stripper->Update(); >>>> >>>>>>> // Save resulting polydata on a file, in which we see that >>>> there >>>> >>>>>>> are 3 >>>> >>>>>>> polylines (actually the second polyline is ok, >>>> >>>>>>> // but the first and third polylines should have been >>>> further >>>> >>>>>>> merged >>>> >>>>>>> vtkSmartPointer wr = >>>> >>>>>>> vtkSmartPointer::New(); >>>> >>>>>>> wr->SetFileName("polylines.txt"); >>>> >>>>>>> wr->SetInputConnection(stripper->GetOutputPort()); >>>> >>>>>>> wr->Write(); >>>> >>>>>>> /////////////////////// >>>> >>>>>>> // END MODIFICATIONS // >>>> >>>>>>> /////////////////////// >>>> >>>>>>> >>>> >>>>>>> vtkSmartPointer intersectionMapper = >>>> >>>>>>> vtkSmartPointer::New(); >>>> >>>>>>> intersectionMapper->SetInputConnection( >>>> >>>>>>> stripper->GetOutputPort() >>>> >>>>>>> ); >>>> >>>>>>> intersectionMapper->ScalarVisibilityOff(); >>>> >>>>>>> >>>> >>>>>>> vtkSmartPointer intersectionActor = >>>> >>>>>>> vtkSmartPointer::New(); >>>> >>>>>>> intersectionActor->SetMapper( intersectionMapper ); >>>> >>>>>>> >>>> >>>>>>> vtkSmartPointer renderer = >>>> >>>>>>> vtkSmartPointer::New(); >>>> >>>>>>> renderer->AddViewProp(sphere1Actor); >>>> >>>>>>> renderer->AddViewProp(planeActor); >>>> >>>>>>> renderer->AddViewProp(intersectionActor); >>>> >>>>>>> >>>> >>>>>>> vtkSmartPointer renderWindow = >>>> >>>>>>> vtkSmartPointer::New(); >>>> >>>>>>> renderWindow->AddRenderer( renderer ); >>>> >>>>>>> >>>> >>>>>>> vtkSmartPointer >>>> renWinInteractor = >>>> >>>>>>> vtkSmartPointer::New(); >>>> >>>>>>> renWinInteractor->SetRenderWindow( renderWindow ); >>>> >>>>>>> >>>> >>>>>>> renderWindow->Render(); >>>> >>>>>>> renderWindow->SetSize(600, 600); >>>> >>>>>>> renderer->SetBackground(0.1, 0.2, 0.4); >>>> >>>>>>> renWinInteractor->Start(); >>>> >>>>>>> >>>> >>>>>>> return EXIT_SUCCESS; >>>> >>>>>>> } >>>> >>>>> >>>> >>>>> >>>> > >>>> _______________________________________________ >>>> 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://www.vtk.org/mailman/listinfo/vtkusers >>>> >>> >>> >>> >> >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From benjamin-berkowitz at uiowa.edu Fri Dec 21 14:42:25 2012 From: benjamin-berkowitz at uiowa.edu (bberkowi) Date: Fri, 21 Dec 2012 11:42:25 -0800 (PST) Subject: [vtkusers] Mac/VTK/Qt problems In-Reply-To: <1356113906174-5717697.post@n5.nabble.com> References: <415758d20906161151k3c283ee8w89848fc282e4a305@mail.gmail.com> <20090616225818.1164164797@76.65.240.2> <415758d20906181045o3dac33d5qc3734ad3dee07874@mail.gmail.com> <4A40F169.2020300@elemtech.com> <4A40FAC7.3010609@elemtech.com> <415758d20906240713t95f5cb3p737d56e17cbccf64@mail.gmail.com> <1356113906174-5717697.post@n5.nabble.com> Message-ID: <1356118945811-5717699.post@n5.nabble.com> So that first error was for the "EventQtSlotConnect" example. I'm getting another error while running make on the "ShareCameraQt" example: [ 20%] Generating moc_ShareCameraQt.cxx [ 40%] Generating ui_ShareCameraQt.h Scanning dependencies of target ShareCameraQt [ 60%] Building CXX object CMakeFiles/ShareCameraQt.dir/ShareCameraQt.cxx.o In file included from /Users/benberkowitz/Desktop/ShareCameraQt/ShareCameraQt.cxx:1: In file included from /Users/benberkowitz/Desktop/ShareCameraQt/ShareCameraQt.h:5: /Users/benberkowitz/Desktop/ShareCameraQt/build/ui_ShareCameraQt.h:20:10: fatal error: 'QVTKWidget.h' file not found #include "QVTKWidget.h" ^ 1 error generated. make[2]: *** [CMakeFiles/ShareCameraQt.dir/ShareCameraQt.cxx.o] Error 1 make[1]: *** [CMakeFiles/ShareCameraQt.dir/all] Error 2 make: *** [all] Error 2 I've built VTK with all the specifications laid out in http://www.vtk.org/Wiki/VTK/Tutorials/QtSetup , so I'm really not sure what the problem is. -- View this message in context: http://vtk.1045678.n5.nabble.com/Mac-VTK-Qt-problems-tp1246044p5717699.html Sent from the VTK - Users mailing list archive at Nabble.com. From benjamin-berkowitz at uiowa.edu Fri Dec 21 16:40:28 2012 From: benjamin-berkowitz at uiowa.edu (bberkowi) Date: Fri, 21 Dec 2012 13:40:28 -0800 (PST) Subject: [vtkusers] Want to find the medial path of an object In-Reply-To: <1356122276220-5717700.post@n5.nabble.com> References: <1356122276220-5717700.post@n5.nabble.com> Message-ID: <1356126028105-5717701.post@n5.nabble.com> The Vascular Modeling ToolKit ( http://www.vmtk.org/ ) has a nice medial axis filter for surface models that uses a Voronoi diagram approach. Check out http://www.vmtk.org/VmtkScripts/vmtkcenterlines/ . It's based on VTK, so chances are that you can build using your pre-existing VTK library. -- View this message in context: http://vtk.1045678.n5.nabble.com/Want-to-find-the-medial-path-of-an-object-tp5717700p5717701.html Sent from the VTK - Users mailing list archive at Nabble.com. From benjamin-berkowitz at uiowa.edu Fri Dec 21 17:43:04 2012 From: benjamin-berkowitz at uiowa.edu (bberkowi) Date: Fri, 21 Dec 2012 14:43:04 -0800 (PST) Subject: [vtkusers] Want to find the medial path of an object In-Reply-To: <1356129102952-5717702.post@n5.nabble.com> References: <1356122276220-5717700.post@n5.nabble.com> <1356126028105-5717701.post@n5.nabble.com> <1356129102952-5717702.post@n5.nabble.com> Message-ID: <1356129784577-5717703.post@n5.nabble.com> Yes, it's similar in concept to a power crust algorithm. Not sure about how similar it is to the vtkpowercrust algorithm. -- View this message in context: http://vtk.1045678.n5.nabble.com/Want-to-find-the-medial-path-of-an-object-tp5717700p5717703.html Sent from the VTK - Users mailing list archive at Nabble.com. From alexmalvtk at gmail.com Fri Dec 21 20:34:40 2012 From: alexmalvtk at gmail.com (Alex Malyushytskyy) Date: Fri, 21 Dec 2012 17:34:40 -0800 Subject: [vtkusers] Bug in vtkPolyDataNormals? In-Reply-To: <1356080920763-5717690.post@n5.nabble.com> References: <1356021946780-5717683.post@n5.nabble.com> <1356080920763-5717690.post@n5.nabble.com> Message-ID: Condition 'if' you refer to is inside the private code which prevents of invalid normal to be exposed to public. If you want to visualize two polygons each has its own normal which are completely independent. If you want them to be displayed properly you should see light conditions defined by the normal directed towards you. By the way you can always try to provide a patch and see if it is accepted. Regards, Alex On Fri, Dec 21, 2012 at 1:08 AM, danimede wrote: > Hi Alex, > > if Normal length must not be 0, the IF condition is useless, or not? > And if I have two polygons that represent the same one, i.e. A-B-C (first > triangular polygon) and A-C-B, when I compute the normal for point A is > correct to have a normal vector equal to 0.0, due to the two polygonal > normals are the same vector but with opposite sign. Maybe a check in the > initial stage can be helpful to avoid this scenario. > > Regards, > Daniele > > > > Alex Malyushytskyy wrote >> AFAS I understand Normal length must not be 0. >> If it is 0 it can be any, cause it means unexpected problem in the code. >> I would probably set it to the OX. But your suggestion is worse than >> current, >> cause it may break other code which expects a well defined vector as a >> normal. >> >> Alex >> >> On Thu, Dec 20, 2012 at 8:45 AM, danimede < > >> danimede@ > >> > wrote: >>> Hi All, >>> >>> I have found a weird computation in vtkPolyDataNormals.cpp. The issue is >>> in >>> the follow piece of code: >>> >>> for (i=0; i < numNewPts; i++) { >>> newNormals->GetTuple(i, vertNormal); >>> length = vtkMath::Norm(vertNormal); >>> if (length != 0.0) { >>> for (j=0; j < 3; j++) { >>> n[j] = vertNormal[j] / length * flipDirection; >>> } >>> } >>> newNormals->SetTuple(i,n); >>> } >>> >>> In the code if we have a length equal to zero we set in the i-th tuple >>> the >>> normal values of the (i-th)-1 point! >>> Is it a bug or maybe there are some hypothesis like consecutive index >>> points >>> can have the same normal vector? >>> Probably the solution is to set the normal to {0.0 , 0.0 , 0.0} if we >>> have a >>> length equal to zero. >>> >>> Regards, >>> Daniele > > > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/Bug-in-vtkPolyDataNormals-tp5717683p5717690.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://www.vtk.org/mailman/listinfo/vtkusers From alexmalvtk at gmail.com Fri Dec 21 20:44:48 2012 From: alexmalvtk at gmail.com (Alex Malyushytskyy) Date: Fri, 21 Dec 2012 17:44:48 -0800 Subject: [vtkusers] Hide/show viewports In-Reply-To: <1356107922784-5717695.post@n5.nabble.com> References: <1356107922784-5717695.post@n5.nabble.com> Message-ID: As far as I understand viewport is area in the window renderer renders to. You can have multiple renderers render in the same/different or overlapping area. http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/MultipleViewports I guess removing specific renderer from pipeline is what you want. Alex On Fri, Dec 21, 2012 at 8:38 AM, a.c.sant wrote: > Hi! > I'm trying to set multiple viewports in a window and having the user choose > which viewport view at each moment. For example, starting with viewport #1, > if the user clicks a button, hide #1 and show #2. > > Currently, I'm playing with Renderer::SetViewport and Renderer::GetViewport > but still can't make this work. > > Maybe it's not possible? I would like to hear your opinions. > > Cheers! > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/Hide-show-viewports-tp5717695.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://www.vtk.org/mailman/listinfo/vtkusers From alexmalvtk at gmail.com Fri Dec 21 21:22:50 2012 From: alexmalvtk at gmail.com (Alex Malyushytskyy) Date: Fri, 21 Dec 2012 18:22:50 -0800 Subject: [vtkusers] Tube Filter In-Reply-To: <1356084510103-5717691.post@n5.nabble.com> References: <1356084510103-5717691.post@n5.nabble.com> Message-ID: I do not think there is vtk function which supports this, but it should be relatively easy to do it since you know that your geometry came through tube filter. I assume you know how pick the point on polydata ( tube ). There are multiple ways to do it once you know it, Easiest which comes to my mind is adding 3 scalars representing XYZ of each vertex to original polydata. Clicking on the filtered geometry you can always find cell clicked and compute value of such scalars at the point you clicked. It means you know XYZ of original point. Alex On Fri, Dec 21, 2012 at 2:08 AM, alihadim wrote: > I can use Tube algorithm and drawing polydata. This screen is 1.png. this is > original data (not use tube alg.). After I added tube algorithm and this > screen is 2.png. > > I want to pick coordinat on original data(1.png) while added on tube > algorithm data. is this possible in VTK. > > > > > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/Tube-Filter-tp5717691.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://www.vtk.org/mailman/listinfo/vtkusers From tuhuawei09 at gmail.com Sat Dec 22 02:05:02 2012 From: tuhuawei09 at gmail.com (HuaweiTu) Date: Fri, 21 Dec 2012 23:05:02 -0800 (PST) Subject: [vtkusers] Two questions about handling multitouch events in VTK Message-ID: <1356159902063-5717708.post@n5.nabble.com> Hi all, I am working on a project of 3D anatomy visualization on multitouch devices. I want to use VTK for 3D visualization and WPF for multitouch interaction. One difficult part in this project is how to translate a multitouch event to a corresponding mouse event because VTK can handle only mouse events and keyboard events. For example, when WPF detects a ?zoom in? event, VTK can trigger a MouseWheelBackwardEvt event. I have two questions when doing so. 1.How to trigger a MouseWheelBackwardEvt event in VTK? I did the following coding, but it can not work. renWin = vtkRenderWindow.New(); iren = vtkRenderWindowInteractor.New(); iren.SetRenderWindow(renWin); vtkInteractorStyleUser interactorStyleUser = vtkInteractorStyleUser.New(); iren.SetInteractorStyle(interactorStyleUser); interactorStyleUser.InvokeEvent((uint)vtkCommand.EventIds. MouseWheelBackwardEvent); 2.A ?zoom in? event of WPF has some parameters which are used to describe the event, such as x, y coordinates. How to pass the parameters to MouseWheelBackwardEvt event in VTK? This one may work: SetEventInformation(int x, int y, int ctrl, int shift, sbyte keycode, int repeatcount, string keysym), but I do not know how to use it. I am new to VTK and WPF. So could someone give me some hints to solve these problems? Or could someone think better ways to handle multitouch events in VTK? PS: Because I am doing this under C# environment, so it would be nice to present examples using C# . I appreciate any help I can get. -- View this message in context: http://vtk.1045678.n5.nabble.com/Two-questions-about-handling-multitouch-events-in-VTK-tp5717708.html Sent from the VTK - Users mailing list archive at Nabble.com. From joachim.pouderoux at kitware.com Sat Dec 22 06:45:44 2012 From: joachim.pouderoux at kitware.com (Joachim Pouderoux) Date: Sat, 22 Dec 2012 12:45:44 +0100 Subject: [vtkusers] Hide/show viewports In-Reply-To: <1356107922784-5717695.post@n5.nabble.com> References: <1356107922784-5717695.post@n5.nabble.com> Message-ID: <-4084136266760916198@unknownmsgid> Hi, The viewport defines the rectangle in the rendering window where the visualization is actually rendered. Are you sure this is what you want to change or isn't it the camera settings (point of view, orientation,...)? The viewport is generally fixed once for all and there is only one viewport per renderer. If you really want to define multiple viewport in the same window you will need to create the same number of renderers. If you want to provide the user multiple viewpoints of the same scene but once at a time, just switch cameras. Regards, Joachim Le 21 d?c. 2012 ? 17:39, "a.c.sant" a ?crit : > Hi! > I'm trying to set multiple viewports in a window and having the user choose > which viewport view at each moment. For example, starting with viewport #1, > if the user clicks a button, hide #1 and show #2. > > Currently, I'm playing with Renderer::SetViewport and Renderer::GetViewport > but still can't make this work. > > Maybe it's not possible? I would like to hear your opinions. > > Cheers! > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/Hide-show-viewports-tp5717695.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://www.vtk.org/mailman/listinfo/vtkusers From joachim.pouderoux at kitware.com Sat Dec 22 06:54:52 2012 From: joachim.pouderoux at kitware.com (Joachim Pouderoux) Date: Sat, 22 Dec 2012 12:54:52 +0100 Subject: [vtkusers] Two questions about handling multitouch events in VTK In-Reply-To: <1356159902063-5717708.post@n5.nabble.com> References: <1356159902063-5717708.post@n5.nabble.com> Message-ID: <-4853136191434160931@unknownmsgid> Hi, AFAIK, Multitouch interaction is not yet supported in vtk. Meanwhile, you could eventually do something like you described and emulate some mouse events to an existing mouse interactor but it might be tricky and difficult to make the interaction smooth. I think the best way would be to directly handle the multitouch events to setup the camera settings in the render-interaction loop. You will find on the internet a lot of c++ or c# classes to compute the camera parameters for a classical 3d multitouch interaction, and you will just need to set the renderer active camera with them on each frame. Joachim Le 22 d?c. 2012 ? 08:05, HuaweiTu a ?crit : > Hi all, > > I am working on a project of 3D anatomy visualization on multitouch devices. > I want to use VTK for 3D visualization and WPF for multitouch interaction. > One difficult part in this project is how to translate a multitouch event to > a corresponding mouse event because VTK can handle only mouse events and > keyboard events. For example, when WPF detects a ?zoom in? event, VTK can > trigger a MouseWheelBackwardEvt event. I have two questions when doing so. > > 1.How to trigger a MouseWheelBackwardEvt event in VTK? I did the following > coding, but it can not work. > renWin = vtkRenderWindow.New(); > iren = vtkRenderWindowInteractor.New(); > iren.SetRenderWindow(renWin); > > vtkInteractorStyleUser interactorStyleUser = vtkInteractorStyleUser.New(); > iren.SetInteractorStyle(interactorStyleUser); > interactorStyleUser.InvokeEvent((uint)vtkCommand.EventIds. > MouseWheelBackwardEvent); > > 2.A ?zoom in? event of WPF has some parameters which are used to describe > the event, such as x, y coordinates. How to pass the parameters to > MouseWheelBackwardEvt event in VTK? This one may work: > SetEventInformation(int x, int y, int ctrl, int shift, sbyte keycode, int > repeatcount, string keysym), but I do not know how to use it. > > I am new to VTK and WPF. So could someone give me some hints to solve these > problems? Or could someone think better ways to handle multitouch events in > VTK? PS: Because I am doing this under C# environment, so it would be nice > to present examples using C# . > > I appreciate any help I can get. > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/Two-questions-about-handling-multitouch-events-in-VTK-tp5717708.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://www.vtk.org/mailman/listinfo/vtkusers From tuhuawei09 at gmail.com Sat Dec 22 07:59:34 2012 From: tuhuawei09 at gmail.com (HuaweiTu) Date: Sat, 22 Dec 2012 04:59:34 -0800 (PST) Subject: [vtkusers] Two questions about handling multitouch events in VTK In-Reply-To: <-4853136191434160931@unknownmsgid> References: <1356159296506-5717707.post@n5.nabble.com> <-4853136191434160931@unknownmsgid> Message-ID: <1356181174183-5717711.post@n5.nabble.com> Hi Joachim, Thanks a lot for your reply and your thoughts. Your thoughts are really helpful. Accordingly, I found some information regarding your thoughts from http://www.vtk.org/doc/nightly/html/classvtkCamera.html . Did you mean using some of the listed functions such as zoom(double factor) to achieve my purpose? -- View this message in context: http://vtk.1045678.n5.nabble.com/Two-questions-about-handling-multitouch-events-in-VTK-tp5717707p5717711.html Sent from the VTK - Users mailing list archive at Nabble.com. From joachim.pouderoux at kitware.com Sat Dec 22 11:40:52 2012 From: joachim.pouderoux at kitware.com (Joachim Pouderoux) Date: Sat, 22 Dec 2012 17:40:52 +0100 Subject: [vtkusers] Two questions about handling multitouch events in VTK In-Reply-To: <1356181174183-5717711.post@n5.nabble.com> References: <1356159296506-5717707.post@n5.nabble.com> <-4853136191434160931@unknownmsgid> <1356181174183-5717711.post@n5.nabble.com> Message-ID: <4748960527746210499@unknownmsgid> Take a look at the method to set the position, view point, up vector and so on. Directly setting the view matrix can also be more efficient... Good luck with that! Joachim Le 22 d?c. 2012 ? 13:59, HuaweiTu a ?crit : > Hi Joachim, > > Thanks a lot for your reply and your thoughts. Your thoughts are really > helpful. > > Accordingly, I found some information regarding your thoughts from > http://www.vtk.org/doc/nightly/html/classvtkCamera.html . Did you > mean using some of the listed functions such as zoom(double factor) to > achieve my purpose? > > > > > > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/Two-questions-about-handling-multitouch-events-in-VTK-tp5717707p5717711.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://www.vtk.org/mailman/listinfo/vtkusers From tuhuawei09 at gmail.com Sun Dec 23 00:27:59 2012 From: tuhuawei09 at gmail.com (HuaweiTu) Date: Sat, 22 Dec 2012 21:27:59 -0800 (PST) Subject: [vtkusers] Two questions about handling multitouch events in VTK In-Reply-To: <4748960527746210499@unknownmsgid> References: <1356159296506-5717707.post@n5.nabble.com> <-4853136191434160931@unknownmsgid> <1356181174183-5717711.post@n5.nabble.com> <4748960527746210499@unknownmsgid> Message-ID: <1356240479794-5717714.post@n5.nabble.com> Hi Joachim, Thanks so much for your help. I will do it as you suggested. -- View this message in context: http://vtk.1045678.n5.nabble.com/Two-questions-about-handling-multitouch-events-in-VTK-tp5717707p5717714.html Sent from the VTK - Users mailing list archive at Nabble.com. From ilan.tal at gmail.com Sun Dec 23 03:55:05 2012 From: ilan.tal at gmail.com (Ilan) Date: Sun, 23 Dec 2012 00:55:05 -0800 (PST) Subject: [vtkusers] wrap java on Mac Air In-Reply-To: References: <1355905578648-5717659.post@n5.nabble.com> <1355913558456-5717662.post@n5.nabble.com> <1355990532290-5717675.post@n5.nabble.com> <20121220162201.172448119@mail.rogue-research.com> <20121220191844.126735706@mail.rogue-research.com> Message-ID: <1356252905551-5717715.post@n5.nabble.com> This morning I got CMake 2.8-10 and from it installed the command line tools. Now it knows what ccmake is and I could try to follow Seb's advice. Here too there are no VTK_Group... commands but I went through the ccmake. Then make gave me ***No targets specified and no makefile found. Stop. Presumably I'm doing something stupid. With the CMake, Xcode did in fact compile with no WRAP_JAVA. So I went back and checked BUILD_SHARED_LIBS and VTK_WRAP_JAVA. After a configure and generate it gave exactly the same error messages I got previously. Then I unchecked VTK_WRAP_JAVA leaving the build shared libs. Again Xcode compiles successfully. So it doesn't like the wrap java and for the same reasons. I'm stuck... and am not sure what the next step should be. Thanks, Ilan -- View this message in context: http://vtk.1045678.n5.nabble.com/wrap-java-on-Mac-Air-tp5717659p5717715.html Sent from the VTK - Users mailing list archive at Nabble.com. From ilan.tal at gmail.com Sun Dec 23 05:09:37 2012 From: ilan.tal at gmail.com (Ilan) Date: Sun, 23 Dec 2012 02:09:37 -0800 (PST) Subject: [vtkusers] wrap java on Mac Air In-Reply-To: <1356252905551-5717715.post@n5.nabble.com> References: <1355905578648-5717659.post@n5.nabble.com> <1355913558456-5717662.post@n5.nabble.com> <1355990532290-5717675.post@n5.nabble.com> <20121220162201.172448119@mail.rogue-research.com> <20121220191844.126735706@mail.rogue-research.com> <1356252905551-5717715.post@n5.nabble.com> Message-ID: <1356257377938-5717716.post@n5.nabble.com> As a last resort I went and reread the source data from VTK. Again it will compile without VTK_WRAP_JAVA but not with it. There are a couple of things which I don't understand. The default value for CMAKE_INSTALL_PREFIX is /usr/local. Where is that? I see that the files seem to come in on vtkBuild/bin/Debug. Is this /usr/local? I set CMAKE_BUILD_TYPE to Release, yet all I see is vtkBuild/bin/Debug. I would have expected bin/Release. In the end it should build vtk.jar for the java wrap. Where will that be located? -- View this message in context: http://vtk.1045678.n5.nabble.com/wrap-java-on-Mac-Air-tp5717659p5717716.html Sent from the VTK - Users mailing list archive at Nabble.com. From joachim.pouderoux at kitware.com Sun Dec 23 06:21:09 2012 From: joachim.pouderoux at kitware.com (Joachim Pouderoux) Date: Sun, 23 Dec 2012 12:21:09 +0100 Subject: [vtkusers] wrap java on Mac Air In-Reply-To: <1356257377938-5717716.post@n5.nabble.com> References: <1355905578648-5717659.post@n5.nabble.com> <1355913558456-5717662.post@n5.nabble.com> <1355990532290-5717675.post@n5.nabble.com> <20121220162201.172448119@mail.rogue-research.com> <20121220191844.126735706@mail.rogue-research.com> <1356252905551-5717715.post@n5.nabble.com> <1356257377938-5717716.post@n5.nabble.com> Message-ID: <6689137599499740038@unknownmsgid> Ilan, The CMAKE_INSTALL_PREFIX is the place where the files will be installed when you call the makefile install target (ie. When you run 'make install' with gnu make). Once you change the build type from debug to release you have to launch the compilation again ('make') for the new binaries to be generated. The vtk.jar will be in the same directoriy than the dynamic libraries. I have not followed this thread but I had some issues when compiling the vtk java wrapping without enabling the vtk TESTING variable in ccmake. Good luck (I have recently build the latest vtk git under mac - not for xcode- without any problem!) Joachim Le 23 d?c. 2012 ? 11:10, Ilan a ?crit : > As a last resort I went and reread the source data from VTK. Again it will > compile without VTK_WRAP_JAVA but not with it. > There are a couple of things which I don't understand. The default value for > CMAKE_INSTALL_PREFIX is /usr/local. Where is that? I see that the files seem > to come in on vtkBuild/bin/Debug. Is this /usr/local? > > I set CMAKE_BUILD_TYPE to Release, yet all I see is vtkBuild/bin/Debug. I > would have expected bin/Release. > > In the end it should build vtk.jar for the java wrap. Where will that be > located? > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/wrap-java-on-Mac-Air-tp5717659p5717716.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://www.vtk.org/mailman/listinfo/vtkusers From notinmyhead at gmail.com Mon Dec 24 07:47:48 2012 From: notinmyhead at gmail.com (Alessandro) Date: Mon, 24 Dec 2012 13:47:48 +0100 Subject: [vtkusers] Mac/VTK/Qt problems In-Reply-To: <1356113906174-5717697.post@n5.nabble.com> References: <415758d20906161151k3c283ee8w89848fc282e4a305@mail.gmail.com> <20090616225818.1164164797@76.65.240.2> <415758d20906181045o3dac33d5qc3734ad3dee07874@mail.gmail.com> <4A40F169.2020300@elemtech.com> <4A40FAC7.3010609@elemtech.com> <415758d20906240713t95f5cb3p737d56e17cbccf64@mail.gmail.com> <1356113906174-5717697.post@n5.nabble.com> Message-ID: Hi, it seems to me that you've compiled vtk for x86 only.... try compiling (under qt) for x86_32, if it'll work, you'll have to compile vtk again... Il giorno 21/dic/2012, alle ore 19.18, bberkowi ha scritto: > I realize this thread is old, but I'm having problems building the examples > also. I'm using Mac 10.8 with Qt 4.8.4 and VTK 5.10. When I run make, I > get the following error: > > > Linking CXX executable > EventQtSlotConnect.app/Contents/MacOS/EventQtSlotConnect > Undefined symbols for architecture x86_64: > "QVTKWidget::QVTKWidget(QWidget*, QFlags)", referenced > from: > Ui_EventQtSlotConnect::setupUi(QMainWindow*) in > EventQtSlotConnect.cxx.o > "vtkEventQtSlotConnect::New()", referenced from: > vtkSmartPointer::New() in > EventQtSlotConnect.cxx.o > ld: symbol(s) not found for architecture x86_64 > clang: error: linker command failed with exit code 1 (use -v to see > invocation) > make[2]: *** [EventQtSlotConnect.app/Contents/MacOS/EventQtSlotConnect] > Error 1 > make[1]: *** [CMakeFiles/EventQtSlotConnect.dir/all] Error 2 > make: *** [all] Error 2 > > Is this an issue with VTK or do I maybe have something installed > incorrectly? > > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/Mac-VTK-Qt-problems-tp1246044p5717697.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://www.vtk.org/mailman/listinfo/vtkusers From benjamin-berkowitz at uiowa.edu Mon Dec 24 15:01:09 2012 From: benjamin-berkowitz at uiowa.edu (Berkowitz, Benjamin M) Date: Mon, 24 Dec 2012 20:01:09 +0000 Subject: [vtkusers] Mac/VTK/Qt problems In-Reply-To: References: <415758d20906161151k3c283ee8w89848fc282e4a305@mail.gmail.com> <20090616225818.1164164797@76.65.240.2> <415758d20906181045o3dac33d5qc3734ad3dee07874@mail.gmail.com> <4A40F169.2020300@elemtech.com> <4A40FAC7.3010609@elemtech.com> <415758d20906240713t95f5cb3p737d56e17cbccf64@mail.gmail.com> <1356113906174-5717697.post@n5.nabble.com> Message-ID: <0284E66B6927A945A88A1714606BCC853712C5B2@ITSNT437.iowa.uiowa.edu> I'm using a 2012 macbook pro with an i7 processor - does that mean I have an x86_64 architecture? I hadn't specified an architecture when I built before, so I rebuild with x86_64 specified this time. I still get the same error, unfortunately. On Dec 24, 2012, at 6:47 AM, Alessandro wrote: > Hi, it seems to me that you've compiled vtk for x86 only.... try compiling (under qt) for x86_32, if it'll work, you'll have to compile vtk again... > > Il giorno 21/dic/2012, alle ore 19.18, bberkowi ha scritto: > >> I realize this thread is old, but I'm having problems building the examples >> also. I'm using Mac 10.8 with Qt 4.8.4 and VTK 5.10. When I run make, I >> get the following error: >> >> >> Linking CXX executable >> EventQtSlotConnect.app/Contents/MacOS/EventQtSlotConnect >> Undefined symbols for architecture x86_64: >> "QVTKWidget::QVTKWidget(QWidget*, QFlags)", referenced >> from: >> Ui_EventQtSlotConnect::setupUi(QMainWindow*) in >> EventQtSlotConnect.cxx.o >> "vtkEventQtSlotConnect::New()", referenced from: >> vtkSmartPointer::New() in >> EventQtSlotConnect.cxx.o >> ld: symbol(s) not found for architecture x86_64 >> clang: error: linker command failed with exit code 1 (use -v to see >> invocation) >> make[2]: *** [EventQtSlotConnect.app/Contents/MacOS/EventQtSlotConnect] >> Error 1 >> make[1]: *** [CMakeFiles/EventQtSlotConnect.dir/all] Error 2 >> make: *** [all] Error 2 >> >> Is this an issue with VTK or do I maybe have something installed >> incorrectly? >> >> >> >> >> -- >> View this message in context: http://vtk.1045678.n5.nabble.com/Mac-VTK-Qt-problems-tp1246044p5717697.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://www.vtk.org/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://www.vtk.org/mailman/listinfo/vtkusers From acsantome at gmail.com Wed Dec 26 03:48:32 2012 From: acsantome at gmail.com (a.c.sant) Date: Wed, 26 Dec 2012 00:48:32 -0800 (PST) Subject: [vtkusers] Hide/show viewports In-Reply-To: <-4084136266760916198@unknownmsgid> References: <1356107922784-5717695.post@n5.nabble.com> <-4084136266760916198@unknownmsgid> Message-ID: <1356511712027-5717726.post@n5.nabble.com> Hi, currently we're working with the PCL library and we have to display several point clouds (right now we're displaying each cloud in its own viewport). However, displaying all clouds at the same time is not always needed. Therefore, I'm trying to achieve something like "first visualize one cloud. When (for example) clicking a button, the next cloud is shown and the previous one is hidden" (PCL doesn't have anything like this). I wanted to know your opinions about this matter before spending too much time in the docs and doing tests. I'm afraid this might not be possible/a good idea. Cheers! Joachim Pouderoux wrote > Hi, > > The viewport defines the rectangle in the rendering window where the > visualization is actually rendered. > Are you sure this is what you want to change or isn't it the camera > settings (point of view, orientation,...)? The viewport is generally > fixed once for all and there is only one viewport per renderer. If you > really want to define multiple viewport in the same window you will > need to create the same number of renderers. > If you want to provide the user multiple viewpoints of the same scene > but once at a time, just switch cameras. > > Regards, > > Joachim > > Le 21 d?c. 2012 ? 17:39, "a.c.sant" < > acsantome@ > > a ?crit : > >> Hi! >> I'm trying to set multiple viewports in a window and having the user >> choose >> which viewport view at each moment. For example, starting with viewport >> #1, >> if the user clicks a button, hide #1 and show #2. >> >> Currently, I'm playing with Renderer::SetViewport and >> Renderer::GetViewport >> but still can't make this work. >> >> Maybe it's not possible? I would like to hear your opinions. >> >> Cheers! >> >> >> >> -- >> View this message in context: >> http://vtk.1045678.n5.nabble.com/Hide-show-viewports-tp5717695.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://www.vtk.org/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://www.vtk.org/mailman/listinfo/vtkusers -- View this message in context: http://vtk.1045678.n5.nabble.com/Hide-show-viewports-tp5717695p5717726.html Sent from the VTK - Users mailing list archive at Nabble.com. From notinmyhead at gmail.com Wed Dec 26 06:21:44 2012 From: notinmyhead at gmail.com (Alessandro) Date: Wed, 26 Dec 2012 12:21:44 +0100 Subject: [vtkusers] Mac/VTK/Qt problems In-Reply-To: <0284E66B6927A945A88A1714606BCC853712C5B2@ITSNT437.iowa.uiowa.edu> References: <415758d20906161151k3c283ee8w89848fc282e4a305@mail.gmail.com> <20090616225818.1164164797@76.65.240.2> <415758d20906181045o3dac33d5qc3734ad3dee07874@mail.gmail.com> <4A40F169.2020300@elemtech.com> <4A40FAC7.3010609@elemtech.com> <415758d20906240713t95f5cb3p737d56e17cbccf64@mail.gmail.com> <1356113906174-5717697.post@n5.nabble.com> <0284E66B6927A945A88A1714606BCC853712C5B2@ITSNT437.iowa.uiowa.edu> Message-ID: Il giorno 24/dic/2012, alle ore 21.01, Berkowitz, Benjamin M ha scritto: > I'm using a 2012 macbook pro with an i7 processor - does that mean I have an x86_64 architecture? yes indeed. but compiler is one thing you can choose. > I hadn't specified an architecture when I built before, so I rebuild with x86_64 specified this time. > > I still get the same error, unfortunately. Have you tried rebuilt the whole project? Sometimes Qt does not rebuilt things... > > > > > > > On Dec 24, 2012, at 6:47 AM, Alessandro wrote: > >> Hi, it seems to me that you've compiled vtk for x86 only.... try compiling (under qt) for x86_32, if it'll work, you'll have to compile vtk again... >> >> Il giorno 21/dic/2012, alle ore 19.18, bberkowi ha scritto: >> >>> I realize this thread is old, but I'm having problems building the examples >>> also. I'm using Mac 10.8 with Qt 4.8.4 and VTK 5.10. When I run make, I >>> get the following error: >>> >>> >>> Linking CXX executable >>> EventQtSlotConnect.app/Contents/MacOS/EventQtSlotConnect >>> Undefined symbols for architecture x86_64: >>> "QVTKWidget::QVTKWidget(QWidget*, QFlags)", referenced >>> from: >>> Ui_EventQtSlotConnect::setupUi(QMainWindow*) in >>> EventQtSlotConnect.cxx.o >>> "vtkEventQtSlotConnect::New()", referenced from: >>> vtkSmartPointer::New() in >>> EventQtSlotConnect.cxx.o >>> ld: symbol(s) not found for architecture x86_64 >>> clang: error: linker command failed with exit code 1 (use -v to see >>> invocation) >>> make[2]: *** [EventQtSlotConnect.app/Contents/MacOS/EventQtSlotConnect] >>> Error 1 >>> make[1]: *** [CMakeFiles/EventQtSlotConnect.dir/all] Error 2 >>> make: *** [all] Error 2 >>> >>> Is this an issue with VTK or do I maybe have something installed >>> incorrectly? >>> >>> >>> >>> >>> -- >>> View this message in context: http://vtk.1045678.n5.nabble.com/Mac-VTK-Qt-problems-tp1246044p5717697.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://www.vtk.org/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://www.vtk.org/mailman/listinfo/vtkusers > From benjamin-berkowitz at uiowa.edu Wed Dec 26 09:05:53 2012 From: benjamin-berkowitz at uiowa.edu (Berkowitz, Benjamin M) Date: Wed, 26 Dec 2012 14:05:53 +0000 Subject: [vtkusers] Mac/VTK/Qt problems In-Reply-To: References: <415758d20906161151k3c283ee8w89848fc282e4a305@mail.gmail.com> <20090616225818.1164164797@76.65.240.2> <415758d20906181045o3dac33d5qc3734ad3dee07874@mail.gmail.com> <4A40F169.2020300@elemtech.com> <4A40FAC7.3010609@elemtech.com> <415758d20906240713t95f5cb3p737d56e17cbccf64@mail.gmail.com> <1356113906174-5717697.post@n5.nabble.com> <0284E66B6927A945A88A1714606BCC853712C5B2@ITSNT437.iowa.uiowa.edu> Message-ID: <0284E66B6927A945A88A1714606BCC85371304A3@ITSNT437.iowa.uiowa.edu> I deleted the project files and rebuilt. I still get the following error, unfortunately: Linking CXX executable EventQtSlotConnect.app/Contents/MacOS/EventQtSlotConnect Undefined symbols for architecture x86_64: "QVTKWidget::QVTKWidget(QWidget*, QFlags)", referenced from: Ui_EventQtSlotConnect::setupUi(QMainWindow*) in EventQtSlotConnect.cxx.o "vtkEventQtSlotConnect::New()", referenced from: vtkSmartPointer::New() in EventQtSlotConnect.cxx.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [EventQtSlotConnect.app/Contents/MacOS/EventQtSlotConnect] Error 1 make[1]: *** [CMakeFiles/EventQtSlotConnect.dir/all] Error 2 make: *** [all] Error 2 Is anyone successfully using VTK and Qt on a Mac with x86_64 architecture? On Dec 26, 2012, at 5:21 AM, Alessandro wrote: > > Il giorno 24/dic/2012, alle ore 21.01, Berkowitz, Benjamin M ha scritto: > >> I'm using a 2012 macbook pro with an i7 processor - does that mean I have an x86_64 architecture? > > yes indeed. but compiler is one thing you can choose. > >> I hadn't specified an architecture when I built before, so I rebuild with x86_64 specified this time. >> >> I still get the same error, unfortunately. > > Have you tried rebuilt the whole project? Sometimes Qt does not rebuilt things... > >> >> >> >> >> >> >> On Dec 24, 2012, at 6:47 AM, Alessandro wrote: >> >>> Hi, it seems to me that you've compiled vtk for x86 only.... try compiling (under qt) for x86_32, if it'll work, you'll have to compile vtk again... >>> >>> Il giorno 21/dic/2012, alle ore 19.18, bberkowi ha scritto: >>> >>>> I realize this thread is old, but I'm having problems building the examples >>>> also. I'm using Mac 10.8 with Qt 4.8.4 and VTK 5.10. When I run make, I >>>> get the following error: >>>> >>>> >>>> Linking CXX executable >>>> EventQtSlotConnect.app/Contents/MacOS/EventQtSlotConnect >>>> Undefined symbols for architecture x86_64: >>>> "QVTKWidget::QVTKWidget(QWidget*, QFlags)", referenced >>>> from: >>>> Ui_EventQtSlotConnect::setupUi(QMainWindow*) in >>>> EventQtSlotConnect.cxx.o >>>> "vtkEventQtSlotConnect::New()", referenced from: >>>> vtkSmartPointer::New() in >>>> EventQtSlotConnect.cxx.o >>>> ld: symbol(s) not found for architecture x86_64 >>>> clang: error: linker command failed with exit code 1 (use -v to see >>>> invocation) >>>> make[2]: *** [EventQtSlotConnect.app/Contents/MacOS/EventQtSlotConnect] >>>> Error 1 >>>> make[1]: *** [CMakeFiles/EventQtSlotConnect.dir/all] Error 2 >>>> make: *** [all] Error 2 >>>> >>>> Is this an issue with VTK or do I maybe have something installed >>>> incorrectly? >>>> >>>> >>>> >>>> >>>> -- >>>> View this message in context: http://vtk.1045678.n5.nabble.com/Mac-VTK-Qt-problems-tp1246044p5717697.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://www.vtk.org/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://www.vtk.org/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://www.vtk.org/mailman/listinfo/vtkusers From gnjoseph at gmail.com Thu Dec 27 00:59:39 2012 From: gnjoseph at gmail.com (Nelson) Date: Wed, 26 Dec 2012 21:59:39 -0800 (PST) Subject: [vtkusers] Configuration Procedure ParaViewWeb Message-ID: <1356587979778-5717731.post@n5.nabble.com> Hi All, I am new to ParaViewWeb. Hope this is the right place to ask my doubt. I want to configure ParaViewWeb in my Windows system. I followed the instruction which is available at http://www.paraview.org/Wiki/ParaViewWeb I could complete the first step ( Compile/Install -> ParaViewWeb SuperBuild ) I also installed Tomcat. 1) From where should I create war files to deploy the application. 2) Should I need ParaView stand alone application to achieve this? Any help in resolving this issue is greatly appreciated. Thanks in advance. ----- Regards, Nelson -- View this message in context: http://vtk.1045678.n5.nabble.com/Configuration-Procedure-ParaViewWeb-tp5717731.html Sent from the VTK - Users mailing list archive at Nabble.com. From sonogi1979 at live.jp Thu Dec 27 01:21:18 2012 From: sonogi1979 at live.jp (sonogi1979 at live.jp) Date: Wed, 26 Dec 2012 22:21:18 -0800 (PST) Subject: [vtkusers] Adding a vtkTextActor during a EndPickEvent callback command hangs the renderer (Visual Studio 2012) In-Reply-To: References: Message-ID: <1356589278878-5717732.post@n5.nabble.com> Hi Jean-Michel, I'm also have the same trouble. The trouble never occurs with vs2010. I tried to build VTK 5.10 using the latest freetype 2.4.11 (VTK_USE_SYSTEM_FREETYPE), however the situation has not been changed. vtkTextActor: Debug with/without debugger: OK Release with debugger: OK Release without debugger: hangup Meanwhile, the original ftgl library works fine (simpledemo) in vc11 (VS2012) with all the configurations. That's all I tried at present. Bests, Shinya -- View this message in context: http://vtk.1045678.n5.nabble.com/Adding-a-vtkTextActor-during-a-EndPickEvent-callback-command-hangs-the-renderer-Visual-Studio-2012-tp5717430p5717732.html Sent from the VTK - Users mailing list archive at Nabble.com. From abhishek at meddiff.com Thu Dec 27 05:40:51 2012 From: abhishek at meddiff.com (abhishek) Date: Thu, 27 Dec 2012 02:40:51 -0800 (PST) Subject: [vtkusers] How to get volume's full resolution image on mouse move? Message-ID: <1356604851053-5717733.post@n5.nabble.com> Hello Users, I want to display volume's full resolution image while rotating on mouse move event. How can I do this? Please help. Regards Abhishek. -- View this message in context: http://vtk.1045678.n5.nabble.com/How-to-get-volume-s-full-resolution-image-on-mouse-move-tp5717733.html Sent from the VTK - Users mailing list archive at Nabble.com. From sonogi1979 at live.jp Thu Dec 27 06:13:32 2012 From: sonogi1979 at live.jp (sonogi1979 at live.jp) Date: Thu, 27 Dec 2012 03:13:32 -0800 (PST) Subject: [vtkusers] Adding a vtkTextActor during a EndPickEvent callback command hangs the renderer (Visual Studio 2012) In-Reply-To: <1356589278878-5717732.post@n5.nabble.com> References: <1356589278878-5717732.post@n5.nabble.com> Message-ID: <1356606812853-5717734.post@n5.nabble.com> Hi, I found vtkTextActor freeze in the line 412 of vtkOpenGLPolyDataMapper2D.cxx. The program freezes in GetTuple function of vtkDataArrayTemplate.txx. [vtkOpenGLPolyDataMapper2D.cxx] 396: for (j = 0; j < npts; j++) 397: { ... 412: glTexCoord2dv(t->GetTuple(pts[j]));// freeze here ... 418: } When GetTuple(vtkId) is replaced with GetTuple(vtkId, double*), the program works in VS2012 release without debugger. [vtkOpenGLPolyDataMapper2D.cxx] 411: { 412: //glTexCoord2dv(t->GetTuple(pts[j])); // freeze in release without debugger : double txcoord_value[2]; : t->GetTuple(pts[j], txcoord_value); : glTexCoord2dv(txcoor_value)); 413: } Bests, Shinya -- View this message in context: http://vtk.1045678.n5.nabble.com/Adding-a-vtkTextActor-during-a-EndPickEvent-callback-command-hangs-the-renderer-Visual-Studio-2012-tp5717430p5717734.html Sent from the VTK - Users mailing list archive at Nabble.com. From sebastien.jourdain at kitware.com Thu Dec 27 07:45:30 2012 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Thu, 27 Dec 2012 07:45:30 -0500 Subject: [vtkusers] Configuration Procedure ParaViewWeb In-Reply-To: <1356587979778-5717731.post@n5.nabble.com> References: <1356587979778-5717731.post@n5.nabble.com> Message-ID: Hi Nelson, the ParaView mailing list is more suitable for your question, but I can certainly try to answer to your question here. First, I'm kind of surprised that the superbuild did work on windows as it was not tested on that platform. Anyway, if everything worked, via the super build, you should have a subset of ParaView that has been built for you with a bunch of libraries and a binary (PWServer), but also the Web part with all the war files that you need. Once you've found the war files, you should put them inside your TOMCAT/webapps directory and add the configuration files pw-config.properties inside TOMCAT/lib. Make sure you edit that file so all the path and options are valid with your current setup. On top of that don't forget to start ActiveMQ, the JMS broker. Seb On Thu, Dec 27, 2012 at 12:59 AM, Nelson wrote: > Hi All, > > I am new to ParaViewWeb. Hope this is the right place to ask my doubt. I > want to configure ParaViewWeb in my Windows system. I followed the > instruction which is available at > http://www.paraview.org/Wiki/ParaViewWeb > > > I could complete the first step ( Compile/Install -> ParaViewWeb SuperBuild > ) > I also installed Tomcat. > > 1) From where should I create war files to deploy the application. > 2) Should I need ParaView stand alone application to achieve this? > > Any help in resolving this issue is greatly appreciated. > > Thanks in advance. > > > > ----- > Regards, > Nelson > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Configuration-Procedure-ParaViewWeb-tp5717731.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://www.vtk.org/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From definitelycertifiable at gmail.com Thu Dec 27 08:37:20 2012 From: definitelycertifiable at gmail.com (John82) Date: Thu, 27 Dec 2012 05:37:20 -0800 (PST) Subject: [vtkusers] vtk3dWidget interaction problem on Windows Message-ID: <1356615440559-5717736.post@n5.nabble.com> Hi I've been facing a small problem interacting with 3d widgets like vtkSphereWidget and vtkLineWidget on Windows. On Windows, after adding and enabling the widget to the graphics window, I cannot move the widget unless I zoom in close to the object. On linux, the same code works without a problem. Has someone else faced this problem before? John -- View this message in context: http://vtk.1045678.n5.nabble.com/vtk3dWidget-interaction-problem-on-Windows-tp5717736.html Sent from the VTK - Users mailing list archive at Nabble.com. From definitelycertifiable at gmail.com Fri Dec 28 07:29:35 2012 From: definitelycertifiable at gmail.com (John82) Date: Fri, 28 Dec 2012 04:29:35 -0800 (PST) Subject: [vtkusers] vtk3dWidget interaction problem on Windows In-Reply-To: <1356615440559-5717736.post@n5.nabble.com> References: <1356615440559-5717736.post@n5.nabble.com> Message-ID: <1356697775677-5717738.post@n5.nabble.com> Thought I would offer some more clarification. For the vtkSphereWidget, I can interact with it if the pointPlaceFactor is sufficiently large. A problem I've seen with this approach is that when I zoom out, then I have to keep increasing the size of the sphere widget. Can someone throw some light? -- View this message in context: http://vtk.1045678.n5.nabble.com/vtk3dWidget-interaction-problem-on-Windows-tp5717736p5717738.html Sent from the VTK - Users mailing list archive at Nabble.com. From tuhuawei09 at gmail.com Fri Dec 28 08:13:18 2012 From: tuhuawei09 at gmail.com (HuaweiTu) Date: Fri, 28 Dec 2012 05:13:18 -0800 (PST) Subject: [vtkusers] Two questions about handling multitouch events in VTK In-Reply-To: <4748960527746210499@unknownmsgid> References: <1356159296506-5717707.post@n5.nabble.com> <-4853136191434160931@unknownmsgid> <1356181174183-5717711.post@n5.nabble.com> <4748960527746210499@unknownmsgid> Message-ID: <1356700398390-5717739.post@n5.nabble.com> Hi Joachim, I hope you are fine. According your suggestion, I have done some coding to handle multitouch gesture events and recorded the corresponding gesture parameters, such as x, y coordinates. Then I want to pass these parameters to the transition matrix of VTK, so as to trigger corresponding manipulations of 3D image. Take the following code as an example, I declared a Sphere object and used "move" for 3D image translation: sphere = vtkSphereSource.New(); sphere.SetThetaResolution(8); sphere.SetPhiResolution(16); shrink = vtkShrinkPolyData.New(); shrink.SetInputConnection(sphere.GetOutputPort()); shrink.SetShrinkFactor(0.9); move = vtkTransform.New(); move.Translate(_random.NextDouble(), _random.NextDouble(), _random.NextDouble()); moveFilter = vtkTransformPolyDataFilter.New(); moveFilter.SetTransform(move); moveFilter.SetInputConnection(shrink.GetOutputPort()); mapper = vtkPolyDataMapper.New(); mapper.SetInputConnection(moveFilter.GetOutputPort()); actor = vtkActor.New(); actor.SetMapper(mapper); actor.GetProperty().SetColor(1, 0, 0); ren1 = vtkRenderer.New(); renWin = vtkRenderWindow.New(); renWin.AddRenderer(ren1); iren = vtkRenderWindowInteractor.New(); iren.SetRenderWindow(renWin); ren1.AddViewProp(actor); renWin.SetSize(500, 500); renWin.Render(); iren.Initialize(); iren.Start(); In my current code, if the user performs a pan gesture, then a pan event is triggered: private void ProcessPan(object sender, GestureEventArgs args) { _translate.X += args.PanTranslation.Width; _translate.Y += args.PanTranslation.Height; } What I want to do is to pass the _translate.X, _translate.Y to move. Translate() as two parameters, so that 3D image can be moved correspondingly as user's pan gesture. However, I tried several methods (e.g. set global variables) but no one can work well. If possible, please give me some hints of how to do it. Thank you very much for your kind help. Wish you a happy new year. -- View this message in context: http://vtk.1045678.n5.nabble.com/Two-questions-about-handling-multitouch-events-in-VTK-tp5717707p5717739.html Sent from the VTK - Users mailing list archive at Nabble.com. From drescherjm at gmail.com Fri Dec 28 10:26:06 2012 From: drescherjm at gmail.com (John Drescher) Date: Fri, 28 Dec 2012 10:26:06 -0500 Subject: [vtkusers] vtk3dWidget interaction problem on Windows In-Reply-To: <1356697775677-5717738.post@n5.nabble.com> References: <1356615440559-5717736.post@n5.nabble.com> <1356697775677-5717738.post@n5.nabble.com> Message-ID: On Fri, Dec 28, 2012 at 7:29 AM, John82 wrote: > Thought I would offer some more clarification. For the vtkSphereWidget, I can > interact with it if the pointPlaceFactor is sufficiently large. A problem > I've seen with this approach is that when I zoom out, then I have to keep > increasing the size of the sphere widget. Can someone throw some light? > How about posting a small example so we can test this quickly. I have access to linux and windows here. -- John M. Drescher From benjamin-berkowitz at uiowa.edu Fri Dec 28 13:11:10 2012 From: benjamin-berkowitz at uiowa.edu (bberkowi) Date: Fri, 28 Dec 2012 10:11:10 -0800 (PST) Subject: [vtkusers] Mac/VTK/Qt problems In-Reply-To: References: <415758d20906161151k3c283ee8w89848fc282e4a305@mail.gmail.com> <20090616225818.1164164797@76.65.240.2> <415758d20906181045o3dac33d5qc3734ad3dee07874@mail.gmail.com> <4A40F169.2020300@elemtech.com> <4A40FAC7.3010609@elemtech.com> <415758d20906240713t95f5cb3p737d56e17cbccf64@mail.gmail.com> <1356113906174-5717697.post@n5.nabble.com> <0284E66B6927A945A88A1714606BCC853712C5B2@ITSNT437.iowa.uiowa.edu> Message-ID: <1356718270390-5717741.post@n5.nabble.com> If it's of any relevance, CMake doesn't find many of the QT plugins and executables. Many of the paths say "[PLUGIN]-NOTFOUND". Is it possible that this is leading to errors when I try to compile Qt projects? -- View this message in context: http://vtk.1045678.n5.nabble.com/Mac-VTK-Qt-problems-tp1246044p5717741.html Sent from the VTK - Users mailing list archive at Nabble.com. From alexmalvtk at gmail.com Fri Dec 28 14:49:00 2012 From: alexmalvtk at gmail.com (Alex Malyushytskyy) Date: Fri, 28 Dec 2012 11:49:00 -0800 Subject: [vtkusers] Hide/show viewports In-Reply-To: <1356511712027-5717726.post@n5.nabble.com> References: <1356107922784-5717695.post@n5.nabble.com> <-4084136266760916198@unknownmsgid> <1356511712027-5717726.post@n5.nabble.com> Message-ID: Explain why removing/adding renderer does not work for you. Alex On Wed, Dec 26, 2012 at 12:48 AM, a.c.sant wrote: > Hi, > > currently we're working with the PCL library and we have to display several > point clouds (right now we're displaying each cloud in its own viewport). > However, displaying all clouds at the same time is not always needed. > Therefore, I'm trying to achieve something like "first visualize one cloud. > When (for example) clicking a button, the next cloud is shown and the > previous one is hidden" (PCL doesn't have anything like this). > I wanted to know your opinions about this matter before spending too much > time in the docs and doing tests. I'm afraid this might not be possible/a > good idea. > > Cheers! > > > Joachim Pouderoux wrote >> Hi, >> >> The viewport defines the rectangle in the rendering window where the >> visualization is actually rendered. >> Are you sure this is what you want to change or isn't it the camera >> settings (point of view, orientation,...)? The viewport is generally >> fixed once for all and there is only one viewport per renderer. If you >> really want to define multiple viewport in the same window you will >> need to create the same number of renderers. >> If you want to provide the user multiple viewpoints of the same scene >> but once at a time, just switch cameras. >> >> Regards, >> >> Joachim >> >> Le 21 d?c. 2012 ? 17:39, "a.c.sant" < > >> acsantome@ > >> > a ?crit : >> >>> Hi! >>> I'm trying to set multiple viewports in a window and having the user >>> choose >>> which viewport view at each moment. For example, starting with viewport >>> #1, >>> if the user clicks a button, hide #1 and show #2. >>> >>> Currently, I'm playing with Renderer::SetViewport and >>> Renderer::GetViewport >>> but still can't make this work. >>> >>> Maybe it's not possible? I would like to hear your opinions. >>> >>> Cheers! >>> >>> >>> >>> -- >>> View this message in context: >>> http://vtk.1045678.n5.nabble.com/Hide-show-viewports-tp5717695.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://www.vtk.org/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://www.vtk.org/mailman/listinfo/vtkusers > > > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/Hide-show-viewports-tp5717695p5717726.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://www.vtk.org/mailman/listinfo/vtkusers From rickfrank at me.com Fri Dec 28 20:35:24 2012 From: rickfrank at me.com (Rick Frank) Date: Fri, 28 Dec 2012 20:35:24 -0500 Subject: [vtkusers] clarification on smart pointer usage Message-ID: <71D5CB86-AB85-46DA-99D8-198E99A7E71E@me.com> Hi, Tracing through the code seems to indicate that assigning one smart point to another does not free the left hand side pointer. For instance, vtkSmartPointer one = vtkVolumeRayCastCompositionFunction::New(); vtkSmartPointer two = vtkVolumeRayCastCompositionFunction::New(); one = two; // The pointer in one seems to be left undeleted? Is there a standard best-pattern for deleting the left hand side of the assignment? The docs say the reference to the pointer is removed, but that's a bit unclear to me. In the above, I put a break point on the dtor of vtkVolumeRayCastCompositionFunction and it wasn't hit. Thanks Rick From david.gobbi at gmail.com Fri Dec 28 22:27:41 2012 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 28 Dec 2012 20:27:41 -0700 Subject: [vtkusers] clarification on smart pointer usage In-Reply-To: <71D5CB86-AB85-46DA-99D8-198E99A7E71E@me.com> References: <71D5CB86-AB85-46DA-99D8-198E99A7E71E@me.com> Message-ID: Hi Frank, Here is the correct code for assigning a smart pointer to a new object: vtkSmartPointer one = vtkSmartPointer::New(); You need to use the special smart pointer "New" method to create the new object. Otherwise, the object ends up with a reference count of two (one from the New and one from assigning the smart pointer). - David On Fri, Dec 28, 2012 at 6:35 PM, Rick Frank wrote: > > Hi, > > > Tracing through the code seems to indicate that assigning one smart point to another does not free the left hand side pointer. > > For instance, > > vtkSmartPointer one = vtkVolumeRayCastCompositionFunction::New(); > > > vtkSmartPointer two = vtkVolumeRayCastCompositionFunction::New(); > > > one = two; > > // The pointer in one seems to be left undeleted? > > Is there a standard best-pattern for deleting the left hand side of the assignment? > > > The docs say the reference to the pointer is removed, but that's a bit unclear to me. > > In the above, I put a break point on the dtor of vtkVolumeRayCastCompositionFunction and it wasn't hit. > > Thanks > > Rick From gnjoseph at gmail.com Fri Dec 28 23:50:42 2012 From: gnjoseph at gmail.com (Nelson) Date: Fri, 28 Dec 2012 20:50:42 -0800 (PST) Subject: [vtkusers] Configuration Procedure ParaViewWeb In-Reply-To: References: <1356587979778-5717731.post@n5.nabble.com> Message-ID: <1356756642087-5717745.post@n5.nabble.com> Hi Sebastien, Thank you very much for your informative reply. I have installed ParaView 3.14.1 in my system. I have installed Tomcat in my system I have downloaded ParaViewWeb super build. With the help of CMake I have created the binaries. Now the folder structure is: ParaViewWeb - build - install - src folders in build directory ========================== ActiveMQ-cpp activemq-cpp.dir activemq-cpp-prefix ant ant.dir ant-prefix apr APR.dir APR-prefix apr-util APR-UTIL.dir APR-UTIL-prefix CMakeFiles flex3 Flex3-MPL.dir Flex3-MPL-prefix GoogleWebToolkit.dir GoogleWebToolkit-prefix gwt ParaView ParaView.dir ParaView-prefix ParaViewWeb ParaViewWeb-prefix qooxdoo qooxdoo.dir qooxdoo-prefix ZERO_CHECK.dir and some MSVC project files etc., folders and files in src ======================== Clients Data Documents ParaViewAdapter Scripts SuperBuild WebServer CMakeLists.txt Copyright.txt CTestConfig.cmake License.txt README.txt Kindly help me to proceed further steps. Anticipating your reply. Thanks in advance. ----- Regards, Nelson -- View this message in context: http://vtk.1045678.n5.nabble.com/Configuration-Procedure-ParaViewWeb-tp5717731p5717745.html Sent from the VTK - Users mailing list archive at Nabble.com. From rickfrank at me.com Fri Dec 28 23:57:53 2012 From: rickfrank at me.com (Richard Frank) Date: Fri, 28 Dec 2012 23:57:53 -0500 Subject: [vtkusers] clarification on smart pointer usage In-Reply-To: References: <71D5CB86-AB85-46DA-99D8-198E99A7E71E@me.com> Message-ID: <9F29BE1D-5E49-4B26-890A-4C1F9EBA8FF0@me.com> Thanks- I'm doing that. Given two smart pointers allocated with ::New() macro, what should happen to the lhs on assignment? i.e lhs = rhs; What I seemed to see was lhs leaking- destructor not called. I would imagine that ref count would be 1 on creation, then decremented on assignment, and delete called if ref count is 0..... Rick Frank On Dec 28, 2012, at 10:27 PM, David Gobbi wrote: > Hi Frank, > > Here is the correct code for assigning a smart pointer to a new object: > > vtkSmartPointer one = > vtkSmartPointer::New(); > > You need to use the special smart pointer "New" method to create the > new object. Otherwise, the object ends up with a reference count of > two (one from the New and one from assigning the smart pointer). > > - David > > > On Fri, Dec 28, 2012 at 6:35 PM, Rick Frank wrote: >> >> Hi, >> >> >> Tracing through the code seems to indicate that assigning one smart point to another does not free the left hand side pointer. >> >> For instance, >> >> vtkSmartPointer one = vtkVolumeRayCastCompositionFunction::New(); >> >> >> vtkSmartPointer two = vtkVolumeRayCastCompositionFunction::New(); >> >> >> one = two; >> >> // The pointer in one seems to be left undeleted? >> >> Is there a standard best-pattern for deleting the left hand side of the assignment? >> >> >> The docs say the reference to the pointer is removed, but that's a bit unclear to me. >> >> In the above, I put a break point on the dtor of vtkVolumeRayCastCompositionFunction and it wasn't hit. >> >> Thanks >> >> Rick From crawfsoldan at yahoo.com Sat Dec 29 03:03:43 2012 From: crawfsoldan at yahoo.com (Neil Crawford) Date: Sat, 29 Dec 2012 00:03:43 -0800 (PST) Subject: [vtkusers] Support of C++ Builder with VTK 5.10 and newer Message-ID: <1356768223.29374.YahooMailNeo@web161703.mail.bf1.yahoo.com> On Tue, 4 Sep 2012 20:41:09 +0000, James Johnston said: > the internal compiler error on vtkExtractSelectedIds turned into this with VTK 5.10 / C++ Builder XE2: >? > C:\Users\JamesJ\Documents\Repositories\VTK-source\VTK\Graphics\vtkExtractSelectedIds.cxx: > Error E2027 > C:\Users\JamesJ\Documents\Repositories\VTK-source\VTK\Graphics\vtkExtractSelectedIds.cxx > 337: Must take address of a memory location in function void > vtkExtractSelectedIdsExtractCells(vtkExtractSelectedIds *,int,int,vtkDataSet > *,vtkIdTypeArray *,vtkSignedCharArray *,vtkSignedCharArray *,int,vtkStdString *,vtkStdString *) > Error E2342 > C:\Users\JamesJ\Documents\Repositories\VTK-source\VTK\Graphics\vtkExtractSelectedIds.cxx > 337: Type mismatch in parameter '_Right' (wanted 'const std::string &', got 'vtkStdString') in function > void vtkExtractSelectedIdsExtractCells(vtkExtractSelectedIds > *,int,int,vtkDataSet *,vtkIdTypeArray *,vtkSignedCharArray *,vtkSignedCharArray *,int,vtkStdString > *,vtkStdString *) ? Using Embarcadero C++ Builder XE3 to compile VTK 5.10.1 I tried to follow the recipe provided by Oliver Weinheimer for VTK 5.8, but I also ran into these same errors in Graphics\vtkExtractSelectedIds.cxx. ? These errors are all related to expressions that include static_cast or static_cast, which the Embarcadero compiler seems to have some trouble with when included in longer expressions.? However, it compiles if an extra line is added with a temporary intermediate variable (I don?t really understand why).? For example, replacing the following line idLessThanLabel =(id[idArrayIndex] < static_cast(label[labelArrayIndex])); with these 2 lines T1 temp= static_cast(label[labelArrayIndex]); idLessThanLabel =(id[idArrayIndex] ::vtkNew() ?- added #include "vtkTextProperty.h" to vtkColorLegend.h ? Rendering\vtkWin32OpenGLRenderWindow.cxx: Error E2451 C:\VTK510\VTK510\Rendering\vtkWin32OpenGLRenderWindow.cxx 1005: Undefined symbol ?intptr_t? in function vtkWin32OpenGLRenderWindow::CreateAWindow() - added #include to vtkWin32OpenGLRenderWindow.h ? Charts\vtkPlotBar.cxx and Charts\vtkPlotStacked.cxx Error E2034 C:\VTK510\VTK510\Charts\vtkPlotStacked.cxx 135: Cannot convert 'vtkSmartPointer' to 'int' in function vtkPlotStackedSegment::Configure(vtkPlotStacked *,vtkDataArray *,vtkDataArray *,vtkPlotStackedSegment *) Error E2285 C:\VTK510\VTK510\Charts\vtkPlotStacked.cxx 135: Could not find a match for 'CopyToPointsSwitch(vtkSmartPointer,undefined,double *,vtkDataArrayk *,int)' in function vtkPlotStackedSegment::Configure(vtkPlotStacked *,vtkDataArray *,vtkDataArray *,vtkPlotStackedSegment *) - Have to help properly cast the vtkPoints2D - for example, changed CopyToPointsSwitch(this->Points,this->Previous ? this->Previous->Points : 0, ???????????????????????????????? static_cast(x_array->GetVoidPointer(0)), ???????????????????????????????? y_array,x_array->GetNumberOfTuples())); to CopyToPointsSwitch(this->Points,this->Previous ? vtkPoints2D::SafeDownCast(this->Previous->Points) : 0, ???????????????????????????????? static_cast(x_array->GetVoidPointer(0)), ???????????????????????????????? y_array,x_array->GetNumberOfTuples())); ? ? In linking CXX executable in Filtering\Testing\Cxx\CMakeFiles\FilteringCxxTests.exe Unresolved external '_vtk_netcdf_nc_inq_varid' (and several others related to netcdf) referenced from vtkSLACReader and elsewhere. ?- When watching closely, during build of vtkNetCDF.lib, the compiler provides a warning that dim.c.obj and var.c.obj are duplicate filenames (because files of the same name are present both in vtkNetCDF.dir\libsrc and vtkNetCDF.dir\libdispatch) and will therefore not be added again.? Although filenames are the same, contents are different, with the unresolved classes residing in the \libdispatch versions.? Renamed dim.c.obj to dim2.c.obj and var.c.obj to var2.c.obj in the libdispatch directory and changed lines within build.make in C:\VTK510\VTK510Bin\Utilities\vtknetcdf\CMakeFiles\vtkNetCDF.dir to reflect the renamed obj files. From notinmyhead at gmail.com Sat Dec 29 04:09:25 2012 From: notinmyhead at gmail.com (Alessandro) Date: Sat, 29 Dec 2012 10:09:25 +0100 Subject: [vtkusers] Mac/VTK/Qt problems In-Reply-To: <1356718270390-5717741.post@n5.nabble.com> References: <415758d20906161151k3c283ee8w89848fc282e4a305@mail.gmail.com> <20090616225818.1164164797@76.65.240.2> <415758d20906181045o3dac33d5qc3734ad3dee07874@mail.gmail.com> <4A40F169.2020300@elemtech.com> <4A40FAC7.3010609@elemtech.com> <415758d20906240713t95f5cb3p737d56e17cbccf64@mail.gmail.com> <1356113906174-5717697.post@n5.nabble.com> <0284E66B6927A945A88A1714606BCC853712C5B2@ITSNT437.iowa.uiowa.edu> <1356718270390-5717741.post@n5.nabble.com> Message-ID: It depends on Plugins. You could give it a try solving all not found. Il giorno 28/dic/2012, alle ore 19.11, bberkowi ha scritto: > If it's of any relevance, CMake doesn't find many of the QT plugins and > executables. Many of the paths say "[PLUGIN]-NOTFOUND". Is it possible > that this is leading to errors when I try to compile Qt projects? > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/Mac-VTK-Qt-problems-tp1246044p5717741.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://www.vtk.org/mailman/listinfo/vtkusers From bill.lorensen at gmail.com Sat Dec 29 08:50:10 2012 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Sat, 29 Dec 2012 08:50:10 -0500 Subject: [vtkusers] Support of C++ Builder with VTK 5.10 and newer In-Reply-To: <1356768223.29374.YahooMailNeo@web161703.mail.bf1.yahoo.com> References: <1356768223.29374.YahooMailNeo@web161703.mail.bf1.yahoo.com> Message-ID: You should report these compiler defects to Embarcadero. FVTK is open source and they can easily reproduce the errors. Bill On Sat, Dec 29, 2012 at 3:03 AM, Neil Crawford wrote: > Embarcadero C++ Builder -- Unpaid intern in BillsBasement at noware dot com From bastiencat at hotmail.com Sat Dec 29 11:18:30 2012 From: bastiencat at hotmail.com (bastiencat) Date: Sat, 29 Dec 2012 08:18:30 -0800 (PST) Subject: [vtkusers] Problem with QVTKWidget2 / QVTKWidget Message-ID: <1356797910501-5717750.post@n5.nabble.com> Hi all, I'm sorry in advance for my poor english. I'm going to explain my problem. Currently, I use a QVTKWidget with a vtkImageViewer to display dicom images on my Qt application. It works great but I'd like to draw onto the widget, for example drawing a line etc... All my attempts are failed concerning the using of paintEvent with a QVTKWidget. I read recently that it's impossible to draw onto a QVTKWidget so I replace my QVTKWidget by a QVTKWidget2. But now I can't display my widget into my main window. The image is displayed in a new window, even thought this widget is add on a parent layout... I tried many solutions but nothing works... So I'd like to know how can I do to displayed correctly my QVTKWidget2 into his parent widget, or maybe have you a solution to draw onto a QVTKWidget ? Thinking you in anticipation, Yours sincerely, Bastien. -- View this message in context: http://vtk.1045678.n5.nabble.com/Problem-with-QVTKWidget2-QVTKWidget-tp5717750.html Sent from the VTK - Users mailing list archive at Nabble.com. From alejandromigcastro at gmail.com Sat Dec 29 13:46:09 2012 From: alejandromigcastro at gmail.com (alejandro castro) Date: Sat, 29 Dec 2012 12:46:09 -0600 Subject: [vtkusers] Surface triangulation from nodes AND normals Message-ID: I have a set of points and the surface normals at those points. I can additionally tell what points belong to the surface boundary. >From this information I would like to triangulate this surface. What would the best approach be? Is there a specific vtk method/filter that I could use for this? Would anybody have a similar source code example? I have seen that vtk offers the vtkSurfaceReconstructionFilter. However, I think I could solve this problem in a more efficient and robust way given that I have this extra information (normals and boundary points). thank you in advance. A. -------------- next part -------------- An HTML attachment was scrubbed... URL: From 522250912 at qq.com Sun Dec 30 09:21:40 2012 From: 522250912 at qq.com (=?gb18030?B?t6zH0cbvyr8=?=) Date: Sun, 30 Dec 2012 22:21:40 +0800 Subject: [vtkusers] tubesurface cutting to ensure the cube periodicity Message-ID: what i want to do is just like above picture. for now i just generate may fibres with out above operation: i dont know how to do with each one cut and move like above. and i don't know how to save so many tubemapper as a stl file. so what vtk function should i use? or any one give me example code. my codes show as bellow: #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include"math.h" #include #include #include #include void normalize(float *a) { float length=sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]); if(length>0) { a[0]=a[0]/length; a[1]=a[1]/length; a[2]=a[2]/length; } else { a[0]=0; a[1]=0; a[2]=0; } } float* cross(float* a,float *b,float *re) { re[0]=a[1]*b[2]-a[2]*b[1]; re[1]=a[2]*b[0]-a[0]*b[2]; re[2]=a[0]*b[1]-a[1]*b[0]; normalize(re); return re; } int main(int argc, char *argv[]) { vtkMath::RandomSeed(1); float beta=1; float PI=3.1415926; int const N=5; int fibernumber=130; float fiberradius=0.1; float boxsize=10; float fiberlength=10; // Create a renderer, render window, and interactor vtkSmartPointer renderer = vtkSmartPointer::New(); renderer->SetBackground(0.8,0.83,0.9); vtkSmartPointer renderWindow = vtkSmartPointer::New(); renderWindow->AddRenderer(renderer); vtkSmartPointer renderWindowInteractor = vtkSmartPointer::New(); renderWindowInteractor->SetRenderWindow(renderWindow); vtkSmartPointer style = vtkSmartPointer::New(); renderWindowInteractor->SetInteractorStyle(style); for(int k=0;k points= vtkSmartPointer::New(); points->SetNumberOfPoints(N); float step=fiberlength/N; float dx=sin(theta)*cos(phi); float dy=sin(theta)*sin(phi); float dz=cos(theta); float up[3]={0,0,1}; float T[3]={dx,dy,dz}; float N1[3],B1[3]; cross(T,up,N1); cross(N1,T,B1); float points2[N][3]; for(int i=0;iInsertPoint(i,points2[i][0],points2[i][1],points2[i][2]); //points->InsertNextPoint(points2[i]); } vtkSmartPointer lines = vtkSmartPointer::New(); lines->InsertNextCell(N); for (int i = 0; i < N; i++) { lines->InsertCellPoint(i); } vtkSmartPointer polyData = vtkSmartPointer::New(); polyData->SetPoints(points); polyData->SetLines(lines); vtkSmartPointer xSpline = vtkSmartPointer::New(); xSpline->SetDefaultTension(0); vtkSmartPointer ySpline = vtkSmartPointer::New(); ySpline->SetDefaultTension(0); vtkSmartPointer zSpline = vtkSmartPointer::New(); zSpline->SetDefaultTension(0); vtkSmartPointer spline = vtkSmartPointer::New(); spline->SetXSpline(xSpline); spline->SetYSpline(ySpline); spline->SetZSpline(zSpline); spline->SetPoints(points); vtkSmartPointer functionSource = vtkSmartPointer::New(); functionSource->SetParametricFunction(spline); functionSource->Update(); // Create a mapper and actor vtkSmartPointer lineMapper = vtkSmartPointer::New(); lineMapper->SetInputConnection(functionSource->GetOutputPort()); vtkSmartPointer lineActor = vtkSmartPointer::New(); lineActor->GetProperty()->SetColor(1,0,1); // Give some color to the line lineActor->SetMapper(lineMapper); // Create a tube (cylinder) around the line vtkSmartPointer tubeFilter = vtkSmartPointer::New(); tubeFilter->SetInputConnection(functionSource->GetOutputPort()); tubeFilter->SetRadius(fiberradius); //default is .5 tubeFilter->SetNumberOfSides(15); tubeFilter->CappingOn(); tubeFilter->Update(); // Create a mapper and actor vtkSmartPointer tubeMapper = vtkSmartPointer::New(); tubeMapper->SetInputConnection(tubeFilter->GetOutputPort()); vtkSmartPointer tubeActor = vtkSmartPointer::New(); tubeActor->GetProperty()->SetOpacity(0.5); //Make the tube have some transparency. tubeActor->GetProperty()->SetColor(0.8,0.7,0.2); tubeActor->SetMapper(tubeMapper); // Add the actor to the scene renderer->AddActor(tubeActor); renderer->AddActor(lineActor); } // Render and interact renderWindow->SetSize(600, 600); renderWindow->Render(); renderWindowInteractor->Start(); return EXIT_SUCCESS; } -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/jpeg Size: 129373 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/jpeg Size: 33770 bytes Desc: not available URL: From 522250912 at qq.com Sun Dec 30 09:50:36 2012 From: 522250912 at qq.com (=?utf-8?B?55Wq6IyE6aqR5aOr?=) Date: Sun, 30 Dec 2012 22:50:36 +0800 Subject: [vtkusers] tubesurface cutting to ensure the cube periodicity Message-ID: An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/jpeg Size: 33770 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/jpeg Size: 129653 bytes Desc: not available URL: From sebastien.jourdain at kitware.com Sun Dec 30 10:50:25 2012 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Sun, 30 Dec 2012 10:50:25 -0500 Subject: [vtkusers] Configuration Procedure ParaViewWeb In-Reply-To: <1356756642087-5717745.post@n5.nabble.com> References: <1356587979778-5717731.post@n5.nabble.com> <1356756642087-5717745.post@n5.nabble.com> Message-ID: The ParaViewWeb super build already downloaded ParaView and build it for you. I'm not a windows user, but if you could trigger the "make install" you should get a nice organized install directory with the binaries and web applications that you will need to move into tomcat. But as I said earlier, Windows is not the best platform for ParaViewWeb. I guess Joachim might know more. Seb On Fri, Dec 28, 2012 at 11:50 PM, Nelson wrote: > Hi Sebastien, > > Thank you very much for your informative reply. > > I have installed ParaView 3.14.1 in my system. > I have installed Tomcat in my system > I have downloaded ParaViewWeb super build. With the help of CMake I have > created the binaries. > > Now the folder structure is: > > ParaViewWeb > - build > - install > - src > > folders in build directory > ========================== > ActiveMQ-cpp > activemq-cpp.dir > activemq-cpp-prefix > ant > ant.dir > ant-prefix > apr > APR.dir > APR-prefix > apr-util > APR-UTIL.dir > APR-UTIL-prefix > CMakeFiles > flex3 > Flex3-MPL.dir > Flex3-MPL-prefix > GoogleWebToolkit.dir > GoogleWebToolkit-prefix > gwt > ParaView > ParaView.dir > ParaView-prefix > ParaViewWeb > ParaViewWeb-prefix > qooxdoo > qooxdoo.dir > qooxdoo-prefix > ZERO_CHECK.dir > > and some MSVC project files etc., > > folders and files in src > ======================== > Clients > Data > Documents > ParaViewAdapter > Scripts > SuperBuild > WebServer > CMakeLists.txt > Copyright.txt > CTestConfig.cmake > License.txt > README.txt > > Kindly help me to proceed further steps. > Anticipating your reply. > > Thanks in advance. > > > > ----- > Regards, > Nelson > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Configuration-Procedure-ParaViewWeb-tp5717731p5717745.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://www.vtk.org/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luis.ibanez at kitware.com Sun Dec 30 11:38:48 2012 From: luis.ibanez at kitware.com (Luis Ibanez) Date: Sun, 30 Dec 2012 11:38:48 -0500 Subject: [vtkusers] Building VTK in the Raspberry Pi Message-ID: How to build VTK in the Raspberry Pi: http://www.kitware.com/blog/home/post/429 -- Luis -------------- next part -------------- An HTML attachment was scrubbed... URL: From definitelycertifiable at gmail.com Mon Dec 31 01:27:45 2012 From: definitelycertifiable at gmail.com (John82) Date: Sun, 30 Dec 2012 22:27:45 -0800 (PST) Subject: [vtkusers] vtk3dWidget interaction problem on Windows In-Reply-To: References: <1356615440559-5717736.post@n5.nabble.com> <1356697775677-5717738.post@n5.nabble.com> Message-ID: <1356935265865-5717756.post@n5.nabble.com> This is how my sphere widget is defined. widget = vtk.vtkSphereWidget() #widget.SetInteractor (self.control) # My interactor widget.PlaceWidget( self.bbox ) # Bounding box widget.SetRepresentation( 2 ) widget.SetCenter(point) # This is a point inside my geometry widget.SetPlaceFactor(0.15) widget.SetRadius(0.1) widget.SetEnabled(1) -- View this message in context: http://vtk.1045678.n5.nabble.com/vtk3dWidget-interaction-problem-on-Windows-tp5717736p5717756.html Sent from the VTK - Users mailing list archive at Nabble.com.