From alican1812 at hotmail.com Wed Nov 1 09:04:01 2017 From: alican1812 at hotmail.com (alican) Date: Wed, 1 Nov 2017 06:04:01 -0700 (MST) Subject: [vtkusers] How to make indefinite coordinate system Message-ID: <1509541441717-0.post@n5.nabble.com> I know about vtkAxisActor, and about vtkCubeAxesActor. However what I would really like is to create a coordinate system across the screen, with a center in the viewport's (0,0,0) and with axis in both positive and negative directions, filling all the screen, no matter how zoomed/panned it is. Does somebody know how to/ have tried to do something similar? Thanks, AC -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From rick at pile.com Wed Nov 1 12:13:47 2017 From: rick at pile.com (Rick Dailey) Date: Wed, 1 Nov 2017 09:13:47 -0700 (MST) Subject: [vtkusers] vtkTextureObject bind error In-Reply-To: References: <1501518920479-5744223.post@n5.nabble.com> <1501522915867-5744226.post@n5.nabble.com> <1501584716697-5744234.post@n5.nabble.com> <1502710447044-5744390.post@n5.nabble.com> Message-ID: <1509552827599-0.post@n5.nabble.com> Can someone please take a look at this issue again. The fix that was provided back in August does not work as expected and causes additional problems as I noted in my most recent post (September 29). I have asked for assistance a few times since then but there have been no replies. Thanks. Rick Dailey -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From aashish.chaudhary at kitware.com Wed Nov 1 12:41:30 2017 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Wed, 01 Nov 2017 16:41:30 +0000 Subject: [vtkusers] vtkTextureObject bind error In-Reply-To: <1509552827599-0.post@n5.nabble.com> References: <1501518920479-5744223.post@n5.nabble.com> <1501522915867-5744226.post@n5.nabble.com> <1501584716697-5744234.post@n5.nabble.com> <1502710447044-5744390.post@n5.nabble.com> <1509552827599-0.post@n5.nabble.com> Message-ID: Hi Rick, As we are following up on this issue, we will report back to the this thread as soon as we have a resolution. Thanks, On Wed, Nov 1, 2017 at 12:13 PM Rick Dailey wrote: > Can someone please take a look at this issue again. The fix that was > provided back in August does not work as expected and causes additional > problems as I noted in my most recent post (September 29). I have asked > for assistance a few times since then but there have been no replies. > > Thanks. > Rick Dailey > > > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sankhesh.jhaveri at kitware.com Wed Nov 1 13:12:29 2017 From: sankhesh.jhaveri at kitware.com (Sankhesh Jhaveri) Date: Wed, 01 Nov 2017 17:12:29 +0000 Subject: [vtkusers] Issues using QVTKOpenGLWidget In-Reply-To: References: Message-ID: Hi Boris, Regarding the vtkHardwareSelector issue, try disabling multisampling on the QSurfaceFormat before setting the default surface format. QSurfaceFormat fmt = QVTKOpenGLWidget::defaultFormat(); fmt.setSamples(0); QSurfaceFormat::setDefaultFormat(fmt); Hope that helps. Cheers, Sankhesh ? On Mon, Oct 30, 2017 at 12:54 PM Boris Basic wrote: > Hi, > > > I'm currently porting an existing finite element mesh analysis application > from VTK 7.0 to VTK 8.x (actually the last master to be ready for the > upcoming 8.1 version). But when switching to the new QVTKOpenGLWidget, I > encountered too issues, one relatively minor, the other pretty annoying. > > > The first and biggest problem is selection, both using vtkHardwareSelector > from surface selection, and the vtkRenderedAreaPicker for frustum > selection. The vtkHardwareSelector sometimes simply fails to select the > points properly, whereas it always worked with the previous QVTKWidget. > Unfortunately, it's very random, and I can't manage to get a working > example showing the issue on each selection. For the vtkRenderedAreaPicker, > the problem is that the render window becomes black while the picker is > working. > > > The second and minor issue, the first I encountered, concerns a > transparency problem with the new widget rendering. Lines seems to blend > with the background. I opened an issue here for that one: > https://gitlab.kitware.com/vtk/vtk/issues/17154. It's not as important as > the selection bug, but it was the first issue I saw. It is only visible > when multisampling is enabled. > > > Boris > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware | (518) 881-4417 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From kayarre at gmail.com Wed Nov 1 13:37:23 2017 From: kayarre at gmail.com (Kurt Sansom) Date: Wed, 01 Nov 2017 17:37:23 +0000 Subject: [vtkusers] Extract unstructured grid faces Message-ID: Vtk has the edge filter and geometry filter. But the geometry filter only extracts the outer surface, I want the equivalent the edge filter but for mesh faces. I assume I can subclass the geometry filter and remove the part that checks for no shared faces? Or does someone know an easier already implemented way? -Kurt -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Wed Nov 1 18:39:32 2017 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Wed, 1 Nov 2017 15:39:32 -0700 Subject: [vtkusers] Example for vtkProjectedTexture usage In-Reply-To: References: Message-ID: I just added an example... https://lorensen.github.io/VTKExamples/site/Cxx/Texture/ProjectedTexture/ On Tue, Oct 31, 2017 at 1:39 AM, Yeshwanth, Chandan wrote: > Hi, > > > > Can someone please provide an example for the usage of the > vtkProjectedTexture class > (https://www.vtk.org/doc/nightly/html/classvtkProjectedTexture.html)? > > My problem: I have a pattern image in PNG format that I want to project onto > a 3D object. I believe this is the right class to use. If this not the right > class to use, can you please point me to the appropriate class? > > > > Thanks, > > Chandan > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Unpaid intern in BillsBasement at noware dot com From iamdpak at gmail.com Thu Nov 2 00:48:06 2017 From: iamdpak at gmail.com (vinmean) Date: Wed, 1 Nov 2017 21:48:06 -0700 (MST) Subject: [vtkusers] How to achieve the screen shot with VTK In-Reply-To: References: <201304151530411020876@163.com> Message-ID: <1509598086989-0.post@n5.nabble.com> You can convert the image data into opencv Mat. Then you can save it in any format. cv::Mat screenshot() { vtkSmartPointer wif = vtkSmartPointer::New(); wif->SetInput(renderWindow); wif->Update(); vtkImageData* vtkRGBimage = wif->GetOutput(); int dimsRGBImage[3]; vtkRGBimage->GetDimensions(dimsRGBImage); cv::Mat cvImageRGB (dimsRGBImage[1], dimsRGBImage[0], CV_8UC3, vtkRGBimage->GetScalarPointer()); cv::cvtColor( cvImageRGB, cvImageRGB, CV_BGR2RGB); //convert color cv::flip( cvImageRGB, cvImageRGB, 0); //align axis with visualizer return cvImageRGB; } -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From chandan.yeshwanth at siemens.com Thu Nov 2 01:08:17 2017 From: chandan.yeshwanth at siemens.com (chandan) Date: Wed, 1 Nov 2017 22:08:17 -0700 (MST) Subject: [vtkusers] Example for vtkProjectedTexture usage In-Reply-To: References: Message-ID: <1509599297797-0.post@n5.nabble.com> Thanks, this helps a lot! -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From wellq.an at gmail.com Thu Nov 2 01:36:05 2017 From: wellq.an at gmail.com (Anniywell) Date: Wed, 1 Nov 2017 22:36:05 -0700 (MST) Subject: [vtkusers] How to create hexahedron polydata? Message-ID: <1509600965678-0.post@n5.nabble.com> I have 8 points, how to create hexahedron polydata? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From tj.corona at kitware.com Thu Nov 2 08:26:39 2017 From: tj.corona at kitware.com (TJ Corona) Date: Thu, 2 Nov 2017 08:26:39 -0400 Subject: [vtkusers] How to create hexahedron polydata? In-Reply-To: <1509600965678-0.post@n5.nabble.com> References: <1509600965678-0.post@n5.nabble.com> Message-ID: <66687410-81DA-49F2-8207-4020426318E3@kitware.com> From the vtk documentation : vtkPolyData represents a geometric structure consisting of vertices, lines, polygons, and/or triangle strips. Hexahedra are 3-dimensional cells; you cannot put a hexahedron into polydata. You can create an unstructured grid from 8 points , and then extract its surface as polydata . What exactly are you trying to do? Thomas J. Corona, Ph.D. Kitware, Inc. Senior R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4443 > On Nov 2, 2017, at 1:36 AM, Anniywell wrote: > > I have 8 points, how to create hexahedron polydata? > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From pdhahn at compintensehpc.com Thu Nov 2 16:23:34 2017 From: pdhahn at compintensehpc.com (Paul Douglas Hahn) Date: Thu, 2 Nov 2017 15:23:34 -0500 Subject: [vtkusers] VTK and SFML Message-ID: <0585aa7d-b6f9-5dff-918c-4318517e5e41@compintensehpc.com> Is anyone out there familiar with SFML who might also have some pointers on the issue of using it with VTK (i.e., either VTK from SFML or vice-versa)? From bartolomei-luca at virgilio.it Thu Nov 2 16:39:14 2017 From: bartolomei-luca at virgilio.it (bartolomei-luca at virgilio.it) Date: Thu, 2 Nov 2017 21:39:14 +0100 (CET) Subject: [vtkusers] Show 2D plane cut in QVTKWidget Message-ID: <1895716105.18228031509655154670.JavaMail.httpd@fep-webmail-04> Hello everyone, I am facing a problem of representation with VTK in a QT gui. I have an unstructured grid and I am cutting it with three separate planes (xy, xz, yz). My objective is to show in three different QVTKWidgets the intersections of the planes with the grid. I would like to display the results in 2D in every widget (like an "image", let's say - so I need to avoid rotations). I have tried to use vtkInteractorStyleImage so far. It works as I expect for the cut in the xy plane, but not in the other two cases. Is there a way to represent the results also in the xz and yz planes? I would like to avoid using vtkCamera, because I would like to have as much flexibility as possible. In my specific problem, the grid to be cut can change dimensions a lot from one case to the other. Thanks for the help. Best, Luca -------------- next part -------------- An HTML attachment was scrubbed... URL: From jayavardhanravi at outlook.com Fri Nov 3 09:59:38 2017 From: jayavardhanravi at outlook.com (Jay) Date: Fri, 3 Nov 2017 06:59:38 -0700 (MST) Subject: [vtkusers] Simple VTK application running for long time crashes with nvoglv32.dll error Message-ID: <1509717578095-0.post@n5.nabble.com> I had created a simple VTK application and the run it for long hours (9-12 hrs approx.). The application crashes with the nvoglv32.dll error. Exception Code: c0000005 - Access violation The exception occurs whent the Start() function is called i.e. renderInteractor->Start(); The crash occurs very randomly but always at the Start() function call. Sample pseudocode: vtkSource s = new vtksource; vtktransform t = new vtktransform; vtkpolydatamapper map = new vtkpolydatamapper; map->setinputconnection(s->getoutputport()); vtkactor act = new vtkactor; act->setmapper(map); renderer->addActor(act); renderInteractor->AddObserver(vtkCommand::TimerEvent, callBackClassObject); // "callBackClassObject" has over ridden the Execute() function renderInteractor->createRepeatingTimer(1); *renderInteractor->Start();* // Error occurs at this line This issue occurs only after running the vtk event loop for long hours. Does the VTK use the nvogl32.dll or any other part use this resource (OpenGL). Any possible ways to debug this issue. Any suggestions would be appreciated. Regards, Jay -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From stephen.langer at nist.gov Fri Nov 3 10:10:28 2017 From: stephen.langer at nist.gov (Langer, Stephen A. (Fed)) Date: Fri, 3 Nov 2017 14:10:28 +0000 Subject: [vtkusers] vtk and gtk on macOS In-Reply-To: References: <49FDD20F-0AFF-4475-B314-20C78E20EEA9@nist.gov> Message-ID: <5D8DE910-425D-4547-BEB3-81A2F2949F9A@nist.gov> HI David -- Thanks for the suggestions, which got me started on the right track. What seems to work is this (somewhat simplified to eliminate some infrastructure): // Create gtk widget and vtk window GtkWidget *drawing_area = gtk_drawing_area_new(); vtkSmartPointer render_window = vtkSmartPointer::New(); // Connect to gtk signals. g_signal_connect(drawing_area, "realize", realize_callback, ..) g_signal_connect(drawing_area, "configure_event", configure_callback, ?) // in realize_callback gtk_widget_realize(drawing_area); render_window->SetRootWindow(gtk_widget_get_root_window(drawing_area)); GdkWindow gparent = gtk_widget_get_parent_window(drawing_area); NSView *pid = gdk_quartz_window_get_nsview(gparent); render_window->SetParentId((void*) pid); // in configure_callback // event is a GdkEventConfigure* that's passed in as an argument // Unlike David's QWidget example, I do not use the superclass versions of SetSize and SetPosition render_window->SetSize(event->width, event->height); render_window->SetPosition(drawing_area->allocation.x, drawing_area->allocation.y); I also added an expose event callback which just called render_window->Render(), but it doesn't seem to be necessary. -- Steve From: David Gobbi Date: Tuesday, October 24, 2017 at 2:56 PM To: "Langer, Stephen A. (Fed)" Cc: "vtkusers at vtk.org" Subject: Re: [vtkusers] vtk and gtk on macOS Hi Steve, Here is some code that I use to bind a VTK window to a QWidget. My guess is that something similar should work with GTK. I have been using this on OS X with vtkCocoaRenderWindow. void BindRenderWindow(vtkRenderWindow *window, QWidget *widget) { // Unmap the window if it is already mapped somewhere else. if (window->GetMapped()) { window->Finalize(); } // Create the connection window->SetWindowId(reinterpret_cast(widget->winId())); // Note that we must call the superclass SetSize()/SetPosition() // (we just want to set the member variables, with no side-effects) window->vtkRenderWindow::SetSize(widget->width(), widget->height()); window->vtkRenderWindow::SetPosition(widget->x(), widget->y()); // Prepare for rendering if (widget->isVisible()) { window->Start(); } // Call SetSize() again, to synchronize the window to the widget window->SetSize(widget->width(), widget->height()); } Some further notes: 1) I disable Qt's paint engine, so that Qt itself doesn't draw in the window. GTK may be similar. 2) You probably will not need GtkGLExt (for Qt, I didn't have to use QGLWidget). - David On Tue, Oct 24, 2017 at 12:12 PM, Langer, Stephen A. (Fed) > wrote: Hi -- Is there a simple way to get vtk to work inside a gtk+2 program on macOS? If there isn't a simple way, is there a difficult one? I'm trying to get a program that uses gtk+2 and vtk to work with a modern version of vtk -- I'm upgrading from 5.10.1 to 7.1.1 or 8.0.1. On Linux, the following code creates a vtk render window and a gtk widget containing it: vtkRenderWindow *render_win = vtkRenderWindow::New(); GtkWidget *drawing_area = gtk_drawing_area_new(); Display *disp = GDK_DISPLAY(); render_win->SetDisplayId(disp); followed eventually by XID wid = GDK_WINDOW_XID(drawing_area->window); render_win->SetWindowId(wid); after receiving the gtk "realize" signal on the drawing_area. On macOS, I'd like to use the Cocoa version of gtk+2 and vtkCocoaRenderWindow, but I can't figure out how to embed the render window into a gtk widget. All the examples I've found on-line aren't really applicable. GtkGLExt might be applicable, but it doesn't look like it's being maintained. An alternative would be to use X11, but native Mac OpenGL doesn't understand X11, so I tried installing mesa from macports , rebuilding vtk with VTK_USE_X instead of VTK_USE_COCOA, and linking to /opt/local/lib instead of /System/Library/Frameworks/OpenGL.framework. Then I can use the same code as on Linux, but vtk complains about the context not supporting OpenGL 3.2, and then crashes: ERROR: In /Users/langer/UTIL/VTK/VTK-7.1.1/Rendering/OpenGL2/vtkTextureObject.cxx, line 440 vtkTextureObject (0x7f9eafdb1690): failed at glGenTextures 1 OpenGL errors detected 0 : (1280) Invalid enum Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From lasso at queensu.ca Fri Nov 3 10:48:31 2017 From: lasso at queensu.ca (Andras Lasso) Date: Fri, 3 Nov 2017 14:48:31 +0000 Subject: [vtkusers] Volume rendering produces rough surface at clipping plane Message-ID: Hi all, I'm working on visualizing cardiac images using volume rendering. I need to cut into the volume to see surfaces inside the heart, which works quite well by using clipping planes of the volume mapper. The only problem is that that surface at the cut plane looks very rough, which makes it difficult to distinguish from actual endocardial surfaces. If I "cut" the volume by setting voxel values outside the clipping box to "empty" (-1000 = air intensity value) then the cut surface looks nice - smooth and flat. See example for both cutting method in the attached files. Is there a way to change volume renderer to get smooth cut surfaces (the same look as we get by setting outside voxels to "empty" values)? Andras --- See full resolution images and more examples here: https://1drv.ms/f/s!Arm_AFxB9yqHsOsClG_QsMx-4sh8rg CT volume can be downloaded from here: http://slicer.kitware.com/midas3/download/item/292309/CTA-cardio.nrrd ________________________ Andras Lasso, PhD Senior Research Engineer, Associate Director (Engineering) Laboratory for Percutaneous Surgery School of Computing, Queen's University Kingston, ON, Canada -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: complete.png Type: image/png Size: 72860 bytes Desc: complete.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: cut-by-vr-clipping-planes.png Type: image/png Size: 71968 bytes Desc: cut-by-vr-clipping-planes.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: cut-by-setting-outside-values-to-empty.png Type: image/png Size: 58224 bytes Desc: cut-by-setting-outside-values-to-empty.png URL: From jayavardhanravi at outlook.com Fri Nov 3 15:29:37 2017 From: jayavardhanravi at outlook.com (Jay) Date: Fri, 3 Nov 2017 12:29:37 -0700 (MST) Subject: [vtkusers] VTK sever socket and vtk clent socket Message-ID: <1509737377702-0.post@n5.nabble.com> Is there any reference / examples for vtkClientSocket and vtkServerSocket Regards Jay -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From beekmaarten at yahoo.com Fri Nov 3 16:14:08 2017 From: beekmaarten at yahoo.com (Maarten Beek) Date: Fri, 3 Nov 2017 20:14:08 +0000 (UTC) Subject: [vtkusers] vtkAlgorithm and vtkExecutive References: <1834302246.1769049.1509740048835.ref@mail.yahoo.com> Message-ID: <1834302246.1769049.1509740048835@mail.yahoo.com> Hi All, Can some one explain me why I don't see a call setExecutive(0) in the vtkAlgorithm destructor? I think that in SetExecutive() (also called by GetExecutive()) the executive gets registered in the algorithm and the algorithm gets registered in the executive. If this is true not calling setExecutive(0) in the vtkAlgorithm destructor would cause a memory leak? Thanks - Maarten -------------- next part -------------- An HTML attachment was scrubbed... URL: From simakov.w at gmail.com Sat Nov 4 07:35:18 2017 From: simakov.w at gmail.com (Met@ll) Date: Sat, 4 Nov 2017 04:35:18 -0700 (MST) Subject: [vtkusers] Rotate the vector along the X, Y, Z axes. Message-ID: <1509795318033-0.post@n5.nabble.com> Rotate the vector along the X, Y, Z axes. Hello. For what day I can not turn the actor on the axes X, Y, Z. There are angles, but it is not possible to calculate the rotation matrix? How can I do that? Someone faced such a problem? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From andrew.amaclean at gmail.com Sat Nov 4 17:49:10 2017 From: andrew.amaclean at gmail.com (Andrew Maclean) Date: Sun, 5 Nov 2017 08:49:10 +1100 Subject: [vtkusers] =?utf-8?q?=E2=80=8B__Rotate_the_vector_along_the_X=2C_?= =?utf-8?q?Y=2C_Z_axes=2E?= Message-ID: If you look at https://www.vtk.org/doc/nightly/html/classvtkActor.html you will see that vtkActor inherits from the abstract class vtkProp3d: https://www.vtk.org/doc/nightly/html/classvtkProp3D.html so all the public member functions defined here are available. This should get you going: //--------------------------------------------------------------- #include #include // Set up your actor vtkSmartPointer actor = vtkSmartPointer::New(); // ... // Here's how to set the orientation of the actor. actor->RotateX(12); actor->RotateY(2); actor->RotateZ(-13); // Here's how to get the rotation matrix etc. vtkSmartPointer m = vtkSmartPointer::New(); actor->GetMatrix(m); double * orient; orient = actor->GetOrientationWXYZ(); //--------------------------------------------------------------- I'll add an example to VTK Examples https://lorensen.github.io/VTKExamples/site/ Andrew ---------- Forwarded message ---------- > From: "Met at ll" > To: vtkusers at vtk.org > Cc: > Bcc: > Date: Sat, 4 Nov 2017 04:35:18 -0700 (MST) > Subject: > ?? > [vtkusers] Rotate the vector along the X, Y, Z axes. > Rotate the vector along the X, Y, Z axes. > Hello. > For what day I can not turn the actor on the axes X, Y, Z. > There are angles, but it is not possible to calculate the rotation matrix? > How can I do that? Someone faced such a problem? > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- ___________________________________________ Andrew J. P. Maclean ___________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.amaclean at gmail.com Sat Nov 4 18:00:05 2017 From: andrew.amaclean at gmail.com (Andrew Maclean) Date: Sun, 5 Nov 2017 09:00:05 +1100 Subject: [vtkusers] =?utf-8?q?=E2=80=8B__Rotate_the_vector_along_the_X=2C_?= =?utf-8?q?Y=2C_Z_axes=2E?= In-Reply-To: References: Message-ID: This example: https://lorensen.github.io/VTKExamples/site/Cxx/GeometricObjects/OrientedArrow/ may be useful. On Sun, Nov 5, 2017 at 8:49 AM, Andrew Maclean wrote: > If you look at https://www.vtk.org/doc/nightly/html/classvtkActor.html > you will see that vtkActor inherits from the abstract class vtkProp3d: > https://www.vtk.org/doc/nightly/html/classvtkProp3D.html so all the > public member functions defined here are available. > > This should get you going: > //--------------------------------------------------------------- > #include > #include > > > > // Set up your actor > vtkSmartPointer actor = vtkSmartPointer::New(); > // ... > > // Here's how to set the orientation of the actor. > actor->RotateX(12); > actor->RotateY(2); > actor->RotateZ(-13); > // Here's how to get the rotation matrix etc. > vtkSmartPointer m = vtkSmartPointer::New(); > actor->GetMatrix(m); > double * orient; > orient = actor->GetOrientationWXYZ(); > //--------------------------------------------------------------- > > I'll add an example to VTK Examples https://lorensen. > github.io/VTKExamples/site/ > > Andrew > > > ---------- Forwarded message ---------- >> From: "Met at ll" >> To: vtkusers at vtk.org >> Cc: >> Bcc: >> Date: Sat, 4 Nov 2017 04:35:18 -0700 (MST) >> Subject: >> ?? >> [vtkusers] Rotate the vector along the X, Y, Z axes. >> Rotate the vector along the X, Y, Z axes. >> Hello. >> For what day I can not turn the actor on the axes X, Y, Z. >> There are angles, but it is not possible to calculate the rotation matrix? >> How can I do that? Someone faced such a problem? >> >> >> >> -- >> Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> > > > > -- > ___________________________________________ > Andrew J. P. Maclean > > ___________________________________________ > -- ___________________________________________ Andrew J. P. Maclean ___________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From landinghere at 163.com Sun Nov 5 09:07:50 2017 From: landinghere at 163.com (landings) Date: Sun, 5 Nov 2017 07:07:50 -0700 (MST) Subject: [vtkusers] My vtkDecimatePro result is problematic. What is the best approach? Message-ID: <1509890870318-0.post@n5.nabble.com> My mesh seems to have missing triangles when vtkDecimatePro is applied. Is there a way to preserve a closed surface? I have the following options: PreserveTopologyOff(); SplittingOn(); BoundaryVertexDeletionOn(); -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From bill.lorensen at gmail.com Sun Nov 5 12:33:52 2017 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Sun, 5 Nov 2017 12:33:52 -0500 Subject: [vtkusers] My vtkDecimatePro result is problematic. What is the best approach? In-Reply-To: <1509890870318-0.post@n5.nabble.com> References: <1509890870318-0.post@n5.nabble.com> Message-ID: PreserveTopologyOn On Nov 5, 2017 9:07 AM, "landings" wrote: > > > My mesh seems to have missing triangles when vtkDecimatePro is applied. Is > there a way to preserve a closed surface? > > I have the following options: > > PreserveTopologyOff(); > SplittingOn(); > BoundaryVertexDeletionOn(); > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From landinghere at 163.com Sun Nov 5 23:12:44 2017 From: landinghere at 163.com (landings) Date: Sun, 5 Nov 2017 21:12:44 -0700 (MST) Subject: [vtkusers] My vtkDecimatePro result is problematic. What is the best approach? In-Reply-To: References: <1509890870318-0.post@n5.nabble.com> Message-ID: <1509941564365-0.post@n5.nabble.com> I have tried PreserveTopologyOn(), but that doesn't make much difference, except that the maximum reduction is limited. There are still missing triangles. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From vijayarani.shanmugavadivu at appasamy.com Mon Nov 6 06:39:43 2017 From: vijayarani.shanmugavadivu at appasamy.com (Vijaya Rani) Date: Mon, 6 Nov 2017 04:39:43 -0700 (MST) Subject: [vtkusers] Fwd: Application hangs while loading vtp files with vtk 7.1.1 Message-ID: <1509968383102-0.post@n5.nabble.com> Hi We have an issue while loading large vtp files(for the file size 101MB and 1189985 points) using vtkUnstructuredGridReader using vtk 7.1.1 whereas its working in vtk7.0.0 without any issues.The application hangs while processing vtkUnstructuredGridReader->Update() method. Kindly help us to fix this issue. Thanks & Regrads Vijaya Rani S -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From mlitterio at pccube.com Mon Nov 6 09:44:11 2017 From: mlitterio at pccube.com (Martina Litterio) Date: Mon, 6 Nov 2017 15:44:11 +0100 Subject: [vtkusers] Opacity problems with vtkOSPRayPass Message-ID: Hi all! I have a problem using vtkOSPRayPass. I'm reading a DICOM series with vtkDICOMImageReader. My code is : ..bla bla bla vtkNew volumeMapper; volumeMapper->SetAutoAdjustSampleDistances(0); volumeMapper->SetSampleDistance(0.5); vtkDICOMImageReader* reader = vtkDICOMImageReader::New(); reader->SetDirectoryName("Path/to/my/DICOM"); reader->Update(); volumeMapper->SetInputConnection(reader->GetOutputPort()); volumeMapper->AddObserver(vtkCommand::ErrorEvent, errorObserver); vtkNew pwf; pwf->AddPoint(-3024, 0.0); pwf->AddPoint(-16, 0.0); pwf->AddPoint(641, 0.05); pwf->AddPoint(3071, 0.1); ctf->AddRGBPoint( -3024, 0, 0, 0, 0.5, 0.0 ); ctf->AddRGBPoint( -16, 0.73, 0.25, 0.30, 0.49, .61 ); ctf->AddRGBPoint( 641, .90, .82, .56, .5, 0.0 ); ctf->AddRGBPoint( 3071, 1, 1, 1, .5, 0.0 ); volumeProperty->SetColor(ctf); volumeProperty->SetScalarOpacity(pwf); volumeProperty->SetShade(0); volumeProperty->SetScalarOpacityUnitDistance(1.732); vtkNew volume; volume->SetMapper(volumeMapper); volume->SetProperty(volumeProperty); // Create the renderwindow, interactor and renderer vtkNew renderWindow; renderWindow->SetMultiSamples(0); renderWindow->SetSize(401, 399); // NPOT size vtkNew renderer; renderer->SetBackground(0.3, 0.3, 0.4); renderWindow->AddRenderer(renderer); renderer->AddVolume(volume); renderer->ResetCamera(); renderWindow->Render(); // Attach OSPRay render pass vtkNew osprayPass; if (useOSP) { renderer->SetPass(osprayPass); } vtkNew iren; iren->SetRenderWindow(renderWindow); vtkNew style; iren->SetInteractorStyle(style); iren->Start(); ... bla bla bla Now, the problem is the following. If "useOSP"==FALSE, I have a certain opacity (the which one I would like to have in my results); if "useOSP"==TRUE, I have a different opacity and I'm not able to manage it as I want. Can you please tell me what's wrong in my code? ?Thanks to everyone!? *Martina Li**tterio* -------------- next part -------------- An HTML attachment was scrubbed... URL: From baljci at hotmail.com Mon Nov 6 10:56:19 2017 From: baljci at hotmail.com (Boris Basic) Date: Mon, 6 Nov 2017 15:56:19 +0000 Subject: [vtkusers] Issues using QVTKOpenGLWidget In-Reply-To: References: , Message-ID: Hi Sankhesh, Disabling multisampling fixes the problem regarding the vtkHardwareSelector, however I prefer to keep it enabled to get a decent image quality. I know that the hardware selector is not supposed to work with mulsisampling on, however it worked with the following trick I: vtkNew selector; ... // Setup the selector renderWindow->OffScreenRenderingOn(); vtkSmartPointer selection = selector->Select(); renderWindow->OffScreenRenderingOff(); I understand though that this does not work anymore with the internal FBO used by QVTKOpenGLWidget. Do you think it could in the future? Cheers, Boris ________________________________ De : Sankhesh Jhaveri Envoy? : mercredi 1 novembre 2017 18:12 ? : Boris Basic Cc : vtk vtk Objet : Re: [vtkusers] Issues using QVTKOpenGLWidget Hi Boris, Regarding the vtkHardwareSelector issue, try disabling multisampling on the QSurfaceFormat before setting the default surface format. QSurfaceFormat fmt = QVTKOpenGLWidget::defaultFormat(); fmt.setSamples(0); QSurfaceFormat::setDefaultFormat(fmt); Hope that helps. Cheers, Sankhesh On Mon, Oct 30, 2017 at 12:54 PM Boris Basic > wrote: Hi, I'm currently porting an existing finite element mesh analysis application from VTK 7.0 to VTK 8.x (actually the last master to be ready for the upcoming 8.1 version). But when switching to the new QVTKOpenGLWidget, I encountered too issues, one relatively minor, the other pretty annoying. The first and biggest problem is selection, both using vtkHardwareSelector from surface selection, and the vtkRenderedAreaPicker for frustum selection. The vtkHardwareSelector sometimes simply fails to select the points properly, whereas it always worked with the previous QVTKWidget. Unfortunately, it's very random, and I can't manage to get a working example showing the issue on each selection. For the vtkRenderedAreaPicker, the problem is that the render window becomes black while the picker is working. The second and minor issue, the first I encountered, concerns a transparency problem with the new widget rendering. Lines seems to blend with the background. I opened an issue here for that one: https://gitlab.kitware.com/vtk/vtk/issues/17154. It's not as important as the selection bug, but it was the first issue I saw. It is only visible when multisampling is enabled. Boris _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -- Sankhesh Jhaveri Sr. Research & Development Engineer | Kitware | (518) 881-4417 -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Mon Nov 6 19:24:41 2017 From: dave.demarle at kitware.com (David E DeMarle) Date: Mon, 6 Nov 2017 19:24:41 -0500 Subject: [vtkusers] Shadow support on volume rendering In-Reply-To: <1509469501231-0.post@n5.nabble.com> References: <1472803169307-5740103.post@n5.nabble.com> <7002df66-ddbd-071b-79bc-272a98a799ce@insigniamedical.co.uk> <1509119924385-0.post@n5.nabble.com> <1509465934854-0.post@n5.nabble.com> <1509469501231-0.post@n5.nabble.com> Message-ID: I wouldn't worry too much about those two failing tests. I've seen them fail occasionally (failing on some of the VTK dashboard submitters currently), but I've yet to track it down. If the rest of the OSPRay*Volume tests work you should be pretty OK. Yes LUTs and in general appearance controls should work about the same. Would you mind sharing the data with me offline so I can take a look? David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Tue, Oct 31, 2017 at 1:05 PM, ianl wrote: > Ok, Looks like the light creation exception was a red herring. This was due > to a rogue old opsray dll in my debug directory (presumably from an earlier > attempt at getting this working). I have removed this and verified that the > correct dlls are getting loaded with Depends. > > I am still seeing a black image, but now no exception or debug output. Are > there any areas I could look at to try to get to the bottom of this? Am I > right in expecting the LUTs, etc that I am using for the GPU render pathway > to function in the same way for OSPRay (just with ray traced results rather > than ray casting)? > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank1985876 at gmail.com Tue Nov 7 02:50:21 2017 From: frank1985876 at gmail.com (frank) Date: Tue, 7 Nov 2017 15:50:21 +0800 Subject: [vtkusers] how to create a vtkDataSet according to the type of the input Message-ID: Hi, all If I want to create a vtkDataSet according to type of the input (vtkDataSet*), I can do that with the code below. Is there any way to get rid of those if-else? Any way like vtkDataArray do? vtkDataArray* a = vtkDataArray::CreateDataArray(array->GetDataType()); //---------------- vtkDataSet *data; if (input->IsA("vtkImageData")) data = vtkImageData::New(); else if (input->IsA("vtkStructuredGrid")) data = vtkStructuredGrid::New(); ? //---------------- Thank you! From kor1581 at gmail.com Tue Nov 7 04:30:19 2017 From: kor1581 at gmail.com (K O ranjith) Date: Tue, 7 Nov 2017 15:00:19 +0530 Subject: [vtkusers] vtk zoom indicator In-Reply-To: References: Message-ID: Hello, Thanks, it's working. Can I get the measured value (which is displayed as label axis) from vtkLegendScaleActor object. Ranjith KO On Fri, Jun 23, 2017 at 7:52 PM, Sankhesh Jhaveri < sankhesh.jhaveri at kitware.com> wrote: > Take a look at vtkLegendScaleActor > . > It uses vtkAxisActor > internally. > > Hth, > Sankhesh > ? > > On Fri, Jun 23, 2017 at 1:55 AM K O ranjith wrote: > >> I'm using vtk for developing a MRI DICOM Image viewer in Qt. >> The viewer uses vtkDICOMImageReader, vtkImageViewer2 & QVTKWidget. >> I need to show a zoom indicator line which varies length with zoom value >> and need not affect other operation like rotate, pan( which is used for >> DICOM image in same window). It's position should be fixed at side of >> viewer and should not alter with zoom, pan, rotate. >> I added an line as an vtkactor to the renderer using vtkLineSource. >> Its length altering with zoom as I intended, but problem is its >> position also altering with the zoom, also rotate and Pan affecting on it. >> How can I make the position of the line fixed at side of the viewer. >> Have any option in vtk for visual indication of zoom factor something >> like vtkOrientationMarkerWidget for orientation... >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at http://www.kitware.com/ >> opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> > -- > Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware > | (518) 881-4417 > ? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Tue Nov 7 06:05:36 2017 From: dave.demarle at kitware.com (David E DeMarle) Date: Tue, 7 Nov 2017 06:05:36 -0500 Subject: [vtkusers] how to create a vtkDataSet according to the type of the input In-Reply-To: References: Message-ID: Try data->NewInstance() On Nov 7, 2017 3:03 AM, "frank" wrote: > Hi, all > > If I want to create a vtkDataSet according to type of the input > (vtkDataSet*), I can do that with the code below. > Is there any way to get rid of those if-else? Any way like vtkDataArray > do? vtkDataArray* a = vtkDataArray::CreateDataArray(array->GetDataType()); > > //---------------- > vtkDataSet *data; > if (input->IsA("vtkImageData")) > data = vtkImageData::New(); > else if (input->IsA("vtkStructuredGrid")) > data = vtkStructuredGrid::New(); > ? > //---------------- > > Thank you! > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From seb.an at icloud.com Tue Nov 7 08:34:53 2017 From: seb.an at icloud.com (sebastian_a) Date: Tue, 7 Nov 2017 06:34:53 -0700 (MST) Subject: [vtkusers] Solidify vtkPolyData In-Reply-To: References: <1507156428979-0.post@n5.nabble.com> Message-ID: <1510061693067-0.post@n5.nabble.com> Hi, thanks for the reply. I now used the vtkImplicitModeller like in this example: https://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ImplicitModeller Also I use it in combination with a stencil, created out of my input PolyData, to solidify it just outside the model. Unfortunately it still isn't very precise and also it's not perfectly what I wanted. The blender solidify modifier really takes care that for example one face will become a solid box with the same dimensions in two directions and will be just solidified in it's flat direction. Using the vtkImplicitModeller Filter the face will become a model with rounded corners and larger dimensions in all directions. Still didn't find the perfekt solution. Thanks, Sebastian -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From bill.lorensen at gmail.com Tue Nov 7 09:14:43 2017 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Tue, 7 Nov 2017 09:14:43 -0500 Subject: [vtkusers] Solidify vtkPolyData In-Reply-To: <1510061693067-0.post@n5.nabble.com> References: <1507156428979-0.post@n5.nabble.com> <1510061693067-0.post@n5.nabble.com> Message-ID: Try this: https://lorensen.github.io/VTKExamples/site/Cxx/Meshes/FillHoles/ On Tue, Nov 7, 2017 at 8:34 AM, sebastian_a wrote: > Hi, thanks for the reply. > > I now used the vtkImplicitModeller like in this example: > https://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ImplicitModeller > > Also I use it in combination with a stencil, created out of my input > PolyData, to solidify it just outside the model. > > Unfortunately it still isn't very precise and also it's not perfectly what I > wanted. The blender solidify modifier really takes care that for example one > face will become a solid box with the same dimensions in two directions and > will be just solidified in it's flat direction. Using the > vtkImplicitModeller Filter the face will become a model with rounded corners > and larger dimensions in all directions. > > Still didn't find the perfekt solution. > > Thanks, > Sebastian > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -- Unpaid intern in BillsBasement at noware dot com From sankhesh.jhaveri at kitware.com Tue Nov 7 11:07:32 2017 From: sankhesh.jhaveri at kitware.com (Sankhesh Jhaveri) Date: Tue, 07 Nov 2017 16:07:32 +0000 Subject: [vtkusers] vtk zoom indicator In-Reply-To: References: Message-ID: There?s no direct API but you can calculate it. All you have to do is compute the length of the axis in world coordinates. Something like this: double * leftPoint = axis->GetPositionCoordinate()->GetComputedWorldValue(renderer);double * rightPoint = axis->GetPosition2Coordinate()->GetComputedWorldValue(renderer);double distance = vtkMath::sqrt(vtkMath::Distance2BetweenPoints(leftPoint, rightPoint));// Scale is 1 : distance Hope that helps. Best, Sankhesh ? On Tue, Nov 7, 2017 at 4:30 AM K O ranjith wrote: > Hello, > Thanks, it's working. > Can I get the measured value (which is displayed as label axis) from > vtkLegendScaleActor object. > > Ranjith KO > > On Fri, Jun 23, 2017 at 7:52 PM, Sankhesh Jhaveri < > sankhesh.jhaveri at kitware.com> wrote: > >> Take a look at vtkLegendScaleActor >> . >> It uses vtkAxisActor >> internally. >> >> Hth, >> Sankhesh >> ? >> >> On Fri, Jun 23, 2017 at 1:55 AM K O ranjith wrote: >> >>> I'm using vtk for developing a MRI DICOM Image viewer in Qt. >>> The viewer uses vtkDICOMImageReader, vtkImageViewer2 & QVTKWidget. >>> I need to show a zoom indicator line which varies length with zoom >>> value and need not affect other operation like rotate, pan( which is used >>> for DICOM image in same window). It's position should be fixed at side of >>> viewer and should not alter with zoom, pan, rotate. >>> I added an line as an vtkactor to the renderer using vtkLineSource. >>> Its length altering with zoom as I intended, but problem is its >>> position also altering with the zoom, also rotate and Pan affecting on it. >>> How can I make the position of the line fixed at side of the viewer. >>> Have any option in vtk for visual indication of zoom factor something >>> like vtkOrientationMarkerWidget for orientation... >>> >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/vtkusers >>> >> -- >> Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware >> | (518) 881-4417 >> ? >> > > -- Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware | (518) 881-4417 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From alvaro.sanchez at kitware.com Tue Nov 7 11:23:37 2017 From: alvaro.sanchez at kitware.com (Alvaro Sanchez) Date: Tue, 7 Nov 2017 11:23:37 -0500 Subject: [vtkusers] Issues using QVTKOpenGLWidget In-Reply-To: References: Message-ID: As an alternative to multisampling, you could enable FXAA in vtkRenderer. I think this would not interfere with hardware selection. https://www.vtk.org/doc/nightly/html/classvtkRenderer.html#a3f46ed85e17e5e297e6c3b02be07ebba On Mon, Nov 6, 2017 at 10:56 AM, Boris Basic wrote: > Hi Sankhesh, > > > Disabling multisampling fixes the problem regarding the > vtkHardwareSelector, however I prefer to keep it enabled to get a decent > image quality. I know that the hardware selector is not supposed to work > with mulsisampling on, however it worked with the following trick I: > > > vtkNew selector; > ... // Setup the selector > renderWindow->OffScreenRenderingOn(); > vtkSmartPointer selection = selector->Select(); > renderWindow->OffScreenRenderingOff(); > > I understand though that this does not work anymore with the internal FBO > used by QVTKOpenGLWidget. Do you think it could in the future? > > Cheers, > Boris > > ------------------------------ > *De :* Sankhesh Jhaveri > *Envoy? :* mercredi 1 novembre 2017 18:12 > *? :* Boris Basic > *Cc :* vtk vtk > *Objet :* Re: [vtkusers] Issues using QVTKOpenGLWidget > > > Hi Boris, > > Regarding the vtkHardwareSelector issue, try disabling multisampling on > the QSurfaceFormat before setting the default surface format. > > QSurfaceFormat fmt = QVTKOpenGLWidget::defaultFormat(); > fmt.setSamples(0); > QSurfaceFormat::setDefaultFormat(fmt); > > Hope that helps. > > Cheers, > Sankhesh > > On Mon, Oct 30, 2017 at 12:54 PM Boris Basic wrote: > > Hi, > > > I'm currently porting an existing finite element mesh analysis application > from VTK 7.0 to VTK 8.x (actually the last master to be ready for the > upcoming 8.1 version). But when switching to the new QVTKOpenGLWidget, I > encountered too issues, one relatively minor, the other pretty annoying. > > > The first and biggest problem is selection, both using vtkHardwareSelector > from surface selection, and the vtkRenderedAreaPicker for frustum > selection. The vtkHardwareSelector sometimes simply fails to select the > points properly, whereas it always worked with the previous QVTKWidget. > Unfortunately, it's very random, and I can't manage to get a working > example showing the issue on each selection. For the vtkRenderedAreaPicker, > the problem is that the render window becomes black while the picker is > working. > > > The second and minor issue, the first I encountered, concerns a > transparency problem with the new widget rendering. Lines seems to blend > with the background. I opened an issue here for that one: > https://gitlab.kitware.com/vtk/vtk/issues/17154. It's not as important as > the selection bug, but it was the first issue I saw. It is only visible > when multisampling is enabled. > > > Boris > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -- > Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware > | (518) 881-4417 > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -- Alvaro Sanchez Kitware, Inc. Senior R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4901 -------------- next part -------------- An HTML attachment was scrubbed... URL: From simakov.w at gmail.com Tue Nov 7 13:36:59 2017 From: simakov.w at gmail.com (Met@ll) Date: Tue, 7 Nov 2017 11:36:59 -0700 (MST) Subject: [vtkusers] =?utf-8?q?=E2=80=8B__Rotate_the_vector_along_the_X=2C_?= =?utf-8?q?Y=2C_Z_axes=2E?= In-Reply-To: References: Message-ID: <1510079819282-0.post@n5.nabble.com> Andrew Maclean-3, thanks for the help. But I still do not understand how to get right rotation ... The fact is that after you rotate along one axis, the other axes also shift and a wrong turn occurs. Below is an example from Wikipedia, in VTK also? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From frank1985876 at gmail.com Tue Nov 7 20:24:33 2017 From: frank1985876 at gmail.com (frank) Date: Wed, 8 Nov 2017 09:24:33 +0800 Subject: [vtkusers] how to create a vtkDataSet according to the type of the input In-Reply-To: References: Message-ID: <38DFB423-F503-4970-AB94-974DE4452A9A@gmail.com> Thank you, David data = input->NewInstance(); > ? 2017?11?7??19:05?David E DeMarle ??? > > Try data->NewInstance() > >> On Nov 7, 2017 3:03 AM, "frank" wrote: >> Hi, all >> >> If I want to create a vtkDataSet according to type of the input (vtkDataSet*), I can do that with the code below. >> Is there any way to get rid of those if-else? Any way like vtkDataArray do? vtkDataArray* a = vtkDataArray::CreateDataArray(array->GetDataType()); >> >> //---------------- >> vtkDataSet *data; >> if (input->IsA("vtkImageData")) >> data = vtkImageData::New(); >> else if (input->IsA("vtkStructuredGrid")) >> data = vtkStructuredGrid::New(); >> ? >> //---------------- >> >> Thank you! >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From ilindsay at insigniamedical.co.uk Wed Nov 8 04:57:34 2017 From: ilindsay at insigniamedical.co.uk (ianl) Date: Wed, 8 Nov 2017 02:57:34 -0700 (MST) Subject: [vtkusers] Shadow support on volume rendering In-Reply-To: References: <7002df66-ddbd-071b-79bc-272a98a799ce@insigniamedical.co.uk> <1509119924385-0.post@n5.nabble.com> <1509465934854-0.post@n5.nabble.com> <1509469501231-0.post@n5.nabble.com> Message-ID: <1510135054887-0.post@n5.nabble.com> Hi David, Basically any DICOM CT set will do, but a good example is the Visible Human Female Ankle, available here: https://mri.radiology.uiowa.edu/VHDicom/VHFCT1mm/VHF-Ankle.tar.gz This renders fine (see image) with the GPU renderer. I get a totally black image when I add in the OSPRay render pass. I have verified this by writing a loop to check the value of all output pixels, all end up as zeros. I have had a play around with the TestOSPRayVolumeRenderer.cxx test. I removed the data surface filter so the test only renders the volumetric image, this seems to render fine with OSPRay, so it seems that my set-up is ok. As another test, I added a marching cubes filter to extract an iso surface to my pipeline, along with a vtkPolyDataMapper to render it. In this configuration, I see a surface rendered by OSPRay, so it seems that the issue is something specific to my pipeline and volumetric rendering. I'll keep digging. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From amine.aboufirass at gmail.com Wed Nov 8 05:58:53 2017 From: amine.aboufirass at gmail.com (awa5114) Date: Wed, 8 Nov 2017 03:58:53 -0700 (MST) Subject: [vtkusers] get all unstructured grid data from vtk Message-ID: <1510138733357-0.post@n5.nabble.com> Hello, I am a new vtk user in python. I have an unstructured grid vtk file containing the following: ASCII DATASET UNSTRUCTURED_GRID POINTS 96 float CELLS 96 192 CELL_TYPES 96 POINT_DATA 96 VECTORS vector1 float VECTORS vector2 float etc I would like to, using the vtk library available in python, obtain the values of the vectors for ALL my points as a python or numpy list. I am toying with the following example in the vtk library website https://lorensen.github.io/VTKExamples/site/Python/IO/UnstructuredGridReader/ It's a nice example that shows some wicked functionality. But that's useless to a new end user like me who needs to accomplish simple data extraction and functionality. Could anyone please provide some additional insight on how this can be accomplished? Thanks -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From rppatil3210 at gmail.com Wed Nov 8 06:00:25 2017 From: rppatil3210 at gmail.com (rohit) Date: Wed, 8 Nov 2017 04:00:25 -0700 (MST) Subject: [vtkusers] MPR crosshairs Call Back Message-ID: <1510138825479-0.post@n5.nabble.com> Hello all VTK users, I am new to vtk and nowadays working on an MPR (MultiPlanar Reconstruction) of a CT/MRI image in JAVA I have successfully developed the view which it is required to view the MPR and its crosshairs, but from two days I am stuck in the crosshairs movement callback, I want to one crosshair along with this other two view + crosshairs have to change. Help me to solve this problem. I am attaching my code below for the reference and also image too. I can also provide the whole MPR project in java for reference. Used - VTK8.0.jar file, vtk dll files, java 8, IDE - Eclipse package test_vtk_blog; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.EventQueue; import java.awt.Font; import java.awt.GraphicsEnvironment; import java.awt.GridLayout; import java.awt.Point; import java.awt.Rectangle; import java.awt.Toolkit; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.File; import java.io.IOException; import javax.swing.BorderFactory; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JMenuItem; import javax.swing.JPanel; import javax.swing.JPopupMenu; import javax.swing.JSplitPane; import javax.swing.JTextArea; import javax.swing.SwingUtilities; import javax.swing.border.TitledBorder; import org.dcm4che2.data.DicomObject; import org.dcm4che2.data.Tag; import org.dcm4che2.io.DicomInputStream; import vtk.vtkCamera; import vtk.vtkCanvas; import vtk.vtkCursor2D; import vtk.vtkDICOMImageReader; import vtk.vtkImageActor; import vtk.vtkImageMapToColors; import vtk.vtkImageReslice; import vtk.vtkInteractorStyleImage; import vtk.vtkLookupTable; import vtk.vtkNativeLibrary; import vtk.vtkPointPicker; import vtk.vtkPoints; import vtk.vtkPolyDataMapper; import vtk.vtkResliceCursorLineRepresentation; import vtk.vtkResliceCursorWidget; import vtk.vtkResliceImageViewer; import vtk.vtkWindowLevelLookupTable; @SuppressWarnings("serial") public class Mpr2DFrame extends JFrame { // label and panel String patientName, age, studyid; static String patientID; String modality; String gender; String date; String time; String studyDesc; String seriesDesc; JPanel mainPan; JSplitPane splitsPane; JPanel mprPan; private JPanel pnlAxialView; private JPanel pnlCoronalView; private JPanel pnlSagittalView; private JPanel pnlAnnotationView; private JTextArea taPageStartCor; private JTextArea taPageEnd; private JTextArea taPageStart; private JTextArea taPageEndCor; private JTextArea taPageStartSag; private JTextArea taPageEndSag; String tittle = "Multi-Plannar Reconstruction (MPR)"; vtkPoints points = new vtkPoints(); vtkCanvas vpanAxial = new vtkCanvas(); vtkCanvas vpanCoronal = new vtkCanvas(); vtkCanvas vpanSagittal = new vtkCanvas(); vtkImageReslice resliceAxial; vtkImageReslice resliceCoronal; vtkImageReslice resliceSagittal; vtkInteractorStyleImage interactorStyle = new vtkInteractorStyleImage(); //vtkInteractorStyleTrackball interactorStyle = new vtkInteractorStyleTrackball(); //vtkInteractorStyleJoystickCamera interactorStyle = new vtkInteractorStyleJoystickCamera(); vtkImageActor actorAxial; vtkImageActor actorCoronal; vtkImageActor actorSagittal; Point mouseXYAxial, mouseXYCoronal, mouseXYSagittal; private vtkDICOMImageReader reader = null; double[] dataExtent; private int WL = -20, WW = 110; private vtkLookupTable axialTable; private vtkImageMapToColors axialColor; private vtkLookupTable coronalTable; private vtkImageMapToColors coronnalColor; private vtkLookupTable saggitalTable; private vtkImageMapToColors saggitalColor; private vtkResliceCursorWidget resliceWidget_resliceImageViewerXY; private vtkResliceImageViewer resliceImageViewerXY; private vtkResliceImageViewer resliceImageViewerXZ; private vtkResliceImageViewer resliceImageViewerYZ; static String imagepath = ""; private static String path_tag_read; private static String modality_name; private static String patient_name; private static String patient_age; private static String patient_gender; private static String study_date; private static String patient_id; static { if (!vtkNativeLibrary.LoadAllNativeLibraries()) { for (vtkNativeLibrary lib : vtkNativeLibrary.values()) { if (!lib.IsLoaded()) { System.out.println(lib.GetLibraryName() + " not loaded"); } } System.out.println("Make sure the search path is correct: "); System.out.println(System.getProperty("java.library.path")); } } public static void main(String[] args) { System.out.println("Mpr2DFrame Called"); imagepath = "C:\\3D VR\\kidney\\series001\\compression\\"; //tag_reader(imagepath); System.out.println( "imagepath = "+ imagepath); EventQueue.invokeLater(new Runnable() { public void run() { Mpr2DFrame frame = new Mpr2DFrame(); frame.readDicomDir(imagepath); frame.setLocationRelativeTo(null); frame.setVisible(true); } }); } public Mpr2DFrame() { System.gc(); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setFrameSize(); initComponents(); addComponents(true); setStyles(); addListners(); System.gc(); this.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { super.windowClosing(e); System.gc(); } }); } static void tag_reader(String path) { //--------------------------- File folder = new File(path); File[] listOfFiles = folder.listFiles(); path_tag_read = listOfFiles[2].getAbsolutePath(); System.out.println(path_tag_read); //--------------------------- File f = new File(path_tag_read); DicomInputStream dcmInputStream = null; try { dcmInputStream = new DicomInputStream(f); } catch (IOException e1) { e1.printStackTrace(); } DicomObject dcmObject = null; try { dcmObject = dcmInputStream.readDicomObject(); } catch (IOException e1) { e1.printStackTrace(); } // Read DICOM TAG IN Variables modality_name = dcmObject.getString(Tag.Modality); patient_id = dcmObject.getString(Tag.PatientID); patient_name = dcmObject.getString(Tag.PatientName); patient_age = dcmObject.getString(Tag.PatientAge); patient_gender = dcmObject.getString(Tag.PatientSex); study_date = dcmObject.getString(Tag.StudyDate); study_date = convertDateTag(study_date); } public void setFrameSize() { Dimension scrnSize = Toolkit.getDefaultToolkit().getScreenSize(); Rectangle winSize = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); int taskBarHeight = scrnSize.height - winSize.height; this.setSize(Toolkit.getDefaultToolkit().getScreenSize().width - 200, (Toolkit.getDefaultToolkit().getScreenSize().height - taskBarHeight)); // set main Frame in the center Dimension dim = Toolkit.getDefaultToolkit().getScreenSize(); this.setLocation(dim.width / 2 - this.getSize().width / 2, (dim.height / 2 - this.getSize().height / 2) + 50); } public void initComponents() { getContentPane().setLayout(new BorderLayout()); axialTable = new vtkLookupTable(); saggitalTable = new vtkLookupTable(); coronalTable = new vtkLookupTable(); coronnalColor = new vtkImageMapToColors(); axialColor = new vtkImageMapToColors(); saggitalColor = new vtkImageMapToColors(); pnlAxialView = new JPanel(); pnlAxialView.setVisible(true); // second panel pnlCoronalView = new JPanel(); pnlCoronalView.setVisible(true); // third panel pnlSagittalView = new JPanel(); pnlSagittalView.setVisible(true); // forth Panel pnlAnnotationView = new JPanel(); pnlAnnotationView.setVisible(true); mainPan = new JPanel(); mainPan.setLayout(new GridLayout(1, 2, 1, 1)); mainPan.revalidate(); mainPan.setVisible(true); // this.sldWL.setOpaque(false); // main panel mprPan = new JPanel(); mprPan.setLayout(new GridLayout(2, 2, 5, 5)); splitsPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true); splitsPane.setDividerSize(1); String Space = " "; taPageStart = new JTextArea("Patient ID:" + patient_id + "\t\t\t\t\t"+Space+ "Gender :" + patient_gender, 3, 10); taPageStart.append("\nPatient Name :" + patient_name + "\t\t\t\t\tAge :" + patient_age); taPageStart.setEditable(false); taPageStart.setBackground(Color.black); taPageStart.setOpaque(false); taPageStart.setForeground(Color.white); taPageEnd = new JTextArea("Date :" + study_date, 3, 10); //taPageEnd.append("\nModality :" + modality_name + "\t\t\t\t\t\t" + "Series Desc :" + seriesDesc); taPageEnd.append("\nModality :" + modality_name); taPageEnd.setEditable(false); taPageEnd.setOpaque(false); taPageEnd.setBackground(Color.black); taPageEnd.setForeground(Color.white); pnlAxialView.setLayout(new BorderLayout()); taPageStartCor = new JTextArea("Patient ID:" + patient_id + "\t\t\t\t\t"+Space+ "Gender :" + patient_gender, 3, 10); taPageStartCor.append("\nPatient Name :" + patient_name + "\t\t\t\t\tAge :" + patient_age); taPageStartCor.setEditable(false); taPageStartCor.setBackground(Color.black); taPageStartCor.setOpaque(false); taPageStartCor.setForeground(Color.white); taPageEndCor = new JTextArea("Date :" + study_date ,3, 10); taPageEndCor.append("\nModality :" + modality_name); taPageEndCor.setEditable(false); taPageEndCor.setOpaque(false); taPageEndCor.setBackground(Color.black); taPageEndCor.setForeground(Color.white); pnlCoronalView.setLayout(new BorderLayout()); taPageStartSag = new JTextArea("Patient ID:" + patient_id + "\t\t\t\t\t"+Space+ "Gender :" + patient_gender, 3, 10); taPageStartSag.append("\nPatient Name :" + patient_name + "\t\t\t\t\tAge :" + patient_age); taPageStartSag.setEditable(false); taPageStartSag.setBackground(Color.black); taPageStartSag.setOpaque(false); taPageStartSag.setForeground(Color.white); taPageEndSag = new JTextArea("Date :" + study_date, 3, 10); taPageEndSag.append("\nModality :" + modality_name); taPageEndSag.setEditable(false); taPageEndSag.setOpaque(false); taPageEndSag.setBackground(Color.black); taPageEndSag.setForeground(Color.white); pnlSagittalView.setLayout(new BorderLayout()); } public void setStyles() { pnlAxialView.setBackground(Color.BLACK); pnlAxialView.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(Color.WHITE, 2), "Axial View", TitledBorder.RIGHT, TitledBorder.TOP, new Font("calibri", Font.BOLD, 14), Color.white)); pnlCoronalView.setBackground(Color.BLACK); pnlCoronalView.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(Color.WHITE, 2), "Coronal View", TitledBorder.RIGHT, TitledBorder.TOP, new Font("calibri", Font.BOLD, 14), Color.white)); pnlSagittalView.setBackground(Color.BLACK); pnlSagittalView.setBorder( BorderFactory.createTitledBorder(BorderFactory.createLineBorder(Color.WHITE, 2), "Sagittal View", TitledBorder.RIGHT, TitledBorder.TOP, new Font("calibri", Font.BOLD, 14), Color.white)); pnlAnnotationView.setBackground(Color.black); mprPan.setBackground(Color.black); this.setTitle(tittle); System.gc(); } public void addComponents(boolean flag) { try { if (flag == true) { pnlSagittalView.add(taPageStartSag, BorderLayout.PAGE_START); pnlSagittalView.add(taPageEndSag, BorderLayout.PAGE_END); pnlCoronalView.add(taPageStartCor, BorderLayout.PAGE_START); pnlCoronalView.add(taPageEndCor, BorderLayout.PAGE_END); pnlAxialView.add(taPageStart, BorderLayout.PAGE_START); pnlAxialView.add(taPageEnd, BorderLayout.PAGE_END); } else { pnlSagittalView.remove(taPageStartSag); pnlSagittalView.remove(taPageEndSag); pnlCoronalView.remove(taPageStartCor); pnlCoronalView.remove(taPageEndCor); pnlAxialView.remove(taPageStart); pnlAxialView.remove(taPageEnd); } mprPan.add(pnlCoronalView); mprPan.add(pnlSagittalView); splitsPane.add(pnlAxialView); mainPan.add(splitsPane); mainPan.add(mprPan); this.setLocationRelativeTo(null); this.setExtendedState(java.awt.Frame.MAXIMIZED_BOTH); getContentPane().add(mainPan, BorderLayout.CENTER); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); this.revalidate(); this.setVisible(true); this.setAlwaysOnTop(true); System.gc(); vpanAxial.GetRenderer().SetBackground(0.0, 0.0, 0.0); //vpanAxial.setSize((pnlAxialView.getWidth() - 30), (pnlAxialView.getHeight() - 40)); vpanAxial.setSize((pnlAxialView.getWidth()), (pnlAxialView.getHeight())); pnlAxialView.add(vpanAxial); System.out.println("pnlAxialView.add(vpanAxial); added "); // change vtk background color vpanCoronal.GetRenderer().SetBackground(0.0, 0.0, 0.0); // set size of image from here in vtk panel..manually //vpanCoronal.setSize((pnlCoronalView.getWidth() + 60), (pnlCoronalView.getHeight() + 50)); vpanCoronal.setSize((pnlCoronalView.getWidth()), (pnlCoronalView.getHeight())); pnlCoronalView.add(vpanCoronal); vpanSagittal.GetRenderer().SetBackground(0.0, 0.0, 0.0); //vpanSagittal.setSize((pnlSagittalView.getWidth() + 60), (pnlSagittalView.getHeight() + 50)); vpanSagittal.setSize((pnlSagittalView.getWidth()), (pnlSagittalView.getHeight())); pnlSagittalView.add(vpanSagittal); System.gc(); } catch (Exception ex) { ex.printStackTrace(); } } public void readDicomDir(String path) { String path1 = "C:\\3D VR\\kidney\\series001\\compression\\"; reader = new vtkDICOMImageReader(); reader.SetDirectoryName(path1); reader.SetDataScalarTypeToUnsignedShort(); reader.UpdateWholeExtent(); reader.Update(); vtkWindowLevelLookupTable win_table = new vtkWindowLevelLookupTable(); win_table.SetLevel(110); win_table.SetWindow(1300); win_table.SetRampToLinear(); win_table.Build(); // ---------------------------- XY vtkResliceImageViewer resliceImageViewerXY = new vtkResliceImageViewer(); resliceImageViewerXY.SetInputData(reader.GetOutput()); //resliceImageViewerXY.SetSize(512, 512); resliceImageViewerXY.SetupInteractor(vpanAxial.GetRenderWindow().GetInteractor()); resliceImageViewerXY.SliceScrollOnMouseWheelOff(); resliceImageViewerXY.SetRenderWindow(vpanAxial.GetRenderWindow()); resliceImageViewerXY.SetRenderer(vpanAxial.GetRenderer()); // -------------------------- Reslice cursor XY ------------------------------ resliceWidget_resliceImageViewerXY = resliceImageViewerXY.GetResliceCursorWidget(); vtkResliceCursorLineRepresentation rep = (vtkResliceCursorLineRepresentation) resliceWidget_resliceImageViewerXY.GetRepresentation(); rep.NeedToRenderOn(); resliceImageViewerXY.SetResliceCursor(rep.GetResliceCursor()); rep.GetResliceCursorActor().GetCursorAlgorithm().SetReslicePlaneNormal(2); resliceWidget_resliceImageViewerXY.ManagesCursorOn(); resliceWidget_resliceImageViewerXY.SetEnabled(1); resliceImageViewerXY.AddObserver("LeftButtonPressEvent", this, "myCallback"); vpanAxial.GetRenderer().ResetCamera(); interactorStyle.AddObserver("LeftButtonPressEvent",this,"myCallback"); // Callback not working // ---------------------------- XZ vtkResliceImageViewer resliceImageViewerXZ = new vtkResliceImageViewer(); resliceImageViewerXZ.SetInputData(reader.GetOutput()); resliceImageViewerXZ.SetSliceOrientationToXZ(); resliceImageViewerXZ.SetupInteractor(vpanCoronal.GetRenderWindow().GetInteractor()); resliceImageViewerXZ.SliceScrollOnMouseWheelOff(); resliceImageViewerXZ.SetRenderWindow(vpanCoronal.GetRenderWindow()); resliceImageViewerXZ.SetRenderer(vpanCoronal.GetRenderer()); resliceImageViewerXZ.SetColorWindow(2700.0); // -------------------------- Reslice cursor ------------------------------ vtkResliceCursorWidget resliceWidget_resliceImageViewerXZ = resliceImageViewerXZ.GetResliceCursorWidget(); vtkResliceCursorLineRepresentation rep1 = (vtkResliceCursorLineRepresentation)resliceWidget_resliceImageViewerXZ.GetRepresentation(); resliceImageViewerXZ.SetResliceCursor(rep1.GetResliceCursor()); rep1.GetResliceCursorActor().GetCursorAlgorithm().SetReslicePlaneNormal(1); resliceWidget_resliceImageViewerXZ.ManagesCursorOn(); resliceWidget_resliceImageViewerXZ.SetEnabled(1); vpanCoronal.GetRenderer().ResetCamera(); interactorStyle.AddObserver("LeftButtonPressEvent",this,"myCallback"); // Callback not working // ---------------------------- YZ vtkResliceImageViewer resliceImageViewerYZ = new vtkResliceImageViewer(); resliceImageViewerYZ.SetInputData(reader.GetOutput()); resliceImageViewerYZ.SetSliceOrientationToYZ(); resliceImageViewerYZ.SetupInteractor(vpanSagittal.GetRenderWindow().GetInteractor()); resliceImageViewerYZ.SetResliceMode(3); resliceImageViewerYZ.SetSize(512, 512); resliceImageViewerYZ.SliceScrollOnMouseWheelOff(); resliceImageViewerYZ.SetRenderWindow(vpanSagittal.GetRenderWindow()); resliceImageViewerYZ.SetRenderer(vpanSagittal.GetRenderer()); // -------------------------- Reslice cursor YZ ------------------------------ vtkResliceCursorWidget resliceWidget_resliceImageViewerYZ = resliceImageViewerYZ.GetResliceCursorWidget(); vtkResliceCursorLineRepresentation rep11 = (vtkResliceCursorLineRepresentation)resliceWidget_resliceImageViewerYZ.GetRepresentation(); resliceImageViewerYZ.SetResliceCursor(rep11.GetResliceCursor()); rep11.GetResliceCursorActor().GetCursorAlgorithm().SetReslicePlaneNormal(0); resliceWidget_resliceImageViewerYZ.ManagesCursorOn(); resliceWidget_resliceImageViewerYZ.SetEnabled(1); vpanSagittal.GetRenderer().ResetCamera(); interactorStyle.AddObserver("LeftButtonPressEvent",this,"myCallback"); // Callback not working } void lookUpTableAxial() { axialTable.SetRange(WL, WW); axialTable.SetValueRange(0.0, 1.0); axialTable.SetSaturationRange(0.0, 0.0); axialTable.SetRampToLinear(); axialTable.Build(); axialColor.SetLookupTable(axialTable); axialColor.SetInputConnection(this.resliceAxial.GetOutputPort()); this.actorAxial = new vtkImageActor(); this.actorAxial.SetInputData(axialColor.GetOutput()); } void lookUpTableCoronal() { coronalTable.SetRange(WL, WW); coronalTable.SetValueRange(0.0, 1.0); coronalTable.SetSaturationRange(0.0, 0.0); coronalTable.SetRampToLinear(); coronalTable.Build(); coronnalColor.SetLookupTable(coronalTable); coronnalColor.SetInputConnection(this.resliceCoronal.GetOutputPort()); this.actorCoronal = new vtkImageActor(); this.actorCoronal.SetInputData(coronnalColor.GetOutput()); } void lookUpTableSaggital() { saggitalTable.SetRange(WL, WW); saggitalTable.SetValueRange(0.0, 1.0); saggitalTable.SetSaturationRange(0.0, 0.0); saggitalTable.SetRampToLinear(); saggitalTable.Build(); saggitalColor.SetLookupTable(saggitalTable); saggitalColor.SetInputConnection(this.resliceSagittal.GetOutputPort()); this.actorSagittal = new vtkImageActor(); this.actorSagittal.SetInputData(saggitalColor.GetOutput()); } @Override protected void finalize() throws Throwable { vpanAxial = null; vpanCoronal = null; vpanSagittal = null; reader = null; actorSagittal = null; actorCoronal = null; actorAxial = null; interactorStyle = null; resliceAxial = null; resliceCoronal = null; resliceSagittal = null; pnlAxialView = null; pnlCoronalView = null; pnlSagittalView = null; splitsPane = null; } public static String convertDateTag(String date) { String year = date.substring(0, 4); String month = date.substring(4, 6); String day = date.substring(6, 8); switch(month) { case "01": month = "Jan"; break; case "02": month = "Feb"; break; case "03": month = "Mar"; break; case "04": month = "Apr"; break; case "05": month = "May"; break; case "06": month = "Jun"; break; case "07": month = "Jul"; break; case "08": month = "Aug"; break; case "09": month = "Sep"; break; case "10": month = "Oct"; break; case "11": month = "Nov"; break; case "12": month = "Dec"; break; } return month + " " + day + ", " + year; } public void myCallback() { // Not Calling from Observer and Don't know what to right to synchronize three views System.out.println("I am Called"); } public void addListners(){ vpanSagittal.addMouseListener(new MouseListener() { @Override public void mouseReleased(MouseEvent e) { // TODO Auto-generated method stub } @Override public void mousePressed(MouseEvent e) { // TODO Auto-generated method stub } @Override public void mouseExited(MouseEvent e) { // TODO Auto-generated method stub } @Override public void mouseEntered(MouseEvent e) { // TODO Auto-generated method stub } @Override public void mouseClicked(MouseEvent me) { // TODO Auto-generated method stub vtkPointPicker pick_xY = new vtkPointPicker(); pick_xY.Pick(me.getX(), me.getY(), 0, resliceImageViewerXY.GetRenderer()); System.out.println(me.getX() + " " + me.getX()); boolean left = SwingUtilities.isLeftMouseButton(me); if (left == true) { mouseXYAxial = me.getPoint(); vtkPointPicker pickerAxial = new vtkPointPicker(); int pickTest = pickerAxial.Pick(mouseXYAxial.x, mouseXYAxial.y, 0.0, vpanAxial.GetRenderer()); if (pickTest != 0) { // -------------------- cross hairs // ---------------------------------- double[] picked_point = pick_xY.GetMapperPosition(); double[][] f_point = { picked_point }; System.out.println( "f_point[] = " + f_point[0][0] + ",,," + f_point[0][1] + ",,," + f_point[0][2]); vtkCursor2D cursor = new vtkCursor2D(); // cursor.SetModelBounds(-512, 512, -512, 512, 0, 0); cursor.SetModelBounds(vpanSagittal.GetRenderer().ComputeVisiblePropBounds()); System.out.println("vpanAxial.getMousePosition() =" + vpanSagittal.getMousePosition()); cursor.SetFocalPoint(f_point[0][0], f_point[0][1], f_point[0][2]); cursor.SetWrap(10); vtkPolyDataMapper cursorMapper = new vtkPolyDataMapper(); cursorMapper.SetInputConnection(cursor.GetOutputPort()); vpanSagittal.Render(); // --------------------------------- cross hairs // --------------------- } // removeListeners(); } } }); } } -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From marcin.krotkiewski at gmail.com Wed Nov 8 06:09:13 2017 From: marcin.krotkiewski at gmail.com (marcin.krotkiewski) Date: Wed, 8 Nov 2017 12:09:13 +0100 Subject: [vtkusers] Rendering artifact at opacity<1 Message-ID: Dear developers, I am observing strange rendering artifacts on my triangulated surface when I use transparency. The artifacts are observed at certain angles only. I've attached 3 pictures: ?- opacity_1.png shows the model as it looks without transparency ?- opacity_09.png shows the model at an angle chosen such that the artifact on the surface is visible. ?- opacity_0.9_behind.png shows the same model with transparency rotated around to a view that does not show the artifact I am using vtk 8.0 with the OpenGL 2 rendering backend. Is this a bug, or am I doing sth wrong? Thanks! Marcin -------------- next part -------------- A non-text attachment was scrubbed... Name: opacity_1.png Type: image/png Size: 165064 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: opacity_09.png Type: image/png Size: 165709 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: opacity_09_behind.png Type: image/png Size: 227638 bytes Desc: not available URL: From ken.martin at kitware.com Wed Nov 8 08:29:43 2017 From: ken.martin at kitware.com (Ken Martin) Date: Wed, 8 Nov 2017 08:29:43 -0500 Subject: [vtkusers] Rendering artifact at opacity<1 In-Reply-To: References: Message-ID: Try using depth peeling to resolve the transparency. //@{ /** * Turn on/off rendering of translucent material with depth peeling * technique. The render window must have alpha bits (ie call * SetAlphaBitPlanes(1)) and no multisample buffer (ie call * SetMultiSamples(0) ) to support depth peeling. * If UseDepthPeeling is on and the GPU supports it, depth peeling is used * for rendering translucent materials. * If UseDepthPeeling is off, alpha blending is used. * Initial value is off. */ vtkSetMacro(UseDepthPeeling,int); vtkGetMacro(UseDepthPeeling,int); vtkBooleanMacro(UseDepthPeeling,int); //@} On Wed, Nov 8, 2017 at 6:09 AM, marcin.krotkiewski < marcin.krotkiewski at gmail.com> wrote: > Dear developers, > > I am observing strange rendering artifacts on my triangulated surface when > I use transparency. The artifacts are observed at certain angles only. I've > attached 3 pictures: > > - opacity_1.png shows the model as it looks without transparency > - opacity_09.png shows the model at an angle chosen such that the > artifact on the surface is visible. > - opacity_0.9_behind.png shows the same model with transparency rotated > around to a view that does not show the artifact > > I am using vtk 8.0 with the OpenGL 2 rendering backend. > > Is this a bug, or am I doing sth wrong? > > Thanks! > > Marcin > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -- Ken Martin PhD Distinguished Engineer Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin.krotkiewski at gmail.com Wed Nov 8 09:08:46 2017 From: marcin.krotkiewski at gmail.com (marcin.krotkiewski) Date: Wed, 8 Nov 2017 15:08:46 +0100 Subject: [vtkusers] Rendering artifact at opacity<1 In-Reply-To: References: Message-ID: <5f78a51b-e787-2157-ea2a-0bc7f1699cc4@gmail.com> Thanks a lot, Ken! This works much better. However ;) now I got very fat-looking fonts and lines (attached). Anything suggestions what I can do with that? Thanks! Marcin On 11/08/2017 02:29 PM, Ken Martin wrote: > Try using depth peeling to resolve the transparency. > > > ? //@{ > ? /** > ? ?* Turn on/off rendering of translucent material with depth peeling > ? ?* technique. The render window must have alpha bits (ie call > ? ?* SetAlphaBitPlanes(1)) and no multisample buffer (ie call > ? ?* SetMultiSamples(0) ) to support depth peeling. > ? ?* If UseDepthPeeling is on and the GPU supports it, depth peeling > is used > ? ?* for rendering translucent materials. > ? ?* If UseDepthPeeling is off, alpha blending is used. > ? ?* Initial value is off. > ? ?*/ > ? vtkSetMacro(UseDepthPeeling,int); > ? vtkGetMacro(UseDepthPeeling,int); > ? vtkBooleanMacro(UseDepthPeeling,int); > ? //@} > > > > > On Wed, Nov 8, 2017 at 6:09 AM, marcin.krotkiewski > > > wrote: > > Dear developers, > > I am observing strange rendering artifacts on my triangulated > surface when I use transparency. The artifacts are observed at > certain angles only. I've attached 3 pictures: > > ?- opacity_1.png shows the model as it looks without transparency > ?- opacity_09.png shows the model at an angle chosen such that the > artifact on the surface is visible. > ?- opacity_0.9_behind.png shows the same model with transparency > rotated around to a view that does not show the artifact > > I am using vtk 8.0 with the OpenGL 2 rendering backend. > > Is this a bug, or am I doing sth wrong? > > Thanks! > > Marcin > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: > http://markmail.org/search/?q=vtkusers > > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > > > > > -- > Ken Martin PhD > Distinguished Engineer > Kitware Inc. > 28 Corporate Drive > Clifton Park NY 12065 > > This communication, including all attachments, contains confidential > and legally privileged information, and it is intended only for the > use of the addressee.? Access to this email by anyone else is > unauthorized. If you are not the intended recipient, any disclosure, > copying, distribution or any action taken in reliance on it is > prohibited and may be unlawful. If you received this communication in > error please notify us immediately and destroy the original message. > Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: opacity_09_peeling.png Type: image/png Size: 142084 bytes Desc: not available URL: From Wiggerl at Linhuber.info Wed Nov 8 11:01:13 2017 From: Wiggerl at Linhuber.info (Willy) Date: Wed, 8 Nov 2017 09:01:13 -0700 (MST) Subject: [vtkusers] Black cross section between volume and near clipping plane? Message-ID: <1510156873693-0.post@n5.nabble.com> Hi, I am using vtk 7.1 to visualize a volume. I have two different problems, one for parallel projection and one for central and parallel projection. A solution for one of the problems would be enough. Maybe somebody can help. 1. Problem: There is a black hole where the near clipping plane (set by SetClippingRange of vtkCamera) intersects with the volume. Only appears for a few angles, not always. 2. Problem: There is no reaction if i am calling SetClippingRange. i can always see the near clipping plane even if i set it to 0.1. But only in parallel projection. Can somebody help me? thanks Ludwig -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From dave.demarle at kitware.com Wed Nov 8 13:34:35 2017 From: dave.demarle at kitware.com (David E DeMarle) Date: Wed, 8 Nov 2017 13:34:35 -0500 Subject: [vtkusers] announce: vtk 8.1.0.rc1 is ready to try Message-ID: Hi folks, VTK 8.1.0.rc1 is up on the downloads site and tagged in git. Please give it a try and report any problems that you find to us via the gitlab issue tracker with an "8.1" milestone tag. Developers, use the same tag to let us know of any fixes that you want integrated to the release branch in time for 8.1.0 final in a few weeks time. We are still gathering feedback from all 70 committers to make up the official release notes but in the meantime here is a preview of what seem to be the most notable changes. /** ------------------------------------------------------------------------------ In this release we?ve done more than the usual amount of deprecation and dead code removal. Most importantly in 8.1 we?ve deprecated both the legacy ?OpenGL1? backend and our interface to Qt4. We also removed the previously deprecated vtkInfovisParallel, vtkFiltersMatlab and vtkFiltersStatisticsGnuR modules as well as deprecated vtkInstantiator. The replacement for vtkInstantiator is to use vtkObjectFactory where applicable or an explicit list of classes. We expect that most of the newly deprecated code paths will be removed in master in preparation for the VTK 9.0 release next spring. The next big ticket item is progress on VTK-m - VTK?s burgeoning mechanism for multithreaded and GPU enabled fine grain parallel processing filters. The VTK-m project is now bundled with VTK (technically we use a git submodule for it) and we?ve made numerous performance improvements and added several new algorithms (vtkmExtractVOI, vtkmPolyDataNormals, and vtkmTriangleMeshPointNormals) to it. We?ve also started the process of transitioning the vtkSMP threaded filters (which are now deprecated) to VTK-m based implementations. In support of the VTK-m we?ve updated the minimum C++ compiler requirements to be Microsoft Visual Studio 2013 or newer, GCC 4.8.3 or newer, Clang 3.3 or newer, and Apple Clang 5.0 (from Xcode 5.0) or newer. VTK?s python interface has some nice new capabilities. First, debug builds of VTK can now better make use of the PYTHON_DEBUG_LIBRARY that cmake detects. Second, in 8.1 the numpy_support.numpy_to_vtk facility will automatically convert non-contiguous arrays to contiguous array and manage the numpy reference in memory using a private attribute called as _numpy_reference so that the programmer does not have to. Third, vtk?s python wrappers have some new capabilities that make wrapped VTK resources safer and generally more pythonc. The VTK_EXPECTS(condition) method hint that will assert a precondition in Python before a C++ method is called, causing Python exceptions to be raised for method calls that might otherwise cause undefined behavior. Two additional hints have been added for wrapping pointers: VTK_SIZEHINT(expression) tells the wrappers to treat a pointer as an array with a size given by 'expression', and VTK_ZEROCOPY tells the wrappers to use Python's buffer interface. This latter hint conveniently allows Python buffers to be used to construct zerocopy VTK data arrays. On the web front vtkWeb converted its client-server communication from using an outdated version of Autobahn WAMP to wslink - a new RPC and publish-subscribe library using websockets, in order to support upgrades to the ParaViewWeb classes and the Visualizer web application. For mobile devices we've begun work on a new mobile VTKViewer app which will replace the older KiwiViewer and use the mainline VTK library. The VTKExamples project has gained more than 111 C++ examples since VTK 8.0. Of the C++ examples added, 73 examples from the VTK Book have been added. We anticipate moving the rest of the VTK book and in source examples to the VTKExamples project over the next few releases. There is also a new SegY file format reader. This originated in Jia Chen?s Google Summer of Code 2015 project. The XML based ?.vtm? multiblock reader has a new load balancing scheme that distribute the load more evenly in some situations. XDMF3 gained an parallel write functionality and support for some of the FEnICs project?s higher order cell types. The later work came out of Michal Habera?s Google Summer this past summer. We?ve added support for arbitrary-order Lagrange-interpolated cells for the following shapes: curve, tri, quad, tet, hex, wedge. See the new vtkLagrangeXXX classes in VTK/Common/DataModel and read all about it in the next Kitware Source to learn more. There is also additional support and bug fixes for polyhedral cells, especially in combination with mapped (zero-copy) grids for in-situ processing ala Catalyst. The hypertree grid (vtkHyperTreeGrid) and its ancillary objects underwent a complete overhaul in order to reduce memory footprint and speed up execution time. The refactoring brings: a more compact hypertree representation, a hierarchy of traversal objects (cursors and supercursors) that transport the minimum amount of information required for any given algorithm, and suite of updated and new hypertree grid filters that take advantage of the above. The vtkArrayCalculator changed to be able to process data arrays from any attribute type (point, cell, field, etc) and operate on vtkGraphs and handle more than 256 arrays. The API for specifying which data association algorithms use changed as a part of this. We?ve made improvements to Dual Depth Peeling and FXAA anti aliased rendering and enabled them with several previously excluded OpenGL implementations. We?ve also fixed a variety of volume rendering bugs and added a means to supply custom GLSL shader codes for volume rendering. In related news the OSPRay rendering path can now directly volume render unstructured grid and vtkOverlappingAMR data sets. Continuing in the area of ray traced rendering VTK has a brand new interface to ray cast surface rendering in the vtkRenderingOptiX module which utilizes the GPU for tracing rays. Meanwhile VTK?s OSPRay based rendering option is also now capable of full path tracing of surface geometry. This is a big jump over the earlier ray casting like capability and includes support for soft shadowing area lights and arbitrary surface materials with generally bring about global illumination and photorealistic rendering capability. ------------------------------------------------------------------------------*/ enjoy! David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 -------------- next part -------------- An HTML attachment was scrubbed... URL: From aashish.chaudhary at kitware.com Wed Nov 8 13:45:58 2017 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Wed, 08 Nov 2017 18:45:58 +0000 Subject: [vtkusers] Black cross section between volume and near clipping plane? In-Reply-To: <1510156873693-0.post@n5.nabble.com> References: <1510156873693-0.post@n5.nabble.com> Message-ID: We may have fixed this problem in latest VTK. Can you try VTK from master or just announced 8.1 pre-release? thanks, On Wed, Nov 8, 2017 at 11:01 AM Willy wrote: > Hi, > > I am using vtk 7.1 to visualize a volume. I have two different problems, > one > for parallel projection and one for central and parallel projection. A > solution for one of the problems would be enough. Maybe somebody can help. > > 1. Problem: > There is a black hole where the near clipping plane (set by > SetClippingRange > of vtkCamera) intersects with the volume. Only appears for a few angles, > not > always. > > 2. Problem: > There is no reaction if i am calling SetClippingRange. i can always see the > near clipping plane even if i set it to 0.1. But only in parallel > projection. > > Can somebody help me? > > thanks > Ludwig > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sur.chiranjib at gmail.com Wed Nov 8 14:03:57 2017 From: sur.chiranjib at gmail.com (Chiranjib Sur) Date: Thu, 9 Nov 2017 00:33:57 +0530 Subject: [vtkusers] =?utf-8?q?=E2=80=8B_Rotate_the_vector_along_the_X=2C_Y?= =?utf-8?b?LCBaIGF4ZXMu?= In-Reply-To: <1510079819282-0.post@n5.nabble.com> References: <1510079819282-0.post@n5.nabble.com> Message-ID: You can combine the rotation+translation operation to achieve the desired results. As an alternative you can define a 3x3 rotation matrix to handle these issues. Some references here : http://planning.cs.uiuc.edu/node102.html and this one contains much more details ( http://web.cs.iastate.edu/~cs577/handouts/rotation.pdf). Once you choose your reference frame right, you will be implemented things the way you want to :) Hope that helps Thanks and regards, Chiranjib On Wed, Nov 8, 2017 at 12:06 AM, Met at ll wrote: > Andrew Maclean-3, thanks for the help. > But I still do not understand how to get right rotation ... > The fact is that after you rotate along one axis, the other axes also shift > and a wrong turn occurs. > Below is an example from Wikipedia, in VTK also? > > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Wed Nov 8 16:42:29 2017 From: dave.demarle at kitware.com (David E DeMarle) Date: Wed, 8 Nov 2017 16:42:29 -0500 Subject: [vtkusers] Opacity problems with vtkOSPRayPass In-Reply-To: References: Message-ID: I have a feeling that what is missing is that the vtk2OSPRay interface doesn't respect the OpacityUnitDistance. Are the images close if you don't change that? If not, can you share images and/or data to reproduce with me so I can take a look? thanks David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Mon, Nov 6, 2017 at 9:44 AM, Martina Litterio wrote: > Hi all! > > I have a problem using vtkOSPRayPass. I'm reading a DICOM series with > vtkDICOMImageReader. > > My code is : > > ..bla bla bla > > vtkNew volumeMapper; > > volumeMapper->SetAutoAdjustSampleDistances(0); > > volumeMapper->SetSampleDistance(0.5); > > > > vtkDICOMImageReader* reader = vtkDICOMImageReader::New(); > > reader->SetDirectoryName("Path/to/my/DICOM"); > > reader->Update(); > > volumeMapper->SetInputConnection(reader->GetOutputPort()); > > > > volumeMapper->AddObserver(vtkCommand::ErrorEvent, errorObserver); > > vtkNew pwf; > > pwf->AddPoint(-3024, 0.0); > > pwf->AddPoint(-16, 0.0); > > pwf->AddPoint(641, 0.05); > > pwf->AddPoint(3071, 0.1); > > > > ctf->AddRGBPoint( -3024, 0, 0, 0, 0.5, 0.0 ); > > ctf->AddRGBPoint( -16, 0.73, 0.25, 0.30, 0.49, .61 ); > > ctf->AddRGBPoint( 641, .90, .82, .56, .5, 0.0 ); > > ctf->AddRGBPoint( 3071, 1, 1, 1, .5, 0.0 ); > > > > volumeProperty->SetColor(ctf); > > volumeProperty->SetScalarOpacity(pwf); > > volumeProperty->SetShade(0); > > volumeProperty->SetScalarOpacityUnitDistance(1.732); > > > > vtkNew volume; > > volume->SetMapper(volumeMapper); > > volume->SetProperty(volumeProperty); > > > > // Create the renderwindow, interactor and renderer > > vtkNew renderWindow; > > renderWindow->SetMultiSamples(0); > > renderWindow->SetSize(401, 399); // NPOT size > > > > vtkNew renderer; > > renderer->SetBackground(0.3, 0.3, 0.4); > > renderWindow->AddRenderer(renderer); > > > > renderer->AddVolume(volume); > > renderer->ResetCamera(); > > renderWindow->Render(); > > > > // Attach OSPRay render pass > > vtkNew osprayPass; > > if (useOSP) > > { > > renderer->SetPass(osprayPass); > > } > > vtkNew iren; > > iren->SetRenderWindow(renderWindow); > > vtkNew style; > > iren->SetInteractorStyle(style); > > iren->Start(); > > ... bla bla bla > > > Now, the problem is the following. If "useOSP"==FALSE, I have a certain > opacity (the which one I would like to have in my results); if > "useOSP"==TRUE, I have a different opacity and I'm not able to manage it as > I want. > > Can you please tell me what's wrong in my code? > > > ?Thanks to everyone!? > > > *Martina Li**tterio* > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From csumushu at 126.com Wed Nov 8 19:42:52 2017 From: csumushu at 126.com (csumushu) Date: Wed, 8 Nov 2017 17:42:52 -0700 (MST) Subject: [vtkusers] Distance between points In-Reply-To: References: Message-ID: <1510188172539-0.post@n5.nabble.com> Have you solved it now? I have the same problem,for data of type double, it does not work.The following code is from https://lorensen.github.io/VTKExamples/site/CSharp/SimpleOperations/DistanceBetweenPoints/ using System; using System.Runtime.InteropServices; using System.Diagnostics; using Kitware.VTK; void DistanceBetweenPoints() { // Create two points. double[] p0 = new double[] { 0.0, 0.0, 0.0 }; double[] p1 = new double[] { 1.0, 1.0, 1.0 }; IntPtr pP0 = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(double)) * 3); IntPtr pP1 = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(double)) * 3); Marshal.Copy(p0, 0, pP0, 3); Marshal.Copy(p1, 0, pP1, 3); // Find the squared distance between the points. double squaredDistance = vtkMath.Distance2BetweenPoints(pP0, pP1); // Take the square root to get the Euclidean distance between the points. double distance = Math.Sqrt(squaredDistance); // Output the results. Console.WriteLine("SquaredDistance = " + squaredDistance); Console.WriteLine("Distance = " + distance); Marshal.FreeHGlobal(pP0); Marshal.FreeHGlobal(pP1); } -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From csumushu at 126.com Wed Nov 8 20:22:49 2017 From: csumushu at 126.com (csumushu) Date: Wed, 8 Nov 2017 18:22:49 -0700 (MST) Subject: [vtkusers] How to use vtkMath functions in ActiViz.NET for data of type double? Message-ID: <1510190569720-0.post@n5.nabble.com> Hello, guys and ladies Is there anybody using ActiViz.NET? I am confused about using vtkMath functions in ActiViz.NET. Take Distance2BetweenPoints as an example, with double type data can not get the correct result,but it is OK to use float type. The following code is from http://lorensen.github.io/VTKExamples/site/CSharp/SimpleOperations/DistanceBetweenPoints/ using System; using System.Runtime.InteropServices; using System.Diagnostics; using Kitware.VTK; void DistanceBetweenPoints() { // Create two points. double[] p0 = new double[] { 0.0, 0.0, 0.0 }; double[] p1 = new double[] { 1.0, 1.0, 1.0 }; IntPtr pP0 = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(double)) * 3); IntPtr pP1 = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(double)) * 3); Marshal.Copy(p0, 0, pP0, 3); Marshal.Copy(p1, 0, pP1, 3); // Find the squared distance between the points. double squaredDistance = vtkMath.Distance2BetweenPoints(pP0, pP1); // Take the square root to get the Euclidean distance between the points. double distance = Math.Sqrt(squaredDistance); // Output the results. Console.WriteLine("SquaredDistance = " + squaredDistance); Console.WriteLine("Distance = " + distance); Marshal.FreeHGlobal(pP0); Marshal.FreeHGlobal(pP1); } The result is SquaredDistance = 3.515625, Distance = 1.875 with double type, and SquaredDistance = 3, Distance = 1.73205080756888 for float. Can anyone tell me where the problem is? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From mark at cascadeacoustic.com Wed Nov 8 23:04:47 2017 From: mark at cascadeacoustic.com (Mark DeArman) Date: Wed, 8 Nov 2017 22:04:47 -0600 Subject: [vtkusers] SPAM-LOW: How to use vtkMath functions in ActiViz.NET for data of type double? In-Reply-To: <1510190569720-0.post@n5.nabble.com> References: <1510190569720-0.post@n5.nabble.com> Message-ID: <224e6d85244840a68eb44a31069e6864@cascadeacoustic.com> I looked into it, it appears no ActiViz wrapper was generated for the double overload. Most likely other functions which are overloaded for both float and double will have the same issue. I would highly recommend building sections of code which are going to require significant passing of data between managed and unmanaged memory as a C++ DLL and use pinvoke to call the function on the pinned arrays. Mark DeArman Cascade Acoustic Research http://www.cascadeacoustic.com (253) 200-5353 ---------------------------------------- From: "csumushu" Sent: Wednesday, November 8, 2017 5:23 PM To: vtkusers at vtk.org Subject: SPAM-LOW: [vtkusers] How to use vtkMath functions in ActiViz.NET for data of type double? Hello, guys and ladies Is there anybody using ActiViz.NET? I am confused about using vtkMath functions in ActiViz.NET. Take Distance2BetweenPoints as an example, with double type data can not get the correct result,but it is OK to use float type. The following code is from http://lorensen.github.io/VTKExamples/site/CSharp/SimpleOperations/DistanceB etweenPoints/ using System; using System.Runtime.InteropServices; using System.Diagnostics; using Kitware.VTK; void DistanceBetweenPoints() { // Create two points. double[] p0 = new double[] { 0.0, 0.0, 0.0 }; double[] p1 = new double[] { 1.0, 1.0, 1.0 }; IntPtr pP0 = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(double)) * 3); IntPtr pP1 = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(double)) * 3); Marshal.Copy(p0, 0, pP0, 3); Marshal.Copy(p1, 0, pP1, 3); // Find the squared distance between the points. double squaredDistance = vtkMath.Distance2BetweenPoints(pP0, pP1); // Take the square root to get the Euclidean distance between the points. double distance = Math.Sqrt(squaredDistance); // Output the results. Console.WriteLine("SquaredDistance = " + squaredDistance); Console.WriteLine("Distance = " + distance); Marshal.FreeHGlobal(pP0); Marshal.FreeHGlobal(pP1); } The result is SquaredDistance = 3.515625, Distance = 1.875 with double type, and SquaredDistance = 3, Distance = 1.73205080756888 for float. Can anyone tell me where the problem is? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From aralol2015 at gmail.com Thu Nov 9 01:29:11 2017 From: aralol2015 at gmail.com (Duster U) Date: Thu, 9 Nov 2017 11:59:11 +0530 Subject: [vtkusers] LegendActor Axis Message-ID: Hello, Thanks for the tips it helped me.I would like to know if the length of axes of the legendactor can be modified.I used the corneroffsetfactor value to change it.Can it be changed using any other means. Thanks in Advance -------------- next part -------------- An HTML attachment was scrubbed... URL: From aralol2015 at gmail.com Thu Nov 9 01:37:39 2017 From: aralol2015 at gmail.com (Aravinth) Date: Wed, 8 Nov 2017 23:37:39 -0700 (MST) Subject: [vtkusers] vtk zoom indicator In-Reply-To: References: Message-ID: <1510209459132-0.post@n5.nabble.com> Hello, Thanks for the tips it helped me.I would like to know if the length of axes of the legendactor can be modified.I used the corneroffsetfactor value to change it.Can it be changed using any other means. Thanks in Advance Sankhesh Jhaveri-2 wrote > There?s no direct API but you can calculate it. All you have to do is > compute the length of the axis in world coordinates. > > Something like this: > > double * leftPoint = > axis->GetPositionCoordinate()->GetComputedWorldValue(renderer);double > * rightPoint = > axis->GetPosition2Coordinate()->GetComputedWorldValue(renderer);double > distance = vtkMath::sqrt(vtkMath::Distance2BetweenPoints(leftPoint, > rightPoint));// Scale is 1 : distance > > Hope that helps. > > Best, > Sankhesh > ? > > On Tue, Nov 7, 2017 at 4:30 AM K O ranjith < > kor1581@ > > wrote: > >> Hello, >> Thanks, it's working. >> Can I get the measured value (which is displayed as label axis) from >> vtkLegendScaleActor object. >> >> Ranjith KO >> >> On Fri, Jun 23, 2017 at 7:52 PM, Sankhesh Jhaveri < >> > sankhesh.jhaveri@ >> wrote: >> >>> Take a look at vtkLegendScaleActor >>> <http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/LegendScaleActor>. >>> It uses vtkAxisActor >>> <http://www.vtk.org/doc/nightly/html/classvtkAxisActor.html> >>> internally. >>> >>> Hth, >>> Sankhesh >>> ? >>> >>> On Fri, Jun 23, 2017 at 1:55 AM K O ranjith < > kor1581@ > > wrote: >>> >>>> I'm using vtk for developing a MRI DICOM Image viewer in Qt. >>>> The viewer uses vtkDICOMImageReader, vtkImageViewer2 & QVTKWidget. >>>> I need to show a zoom indicator line which varies length with zoom >>>> value and need not affect other operation like rotate, pan( which is >>>> used >>>> for DICOM image in same window). It's position should be fixed at side >>>> of >>>> viewer and should not alter with zoom, pan, rotate. >>>> I added an line as an vtkactor to the renderer using vtkLineSource. >>>> Its length altering with zoom as I intended, but problem is its >>>> position also altering with the zoom, also rotate and Pan affecting on >>>> it. >>>> How can I make the position of the line fixed at side of the viewer. >>>> Have any option in vtk for visual indication of zoom factor something >>>> like vtkOrientationMarkerWidget for orientation... >>>> >>>> >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ at: >>>> http://www.vtk.org/Wiki/VTK_FAQ >>>> >>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://public.kitware.com/mailman/listinfo/vtkusers >>>> >>> -- >>> Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware >>> <http://www.kitware.com/> | (518) 881-4417 >>> ? >>> >> >> -- > Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware > <http://www.kitware.com/> | (518) 881-4417 > ? > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From Wiggerl at Linhuber.info Thu Nov 9 02:35:47 2017 From: Wiggerl at Linhuber.info (Willy) Date: Thu, 9 Nov 2017 00:35:47 -0700 (MST) Subject: [vtkusers] Black cross section between volume and near clipping plane? In-Reply-To: References: <1510156873693-0.post@n5.nabble.com> Message-ID: <1510212947261-0.post@n5.nabble.com> Unfortunately i am working with Visual Studio 2010. It does not support vtk 8.x. Can you name the date of the fix? Maybe i can transfer the changes to my vtk version and rebuild it. Or is there some kind of workaround? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From csumushu at 126.com Thu Nov 9 08:44:47 2017 From: csumushu at 126.com (csumushu) Date: Thu, 9 Nov 2017 06:44:47 -0700 (MST) Subject: [vtkusers] SPAM-LOW: How to use vtkMath functions in ActiViz.NET for data of type double? In-Reply-To: <224e6d85244840a68eb44a31069e6864@cascadeacoustic.com> References: <1510190569720-0.post@n5.nabble.com> <224e6d85244840a68eb44a31069e6864@cascadeacoustic.com> Message-ID: <1510235087981-0.post@n5.nabble.com> Oh wow, nice to see you again, a few days ago I had questions to ask your advice on Github. How about using C++ CLR instead of PInvoke? For some classes, such as vtkTransform, I want to call the entire class, not some member functions. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From petersenkolja at gmail.com Thu Nov 9 13:25:45 2017 From: petersenkolja at gmail.com (Kolja Petersen) Date: Thu, 9 Nov 2017 19:25:45 +0100 Subject: [vtkusers] vtkJPEGReader can read from memory, vtkPNGReader not. why? Message-ID: Heya, I was searching for a solution to read PNG data, when I have their bytes in memory, not on disk. You can use vtkJPEGReader::SetMemoryBuffer(addr) for JPEG data. I have tested this successfully. In https://github.com/Kitware/VTK/blob/master/IO/Image/vtkJPEGReader.cxx, starting from line 91, is the code for reading from memory. Why is there no equivalent for vtkPNGReader? Even if I set the MemoryBuffer for vtkPNGWriter, it tries to read from file and fails if the file doesn't exist. Thank you Kolja Virenfrei. www.avast.com <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark at cascadeacoustic.com Thu Nov 9 17:02:51 2017 From: mark at cascadeacoustic.com (Mark DeArman) Date: Thu, 9 Nov 2017 16:02:51 -0600 Subject: [vtkusers] How to use vtkMath functions in ActiViz.NET for data of type double? Message-ID: Yes, I saw you closed your issue, but I was going to suggest we move the discussion over hear beforehand. It's probably not not something I will get around to fixing, but I was interested in tracking down the cause of the behavior you were seeing. Moving your project into CLR C++ might simplify the work syntactically, but your still going to require the same careful attention. I find it is quite easy to write mixed C#/C++ as long as you follow a rigid pattern for how you operate on your data, where you do your allocations, and how you write your C++ signatures. ///------------------------------------------------------------------------- --- Your Code ///------------------------------------------------------------------------- --- // Create two points. float[] pt0 = new float[3] { 0.0F, 0.0F, 0.0F }; float[] pt1 = new float[3] { 1.0F, 1.0F, 1.0F }; fixed(float* pt0_p = pt0, pt1_p = pt1) { // Find the squared distance between the points. squaredDistance = vtkMath.Distance2BetweenPoints(new IntPtr(pt0_p), new IntPtr(pt1_p)); } double distance = Math.Sqrt(squaredDistance); ///------------------------------------------------------------------------- --- The ActiViz generated pinvoke signature ///------------------------------------------------------------------------- --- [DllImport(vtkCommonCoreEL_dll, CallingConvention = CallingConvention.Cdecl, EntryPoint = "vtkMath_Distance2BetweenPoints_21")] internal static extern float vtkMath_Distance2BetweenPoints_21(IntPtr p1, IntPtr p2); ///------------------------------------------------------------------------- --- The ActiViz generated wrapper function ///------------------------------------------------------------------------- --- public static float Distance2BetweenPoints(IntPtr p1, IntPtr p2) { float rv = vtkMath_Distance2BetweenPoints_21(p1, p2); return rv; } I don't know if it is an option for your project, but as I said previously, I normally use the unsafe flag, so that I can do allocation in C#, pin those arrays, then pass pointers into C functions to be operated on. Unlike the Activiz autogenerated signature above, by not using IntPtr, and using strongly type pointers, its is much easier to keep track of what is going on. ///------------------------------------------------------------------------- --- Sample signature ///------------------------------------------------------------------------- --- [DllImport(myDSP_dll, CallingConvention = CallingConvention.Cdecl, EntryPoint = "myDSP_doSomething")] internal static extern int myDSP_doSomething(double* input, double* output); ///------------------------------------------------------------------------- --- Sample C# Code ///------------------------------------------------------------------------- --- double[] x = new double[3] { 0.0, 0.0, 0.0 }; double[] y = new double[3]; fixed(double* px = x, py = y) { if(!myDSP_doSomething(px,py)) throw new MyException() } With attention to house keeping inside of your C++ DllMain, it is rather easy to keep allocations split up between managed and unmanaged, and stay out of trouble generating memory leaks. So I will end up with only code having to do with the GUI, user interaction, in the C# side, and all of the data processing happening in C++. Mark DeArman Cascade Acoustic Research http://www.cascadeacoustic.com (253) 200-5353 ---------------------------------------- From: "csumushu" Sent: Thursday, November 9, 2017 5:45 AM To: vtkusers at vtk.org Subject: Re: [vtkusers] SPAM-LOW: How to use vtkMath functions in ActiViz.NET for data of type double? Oh wow, nice to see you again, a few days ago I had questions to ask your advice on Github. How about using C++ CLR instead of PInvoke? For some classes, such as vtkTransform, I want to call the entire class, not some member functions. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From bookandpay at yahoo.com Thu Nov 9 17:41:37 2017 From: bookandpay at yahoo.com (Todd Martin) Date: Thu, 9 Nov 2017 22:41:37 +0000 (UTC) Subject: [vtkusers] Hidden static method vtkGenericEnSightReader::CanReadFile() References: <437436203.6647060.1510267297333.ref@mail.yahoo.com> Message-ID: <437436203.6647060.1510267297333@mail.yahoo.com> Hi This commit has generated some discussion in recent weeks. https://gitlab.kitware.com/todoooo/vtk/commit/9b15f1354e1d7d1574f2f15e90097fd9d4b163da If you use CanReadFile() from vtkGenericEnSightReader, vtkEnSightReader or vtkEnSightMasterServerReader perhaps you can clarify how it is being used. I submitted a merge request to change the static method name to vtkGenericEnSightReader::IsEnSightFile() so that it still visible in descendant classes and then made vtkGenericEnSightReader::CanReadFile() non-static virtual. Now it is unclear whether vtkEnSightMasterServerReader should call vtkGenericEnSightReader::CanReadFile() because we simply don't know if the ability of the master server reader to read a file also depends on the file being an EnSight file. If that is the case, then the original implementation was wrong. Can anyone who uses this function please comment? Freelance Engineer/Software ArchitectB.E. (Mech) Hons, PhD. -------------- next part -------------- An HTML attachment was scrubbed... URL: From 278124177 at qq.com Fri Nov 10 01:15:19 2017 From: 278124177 at qq.com (=?gb18030?B?zui3qM7ozOw=?=) Date: Fri, 10 Nov 2017 14:15:19 +0800 Subject: [vtkusers] how to know wheter an smart pointer is null Message-ID: hi: How can i judge an smart pointer is null? -------------- next part -------------- An HTML attachment was scrubbed... URL: From chandan.yeshwanth at siemens.com Fri Nov 10 01:26:27 2017 From: chandan.yeshwanth at siemens.com (Yeshwanth, Chandan) Date: Fri, 10 Nov 2017 06:26:27 +0000 Subject: [vtkusers] Current status of hardware accelerated offscreen rendering in VTK Message-ID: Hi, I am interested in hardware accelerated offscreen rendering with VTK (without a display, without an X server). According to these previous threads, VTK doesn't support this by default - https://www.vtk.org/pipermail/vtkusers/2011-July/068944.html - https://www.vtk.org/pipermail/vtkusers/2011-March/066907.html Does anyone know if H/W accelerated offscreen rendering is currently supported (officially) in VTK? Any examples or links will be great! Thanks, Chandan -------------- next part -------------- An HTML attachment was scrubbed... URL: From woshizyc at gmail.com Fri Nov 10 03:09:31 2017 From: woshizyc at gmail.com (Yuanchao Zhang) Date: Fri, 10 Nov 2017 16:09:31 +0800 Subject: [vtkusers] Question about volume rendering Message-ID: Hi, experts, I am not quite familar with volume rendering using vtk. I want to overlay one mask image onto another volume and render them simutaneously. I know vtkGPUVolumeRayCastMapper allows to input a mask image, this class however requires OPENGL 2 which is not supported for my computer. Is there any other way to achieve this? Is there any example for this? Thanks a lot! Yuanchao -------------- next part -------------- An HTML attachment was scrubbed... URL: From aron.helser at kitware.com Fri Nov 10 09:49:43 2017 From: aron.helser at kitware.com (Aron Helser) Date: Fri, 10 Nov 2017 09:49:43 -0500 Subject: [vtkusers] how to know wheter an smart pointer is null In-Reply-To: References: Message-ID: Hi! I believe all the smart pointers have a boolean operator, so you can just do: if ( !name ) { //pointer "name" is null... } On Fri, Nov 10, 2017 at 1:15 AM, ???? <278124177 at qq.com> wrote: > hi: > How can i judge an smart pointer is null? > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From skab12 at gmail.com Fri Nov 10 12:32:27 2017 From: skab12 at gmail.com (Serge K.) Date: Fri, 10 Nov 2017 18:32:27 +0100 Subject: [vtkusers] SetClientData in python Message-ID: Hi All, I am playing with MouseEventObserver.py example and I would like to add a ClientData on my callback function. There are many examples in C++ like this one: https://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/ClientData However, I do not know how to do that in Python. Indeed, if I create a vtkCallbackCommand , SetCallBack function does not exist. Any Idea? Thanks for your answer. Serge ps: python36 - vtk 7.1.1 #!/usr/bin/env pythonfrom __future__ import print_function import vtksource = vtk.vtkSphereSource()source.SetCenter(0, 0, 0)source.SetRadius(1)source.Update() mapper = vtk.vtkPolyDataMapper()mapper.SetInputConnection(source.GetOutputPort()) actor = vtk.vtkActor()actor.SetMapper(mapper) renderer = vtk.vtkRenderer()renderer.SetBackground(1, 1, 1)renderer.AddActor(actor) renwin = vtk.vtkRenderWindow()renwin.AddRenderer(renderer) interactor = vtk.vtkRenderWindowInteractor()interactor.SetInteractorStyle(vtk.vtkInteractorStyleTrackballCamera())interactor.SetRenderWindow(renwin) def DummyFunc(obj, ev, my_obj_2): print(obj, my_obj_2) # obj_2 = vtk.whatever()# How do I pass my obj_2 ? interactor.AddObserver('LeftButtonPressEvent', DummyFunc)interactor.Initialize()interactor.Start() -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Fri Nov 10 13:17:26 2017 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 10 Nov 2017 11:17:26 -0700 Subject: [vtkusers] SetClientData in python In-Reply-To: References: Message-ID: Hi Serge, The way to do this in Python is to add attributes to your callback function. def DummyFunc(obj, ev, data): print(ev, data) DummyFunc.CallData = whatever interactor.AddObserver('LeftButtonPressEvent', DummyFunc) So the vtkCallbackCommand really isn't needed in Python (and, as you have noticed, it really can't be used in Python anyway). - David On Fri, Nov 10, 2017 at 10:32 AM, Serge K. wrote: > Hi All, > > I am playing with MouseEventObserver.py example and I would like to add a > ClientData on my callback function. There are many examples in C++ like > this one: https://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/ClientData > > However, I do not know how to do that in Python. > > Indeed, if I create a vtkCallbackCommand , SetCallBack function does not > exist. > > Any Idea? Thanks for your answer. > > Serge > > ps: python36 - vtk 7.1.1 > > > #!/usr/bin/env pythonfrom __future__ import print_function > import vtksource = vtk.vtkSphereSource()source.SetCenter(0, 0, 0)source.SetRadius(1)source.Update() > mapper = vtk.vtkPolyDataMapper()mapper.SetInputConnection(source.GetOutputPort()) > actor = vtk.vtkActor()actor.SetMapper(mapper) > renderer = vtk.vtkRenderer()renderer.SetBackground(1, 1, 1)renderer.AddActor(actor) > renwin = vtk.vtkRenderWindow()renwin.AddRenderer(renderer) > interactor = vtk.vtkRenderWindowInteractor()interactor.SetInteractorStyle(vtk.vtkInteractorStyleTrackballCamera())interactor.SetRenderWindow(renwin) > def DummyFunc(obj, ev, my_obj_2): > print(obj, my_obj_2) > > # obj_2 = vtk.whatever()# How do I pass my obj_2 ? interactor.AddObserver('LeftButtonPressEvent', DummyFunc)interactor.Initialize()interactor.Start() > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jayavardhanravi at outlook.com Fri Nov 10 15:38:30 2017 From: jayavardhanravi at outlook.com (Jay) Date: Fri, 10 Nov 2017 13:38:30 -0700 (MST) Subject: [vtkusers] VTK sever socket and vtk client socket In-Reply-To: <1509737377702-0.post@n5.nabble.com> References: <1509737377702-0.post@n5.nabble.com> Message-ID: <1510346310275-0.post@n5.nabble.com> Yes, this can be achieved using the vtkServerSocket and vtkClientSocket Pseudocode: // Server Side serverSocket.CreateServer(portNumber); clientSocket = serverSocket.WaitForConnection(timeToWaitInms); clientSocket.Send(data,length); clientSocket.CloseSocket(); //Client Side clientSocket.ConnectToServer(IpAddress, port); clientSocket.Receive(data, length, readMode); clientSocket.CloseSocket(); Regards, Jay -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From csumushu at 126.com Fri Nov 10 20:06:23 2017 From: csumushu at 126.com (csumushu) Date: Fri, 10 Nov 2017 18:06:23 -0700 (MST) Subject: [vtkusers] How to use vtkMath functions in ActiViz.NET for data of type double? In-Reply-To: References: <1510190569720-0.post@n5.nabble.com> Message-ID: <1510362383246-0.post@n5.nabble.com> Got it, you made it clear. BTW, I still don't know the way to build ActiViz 7.1. Is your method similar to this one? https://www.vtk.org/Wiki/VTK/CSharp/ActiViz/Build#Visual_Studio_2005_or_2008_.28gccxml_does_not_yet_work_with_Visual_Studio_2010.29 Do you have any relevant references? Then I tried to build ActiViz 6.3, and I found that the patched activiz.net and mummy source (uploaded by you) were delete https://onedrive.live.com/redir?resid=C21891647818579A!108957&authkey=!ADS9VLyqTef24FY&ithint=folder%2c I am a newcomer to C# and VTK, and I hope I did not ask too much.Thank you again. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From mark at cascadeacoustic.com Sat Nov 11 00:21:13 2017 From: mark at cascadeacoustic.com (Mark DeArman) Date: Fri, 10 Nov 2017 23:21:13 -0600 Subject: [vtkusers] How to use vtkMath functions in ActiViz.NET for data of type double? In-Reply-To: <1510362383246-0.post@n5.nabble.com> References: <1510190569720-0.post@n5.nabble.com> <1510362383246-0.post@n5.nabble.com> Message-ID: <705a11bc43ce459bab8c97fc057ddfbc@cascadeacoustic.com> The wiki guide was what I followed when I built version 6.3 and initially patched mummy. I just deleted the binaries from OneDrive a few days ago after I moved 7.1.1 into github. You should be able to follow the wiki guide using the repos from my github. If you use the kitware repos you will have to apply some of the patches, which you can get from my github commits. There are only a couple changes to make. I noted which ones had to do with the fact I was building with Intel C++. You can also just download my gcc-xml, mummy binaries and skip a lot of the wiki guide. You still will need VS2008 installed to build the wrappers. I built with Visual Studio 2013, Visual Studio 2008, and ICC 2016. For activiz, the relevant (depending on your build environment) variables are going to be: CMAKE_GENERATOR_TOOLSET:INTERNAL=Intel C++ Compiler 16.0 //CXX compiler. CMAKE_CXX_COMPILER:FILEPATH=C:/Program Files (x86)/IntelSWTools/compilers_and_libraries/windows/bin/ia32/icl.exe //C compiler. CMAKE_C_COMPILER:FILEPATH=C:/Program Files (x86)/IntelSWTools/compilers_and_libraries/windows/bin/ia32/icl.exe //Path to a file. MSVC_REDIST_DIR:PATH=C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/redist //The directory containing a CMake configuration file for Mummy. Mummy_DIR:PATH=J:/GitHub/dearman/mummy-build/share/mummy-1.0.3 //The directory containing a CMake configuration file for VTK. VTK_DIR:PATH=J:/GitHub/dearman/VTK-build //Path to a program. csc_EXECUTABLE:FILEPATH=C:/Windows/Microsoft.NET/Framework/v4.0.30319/csc.ex e //Path to a program. gccxml_EXECUTABLE:FILEPATH=J:/Tools/gccxml/bin/gccxml.exe gccxml_compiler:FILEPATH=C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin/cl.exe //Path to a program. mono_EXECUTABLE:FILEPATH=mono_EXECUTABLE-NOTFOUND //FILEPATH to mummy.exe mummy_EXECUTABLE:FILEPATH=J:/GitHub/dearman/mummy-build/bin/Debug/mummy. Feel free to ask if you have any other questions, I will help if I can. Mark DeArman Cascade Acoustic Research http://www.cascadeacoustic.com (253) 200-5353 ---------------------------------------- From: "csumushu" Sent: Friday, November 10, 2017 5:06 PM To: vtkusers at vtk.org Subject: Re: [vtkusers] How to use vtkMath functions in ActiViz.NET for data of type double? Got it, you made it clear. BTW, I still don't know the way to build ActiViz 7.1. Is your method similar to this one? https://www.vtk.org/Wiki/VTK/CSharp/ActiViz/Build#Visual_Studio_2005_or_2008 _.28gccxml_does_not_yet_work_with_Visual_Studio_2010.29 Do you have any relevant references? Then I tried to build ActiViz 6.3, and I found that the patched activiz.net and mummy source (uploaded by you) were delete https://onedrive.live.com/redir?resid=C21891647818579A!108957&authkey=!ADS9V LyqTef24FY&ithint=folder%2c I am a newcomer to C# and VTK, and I hope I did not ask too much.Thank you again. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.amaclean at gmail.com Sat Nov 11 16:59:00 2017 From: andrew.amaclean at gmail.com (Andrew Maclean) Date: Sun, 12 Nov 2017 08:59:00 +1100 Subject: [vtkusers] =?utf-8?q?=E2=80=8BSetClientData_in_python_=28David_Go?= =?utf-8?q?bbi=29?= Message-ID: David, When I try this I get: TypeError: DummyFunc() missing 1 required positional argument: 'data' I used a slightly different approach in https://lorensen.github.io/VTKExamples/site/Python/VisualizationAlgorithms/StreamlinesWithLineWidget/ Regards Andrew ? 2. Re: ?? SetClientData in python (David Gobbi) > > ---------- Forwarded message ---------- > From: David Gobbi > To: > ?? > "Serge K." > Cc: VTK Users > Bcc: > Date: Fri, 10 Nov 2017 11:17:26 -0700 > Subject: Re: [vtkusers] SetClientData in python > Hi Serge, > > The way to do this in Python is to add attributes to your callback > function. > > def DummyFunc(obj, ev, data): > print(ev, data) > > > ?? > DummyFunc.CallData = whatever > > interactor.AddObserver('LeftButtonPressEvent', DummyFunc) > > So the vtkCallbackCommand really isn't needed in Python (and, as you have > noticed, it really can't be used in Python anyway). > > - David > > > > On Fri, Nov 10, 2017 at 10:32 AM, Serge K. wrote: > >> Hi All, >> >> I am playing with MouseEventObserver.py example and I would like to add a >> ClientData on my callback function. There are many examples in C++ like >> this one: https://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/C >> lientData >> >> However, I do not know how to do that in Python. >> >> Indeed, if I create a vtkCallbackCommand , SetCallBack function does >> not exist. >> >> Any Idea? Thanks for your answer. >> >> Serge >> >> ps: python36 - vtk 7.1.1 >> >> >> ?? >> #!/usr/bin/env pythonfrom __future__ import print_function >> import vtksource = vtk.vtkSphereSource()source.SetCenter(0, 0, 0)source.SetRadius(1)source.Update() >> mapper = vtk.vtkPolyDataMapper()mapper.SetInputConnection(source.GetOutputPort()) >> actor = vtk.vtkActor()actor.SetMapper(mapper) >> renderer = vtk.vtkRenderer()renderer.SetBackground(1, 1, 1)renderer.AddActor(actor) >> renwin = vtk.vtkRenderWindow()renwin.AddRenderer(renderer) >> interactor = vtk.vtkRenderWindowInteractor()interactor.SetInteractorStyle(vtk.vtkInteractorStyleTrackballCamera())interactor.SetRenderWindow(renwin) >> def DummyFunc(obj, ev, my_obj_2): >> print(obj, my_obj_2) >> >> # obj_2 = vtk.whatever()# How do I pass my obj_2 ? interactor.AddObserver('LeftButtonPressEvent', DummyFunc)interactor.Initialize()interactor.Start() >> >> > > -- ___________________________________________ Andrew J. P. Maclean ___________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.amaclean at gmail.com Sat Nov 11 17:46:20 2017 From: andrew.amaclean at gmail.com (Andrew Maclean) Date: Sun, 12 Nov 2017 09:46:20 +1100 Subject: [vtkusers] =?utf-8?q?=E2=80=8BSetClientData_in_python_=28David_Go?= =?utf-8?q?bbi=29?= In-Reply-To: References: Message-ID: Ok I have got it. This works: def DummyFunc(obj, ev): print(ev, DummyFunc.data) DummyFunc.data = renwin # How do I pass my obj_2 ? interactor.AddObserver('LeftButtonPressEvent', DummyFunc) ?David, you may be able to explain this better than I can but I assume this is what happens:? Here we are adding a new attribute to DummyFunc. We can do this because Python functions are in fact objects. ?This is something totally strange to C++ programmers! What a neat approach!? On Sun, Nov 12, 2017 at 8:59 AM, Andrew Maclean wrote: > David, > > When I try this I get: > TypeError: DummyFunc() missing 1 required positional argument: 'data' > > I used a slightly different approach in https://lorensen.github.io/ > VTKExamples/site/Python/VisualizationAlgorithms/StreamlinesWithLineWidget/ > > > Regards > Andrew > > ? > 2. Re: > ?? > SetClientData in python (David Gobbi) >> >> ---------- Forwarded message ---------- >> From: David Gobbi >> To: >> ?? >> "Serge K." >> Cc: VTK Users >> Bcc: >> Date: Fri, 10 Nov 2017 11:17:26 -0700 >> Subject: Re: [vtkusers] SetClientData in python >> Hi Serge, >> >> The way to do this in Python is to add attributes to your callback >> function. >> >> def DummyFunc(obj, ev, data): >> print(ev, data) >> >> >> ?? >> DummyFunc.CallData = whatever >> >> interactor.AddObserver('LeftButtonPressEvent', DummyFunc) >> >> So the vtkCallbackCommand really isn't needed in Python (and, as you have >> noticed, it really can't be used in Python anyway). >> >> - David >> >> >> >> On Fri, Nov 10, 2017 at 10:32 AM, Serge K. wrote: >> >>> Hi All, >>> >>> I am playing with MouseEventObserver.py example and I would like to add >>> a ClientData on my callback function. There are many examples in C++ like >>> this one: https://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/C >>> lientData >>> >>> However, I do not know how to do that in Python. >>> >>> Indeed, if I create a vtkCallbackCommand , SetCallBack function does >>> not exist. >>> >>> Any Idea? Thanks for your answer. >>> >>> Serge >>> >>> ps: python36 - vtk 7.1.1 >>> >>> >>> ?? >>> #!/usr/bin/env pythonfrom __future__ import print_function >>> import vtksource = vtk.vtkSphereSource()source.SetCenter(0, 0, 0)source.SetRadius(1)source.Update() >>> mapper = vtk.vtkPolyDataMapper()mapper.SetInputConnection(source.GetOutputPort()) >>> actor = vtk.vtkActor()actor.SetMapper(mapper) >>> renderer = vtk.vtkRenderer()renderer.SetBackground(1, 1, 1)renderer.AddActor(actor) >>> renwin = vtk.vtkRenderWindow()renwin.AddRenderer(renderer) >>> interactor = vtk.vtkRenderWindowInteractor()interactor.SetInteractorStyle(vtk.vtkInteractorStyleTrackballCamera())interactor.SetRenderWindow(renwin) >>> def DummyFunc(obj, ev, my_obj_2): >>> print(obj, my_obj_2) >>> >>> # obj_2 = vtk.whatever()# How do I pass my obj_2 ? interactor.AddObserver('LeftButtonPressEvent', DummyFunc)interactor.Initialize()interactor.Start() >>> >>> >> >> > -- > ___________________________________________ > Andrew J. P. Maclean > > ___________________________________________ > -- ___________________________________________ Andrew J. P. Maclean ___________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.amaclean at gmail.com Sat Nov 11 18:07:25 2017 From: andrew.amaclean at gmail.com (Andrew Maclean) Date: Sun, 12 Nov 2017 10:07:25 +1100 Subject: [vtkusers] =?utf-8?q?=E2=80=8BSetClientData_in_python_=28David_Go?= =?utf-8?q?bbi=29?= In-Reply-To: References: Message-ID: I'll do an example for this. I'm also thinking that since we are using C++11 we should be able to use lambda expressions. I'll also do an example for that. Regards Andrew On Sun, Nov 12, 2017 at 8:59 AM, Andrew Maclean wrote: > David, > > When I try this I get: > TypeError: DummyFunc() missing 1 required positional argument: 'data' > > I used a slightly different approach in https://lorensen.github.io/ > VTKExamples/site/Python/VisualizationAlgorithms/StreamlinesWithLineWidget/ > > > Regards > Andrew > > ? > 2. Re: > ?? > SetClientData in python (David Gobbi) >> >> ---------- Forwarded message ---------- >> From: David Gobbi >> To: >> ?? >> "Serge K." >> Cc: VTK Users >> Bcc: >> Date: Fri, 10 Nov 2017 11:17:26 -0700 >> Subject: Re: [vtkusers] SetClientData in python >> Hi Serge, >> >> The way to do this in Python is to add attributes to your callback >> function. >> >> def DummyFunc(obj, ev, data): >> print(ev, data) >> >> >> ?? >> DummyFunc.CallData = whatever >> >> interactor.AddObserver('LeftButtonPressEvent', DummyFunc) >> >> So the vtkCallbackCommand really isn't needed in Python (and, as you have >> noticed, it really can't be used in Python anyway). >> >> - David >> >> >> >> On Fri, Nov 10, 2017 at 10:32 AM, Serge K. wrote: >> >>> Hi All, >>> >>> I am playing with MouseEventObserver.py example and I would like to add >>> a ClientData on my callback function. There are many examples in C++ like >>> this one: https://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/C >>> lientData >>> >>> However, I do not know how to do that in Python. >>> >>> Indeed, if I create a vtkCallbackCommand , SetCallBack function does >>> not exist. >>> >>> Any Idea? Thanks for your answer. >>> >>> Serge >>> >>> ps: python36 - vtk 7.1.1 >>> >>> >>> ?? >>> #!/usr/bin/env pythonfrom __future__ import print_function >>> import vtksource = vtk.vtkSphereSource()source.SetCenter(0, 0, 0)source.SetRadius(1)source.Update() >>> mapper = vtk.vtkPolyDataMapper()mapper.SetInputConnection(source.GetOutputPort()) >>> actor = vtk.vtkActor()actor.SetMapper(mapper) >>> renderer = vtk.vtkRenderer()renderer.SetBackground(1, 1, 1)renderer.AddActor(actor) >>> renwin = vtk.vtkRenderWindow()renwin.AddRenderer(renderer) >>> interactor = vtk.vtkRenderWindowInteractor()interactor.SetInteractorStyle(vtk.vtkInteractorStyleTrackballCamera())interactor.SetRenderWindow(renwin) >>> def DummyFunc(obj, ev, my_obj_2): >>> print(obj, my_obj_2) >>> >>> # obj_2 = vtk.whatever()# How do I pass my obj_2 ? interactor.AddObserver('LeftButtonPressEvent', DummyFunc)interactor.Initialize()interactor.Start() >>> >>> >> >> > -- > ___________________________________________ > Andrew J. P. Maclean > > ___________________________________________ > -- ___________________________________________ Andrew J. P. Maclean ___________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Sat Nov 11 18:32:42 2017 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Sat, 11 Nov 2017 18:32:42 -0500 Subject: [vtkusers] =?utf-8?q?=E2=80=8BSetClientData_in_python_=28David_Go?= =?utf-8?q?bbi=29?= In-Reply-To: References: Message-ID: Andrew, I do want to make the examples available to at least 6.0 users. We can add c++ 11 stuff if we can exclude those examples based on VTK versions. Bill On Sat, Nov 11, 2017 at 6:07 PM, Andrew Maclean wrote: > I'll do an example for this. > > I'm also thinking that since we are using C++11 we should be able to use > lambda expressions. I'll also do an example for that. > > Regards > Andrew > > > On Sun, Nov 12, 2017 at 8:59 AM, Andrew Maclean > wrote: >> >> David, >> >> When I try this I get: >> TypeError: DummyFunc() missing 1 required positional argument: 'data' >> >> I used a slightly different approach in >> https://lorensen.github.io/VTKExamples/site/Python/VisualizationAlgorithms/StreamlinesWithLineWidget/ >> >> Regards >> Andrew >> >> 2. Re: >> SetClientData in python (David Gobbi) >>> >>> ---------- Forwarded message ---------- >>> From: David Gobbi >>> To: >>> "Serge K." >>> Cc: VTK Users >>> Bcc: >>> Date: Fri, 10 Nov 2017 11:17:26 -0700 >>> Subject: Re: [vtkusers] SetClientData in python >>> Hi Serge, >>> >>> The way to do this in Python is to add attributes to your callback >>> function. >>> >>> def DummyFunc(obj, ev, data): >>> print(ev, data) >>> >>> >>> DummyFunc.CallData = whatever >>> >>> interactor.AddObserver('LeftButtonPressEvent', DummyFunc) >>> >>> So the vtkCallbackCommand really isn't needed in Python (and, as you have >>> noticed, it really can't be used in Python anyway). >>> >>> - David >>> >>> >>> >>> On Fri, Nov 10, 2017 at 10:32 AM, Serge K. wrote: >>>> >>>> Hi All, >>>> >>>> I am playing with MouseEventObserver.py example and I would like to add >>>> a ClientData on my callback function. There are many examples in C++ like >>>> this one: https://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/ClientData >>>> >>>> However, I do not know how to do that in Python. >>>> >>>> Indeed, if I create a vtkCallbackCommand , SetCallBack function does >>>> not exist. >>>> >>>> Any Idea? Thanks for your answer. >>>> >>>> Serge >>>> >>>> ps: python36 - vtk 7.1.1 >>>> >>>> >>>> #!/usr/bin/env python >>>> from __future__ import print_function >>>> >>>> import vtk >>>> >>>> source = vtk.vtkSphereSource() >>>> source.SetCenter(0, 0, 0) >>>> source.SetRadius(1) >>>> source.Update() >>>> >>>> mapper = vtk.vtkPolyDataMapper() >>>> mapper.SetInputConnection(source.GetOutputPort()) >>>> >>>> actor = vtk.vtkActor() >>>> actor.SetMapper(mapper) >>>> >>>> renderer = vtk.vtkRenderer() >>>> renderer.SetBackground(1, 1, 1) >>>> renderer.AddActor(actor) >>>> >>>> renwin = vtk.vtkRenderWindow() >>>> renwin.AddRenderer(renderer) >>>> >>>> interactor = vtk.vtkRenderWindowInteractor() >>>> interactor.SetInteractorStyle(vtk.vtkInteractorStyleTrackballCamera()) >>>> interactor.SetRenderWindow(renwin) >>>> >>>> def DummyFunc(obj, ev, my_obj_2): >>>> print(obj, my_obj_2) >>>> >>>> # obj_2 = vtk.whatever() >>>> # How do I pass my obj_2 ? >>>> interactor.AddObserver('LeftButtonPressEvent', DummyFunc) >>>> interactor.Initialize() >>>> interactor.Start() >>> >>> >>> >> >> -- >> ___________________________________________ >> Andrew J. P. Maclean >> >> ___________________________________________ > > > > > -- > ___________________________________________ > Andrew J. P. Maclean > > ___________________________________________ > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Unpaid intern in BillsBasement at noware dot com From andrew.amaclean at gmail.com Sat Nov 11 20:06:36 2017 From: andrew.amaclean at gmail.com (Andrew Maclean) Date: Sun, 12 Nov 2017 12:06:36 +1100 Subject: [vtkusers] =?utf-8?q?=E2=80=8BSetClientData_in_python_=28David_Go?= =?utf-8?q?bbi=29?= In-Reply-To: References: Message-ID: We should be able to do this. Andrew Maclean On 12 Nov 2017 10:32, "Bill Lorensen" wrote: > Andrew, > > I do want to make the examples available to at least 6.0 users. We can > add c++ 11 stuff if we can exclude those examples based on VTK > versions. > > Bill > > > On Sat, Nov 11, 2017 at 6:07 PM, Andrew Maclean > wrote: > > I'll do an example for this. > > > > I'm also thinking that since we are using C++11 we should be able to use > > lambda expressions. I'll also do an example for that. > > > > Regards > > Andrew > > > > > > On Sun, Nov 12, 2017 at 8:59 AM, Andrew Maclean < > andrew.amaclean at gmail.com> > > wrote: > >> > >> David, > >> > >> When I try this I get: > >> TypeError: DummyFunc() missing 1 required positional argument: 'data' > >> > >> I used a slightly different approach in > >> https://lorensen.github.io/VTKExamples/site/Python/ > VisualizationAlgorithms/StreamlinesWithLineWidget/ > >> > >> Regards > >> Andrew > >> > >> 2. Re: > >> SetClientData in python (David Gobbi) > >>> > >>> ---------- Forwarded message ---------- > >>> From: David Gobbi > >>> To: > >>> "Serge K." > >>> Cc: VTK Users > >>> Bcc: > >>> Date: Fri, 10 Nov 2017 11:17:26 -0700 > >>> Subject: Re: [vtkusers] SetClientData in python > >>> Hi Serge, > >>> > >>> The way to do this in Python is to add attributes to your callback > >>> function. > >>> > >>> def DummyFunc(obj, ev, data): > >>> print(ev, data) > >>> > >>> > >>> DummyFunc.CallData = whatever > >>> > >>> interactor.AddObserver('LeftButtonPressEvent', DummyFunc) > >>> > >>> So the vtkCallbackCommand really isn't needed in Python (and, as you > have > >>> noticed, it really can't be used in Python anyway). > >>> > >>> - David > >>> > >>> > >>> > >>> On Fri, Nov 10, 2017 at 10:32 AM, Serge K. wrote: > >>>> > >>>> Hi All, > >>>> > >>>> I am playing with MouseEventObserver.py example and I would like to > add > >>>> a ClientData on my callback function. There are many examples in C++ > like > >>>> this one: https://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/ > ClientData > >>>> > >>>> However, I do not know how to do that in Python. > >>>> > >>>> Indeed, if I create a vtkCallbackCommand , SetCallBack function does > >>>> not exist. > >>>> > >>>> Any Idea? Thanks for your answer. > >>>> > >>>> Serge > >>>> > >>>> ps: python36 - vtk 7.1.1 > >>>> > >>>> > >>>> #!/usr/bin/env python > >>>> from __future__ import print_function > >>>> > >>>> import vtk > >>>> > >>>> source = vtk.vtkSphereSource() > >>>> source.SetCenter(0, 0, 0) > >>>> source.SetRadius(1) > >>>> source.Update() > >>>> > >>>> mapper = vtk.vtkPolyDataMapper() > >>>> mapper.SetInputConnection(source.GetOutputPort()) > >>>> > >>>> actor = vtk.vtkActor() > >>>> actor.SetMapper(mapper) > >>>> > >>>> renderer = vtk.vtkRenderer() > >>>> renderer.SetBackground(1, 1, 1) > >>>> renderer.AddActor(actor) > >>>> > >>>> renwin = vtk.vtkRenderWindow() > >>>> renwin.AddRenderer(renderer) > >>>> > >>>> interactor = vtk.vtkRenderWindowInteractor() > >>>> interactor.SetInteractorStyle(vtk.vtkInteractorStyleTrackballCam > era()) > >>>> interactor.SetRenderWindow(renwin) > >>>> > >>>> def DummyFunc(obj, ev, my_obj_2): > >>>> print(obj, my_obj_2) > >>>> > >>>> # obj_2 = vtk.whatever() > >>>> # How do I pass my obj_2 ? > >>>> interactor.AddObserver('LeftButtonPressEvent', DummyFunc) > >>>> interactor.Initialize() > >>>> interactor.Start() > >>> > >>> > >>> > >> > >> -- > >> ___________________________________________ > >> Andrew J. P. Maclean > >> > >> ___________________________________________ > > > > > > > > > > -- > > ___________________________________________ > > Andrew J. P. Maclean > > > > ___________________________________________ > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Please keep messages on-topic and check the VTK FAQ at: > > http://www.vtk.org/Wiki/VTK_FAQ > > > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/vtkusers > > > > > > -- > Unpaid intern in BillsBasement at noware dot com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hlukeh at hotmail.com Sun Nov 12 00:24:43 2017 From: hlukeh at hotmail.com (hlukeh) Date: Sat, 11 Nov 2017 22:24:43 -0700 (MST) Subject: [vtkusers] vtkLandmarkTransform Message-ID: <1510464283661-0.post@n5.nabble.com> I'm trying to find the best fit of a circular set of landmarks lying almost on a plane to a point cloud. I'm currently using a vtkLandmarkTransform with the mode set to Rigid Body. This does a good job of matching the two sets of data, but sometimes the best fit is found with a rotation and translation when I only want a translation (even if the fit isn't quite as good). I see three modes in the landmark transform, Rigid Body, Similarity and Affine, but all of those include rotation and translation (and scaling for Similarity). Does anyone know what transform could be used to match a set of landmarks to a set of points but limiting the method to translation only? Thank you, Luke -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From csumushu at 126.com Sun Nov 12 04:33:05 2017 From: csumushu at 126.com (csumushu) Date: Sun, 12 Nov 2017 02:33:05 -0700 (MST) Subject: [vtkusers] How to use vtkMath functions in ActiViz.NET for data of type double? In-Reply-To: <705a11bc43ce459bab8c97fc057ddfbc@cascadeacoustic.com> References: <1510190569720-0.post@n5.nabble.com> <1510362383246-0.post@n5.nabble.com> <705a11bc43ce459bab8c97fc057ddfbc@cascadeacoustic.com> Message-ID: <1510479185751-0.post@n5.nabble.com> Hello, Mark, I'm sorry I have to trouble you again. When I build mummy which downloaded from you github according to wiki suggestions with vs 2008, it will call other app to open cxx files, such as C:\VTK\mummy-build\Examples\Vehicles\wrappers\csharpmummy\xml\VehicleDescriptor_gccxml.cxx. I don't know what I need to do. If I do nothing, compilation will not continue. I tried to close the cxx file, it will generate an error: Generating xml/VehicleDescriptor.xml m_GCCXML_COMPILER: C:/VTK/mummy-build/Examples/Vehicles/wrappers/csharpmummy/xml/VehicleDescriptor_gccxml.cxx compilerName: vehicledescriptor_gccxml.cxx compilerID: ERROR_unsupported_compiler_in_gxConfiguration_GetCompilerId Compiler "C:/VTK/mummy-build/Examples/Vehicles/wrappers/csharpmummy/xml/VehicleDescriptor_gccxml.cxx" is not supported by GCC_XML. (gxConfiguration::FindFlags) Could not determine GCCXML_FLAGS setting. What should I do? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From onatt at gmx.de Sun Nov 12 09:26:09 2017 From: onatt at gmx.de (Oliver Natt) Date: Sun, 12 Nov 2017 15:26:09 +0100 Subject: [vtkusers] =?utf-8?q?=E2=80=8BSetClientData_in_python_=28David_Go?= =?utf-8?q?bbi=29?= In-Reply-To: References: Message-ID: <860a9c93-8184-89b1-dc31-5fea4e9846e8@gmx.de> Dear Andrew, Davids proposal ist great. However, it appears a bit strange to most programmers. I prefer for this purpose to make a new class which is a callable. I think, this makes the code more readable for most programmers since the data attribute is already initialized within the class itself. Your example would look like this: class DummyCallback: ??? def __init__(self, data): ??? ??? self.data = data ??? def __call__(self, obj, event): ??? ??? print(ev, self.data) cb = DummyCallback(renwin) interactor.AddObserver('LeftButtonPressEvent', cb) The last two lines can, of course, be abbreviated to: interactor.AddObserver('LeftButtonPressEvent', DummyCallback(renwin)) Best regards Oliver Am 11.11.2017 um 23:46 schrieb Andrew Maclean: > Ok > I have got it. > This works: > > def DummyFunc(obj, ev): > print(ev, DummyFunc.data) > > DummyFunc.data = renwin > # How do I pass my obj_2 ? interactor.AddObserver('LeftButtonPressEvent', DummyFunc) > > ?David, you may be able to explain this better than I can but I assume > this is what happens:? > ? ? Here we are adding a new attribute to DummyFunc. We can do this > because Python functions are in fact objects. > > ?This is something totally strange to C++ programmers! > > What a neat approach!? > > -- Oliver Natt, J?gerstra?e 26b 90451 N?rnberg Phone: +49 (0) 9 11 - 71 58 71 40 Mobile +49 (0) 1 76 - 20 82 27 38 E-Mail: onatt at gmx.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark at cascadeacoustic.com Sun Nov 12 18:07:58 2017 From: mark at cascadeacoustic.com (Mark DeArman) Date: Sun, 12 Nov 2017 17:07:58 -0600 Subject: [vtkusers] How to use vtkMath functions in ActiViz.NET for data of type double? In-Reply-To: <1510479185751-0.post@n5.nabble.com> References: <1510190569720-0.post@n5.nabble.com> <1510362383246-0.post@n5.nabble.com> <705a11bc43ce459bab8c97fc057ddfbc@cascadeacoustic.com> <1510479185751-0.post@n5.nabble.com> Message-ID: I would diff your CMakeCache.txt against the CMakeCache.sample I provided in the repo. It sounds like you don't have gcc-xml working quite right. Also: There are a couple of errors generated during the build process that I never tracked down, but they do not stop the binaries from being built. I can not remember if you have to build Mummy step-by-step or not, but I would give that a try, instead of just calling ALL_BUILD. It is not necessary to built the samples Mark DeArman Cascade Acoustic Research http://www.cascadeacoustic.com (253) 200-5353 ---------------------------------------- From: "csumushu" Sent: Sunday, November 12, 2017 1:33 AM To: vtkusers at vtk.org Subject: Re: [vtkusers] How to use vtkMath functions in ActiViz.NET for data of type double? Hello, Mark, I'm sorry I have to trouble you again. When I build mummy which downloaded from you github according to wiki suggestions with vs 2008, it will call other app to open cxx files, such as C:\VTK\mummy-build\Examples\Vehicles\wrappers\csharpmummy\xml\VehicleDescrip tor_gccxml.cxx. I don't know what I need to do. If I do nothing, compilation will not continue. I tried to close the cxx file, it will generate an error: Generating xml/VehicleDescriptor.xml m_GCCXML_COMPILER: C:/VTK/mummy-build/Examples/Vehicles/wrappers/csharpmummy/xml/VehicleDescrip tor_gccxml.cxx compilerName: vehicledescriptor_gccxml.cxx compilerID: ERROR_unsupported_compiler_in_gxConfiguration_GetCompilerId Compiler "C:/VTK/mummy-build/Examples/Vehicles/wrappers/csharpmummy/xml/VehicleDescri ptor_gccxml.cxx" is not supported by GCC_XML. (gxConfiguration::FindFlags) Could not determine GCCXML_FLAGS setting. What should I do? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From mikhail.pukhlikov at outlook.com Mon Nov 13 03:04:42 2017 From: mikhail.pukhlikov at outlook.com (Mikhail Pukhlikov) Date: Mon, 13 Nov 2017 08:04:42 +0000 Subject: [vtkusers] vtkRenderWindow: SetMultiSamples(8) doesn't work Message-ID: There is no difference with renderWindow->SetMultiSamples(0) or renderWindow->SetMultiSamples(8) for me. I've tested on different versions but seems like it's always the same, what am possibly doing wrong? (in current MITK (they use VTK renderer with same option) it doesn't work too for me). -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 529 bytes Desc: This is a digitally signed message part URL: From kor1581 at gmail.com Mon Nov 13 04:14:27 2017 From: kor1581 at gmail.com (K O ranjith) Date: Mon, 13 Nov 2017 14:44:27 +0530 Subject: [vtkusers] vtk zoom indicator In-Reply-To: References: Message-ID: Hello, Thanks for the tips it helped me.I would like to know if the length of axes of the legendactor can be modified.I used the corneroffsetfactor value to change it.Can it be changed using any other means. Thanks in Advance On Tue, Nov 7, 2017 at 9:37 PM, Sankhesh Jhaveri < sankhesh.jhaveri at kitware.com> wrote: > There?s no direct API but you can calculate it. All you have to do is > compute the length of the axis in world coordinates. > > Something like this: > > double * leftPoint = axis->GetPositionCoordinate()->GetComputedWorldValue(renderer);double * rightPoint = axis->GetPosition2Coordinate()->GetComputedWorldValue(renderer);double distance = vtkMath::sqrt(vtkMath::Distance2BetweenPoints(leftPoint, rightPoint));// Scale is 1 : distance > > Hope that helps. > > Best, > Sankhesh > ? > > On Tue, Nov 7, 2017 at 4:30 AM K O ranjith wrote: > >> Hello, >> Thanks, it's working. >> Can I get the measured value (which is displayed as label axis) from >> vtkLegendScaleActor object. >> >> Ranjith KO >> >> On Fri, Jun 23, 2017 at 7:52 PM, Sankhesh Jhaveri < >> sankhesh.jhaveri at kitware.com> wrote: >> >>> Take a look at vtkLegendScaleActor >>> . >>> It uses vtkAxisActor >>> internally. >>> >>> Hth, >>> Sankhesh >>> ? >>> >>> On Fri, Jun 23, 2017 at 1:55 AM K O ranjith wrote: >>> >>>> I'm using vtk for developing a MRI DICOM Image viewer in Qt. >>>> The viewer uses vtkDICOMImageReader, vtkImageViewer2 & QVTKWidget. >>>> I need to show a zoom indicator line which varies length with zoom >>>> value and need not affect other operation like rotate, pan( which is used >>>> for DICOM image in same window). It's position should be fixed at side of >>>> viewer and should not alter with zoom, pan, rotate. >>>> I added an line as an vtkactor to the renderer using vtkLineSource. >>>> Its length altering with zoom as I intended, but problem is its >>>> position also altering with the zoom, also rotate and Pan affecting on it. >>>> How can I make the position of the line fixed at side of the viewer. >>>> Have any option in vtk for visual indication of zoom factor something >>>> like vtkOrientationMarkerWidget for orientation... >>>> >>>> >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at http://www.kitware.com/ >>>> opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ at: >>>> http://www.vtk.org/Wiki/VTK_FAQ >>>> >>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://public.kitware.com/mailman/listinfo/vtkusers >>>> >>> -- >>> Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware >>> | (518) 881-4417 >>> ? >>> >> >> -- > Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware > | (518) 881-4417 > ? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elhassan.abdou at gmail.com Mon Nov 13 04:21:02 2017 From: elhassan.abdou at gmail.com (Elhassan Abdou) Date: Mon, 13 Nov 2017 10:21:02 +0100 Subject: [vtkusers] WIndows 10 OpenGL Message-ID: Hi All >From what I read that windows 10 supports OpenGL using OpenGLES, I think using ANGLE. I built VTK using WIN32 and _windows and opengl32 library. How VTK can be built on Window10? Regards Elhassan -------------- next part -------------- An HTML attachment was scrubbed... URL: From landinghere at 163.com Mon Nov 13 08:08:45 2017 From: landinghere at 163.com (landings) Date: Mon, 13 Nov 2017 06:08:45 -0700 (MST) Subject: [vtkusers] What happens if the indices of points are random? Message-ID: <1510578525316-0.post@n5.nabble.com> I have a few thousand points whose indices are quite random. They start from a few thousand to tens of thousand. I can't fix this easily because my cells are referencing them. I would like to know what will happen: - If the indices are random, is it OK for all buit-in filters, or some of them? - If I apply some filters that change the number of points, for example, extracting the surface of a solid mesh, are the new surface mesh's indices starting from 0 and continuous, or it depends? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From tim.hutton at gmail.com Mon Nov 13 08:32:46 2017 From: tim.hutton at gmail.com (Tim Hutton) Date: Mon, 13 Nov 2017 13:32:46 +0000 Subject: [vtkusers] vtkLandmarkTransform In-Reply-To: <1510464283661-0.post@n5.nabble.com> References: <1510464283661-0.post@n5.nabble.com> Message-ID: For translation only, you can just translate to match the centroids of the two point sets. I don't think there's a way of doing this in a VTK pipeline at the moment so you'd need to do it manually. We might usefully add such a mode to vtkLandmarkTransform. Tim On 12 November 2017 at 05:24, hlukeh wrote: > I'm trying to find the best fit of a circular set of landmarks lying almost > on a plane to a point cloud. I'm currently using a vtkLandmarkTransform > with > the mode set to Rigid Body. This does a good job of matching the two sets > of > data, but sometimes the best fit is found with a rotation and translation > when I only want a translation (even if the fit isn't quite as good). > > I see three modes in the landmark transform, Rigid Body, Similarity and > Affine, but all of those include rotation and translation (and scaling for > Similarity). > > Does anyone know what transform could be used to match a set of landmarks > to > a set of points but limiting the method to translation only? > > Thank you, > > Luke > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Tim Hutton - http://www.sq3.org.uk - http://profiles.google.com/tim.hutton/ - https://github.com/timhutton -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.martin at kitware.com Mon Nov 13 09:51:55 2017 From: ken.martin at kitware.com (Ken Martin) Date: Mon, 13 Nov 2017 09:51:55 -0500 Subject: [vtkusers] vtkRenderWindow: SetMultiSamples(8) doesn't work In-Reply-To: References: Message-ID: Make sure you set it before your first render, it is used when creating the hardware window. On Mon, Nov 13, 2017 at 3:04 AM, Mikhail Pukhlikov < mikhail.pukhlikov at outlook.com> wrote: > There is no difference with renderWindow->SetMultiSamples(0) or > renderWindow->SetMultiSamples(8) for me. > > I've tested on different versions but seems like it's always the same, > what am possibly doing wrong? (in current MITK (they use VTK renderer > with same option) it doesn't work too for 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 > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -- Ken Martin PhD Distinguished Engineer Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kwerner at rhrk.uni-kl.de Mon Nov 13 10:25:42 2017 From: kwerner at rhrk.uni-kl.de (Kilian Werner) Date: Mon, 13 Nov 2017 16:25:42 +0100 Subject: [vtkusers] vtkDistributedDataFilter::SingleProcessExecute() Message-ID: Dear list, for a distributed contour tree computation I am currently trying to split vtk data among mutliple nodes (that do not have shared memory). I am reading data from a file with a vtkXMLUnstructuredGridReader, there are no overlappings/ghost cells in the data at this point. The result should be a vtkUnstructuredGrid of one spatially contiguous part of the data per node including one layer of ghost cells. While vtkDistributedDataFilter seems to be doing just what I want, I do not use MPI for communication between nodes, but a task-parallel framework (called HPX). Because of the task parallel nature, I explicitly do not want the data splitting to require messages between nodes. Therefore the usual usage of vtkDistributedDataFilter with setController and implicit call of execute() through pipeline demands is not suitable for me. There is however word of "an explicit execution mode" in the documentation https://www.vtk.org/doc/nightly/html/classvtkDistributedDataFilter.html and I somewhat suspect that this involves a direct call to SingleProcessExecute(); With this however I have two(three) questions: 0.) Are my assumptions about SingleProcessExecute() and "an explicit execution mode" correct? Is there a way to perform data segmentation with vtkDistributedDataFilter "offline" as in not using the communication controller and not sending any mpi messages? 1.) If this offline segmentation is possible, how do I let vtkDistributedDataFilter know how many segments should be created and which one of them should be outputted? I do have that information per node even without using MPI, but where do I put the numbers, now that there is no communication controller? 2.) How do I request Ghost Cells, when not using the typical downstream pipeline demands? I assume that SingleProcessExecute() will not wait for any update() of any pipeline but start immediately, how to assure it creates ghost cells at that moment? Is it enough to extend vtkDistributedDataFilter with a custom class that overrides RequestData() and increases the ghost cells info? Or will this info be ignored by SingleProcessExecute() since it does not generate Output in the pipeline sense? Thank you in advance for your time, Kilian Werner P.S.: Maybe I could achieve the same results with an vtkOBBDicer + vtkThresholdFilter but how would I make the ThresholdFilter output ghost cells in this scenario? From sankhesh.jhaveri at kitware.com Mon Nov 13 11:54:08 2017 From: sankhesh.jhaveri at kitware.com (Sankhesh Jhaveri) Date: Mon, 13 Nov 2017 16:54:08 +0000 Subject: [vtkusers] vtk zoom indicator In-Reply-To: References: Message-ID: I don?t think so. You could directly use the vtkAxisActor API instead of using vtkLegendScaleActor to set the position coordinates of the two endpoints. ? On Mon, Nov 13, 2017 at 4:14 AM K O ranjith wrote: > Hello, > > Thanks for the tips it helped me.I would like to know if the length of axes > of the legendactor can be modified.I used the corneroffsetfactor value to > change it.Can it be changed using any other means. > > Thanks in Advance > > On Tue, Nov 7, 2017 at 9:37 PM, Sankhesh Jhaveri < > sankhesh.jhaveri at kitware.com> wrote: > >> There?s no direct API but you can calculate it. All you have to do is >> compute the length of the axis in world coordinates. >> >> Something like this: >> >> double * leftPoint = axis->GetPositionCoordinate()->GetComputedWorldValue(renderer);double * rightPoint = axis->GetPosition2Coordinate()->GetComputedWorldValue(renderer);double distance = vtkMath::sqrt(vtkMath::Distance2BetweenPoints(leftPoint, rightPoint));// Scale is 1 : distance >> >> Hope that helps. >> >> Best, >> Sankhesh >> ? >> >> On Tue, Nov 7, 2017 at 4:30 AM K O ranjith wrote: >> >>> Hello, >>> Thanks, it's working. >>> Can I get the measured value (which is displayed as label axis) from >>> vtkLegendScaleActor object. >>> >>> Ranjith KO >>> >>> On Fri, Jun 23, 2017 at 7:52 PM, Sankhesh Jhaveri < >>> sankhesh.jhaveri at kitware.com> wrote: >>> >>>> Take a look at vtkLegendScaleActor >>>> . >>>> It uses vtkAxisActor >>>> >>>> internally. >>>> >>>> Hth, >>>> Sankhesh >>>> ? >>>> >>>> On Fri, Jun 23, 2017 at 1:55 AM K O ranjith wrote: >>>> >>>>> I'm using vtk for developing a MRI DICOM Image viewer in Qt. >>>>> The viewer uses vtkDICOMImageReader, vtkImageViewer2 & QVTKWidget. >>>>> I need to show a zoom indicator line which varies length with zoom >>>>> value and need not affect other operation like rotate, pan( which is used >>>>> for DICOM image in same window). It's position should be fixed at side of >>>>> viewer and should not alter with zoom, pan, rotate. >>>>> I added an line as an vtkactor to the renderer using vtkLineSource. >>>>> Its length altering with zoom as I intended, but problem is its >>>>> position also altering with the zoom, also rotate and Pan affecting on it. >>>>> How can I make the position of the line fixed at side of the viewer. >>>>> Have any option in vtk for visual indication of zoom factor something >>>>> like vtkOrientationMarkerWidget for orientation... >>>>> >>>>> >>>>> _______________________________________________ >>>>> Powered by www.kitware.com >>>>> >>>>> Visit other Kitware open-source projects at >>>>> http://www.kitware.com/opensource/opensource.html >>>>> >>>>> Please keep messages on-topic and check the VTK FAQ at: >>>>> http://www.vtk.org/Wiki/VTK_FAQ >>>>> >>>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>>> >>>>> Follow this link to subscribe/unsubscribe: >>>>> http://public.kitware.com/mailman/listinfo/vtkusers >>>>> >>>> -- >>>> Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware >>>> | (518) 881-4417 >>>> ? >>>> >>> >>> -- >> Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware >> | (518) 881-4417 >> ? >> > > -- Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware | (518) 881-4417 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From csumushu at 126.com Mon Nov 13 12:23:07 2017 From: csumushu at 126.com (csumushu) Date: Mon, 13 Nov 2017 10:23:07 -0700 (MST) Subject: [vtkusers] How to use vtkMath functions in ActiViz.NET for data of type double? In-Reply-To: References: <1510190569720-0.post@n5.nabble.com> <1510362383246-0.post@n5.nabble.com> <705a11bc43ce459bab8c97fc057ddfbc@cascadeacoustic.com> <1510479185751-0.post@n5.nabble.com> Message-ID: <1510593787448-0.post@n5.nabble.com> I also used the gccxml binaries you provided? and it turned out to be the same. I'll follow your advice and continue building ActiViz when I have more free time. In addition to this, I have one more important and strange thing to ask you. I created a simple ActiViz project on my computer with Activiz.NET-7.1.1 which built by you, and it worked very well. But when I copy the whole project to my colleague's computer, it doesn't work. I am sure all dlls are included. When I start dubugging, it will pop up this window. If I click cancel button, it will throw an exception. Look forward to your reply. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From simakov.w at gmail.com Mon Nov 13 12:55:58 2017 From: simakov.w at gmail.com (Met@ll) Date: Mon, 13 Nov 2017 10:55:58 -0700 (MST) Subject: [vtkusers] =?utf-8?q?=E2=80=8B_Rotate_the_vector_along_the_X=2C_Y?= =?utf-8?b?LCBaIGF4ZXMu?= In-Reply-To: References: <1510079819282-0.post@n5.nabble.com> Message-ID: <1510595758437-0.post@n5.nabble.com> Thanks for the help! And how do I apply this matrix then? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From mark at cascadeacoustic.com Mon Nov 13 15:02:24 2017 From: mark at cascadeacoustic.com (Mark DeArman) Date: Mon, 13 Nov 2017 14:02:24 -0600 Subject: [vtkusers] How to use vtkMath functions in ActiViz.NET for data of type double? In-Reply-To: <1510593787448-0.post@n5.nabble.com> References: <1510190569720-0.post@n5.nabble.com> <1510362383246-0.post@n5.nabble.com> <705a11bc43ce459bab8c97fc057ddfbc@cascadeacoustic.com> <1510479185751-0.post@n5.nabble.com> <1510593787448-0.post@n5.nabble.com> Message-ID: <93a8c288b7bc41a1a242948fe160d779@cascadeacoustic.com> You need to make sure to include any of the required redistributable libraries when you deploy off of your development machine. For Activiz, I believe I have included them all in the binary package, although they might not all be moved automatically to the output directory. You also need to take care of any redist requirements for your build environment. You'll want to use the depends utility to evaluate what the requirements are, or build an installer with a tool that can help you figure it out. Mark DeArman Cascade Acoustic Research http://www.cascadeacoustic.com (253) 200-5353 ---------------------------------------- From: "csumushu" Sent: Monday, November 13, 2017 9:23 AM To: vtkusers at vtk.org Subject: Re: [vtkusers] How to use vtkMath functions in ActiViz.NET for data of type double? I also used the gccxml binaries you provided, and it turned out to be the same. I'll follow your advice and continue building ActiViz when I have more free time. In addition to this, I have one more important and strange thing to ask you. I created a simple ActiViz project on my computer with Activiz.NET-7.1.1 which built by you, and it worked very well. But when I copy the whole project to my colleague's computer, it doesn't work. I am sure all dlls are included. When I start dubugging, it will pop up this window. If I click cancel button, it will throw an exception. Look forward to your reply. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From petersenkolja at gmail.com Mon Nov 13 15:21:15 2017 From: petersenkolja at gmail.com (Kolja Petersen) Date: Mon, 13 Nov 2017 21:21:15 +0100 Subject: [vtkusers] TimerEvents not fired while dragging mouse in vtkRenderWindow Message-ID: Heya, I paste some code below, which displays an empty vtkRenderWindow with an interactor. The interactor fires a TimerEvent every 100ms as printed by the Observer. The problem: as long as I press a mouse button in the vtkRenderWindow, the TimerEvents stop to be reported, although I need to process data periodically in my application as a reaction to those TimerEvents. Why are no TimerEvents fired while a button is pressed, and how can I change this behaviour? Thank you Kolja import vtk class Observer(object): def __init__(self): self.cnt=0 def __call__(self,caller,evt): self.cnt+=1 print "count %d %s" % (self.cnt,evt) ren1 = vtk.vtkRenderer() ren1.SetBackground(0.1, 0.2, 0.4) renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren1) renWin.SetSize(300, 300) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) style = vtk.vtkInteractorStyleTrackballCamera() iren.SetInteractorStyle(style) iren.Initialize() observer=Observer() iren.AddObserver(vtk.vtkCommand.TimerEvent,observer) iren.AddObserver(vtk.vtkCommand.MouseMoveEvent,observer) iren.AddObserver(vtk.vtkCommand.InteractionEvent,observer) iren.CreateRepeatingTimer(100) iren.Start() Virenfrei. www.avast.com <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> -------------- next part -------------- An HTML attachment was scrubbed... URL: From utkarsh.ayachit at kitware.com Mon Nov 13 19:12:58 2017 From: utkarsh.ayachit at kitware.com (Utkarsh Ayachit) Date: Mon, 13 Nov 2017 19:12:58 -0500 Subject: [vtkusers] Supercomputing 2017: Schedule for talks at the Kitware Booth Message-ID: Folks, If you are attending Supercomputing 2017 (https://sc17.supercomputing.org/), please stop by the Kitware Booth #647 and say hello! It's always great to meet community members. Also, we are hosting short talks throughout the day Tue & Wed (schedule attached). See you there! Utkarsh -------------- next part -------------- A non-text attachment was scrubbed... Name: SC17_Schedule.jpg Type: image/jpeg Size: 412059 bytes Desc: not available URL: From aralol2015 at gmail.com Tue Nov 14 00:32:14 2017 From: aralol2015 at gmail.com (Duster) Date: Mon, 13 Nov 2017 22:32:14 -0700 (MST) Subject: [vtkusers] ruler in dicom Message-ID: <1510637534790-0.post@n5.nabble.com> Hello, I am trying to create a ruler for an image that changes along with the zoom event of the interactorstyle. I tried using the vtkLegendScaleActor.What i am trying to achieve is marked in the pictures below. Could anyone please provide some ideas on how this can be accomplished? Thanks in Advance -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From csumushu at 126.com Tue Nov 14 00:37:42 2017 From: csumushu at 126.com (csumushu) Date: Mon, 13 Nov 2017 22:37:42 -0700 (MST) Subject: [vtkusers] How to use vtkMath functions in ActiViz.NET for data of type double? In-Reply-To: <93a8c288b7bc41a1a242948fe160d779@cascadeacoustic.com> References: <1510190569720-0.post@n5.nabble.com> <1510362383246-0.post@n5.nabble.com> <705a11bc43ce459bab8c97fc057ddfbc@cascadeacoustic.com> <1510479185751-0.post@n5.nabble.com> <1510593787448-0.post@n5.nabble.com> <93a8c288b7bc41a1a242948fe160d779@cascadeacoustic.com> Message-ID: <1510637862636-0.post@n5.nabble.com> I am sure all of the VTK libraries are included. I also tried to build the project on a new virtual machine and the result is the same. I'm sure your library has no problems, otherwise it will not work well on my computer. I think it is caused by the different operating system environment. The picture below has more details. Thank you for your help. If I find out the reason, I'll tell you. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From marcin.krotkiewski at gmail.com Tue Nov 14 04:43:31 2017 From: marcin.krotkiewski at gmail.com (marcin.krotkiewski) Date: Tue, 14 Nov 2017 10:43:31 +0100 Subject: [vtkusers] Performance issue with 8.1.0rc1 Message-ID: Hello, I compiled VTK8.1.0rc1 with GCC + OpenMP and tested it in my Java-based application. The behavior is different compared to 8.0.1: when I manipulate (rotate/move) my model, all CPU cores are 100% active (used to be only 1), and the performance is very sluggish. Rotation staggers and is not smooth, even if I only render the axis actor. On the other hand, compiling without OpenMP support (Sequential) works as it used to. Does anyone have ideas? Thanks! Marcin From Wiggerl at Linhuber.info Tue Nov 14 05:34:43 2017 From: Wiggerl at Linhuber.info (Willy) Date: Tue, 14 Nov 2017 03:34:43 -0700 (MST) Subject: [vtkusers] Black cross section between volume and near clipping plane? In-Reply-To: References: <1510156873693-0.post@n5.nabble.com> Message-ID: <1510655683612-0.post@n5.nabble.com> It took a few days, but i changed to VS 2017. With vtk 8.1.0 everything works. Thanks Ludwig -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From ich_daniel at habmalnefrage.de Tue Nov 14 08:09:28 2017 From: ich_daniel at habmalnefrage.de (-Daniel-) Date: Tue, 14 Nov 2017 06:09:28 -0700 (MST) Subject: [vtkusers] vtkbioeng for vtk7.1.1 ? Message-ID: <1510664968533-0.post@n5.nabble.com> Hi there, I would like to use vtkbioeng with vtk7.1.1, but apparently this is no longer supported. Only up to version 6? Or is there already a solution for that? I'm particularly interested in collision detection. Every hint is welcome! -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From aashish.chaudhary at kitware.com Tue Nov 14 10:08:38 2017 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Tue, 14 Nov 2017 15:08:38 +0000 Subject: [vtkusers] Black cross section between volume and near clipping plane? In-Reply-To: <1510655683612-0.post@n5.nabble.com> References: <1510156873693-0.post@n5.nabble.com> <1510655683612-0.post@n5.nabble.com> Message-ID: Thanks for the update. I am glad things are working now. - Aashish On Tue, Nov 14, 2017 at 5:34 AM Willy wrote: > It took a few days, but i changed to VS 2017. With vtk 8.1.0 everything > works. > > Thanks > Ludwig > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lasso at queensu.ca Tue Nov 14 11:00:04 2017 From: lasso at queensu.ca (Andras Lasso) Date: Tue, 14 Nov 2017 16:00:04 +0000 Subject: [vtkusers] ruler in dicom In-Reply-To: <1510637534790-0.post@n5.nabble.com> References: <1510637534790-0.post@n5.nabble.com> Message-ID: You can have a look at how it is implemented in 3D Slicer. Screenshot: https://www.dropbox.com/s/3dzhrkq80gsbvdx/SlicerRulerScreenshot.png?dl=0 Source code: https://github.com/Slicer/Slicer/blob/master/Libs/MRML/DisplayableManager/vtkMRMLRulerDisplayableManager.cxx Andras -----Original Message----- From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Duster Sent: Tuesday, November 14, 2017 12:32 AM To: vtkusers at vtk.org Subject: [vtkusers] ruler in dicom Hello, I am trying to create a ruler for an image that changes along with the zoom event of the interactorstyle. I tried using the vtkLegendScaleActor.What i am trying to achieve is marked in the pictures below. Could anyone please provide some ideas on how this can be accomplished? Thanks in Advance -- Sent from: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fvtk.1045678.n5.nabble.com%2FVTK-Users-f1224199.html&data=02%7C01%7Classo%40queensu.ca%7Cfa1628c0d5b64d7de03308d52b2117bb%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636462343484739675&sdata=YEdncRfzPDiCbjAhD%2BSqIa4m0aSNahnT6e74%2BtxyZno%3D&reserved=0 _______________________________________________ Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7Cfa1628c0d5b64d7de03308d52b2117bb%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636462343484739675&sdata=IpzS0rMkfrnYiVGQPhRQ8h3G6XpbCRWeqNumLRQUkx0%3D&reserved=0 Visit other Kitware open-source projects at https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40queensu.ca%7Cfa1628c0d5b64d7de03308d52b2117bb%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636462343484739675&sdata=8%2Frj8t6fD1zvrjr04J9fdxTief2arcA77rdi%2B0w%2B7Zo%3D&reserved=0 Please keep messages on-topic and check the VTK FAQ at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Classo%40queensu.ca%7Cfa1628c0d5b64d7de03308d52b2117bb%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636462343484739675&sdata=5rsgriXHuX8EfuThjtejQAoW66CXkZn3bhM2mFj2%2BdY%3D&reserved=0 Search the list archives at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Classo%40queensu.ca%7Cfa1628c0d5b64d7de03308d52b2117bb%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636462343484739675&sdata=OYdA09%2BCquQbTmYIRRloVaBYk32d9BkvNjkHEzCP28k%3D&reserved=0 Follow this link to subscribe/unsubscribe: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%7Cfa1628c0d5b64d7de03308d52b2117bb%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636462343484739675&sdata=ZVzQ5l9y99LXe0hK%2BidU7wKjNlBu8JkhpzGLvb70heg%3D&reserved=0 From ken.martin at kitware.com Tue Nov 14 11:53:15 2017 From: ken.martin at kitware.com (Ken Martin) Date: Tue, 14 Nov 2017 11:53:15 -0500 Subject: [vtkusers] TimerEvents not fired while dragging mouse in vtkRenderWindow In-Reply-To: References: Message-ID: I suspect timer events are fired but something else is consuming them. Probably in the interactor style. Try adding your timer events with a higher priority like 10.0 (third argument). On Mon, Nov 13, 2017 at 3:21 PM, Kolja Petersen wrote: > Heya, > I paste some code below, which displays an empty vtkRenderWindow with an > interactor. The interactor fires a TimerEvent every 100ms as printed by the > Observer. > The problem: as long as I press a mouse button in the vtkRenderWindow, the > TimerEvents stop to be reported, although I need to process data > periodically in my application as a reaction to those TimerEvents. > > Why are no TimerEvents fired while a button is pressed, and how can I > change this behaviour? > Thank you > Kolja > > import vtk > > class Observer(object): > def __init__(self): > self.cnt=0 > def __call__(self,caller,evt): > self.cnt+=1 > print "count %d %s" % (self.cnt,evt) > > ren1 = vtk.vtkRenderer() > ren1.SetBackground(0.1, 0.2, 0.4) > > renWin = vtk.vtkRenderWindow() > renWin.AddRenderer(ren1) > renWin.SetSize(300, 300) > > iren = vtk.vtkRenderWindowInteractor() > iren.SetRenderWindow(renWin) > > style = vtk.vtkInteractorStyleTrackballCamera() > iren.SetInteractorStyle(style) > > iren.Initialize() > observer=Observer() > iren.AddObserver(vtk.vtkCommand.TimerEvent,observer) > iren.AddObserver(vtk.vtkCommand.MouseMoveEvent,observer) > iren.AddObserver(vtk.vtkCommand.InteractionEvent,observer) > iren.CreateRepeatingTimer(100) > iren.Start() > > > Virenfrei. > www.avast.com > > <#m_5020402281578617109_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -- Ken Martin PhD Distinguished Engineer Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.langer at nist.gov Tue Nov 14 14:05:44 2017 From: stephen.langer at nist.gov (Langer, Stephen A. (Fed)) Date: Tue, 14 Nov 2017 19:05:44 +0000 Subject: [vtkusers] vtk and gtk on macOS In-Reply-To: <5D8DE910-425D-4547-BEB3-81A2F2949F9A@nist.gov> References: <49FDD20F-0AFF-4475-B314-20C78E20EEA9@nist.gov> <5D8DE910-425D-4547-BEB3-81A2F2949F9A@nist.gov> Message-ID: <3CDBE37E-520E-46EB-BA69-30F177FC71EF@nist.gov> Just in case someone else is trying to do the same thing and finds this message, the configure callback below is incorrect because gtk and vtk have different ideas about which direction is up. The call to render_window->SetPosition should be GtkWidget *top = gtk_widget_get_toplevel(drawing_area) render_window->SetPosition(top->allocation.height- event->y - event->height); event->y and drawing_area->allocation.y are interchangeable. -- Steve From: vtkusers on behalf of "Langer, Stephen A. (Fed)" Date: Friday, November 3, 2017 at 10:11 AM To: David Gobbi Cc: "vtkusers at vtk.org" Subject: Re: [vtkusers] vtk and gtk on macOS HI David -- Thanks for the suggestions, which got me started on the right track. What seems to work is this (somewhat simplified to eliminate some infrastructure): // Create gtk widget and vtk window GtkWidget *drawing_area = gtk_drawing_area_new(); vtkSmartPointer render_window = vtkSmartPointer::New(); // Connect to gtk signals. g_signal_connect(drawing_area, "realize", realize_callback, ..) g_signal_connect(drawing_area, "configure_event", configure_callback, ?) // in realize_callback gtk_widget_realize(drawing_area); render_window->SetRootWindow(gtk_widget_get_root_window(drawing_area)); GdkWindow gparent = gtk_widget_get_parent_window(drawing_area); NSView *pid = gdk_quartz_window_get_nsview(gparent); render_window->SetParentId((void*) pid); // in configure_callback // event is a GdkEventConfigure* that's passed in as an argument // Unlike David's QWidget example, I do not use the superclass versions of SetSize and SetPosition render_window->SetSize(event->width, event->height); render_window->SetPosition(drawing_area->allocation.x, drawing_area->allocation.y); I also added an expose event callback which just called render_window->Render(), but it doesn't seem to be necessary. -- Steve From: David Gobbi Date: Tuesday, October 24, 2017 at 2:56 PM To: "Langer, Stephen A. (Fed)" Cc: "vtkusers at vtk.org" Subject: Re: [vtkusers] vtk and gtk on macOS Hi Steve, Here is some code that I use to bind a VTK window to a QWidget. My guess is that something similar should work with GTK. I have been using this on OS X with vtkCocoaRenderWindow. void BindRenderWindow(vtkRenderWindow *window, QWidget *widget) { // Unmap the window if it is already mapped somewhere else. if (window->GetMapped()) { window->Finalize(); } // Create the connection window->SetWindowId(reinterpret_cast(widget->winId())); // Note that we must call the superclass SetSize()/SetPosition() // (we just want to set the member variables, with no side-effects) window->vtkRenderWindow::SetSize(widget->width(), widget->height()); window->vtkRenderWindow::SetPosition(widget->x(), widget->y()); // Prepare for rendering if (widget->isVisible()) { window->Start(); } // Call SetSize() again, to synchronize the window to the widget window->SetSize(widget->width(), widget->height()); } Some further notes: 1) I disable Qt's paint engine, so that Qt itself doesn't draw in the window. GTK may be similar. 2) You probably will not need GtkGLExt (for Qt, I didn't have to use QGLWidget). - David On Tue, Oct 24, 2017 at 12:12 PM, Langer, Stephen A. (Fed) > wrote: Hi -- Is there a simple way to get vtk to work inside a gtk+2 program on macOS? If there isn't a simple way, is there a difficult one? I'm trying to get a program that uses gtk+2 and vtk to work with a modern version of vtk -- I'm upgrading from 5.10.1 to 7.1.1 or 8.0.1. On Linux, the following code creates a vtk render window and a gtk widget containing it: vtkRenderWindow *render_win = vtkRenderWindow::New(); GtkWidget *drawing_area = gtk_drawing_area_new(); Display *disp = GDK_DISPLAY(); render_win->SetDisplayId(disp); followed eventually by XID wid = GDK_WINDOW_XID(drawing_area->window); render_win->SetWindowId(wid); after receiving the gtk "realize" signal on the drawing_area. On macOS, I'd like to use the Cocoa version of gtk+2 and vtkCocoaRenderWindow, but I can't figure out how to embed the render window into a gtk widget. All the examples I've found on-line aren't really applicable. GtkGLExt might be applicable, but it doesn't look like it's being maintained. An alternative would be to use X11, but native Mac OpenGL doesn't understand X11, so I tried installing mesa from macports , rebuilding vtk with VTK_USE_X instead of VTK_USE_COCOA, and linking to /opt/local/lib instead of /System/Library/Frameworks/OpenGL.framework. Then I can use the same code as on Linux, but vtk complains about the context not supporting OpenGL 3.2, and then crashes: ERROR: In /Users/langer/UTIL/VTK/VTK-7.1.1/Rendering/OpenGL2/vtkTextureObject.cxx, line 440 vtkTextureObject (0x7f9eafdb1690): failed at glGenTextures 1 OpenGL errors detected 0 : (1280) Invalid enum Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.langer at nist.gov Tue Nov 14 14:59:19 2017 From: stephen.langer at nist.gov (Langer, Stephen A. (Fed)) Date: Tue, 14 Nov 2017 19:59:19 +0000 Subject: [vtkusers] vtk and gtk on macOS In-Reply-To: <3CDBE37E-520E-46EB-BA69-30F177FC71EF@nist.gov> References: <49FDD20F-0AFF-4475-B314-20C78E20EEA9@nist.gov> <5D8DE910-425D-4547-BEB3-81A2F2949F9A@nist.gov> <3CDBE37E-520E-46EB-BA69-30F177FC71EF@nist.gov> Message-ID: Responding to my own message again? Is it possible that the vtk or gtk+2 coordinate systems are different on different platforms? On a Mac, using vtk 7.1.1 and Cocoa, the configure callback for the vtk render window inside a gtk widget looks like this: gboolean OOFCanvas3D::configure(GdkEventConfigure *event) { render_window->SetSize(event->width, event->height); GtkWidget *topwindow = gtk_widget_get_toplevel(drawing_area); assert(topwindow != nullptr); int top_height = topwindow->allocation.height; render_window->SetPosition(event->x, top_height - event->y - event->height); return true; } but that doesn't work on Linux (Ubuntu inside VirtualBox, using vtk 7.1.1 and X11), where it has to be this: gboolean OOFCanvas3D::configure(GdkEventConfigure *event) { render_window->SetSize(event->width, event->height); render_window->SetPosition(event->x, event->y); return true; } Both of these do what they should do (on their respective platforms) when the space allocated for the vtk render window is changed. But it looks like on the Mac the position of the vtk widget is measured from the bottom of the enclosing window while on Linux it's measured from the top! Can this be true? What am I missing? Thanks. -- Steve From: vtkusers on behalf of "Langer, Stephen A. (Fed)" Date: Tuesday, November 14, 2017 at 2:06 PM To: "vtkusers at vtk.org" Subject: Re: [vtkusers] vtk and gtk on macOS Just in case someone else is trying to do the same thing and finds this message, the configure callback below is incorrect because gtk and vtk have different ideas about which direction is up. The call to render_window->SetPosition should be GtkWidget *top = gtk_widget_get_toplevel(drawing_area) render_window->SetPosition(top->allocation.height- event->y - event->height); event->y and drawing_area->allocation.y are interchangeable. -- Steve From: vtkusers on behalf of "Langer, Stephen A. (Fed)" Date: Friday, November 3, 2017 at 10:11 AM To: David Gobbi Cc: "vtkusers at vtk.org" Subject: Re: [vtkusers] vtk and gtk on macOS HI David -- Thanks for the suggestions, which got me started on the right track. What seems to work is this (somewhat simplified to eliminate some infrastructure): // Create gtk widget and vtk window GtkWidget *drawing_area = gtk_drawing_area_new(); vtkSmartPointer render_window = vtkSmartPointer::New(); // Connect to gtk signals. g_signal_connect(drawing_area, "realize", realize_callback, ..) g_signal_connect(drawing_area, "configure_event", configure_callback, ?) // in realize_callback gtk_widget_realize(drawing_area); render_window->SetRootWindow(gtk_widget_get_root_window(drawing_area)); GdkWindow gparent = gtk_widget_get_parent_window(drawing_area); NSView *pid = gdk_quartz_window_get_nsview(gparent); render_window->SetParentId((void*) pid); // in configure_callback // event is a GdkEventConfigure* that's passed in as an argument // Unlike David's QWidget example, I do not use the superclass versions of SetSize and SetPosition render_window->SetSize(event->width, event->height); render_window->SetPosition(drawing_area->allocation.x, drawing_area->allocation.y); I also added an expose event callback which just called render_window->Render(), but it doesn't seem to be necessary. -- Steve From: David Gobbi Date: Tuesday, October 24, 2017 at 2:56 PM To: "Langer, Stephen A. (Fed)" Cc: "vtkusers at vtk.org" Subject: Re: [vtkusers] vtk and gtk on macOS Hi Steve, Here is some code that I use to bind a VTK window to a QWidget. My guess is that something similar should work with GTK. I have been using this on OS X with vtkCocoaRenderWindow. void BindRenderWindow(vtkRenderWindow *window, QWidget *widget) { // Unmap the window if it is already mapped somewhere else. if (window->GetMapped()) { window->Finalize(); } // Create the connection window->SetWindowId(reinterpret_cast(widget->winId())); // Note that we must call the superclass SetSize()/SetPosition() // (we just want to set the member variables, with no side-effects) window->vtkRenderWindow::SetSize(widget->width(), widget->height()); window->vtkRenderWindow::SetPosition(widget->x(), widget->y()); // Prepare for rendering if (widget->isVisible()) { window->Start(); } // Call SetSize() again, to synchronize the window to the widget window->SetSize(widget->width(), widget->height()); } Some further notes: 1) I disable Qt's paint engine, so that Qt itself doesn't draw in the window. GTK may be similar. 2) You probably will not need GtkGLExt (for Qt, I didn't have to use QGLWidget). - David On Tue, Oct 24, 2017 at 12:12 PM, Langer, Stephen A. (Fed) > wrote: Hi -- Is there a simple way to get vtk to work inside a gtk+2 program on macOS? If there isn't a simple way, is there a difficult one? I'm trying to get a program that uses gtk+2 and vtk to work with a modern version of vtk -- I'm upgrading from 5.10.1 to 7.1.1 or 8.0.1. On Linux, the following code creates a vtk render window and a gtk widget containing it: vtkRenderWindow *render_win = vtkRenderWindow::New(); GtkWidget *drawing_area = gtk_drawing_area_new(); Display *disp = GDK_DISPLAY(); render_win->SetDisplayId(disp); followed eventually by XID wid = GDK_WINDOW_XID(drawing_area->window); render_win->SetWindowId(wid); after receiving the gtk "realize" signal on the drawing_area. On macOS, I'd like to use the Cocoa version of gtk+2 and vtkCocoaRenderWindow, but I can't figure out how to embed the render window into a gtk widget. All the examples I've found on-line aren't really applicable. GtkGLExt might be applicable, but it doesn't look like it's being maintained. An alternative would be to use X11, but native Mac OpenGL doesn't understand X11, so I tried installing mesa from macports , rebuilding vtk with VTK_USE_X instead of VTK_USE_COCOA, and linking to /opt/local/lib instead of /System/Library/Frameworks/OpenGL.framework. Then I can use the same code as on Linux, but vtk complains about the context not supporting OpenGL 3.2, and then crashes: ERROR: In /Users/langer/UTIL/VTK/VTK-7.1.1/Rendering/OpenGL2/vtkTextureObject.cxx, line 440 vtkTextureObject (0x7f9eafdb1690): failed at glGenTextures 1 OpenGL errors detected 0 : (1280) Invalid enum Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From kayarre at gmail.com Tue Nov 14 20:30:57 2017 From: kayarre at gmail.com (Kurt Sansom) Date: Tue, 14 Nov 2017 17:30:57 -0800 Subject: [vtkusers] Ensight Gold Binary Reader Message-ID: Hi, I am exporting fluent files to the ensight gold format, but I have determined that either the ensight Gold format only supports floats or that the vtk reader only supports reading into float arrays (single precision). I could not find information about ensight gold format (I did see ensight 6 and 5 mentioned not supporting double precision, bu no comment on ensight gold) I would like to know if I can create an vtkEnSightGoldBinaryDoubleReader that will read in double precision arrays, or if the ensight gold format doesn't support double precision. Many thanks, VTK is so awesome. (especially the python bindings) ~Kurt -- Kurt Sansom -------------- next part -------------- An HTML attachment was scrubbed... URL: From 419655660 at qq.com Wed Nov 15 01:58:50 2017 From: 419655660 at qq.com (louiskoo) Date: Tue, 14 Nov 2017 23:58:50 -0700 (MST) Subject: [vtkusers] vtkDICOMImageReader will reverse using ImagePositionPatient ? Message-ID: <1510729130030-0.post@n5.nabble.com> vtkDICOMImageReader dicom_reader = vtkDICOMImageReader.New(); dicom_reader.SetDirectoryName(dicom_folder); dicom_reader.Update(); -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From petersenkolja at gmail.com Wed Nov 15 05:26:11 2017 From: petersenkolja at gmail.com (Kolja Petersen) Date: Wed, 15 Nov 2017 11:26:11 +0100 Subject: [vtkusers] TimerEvents not fired while dragging mouse in vtkRenderWindow In-Reply-To: References: Message-ID: I replaced the line "iren.AddObserver(vtk.vtkCommand.TimerEvent,observer)" with iren.AddObserver(vtk.vtkCommand.TimerEvent,observer,100000.) (also tried 10.0 instead of 100000.) Still no TimerEvents are reported as long as the mouse button is pressed. How are events consumed? My understanding is that AddObserver(...) adds just another listener, and that all listeners registered for a specific event are invoked one after the other. Which function would "consume" events in an interactor style? Is it possible to circumvent the consuming of events, or to re-emit the event after it has been consumed? Thank you Kolja On Tue, Nov 14, 2017 at 5:53 PM, Ken Martin wrote: > I suspect timer events are fired but something else is consuming them. > Probably in the interactor style. Try adding your timer events with a > higher priority like 10.0 (third argument). > > On Mon, Nov 13, 2017 at 3:21 PM, Kolja Petersen > wrote: > >> Heya, >> I paste some code below, which displays an empty vtkRenderWindow with an >> interactor. The interactor fires a TimerEvent every 100ms as printed by the >> Observer. >> The problem: as long as I press a mouse button in the vtkRenderWindow, >> the TimerEvents stop to be reported, although I need to process data >> periodically in my application as a reaction to those TimerEvents. >> >> Why are no TimerEvents fired while a button is pressed, and how can I >> change this behaviour? >> Thank you >> Kolja >> >> import vtk >> >> class Observer(object): >> def __init__(self): >> self.cnt=0 >> def __call__(self,caller,evt): >> self.cnt+=1 >> print "count %d %s" % (self.cnt,evt) >> >> ren1 = vtk.vtkRenderer() >> ren1.SetBackground(0.1, 0.2, 0.4) >> >> renWin = vtk.vtkRenderWindow() >> renWin.AddRenderer(ren1) >> renWin.SetSize(300, 300) >> >> iren = vtk.vtkRenderWindowInteractor() >> iren.SetRenderWindow(renWin) >> >> style = vtk.vtkInteractorStyleTrackballCamera() >> iren.SetInteractorStyle(style) >> >> iren.Initialize() >> observer=Observer() >> iren.AddObserver(vtk.vtkCommand.TimerEvent,observer) >> iren.AddObserver(vtk.vtkCommand.MouseMoveEvent,observer) >> iren.AddObserver(vtk.vtkCommand.InteractionEvent,observer) >> iren.CreateRepeatingTimer(100) >> iren.Start() >> >> >> Virenfrei. >> www.avast.com >> >> <#m_-5995428116567439952_m_5020402281578617109_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> > > > -- > Ken Martin PhD > Distinguished Engineer > Kitware Inc. > 28 Corporate Drive > > Clifton Park NY 12065 > > > This communication, including all attachments, contains confidential and > legally privileged information, and it is intended only for the use of the > addressee. Access to this email by anyone else is unauthorized. If you are > not the intended recipient, any disclosure, copying, distribution or any > action taken in reliance on it is prohibited and may be unlawful. If you > received this communication in error please notify us immediately and > destroy the original message. Thank you. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pengfeijia11 at sjtu.edu.cn Wed Nov 15 06:17:11 2017 From: pengfeijia11 at sjtu.edu.cn (=?gb2312?B?vNbF9LfJ?=) Date: Wed, 15 Nov 2017 19:17:11 +0800 (CST) Subject: [vtkusers] using vtkImageBlend to combine two gray image Message-ID: <928007308.11523911.1510744631970.JavaMail.zimbra@sjtu.edu.cn> Hi All: ? I have two gray images (vtkimagedata version),? they have the same size. I want to combine them together using vtkimageblend. 1st? the following are some codes: ?vtkSmartPointer imgBlender = vtkSmartPointer::New(); ?imgBlender->SetOpacity( 0, 0.5); ?imgBlender->SetOpacity( 1, 0.5); ?imgBlender->AddInput(AP); ?imgBlender->AddInput( APdrr ); It seems that the result is wrong! the second is in the window, while the first seems not in the proper position, only part of it. 2nd?Then I adjust the opacity? vtkSmartPointer imgBlender = vtkSmartPointer::New(); ?imgBlender->SetOpacity( 0, 1); ?imgBlender->SetOpacity( 1, 1); ?imgBlender->AddInput(AP); ?imgBlender->AddInput( APdrr ); then the result only shows the second image, there is not the first image! can someone give me some suggestions, thanks in advance! From landinghere at 163.com Wed Nov 15 08:49:42 2017 From: landinghere at 163.com (landings) Date: Wed, 15 Nov 2017 06:49:42 -0700 (MST) Subject: [vtkusers] How to use unsigned char to represent cell types? Message-ID: <1510753782836-0.post@n5.nabble.com> I am using vtkUnstructuredGrid::SetCells() and I don't know what to fill into the cellTypes array. By the way, do parameters *types and *cellTypes contain similar values? ------------------------------------- void vtkUnstructuredGrid::SetCells ( int type, vtkCellArray * cells ) void vtkUnstructuredGrid::SetCells ( int * types, vtkCellArray * cells ) void vtkUnstructuredGrid::SetCells ( vtkUnsignedCharArray * cellTypes, vtkIdTypeArray * cellLocations, vtkCellArray * cells ) void vtkUnstructuredGrid::SetCells ( vtkUnsignedCharArray * cellTypes, vtkIdTypeArray * cellLocations, vtkCellArray * cells, vtkIdTypeArray * faceLocations, vtkIdTypeArray * faces ) Description: ------------------------------------- Most cells require just arrays of cellTypes, cellLocations and cellConnectivities which implicitly define the set of points in each cell and their ordering. In those cases the cellConnectivities are of the format (numFace0Pts, id1, id2, id3, numFace1Pts, id1, id2, id3...). However, some cells like vtkPolyhedron require points plus a list of faces. To handle vtkPolyhedron, SetCells() support a special input cellConnectivities format (numCellFaces, numFace0Pts, id1, id2, id3, numFace1Pts,id1, id2, id3, ...) The functions use vtkPolyhedron::DecomposeAPolyhedronCell() to convert polyhedron cells into standard format. ------------------------------------- -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From DLRdave at aol.com Wed Nov 15 11:25:07 2017 From: DLRdave at aol.com (David Cole) Date: Wed, 15 Nov 2017 11:25:07 -0500 Subject: [vtkusers] TimerEvents not fired while dragging mouse in vtkRenderWindow In-Reply-To: References: Message-ID: Is this on Windows? WM_TIMER events are notorious for not firing frequently when lots of other user events are also happening. If the mouse is captured, they may not fire at all. This is not something unique to VTK, it happens with just any Windows program. You may need to consider redesigning a bit of your app if you must have code being executed regularly even during user interactions. David > On Nov 15, 2017, at 5:26 AM, Kolja Petersen wrote: > > I replaced the line "iren.AddObserver(vtk.vtkCommand.TimerEvent,observer)" with > iren.AddObserver(vtk.vtkCommand.TimerEvent,observer,100000.) (also tried 10.0 instead of 100000.) > > Still no TimerEvents are reported as long as the mouse button is pressed. > > How are events consumed? My understanding is that AddObserver(...) adds just another listener, and that all listeners registered for a specific event are invoked one after the other. Which function would "consume" events in an interactor style? Is it possible to circumvent the consuming of events, or to re-emit the event after it has been consumed? > Thank you > Kolja > > >> On Tue, Nov 14, 2017 at 5:53 PM, Ken Martin wrote: >> I suspect timer events are fired but something else is consuming them. Probably in the interactor style. Try adding your timer events with a higher priority like 10.0 (third argument). >> >>> On Mon, Nov 13, 2017 at 3:21 PM, Kolja Petersen wrote: >>> Heya, >>> I paste some code below, which displays an empty vtkRenderWindow with an interactor. The interactor fires a TimerEvent every 100ms as printed by the Observer. >>> The problem: as long as I press a mouse button in the vtkRenderWindow, the TimerEvents stop to be reported, although I need to process data periodically in my application as a reaction to those TimerEvents. >>> >>> Why are no TimerEvents fired while a button is pressed, and how can I change this behaviour? >>> Thank you >>> Kolja >>> >>> import vtk >>> >>> class Observer(object): >>> def __init__(self): >>> self.cnt=0 >>> def __call__(self,caller,evt): >>> self.cnt+=1 >>> print "count %d %s" % (self.cnt,evt) >>> >>> ren1 = vtk.vtkRenderer() >>> ren1.SetBackground(0.1, 0.2, 0.4) >>> >>> renWin = vtk.vtkRenderWindow() >>> renWin.AddRenderer(ren1) >>> renWin.SetSize(300, 300) >>> >>> iren = vtk.vtkRenderWindowInteractor() >>> iren.SetRenderWindow(renWin) >>> >>> style = vtk.vtkInteractorStyleTrackballCamera() >>> iren.SetInteractorStyle(style) >>> >>> iren.Initialize() >>> observer=Observer() >>> iren.AddObserver(vtk.vtkCommand.TimerEvent,observer) >>> iren.AddObserver(vtk.vtkCommand.MouseMoveEvent,observer) >>> iren.AddObserver(vtk.vtkCommand.InteractionEvent,observer) >>> iren.CreateRepeatingTimer(100) >>> iren.Start() >>> >>> Virenfrei. www.avast.com >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/vtkusers >>> >> >> >> >> -- >> Ken Martin PhD >> Distinguished Engineer >> Kitware Inc. >> 28 Corporate Drive >> Clifton Park NY 12065 >> >> This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From petersenkolja at gmail.com Wed Nov 15 11:42:55 2017 From: petersenkolja at gmail.com (Kolja Petersen) Date: Wed, 15 Nov 2017 17:42:55 +0100 Subject: [vtkusers] TimerEvents not fired while dragging mouse in vtkRenderWindow In-Reply-To: References: Message-ID: No, this is on Linux. Maybe you can try the code snippet yourself to see what I am talking about? The problem is not, that the TimerEvents are slowed down during mouse interaction, they are dropped completely. How can the app be redesigned? First, I need the standard behaviour of vtkRenderWindowInteractor to allow rotating, zooming, panning. Second I need to update and redraw the scene repeatedly in constant intervals. Of course, I could trigger these events independent from VTK using a second thread. But these events need to operate on VTK objects from the main thread. Because VTK is not thread safe (which I have experienced by a number of segmentation faults when modifying VTK objects from different threads), I see absolutely no way to correctly process both 1) timer events and 2) user interaction events that block the timer events. Kolja Virenfrei. www.avast.com <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> On Wed, Nov 15, 2017 at 5:25 PM, David Cole wrote: > Is this on Windows? WM_TIMER events are notorious for not firing > frequently when lots of other user events are also happening. If the mouse > is captured, they may not fire at all. This is not something unique to VTK, > it happens with just any Windows program. > > You may need to consider redesigning a bit of your app if you must have > code being executed regularly even during user interactions. > > > David > > On Nov 15, 2017, at 5:26 AM, Kolja Petersen > wrote: > > I replaced the line "iren.AddObserver(vtk.vtkCommand.TimerEvent,observer)" > with > iren.AddObserver(vtk.vtkCommand.TimerEvent,observer,100000.) (also tried > 10.0 instead of 100000.) > > Still no TimerEvents are reported as long as the mouse button is pressed. > > How are events consumed? My understanding is that AddObserver(...) adds > just another listener, and that all listeners registered for a specific > event are invoked one after the other. Which function would "consume" > events in an interactor style? Is it possible to circumvent the consuming > of events, or to re-emit the event after it has been consumed? > Thank you > Kolja > > > On Tue, Nov 14, 2017 at 5:53 PM, Ken Martin > wrote: > >> I suspect timer events are fired but something else is consuming them. >> Probably in the interactor style. Try adding your timer events with a >> higher priority like 10.0 (third argument). >> >> On Mon, Nov 13, 2017 at 3:21 PM, Kolja Petersen >> wrote: >> >>> Heya, >>> I paste some code below, which displays an empty vtkRenderWindow with an >>> interactor. The interactor fires a TimerEvent every 100ms as printed by the >>> Observer. >>> The problem: as long as I press a mouse button in the vtkRenderWindow, >>> the TimerEvents stop to be reported, although I need to process data >>> periodically in my application as a reaction to those TimerEvents. >>> >>> Why are no TimerEvents fired while a button is pressed, and how can I >>> change this behaviour? >>> Thank you >>> Kolja >>> >>> import vtk >>> >>> class Observer(object): >>> def __init__(self): >>> self.cnt=0 >>> def __call__(self,caller,evt): >>> self.cnt+=1 >>> print "count %d %s" % (self.cnt,evt) >>> >>> ren1 = vtk.vtkRenderer() >>> ren1.SetBackground(0.1, 0.2, 0.4) >>> >>> renWin = vtk.vtkRenderWindow() >>> renWin.AddRenderer(ren1) >>> renWin.SetSize(300, 300) >>> >>> iren = vtk.vtkRenderWindowInteractor() >>> iren.SetRenderWindow(renWin) >>> >>> style = vtk.vtkInteractorStyleTrackballCamera() >>> iren.SetInteractorStyle(style) >>> >>> iren.Initialize() >>> observer=Observer() >>> iren.AddObserver(vtk.vtkCommand.TimerEvent,observer) >>> iren.AddObserver(vtk.vtkCommand.MouseMoveEvent,observer) >>> iren.AddObserver(vtk.vtkCommand.InteractionEvent,observer) >>> iren.CreateRepeatingTimer(100) >>> iren.Start() >>> >>> >>> Virenfrei. >>> www.avast.com >>> >>> <#m_-7045443072964375499_m_-5995428116567439952_m_5020402281578617109_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/vtkusers >>> >>> >> >> >> -- >> Ken Martin PhD >> Distinguished Engineer >> Kitware Inc. >> 28 Corporate Drive >> >> Clifton Park NY 12065 >> >> >> This communication, including all attachments, contains confidential and >> legally privileged information, and it is intended only for the use of the >> addressee. Access to this email by anyone else is unauthorized. If you are >> not the intended recipient, any disclosure, copying, distribution or any >> action taken in reliance on it is prohibited and may be unlawful. If you >> received this communication in error please notify us immediately and >> destroy the original message. Thank you. >> > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.martin at kitware.com Wed Nov 15 11:48:24 2017 From: ken.martin at kitware.com (Ken Martin) Date: Wed, 15 Nov 2017 11:48:24 -0500 Subject: [vtkusers] TimerEvents not fired while dragging mouse in vtkRenderWindow In-Reply-To: References: Message-ID: The interactor style may be doing a grab focus (which grabs all events until the motion is done). Try putting some printfs/breaks in the code that generates the timerevent in vtk. Then maybe you can follow the event and see who is consuming it etc,. Or try commenting out all the GrabFocus() calls in the style you are using. On Wed, Nov 15, 2017 at 11:42 AM, Kolja Petersen wrote: > No, this is on Linux. Maybe you can try the code snippet yourself to see > what I am talking about? The problem is not, that the TimerEvents are > slowed down during mouse interaction, they are dropped completely. > > How can the app be redesigned? > First, I need the standard behaviour of vtkRenderWindowInteractor to allow > rotating, zooming, panning. > Second I need to update and redraw the scene repeatedly in constant > intervals. Of course, I could trigger these events independent from VTK > using a second thread. But these events need to operate on VTK objects from > the main thread. Because VTK is not thread safe (which I have experienced > by a number of segmentation faults when modifying VTK objects from > different threads), I see absolutely no way to correctly process both 1) > timer events and 2) user interaction events that block the timer events. > Kolja > > > Virenfrei. > www.avast.com > > <#m_869865242780024731_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> > > On Wed, Nov 15, 2017 at 5:25 PM, David Cole wrote: > >> Is this on Windows? WM_TIMER events are notorious for not firing >> frequently when lots of other user events are also happening. If the mouse >> is captured, they may not fire at all. This is not something unique to VTK, >> it happens with just any Windows program. >> >> You may need to consider redesigning a bit of your app if you must have >> code being executed regularly even during user interactions. >> >> >> David >> >> On Nov 15, 2017, at 5:26 AM, Kolja Petersen >> wrote: >> >> I replaced the line "iren.AddObserver(vtk.vtkCommand.TimerEvent,observer)" >> with >> iren.AddObserver(vtk.vtkCommand.TimerEvent,observer,100000.) (also tried >> 10.0 instead of 100000.) >> >> Still no TimerEvents are reported as long as the mouse button is pressed. >> >> How are events consumed? My understanding is that AddObserver(...) adds >> just another listener, and that all listeners registered for a specific >> event are invoked one after the other. Which function would "consume" >> events in an interactor style? Is it possible to circumvent the consuming >> of events, or to re-emit the event after it has been consumed? >> Thank you >> Kolja >> >> >> On Tue, Nov 14, 2017 at 5:53 PM, Ken Martin >> wrote: >> >>> I suspect timer events are fired but something else is consuming them. >>> Probably in the interactor style. Try adding your timer events with a >>> higher priority like 10.0 (third argument). >>> >>> On Mon, Nov 13, 2017 at 3:21 PM, Kolja Petersen >> > wrote: >>> >>>> Heya, >>>> I paste some code below, which displays an empty vtkRenderWindow with >>>> an interactor. The interactor fires a TimerEvent every 100ms as printed by >>>> the Observer. >>>> The problem: as long as I press a mouse button in the vtkRenderWindow, >>>> the TimerEvents stop to be reported, although I need to process data >>>> periodically in my application as a reaction to those TimerEvents. >>>> >>>> Why are no TimerEvents fired while a button is pressed, and how can I >>>> change this behaviour? >>>> Thank you >>>> Kolja >>>> >>>> import vtk >>>> >>>> class Observer(object): >>>> def __init__(self): >>>> self.cnt=0 >>>> def __call__(self,caller,evt): >>>> self.cnt+=1 >>>> print "count %d %s" % (self.cnt,evt) >>>> >>>> ren1 = vtk.vtkRenderer() >>>> ren1.SetBackground(0.1, 0.2, 0.4) >>>> >>>> renWin = vtk.vtkRenderWindow() >>>> renWin.AddRenderer(ren1) >>>> renWin.SetSize(300, 300) >>>> >>>> iren = vtk.vtkRenderWindowInteractor() >>>> iren.SetRenderWindow(renWin) >>>> >>>> style = vtk.vtkInteractorStyleTrackballCamera() >>>> iren.SetInteractorStyle(style) >>>> >>>> iren.Initialize() >>>> observer=Observer() >>>> iren.AddObserver(vtk.vtkCommand.TimerEvent,observer) >>>> iren.AddObserver(vtk.vtkCommand.MouseMoveEvent,observer) >>>> iren.AddObserver(vtk.vtkCommand.InteractionEvent,observer) >>>> iren.CreateRepeatingTimer(100) >>>> iren.Start() >>>> >>>> >>>> Virenfrei. >>>> www.avast.com >>>> >>>> <#m_869865242780024731_m_-7045443072964375499_m_-5995428116567439952_m_5020402281578617109_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> >>>> >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ at: >>>> http://www.vtk.org/Wiki/VTK_FAQ >>>> >>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://public.kitware.com/mailman/listinfo/vtkusers >>>> >>>> >>> >>> >>> -- >>> Ken Martin PhD >>> Distinguished Engineer >>> Kitware Inc. >>> 28 Corporate Drive >>> >>> Clifton Park NY 12065 >>> >>> >>> This communication, including all attachments, contains confidential and >>> legally privileged information, and it is intended only for the use of the >>> addressee. Access to this email by anyone else is unauthorized. If you are >>> not the intended recipient, any disclosure, copying, distribution or any >>> action taken in reliance on it is prohibited and may be unlawful. If you >>> received this communication in error please notify us immediately and >>> destroy the original message. Thank you. >>> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> > -- Ken Martin PhD Distinguished Engineer Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kayarre at gmail.com Wed Nov 15 12:12:14 2017 From: kayarre at gmail.com (Kurt Sansom) Date: Wed, 15 Nov 2017 09:12:14 -0800 Subject: [vtkusers] Ensight Gold Binary Reader In-Reply-To: References: Message-ID: I contacted ensight. The ensight gold binary format does not support double precision. Bummer Town. ~Kurt On Tue, Nov 14, 2017 at 5:30 PM, Kurt Sansom wrote: > Hi, > I am exporting fluent files to the ensight gold format, but I have > determined that either the ensight Gold format only supports floats or that > the vtk reader only supports reading into float arrays (single precision). > > I could not find information about ensight gold format (I did see ensight > 6 and 5 mentioned not supporting double precision, bu no comment on ensight > gold) > > I would like to know if I can create an vtkEnSightGoldBinaryDoubleReader > that will read in double precision arrays, or if the ensight gold format > doesn't support double precision. > > Many thanks, > VTK is so awesome. (especially the python bindings) > > ~Kurt > > -- > Kurt Sansom > -- Kurt Sansom -------------- next part -------------- An HTML attachment was scrubbed... URL: From petersenkolja at gmail.com Wed Nov 15 12:28:43 2017 From: petersenkolja at gmail.com (Kolja Petersen) Date: Wed, 15 Nov 2017 18:28:43 +0100 Subject: [vtkusers] TimerEvents not fired while dragging mouse in vtkRenderWindow In-Reply-To: References: Message-ID: On Wed, Nov 15, 2017 at 5:48 PM, Ken Martin wrote: > The interactor style may be doing a grab focus (which grabs all events > until the motion is done). Try putting some printfs/breaks in the code > that generates the timerevent in vtk. Then maybe you can follow the event > and see who is consuming it etc,. > Or maybe I can't because the event forwarding is so entangled that nobody dares to look into it again. > Or try commenting out all the GrabFocus() calls in the style you are > using. > Did that. Now the interactor is dead. > > On Wed, Nov 15, 2017 at 11:42 AM, Kolja Petersen > wrote: > >> No, this is on Linux. Maybe you can try the code snippet yourself to see >> what I am talking about? The problem is not, that the TimerEvents are >> slowed down during mouse interaction, they are dropped completely. >> >> How can the app be redesigned? >> First, I need the standard behaviour of vtkRenderWindowInteractor to >> allow rotating, zooming, panning. >> Second I need to update and redraw the scene repeatedly in constant >> intervals. Of course, I could trigger these events independent from VTK >> using a second thread. But these events need to operate on VTK objects from >> the main thread. Because VTK is not thread safe (which I have experienced >> by a number of segmentation faults when modifying VTK objects from >> different threads), I see absolutely no way to correctly process both 1) >> timer events and 2) user interaction events that block the timer events. >> Kolja >> >> >> Virenfrei. >> www.avast.com >> >> <#m_-1757675277711270463_m_869865242780024731_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> >> >> On Wed, Nov 15, 2017 at 5:25 PM, David Cole wrote: >> >>> Is this on Windows? WM_TIMER events are notorious for not firing >>> frequently when lots of other user events are also happening. If the mouse >>> is captured, they may not fire at all. This is not something unique to VTK, >>> it happens with just any Windows program. >>> >>> You may need to consider redesigning a bit of your app if you must have >>> code being executed regularly even during user interactions. >>> >>> >>> David >>> >>> On Nov 15, 2017, at 5:26 AM, Kolja Petersen >>> wrote: >>> >>> I replaced the line "iren.AddObserver(vtk.vtkCommand.TimerEvent,observer)" >>> with >>> iren.AddObserver(vtk.vtkCommand.TimerEvent,observer,100000.) (also >>> tried 10.0 instead of 100000.) >>> >>> Still no TimerEvents are reported as long as the mouse button is pressed. >>> >>> How are events consumed? My understanding is that AddObserver(...) adds >>> just another listener, and that all listeners registered for a specific >>> event are invoked one after the other. Which function would "consume" >>> events in an interactor style? Is it possible to circumvent the consuming >>> of events, or to re-emit the event after it has been consumed? >>> Thank you >>> Kolja >>> >>> >>> On Tue, Nov 14, 2017 at 5:53 PM, Ken Martin >>> wrote: >>> >>>> I suspect timer events are fired but something else is consuming them. >>>> Probably in the interactor style. Try adding your timer events with a >>>> higher priority like 10.0 (third argument). >>>> >>>> On Mon, Nov 13, 2017 at 3:21 PM, Kolja Petersen < >>>> petersenkolja at gmail.com> wrote: >>>> >>>>> Heya, >>>>> I paste some code below, which displays an empty vtkRenderWindow with >>>>> an interactor. The interactor fires a TimerEvent every 100ms as printed by >>>>> the Observer. >>>>> The problem: as long as I press a mouse button in the vtkRenderWindow, >>>>> the TimerEvents stop to be reported, although I need to process data >>>>> periodically in my application as a reaction to those TimerEvents. >>>>> >>>>> Why are no TimerEvents fired while a button is pressed, and how can I >>>>> change this behaviour? >>>>> Thank you >>>>> Kolja >>>>> >>>>> import vtk >>>>> >>>>> class Observer(object): >>>>> def __init__(self): >>>>> self.cnt=0 >>>>> def __call__(self,caller,evt): >>>>> self.cnt+=1 >>>>> print "count %d %s" % (self.cnt,evt) >>>>> >>>>> ren1 = vtk.vtkRenderer() >>>>> ren1.SetBackground(0.1, 0.2, 0.4) >>>>> >>>>> renWin = vtk.vtkRenderWindow() >>>>> renWin.AddRenderer(ren1) >>>>> renWin.SetSize(300, 300) >>>>> >>>>> iren = vtk.vtkRenderWindowInteractor() >>>>> iren.SetRenderWindow(renWin) >>>>> >>>>> style = vtk.vtkInteractorStyleTrackballCamera() >>>>> iren.SetInteractorStyle(style) >>>>> >>>>> iren.Initialize() >>>>> observer=Observer() >>>>> iren.AddObserver(vtk.vtkCommand.TimerEvent,observer) >>>>> iren.AddObserver(vtk.vtkCommand.MouseMoveEvent,observer) >>>>> iren.AddObserver(vtk.vtkCommand.InteractionEvent,observer) >>>>> iren.CreateRepeatingTimer(100) >>>>> iren.Start() >>>>> >>>>> >>>>> Virenfrei. >>>>> www.avast.com >>>>> >>>>> <#m_-1757675277711270463_m_869865242780024731_m_-7045443072964375499_m_-5995428116567439952_m_5020402281578617109_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> >>>>> >>>>> _______________________________________________ >>>>> Powered by www.kitware.com >>>>> >>>>> Visit other Kitware open-source projects at >>>>> http://www.kitware.com/opensource/opensource.html >>>>> >>>>> Please keep messages on-topic and check the VTK FAQ at: >>>>> http://www.vtk.org/Wiki/VTK_FAQ >>>>> >>>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>>> >>>>> Follow this link to subscribe/unsubscribe: >>>>> http://public.kitware.com/mailman/listinfo/vtkusers >>>>> >>>>> >>>> >>>> >>>> -- >>>> Ken Martin PhD >>>> Distinguished Engineer >>>> Kitware Inc. >>>> 28 Corporate Drive >>>> >>>> Clifton Park NY 12065 >>>> >>>> >>>> This communication, including all attachments, contains confidential >>>> and legally privileged information, and it is intended only for the use of >>>> the addressee. Access to this email by anyone else is unauthorized. If you >>>> are not the intended recipient, any disclosure, copying, distribution or >>>> any action taken in reliance on it is prohibited and may be unlawful. If >>>> you received this communication in error please notify us immediately and >>>> destroy the original message. Thank you. >>>> >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/vtkusers >>> >>> >> > > > -- > Ken Martin PhD > Distinguished Engineer > Kitware Inc. > 28 Corporate Drive > > Clifton Park NY 12065 > > > This communication, including all attachments, contains confidential and > legally privileged information, and it is intended only for the use of the > addressee. Access to this email by anyone else is unauthorized. If you are > not the intended recipient, any disclosure, copying, distribution or any > action taken in reliance on it is prohibited and may be unlawful. If you > received this communication in error please notify us immediately and > destroy the original message. Thank you. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lasso at queensu.ca Wed Nov 15 12:41:16 2017 From: lasso at queensu.ca (Andras Lasso) Date: Wed, 15 Nov 2017 17:41:16 +0000 Subject: [vtkusers] vtkbioeng for vtk7.1.1 ? In-Reply-To: <1510664968533-0.post@n5.nabble.com> References: <1510664968533-0.post@n5.nabble.com> Message-ID: We have an updated version of the collision detection filter in SlicerRT: https://github.com/SlicerRt/SlicerRT/blob/master/SlicerRtCommon/vtkCollisionDetectionFilter.cxx I think it works with latest VTK version. It would be nice to add this to VTK proper. Andras -----Original Message----- From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of -Daniel- Sent: Tuesday, November 14, 2017 8:09 AM To: vtkusers at vtk.org Subject: [vtkusers] vtkbioeng for vtk7.1.1 ? Hi there, I would like to use vtkbioeng with vtk7.1.1, but apparently this is no longer supported. Only up to version 6? Or is there already a solution for that? I'm particularly interested in collision detection. Every hint is welcome! -- Sent from: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fvtk.1045678.n5.nabble.com%2FVTK-Users-f1224199.html&data=02%7C01%7Classo%40queensu.ca%7C236dd355b0364885c10b08d52b60f5f9%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636462617850615573&sdata=cbkmSqON%2B4b2w2ke7fUqQr1oOGb0BqUoZSaXVTWq6J8%3D&reserved=0 _______________________________________________ Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7C236dd355b0364885c10b08d52b60f5f9%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636462617850615573&sdata=aaSMp38DAlyPxH1XE8TIrseBOW1dL2ZFoN3bEIY7OfE%3D&reserved=0 Visit other Kitware open-source projects at https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40queensu.ca%7C236dd355b0364885c10b08d52b60f5f9%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636462617850615573&sdata=Zbd9PwGOWtOzKP49O3%2B%2FBQ0yPjYjUP1trQcxymkVO7s%3D&reserved=0 Please keep messages on-topic and check the VTK FAQ at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Classo%40queensu.ca%7C236dd355b0364885c10b08d52b60f5f9%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636462617850615573&sdata=j7GNn0axhvIUDOhPZ%2Foa2sQjeFpozBfHfdY2Q7HaT%2B8%3D&reserved=0 Search the list archives at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Classo%40queensu.ca%7C236dd355b0364885c10b08d52b60f5f9%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636462617850615573&sdata=rIeIfeGvrvMO64xEhO8wdCnbgX6LGSvV93ylfg683Aw%3D&reserved=0 Follow this link to subscribe/unsubscribe: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%7C236dd355b0364885c10b08d52b60f5f9%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636462617850615573&sdata=ZYBgHxWbYjrgEayWVkOsqiUTKIoLGqTO6sgMuzrWE0o%3D&reserved=0 From jlewis at accuray.com Wed Nov 15 13:24:05 2017 From: jlewis at accuray.com (Jeffery Lewis) Date: Wed, 15 Nov 2017 18:24:05 +0000 Subject: [vtkusers] using vtkImageBlend to combine two gray image (???) Message-ID: If you are using the default normal blend mode, then setting the opacity on the 0 index input will do nothing. To see both images, you just need to set the second input to its desired opacity, the 0 index input will get the remaining. I would consider using vtkImageBlend::SetInputConnection() (the overload that does not have a port parameter) for the first input, and then calling AddInputConnection() for the second input. This will assure older inputs are cleared out. Your first code sample seems like it is working. Not sure though why the first image is not in the right position. That could be something not caused by vtkImageBlend. Your second code sample though would expect the first image to not show up because the call to SetOpacity(1, 1) would visualize the opacity of the first image to 0. If you have more than two images to blend, I would recommend using the blend mode compound. When using the blend mode compound, setting the opacity to the first input does do something. To get what you would typically expect, your opacities for all the inputs should add up to 1. -----Original Message----- From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of vtkusers-request at vtk.org Sent: Wednesday, November 15, 2017 9:00 AM To: vtkusers at vtk.org Subject: vtkusers Digest, Vol 163, Issue 18 Send vtkusers mailing list submissions to vtkusers at vtk.org To subscribe or unsubscribe via the World Wide Web, visit http://public.kitware.com/mailman/listinfo/vtkusers or, via email, send a message with subject or body 'help' to vtkusers-request at vtk.org You can reach the person managing the list at vtkusers-owner at vtk.org When replying, please edit your Subject line so it is more specific than "Re: Contents of vtkusers digest..." Today's Topics: 1. Re: vtk and gtk on macOS (Langer, Stephen A. (Fed)) 2. Re: vtk and gtk on macOS (Langer, Stephen A. (Fed)) 3. Ensight Gold Binary Reader (Kurt Sansom) 4. vtkDICOMImageReader will reverse usingImagePositionPatient ? (louiskoo) 5. Re: TimerEvents not fired while dragging mouse in vtkRenderWindow (Kolja Petersen) 6. using vtkImageBlend to combine two gray image (???) 7. How to use unsigned char to represent cell types? (landings) 8. Re: TimerEvents not fired while dragging mouse in vtkRenderWindow (David Cole) 9. Re: TimerEvents not fired while dragging mouse in vtkRenderWindow (Kolja Petersen) 10. Re: TimerEvents not fired while dragging mouse in vtkRenderWindow (Ken Martin) ---------------------------------------------------------------------- Message: 1 Date: Tue, 14 Nov 2017 19:05:44 +0000 From: "Langer, Stephen A. (Fed)" To: "vtkusers at vtk.org" Subject: Re: [vtkusers] vtk and gtk on macOS Message-ID: <3CDBE37E-520E-46EB-BA69-30F177FC71EF at nist.gov> Content-Type: text/plain; charset="utf-8" Just in case someone else is trying to do the same thing and finds this message, the configure callback below is incorrect because gtk and vtk have different ideas about which direction is up. The call to render_window->SetPosition should be GtkWidget *top = gtk_widget_get_toplevel(drawing_area) render_window->SetPosition(top->allocation.height- event->y - event->height); event->y and drawing_area->allocation.y are interchangeable. -- Steve From: vtkusers on behalf of "Langer, Stephen A. (Fed)" Date: Friday, November 3, 2017 at 10:11 AM To: David Gobbi Cc: "vtkusers at vtk.org" Subject: Re: [vtkusers] vtk and gtk on macOS HI David -- Thanks for the suggestions, which got me started on the right track. What seems to work is this (somewhat simplified to eliminate some infrastructure): // Create gtk widget and vtk window GtkWidget *drawing_area = gtk_drawing_area_new(); vtkSmartPointer render_window = vtkSmartPointer::New(); // Connect to gtk signals. g_signal_connect(drawing_area, "realize", realize_callback, ..) g_signal_connect(drawing_area, "configure_event", configure_callback, ?) // in realize_callback gtk_widget_realize(drawing_area); render_window->SetRootWindow(gtk_widget_get_root_window(drawing_area)); GdkWindow gparent = gtk_widget_get_parent_window(drawing_area); NSView *pid = gdk_quartz_window_get_nsview(gparent); render_window->SetParentId((void*) pid); // in configure_callback // event is a GdkEventConfigure* that's passed in as an argument // Unlike David's QWidget example, I do not use the superclass versions of SetSize and SetPosition render_window->SetSize(event->width, event->height); render_window->SetPosition(drawing_area->allocation.x, drawing_area->allocation.y); I also added an expose event callback which just called render_window->Render(), but it doesn't seem to be necessary. -- Steve From: David Gobbi Date: Tuesday, October 24, 2017 at 2:56 PM To: "Langer, Stephen A. (Fed)" Cc: "vtkusers at vtk.org" Subject: Re: [vtkusers] vtk and gtk on macOS Hi Steve, Here is some code that I use to bind a VTK window to a QWidget. My guess is that something similar should work with GTK. I have been using this on OS X with vtkCocoaRenderWindow. void BindRenderWindow(vtkRenderWindow *window, QWidget *widget) { // Unmap the window if it is already mapped somewhere else. if (window->GetMapped()) { window->Finalize(); } // Create the connection window->SetWindowId(reinterpret_cast(widget->winId())); // Note that we must call the superclass SetSize()/SetPosition() // (we just want to set the member variables, with no side-effects) window->vtkRenderWindow::SetSize(widget->width(), widget->height()); window->vtkRenderWindow::SetPosition(widget->x(), widget->y()); // Prepare for rendering if (widget->isVisible()) { window->Start(); } // Call SetSize() again, to synchronize the window to the widget window->SetSize(widget->width(), widget->height()); } Some further notes: 1) I disable Qt's paint engine, so that Qt itself doesn't draw in the window. GTK may be similar. 2) You probably will not need GtkGLExt (for Qt, I didn't have to use QGLWidget). - David On Tue, Oct 24, 2017 at 12:12 PM, Langer, Stephen A. (Fed) > wrote: Hi -- Is there a simple way to get vtk to work inside a gtk+2 program on macOS? If there isn't a simple way, is there a difficult one? I'm trying to get a program that uses gtk+2 and vtk to work with a modern version of vtk -- I'm upgrading from 5.10.1 to 7.1.1 or 8.0.1. On Linux, the following code creates a vtk render window and a gtk widget containing it: vtkRenderWindow *render_win = vtkRenderWindow::New(); GtkWidget *drawing_area = gtk_drawing_area_new(); Display *disp = GDK_DISPLAY(); render_win->SetDisplayId(disp); followed eventually by XID wid = GDK_WINDOW_XID(drawing_area->window); render_win->SetWindowId(wid); after receiving the gtk "realize" signal on the drawing_area. On macOS, I'd like to use the Cocoa version of gtk+2 and vtkCocoaRenderWindow, but I can't figure out how to embed the render window into a gtk widget. All the examples I've found on-line aren't really applicable. GtkGLExt might be applicable, but it doesn't look like it's being maintained. An alternative would be to use X11, but native Mac OpenGL doesn't understand X11, so I tried installing mesa from macports , rebuilding vtk with VTK_USE_X instead of VTK_USE_COCOA, and linking to /opt/local/lib instead of /System/Library/Frameworks/OpenGL.framework. Then I can use the same code as on Linux, but vtk complains about the context not supporting OpenGL 3.2, and then crashes: ERROR: In /Users/langer/UTIL/VTK/VTK-7.1.1/Rendering/OpenGL2/vtkTextureObject.cxx, line 440 vtkTextureObject (0x7f9eafdb1690): failed at glGenTextures 1 OpenGL errors detected 0 : (1280) Invalid enum Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 2 Date: Tue, 14 Nov 2017 19:59:19 +0000 From: "Langer, Stephen A. (Fed)" To: "vtkusers at vtk.org" Subject: Re: [vtkusers] vtk and gtk on macOS Message-ID: Content-Type: text/plain; charset="utf-8" Responding to my own message again? Is it possible that the vtk or gtk+2 coordinate systems are different on different platforms? On a Mac, using vtk 7.1.1 and Cocoa, the configure callback for the vtk render window inside a gtk widget looks like this: gboolean OOFCanvas3D::configure(GdkEventConfigure *event) { render_window->SetSize(event->width, event->height); GtkWidget *topwindow = gtk_widget_get_toplevel(drawing_area); assert(topwindow != nullptr); int top_height = topwindow->allocation.height; render_window->SetPosition(event->x, top_height - event->y - event->height); return true; } but that doesn't work on Linux (Ubuntu inside VirtualBox, using vtk 7.1.1 and X11), where it has to be this: gboolean OOFCanvas3D::configure(GdkEventConfigure *event) { render_window->SetSize(event->width, event->height); render_window->SetPosition(event->x, event->y); return true; } Both of these do what they should do (on their respective platforms) when the space allocated for the vtk render window is changed. But it looks like on the Mac the position of the vtk widget is measured from the bottom of the enclosing window while on Linux it's measured from the top! Can this be true? What am I missing? Thanks. -- Steve From: vtkusers on behalf of "Langer, Stephen A. (Fed)" Date: Tuesday, November 14, 2017 at 2:06 PM To: "vtkusers at vtk.org" Subject: Re: [vtkusers] vtk and gtk on macOS Just in case someone else is trying to do the same thing and finds this message, the configure callback below is incorrect because gtk and vtk have different ideas about which direction is up. The call to render_window->SetPosition should be GtkWidget *top = gtk_widget_get_toplevel(drawing_area) render_window->SetPosition(top->allocation.height- event->y - event->height); event->y and drawing_area->allocation.y are interchangeable. -- Steve From: vtkusers on behalf of "Langer, Stephen A. (Fed)" Date: Friday, November 3, 2017 at 10:11 AM To: David Gobbi Cc: "vtkusers at vtk.org" Subject: Re: [vtkusers] vtk and gtk on macOS HI David -- Thanks for the suggestions, which got me started on the right track. What seems to work is this (somewhat simplified to eliminate some infrastructure): // Create gtk widget and vtk window GtkWidget *drawing_area = gtk_drawing_area_new(); vtkSmartPointer render_window = vtkSmartPointer::New(); // Connect to gtk signals. g_signal_connect(drawing_area, "realize", realize_callback, ..) g_signal_connect(drawing_area, "configure_event", configure_callback, ?) // in realize_callback gtk_widget_realize(drawing_area); render_window->SetRootWindow(gtk_widget_get_root_window(drawing_area)); GdkWindow gparent = gtk_widget_get_parent_window(drawing_area); NSView *pid = gdk_quartz_window_get_nsview(gparent); render_window->SetParentId((void*) pid); // in configure_callback // event is a GdkEventConfigure* that's passed in as an argument // Unlike David's QWidget example, I do not use the superclass versions of SetSize and SetPosition render_window->SetSize(event->width, event->height); render_window->SetPosition(drawing_area->allocation.x, drawing_area->allocation.y); I also added an expose event callback which just called render_window->Render(), but it doesn't seem to be necessary. -- Steve From: David Gobbi Date: Tuesday, October 24, 2017 at 2:56 PM To: "Langer, Stephen A. (Fed)" Cc: "vtkusers at vtk.org" Subject: Re: [vtkusers] vtk and gtk on macOS Hi Steve, Here is some code that I use to bind a VTK window to a QWidget. My guess is that something similar should work with GTK. I have been using this on OS X with vtkCocoaRenderWindow. void BindRenderWindow(vtkRenderWindow *window, QWidget *widget) { // Unmap the window if it is already mapped somewhere else. if (window->GetMapped()) { window->Finalize(); } // Create the connection window->SetWindowId(reinterpret_cast(widget->winId())); // Note that we must call the superclass SetSize()/SetPosition() // (we just want to set the member variables, with no side-effects) window->vtkRenderWindow::SetSize(widget->width(), widget->height()); window->vtkRenderWindow::SetPosition(widget->x(), widget->y()); // Prepare for rendering if (widget->isVisible()) { window->Start(); } // Call SetSize() again, to synchronize the window to the widget window->SetSize(widget->width(), widget->height()); } Some further notes: 1) I disable Qt's paint engine, so that Qt itself doesn't draw in the window. GTK may be similar. 2) You probably will not need GtkGLExt (for Qt, I didn't have to use QGLWidget). - David On Tue, Oct 24, 2017 at 12:12 PM, Langer, Stephen A. (Fed) > wrote: Hi -- Is there a simple way to get vtk to work inside a gtk+2 program on macOS? If there isn't a simple way, is there a difficult one? I'm trying to get a program that uses gtk+2 and vtk to work with a modern version of vtk -- I'm upgrading from 5.10.1 to 7.1.1 or 8.0.1. On Linux, the following code creates a vtk render window and a gtk widget containing it: vtkRenderWindow *render_win = vtkRenderWindow::New(); GtkWidget *drawing_area = gtk_drawing_area_new(); Display *disp = GDK_DISPLAY(); render_win->SetDisplayId(disp); followed eventually by XID wid = GDK_WINDOW_XID(drawing_area->window); render_win->SetWindowId(wid); after receiving the gtk "realize" signal on the drawing_area. On macOS, I'd like to use the Cocoa version of gtk+2 and vtkCocoaRenderWindow, but I can't figure out how to embed the render window into a gtk widget. All the examples I've found on-line aren't really applicable. GtkGLExt might be applicable, but it doesn't look like it's being maintained. An alternative would be to use X11, but native Mac OpenGL doesn't understand X11, so I tried installing mesa from macports , rebuilding vtk with VTK_USE_X instead of VTK_USE_COCOA, and linking to /opt/local/lib instead of /System/Library/Frameworks/OpenGL.framework. Then I can use the same code as on Linux, but vtk complains about the context not supporting OpenGL 3.2, and then crashes: ERROR: In /Users/langer/UTIL/VTK/VTK-7.1.1/Rendering/OpenGL2/vtkTextureObject.cxx, line 440 vtkTextureObject (0x7f9eafdb1690): failed at glGenTextures 1 OpenGL errors detected 0 : (1280) Invalid enum Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 3 Date: Tue, 14 Nov 2017 17:30:57 -0800 From: Kurt Sansom To: vtk Subject: [vtkusers] Ensight Gold Binary Reader Message-ID: Content-Type: text/plain; charset="utf-8" Hi, I am exporting fluent files to the ensight gold format, but I have determined that either the ensight Gold format only supports floats or that the vtk reader only supports reading into float arrays (single precision). I could not find information about ensight gold format (I did see ensight 6 and 5 mentioned not supporting double precision, bu no comment on ensight gold) I would like to know if I can create an vtkEnSightGoldBinaryDoubleReader that will read in double precision arrays, or if the ensight gold format doesn't support double precision. Many thanks, VTK is so awesome. (especially the python bindings) ~Kurt -- Kurt Sansom -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 4 Date: Tue, 14 Nov 2017 23:58:50 -0700 (MST) From: louiskoo <419655660 at qq.com> To: vtkusers at vtk.org Subject: [vtkusers] vtkDICOMImageReader will reverse using ImagePositionPatient ? Message-ID: <1510729130030-0.post at n5.nabble.com> Content-Type: text/plain; charset=us-ascii vtkDICOMImageReader dicom_reader = vtkDICOMImageReader.New(); dicom_reader.SetDirectoryName(dicom_folder); dicom_reader.Update(); -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html ------------------------------ Message: 5 Date: Wed, 15 Nov 2017 11:26:11 +0100 From: Kolja Petersen To: Ken Martin Cc: vtk Subject: Re: [vtkusers] TimerEvents not fired while dragging mouse in vtkRenderWindow Message-ID: Content-Type: text/plain; charset="utf-8" I replaced the line "iren.AddObserver(vtk.vtkCommand.TimerEvent,observer)" with iren.AddObserver(vtk.vtkCommand.TimerEvent,observer,100000.) (also tried 10.0 instead of 100000.) Still no TimerEvents are reported as long as the mouse button is pressed. How are events consumed? My understanding is that AddObserver(...) adds just another listener, and that all listeners registered for a specific event are invoked one after the other. Which function would "consume" events in an interactor style? Is it possible to circumvent the consuming of events, or to re-emit the event after it has been consumed? Thank you Kolja On Tue, Nov 14, 2017 at 5:53 PM, Ken Martin wrote: > I suspect timer events are fired but something else is consuming them. > Probably in the interactor style. Try adding your timer events with a > higher priority like 10.0 (third argument). > > On Mon, Nov 13, 2017 at 3:21 PM, Kolja Petersen > > wrote: > >> Heya, >> I paste some code below, which displays an empty vtkRenderWindow with >> an interactor. The interactor fires a TimerEvent every 100ms as >> printed by the Observer. >> The problem: as long as I press a mouse button in the >> vtkRenderWindow, the TimerEvents stop to be reported, although I need >> to process data periodically in my application as a reaction to those TimerEvents. >> >> Why are no TimerEvents fired while a button is pressed, and how can I >> change this behaviour? >> Thank you >> Kolja >> >> import vtk >> >> class Observer(object): >> def __init__(self): >> self.cnt=0 >> def __call__(self,caller,evt): >> self.cnt+=1 >> print "count %d %s" % (self.cnt,evt) >> >> ren1 = vtk.vtkRenderer() >> ren1.SetBackground(0.1, 0.2, 0.4) >> >> renWin = vtk.vtkRenderWindow() >> renWin.AddRenderer(ren1) >> renWin.SetSize(300, 300) >> >> iren = vtk.vtkRenderWindowInteractor() >> iren.SetRenderWindow(renWin) >> >> style = vtk.vtkInteractorStyleTrackballCamera() >> iren.SetInteractorStyle(style) >> >> iren.Initialize() >> observer=Observer() >> iren.AddObserver(vtk.vtkCommand.TimerEvent,observer) >> iren.AddObserver(vtk.vtkCommand.MouseMoveEvent,observer) >> iren.AddObserver(vtk.vtkCommand.InteractionEvent,observer) >> iren.CreateRepeatingTimer(100) >> iren.Start() >> >> >> Virenfrei. >> www.avast.com >> > _campaign=sig-email&utm_content=webmail> >> <#m_-5995428116567439952_m_5020402281578617109_DAB4FAD8-2DD7-40BB-A1B >> 8-4E2AA1F9FDF2> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> > > > -- > Ken Martin PhD > Distinguished Engineer > Kitware Inc. > 28 Corporate Drive > ntry=gmail&source=g> > Clifton Park NY 12065 > ntry=gmail&source=g> > > This communication, including all attachments, contains confidential > and legally privileged information, and it is intended only for the > use of the addressee. Access to this email by anyone else is > unauthorized. If you are not the intended recipient, any disclosure, > copying, distribution or any action taken in reliance on it is > prohibited and may be unlawful. If you received this communication in > error please notify us immediately and destroy the original message. Thank you. > -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 6 Date: Wed, 15 Nov 2017 19:17:11 +0800 (CST) From: ??? To: vtkusers at vtk.org Subject: [vtkusers] using vtkImageBlend to combine two gray image Message-ID: <928007308.11523911.1510744631970.JavaMail.zimbra at sjtu.edu.cn> Content-Type: text/plain; charset=utf-8 Hi All: ? I have two gray images (vtkimagedata version),? they have the same size. I want to combine them together using vtkimageblend. 1st? the following are some codes: ?vtkSmartPointer imgBlender = vtkSmartPointer::New(); ?imgBlender->SetOpacity( 0, 0.5); ?imgBlender->SetOpacity( 1, 0.5); ?imgBlender->AddInput(AP); ?imgBlender->AddInput( APdrr ); It seems that the result is wrong! the second is in the window, while the first seems not in the proper position, only part of it. 2nd?Then I adjust the opacity? vtkSmartPointer imgBlender = vtkSmartPointer::New(); ?imgBlender->SetOpacity( 0, 1); ?imgBlender->SetOpacity( 1, 1); ?imgBlender->AddInput(AP); ?imgBlender->AddInput( APdrr ); then the result only shows the second image, there is not the first image! can someone give me some suggestions, thanks in advance! ------------------------------ Message: 7 Date: Wed, 15 Nov 2017 06:49:42 -0700 (MST) From: landings To: vtkusers at vtk.org Subject: [vtkusers] How to use unsigned char to represent cell types? Message-ID: <1510753782836-0.post at n5.nabble.com> Content-Type: text/plain; charset=us-ascii I am using vtkUnstructuredGrid::SetCells() and I don't know what to fill into the cellTypes array. By the way, do parameters *types and *cellTypes contain similar values? ------------------------------------- void vtkUnstructuredGrid::SetCells ( int type, vtkCellArray * cells ) void vtkUnstructuredGrid::SetCells ( int * types, vtkCellArray * cells ) void vtkUnstructuredGrid::SetCells ( vtkUnsignedCharArray * cellTypes, vtkIdTypeArray * cellLocations, vtkCellArray * cells ) void vtkUnstructuredGrid::SetCells ( vtkUnsignedCharArray * cellTypes, vtkIdTypeArray * cellLocations, vtkCellArray * cells, vtkIdTypeArray * faceLocations, vtkIdTypeArray * faces ) Description: ------------------------------------- Most cells require just arrays of cellTypes, cellLocations and cellConnectivities which implicitly define the set of points in each cell and their ordering. In those cases the cellConnectivities are of the format (numFace0Pts, id1, id2, id3, numFace1Pts, id1, id2, id3...). However, some cells like vtkPolyhedron require points plus a list of faces. To handle vtkPolyhedron, SetCells() support a special input cellConnectivities format (numCellFaces, numFace0Pts, id1, id2, id3, numFace1Pts,id1, id2, id3, ...) The functions use vtkPolyhedron::DecomposeAPolyhedronCell() to convert polyhedron cells into standard format. ------------------------------------- -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html ------------------------------ Message: 8 Date: Wed, 15 Nov 2017 11:25:07 -0500 From: David Cole To: Kolja Petersen Cc: vtk Subject: Re: [vtkusers] TimerEvents not fired while dragging mouse in vtkRenderWindow Message-ID: Content-Type: text/plain; charset="us-ascii" Is this on Windows? WM_TIMER events are notorious for not firing frequently when lots of other user events are also happening. If the mouse is captured, they may not fire at all. This is not something unique to VTK, it happens with just any Windows program. You may need to consider redesigning a bit of your app if you must have code being executed regularly even during user interactions. David > On Nov 15, 2017, at 5:26 AM, Kolja Petersen wrote: > > I replaced the line > "iren.AddObserver(vtk.vtkCommand.TimerEvent,observer)" with > iren.AddObserver(vtk.vtkCommand.TimerEvent,observer,100000.) (also > tried 10.0 instead of 100000.) > > Still no TimerEvents are reported as long as the mouse button is pressed. > > How are events consumed? My understanding is that AddObserver(...) adds just another listener, and that all listeners registered for a specific event are invoked one after the other. Which function would "consume" events in an interactor style? Is it possible to circumvent the consuming of events, or to re-emit the event after it has been consumed? > Thank you > Kolja > > >> On Tue, Nov 14, 2017 at 5:53 PM, Ken Martin wrote: >> I suspect timer events are fired but something else is consuming them. Probably in the interactor style. Try adding your timer events with a higher priority like 10.0 (third argument). >> >>> On Mon, Nov 13, 2017 at 3:21 PM, Kolja Petersen wrote: >>> Heya, >>> I paste some code below, which displays an empty vtkRenderWindow with an interactor. The interactor fires a TimerEvent every 100ms as printed by the Observer. >>> The problem: as long as I press a mouse button in the vtkRenderWindow, the TimerEvents stop to be reported, although I need to process data periodically in my application as a reaction to those TimerEvents. >>> >>> Why are no TimerEvents fired while a button is pressed, and how can I change this behaviour? >>> Thank you >>> Kolja >>> >>> import vtk >>> >>> class Observer(object): >>> def __init__(self): >>> self.cnt=0 >>> def __call__(self,caller,evt): >>> self.cnt+=1 >>> print "count %d %s" % (self.cnt,evt) >>> >>> ren1 = vtk.vtkRenderer() >>> ren1.SetBackground(0.1, 0.2, 0.4) >>> >>> renWin = vtk.vtkRenderWindow() >>> renWin.AddRenderer(ren1) >>> renWin.SetSize(300, 300) >>> >>> iren = vtk.vtkRenderWindowInteractor() >>> iren.SetRenderWindow(renWin) >>> >>> style = vtk.vtkInteractorStyleTrackballCamera() >>> iren.SetInteractorStyle(style) >>> >>> iren.Initialize() >>> observer=Observer() >>> iren.AddObserver(vtk.vtkCommand.TimerEvent,observer) >>> iren.AddObserver(vtk.vtkCommand.MouseMoveEvent,observer) >>> iren.AddObserver(vtk.vtkCommand.InteractionEvent,observer) >>> iren.CreateRepeatingTimer(100) >>> iren.Start() >>> >>> Virenfrei. www.avast.com >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/vtkusers >>> >> >> >> >> -- >> Ken Martin PhD >> Distinguished Engineer >> Kitware Inc. >> 28 Corporate Drive >> Clifton Park NY 12065 >> >> This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 9 Date: Wed, 15 Nov 2017 17:42:55 +0100 From: Kolja Petersen To: David Cole Cc: vtk Subject: Re: [vtkusers] TimerEvents not fired while dragging mouse in vtkRenderWindow Message-ID: Content-Type: text/plain; charset="utf-8" No, this is on Linux. Maybe you can try the code snippet yourself to see what I am talking about? The problem is not, that the TimerEvents are slowed down during mouse interaction, they are dropped completely. How can the app be redesigned? First, I need the standard behaviour of vtkRenderWindowInteractor to allow rotating, zooming, panning. Second I need to update and redraw the scene repeatedly in constant intervals. Of course, I could trigger these events independent from VTK using a second thread. But these events need to operate on VTK objects from the main thread. Because VTK is not thread safe (which I have experienced by a number of segmentation faults when modifying VTK objects from different threads), I see absolutely no way to correctly process both 1) timer events and 2) user interaction events that block the timer events. Kolja Virenfrei. www.avast.com <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> On Wed, Nov 15, 2017 at 5:25 PM, David Cole wrote: > Is this on Windows? WM_TIMER events are notorious for not firing > frequently when lots of other user events are also happening. If the > mouse is captured, they may not fire at all. This is not something > unique to VTK, it happens with just any Windows program. > > You may need to consider redesigning a bit of your app if you must > have code being executed regularly even during user interactions. > > > David > > On Nov 15, 2017, at 5:26 AM, Kolja Petersen > wrote: > > I replaced the line "iren.AddObserver(vtk.vtkCommand.TimerEvent,observer)" > with > iren.AddObserver(vtk.vtkCommand.TimerEvent,observer,100000.) (also > tried > 10.0 instead of 100000.) > > Still no TimerEvents are reported as long as the mouse button is pressed. > > How are events consumed? My understanding is that AddObserver(...) > adds just another listener, and that all listeners registered for a > specific event are invoked one after the other. Which function would "consume" > events in an interactor style? Is it possible to circumvent the > consuming of events, or to re-emit the event after it has been consumed? > Thank you > Kolja > > > On Tue, Nov 14, 2017 at 5:53 PM, Ken Martin > wrote: > >> I suspect timer events are fired but something else is consuming them. >> Probably in the interactor style. Try adding your timer events with a >> higher priority like 10.0 (third argument). >> >> On Mon, Nov 13, 2017 at 3:21 PM, Kolja Petersen >> >> wrote: >> >>> Heya, >>> I paste some code below, which displays an empty vtkRenderWindow >>> with an interactor. The interactor fires a TimerEvent every 100ms as >>> printed by the Observer. >>> The problem: as long as I press a mouse button in the >>> vtkRenderWindow, the TimerEvents stop to be reported, although I >>> need to process data periodically in my application as a reaction to those TimerEvents. >>> >>> Why are no TimerEvents fired while a button is pressed, and how can >>> I change this behaviour? >>> Thank you >>> Kolja >>> >>> import vtk >>> >>> class Observer(object): >>> def __init__(self): >>> self.cnt=0 >>> def __call__(self,caller,evt): >>> self.cnt+=1 >>> print "count %d %s" % (self.cnt,evt) >>> >>> ren1 = vtk.vtkRenderer() >>> ren1.SetBackground(0.1, 0.2, 0.4) >>> >>> renWin = vtk.vtkRenderWindow() >>> renWin.AddRenderer(ren1) >>> renWin.SetSize(300, 300) >>> >>> iren = vtk.vtkRenderWindowInteractor() >>> iren.SetRenderWindow(renWin) >>> >>> style = vtk.vtkInteractorStyleTrackballCamera() >>> iren.SetInteractorStyle(style) >>> >>> iren.Initialize() >>> observer=Observer() >>> iren.AddObserver(vtk.vtkCommand.TimerEvent,observer) >>> iren.AddObserver(vtk.vtkCommand.MouseMoveEvent,observer) >>> iren.AddObserver(vtk.vtkCommand.InteractionEvent,observer) >>> iren.CreateRepeatingTimer(100) >>> iren.Start() >>> >>> >>> Virenfrei. >>> www.avast.com >>> >> m_campaign=sig-email&utm_content=webmail> >>> <#m_-7045443072964375499_m_-5995428116567439952_m_502040228157861710 >>> 9_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/vtkusers >>> >>> >> >> >> -- >> Ken Martin PhD >> Distinguished Engineer >> Kitware Inc. >> 28 Corporate Drive >> > entry=gmail&source=g> >> Clifton Park NY 12065 >> > entry=gmail&source=g> >> >> This communication, including all attachments, contains confidential >> and legally privileged information, and it is intended only for the >> use of the addressee. Access to this email by anyone else is >> unauthorized. If you are not the intended recipient, any disclosure, >> copying, distribution or any action taken in reliance on it is >> prohibited and may be unlawful. If you received this communication in >> error please notify us immediately and destroy the original message. Thank you. >> > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 10 Date: Wed, 15 Nov 2017 11:48:24 -0500 From: Ken Martin To: Kolja Petersen Cc: vtk Subject: Re: [vtkusers] TimerEvents not fired while dragging mouse in vtkRenderWindow Message-ID: Content-Type: text/plain; charset="utf-8" The interactor style may be doing a grab focus (which grabs all events until the motion is done). Try putting some printfs/breaks in the code that generates the timerevent in vtk. Then maybe you can follow the event and see who is consuming it etc,. Or try commenting out all the GrabFocus() calls in the style you are using. On Wed, Nov 15, 2017 at 11:42 AM, Kolja Petersen wrote: > No, this is on Linux. Maybe you can try the code snippet yourself to > see what I am talking about? The problem is not, that the TimerEvents > are slowed down during mouse interaction, they are dropped completely. > > How can the app be redesigned? > First, I need the standard behaviour of vtkRenderWindowInteractor to > allow rotating, zooming, panning. > Second I need to update and redraw the scene repeatedly in constant > intervals. Of course, I could trigger these events independent from > VTK using a second thread. But these events need to operate on VTK > objects from the main thread. Because VTK is not thread safe (which I > have experienced by a number of segmentation faults when modifying VTK > objects from different threads), I see absolutely no way to correctly > process both 1) timer events and 2) user interaction events that block the timer events. > Kolja > > > Virenfrei. > www.avast.com > campaign=sig-email&utm_content=webmail> > <#m_869865242780024731_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> > > On Wed, Nov 15, 2017 at 5:25 PM, David Cole wrote: > >> Is this on Windows? WM_TIMER events are notorious for not firing >> frequently when lots of other user events are also happening. If the >> mouse is captured, they may not fire at all. This is not something >> unique to VTK, it happens with just any Windows program. >> >> You may need to consider redesigning a bit of your app if you must >> have code being executed regularly even during user interactions. >> >> >> David >> >> On Nov 15, 2017, at 5:26 AM, Kolja Petersen >> wrote: >> >> I replaced the line "iren.AddObserver(vtk.vtkCommand.TimerEvent,observer)" >> with >> iren.AddObserver(vtk.vtkCommand.TimerEvent,observer,100000.) (also >> tried >> 10.0 instead of 100000.) >> >> Still no TimerEvents are reported as long as the mouse button is pressed. >> >> How are events consumed? My understanding is that AddObserver(...) >> adds just another listener, and that all listeners registered for a >> specific event are invoked one after the other. Which function would "consume" >> events in an interactor style? Is it possible to circumvent the >> consuming of events, or to re-emit the event after it has been consumed? >> Thank you >> Kolja >> >> >> On Tue, Nov 14, 2017 at 5:53 PM, Ken Martin >> wrote: >> >>> I suspect timer events are fired but something else is consuming them. >>> Probably in the interactor style. Try adding your timer events with >>> a higher priority like 10.0 (third argument). >>> >>> On Mon, Nov 13, 2017 at 3:21 PM, Kolja Petersen >>> >> > wrote: >>> >>>> Heya, >>>> I paste some code below, which displays an empty vtkRenderWindow >>>> with an interactor. The interactor fires a TimerEvent every 100ms >>>> as printed by the Observer. >>>> The problem: as long as I press a mouse button in the >>>> vtkRenderWindow, the TimerEvents stop to be reported, although I >>>> need to process data periodically in my application as a reaction to those TimerEvents. >>>> >>>> Why are no TimerEvents fired while a button is pressed, and how can >>>> I change this behaviour? >>>> Thank you >>>> Kolja >>>> >>>> import vtk >>>> >>>> class Observer(object): >>>> def __init__(self): >>>> self.cnt=0 >>>> def __call__(self,caller,evt): >>>> self.cnt+=1 >>>> print "count %d %s" % (self.cnt,evt) >>>> >>>> ren1 = vtk.vtkRenderer() >>>> ren1.SetBackground(0.1, 0.2, 0.4) >>>> >>>> renWin = vtk.vtkRenderWindow() >>>> renWin.AddRenderer(ren1) >>>> renWin.SetSize(300, 300) >>>> >>>> iren = vtk.vtkRenderWindowInteractor() >>>> iren.SetRenderWindow(renWin) >>>> >>>> style = vtk.vtkInteractorStyleTrackballCamera() >>>> iren.SetInteractorStyle(style) >>>> >>>> iren.Initialize() >>>> observer=Observer() >>>> iren.AddObserver(vtk.vtkCommand.TimerEvent,observer) >>>> iren.AddObserver(vtk.vtkCommand.MouseMoveEvent,observer) >>>> iren.AddObserver(vtk.vtkCommand.InteractionEvent,observer) >>>> iren.CreateRepeatingTimer(100) >>>> iren.Start() >>>> >>>> >>>> Virenfrei. >>>> www.avast.com >>>> >>> tm_campaign=sig-email&utm_content=webmail> >>>> <#m_869865242780024731_m_-7045443072964375499_m_-599542811656743995 >>>> 2_m_5020402281578617109_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> >>>> >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ at: >>>> http://www.vtk.org/Wiki/VTK_FAQ >>>> >>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://public.kitware.com/mailman/listinfo/vtkusers >>>> >>>> >>> >>> >>> -- >>> Ken Martin PhD >>> Distinguished Engineer >>> Kitware Inc. >>> 28 Corporate Drive >>> >> &entry=gmail&source=g> >>> Clifton Park NY 12065 >>> >> &entry=gmail&source=g> >>> >>> This communication, including all attachments, contains confidential >>> and legally privileged information, and it is intended only for the >>> use of the addressee. Access to this email by anyone else is >>> unauthorized. If you are not the intended recipient, any disclosure, >>> copying, distribution or any action taken in reliance on it is >>> prohibited and may be unlawful. If you received this communication >>> in error please notify us immediately and destroy the original message. Thank you. >>> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> > -- Ken Martin PhD Distinguished Engineer Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Subject: Digest Footer _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers ------------------------------ End of vtkusers Digest, Vol 163, Issue 18 ***************************************** -- WARNING - CONFIDENTIAL INFORMATION: The information contained in the e-mail may contain confidential and privileged information and is intended solely for the use of the intended recipient(s). Access for any review, re-transmission, dissemination or other use of, or taking of any action in regard and reliance upon this e-mail by persons or entities other than the intended recipient(s) is unauthorized and prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message and any attachments. From goodwin.lawlor.lists at gmail.com Wed Nov 15 15:58:10 2017 From: goodwin.lawlor.lists at gmail.com (Goodwin Lawlor) Date: Wed, 15 Nov 2017 20:58:10 +0000 Subject: [vtkusers] vtkbioeng for vtk7.1.1 ? In-Reply-To: <1510664968533-0.post@n5.nabble.com> References: <1510664968533-0.post@n5.nabble.com> Message-ID: Hi Daniel, I'll update the vtkbioeng repo on github. Hi Andras, Thanks for the heads up on the SlicerRT version. It's been mentioned before to add the collision detection class to VTK but I think it more likely to work as an external module. Goodwin On Tue, Nov 14, 2017 at 1:09 PM, -Daniel- wrote: > Hi there, > > I would like to use vtkbioeng with vtk7.1.1, but apparently this is no > longer supported. Only up to version 6? Or is there already a solution for > that? > I'm particularly interested in collision detection. > > Every hint is welcome! > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Wed Nov 15 17:48:52 2017 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Wed, 15 Nov 2017 17:48:52 -0500 Subject: [vtkusers] vtkbioeng for vtk7.1.1 ? In-Reply-To: References: <1510664968533-0.post@n5.nabble.com> Message-ID: The copyright is not here: http://www.bioengineering-research.com/copyright.html On Wed, Nov 15, 2017 at 3:58 PM, Goodwin Lawlor wrote: > Hi Daniel, > > I'll update the vtkbioeng repo on github. > > Hi Andras, > > Thanks for the heads up on the SlicerRT version. > > It's been mentioned before to add the collision detection class to VTK but I > think it more likely to work as an external module. > > Goodwin > > On Tue, Nov 14, 2017 at 1:09 PM, -Daniel- > wrote: >> >> Hi there, >> >> I would like to use vtkbioeng with vtk7.1.1, but apparently this is no >> longer supported. Only up to version 6? Or is there already a solution for >> that? >> I'm particularly interested in collision detection. >> >> Every hint is welcome! >> >> >> >> -- >> Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Unpaid intern in BillsBasement at noware dot com From goodwin.lawlor.lists at gmail.com Wed Nov 15 18:04:09 2017 From: goodwin.lawlor.lists at gmail.com (Goodwin Lawlor) Date: Wed, 15 Nov 2017 23:04:09 +0000 Subject: [vtkusers] vtkbioeng for vtk7.1.1 ? In-Reply-To: References: <1510664968533-0.post@n5.nabble.com> Message-ID: Thanks Bill - that page used to contain the usual VTK BSD licence. It should point here now: https://github.com/glawlor/vtkbioeng/blob/master/LICENSE.md which is the BSD 2 clause boilerplate licence Github provides. I'll update that too while I'm at it Goodwin On Wednesday, November 15, 2017, Bill Lorensen wrote: > The copyright is not here: > http://www.bioengineering-research.com/copyright.html > > > On Wed, Nov 15, 2017 at 3:58 PM, Goodwin Lawlor > > wrote: > > Hi Daniel, > > > > I'll update the vtkbioeng repo on github. > > > > Hi Andras, > > > > Thanks for the heads up on the SlicerRT version. > > > > It's been mentioned before to add the collision detection class to VTK > but I > > think it more likely to work as an external module. > > > > Goodwin > > > > On Tue, Nov 14, 2017 at 1:09 PM, -Daniel- > > > wrote: > >> > >> Hi there, > >> > >> I would like to use vtkbioeng with vtk7.1.1, but apparently this is no > >> longer supported. Only up to version 6? Or is there already a solution > for > >> that? > >> I'm particularly interested in collision detection. > >> > >> Every hint is welcome! > >> > >> > >> > >> -- > >> Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > >> _______________________________________________ > >> Powered by www.kitware.com > >> > >> Visit other Kitware open-source projects at > >> http://www.kitware.com/opensource/opensource.html > >> > >> Please keep messages on-topic and check the VTK FAQ at: > >> http://www.vtk.org/Wiki/VTK_FAQ > >> > >> Search the list archives at: http://markmail.org/search/?q=vtkusers > >> > >> Follow this link to subscribe/unsubscribe: > >> http://public.kitware.com/mailman/listinfo/vtkusers > > > > > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Please keep messages on-topic and check the VTK FAQ at: > > http://www.vtk.org/Wiki/VTK_FAQ > > > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/vtkusers > > > > > > -- > Unpaid intern in BillsBasement at noware dot com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Wed Nov 15 18:12:53 2017 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Wed, 15 Nov 2017 18:12:53 -0500 Subject: [vtkusers] vtkbioeng for vtk7.1.1 ? In-Reply-To: References: <1510664968533-0.post@n5.nabble.com> Message-ID: License looks good to me. I agree that the suite might be a good remote module. The bar is a little lower than integrating into VTK proper. Bill On Wed, Nov 15, 2017 at 6:04 PM, Goodwin Lawlor wrote: > Thanks Bill - that page used to contain the usual VTK BSD licence. > > It should point here now: > https://github.com/glawlor/vtkbioeng/blob/master/LICENSE.md > > which is the BSD 2 clause boilerplate licence Github provides. > > I'll update that too while I'm at it > > Goodwin > > On Wednesday, November 15, 2017, Bill Lorensen > wrote: >> >> The copyright is not here: >> http://www.bioengineering-research.com/copyright.html >> >> >> On Wed, Nov 15, 2017 at 3:58 PM, Goodwin Lawlor >> wrote: >> > Hi Daniel, >> > >> > I'll update the vtkbioeng repo on github. >> > >> > Hi Andras, >> > >> > Thanks for the heads up on the SlicerRT version. >> > >> > It's been mentioned before to add the collision detection class to VTK >> > but I >> > think it more likely to work as an external module. >> > >> > Goodwin >> > >> > On Tue, Nov 14, 2017 at 1:09 PM, -Daniel- >> > wrote: >> >> >> >> Hi there, >> >> >> >> I would like to use vtkbioeng with vtk7.1.1, but apparently this is no >> >> longer supported. Only up to version 6? Or is there already a solution >> >> for >> >> that? >> >> I'm particularly interested in collision detection. >> >> >> >> Every hint is welcome! >> >> >> >> >> >> >> >> -- >> >> Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html >> >> _______________________________________________ >> >> Powered by www.kitware.com >> >> >> >> Visit other Kitware open-source projects at >> >> http://www.kitware.com/opensource/opensource.html >> >> >> >> Please keep messages on-topic and check the VTK FAQ at: >> >> http://www.vtk.org/Wiki/VTK_FAQ >> >> >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> >> >> Follow this link to subscribe/unsubscribe: >> >> http://public.kitware.com/mailman/listinfo/vtkusers >> > >> > >> > >> > _______________________________________________ >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at >> > http://www.kitware.com/opensource/opensource.html >> > >> > Please keep messages on-topic and check the VTK FAQ at: >> > http://www.vtk.org/Wiki/VTK_FAQ >> > >> > Search the list archives at: http://markmail.org/search/?q=vtkusers >> > >> > Follow this link to subscribe/unsubscribe: >> > http://public.kitware.com/mailman/listinfo/vtkusers >> > >> >> >> >> -- >> Unpaid intern in BillsBasement at noware dot com -- Unpaid intern in BillsBasement at noware dot com From andrew.amaclean at gmail.com Wed Nov 15 23:25:45 2017 From: andrew.amaclean at gmail.com (Andrew Maclean) Date: Thu, 16 Nov 2017 15:25:45 +1100 Subject: [vtkusers] =?utf-8?q?=E2=80=8BSetClientData_in_python_=28David_Go?= =?utf-8?q?bbi=29?= Message-ID: Hi, As promised, I did an example, please see: https://lorensen.github.io/VTKExamples/site/Python/Interaction/CallBack/ and https://lorensen.github.io/VTKExamples/site/Cxx/Interaction/CallBack/ Also look at: https://lorensen.github.io/VTKExamples/site/Python/VisualizationAlgorithms/ StreamlinesWithLineWidget/ Thanks to Bill Lorensen for some solving markdown issues in the case of CallBack. Please feel free to improve/correct the examples. Regards Andrew On Mon, Nov 13, 2017 at 1:26 AM, Oliver Natt wrote: > Dear Andrew, > > Davids proposal ist great. However, it appears a bit strange to most > programmers. I prefer for this purpose to make a new class which is a > callable. I think, this makes the code more readable for most programmers > since the data attribute is already initialized within the class itself. > Your example would look like this: > > class DummyCallback: > def __init__(self, data): > self.data = data > def __call__(self, obj, event): > print(ev, self.data) > > cb = DummyCallback(renwin) > interactor.AddObserver('LeftButtonPressEvent', cb) > > The last two lines can, of course, be abbreviated to: > interactor.AddObserver('LeftButtonPressEvent', DummyCallback(renwin)) > > Best regards > Oliver > > > Am 11.11.2017 um 23:46 schrieb Andrew Maclean: > > Ok > I have got it. > This works: > > def DummyFunc(obj, ev): > print(ev, DummyFunc.data) > > DummyFunc.data = renwin# How do I pass my obj_2 ?interactor.AddObserver('LeftButtonPressEvent', DummyFunc) > > > ?David, you may be able to explain this better than I can but I assume > this is what happens:? > Here we are adding a new attribute to DummyFunc. We can do this > because Python functions are in fact objects. > > ?This is something totally strange to C++ programmers! > > What a neat approach!? > > > > -- > Oliver Natt, > > J?gerstra?e 26b > 90451 N?rnberg > > Phone: +49 (0) 9 11 - 71 58 71 40 > Mobile +49 (0) 1 76 - 20 82 27 38 > E-Mail: onatt at gmx.de > > -- ___________________________________________ Andrew J. P. Maclean ___________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From landinghere at 163.com Wed Nov 15 23:30:43 2017 From: landinghere at 163.com (landings) Date: Wed, 15 Nov 2017 21:30:43 -0700 (MST) Subject: [vtkusers] Can vtkDataObject be downcasted to vtkUnstructuredGrid? Message-ID: <1510806643314-0.post@n5.nabble.com> Hi, I am writing a reader that outputs an unstructured solid mesh. I am referring to vtkSTLReader, in its RequestData() method I can see the following code: vtkInformation *outInfo = outputVector->GetInformationObject(0); vtkPolyData *output = vtkPolyData::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT())); But when I do similar things: vtkInformation* outInfo = outputVector->GetInformationObject(0); vtkUnstructuredGrid *output = vtkUnstructuredGrid::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT())); I get a nullptr for output. I am sure outInfo->Get(vtkDataObject::DATA_OBJECT()) exists before downcasting. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From mathieu.westphal at kitware.com Thu Nov 16 03:41:57 2017 From: mathieu.westphal at kitware.com (Mathieu Westphal) Date: Thu, 16 Nov 2017 09:41:57 +0100 Subject: [vtkusers] Can vtkDataObject be downcasted to vtkUnstructuredGrid? In-Reply-To: <1510806643314-0.post@n5.nabble.com> References: <1510806643314-0.post@n5.nabble.com> Message-ID: Hello For the cast to work, the object need to be of the right type. If the output is a vtkPolyData, it cannot be a vtkUnstructuredGrid. Take a look at the polymorphism here. https://www.vtk.org/doc/nightly/html/classvtkDataSet.html Best, Mathieu Westphal On Thu, Nov 16, 2017 at 5:30 AM, landings wrote: > Hi, > > I am writing a reader that outputs an unstructured solid mesh. > > I am referring to vtkSTLReader, in its RequestData() method I can see the > following code: > > vtkInformation *outInfo = outputVector->GetInformationObject(0); > vtkPolyData *output = > vtkPolyData::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT())); > > But when I do similar things: > > vtkInformation* outInfo = outputVector->GetInformationObject(0); > vtkUnstructuredGrid *output = > vtkUnstructuredGrid::SafeDownCast(outInfo->Get( > vtkDataObject::DATA_OBJECT())); > > I get a nullptr for output. I am sure > outInfo->Get(vtkDataObject::DATA_OBJECT()) exists before downcasting. > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul.melis at surfsara.nl Thu Nov 16 04:20:44 2017 From: paul.melis at surfsara.nl (Paul Melis) Date: Thu, 16 Nov 2017 10:20:44 +0100 Subject: [vtkusers] vtkXdmf3Writer index precision Message-ID: Hi, Is there a way to specify the integer precision of polydata index arrays when using the Xdmf3 writer? For me, it's currently writing out indices in 64 bits, which is a bit wasteful given the number of vertices: region-rbc-9.h5:Data2 region-rbc-9.h5:Data3 Or is the output precision of (most) VTK writers fully determined by the compiled-in ID type? Thanks, Paul -- Paul Melis | Visualization group leader & developer | SURFsara | | Science Park 140 | 1098 XG Amsterdam | | T 020 800 1312 | paul.melis at surfsara.nl | www.surfsara.nl | From chandan.yeshwanth at siemens.com Thu Nov 16 04:30:46 2017 From: chandan.yeshwanth at siemens.com (Yeshwanth, Chandan) Date: Thu, 16 Nov 2017 09:30:46 +0000 Subject: [vtkusers] Shadows with VTK 8.0 Message-ID: Hi, Can anyone help me implement shadow mapping with VTK 8.0? The existing example here - https://lorensen.github.io/VTKExamples/site/Cxx/Visualization/Shadows/ gives this error - AttributeError: 'vtkRenderingOpenGL2Python.vtkShadowMapBakerPass' object has no attribute 'SetOpaquePass' Has the API changed from 5.10 to 8? A minimum working example of shadows in VTK 8 or a summary of the API changes will be great! Thanks, Chandan -------------- next part -------------- An HTML attachment was scrubbed... URL: From sur.chiranjib at gmail.com Thu Nov 16 04:40:03 2017 From: sur.chiranjib at gmail.com (Chiranjib Sur) Date: Thu, 16 Nov 2017 15:10:03 +0530 Subject: [vtkusers] Shadows with VTK 8.0 In-Reply-To: References: Message-ID: This wiki link gives you the details of the API changes in VTK development : https://www.vtk.org/Wiki/VTK/Roadmap Hope that helps Thanks and regards, Chiranjib On Thu, Nov 16, 2017 at 3:00 PM, Yeshwanth, Chandan < chandan.yeshwanth at siemens.com> wrote: > Hi, > > > > Can anyone help me implement shadow mapping with VTK 8.0? > > The existing example here - https://lorensen.github.io/ > VTKExamples/site/Cxx/Visualization/Shadows/ gives this error ? > > AttributeError: 'vtkRenderingOpenGL2Python.vtkShadowMapBakerPass' object > has no attribute 'SetOpaquePass' > > > > Has the API changed from 5.10 to 8? A minimum working example of shadows > in VTK 8 or a summary of the API changes will be great! > > > > Thanks, > > Chandan > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From goodwin.lawlor.lists at gmail.com Thu Nov 16 07:09:32 2017 From: goodwin.lawlor.lists at gmail.com (Goodwin Lawlor) Date: Thu, 16 Nov 2017 12:09:32 +0000 Subject: [vtkusers] vtkbioeng for vtk7.1.1 ? In-Reply-To: References: <1510664968533-0.post@n5.nabble.com> Message-ID: Is there the same (VTK proper) vow to maintain the code until death-do-us-part for the Remote Modules? Just asking :-) Goodwin -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.martin at kitware.com Thu Nov 16 08:54:23 2017 From: ken.martin at kitware.com (Ken Martin) Date: Thu, 16 Nov 2017 08:54:23 -0500 Subject: [vtkusers] Shadows with VTK 8.0 In-Reply-To: References: Message-ID: There is also a test of shadows in Rendering/OpenGL2/Testing/Cxx that you can look at - Ken On Thu, Nov 16, 2017 at 4:40 AM, Chiranjib Sur wrote: > This wiki link gives you the details of the API changes in VTK development > : https://www.vtk.org/Wiki/VTK/Roadmap > > Hope that helps > > > Thanks and regards, > Chiranjib > > On Thu, Nov 16, 2017 at 3:00 PM, Yeshwanth, Chandan < > chandan.yeshwanth at siemens.com> wrote: > >> Hi, >> >> >> >> Can anyone help me implement shadow mapping with VTK 8.0? >> >> The existing example here - https://lorensen.github.io/VTK >> Examples/site/Cxx/Visualization/Shadows/ gives this error ? >> >> AttributeError: 'vtkRenderingOpenGL2Python.vtkShadowMapBakerPass' object >> has no attribute 'SetOpaquePass' >> >> >> >> Has the API changed from 5.10 to 8? A minimum working example of shadows >> in VTK 8 or a summary of the API changes will be great! >> >> >> >> Thanks, >> >> Chandan >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -- Ken Martin PhD Distinguished Engineer Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From amine.aboufirass at gmail.com Thu Nov 16 11:25:02 2017 From: amine.aboufirass at gmail.com (Amine Aboufirass) Date: Thu, 16 Nov 2017 17:25:02 +0100 Subject: [vtkusers] Extracting selection from UnstructuredGridDataset using python Message-ID: Hello, I am trying to extract specific points and their corresponding values from an unstructured grid dataset using python. My objective is to provide a list of pointID's or X,Y,Z locations, the name of the result I would like to extract and in return get a list containing the values.. The values associated with the points are in vector, scalar and/or tensor form. I've made several attempts using the following classes of objects described in the vtk class documentation: - vtkExtractSelection - vtkSelection - vtkSelectionNode - vtkSelectionSource - vtkUnstructuredGridReader It appears that these objects are somewhat related. For instance the vtkExtractSelection object can take in a vtkObject output from an unstructured grid reader and a vtkSelection. A vtkSelection can carry any number of vtkSelectionNodes. The vtkSelection node stores selection parameters for a list of properties and a list of selection values. The list of properties can contain information about what is stored by the node such as GLOBALID and LOCATION. It is also possible to assign several vtkSelectionNodes as ContentTypes and FieldTypes to a vtkSelectionSourceObject. The vtkSelectionSource object itself outputs a vtkSelection when piece id and cell id pairs are provided as input. I have also noticed it is possible to .AddID and .AddLocation to a vtkSelectionSource object. Furthermore I have searched through the available examples including the following: https://www.vtk.org/gitweb?p=VTK.git;a=blob;f=Examples/Infovis/Python/graph_selection_subtract.py https://www.programcreek.com/python/example/21682/vtk. vtkExtractUnstructuredGrid I also asked a fairly detailed question on stackexchange: https://stackoverflow.com/questions/47332100/selectionnode-object-from-vtk-library The stackexchange post has of yet received no response, and the examples were helpful but didn't quite get me there. In light of what I have explained above, does anyone have further indications of what I can do to achieve this? Thanks you kindly for your consideration and look forward to your responses. Regards, Amine -------------- next part -------------- An HTML attachment was scrubbed... URL: From lasso at queensu.ca Thu Nov 16 13:38:50 2017 From: lasso at queensu.ca (Andras Lasso) Date: Thu, 16 Nov 2017 18:38:50 +0000 Subject: [vtkusers] vtkbioeng for vtk7.1.1 ? In-Reply-To: References: <1510664968533-0.post@n5.nabble.com> Message-ID: If a remote module has users then they will probably keep sending pull requests with small fixes and improvements. If you cannot maintain the code anymore (not even merging pull requests) then eventually people will switch to a better-maintained fork or use different modules. So, I don?t think you need to promise or guarantee anything for the future. Andras From: Goodwin Lawlor [mailto:goodwin.lawlor.lists at gmail.com] Sent: Thursday, November 16, 2017 7:10 AM To: Bill Lorensen Cc: -Daniel- ; Andras Lasso ; VTK Users Subject: Re: [vtkusers] vtkbioeng for vtk7.1.1 ? Is there the same (VTK proper) vow to maintain the code until death-do-us-part for the Remote Modules? Just asking :-) Goodwin -------------- next part -------------- An HTML attachment was scrubbed... URL: From goodwin.lawlor.lists at gmail.com Thu Nov 16 14:02:14 2017 From: goodwin.lawlor.lists at gmail.com (Goodwin Lawlor) Date: Thu, 16 Nov 2017 19:02:14 +0000 Subject: [vtkusers] vtkbioeng for vtk7.1.1 ? In-Reply-To: References: <1510664968533-0.post@n5.nabble.com> Message-ID: That's a good point - the community/users can fork a remote module so the only thing that has to change in VTK core is the new repo location. On Thu, Nov 16, 2017 at 6:38 PM, Andras Lasso wrote: > If a remote module has users then they will probably keep sending pull > requests with small fixes and improvements. If you cannot maintain the code > anymore (not even merging pull requests) then eventually people will switch > to a better-maintained fork or use different modules. So, I don?t think you > need to promise or guarantee anything for the future. > > > > Andras > > > > *From:* Goodwin Lawlor [mailto:goodwin.lawlor.lists at gmail.com] > *Sent:* Thursday, November 16, 2017 7:10 AM > *To:* Bill Lorensen > *Cc:* -Daniel- ; Andras Lasso < > lasso at queensu.ca>; VTK Users > *Subject:* Re: [vtkusers] vtkbioeng for vtk7.1.1 ? > > > > Is there the same (VTK proper) vow to maintain the code until > death-do-us-part for the Remote Modules? Just asking :-) > > > > Goodwin > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chandan.yeshwanth at siemens.com Thu Nov 16 23:15:18 2017 From: chandan.yeshwanth at siemens.com (Yeshwanth, Chandan) Date: Fri, 17 Nov 2017 04:15:18 +0000 Subject: [vtkusers] Shadows with VTK 8.0 In-Reply-To: References: Message-ID: Thanks Ken, Chiranjib. I tried out the example you mentioned in Rendering/OpenGL2/Testing/Cxx. It looks like the API has changed in a few places ? ? vtkShadowMapBakerPass.SetOpaquePass is now SetOpaqueSequence I couldn?t resolve these API errors, which seem to be essential to rendering shadows - ? vtkShadowMapBakerPass has no member named SetPolygonOffsetFactor ? vtkShadowMapBakerPass has no member named SetPolygonOffsetUnits ? ?OCCLUDER? is not a member of ?vtkShadowMapBakerPass? ? ?RECEIVER? is not a member of ?vtkShadowMapBakerPass? I searched for the new API in the ?API Changes? sections that Chiranjib mentioned as well as in the VTK source code itself, but I couldn?t find the new function calls to be used. Can you please help me out with this? Regards, Chandan From: Ken Martin [mailto:ken.martin at kitware.com] Sent: Thursday, November 16, 2017 7:24 PM To: Chiranjib Sur Cc: Yeshwanth, Chandan (CT RDA BAM ADM-IN); vtkusers at vtk.org; Chennamsetty, Sai Saketh (CT RDA BAM ADM-IN) Subject: Re: [vtkusers] Shadows with VTK 8.0 There is also a test of shadows in Rendering/OpenGL2/Testing/Cxx that you can look at - Ken On Thu, Nov 16, 2017 at 4:40 AM, Chiranjib Sur > wrote: This wiki link gives you the details of the API changes in VTK development : https://www.vtk.org/Wiki/VTK/Roadmap Hope that helps Thanks and regards, Chiranjib On Thu, Nov 16, 2017 at 3:00 PM, Yeshwanth, Chandan > wrote: Hi, Can anyone help me implement shadow mapping with VTK 8.0? The existing example here - https://lorensen.github.io/VTKExamples/site/Cxx/Visualization/Shadows/ gives this error ? AttributeError: 'vtkRenderingOpenGL2Python.vtkShadowMapBakerPass' object has no attribute 'SetOpaquePass' Has the API changed from 5.10 to 8? A minimum working example of shadows in VTK 8 or a summary of the API changes will be great! Thanks, Chandan _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -- Ken Martin PhD Distinguished Engineer Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chandan.yeshwanth at siemens.com Fri Nov 17 00:47:19 2017 From: chandan.yeshwanth at siemens.com (Yeshwanth, Chandan) Date: Fri, 17 Nov 2017 05:47:19 +0000 Subject: [vtkusers] Shadows with VTK 8.0 References: Message-ID: Sorry, I was looking for the examples in the wrong directory (OpenGL). I tried out the example in the OpenGL2 directory and most of the API works in Python, except line 94 (https://github.com/Kitware/VTK/blob/master/Rendering/OpenGL2/Testing/Cxx/TestShadowMapBakerPass.cxx) ? ? vtkTextureObject *to = (*bakerPass->GetShadowMaps())[2]; The error in Python is ?AttributeError: 'vtkRenderingOpenGL2Python.vtkShadowMapBakerPass' object has no attribute 'GetShadowMaps'?. I couldn?t find an alternative to this yet. If comment out this code and run it, the second renderWindow.Render() call causes a segmentation fault with this error ? ? Warning: In /home/user1/VTK-8.0.1/Common/ExecutionModel/vtkAlgorithm.cxx, line 1422 ? vtkOpenGLTexture (0x5555ba473d10): Attempt to get connection index 0 for input port 0, which has 0 connections. ? Segmentation fault (core dumped) Please let me know if you have any advice for this. Meanwhile I will try out the other example - TestShadowMapPass.cxx. Regards, Chandan From: Yeshwanth, Chandan (CT RDA BAM ADM-IN) Sent: Friday, November 17, 2017 9:45 AM To: 'Ken Martin'; Chiranjib Sur Cc: vtkusers at vtk.org; Chennamsetty, Sai Saketh (CT RDA BAM ADM-IN) Subject: RE: [vtkusers] Shadows with VTK 8.0 Thanks Ken, Chiranjib. I tried out the example you mentioned in Rendering/OpenGL2/Testing/Cxx. It looks like the API has changed in a few places ? ? vtkShadowMapBakerPass.SetOpaquePass is now SetOpaqueSequence I couldn?t resolve these API errors, which seem to be essential to rendering shadows - ? vtkShadowMapBakerPass has no member named SetPolygonOffsetFactor ? vtkShadowMapBakerPass has no member named SetPolygonOffsetUnits ? ?OCCLUDER? is not a member of ?vtkShadowMapBakerPass? ? ?RECEIVER? is not a member of ?vtkShadowMapBakerPass? I searched for the new API in the ?API Changes? sections that Chiranjib mentioned as well as in the VTK source code itself, but I couldn?t find the new function calls to be used. Can you please help me out with this? Regards, Chandan From: Ken Martin [mailto:ken.martin at kitware.com] Sent: Thursday, November 16, 2017 7:24 PM To: Chiranjib Sur Cc: Yeshwanth, Chandan (CT RDA BAM ADM-IN); vtkusers at vtk.org; Chennamsetty, Sai Saketh (CT RDA BAM ADM-IN) Subject: Re: [vtkusers] Shadows with VTK 8.0 There is also a test of shadows in Rendering/OpenGL2/Testing/Cxx that you can look at - Ken On Thu, Nov 16, 2017 at 4:40 AM, Chiranjib Sur > wrote: This wiki link gives you the details of the API changes in VTK development : https://www.vtk.org/Wiki/VTK/Roadmap Hope that helps Thanks and regards, Chiranjib On Thu, Nov 16, 2017 at 3:00 PM, Yeshwanth, Chandan > wrote: Hi, Can anyone help me implement shadow mapping with VTK 8.0? The existing example here - https://lorensen.github.io/VTKExamples/site/Cxx/Visualization/Shadows/ gives this error ? AttributeError: 'vtkRenderingOpenGL2Python.vtkShadowMapBakerPass' object has no attribute 'SetOpaquePass' Has the API changed from 5.10 to 8? A minimum working example of shadows in VTK 8 or a summary of the API changes will be great! Thanks, Chandan _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -- Ken Martin PhD Distinguished Engineer Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.slaughter at inl.gov Fri Nov 17 13:13:46 2017 From: andrew.slaughter at inl.gov (Slaughter, Andrew E) Date: Fri, 17 Nov 2017 11:13:46 -0700 Subject: [vtkusers] Glyphs Help Message-ID: I am attempting to use VTK to create arrow glyphs of a vector field from an ExodusII file, but can't seem to get the vectors to orient and scale according to the data. Attached is the data, example output, and script I am running. Also, I included an image of what I am trying to do that was created with Paraview. I am using VTK7.1 with python on a MacOS high sierra. I would appreciate any help getting this working, when done I will upload it to the VTK examples. Thanks, Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: vector_paraview.png Type: image/png Size: 38946 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: tmp_vector.png Type: image/png Size: 32969 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: vector_out.e Type: application/octet-stream Size: 34368 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: script.py Type: text/x-python-script Size: 1772 bytes Desc: not available URL: From amine.aboufirass at gmail.com Fri Nov 17 15:40:53 2017 From: amine.aboufirass at gmail.com (Amine Aboufirass) Date: Fri, 17 Nov 2017 21:40:53 +0100 Subject: [vtkusers] write unstructured grid vtk file to query-able database format Message-ID: Hello, I would like to find out if there is a way to write unstructured grid vtk files containing scalar, tensor or vector data to any standard database format. This could be SQLite, JSON or XML for example. The reason for this is that I would like to conduct queries on the *data* contained in the vtk file. I have no need to create new geometries or select by frustum for example. I need only basic SQL select-where type functionality where I can query and extract numerical data based on simple conditions. I saw that the vtk file contains some SQL readiness but as far as I can tell the tools are mainly to connect to an SQL database and extract data from it. I seek to go the other way, namely to start with an unstructured grid vtk dataset and write *that *into a database. The following examples look promising - https://lorensen.github.io/VTKExamples/site/Cxx/Databases/SQL/MySQL/CreateDatabase/ - https://lorensen.github.io/VTKExamples/site/Cxx/Databases/SQL/MySQL/WriteToDatabase/ But I have no C++ background and use mainly Python. Furthermore I'm not sure if the above applies for Unstructured grid data. Could anyone please enlighten me on this? Thanks, Amine -------------- next part -------------- An HTML attachment was scrubbed... URL: From jvdura at gmail.com Sun Nov 19 17:13:59 2017 From: jvdura at gmail.com (Juan) Date: Sun, 19 Nov 2017 15:13:59 -0700 (MST) Subject: [vtkusers] vtkRenderWindow does not open Message-ID: <1511129639027-0.post@n5.nabble.com> I am running VTK in Python. I am using the Anaconda distribution for Python 2.7 (ubuntu 16.04) I run this simple cylinder example in Spyder. There is not message error or warning. I don't know what to do. Please help. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From landinghere at 163.com Sun Nov 19 22:52:48 2017 From: landinghere at 163.com (landings) Date: Sun, 19 Nov 2017 20:52:48 -0700 (MST) Subject: [vtkusers] Why does my vtkContourFilter have no output? Message-ID: <1511149968961-0.post@n5.nabble.com> Hi, I asked this question in Stackoverflow two days ago, but very few people saw it and no response yet. https://stackoverflow.com/questions/47365819/why-does-my-vtkcontourfilter-have-no-output I am writing a VTK program with C++ to deal with finite element analysis results. To show isosurfaces, I am trying vtkContourFilter, but I get nothing after this filter. So I write a simple version: a custom reader produces a 2-cell unstructured mesh and a following vtkContourFilter extracts the isosurfaces. My scalar data are point data. I intend to get isosurfaces, but still, I get zero output. I want to know what I have missed. My program: ---------------------------------------------------- #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; // This is a fake reader that outputs an unstructured mesh class VTKIOLEGACY_EXPORT FakeUnstructuredGridReader : public vtkUnstructuredGridReader { public: static FakeUnstructuredGridReader* New() { return new FakeUnstructuredGridReader(); } vtkTypeMacro(FakeUnstructuredGridReader, vtkUnstructuredGridReader); void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE {} protected: FakeUnstructuredGridReader() { this->SetNumberOfInputPorts(0); }// No input ports // This method passes a 2-cell unstructured grid with 1 set of scalar point data int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector* outputVector) VTK_OVERRIDE { static const double rawPoints[15] = { 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1 }; static const vtkIdType rawIndices[8] = { 0, 1, 2, 3, 1, 2, 3, 4}; static const double rawScalar[5] = { 5, 10, 20, 15, 50 }; static const char* scalarName = "Stress"; // Build Points auto points = vtkSmartPointer::New(); for (int i = 0; i < 15; i += 3) points->InsertNextPoint(rawPoints + i); // Build Cells auto cells = vtkSmartPointer::New(); // Build Cell 1 auto indices1 = vtkSmartPointer::New(); for (int i = 0; i < 4; ++i) indices1->InsertNextId(rawIndices[i]); cells->InsertNextCell(indices1); // Build Cell 2 auto indices2 = vtkSmartPointer::New(); for (int i = 0; i < 4; ++i) indices2->InsertNextId(rawIndices[i + 4]); cells->InsertNextCell(indices2); // Scalar Data auto dataArray = vtkSmartPointer::New(); dataArray->SetName(scalarName); dataArray->SetNumberOfComponents(1); for (int i = 0; i < 5; ++i) dataArray->InsertNextValue(rawScalar[i]); // Point Data auto pointData = vtkSmartPointer::New(); pointData->AddArray(dataArray); // Pass Data vtkInformation* outInfo = outputVector->GetInformationObject(0); vtkUnstructuredGrid *output = vtkUnstructuredGrid::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT())); output->SetPoints(points); output->SetCells(VTK_TETRA, cells); output->SetFieldData(pointData); return 1; } }; int main() { // Reader auto fakeReader = vtkSmartPointer::New(); // Isosurface Filter auto isoFilter = vtkSmartPointer::New(); isoFilter->SetInputConnection(fakeReader->GetOutputPort()); isoFilter->GenerateValues(8, 0.0, 50.0); isoFilter->Update(); cout << fakeReader->GetOutput()->GetNumberOfPoints() << endl; cout << fakeReader->GetOutput()->GetNumberOfCells() << endl; cout << fakeReader->GetOutput()->GetFieldData()->GetNumberOfArrays() << endl; cout << isoFilter->GetOutput()->GetNumberOfPoints() << endl; cout << isoFilter->GetOutput()->GetNumberOfCells() << endl; cout << isoFilter->GetOutput()->GetFieldData()->GetNumberOfArrays() << endl; system("pause"); return 0; } ---------------------------------------------------- Its output: 5 2 1 0 0 1 -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From 278124177 at qq.com Mon Nov 20 03:49:30 2017 From: 278124177 at qq.com (=?gb18030?B?zui3qM7ozOw=?=) Date: Mon, 20 Nov 2017 16:49:30 +0800 Subject: [vtkusers] Draw a closed area on the screen Message-ID: Hi, I want to use the mouse to choose an array of points and then connetct the dots directly to make a closed area. How can i do this with VTK? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.maynard at kitware.com Mon Nov 20 12:39:00 2017 From: robert.maynard at kitware.com (Robert Maynard) Date: Mon, 20 Nov 2017 12:39:00 -0500 Subject: [vtkusers] Performance issue with 8.1.0rc1 In-Reply-To: References: Message-ID: Are you able to record some performance information so we can dig into the issue? Can you build with debug symbols, run performance analysis ( sudo perf record -F 99 -a -g -- sleep 50 ), and than link us to the performance data ( perf.data )? On Tue, Nov 14, 2017 at 4:43 AM, marcin.krotkiewski wrote: > Hello, > > I compiled VTK8.1.0rc1 with GCC + OpenMP and tested it in my Java-based > application. The behavior is different compared to 8.0.1: when I manipulate > (rotate/move) my model, all CPU cores are 100% active (used to be only 1), > and the performance is very sluggish. Rotation staggers and is not smooth, > even if I only render the axis actor. On the other hand, compiling without > OpenMP support (Sequential) works as it used to. > > Does anyone have ideas? > > Thanks! > > Marcin > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers From mikewithascarf at yahoo.com Mon Nov 20 16:21:25 2017 From: mikewithascarf at yahoo.com (mikewithascarf) Date: Mon, 20 Nov 2017 14:21:25 -0700 (MST) Subject: [vtkusers] smooth part of surface (polydata) Message-ID: <1511212885803-0.post@n5.nabble.com> How would I go about smoothing only a part of a surface (vtkpolydata)? I have a surface where there are bumps, which I know the centers (x,y,z) and approximate radius of. I only want to smooth these bumps, and leave the rest of the surface untouched. Is there perhaps a way to specify a region for vtkSmoothPolyDataFilter to act on? Any help is appreciated! -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From dave.demarle at kitware.com Mon Nov 20 17:03:53 2017 From: dave.demarle at kitware.com (David E DeMarle) Date: Mon, 20 Nov 2017 17:03:53 -0500 Subject: [vtkusers] vtkXdmf3Writer index precision In-Reply-To: References: Message-ID: As for xdmf3, yes the size of the compiled in ID type is what determines it. See https://gitlab.kitware.com/vtk/vtk/blob/master/IO/Xdmf3/vtkXdmf3DataSet.cxx#L372 where we check the size and then give over the pointer. David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Thu, Nov 16, 2017 at 4:20 AM, Paul Melis wrote: > Hi, > > Is there a way to specify the integer precision of polydata index arrays > when using the Xdmf3 writer? For me, it's currently writing out indices in > 64 bits, which is a bit wasteful given the number of vertices: > > > > > > > Precision="4">region-rbc-9.h5:Data2 > > > Precision="8">region-rbc-9.h5:Data3 > > > > > > Or is the output precision of (most) VTK writers fully determined by the > compiled-in ID type? > > Thanks, > Paul > > -- > > Paul Melis > | Visualization group leader & developer | SURFsara | > | Science Park 140 | 1098 XG Amsterdam | > | T 020 800 1312 | paul.melis at surfsara.nl | www.surfsara.nl | > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensou > rce/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul.melis at surfsara.nl Tue Nov 21 02:40:38 2017 From: paul.melis at surfsara.nl (Paul Melis) Date: Tue, 21 Nov 2017 08:40:38 +0100 Subject: [vtkusers] vtkXdmf3Writer index precision In-Reply-To: References: Message-ID: <08ab5aca-e2b9-ee9c-2a01-1e6d6de535a6@surfsara.nl> Thanks, David! Looks like I need to build a 32-bit-ID version of VTK :-) Paul On 11/20/2017 11:03 PM, David E DeMarle wrote: > As for xdmf3, yes the size of the compiled in ID type is what > determines it. > See > https://gitlab.kitware.com/vtk/vtk/blob/master/IO/Xdmf3/vtkXdmf3DataSet.cxx#L372 > where we check the size and then give over the pointer. > > > > David E DeMarle > Kitware, Inc. > Principal Engineer > 21 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-881-4909 > > On Thu, Nov 16, 2017 at 4:20 AM, Paul Melis > wrote: > > Hi, > > Is there a way to specify the integer precision of polydata index > arrays when using the Xdmf3 writer? For me, it's currently writing > out indices in 64 bits, which is a bit wasteful given the number > of vertices: > > > > ? > ? ? > ? ? ? > ? ? ? ? Format="HDF" Precision="4">region-rbc-9.h5:Data2 > ? ? ? > ? ? ? > ? ? ? ? Format="HDF" Precision="8">region-rbc-9.h5:Data3 > ? ? ? > ? ? > ? > > > Or is the output precision of (most) VTK writers fully determined > by the compiled-in ID type? > > Thanks, > Paul > > -- > > Paul Melis > | Visualization group leader & developer | SURFsara | > | Science Park 140 | 1098 XG Amsterdam | > | T 020 800 1312 | paul.melis at surfsara.nl > | www.surfsara.nl > | > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: > http://markmail.org/search/?q=vtkusers > > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fromseattle at gmail.com Tue Nov 21 22:31:23 2017 From: fromseattle at gmail.com (Frank Sea) Date: Tue, 21 Nov 2017 20:31:23 -0700 (MST) Subject: [vtkusers] vtkTextActor render utf8 characters not working Message-ID: <1511321483500-0.post@n5.nabble.com> Hi All, I built the test code at the following location: https://gitlab.kitware.com/vtk/vtk/blob/master/Rendering/FreeType/Testing/Cxx/TestMathTextFreeTypeTextRenderer.cxx#L184 which tests displaying utf8 chars like following: // UTF-8 freetype handling: vtkNew actor15; actor15->GetTextProperty()->SetFontFamily(VTK_FONT_FILE); actor15->GetTextProperty()->SetFontFile(uncodeFontFile.c_str()); actor15->GetTextProperty()->SetJustificationToCentered(); actor15->GetTextProperty()->SetVerticalJustificationToCentered(); actor15->GetTextProperty()->SetFontSize(18); actor15->GetTextProperty()->SetColor(0.0, 1.0, 0.7); actor15->SetInput("UTF-8 FreeType: \xce\xa8\xd2\x94\xd2\x96\xd1\x84\xd2\xbe"); actor15->SetPosition(10, 110); I provided font file from https://github.com/aosp-mirror/platform_frameworks_base/blob/master/data/fonts/DroidSansFallbackFull.ttf But the text is not rendered. It's blank for that one. Anyone know the reason? I am on Windows 10. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From chandan.yeshwanth at siemens.com Wed Nov 22 06:24:49 2017 From: chandan.yeshwanth at siemens.com (chandan) Date: Wed, 22 Nov 2017 04:24:49 -0700 (MST) Subject: [vtkusers] Example for vtkProjectedTexture usage In-Reply-To: References: Message-ID: <1511349889237-0.post@n5.nabble.com> Thanks for the example Bill. I am trying to project 2 different images onto the same object (an STL actor). Is this possible with vtkProjectedTexture? For simplicity, I am projecting a simple red square and blue square onto the object from 2 different locations. I set 2 different locations for the vtkProjectedTexture objects and create a vtkLight at each location as well. The light is required to create shadows on the rest of the object which is not covered by textures. However, only the second (blue image) gets projected onto the object, and this gets illuminated by both lights. I have tried these approaches - - combine the TCoords obtained from both ProjectedTexture objects, by concatenating the vtkFloatArray objects. (projectedTexture.GetOutput().GetPointData().GetTCoords()). - reuse the vtkPolyData object returned by projectedTexture.GetPolyDataOutput() Both of these gave the same result that I mentioned above. Thanks, Chandan -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From karsten.tausche at student.hpi.uni-potsdam.de Wed Nov 22 10:45:08 2017 From: karsten.tausche at student.hpi.uni-potsdam.de (Karsten Tausche) Date: Wed, 22 Nov 2017 16:45:08 +0100 Subject: [vtkusers] vtkPlotPoints marker in QVTKOpenGLWidget on Windows Message-ID: <454ffaae-9820-ff82-16d8-e5892bb1aa51@student.hpi.uni-potsdam.de> Hi all, I'm having trouble with the MarkerStyle property of vtkPlotPoints when using the QVTKOpenGLWidget for OpenGL context creation on Windows. See the attached code for a minimum example. When cross or square is selected, squares are drawn. For all other marker styles, no markers at all are drawn. After some debugging, it seems that the correct marker textures are generated and selected, but apparently they don't reach the GPU buffer/texture data. Maybe some GPU buffers of the chart/context components are not correctly (re-)initialized in the OpenGL context of Qt widget. The example code works fine when using the vtkRenderWindow for context creation (undefine USE_QVTK in line 18). On Linux both implementations work fine. On Windows (8.1) I tested the code on an Intel HD Graphics 5500 and GeForce 940M, with Qt 5.9 and VTK v8.1.0.rc1. Note that the QSurfaceFormat hacks around line 52 don't change anything on modern hardware. Also, changing the vtkPlotLine to vtkPlotPoints has no effect on the markers, it's just convenient to see the line for reference. Did I miss anything for passing the QVTKOpenGLWidget's render window to the vtkContextView? It's not that obvious in which order the widget, context view and chart should be created and assigned to each other. With some alternative initialization orders it just crashes at runtime. Thanks a lot for your help! Karsten -------------- next part -------------- #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define USE_QVTK int main(int argc, char ** argv) { vtkNew x; x->SetName("x"); x->SetNumberOfTuples(10); for (vtkIdType i = 0; i < x->GetNumberOfTuples(); ++i) { x->SetValue(i, float(i)); } vtkNew y; y->DeepCopy(x); y->SetName("y"); vtkNew table; table->AddColumn(x); table->AddColumn(y); auto plot = vtkSmartPointer::New(); plot->SetInputData(table, 0, 1); //plot->SetMarkerStyle(vtkPlotPoints::NONE); // -> None //plot->SetMarkerStyle(vtkPlotPoints::CROSS); // -> Square //plot->SetMarkerStyle(vtkPlotPoints::PLUS); // -> None //plot->SetMarkerStyle(vtkPlotPoints::SQUARE); // -> Square //plot->SetMarkerStyle(vtkPlotPoints::CIRCLE); // -> None plot->SetMarkerStyle(vtkPlotPoints::DIAMOND); // -> None plot->SetMarkerSize(20.f); vtkNew view; #ifdef USE_QVTK auto format = QVTKOpenGLWidget::defaultFormat(); format.setSamples(0); // This is required for Intel HD 3000 (and similar?) broken Windows drivers. format.setProfile(QSurfaceFormat::CompatibilityProfile); format.setOption(QSurfaceFormat::DeprecatedFunctions, true); QSurfaceFormat::setDefaultFormat(format); QApplication app(argc, argv); QVTKOpenGLWidget widget; vtkNew renWin; widget.SetRenderWindow(renWin); view->SetRenderWindow(renWin); #endif vtkNew chart; view->GetScene()->AddItem(chart); chart->AddPlot(plot); class Callback : public vtkCallbackCommand { public: static Callback* New() { return new Callback; } void Execute(vtkObject * obj, unsigned long evId, void*ptr) override { auto iren = vtkRenderWindowInteractor::SafeDownCast(obj); if (!iren) { return; } const int diff = iren->GetKeyCode() == 'a' ? 1 : -1; const int newMarker = (plot->GetMarkerStyle() + diff + vtkPlotPoints::DIAMOND + 1) % (vtkPlotPoints::DIAMOND + 1); switch (newMarker) { case vtkPlotPoints::NONE: std::cout << "NONE" << std::endl; break; case vtkPlotPoints::CROSS: std::cout << "CROSS" << std::endl; break; case vtkPlotPoints::PLUS: std::cout << "PLUS" << std::endl; break; case vtkPlotPoints::SQUARE: std::cout << "SQUARE" << std::endl; break; case vtkPlotPoints::CIRCLE: std::cout << "CIRCLE" << std::endl; break; case vtkPlotPoints::DIAMOND: std::cout << "DIAMOND" << std::endl; break; default: std::cout << "(invalid)" << std::endl; break; } plot->SetMarkerStyle(newMarker); iren->Render(); } Callback() {} vtkSmartPointer plot; }; vtkNew callback; callback->plot = plot; view->GetInteractor()->AddObserver(vtkCommand::KeyReleaseEvent, callback); #ifdef USE_QVTK widget.show(); return app.exec(); #else view->GetInteractor()->Start(); return 0; #endif } -------------- next part -------------- cmake_minimum_required(VERSION 3.3.0 FATAL_ERROR) project(QtPlotMarkerTest) find_package(VTK REQUIRED COMPONENTS vtkRenderingContextOpenGL2 vtkChartsCore vtkViewsContext2D vtkGUISupportQt ) include(${VTK_USE_FILE}) add_executable(QtPlotMarkerTest QtPlotMarkerTest.cxx) target_link_libraries(QtPlotMarkerTest ${VTK_LIBRARIES}) From Adrian.Bielefeldt at mailbox.tu-dresden.de Wed Nov 22 11:03:35 2017 From: Adrian.Bielefeldt at mailbox.tu-dresden.de (Adrian Bielefeldt) Date: Wed, 22 Nov 2017 17:03:35 +0100 Subject: [vtkusers] appendPolyData with shepard method: Points must be defined! Message-ID: <4c01dc04-c4e2-9467-7594-01943fcedd5b@mailbox.tu-dresden.de> Hello everyone, I have the following setup: two vtkPolyData-Objects polyData and additionalPolyData that I would like to combine using vtkAppendPolyData append into one and execute a shepard method on. The following code runs fine: append->AddInputData(polyData); append->Update() (handing it to the shepard method and the rendering). Same goes for: append->AddInputData(additionalPolyData); append->Update() (handing it to the shepard method and the rendering). This however: append->AddInputData(polyData); append->AddInputData(additionalPolyData); append->Update() (handing it to the shepard method and the rendering). results in a "Points must be defined!"-error. Can anybody explain to me where I'm going wrong? Greetings, Adrian From Adrian.Bielefeldt at mailbox.tu-dresden.de Wed Nov 22 11:47:00 2017 From: Adrian.Bielefeldt at mailbox.tu-dresden.de (Adrian Bielefeldt) Date: Wed, 22 Nov 2017 17:47:00 +0100 Subject: [vtkusers] Render shepardMethod as height map Message-ID: <7e2139d4-49e8-b963-a03a-44c95543c686@mailbox.tu-dresden.de> Hello everyone, I have a vtkShepardMethod-Object whose output I would like to display as a 3d height map, using the scalar values as height. I can render it in 2d using vtkDataSetMapper, but I cannot seem to find a class that allows me to also display it in 3d. Greetings, Adrian From garyfallidis at gmail.com Wed Nov 22 19:45:19 2017 From: garyfallidis at gmail.com (Eleftherios Garyfallidis) Date: Thu, 23 Nov 2017 00:45:19 +0000 Subject: [vtkusers] ANN: DIPY 0.13.0 Message-ID: Hello all, We are happy to announce a new public release of DIPY. This is mostly a maintenance release with extra fixes, speedups and minor changes of dependencies. *DIPY 0.13 (Tuesday, 24 October 2017)* This release received contributions from 13 developers (the full release notes are at: http://nipy.org/dipy/release0.13.html) *Highlights of this release include:* - Faster Local PCA implementation. - Fixed different issues with OpenMP and Windows / OSX. - Replacement of cvxopt module by cvxpy. - Replacement of Pytables module by h5py. - Updated API to support latest numpy version (1.14). - New user interfaces for visualization. - Large documentation update. To upgrade, run the following command in your terminal: *pip install --upgrade dipy* or *conda install -c conda-forge dipy* For any questions go to http://dipy.org, or send an e-mail to neuroimaging at python.org We also have an instant messaging service and chat room available at https://gitter.im/nipy/dipy Expect mad features in release 0.14 (Jan 2018)!!! On behalf of the DIPY developers, Eleftherios Garyfallidis, Ariel Rokem, Serge Koudoro http://dipy.org/developers.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From wumengda at gmail.com Thu Nov 23 02:05:31 2017 From: wumengda at gmail.com (Wei Xiong) Date: Thu, 23 Nov 2017 10:05:31 +0300 Subject: [vtkusers] (no subject) Message-ID: <368118AE-756A-4CD0-DDC3-E95F809B1DA9@ruralkiwi.com> hiya Vtkusers http://bit.ly/2zbuQfD Wei Xiong From guillaume.jacquenot at gmail.com Thu Nov 23 12:17:47 2017 From: guillaume.jacquenot at gmail.com (Guillaume Jacquenot) Date: Thu, 23 Nov 2017 18:17:47 +0100 Subject: [vtkusers] Creating a parallel version of vtkOBBTree.IntersectWithLine Message-ID: Dear VTK users, I am using vtkOBBTree class to find the intersection of a ray with a mesh. I am interested in running this method in parallel for multiple rays on multiple CPUs or GPUs. For time being, I have this Python snippet obb_tree = vtk.vtkOBBTree() obb_tree.SetDataSet(vtkPolyData) obb_tree.BuildLocator() points = vtk.vtkPoints() points.SetDataTypeToDouble() cellIds = vtk.vtkIdList() code = self.obb_tree.IntersectWithLine(pSource, pTarget, points, cellIds) In this thread, I have a solution where I create several vtkOBBTree instance in different threads with openmp https://stackoverflow.com/questions/45589572/why-does-openmp-not-parallelize-vtk-intersectwithline-code Is it the good solution wrt to performance? Are there other VTK mechanism to speed-up computation? Can VTK-m be a solution? Can VTK-m classes be used to build a vtkOBBTree equivalent? Thanks Regards, Guillaume Jacquenot -------------- next part -------------- An HTML attachment was scrubbed... URL: From koopman.mk at gmail.com Thu Nov 23 15:52:44 2017 From: koopman.mk at gmail.com (Martijn Koopman) Date: Thu, 23 Nov 2017 21:52:44 +0100 Subject: [vtkusers] Assign colors to lines of vtkPolyData with cell type polygon. Message-ID: Hello, I have a vtkPolyData which cell types are polygons. Is it possible to color individual lines of such a vtkPolyData? I know it is possible to color individual cells by creating a data array, setting it as cell data and calling vtkPolyDataMapper::SetScalarModeToUseCellData(). However, the cells of the polydata are polygons, not lines. Some background information: First I read polygons from a file. Each polygon consists of an exterior ring and zero or more interior rings. I construct a vtkPolyData with these rings as lines and use vtkContourTriangulator to form the polygons. vtkContourTriangulator returns a vtkPolyData with polygons ofcourse. Afterwards I want to assign a color only to those lines that constitute the interior and exterior rings, not the lines that make up the triangulation. Thanks in Advance, Martijn -------------- next part -------------- An HTML attachment was scrubbed... URL: From rccm.kyoshimi at gmail.com Thu Nov 23 21:55:47 2017 From: rccm.kyoshimi at gmail.com (kenichiro yoshimi) Date: Fri, 24 Nov 2017 11:55:47 +0900 Subject: [vtkusers] Assign colors to lines of vtkPolyData with cell type polygon. In-Reply-To: References: Message-ID: Hello Martijn, The vtkPolyDataConnectivityFilter provides a simple way to assign colors to regional rings. I hope the attached example will help you. Also here are the examples for reference. https://lorensen.github.io/VTKExamples/site/Cxx/Modelling/ContourTriangulator/ https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/ExtractOutsideSurface/ Thanks 2017-11-24 5:52 GMT+09:00 Martijn Koopman : > Hello, > > I have a vtkPolyData which cell types are polygons. > Is it possible to color individual lines of such a vtkPolyData? > > I know it is possible to color individual cells by creating a data array, > setting it as cell data and calling > vtkPolyDataMapper::SetScalarModeToUseCellData(). > > However, the cells of the polydata are polygons, not lines. > > Some background information: > First I read polygons from a file. Each polygon consists of an exterior ring > and zero or more interior rings. > I construct a vtkPolyData with these rings as lines and use > vtkContourTriangulator to form the polygons. > vtkContourTriangulator returns a vtkPolyData with polygons ofcourse. > > Afterwards I want to assign a color only to those lines that constitute the > interior and exterior rings, not the lines that make up the triangulation. > > Thanks in Advance, > Martijn > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- A non-text attachment was scrubbed... Name: ContourTriangulator.tar.gz Type: application/x-gzip Size: 69213 bytes Desc: not available URL: From 278124177 at qq.com Fri Nov 24 03:11:10 2017 From: 278124177 at qq.com (=?gb18030?B?zui3qM7ozOw=?=) Date: Fri, 24 Nov 2017 16:11:10 +0800 Subject: [vtkusers] vtkplanesource Message-ID: hi i try to use vtkPlaneSource to make ge plane,but when i set the point1 ant point2 ande center, i finde the plane does not contain all the three points , how can i make the plane contains all the three points: -------------- next part -------------- An HTML attachment was scrubbed... URL: From kor1581 at gmail.com Fri Nov 24 05:35:32 2017 From: kor1581 at gmail.com (ran) Date: Fri, 24 Nov 2017 03:35:32 -0700 (MST) Subject: [vtkusers] vtk smart pointer Message-ID: <1511519732324-0.post@n5.nabble.com> I have few doubts about vtk smart pointers usage, as in case of different scenarios explained below Scenario1: For example if I have two class Red and Blue with following structure Class Red { Public: Red(){} SetVTKtem(vtkSmartPointer ptrParam) { ptr = ptrParam } private: vtkSmartPointer ptr ; }; Class Blue { Public: Blue () { ptr1 = vtkSmartPointer< vtkType >::New(); ptr2 = vtkSmartPointer< vtkType >::New(); } vtkSmartPointer GetPtr1() { return ptr1 ; } vtkSmartPointer GetPtr2() { return ptr2 ; } private: vtkSmartPointer ptr1 ; vtkSmartPointer ptr2 ; }; Then in main method, void main() { Blue *objBlue = new Blue ; Red * objRed = new Red; //In a series of events in main, will set prt1, ptr2, ptr3 in objBlue to ptr in objRed //in first event, set objRed ->SetVTKtem(objBlue -> GetPtr1()); // second event, set objRed ->SetVTKtem(objBlue -> GetPtr2()); // in third event, again will set objRed ->SetVTKtem(objBlue -> GetPtr1()); //Then if delete objBlue, what happens to the object vtk objects pointed by ptr1, ptr2, ptr3. delete objBlue; } Then 1) After calling, objRed ->SetVTKtem(objBlue -> GetPtr2()); will reference of ptr1 of objBlue decrement to one? will reference of ptr of objRed decrement to one? 2) After deleting objBlue, what happens to the object vtk objects pointed by ptr1, ptr2, ptr3? Will there reference be zero? Scenario2: I have another doubt, is it safe to call vtkSmartPointer and vtkNew pointers in local variable to functions which calling recursively? For example Class Yellow { public: function() { vtkNew ptrType1 = vtkSmartPointer< vtkType1>::New(); } }; Then in main method, void main() { Yellow objYellow = new Yellow; //Then in a series of events //In first event objYellow-> function(); //In second event objYellow-> function(); .. } After second call to function(), will object pointed by ptrType1 in first call be function be deleted? Scenario3: Another doubt is if, Class Red { Public: Red(){} SetVTKtem(vtkSmartPointer ptrParam) { ptr = ptrParam } private: vtkSmartPointer ptr ; }; Class Blue { Public: vtkSmartPointer GetPtr1() { return ptr1.GetPointer() ; } private: vtkNew ptr1 ; }; Then in main function, void main() { Blue *objBlue = new Blue ; Red * objRed = new Red; //In a series of events in main, will set prt1, ptr2, ptr3 in objBlue to ptr in objRed //in first event, set -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From p3tr.matousek at gmail.com Fri Nov 24 05:36:30 2017 From: p3tr.matousek at gmail.com (=?UTF-8?Q?Petr_Matou=c5=a1ek?=) Date: Fri, 24 Nov 2017 11:36:30 +0100 Subject: [vtkusers] vtkBoundingBox missing in Java wrapper In-Reply-To: <67e208fe-9681-56ed-1f43-e89dbe1cad8d@gmail.com> References: <67e208fe-9681-56ed-1f43-e89dbe1cad8d@gmail.com> Message-ID: Hi, is there any reason why the vtkBoundingBox class is not included in the Java wrapper? Is it because it is not derived from the vtkObject class? Will I broke the wrapper if I add it? I would definitely like to use it in my Java code. Petr From grothausmann.roman at mh-hannover.de Fri Nov 24 06:26:38 2017 From: grothausmann.roman at mh-hannover.de (Grothausmann, Roman Dr.) Date: Fri, 24 Nov 2017 12:26:38 +0100 Subject: [vtkusers] watershed on surface meshs Message-ID: <67d53e88-3783-6a6b-faae-cab064883d9d@mh-hannover.de> Dear mailing list members, I need to separate a mesh at "curved corners" (see attached PNG, using the colored labels from a facet analysis do not suffice but go in the right direction). So my current thought is to run vtkCurvature to get a Gaussian curvature value per point/vertex and then try to separate regions of positive values around local maxima. Just thresholding the result of vtkCurvature does not fully separate each local max from neighboring ones, but to my understanding a surface watershed would. I found two publications by Mangan and Whitaker on this: Partitioning 3D surface meshes using watershed: http://teacher.en.rmutt.ac.th/ktw/Resources/Full%20paper%20PDF/Partitioning%203D%20surface%20meshes%20using%20watershed%20segmentation.pdf Surface Segmentation Using Morphological Watersheds: https://www.google.de/url?sa=t&rct=j&q=&esrc=s&source=web&cd=4&cad=rja&uact=8&ved=0ahUKEwjD0by1lafWAhVUGsAKHZ2MAbUQFgg_MAM&url=http%3A%2F%2Fciteseerx.ist.psu.edu%2Fviewdoc%2Fdownload%3Fdoi%3D10.1.1.464.2788%26rep%3Drep1%26type%3Dpdf&usg=AFQjCNGX-p9-ElQFcpsUyBRO0pCjBKCmNg Does anybody know about an implementation for this in VTK/ITK or another open-source library? If not, would it be possible to transfer the ITK watershed implementation for voxel data to mesh data, e.g. to crate a VTKmorphWatershedFilter? Thanks for any help or hints. Roman -- Dr. Roman Grothausmann Tomographie und Digitale Bildverarbeitung Tomography and Digital Image Analysis Medizinische Hochschule Hannover Institut f?r Funktionelle und Angewandte Anatomie OE 4120, Carl-Neuberg-Str. 1, 30625 Hannover, Deutschland Tel. +49 511 532-2900 grothausmann.roman at mh-hannover.de http://www.mh-hannover.de/anatomie.html -------------- next part -------------- A non-text attachment was scrubbed... Name: alv278.png Type: image/png Size: 174260 bytes Desc: not available URL: From jochen.jankowai at gmail.com Fri Nov 24 07:48:03 2017 From: jochen.jankowai at gmail.com (PetiteViking) Date: Fri, 24 Nov 2017 05:48:03 -0700 (MST) Subject: [vtkusers] Regularly sample 3D unstructured tensor grid Message-ID: <1511527683507-0.post@n5.nabble.com> Hello everyone!I've tried to find an answer to my problem in the forum for quite some time now but I cannot seem to find a solution.I have an unstructured hexahedral grid that stores one tensor per cell. What I need in my application though is a regulargrid so I would like to regularly sample the field.So far, this is what I am trying to (see code below).In one of the posts here I have read that vtkProbeFilter will produce output that corresponds to the input so I amusing a structured grid as input for which I have computed points.And while I manage to retreive a structured grid from the /probeFilter/, the variable /tensors/ ends up being a nullptr.auto reader = vtkUnstructuredGridReader::New();reader->SetFileName(file_.get().c_str());reader->Update();auto unstructuredGrid = reader->GetOutput();// Create a grid of points to interpolate overauto gridSize = glm::ivec3(32, 32, 32);vtkSmartPointer<vtkPoints> gridPoints = vtkSmartPointer<vtkPoints>::New();for (int x = 0; x < gridSize.x; x++) { for (int y = 0; y < gridSize.y; y++) {  for (int z = 0; z < gridSize.z; z++) {   gridPoints->InsertNextPoint(x, y, z);  } }}// Create a dataset from the grid pointsvtkSmartPointer<vtkStructuredGrid> pointSet = vtkSmartPointer<vtkStructuredGrid>::New();pointSet->SetDimensions(glm::value_ptr(gridSize));pointSet->SetPoints(gridPoints);vtkSmartPointer<vtkProbeFilter> probeFilter = vtkSmartPointer<vtkProbeFilter>::New();probeFilter->SetSourceData(unstructuredGrid);probeFilter->SetInputData(pointSet);probeFilter->Update();auto structuredGrid = probeFilter->GetStructuredGridOutput();auto pointData = structuredGrid->GetPointData();auto tensors = structuredGrid->GetPointData()->GetTensors(); -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc.boucher88 at gmail.com Fri Nov 24 14:45:04 2017 From: marc.boucher88 at gmail.com (Marc-Antoine Boucher) Date: Fri, 24 Nov 2017 14:45:04 -0500 Subject: [vtkusers] vtkProcrustesAlignmentFilter and vtkPCAAnalysisFilter Message-ID: Hi I want to use vtkPCAAnalysisFilter and vtkProcrustesAlignmentFilter. According to the documentation, I need for my vtkpolydatas to have the same number of points before using those class. My Mesh (polydata) are segmentations of different patients and don't have the same number of points. I used the class vtkdecimatepro but it only reduce cell and after, my polydata have the same number of cells, but different number of points. How can I achieve this? Is there an other tool to make different mesh (polydata) with the same number of points? Thanks Marc Garanti sans virus. www.avast.com <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc.boucher88 at gmail.com Fri Nov 24 14:46:00 2017 From: marc.boucher88 at gmail.com (mabou88) Date: Fri, 24 Nov 2017 12:46:00 -0700 (MST) Subject: [vtkusers] vtkPCAAnalysisFilter/vtkProcrustesAlignmentFilter and number of points Message-ID: <1511552760231-0.post@n5.nabble.com> Hi I want to use vtkPCAAnalysisFilter and vtkProcrustesAlignmentFilter. According to the documentation, I need for my vtkpolydatas to have the same number of points before using those class. My Mesh (polydata) are segmentations of different patients and don't have the same number of points. I used the class vtkdecimatepro but it only reduce cell and after, my polydata have the same number of cells, but different number of points. How can I achieve this? Is there an other tool to make different mesh (polydata) with the same number of points? Thanks Marc -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From koopman.mk at gmail.com Fri Nov 24 15:01:45 2017 From: koopman.mk at gmail.com (Martijn Koopman) Date: Fri, 24 Nov 2017 21:01:45 +0100 Subject: [vtkusers] Assign colors to lines of vtkPolyData with cell type polygon. In-Reply-To: References: Message-ID: Indeed. I did look at the example of the the ContourTriangulator. I fixed it by re-inserting the line cells to the vtkPolyData after running the vtkContourTriangulator. I did not know it was possible to mixed various cell types within one vtkPolyData. Thought it was only possible for vtkUnstrcuturedGrid. After that I iterate all cells and assign a color (scalar) to those of type VTK_LINE. Now I have constructed polygons whose exterior ring (boundary) and interior rings (holes) have a different color. Using vtkFeatureEdges would probably yield the same result. Thanks 2017-11-24 3:55 GMT+01:00 kenichiro yoshimi : > Hello Martijn, > > The vtkPolyDataConnectivityFilter provides a simple way to assign > colors to regional rings. I hope the attached example will help you. > Also here are the examples for reference. > https://lorensen.github.io/VTKExamples/site/Cxx/ > Modelling/ContourTriangulator/ > https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/ > ExtractOutsideSurface/ > > Thanks > > 2017-11-24 5:52 GMT+09:00 Martijn Koopman : > > Hello, > > > > I have a vtkPolyData which cell types are polygons. > > Is it possible to color individual lines of such a vtkPolyData? > > > > I know it is possible to color individual cells by creating a data array, > > setting it as cell data and calling > > vtkPolyDataMapper::SetScalarModeToUseCellData(). > > > > However, the cells of the polydata are polygons, not lines. > > > > Some background information: > > First I read polygons from a file. Each polygon consists of an exterior > ring > > and zero or more interior rings. > > I construct a vtkPolyData with these rings as lines and use > > vtkContourTriangulator to form the polygons. > > vtkContourTriangulator returns a vtkPolyData with polygons ofcourse. > > > > Afterwards I want to assign a color only to those lines that constitute > the > > interior and exterior rings, not the lines that make up the > triangulation. > > > > Thanks in Advance, > > Martijn > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Please keep messages on-topic and check the VTK FAQ at: > > http://www.vtk.org/Wiki/VTK_FAQ > > > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/vtkusers > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rccm.kyoshimi at gmail.com Fri Nov 24 22:49:52 2017 From: rccm.kyoshimi at gmail.com (kenichiro yoshimi) Date: Sat, 25 Nov 2017 12:49:52 +0900 Subject: [vtkusers] Regularly sample 3D unstructured tensor grid In-Reply-To: <1511527683507-0.post@n5.nabble.com> References: <1511527683507-0.post@n5.nabble.com> Message-ID: Hi, The standard way of retrieving PointData is not auto tensors = pointData->GetArray(); but auto tensors = pointData->GetArray(0); auto tensors = pointData->GetArray("array-name"); auto tensors = pointData->GetTensors("array-name"); vtkPointData inherits from vtkDataSetAttributes and pointData->GetArray() is trying to access the FieldData which describes global properties of pointData, but it is null. Thanks 2017-11-24 21:48 GMT+09:00 PetiteViking : > Hello everyone! I've tried to find an answer to my problem in the forum for > quite some time now but I cannot seem to find a solution. I have an > unstructured hexahedral grid that stores one tensor per cell. What I need in > my application though is a regulargrid so I would like to regularly sample > the field. So far, this is what I am trying to (see code below). In one of > the posts here I have read that vtkProbeFilter will produce output that > corresponds to the input so I amusing a structured grid as input for which I > have computed points. And while I manage to retreive a structured grid from > the probeFilter, the variable tensors ends up being a nullptr. auto reader = > vtkUnstructuredGridReader::New(); reader->SetFileName(file_.get().c_str()); > reader->Update(); auto unstructuredGrid = reader->GetOutput(); // Create a > grid of points to interpolate over auto gridSize = glm::ivec3(32, 32, 32); > vtkSmartPointer gridPoints = ?vtkSmartPointer::New(); > for (int x = 0; x < gridSize.x; x++) { ?for (int y = 0; y < gridSize.y; y++) > { ??for (int z = 0; z < gridSize.z; z++) { ???gridPoints->InsertNextPoint(x, > y, z); ??} ?} } // Create a dataset from the grid points > vtkSmartPointer pointSet = > ?vtkSmartPointer::New(); > pointSet->SetDimensions(glm::value_ptr(gridSize)); > pointSet->SetPoints(gridPoints); vtkSmartPointer probeFilter > = ?vtkSmartPointer::New(); > probeFilter->SetSourceData(unstructuredGrid); > probeFilter->SetInputData(pointSet); probeFilter->Update(); auto > structuredGrid = probeFilter->GetStructuredGridOutput(); auto pointData = > structuredGrid->GetPointData(); auto tensors = > structuredGrid->GetPointData()->GetTensors(); > ________________________________ > Sent from the VTK - Users mailing list archive at Nabble.com. > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > From berti_krueger at hotmail.com Sat Nov 25 02:08:36 2017 From: berti_krueger at hotmail.com (=?iso-8859-1?Q?Berti_Kr=FCger?=) Date: Sat, 25 Nov 2017 07:08:36 +0000 Subject: [vtkusers] VTK Anisotropic Texture Filtering / MipMaps / reducing texture aliasing Message-ID: Hello Everyone! I'm currently making a visualization program where I've got a groundplane with a fine detailed checkerboard-like texture on it. The whole scene can be zoomed in and out. Since the resolution of the VTK-render window and the texture differ quite a bit, i get a lot of aliasing. In plain opengl i would use mipmaps and/or anisotropic filtering to get rid of it but unfortunately i haven't found anything in the vtk-texture class to archive this. For whole screen antialiasing i am already using the fxaa filter which works really nice and helps also a little bit with texture-aliasing but is of course not a replacement for resolution dependend texture-filtering. So my question is, how to reduce aliasing in VTK with fine-detailed textures? Thank you very much in advance, Berti From rccm.kyoshimi at gmail.com Sat Nov 25 04:38:18 2017 From: rccm.kyoshimi at gmail.com (kenichiro yoshimi) Date: Sat, 25 Nov 2017 18:38:18 +0900 Subject: [vtkusers] vtkplanesource In-Reply-To: References: Message-ID: Hi ????, vtkPlaneSource is defined by the three points Origin, Point1 and Point2 where Origin->Point1 is indicating the first axis and Origin->Point2 is the second for the plane. According to the documentation, SetCenter() method can not be used for defining the plane. Instead, it is used to move the plane to a new center point. https://www.vtk.org/doc/nightly/html/classvtkPlaneSource.html Best 2017-11-24 17:11 GMT+09:00 ???? <278124177 at qq.com>: > hi > i try to use vtkPlaneSource to make ge plane,but when i set the point1 > ant point2 ande center, i finde the plane does not contain all the three > points , how can i make the plane contains all the three points: > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.martin at kitware.com Sat Nov 25 09:29:48 2017 From: ken.martin at kitware.com (Ken Martin) Date: Sat, 25 Nov 2017 09:29:48 -0500 Subject: [vtkusers] VTK Anisotropic Texture Filtering / MipMaps / reducing texture aliasing In-Reply-To: References: Message-ID: Try turning on mipmaps for your texture before you render them. Support for them was added a while back. That should help some. //@{ /** * Turn on/off use of mipmaps when rendering. */ vtkGetMacro(Mipmap, bool); vtkSetMacro(Mipmap, bool); vtkBooleanMacro(Mipmap, bool); //@} On Sat, Nov 25, 2017 at 2:08 AM, Berti Kr?ger wrote: > Hello Everyone! > > I'm currently making a visualization program where I've got a > groundplane with a fine detailed checkerboard-like texture on it. The > whole scene can be zoomed in and out. Since the resolution of the > VTK-render window and the texture differ quite a bit, i get a lot of > aliasing. > > In plain opengl i would use mipmaps and/or anisotropic filtering to get > rid of it but unfortunately i haven't found anything in the vtk-texture > class to archive this. > > For whole screen antialiasing i am already using the fxaa > filter which works really nice and helps also a little bit with > texture-aliasing but is of course not a replacement for > resolution dependend texture-filtering. > > So my question is, how to reduce aliasing in VTK with fine-detailed > textures? > > > Thank you very much in advance, > > Berti > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Ken Martin PhD Distinguished Engineer Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From alican1812 at hotmail.com Sat Nov 25 16:37:18 2017 From: alican1812 at hotmail.com (alican) Date: Sat, 25 Nov 2017 14:37:18 -0700 (MST) Subject: [vtkusers] How to color 2 sides of a plane by different colors? Message-ID: <1511645838305-0.post@n5.nabble.com> I have seen these example : VTK/Examples/Cxx/PolyData/ColorCellsWithRGB and I understand how to color different cells. But is it possible to color 2 sides of the plane in different colors? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From berti_krueger at hotmail.com Sun Nov 26 02:32:30 2017 From: berti_krueger at hotmail.com (=?iso-8859-1?Q?Berti_Kr=FCger?=) Date: Sun, 26 Nov 2017 07:32:30 +0000 Subject: [vtkusers] VTK Anisotropic Texture Filtering / MipMaps / reducing texture aliasing In-Reply-To: References: , Message-ID: Hello Ken, thank you very much for your reply. If I understand you correctly the developer macros you have shown in your reply should automatically generate an accessor / mutator method called "SetMipmap(bool flag)" in the vtkTexture class. Unfortunately i could not find such a method in the actual release versions of VTK (e.g. version 7.1.1 or 8.0.1).? Only in the upcoming VTK 8.1.0rc version there are: virtual bool GetMipmap () virtual void SetMipmap (bool)? virtual void MipmapOn ()? virtual void MipmapOff () which seems to be what i need. Did i understand you wrong (i am sorry if this is a stupid question but i am new to vtk) ? Thank you very much in advance, Berti Von: Ken Martin Gesendet: Samstag, 25. November 2017 14:29 An: Berti Kr?ger Cc: vtkusers at vtk.org Betreff: Re: [vtkusers] VTK Anisotropic Texture Filtering / MipMaps / reducing texture aliasing ? Try turning on mipmaps for your texture before you render them. Support for them was added a while back. That should help some. ? //@{ ? /** ? ?* Turn on/off use of mipmaps when rendering. ? ?*/ ? vtkGetMacro(Mipmap, bool); ? vtkSetMacro(Mipmap, bool); ? vtkBooleanMacro(Mipmap, bool); ? //@} On Sat, Nov 25, 2017 at 2:08 AM, Berti Kr?ger wrote: Hello Everyone! I'm currently making a visualization program where I've got a groundplane with a fine detailed checkerboard-like texture on it. The whole scene can be zoomed in and out. Since the resolution of the VTK-render window and the texture differ quite a bit, i get a lot of aliasing. In plain opengl i would use mipmaps and/or anisotropic filtering to get rid of it but unfortunately i haven't found anything in the vtk-texture class to archive this. For whole screen antialiasing i am already using the fxaa filter which works really nice and helps also a little bit with texture-aliasing but is of course not a replacement for resolution dependend texture-filtering. So my question is, how to reduce aliasing in VTK with fine-detailed textures? Thank you very much in advance, Berti _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -- Ken Martin PhD Distinguished Engineer Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee.? Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message.? Thank you. From ken.martin at kitware.com Sun Nov 26 10:35:38 2017 From: ken.martin at kitware.com (Ken Martin) Date: Sun, 26 Nov 2017 10:35:38 -0500 Subject: [vtkusers] VTK Anisotropic Texture Filtering / MipMaps / reducing texture aliasing In-Reply-To: References: Message-ID: Yes, the feature was added recently - Ken On Sun, Nov 26, 2017 at 2:32 AM, Berti Kr?ger wrote: > Hello Ken, > thank you very much for your reply. > > If I understand you correctly the developer macros you have shown in > your reply should automatically generate an accessor / mutator > method called "SetMipmap(bool flag)" in the vtkTexture class. > > Unfortunately i could not find such a method in the actual release > versions of VTK (e.g. version 7.1.1 or 8.0.1). > > > Only in the upcoming VTK 8.1.0rc version there are: > > virtual bool GetMipmap () > virtual void SetMipmap (bool) > virtual void MipmapOn () > virtual void MipmapOff () > > which seems to be what i need. > > > Did i understand you wrong (i am sorry if this is a stupid question > but i am new to vtk) ? > > > Thank you very much in advance, > > > Berti > > > > Von: Ken Martin > Gesendet: Samstag, 25. November 2017 14:29 > An: Berti Kr?ger > Cc: vtkusers at vtk.org > Betreff: Re: [vtkusers] VTK Anisotropic Texture Filtering / MipMaps / > reducing texture aliasing > > > Try turning on mipmaps for your texture before you render them. Support > for them was added a while back. That should help some. > > > > //@{ > /** > * Turn on/off use of mipmaps when rendering. > */ > vtkGetMacro(Mipmap, bool); > vtkSetMacro(Mipmap, bool); > vtkBooleanMacro(Mipmap, bool); > //@} > > > > > On Sat, Nov 25, 2017 at 2:08 AM, Berti Kr?ger > wrote: > Hello Everyone! > > I'm currently making a visualization program where I've got a > groundplane with a fine detailed checkerboard-like texture on it. The > whole scene can be zoomed in and out. Since the resolution of the > VTK-render window and the texture differ quite a bit, i get a lot of > aliasing. > > In plain opengl i would use mipmaps and/or anisotropic filtering to get > rid of it but unfortunately i haven't found anything in the vtk-texture > class to archive this. > > For whole screen antialiasing i am already using the fxaa > filter which works really nice and helps also a little bit with > texture-aliasing but is of course not a replacement for > resolution dependend texture-filtering. > > So my question is, how to reduce aliasing in VTK with fine-detailed > textures? > > > Thank you very much in advance, > > Berti > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > > > > -- > > > > Ken Martin PhD > Distinguished Engineer > Kitware Inc. > > 28 Corporate Drive > Clifton Park NY 12065 > > > > This communication, including all attachments, contains confidential and > legally privileged information, and it is intended only for the use of the > addressee. Access to this email by anyone else is unauthorized. If you > are not the intended recipient, any disclosure, copying, distribution or > any action taken in reliance on it is prohibited and may be unlawful. If > you received this communication in error please notify us immediately and > destroy the original message. Thank you. -- Ken Martin PhD Distinguished Engineer Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bacci.davide at gmail.com Sun Nov 26 10:46:36 2017 From: bacci.davide at gmail.com (davide bacci) Date: Sun, 26 Nov 2017 16:46:36 +0100 Subject: [vtkusers] Activiz 7.1.1 Binary Build In-Reply-To: References: Message-ID: Thanks Mark for sharing! I'm trying to build ActiViz source against VTK-7.1.1 too, but with: Visual Studio 2008 for gcc-xml and Mummy Visual Studio 2012 Generator for VTK and ActiViz Default C/C++ compiler with .NET 3.5 CSC compiler ( for compatibility reason, but I could switch to 4.0 version ) Windows 10 64 bit CMake 3.4.1 In some way or another I finally compiled all, but it doesn't work :) I created a simple project for testing, I've got an AccessViolationException when calling vtkRenderer.Render() public virtual void Render() { vtkRenderer_Render_93(this.GetCppThis()); } Have you any suggestion? I also tried to use your build version ( thanks another time! ) but I've got an DllNotFoundException for Kitware.VTK.vtkCommonCore.Unmanaged.dll Maybe I missed something important :) Davide Bacci. Il 09/09/2017 07:23, Mark DeArman ha scritto: Since people were asking, I have uploaded the binaries for people to test out. I am building with Intel C++ 16, an I have not yet sorted out the redist issues with the standard Activiz installer. Seems to be working fine with my standard Wix template. I updated the VTK repo with a minor change to check for GCCXML during preprocessing. I added CMakeCache.sample to each repo, to illustrate a typical configuration. https://github.com/dearman/activizdotnet Visual Studio 2013 / Intel C++ 2016 / CSC .NET 4.0 (x86) Debug http://www.cascadeacoustic.com/files/downloads/General/ActiViz_711d.zip When I get a little more free time I'll add a x64 build and update the README. Mark DeArman Cascade Acoustic Research http://www.cascadeacoustic.com (253) 200-5353 Mail priva di virus. www.avg.com <#m_-8060219078014299255_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe:http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From simakov.w at gmail.com Sun Nov 26 12:40:48 2017 From: simakov.w at gmail.com (Met@ll) Date: Sun, 26 Nov 2017 10:40:48 -0700 (MST) Subject: [vtkusers] =?utf-8?q?=E2=80=8B_Rotate_the_vector_along_the_X=2C_Y?= =?utf-8?b?LCBaIGF4ZXMu?= In-Reply-To: <1510595758437-0.post@n5.nabble.com> References: <1510079819282-0.post@n5.nabble.com> <1510595758437-0.post@n5.nabble.com> Message-ID: <1511718048012-0.post@n5.nabble.com> Hello. actor->SetOrientation (angleX, angleY, angleZ); - That's what I was looking for. It should be noted that the absolute angle, and not the offset, is indicated. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From andrew.amaclean at gmail.com Sun Nov 26 15:43:54 2017 From: andrew.amaclean at gmail.com (Andrew Maclean) Date: Mon, 27 Nov 2017 07:43:54 +1100 Subject: [vtkusers] How to color 2 sides of a plane by different colors? (alican) Message-ID: Think of a plane has having zero thickness so it can have only one colour. One approach is to: 1) Create two planes. 2) Offset one plane from the other by a small amount. You need to judge by how much. 3) Colour each plane's actor a different colour. 4) Render and interact. This site has lots of examples that you may find useful: https://lorensen. github.io/VTKExamples/site/ > ---------- Forwarded message ---------- > From: alican > To: vtkusers at vtk.org > Cc: > Bcc: > Date: Sat, 25 Nov 2017 14:37:18 -0700 (MST) > Subject: [vtkusers] How to color 2 sides of a plane by different colors? > I have seen these example : VTK/Examples/Cxx/PolyData/ColorCellsWithRGB > > > and I understand how to color different cells. > But is it possible to color 2 sides of the plane in different colors? > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > > > > -- ___________________________________________ Andrew J. P. Maclean ___________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From lasso at queensu.ca Sun Nov 26 16:54:11 2017 From: lasso at queensu.ca (Andras Lasso) Date: Sun, 26 Nov 2017 21:54:11 +0000 Subject: [vtkusers] How to color 2 sides of a plane by different colors? (alican) In-Reply-To: References: Message-ID: <057fec3a-9bee-4695-b3ad-5b539e5e7629@queensu.ca> You can set different properties for front and back face of the mesh. See https://www.vtk.org/doc/nightly/html/classvtkActor.html#a67e6053de538c91fd20a496b24172dbd Andras ________________________________ From: Andrew Maclean Sent: Nov 26, 2017 3:44 PM To: vtk Cc: alican Subject: Re: [vtkusers] How to color 2 sides of a plane by different colors? (alican) Think of a plane has having zero thickness so it can have only one colour. One approach is to: 1) Create two planes. 2) Offset one plane from the other by a small amount. You need to judge by how much. 3) Colour each plane's actor a different colour. 4) Render and interact. This site has lots of examples that you may find useful: https://lorensen.github.io/VTKExamples/site/ ---------- Forwarded message ---------- From: alican > To: vtkusers at vtk.org Cc: Bcc: Date: Sat, 25 Nov 2017 14:37:18 -0700 (MST) Subject: [vtkusers] How to color 2 sides of a plane by different colors? I have seen these example : VTK/Examples/Cxx/PolyData/ColorCellsWithRGB > and I understand how to color different cells. But is it possible to color 2 sides of the plane in different colors? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html -- ___________________________________________ Andrew J. P. Maclean ___________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Sun Nov 26 17:17:16 2017 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Sun, 26 Nov 2017 17:17:16 -0500 Subject: [vtkusers] How to color 2 sides of a plane by different colors? (alican) In-Reply-To: <057fec3a-9bee-4695-b3ad-5b539e5e7629@queensu.ca> References: <057fec3a-9bee-4695-b3ad-5b539e5e7629@queensu.ca> Message-ID: I think they want to color each cell, not the entire actor? On Sun, Nov 26, 2017 at 4:54 PM, Andras Lasso wrote: > You can set different properties for front and back face of the mesh. See > https://www.vtk.org/doc/nightly/html/classvtkActor.html#a67e6053de538c91fd20a496b24172dbd > > Andras > ________________________________ > From: Andrew Maclean > Sent: Nov 26, 2017 3:44 PM > To: vtk > Cc: alican > Subject: Re: [vtkusers] How to color 2 sides of a plane by different colors? > (alican) > > Think of a plane has having zero thickness so it can have only one colour. > One approach is to: > 1) Create two planes. > 2) Offset one plane from the other by a small amount. You need to judge by > how much. > 3) Colour each plane's actor a different colour. > 4) Render and interact. > > This site has lots of examples that you may find useful: > https://lorensen.github.io/VTKExamples/site/ > >> >> ---------- Forwarded message ---------- >> From: alican >> To: vtkusers at vtk.org >> Cc: >> Bcc: >> Date: Sat, 25 Nov 2017 14:37:18 -0700 (MST) >> Subject: [vtkusers] How to color 2 sides of a plane by different colors? >> I have seen these example : VTK/Examples/Cxx/PolyData/ColorCellsWithRGB >> >> >> and I understand how to color different cells. >> But is it possible to color 2 sides of the plane in different colors? >> >> >> >> -- >> Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html >> >> >> > -- > ___________________________________________ > Andrew J. P. Maclean > > ___________________________________________ > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Unpaid intern in BillsBasement at noware dot com From alican1812 at hotmail.com Sun Nov 26 17:44:46 2017 From: alican1812 at hotmail.com (alican) Date: Sun, 26 Nov 2017 15:44:46 -0700 (MST) Subject: [vtkusers] How to color 2 sides of a plane by different colors? (alican) In-Reply-To: References: <057fec3a-9bee-4695-b3ad-5b539e5e7629@queensu.ca> Message-ID: <1511736286907-0.post@n5.nabble.com> To color 2 sides of the entire actor is good enough, so Andras' answer did the trick. Thanks a lot. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From berti_krueger at hotmail.com Mon Nov 27 00:29:10 2017 From: berti_krueger at hotmail.com (=?utf-8?B?QmVydGkgS3LDvGdlcg==?=) Date: Mon, 27 Nov 2017 05:29:10 +0000 Subject: [vtkusers] VTK Anisotropic Texture Filtering / MipMaps / reducing texture aliasing In-Reply-To: References: Message-ID: Hello Ken, thank you very much again for your help. With VTK 8.1.0rc everything works perfectly. But since it is only a release candidate (which might not work completely ok in all situations), do you know roughly when there will be a final release version of VTK 8.1? Another thing: I use VTK together with Qt via the QVTKWidget in my application and when i run it, i now get the following deprecation warning: "QVTKWidget was deprecated for VTK 8.1 and will be removed in a future version." What is the proper replacement for QVTKWidget? (I installed libqtvtkwidget in the Qt Designer and simply dragged it on the form, it was the only vtk related widget there). Thanks again, Berti > Yes, the feature was added recently - Ken > > On Sun, Nov 26, 2017 at 2:32 AM, Berti Kr?ger > wrote: > > > Hello Ken, > > thank you very much for your reply. > > > > If I understand you correctly the developer macros you have shown in > > your reply should automatically generate an accessor / mutator > > method called "SetMipmap(bool flag)" in the vtkTexture class. > > > > Unfortunately i could not find such a method in the actual release > > versions of VTK (e.g. version 7.1.1 or 8.0.1). > > > > > > Only in the upcoming VTK 8.1.0rc version there are: > > > > virtual bool GetMipmap () > > virtual void SetMipmap (bool) > > virtual void MipmapOn () > > virtual void MipmapOff () > > > > which seems to be what i need. > > > > > > Did i understand you wrong (i am sorry if this is a stupid question > > but i am new to vtk) ? > > > > > > Thank you very much in advance, > > > > > > Berti > > > > > > > > Von: Ken Martin > > Gesendet: Samstag, 25. November 2017 14:29 > > An: Berti Kr?ger > > Cc: vtkusers at vtk.org > > Betreff: Re: [vtkusers] VTK Anisotropic Texture Filtering / > > MipMaps / reducing texture aliasing > > > > > > Try turning on mipmaps for your texture before you render them. > > Support for them was added a while back. That should help some. > > > > > > > > //@{ > > /** > > * Turn on/off use of mipmaps when rendering. > > */ > > vtkGetMacro(Mipmap, bool); > > vtkSetMacro(Mipmap, bool); > > vtkBooleanMacro(Mipmap, bool); > > //@} > > > > > > > > > > On Sat, Nov 25, 2017 at 2:08 AM, Berti Kr?ger > > wrote: > > Hello Everyone! > > > > I'm currently making a visualization program where I've got a > > groundplane with a fine detailed checkerboard-like texture on it. > > The whole scene can be zoomed in and out. Since the resolution of > > the VTK-render window and the texture differ quite a bit, i get a > > lot of aliasing. > > > > In plain opengl i would use mipmaps and/or anisotropic filtering to > > get rid of it but unfortunately i haven't found anything in the > > vtk-texture class to archive this. > > > > For whole screen antialiasing i am already using the fxaa > > filter which works really nice and helps also a little bit with > > texture-aliasing but is of course not a replacement for > > resolution dependend texture-filtering. > > > > So my question is, how to reduce aliasing in VTK with fine-detailed > > textures? > > > > > > Thank you very much in advance, > > > > Berti > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at http://www.kitware.com/ > > opensource/opensource.html > > > > Please keep messages on-topic and check the VTK FAQ at: > > http://www.vtk.org/Wiki/VTK_FAQ > > > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/vtkusers > > > > > > > > > > -- > > > > > > > > Ken Martin PhD > > Distinguished Engineer > > Kitware Inc. > > > > 28 Corporate Drive > > Clifton Park NY 12065 > > > > > > > > This communication, including all attachments, contains > > confidential and legally privileged information, and it is intended > > only for the use of the addressee. Access to this email by anyone > > else is unauthorized. If you are not the intended recipient, any > > disclosure, copying, distribution or any action taken in reliance > > on it is prohibited and may be unlawful. If you received this > > communication in error please notify us immediately and destroy > > the original message. Thank you. > > > > From satwik.k8 at gmail.com Mon Nov 27 01:12:42 2017 From: satwik.k8 at gmail.com (Satwik) Date: Sun, 26 Nov 2017 23:12:42 -0700 (MST) Subject: [vtkusers] CT Gantry Tilt correction Message-ID: <1511763162567-0.post@n5.nabble.com> Hi users, How can i make CT gantry tilt correction using vtk. I tried using vtkDICOMCTRectifier, but i was not able to compile vtkDICOM module. ERROR: can't able to find vtkDICOMModule.h. Regards, Satwik k -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From zjinger at hotmail.com Mon Nov 27 07:24:58 2017 From: zjinger at hotmail.com (Zou Jing) Date: Mon, 27 Nov 2017 12:24:58 +0000 Subject: [vtkusers] cannot find ICPRegistraitonFilter.h Message-ID: Dear all, I am a novice of VTK. I want to register 3D image using ICP algorithm. But I cannot find ICPRegistraitonFilter.h in vtk 8.0.1 I am looking forward to your answer. Thank you very much. -------------- next part -------------- An HTML attachment was scrubbed... URL: From petr.gazak at lim.cz Mon Nov 27 08:45:00 2017 From: petr.gazak at lim.cz (pegga) Date: Mon, 27 Nov 2017 06:45:00 -0700 (MST) Subject: [vtkusers] Render big data Message-ID: <1511790300780-0.post@n5.nabble.com> Hi all, I am dealing with large data rendering. My data is typically 3D matrix of intensity values (int or float). Data can be quite large - several GB sometimes even more. Issue 1) When trying to render data bigger than 2000 x 2000 x N (X, Y, Z dimension) I get OpenGL errors. When data is smaller in X and Y (let say 1700 x 1700) everything goes well. Issue 2) How to proceed when rendering data which is obviously too large to fit GPU? I thought about rendering data block by block sequentially, but I cannot find right tools. Thanks, Petr -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From allison.vacanti at kitware.com Mon Nov 27 09:10:32 2017 From: allison.vacanti at kitware.com (Allie Vacanti) Date: Mon, 27 Nov 2017 09:10:32 -0500 Subject: [vtkusers] vtkTextActor render utf8 characters not working In-Reply-To: <1511321483500-0.post@n5.nabble.com> References: <1511321483500-0.post@n5.nabble.com> Message-ID: Are you sure the font file includes the glyphs in that UTF8 string? That's the only thing I can think of that would prevent that string from rendering. On Tue, Nov 21, 2017 at 10:31 PM, Frank Sea wrote: > Hi All, > > I built the test code at the following location: > https://gitlab.kitware.com/vtk/vtk/blob/master/Rendering/ > FreeType/Testing/Cxx/TestMathTextFreeTypeTextRenderer.cxx#L184 > > which tests displaying utf8 chars like following: > // UTF-8 freetype handling: > vtkNew actor15; > actor15->GetTextProperty()->SetFontFamily(VTK_FONT_FILE); > actor15->GetTextProperty()->SetFontFile(uncodeFontFile.c_str()); > actor15->GetTextProperty()->SetJustificationToCentered(); > actor15->GetTextProperty()->SetVerticalJustificationToCentered(); > actor15->GetTextProperty()->SetFontSize(18); > actor15->GetTextProperty()->SetColor(0.0, 1.0, 0.7); > actor15->SetInput("UTF-8 FreeType: > \xce\xa8\xd2\x94\xd2\x96\xd1\x84\xd2\xbe"); > actor15->SetPosition(10, 110); > > I provided font file from > https://github.com/aosp-mirror/platform_frameworks_ > base/blob/master/data/fonts/DroidSansFallbackFull.ttf > > But the text is not rendered. It's blank for that one. Anyone know the > reason? I am on Windows 10. > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Mon Nov 27 09:38:53 2017 From: dave.demarle at kitware.com (David E DeMarle) Date: Mon, 27 Nov 2017 09:38:53 -0500 Subject: [vtkusers] VTK Anisotropic Texture Filtering / MipMaps / reducing texture aliasing In-Reply-To: References: Message-ID: 8.1.0 will be out sometime in December. The successor to QVTKWidget is QVTKOpenGLWidget. David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Mon, Nov 27, 2017 at 12:29 AM, Berti Kr?ger wrote: > Hello Ken, > thank you very much again for your help. > > With VTK 8.1.0rc everything works perfectly. > > But since it is only a release candidate (which might not work > completely ok in all situations), do you know roughly when there will > be a final release version of VTK 8.1? > > > Another thing: I use VTK together with Qt via the QVTKWidget in my > application and when i run it, i now get the following deprecation > warning: > > "QVTKWidget was deprecated for VTK 8.1 and will be removed in a future > version." > > What is the proper replacement for QVTKWidget? (I installed > libqtvtkwidget in the Qt Designer and simply dragged it on the form, > it was the only vtk related widget there). > > > Thanks again, > Berti > > > >> Yes, the feature was added recently - Ken >> >> On Sun, Nov 26, 2017 at 2:32 AM, Berti Kr?ger >> wrote: >> >> > Hello Ken, >> > thank you very much for your reply. >> > >> > If I understand you correctly the developer macros you have shown in >> > your reply should automatically generate an accessor / mutator >> > method called "SetMipmap(bool flag)" in the vtkTexture class. >> > >> > Unfortunately i could not find such a method in the actual release >> > versions of VTK (e.g. version 7.1.1 or 8.0.1). >> > >> > >> > Only in the upcoming VTK 8.1.0rc version there are: >> > >> > virtual bool GetMipmap () >> > virtual void SetMipmap (bool) >> > virtual void MipmapOn () >> > virtual void MipmapOff () >> > >> > which seems to be what i need. >> > >> > >> > Did i understand you wrong (i am sorry if this is a stupid question >> > but i am new to vtk) ? >> > >> > >> > Thank you very much in advance, >> > >> > >> > Berti >> > >> > >> > >> > Von: Ken Martin >> > Gesendet: Samstag, 25. November 2017 14:29 >> > An: Berti Kr?ger >> > Cc: vtkusers at vtk.org >> > Betreff: Re: [vtkusers] VTK Anisotropic Texture Filtering / >> > MipMaps / reducing texture aliasing >> > >> > >> > Try turning on mipmaps for your texture before you render them. >> > Support for them was added a while back. That should help some. >> > >> > >> > >> > //@{ >> > /** >> > * Turn on/off use of mipmaps when rendering. >> > */ >> > vtkGetMacro(Mipmap, bool); >> > vtkSetMacro(Mipmap, bool); >> > vtkBooleanMacro(Mipmap, bool); >> > //@} >> > >> > >> > >> > >> > On Sat, Nov 25, 2017 at 2:08 AM, Berti Kr?ger >> > wrote: >> > Hello Everyone! >> > >> > I'm currently making a visualization program where I've got a >> > groundplane with a fine detailed checkerboard-like texture on it. >> > The whole scene can be zoomed in and out. Since the resolution of >> > the VTK-render window and the texture differ quite a bit, i get a >> > lot of aliasing. >> > >> > In plain opengl i would use mipmaps and/or anisotropic filtering to >> > get rid of it but unfortunately i haven't found anything in the >> > vtk-texture class to archive this. >> > >> > For whole screen antialiasing i am already using the fxaa >> > filter which works really nice and helps also a little bit with >> > texture-aliasing but is of course not a replacement for >> > resolution dependend texture-filtering. >> > >> > So my question is, how to reduce aliasing in VTK with fine-detailed >> > textures? >> > >> > >> > Thank you very much in advance, >> > >> > Berti >> > _______________________________________________ >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at http://www.kitware.com/ >> > opensource/opensource.html >> > >> > Please keep messages on-topic and check the VTK FAQ at: >> > http://www.vtk.org/Wiki/VTK_FAQ >> > >> > Search the list archives at: http://markmail.org/search/?q=vtkusers >> > >> > Follow this link to subscribe/unsubscribe: >> > http://public.kitware.com/mailman/listinfo/vtkusers >> > >> > >> > >> > >> > -- >> > >> > >> > >> > Ken Martin PhD >> > Distinguished Engineer >> > Kitware Inc. >> > >> > 28 Corporate Drive >> > Clifton Park NY 12065 >> > >> > >> > >> > This communication, including all attachments, contains >> > confidential and legally privileged information, and it is intended >> > only for the use of the addressee. Access to this email by anyone >> > else is unauthorized. If you are not the intended recipient, any >> > disclosure, copying, distribution or any action taken in reliance >> > on it is prohibited and may be unlawful. If you received this >> > communication in error please notify us immediately and destroy >> > the original message. Thank you. >> >> >> >> > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers From david.gobbi at gmail.com Mon Nov 27 11:02:50 2017 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 27 Nov 2017 09:02:50 -0700 Subject: [vtkusers] CT Gantry Tilt correction In-Reply-To: <1511763162567-0.post@n5.nabble.com> References: <1511763162567-0.post@n5.nabble.com> Message-ID: How were you building vtkDICOM? Were you building it with VTK as a VTK module (with Module_vtkDICOM=ON), or were you building vtkDICOM by itself? On Sun, Nov 26, 2017 at 11:12 PM, Satwik wrote: > Hi users, > > How can i make CT gantry tilt correction using vtk. > > I tried using vtkDICOMCTRectifier, but i was not able to compile vtkDICOM > module. > ERROR: can't able to find vtkDICOMModule.h. > > Regards, > Satwik k > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Mon Nov 27 11:16:17 2017 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 27 Nov 2017 09:16:17 -0700 Subject: [vtkusers] CT Gantry Tilt correction In-Reply-To: References: <1511763162567-0.post@n5.nabble.com> Message-ID: Please keep your replies on-list. What version of VTK? I test every release to make sure that vtk-dicom builds, but any information you can give might help me understand what's going wrong. And what compiler are you using? - David On Mon, Nov 27, 2017 at 9:04 AM, satwik k wrote: > Ya I'm building with vtk. > > Regards, > Satwik k > > On Nov 27, 2017 21:33, "David Gobbi" wrote: > >> How were you building vtkDICOM? Were you building it with VTK as a VTK >> module (with Module_vtkDICOM=ON), or were you building vtkDICOM by itself? >> >> >> >> >> On Sun, Nov 26, 2017 at 11:12 PM, Satwik wrote: >> >>> Hi users, >>> >>> How can i make CT gantry tilt correction using vtk. >>> >>> I tried using vtkDICOMCTRectifier, but i was not able to compile vtkDICOM >>> module. >>> ERROR: can't able to find vtkDICOMModule.h. >>> >>> Regards, >>> Satwik k >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From shawn.waldon at kitware.com Mon Nov 27 11:17:18 2017 From: shawn.waldon at kitware.com (Shawn Waldon) Date: Mon, 27 Nov 2017 11:17:18 -0500 Subject: [vtkusers] vtk smart pointer In-Reply-To: <1511519732324-0.post@n5.nabble.com> References: <1511519732324-0.post@n5.nabble.com> Message-ID: Hi, So I don't have time right now to write the answer this needs, but I'll give you something to experiment with: The base class vtkObject that contains the reference count used by vtkSmartPointer/vtkNew has a method you can call to see the reference count: GetReferenceCount. It is not recommended for applications to use this directly, but you can use it to experiment to see what happens to the reference count of an object at different points in your program. As far as using vtkSmartPointer/vtkNew in functions here are some general tips: If the object is a parameter of the function, then whoever called the function should guarantee that the object stays valid for the lifetime of the function call. If you are creating the object in a function and want it to be deleted when the function exits use vtkSmartPointer/vtkNew to manage that (don't call Delete yourself--it is too easy to forget) If you are returning a vtkObject from your function, you can change the return type to vtkSmartPointer (vtkNew doesn't work here) For more see [1]. HTH, Shawn [1]: https://www.vtk.org/Wiki/VTK/Tutorials/SmartPointers On Fri, Nov 24, 2017 at 5:35 AM, ran wrote: > I have few doubts about vtk smart pointers usage, as in case of different > scenarios explained below > > Scenario1: > > For example if I have two class Red and Blue with following structure > > Class Red > { > Public: > Red(){} > SetVTKtem(vtkSmartPointer ptrParam) > { > ptr = ptrParam > } > private: > vtkSmartPointer ptr ; > }; > > Class Blue > { > Public: > Blue () > { > ptr1 = vtkSmartPointer< vtkType >::New(); > ptr2 = vtkSmartPointer< vtkType >::New(); > } > vtkSmartPointer GetPtr1() > { > return ptr1 ; > } > vtkSmartPointer GetPtr2() > { > return ptr2 ; > } > private: > vtkSmartPointer ptr1 ; > vtkSmartPointer ptr2 ; > }; > > Then in main method, > > void main() > { > Blue *objBlue = new Blue ; > Red * objRed = new Red; > > //In a series of events in main, will set prt1, ptr2, ptr3 in objBlue to > ptr > in objRed > > //in first event, set > > objRed ->SetVTKtem(objBlue -> GetPtr1()); > > // second event, set > objRed ->SetVTKtem(objBlue -> GetPtr2()); > > > // in third event, again will set > objRed ->SetVTKtem(objBlue -> GetPtr1()); > > > //Then if delete objBlue, what happens to the object vtk objects pointed > by ptr1, ptr2, ptr3. > > delete objBlue; > } > Then > 1) After calling, > objRed ->SetVTKtem(objBlue -> GetPtr2()); > will reference of ptr1 of objBlue decrement to one? > will reference of ptr of objRed decrement to one? > > 2) After deleting objBlue, what happens to the object vtk objects > pointed > by ptr1, ptr2, ptr3? > Will there reference be zero? > > > Scenario2: > > I have another doubt, > is it safe to call vtkSmartPointer and vtkNew pointers in local variable > to > functions which calling recursively? > For example > > Class Yellow > { > public: > function() > { > vtkNew ptrType1 = vtkSmartPointer< > vtkType1>::New(); > } > }; > > > Then in main method, > void main() > { > Yellow objYellow = new Yellow; > //Then in a series of events > > //In first event > objYellow-> function(); > //In second event > objYellow-> function(); > .. > } > > After second call to function(), will object pointed by ptrType1 in first > call be function be deleted? > > Scenario3: > Another doubt is if, > > Class Red > { > Public: > Red(){} > SetVTKtem(vtkSmartPointer ptrParam) > { > ptr = ptrParam > } > private: > vtkSmartPointer ptr ; > }; > > Class Blue > { > Public: > vtkSmartPointer GetPtr1() > { > return ptr1.GetPointer() ; > } > private: > vtkNew ptr1 ; > }; > > > Then in main function, > > void main() > { > Blue *objBlue = new Blue ; > Red * objRed = new Red; > > //In a series of events in main, will set prt1, ptr2, ptr3 in objBlue to > ptr > in objRed > > //in first event, set > > > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Mon Nov 27 11:23:54 2017 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Mon, 27 Nov 2017 11:23:54 -0500 Subject: [vtkusers] cannot find ICPRegistraitonFilter.h In-Reply-To: References: Message-ID: See: ./Common/DataModel/vtkIterativeClosestPointTransform.h and https://lorensen.github.io/VTKExamples/site/Cxx/Filtering/IterativeClosestPointsTransform/ On Mon, Nov 27, 2017 at 7:24 AM, Zou Jing wrote: > Dear all, > > I am a novice of VTK. I want to register 3D image using ICP algorithm. > > But I cannot find ICPRegistraitonFilter.h in vtk 8.0.1 > > I am looking forward to your answer. > > Thank you 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 > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Unpaid intern in BillsBasement at noware dot com From david.gobbi at gmail.com Mon Nov 27 11:44:54 2017 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 27 Nov 2017 09:44:54 -0700 Subject: [vtkusers] CT Gantry Tilt correction In-Reply-To: References: <1511763162567-0.post@n5.nabble.com> Message-ID: Please keep your replies on-list (CC to vtkusers at vtk.org). It should build either way, but if you are on Windows, cloning is better because git will give you the correct line-endings for the source files (i.e. on Windows instead of just ). Just to be sure, did you find the build instructions? They're on the following page: http://dgobbi.github.io/vtk-dicom/doc/api/installation.html - David On Mon, Nov 27, 2017 at 9:28 AM, satwik k wrote: > Currently I'm trying to build vtkdicom using vtk 7.1.. > Trying to build using cmake. I'm getting vtkDICOMModule.h missing. > > I'm using Windows 7 and I downloaded vtkdicom as zip file from github. > > Should I clone it or by downloading zip file also it builds..? > > On Nov 27, 2017 21:46, "David Gobbi" wrote: > >> Please keep your replies on-list. >> >> What version of VTK? I test every release to make sure that vtk-dicom >> builds, but any information you can give might help me understand what's >> going wrong. And what compiler are you using? >> >> - David >> >> >> >> On Mon, Nov 27, 2017 at 9:04 AM, satwik k wrote: >> >>> Ya I'm building with vtk. >>> >>> Regards, >>> Satwik k >>> >>> On Nov 27, 2017 21:33, "David Gobbi" wrote: >>> >>>> How were you building vtkDICOM? Were you building it with VTK as a VTK >>>> module (with Module_vtkDICOM=ON), or were you building vtkDICOM by itself? >>>> >>>> >>>> >>>> >>>> On Sun, Nov 26, 2017 at 11:12 PM, Satwik wrote: >>>> >>>>> Hi users, >>>>> >>>>> How can i make CT gantry tilt correction using vtk. >>>>> >>>>> I tried using vtkDICOMCTRectifier, but i was not able to compile >>>>> vtkDICOM >>>>> module. >>>>> ERROR: can't able to find vtkDICOMModule.h. >>>>> >>>>> Regards, >>>>> Satwik k >>>>> >>>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Mon Nov 27 18:18:26 2017 From: dave.demarle at kitware.com (David E DeMarle) Date: Mon, 27 Nov 2017 18:18:26 -0500 Subject: [vtkusers] Shadow support on volume rendering In-Reply-To: <1510135054887-0.post@n5.nabble.com> References: <7002df66-ddbd-071b-79bc-272a98a799ce@insigniamedical.co.uk> <1509119924385-0.post@n5.nabble.com> <1509465934854-0.post@n5.nabble.com> <1509469501231-0.post@n5.nabble.com> <1510135054887-0.post@n5.nabble.com> Message-ID: Finally had a second to look into it. There seem to be issues with short word type (and likely endian) in the ospray volume renderer interface. Converting the array to float results in a close match between ospray and gl volume rendered data. Sorry for the hassle and delay Ian. I'll file a bug report and we'll try and get it addressed. Attached find a sample rendered with lighting and shadows enabled. David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Wed, Nov 8, 2017 at 4:57 AM, ianl wrote: > Hi David, > > Basically any DICOM CT set will do, but a good example is the Visible Human > Female Ankle, available here: > https://mri.radiology.uiowa.edu/VHDicom/VHFCT1mm/VHF-Ankle.tar.gz > > This renders fine (see image) with the GPU renderer. I get a totally black > image when I add in the OSPRay render pass. I have verified this by writing > a loop to check the value of all output pixels, all end up as zeros. > > > > I have had a play around with the TestOSPRayVolumeRenderer.cxx test. I > removed the data surface filter so the test only renders the volumetric > image, this seems to render fine with OSPRay, so it seems that my set-up is > ok. > > As another test, I added a marching cubes filter to extract an iso surface > to my pipeline, along with a vtkPolyDataMapper to render it. In this > configuration, I see a surface rendered by OSPRay, so it seems that the > issue is something specific to my pipeline and volumetric rendering. I'll > keep digging. > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- A non-text attachment was scrubbed... Name: Screenshot from 2017-11-27 18-16-39.png Type: image/png Size: 728241 bytes Desc: not available URL: From bill.lorensen at gmail.com Mon Nov 27 18:25:18 2017 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Mon, 27 Nov 2017 18:25:18 -0500 Subject: [vtkusers] Shadow support on volume rendering In-Reply-To: References: <7002df66-ddbd-071b-79bc-272a98a799ce@insigniamedical.co.uk> <1509119924385-0.post@n5.nabble.com> <1509465934854-0.post@n5.nabble.com> <1509469501231-0.post@n5.nabble.com> <1510135054887-0.post@n5.nabble.com> Message-ID: This would be a great example. Would it be hard to replicate in C++ On Nov 27, 2017 6:19 PM, "David E DeMarle" wrote: > Finally had a second to look into it. > > There seem to be issues with short word type (and likely endian) in > the ospray volume renderer interface. Converting the array to float > results in a close match between ospray and gl volume rendered data. > > Sorry for the hassle and delay Ian. > > I'll file a bug report and we'll try and get it addressed. > > Attached find a sample rendered with lighting and shadows enabled. > > David E DeMarle > Kitware, Inc. > Principal Engineer > 21 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-881-4909 > > > On Wed, Nov 8, 2017 at 4:57 AM, ianl > wrote: > > Hi David, > > > > Basically any DICOM CT set will do, but a good example is the Visible > Human > > Female Ankle, available here: > > https://mri.radiology.uiowa.edu/VHDicom/VHFCT1mm/VHF-Ankle.tar.gz > > > > This renders fine (see image) with the GPU renderer. I get a totally > black > > image when I add in the OSPRay render pass. I have verified this by > writing > > a loop to check the value of all output pixels, all end up as zeros. > > > > > > > > I have had a play around with the TestOSPRayVolumeRenderer.cxx test. I > > removed the data surface filter so the test only renders the volumetric > > image, this seems to render fine with OSPRay, so it seems that my set-up > is > > ok. > > > > As another test, I added a marching cubes filter to extract an iso > surface > > to my pipeline, along with a vtkPolyDataMapper to render it. In this > > configuration, I see a surface rendered by OSPRay, so it seems that the > > issue is something specific to my pipeline and volumetric rendering. I'll > > keep digging. > > > > > > > > -- > > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/vtkusers > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Mon Nov 27 18:32:21 2017 From: dave.demarle at kitware.com (David E DeMarle) Date: Mon, 27 Nov 2017 18:32:21 -0500 Subject: [vtkusers] Shadow support on volume rendering In-Reply-To: References: <7002df66-ddbd-071b-79bc-272a98a799ce@insigniamedical.co.uk> <1509119924385-0.post@n5.nabble.com> <1509465934854-0.post@n5.nabble.com> <1509469501231-0.post@n5.nabble.com> <1510135054887-0.post@n5.nabble.com> Message-ID: Shouldn't be hard dicom reader -> vtkImageCast (for the time being) -> volume render enable volumetric lighting on the volume mapper renderer->UseShadowsOn insert ospraypass on renderer David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Mon, Nov 27, 2017 at 6:25 PM, Bill Lorensen wrote: > This would be a great example. Would it be hard to replicate in C++ > > On Nov 27, 2017 6:19 PM, "David E DeMarle" wrote: >> >> Finally had a second to look into it. >> >> There seem to be issues with short word type (and likely endian) in >> the ospray volume renderer interface. Converting the array to float >> results in a close match between ospray and gl volume rendered data. >> >> Sorry for the hassle and delay Ian. >> >> I'll file a bug report and we'll try and get it addressed. >> >> Attached find a sample rendered with lighting and shadows enabled. >> >> David E DeMarle >> Kitware, Inc. >> Principal Engineer >> 21 Corporate Drive >> Clifton Park, NY 12065-8662 >> Phone: 518-881-4909 >> >> >> On Wed, Nov 8, 2017 at 4:57 AM, ianl >> wrote: >> > Hi David, >> > >> > Basically any DICOM CT set will do, but a good example is the Visible >> > Human >> > Female Ankle, available here: >> > https://mri.radiology.uiowa.edu/VHDicom/VHFCT1mm/VHF-Ankle.tar.gz >> > >> > This renders fine (see image) with the GPU renderer. I get a totally >> > black >> > image when I add in the OSPRay render pass. I have verified this by >> > writing >> > a loop to check the value of all output pixels, all end up as zeros. >> > >> > >> > >> > I have had a play around with the TestOSPRayVolumeRenderer.cxx test. I >> > removed the data surface filter so the test only renders the volumetric >> > image, this seems to render fine with OSPRay, so it seems that my set-up >> > is >> > ok. >> > >> > As another test, I added a marching cubes filter to extract an iso >> > surface >> > to my pipeline, along with a vtkPolyDataMapper to render it. In this >> > configuration, I see a surface rendered by OSPRay, so it seems that the >> > issue is something specific to my pipeline and volumetric rendering. >> > I'll >> > keep digging. >> > >> > >> > >> > -- >> > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html >> > _______________________________________________ >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at >> > http://www.kitware.com/opensource/opensource.html >> > >> > Please keep messages on-topic and check the VTK FAQ at: >> > http://www.vtk.org/Wiki/VTK_FAQ >> > >> > Search the list archives at: http://markmail.org/search/?q=vtkusers >> > >> > Follow this link to subscribe/unsubscribe: >> > http://public.kitware.com/mailman/listinfo/vtkusers >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> > From satwik.k8 at gmail.com Mon Nov 27 23:44:41 2017 From: satwik.k8 at gmail.com (satwik k) Date: Tue, 28 Nov 2017 10:14:41 +0530 Subject: [vtkusers] CT Gantry Tilt correction In-Reply-To: References: <1511763162567-0.post@n5.nabble.com> Message-ID: Hi David, thanx for the reply... VTKDICOM module got compiled after cloning from git. Regards, Satwik k On Mon, Nov 27, 2017 at 10:14 PM, David Gobbi wrote: > Please keep your replies on-list (CC to vtkusers at vtk.org). > > It should build either way, but if you are on Windows, cloning is better > because git will give you the correct line-endings for the source files > (i.e. on Windows instead of just ). > > Just to be sure, did you find the build instructions? They're on the > following page: > http://dgobbi.github.io/vtk-dicom/doc/api/installation.html > > - David > > > On Mon, Nov 27, 2017 at 9:28 AM, satwik k wrote: > >> Currently I'm trying to build vtkdicom using vtk 7.1.. >> Trying to build using cmake. I'm getting vtkDICOMModule.h missing. >> >> I'm using Windows 7 and I downloaded vtkdicom as zip file from github. >> >> Should I clone it or by downloading zip file also it builds..? >> >> On Nov 27, 2017 21:46, "David Gobbi" wrote: >> >>> Please keep your replies on-list. >>> >>> What version of VTK? I test every release to make sure that vtk-dicom >>> builds, but any information you can give might help me understand what's >>> going wrong. And what compiler are you using? >>> >>> - David >>> >>> >>> >>> On Mon, Nov 27, 2017 at 9:04 AM, satwik k wrote: >>> >>>> Ya I'm building with vtk. >>>> >>>> Regards, >>>> Satwik k >>>> >>>> On Nov 27, 2017 21:33, "David Gobbi" wrote: >>>> >>>>> How were you building vtkDICOM? Were you building it with VTK as a >>>>> VTK module (with Module_vtkDICOM=ON), or were you building vtkDICOM by >>>>> itself? >>>>> >>>>> >>>>> >>>>> >>>>> On Sun, Nov 26, 2017 at 11:12 PM, Satwik wrote: >>>>> >>>>>> Hi users, >>>>>> >>>>>> How can i make CT gantry tilt correction using vtk. >>>>>> >>>>>> I tried using vtkDICOMCTRectifier, but i was not able to compile >>>>>> vtkDICOM >>>>>> module. >>>>>> ERROR: can't able to find vtkDICOMModule.h. >>>>>> >>>>>> Regards, >>>>>> Satwik k >>>>>> >>>>> >>> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stn.gupta.pankaj at gmail.com Tue Nov 28 01:21:46 2017 From: stn.gupta.pankaj at gmail.com (Pankaj Gupta) Date: Tue, 28 Nov 2017 13:21:46 +0700 Subject: [vtkusers] know the pixels on the line Message-ID: Hi, I am new to vtk. I am using Activiz. I created multiple lines using vtkLine and display them using vtkActor. Now i want to draw line on 2D points calculated from the 3D Line Points. I want to know all the pixels of 3D lines from where my lines is passed. Below is my code. vtkPoints points = vtkPoints.New(); for (int i = 0; i < point.Count; i++) points.InsertNextPoint(x, y, z); vtkCellArray lines = vtkCellArray.New(); for (int i = 0; i < point.Count-1; i++) { vtkLine line = vtkLine.New(); line.GetPointIds().SetId(0, i); line.GetPointIds().SetId(1, i + 1); lines.InsertNextCell(line); } vtkPolyData linesPolyData = vtkPolyData.New(); linesPolyData.SetPoints(points); linesPolyData.SetLines(lines); linesPolyData.Update(); vtkPolyDataMapper mapper = vtkPolyDataMapper.New(); mapper.SetInput(linesPolyData); mapper.Update(); vtkActor actor = vtkActor.New(); actor.SetMapper(mapper); actor.GetProperty().SetLineWidth(10); actor.GetProperty().SetColor(255, 255, 0); renderer.AddActor(actor); Now i want to know the pixels on the lines. Please help me. Thanks in advance. :) :) Thanks, Pankaj -------------- next part -------------- An HTML attachment was scrubbed... URL: From ilindsay at insigniamedical.co.uk Tue Nov 28 04:04:07 2017 From: ilindsay at insigniamedical.co.uk (ianl) Date: Tue, 28 Nov 2017 02:04:07 -0700 (MST) Subject: [vtkusers] Shadow support on volume rendering In-Reply-To: References: <1509119924385-0.post@n5.nabble.com> <1509465934854-0.post@n5.nabble.com> <1509469501231-0.post@n5.nabble.com> <1510135054887-0.post@n5.nabble.com> Message-ID: <1511859847474-0.post@n5.nabble.com> Hi David, thanks for looking into this. I eventually got to the point where I could see a volume, but with no opacity (as I think someone else mentioned in a separate thread), then ran out of time to look any further. I think some of our issues were due to a custom SmartVolumeMapper we had built to address some other issues we were having (GPU memory size info, auto volume down sampling etc). This was presumably interfering with the insertion of the ray cast pass. Reverting to the VTK one seemed to help, so this is something we need to look into. Glad to hear there is an explanation. I look forward to the fix, the results look good in the image you attached. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From koopman.mk at gmail.com Tue Nov 28 04:38:09 2017 From: koopman.mk at gmail.com (Martijn Koopman) Date: Tue, 28 Nov 2017 10:38:09 +0100 Subject: [vtkusers] know the pixels on the line In-Reply-To: References: Message-ID: Hi Pankaj, You could use vtkTransformCoordinateSystems to transform the world coordinates of your vtkPolyData to display coordinates. Also the convenience method vtkInteractorObserver::ComputeWorldToDisplay would be an option. >From these two display points you can derive the vector of the 2D line and then traverse the intermediate points. However, this is method only gives you a description of the 2D line. It does not tell exactly which which pixels on the screen are rendered from that line. The thickness of the line is neglected for example. Regards, Martijn 2017-11-28 7:21 GMT+01:00 Pankaj Gupta : > Hi, > > I am new to vtk. I am using Activiz. I created multiple lines using > vtkLine and display them using vtkActor. Now i want to draw line on 2D > points calculated from the 3D Line Points. I want to know all the pixels of > 3D lines from where my lines is passed. Below is my code. > > vtkPoints points = vtkPoints.New(); > for (int i = 0; i < point.Count; i++) > points.InsertNextPoint(x, y, z); > > vtkCellArray lines = vtkCellArray.New(); > for (int i = 0; i < point.Count-1; i++) > { > vtkLine line = vtkLine.New(); > line.GetPointIds().SetId(0, i); > line.GetPointIds().SetId(1, i + 1); > lines.InsertNextCell(line); > } > > vtkPolyData linesPolyData = vtkPolyData.New(); > linesPolyData.SetPoints(points); > linesPolyData.SetLines(lines); > linesPolyData.Update(); > > vtkPolyDataMapper mapper = vtkPolyDataMapper.New(); > mapper.SetInput(linesPolyData); > mapper.Update(); > > vtkActor actor = vtkActor.New(); > actor.SetMapper(mapper); > actor.GetProperty().SetLineWidth(10); > actor.GetProperty().SetColor(255, 255, 0); > renderer.AddActor(actor); > > > Now i want to know the pixels on the lines. Please help me. Thanks in > advance. :) :) > > > Thanks, > > Pankaj > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensou > rce/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amine.aboufirass at gmail.com Tue Nov 28 07:12:42 2017 From: amine.aboufirass at gmail.com (Amine Aboufirass) Date: Tue, 28 Nov 2017 13:12:42 +0100 Subject: [vtkusers] vtkSelectionNodes Message-ID: Dear all, I developed a python script which extracts attributes from points in a vtkUnstructuredGrid. The script uses SelectionNodes to extract the point using the LOCATIONS attribute. I believe that this should select the point closest to the desired world coordinates. The meat of my code is copied below. It is in python. reader = vtk.vtkUnstructuredGridReader() reader.SetFileName(FileName) SelectionList = vtk.vtkDoubleArray() SelectionList.SetNumberOfComponents(3) for Location in Locations: SelectionList.InsertNextTuple(Location) SelectionNode = vtk.vtkSelectionNode() SelectionNode.SetFieldType(vtk.vtkSelectionNode.POINT) SelectionNode.SetContentType(vtk.vtkSelectionNode.LOCATIONS) SelectionNode.SetSelectionList(SelectionList) Selection = vtk.vtkSelection() Selection.AddNode(SelectionNode) ExtractSelection = vtk.vtkExtractSelection() ExtractSelection.SetInputConnection(0, reader.GetOutputPort()) ExtractSelection.SetInput(1,Selection) ExtractSelection.Update() Selected = vtk.vtkUnstructuredGrid() Selected.ShallowCopy(ExtractSelection.GetOutput()) PointData = Selected.GetPointData() While this does indeed select points based on the supplied coordinates, the points are not necessarily the closest ones to the supplied coordinate. In this case I wanted a set of points closest to the left extreme of my unstructured grid, i.e (X = 0). As you can see from the attachment it is selecting points quite far away from it. Is there a better way to simply select the points I need? Thanks and look forward to hearing from you -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Points.JPG Type: image/jpeg Size: 22109 bytes Desc: not available URL: From woshizyc at gmail.com Tue Nov 28 08:20:13 2017 From: woshizyc at gmail.com (woshizyc at gmail.com) Date: Tue, 28 Nov 2017 21:20:13 +0800 Subject: [vtkusers] Visualize cell normal vector of polydata Message-ID: <2017112821184103591617@gmail.com> Hi, experts, I want to visualize the normal vectors of a polydata to be centered in the center of each triangle. I tried to do this for a sphere generated from vtkSphereSource. I used the following python codes to calculate the normal vectors of the sphere: sphere = vtk.vtkSphereSource() sphere.SetCenter(0, 0, 0) sphere.SetRadius(5.0) arrow = vtk.vtkArrowSource() arrow.Update() normals = vtk.vtkPolyDataNormals() normals.SetInputConnection(sphere.GetOutputPort()) normals.ComputePointNormalsOff() normals.ComputeCellNormalsOn() normals.SplittingOff() normals.FlipNormalsOff() normals.ConsistencyOn() normals.AutoOrientNormalsOn() normals.Update() However, it seemed that I did not get the correct normal vectors of each triangle, as you can see in the attached figure. In addition, I also do not know how to move the vectors to the center of each triangle. Could any experts give me some clue for solving this problem. Are there any example for doing this? Thanks in advance. Best, Yuanchao woshizyc at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Normal.png Type: application/octet-stream Size: 40371 bytes Desc: not available URL: From zjinger at hotmail.com Tue Nov 28 09:05:18 2017 From: zjinger at hotmail.com (Zou Jing) Date: Tue, 28 Nov 2017 14:05:18 +0000 Subject: [vtkusers] MarchingCubes pointer to incomplete class type is not allowed Message-ID: Dear all, I want to convert 3D DICOM or NIFTI image to points cloud (.stl) using vtkMarchingCubes. But there is always the error that 'pointer to incomplete class type is not allowed' when I deepcopy volume from reader(show in boldface in following code). I am using vtk 8.0.1. And I am a novice. I am looking forward to your answer. Thank you very much. There is the code : vtkSmartPointer reader1 = vtkSmartPointer::New(); reader1->SetFileName("C:/Users/studentx/Desktop/lung/test/case1-00.nii"); reader1->Update(); vtkSmartPointer volume = vtkSmartPointer::New(); vtkSmartPointer surface = vtkSmartPointer::New(); volume->DeepCopy(reader1->GetOutput()); #if VTK_MAJOR_VERSION <= 5 surface->SetInput(volume); #else surface->SetInputData(volume); #endif surface->ComputeNormalsOn(); surface->SetValue(0,0.5); vtkSmartPointer moving = vtkSmartPointer ::New(); moving->surface->GetOutput(); //write polydata vtkSmartPointer writer0 = vtkSmartPointer::New(); writer0->SetFileName("C:/Users/studentx/Desktop/lung/test/case1orgin.stl"); writer0->SetInputData(moving); writer0->Write(); -------------- next part -------------- An HTML attachment was scrubbed... URL: From jochen.jankowai at gmail.com Tue Nov 28 09:23:01 2017 From: jochen.jankowai at gmail.com (Jochen Jankowai) Date: Tue, 28 Nov 2017 15:23:01 +0100 Subject: [vtkusers] Regularly sample 3D unstructured tensor grid In-Reply-To: References: <1511527683507-0.post@n5.nabble.com> Message-ID: <021a01d36854$664f2200$32ed6600$@gmail.com> Hi, Thank you for your reply! I have adjusted my code according to your suggestions which had the effect that I am not getting a nullptr any longer. The resulting structured grid has 0 values at all positions though. Am I forgetting to specify that/how I want to interpolate the tensors or something like that? See code below: auto reader = vtkUnstructuredGridReader::New(); reader->SetFileName(file_.get().c_str()); reader->SetReadAllTensors(1); reader->Update(); auto unstructuredGrid = reader->GetOutput(); auto bounds = unstructuredGrid->GetBounds(); // Create a grid of points to interpolate over auto gridSize = ivec3(32); const auto gridBounds = dvec3(31); vtkSmartPointer gridPoints = vtkSmartPointer::New(); const auto xRange = std::abs(bounds[0] - bounds[1]); const auto yRange = std::abs(bounds[2] - bounds[3]); const auto zRange = std::abs(bounds[4] - bounds[5]); const auto stepSize = dvec3(xRange / gridBounds.x, yRange / gridBounds.y, zRange / gridBounds.z); for (int x = 0; x < gridSize.x; x++) { for (int y = 0; y < gridSize.y; y++) { for (int z = 0; z < gridSize.z; z++) { const auto xCoord = bounds[0] + static_cast(x) * stepSize.x; const auto yCoord = bounds[2] + static_cast(y) * stepSize.y; const auto zCoord = bounds[4] + static_cast(z) * stepSize.z; gridPoints->InsertNextPoint(xCoord, yCoord, zCoord); } } } // Create a dataset from the grid points vtkSmartPointer pointSet = vtkSmartPointer::New(); pointSet->SetDimensions(glm::value_ptr(gridSize)); pointSet->SetPoints(gridPoints); vtkSmartPointer probeFilter = vtkSmartPointer::New(); probeFilter->SetSourceData(unstructuredGrid); probeFilter->SetInputData(pointSet); probeFilter->Update(); auto structuredGrid = probeFilter->GetStructuredGridOutput(); auto pointData = structuredGrid->GetPointData(); auto tensors = pointData->GetArray("strain_0.0"); -----Original Message----- From: kenichiro yoshimi [mailto:rccm.kyoshimi at gmail.com] Sent: den 25 november 2017 04:50 To: PetiteViking Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Regularly sample 3D unstructured tensor grid Hi, The standard way of retrieving PointData is not auto tensors = pointData->GetArray(); but auto tensors = pointData->GetArray(0); auto tensors = pointData->GetArray("array-name"); auto tensors = pointData->GetTensors("array-name"); vtkPointData inherits from vtkDataSetAttributes and pointData->GetArray() is trying to access the FieldData which describes global properties of pointData, but it is null. Thanks 2017-11-24 21:48 GMT+09:00 PetiteViking : > Hello everyone! I've tried to find an answer to my problem in the > forum for quite some time now but I cannot seem to find a solution. I > have an unstructured hexahedral grid that stores one tensor per cell. > What I need in my application though is a regulargrid so I would like > to regularly sample the field. So far, this is what I am trying to > (see code below). In one of the posts here I have read that > vtkProbeFilter will produce output that corresponds to the input so I > amusing a structured grid as input for which I have computed points. > And while I manage to retreive a structured grid from the probeFilter, > the variable tensors ends up being a nullptr. auto reader = > vtkUnstructuredGridReader::New(); > reader->SetFileName(file_.get().c_str()); > reader->Update(); auto unstructuredGrid = reader->GetOutput(); // > reader->Create a > grid of points to interpolate over auto gridSize = glm::ivec3(32, 32, > 32); vtkSmartPointer gridPoints = ? > vtkSmartPointer::New(); > for (int x = 0; x < gridSize.x; x++) { ?for (int y = 0; y < > gridSize.y; y++) { ??for (int z = 0; z < gridSize.z; z++) { ??? > gridPoints->InsertNextPoint(x, y, z); ??} ?} } // Create a dataset > from the grid points vtkSmartPointer pointSet = > ?vtkSmartPointer::New(); > pointSet->SetDimensions(glm::value_ptr(gridSize)); > pointSet->SetPoints(gridPoints); vtkSmartPointer > pointSet->probeFilter > = ?vtkSmartPointer::New(); > probeFilter->SetSourceData(unstructuredGrid); > probeFilter->SetInputData(pointSet); probeFilter->Update(); auto > structuredGrid = probeFilter->GetStructuredGridOutput(); auto > pointData = > structuredGrid->GetPointData(); auto tensors = > structuredGrid->GetPointData()->GetTensors(); > ________________________________ > Sent from the VTK - Users mailing list archive at Nabble.com. > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > From cory.quammen at kitware.com Tue Nov 28 09:43:43 2017 From: cory.quammen at kitware.com (Cory Quammen) Date: Tue, 28 Nov 2017 09:43:43 -0500 Subject: [vtkusers] Visualize cell normal vector of polydata In-Reply-To: <2017112821184103591617@gmail.com> References: <2017112821184103591617@gmail.com> Message-ID: How did you generate the arrow glyphs? My guess is that the problem is there rather than in the generation of the cell normals, which appears to me to be correct. Thanks, Cory On Tue, Nov 28, 2017 at 8:20 AM, woshizyc at gmail.com wrote: > Hi, experts, > > I want to visualize the normal vectors of a polydata to be centered in the > center of each triangle. > I tried to do this for a sphere generated from vtkSphereSource. > > I used the following python codes to calculate the normal vectors of the > sphere: > sphere = vtk.vtkSphereSource() > sphere.SetCenter(0, 0, 0) > sphere.SetRadius(5.0) > arrow = vtk.vtkArrowSource() > arrow.Update() > > normals = vtk.vtkPolyDataNormals() > normals.SetInputConnection(sphere.GetOutputPort()) > > normals.ComputePointNormalsOff() > normals.ComputeCellNormalsOn() > normals.SplittingOff() > normals.FlipNormalsOff() > normals.ConsistencyOn() > normals.AutoOrientNormalsOn() > normals.Update() > > However, it seemed that I did not get the correct normal vectors of each > triangle, as you can see in the attached figure. > In addition, I also do not know how to move the vectors to the center of > each triangle. > > Could any experts give me some clue for solving this problem. > > Are there any example for doing this? > > Thanks in advance. > > Best, > > Yuanchao > > > ------------------------------ > woshizyc at gmail.com > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -- Cory Quammen Staff R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Tue Nov 28 09:51:18 2017 From: cory.quammen at kitware.com (Cory Quammen) Date: Tue, 28 Nov 2017 09:51:18 -0500 Subject: [vtkusers] MarchingCubes pointer to incomplete class type is not allowed In-Reply-To: References: Message-ID: Make sure you are including the header files that define the classes you are using, e.g. #include #include #include - Cory On Tue, Nov 28, 2017 at 9:05 AM, Zou Jing wrote: > Dear all, > > I want to convert 3D DICOM or NIFTI image to points cloud (.stl) using > vtkMarchingCubes. > > But there is always the error that ?pointer to incomplete class type is not > allowed? when I deepcopy volume from reader(show in boldface in following > code). > > I am using vtk 8.0.1. And I am a novice. > > I am looking forward to your answer. > > Thank you very much. > > > > There is the code : > > vtkSmartPointer reader1 = > vtkSmartPointer::New(); > > > reader1->SetFileName("C:/Users/studentx/Desktop/lung/test/case1-00.nii"); > > reader1->Update(); > > vtkSmartPointer volume = > > vtkSmartPointer::New(); > > vtkSmartPointer surface = > > vtkSmartPointer::New(); > > volume->DeepCopy(reader1->GetOutput()); > > #if VTK_MAJOR_VERSION <= 5 > > surface->SetInput(volume); > > #else > > surface->SetInputData(volume); > > #endif > > surface->ComputeNormalsOn(); > > surface->SetValue(0,0.5); > > > > vtkSmartPointer moving = vtkSmartPointer > ::New(); > > moving->surface->GetOutput(); > > > > //write polydata > > vtkSmartPointer writer0 = > vtkSmartPointer::New(); > > > writer0->SetFileName("C:/Users/studentx/Desktop/lung/test/case1orgin.stl"); > > writer0->SetInputData(moving); > > writer0->Write(); > > > > > > > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Cory Quammen Staff R&D Engineer Kitware, Inc. From satwik.k8 at gmail.com Tue Nov 28 10:59:48 2017 From: satwik.k8 at gmail.com (satwik k) Date: Tue, 28 Nov 2017 21:29:48 +0530 Subject: [vtkusers] CT Gantry Tilt correction In-Reply-To: References: <1511763162567-0.post@n5.nabble.com> Message-ID: Hi David, I'm using vtkDicomCtRectifier API to correct gantry rotation. But i'm facing slowness while updating. Is there any better way to speed up the computation. I tried it, by enabling SMP, but also facing slowness. Regards, Satwik k On Nov 28, 2017 10:14 AM, "satwik k" wrote: Hi David, thanx for the reply... VTKDICOM module got compiled after cloning from git. Regards, Satwik k On Mon, Nov 27, 2017 at 10:14 PM, David Gobbi wrote: > Please keep your replies on-list (CC to vtkusers at vtk.org). > > It should build either way, but if you are on Windows, cloning is better > because git will give you the correct line-endings for the source files > (i.e. on Windows instead of just ). > > Just to be sure, did you find the build instructions? They're on the > following page: > http://dgobbi.github.io/vtk-dicom/doc/api/installation.html > > - David > > > On Mon, Nov 27, 2017 at 9:28 AM, satwik k wrote: > >> Currently I'm trying to build vtkdicom using vtk 7.1.. >> Trying to build using cmake. I'm getting vtkDICOMModule.h missing. >> >> I'm using Windows 7 and I downloaded vtkdicom as zip file from github. >> >> Should I clone it or by downloading zip file also it builds..? >> >> On Nov 27, 2017 21:46, "David Gobbi" wrote: >> >>> Please keep your replies on-list. >>> >>> What version of VTK? I test every release to make sure that vtk-dicom >>> builds, but any information you can give might help me understand what's >>> going wrong. And what compiler are you using? >>> >>> - David >>> >>> >>> >>> On Mon, Nov 27, 2017 at 9:04 AM, satwik k wrote: >>> >>>> Ya I'm building with vtk. >>>> >>>> Regards, >>>> Satwik k >>>> >>>> On Nov 27, 2017 21:33, "David Gobbi" wrote: >>>> >>>>> How were you building vtkDICOM? Were you building it with VTK as a >>>>> VTK module (with Module_vtkDICOM=ON), or were you building vtkDICOM by >>>>> itself? >>>>> >>>>> >>>>> >>>>> >>>>> On Sun, Nov 26, 2017 at 11:12 PM, Satwik wrote: >>>>> >>>>>> Hi users, >>>>>> >>>>>> How can i make CT gantry tilt correction using vtk. >>>>>> >>>>>> I tried using vtkDICOMCTRectifier, but i was not able to compile >>>>>> vtkDICOM >>>>>> module. >>>>>> ERROR: can't able to find vtkDICOMModule.h. >>>>>> >>>>>> Regards, >>>>>> Satwik k >>>>>> >>>>> >>> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfavre at cscs.ch Tue Nov 28 10:59:44 2017 From: jfavre at cscs.ch (Favre Jean) Date: Tue, 28 Nov 2017 15:59:44 +0000 Subject: [vtkusers] Visualize cell normal vector of polydata In-Reply-To: <2017112821184103591617@gmail.com> References: <2017112821184103591617@gmail.com> Message-ID: <0EB9B6375711A04B820E6B6F5CCA9F685CA28F43@MBX111.d.ethz.ch> I am having doubts about the fact that one can *directly* generate cell-centered normal vectors. Looking at the source of ParaView, I see that if the association is FIELD_ASSOCIATION_CELLS, then vtkPVGlyphFilter::UseCellCenters() returns TRUE and a vtkCellCenters() is created to act as input. for reference: https://gitlab.kitware.com/paraview/paraview/blob/master/ParaViewCore/VTKExtensions/Default/vtkPVGlyphFilter.cxx thus my suggestion is to insert a vtkCellCenters() in your pipeline, before the Glyph ----------------- Jean/CSCS -------------- next part -------------- An HTML attachment was scrubbed... URL: From woshizyc at gmail.com Tue Nov 28 11:07:07 2017 From: woshizyc at gmail.com (woshizyc at gmail.com) Date: Wed, 29 Nov 2017 00:07:07 +0800 Subject: [vtkusers] Visualize cell normal vector of polydata References: <2017112821184103591617@gmail.com>, Message-ID: <2017112823390974292122@gmail.com> Thanks for your reply and help. The following is my codes: sphere = vtk.vtkSphereSource() sphere.SetCenter(0, 0, 0) sphere.SetRadius(5.0) arrow = vtk.vtkArrowSource() arrow.Update() normals = vtk.vtkPolyDataNormals() normals.SetInputConnection(sphere.GetOutputPort()) normals.ComputePointNormalsOff() normals.ComputeCellNormalsOn() normals.SplittingOff() normals.FlipNormalsOff() normals.ConsistencyOn() normals.AutoOrientNormalsOn() normals.Update() mapper = vtk.vtkPolyDataMapper() if vtk.VTK_MAJOR_VERSION <= 5: mapper.SetInput(sphere.GetOutput()) else: mapper.SetInputConnection(sphere.GetOutputPort()) glyph=vtk.vtkGlyph3D() glyph.SetInputData(normals.GetOutput()) glyph.SetSourceData(arrow.GetOutput()) glyph.SetVectorModeToUseNormal() glyph.SetScaleModeToScaleByVector() glyph.SetScaleFactor(1) glyph.OrientOn() glyph.Update() print (glyph) glyph_mapper=vtk.vtkPolyDataMapper() glyph_mapper.SetInputData(glyph.GetOutput()) glyph_mapper.ImmediateModeRenderingOn() glyph_actor=vtk.vtkActor() glyph_actor.SetMapper(glyph_mapper) glyph_actor.GetProperty().SetColor(1,0.4,1) actor = vtk.vtkActor() actor.SetMapper(mapper) woshizyc at gmail.com From: Cory Quammen Date: 2017-11-28 22:43 To: woshizyc at gmail.com CC: vtkusers Subject: Re: [vtkusers] Visualize cell normal vector of polydata How did you generate the arrow glyphs? My guess is that the problem is there rather than in the generation of the cell normals, which appears to me to be correct. Thanks, Cory On Tue, Nov 28, 2017 at 8:20 AM, woshizyc at gmail.com wrote: Hi, experts, I want to visualize the normal vectors of a polydata to be centered in the center of each triangle. I tried to do this for a sphere generated from vtkSphereSource. I used the following python codes to calculate the normal vectors of the sphere: sphere = vtk.vtkSphereSource() sphere.SetCenter(0, 0, 0) sphere.SetRadius(5.0) arrow = vtk.vtkArrowSource() arrow.Update() normals = vtk.vtkPolyDataNormals() normals.SetInputConnection(sphere.GetOutputPort()) normals.ComputePointNormalsOff() normals.ComputeCellNormalsOn() normals.SplittingOff() normals.FlipNormalsOff() normals.ConsistencyOn() normals.AutoOrientNormalsOn() normals.Update() However, it seemed that I did not get the correct normal vectors of each triangle, as you can see in the attached figure. In addition, I also do not know how to move the vectors to the center of each triangle. Could any experts give me some clue for solving this problem. Are there any example for doing this? Thanks in advance. Best, Yuanchao woshizyc at gmail.com _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -- Cory Quammen Staff R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Tue Nov 28 11:15:17 2017 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 28 Nov 2017 09:15:17 -0700 Subject: [vtkusers] CT Gantry Tilt correction In-Reply-To: References: <1511763162567-0.post@n5.nabble.com> Message-ID: Hi Satwik, The VTK imaging pipeline works by "streaming", which means that if you display one slice, then the entire pipeline is executed for that slice, and when you move to the next slice, it re-executes for that next slice, etc. It's easy to keep this from occurring. Just call Update() on the filter after you have set up the filter. Even better, you can use SetInputData() and GetOutput() to connect the filter. In VTK 6, 7, and 8 these methods will disable streaming. If it still updates slowly after you've done this, let me know. Cheers, - David On Tue, Nov 28, 2017 at 8:59 AM, satwik k wrote: > Hi David, > > I'm using vtkDicomCtRectifier API to correct gantry rotation. But i'm > facing slowness while updating. > > Is there any better way to speed up the computation. I tried it, by > enabling SMP, but also facing slowness. > > > > Regards, > Satwik k > > On Nov 28, 2017 10:14 AM, "satwik k" wrote: > > Hi David, thanx for the reply... VTKDICOM module got compiled after > cloning from git. > > Regards, > Satwik k > > On Mon, Nov 27, 2017 at 10:14 PM, David Gobbi > wrote: > >> Please keep your replies on-list (CC to vtkusers at vtk.org). >> >> It should build either way, but if you are on Windows, cloning is better >> because git will give you the correct line-endings for the source files >> (i.e. on Windows instead of just ). >> >> Just to be sure, did you find the build instructions? They're on the >> following page: >> http://dgobbi.github.io/vtk-dicom/doc/api/installation.html >> >> - David >> >> >> On Mon, Nov 27, 2017 at 9:28 AM, satwik k wrote: >> >>> Currently I'm trying to build vtkdicom using vtk 7.1.. >>> Trying to build using cmake. I'm getting vtkDICOMModule.h missing. >>> >>> I'm using Windows 7 and I downloaded vtkdicom as zip file from github. >>> >>> Should I clone it or by downloading zip file also it builds..? >>> >>> On Nov 27, 2017 21:46, "David Gobbi" wrote: >>> >>>> Please keep your replies on-list. >>>> >>>> What version of VTK? I test every release to make sure that vtk-dicom >>>> builds, but any information you can give might help me understand what's >>>> going wrong. And what compiler are you using? >>>> >>>> - David >>>> >>>> >>>> >>>> On Mon, Nov 27, 2017 at 9:04 AM, satwik k wrote: >>>> >>>>> Ya I'm building with vtk. >>>>> >>>>> Regards, >>>>> Satwik k >>>>> >>>>> On Nov 27, 2017 21:33, "David Gobbi" wrote: >>>>> >>>>>> How were you building vtkDICOM? Were you building it with VTK as a >>>>>> VTK module (with Module_vtkDICOM=ON), or were you building vtkDICOM by >>>>>> itself? >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> On Sun, Nov 26, 2017 at 11:12 PM, Satwik wrote: >>>>>> >>>>>>> Hi users, >>>>>>> >>>>>>> How can i make CT gantry tilt correction using vtk. >>>>>>> >>>>>>> I tried using vtkDICOMCTRectifier, but i was not able to compile >>>>>>> vtkDICOM >>>>>>> module. >>>>>>> ERROR: can't able to find vtkDICOMModule.h. >>>>>>> >>>>>>> Regards, >>>>>>> Satwik k >>>>>>> >>>>>> >>>> >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Tue Nov 28 11:18:04 2017 From: cory.quammen at kitware.com (Cory Quammen) Date: Tue, 28 Nov 2017 11:18:04 -0500 Subject: [vtkusers] Visualize cell normal vector of polydata In-Reply-To: <0EB9B6375711A04B820E6B6F5CCA9F685CA28F43@MBX111.d.ethz.ch> References: <2017112821184103591617@gmail.com> <0EB9B6375711A04B820E6B6F5CCA9F685CA28F43@MBX111.d.ethz.ch> Message-ID: On Tue, Nov 28, 2017 at 10:59 AM, Favre Jean wrote: > > I am having doubts about the fact that one can *directly* generate > cell-centered normal vectors. Looking at the source of ParaView, I see that > if the association is FIELD_ASSOCIATION_CELLS, then > vtkPVGlyphFilter::UseCellCenters() returns TRUE and a vtkCellCenters() is > created to act as input. > > for reference: > > https://gitlab.kitware.com/paraview/paraview/blob/master/ParaViewCore/VTKExtensions/Default/vtkPVGlyphFilter.cxx > > thus my suggestion is to insert a vtkCellCenters() in your pipeline, before > the Glyph Yep, I agree. The vtkGlyph3D filter operates only on input point data, so you will definitely need to add a vtkCellCenters filter before the glypher. vtkCellCenters copies cell data to point data in its output, which is exactly what you need for vtkGlyph3D. Cory > ----------------- > Jean/CSCS > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Cory Quammen Staff R&D Engineer Kitware, Inc. From jfavre at cscs.ch Tue Nov 28 11:21:18 2017 From: jfavre at cscs.ch (Favre Jean) Date: Tue, 28 Nov 2017 16:21:18 +0000 Subject: [vtkusers] Visualize cell normal vector of polydata In-Reply-To: <2017112823390974292122@gmail.com> References: <2017112821184103591617@gmail.com>, , <2017112823390974292122@gmail.com> Message-ID: <0EB9B6375711A04B820E6B6F5CCA9F685CA28F6C@MBX111.d.ethz.ch> more specifically: centers = vtk.vtkCellCenters() centers.SetInputConnection(normals.GetOutputPort()) glyph.SetInputConnection(centers.GetOutputPort()) -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.jourdain at kitware.com Tue Nov 28 12:12:08 2017 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Tue, 28 Nov 2017 10:12:08 -0700 Subject: [vtkusers] ANN: vtk.js, an Open-Source Toolkit for SciVis on the Web Message-ID: The Kitware team is pleased to announce vtk.js, a WebGL library taking the best of VTK to the Web. To learn more, click on the link for our blog post. https://blog.kitware.com/vtk-js-the-visualization-toolkit-on-the-web/ And if you want to follow along the progress of the project, star it on github! https://github.com/Kitware/vtk-js Feel free to leave feedback on the mailing list or issue tracker. Thank you all for making VTK such a great platform for SciViz! Sebastien -------------- next part -------------- An HTML attachment was scrubbed... URL: From satwik.k8 at gmail.com Tue Nov 28 13:17:15 2017 From: satwik.k8 at gmail.com (satwik k) Date: Tue, 28 Nov 2017 23:47:15 +0530 Subject: [vtkusers] CT Gantry Tilt correction In-Reply-To: References: <1511763162567-0.post@n5.nabble.com> Message-ID: I'm passing image data as an input to vtkDicomCtRectifier and matrix to a method volumeMatrix and I'm calling update method... This update method is taking time... I'm updating the entire cuboid at a time.. so it is taking 1min. Regards, Satwik k On Nov 28, 2017 9:45 PM, "David Gobbi" wrote: > Hi Satwik, > > The VTK imaging pipeline works by "streaming", which means that if you > display one slice, then the entire pipeline is executed for that slice, and > when you move to the next slice, it re-executes for that next slice, etc. > > It's easy to keep this from occurring. Just call Update() on the filter > after you have set up the filter. Even better, you can use SetInputData() > and GetOutput() to connect the filter. In VTK 6, 7, and 8 these methods > will disable streaming. > > If it still updates slowly after you've done this, let me know. > > Cheers, > > - David > > > On Tue, Nov 28, 2017 at 8:59 AM, satwik k wrote: > >> Hi David, >> >> I'm using vtkDicomCtRectifier API to correct gantry rotation. But i'm >> facing slowness while updating. >> >> Is there any better way to speed up the computation. I tried it, by >> enabling SMP, but also facing slowness. >> >> >> >> Regards, >> Satwik k >> >> On Nov 28, 2017 10:14 AM, "satwik k" wrote: >> >> Hi David, thanx for the reply... VTKDICOM module got compiled after >> cloning from git. >> >> Regards, >> Satwik k >> >> On Mon, Nov 27, 2017 at 10:14 PM, David Gobbi >> wrote: >> >>> Please keep your replies on-list (CC to vtkusers at vtk.org). >>> >>> It should build either way, but if you are on Windows, cloning is better >>> because git will give you the correct line-endings for the source files >>> (i.e. on Windows instead of just ). >>> >>> Just to be sure, did you find the build instructions? They're on the >>> following page: >>> http://dgobbi.github.io/vtk-dicom/doc/api/installation.html >>> >>> - David >>> >>> >>> On Mon, Nov 27, 2017 at 9:28 AM, satwik k wrote: >>> >>>> Currently I'm trying to build vtkdicom using vtk 7.1.. >>>> Trying to build using cmake. I'm getting vtkDICOMModule.h missing. >>>> >>>> I'm using Windows 7 and I downloaded vtkdicom as zip file from github. >>>> >>>> Should I clone it or by downloading zip file also it builds..? >>>> >>>> On Nov 27, 2017 21:46, "David Gobbi" wrote: >>>> >>>>> Please keep your replies on-list. >>>>> >>>>> What version of VTK? I test every release to make sure that vtk-dicom >>>>> builds, but any information you can give might help me understand what's >>>>> going wrong. And what compiler are you using? >>>>> >>>>> - David >>>>> >>>>> >>>>> >>>>> On Mon, Nov 27, 2017 at 9:04 AM, satwik k wrote: >>>>> >>>>>> Ya I'm building with vtk. >>>>>> >>>>>> Regards, >>>>>> Satwik k >>>>>> >>>>>> On Nov 27, 2017 21:33, "David Gobbi" wrote: >>>>>> >>>>>>> How were you building vtkDICOM? Were you building it with VTK as a >>>>>>> VTK module (with Module_vtkDICOM=ON), or were you building vtkDICOM by >>>>>>> itself? >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Sun, Nov 26, 2017 at 11:12 PM, Satwik >>>>>>> wrote: >>>>>>> >>>>>>>> Hi users, >>>>>>>> >>>>>>>> How can i make CT gantry tilt correction using vtk. >>>>>>>> >>>>>>>> I tried using vtkDICOMCTRectifier, but i was not able to compile >>>>>>>> vtkDICOM >>>>>>>> module. >>>>>>>> ERROR: can't able to find vtkDICOMModule.h. >>>>>>>> >>>>>>>> Regards, >>>>>>>> Satwik k >>>>>>>> >>>>>>> >>>>> >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fromseattle at gmail.com Tue Nov 28 13:20:06 2017 From: fromseattle at gmail.com (Frank Sea) Date: Tue, 28 Nov 2017 11:20:06 -0700 (MST) Subject: [vtkusers] vtkTextActor render utf8 characters not working In-Reply-To: References: <1511321483500-0.post@n5.nabble.com> Message-ID: <1511893206620-0.post@n5.nabble.com> Downloaded the DroidSansFallbackFull.ttf from a different location and now it works. Thanks for the reply. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From david.gobbi at gmail.com Tue Nov 28 13:31:17 2017 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 28 Nov 2017 11:31:17 -0700 Subject: [vtkusers] CT Gantry Tilt correction In-Reply-To: References: <1511763162567-0.post@n5.nabble.com> Message-ID: Give me more info... what are the dimensions of your volume? On Tue, Nov 28, 2017 at 11:17 AM, satwik k wrote: > I'm passing image data as an input to vtkDicomCtRectifier and matrix to a > method volumeMatrix and I'm calling update method... > > This update method is taking time... I'm updating the entire cuboid at a > time.. so it is taking 1min. > > Regards, > Satwik k > > On Nov 28, 2017 9:45 PM, "David Gobbi" wrote: > >> Hi Satwik, >> >> The VTK imaging pipeline works by "streaming", which means that if you >> display one slice, then the entire pipeline is executed for that slice, and >> when you move to the next slice, it re-executes for that next slice, etc. >> >> It's easy to keep this from occurring. Just call Update() on the filter >> after you have set up the filter. Even better, you can use SetInputData() >> and GetOutput() to connect the filter. In VTK 6, 7, and 8 these methods >> will disable streaming. >> >> If it still updates slowly after you've done this, let me know. >> >> Cheers, >> >> - David >> >> >> On Tue, Nov 28, 2017 at 8:59 AM, satwik k wrote: >> >>> Hi David, >>> >>> I'm using vtkDicomCtRectifier API to correct gantry rotation. But i'm >>> facing slowness while updating. >>> >>> Is there any better way to speed up the computation. I tried it, by >>> enabling SMP, but also facing slowness. >>> >>> >>> >>> Regards, >>> Satwik k >>> >>> On Nov 28, 2017 10:14 AM, "satwik k" wrote: >>> >>> Hi David, thanx for the reply... VTKDICOM module got compiled after >>> cloning from git. >>> >>> Regards, >>> Satwik k >>> >>> On Mon, Nov 27, 2017 at 10:14 PM, David Gobbi >>> wrote: >>> >>>> Please keep your replies on-list (CC to vtkusers at vtk.org). >>>> >>>> It should build either way, but if you are on Windows, cloning is >>>> better because git will give you the correct line-endings for the source >>>> files (i.e. on Windows instead of just ). >>>> >>>> Just to be sure, did you find the build instructions? They're on the >>>> following page: >>>> http://dgobbi.github.io/vtk-dicom/doc/api/installation.html >>>> >>>> - David >>>> >>>> >>>> On Mon, Nov 27, 2017 at 9:28 AM, satwik k wrote: >>>> >>>>> Currently I'm trying to build vtkdicom using vtk 7.1.. >>>>> Trying to build using cmake. I'm getting vtkDICOMModule.h missing. >>>>> >>>>> I'm using Windows 7 and I downloaded vtkdicom as zip file from github. >>>>> >>>>> Should I clone it or by downloading zip file also it builds..? >>>>> >>>>> On Nov 27, 2017 21:46, "David Gobbi" wrote: >>>>> >>>>>> Please keep your replies on-list. >>>>>> >>>>>> What version of VTK? I test every release to make sure that >>>>>> vtk-dicom builds, but any information you can give might help me understand >>>>>> what's going wrong. And what compiler are you using? >>>>>> >>>>>> - David >>>>>> >>>>>> >>>>>> >>>>>> On Mon, Nov 27, 2017 at 9:04 AM, satwik k >>>>>> wrote: >>>>>> >>>>>>> Ya I'm building with vtk. >>>>>>> >>>>>>> Regards, >>>>>>> Satwik k >>>>>>> >>>>>>> On Nov 27, 2017 21:33, "David Gobbi" wrote: >>>>>>> >>>>>>>> How were you building vtkDICOM? Were you building it with VTK as a >>>>>>>> VTK module (with Module_vtkDICOM=ON), or were you building vtkDICOM by >>>>>>>> itself? >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> On Sun, Nov 26, 2017 at 11:12 PM, Satwik >>>>>>>> wrote: >>>>>>>> >>>>>>>>> Hi users, >>>>>>>>> >>>>>>>>> How can i make CT gantry tilt correction using vtk. >>>>>>>>> >>>>>>>>> I tried using vtkDICOMCTRectifier, but i was not able to compile >>>>>>>>> vtkDICOM >>>>>>>>> module. >>>>>>>>> ERROR: can't able to find vtkDICOMModule.h. >>>>>>>>> >>>>>>>>> Regards, >>>>>>>>> Satwik k >>>>>>>>> >>>>>>>> >>>>>> >>>> >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From allison.vacanti at kitware.com Tue Nov 28 15:35:37 2017 From: allison.vacanti at kitware.com (Allie Vacanti) Date: Tue, 28 Nov 2017 15:35:37 -0500 Subject: [vtkusers] Is anyone using Octree Fractal (vtkHyperOctreeFractalSource)? Message-ID: Unless there is a reason not to, we will be deprecating this class soon as per https://gitlab.kitware.com/paraview/paraview/issues/17791. Let me know if you'd like it to stay. Allie -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Tue Nov 28 19:58:10 2017 From: cory.quammen at kitware.com (Cory Quammen) Date: Tue, 28 Nov 2017 19:58:10 -0500 Subject: [vtkusers] MarchingCubes pointer to incomplete class type is not allowed In-Reply-To: References: Message-ID: On Tue, Nov 28, 2017 at 7:57 PM, Zou Jing wrote: > Thanks a lot. > I forgot #include > Best regards. > Jing You're welcome :-) Cory > > -----Original Message----- > From: Cory Quammen [mailto:cory.quammen at kitware.com] > Sent: Tuesday, November 28, 2017 10:51 PM > To: Zou Jing > Cc: vtkusers at vtk.org > Subject: Re: [vtkusers] MarchingCubes pointer to incomplete class type is not allowed > > Make sure you are including the header files that define the classes you are using, e.g. > > #include > #include > #include > > - Cory > > > On Tue, Nov 28, 2017 at 9:05 AM, Zou Jing wrote: >> Dear all, >> >> I want to convert 3D DICOM or NIFTI image to points cloud (.stl) using >> vtkMarchingCubes. >> >> But there is always the error that ?pointer to incomplete class type >> is not allowed? when I deepcopy volume from reader(show in boldface >> in following code). >> >> I am using vtk 8.0.1. And I am a novice. >> >> I am looking forward to your answer. >> >> Thank you very much. >> >> >> >> There is the code : >> >> vtkSmartPointer reader1 = >> vtkSmartPointer::New(); >> >> >> reader1->SetFileName("C:/Users/studentx/Desktop/lung/test/case1-00.nii >> reader1->"); >> >> reader1->Update(); >> >> vtkSmartPointer volume = >> >> vtkSmartPointer::New(); >> >> vtkSmartPointer surface = >> >> vtkSmartPointer::New(); >> >> volume->DeepCopy(reader1->GetOutput()); >> >> #if VTK_MAJOR_VERSION <= 5 >> >> surface->SetInput(volume); >> >> #else >> >> surface->SetInputData(volume); >> >> #endif >> >> surface->ComputeNormalsOn(); >> >> surface->SetValue(0,0.5); >> >> >> >> vtkSmartPointer moving = vtkSmartPointer >> ::New(); >> >> moving->surface->GetOutput(); >> >> >> >> //write polydata >> >> vtkSmartPointer writer0 = >> vtkSmartPointer::New(); >> >> >> writer0->SetFileName("C:/Users/studentx/Desktop/lung/test/case1orgin.s >> writer0->tl"); >> >> writer0->SetInputData(moving); >> >> writer0->Write(); >> >> >> >> >> >> >> >> >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> > > > > -- > Cory Quammen > Staff R&D Engineer > Kitware, Inc. -- Cory Quammen Staff R&D Engineer Kitware, Inc. From rccm.kyoshimi at gmail.com Tue Nov 28 20:46:00 2017 From: rccm.kyoshimi at gmail.com (kenichiro yoshimi) Date: Wed, 29 Nov 2017 10:46:00 +0900 Subject: [vtkusers] Regularly sample 3D unstructured tensor grid In-Reply-To: <021a01d36854$664f2200$32ed6600$@gmail.com> References: <1511527683507-0.post@n5.nabble.com> <021a01d36854$664f2200$32ed6600$@gmail.com> Message-ID: Hello, The reason why resampling fails cannot be found, but at least, the order of IJK-coordinates of the structured points is needed to be changed in reverse. for (int z = 0; z < gridSize.z; z++) { for (int y = 0; y < gridSize.y; y++) { for (int x = 0; x < gridSize.x; x++) { ... Also I attached a sample that works. Hope that helps to solve. 2017-11-28 23:23 GMT+09:00 Jochen Jankowai : > Hi, > Thank you for your reply! I have adjusted my code according to your > suggestions which had the effect that I am not getting a nullptr any longer. > The resulting structured grid has 0 values at all positions though. > Am I forgetting to specify that/how I want to interpolate the tensors or > something like that? > > See code below: > > auto reader = vtkUnstructuredGridReader::New(); > > reader->SetFileName(file_.get().c_str()); > > reader->SetReadAllTensors(1); > > reader->Update(); > > auto unstructuredGrid = reader->GetOutput(); > > auto bounds = unstructuredGrid->GetBounds(); > > // Create a grid of points to interpolate over > auto gridSize = ivec3(32); > const auto gridBounds = dvec3(31); > vtkSmartPointer gridPoints = vtkSmartPointer:: > New(); > > const auto xRange = std::abs(bounds[0] - bounds[1]); > const auto yRange = std::abs(bounds[2] - bounds[3]); > const auto zRange = std::abs(bounds[4] - bounds[5]); > > const auto stepSize = dvec3(xRange / gridBounds.x, yRange / > gridBounds.y, zRange / gridBounds.z); > > for (int x = 0; x < gridSize.x; x++) { > for (int y = 0; y < gridSize.y; y++) { > for (int z = 0; z < gridSize.z; z++) { > const auto xCoord = bounds[0] + static_cast(x) * > stepSize.x; > const auto yCoord = bounds[2] + static_cast(y) * > stepSize.y; > const auto zCoord = bounds[4] + static_cast(z) * > stepSize.z; > gridPoints->InsertNextPoint(xCoord, yCoord, zCoord); > } > } > } > > // Create a dataset from the grid points > vtkSmartPointer pointSet = > vtkSmartPointer::New(); > pointSet->SetDimensions(glm::value_ptr(gridSize)); > pointSet->SetPoints(gridPoints); > > vtkSmartPointer probeFilter = > vtkSmartPointer::New(); > probeFilter->SetSourceData(unstructuredGrid); > > probeFilter->SetInputData(pointSet); > > probeFilter->Update(); > > auto structuredGrid = probeFilter->GetStructuredGridOutput(); > > auto pointData = structuredGrid->GetPointData(); > auto tensors = pointData->GetArray("strain_0.0"); > > > > -----Original Message----- > From: kenichiro yoshimi [mailto:rccm.kyoshimi at gmail.com] > Sent: den 25 november 2017 04:50 > To: PetiteViking > Cc: vtkusers at vtk.org > Subject: Re: [vtkusers] Regularly sample 3D unstructured tensor grid > > Hi, > > The standard way of retrieving PointData is not auto tensors = > pointData->GetArray(); but auto tensors = pointData->GetArray(0); auto > tensors = pointData->GetArray("array-name"); > auto tensors = pointData->GetTensors("array-name"); > > vtkPointData inherits from vtkDataSetAttributes and > pointData->GetArray() is trying to access the FieldData which > describes global properties of pointData, but it is null. > > Thanks > > 2017-11-24 21:48 GMT+09:00 PetiteViking : > > Hello everyone! I've tried to find an answer to my problem in the > > forum for quite some time now but I cannot seem to find a solution. I > > have an unstructured hexahedral grid that stores one tensor per cell. > > What I need in my application though is a regulargrid so I would like > > to regularly sample the field. So far, this is what I am trying to > > (see code below). In one of the posts here I have read that > > vtkProbeFilter will produce output that corresponds to the input so I > > amusing a structured grid as input for which I have computed points. > > And while I manage to retreive a structured grid from the probeFilter, > > the variable tensors ends up being a nullptr. auto reader = > > vtkUnstructuredGridReader::New(); > > reader->SetFileName(file_.get().c_str()); > > reader->Update(); auto unstructuredGrid = reader->GetOutput(); // > > reader->Create a > > grid of points to interpolate over auto gridSize = glm::ivec3(32, 32, > > 32); vtkSmartPointer gridPoints = > > vtkSmartPointer::New(); > > for (int x = 0; x < gridSize.x; x++) { for (int y = 0; y < > > gridSize.y; y++) { for (int z = 0; z < gridSize.z; z++) { > > gridPoints->InsertNextPoint(x, y, z); } } } // Create a dataset > > from the grid points vtkSmartPointer pointSet = > > vtkSmartPointer::New(); > > pointSet->SetDimensions(glm::value_ptr(gridSize)); > > pointSet->SetPoints(gridPoints); vtkSmartPointer > > pointSet->probeFilter > > = vtkSmartPointer::New(); > > probeFilter->SetSourceData(unstructuredGrid); > > probeFilter->SetInputData(pointSet); probeFilter->Update(); auto > > structuredGrid = probeFilter->GetStructuredGridOutput(); auto > > pointData = > > structuredGrid->GetPointData(); auto tensors = > > structuredGrid->GetPointData()->GetTensors(); > > ________________________________ > > Sent from the VTK - Users mailing list archive at Nabble.com. > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Please keep messages on-topic and check the VTK FAQ at: > > http://www.vtk.org/Wiki/VTK_FAQ > > > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/vtkusers > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: StructuredGrid.tar.gz Type: application/x-gzip Size: 15620 bytes Desc: not available URL: From 278124177 at qq.com Wed Nov 29 05:23:42 2017 From: 278124177 at qq.com (=?gb18030?B?zui3qM7ozOw=?=) Date: Wed, 29 Nov 2017 18:23:42 +0800 Subject: [vtkusers] visualize DTI(Diffuse tensor iamge) using VTK Message-ID: HI? i am learnning to visualize the dti , how can i do this with vtk? Any advice will be great appreciated. Regards, -------------- next part -------------- An HTML attachment was scrubbed... URL: From woshizyc at gmail.com Wed Nov 29 06:42:01 2017 From: woshizyc at gmail.com (woshizyc at gmail.com) Date: Wed, 29 Nov 2017 19:42:01 +0800 Subject: [vtkusers] Visualize cell normal vector of polydata References: <2017112821184103591617@gmail.com>, , <2017112823390974292122@gmail.com>, <0EB9B6375711A04B820E6B6F5CCA9F685CA28F6C@MBX111.d.ethz.ch> Message-ID: <201711291814208696999@gmail.com> Thanks for your reply. It works. The normals of the triangles are correct. What if I want to visualize only some of the normals? Can I just modify the normal vector of the point data of centers? I tried to set all the normal vectors that I do not want to visualize to (0,0,0). However, it does not work out as I expected. Please see the attached figure. I want to set the vectors of red regions to be zero and leave the vectors of the blue regions untouched. I set the normals of the red regions to be zero. I got the attached figure, which is not what I want Thanks a lot. woshizyc at gmail.com From: Favre Jean Date: 2017-11-29 00:21 To: woshizyc at gmail.com; Cory Quammen CC: vtkusers Subject: RE: [vtkusers] Visualize cell normal vector of polydata more specifically: centers = vtk.vtkCellCenters() centers.SetInputConnection(normals.GetOutputPort()) glyph.SetInputConnection(centers.GetOutputPort()) -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Wed Nov 29 09:42:37 2017 From: cory.quammen at kitware.com (Cory Quammen) Date: Wed, 29 Nov 2017 09:42:37 -0500 Subject: [vtkusers] Visualize cell normal vector of polydata In-Reply-To: <201711291814208696999@gmail.com> References: <2017112821184103591617@gmail.com> <2017112823390974292122@gmail.com> <0EB9B6375711A04B820E6B6F5CCA9F685CA28F6C@MBX111.d.ethz.ch> <201711291814208696999@gmail.com> Message-ID: If their is a scalar value that controls which arrow glyphs you want to see, you can use vtkThreshold applied to vtkGlyph3D to exclude those you don't want to see. Cory On Wed, Nov 29, 2017 at 6:42 AM, woshizyc at gmail.com wrote: > Thanks for your reply. It works. > > The normals of the triangles are correct. What if I want to visualize only > some of the normals? > Can I just modify the normal vector of the point data of centers? > I tried to set all the normal vectors that I do not want to visualize to > (0,0,0). However, it does not work out as I expected. Please see the > attached figure. > > I want to set the vectors of red regions to be zero and leave the vectors of > the blue regions untouched. > > I set the normals of the red regions to be zero. > > I got the attached figure, which is not what I want > > Thanks a lot. > > > > > ________________________________ > woshizyc at gmail.com > > > From: Favre Jean > Date: 2017-11-29 00:21 > To: woshizyc at gmail.com; Cory Quammen > CC: vtkusers > Subject: RE: [vtkusers] Visualize cell normal vector of polydata > more specifically: > > centers = vtk.vtkCellCenters() > centers.SetInputConnection(normals.GetOutputPort()) > > glyph.SetInputConnection(centers.GetOutputPort()) > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Cory Quammen Staff R&D Engineer Kitware, Inc. From m.nunes at fratoria.com Wed Nov 29 09:51:30 2017 From: m.nunes at fratoria.com (Miguel) Date: Wed, 29 Nov 2017 07:51:30 -0700 (MST) Subject: [vtkusers] Size of labels in vtkScalarBarActor In-Reply-To: References: Message-ID: <1511967090568-0.post@n5.nabble.com> Hello, I am trying to mimic Fernando's work but after adding the scaleBar to the renderer, I get a crash when refreshing the render window. I am adding the scale bar like this: _pRenderer->AddActor2D(m_scalarBarActor); However, when I do this: vtkScalarBarActor *mybar = vtkScalarBarActor::New(); mybar->SetLookupTable(m_scalarBarLUT ); _pRenderer->AddActor2D(mybar); I have no issues. I have also tried adding a basic initialization, but without success: vtkContext2DScalarBarActor* m_scalarBarActor = vtkContext2DScalarBarActor::New(); m_scalarBarActor->SetLookupTable(m_scalarBarLUT ); _pRenderer->AddActor2D(m_scalarBarActor); Any idea on what could be wrong? Thank you. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From cory.quammen at kitware.com Wed Nov 29 10:07:27 2017 From: cory.quammen at kitware.com (Cory Quammen) Date: Wed, 29 Nov 2017 10:07:27 -0500 Subject: [vtkusers] Size of labels in vtkScalarBarActor In-Reply-To: <1511967090568-0.post@n5.nabble.com> References: <1511967090568-0.post@n5.nabble.com> Message-ID: If you could provide a stack trace from the crash, that would help identify what additional initialization you might need to do. Thanks, Cory On Wed, Nov 29, 2017 at 9:51 AM, Miguel wrote: > Hello, > I am trying to mimic Fernando's work but after adding the scaleBar to the > renderer, I get a crash when refreshing the render window. > > I am adding the scale bar like this: > _pRenderer->AddActor2D(m_scalarBarActor); > > > However, when I do this: > vtkScalarBarActor *mybar = vtkScalarBarActor::New(); > mybar->SetLookupTable(m_scalarBarLUT ); > _pRenderer->AddActor2D(mybar); > > I have no issues. > > I have also tried adding a basic initialization, but without success: > vtkContext2DScalarBarActor* m_scalarBarActor = > vtkContext2DScalarBarActor::New(); > m_scalarBarActor->SetLookupTable(m_scalarBarLUT ); > _pRenderer->AddActor2D(m_scalarBarActor); > > > Any idea on what could be wrong? > Thank you. > > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -- Cory Quammen Staff R&D Engineer Kitware, Inc. From m.nunes at fratoria.com Wed Nov 29 10:38:11 2017 From: m.nunes at fratoria.com (Miguel) Date: Wed, 29 Nov 2017 08:38:11 -0700 (MST) Subject: [vtkusers] Size of labels in vtkScalarBarActor In-Reply-To: References: <1511967090568-0.post@n5.nabble.com> Message-ID: <1511969891441-0.post@n5.nabble.com> Hi Cory, thank you for your quick reply. Unfortunately I am not able to provide this, as vkt is embedded in a complex windows system. However, I edited the file vtkContext2DScalarBarActor.cxx to be able to print messages. I have found out the crash come from the function /int vtkContext2DScalarBarActor::RenderOverlay(vtkViewport* viewport)/ when /returnValue = this->ActorDelegate->RenderOverlay(viewport);/ is called. I the constructor I see / this->ActorDelegate = vtkContextActor::New(); (...) vtkContextScene* localScene = vtkContextScene::New(); this->ActorDelegate->SetScene(localScene); localScene->AddItem(this->ScalarBarItem); localScene->Delete(); this->CurrentViewport = NULL; this->Axis = vtkAxis::New(); this->Axis->SetScene(localScene);/ Why is the localScene deleted? Do I have a old version of the code? I also printed the viewport size and the values are correct. I hope this helps. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From cory.quammen at kitware.com Wed Nov 29 11:08:43 2017 From: cory.quammen at kitware.com (Cory Quammen) Date: Wed, 29 Nov 2017 11:08:43 -0500 Subject: [vtkusers] Size of labels in vtkScalarBarActor In-Reply-To: <1511969891441-0.post@n5.nabble.com> References: <1511967090568-0.post@n5.nabble.com> <1511969891441-0.post@n5.nabble.com> Message-ID: On Wed, Nov 29, 2017 at 10:38 AM, Miguel wrote: > Hi Cory, > thank you for your quick reply. > Unfortunately I am not able to provide this, as vkt is embedded in a complex > windows system. Barring even the last few calls of a stack trace, it would be helpful if you could distill the scalar bar code down to a minimal compilable program (and provide a CMakeLists.txt file) so I can debug locally. > However, I edited the file vtkContext2DScalarBarActor.cxx to be able to > print messages. > I have found out the crash come from the function /int > vtkContext2DScalarBarActor::RenderOverlay(vtkViewport* viewport)/ > when /returnValue = this->ActorDelegate->RenderOverlay(viewport);/ is > called. > > I the constructor I see > > / this->ActorDelegate = vtkContextActor::New(); > (...) > vtkContextScene* localScene = vtkContextScene::New(); > this->ActorDelegate->SetScene(localScene); > localScene->AddItem(this->ScalarBarItem); > localScene->Delete(); > > this->CurrentViewport = NULL; > > this->Axis = vtkAxis::New(); > this->Axis->SetScene(localScene);/ > > > Why is the localScene deleted? Do I have a old version of the code? That's a standard VTK-ism. Most VTK objects are reference counted. When the reference count reaches zero, the object is actually deleted. Here, ::New() increments the reference count once, SetScence() increments it again (the ActorDelegate adds a reference to localScene), so now you have two references. Calling Delete() just decrements the reference count by 1 because the local scope is done with the object - it won't actually be deleted until the ActorDelegate and anything else that references decrements the reference count down to zero. I don't suspect that is where the problem lies. Cory > I also printed the viewport size and the values are correct. > > I hope this helps. > > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -- Cory Quammen Staff R&D Engineer Kitware, Inc. From jfavre at cscs.ch Wed Nov 29 11:28:59 2017 From: jfavre at cscs.ch (Favre Jean) Date: Wed, 29 Nov 2017 16:28:59 +0000 Subject: [vtkusers] Visualize cell normal vector of polydata In-Reply-To: References: <2017112821184103591617@gmail.com> <2017112823390974292122@gmail.com> <0EB9B6375711A04B820E6B6F5CCA9F685CA28F6C@MBX111.d.ethz.ch> <201711291814208696999@gmail.com>, Message-ID: <0EB9B6375711A04B820E6B6F5CCA9F685CA294E6@MBX111.d.ethz.ch> May I suggest the use of a vtkGlyph3DMapper, instead of a vtkGlyph3D? a vtkGlyph3DMapper enables you to set two options: glypher = vtkGlyph3DMapper(); glypher.MaskingOn(); glypher.SetMaskArray("masks"); This requires your input to have a vtkBitArray scalar field called "masks" which you can set by thresholding on your other field data. ----------------- Jean/CSCS From m.nunes at fratoria.com Wed Nov 29 11:42:30 2017 From: m.nunes at fratoria.com (Miguel) Date: Wed, 29 Nov 2017 09:42:30 -0700 (MST) Subject: [vtkusers] Size of labels in vtkScalarBarActor In-Reply-To: References: <1511967090568-0.post@n5.nabble.com> <1511969891441-0.post@n5.nabble.com> Message-ID: <1511973750330-0.post@n5.nabble.com> Thank you Cory. Unfortunately I cannot retrieve anything. The only way I have of debuging is by printing messages. So, by printing values, what I can say is that the viewport looks like it has no issues, and that the error comes from: returnValue = this->ActorDelegate->RenderOverlay(viewport); I am using VTK 8.0.1 under windows 10. visual studio 2013. Best regards -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From coyarzunlaura at googlemail.com Wed Nov 29 12:51:10 2017 From: coyarzunlaura at googlemail.com (Cristina Oyarzun) Date: Wed, 29 Nov 2017 18:51:10 +0100 Subject: [vtkusers] VTK-JS: How to visualize numbers Message-ID: Hello, I would like to visualize some numbers next to my actors. I saw an example (Spheres and Labels) where a canvas is created for this purpose. I remember doing this using vtkFollowers in the past. Is there currently some easy way to do this with vtk-js? I mean something similar to vtkFollowers or vtkTextActors? Thank you! Cristina -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.jourdain at kitware.com Wed Nov 29 12:59:01 2017 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Wed, 29 Nov 2017 10:59:01 -0700 Subject: [vtkusers] VTK-JS: How to visualize numbers In-Reply-To: References: Message-ID: The example you mention is the right approach for what you are looking for. The reason why you don't need vtkFollowers+vtkTextActors, is that we have a 2D layer on top of the 3D for which it is trivial to render text that is always facing the camera. ;-) And we have a mechanism that can convert a set of location in the 3D world into the screen space so those label could be printed. Let us know if you the example is not enough to get you started. Seb On Wed, Nov 29, 2017 at 10:51 AM, Cristina Oyarzun via vtkusers < vtkusers at vtk.org> wrote: > Hello, > > I would like to visualize some numbers next to my actors. I saw an example > (Spheres and Labels) where a canvas is created for this purpose. I remember > doing this using vtkFollowers in the past. Is there currently some easy way > to do this with vtk-js? I mean something similar to vtkFollowers or > vtkTextActors? > > Thank you! > Cristina > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hardenbergh at terarecon.com Wed Nov 29 13:30:01 2017 From: hardenbergh at terarecon.com (Jan Hardenbergh) Date: Wed, 29 Nov 2017 18:30:01 +0000 Subject: [vtkusers] ANN: vtk.js, an Open-Source Toolkit for SciVis on the Web Message-ID: This is awesome!!! Would an AnimationScene work in vtk.js? P.S. For the volume datasets, a Cardiac LUT would be nice. YON - Jan C. Hardenbergh, VolumePro SW Eng. Mgr. Terarecon, Inc. ---------------------------------------------------------------------- Message: 1 Date: Tue, 28 Nov 2017 10:12:08 -0700 From: Sebastien Jourdain To: "vtk-developers at vtk.org" , vtkusers , "paraview at paraview.org" , "paraview-developers at paraview.org" Subject: [vtkusers] ANN: vtk.js, an Open-Source Toolkit for SciVis on the Web Message-ID: Content-Type: text/plain; charset="utf-8" The Kitware team is pleased to announce vtk.js, a WebGL library taking the best of VTK to the Web. To learn more, click on the link for our blog post. https://blog.kitware.com/vtk-js-the-visualization-toolkit-on-the-web/ And if you want to follow along the progress of the project, star it on github! https://github.com/Kitware/vtk-js Feel free to leave feedback on the mailing list or issue tracker. Thank you all for making VTK such a great platform for SciViz! Sebastien From sebastien.jourdain at kitware.com Wed Nov 29 14:08:26 2017 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Wed, 29 Nov 2017 12:08:26 -0700 Subject: [vtkusers] ANN: vtk.js, an Open-Source Toolkit for SciVis on the Web In-Reply-To: References: Message-ID: ArcticViewer can do time animation using vtk.js for both geometry and volume rendering. https://kitware.github.io/arctic-viewer/ Some example script can be found here: https://github.com/Kitware/arctic-viewer/blob/master/scripts/examples/paraview/samples/VTKGeometry-can.py For volume data export, we don't have an example but could add one easily. Seb On Wed, Nov 29, 2017 at 11:30 AM, Jan Hardenbergh wrote: > This is awesome!!! Would an AnimationScene work in vtk.js? > > P.S. For the volume datasets, a Cardiac LUT would be nice. > > YON - Jan C. Hardenbergh, VolumePro SW Eng. Mgr. Terarecon, Inc. > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 28 Nov 2017 10:12:08 -0700 > From: Sebastien Jourdain > To: "vtk-developers at vtk.org" , vtkusers > , "paraview at paraview.org" < > paraview at paraview.org>, > "paraview-developers at paraview.org" org> > Subject: [vtkusers] ANN: vtk.js, an Open-Source Toolkit for SciVis on > the Web > Message-ID: > Mng9SdoQ at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > The Kitware team is pleased to announce vtk.js, a WebGL library taking the > best of VTK to the Web. > To learn more, click on the link for our blog post. > > https://blog.kitware.com/vtk-js-the-visualization-toolkit-on-the-web/ > > And if you want to follow along the progress of the project, star it on > github! > > https://github.com/Kitware/vtk-js > > Feel free to leave feedback on the mailing list or issue tracker. > > Thank you all for making VTK such a great platform for SciViz! > > Sebastien > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.jourdain at kitware.com Wed Nov 29 14:10:32 2017 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Wed, 29 Nov 2017 12:10:32 -0700 Subject: [vtkusers] ANN: vtk.js, an Open-Source Toolkit for SciVis on the Web In-Reply-To: References: Message-ID: If you want to add your preset for "Cardiac LUT", feel free to add it here: https://github.com/Kitware/vtk-js/blob/master/Sources/Rendering/Core/ColorTransferFunction/ColorMaps.json On Wed, Nov 29, 2017 at 12:08 PM, Sebastien Jourdain < sebastien.jourdain at kitware.com> wrote: > ArcticViewer can do time animation using vtk.js for both geometry and > volume rendering. > > https://kitware.github.io/arctic-viewer/ > > Some example script can be found here: > https://github.com/Kitware/arctic-viewer/blob/master/ > scripts/examples/paraview/samples/VTKGeometry-can.py > > For volume data export, we don't have an example but could add one easily. > > Seb > > On Wed, Nov 29, 2017 at 11:30 AM, Jan Hardenbergh < > hardenbergh at terarecon.com> wrote: > >> This is awesome!!! Would an AnimationScene work in vtk.js? >> >> P.S. For the volume datasets, a Cardiac LUT would be nice. >> >> YON - Jan C. Hardenbergh, VolumePro SW Eng. Mgr. Terarecon, Inc. >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Tue, 28 Nov 2017 10:12:08 -0700 >> From: Sebastien Jourdain >> To: "vtk-developers at vtk.org" , vtkusers >> , "paraview at paraview.org" < >> paraview at paraview.org>, >> "paraview-developers at paraview.org" > org> >> Subject: [vtkusers] ANN: vtk.js, an Open-Source Toolkit for SciVis on >> the Web >> Message-ID: >> > gmail.com> >> Content-Type: text/plain; charset="utf-8" >> >> The Kitware team is pleased to announce vtk.js, a WebGL library taking >> the best of VTK to the Web. >> To learn more, click on the link for our blog post. >> >> https://blog.kitware.com/vtk-js-the-visualization-toolkit-on-the-web/ >> >> And if you want to follow along the progress of the project, star it on >> github! >> >> https://github.com/Kitware/vtk-js >> >> Feel free to leave feedback on the mailing list or issue tracker. >> >> Thank you all for making VTK such a great platform for SciViz! >> >> Sebastien >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hardenbergh at terarecon.com Wed Nov 29 14:37:08 2017 From: hardenbergh at terarecon.com (Jan Hardenbergh) Date: Wed, 29 Nov 2017 19:37:08 +0000 Subject: [vtkusers] ANN: vtk.js, an Open-Source Toolkit for SciVis on the Web In-Reply-To: References: Message-ID: Seb, Let?s pretend I?m a dinosaur who has run a vtk demo every couple of years since kitware was founded and Mitsubishi hired them to do a VolumePro500 demo. Are you saying that the browser would call Python? Or are you saying it would be trivial to port VTKGeometry-can.py to .js? Also, this a bit opaque: inputFile = '/Users/seb/Downloads/data/can.ex2' Would this work as well? https://midas3.kitware.com/midas/item/207317 I am assuming that I would copy a bunch of stuff to an examples directory in my webserver and presto-keeno, it would work. Right? Adding the LUT will go on my aspirational TODO list. -Jan From: Sebastien Jourdain [mailto:sebastien.jourdain at kitware.com] Sent: Wednesday, November 29, 2017 2:11 PM To: Jan Hardenbergh Cc: vtkusers at vtk.org Subject: Re: [vtkusers] ANN: vtk.js, an Open-Source Toolkit for SciVis on the Web If you want to add your preset for "Cardiac LUT", feel free to add it here: https://github.com/Kitware/vtk-js/blob/master/Sources/Rendering/Core/ColorTransferFunction/ColorMaps.json On Wed, Nov 29, 2017 at 12:08 PM, Sebastien Jourdain > wrote: ArcticViewer can do time animation using vtk.js for both geometry and volume rendering. https://kitware.github.io/arctic-viewer/ Some example script can be found here: https://github.com/Kitware/arctic-viewer/blob/master/scripts/examples/paraview/samples/VTKGeometry-can.py For volume data export, we don't have an example but could add one easily. Seb On Wed, Nov 29, 2017 at 11:30 AM, Jan Hardenbergh > wrote: This is awesome!!! Would an AnimationScene work in vtk.js? P.S. For the volume datasets, a Cardiac LUT would be nice. YON - Jan C. Hardenbergh, VolumePro SW Eng. Mgr. Terarecon, Inc. ---------------------------------------------------------------------- Message: 1 Date: Tue, 28 Nov 2017 10:12:08 -0700 From: Sebastien Jourdain > To: "vtk-developers at vtk.org" >, vtkusers >, "paraview at paraview.org" >, "paraview-developers at paraview.org" > Subject: [vtkusers] ANN: vtk.js, an Open-Source Toolkit for SciVis on the Web Message-ID: > Content-Type: text/plain; charset="utf-8" The Kitware team is pleased to announce vtk.js, a WebGL library taking the best of VTK to the Web. To learn more, click on the link for our blog post. https://blog.kitware.com/vtk-js-the-visualization-toolkit-on-the-web/ And if you want to follow along the progress of the project, star it on github! https://github.com/Kitware/vtk-js Feel free to leave feedback on the mailing list or issue tracker. Thank you all for making VTK such a great platform for SciViz! Sebastien _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From skab12 at gmail.com Wed Nov 29 15:05:40 2017 From: skab12 at gmail.com (Serge K.) Date: Wed, 29 Nov 2017 15:05:40 -0500 Subject: [vtkusers] visualize DTI(Diffuse tensor iamge) using VTK Message-ID: Hi, You can have a look at DIPY project. They use VTK for visualization. Here some examples : - http://nipy.org/dipy/examples_built/reconst_dti.html#example-reconst-dti - http://nipy.org/dipy/examples_built/reconst_csd.html#example-reconst-csd and the code part : - https://github.com/nipy/dipy/blob/master/dipy/viz Feel free to use or extend these tools Cheers, Serge K. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.jourdain at kitware.com Wed Nov 29 15:30:44 2017 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Wed, 29 Nov 2017 13:30:44 -0700 Subject: [vtkusers] ANN: vtk.js, an Open-Source Toolkit for SciVis on the Web In-Reply-To: References: Message-ID: Sorry, for being light on my initial explanations. I've been playing too long with all those technologies... ;-) ArcticViewer is just a viewer of static data. The Python script is to actually process the data and generate a data structure that would be easy to serve to a web page. So it is just pre-processing to generate new files that should be a subset of the original data. Then once you load the (newly generated) data in ArcticViewer, you can edit the lookup table, play the time animation, change the array to color by and so on... But it could also be fairly easy to create an animation with vtk.js just by dealing with the switch of input data on your own in plain JavaScript. I was just mentioning ArcticViewer as you can easily try it out. If you want the web browser to drive a VTK/Python backend, you can use ParaViewWeb for that and Visualizer is a good example of it. You can learn more about it here: https://kitware.github.io/paraviewweb/docs/ Hope that clarify some of your questions... Seb On Wed, Nov 29, 2017 at 12:37 PM, Jan Hardenbergh wrote: > Seb, > > > > Let?s pretend I?m a dinosaur who has run a vtk demo every couple of years > since kitware was founded and Mitsubishi hired them to do a VolumePro500 > demo. > > > > Are you saying that the browser would call Python? Or are you saying it > would be trivial to port VTKGeometry-can.py to .js? > > Also, this a bit opaque: inputFile = '/Users/seb/Downloads/data/can.ex2' > > Would this work as well? https://midas3.kitware.com/midas/item/207317 > > > > I am assuming that I would copy a bunch of stuff to an examples directory > in my webserver and presto-keeno, it would work. Right? > > > > Adding the LUT will go on my aspirational TODO list. > > > > -Jan > > > > *From:* Sebastien Jourdain [mailto:sebastien.jourdain at kitware.com] > *Sent:* Wednesday, November 29, 2017 2:11 PM > *To:* Jan Hardenbergh > *Cc:* vtkusers at vtk.org > *Subject:* Re: [vtkusers] ANN: vtk.js, an Open-Source Toolkit for SciVis > on the Web > > > > If you want to add your preset for "Cardiac LUT", > > feel free to add it here: https://github.com/Kitware/vtk-js/blob/master/ > Sources/Rendering/Core/ColorTransferFunction/ColorMaps.json > > > > On Wed, Nov 29, 2017 at 12:08 PM, Sebastien Jourdain < > sebastien.jourdain at kitware.com> wrote: > > ArcticViewer can do time animation using vtk.js for both geometry and > volume rendering. > > > > https://kitware.github.io/arctic-viewer/ > > > > Some example script can be found here: > > https://github.com/Kitware/arctic-viewer/blob/master/ > scripts/examples/paraview/samples/VTKGeometry-can.py > > > > For volume data export, we don't have an example but could add one easily. > > > > Seb > > > > On Wed, Nov 29, 2017 at 11:30 AM, Jan Hardenbergh < > hardenbergh at terarecon.com> wrote: > > This is awesome!!! Would an AnimationScene work in vtk.js? > > P.S. For the volume datasets, a Cardiac LUT would be nice. > > YON - Jan C. Hardenbergh, VolumePro SW Eng. Mgr. Terarecon, Inc. > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 28 Nov 2017 10:12:08 -0700 > From: Sebastien Jourdain > To: "vtk-developers at vtk.org" , vtkusers > , "paraview at paraview.org" < > paraview at paraview.org>, > "paraview-developers at paraview.org" org> > Subject: [vtkusers] ANN: vtk.js, an Open-Source Toolkit for SciVis on > the Web > Message-ID: > Mng9SdoQ at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > > The Kitware team is pleased to announce vtk.js, a WebGL library taking the > best of VTK to the Web. > To learn more, click on the link for our blog post. > > https://blog.kitware.com/vtk-js-the-visualization-toolkit-on-the-web/ > > And if you want to follow along the progress of the project, star it on > github! > > https://github.com/Kitware/vtk-js > > Feel free to leave feedback on the mailing list or issue tracker. > > Thank you all for making VTK such a great platform for SciViz! > > Sebastien > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From will.schroeder at kitware.com Wed Nov 29 15:49:04 2017 From: will.schroeder at kitware.com (Will Schroeder) Date: Wed, 29 Nov 2017 15:49:04 -0500 Subject: [vtkusers] [Paraview-developers] ANN: vtk.js, an Open-Source Toolkit for SciVis on the Web In-Reply-To: References: Message-ID: Note that vtk.js is a relatively young project. That means if you are anxious to contribute to an open source community here's a chance to get in on the ground floor; we can certainly use your help. Give yourself the holiday gift of contributing to an OS platform :-) On Tue, Nov 28, 2017 at 12:12 PM, Sebastien Jourdain < sebastien.jourdain at kitware.com> wrote: > The Kitware team is pleased to announce vtk.js, a WebGL library taking the > best of VTK to the Web. > To learn more, click on the link for our blog post. > > https://blog.kitware.com/vtk-js-the-visualization-toolkit-on-the-web/ > > And if you want to follow along the progress of the project, star it on > github! > > https://github.com/Kitware/vtk-js > > Feel free to leave feedback on the mailing list or issue tracker. > > Thank you all for making VTK such a great platform for SciViz! > > Sebastien > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Search the list archives at: http://markmail.org/search/?q= > Paraview-developers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/paraview-developers > > -- William J. Schroeder, PhD Kitware, Inc. - Building the World's Technical Computing Software 28 Corporate Drive Clifton Park, NY 12065 will.schroeder at kitware.com http://www.kitware.com (518) 881-4902 -------------- next part -------------- An HTML attachment was scrubbed... URL: From allison.vacanti at kitware.com Wed Nov 29 16:44:18 2017 From: allison.vacanti at kitware.com (Allie Vacanti) Date: Wed, 29 Nov 2017 16:44:18 -0500 Subject: [vtkusers] Is anyone using Octree Fractal (vtkHyperOctreeFractalSource)? In-Reply-To: References: Message-ID: Merge requests are up for this: VTK: https://gitlab.kitware.com/vtk/vtk/merge_requests/3644 PV: https://gitlab.kitware.com/paraview/paraview/merge_requests/2062 On Tue, Nov 28, 2017 at 3:35 PM, Allie Vacanti wrote: > Unless there is a reason not to, we will be deprecating this class soon as > per https://gitlab.kitware.com/paraview/paraview/issues/17791. > > Let me know if you'd like it to stay. > > Allie > -------------- next part -------------- An HTML attachment was scrubbed... URL: From satwik.k8 at gmail.com Thu Nov 30 00:29:43 2017 From: satwik.k8 at gmail.com (Satwik) Date: Wed, 29 Nov 2017 22:29:43 -0700 (MST) Subject: [vtkusers] CT Gantry Tilt correction In-Reply-To: References: <1511763162567-0.post@n5.nabble.com> Message-ID: <1512019783167-0.post@n5.nabble.com> Hi, Dimensions of my volume is (512, 512, 144). ///My Code/// vtkDICOMCTRectifier* m_rectify = vtkDICOMCTRectifier::New(); m_rectify->SetEnableSMP(true); m_rectify->SetVolumeMatrix(d->m_initOrient); //passing orientation matrix m_rectify->SetInputData(d->m_imageData); //passing image data m_rectify->Update(); Regards, Satwik K. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From david.gobbi at gmail.com Thu Nov 30 09:01:15 2017 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 30 Nov 2017 07:01:15 -0700 Subject: [vtkusers] CT Gantry Tilt correction In-Reply-To: <1512019783167-0.post@n5.nabble.com> References: <1511763162567-0.post@n5.nabble.com> <1512019783167-0.post@n5.nabble.com> Message-ID: Hi Satwik, I tested a 512x512x144 volume on my laptop, and it took 15 seconds. So, no, that's not very fast. The class uses a windowed sinc interpolator, which is computationally expensive. I could add an option to use linear interpolation. With linear interpolation it only takes 1 second. - David On Wed, Nov 29, 2017 at 10:29 PM, Satwik wrote: > Hi, > > Dimensions of my volume is (512, 512, 144). > > ///My Code/// > vtkDICOMCTRectifier* m_rectify = vtkDICOMCTRectifier::New(); > m_rectify->SetEnableSMP(true); > m_rectify->SetVolumeMatrix(d->m_initOrient); //passing orientation matrix > m_rectify->SetInputData(d->m_imageData); //passing image data > m_rectify->Update(); > > Regards, > Satwik K. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From charles.kind at bristol.ac.uk Thu Nov 30 09:41:53 2017 From: charles.kind at bristol.ac.uk (Charles Kind) Date: Thu, 30 Nov 2017 14:41:53 +0000 Subject: [vtkusers] Translate all VTK glyphs individually in large dataset Message-ID: I am imaging unit 3vector data on a 2d grid of points. The vectors are cartesian. I want to display these vectors as 3d arrows centered with the mid point of the arrows total length on the plane. My idea was to create another matrix of translations, equal to -(vector/2), and then move the glyphs (or change each vector origin or whatever would work)! I therefore wanted to apply these new vectors pointwise as translations to the glyphs. I have failed and need help. The translation needs to preserve the magnitude of the vector. Are there perhaps other ways of doing this. I note that Mayavi2 can do this with a check button but does not have the other functionality I need. I should mention that I have only started using Python and VTK this week so please point out any idiocy in the code. Working code: import vtk import math import sys #Just to break flow # The source file file_name = "Stable.vts" # Read the source file. reader = vtk.vtkXMLStructuredGridReader() reader.SetFileName(file_name) reader.Update() output = reader.GetOutput() numPoints = output.GetNumberOfPoints() dimensions = output.GetDimensions() #Tuple to hold spherical polar coords mpolar = vtk.vtkFloatArray() mpolar.SetNumberOfTuples(numPoints) mpolar.SetNumberOfComponents(3) mpolar.SetNumberOfValues(3*numPoints) mpolar.SetName("mpolar") #Tuple to hold translations mtrans = vtk.vtkFloatArray() mtrans.SetNumberOfTuples(numPoints) mtrans.SetNumberOfComponents(3) mtrans.SetNumberOfValues(3*numPoints) mtrans.SetName("mtrans") #Tuple copy of cartesian data mxyz = vtk.vtkFloatArray() mxyz = output.GetPointData().GetAbstractArray(0) mxyz.SetName("mxyz") #Loop through input data and convert to spherical polar #Also set points equal to input points #Also create vector transform for each vector for x in range(numPoints): azi = math.atan2(output.GetPointData().GetAbstractArray(0).GetTuple(x)[0],output.GetPointData().GetAbstractArray(0).GetTuple(x)[1]) pol = math.acos(output.GetPointData().GetAbstractArray(0).GetTuple(x)[2]) rad = 1 mpolar.SetTuple3(x, azi, pol, rad) mtrans.SetTuple3(x, -output.GetPointData().GetAbstractArray(0).GetTuple(x)[0]/2, \ -output.GetPointData().GetAbstractArray(0).GetTuple(x)[1]/2, \ -output.GetPointData().GetAbstractArray(0).GetTuple(x)[2]/2) #Define new structured grid skrGrid = vtk.vtkStructuredGrid() skrGrid.SetDimensions(dimensions) skrGrid.SetPoints(output.GetPoints()) skrGrid.GetPointData().AddArray(mpolar) skrGrid.GetPointData().AddArray(mxyz) skrGrid.GetPointData().AddArray(mtrans) #Write new structured grid #writer = vtk.vtkXMLStructuredGridWriter() #writer.SetFileName("skrGrid.vts") #writer.SetInputData(skrGrid) #writer.Write() #Subsample grid subs = 11 extract = vtk.vtkExtractGrid() extract.SetInputData(skrGrid) extract.SetSampleRate(subs, subs, 1) extract.Update() #extract.IncludeBoundaryOn() #Get boundary even if not sampled #Cast data into PolyData format for Glyphs pd = vtk.vtkPolyData() pd.SetPoints(extract.GetOutput().GetPoints()) pd.GetPointData().SetVectors(extract.GetOutput().GetPointData().GetAbstractArray(1)) arrowSource = vtk.vtkArrowSource() glyph3D = vtk.vtkGlyph3D() glyph3D.SetSourceConnection(arrowSource.GetOutputPort()) glyph3D.SetVectorModeToUseVector() glyph3D.SetInputData(pd) glyph3D.SetScaleFactor(1e-07) glyph3D.Update() # Create a mapper and actor mapper = vtk.vtkPolyDataMapper() mapper.SetInputConnection(glyph3D.GetOutputPort()) actor = vtk.vtkActor() actor.SetMapper(mapper) # Visualize camera = vtk.vtkCamera() camera.SetPosition(5e-07, -15e-07, 1e-06) camera.SetFocalPoint(5e-07, 5e-07, 0) # Create a renderer, render window, and interactor renderer = vtk.vtkRenderer() renderer.SetActiveCamera(camera) renderWindow = vtk.vtkRenderWindow() renderWindow.AddRenderer(renderer) renderWindowInteractor = vtk.vtkRenderWindowInteractor() renderWindowInteractor.SetRenderWindow(renderWindow) # Add the actor to the scene renderer.AddActor(actor) renderer.SetBackground(1, 1, 1) # Background color white renderer.ResetCameraClippingRange() # Call because without it you need window input to make render display! # enable user interface interactor # Render and interact renderWindow.SetSize(800,600) renderWindowInteractor.Initialize() renderWindow.Render() renderWindowInteractor.Start() -------------- next part -------------- An HTML attachment was scrubbed... URL: From satwik.k8 at gmail.com Thu Nov 30 10:24:32 2017 From: satwik.k8 at gmail.com (satwik k) Date: Thu, 30 Nov 2017 20:54:32 +0530 Subject: [vtkusers] CT Gantry Tilt correction In-Reply-To: References: <1511763162567-0.post@n5.nabble.com> <1512019783167-0.post@n5.nabble.com> Message-ID: Last time when I used this API.. By mistake added in loop.. so it was taking more time... But now I moved it some where else method.. Now it is taking around 10sec... My doubt is, for 144 images.. it is taking this much extra time.. wht if have 1000images..? will it take same time or more? Regards, Satwik k On Nov 30, 2017 19:31, "David Gobbi" wrote: > Hi Satwik, > > I tested a 512x512x144 volume on my laptop, and it took 15 seconds. > So, no, that's not very fast. The class uses a windowed sinc interpolator, > which is computationally expensive. I could add an option to use linear > interpolation. With linear interpolation it only takes 1 second. > > - David > > > On Wed, Nov 29, 2017 at 10:29 PM, Satwik wrote: > >> Hi, >> >> Dimensions of my volume is (512, 512, 144). >> >> ///My Code/// >> vtkDICOMCTRectifier* m_rectify = vtkDICOMCTRectifier::New(); >> m_rectify->SetEnableSMP(true); >> m_rectify->SetVolumeMatrix(d->m_initOrient); //passing orientation matrix >> m_rectify->SetInputData(d->m_imageData); //passing image data >> m_rectify->Update(); >> >> Regards, >> Satwik K. >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Thu Nov 30 12:08:59 2017 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 30 Nov 2017 10:08:59 -0700 Subject: [vtkusers] CT Gantry Tilt correction In-Reply-To: References: <1511763162567-0.post@n5.nabble.com> <1512019783167-0.post@n5.nabble.com> Message-ID: The time will be proportional to the number of slices in the volume. I've pushed a change to github so that you can call the following method to speed things up: rectify->SetInterpolationModeToLinear(); Linear interpolation will be at least 10 times faster than sinc interpolation. Just grab the latest master branch and this method will be available. When I have some time, I'll dig into the sinc interpolation code to speed it up. Right now it's just using vtkImageReslice and a 3D sinc kernel, but CT rectification really only needs a one-dimensional kernel. - David On Thu, Nov 30, 2017 at 8:24 AM, satwik k wrote: > Last time when I used this API.. By mistake added in loop.. so it was > taking more time... But now I moved it some where else method.. Now it is > taking around 10sec... My doubt is, for 144 images.. it is taking this much > extra time.. wht if have 1000images..? > > will it take same time or more? > > > Regards, > Satwik k > > On Nov 30, 2017 19:31, "David Gobbi" wrote: > >> Hi Satwik, >> >> I tested a 512x512x144 volume on my laptop, and it took 15 seconds. >> So, no, that's not very fast. The class uses a windowed sinc >> interpolator, >> which is computationally expensive. I could add an option to use linear >> interpolation. With linear interpolation it only takes 1 second. >> >> - David >> >> >> On Wed, Nov 29, 2017 at 10:29 PM, Satwik wrote: >> >>> Hi, >>> >>> Dimensions of my volume is (512, 512, 144). >>> >>> ///My Code/// >>> vtkDICOMCTRectifier* m_rectify = vtkDICOMCTRectifier::New(); >>> m_rectify->SetEnableSMP(true); >>> m_rectify->SetVolumeMatrix(d->m_initOrient); //passing orientation >>> matrix >>> m_rectify->SetInputData(d->m_imageData); //passing image data >>> m_rectify->Update(); >>> >>> Regards, >>> Satwik K. >>> >>> -------------- next part -------------- An HTML attachment was scrubbed... URL: