From minpu.code at gmail.com Tue May 1 22:52:18 2018 From: minpu.code at gmail.com (pnt1614) Date: Tue, 1 May 2018 19:52:18 -0700 (MST) Subject: [vtkusers] Why does a vtkFeatureEdge return non-scalar output? Message-ID: <1525229538591-0.post@n5.nabble.com> I am using a vtkFeatureEdge to extract a boundary edges and everything works fine. Now I want to render points on the boundary edge so I try to use vtkEdgePoints but there is an "No scalar data to contour " error. I found out that the boundary edge has no scalars. Is there something missing? or is this a bug? // Load a stl file //... vtkSmartPointer data = pSTLReader->GetOutput(); // vtkPolyData ???? ???? // Create a mapper and actor vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputData(data); vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); //---------------edges----------- vtkSmartPointer edges = vtkSmartPointer::New(); edges->SetInputConnection(pSTLReader->GetOutputPort()); edges->BoundaryEdgesOn(); edges->FeatureEdgesOff(); edges->ManifoldEdgesOff(); edges->NonManifoldEdgesOff(); edges->Update(); int test = edges->GetColoring(); // the result is 1 vtkSmartPointer edgeMapper = vtkSmartPointer::New(); edgeMapper->SetInputConnection(edges->GetOutputPort()); vtkSmartPointer edgeActor = vtkSmartPointer::New(); edgeActor->SetMapper(edgeMapper); edgeActor->GetProperty()->SetLineWidth(3.0); vtkSmartPointer e_points = vtkSmartPointer::New(); e_points->SetInputConnection(edges->GetOutputPort()); e_points->SetValue(1150); e_points->Update(); vtkSmartPointer e_a = make_an_actor(e_points->GetOutputPort()); vtkSmartPointer renderer = vtkSmartPointer::New(); renderer->AddActor(e_a); -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From amine.mzoughi at febus-optics.com Wed May 2 03:15:27 2018 From: amine.mzoughi at febus-optics.com (amine.mz) Date: Wed, 2 May 2018 00:15:27 -0700 (MST) Subject: [vtkusers] zoom on a single vtkChartXY axis with the mouse's wheel Message-ID: <1525245327574-0.post@n5.nabble.com> I'm working with Qt and I have a code that rely on QCustomPlot that I want to port to VTK. I want to select only a single axis (left or bottom) of a vtkChartXY, highlight it (increase its width and maybe change its color), and use mouse's wheel forward/backward movements to increase/decrease its range (zoom only the left or bottom part). When I click elsewhere on the plot, the last selected axis must be unhighlithed and mouse's wheel movements will change zoom/unzoom both axis (the native zoom mode of vtkChartXY). For the moment, I proceeded like this (and I don't know if there is a better solution) : * I created a class "MouseInteractor" that inherits from vtkContextInteractorStyle, in this class, I overrode the following methods : OnLeftButtonDown, OnMouseWheelForward, OnMouseWheelBackward but also OnRightButtonDown because I want to show a context menu to clear all plots or move legends. In this class, I also put a pointer to the class that manage the QVTKWidget (contains the X and Y arrays, the view etc...) * Then I register an object of this class in the render window interactor : example : m_view->GetRenderWindow()->GetInteractor()->SetInteractorStyle(m_mouseIntStyle); I encounter a lot of difficulties in the implementation of the user's interactions : - how check if the user has clicked on one of the two axis ? (I need 2 coordinates of the axis box but I don't know how, in the class I can get an axis pointer (example : m_chart->GetAxis(vtkAxis::BOTTOM) but I don't know to get the right coords), mouse coords can be gotten with something like : this->Interactor->GetEventPosition()[0] in the MouseInteractor methods. - Otherwise, setting the interactor style made me lose the vtkChartXY's native zoom which works on both axes. How to keep it along with the new interactor style ? - How to implement the zoom on a single axis ? Thanks in advance for any suggestion -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From g.bogle at auckland.ac.nz Wed May 2 04:12:12 2018 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Wed, 2 May 2018 08:12:12 +0000 Subject: [vtkusers] Problem building VTK5.10 64-bit with Qt Message-ID: <1525248725220.15902@auckland.ac.nz> In the Windows cmake_gui I tick VTK_USE_QT and I set QT_QMAKE_EXECUTABLE to the place where it exists, C:/Qt64/4.8.1/bin/qmake.exe (in fact I select it using the drop-down file selector). I get this error: CMake Error at CMakeLists.txt:387 (MESSAGE): Qt 4.5.0 or greater not found. Please check the QT_QMAKE_EXECUTABLE variable. and qmake.exe shows as NOT FOUND. What could cause this? Thanks Gib -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul_geus at hotmail.com Wed May 2 05:46:42 2018 From: paul_geus at hotmail.com (virtual tea kit) Date: Wed, 2 May 2018 02:46:42 -0700 (MST) Subject: [vtkusers] Beautiful Rendering Message-ID: <1525254402056-0.post@n5.nabble.com> Hi everyone, I created a surface volume with vtk extract surface and now want to render my creation :) Unfortunately, I can't get it to work properly and need your help. I am new to rendering, but this is what I tried. actor->GetProperty()->ShadingOn(); actor->GetProperty()->SetInterpolationToPhong(); actor->GetProperty()->SetAmbient(0.3); actor->GetProperty()->SetDiffuse(0.8); actor->GetProperty()->SetSpecular(0.5); renderer_->AddActor(actor); vtkSmartPointer light = vtkSmartPointer::New(); light->SetIntensity(0.75); light->SetFocalPoint(2, 0, 0); I uploaded two images, one is created within blender and is basically my aim. The other is what happens, when I use the code above. Where is my mistake? Any tutorial would be great as well, thanks :) My effort for creating a fluid-like body: 10miodambreak.png What happens, when I use the code: 56screenshot.png -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From Robert.Atwood at diamond.ac.uk Wed May 2 06:32:44 2018 From: Robert.Atwood at diamond.ac.uk (Robert.Atwood at diamond.ac.uk) Date: Wed, 2 May 2018 10:32:44 +0000 Subject: [vtkusers] Python/VTK offscreen / headless rendering In-Reply-To: <19885c45445d4b3e98437fa9b048331a@diamond.ac.uk> References: <3c058693e8ce47b9ada7995851fe7d70@diamond.ac.uk> <20152d4e-b07b-a350-1a54-341bc14793fc@ebi.ac.uk> <19885c45445d4b3e98437fa9b048331a@diamond.ac.uk> Message-ID: Hi, I solved that little problem by comparing a few examples and have an example that runs in the environment with up-to-date mesalib and vtk , but it still does not run headless, or logged in on remote Xwindow either. An X-window frame blinks very briefly and then it crashes. Attached the code, altered only to create internally an image array instead of reading it and getting rid of ITK dependency. I get the following error (/home/musername/python_conda_env/offscreen) [musername at ws011 vtkpythonprogs]$ python ./vtktomo8.py 100 Trying to render... ERROR: In ../Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx, line 291 vtkXOpenGLRenderWindow (0x10274f0): Could not find a decent config ERROR: In ../Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx, line 291 vtkXOpenGLRenderWindow (0x10274f0): Could not find a decent config ERROR: In ../Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx, line 291 vtkXOpenGLRenderWindow (0x10274f0): Could not find a decent config ERROR: In ../Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx, line 606 vtkXOpenGLRenderWindow (0x10274f0): Cannot create GLX context. Aborting. Aborted (core dumped) From: Atwood, Robert (DLSLtd,RAL,SCI) Sent: 27 April 2018 16:13 To: Atwood, Robert (DLSLtd,RAL,SCI); 'Max Smolens' Cc: vtkusers at vtk.org Subject: RE: [vtkusers] Python/VTK offscreen / headless rendering Hi, What is the change in vtk8 that means the composite function doesn?t exist ? what do I use instead? Thanks Traceback (most recent call last): File "./vtktomo.py", line 84, in compositeFunction = vtk.vtkVolumeRayCastCompositeFunction() AttributeError: module 'vtk' has no attribute 'vtkVolumeRayCastCompositeFunction' From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Robert.Atwood at diamond.ac.uk Sent: 27 April 2018 16:06 To: 'Max Smolens' Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Python/VTK offscreen / headless rendering Thanks Max, that seems to install if I use a conda enviromnet to avoid messing up other users ? conda create --prefix /path/to/my/local/env source activate /path/to/my/local/env conda config --add channels conda-forge conda install mesalib vtk It?s still installing ? but it looks like then I have to update to Python 3 and vtk 8 ???? From: Max Smolens [mailto:max.smolens at kitware.com] Sent: 27 April 2018 14:52 To: Atwood, Robert (DLSLtd,RAL,SCI) Cc: Paul Korir; vtkusers at vtk.org Subject: Re: [vtkusers] Python/VTK offscreen / headless rendering Hi Robert, The conda-forge channel includes a variant of the vtk package that supports offscreen rendering with OSMesa. This variant is chosen automatically if the mesalib package is installed when installing vtk: conda config --add channels conda-forge conda install mesalib vtk HTH, Max On Fri, Apr 27, 2018 at 7:16 AM, Robert.Atwood at diamond.ac.uk > wrote: Hi, Paul The difference is to get to the point where there is something rendered, without having to open a window on the terminal. In the case where I already know (or can calculate from the image data) the colour function and the transparency function, I know what camera angle I want and so on, I just want to run a background job on a remote workstation/cluster node to render that same view for a number of similar images (of the same object in different time steps) Instead of sitting on my computer watching it. But, the problem is that with the way I know how to do it, the creation of the render window trys to get a GL context, but it can't do that . If I try in python on a X-window connection even, I get the following ERROR: In /home/ilan/minonda/conda-bld/work/VTK-6.3.0/Rendering/OpenGL/vtkXOpenGLRenderWindow.cxx, line 394 vtkXOpenGLRenderWindow (0x7f47c0fda000): Could not find a decent visual But maye the capability isn't compiled into the python package from Anaconda?? Is there a python package I can grab that has software rendering? I tried to buld the c++ from source of 7.1.1. But not successfully. .. ./CylinderRenderingProperties ERROR: In /dls/science/users/kny48981/sources/vtk/VTK-7.1.1/Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx, line 320 vtkXOpenGLRenderWindow (0xfc18a0): Could not find a decent config > -----Original Message----- > From: Paul Korir [mailto:pkorir at ebi.ac.uk] > Sent: 27 April 2018 11:09 > To: Atwood, Robert (DLSLtd,RAL,SCI); 'vtkusers at vtk.org' > Subject: Re: [vtkusers] Python/VTK offscreen / headless rendering > > How different is what you need from writing the rendered output directly > to a file using one of the vtk*Writer classes? > > Correct me if I'm missing something. > > Paul K. Korir, PhD > Scientific Programmer > EMBL-EBI > 01223494422 > > On 23/04/2018 11:52, Robert.Atwood at diamond.ac.uk wrote: > > Hi, > > I would like to have a Python script to render several volume images > (tomography data) on a headless machine. I could not find any advice more > recent than 2011 , is this something that just isn't configured in the Python as > installed from existing packages? How do I tell? > > If it's not in the python , what needs to be done, at the time of prior > questions it seemed to be a compile-time option of the VTK library, is that > still the case, Any exaples on line that are for the current release ? > > Thanks > > Robert > > > > > > -- This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message. Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://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: https://vtk.org/mailman/listinfo/vtkusers -- This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message. Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: vtktomo8.py Type: application/octet-stream Size: 7505 bytes Desc: vtktomo8.py URL: From dave.demarle at kitware.com Wed May 2 07:29:30 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Wed, 02 May 2018 11:29:30 +0000 Subject: [vtkusers] Beautiful Rendering In-Reply-To: <1525254402056-0.post@n5.nabble.com> References: <1525254402056-0.post@n5.nabble.com> Message-ID: Some things to try. Swap out your data with something very simple and predictable like vthSphereSource to simplify diagnosing the issues. Compare you setup with the lighting examples in the vtk wiki examples project. Try the vtkLightKit instead of the single light you have now. Turn down the ambient term further. On Wed, May 2, 2018, 5:46 AM virtual tea kit wrote: > Hi everyone, > > I created a surface volume with vtk extract surface and now want to render > my creation :) > Unfortunately, I can't get it to work properly and need your help. > > I am new to rendering, but this is what I tried. > > actor->GetProperty()->ShadingOn(); > actor->GetProperty()->SetInterpolationToPhong(); > actor->GetProperty()->SetAmbient(0.3); > actor->GetProperty()->SetDiffuse(0.8); > actor->GetProperty()->SetSpecular(0.5); > > renderer_->AddActor(actor); > > vtkSmartPointer light = vtkSmartPointer::New(); > light->SetIntensity(0.75); > light->SetFocalPoint(2, 0, 0); > > I uploaded two images, one is created within blender and is basically my > aim. The other is what happens, when I use the code above. Where is my > mistake? > Any tutorial would be great as well, thanks :) > > My effort for creating a fluid-like body: > 10miodambreak.png > > > What happens, when I use the code: > 56screenshot.png > > > > > -- > 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: > https://vtk.org/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Wed May 2 09:48:39 2018 From: cory.quammen at kitware.com (Cory Quammen) Date: Wed, 02 May 2018 13:48:39 +0000 Subject: [vtkusers] Why does a vtkFeatureEdge return non-scalar output? In-Reply-To: <1525229538591-0.post@n5.nabble.com> References: <1525229538591-0.post@n5.nabble.com> Message-ID: On Tue, May 1, 2018 at 10:52 PM pnt1614 wrote: > I am using a vtkFeatureEdge to extract a boundary edges and everything > works > fine. Now I want to render points on the boundary edge so I try to use > vtkEdgePoints but there is an "No scalar data to contour > " error. I found out that the boundary edge has no scalars. Is there > something missing? or is this a bug? > vtkFeatureEdges does indeed copy data arrays to its output, so that is not the problem. vtkEdgePoints expects a point data array to use for interpolating points along edges. However, vtkSTLReader does not create any point data arrays - I'm not sure STL files can even store data arrays. If you just want to render the points in the vtkPolyData extracted from vtkFeatureEdges, call edgeActor->GetProperty()->SetRepresentationToPoints(); HTH, Cory > > > // Load a stl file > //... > vtkSmartPointer data = > pSTLReader->GetOutput(); // > vtkPolyData ???? ???? > > > // Create a mapper and > actor > vtkSmartPointer mapper = > vtkSmartPointer::New(); > mapper->SetInputData(data); > > vtkSmartPointer actor = > vtkSmartPointer::New(); > actor->SetMapper(mapper); > > > //---------------edges----------- > vtkSmartPointer edges = > vtkSmartPointer::New(); > edges->SetInputConnection(pSTLReader->GetOutputPort()); > edges->BoundaryEdgesOn(); > edges->FeatureEdgesOff(); > edges->ManifoldEdgesOff(); > edges->NonManifoldEdgesOff(); > edges->Update(); > > int test = edges->GetColoring(); // the result is 1 > > vtkSmartPointer edgeMapper = > vtkSmartPointer::New(); > edgeMapper->SetInputConnection(edges->GetOutputPort()); > > vtkSmartPointer edgeActor = > vtkSmartPointer::New(); > edgeActor->SetMapper(edgeMapper); > edgeActor->GetProperty()->SetLineWidth(3.0); > > > vtkSmartPointer e_points = > vtkSmartPointer::New(); > e_points->SetInputConnection(edges->GetOutputPort()); > e_points->SetValue(1150); > e_points->Update(); > > vtkSmartPointer e_a = > make_an_actor(e_points->GetOutputPort()); > > vtkSmartPointer renderer = > vtkSmartPointer::New(); > renderer->AddActor(e_a); > > > > -- > 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: > https://vtk.org/mailman/listinfo/vtkusers > -- Cory Quammen Staff R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From saleh.sta at live.fr Wed May 2 11:21:28 2018 From: saleh.sta at live.fr (SalaheddineSTA) Date: Wed, 2 May 2018 08:21:28 -0700 (MST) Subject: [vtkusers] VTK Medical example Message-ID: <1525274488588-0.post@n5.nabble.com> Hello, i have tried to use medical example with another dataset(DICOM images not .Raw), but what i see is a strange module ? please can anyone help me ? the mhd file i use : -------------------------- ObjectType = Image NDims = 3 BinaryData = True BinaryDataByteOrderMSB = False ElementSpacing = 1 1 3 ITK_InputFilterName = MetaImageIO DimSize = 256 256 94 ElementType = MET_USHORT ElementDataFile = MR0000%02d 0 31 1 ------------------------------ the vtk c++ code : ------------------------------------ // testMedicalVTK.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "vtkAutoInit.h" VTK_MODULE_INIT(vtkRenderingOpenGL2); // VTK was built with vtkRenderingOpenGL2 VTK_MODULE_INIT(vtkInteractionStyle); #define vtkRenderingCore_AUTOINIT 2(vtkRenderingOpenGL2, vtkInteractionStyle) #include #include #include #include #include #include #include #include #include #include #include #include #include #include int main() { /*if (argc < 2) { cout << "Usage: " << argv[0] << " file.mhd" << endl; return EXIT_FAILURE; }*/ vtkSmartPointer colors = vtkSmartPointer::New(); // Set the colors. unsigned char skinColor[4]= { 255, 125, 64,255 }; colors->SetColor("SkinColor", skinColor); unsigned char bkg[4]={ 51, 77, 102, 255 }; colors->SetColor("BkgColor", bkg); // Create the renderer, the render window, and the interactor. The renderer // draws into the render window, the interactor enables mouse- and // keyboard-based interaction with the data within the render window. // vtkSmartPointer aRenderer = vtkSmartPointer::New(); vtkSmartPointer renWin = vtkSmartPointer::New(); renWin->AddRenderer(aRenderer); vtkSmartPointer iren = vtkSmartPointer::New(); iren->SetRenderWindow(renWin); // The following reader is used to read a series of 2D slices (images) // that compose the volume. The slice dimensions are set, and the // pixel spacing. The data Endianness must also be specified. The reader // uses the FilePrefix in combination with the slice number to construct // filenames using the format FilePrefix.%d. (In this case the FilePrefix // is the root name of the file: quarter.) vtkSmartPointer reader = vtkSmartPointer::New(); reader->SetFileName("C:\\Users\\usr\\Desktop\\SE000002\\img.mhd"); // An isosurface, or contour value of 500 is known to correspond to the // skin of the patient. // The triangle stripper is used to create triangle strips from the // isosurface; these render much faster on many systems. vtkSmartPointer skinExtractor = vtkSmartPointer::New(); skinExtractor->SetInputConnection(reader->GetOutputPort()); skinExtractor->SetValue(0, 500); vtkSmartPointer skinStripper = vtkSmartPointer::New(); skinStripper->SetInputConnection(skinExtractor->GetOutputPort()); vtkSmartPointer skinMapper = vtkSmartPointer::New(); skinMapper->SetInputConnection(skinStripper->GetOutputPort()); skinMapper->ScalarVisibilityOff(); vtkSmartPointer skin = vtkSmartPointer::New(); skin->SetMapper(skinMapper); skin->GetProperty()->SetDiffuseColor(colors->GetColor3d("SkinColor").GetData()); skin->GetProperty()->SetSpecular(.3); skin->GetProperty()->SetSpecularPower(20); skin->GetProperty()->SetOpacity(1); // An isosurface, or contour value of 1150 is known to correspond to the // bone of the patient. // The triangle stripper is used to create triangle strips from the // isosurface; these render much faster on may systems. vtkSmartPointer boneExtractor = vtkSmartPointer::New(); boneExtractor->SetInputConnection(reader->GetOutputPort()); boneExtractor->SetValue(0, 1150); vtkSmartPointer boneStripper = vtkSmartPointer::New(); boneStripper->SetInputConnection(boneExtractor->GetOutputPort()); vtkSmartPointer boneMapper = vtkSmartPointer::New(); boneMapper->SetInputConnection(boneStripper->GetOutputPort()); boneMapper->ScalarVisibilityOff(); vtkSmartPointer bone = vtkSmartPointer::New(); bone->SetMapper(boneMapper); bone->GetProperty()->SetDiffuseColor(colors->GetColor3d("Ivory").GetData()); // An outline provides context around the data. // vtkSmartPointer outlineData = vtkSmartPointer::New(); outlineData->SetInputConnection(reader->GetOutputPort()); vtkSmartPointer mapOutline = vtkSmartPointer::New(); mapOutline->SetInputConnection(outlineData->GetOutputPort()); vtkSmartPointer outline = vtkSmartPointer::New(); outline->SetMapper(mapOutline); outline->GetProperty()->SetColor(colors->GetColor3d("Yellow").GetData()); // It is convenient to create an initial view of the data. The FocalPoint // and Position form a vector direction. Later on (ResetCamera() method) // this vector is used to position the camera to look at the data in // this direction. vtkSmartPointer aCamera = vtkSmartPointer::New(); aCamera->SetViewUp(0, 0, -1); aCamera->SetPosition(0, -1, 0); aCamera->SetFocalPoint(0, 0, 0); aCamera->ComputeViewPlaneNormal(); aCamera->Azimuth(30.0); aCamera->Elevation(30.0); // Actors are added to the renderer. An initial camera view is created. // The Dolly() method moves the camera towards the FocalPoint, // thereby enlarging the image. //aRenderer->AddActor(outline); aRenderer->AddActor(skin); aRenderer->AddActor(bone); aRenderer->SetActiveCamera(aCamera); aRenderer->ResetCamera(); aCamera->Dolly(1.5); // Set a background color for the renderer and set the size of the // render window (expressed in pixels). aRenderer->SetBackground(colors->GetColor3d("BkgColor").GetData()); renWin->SetSize(640, 480); // Note that when camera movement occurs (as it does in the Dolly() // method), the clipping planes often need adjusting. Clipping planes // consist of two planes: near and far along the view direction. The // near plane clips out objects in front of the plane; the far plane // clips out objects behind the plane. This way only what is drawn // between the planes is actually rendered. aRenderer->ResetCameraClippingRange(); // Initialize the event loop and then start it. iren->Initialize(); iren->Start(); return EXIT_SUCCESS; return 0; } ------------------------------------------------------------------------ -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From saleh.sta at live.fr Wed May 2 11:22:43 2018 From: saleh.sta at live.fr (SalaheddineSTA) Date: Wed, 2 May 2018 08:22:43 -0700 (MST) Subject: [vtkusers] Medical examples In-Reply-To: <399961.49172.qm@web45704.mail.sp1.yahoo.com> References: <399961.49172.qm@web45704.mail.sp1.yahoo.com> Message-ID: <1525274563819-0.post@n5.nabble.com> hello Dora, hope you find a solution i have the same issue -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From minpu.code at gmail.com Wed May 2 21:23:55 2018 From: minpu.code at gmail.com (pnt1614) Date: Wed, 2 May 2018 18:23:55 -0700 (MST) Subject: [vtkusers] Why does a vtkFeatureEdge return non-scalar output? In-Reply-To: References: <1525229538591-0.post@n5.nabble.com> Message-ID: <1525310635048-0.post@n5.nabble.com> Thank for the reply, but I tried to call SetRepresentationToPoints() as you said but it does not work. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From cory.quammen at kitware.com Thu May 3 01:15:55 2018 From: cory.quammen at kitware.com (Cory Quammen) Date: Thu, 03 May 2018 05:15:55 +0000 Subject: [vtkusers] Why does a vtkFeatureEdge return non-scalar output? In-Reply-To: <1525310635048-0.post@n5.nabble.com> References: <1525229538591-0.post@n5.nabble.com> <1525310635048-0.post@n5.nabble.com> Message-ID: Please elaborate on the result you see. On Wed, May 2, 2018 at 9:24 PM pnt1614 wrote: > Thank for the reply, but I tried to call SetRepresentationToPoints() as you > said but it does not work. > > > > -- > 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: > https://vtk.org/mailman/listinfo/vtkusers > -- Cory Quammen Staff R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ashishbme at gmail.com Thu May 3 02:04:23 2018 From: ashishbme at gmail.com (ashishbme) Date: Wed, 2 May 2018 23:04:23 -0700 (MST) Subject: [vtkusers] VtkDistanceWidget label text font Message-ID: <1525327463658-0.post@n5.nabble.com> Hi, Can anybody suggest me, how can i change VtkDistanceWidget label text font. because in my application when displaying distance on image label font is too small. Thank you Ashish -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From eric.voigt at outlook.de Thu May 3 03:53:40 2018 From: eric.voigt at outlook.de (Voigteri) Date: Thu, 3 May 2018 00:53:40 -0700 (MST) Subject: [vtkusers] Updating color of actor without call renderWindow->Render() Message-ID: <1525334020351-0.post@n5.nabble.com> Hi all, I have a long list of actors and I periodically (very short time intervals) update the color of these actors with actors[i]->GetProperty()->SetColor(r,g,b); renderWindow->Render() after each color change. However, this redraws the entire scene, not just the actor I am updating and causes my application to become quite sluggish since the colors can be changed interactively by the user at a fast pace. Is there a better/more efficient way to do this? Kind regards, Eric -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From jhlegarreta at vicomtech.org Thu May 3 04:04:56 2018 From: jhlegarreta at vicomtech.org (Jon Haitz Legarreta) Date: Thu, 3 May 2018 10:04:56 +0200 Subject: [vtkusers] VTK Medical example In-Reply-To: <1525274488588-0.post@n5.nabble.com> References: <1525274488588-0.post@n5.nabble.com> Message-ID: Hello Salaheddine, your question is unclear. Which is your specific problem? Can you provide details about what you expect as an output and which the current output is? Also, providing your code as a .cxx file and the corresponding CMakeLists.txt, as well as the dataset you used, is likely to attract a broader audience to try to reproduce your issue. Right now, nobody will be able to run your program without additional work (e.g. CMakeLists.txt), but especially because you hard-coded the location of your input image (first, people may not use the same OS you are using, and they are not likely to have/be willing to create the same folder tree), and if not in a public repository, people will not have access to it. Also, read David Gobbi's answer to the very similar thread ([vtkusers] Medical examples) from 2013 that you just used. Adding a more descriptive subject increases your chances of getting a useful answer, especially if it has not been asked/answered previously. BTW, the last return sentence will never be hit. HTH, JON HAITZ -- On 2 May 2018 at 17:21, SalaheddineSTA wrote: > Hello, i have tried to use medical example with another dataset(DICOM images > not .Raw), but what i see is a strange module ? please can anyone help me ? > > the mhd file i use : > -------------------------- > ObjectType = Image > NDims = 3 > BinaryData = True > BinaryDataByteOrderMSB = False > ElementSpacing = 1 1 3 > ITK_InputFilterName = MetaImageIO > DimSize = 256 256 94 > ElementType = MET_USHORT > ElementDataFile = MR0000%02d 0 31 1 > ------------------------------ > > the vtk c++ code : > ------------------------------------ > // testMedicalVTK.cpp : Defines the entry point for the console application. > // > > #include "stdafx.h" > #include "vtkAutoInit.h" > VTK_MODULE_INIT(vtkRenderingOpenGL2); // VTK was built with > vtkRenderingOpenGL2 > VTK_MODULE_INIT(vtkInteractionStyle); > #define vtkRenderingCore_AUTOINIT 2(vtkRenderingOpenGL2, > vtkInteractionStyle) > > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > > int main() > { > /*if (argc < 2) > { > cout << "Usage: " << argv[0] << " file.mhd" << endl; > return EXIT_FAILURE; > }*/ > > > vtkSmartPointer colors = > vtkSmartPointer::New(); > > // Set the colors. > unsigned char skinColor[4]= { 255, 125, 64,255 }; > colors->SetColor("SkinColor", skinColor); > unsigned char bkg[4]={ 51, 77, 102, 255 }; > colors->SetColor("BkgColor", bkg); > > // Create the renderer, the render window, and the interactor. The > renderer > // draws into the render window, the interactor enables mouse- and > // keyboard-based interaction with the data within the render > window. > // > vtkSmartPointer aRenderer = > vtkSmartPointer::New(); > vtkSmartPointer renWin = > vtkSmartPointer::New(); > renWin->AddRenderer(aRenderer); > > vtkSmartPointer iren = > vtkSmartPointer::New(); > iren->SetRenderWindow(renWin); > > // The following reader is used to read a series of 2D slices > (images) > // that compose the volume. The slice dimensions are set, and the > // pixel spacing. The data Endianness must also be specified. The > reader > // uses the FilePrefix in combination with the slice number to > construct > // filenames using the format FilePrefix.%d. (In this case the > FilePrefix > // is the root name of the file: quarter.) > vtkSmartPointer reader = > vtkSmartPointer::New(); > reader->SetFileName("C:\\Users\\usr\\Desktop\\SE000002\\img.mhd"); > // An isosurface, or contour value of 500 is known to correspond to > the > // skin of the patient. > // The triangle stripper is used to create triangle strips from the > // isosurface; these render much faster on many systems. > vtkSmartPointer skinExtractor = > vtkSmartPointer::New(); > skinExtractor->SetInputConnection(reader->GetOutputPort()); > skinExtractor->SetValue(0, 500); > > vtkSmartPointer skinStripper = > vtkSmartPointer::New(); > skinStripper->SetInputConnection(skinExtractor->GetOutputPort()); > > vtkSmartPointer skinMapper = > vtkSmartPointer::New(); > skinMapper->SetInputConnection(skinStripper->GetOutputPort()); > skinMapper->ScalarVisibilityOff(); > > vtkSmartPointer skin = > vtkSmartPointer::New(); > skin->SetMapper(skinMapper); > > skin->GetProperty()->SetDiffuseColor(colors->GetColor3d("SkinColor").GetData()); > skin->GetProperty()->SetSpecular(.3); > skin->GetProperty()->SetSpecularPower(20); > skin->GetProperty()->SetOpacity(1); > > // An isosurface, or contour value of 1150 is known to correspond to > the > // bone of the patient. > // The triangle stripper is used to create triangle strips from the > // isosurface; these render much faster on may systems. > vtkSmartPointer boneExtractor = > vtkSmartPointer::New(); > boneExtractor->SetInputConnection(reader->GetOutputPort()); > boneExtractor->SetValue(0, 1150); > > vtkSmartPointer boneStripper = > vtkSmartPointer::New(); > boneStripper->SetInputConnection(boneExtractor->GetOutputPort()); > > vtkSmartPointer boneMapper = > vtkSmartPointer::New(); > boneMapper->SetInputConnection(boneStripper->GetOutputPort()); > boneMapper->ScalarVisibilityOff(); > > vtkSmartPointer bone = > vtkSmartPointer::New(); > bone->SetMapper(boneMapper); > > bone->GetProperty()->SetDiffuseColor(colors->GetColor3d("Ivory").GetData()); > > // An outline provides context around the data. > // > vtkSmartPointer outlineData = > vtkSmartPointer::New(); > outlineData->SetInputConnection(reader->GetOutputPort()); > > vtkSmartPointer mapOutline = > vtkSmartPointer::New(); > mapOutline->SetInputConnection(outlineData->GetOutputPort()); > > vtkSmartPointer outline = > vtkSmartPointer::New(); > outline->SetMapper(mapOutline); > > outline->GetProperty()->SetColor(colors->GetColor3d("Yellow").GetData()); > > // It is convenient to create an initial view of the data. The > FocalPoint > // and Position form a vector direction. Later on (ResetCamera() > method) > // this vector is used to position the camera to look at the data in > // this direction. > vtkSmartPointer aCamera = > vtkSmartPointer::New(); > aCamera->SetViewUp(0, 0, -1); > aCamera->SetPosition(0, -1, 0); > aCamera->SetFocalPoint(0, 0, 0); > aCamera->ComputeViewPlaneNormal(); > aCamera->Azimuth(30.0); > aCamera->Elevation(30.0); > > // Actors are added to the renderer. An initial camera view is > created. > // The Dolly() method moves the camera towards the FocalPoint, > // thereby enlarging the image. > //aRenderer->AddActor(outline); > aRenderer->AddActor(skin); > aRenderer->AddActor(bone); > aRenderer->SetActiveCamera(aCamera); > aRenderer->ResetCamera(); > aCamera->Dolly(1.5); > > // Set a background color for the renderer and set the size of the > // render window (expressed in pixels). > aRenderer->SetBackground(colors->GetColor3d("BkgColor").GetData()); > renWin->SetSize(640, 480); > > // Note that when camera movement occurs (as it does in the Dolly() > // method), the clipping planes often need adjusting. Clipping > planes > // consist of two planes: near and far along the view direction. The > // near plane clips out objects in front of the plane; the far plane > // clips out objects behind the plane. This way only what is drawn > // between the planes is actually rendered. > aRenderer->ResetCameraClippingRange(); > > // Initialize the event loop and then start it. > iren->Initialize(); > iren->Start(); > > return EXIT_SUCCESS; > return 0; > } > > ------------------------------------------------------------------------ > > > > -- > 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: > https://vtk.org/mailman/listinfo/vtkusers From paul_geus at hotmail.com Thu May 3 04:06:15 2018 From: paul_geus at hotmail.com (virtual tea kit) Date: Thu, 3 May 2018 01:06:15 -0700 (MST) Subject: [vtkusers] Beautiful Rendering In-Reply-To: References: <1525254402056-0.post@n5.nabble.com> Message-ID: <1525334775211-0.post@n5.nabble.com> Thanks a lot for the vtklightkit advice. With the following code I am now able to render the following image. water.PNG It looks a lot nicer, than anything I had before. But is still a long way away from being water Do you, or anyone else, have any advice on how to make it more water-like? Kind regards -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From jamil.goettlich at gmail.com Thu May 3 06:10:46 2018 From: jamil.goettlich at gmail.com (Jamil Goettlich) Date: Thu, 3 May 2018 12:10:46 +0200 Subject: [vtkusers] Fast File I/O for VTK Message-ID: Hello vtkUsers, I am planning on writing some code for visualizing time sequential data and figured out that it will be hard to get around streaming data (because of RAM limitations). I am currently using vtp files for storing. They are loaded into multiblocks of vtkPolyData to be visualized further on. Since the data can be pretty big, its taking a while to import them, hence streaming data is alot about fast file I/O (please correct me if I'm wrong). I am currently reading vtp files (only Point Data) with about six attributes (velocity, acceleration, pressure, ...) and with the vtkDataArraySelectionClass I am able to read in only selected arrays, which makes everything faster. I am happy with that, but as I do not know anything about File I/O, I guess there is alot of optimization possible. My questions are the following and I'm happy about every answer on one of them: - I realized that for reading XML Data, there is only one CPU core being used. Is there a (c++) implementation to read parallelly? - When I stored all timestep files in vtkMultiBlockData (collection of vtp) and imported those ones with XMLMultiblockDataReader, the import took even longer than manually importing each timestep into polyData and putting them into a multiblock afterwards. Is it possible to parallelly read files of the multiblock, so reading each block is distributed on different cores? (Sorry if the question seems dumb, I have no idea of parallellism) - Has anyone got experience using the HDF5 format for storing and reading polydata?And is it faster than reading XML data/ are multiple cores being used? If so, how much effort does it take to write a custom HDF5 reader/writer (as I did not find any vtk-c++ implementation on the web)? - Or is there any better/ faster/ more flexible/ parallel file format than HDF5/vtp for this purpose? - Is there some good (vtk related) literature concerning that topic? I am sorry for asking many general questions at once but I thought it would help many users that struggle with the same problems to get an overview. I would be happy for any answers/experiences. Thanks alot Jamil -------------- next part -------------- An HTML attachment was scrubbed... URL: From mario at emmenlauer.de Thu May 3 07:12:32 2018 From: mario at emmenlauer.de (Mario Emmenlauer) Date: Thu, 3 May 2018 13:12:32 +0200 Subject: [vtkusers] any libraries for out-of-core volume handling? Message-ID: Dear all, is there out-of-core volume handling in VTK? To be more precise, has VTK file-backed volumes that can be used for visualization and processing? Ideally I'm looking for a full abstraction of the file- backed storage, to process and visualize volumes of TB size in C++. The best I could find is vigra, that has a chunked MultiArray with HDF5 buffered storage. Does anyone know of other implementations? All the best, Mario Emmenlauer -- BioDataAnalysis GmbH, Mario Emmenlauer Tel. Buero: +49-89-74677203 Balanstr. 43 mailto: memmenlauer * biodataanalysis.de D-81669 M?nchen http://www.biodataanalysis.de/ From rccm.kyoshimi at gmail.com Thu May 3 08:03:13 2018 From: rccm.kyoshimi at gmail.com (kenichiro yoshimi) Date: Thu, 3 May 2018 21:03:13 +0900 Subject: [vtkusers] VtkDistanceWidget label text font In-Reply-To: <1525327463658-0.post@n5.nabble.com> References: <1525327463658-0.post@n5.nabble.com> Message-ID: Hi Ashish, You can change the font size as below. --- vtkAxisActor2D * axis = static_cast(distanceWidget->GetRepresentation())->GetAxis(); axis->UseFontSizeFromPropertyOn(); axis->GetTitleTextProperty()->SetFontSize(28); --- I hope this helps you. 2018-05-03 15:04 GMT+09:00 ashishbme : > Hi, > > Can anybody suggest me, how can i change VtkDistanceWidget label text font. > because in my application when displaying distance on image label font is > too small. > > Thank you > Ashish > > > > -- > 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: > https://vtk.org/mailman/listinfo/vtkusers From ken.martin at kitware.com Thu May 3 08:39:48 2018 From: ken.martin at kitware.com (Ken Martin) Date: Thu, 3 May 2018 08:39:48 -0400 Subject: [vtkusers] Updating color of actor without call renderWindow->Render() In-Reply-To: <1525334020351-0.post@n5.nabble.com> References: <1525334020351-0.post@n5.nabble.com> Message-ID: If the events/actions that cause a color change can happen significantly faster than your render rate then you should break apart the two actions (changing the color and rendering). Have a queue of color changes that you push to and then on the next render pop all the ones that have accumulated. The rendering can be driven by a timer. That way you can have 500 Hz of color changes and a 30Hz render rate for example. On Thu, May 3, 2018 at 3:53 AM, Voigteri wrote: > Hi all, > > I have a long list of actors and I periodically (very short time intervals) > update the color of these actors with > > actors[i]->GetProperty()->SetColor(r,g,b); > renderWindow->Render() > > after each color change. However, this redraws the entire scene, not just > the actor I am updating and causes my application to become quite sluggish > since the colors can be changed interactively by the user at a fast pace. > > Is there a better/more efficient way to do this? > > Kind regards, > > Eric > > > > -- > 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: > https://vtk.org/mailman/listinfo/vtkusers > -- Ken Martin PhD Distinguished Engineer Kitware Inc. 101 East Weaver Street Carrboro, North Carolina 27510 USA 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 dave.demarle at kitware.com Thu May 3 08:46:53 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Thu, 3 May 2018 08:46:53 -0400 Subject: [vtkusers] Beautiful Rendering In-Reply-To: <1525334775211-0.post@n5.nabble.com> References: <1525254402056-0.post@n5.nabble.com> <1525334775211-0.post@n5.nabble.com> Message-ID: In VTK 8.1 and ParaView 5.5.0 you can use OSPRay's path tracer. That will allow you to apply a material to the surface and give it true reflective and refractive characteristics you are used to seeing in the real world. At the VTK level, the most relevant example so far is this bit from a regression test. https://gitlab.kitware.com/vtk/vtk/blob/master/Rendering/OSPRay/Testing/Cxx/TestPathTracerMaterials.cxx#L248. You will need to download OSPRay and build VTK with Module_vtkRenderingOSPRay on to use it. To quickly try it I recommend ParaView. To do so: * Save the data into a vtk file and load it in a ParaView 5.5.0 binary. * Change the background in the Properties panel from "Single color" to "Gradient" to give the reflective and refractive rays something to work with. * Type ospray in the search field on the Properties panel to focus on OSPRay related controls. * Click Enable OSPRay. * Change OSPRay Renderer from "scivis" to "pathtracer". * Increase the "Samples Per Pixel" from 1 to 10 to cut down on the grainy noise (like underexposure in film). * Change the OSPRay Material from "None" to "water". The "water" material in ParaView is just one example which may or may not be appropriate for your data. By doing some file editing or coding you can arbitrarily change the material to make it more blue, more refractive, etc. The VTK tests are your best guide for that right now. See also the ospray_mats.json file in the ParaView binary. David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Thu, May 3, 2018 at 4:06 AM, virtual tea kit wrote: > Thanks a lot for the vtklightkit advice. > > With the following code I am now able to render the following image. > water.PNG > It looks a lot nicer, than anything I had before. > But is still a long way away from being water > > Do you, or anyone else, have any advice on how to make it more water-like? > > Kind regards > > > > -- > 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: > https://vtk.org/mailman/listinfo/vtkusers From dave.demarle at kitware.com Thu May 3 08:57:13 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Thu, 3 May 2018 08:57:13 -0400 Subject: [vtkusers] Fast File I/O for VTK In-Reply-To: References: Message-ID: Sorry I can only answer one of your questions at this time. On Thu, May 3, 2018 at 6:10 AM, Jamil Goettlich wrote: > Hello vtkUsers, > > I am planning on writing some code for visualizing time sequential data and > figured out that it will be hard to get around streaming data (because of > RAM limitations). I am currently using vtp files for storing. They are > loaded into multiblocks of vtkPolyData to be visualized further on. Since > the data can be pretty big, its taking a while to import them, hence > streaming data is alot about fast file I/O (please correct me if I'm wrong). > I am currently reading vtp files (only Point Data) with about six attributes > (velocity, acceleration, pressure, ...) and with the > vtkDataArraySelectionClass I am able to read in only selected arrays, which > makes everything faster. I am happy with that, but as I do not know anything > about File I/O, I guess there is alot of optimization possible. > > My questions are the following and I'm happy about every answer on one of > them: > - I realized that for reading XML Data, there is only one CPU core being > used. Is there a (c++) implementation to read parallelly? > - When I stored all timestep files in vtkMultiBlockData (collection of vtp) > and imported those ones with XMLMultiblockDataReader, the import took even > longer than manually importing each timestep into polyData and putting them > into a multiblock afterwards. Is it possible to parallelly read files of the > multiblock, so reading each block is distributed on different cores? (Sorry > if the question seems dumb, I have no idea of parallellism) > - Has anyone got experience using the HDF5 format for storing and reading > polydata?And is it faster than reading XML data/ are multiple cores being > used? If so, how much effort does it take to write a custom HDF5 > reader/writer (as I did not find any vtk-c++ implementation on the web)? You could look at the source code of IO/Truchas. That reader took me perhaps a week of effort to get to where it is now. It makes unstructured grids of volumetric cells types. For somple points your code will be less complex. > - Or is there any better/ faster/ more flexible/ parallel file format than > HDF5/vtp for this purpose? > - Is there some good (vtk related) literature concerning that topic? > > I am sorry for asking many general questions at once but I thought it would > help many users that struggle with the same problems to get an overview. I > would be happy for any answers/experiences. > > Thanks alot > > Jamil > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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: > https://vtk.org/mailman/listinfo/vtkusers > From lasso at queensu.ca Thu May 3 08:57:47 2018 From: lasso at queensu.ca (Andras Lasso) Date: Thu, 3 May 2018 12:57:47 +0000 Subject: [vtkusers] Updating color of actor without call renderWindow->Render() In-Reply-To: References: <1525334020351-0.post@n5.nabble.com> Message-ID: You may use ctkVTKAbstractView (or copy-paste its rendering mechanism into your code). It has a scheduleRender() method that you call instead of directly calling Render(). The class makes sure that actual rendering does not happen more frequently than the DesiredUpdateRate set in the render window. http://www.commontk.org/docs/html/classctkVTKAbstractView.html https://github.com/commontk/CTK/blob/master/Libs/Visualization/VTK/Widgets/ctkVTKAbstractView.h Or, you may enable ?vsync? in your GPU driver, which delays your rendering thread if it gets rendering request more frequently than the refresh rate of your monitor. Andras From: vtkusers On Behalf Of Ken Martin Sent: Thursday, May 3, 2018 8:40 AM To: Voigteri Cc: vtk Subject: Re: [vtkusers] Updating color of actor without call renderWindow->Render() If the events/actions that cause a color change can happen significantly faster than your render rate then you should break apart the two actions (changing the color and rendering). Have a queue of color changes that you push to and then on the next render pop all the ones that have accumulated. The rendering can be driven by a timer. That way you can have 500 Hz of color changes and a 30Hz render rate for example. On Thu, May 3, 2018 at 3:53 AM, Voigteri > wrote: Hi all, I have a long list of actors and I periodically (very short time intervals) update the color of these actors with actors[i]->GetProperty()->SetColor(r,g,b); renderWindow->Render() after each color change. However, this redraws the entire scene, not just the actor I am updating and causes my application to become quite sluggish since the colors can be changed interactively by the user at a fast pace. Is there a better/more efficient way to do this? Kind regards, Eric -- 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: https://vtk.org/mailman/listinfo/vtkusers -- Ken Martin PhD Distinguished Engineer Kitware Inc. 101 East Weaver Street Carrboro, North Carolina 27510 USA 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 Thu May 3 09:04:06 2018 From: lasso at queensu.ca (Andras Lasso) Date: Thu, 3 May 2018 13:04:06 +0000 Subject: [vtkusers] Fast File I/O for VTK In-Reply-To: References: Message-ID: > it will be hard to get around streaming data (because of RAM limitations). You may increase virtual memory size setting in your system and let the operating system worry about how to save/restore physical memory content to/from disk. You have less control over what is written to disk and when, but everything is done at a very low level and you don't need file parsing, so it may be simpler and faster than re-loading hdf files. Andras -----Original Message----- From: vtkusers On Behalf Of David E DeMarle Sent: Thursday, May 3, 2018 8:57 AM To: Jamil Goettlich Cc: vtk Subject: Re: [vtkusers] Fast File I/O for VTK Sorry I can only answer one of your questions at this time. On Thu, May 3, 2018 at 6:10 AM, Jamil Goettlich wrote: > Hello vtkUsers, > > I am planning on writing some code for visualizing time sequential > data and figured out that it will be hard to get around streaming data > (because of RAM limitations). I am currently using vtp files for > storing. They are loaded into multiblocks of vtkPolyData to be > visualized further on. Since the data can be pretty big, its taking a > while to import them, hence streaming data is alot about fast file I/O (please correct me if I'm wrong). > I am currently reading vtp files (only Point Data) with about six > attributes (velocity, acceleration, pressure, ...) and with the > vtkDataArraySelectionClass I am able to read in only selected arrays, > which makes everything faster. I am happy with that, but as I do not > know anything about File I/O, I guess there is alot of optimization possible. > > My questions are the following and I'm happy about every answer on one > of > them: > - I realized that for reading XML Data, there is only one CPU core > being used. Is there a (c++) implementation to read parallelly? > - When I stored all timestep files in vtkMultiBlockData (collection of > vtp) and imported those ones with XMLMultiblockDataReader, the import > took even longer than manually importing each timestep into polyData > and putting them into a multiblock afterwards. Is it possible to > parallelly read files of the multiblock, so reading each block is > distributed on different cores? (Sorry if the question seems dumb, I > have no idea of parallellism) > - Has anyone got experience using the HDF5 format for storing and > reading polydata?And is it faster than reading XML data/ are multiple > cores being used? If so, how much effort does it take to write a > custom HDF5 reader/writer (as I did not find any vtk-c++ implementation on the web)? You could look at the source code of IO/Truchas. That reader took me perhaps a week of effort to get to where it is now. It makes unstructured grids of volumetric cells types. For somple points your code will be less complex. > - Or is there any better/ faster/ more flexible/ parallel file format > than HDF5/vtp for this purpose? > - Is there some good (vtk related) literature concerning that topic? > > I am sorry for asking many general questions at once but I thought it > would help many users that struggle with the same problems to get an > overview. I would be happy for any answers/experiences. > > Thanks alot > > Jamil > > > > _______________________________________________ > Powered by > https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&dat > a=02%7C01%7Classo%40queensu.ca%7C5d51857638d640abfce308d5b0f5757a%7Cd6 > 1ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636609490646480690&sdata=ZlZe > F0bsckE9EbKlv9jspraeoJNwfP0OzeV2MTyDeyQ%3D&reserved=0 > > Visit other Kitware open-source projects at > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.ki > tware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40queens > u.ca%7C5d51857638d640abfce308d5b0f5757a%7Cd61ecb3b38b142d582c4efb2838b > 925c%7C1%7C0%7C636609490646480690&sdata=Yc6YnPgFfYMzrRIIX8FdjWNQe40UbF > ojCPyQ7CDzckY%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.vt > k.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Classo%40queensu.ca%7C5d51857638d > 640abfce308d5b0f5757a%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636 > 609490646480690&sdata=w8ravzj8oob5nwoV6WNIf3ITYJdJAkDmfINUy3wzR54%3D&r > eserved=0 > > Search the list archives at: > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkma > il.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Classo%40queensu.ca%7C > 5d51857638d640abfce308d5b0f5757a%7Cd61ecb3b38b142d582c4efb2838b925c%7C > 1%7C0%7C636609490646480690&sdata=hDaOmlmp%2FMsuC2E463IMIAfdHqRZRI4rtAX > 1x%2BuEDdo%3D&reserved=0 > > Follow this link to subscribe/unsubscribe: > https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk.o > rg%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%7 > C5d51857638d640abfce308d5b0f5757a%7Cd61ecb3b38b142d582c4efb2838b925c%7 > C1%7C0%7C636609490646480690&sdata=tZytuI3tWINvEA9vLmYV8q52awE56KpUGpaw > yKsn9JM%3D&reserved=0 > _______________________________________________ Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7C5d51857638d640abfce308d5b0f5757a%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636609490646480690&sdata=ZlZeF0bsckE9EbKlv9jspraeoJNwfP0OzeV2MTyDeyQ%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%7C5d51857638d640abfce308d5b0f5757a%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636609490646480690&sdata=Yc6YnPgFfYMzrRIIX8FdjWNQe40UbFojCPyQ7CDzckY%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%7C5d51857638d640abfce308d5b0f5757a%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636609490646480690&sdata=w8ravzj8oob5nwoV6WNIf3ITYJdJAkDmfINUy3wzR54%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%7C5d51857638d640abfce308d5b0f5757a%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636609490646480690&sdata=hDaOmlmp%2FMsuC2E463IMIAfdHqRZRI4rtAX1x%2BuEDdo%3D&reserved=0 Follow this link to subscribe/unsubscribe: https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk.org%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%7C5d51857638d640abfce308d5b0f5757a%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636609490646480690&sdata=tZytuI3tWINvEA9vLmYV8q52awE56KpUGpawyKsn9JM%3D&reserved=0 From ashahrior.91994 at gmail.com Thu May 3 09:28:45 2018 From: ashahrior.91994 at gmail.com (Ashef Shahrior) Date: Thu, 3 May 2018 19:28:45 +0600 Subject: [vtkusers] Installation error in building VTK Message-ID: I am following this link - https://www.vtk.org/Wiki/VTK/Building/Windows and this video tutorial - https://www.youtube.com/watch?v=IgvbhyDh8r0&t=4s for installing VTK-8.1.0 on my Windows-10. According to both of the links, I have built the ALL_BUILD. But according to the first link, after being done with ALL_BUILD, I am supposed to be selecting INSTALL and then do "Build Only INSTALL". But after selecting that, there was a building process for like an hour in the output window and after completion, it gave the following errors. I have no idea what this means. Please help. I have installed ITK in this manner, and it worked pretty fine. But I am having trouble with VTK. :( -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 14021 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 55188 bytes Desc: not available URL: From wangq1979 at outlook.com Thu May 3 09:36:31 2018 From: wangq1979 at outlook.com (Wang Q) Date: Thu, 3 May 2018 13:36:31 +0000 Subject: [vtkusers] Programmatically move actors and reset all actors Message-ID: Hello vtkers, I use Qt5.9 with VTK8.0 to develop a GUI based system. I create multiple actors and want to allow users to interact with the actors by clicking relating buttons, e.g. changing colours, moving in one direction and rotating along one axis. The basic strategy is that all actors store in a vector and update the colours or transforms in a separate function when a button is clicked. In the function, the code is like: double tmpColor[4]; tmpColor[0] = pipeColor[0]; tmpColor[1] = pipeColor[1]; tmpColor[2] = pipeColor[2]; tmpColor[3] = pipeColor[3]; pipeActor->GetProperty()->SetColor(tmpColor); pipeActor->GetProperty()->SetOpacity(tmpColor[3]); pipeTransform->Translate(0.0, 0.0, currentMove); pipeTransform->RotateY(static_cast(currentRotate)); pipeTransform->Update(); pipeActor->SetUserTransform(pipeTransform); this->bmRenderer->ResetCamera(); this->bmRenderer->GetActiveCamera()->Zoom(scaleFactor); ui->bmWidget->GetRenderWindow()->Render(); The actor's colour is updated but the movement is not. -------------- next part -------------- An HTML attachment was scrubbed... URL: From wangq1979 at outlook.com Thu May 3 09:42:39 2018 From: wangq1979 at outlook.com (Wang Q) Date: Thu, 3 May 2018 13:42:39 +0000 Subject: [vtkusers] =?gb2312?b?tPC4tDogUHJvZ3JhbW1hdGljYWxseSBtb3ZlIGFj?= =?gb2312?b?dG9ycyBhbmQgcmVzZXQgYWxsIGFjdG9ycw==?= In-Reply-To: References: Message-ID: Sorry for the inconvenience, but somehow the incomplete email was sent out accidentally. The interactor of the vtkWidget window is disabled so the default interaction by mouse is not allowed. Any help will be appreciated! Cheers, Chiang ________________________________ ???: vtkusers ?? Wang Q ????: 2018?5?3? 14:36 ???: vtkusers at vtk.org ??: [vtkusers] Programmatically move actors and reset all actors Hello vtkers, I use Qt5.9 with VTK8.0 to develop a GUI based system. I create multiple actors and want to allow users to interact with the actors by clicking relating buttons, e.g. changing colours, moving in one direction and rotating along one axis. The basic strategy is that all actors store in a vector and update the colours or transforms in a separate function when a button is clicked. In the function, the code is like: double tmpColor[4]; tmpColor[0] = pipeColor[0]; tmpColor[1] = pipeColor[1]; tmpColor[2] = pipeColor[2]; tmpColor[3] = pipeColor[3]; pipeActor->GetProperty()->SetColor(tmpColor); pipeActor->GetProperty()->SetOpacity(tmpColor[3]); pipeTransform->Translate(0.0, 0.0, currentMove); pipeTransform->RotateY(static_cast(currentRotate)); pipeTransform->Update(); pipeActor->SetUserTransform(pipeTransform); this->bmRenderer->ResetCamera(); this->bmRenderer->GetActiveCamera()->Zoom(scaleFactor); ui->bmWidget->GetRenderWindow()->Render(); The actor's colour is updated but the movement is not. -------------- next part -------------- An HTML attachment was scrubbed... URL: From seb.an at icloud.com Thu May 3 13:08:07 2018 From: seb.an at icloud.com (sebastian_a) Date: Thu, 3 May 2018 10:08:07 -0700 (MST) Subject: [vtkusers] Solidify-Modifier for VTK Message-ID: <1525367287775-0.post@n5.nabble.com> Hello, I created a Blender-like Solidify-Algorithm. Maybe it helps someone. Unfortunately, also like the one in Blender, it has the following problem: If the Solidification-Thickness to large (for example larger than half the distance to an opponent face), it creates inside-out-errors. Do you have any suggestions how to fix this nicely? Thanks, Sebastian import vtk import numpy as np solidificationThickness = 2 # polydataSource = vtk.vtkSTLReader() # polydataSource.SetFileName("testmodel.stl") # polydataSource.Update() polydataSource = vtk.vtkSphereSource() polydataSource.SetRadius(10) polydataSource.SetThetaResolution(5) polydataSource.SetPhiResolution(3) polydataSource.Update() # remove double vertices cleanPolyData = vtk.vtkCleanPolyData() cleanPolyData.SetInputData(polydataSource.GetOutput()) cleanPolyData.Update() # create normals normals = vtk.vtkPolyDataNormals() normals.SetComputeCellNormals(1) normals.SetInputData(cleanPolyData.GetOutput()) normals.SplittingOff() normals.Update() polydata = vtk.vtkPolyData() polydata.DeepCopy(normals.GetOutput()) numberOfPoints = polydata.GetNumberOfPoints() print polydata.GetNumberOfPoints() # get boundary edges, used later featureEdges = vtk.vtkFeatureEdges() featureEdges.BoundaryEdgesOn() featureEdges.ColoringOff() featureEdges.FeatureEdgesOff() featureEdges.NonManifoldEdgesOff() featureEdges.ManifoldEdgesOff() featureEdges.SetInputData(normals.GetOutput()) featureEdges.Update() # check for intersection cellLocator = vtk.vtkOBBTree() cellLocator.SetDataSet(polydata) cellLocator.BuildLocator() addingPoints = [] addingPolys = [] for pointID in range(numberOfPoints): cellIDs = vtk.vtkIdList() polydata.GetPointCells(pointID, cellIDs) normalsArray = [] # ilterate through all cells/faces which contain point for id in xrange(cellIDs.GetNumberOfIds()): # faceData = [] n = [] n.append(polydata.GetCellData().GetArray('Normals').GetValue(cellIDs.GetId(id)*3)) n.append(polydata.GetCellData().GetArray('Normals').GetValue(cellIDs.GetId(id)*3 + 1)) n.append(polydata.GetCellData().GetArray('Normals').GetValue(cellIDs.GetId(id)*3 + 2)) normalsArray.append(np.array(n) * (-1)) # calculate position of new vert dir_vec = np.zeros(3) for n in normalsArray: dir_vec = dir_vec + np.array(n) dir_vec_norm = dir_vec / np.linalg.norm(dir_vec) proj_length = np.dot(dir_vec_norm, np.array(normalsArray[0])) dir_vec_finallenght = dir_vec_norm * proj_length vertex_neu = np.array(polydata.GetPoint(pointID)) + (dir_vec_finallenght * solidificationThickness) addingPoints.append(vertex_neu) for cellID in range(polydata.GetNumberOfCells()): pointIDs = vtk.vtkIdList() polydata.GetCellPoints(cellID, pointIDs) newPointIDs = vtk.vtkIdList() for i in reversed(range(pointIDs.GetNumberOfIds())): newPointIDs.InsertNextId(int(pointIDs.GetId(i) + numberOfPoints)) addingPolys.append(newPointIDs) doubleSurfacePoints = vtk.vtkPoints() doubleSurfacePolys = vtk.vtkCellArray() doubleSurfacePoints.DeepCopy(polydata.GetPoints()) doubleSurfacePolys.DeepCopy(polydata.GetPolys()) addedPoints = vtk.vtkPoints() for p in addingPoints: doubleSurfacePoints.InsertNextPoint(p) addedPoints.InsertNextPoint(p) for p in addingPolys: doubleSurfacePolys.InsertNextCell(p) doubleSurfacePD = vtk.vtkPolyData() doubleSurfacePD.SetPoints(doubleSurfacePoints) doubleSurfacePD.SetPolys(doubleSurfacePolys) # add faces to boundary edges mergePoints = vtk.vtkMergePoints() mergePoints.InitPointInsertion(doubleSurfacePD.GetPoints(), doubleSurfacePD.GetBounds()) mergePoints.SetDataSet(doubleSurfacePD) mergePoints.BuildLocator() watertightPolys = vtk.vtkCellArray() watertightPolys.DeepCopy(doubleSurfacePD.GetPolys()) watertightPoints = vtk.vtkPoints() watertightPoints.DeepCopy(doubleSurfacePD.GetPoints()) for e in range(featureEdges.GetOutput().GetNumberOfCells()): pointIDs = vtk.vtkIdList() featureEdges.GetOutput().GetCellPoints(e, pointIDs) if pointIDs.GetNumberOfIds() == 2: # -> Edge matchingPointIDs = [] newPointIDs = vtk.vtkIdList() for p in range(2): matchingPointIDs.append(mergePoints.IsInsertedPoint(featureEdges.GetOutput().GetPoint(pointIDs.GetId(p)))) if not (-1) in matchingPointIDs: # edge vertex not found in original pd, should not happen newPointIDs.InsertNextId(matchingPointIDs[1]) newPointIDs.InsertNextId(matchingPointIDs[0]) newPointIDs.InsertNextId(matchingPointIDs[0]+numberOfPoints) newPointIDs.InsertNextId(matchingPointIDs[1]+numberOfPoints) watertightPolys.InsertNextCell(newPointIDs) watertightPD = vtk.vtkPolyData() watertightPD.SetPoints(watertightPoints) watertightPD.SetPolys(watertightPolys) # triangulate new connecting faces triangleFilter = vtk.vtkTriangleFilter() triangleFilter.SetInputData(watertightPD) triangleFilter.Update() # visualize mapper = vtk.vtkPolyDataMapper() mapper.SetInputData(triangleFilter.GetOutput()) actor = vtk.vtkActor() actor.GetProperty().SetEdgeVisibility(1) actor.GetProperty().SetOpacity(0.5) actor.GetProperty().BackfaceCullingOn() #actor.GetProperty().SetRepresentationToWireframe() actor.SetMapper(mapper) camera = vtk.vtkCamera() camera.SetPosition(1,1,1) camera.SetFocalPoint(0,0,0) renderer = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(renderer) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) renderer.AddActor(actor) renderer.SetActiveCamera(camera) renderer.ResetCamera() renderer.SetBackground(1,1,1) renWin.SetSize(300,300) renWin.Render() iren.Start() -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From aborsic at ne-scientific.com Thu May 3 17:14:02 2018 From: aborsic at ne-scientific.com (Andrea Borsic) Date: Thu, 3 May 2018 23:14:02 +0200 Subject: [vtkusers] Medical image display - color of image pixels outside an image volume sliced with vtkImageResliceMapper Message-ID: <67c2093e-0e3a-24f6-9ffd-4535215ae49e@ne-scientific.com> Hi, I have a question about the use of the vtkImageReslice mapper. In setting up a VTK pipeline for displaying CT image slices we used previously a vtkImageReslice followed by a vtkImageMapToColors. We have recently switched to using a vtkImageResliceMapper instead of the two previous classes, but we are experiencing an issue. When using vtkImageReslice the method SetBackgroundLevel() was called with a value of -1000 which mapped pixels falling outside the sampled CT volume to a black pixel on screen, given the LUT in use. In vtkImageResliceMapper the conversion from CT scalar values to screen colors is performed internally and we have tried playing with BackgroundOn() and with SetBackingColor of a vtkImagePorperty is passed to the vtkImageResliceMapper, but we are not able to get rid of a thin gray border that at times shows around the image as shown in the screenshot below .... Additionally, when the slicing plane is set at the very beginning of the volume or at the very end, the output is a slice which is completely gray. I suspect that pixel values for sampling locations that fall outside of the CT image volume are set to a default value which results in the gray pixels. Can anyone please advise on how to control such value - so that gray borders could be eliminated? Thanks in advance for any suggestion, Best Regards, Andrea -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: dikmnalkeelkenoa.png Type: image/png Size: 377747 bytes Desc: not available URL: From david.gobbi at gmail.com Thu May 3 17:54:26 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 3 May 2018 15:54:26 -0600 Subject: [vtkusers] Medical image display - color of image pixels outside an image volume sliced with vtkImageResliceMapper In-Reply-To: <67c2093e-0e3a-24f6-9ffd-4535215ae49e@ne-scientific.com> References: <67c2093e-0e3a-24f6-9ffd-4535215ae49e@ne-scientific.com> Message-ID: Hi Andrea, I've tried reproducing your problem with CTs on my own system, but so far I haven't seen the grey border. Can you show me all of the settings that you use with vtkImageResliceMapper and also all the settings for the vtkImageProperty? Also, can you tell me what version of VTK you are using? And whether you're using the OpenGL backend or the OpenGL2 backend? And what your are using to read the DICOM images into your program (ITK, vtkDICOMImageReader, vtk-dicom, GDCM, etc)? - David On Thu, May 3, 2018 at 3:14 PM, Andrea Borsic wrote: > Hi, > > I have a question about the use of the vtkImageReslice mapper. > > In setting up a VTK pipeline for displaying CT image slices we used > previously a vtkImageReslice followed by a vtkImageMapToColors. We have > recently switched to using a vtkImageResliceMapper instead of the two > previous classes, but we are experiencing an issue. > > When using vtkImageReslice the method SetBackgroundLevel() was called with > a value of -1000 which mapped pixels falling outside the sampled CT volume > to a black pixel on screen, given the LUT in use. > > In vtkImageResliceMapper the conversion from CT scalar values to screen > colors is performed internally and we have tried playing with > BackgroundOn() and with SetBackingColor of a vtkImagePorperty is passed to > the vtkImageResliceMapper, but we are not able to get rid of a thin gray > border that at times shows around the image as shown in the screenshot > below .... > > > > Additionally, when the slicing plane is set at the very beginning of the > volume or at the very end, the output is a slice which is completely gray. > > I suspect that pixel values for sampling locations that fall outside of > the CT image volume are set to a default value which results in the gray > pixels. > > Can anyone please advise on how to control such value - so that gray > borders could be eliminated? > > Thanks in advance for any suggestion, > > Best Regards, > > Andrea > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: dikmnalkeelkenoa.png Type: image/png Size: 377747 bytes Desc: not available URL: From rabysam28 at gmail.com Thu May 3 18:00:00 2018 From: rabysam28 at gmail.com (Sam Raby) Date: Thu, 3 May 2018 15:00:00 -0700 Subject: [vtkusers] Fwd: vtkPoint In-Reply-To: References: <22F26B9D-D860-4FAE-8C40-59E57D2EDE1D@gmail.com> Message-ID: Thanks for the feedback. Here is the problem statement: I want to visualize points but I want the points to become larger/smaller as I zoom in/out. I could add glyph to each point, but glyph also wants me to assign a source to it, and I end up assigning for example a small Cubes, but I need to visualize a point not a cube. Is there a way to enable a point so that zoom in and out can change the size of point? or any alternative approach? Thanks Sam On Sun, Apr 22, 2018 at 3:34 PM, Angela Noecker wrote: > I add a glyph. > > > On Apr 22, 2018, at 3:01 PM, Sam Raby wrote: > > > > Hi > > When we use vtkPoint or vtkPointSource, as we zoom in and out, the size > of points does not change. Is there a way to enable this so that zoom in > and out can change the size of point? > > Thanks > > S > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > http://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: > > https://vtk.org/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From patrick.laurin at caboma.com Thu May 3 18:09:09 2018 From: patrick.laurin at caboma.com (Patrick Laurin) Date: Thu, 3 May 2018 22:09:09 +0000 Subject: [vtkusers] vtkPointVolumeInterpolator does not adjust bounds after PolyData input update Message-ID: Hi, I'm having a bit of trouble using the vtkPointVolumeInterpolator with default parameters, using a Voronoi Kernel and a bounded volume as a source. Calling a new vtkPointInterpolator object with any vtkPolyData as input works just fine, but as soon as I switch the input to a different PolyData, the RequestData method gets processed but the box doesn't adjust in consequence. The input variable received by RequestData does not seem to be the updated one. Any thoughts? Many thanks, Patrick Laurin -------------- next part -------------- An HTML attachment was scrubbed... URL: From rccm.kyoshimi at gmail.com Thu May 3 21:03:35 2018 From: rccm.kyoshimi at gmail.com (kenichiro yoshimi) Date: Fri, 4 May 2018 10:03:35 +0900 Subject: [vtkusers] Installation error in building VTK In-Reply-To: References: Message-ID: Hi, Did you specify the proper path for "CMAKE_INSTALL_PREFIX" instead of default path? The default requires admin rights. Otherwise, you need to launch Visual Studio as Administrator mode. Best Regards, 2018-05-03 22:28 GMT+09:00 Ashef Shahrior : > I am following this link - https://www.vtk.org/Wiki/VTK/Building/Windows and > this video tutorial - https://www.youtube.com/watch?v=IgvbhyDh8r0&t=4s for > installing VTK-8.1.0 on my Windows-10. According to both of the links, I > have built the ALL_BUILD. But according to the first link, after being done > with ALL_BUILD, I am supposed to be selecting INSTALL and then do "Build > Only INSTALL". > > > > But after selecting that, there was a building process for like an hour in > the output window and after completion, it gave the following errors. > > > I have no idea what this means. Please help. I have installed ITK in this > manner, and it worked pretty fine. But I am having trouble with VTK. :( > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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: > https://vtk.org/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 55188 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 14021 bytes Desc: not available URL: From minpu.code at gmail.com Thu May 3 21:34:09 2018 From: minpu.code at gmail.com (pnt1614) Date: Thu, 3 May 2018 18:34:09 -0700 (MST) Subject: [vtkusers] How to generate a surface from u-shape points? Message-ID: <1525397649894-0.post@n5.nabble.com> I have a set of co-planar points which forms u-shape surface, so I want to generate a surface using these points but I have no idea how to do it. I have tried to create triangles as follows but it does not work. start = 0; back = #points - 1; num_triangles = #points - 2; for (int i=0; i < num_tirangles; i++) { Make 2 triangles using 4 points: points[start], points[start+1], points[back], points[back-1] start++; back--; } Since I have said that these points form a u-shape surface, generated triangles go out the u-shape. Similarly, using vtkUnstructuredGrid and vtkSurfaceReconstructionFilter makes the same problem. Is there anyone experienced about this problem? Please, help me. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From lasso at queensu.ca Thu May 3 22:22:50 2018 From: lasso at queensu.ca (Andras Lasso) Date: Fri, 4 May 2018 02:22:50 +0000 Subject: [vtkusers] Solidify-Modifier for VTK In-Reply-To: <1525367287775-0.post@n5.nabble.com> References: <1525367287775-0.post@n5.nabble.com> Message-ID: Yes, if you extrude in surface normal direction then there is a high chance that you will have self-intersecting faces. If you need a solution that guarantees accurate thickness and never generates self-intersecting faces, then you can compute a distance map using vtkImplicitModeller and create a surface from it using vtkContourFilter. Of course, computation time and memory need may be magnitudes higher than simple linear extrusion if you need highly accurate output. By the way, it seems that your code does something very similar to vtkLinearExtrusionFilter. You might be able to simply use vtkLinearExtrusionFilter as is, or with an optional pre-shrinking step using vtkWarpVector (if you want to center the shell around the original surface). Andras -----Original Message----- From: vtkusers On Behalf Of sebastian_a Sent: Thursday, May 3, 2018 1:08 PM To: vtkusers at vtk.org Subject: [vtkusers] Solidify-Modifier for VTK Hello, I created a Blender-like Solidify-Algorithm. Maybe it helps someone. Unfortunately, also like the one in Blender, it has the following problem: If the Solidification-Thickness to large (for example larger than half the distance to an opponent face), it creates inside-out-errors. Do you have any suggestions how to fix this nicely? Thanks, Sebastian import vtk import numpy as np solidificationThickness = 2 # polydataSource = vtk.vtkSTLReader() # polydataSource.SetFileName("testmodel.stl") # polydataSource.Update() polydataSource = vtk.vtkSphereSource() polydataSource.SetRadius(10) polydataSource.SetThetaResolution(5) polydataSource.SetPhiResolution(3) polydataSource.Update() # remove double vertices cleanPolyData = vtk.vtkCleanPolyData() cleanPolyData.SetInputData(polydataSource.GetOutput()) cleanPolyData.Update() # create normals normals = vtk.vtkPolyDataNormals() normals.SetComputeCellNormals(1) normals.SetInputData(cleanPolyData.GetOutput()) normals.SplittingOff() normals.Update() polydata = vtk.vtkPolyData() polydata.DeepCopy(normals.GetOutput()) numberOfPoints = polydata.GetNumberOfPoints() print polydata.GetNumberOfPoints() # get boundary edges, used later featureEdges = vtk.vtkFeatureEdges() featureEdges.BoundaryEdgesOn() featureEdges.ColoringOff() featureEdges.FeatureEdgesOff() featureEdges.NonManifoldEdgesOff() featureEdges.ManifoldEdgesOff() featureEdges.SetInputData(normals.GetOutput()) featureEdges.Update() # check for intersection cellLocator = vtk.vtkOBBTree() cellLocator.SetDataSet(polydata) cellLocator.BuildLocator() addingPoints = [] addingPolys = [] for pointID in range(numberOfPoints): cellIDs = vtk.vtkIdList() polydata.GetPointCells(pointID, cellIDs) normalsArray = [] # ilterate through all cells/faces which contain point for id in xrange(cellIDs.GetNumberOfIds()): # faceData = [] n = [] n.append(polydata.GetCellData().GetArray('Normals').GetValue(cellIDs.GetId(id)*3)) n.append(polydata.GetCellData().GetArray('Normals').GetValue(cellIDs.GetId(id)*3 + 1)) n.append(polydata.GetCellData().GetArray('Normals').GetValue(cellIDs.GetId(id)*3 + 2)) normalsArray.append(np.array(n) * (-1)) # calculate position of new vert dir_vec = np.zeros(3) for n in normalsArray: dir_vec = dir_vec + np.array(n) dir_vec_norm = dir_vec / np.linalg.norm(dir_vec) proj_length = np.dot(dir_vec_norm, np.array(normalsArray[0])) dir_vec_finallenght = dir_vec_norm * proj_length vertex_neu = np.array(polydata.GetPoint(pointID)) + (dir_vec_finallenght * solidificationThickness) addingPoints.append(vertex_neu) for cellID in range(polydata.GetNumberOfCells()): pointIDs = vtk.vtkIdList() polydata.GetCellPoints(cellID, pointIDs) newPointIDs = vtk.vtkIdList() for i in reversed(range(pointIDs.GetNumberOfIds())): newPointIDs.InsertNextId(int(pointIDs.GetId(i) + numberOfPoints)) addingPolys.append(newPointIDs) doubleSurfacePoints = vtk.vtkPoints() doubleSurfacePolys = vtk.vtkCellArray() doubleSurfacePoints.DeepCopy(polydata.GetPoints()) doubleSurfacePolys.DeepCopy(polydata.GetPolys()) addedPoints = vtk.vtkPoints() for p in addingPoints: doubleSurfacePoints.InsertNextPoint(p) addedPoints.InsertNextPoint(p) for p in addingPolys: doubleSurfacePolys.InsertNextCell(p) doubleSurfacePD = vtk.vtkPolyData() doubleSurfacePD.SetPoints(doubleSurfacePoints) doubleSurfacePD.SetPolys(doubleSurfacePolys) # add faces to boundary edges mergePoints = vtk.vtkMergePoints() mergePoints.InitPointInsertion(doubleSurfacePD.GetPoints(), doubleSurfacePD.GetBounds()) mergePoints.SetDataSet(doubleSurfacePD) mergePoints.BuildLocator() watertightPolys = vtk.vtkCellArray() watertightPolys.DeepCopy(doubleSurfacePD.GetPolys()) watertightPoints = vtk.vtkPoints() watertightPoints.DeepCopy(doubleSurfacePD.GetPoints()) for e in range(featureEdges.GetOutput().GetNumberOfCells()): pointIDs = vtk.vtkIdList() featureEdges.GetOutput().GetCellPoints(e, pointIDs) if pointIDs.GetNumberOfIds() == 2: # -> Edge matchingPointIDs = [] newPointIDs = vtk.vtkIdList() for p in range(2): matchingPointIDs.append(mergePoints.IsInsertedPoint(featureEdges.GetOutput().GetPoint(pointIDs.GetId(p)))) if not (-1) in matchingPointIDs: # edge vertex not found in original pd, should not happen newPointIDs.InsertNextId(matchingPointIDs[1]) newPointIDs.InsertNextId(matchingPointIDs[0]) newPointIDs.InsertNextId(matchingPointIDs[0]+numberOfPoints) newPointIDs.InsertNextId(matchingPointIDs[1]+numberOfPoints) watertightPolys.InsertNextCell(newPointIDs) watertightPD = vtk.vtkPolyData() watertightPD.SetPoints(watertightPoints) watertightPD.SetPolys(watertightPolys) # triangulate new connecting faces triangleFilter = vtk.vtkTriangleFilter() triangleFilter.SetInputData(watertightPD) triangleFilter.Update() # visualize mapper = vtk.vtkPolyDataMapper() mapper.SetInputData(triangleFilter.GetOutput()) actor = vtk.vtkActor() actor.GetProperty().SetEdgeVisibility(1) actor.GetProperty().SetOpacity(0.5) actor.GetProperty().BackfaceCullingOn() #actor.GetProperty().SetRepresentationToWireframe() actor.SetMapper(mapper) camera = vtk.vtkCamera() camera.SetPosition(1,1,1) camera.SetFocalPoint(0,0,0) renderer = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(renderer) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) renderer.AddActor(actor) renderer.SetActiveCamera(camera) renderer.ResetCamera() renderer.SetBackground(1,1,1) renWin.SetSize(300,300) renWin.Render() iren.Start() -- 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%7C7ade740d2ac14ede567708d5b11873d7%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636609640949708331&sdata=vRH7ArAVsdhBuCbV4y0q5Mrwjpy67kt4lP31CcyAt3I%3D&reserved=0 _______________________________________________ Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7C7ade740d2ac14ede567708d5b11873d7%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636609640949708331&sdata=uIJtEXHJ8hM6aVa2LvtwxcLH72mpiIY8o7EIj7sPKUQ%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%7C7ade740d2ac14ede567708d5b11873d7%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636609640949708331&sdata=81ZsUqp2OK267v2r0Fi4ojqZSclsuUCC4Ncx5YIi2SA%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%7C7ade740d2ac14ede567708d5b11873d7%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636609640949708331&sdata=8Lw8%2BW41hXqOpKz2nFdotPXd12n%2BOnjMs4vqH2UulhE%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%7C7ade740d2ac14ede567708d5b11873d7%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636609640949708331&sdata=uGL6MPhkkxNkm%2BIhENhvUihWTzlwlSoGKWLweUe1Jtg%3D&reserved=0 Follow this link to subscribe/unsubscribe: https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk.org%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%7C7ade740d2ac14ede567708d5b11873d7%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636609640949708331&sdata=MZNBfIJS0tZbEVQvawfnAQbhMhrEApMmfgnxWDbOIzY%3D&reserved=0 From litteriomartina at gmail.com Fri May 4 03:53:37 2018 From: litteriomartina at gmail.com (Martina Litterio) Date: Fri, 4 May 2018 09:53:37 +0200 Subject: [vtkusers] Add tooltipl to a vtkChartXY Message-ID: Hello everybody! I have a vtkChartXY like the which one in figure and I would like to add a tooltip when I select a point with the mouse left button. Is it possible? I've tried a little bit, but I failed! Thank you for the help! *Martina* -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2018-05-04 at 09.46.54.png Type: image/png Size: 18705 bytes Desc: not available URL: From iamdpak at gmail.com Fri May 4 04:22:06 2018 From: iamdpak at gmail.com (vinmean) Date: Fri, 4 May 2018 01:22:06 -0700 (MST) Subject: [vtkusers] How to scale up a textured 3D object in vtk? Message-ID: <1525422126404-0.post@n5.nabble.com> I know how to scale an actor. But when I import a textured obj file using vtkOBJImporter filter, I am not sure how to scale up or down. Actually I want to permanently scale up the polydata of the 3D model. Please suggest me how to ensure even the texture is scaled along with the polydata. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From litteriomartina at gmail.com Fri May 4 05:46:25 2018 From: litteriomartina at gmail.com (Martina Litterio) Date: Fri, 4 May 2018 11:46:25 +0200 Subject: [vtkusers] Add tooltipl to a vtkChartXY In-Reply-To: References: Message-ID: Updates: I'm finally able to show a tooltip when I left click on my vtkChartXY. My problem now is that I would like that the tooltip changes its values when I drag the point with the mouse. How can I intercept that event? *Martina* 2018-05-04 9:53 GMT+02:00 Martina Litterio : > Hello everybody! > > I have a vtkChartXY like the which one in figure and I would like to add a > tooltip when I select a point with the mouse left button. Is it possible? > I've tried a little bit, but I failed! > Thank you for the help! > > *Martina* > -------------- next part -------------- An HTML attachment was scrubbed... URL: From grothausmann.roman at mh-hannover.de Fri May 4 06:47:50 2018 From: grothausmann.roman at mh-hannover.de (Grothausmann, Roman Dr.) Date: Fri, 4 May 2018 12:47:50 +0200 Subject: [vtkusers] Remove duplicate triangles in vtkPolyData In-Reply-To: References: Message-ID: <03c020d8-702a-d6b8-b44a-3634177bfad4@mh-hannover.de> Hi Kenichiro, Your filter also helped me. As Luca, I strongly vote for contributing that as a new filter for VTK. It seems You already have an account on gitlab.kitware.com, tough I could not find Your code on GitLab nor GitHub. To contribute via a PR on gitlab.kitware.com You cold just add your code to a clone of the current VTK master and push your additions to create a PR from. Let me know if you need more help on that. It would really be a pity if such a useful implementation would stay outside VTK. Best, Roman On 26/05/17 06:06, kenichiro yoshimi wrote: > Hi, > > I have a filter to remove duplicate polygons which is created with > reference to the filter vtkCleanUnstructuredGridCells in ParaView. I > have attached the sample. I hope this will help you in some way. > > Thanks, > > 2017-05-25 21:47 GMT+09:00 Luca Pallozzi Lavorante : >> Good morning, >> I would like to know if there any VTK (7.0) class to remove duplicate >> triangles in a vtkPolyData. Actually, the duplicate triangles are the output >> of the following pipeline: >> >> vtkUnstructuredGrid -> vtkDataSetSurfaceFilter >> >> My original data is a geological layer which can have zero thickness in >> some portions. When this happens, vtkDataSetSurfaceFilter returns a >> vtkPolyData mesh with duplicated triangles. When I apply vtkPolyDataNormals >> to this mesh, the duplicated triangles do not appear smooth. So I though I >> could use vtkCleanPolyData, but it did not work. >> >> Thanks in advance for any help. >> >> Luca Pallozzi Lavorante >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://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 -- 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 From patrick.laurin at caboma.com Fri May 4 09:31:51 2018 From: patrick.laurin at caboma.com (Patrick Laurin) Date: Fri, 4 May 2018 13:31:51 +0000 Subject: [vtkusers] vtkPointVolumeInterpolator does not adjust bounds after PolyData input update In-Reply-To: References: Message-ID: Hi, Just to be more precise, what I meant by vtkPointVolumeInterpolator is actually a vtkPointInterpolator using a bounded volume image source. Thank you, Patrick Laurin From: Patrick Laurin Sent: May 3, 2018 6:09 PM To: 'vtkusers at vtk.org' Subject: vtkPointVolumeInterpolator does not adjust bounds after PolyData input update Hi, I'm having a bit of trouble using the vtkPointVolumeInterpolator with default parameters, using a Voronoi Kernel and a bounded volume as a source. Calling a new vtkPointInterpolator object with any vtkPolyData as input works just fine, but as soon as I switch the input to a different PolyData, the RequestData method gets processed but the box doesn't adjust in consequence. The input variable received by RequestData does not seem to be the updated one. Any thoughts? Many thanks, Patrick Laurin -------------- next part -------------- An HTML attachment was scrubbed... URL: From noeckera at gmail.com Fri May 4 09:34:59 2018 From: noeckera at gmail.com (Angela Noecker) Date: Fri, 4 May 2018 09:34:59 -0400 Subject: [vtkusers] vtkPoint In-Reply-To: References: <22F26B9D-D860-4FAE-8C40-59E57D2EDE1D@gmail.com> Message-ID: What do you want your points to look like? I assign a small sphere to the glyph. On Thu, May 3, 2018 at 6:00 PM, Sam Raby wrote: > > Thanks for the feedback. Here is the problem statement: I want to > visualize points but I want the points to become larger/smaller as I zoom > in/out. I could add glyph to each point, but glyph also wants me to assign > a source to it, and I end up assigning for example a small Cubes, but I > need to visualize a point not a cube. Is there a way to enable a point so > that zoom in and out can change the size of point? or any alternative > approach? > > Thanks > Sam > > On Sun, Apr 22, 2018 at 3:34 PM, Angela Noecker > wrote: > >> I add a glyph. >> >> > On Apr 22, 2018, at 3:01 PM, Sam Raby wrote: >> > >> > Hi >> > When we use vtkPoint or vtkPointSource, as we zoom in and out, the size >> of points does not change. Is there a way to enable this so that zoom in >> and out can change the size of point? >> > Thanks >> > S >> > _______________________________________________ >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at >> http://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: >> > https://vtk.org/mailman/listinfo/vtkusers >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From malte.springer at t-online.de Fri May 4 10:36:30 2018 From: malte.springer at t-online.de (Schmeckis) Date: Fri, 4 May 2018 07:36:30 -0700 (MST) Subject: [vtkusers] limit the direction for triangulation in Delaunay Message-ID: <1525444590990-0.post@n5.nabble.com> Hey, i'm using Delaunay3D with alpha shades and the vtkDataSetSurfaceFilter() to mesh segments of airfoil profiles. I want to remove the part of the mesh in the x and y plane to open up the surface mesh. I could delete the part in the stl file from the mesh, but i'm looking for a more elegant way to directly do it in Delaunay3D. Is there a an attribute in the Delaunay3D class to prohibit triangulation in a certain direction? or are there other vtk filters to solve this problem? Kind regards -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From jayavardhanravi at outlook.com Fri May 4 10:54:43 2018 From: jayavardhanravi at outlook.com (Jay) Date: Fri, 4 May 2018 07:54:43 -0700 (MST) Subject: [vtkusers] Making VTK renderwindow background transparent Message-ID: <1525445683540-0.post@n5.nabble.com> Is it possible to make the vtk render window with one render layer to be transparent ? If I try to add more layer I can make the other layers transparent except the first layer or the base layer. When I try to render then I get a black background which I want to make it transparent and render only actors. The sample code that I tried is Sample.txt -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From rabysam28 at gmail.com Fri May 4 11:06:57 2018 From: rabysam28 at gmail.com (Sam Raby) Date: Fri, 4 May 2018 08:06:57 -0700 Subject: [vtkusers] vtkPoint In-Reply-To: References: <22F26B9D-D860-4FAE-8C40-59E57D2EDE1D@gmail.com> Message-ID: I have used small spheres and small cubes, but the issue is that they are heavy if I use thousands of them - that is why I am trying to use a simple point which is much lighter. On Fri, May 4, 2018 at 6:34 AM, Angela Noecker wrote: > What do you want your points to look like? I assign a small sphere to the > glyph. > > On Thu, May 3, 2018 at 6:00 PM, Sam Raby wrote: > >> >> Thanks for the feedback. Here is the problem statement: I want to >> visualize points but I want the points to become larger/smaller as I zoom >> in/out. I could add glyph to each point, but glyph also wants me to assign >> a source to it, and I end up assigning for example a small Cubes, but I >> need to visualize a point not a cube. Is there a way to enable a point >> so that zoom in and out can change the size of point? or any alternative >> approach? >> >> Thanks >> Sam >> >> On Sun, Apr 22, 2018 at 3:34 PM, Angela Noecker >> wrote: >> >>> I add a glyph. >>> >>> > On Apr 22, 2018, at 3:01 PM, Sam Raby wrote: >>> > >>> > Hi >>> > When we use vtkPoint or vtkPointSource, as we zoom in and out, the >>> size of points does not change. Is there a way to enable this so that zoom >>> in and out can change the size of point? >>> > Thanks >>> > S >>> > _______________________________________________ >>> > Powered by www.kitware.com >>> > >>> > Visit other Kitware open-source projects at >>> http://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: >>> > https://vtk.org/mailman/listinfo/vtkusers >>> >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From litteriomartina at gmail.com Fri May 4 11:38:15 2018 From: litteriomartina at gmail.com (Martina Litterio) Date: Fri, 4 May 2018 17:38:15 +0200 Subject: [vtkusers] Add tooltipl to a vtkChartXY In-Reply-To: References: Message-ID: I have a class that extend vtkChartXY and I've tried to override its MouseMoveEvent(). I've added the following line if(mouse.GetButton()== vtkContextMouseEvent::LEFT_BUTTON) to intercept the start of the dragging event, but it returns false. The only condition that returns true put in that function is this one if(mouse.GetButton()== vtkContextMouseEvent::NO_BUTTON) I know something is missing but I can't understand what ? *Martina* 2018-05-04 14:05 GMT+02:00 Paul Douglas Hahn : > You can override the MouseMoveEvent() method in your subclass of > vtkChartXY. > > > On 05/04/2018 04:46 AM, Martina Litterio wrote: > > Updates: I'm finally able to show a tooltip when I left click on my > vtkChartXY. > My problem now is that I would like that the tooltip changes its values > when I drag the point with the mouse. > How can I intercept that event? > > *Martina* > > 2018-05-04 9:53 GMT+02:00 Martina Litterio : > >> Hello everybody! >> >> I have a vtkChartXY like the which one in figure and I would like to add >> a tooltip when I select a point with the mouse left button. Is it possible? >> I've tried a little bit, but I failed! >> Thank you for the help! >> >> *Martina* >> > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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:https://vtk.org/mailman/listinfo/vtkusers > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rabysam28 at gmail.com Fri May 4 11:55:40 2018 From: rabysam28 at gmail.com (Sam Raby) Date: Fri, 4 May 2018 08:55:40 -0700 Subject: [vtkusers] QVTKOpenGLWidget and QWidgets Message-ID: I am running the following example of using QVTKOpenGLWidget to display a sphere. https://www.vtk.org/Wiki/VTK/Examples/Cxx/Qt/SideBySideRenderWindowsQt It works fine. Then I added one QT Checkbox. but the checkbox is not checkable. After debugging I realized that when I remove the following line of code, the checkbox starts working but QVTKOpenGLWidget does not display the sphere anymore. Is that something that I am missing here. QSlicer and other qwidgets also do not work if I keep the following like of code: QSurfaceFormat::setDefaultFormat(QVTKOpenGLWidget::defaultFormat()); Thanks S -------------- next part -------------- An HTML attachment was scrubbed... URL: From pdhahn at compintensehpc.com Fri May 4 12:34:17 2018 From: pdhahn at compintensehpc.com (Paul Douglas Hahn) Date: Fri, 4 May 2018 11:34:17 -0500 Subject: [vtkusers] Add tooltipl to a vtkChartXY In-Reply-To: References: Message-ID: <27c03834-a2ac-90d1-2556-45600db8d91e@compintensehpc.com> Maybe check "mouse.GetButton() == this->Actions.Pan()"? On 05/04/2018 10:38 AM, Martina Litterio wrote: > I have a class that extend vtkChartXY and I've tried to override > its?MouseMoveEvent(). I've added the following line > > if(mouse.GetButton()== vtkContextMouseEvent::LEFT_BUTTON) > > to intercept the start of the dragging event, but it returns false. > > The only condition that returns true put in that function is this one > > if(mouse.GetButton()== vtkContextMouseEvent::NO_BUTTON) > > > I know something is missing but I can't understand what?? > > /Martina/ > > 2018-05-04 14:05 GMT+02:00 Paul Douglas Hahn >: > > You can override the MouseMoveEvent() method in your subclass of > vtkChartXY. > > > On 05/04/2018 04:46 AM, Martina Litterio wrote: >> Updates: I'm finally able to show a tooltip when I left click on >> my vtkChartXY. >> My problem now is that I would like that the tooltip changes its >> values when I drag the point with the mouse. >> How can I intercept that event? >> >> /Martina/ >> >> 2018-05-04 9:53 GMT+02:00 Martina Litterio >> >: >> >> Hello everybody! >> >> I have a vtkChartXY like the which one in figure and I would >> like to add a tooltip when I select a point with the mouse >> left button. Is it possible? I've tried a little bit, but I >> failed! >> Thank you for the help! >> >> /Martina/ >> >> >> >> >> _______________________________________________ >> Powered bywww.kitware.com >> >> Visit other Kitware open-source projects athttp://www.kitware.com/opensource/opensource.html >> >> >> Please keep messages on-topic and check the VTK FAQ at:http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at:http://markmail.org/search/?q=vtkusers >> >> >> Follow this link to subscribe/unsubscribe: >> https://vtk.org/mailman/listinfo/vtkusers >> > > -- Paul D. Hahn CompIntense HPC, LLC -------------- next part -------------- An HTML attachment was scrubbed... URL: From aron.helser at kitware.com Fri May 4 13:16:46 2018 From: aron.helser at kitware.com (Aron Helser) Date: Fri, 4 May 2018 13:16:46 -0400 Subject: [vtkusers] vtkPoint In-Reply-To: References: <22F26B9D-D860-4FAE-8C40-59E57D2EDE1D@gmail.com> Message-ID: That's exactly what the Glyph filter is for - it uses a single instance of the geometry, drawn at different points in space. Modern graphics cards can make that much faster than drawing separate geometry. -Aron On Fri, May 4, 2018 at 11:06 AM, Sam Raby wrote: > I have used small spheres and small cubes, but the issue is that they are > heavy if I use thousands of them - that is why I am trying to use a simple > point which is much lighter. > > On Fri, May 4, 2018 at 6:34 AM, Angela Noecker wrote: > >> What do you want your points to look like? I assign a small sphere to >> the glyph. >> >> On Thu, May 3, 2018 at 6:00 PM, Sam Raby wrote: >> >>> >>> Thanks for the feedback. Here is the problem statement: I want to >>> visualize points but I want the points to become larger/smaller as I zoom >>> in/out. I could add glyph to each point, but glyph also wants me to assign >>> a source to it, and I end up assigning for example a small Cubes, but I >>> need to visualize a point not a cube. Is there a way to enable a point >>> so that zoom in and out can change the size of point? or any alternative >>> approach? >>> >>> Thanks >>> Sam >>> >>> On Sun, Apr 22, 2018 at 3:34 PM, Angela Noecker >>> wrote: >>> >>>> I add a glyph. >>>> >>>> > On Apr 22, 2018, at 3:01 PM, Sam Raby wrote: >>>> > >>>> > Hi >>>> > When we use vtkPoint or vtkPointSource, as we zoom in and out, the >>>> size of points does not change. Is there a way to enable this so that zoom >>>> in and out can change the size of point? >>>> > Thanks >>>> > S >>>> > _______________________________________________ >>>> > Powered by www.kitware.com >>>> > >>>> > Visit other Kitware open-source projects at >>>> http://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: >>>> > https://vtk.org/mailman/listinfo/vtkusers >>>> >>> >>> >>> >> > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://vtk.org/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rabysam28 at gmail.com Fri May 4 17:01:29 2018 From: rabysam28 at gmail.com (Sam Raby) Date: Fri, 4 May 2018 14:01:29 -0700 Subject: [vtkusers] QVTKOpenGLWidget and QWidgets In-Reply-To: References: Message-ID: Let me rephrase the issue that I am observing. I run the following vtk example that uses QVTKOpenGLWidget in Qt Creator. I can successfully run the example. Then I added one simple QCheckBox to UI. I can compile the code but the checkbox does not respond to mouse clicking, meaning that If I click on the checkbox it does not get checked, but if I interact with the QVTKOpenGLWidget it causes the checkbox to be updated. Is that a bug? because what I am doing seems pretty basic. https://www.vtk.org/Wiki/VTK/Examples/Cxx/Qt/SideBySideRenderWindowsQt Thanks On Friday, May 4, 2018, Sam Raby wrote: > > > I am running the following example of using QVTKOpenGLWidget to display a > sphere. > > https://www.vtk.org/Wiki/VTK/Examples/Cxx/Qt/SideBySideRenderWindowsQt > > It works fine. Then I added one QT Checkbox. but the checkbox is not > checkable. After debugging I realized that when I remove the following line > of code, the checkbox starts working but QVTKOpenGLWidget does not > display the sphere anymore. Is that something that I am missing here. > QSlicer and other qwidgets also do not work if I keep the following like of > code: > > QSurfaceFormat::setDefaultFormat(QVTKOpenGLWidget::defaultFormat()); > > > Thanks > > S > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rabysam28 at gmail.com Fri May 4 17:02:06 2018 From: rabysam28 at gmail.com (Sam Raby) Date: Fri, 4 May 2018 14:02:06 -0700 Subject: [vtkusers] vtkPoint In-Reply-To: References: <22F26B9D-D860-4FAE-8C40-59E57D2EDE1D@gmail.com> Message-ID: Thanks Aron. It is good to know! On Fri, May 4, 2018 at 10:16 AM, Aron Helser wrote: > That's exactly what the Glyph filter is for - it uses a single instance of > the geometry, drawn at different points in space. Modern graphics cards can > make that much faster than drawing separate geometry. > -Aron > > On Fri, May 4, 2018 at 11:06 AM, Sam Raby wrote: > >> I have used small spheres and small cubes, but the issue is that they are >> heavy if I use thousands of them - that is why I am trying to use a simple >> point which is much lighter. >> >> On Fri, May 4, 2018 at 6:34 AM, Angela Noecker >> wrote: >> >>> What do you want your points to look like? I assign a small sphere to >>> the glyph. >>> >>> On Thu, May 3, 2018 at 6:00 PM, Sam Raby wrote: >>> >>>> >>>> Thanks for the feedback. Here is the problem statement: I want to >>>> visualize points but I want the points to become larger/smaller as I zoom >>>> in/out. I could add glyph to each point, but glyph also wants me to assign >>>> a source to it, and I end up assigning for example a small Cubes, but I >>>> need to visualize a point not a cube. Is there a way to enable a point >>>> so that zoom in and out can change the size of point? or any alternative >>>> approach? >>>> >>>> Thanks >>>> Sam >>>> >>>> On Sun, Apr 22, 2018 at 3:34 PM, Angela Noecker >>>> wrote: >>>> >>>>> I add a glyph. >>>>> >>>>> > On Apr 22, 2018, at 3:01 PM, Sam Raby wrote: >>>>> > >>>>> > Hi >>>>> > When we use vtkPoint or vtkPointSource, as we zoom in and out, the >>>>> size of points does not change. Is there a way to enable this so that zoom >>>>> in and out can change the size of point? >>>>> > Thanks >>>>> > S >>>>> > _______________________________________________ >>>>> > Powered by www.kitware.com >>>>> > >>>>> > Visit other Kitware open-source projects at >>>>> http://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: >>>>> > https://vtk.org/mailman/listinfo/vtkusers >>>>> >>>> >>>> >>>> >>> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> https://vtk.org/mailman/listinfo/vtkusers >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rccm.kyoshimi at gmail.com Sat May 5 03:49:53 2018 From: rccm.kyoshimi at gmail.com (kenichiro yoshimi) Date: Sat, 5 May 2018 16:49:53 +0900 Subject: [vtkusers] Visualizing a surface In-Reply-To: <1524729067596-0.post@n5.nabble.com> References: <1524570513469-0.post@n5.nabble.com> <1524729067596-0.post@n5.nabble.com> Message-ID: Hello, I am also very worried about extracting surface from points. In your case, I managed to get some good result using vtkPointInterpolator as the attached. Here, the attached input "test3.particles" is in advance made to deduce the size by vtkMaskPoints and convert to vtk particle format from your xyz file for convenience. And run is below: $ ./ParticlesToSurface test3.particles 101 0.02 Followed by the surface decimation filter. Unfortunately this way is very depending on the specified parameters. Hence there might be some better way and if you find better solutions, please post. Best Regards 2018-04-26 16:51 GMT+09:00 pauldoesntlikesurfaceextractio : > I have a further problem related to surface extraction, > > when I use the vtkextractsurface algorithm it places large half spheres > where a couple of > particles are clustered together. > > See picture. > > How do I reduce the size of those spheres? ->SetRadius is related to the > seen/unseen voxels > > kind regards > > > > -- > 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: > https://vtk.org/mailman/listinfo/vtkusers -------------- next part -------------- A non-text attachment was scrubbed... Name: particlesToSurface.zip Type: application/x-zip-compressed Size: 502255 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: test3.png Type: image/png Size: 101296 bytes Desc: not available URL: From pdhahn at compintensehpc.com Sat May 5 10:32:59 2018 From: pdhahn at compintensehpc.com (Paul Douglas Hahn) Date: Sat, 5 May 2018 09:32:59 -0500 Subject: [vtkusers] QVTKOpenGLWidget and QWidgets In-Reply-To: References: Message-ID: <9dc01a89-6c5c-a4c2-26e0-73424be31f7e@compintensehpc.com> Sounds like a problem with event processing based on widget focus. Sorry for this generality which is probably not too helpful. But speaking just a tad bit sarcastically, I think eventually the answer you **might** get on this forum from a knowledgeable VTK person (that's not me, sorry) will be "look at ParaView to see how things are done with Qt there". So you might try that IMHO.? :-) As for me, I am researching alternatives to Qt with VTK. I will be trying IMGUI because it is "immediate mode" and hopefully will avoid issues like this. The downside is that IMGUI widgets stink in terms of appearance. Over all, Qt is by far the most polished and mature UI toolkit out there in my experience (speaking as a self-rated Qt expert, at least Qt4). But speaking a tad bit sarcastically again, I think using VTK with any UI toolkit seems to have its fair share of challenges and mysteries. I have posed a number of questions about alternatives to Qt in this forum and have had no useful response. On 05/04/2018 04:01 PM, Sam Raby wrote: > Let me rephrase the issue that I am observing. I run the following vtk > example that uses?QVTKOpenGLWidget in Qt Creator. I can successfully > run the example. Then I added one simple QCheckBox to UI. I can > compile the code but the checkbox does not respond to mouse clicking, > meaning that If I click on the checkbox it does not get checked, but > if I interact with the QVTKOpenGLWidget it causes the checkbox to be > updated. Is that a bug? because what I am doing seems pretty basic. > > https://www.vtk.org/Wiki/VTK/Examples/Cxx/Qt/SideBySideRenderWindowsQt > > > Thanks > > > On Friday, May 4, 2018, Sam Raby > wrote: > > > > I am running the following example of using QVTKOpenGLWidget to > display a sphere. > > https://www.vtk.org/Wiki/VTK/Examples/Cxx/Qt/SideBySideRenderWindowsQt > > > It works fine. Then I added one QT Checkbox. but the checkbox is > not checkable. After debugging I realized that when I remove the > following line of code, the checkbox starts working but > QVTKOpenGLWidgetdoes not display the sphere anymore. Is that > something that I am missing here. QSlicer and other qwidgets also > do not work if I keep the following like of code: > > QSurfaceFormat::setDefaultFormat(QVTKOpenGLWidget::defaultFormat()); > > Thanks > > S > > > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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: > https://vtk.org/mailman/listinfo/vtkusers -- Paul D. Hahn CompIntense HPC, LLC -------------- next part -------------- An HTML attachment was scrubbed... URL: From nztoddler at yahoo.com Sat May 5 20:20:43 2018 From: nztoddler at yahoo.com (Todd) Date: Sun, 06 May 2018 12:20:43 +1200 Subject: [vtkusers] QVTKOpenGLWidget and QWidgets In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: From paul_geus at hotmail.com Sun May 6 05:20:09 2018 From: paul_geus at hotmail.com (virtual tea kit) Date: Sun, 6 May 2018 02:20:09 -0700 (MST) Subject: [vtkusers] Visualizing a surface In-Reply-To: References: <1524570513469-0.post@n5.nabble.com> <1524729067596-0.post@n5.nabble.com> Message-ID: <1525598409472-0.post@n5.nabble.com> That is a very impressive result. Thank you! I have made the same experience regarding the parameters. For each data set the parameters are different. But here is what I did, which works okay until now: I largely follow the this tutorial: https://lorensen.github.io/VTKExamples/site/Cxx/Points/ExtractSurface/ However, for the radius in the distance and vtkextractsurface functions I set a much smaller value, than the one given in the example. There, the radius is dependend on the bounds. This led to bad results in my case. I then pass the signeddistancefunction to the extractsurface function and try creating a surface. Sometimes, if the parameters are wrong no surface-volume is created. Or a surface-volume with a lot of holes is created. That is why I put the whole thing into a loop. At the end of the loop, i check the number of cells created by the vtkextractsurface. If that is smaller than 1.5*number of points in polydata then I restart the loop and increase the parameters. This has led to a fairly robust function that keeps creating surfaces. vtketxractsurface.PNG I hope this helped. Kind regards :) -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From rabysam28 at gmail.com Sun May 6 10:15:59 2018 From: rabysam28 at gmail.com (Sam Raby) Date: Sun, 6 May 2018 07:15:59 -0700 Subject: [vtkusers] QVTKOpenGLWidget and QWidgets In-Reply-To: References: Message-ID: *The solution I found was to disable multisampling on the QSurfaceFormat before setting the default surface format, meaning to replace the following:* QSurfaceFormat::setDefaultFormat(QVTKOpenGLWidget::defaultFormat()); *with the following:* QSurfaceFormat fmt = QVTKOpenGLWidget::defaultFormat(); fmt.setSamples(0); QSurfaceFormat::setDefaultFormat(fmt); *This was a solution to another problem that I found on this link:* http://vtk.1045678.n5.nabble.com/Issues-using-QVTKOpenGLWidget-td5745401.html *Would anyone explain why this fixes the issue and if there is any consequence to this?* *Thanks* On Sat, May 5, 2018 at 5:20 PM, Todd wrote: > Is the checkbox widget placed within the render window boundary? > > It sounds like the vtk render window is capturing the mouse events. I'm > not familiar with Qt but it seems that the solution would be to grab the > mouse event position in your vtk render widow event handler and reroute the > event to the widget that bounds that location. > > On 5 May 2018 9:01 a.m., Sam Raby wrote: > > Let me rephrase the issue that I am observing. I run the following vtk > example that uses QVTKOpenGLWidget in Qt Creator. I can successfully run > the example. Then I added one simple QCheckBox to UI. I can compile the > code but the checkbox does not respond to mouse clicking, meaning that If I > click on the checkbox it does not get checked, but if I interact with the QVTKOpenGLWidget > it causes the checkbox to be updated. Is that a bug? because what I am > doing seems pretty basic. > > https://www.vtk.org/Wiki/VTK/Examples/Cxx/Qt/SideBySideRenderWindowsQt > > Thanks > > > On Friday, May 4, 2018, Sam Raby wrote: > > > > I am running the following example of using QVTKOpenGLWidget to display a > sphere. > > https://www.vtk.org/Wiki/VTK/Examples/Cxx/Qt/SideBySideRenderWindowsQt > > It works fine. Then I added one QT Checkbox. but the checkbox is not > checkable. After debugging I realized that when I remove the following line > of code, the checkbox starts working but QVTKOpenGLWidget does not > display the sphere anymore. Is that something that I am missing here. > QSlicer and other qwidgets also do not work if I keep the following like of > code: > > QSurfaceFormat::setDefaultFormat(QVTKOpenGLWidget::defaultFormat()); > > > Thanks > > S > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aborsic at ne-scientific.com Sun May 6 16:39:01 2018 From: aborsic at ne-scientific.com (Andrea Borsic) Date: Sun, 6 May 2018 22:39:01 +0200 Subject: [vtkusers] Medical image display - color of image pixels outside an image volume sliced with vtkImageResliceMapper In-Reply-To: References: <67c2093e-0e3a-24f6-9ffd-4535215ae49e@ne-scientific.com> Message-ID: Dear VTK users list: I am reporting that the issue can be fixed by calling SeparateWindowLevelOperationOff() on the mapper. This solution was learned from an off-line conversation with David Gobbi. The conversation was off-line as I could not provide publicly sharable code, due to privacy considerations related to medical data-sets. Best Regards, Andrea On 5/3/2018 11:54 PM, David Gobbi wrote: > Hi Andrea, > > I've tried reproducing your problem with CTs on my own system, but so > far I haven't seen the grey border. > > Can you show me all of the settings that you use with > vtkImageResliceMapper and also all the settings for the vtkImageProperty? > > Also, can you tell me what version of VTK you are using? And whether > you're using the OpenGL backend or the OpenGL2 backend? > > And what your are using to read the DICOM images into your program > (ITK, vtkDICOMImageReader, vtk-dicom, GDCM, etc)? > > ?- David > > > > On Thu, May 3, 2018 at 3:14 PM, Andrea Borsic > > wrote: > > Hi, > > I have a question about the use of the vtkImageReslice mapper. > > In setting up a VTK pipeline for displaying CT image slices we > used previously a vtkImageReslice followed by a > vtkImageMapToColors. We have recently switched to using a > vtkImageResliceMapper instead of the two previous classes, but we > are experiencing an issue. > > When using vtkImageReslice the method SetBackgroundLevel() was > called with a value of -1000 which mapped pixels falling outside > the sampled CT volume to a black pixel on screen, given the LUT in > use. > > In vtkImageResliceMapper the conversion from CT scalar values to > screen colors is performed internally and we have tried playing > with BackgroundOn() and with SetBackingColor of a vtkImagePorperty > is passed to the vtkImageResliceMapper, but we are not able to get > rid of a thin gray border that at times shows around the image as > shown in the screenshot below .... > > > > Additionally, when the slicing plane is set at the very beginning > of the volume or at the very end, the output is a slice which is > completely gray. > > I suspect that pixel values for sampling locations that fall > outside of the CT image volume are set to a default value which > results in the gray pixels. > > Can anyone please advise on how to control such value - so that > gray borders could be eliminated? > > Thanks in advance for any suggestion, > > Best Regards, > > Andrea > > -- ++++++++++++++++++++++++++++++++++++++ Andrea Borsic Ph.D. Founder & CEO - NE Scientific LLC web: http://www.ne-scientific.com/ twitter: https://twitter.com/NE_Scientific phone: +1 603 676 7450 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: dikmnalkeelkenoa.png Type: image/png Size: 377747 bytes Desc: not available URL: From david.gobbi at gmail.com Sun May 6 22:20:39 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Sun, 6 May 2018 20:20:39 -0600 Subject: [vtkusers] Medical image display - color of image pixels outside an image volume sliced with vtkImageResliceMapper In-Reply-To: References: <67c2093e-0e3a-24f6-9ffd-4535215ae49e@ne-scientific.com> Message-ID: Hi Andrea, It isn't really a proper fix, it's a work around for what is probably a bug in VTK. I'm still hoping to be able to fix the bug. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From ruvva at yahoo.com Mon May 7 02:02:55 2018 From: ruvva at yahoo.com (Koteswara Rao Ruvva) Date: Mon, 7 May 2018 06:02:55 +0000 (UTC) Subject: [vtkusers] Rotation about a line References: <218619704.554949.1525672975583.ref@mail.yahoo.com> Message-ID: <218619704.554949.1525672975583@mail.yahoo.com> Hello, I have the following routine to rotate an assembly about a line passing through two points pt1 and pt2. It works good for the rotation about the first line. But when I rotate about another line it produce unexpected results. Looks like I am missing something here. ? ? def RotateAboutAxis(assembly, pt1, pt2, degrees): ? ? ? ? vec = vtk.vtkVector3d(pt1[0]-pt2[0], pt1[1]-pt2[1], pt1[2]-pt2[2]) ????????transform = assembly.GetUserTransform() ? ? ? ? transform.Translate(pt1[0], pt1[1], pt1[2])? ? ? ? transform.RotateWXYZ(degrees, vec[0], vec[1], vec[2])? ? ? ? transform.Translate(-pt1[0], -pt1[1], -pt1[2]) ThanksRao -------------- next part -------------- An HTML attachment was scrubbed... URL: From rccm.kyoshimi at gmail.com Mon May 7 05:59:13 2018 From: rccm.kyoshimi at gmail.com (kenichiro yoshimi) Date: Mon, 7 May 2018 18:59:13 +0900 Subject: [vtkusers] Remove duplicate triangles in vtkPolyData In-Reply-To: <03c020d8-702a-d6b8-b44a-3634177bfad4@mh-hannover.de> References: <03c020d8-702a-d6b8-b44a-3634177bfad4@mh-hannover.de> Message-ID: Hi Roman, Thank you for your suggestion. I created a Merge Request, though the improvement of the code quality might be still not enough. https://gitlab.kitware.com/vtk/vtk/merge_requests/4265 Best, yoshimi 2018-05-04 19:47 GMT+09:00 Grothausmann, Roman Dr. : > Hi Kenichiro, > > > Your filter also helped me. As Luca, I strongly vote for contributing that > as a new filter for VTK. It seems You already have an account on > gitlab.kitware.com, tough I could not find Your code on GitLab nor GitHub. > To contribute via a PR on gitlab.kitware.com You cold just add your code to > a clone of the current VTK master and push your additions to create a PR > from. Let me know if you need more help on that. It would really be a pity > if such a useful implementation would stay outside VTK. > > Best, > Roman > > > > On 26/05/17 06:06, kenichiro yoshimi wrote: >> >> Hi, >> >> I have a filter to remove duplicate polygons which is created with >> reference to the filter vtkCleanUnstructuredGridCells in ParaView. I >> have attached the sample. I hope this will help you in some way. >> >> Thanks, >> >> 2017-05-25 21:47 GMT+09:00 Luca Pallozzi Lavorante >> : >>> >>> Good morning, >>> I would like to know if there any VTK (7.0) class to remove duplicate >>> triangles in a vtkPolyData. Actually, the duplicate triangles are the >>> output >>> of the following pipeline: >>> >>> vtkUnstructuredGrid -> vtkDataSetSurfaceFilter >>> >>> My original data is a geological layer which can have zero thickness in >>> some portions. When this happens, vtkDataSetSurfaceFilter returns a >>> vtkPolyData mesh with duplicated triangles. When I apply >>> vtkPolyDataNormals >>> to this mesh, the duplicated triangles do not appear smooth. So I though >>> I >>> could use vtkCleanPolyData, but it did not work. >>> >>> Thanks in advance for any help. >>> >>> Luca Pallozzi Lavorante >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://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 > > > -- > 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 From shawn.waldon at kitware.com Mon May 7 09:21:50 2018 From: shawn.waldon at kitware.com (Shawn Waldon) Date: Mon, 7 May 2018 09:21:50 -0400 Subject: [vtkusers] QVTKOpenGLWidget and QWidgets In-Reply-To: References: Message-ID: Hi Sam, I know there are still some issues with the QVTKOpenGLWidget, but I've never heard of this one before. There is ongoing work [1] to improve the QVTKOpenGLWidget. You might try building with that branch and see if it improves things. Shawn [1]: https://gitlab.kitware.com/vtk/vtk/merge_requests/3745 On Sun, May 6, 2018 at 10:15 AM, Sam Raby wrote: > *The solution I found was to disable multisampling on the QSurfaceFormat > before setting the default surface format, meaning to replace the > following:* > > QSurfaceFormat::setDefaultFormat(QVTKOpenGLWidget::defaultFormat()); > > *with the following:* > > QSurfaceFormat fmt = QVTKOpenGLWidget::defaultFormat(); > fmt.setSamples(0); > QSurfaceFormat::setDefaultFormat(fmt); > > *This was a solution to another problem that I found on this link:* > http://vtk.1045678.n5.nabble.com/Issues-using-QVTKOpenGLWidget-td5745401. > html > > *Would anyone explain why this fixes the issue and if there is any > consequence to this?* > > *Thanks* > > > > > On Sat, May 5, 2018 at 5:20 PM, Todd wrote: > >> Is the checkbox widget placed within the render window boundary? >> >> It sounds like the vtk render window is capturing the mouse events. I'm >> not familiar with Qt but it seems that the solution would be to grab the >> mouse event position in your vtk render widow event handler and reroute the >> event to the widget that bounds that location. >> >> On 5 May 2018 9:01 a.m., Sam Raby wrote: >> >> Let me rephrase the issue that I am observing. I run the following vtk >> example that uses QVTKOpenGLWidget in Qt Creator. I can successfully run >> the example. Then I added one simple QCheckBox to UI. I can compile the >> code but the checkbox does not respond to mouse clicking, meaning that If I >> click on the checkbox it does not get checked, but if I interact with the QVTKOpenGLWidget >> it causes the checkbox to be updated. Is that a bug? because what I am >> doing seems pretty basic. >> >> https://www.vtk.org/Wiki/VTK/Examples/Cxx/Qt/SideBySideRenderWindowsQt >> >> Thanks >> >> >> On Friday, May 4, 2018, Sam Raby wrote: >> >> >> >> I am running the following example of using QVTKOpenGLWidget to display >> a sphere. >> >> https://www.vtk.org/Wiki/VTK/Examples/Cxx/Qt/SideBySideRenderWindowsQt >> >> It works fine. Then I added one QT Checkbox. but the checkbox is not >> checkable. After debugging I realized that when I remove the following line >> of code, the checkbox starts working but QVTKOpenGLWidget does not >> display the sphere anymore. Is that something that I am missing here. >> QSlicer and other qwidgets also do not work if I keep the following like of >> code: >> >> QSurfaceFormat::setDefaultFormat(QVTKOpenGLWidget::defaultFormat()); >> >> >> Thanks >> >> S >> >> >> >> >> >> >> > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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: > https://vtk.org/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Mon May 7 12:09:39 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Mon, 07 May 2018 16:09:39 +0000 Subject: [vtkusers] QVTKOpenGLWidget and QWidgets In-Reply-To: References: Message-ID: I think what you will lose is MSAA (Multi-sampling anti aliasing). FXAA is another approach to AA if you need that. (I also run with samples hard-set to 0, because I think I had problems with volume rendering on some graphics cards (volume would not show up), or perhaps it was a problem with mixing volumes and polys, I can't remember. In any case I should revisit whether it's still necessary.) Elvis Den s?n 6 maj 2018 16:16Sam Raby skrev: > *The solution I found was to disable multisampling on the QSurfaceFormat > before setting the default surface format, meaning to replace the > following:* > > QSurfaceFormat::setDefaultFormat(QVTKOpenGLWidget::defaultFormat()); > > *with the following:* > > QSurfaceFormat fmt = QVTKOpenGLWidget::defaultFormat(); > fmt.setSamples(0); > QSurfaceFormat::setDefaultFormat(fmt); > > *This was a solution to another problem that I found on this link:* > http://vtk.1045678.n5.nabble.com/Issues-using-QVTKOpenGLWidget-td5745401.html > > *Would anyone explain why this fixes the issue and if there is any > consequence to this?* > > *Thanks* > > > > > On Sat, May 5, 2018 at 5:20 PM, Todd wrote: > >> Is the checkbox widget placed within the render window boundary? >> >> It sounds like the vtk render window is capturing the mouse events. I'm >> not familiar with Qt but it seems that the solution would be to grab the >> mouse event position in your vtk render widow event handler and reroute the >> event to the widget that bounds that location. >> >> On 5 May 2018 9:01 a.m., Sam Raby wrote: >> >> Let me rephrase the issue that I am observing. I run the following vtk >> example that uses QVTKOpenGLWidget in Qt Creator. I can successfully run >> the example. Then I added one simple QCheckBox to UI. I can compile the >> code but the checkbox does not respond to mouse clicking, meaning that If I >> click on the checkbox it does not get checked, but if I interact with the QVTKOpenGLWidget >> it causes the checkbox to be updated. Is that a bug? because what I am >> doing seems pretty basic. >> >> https://www.vtk.org/Wiki/VTK/Examples/Cxx/Qt/SideBySideRenderWindowsQt >> >> Thanks >> >> >> On Friday, May 4, 2018, Sam Raby wrote: >> >> >> >> I am running the following example of using QVTKOpenGLWidget to display >> a sphere. >> >> https://www.vtk.org/Wiki/VTK/Examples/Cxx/Qt/SideBySideRenderWindowsQt >> >> It works fine. Then I added one QT Checkbox. but the checkbox is not >> checkable. After debugging I realized that when I remove the following line >> of code, the checkbox starts working but QVTKOpenGLWidget does not >> display the sphere anymore. Is that something that I am missing here. >> QSlicer and other qwidgets also do not work if I keep the following like of >> code: >> >> QSurfaceFormat::setDefaultFormat(QVTKOpenGLWidget::defaultFormat()); >> >> >> Thanks >> >> S >> >> >> >> >> >> >> > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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: > https://vtk.org/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From minpu.code at gmail.com Mon May 7 19:52:19 2018 From: minpu.code at gmail.com (pnt1614) Date: Mon, 7 May 2018 16:52:19 -0700 (MST) Subject: [vtkusers] vtkSelectPolydata does not work Message-ID: <1525737139658-0.post@n5.nabble.com> I want to use the vtkSelectPolyData to extract a region inside a loop so first I click many points to form a closed loop. After that, I use the vtkSelectPolyData to extract a part inside this loop but in some cases the result is empty. Is there anyway to check or debug this problem? or is this a bug of VTK? vtkSmartPointer renderer = vtkSmartPointer::New(); vtkSmartPointer loop_points = vtkSmartPointer::New(); // m_clicked_points stores a list of points I clicked on a stl model int n = m_clicked_points->GetNumberOfTuples(); for (int i = 0; i < n; i++) { double p[3]; m_clicked_points->GetTuple(i, p); loop_points->InsertNextPoint(p); } // Insert the first point to close the loop double first_point[3]; m_clicked_points->GetTuple(0, first_point); loop_points->InsertNextPoint(first_point); //------------------Extract-------------------- vtkSmartPointer loop = vtkSmartPointer::New(); loop->SetLoop(loop_points); loop->SetInputData(stl_base->GetOutput()); loop->GenerateUnselectedOutputOn(); loop->Update(); vtkSmartPointer output_a = make_an_actor(loop->GetOutput()); vtkSmartPointer unselected_a = make_an_actor(loop->GetUnselectedOutput()); output_a->GetProperty()->SetRepresentationToWireframe(); output_a->GetProperty()->SetColor(1, 0, 0); renderer->AddActor(output_a); renderer->AddActor(unselected_a); // m_vtkWindow is a vtkSmartPointer m_vtkWindow->AddRenderer(renderer); m_vtkWindow->Render(); -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From minpu.code at gmail.com Mon May 7 22:10:00 2018 From: minpu.code at gmail.com (pnt1614) Date: Mon, 7 May 2018 19:10:00 -0700 (MST) Subject: [vtkusers] vtkFeatureEdges - Order of Boundary Points In-Reply-To: <2559B7878C2B425099E45D6B6D88C2FE@razorback> References: <2559B7878C2B425099E45D6B6D88C2FE@razorback> Message-ID: <1525745400456-0.post@n5.nabble.com> Thanks for the useful information, but could you explain why cleaning the data after using vtkStripper correct the order of boundary points? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From david.gobbi at gmail.com Tue May 8 11:27:39 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 8 May 2018 09:27:39 -0600 Subject: [vtkusers] Medical image display - color of image pixels outside an image volume sliced with vtkImageResliceMapper In-Reply-To: References: <67c2093e-0e3a-24f6-9ffd-4535215ae49e@ne-scientific.com> Message-ID: I've located the bug, there was a missing check in the code: https://gitlab.kitware.com/vtk/vtk/merge_requests/4274 The bug is triggered by multi-sampling, which is why its appearance depends on the graphics hardware. So calling SetMultiSamples(0) on the render window is another work-around that can be used. - David On Sun, May 6, 2018 at 8:20 PM, David Gobbi wrote: > Hi Andrea, > > It isn't really a proper fix, it's a work around for what is probably a > bug in VTK. I'm still hoping to be able to fix the bug. > > - David > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bebe0705 at colorado.edu Tue May 8 19:26:40 2018 From: bebe0705 at colorado.edu (BBerco) Date: Tue, 8 May 2018 16:26:40 -0700 (MST) Subject: [vtkusers] VTK install with incomplete RPATHs to Qt targets Message-ID: <1525822000498-0.post@n5.nabble.com> I am using a slightly modifed version of the vtk Homebrew formula to distribute VTK with the proper QVTK flags along with my application. When the Homebrew install runs nominally (like on my Mac), the installed VTK libraries point to the proper location of Qt's components. For instance, otool returns the following targets for libvtkGUISupportQtSQL: * otool -L /usr/local/lib/libvtkGUISupportQtSQL-8.1.1.dylib : ... /usr/local/opt/qt/lib/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.10.0, current version 5.10.1) ... * However, on another Mac, the install process yields vtk libraries with partially resolved Qt targets: * otool -L /usr/local/lib/libvtkGUISupportQtSQL-8.1.1.dylib : ... @rpath/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.10.0, current version 5.10.1) ... * Note how "@rpath" is not expanded into "/usr/local/opt/qt/lib/". Running a program depending in libvtkGUISupportQtSQL.dylib fails at runtime with the linker error. *dyld: Library not loaded: @rpath/QtWidgets.framework/Versions/5/QtWidgets Referenced from: /usr/local/lib/libvtkGUISupportQtSQL-8.0.1.dylib* which makes complete sense. My questions: 1) at what point in the configure step of VTK's installation are the VTK libraries' targets defined? 2) why would "@rpath" not be properly expanded in the first place? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From tsilveira1993 at gmail.com Wed May 9 06:17:19 2018 From: tsilveira1993 at gmail.com (mafiaskafia) Date: Wed, 9 May 2018 03:17:19 -0700 (MST) Subject: [vtkusers] VTK integration in PyQt (wrong layout) Message-ID: <1525861039535-0.post@n5.nabble.com> I need to create a simple QT application that allows the user to view meshes using VTK. So basically the program is a window with a frame and a button (for now). My layout is such that the button must fill half the length of the window, and the frame (that'll display the mesh) will fill the other half. For experimentation i tried the 3D ball shown here: https://stackoverflow.com/questions/48105646/embedding-vtk-object-in-pyqt5-window Note: This is different the example above because i just want part of the window to be filled by the VTK widget, instead of the whole window. Here's my code for foo.py: from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(743, 430) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.horizontalLayout = QtWidgets.QHBoxLayout(self.centralwidget) self.horizontalLayout.setObjectName("horizontalLayout") self.pushButton = QtWidgets.QPushButton(self.centralwidget) self.pushButton.setObjectName("pushButton") self.horizontalLayout.addWidget(self.pushButton) self.frame = QtWidgets.QFrame(self.centralwidget) self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel) self.frame.setFrameShadow(QtWidgets.QFrame.Raised) self.frame.setObjectName("frame") self.horizontalLayout.addWidget(self.frame) MainWindow.setCentralWidget(self.centralwidget) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow) def retranslateUi(self, MainWindow): _translate = QtCore.QCoreApplication.translate MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow")) self.pushButton.setText(_translate("MainWindow", "PushButton")) And here is my code for init.py: import vtk import sys from PyQt5 import QtCore, QtGui from vtk.qt.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor from PyQt5.QtWidgets import QMainWindow, QApplication, QDialog, QFileDialog from foo import Ui_MainWindow from PyQt5 import Qt class MainWindow(QMainWindow, Ui_MainWindow): def __init__(self, parent=None): super(MainWindow, self).__init__(parent) self.setupUi(self) self.pushButton.clicked.connect(self.OpenVTK) def OpenVTK(self): self.vtkWidget = QVTKRenderWindowInteractor(self.frame) self.vl = Qt.QVBoxLayout() #I think the mistake might be here.. self.vl.addWidget(self.vtkWidget) self.ren = vtk.vtkRenderer() self.vtkWidget.GetRenderWindow().AddRenderer(self.ren) self.iren = self.vtkWidget.GetRenderWindow().GetInteractor() # Create source source = vtk.vtkSphereSource() source.SetCenter(0, 0, 0) source.SetRadius(5.0) # Create a mapper mapper = vtk.vtkPolyDataMapper() mapper.SetInputConnection(source.GetOutputPort()) # Create an actor actor = vtk.vtkActor() actor.SetMapper(mapper) self.ren.AddActor(actor) self.ren.ResetCamera() self.frame.setLayout(self.vl) self.setCentralWidget(self.frame) self.show() self.iren.Initialize() self.iren.Start() if __name__ == "__main__": app = QApplication(sys.argv) window = MainWindow() window.show() sys.exit(app.exec_()) I would be very appreciated if someone could help me out. Thanks in advance! -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From sankhesh.jhaveri at kitware.com Wed May 9 08:19:37 2018 From: sankhesh.jhaveri at kitware.com (Sankhesh Jhaveri) Date: Wed, 09 May 2018 12:19:37 +0000 Subject: [vtkusers] VTK integration in PyQt (wrong layout) In-Reply-To: <1525861039535-0.post@n5.nabble.com> References: <1525861039535-0.post@n5.nabble.com> Message-ID: Hi, Could you please share a screenshot of what you?re seeing and what you expect to see? Thanks, Sankhesh ? On Wed, May 9, 2018 at 6:17 AM mafiaskafia wrote: > I need to create a simple QT application that allows the user to view > meshes > using VTK. So basically the program is a window with a frame and a button > (for now). My layout is such that the button must fill half the length of > the window, and the frame (that'll display the mesh) will fill the other > half. For > experimentation i tried the 3D ball shown here: > > https://stackoverflow.com/questions/48105646/embedding-vtk-object-in-pyqt5-window > > Note: This is different the example above because i just want part of the > window to be filled by the VTK widget, instead of the whole window. > > Here's my code for foo.py: > > from PyQt5 import QtCore, QtGui, QtWidgets > > class Ui_MainWindow(object): > def setupUi(self, MainWindow): > MainWindow.setObjectName("MainWindow") > MainWindow.resize(743, 430) > self.centralwidget = QtWidgets.QWidget(MainWindow) > self.centralwidget.setObjectName("centralwidget") > self.horizontalLayout = > QtWidgets.QHBoxLayout(self.centralwidget) > self.horizontalLayout.setObjectName("horizontalLayout") > self.pushButton = QtWidgets.QPushButton(self.centralwidget) > self.pushButton.setObjectName("pushButton") > self.horizontalLayout.addWidget(self.pushButton) > self.frame = QtWidgets.QFrame(self.centralwidget) > self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel) > self.frame.setFrameShadow(QtWidgets.QFrame.Raised) > self.frame.setObjectName("frame") > self.horizontalLayout.addWidget(self.frame) > MainWindow.setCentralWidget(self.centralwidget) > > > self.retranslateUi(MainWindow) > QtCore.QMetaObject.connectSlotsByName(MainWindow) > > def retranslateUi(self, MainWindow): > _translate = QtCore.QCoreApplication.translate > MainWindow.setWindowTitle(_translate("MainWindow", > "MainWindow")) > self.pushButton.setText(_translate("MainWindow", "PushButton")) > > And here is my code for init.py: > > import vtk > import sys > from PyQt5 import QtCore, QtGui > from vtk.qt.QVTKRenderWindowInteractor import > QVTKRenderWindowInteractor > from PyQt5.QtWidgets import QMainWindow, QApplication, QDialog, > QFileDialog > from foo import Ui_MainWindow > from PyQt5 import Qt > > class MainWindow(QMainWindow, Ui_MainWindow): > def __init__(self, parent=None): > super(MainWindow, self).__init__(parent) > self.setupUi(self) > self.pushButton.clicked.connect(self.OpenVTK) > > def OpenVTK(self): > > self.vtkWidget = QVTKRenderWindowInteractor(self.frame) > self.vl = Qt.QVBoxLayout() #I think the mistake might be here.. > self.vl.addWidget(self.vtkWidget) > > self.ren = vtk.vtkRenderer() > self.vtkWidget.GetRenderWindow().AddRenderer(self.ren) > self.iren = self.vtkWidget.GetRenderWindow().GetInteractor() > > # Create source > source = vtk.vtkSphereSource() > source.SetCenter(0, 0, 0) > source.SetRadius(5.0) > > # Create a mapper > mapper = vtk.vtkPolyDataMapper() > mapper.SetInputConnection(source.GetOutputPort()) > > # Create an actor > actor = vtk.vtkActor() > actor.SetMapper(mapper) > > self.ren.AddActor(actor) > > self.ren.ResetCamera() > > self.frame.setLayout(self.vl) > self.setCentralWidget(self.frame) > > self.show() > self.iren.Initialize() > self.iren.Start() > > if __name__ == "__main__": > app = QApplication(sys.argv) > window = MainWindow() > window.show() > sys.exit(app.exec_()) > > I would be very appreciated if someone could help me out. Thanks in > advance! > > > > > > -- > 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: > https://vtk.org/mailman/listinfo/vtkusers > -- Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware | (518) 881-4417 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From tsilveira1993 at gmail.com Wed May 9 09:26:17 2018 From: tsilveira1993 at gmail.com (mafiaskafia) Date: Wed, 9 May 2018 06:26:17 -0700 (MST) Subject: [vtkusers] VTK integration in PyQt (wrong layout) In-Reply-To: References: <1525861039535-0.post@n5.nabble.com> Message-ID: <1525872377681-0.post@n5.nabble.com> Hey, Yes of course! Here is a screenshot of what i'm seeing: And this is what i want: Cheers -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From rabysam28 at gmail.com Wed May 9 10:05:27 2018 From: rabysam28 at gmail.com (Sam Raby) Date: Wed, 9 May 2018 07:05:27 -0700 Subject: [vtkusers] assigning vtkLookupTable to vtkpolydata Message-ID: I am running the following example for coloring, which works fine. I see that in this example, after the look up table is created there is a loop to iterate through the look up table and assign the colors to vtkUnsignedCharArray, and then assign it to a vtkpolydata as color. I understand the logic, but I am not sure why we need to iterate through the lookuo table one by one and assign it to another data structure, as oppose to just assigning the look up table directly to the mapper, which could be much faster. Is there a way in this example to assign the lookup table directly to the mapper and remove the vtkUnsignedCharArray? https://www.vtk.org/Wiki/VTK/Examples/Cxx/Meshes/Color_a_mesh_by_height Thanks -sam -------------- next part -------------- An HTML attachment was scrubbed... URL: From rabysam28 at gmail.com Wed May 9 10:09:23 2018 From: rabysam28 at gmail.com (Sam Raby) Date: Wed, 9 May 2018 07:09:23 -0700 Subject: [vtkusers] animation while renderer responsive Message-ID: Hello, I have a vtkPolyData that I can display fine. Every half a second another vrkplydata comes in, so I need to display the new vtkpolydata instead of the old one, and so forth. It is essentially like an animation but the incoming vtkploydata are different in size and content, so I cannot use the same vtkpolydata object every time. Is there an example so I see how to approach this? One requirement is that as this animation is displayed I need to be able to still interact with the scene such as zoom in and out. So it needs to be an unblocking call. Thanks -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Wed May 9 10:26:08 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Wed, 9 May 2018 22:26:08 +0800 Subject: [vtkusers] animation while renderer responsive In-Reply-To: References: Message-ID: 2018-05-09 16:09 GMT+02:00 Sam Raby : > Hello, I have a vtkPolyData that I can display fine. Every half a second > another vrkplydata comes in, so I need to display the new vtkpolydata > instead of the old one, and so forth. It is essentially like an animation > but the incoming vtkploydata are different in size and content, so I cannot > use the same vtkpolydata object every time. > > Is there an example so I see how to approach this? One requirement is that > as this animation is displayed I need to be able to still interact with the > scene such as zoom in and out. So it needs to be an unblocking call. I think that everything up to the AddActor(..) and Render() calls on the renderer can be made in a different thread. But the AddActor(..) and Render() calls must be made from the main (GUI) thread (please someone correct me if I'm wrong). So your GUI will be blocked for some time, depending on how much time those two calls take for your polydata. In our application we also have this problem, but we're working with volumes (not polydata). The GUI should ideally be fully responsive while a volume is being added to the renderer, but it will freeze for some hundred ms or so. I don't think there's a way around this. We do the reading/creation of the volume pipeline in a separate thread, but still the adding of the volume to the renderer and the subsequent first render will take some time. Elvis > > Thanks > -s > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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: > https://vtk.org/mailman/listinfo/vtkusers > From david.gobbi at gmail.com Wed May 9 10:55:13 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 9 May 2018 08:55:13 -0600 Subject: [vtkusers] animation while renderer responsive In-Reply-To: References: Message-ID: Hi Sam, There is a simple solution to this if the animation is looped (for example, if you have 20 polydata and you want to cycle through them). If this is the case, then add all of your polydata to the renderer at the same time, each with its own actor, and use the SetVisibility() method to hide all but the one that you want to show. The advantage to doing things this way is that all of the polydata is loaded onto the GPU up front. During the animation, switching the visibility on and off is instantaneous. The visibility switching can be done in a callback to a TimerEvent (for obvious reasons, it can't be done in a for() loop, and for less obvious reasons, trying to use multithreading for this is just asking for trouble). I've used this method myself for displaying animated cardiac models with interaction, but I no longer have the code (it was a long time ago). One thing that I remember is that in order to ensure that all the polydata were loaded onto the GPU before the animation started, I did one render at the beginning with all of the actors visible, but with SwapBuffersOff() so that this initial rendering was restricted to the back buffer. - David On Wed, May 9, 2018 at 8:09 AM, Sam Raby wrote: > Hello, I have a vtkPolyData that I can display fine. Every half a second > another vrkplydata comes in, so I need to display the new vtkpolydata > instead of the old one, and so forth. It is essentially like an animation > but the incoming vtkploydata are different in size and content, so I cannot > use the same vtkpolydata object every time. > > Is there an example so I see how to approach this? One requirement is that > as this animation is displayed I need to be able to still interact with the > scene such as zoom in and out. So it needs to be an unblocking call. > > Thanks > -s > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.martin at kitware.com Wed May 9 11:06:47 2018 From: ken.martin at kitware.com (Ken Martin) Date: Wed, 9 May 2018 11:06:47 -0400 Subject: [vtkusers] animation while renderer responsive In-Reply-To: References: Message-ID: Elvis is right. Load the data, Update() the reader/pipeline (which forces the pipeline to actually run). You can even create the mapper/actor etc if you want. All in another thread. But adding the actor to the renderer and rendering must be done in the main thread and there will be a pause as the graphics objects get built and uploaded to the GPU but at least it will be shorter as the file IO etc has already been done. Some of the building of the graphics objects could also be done in the other thread with some (possibly significant) coding changes to VTK which would further reduce any hiccups. On Wed, May 9, 2018 at 10:26 AM, Elvis Stansvik < elvis.stansvik at orexplore.com> wrote: > 2018-05-09 16:09 GMT+02:00 Sam Raby : > > Hello, I have a vtkPolyData that I can display fine. Every half a second > > another vrkplydata comes in, so I need to display the new vtkpolydata > > instead of the old one, and so forth. It is essentially like an animation > > but the incoming vtkploydata are different in size and content, so I > cannot > > use the same vtkpolydata object every time. > > > > Is there an example so I see how to approach this? One requirement is > that > > as this animation is displayed I need to be able to still interact with > the > > scene such as zoom in and out. So it needs to be an unblocking call. > > I think that everything up to the AddActor(..) and Render() calls on > the renderer can be made in a different thread. But the AddActor(..) > and Render() calls must be made from the main (GUI) thread (please > someone correct me if I'm wrong). > > So your GUI will be blocked for some time, depending on how much time > those two calls take for your polydata. > > In our application we also have this problem, but we're working with > volumes (not polydata). The GUI should ideally be fully responsive > while a volume is being added to the renderer, but it will freeze for > some hundred ms or so. I don't think there's a way around this. We do > the reading/creation of the volume pipeline in a separate thread, but > still the adding of the volume to the renderer and the subsequent > first render will take some time. > > Elvis > > > > > Thanks > > -s > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://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: > > https://vtk.org/mailman/listinfo/vtkusers > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://vtk.org/mailman/listinfo/vtkusers > -- Ken Martin PhD Distinguished Engineer Kitware Inc. 101 East Weaver Street Carrboro, North Carolina 27510 USA 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 ochampao at hotmail.com Wed May 9 13:26:48 2018 From: ochampao at hotmail.com (ochampao) Date: Wed, 9 May 2018 10:26:48 -0700 (MST) Subject: [vtkusers] Correct anatomical orientation of volumes from Niftii and DICOM Message-ID: <1525886808408-0.post@n5.nabble.com> Hi vtkUsers, I am developing an application for displaying medical images (four pane viewer with Sagittal, Coronal and Axial views). The volumes are loaded from different files that can be DICOM, Niftii or HDF5. Multiple volumes can be loaded and displayed simultaneously (by overlaying 2D slices). Until recently I have been using vtkDICOMImageReader for DICOM (see loadDicom()) and vtkNIFTIImageReader for Niftii (see loadNiftii()). Using these two functions I was able to display the 3 views with the correct anatomical orientations (i.e. Sagittal, Coronal and Axial). After reading the very nice guide by David Gobbi about Medical Image Orientation (see http://calgaryimageanalysis.ca/wiki/images/5/52/Image-orientation.pdf ) I followed the recommendation therein and decided to switch to vtkGDCMImageReader (see loadDicomGDCM() ). Despite using FileLowerLeftOn() and SetOutputOrigin() (as recommended in the guide) after switching to the vtkGDCMImageReader I am unable to display datasets coming from both DICOM and Niftii with the correct anatomical orientation. Using the pipeline as configured in the code segments below, I am able to correctly display volumes loaded from Niftii files (using loadNiftii()) and incorrectly display volumes loaded from DICOM (using loadDicomGDCM()). The 2D slices loaded using loadDicomGDCM() appear flipped both in the X and Y axes. The X axis flip can be avoided by skipping the call to FileLowerLeftOn(). So, my question is: how can I setup/correct my pipeline below to correctly display volumes loaded from both Niftii and DICOM (using vtkGDCMImageReader)? Below you can see relevant segments of my code. Thanks for your help Panos. ================================================================ // setups empty view with a vtkImageStack for overalying slices from multiple datasets void QuadView::initStaticPipelineForView(const IQuadViewUI::VTKDockWidget view) { // create an object that will hold the pointers to the static objects of the pipeline PipelineObjects2D pipelineObject2D; // setup image stack for overalying the multiple slices pipelineObject2D.imageStack = vtkSmartPointer::New(); // Setup renderers pipelineObject2D.renderer = vtkSmartPointer::New(); pipelineObject2D.renderer->AddViewProp(pipelineObject2D.imageStack); pipelineObject2D.renderer->GetActiveCamera()->ParallelProjectionOn(); pipelineObject2D.renderer->ResetCameraClippingRange(); pipelineObject2D.renderer->ResetCamera(); // Setup camera for each view if (view == IQuadViewUI::VTKDockWidget::TopLeft) // Axial { // do nothing } if (view == IQuadViewUI::VTKDockWidget::TopRight) // Sagittal { pipelineObject2D.renderer->GetActiveCamera()->Azimuth(90); pipelineObject2D.renderer->GetActiveCamera()->Roll(90); pipelineObject2D.renderer->GetActiveCamera()->OrthogonalizeViewUp(); } if (view == IQuadViewUI::VTKDockWidget::BottomLeft) // Coronal { pipelineObject2D.renderer->GetActiveCamera()->Elevation(90); pipelineObject2D.renderer->GetActiveCamera()->OrthogonalizeViewUp(); } // Setup render window pipelineObject2D.renderWindow = vtkSmartPointer::New(); pipelineObject2D.renderWindow->AddRenderer(pipelineObject2D.renderer); // Attach render window to QVTK widget QVTKOpenGLWidget& qVtkWidget = mQuadViewUI.getQVTKOpenGLWidget(view); qVtkWidget.SetRenderWindow(pipelineObject2D.renderWindow); //setup interaction style pipelineObject2D.interactorStyle = vtkSmartPointer::New(); pipelineObject2D.interactorStyle->SetInteractionModeToImageSlicing(); // Setup render window interactor pipelineObject2D.renderWindowInteractor = vtkSmartPointer::New(); pipelineObject2D.renderWindowInteractor->SetInteractorStyle(pipelineObject2D.interactorStyle); pipelineObject2D.renderWindowInteractor->SetRenderWindow(pipelineObject2D.renderWindow); pipelineObject2D.renderWindowInteractor->Initialize(); mPipelineObject2DContainer.insert(std::pair(view, pipelineObject2D)); // render pipelineObject2D.renderWindow->Render(); } // load a new volume unsigned long QuadView::addImage(const char* filename) { ImageDataStruct imageDataStruct; // *** SELECT ONE OF READERS imageDataStruct.imageData = loadDicomGDCM(filename); //imageDataStruct.imageData = loadDicomGDCM(filename); //imageDataStruct.imageData = loadNiftii(filename); //imageDataStruct.imageData = loadH5(filename); // setup lookup for the image data. imageDataStruct.lookupTable = setupLookupTableInternal(); // iterate through the active 2D views for (const auto &view : mQuadViewUI.getQVTKOpenGLWidget2DKeyList()) { // get a reference to the PipelineObjects2D &pipelineObjects2D = mPipelineObject2DContainer.at(view); // setup slice mapper for the current view imageDataStruct.resliceMapperContainer[view] = vtkSmartPointer::New(); imageDataStruct.resliceMapperContainer[view]->SetInputData(imageDataStruct.imageData); imageDataStruct.resliceMapperContainer[view]->SliceFacesCameraOn(); imageDataStruct.resliceMapperContainer[view]->SliceAtFocalPointOn(); // setup prop holding the slice imageDataStruct.imageSliceContainer[view] = vtkSmartPointer::New(); imageDataStruct.imageSliceContainer[view]->SetMapper(imageDataStruct.resliceMapperContainer[view]); imageDataStruct.imageSliceContainer[view]->GetProperty()->SetLookupTable(imageDataStruct.lookupTable); imageDataStruct.imageSliceContainer[view]->GetProperty()->UseLookupTableScalarRangeOn(); // add to image stack pipelineObjects2D.imageStack->AddImage(imageDataStruct.imageSliceContainer[view]); } // reset camera and clipping range resetCameras2D(); // render views renderViews2D(); // save object holding the pointers to the dynamic part of pipeline associated with the current image data mImageDataContainer.insert( std::pair(imageDataStruct.getUID(), imageDataStruct)); return imageDataStruct.getUID(); } // load volume from dicom using vtkDICOMImageReader vtkSmartPointer QuadView::loadDicom(const char* filename) const { vtkNew dicomReader; dicomReader->SetDirectoryName(filename); dicomReader->Update(); return dicomReader->GetOutput(); } // load volume from dicom using vtkDICOMImageReader vtkSmartPointer QuadView::loadDicomGDCM(const char* finename) const { gdcm::Directory gdcmDir; gdcmDir.Load(finename, false); gdcm::IPPSorter ippSorter; ippSorter.SetComputeZSpacing(true); ippSorter.SetZSpacingTolerance(1e-3); ippSorter.Sort(gdcmDir.GetFilenames()); vtkNew sortedFiles; for (const auto file : ippSorter.GetFilenames()) sortedFiles->InsertNextValue(file); vtkNew reader; reader->SetFileNames(sortedFiles); reader->FileLowerLeftOn(); reader->Update(); vtkNew imageInfo; imageInfo->SetOutputOrigin(0.0, 0.0, 0.0); imageInfo->SetOutputSpacing( reader->GetOutput()->GetSpacing()[0], reader->GetOutput()->GetSpacing()[1], ippSorter.GetZSpacing()); imageInfo->SetInputConnection(reader->GetOutputPort()); imageInfo->Update(); return imageInfo->GetOutput(); } // load volume from Niftii vtkSmartPointer QuadView::loadNiftii(const char* filename) const { vtkNew niftiiReader; niftiiReader->SetFileName(filename); niftiiReader->Update(); return niftiiReader->GetOutput(); } void QuadView::renderViews2D() const { // Render changes in 2D views for (const auto view : mQuadViewUI.getQVTKOpenGLWidget2DKeyList()) mPipelineObject2DContainer.at(view).renderWindow->Render(); } void QuadView::resetCameras2D() const { // iterate through the active 2D views. for (const auto &view : mQuadViewUI.getQVTKOpenGLWidget2DKeyList()) { // Reset camera & clipping range mPipelineObject2DContainer.at(view).renderer->ResetCamera(); switch (view) { case IQuadViewUI::VTKDockWidget::TopLeft: //Axial mPipelineObject2DContainer.at(view).renderer->GetActiveCamera()->SetViewUp(0, 1, 0); mPipelineObject2DContainer.at(view).renderer->GetActiveCamera()->OrthogonalizeViewUp(); break; case IQuadViewUI::VTKDockWidget::TopRight: //Sagittal mPipelineObject2DContainer.at(view).renderer->GetActiveCamera()->SetViewUp(0, 0, -1); mPipelineObject2DContainer.at(view).renderer->GetActiveCamera()->OrthogonalizeViewUp(); break; case IQuadViewUI::VTKDockWidget::BottomLeft: //Coronal mPipelineObject2DContainer.at(view).renderer->GetActiveCamera()->SetViewUp(0, 0, -1); mPipelineObject2DContainer.at(view).renderer->GetActiveCamera()->OrthogonalizeViewUp(); break; default: break; } } } ================================================================ -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From bill.lorensen at gmail.com Wed May 9 15:49:08 2018 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Wed, 9 May 2018 12:49:08 -0700 Subject: [vtkusers] VTK Textbook Update Message-ID: Folks, We have made great progress converting the current online PDF version of the VTK Textbook. The two efforts include a Latex version led by Andrew Maclean and a markdown version led by Bill Lorensen. Will Schroeder provided encouragement and a high resolution PDF of the textbook. Bernhard Meehan provided us with Latex versions for most of the equations. The two versions serve two different goals. The Latex version is duplicating the original text that was written using Adobe's Framemaker. The goal is to produce a version with links to figures, references, equations, examples, etc. Hopefully, by using a more familiar format (Latex), this version will serve as a base for future versions of the text. The Markdown version is an interactive, platform friendly version of the book. The entire text is available on as a Chapter by Chapter web site. The figures that exist as VTK Examples are linked to the nightly output of the regression testing. Also, all vtk classes in the text are linked to the doxygen descripti0on of the class. Example code that produces book figures links back to the figure in the text. This allows easy movement from text to examples and back The current version of the Latex textbook is here: https://raw.githubusercontent.com/lorensen/VTKExamples/master/src/VTKBookLaTex/VTKTextBook.pdf The alpha version of all Chapters of the Markdown text starts here: https://lorensen.github.io/VTKExamples/site/VTKBook/01Chapter1/ A more detailed description of the effort is here: https://lorensen.github.io/VTKExamples/site/VTKBook/ As always, we welcome positive and constructive comments. Bill -- Unpaid intern in BillsParadise at noware dot com From ustungozde at gmail.com Wed May 9 17:28:35 2018 From: ustungozde at gmail.com (blue) Date: Wed, 9 May 2018 14:28:35 -0700 (MST) Subject: [vtkusers] 3d Reconstructions wityh Python Message-ID: <1525901315603-0.post@n5.nabble.com> Hello; I am studying 3d reconstructions with python for my thesis I think firstly I should these algorithms for image processing before reconstructions. 1)Median Filtering 2)Image contrastion 3)Global thresholding 4)Noise reduction But I cant find these algorithm in vtk Which algorithms should I use instead of these algorithms? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From cory.quammen at kitware.com Wed May 9 21:30:00 2018 From: cory.quammen at kitware.com (Cory Quammen) Date: Thu, 10 May 2018 01:30:00 +0000 Subject: [vtkusers] 3d Reconstructions wityh Python In-Reply-To: <1525901315603-0.post@n5.nabble.com> References: <1525901315603-0.post@n5.nabble.com> Message-ID: You may want to use the Insight Toolkit, which does have all the algorithms you have asked for. www.itk.org Cheers, Cory On Wed, May 9, 2018 at 5:28 PM blue wrote: > Hello; > I am studying 3d reconstructions with python for my thesis I think firstly > I > should these algorithms for image processing before reconstructions. > 1)Median Filtering > 2)Image contrastion > 3)Global thresholding > 4)Noise reduction > But I cant find these algorithm in vtk Which algorithms should I use > instead > of these algorithms? > > > > > -- > 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: > https://vtk.org/mailman/listinfo/vtkusers > -- Cory Quammen Staff R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nil.goyette at imeka.ca Wed May 9 10:00:52 2018 From: nil.goyette at imeka.ca (Nil Goyette) Date: Wed, 9 May 2018 10:00:52 -0400 Subject: [vtkusers] Filtered polydata Message-ID: Hi all, We decided to port our old vtk application to vtk8 and I have some questions concerning the jump to OpenGL2+. We load a streamlines file (tck/trk/fib/vtk), which is simply a list of lines in 3D [1], to view it with an image, compute some stats on it, etc. This is already working well, thanks to the MITK framework. The problem is that we need to filter the streamlines when the user moves a selection box. It needs to be real-time, even with million(s) of streamlines. By 'filter', I simply mean that the user won't see all the data, but the data still should be in memory. Last time I simply created my own mapper, extending vtkPolyDataMapper, looping over a shared QSet containing the indices I wanted to draw. It was kind of a hack but it was super fast because there was no data duplication, only the qset was modified. vtk changed a lot so I prefer asking before coding anything. Is there a standard way to filter a huge polydata in real-time? If not, I started studying OpenGL2/vtkOpenGLPolyDataMapper.cxx and I have some questions about the best way to draw only the lines I want, probably concerning glDrawRangeElements and Primitives.IBO. Nil Goyette [1] https://i.imgur.com/krzBvJV.png From ruvva at yahoo.com Thu May 10 01:08:03 2018 From: ruvva at yahoo.com (Koteswara Rao Ruvva) Date: Thu, 10 May 2018 05:08:03 +0000 (UTC) Subject: [vtkusers] Rotation about arbitrary line passing through two points In-Reply-To: <218619704.554949.1525672975583@mail.yahoo.com> References: <218619704.554949.1525672975583.ref@mail.yahoo.com> <218619704.554949.1525672975583@mail.yahoo.com> Message-ID: <1919728931.1870373.1525928883545@mail.yahoo.com> Any comments on this? Basically I applied the following transformations: 1) Translate to one of the end points of the line 2) RotateWXYZ( angle, vector) 3) Translate back to the same end point If I have two lines, it rotates good around the first line but produce unexpected results about line2. Best Regards On Sunday, May 6, 2018, 11:02:55 PM PDT, Koteswara Rao Ruvva wrote: Hello, I have the following routine to rotate an assembly about a line passing through two points pt1 and pt2. It works good for the rotation about the first line. But when I rotate about another line it produce unexpected results. Looks like I am missing something here. ? ? def RotateAboutAxis(assembly, pt1, pt2, degrees): ? ? ? ? vec = vtk.vtkVector3d(pt1[0]-pt2[0], pt1[1]-pt2[1], pt1[2]-pt2[2]) ????????transform = assembly.GetUserTransform() ? ? ? ? transform.Translate(pt1[0], pt1[1], pt1[2])? ? ? ? transform.RotateWXYZ(degrees, vec[0], vec[1], vec[2])? ? ? ? transform.Translate(-pt1[0], -pt1[1], -pt1[2]) ThanksRao -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul_geus at hotmail.com Thu May 10 05:17:17 2018 From: paul_geus at hotmail.com (virtual tea kit) Date: Thu, 10 May 2018 02:17:17 -0700 (MST) Subject: [vtkusers] Visualizing a surface In-Reply-To: References: <1524570513469-0.post@n5.nabble.com> <1524729067596-0.post@n5.nabble.com> Message-ID: <1525943837888-0.post@n5.nabble.com> Hi kenichiro yoshimi, I have been trying to implement your methode, but I keep failing. How do you set the radius and dimension? Thank you -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From ochampao at hotmail.com Thu May 10 06:01:07 2018 From: ochampao at hotmail.com (ochampao) Date: Thu, 10 May 2018 03:01:07 -0700 (MST) Subject: [vtkusers] Correct anatomical orientation of volumes from Niftii and DICOM In-Reply-To: <1525886808408-0.post@n5.nabble.com> References: <1525886808408-0.post@n5.nabble.com> Message-ID: <1525946467407-0.post@n5.nabble.com> Just a small clarification for my previous post. The code as presented in my last post displays volumes loaded from Niftii with the correct anatomical orientation, whereas volumes loaded from DICOM using vtkGDCMImageReader appear flipped in the X and Y axis. Is it possible to have a single pipeline that will display volumes from both file formats correctly? Thanks. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From rccm.kyoshimi at gmail.com Thu May 10 07:15:37 2018 From: rccm.kyoshimi at gmail.com (kenichiro yoshimi) Date: Thu, 10 May 2018 20:15:37 +0900 Subject: [vtkusers] Visualizing a surface In-Reply-To: <1525943837888-0.post@n5.nabble.com> References: <1524570513469-0.post@n5.nabble.com> <1524729067596-0.post@n5.nabble.com> <1525943837888-0.post@n5.nabble.com> Message-ID: Hi, I'm sorry, but I don't know the reason why you are failing. I set the parameters against your data below: radius = 0.02 (the Gaussian blur kernel's radius) dimension = 101 (the resolution of the 3D volume) >>Is it okay to use a polydata? OK, because the code you indicate can be replaced in the following manner: auto particles = reader->GetOutput(); => vtkPolyData *particles = reader->GetOutput(); Best Regards 2018-05-10 18:17 GMT+09:00 virtual tea kit : > Hi kenichiro yoshimi, > > I have been trying to implement your methode, but I keep failing. > > How do you set the radius and dimension? > > 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: > https://vtk.org/mailman/listinfo/vtkusers From aborsic at ne-scientific.com Thu May 10 08:26:25 2018 From: aborsic at ne-scientific.com (aborsic at ne-scientific.com) Date: Thu, 10 May 2018 08:26:25 -0400 Subject: [vtkusers] animation while renderer responsive In-Reply-To: References: Message-ID: <004001d3e85a$1e84b2b0$5b8e1810$@ne-scientific.com> Hi Ken, Elvis, I have one question: the VTK User?s Guide covers in detail multithreading approaches based on streaming datasets across different execution paths. I am not aware (and perhaps I am mistaken) of a unified discussion / documentation for approaches to parallelism where parts of a pipeline are executed by different threads, as in the case discussed here. Am I wrong in this? Is there any documentation / resource that you would suggest reading? For example, where is it possible too find the requirement that the AddActor() and Render() calls should be made by the main thread? Thanks for any advice, Best Regards, Andrea From: vtkusers On Behalf Of Ken Martin Sent: Wednesday, May 9, 2018 11:07 AM To: Elvis Stansvik Cc: VTK Users Subject: Re: [vtkusers] animation while renderer responsive Elvis is right. Load the data, Update() the reader/pipeline (which forces the pipeline to actually run). You can even create the mapper/actor etc if you want. All in another thread. But adding the actor to the renderer and rendering must be done in the main thread and there will be a pause as the graphics objects get built and uploaded to the GPU but at least it will be shorter as the file IO etc has already been done. Some of the building of the graphics objects could also be done in the other thread with some (possibly significant) coding changes to VTK which would further reduce any hiccups. On Wed, May 9, 2018 at 10:26 AM, Elvis Stansvik > wrote: 2018-05-09 16:09 GMT+02:00 Sam Raby >: > Hello, I have a vtkPolyData that I can display fine. Every half a second > another vrkplydata comes in, so I need to display the new vtkpolydata > instead of the old one, and so forth. It is essentially like an animation > but the incoming vtkploydata are different in size and content, so I cannot > use the same vtkpolydata object every time. > > Is there an example so I see how to approach this? One requirement is that > as this animation is displayed I need to be able to still interact with the > scene such as zoom in and out. So it needs to be an unblocking call. I think that everything up to the AddActor(..) and Render() calls on the renderer can be made in a different thread. But the AddActor(..) and Render() calls must be made from the main (GUI) thread (please someone correct me if I'm wrong). So your GUI will be blocked for some time, depending on how much time those two calls take for your polydata. In our application we also have this problem, but we're working with volumes (not polydata). The GUI should ideally be fully responsive while a volume is being added to the renderer, but it will freeze for some hundred ms or so. I don't think there's a way around this. We do the reading/creation of the volume pipeline in a separate thread, but still the adding of the volume to the renderer and the subsequent first render will take some time. Elvis > > Thanks > -s > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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: > https://vtk.org/mailman/listinfo/vtkusers > _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: https://vtk.org/mailman/listinfo/vtkusers -- Ken Martin PhD Distinguished Engineer Kitware Inc. 101 East Weaver Street Carrboro, North Carolina 27510 USA 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 elvis.stansvik at orexplore.com Thu May 10 09:13:30 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Thu, 10 May 2018 21:13:30 +0800 Subject: [vtkusers] animation while renderer responsive In-Reply-To: <004001d3e85a$1e84b2b0$5b8e1810$@ne-scientific.com> References: <004001d3e85a$1e84b2b0$5b8e1810$@ne-scientific.com> Message-ID: 2018-05-10 14:26 GMT+02:00 : > Hi Ken, Elvis, > > > > I have one question: the VTK User?s Guide covers in detail multithreading > approaches based on streaming datasets across different execution paths. I > am not aware (and perhaps I am mistaken) of a unified discussion / > documentation for approaches to parallelism where parts of a pipeline are > executed by different threads, as in the case discussed here. > > > > Am I wrong in this? Is there any documentation / resource that you would > suggest reading? For example, where is it possible too find the requirement > that the AddActor() and Render() calls should be made by the main thread? I've also looked for some page that summarizes "all things related to multithreading" in VTK in the past (what's safe, what's not et.c.), but haven't found it. The approach I've taken is to assume that things are not thread-safe in general, unless otherwise noted, since it's quite some work to make things thread-safe. Regarding the info that you can construct your pipeline and execute it (using Update()) to obtain a result, and then hand that result off to the main thread, but that the AddActor(...) and Render(..) must run on the main (GUI) thread, well I think I may have found that bit of info in some other mail thread, or maybe I just tried it and assumed it would work :) But yes, it would be great if it was officially documented somewhere. Note that individual algorithms in a pipeline may use multithreading internally to do their work (and in fact many VTK filters do), so parts of a pipeline may be multi-threaded internally, but I don't think the pipeline machinery itself is thread-safe. E.g. you can't have a pipeline that straddle thread boundaries (again, someone correct me if I'm wrong). Elvis > > > > Thanks for any advice, > > > > Best Regards, > > > > Andrea > > > > > > > > From: vtkusers On Behalf Of Ken Martin > Sent: Wednesday, May 9, 2018 11:07 AM > To: Elvis Stansvik > Cc: VTK Users > Subject: Re: [vtkusers] animation while renderer responsive > > > > Elvis is right. Load the data, Update() the reader/pipeline (which forces > the pipeline to actually run). You can even create the mapper/actor etc if > you want. All in another thread. But adding the actor to the renderer and > rendering must be done in the main thread and there will be a pause as the > graphics objects get built and uploaded to the GPU but at least it will be > shorter as the file IO etc has already been done. > > > > Some of the building of the graphics objects could also be done in the other > thread with some (possibly significant) coding changes to VTK which would > further reduce any hiccups. > > > > > > On Wed, May 9, 2018 at 10:26 AM, Elvis Stansvik > wrote: > > 2018-05-09 16:09 GMT+02:00 Sam Raby : >> Hello, I have a vtkPolyData that I can display fine. Every half a second >> another vrkplydata comes in, so I need to display the new vtkpolydata >> instead of the old one, and so forth. It is essentially like an animation >> but the incoming vtkploydata are different in size and content, so I >> cannot >> use the same vtkpolydata object every time. >> >> Is there an example so I see how to approach this? One requirement is that >> as this animation is displayed I need to be able to still interact with >> the >> scene such as zoom in and out. So it needs to be an unblocking call. > > I think that everything up to the AddActor(..) and Render() calls on > the renderer can be made in a different thread. But the AddActor(..) > and Render() calls must be made from the main (GUI) thread (please > someone correct me if I'm wrong). > > So your GUI will be blocked for some time, depending on how much time > those two calls take for your polydata. > > In our application we also have this problem, but we're working with > volumes (not polydata). The GUI should ideally be fully responsive > while a volume is being added to the renderer, but it will freeze for > some hundred ms or so. I don't think there's a way around this. We do > the reading/creation of the volume pipeline in a separate thread, but > still the adding of the volume to the renderer and the subsequent > first render will take some time. > > Elvis > >> >> Thanks >> -s >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://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: >> https://vtk.org/mailman/listinfo/vtkusers >> > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://vtk.org/mailman/listinfo/vtkusers > > > > > > -- > > Ken Martin PhD > > Distinguished Engineer > Kitware Inc. > > 101 East Weaver Street > Carrboro, North Carolina > 27510 USA > > 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 ustungozde at gmail.com Thu May 10 09:14:42 2018 From: ustungozde at gmail.com (blue) Date: Thu, 10 May 2018 06:14:42 -0700 (MST) Subject: [vtkusers] 3d Reconstructions wityh Python In-Reply-To: References: <1525901315603-0.post@n5.nabble.com> Message-ID: <1525958082561-0.post@n5.nabble.com> Can I use opencv instead of insight toolkit? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From cory.quammen at kitware.com Thu May 10 09:22:00 2018 From: cory.quammen at kitware.com (Cory Quammen) Date: Thu, 10 May 2018 13:22:00 +0000 Subject: [vtkusers] 3d Reconstructions wityh Python In-Reply-To: <1525958082561-0.post@n5.nabble.com> References: <1525901315603-0.post@n5.nabble.com> <1525958082561-0.post@n5.nabble.com> Message-ID: I'm not that familiar with OpenCV, but sure. You can use whatever software has the algorithms you need :-) Cory On Thu, May 10, 2018 at 9:14 AM blue wrote: > Can I use opencv instead of insight toolkit? > > > > -- > 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: > https://vtk.org/mailman/listinfo/vtkusers > -- Cory Quammen Staff R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcus.hanwell at kitware.com Thu May 10 10:02:24 2018 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Thu, 10 May 2018 10:02:24 -0400 Subject: [vtkusers] 3d Reconstructions wityh Python In-Reply-To: <1525901315603-0.post@n5.nabble.com> References: <1525901315603-0.post@n5.nabble.com> Message-ID: On Wed, May 9, 2018 at 5:28 PM, blue wrote: > Hello; > I am studying 3d reconstructions with python for my thesis I think firstly > I > should these algorithms for image processing before reconstructions. > 1)Median Filtering > 2)Image contrastion > 3)Global thresholding > 4)Noise reduction > But I cant find these algorithm in vtk Which algorithms should I use > instead > of these algorithms? > The Tomviz project might be of interest, we use Python in our pipeline, and have many SciPy-based data operators, as well as some ITK operators. If you look at the Python folder, https://github.com/OpenChemistry/tomviz/tree/master/tomviz/python You can see a number of examples that focus on taking a NumPy array, treating the data, and setting the output. Things like remove bad pixels use ndimage from scipy for example. You can visualize the outputs of various Python operations. We have not integrated OpenCV. The installer comes with a full Python environment that contains SciPy, NumPy, ITK, etc. Thanks, Marcus -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcus.hanwell at kitware.com Thu May 10 10:02:24 2018 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Thu, 10 May 2018 10:02:24 -0400 Subject: [vtkusers] 3d Reconstructions wityh Python In-Reply-To: <1525901315603-0.post@n5.nabble.com> References: <1525901315603-0.post@n5.nabble.com> Message-ID: On Wed, May 9, 2018 at 5:28 PM, blue wrote: > Hello; > I am studying 3d reconstructions with python for my thesis I think firstly > I > should these algorithms for image processing before reconstructions. > 1)Median Filtering > 2)Image contrastion > 3)Global thresholding > 4)Noise reduction > But I cant find these algorithm in vtk Which algorithms should I use > instead > of these algorithms? > The Tomviz project might be of interest, we use Python in our pipeline, and have many SciPy-based data operators, as well as some ITK operators. If you look at the Python folder, https://github.com/OpenChemistry/tomviz/tree/master/tomviz/python You can see a number of examples that focus on taking a NumPy array, treating the data, and setting the output. Things like remove bad pixels use ndimage from scipy for example. You can visualize the outputs of various Python operations. We have not integrated OpenCV. The installer comes with a full Python environment that contains SciPy, NumPy, ITK, etc. Thanks, Marcus -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul_geus at hotmail.com Thu May 10 10:12:36 2018 From: paul_geus at hotmail.com (virtual tea kit) Date: Thu, 10 May 2018 07:12:36 -0700 (MST) Subject: [vtkusers] Visualizing a surface In-Reply-To: References: <1524570513469-0.post@n5.nabble.com> <1524729067596-0.post@n5.nabble.com> <1525943837888-0.post@n5.nabble.com> Message-ID: <1525961556647-0.post@n5.nabble.com> Thank you for the quick reply. I found the mistake. I was making an error reading in the data. Do you know any good papers of instructions on how to set the parameters according to the given dataset. I managed to do it for the dataset I send earlier. But others still dont work. I am guessing, that I have to adjust the radius and the dimension. But what else is very good to adjust? Thank you :) -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From ustungozde at gmail.com Thu May 10 11:08:04 2018 From: ustungozde at gmail.com (blue) Date: Thu, 10 May 2018 08:08:04 -0700 (MST) Subject: [vtkusers] 3d Reconstructions wityh Python In-Reply-To: References: <1525901315603-0.post@n5.nabble.com> Message-ID: <1525964884738-0.post@n5.nabble.com> I think I can use opencv for image processing steps and after processed images I can bact to vtk (I have been using 5 years with c++ for iamge processing and for my this project I will use opencv in the first step and than for this steps's results I can use vtk)(opencv installed another python and c++ version ) -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From ochampao at hotmail.com Thu May 10 11:37:35 2018 From: ochampao at hotmail.com (ochampao) Date: Thu, 10 May 2018 08:37:35 -0700 (MST) Subject: [vtkusers] Correct anatomical orientation of volumes from Niftii and DICOM In-Reply-To: <1525946467407-0.post@n5.nabble.com> References: <1525886808408-0.post@n5.nabble.com> <1525946467407-0.post@n5.nabble.com> Message-ID: <1525966655394-0.post@n5.nabble.com> I have tried passing the output of vtkNIFTIImageReader via vtkImageChangeInformation filter to change the origin to (0,0,0) but this had no effect, i.e: // .... vtkNew imageInfo; imageInfo->SetOutputOrigin(0.0, 0.0, 0.0); imageInfo->SetInputConnection(niftiiReader->GetOutputPort()); imageInfo->Update(); return imageInfo->GetOutput(); -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From andrew.slaughter at inl.gov Thu May 10 13:06:54 2018 From: andrew.slaughter at inl.gov (Slaughter, Andrew E) Date: Thu, 10 May 2018 11:06:54 -0600 Subject: [vtkusers] Time Interpolation Message-ID: I was hoping someone could help me setup interpolation for ExodusII data. The attached python scripts (I am using MacOS; python2.7; vtk7.1) reads the ExodusII file (mug.e). I would like to be able to set an arbitrary time value and have VTK perform the interpolation, would someone please help me get this working? I have two versions I am working on, one using vtkTemporalInterpolator and the other with vtkInterpolateDataSetAttributes. I am happy using either class, I just need it to work. I am aware that some of these features are built into Paraview, but my project requires me to make this work with pure VTK. Thanks, Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mug.e Type: application/octet-stream Size: 1928660 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: data_interolate.py Type: text/x-python-script Size: 1581 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: time_interpolator.py Type: text/x-python-script Size: 1273 bytes Desc: not available URL: From david.gobbi at gmail.com Thu May 10 13:11:51 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 10 May 2018 11:11:51 -0600 Subject: [vtkusers] Correct anatomical orientation of volumes from Niftii and DICOM In-Reply-To: <1525966655394-0.post@n5.nabble.com> References: <1525886808408-0.post@n5.nabble.com> <1525946467407-0.post@n5.nabble.com> <1525966655394-0.post@n5.nabble.com> Message-ID: Hi Panos, It is possible to display NIFTI and DICOM together in the same program, but this isn't something you can achieve simply by adjusting things with vtkImageChangeInformation or with FileLowerLeftOn(). Here are some key points: 1) NIFTI is fundamentally a 3D, volumetric, oriented image format. In order to properly display a NIFTI file, you must use the orientation info embedded in the file (the sform or the qform). 2) DICOM is fundamentally a 2D image format, but of course the meta-data contains info to allow DICOM images to be reconstructed into a 3D volume and oriented in 3D space. Since DICOM originated as a 2D format, you can ignore the orientation meta-data and still display the data reasonably. For example, if you show an axial CT or MR head data set, you can reasonably trust that the nose will point to the top of the image, and that the left ear will be on the right, even without checking the ImageOrientationPatient info. This is not true of NIFTI. If you don't check the sform or the qform in the NIFTI header, you have no way to know whether left is left or left is right on the 2D slices, even if you know that the slices are axial. There is no way to robustly display NIFTI with the correct orientation unless you use the sform or qform info. 3) The 3D coordinate systems of DICOM and NIFTI differ. The 3D "y" direction in NIFTI maps to the 3D "-y" direction in DICOM, and similarly "x" maps to "-x". Note that I'm talking about the the 3D directions in the oriented coordinate system, I'm not talking about the vertical or horizontal direction in the 2D coordinate system. This isn't something that you can properly account for by flipping the image. In order to properly map from DICOM coords to NIFTI coords, so that you can display DICOM and NIFTI together, you should get the orientation info from both the DICOM and the NIFTI, and you should account for the difference in the 3D coordinate systems for each. If you can be certain that the NIFTI files are from an axial scan, then at the very least you must check the sform or qform in order to get left/right and up/down correct. Read everything that you can find on DICOM and NIFTI orientation, it's a tricky subject and goes beyond what can be answered on a mailing list. Here's a few links: Here's the Slicer page on coordinate systems: https://www.slicer.org/wiki/Coordinate_systems The official NIFTI documentation for orientation: https://nifti.nimh.nih.gov/nifti-1/documentation/nifti1fields/nifti1fields_pages/qsform.html The official DICOM documentation for orientation: http://dicom.nema.org/MEDICAL/dicom/current/output/chtml/part03/sect_C.7.6.2.html This is a program that I wrote to convert NIFTI images to DICOM, the code isn't easy to follow but it contains all the needed logic: https://github.com/dgobbi/vtk-dicom/blob/master/Programs/niftitodicom.cxx#L482 Hope this helps. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From nztoddler at yahoo.com Thu May 10 19:26:41 2018 From: nztoddler at yahoo.com (Todd) Date: Fri, 11 May 2018 11:26:41 +1200 Subject: [vtkusers] Correct anatomical orientation of volumes from Niftii and DICOM In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Thu May 10 19:37:57 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 10 May 2018 17:37:57 -0600 Subject: [vtkusers] Correct anatomical orientation of volumes from Niftii and DICOM In-Reply-To: References: Message-ID: Hi Todd, The DICOM patient coordinate system and the NIFTI world coordinate system both follow the right hand rule (there is a sign change along two axes, not just along one axis). Flipping along the z axis will certainly not fix the issue. - David On Thu, May 10, 2018 at 5:26 PM, Todd wrote: > > > On 11 May 2018 5:11 a.m., David Gobbi wrote: > > Hi Panos, > > It is possible to display NIFTI and DICOM together in the same program, > but this isn't something you can achieve simply by adjusting things with > vtkImageChangeInformation or with FileLowerLeftOn(). > > Here are some key points: > > 1) NIFTI is fundamentally a 3D, volumetric, oriented image format. In > order to properly display a NIFTI file, you must use the orientation info > embedded in the file (the sform or the qform). > > 2) DICOM is fundamentally a 2D image format, but of course the > meta-data contains info to allow DICOM images to be reconstructed > into a 3D volume and oriented in 3D space. > > Since DICOM originated as a 2D format, you can ignore the orientation > meta-data and still display the data reasonably. For example, if you > show an axial CT or MR head data set, you can reasonably trust that > the nose will point to the top of the image, and that the left ear will be > on the right, even without checking the ImageOrientationPatient info. > > This is not true of NIFTI. If you don't check the sform or the qform in > the NIFTI header, you have no way to know whether left is left or > left is right on the 2D slices, even if you know that the slices are axial. > There is no way to robustly display NIFTI with the correct orientation > unless you use the sform or qform info. > > 3) The 3D coordinate systems of DICOM and NIFTI differ. The 3D "y" > direction in NIFTI maps to the 3D "-y" direction in DICOM, and > similarly "x" maps to "-x". Note that I'm talking about the the 3D > directions in the oriented coordinate system, I'm not talking about > the vertical or horizontal direction in the 2D coordinate system. > This isn't something that you can properly account for by flipping the > image. > > > What you're describing here is a right-handed coordinate system for DICOM > and a left-handed coordinate system for NIFTY. In that case, for > consistency, it would be simpler just to flip the z axis of one data set. > It doesn't really matter which is chosen, provided one is cognicient of > what a positive axial rotation means in that CS. > > As an engineer I always revert to a right-handed CS, otherwise the mental > gymnastics are too onerous. > > > In order to properly map from DICOM coords to NIFTI coords, so > that you can display DICOM and NIFTI together, you should get the > orientation info from both the DICOM and the NIFTI, and you should > account for the difference in the 3D coordinate systems for each. > > If you can be certain that the NIFTI files are from an axial scan, then > at the very least you must check the sform or qform in order to get > left/right and up/down correct. > > > Read everything that you can find on DICOM and NIFTI orientation, > it's a tricky subject and goes beyond what can be answered on a > mailing list. Here's a few links: > > Here's the Slicer page on coordinate systems: > https://www.slicer.org/wiki/Coordinate_systems > > The official NIFTI documentation for orientation: > https://nifti.nimh.nih.gov/nifti-1/documentation/ > nifti1fields/nifti1fields_pages/qsform.html > > The official DICOM documentation for orientation: > http://dicom.nema.org/MEDICAL/dicom/current/output/chtml/ > part03/sect_C.7.6.2.html > > This is a program that I wrote to convert NIFTI images to DICOM, > the code isn't easy to follow but it contains all the needed logic: > https://github.com/dgobbi/vtk-dicom/blob/master/Programs/ > niftitodicom.cxx#L482 > > Hope this helps. > > - David > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nztoddler at yahoo.com Thu May 10 19:56:49 2018 From: nztoddler at yahoo.com (Todd) Date: Fri, 11 May 2018 11:56:49 +1200 Subject: [vtkusers] Correct anatomical orientation of volumes from Niftii and DICOM In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: From sur.chiranjib at gmail.com Fri May 11 01:34:08 2018 From: sur.chiranjib at gmail.com (Chiranjib Sur) Date: Fri, 11 May 2018 11:04:08 +0530 Subject: [vtkusers] Visualizing a surface In-Reply-To: <1525961556647-0.post@n5.nabble.com> References: <1524570513469-0.post@n5.nabble.com> <1524729067596-0.post@n5.nabble.com> <1525943837888-0.post@n5.nabble.com> <1525961556647-0.post@n5.nabble.com> Message-ID: Hi, A quick rule of thumb will be using the same particle radius as the Gaussian blur kernel's radius. This might not be perfect but works for most of the cases (at least I have tried the Delaunay3D filter based on this assumption) Good luck! Thanks and regards, Chiranjib On Thu, May 10, 2018 at 7:42 PM, virtual tea kit wrote: > Thank you for the quick reply. > I found the mistake. I was making an error reading in the data. > > Do you know any good papers of instructions on how to set the parameters > according to the given dataset. > I managed to do it for the dataset I send earlier. But others still dont > work. I am guessing, that I have to adjust the radius and the dimension. > But > what else is very good to adjust? > 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: > https://vtk.org/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul_geus at hotmail.com Fri May 11 04:26:37 2018 From: paul_geus at hotmail.com (virtual tea kit) Date: Fri, 11 May 2018 01:26:37 -0700 (MST) Subject: [vtkusers] Visualizing a surface In-Reply-To: References: <1524570513469-0.post@n5.nabble.com> <1524729067596-0.post@n5.nabble.com> <1525943837888-0.post@n5.nabble.com> Message-ID: <1526027197911-0.post@n5.nabble.com> Thanks for the rule. What is the different between a ".particle" file and just reading x,y,z coordinates into points and then setting polydata->SetPoints(points). Whenever I want to use other particle sets it doesnt work. Only when reading in the file from the zip file, uploaded earlier, does it work. It gives me the error message: Filters\Geometry\vtkDataSetSurfaceFilter.cxx, line 167 vtkDataSetSurfaceFilter (000001C6444EBAD0): Number of cells is zero, no data to process. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From ochampao at hotmail.com Fri May 11 09:44:23 2018 From: ochampao at hotmail.com (ochampao) Date: Fri, 11 May 2018 06:44:23 -0700 (MST) Subject: [vtkusers] Correct anatomical orientation of volumes from Niftii and DICOM In-Reply-To: References: <1525886808408-0.post@n5.nabble.com> <1525946467407-0.post@n5.nabble.com> <1525966655394-0.post@n5.nabble.com> Message-ID: <1526046263006-0.post@n5.nabble.com> Hi David. Thanks for the detailed reply. It's clear I need to familirize myself more with the two formats. I have a few follow-up questions: 1) I understand that we need to look into the information stored in each file to determine how to position and orient the volume. What is not clear to me is how much of this is done by the readers themselves. Are there some rules/conventions/logic that each reader follows when orienting and positioning the reconstructed volume in vtk's world coordinate system? Can we make some assumptions about the reconstructed volume (vtkImageData) generated by the reader? 2) Let's put Niftii on the side for a moment. With in my code above the same volume appears with it's x and y axes reversed when using vtkGDCMImageReader (loadDicomGDCM()) compared to when using vtkDICOMImageReader (loadDicom())? How can I ensure the correct volume orientation (or equivalently the correct camera perspective)? Panos. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From david.gobbi at gmail.com Fri May 11 11:44:05 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 11 May 2018 09:44:05 -0600 Subject: [vtkusers] Correct anatomical orientation of volumes from Niftii and DICOM In-Reply-To: <1526046263006-0.post@n5.nabble.com> References: <1525886808408-0.post@n5.nabble.com> <1525946467407-0.post@n5.nabble.com> <1525966655394-0.post@n5.nabble.com> <1526046263006-0.post@n5.nabble.com> Message-ID: I'll have to provide some background before answering your questions, please bear with me and hopefully everything will come together at the end. Originally (meaning around 20 years ago) VTK was very limited as far as image display is concerned. The original vtkImageMapper always displayed images in a 2D pixel coordinate system where the first pixel in the image was at the bottom left. Of course, for most image file formats the first pixel in the file is meant to be at the top left. Such file formats include JPEG, DICOM, and many others. So in general the VTK image readers flip the image vertically, and the FileLowerLeft flag can be used to tell the readers not to flip the image. There are some exceptions, however. So the vtkDICOMImageReader flips the DICOM image vertically by default, in order to make the 2D slices look right when displayed with the vtkImageMapper. It should be obvious that flipping the images can mess things up as far as the 3D coordinate system is concerned. Also, it's 2018 and nobody should be using vtkImageMapper anymore, there are much better ways of displaying images in VTK. By using 3D image rendering and by setting the ViewUp of the camera, one can keep the images in their original orientation and still display them properly. The vtkGDCMImageReader does this same vertical flip when reading images, and of course I strongly recommend setting FileLowerLeftOn() to stop it from doing so. So now we get to your first question. The readers do, indeed, try to handle certain orientation issues themselves. But often what they do hurts more than it helps. That is why, in that document of mine that you linked to earlier, I recommend setting up the reader so that it reads the pixels directly into memory without any flips or other mangling. Once you have done so, you can go to the official, standard documentation for the file formats to figure out how to properly orient and position the images in 3D space. For your second question, I'll turn it into an exercise. You know that in DICOM, left is +x and anterior (towards the nose) is -y. So first, verify that this is the view orientation that you are providing for your 'axial' view. When I say verify, I don't mean to do so by displaying an image and seeing if it looks like... that's not independent verification! Verify with vtkAxesActor or with something similar: https://lorensen.github.io/VTKExamples/site/Cxx/Visualization/DisplayCoordinateAxes/ Once you've verified that the camera is correct, you can display output of vtkDICOMImageReader and vtkGDCMReader and check which is correct. After you've made sure that everything is correct for the axial view, you can do the same for the other views (again, using vtkAxesActor to verify the camera). That should be enough to get you started. - David On Fri, May 11, 2018 at 7:44 AM, ochampao wrote: > Hi David. > > Thanks for the detailed reply. It's clear I need to familirize myself more > with the two formats. > > I have a few follow-up questions: > > 1) I understand that we need to look into the information stored in each > file to determine how to position and orient the volume. What is not clear > to me is how much of this is done by the readers themselves. Are there some > rules/conventions/logic that each reader follows when orienting and > positioning the reconstructed volume in vtk's world coordinate system? Can > we make some assumptions about the reconstructed volume (vtkImageData) > generated by the reader? > > 2) Let's put Niftii on the side for a moment. With in my code above the > same > volume appears with it's x and y axes reversed when using > vtkGDCMImageReader > (loadDicomGDCM()) compared to when using vtkDICOMImageReader (loadDicom())? > How can I ensure the correct volume orientation (or equivalently the > correct > camera perspective)? > > > Panos. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nil.goyette at imeka.ca Fri May 11 12:04:18 2018 From: nil.goyette at imeka.ca (Nil Goyette) Date: Fri, 11 May 2018 12:04:18 -0400 Subject: [vtkusers] Filtered polydata In-Reply-To: References: Message-ID: <2770e3da-ad40-6be3-2ee4-5f948fceb98c@imeka.ca> Hi all, My last mesage was probably not seen because it appeared on the ML several hours after I sent it. Anyone? It would be nice to have a some general advices before starting this project. Thank you. Nil Le 2018-05-09 ? 10:00, Nil Goyette a ?crit?: > Hi all, > > We decided to port our old vtk application to vtk8 and I have some > questions concerning the jump to OpenGL2+. We load a streamlines file > (tck/trk/fib/vtk), which is simply a list of lines in 3D [1], to view > it with an image, compute some stats on it, etc. This is already > working well, thanks to the MITK framework. > > The problem is that we need to filter the streamlines when the user > moves a selection box. It needs to be real-time, even with million(s) > of streamlines. By 'filter', I simply mean that the user won't see all > the data, but the data still should be in memory. Last time I simply > created my own mapper, extending vtkPolyDataMapper, looping over a > shared QSet containing the indices I wanted to draw. It was kind of a > hack but it was super fast because there was no data duplication, only > the qset was modified. > > vtk changed a lot so I prefer asking before coding anything. Is there > a standard way to filter a huge polydata in real-time? If not, I > started studying OpenGL2/vtkOpenGLPolyDataMapper.cxx and I have some > questions about the best way to draw only the lines I want, probably > concerning glDrawRangeElements and Primitives.IBO. > > Nil Goyette > > [1] https://i.imgur.com/krzBvJV.png > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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: > https://vtk.org/mailman/listinfo/vtkusers From minpu.code at gmail.com Fri May 11 21:36:14 2018 From: minpu.code at gmail.com (pnt1614) Date: Fri, 11 May 2018 18:36:14 -0700 (MST) Subject: [vtkusers] How to render vtkActor2D and vtkActor in different colors? Message-ID: <1526088974249-0.post@n5.nabble.com> I want to render a 2D line using the vtkActor2D and a 3D sphere using vtkActor in different colors. After generating a sphere with the default color, I make a 2D blue line. At the first render, the sphere and the line are rendered in the different colors but the line's color is changed to the sphere's color when I rotate the camera. vtkSmartPointer s = vtkSmartPointer::New(); s->SetCenter(0.0, 0.0, 0.0); s->SetRadius(2.0); s->Update(); vtkSmartPointer sphere_actor = make_an_actor(s->GetOutput()); vtkSmartPointer renderer = m_vtkWindow->GetRenderers()->GetFirstRenderer(); renderer->AddActor(sphere_actor); //-----------------2D line------------------ int* size = m_vtkWindow->GetSize(); double w = (double)size[0]; double h = (double)size[1]; vtkSmartPointer coordinate1 = vtkCoordinate::New(); coordinate1->SetCoordinateSystemToDisplay(); coordinate1->SetValue(0.0, h / 2); double* p1 = coordinate1->GetComputedDoubleDisplayValue(renderer); vtkSmartPointer coordinate2 = vtkCoordinate::New(); coordinate2->SetCoordinateSystemToDisplay(); coordinate2->SetValue(w, h / 2); double* p2 = coordinate2->GetComputedDoubleDisplayValue(renderer); vtkSmartPointer line = vtkSmartPointer::New(); line->SetPoint1(p1); line->SetPoint2(p2); line->Update(); vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputData(line->GetOutput()); vtkSmartPointer line_actor = vtkSmartPointer::New(); line_actor->SetMapper(mapper); line_actor->GetProperty()->SetColor(0, 0, 1); line_actor->GetProperty()->SetLineWidth(2.0); renderer->AddActor2D(line_actor); renderer->ResetCamera(); vtkSmartPointer style = vtkSmartPointer::New(); vtkSmartPointer interactor = m_vtkWindow->GetInteractor(); interactor->SetInteractorStyle(style); m_vtkWindow->Render(); Is there something I missing? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From mark at mccluregeomechanics.com Sat May 12 14:45:27 2018 From: mark at mccluregeomechanics.com (Mark McClure) Date: Sat, 12 May 2018 11:45:27 -0700 Subject: [vtkusers] Slow VTK Python import after a crash Message-ID: I am developing software using VTK within Python. Typically, it requires about 7 seconds on my machine to import vtk (assuming it is not already cached). However, I have observed that sometimes if a program is force quit, or otherwise closed in an uncontrolled way, then the next time I try to import vtk, it can take 2-5 minutes. Any suggestions on how to deal with this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From geoff.woodcock at velo3d.com Sat May 12 23:22:08 2018 From: geoff.woodcock at velo3d.com (Geoff Woodcock) Date: Sun, 13 May 2018 03:22:08 +0000 Subject: [vtkusers] black window with qvtkopenGLWidget and vtkHardwareSelector / cell picking from screen In-Reply-To: References: Message-ID: Hi, I am new to VTK. My company is trying to develop a visualization program around VTK. We are using VTK 8.1 with Qt. I am trying to do cell selection using vtkHardwareSelector. I have an InteractorStyle that is a subclass of vtkInteractorStyleRubberBandPick. Seemingly at random when picking, the entire screen goes black, including not just the 3d view but the entire QT window including the menu bar. It appears to happen only after I create the second InteractorStyle. A possibly related problem is that I can't seem to call Delete() on the vtkHardwareSelector. Doing so causes an exception to occur, but not at the point of the Delete call - somewhere later in the function. We are using vtk in a static library and I wonder if that is the cause. (Is there any way to debug the black screen?) I have also tried doing: VTK_MODULE_INIT(vtkRenderingOpenGL2); // VTK was built with vtkRenderingOpenGL2 VTK_MODULE_INIT(vtkInteractionStyle); And auto defaultFormat = QVTKOpenGLWidget::defaultFormat(); defaultFormat.setSamples(0); QSurfaceFormat::setDefaultFormat(defaultFormat); In main before I do anything else, but does not seem to have any effect. Here is the snippet from my OnLeftButtonUp that deals with vtkHardwareSelector: vtkSmartPointer selector = vtkSmartPointer::New(); selector->SetRenderer(this->CurrentRenderer); unsigned int windowSize[4]; windowSize[0] = StartPosition[0] < EndPosition[0] ? StartPosition[0] : EndPosition[0]; // xmin windowSize[1] = StartPosition[1] < EndPosition[1] ? StartPosition[1] : EndPosition[1]; // ymin windowSize[2] = StartPosition[0] < EndPosition[0] ? EndPosition[0] : StartPosition[0]; // xmax windowSize[3] = StartPosition[1] < EndPosition[1] ? EndPosition[1] : StartPosition[1]; // ymax selector->SetArea(windowSize); selector->SetFieldAssociation(vtkDataObject::FIELD_ASSOCIATION_CELLS); selector->CaptureBuffers(); mainWindow()->renderWindow()->OffScreenRenderingOn(); vtkSmartPointer selection = selector->Select(); selector->ClearBuffers(); mainWindow()->renderWindow()->OffScreenRenderingOff(); selector->Delete(); // I have to comment this out to avoid exceptions. Why??? (Exception occurs when the close brace on this code block is hit...) Any help very much appreciated! I am new to this and have been banging my head against it for a week! -Geoff CONFIDENTIALITY NOTICE:This message (including any attachments) may contain confidential, proprietary, privileged and/or private information. If you are not the intended recipient of this message, please notify the sender immediately, and delete the message and any attachments. Any disclosure, reproduction, distribution or other use of this message or any attachments by an individual or entity other than the intended recipient is prohibited CONFIDENTIALITY NOTICE:This message (including any attachments) may contain confidential, proprietary, privileged and/or private information. If you are not the intended recipient of this message, please notify the sender immediately, and delete the message and any attachments. Any disclosure, reproduction, distribution or other use of this message or any attachments by an individual or entity other than the intended recipient is prohibited CONFIDENTIALITY NOTICE:This message (including any attachments) may contain confidential, proprietary, privileged and/or private information. If you are not the intended recipient of this message, please notify the sender immediately, and delete the message and any attachments. Any disclosure, reproduction, distribution or other use of this message or any attachments by an individual or entity other than the intended recipient is prohibited -------------- next part -------------- An HTML attachment was scrubbed... URL: From ustungozde at gmail.com Sun May 13 13:12:46 2018 From: ustungozde at gmail.com (blue) Date: Sun, 13 May 2018 10:12:46 -0700 (MST) Subject: [vtkusers] 3d reconstructions 2d data Message-ID: <1526231566227-0.post@n5.nabble.com> Hello; I have data set for 3d reconstructions and I found this: https://nihcc.app.box.com/v/ChestXray-NIHCC/folder/37178474737 (004.tar.gz) Is it a suitable data set for 3d reconstructions? And how many images required for this study? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From minpu.code at gmail.com Mon May 14 01:24:54 2018 From: minpu.code at gmail.com (pnt1614) Date: Sun, 13 May 2018 22:24:54 -0700 (MST) Subject: [vtkusers] Is this a bug of vtkSelectPolyData? Message-ID: <1526275494989-0.post@n5.nabble.com> I load a stl 3D model and click many points to form a closed loop. After that, I use the vtkSelectPolyData to extract a part inside this loop but in some cases the result is empty. The un-selected region is also empty. This error occurs in some cases but I want to know the reason. Is there anyone knows how to debug this problem? // Output in the console --------Loop (vtkSelectPolyData)----------- Debug: On Modified Time: 47630 Reference Count: 2 Registered Events: (none) Executive: 0B2F6C50 ErrorCode: No error Information: 0B48C650 AbortExecute: Off Progress: 1 Progress Text: (None) Generate Unselected Output: On Inside Mode: InsideSmallestRegion Closest Point: (0, 0, 0) Generate Selection Scalars: Off Inside Out: Off Loop of 18points defined --------Select----------- Debug: Off Modified Time: 47773 Reference Count: 1 Registered Events: (none) Information: 0B48C4D0 Data Released: False Global Release Data: Off UpdateTime: 48488 Field Data: Debug: Off Modified Time: 47763 Reference Count: 1 Registered Events: (none) Number Of Arrays: 0 Number Of Components: 0 Number Of Tuples: 0 Number Of Points: 0 Number Of Cells: 0 Cell Data: Debug: Off Modified Time: 47771 Reference Count: 1 Registered Events: Registered Observers: vtkObserver (0B3110E8) Event: 33 EventName: ModifiedEvent Command: 0B48BF60 Priority: 0 Tag: 1 Number Of Arrays: 0 Number Of Components: 0 Number Of Tuples: 0 Copy Tuple Flags: ( 1 1 1 1 1 0 1 1 ) Interpolate Flags: ( 1 1 1 1 1 0 0 1 ) Pass Through Flags: ( 1 1 1 1 1 1 1 1 ) Scalars: (none) Vectors: (none) Normals: (none) TCoords: (none) Tensors: (none) GlobalIds: (none) PedigreeIds: (none) EdgeFlag: (none) Point Data: Debug: Off Modified Time: 47773 Reference Count: 1 Registered Events: Registered Observers: vtkObserver (0B310D08) Event: 33 EventName: ModifiedEvent Command: 0B48BF60 Priority: 0 Tag: 1 Number Of Arrays: 0 Number Of Components: 0 Number Of Tuples: 0 Copy Tuple Flags: ( 1 1 1 1 1 0 1 1 ) Interpolate Flags: ( 1 1 1 1 1 0 0 1 ) Pass Through Flags: ( 1 1 1 1 1 1 1 1 ) Scalars: (none) Vectors: (none) Normals: (none) TCoords: (none) Tensors: (none) GlobalIds: (none) PedigreeIds: (none) EdgeFlag: (none) Bounds: Xmin,Xmax: (1, -1) Ymin,Ymax: (1, -1) Zmin,Zmax: (1, -1) Compute Time: 48515 Number Of Points: 0 Point Coordinates: 00000000 Locator: 00000000 Number Of Vertices: 0 Number Of Lines: 0 Number Of Polygons: 0 Number Of Triangle Strips: 0 Number Of Pieces: 1 Piece: 0 Ghost Level: 0 --------Unselect----------- Debug: Off Modified Time: 47817 Reference Count: 1 Registered Events: (none) Information: 0B48C710 Data Released: False Global Release Data: Off UpdateTime: 48489 Field Data: Debug: Off Modified Time: 47807 Reference Count: 1 Registered Events: (none) Number Of Arrays: 0 Number Of Components: 0 Number Of Tuples: 0 Number Of Points: 0 Number Of Cells: 0 Cell Data: Debug: Off Modified Time: 47815 Reference Count: 1 Registered Events: Registered Observers: vtkObserver (0B30FBE8) Event: 33 EventName: ModifiedEvent Command: 0B48C7D0 Priority: 0 Tag: 1 Number Of Arrays: 0 Number Of Components: 0 Number Of Tuples: 0 Copy Tuple Flags: ( 1 1 1 1 1 0 1 1 ) Interpolate Flags: ( 1 1 1 1 1 0 0 1 ) Pass Through Flags: ( 1 1 1 1 1 1 1 1 ) Scalars: (none) Vectors: (none) Normals: (none) TCoords: (none) Tensors: (none) GlobalIds: (none) PedigreeIds: (none) EdgeFlag: (none) Point Data: Debug: Off Modified Time: 47817 Reference Count: 1 Registered Events: Registered Observers: vtkObserver (0B311588) Event: 33 EventName: ModifiedEvent Command: 0B48C7D0 Priority: 0 Tag: 1 Number Of Arrays: 0 Number Of Components: 0 Number Of Tuples: 0 Copy Tuple Flags: ( 1 1 1 1 1 0 1 1 ) Interpolate Flags: ( 1 1 1 1 1 0 0 1 ) Pass Through Flags: ( 1 1 1 1 1 1 1 1 ) Scalars: (none) Vectors: (none) Normals: (none) TCoords: (none) Tensors: (none) GlobalIds: (none) PedigreeIds: (none) EdgeFlag: (none) Bounds: Xmin,Xmax: (1, -1) Ymin,Ymax: (1, -1) Zmin,Zmax: (1, -1) Compute Time: 48516 Number Of Points: 0 Point Coordinates: 00000000 Locator: 00000000 Number Of Vertices: 0 Number Of Lines: 0 Number Of Polygons: 0 Number Of Triangle Strips: 0 Number Of Pieces: 1 Piece: 0 Ghost Level: 0 -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From minpu.code at gmail.com Mon May 14 03:59:42 2018 From: minpu.code at gmail.com (pnt1614) Date: Mon, 14 May 2018 00:59:42 -0700 (MST) Subject: [vtkusers] How to generate a surface from u-shape points? In-Reply-To: <1525397649894-0.post@n5.nabble.com> References: <1525397649894-0.post@n5.nabble.com> Message-ID: <1526284782283-0.post@n5.nabble.com> I use vtkContourLoopExtraction to generate a surface from a set of points and triangulate this surface. However, the result is in low quality. How to triangulate a surface to make a high-quality result like the following image? A low-quality surface A high-quality surface -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From tossin at gmail.com Mon May 14 19:54:02 2018 From: tossin at gmail.com (Evan Kao) Date: Mon, 14 May 2018 16:54:02 -0700 Subject: [vtkusers] Large performance difference between vtkResampleWithDataSet in VTK 8.1.0 and Resample with Dataset filter in Paraview 5.5 Message-ID: Hello all, I am trying to resample a structured grid data (~1.4M points, 1.3M cells) with an unstructured grid (~320K points, 480K cells). In Paraview 5.5, this resampling is nearly instant with the Resample With Dataset filter. Yet in a Python script using vtkResampleWithDataSet from VTK 8.1.0, the same operation takes about 15 minutes (>2 orders of magnitude difference in speed). As far as I can tell from the VTK repository on Gitlab, the only difference between the Paraview/release version and the 8.1.0 or 8.1.1 tagged releases is a switch in the cell locator. Is this enough to explain the difference in the performance? If not, could someone enlighten me as to what the possible factors are here? Also, if it matters, this is all on a Windows 7 64-bit machine. Paraview is installed from binaries, while VTK was downloaded from an Anaconda distribution compiled by a third party. Thanks for your time, Evan Kao -------------- next part -------------- An HTML attachment was scrubbed... URL: From iamdpak at gmail.com Mon May 14 21:54:42 2018 From: iamdpak at gmail.com (vinmean) Date: Mon, 14 May 2018 18:54:42 -0700 (MST) Subject: [vtkusers] how to make vtkOBJExporter save the texture filename inside the .mtl file? Message-ID: <1526349282986-0.post@n5.nabble.com> Hi, I am trying to export actors of a render window into an obj file. I am able to save the .obj file and .mtl file but the texture file name is not written inside the .mtl file. How do I enable the exporter to write the texture filename? When I import the saved obj file, I am unable to see the texture. vtkNew exporter; exporter->SetFilePrefix(flnam.c_str()); exporter->SetRenderWindow(renderWindow); exporter->Write(); Thank You, Vinmean -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From lasso at queensu.ca Mon May 14 23:11:35 2018 From: lasso at queensu.ca (Andras Lasso) Date: Tue, 15 May 2018 03:11:35 +0000 Subject: [vtkusers] how to make vtkOBJExporter save the texture filename inside the .mtl file? In-Reply-To: <1526349282986-0.post@n5.nabble.com> References: <1526349282986-0.post@n5.nabble.com> Message-ID: > the texture file name is not written inside the .mtl file This feature has yet to be implemented in vtkOBJExporter, but it is already available in vtkOBJWriter (https://www.vtk.org/doc/nightly/html/classvtkOBJWriter.html). Andras -----Original Message----- From: vtkusers On Behalf Of vinmean Sent: Monday, May 14, 2018 9:55 PM To: vtkusers at vtk.org Subject: [vtkusers] how to make vtkOBJExporter save the texture filename inside the .mtl file? Hi, I am trying to export actors of a render window into an obj file. I am able to save the .obj file and .mtl file but the texture file name is not written inside the .mtl file. How do I enable the exporter to write the texture filename? When I import the saved obj file, I am unable to see the texture. vtkNew exporter; exporter->SetFilePrefix(flnam.c_str()); exporter->SetRenderWindow(renderWindow); exporter->Write(); Thank You, Vinmean -- 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%7C414fe44cc5544283f65f08d5ba06d561%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636619460893228512&sdata=MPdmvYmi1UMD3oqNz5flMpwrcHfoaXqDeL2RVdd0PUA%3D&reserved=0 _______________________________________________ Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7C414fe44cc5544283f65f08d5ba06d561%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636619460893228512&sdata=uqqPHqnL%2FistyvkRAuVYXn3nzK3z%2BRFfSicvI%2BH2NcQ%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%7C414fe44cc5544283f65f08d5ba06d561%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636619460893228512&sdata=Vdvmo%2B1Szs5HQLH4kR1ZZR1gVjHrOXnUmqdbEb3MeZI%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%7C414fe44cc5544283f65f08d5ba06d561%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636619460893228512&sdata=1YJ7ngMybtdcIb5gFxMqCBJYLBBwSFtFq0AxeGnm0dM%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%7C414fe44cc5544283f65f08d5ba06d561%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636619460893228512&sdata=3xFSCdlmtf9ldEWpi7OjvMxU6tpRCqra6KOW22MVUZU%3D&reserved=0 Follow this link to subscribe/unsubscribe: https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk.org%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%7C414fe44cc5544283f65f08d5ba06d561%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636619460893228512&sdata=t1%2Fx2%2BRToxqJ1QrzRaVadjaqIWVEDxAyz0PuHaZd8mA%3D&reserved=0 From ronald at mulderrienks.nl Tue May 15 02:52:29 2018 From: ronald at mulderrienks.nl (Ronald) Date: Mon, 14 May 2018 23:52:29 -0700 (MST) Subject: [vtkusers] Activiz 7.1.1 Binary Build In-Reply-To: <1515427184405-0.post@n5.nabble.com> References: <1515427184405-0.post@n5.nabble.com> Message-ID: <1526367149785-0.post@n5.nabble.com> Hi Temi, I got the exact same error message. My experience was that the binaries worked great on my development machine but not on a test machine. I managed to get things working by adding the following DLL's from my development machine to the test machine: msvcp120d.dll msvcp120_clr0400.dll msvcr120d.dll I found these in my C:\Windows\SysWow64 folder. If you don't have those and can't find them elsewhere contact me? Hope this helps. Regards, Ronald -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From nztoddler at yahoo.com Tue May 15 03:48:06 2018 From: nztoddler at yahoo.com (Todd) Date: Tue, 15 May 2018 19:48:06 +1200 Subject: [vtkusers] Activiz 7.1.1 Binary Build In-Reply-To: <1526367149785-0.post@n5.nabble.com> Message-ID: <60e65077-55f1-4a50-93c8-6f027336c6b6@email.android.com> An HTML attachment was scrubbed... URL: From rccm.kyoshimi at gmail.com Tue May 15 04:13:24 2018 From: rccm.kyoshimi at gmail.com (kenichiro yoshimi) Date: Tue, 15 May 2018 17:13:24 +0900 Subject: [vtkusers] Time Interpolation In-Reply-To: References: Message-ID: Hello Andrew, I found a dirty way using vtkTemporalInterpolator and vtkExtractTimeSteps as follows, and you can set an arbitrary time value to "specifiedTime" within the code: ---- #!/usr/bin/env python import os import vtk import numpy as np specifiedTime = 0.18 # Input file and variable filename = os.path.abspath('mug.e') nodal_var = 'convected' # Read Exodus Data reader = vtk.vtkExodusIIReader() reader.SetFileName(filename) reader.UpdateInformation() reader.SetTimeStep(10) reader.SetAllArrayStatus(vtk.vtkExodusIIReader.NODAL, 1) #reader.Update(); print reader info = reader.GetExecutive().GetOutputInformation().GetInformationObject(0) key = vtk.vtkStreamingDemandDrivenPipeline.TIME_STEPS() times = np.array([info.Get(key,i) for i in range(info.Length(key))]) index = np.max(np.where(times <= specifiedTime)) extractTime = vtk.vtkExtractTimeSteps() extractTime.SetInputConnection(0, reader.GetOutputPort(0)) extractTime.SetTimeStepIndices(2, [index, index+1]) # Time interpolation (How do I set this up?) time = vtk.vtkTemporalInterpolator() time.SetInputConnection(0, extractTime.GetOutputPort(0)) time.SetDiscreteTimeStepInterval(specifiedTime - times[index]) time.UpdateTimeStep(specifiedTime) extractTime2 = vtk.vtkExtractTimeSteps() extractTime2.SetInputConnection(0, time.GetOutputPort(0)) extractTime2.AddTimeStepIndex(1) # Create Geometry geometry = vtk.vtkCompositeDataGeometryFilter() geometry.SetInputConnection(0, extractTime2.GetOutputPort(0)) geometry.Update() writer = vtk.vtkExodusIIWriter() writer.SetInputConnection(0, geometry.GetOutputPort()) writer.SetFileName('time.e') writer.WriteAllTimeStepsOn() writer.Write() # Mapper mapper = vtk.vtkPolyDataMapper() mapper.SetInputConnection(geometry.GetOutputPort()) mapper.SelectColorArray(nodal_var) mapper.SetScalarModeToUsePointFieldData() mapper.InterpolateScalarsBeforeMappingOn() # Actor actor = vtk.vtkActor() actor.SetMapper(mapper) # Renderer renderer = vtk.vtkRenderer() renderer.AddViewProp(actor) # Window and Interactor window = vtk.vtkRenderWindow() window.AddRenderer(renderer) window.SetSize(600, 600) interactor = vtk.vtkRenderWindowInteractor() interactor.SetRenderWindow(window) interactor.Initialize() # Show the result window.Render() interactor.Start() ---- Best 2018-05-11 2:06 GMT+09:00 Slaughter, Andrew E : > I was hoping someone could help me setup interpolation for ExodusII data. > The attached python scripts (I am using MacOS; python2.7; vtk7.1) reads the > ExodusII file (mug.e). I would like to be able to set an arbitrary time > value and have VTK perform the interpolation, would someone please help me > get this working? I have two versions I am working on, one using > vtkTemporalInterpolator and the other with vtkInterpolateDataSetAttributes. > I am happy using either class, I just need it to work. > > I am aware that some of these features are built into Paraview, but my > project requires me to make this work with pure VTK. > > Thanks, > > Andrew > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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: > https://vtk.org/mailman/listinfo/vtkusers > From shawn.waldon at kitware.com Tue May 15 09:52:47 2018 From: shawn.waldon at kitware.com (Shawn Waldon) Date: Tue, 15 May 2018 09:52:47 -0400 Subject: [vtkusers] Large performance difference between vtkResampleWithDataSet in VTK 8.1.0 and Resample with Dataset filter in Paraview 5.5 In-Reply-To: References: Message-ID: Hi Evan, I suspect the differece is that the ParaView binaries were compiled with TBB multithreading support and the Anaconda VTK was not. vtkResampleWithDataSet is set up to use TBB multithreading if available. Check the utilization of the cores on your computer when running each and you will see ParaView using all available cores and Anaconda's VTK probably only using one. It is also possible the cell locator change improved things further but I'm not familiar with that. HTH, Shawn On Mon, May 14, 2018 at 7:54 PM, Evan Kao wrote: > Hello all, > > I am trying to resample a structured grid data (~1.4M points, 1.3M cells) > with an unstructured grid (~320K points, 480K cells). In Paraview 5.5, > this resampling is nearly instant with the Resample With Dataset filter. > Yet in a Python script using vtkResampleWithDataSet from VTK 8.1.0, the > same operation takes about 15 minutes (>2 orders of magnitude difference in > speed). As far as I can tell from the VTK repository on Gitlab, the only > difference between the Paraview/release version and the 8.1.0 or 8.1.1 > tagged releases is a switch in the cell locator. Is this enough to explain > the difference in the performance? If not, could someone enlighten me as > to what the possible factors are here? > > Also, if it matters, this is all on a Windows 7 64-bit machine. Paraview > is installed from binaries, while VTK was downloaded from an Anaconda > distribution compiled by a third party. > > Thanks for your time, > Evan Kao > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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: > https://vtk.org/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.slaughter at inl.gov Tue May 15 10:37:24 2018 From: andrew.slaughter at inl.gov (Slaughter, Andrew E) Date: Tue, 15 May 2018 08:37:24 -0600 Subject: [vtkusers] Time Interpolation In-Reply-To: References: Message-ID: This is great, thanks for taking time to get this working. I have one question, what is the purpose of the second vtkExtractTimeSteps? On Tue, May 15, 2018 at 2:13 AM, kenichiro yoshimi wrote: > Hello Andrew, > > I found a dirty way using vtkTemporalInterpolator and > vtkExtractTimeSteps as follows, and you can set an arbitrary time > value to "specifiedTime" within the code: > > ---- > #!/usr/bin/env python > import os > import vtk > import numpy as np > > specifiedTime = 0.18 > > # Input file and variable > filename = os.path.abspath('mug.e') > nodal_var = 'convected' > > # Read Exodus Data > reader = vtk.vtkExodusIIReader() > reader.SetFileName(filename) > reader.UpdateInformation() > reader.SetTimeStep(10) > reader.SetAllArrayStatus(vtk.vtkExodusIIReader.NODAL, 1) > #reader.Update(); print reader > > info = reader.GetExecutive().GetOutputInformation(). > GetInformationObject(0) > key = vtk.vtkStreamingDemandDrivenPipeline.TIME_STEPS() > times = np.array([info.Get(key,i) for i in range(info.Length(key))]) > index = np.max(np.where(times <= specifiedTime)) > > extractTime = vtk.vtkExtractTimeSteps() > extractTime.SetInputConnection(0, reader.GetOutputPort(0)) > extractTime.SetTimeStepIndices(2, [index, index+1]) > > # Time interpolation (How do I set this up?) > time = vtk.vtkTemporalInterpolator() > time.SetInputConnection(0, extractTime.GetOutputPort(0)) > time.SetDiscreteTimeStepInterval(specifiedTime - times[index]) > time.UpdateTimeStep(specifiedTime) > > extractTime2 = vtk.vtkExtractTimeSteps() > extractTime2.SetInputConnection(0, time.GetOutputPort(0)) > extractTime2.AddTimeStepIndex(1) > > # Create Geometry > geometry = vtk.vtkCompositeDataGeometryFilter() > geometry.SetInputConnection(0, extractTime2.GetOutputPort(0)) > geometry.Update() > > writer = vtk.vtkExodusIIWriter() > writer.SetInputConnection(0, geometry.GetOutputPort()) > writer.SetFileName('time.e') > writer.WriteAllTimeStepsOn() > writer.Write() > > # Mapper > mapper = vtk.vtkPolyDataMapper() > mapper.SetInputConnection(geometry.GetOutputPort()) > mapper.SelectColorArray(nodal_var) > mapper.SetScalarModeToUsePointFieldData() > mapper.InterpolateScalarsBeforeMappingOn() > > # Actor > actor = vtk.vtkActor() > actor.SetMapper(mapper) > > # Renderer > renderer = vtk.vtkRenderer() > renderer.AddViewProp(actor) > > # Window and Interactor > window = vtk.vtkRenderWindow() > window.AddRenderer(renderer) > window.SetSize(600, 600) > > interactor = vtk.vtkRenderWindowInteractor() > interactor.SetRenderWindow(window) > interactor.Initialize() > > # Show the result > window.Render() > interactor.Start() > ---- > > Best > > 2018-05-11 2:06 GMT+09:00 Slaughter, Andrew E : > > I was hoping someone could help me setup interpolation for ExodusII data. > > The attached python scripts (I am using MacOS; python2.7; vtk7.1) reads > the > > ExodusII file (mug.e). I would like to be able to set an arbitrary time > > value and have VTK perform the interpolation, would someone please help > me > > get this working? I have two versions I am working on, one using > > vtkTemporalInterpolator and the other with vtkInterpolateDataSetAttribute > s. > > I am happy using either class, I just need it to work. > > > > I am aware that some of these features are built into Paraview, but my > > project requires me to make this work with pure VTK. > > > > Thanks, > > > > Andrew > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > https://urldefense.proofpoint.com/v2/url?u=http-3A__www. > kitware.com_opensource_opensource.html&d=DwIBaQ&c= > 54IZrppPQZKX9mLzcGdPfFD1hxrcB__aEkJFOKJFd00&r=h7heP8xwI1i_ > HikChvhFbEBurKirgfOCdwgBxB9lM8c&m=puHckBK1HPjYo6fLuDnW7Rsr9yj_ > a2niN1Z4KRui5BM&s=E7mpGidBh-HqQHk8zv6FqPKcN2BAfHg5FyshFS96aAM&e= > > > > Please keep messages on-topic and check the VTK FAQ at: > > https://urldefense.proofpoint.com/v2/url?u=http-3A__www.vtk. > org_Wiki_VTK-5FFAQ&d=DwIBaQ&c=54IZrppPQZKX9mLzcGdPfFD1hxrcB_ > _aEkJFOKJFd00&r=h7heP8xwI1i_HikChvhFbEBurKirgfOCdwgBxB9lM8c&m= > puHckBK1HPjYo6fLuDnW7Rsr9yj_a2niN1Z4KRui5BM&s=__QxFPfkRQHlaX87BPaTQqC3- > xiuwKePex8T9KtAD8Q&e= > > > > Search the list archives at: https://urldefense.proofpoint. > com/v2/url?u=http-3A__markmail.org_search_-3Fq-3Dvtkusers&d=DwIBaQ&c= > 54IZrppPQZKX9mLzcGdPfFD1hxrcB__aEkJFOKJFd00&r=h7heP8xwI1i_ > HikChvhFbEBurKirgfOCdwgBxB9lM8c&m=puHckBK1HPjYo6fLuDnW7Rsr9yj_ > a2niN1Z4KRui5BM&s=CNEA4K6JVEFn6AGYM0fYeW0rg6ENnWlIx_cTPpb7zHM&e= > > > > Follow this link to subscribe/unsubscribe: > > https://urldefense.proofpoint.com/v2/url?u=https-3A__vtk. > org_mailman_listinfo_vtkusers&d=DwIBaQ&c=54IZrppPQZKX9mLzcGdPfFD1hxrcB_ > _aEkJFOKJFd00&r=h7heP8xwI1i_HikChvhFbEBurKirgfOCdwgBxB9lM8c&m= > puHckBK1HPjYo6fLuDnW7Rsr9yj_a2niN1Z4KRui5BM&s= > DJXa7N2JNLCUAVjyuFKhbN5PDsErajyMP1cjw0MJQyg&e= > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sujin.philip at kitware.com Tue May 15 10:38:34 2018 From: sujin.philip at kitware.com (Sujin Philip) Date: Tue, 15 May 2018 10:38:34 -0400 Subject: [vtkusers] Large performance difference between vtkResampleWithDataSet in VTK 8.1.0 and Resample with Dataset filter in Paraview 5.5 In-Reply-To: References: Message-ID: Hi Evan, As Shawn mentioned it could be due to lack of multi-threading. Could you provide us the configuration of the system you are using? Like the number of cores/threads and the CPU frequency? Also please share the actual time that ParaView and VTK are taking. Is it possible for you to try out a slightly older VTK version and see if the performance difference is still there? Which dataset are you setting as input and which as source? The names are unfortunately opposite between VTK-m and ParaView due to legacy reasons. Probing with the unstructured grid as the source is much slower than probing with the structured grid as the source. So please confirm that the VTK pipeline is set up properly. Please let me know if none these seem to be the cause of your problem and I will dig deeper. Thanks Sujin On Tue, May 15, 2018 at 9:52 AM, Shawn Waldon wrote: > Hi Evan, > > I suspect the differece is that the ParaView binaries were compiled with > TBB multithreading support and the Anaconda VTK was not. > vtkResampleWithDataSet is set up to use TBB multithreading if available. > Check the utilization of the cores on your computer when running each and > you will see ParaView using all available cores and Anaconda's VTK probably > only using one. It is also possible the cell locator change improved > things further but I'm not familiar with that. > > HTH, > > Shawn > > On Mon, May 14, 2018 at 7:54 PM, Evan Kao wrote: > >> Hello all, >> >> I am trying to resample a structured grid data (~1.4M points, 1.3M cells) >> with an unstructured grid (~320K points, 480K cells). In Paraview 5.5, >> this resampling is nearly instant with the Resample With Dataset filter. >> Yet in a Python script using vtkResampleWithDataSet from VTK 8.1.0, the >> same operation takes about 15 minutes (>2 orders of magnitude difference in >> speed). As far as I can tell from the VTK repository on Gitlab, the only >> difference between the Paraview/release version and the 8.1.0 or 8.1.1 >> tagged releases is a switch in the cell locator. Is this enough to explain >> the difference in the performance? If not, could someone enlighten me as >> to what the possible factors are here? >> >> Also, if it matters, this is all on a Windows 7 64-bit machine. Paraview >> is installed from binaries, while VTK was downloaded from an Anaconda >> distribution compiled by a third party. >> >> Thanks for your time, >> Evan Kao >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://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: >> https://vtk.org/mailman/listinfo/vtkusers >> >> > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://vtk.org/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.ostroot at lickenbrocktech.com Tue May 15 11:42:14 2018 From: mark.ostroot at lickenbrocktech.com (mark.ostroot at lickenbrocktech.com) Date: Tue, 15 May 2018 08:42:14 -0700 Subject: [vtkusers] vtksmartvolumemapper issues Message-ID: <20180515084214.c7db654a879d86b78cfcacc46040d57b.137283e700.mailapi@email09.godaddy.com> Hello all, I am updating some old vtk 6.3 code to vtk 8.1, Currently the older code uses vtksmartvolumemapper, I am running into a run time error with a new smart pointer. my code: #include .. .. .. vtkSmartPointer vMapper = vtkSmartPointer::New(); < = this breaks with unhandled exception at (vtkRenderingVolume-8.1.dll) Access violation reading location 0x0000000000000000 The code compiles, but I hit this run time exception on execution. I don't believe the smartvolumemapper has been deprecated, does anyone have any idea of what I am doing wrong? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aur.marsan at gmail.com Tue May 15 11:51:53 2018 From: aur.marsan at gmail.com (=?UTF-8?Q?Aur=C3=A9lien_Marsan?=) Date: Tue, 15 May 2018 11:51:53 -0400 Subject: [vtkusers] Python Threading and VTK rendering Message-ID: Dear vtk-users, I am using Python-Qt-VTK in order to develop a graphical interface. At some point, I need to animate the view. I use the vtkActor.RotateZ function. Everything works well, until I delegate the animation to a Threading.Thread. The actors is well rotated, but I can't update the Renderer automatically. The window is only update when I use the mouse and click on it. Any tips for this ? Bests, - Aur?lien - -------------- next part -------------- An HTML attachment was scrubbed... URL: From mario at emmenlauer.de Tue May 15 11:52:44 2018 From: mario at emmenlauer.de (Mario Emmenlauer) Date: Tue, 15 May 2018 17:52:44 +0200 Subject: [vtkusers] any libraries for out-of-core volume handling? In-Reply-To: References: Message-ID: Does anybody know if out-of-core volume handling is supported in VTK, or if support is planned? On 03.05.2018 13:12, Mario Emmenlauer wrote: > > Dear all, > > is there out-of-core volume handling in VTK? To be more precise, > has VTK file-backed volumes that can be used for visualization and > processing? Ideally I'm looking for a full abstraction of the file- > backed storage, to process and visualize volumes of TB size in C++. > > The best I could find is vigra, that has a chunked MultiArray with > HDF5 buffered storage. Does anyone know of other implementations? All the best, Mario Emmenlauer -- BioDataAnalysis GmbH, Mario Emmenlauer Tel. Buero: +49-89-74677203 Balanstr. 43 mailto: memmenlauer * biodataanalysis.de D-81669 M?nchen http://www.biodataanalysis.de/ From aur.marsan at gmail.com Tue May 15 11:56:07 2018 From: aur.marsan at gmail.com (=?UTF-8?Q?Aur=C3=A9lien_Marsan?=) Date: Tue, 15 May 2018 11:56:07 -0400 Subject: [vtkusers] Python Threading and VTK rendering In-Reply-To: References: Message-ID: I found the following thread which is dealing with the same topic. http://vtk.1045678.n5.nabble.com/animation-while-renderer-responsive-td5747316.html 2018-05-15 11:51 GMT-04:00 Aur?lien Marsan : > Dear vtk-users, > > I am using Python-Qt-VTK in order to develop a graphical interface. > > At some point, I need to animate the view. I use the vtkActor.RotateZ > function. > > Everything works well, until I delegate the animation to a > Threading.Thread. > The actors is well rotated, but I can't update the Renderer automatically. > The window is only update when I use the mouse and click on it. > > Any tips for this ? > > Bests, > > - Aur?lien - > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aur.marsan at gmail.com Tue May 15 11:58:28 2018 From: aur.marsan at gmail.com (=?UTF-8?Q?Aur=C3=A9lien_Marsan?=) Date: Tue, 15 May 2018 11:58:28 -0400 Subject: [vtkusers] VTK integration in PyQt (wrong layout) In-Reply-To: <1525872377681-0.post@n5.nabble.com> References: <1525861039535-0.post@n5.nabble.com> <1525872377681-0.post@n5.nabble.com> Message-ID: Hi, There is a fantastic tutorial on this topic. See: https://github.com/diego0020/tutorial-vtk-pyqt Bests. Aur?lien 2018-05-09 9:26 GMT-04:00 mafiaskafia : > Hey, > > Yes of course! > Here is a screenshot of what i'm seeing: > > > > And this is what i want: > > > > Cheers > > > > > > > > -- > 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: > https://vtk.org/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aur.marsan at gmail.com Tue May 15 12:06:24 2018 From: aur.marsan at gmail.com (=?UTF-8?Q?Aur=C3=A9lien_Marsan?=) Date: Tue, 15 May 2018 12:06:24 -0400 Subject: [vtkusers] VTK integration in PyQt (wrong layout) In-Reply-To: <1525872377681-0.post@n5.nabble.com> References: <1525861039535-0.post@n5.nabble.com> <1525872377681-0.post@n5.nabble.com> Message-ID: Hi, There is a fantastic tutorial on this topic. See: https://github.com/diego0020/tutorial-vtk-pyqt Bests. 2018-05-09 9:26 GMT-04:00 mafiaskafia : > Hey, > > Yes of course! > Here is a screenshot of what i'm seeing: > > > > And this is what i want: > > > > Cheers > > > > > > > > -- > 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: > https://vtk.org/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From maguire7 at llnl.gov Tue May 15 12:24:21 2018 From: maguire7 at llnl.gov (Maguire, Alister Owen) Date: Tue, 15 May 2018 16:24:21 +0000 Subject: [vtkusers] vtksmartvolumemapper issues In-Reply-To: <20180515084214.c7db654a879d86b78cfcacc46040d57b.137283e700.mailapi@email09.godaddy.com> References: <20180515084214.c7db654a879d86b78cfcacc46040d57b.137283e700.mailapi@email09.godaddy.com> Message-ID: <2AD840EC-594A-43A5-8A89-9D27A9E846D0@llnl.gov> Are you including the following two lines in your .C file? #include VTK_MODULE_INIT(vtkRenderingVolumeOpenGL2); I?m not sure if this is the root of your issue, but I had run into problems while working with vtkSmartVolumeMapper a while back, and I ended up discovering that these two lines were needed for it to be used properly. You can find more info about it here https://www.vtk.org/Wiki/VTK/VTK_6_Migration/Factories_now_require_defines Best, Alister From: vtkusers on behalf of "mark.ostroot at lickenbrocktech.com" Date: Tuesday, May 15, 2018 at 8:43 AM To: "vtkusers at vtk.org" Subject: [vtkusers] vtksmartvolumemapper issues Hello all, I am updating some old vtk 6.3 code to vtk 8.1, Currently the older code uses vtksmartvolumemapper, I am running into a run time error with a new smart pointer. my code: #include .. .. .. vtkSmartPointer vMapper = vtkSmartPointer::New(); < = this breaks with unhandled exception at (vtkRenderingVolume-8.1.dll) Access violation reading location 0x0000000000000000 The code compiles, but I hit this run time exception on execution. I don't believe the smartvolumemapper has been deprecated, does anyone have any idea of what I am doing wrong? -------------- next part -------------- An HTML attachment was scrubbed... URL: From tossin at gmail.com Tue May 15 13:05:01 2018 From: tossin at gmail.com (Evan Kao) Date: Tue, 15 May 2018 10:05:01 -0700 Subject: [vtkusers] Large performance difference between vtkResampleWithDataSet in VTK 8.1.0 and Resample with Dataset filter in Paraview 5.5 In-Reply-To: References: Message-ID: Hi Shawn and Sujin, Thanks for the quick responses. The CPU on the computer I'm using is an i7-6700 with 4 cores, 8 threads, and 3.4 GHz frequency. Multi-threading may be a factor, but it's hard to tell because resampling in ParaView is so quick. ParaView is capable of using 100% of the CPU, while VTK (in Python) will max out at 12-13%. However, for these particular datasets, resampling doesn't appear to stress ParaView that much (11-16% when observing the Windows Task Manager, and some of that may be because of the rendering). However, I was under the impression that at best multi-threading could only reduce the time it takes by N threads (ie 8x), while the speed difference here is almost 1000x. I measured the times for ParaView 5.5, VTK 8.1 (compiled elsewhere), and VTK 7.1 (compiled by our group): 1. ParaView 5.5 - 1.1s, using a stopwatch, multiple trials. Timing started the moment I clicked "Apply". 2. VTK 8.1 - 922.47s, timed using Python's timeit module, measuring only the vtkResampleWithDataSet.Update() method. 3. VTK 7.1 - 950.47s, timed the same way as above. I'm aware of the difference in labeling between VTK and ParaView for Source and Input (which confuses me all the time). I can verify the correct data sets were assigned by saving the output (which should an unstructured grid) and viewing it in ParaView - it looks identical to the resampled data generated in ParaView (although it overwrites the point scalars array and adds some ghost information that needs to be removed). Thanks, Evan On Tue, May 15, 2018 at 7:38 AM, Sujin Philip wrote: > Hi Evan, > > As Shawn mentioned it could be due to lack of multi-threading. Could you > provide us the configuration of the system you are using? Like the number > of cores/threads and the CPU frequency? Also please share the actual time > that ParaView and VTK are taking. Is it possible for you to try out a > slightly older VTK version and see if the performance difference is still > there? > > Which dataset are you setting as input and which as source? The names are > unfortunately opposite between VTK-m and ParaView due to legacy reasons. > Probing with the unstructured grid as the source is much slower than > probing with the structured grid as the source. So please confirm that the > VTK pipeline is set up properly. > > Please let me know if none these seem to be the cause of your problem and > I will dig deeper. > > Thanks > Sujin > > > > On Tue, May 15, 2018 at 9:52 AM, Shawn Waldon > wrote: > >> Hi Evan, >> >> I suspect the differece is that the ParaView binaries were compiled with >> TBB multithreading support and the Anaconda VTK was not. >> vtkResampleWithDataSet is set up to use TBB multithreading if available. >> Check the utilization of the cores on your computer when running each and >> you will see ParaView using all available cores and Anaconda's VTK probably >> only using one. It is also possible the cell locator change improved >> things further but I'm not familiar with that. >> >> HTH, >> >> Shawn >> >> On Mon, May 14, 2018 at 7:54 PM, Evan Kao wrote: >> >>> Hello all, >>> >>> I am trying to resample a structured grid data (~1.4M points, 1.3M >>> cells) with an unstructured grid (~320K points, 480K cells). In Paraview >>> 5.5, this resampling is nearly instant with the Resample With Dataset >>> filter. Yet in a Python script using vtkResampleWithDataSet from VTK >>> 8.1.0, the same operation takes about 15 minutes (>2 orders of magnitude >>> difference in speed). As far as I can tell from the VTK repository on >>> Gitlab, the only difference between the Paraview/release version and the >>> 8.1.0 or 8.1.1 tagged releases is a switch in the cell locator. Is this >>> enough to explain the difference in the performance? If not, could someone >>> enlighten me as to what the possible factors are here? >>> >>> Also, if it matters, this is all on a Windows 7 64-bit machine. >>> Paraview is installed from binaries, while VTK was downloaded from an >>> Anaconda distribution compiled by a third party. >>> >>> Thanks for your time, >>> Evan Kao >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://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: >>> https://vtk.org/mailman/listinfo/vtkusers >>> >>> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> https://vtk.org/mailman/listinfo/vtkusers >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.ostroot at lickenbrocktech.com Tue May 15 13:07:52 2018 From: mark.ostroot at lickenbrocktech.com (mark.ostroot at lickenbrocktech.com) Date: Tue, 15 May 2018 10:07:52 -0700 Subject: [vtkusers] vtksmartvolumemapper issues In-Reply-To: <2AD840EC-594A-43A5-8A89-9D27A9E846D0@llnl.gov> Message-ID: <20180515100752.c7db654a879d86b78cfcacc46040d57b.abe68c2fdf.mailapi@email09.godaddy.com> Alister, Thanks for your help I managed to get the code working now It was a missing autoinit line. I ended up needing to add #define vtkRenderingVolume_AUTOINIT 1(vtkRenderingVolumeOpenGL2) at the top of my code -Thanks, Mark --------- Original Message --------- Subject: Re: [vtkusers] vtksmartvolumemapper issues From: "Maguire, Alister Owen" Date: 5/15/18 9:24 am To: "mark.ostroot at lickenbrocktech.com" , "vtkusers at vtk.org" Are you including the following two lines in your .C file? #include VTK_MODULE_INIT(vtkRenderingVolumeOpenGL2); I'm not sure if this is the root of your issue, but I had run into problems while working with vtkSmartVolumeMapper a while back, and I ended up discovering that these two lines were needed for it to be used properly. You can find more info about it here https://www.vtk.org/Wiki/VTK/VTK_6_Migration/Factories_now_require_defines Best, Alister From: vtkusers on behalf of "mark.ostroot at lickenbrocktech.com" Date: Tuesday, May 15, 2018 at 8:43 AM To: "vtkusers at vtk.org" Subject: [vtkusers] vtksmartvolumemapper issues Hello all, I am updating some old vtk 6.3 code to vtk 8.1, Currently the older code uses vtksmartvolumemapper, I am running into a run time error with a new smart pointer. my code: #include .. .. .. vtkSmartPointer vMapper = vtkSmartPointer::New(); < = this breaks with unhandled exception at (vtkRenderingVolume-8.1.dll) Access violation reading location 0x0000000000000000 The code compiles, but I hit this run time exception on execution. I don't believe the smartvolumemapper has been deprecated, does anyone have any idea of what I am doing wrong? -------------- next part -------------- An HTML attachment was scrubbed... URL: From sujin.philip at kitware.com Tue May 15 15:32:23 2018 From: sujin.philip at kitware.com (Sujin Philip) Date: Tue, 15 May 2018 15:32:23 -0400 Subject: [vtkusers] Large performance difference between vtkResampleWithDataSet in VTK 8.1.0 and Resample with Dataset filter in Paraview 5.5 In-Reply-To: References: Message-ID: Hi Evan, I tried testing this on my end and I am seeing expected performance from VTK and ParaView. But the performance is dependent on the datasets used. Is it possible for you to share your datasets and scripts with us? Could you try this with smaller versions of your datasets and see if you are able to reproduce this? I am not familiar with the timeit module in Python. From the documentation it looks like it runs the code multiple times by default and prints the total time. Can you confirm if you have taken this into consideration in your script? A simple way to time operations in ParaView is to refer to the "Timer Log" under the "Tools" menu. You should see a line like: Execute vtkResampleWithDataSet id: 6788, 2.70556 seconds Thanks Sujin On Tue, May 15, 2018 at 1:05 PM, Evan Kao wrote: > Hi Shawn and Sujin, > > Thanks for the quick responses. The CPU on the computer I'm using is an > i7-6700 > > with 4 cores, 8 threads, and 3.4 GHz frequency. > > Multi-threading may be a factor, but it's hard to tell because resampling > in ParaView is so quick. ParaView is capable of using 100% of the CPU, > while VTK (in Python) will max out at 12-13%. However, for these > particular datasets, resampling doesn't appear to stress ParaView that much > (11-16% when observing the Windows Task Manager, and some of that may be > because of the rendering). However, I was under the impression that at > best multi-threading could only reduce the time it takes by N threads (ie > 8x), while the speed difference here is almost 1000x. I measured the times > for ParaView 5.5, VTK 8.1 (compiled elsewhere), and VTK 7.1 (compiled by > our group): > > 1. ParaView 5.5 - 1.1s, using a stopwatch, multiple trials. Timing > started the moment I clicked "Apply". > 2. VTK 8.1 - 922.47s, timed using Python's timeit module, measuring > only the vtkResampleWithDataSet.Update() method. > 3. VTK 7.1 - 950.47s, timed the same way as above. > > I'm aware of the difference in labeling between VTK and ParaView for > Source and Input (which confuses me all the time). I can verify the > correct data sets were assigned by saving the output (which should an > unstructured grid) and viewing it in ParaView - it looks identical to the > resampled data generated in ParaView (although it overwrites the point > scalars array and adds some ghost information that needs to be removed). > > Thanks, > Evan > > On Tue, May 15, 2018 at 7:38 AM, Sujin Philip > wrote: > >> Hi Evan, >> >> As Shawn mentioned it could be due to lack of multi-threading. Could you >> provide us the configuration of the system you are using? Like the number >> of cores/threads and the CPU frequency? Also please share the actual time >> that ParaView and VTK are taking. Is it possible for you to try out a >> slightly older VTK version and see if the performance difference is still >> there? >> >> Which dataset are you setting as input and which as source? The names are >> unfortunately opposite between VTK-m and ParaView due to legacy reasons. >> Probing with the unstructured grid as the source is much slower than >> probing with the structured grid as the source. So please confirm that the >> VTK pipeline is set up properly. >> >> Please let me know if none these seem to be the cause of your problem and >> I will dig deeper. >> >> Thanks >> Sujin >> >> >> >> On Tue, May 15, 2018 at 9:52 AM, Shawn Waldon >> wrote: >> >>> Hi Evan, >>> >>> I suspect the differece is that the ParaView binaries were compiled with >>> TBB multithreading support and the Anaconda VTK was not. >>> vtkResampleWithDataSet is set up to use TBB multithreading if available. >>> Check the utilization of the cores on your computer when running each and >>> you will see ParaView using all available cores and Anaconda's VTK probably >>> only using one. It is also possible the cell locator change improved >>> things further but I'm not familiar with that. >>> >>> HTH, >>> >>> Shawn >>> >>> On Mon, May 14, 2018 at 7:54 PM, Evan Kao wrote: >>> >>>> Hello all, >>>> >>>> I am trying to resample a structured grid data (~1.4M points, 1.3M >>>> cells) with an unstructured grid (~320K points, 480K cells). In Paraview >>>> 5.5, this resampling is nearly instant with the Resample With Dataset >>>> filter. Yet in a Python script using vtkResampleWithDataSet from VTK >>>> 8.1.0, the same operation takes about 15 minutes (>2 orders of magnitude >>>> difference in speed). As far as I can tell from the VTK repository on >>>> Gitlab, the only difference between the Paraview/release version and the >>>> 8.1.0 or 8.1.1 tagged releases is a switch in the cell locator. Is this >>>> enough to explain the difference in the performance? If not, could someone >>>> enlighten me as to what the possible factors are here? >>>> >>>> Also, if it matters, this is all on a Windows 7 64-bit machine. >>>> Paraview is installed from binaries, while VTK was downloaded from an >>>> Anaconda distribution compiled by a third party. >>>> >>>> Thanks for your time, >>>> Evan Kao >>>> >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://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: >>>> https://vtk.org/mailman/listinfo/vtkusers >>>> >>>> >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> https://vtk.org/mailman/listinfo/vtkusers >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tossin at gmail.com Tue May 15 16:47:44 2018 From: tossin at gmail.com (Evan Kao) Date: Tue, 15 May 2018 13:47:44 -0700 Subject: [vtkusers] Large performance difference between vtkResampleWithDataSet in VTK 8.1.0 and Resample with Dataset filter in Paraview 5.5 In-Reply-To: References: Message-ID: Hello Sujin, Using the TimerLog, I got the following time from ParaView: Execute vtkResampleWithDataSet id: 10345, 0.42 seconds As for the timeit module, you can see how I use it in the attached Python script. I only use timeit's default_timer function to grab the time before and after completion of the vtkResampleWithDataSet method and take the difference as the time elapsed. Regardless, qualitatively ParaView is near-instant while VTK takes a while. Google drive links to the datasets themselves are here (hopefully this doesn't trigger any mailing list filters): Unstructured Grid (35MB) | Structured Grid (70MB) If I get a chance, I'll take a look at using smaller data sets. - Evan On Tue, May 15, 2018 at 12:32 PM, Sujin Philip wrote: > Hi Evan, > > I tried testing this on my end and I am seeing expected performance from > VTK and ParaView. But the performance is dependent on the datasets used. Is > it possible for you to share your datasets and scripts with us? Could you > try this with smaller versions of your datasets and see if you are able to > reproduce this? > > I am not familiar with the timeit module in Python. From the documentation > it looks like it runs the code multiple times by default and prints the > total time. Can you confirm if you have taken this into consideration in > your script? > > A simple way to time operations in ParaView is to refer to the "Timer Log" > under the "Tools" menu. You should see a line like: > > Execute vtkResampleWithDataSet id: 6788, 2.70556 seconds > > > Thanks > Sujin > > > On Tue, May 15, 2018 at 1:05 PM, Evan Kao wrote: > >> Hi Shawn and Sujin, >> >> Thanks for the quick responses. The CPU on the computer I'm using is an >> i7-6700 >> >> with 4 cores, 8 threads, and 3.4 GHz frequency. >> >> Multi-threading may be a factor, but it's hard to tell because resampling >> in ParaView is so quick. ParaView is capable of using 100% of the CPU, >> while VTK (in Python) will max out at 12-13%. However, for these >> particular datasets, resampling doesn't appear to stress ParaView that much >> (11-16% when observing the Windows Task Manager, and some of that may be >> because of the rendering). However, I was under the impression that at >> best multi-threading could only reduce the time it takes by N threads (ie >> 8x), while the speed difference here is almost 1000x. I measured the times >> for ParaView 5.5, VTK 8.1 (compiled elsewhere), and VTK 7.1 (compiled by >> our group): >> >> 1. ParaView 5.5 - 1.1s, using a stopwatch, multiple trials. Timing >> started the moment I clicked "Apply". >> 2. VTK 8.1 - 922.47s, timed using Python's timeit module, measuring >> only the vtkResampleWithDataSet.Update() method. >> 3. VTK 7.1 - 950.47s, timed the same way as above. >> >> I'm aware of the difference in labeling between VTK and ParaView for >> Source and Input (which confuses me all the time). I can verify the >> correct data sets were assigned by saving the output (which should an >> unstructured grid) and viewing it in ParaView - it looks identical to the >> resampled data generated in ParaView (although it overwrites the point >> scalars array and adds some ghost information that needs to be removed). >> >> Thanks, >> Evan >> >> On Tue, May 15, 2018 at 7:38 AM, Sujin Philip >> wrote: >> >>> Hi Evan, >>> >>> As Shawn mentioned it could be due to lack of multi-threading. Could you >>> provide us the configuration of the system you are using? Like the number >>> of cores/threads and the CPU frequency? Also please share the actual time >>> that ParaView and VTK are taking. Is it possible for you to try out a >>> slightly older VTK version and see if the performance difference is still >>> there? >>> >>> Which dataset are you setting as input and which as source? The names >>> are unfortunately opposite between VTK-m and ParaView due to legacy >>> reasons. Probing with the unstructured grid as the source is much slower >>> than probing with the structured grid as the source. So please confirm that >>> the VTK pipeline is set up properly. >>> >>> Please let me know if none these seem to be the cause of your problem >>> and I will dig deeper. >>> >>> Thanks >>> Sujin >>> >>> >>> >>> On Tue, May 15, 2018 at 9:52 AM, Shawn Waldon >>> wrote: >>> >>>> Hi Evan, >>>> >>>> I suspect the differece is that the ParaView binaries were compiled >>>> with TBB multithreading support and the Anaconda VTK was not. >>>> vtkResampleWithDataSet is set up to use TBB multithreading if available. >>>> Check the utilization of the cores on your computer when running each and >>>> you will see ParaView using all available cores and Anaconda's VTK probably >>>> only using one. It is also possible the cell locator change improved >>>> things further but I'm not familiar with that. >>>> >>>> HTH, >>>> >>>> Shawn >>>> >>>> On Mon, May 14, 2018 at 7:54 PM, Evan Kao wrote: >>>> >>>>> Hello all, >>>>> >>>>> I am trying to resample a structured grid data (~1.4M points, 1.3M >>>>> cells) with an unstructured grid (~320K points, 480K cells). In Paraview >>>>> 5.5, this resampling is nearly instant with the Resample With Dataset >>>>> filter. Yet in a Python script using vtkResampleWithDataSet from VTK >>>>> 8.1.0, the same operation takes about 15 minutes (>2 orders of magnitude >>>>> difference in speed). As far as I can tell from the VTK repository on >>>>> Gitlab, the only difference between the Paraview/release version and the >>>>> 8.1.0 or 8.1.1 tagged releases is a switch in the cell locator. Is this >>>>> enough to explain the difference in the performance? If not, could someone >>>>> enlighten me as to what the possible factors are here? >>>>> >>>>> Also, if it matters, this is all on a Windows 7 64-bit machine. >>>>> Paraview is installed from binaries, while VTK was downloaded from an >>>>> Anaconda distribution compiled by a third party. >>>>> >>>>> Thanks for your time, >>>>> Evan Kao >>>>> >>>>> _______________________________________________ >>>>> Powered by www.kitware.com >>>>> >>>>> Visit other Kitware open-source projects at >>>>> http://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: >>>>> https://vtk.org/mailman/listinfo/vtkusers >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ at: >>>> http://www.vtk.org/Wiki/VTK_FAQ >>>> >>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> https://vtk.org/mailman/listinfo/vtkusers >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: test_vtkresamplewithdataset.py Type: application/octet-stream Size: 1287 bytes Desc: not available URL: From sujin.philip at kitware.com Tue May 15 17:36:10 2018 From: sujin.philip at kitware.com (Sujin Philip) Date: Tue, 15 May 2018 17:36:10 -0400 Subject: [vtkusers] Large performance difference between vtkResampleWithDataSet in VTK 8.1.0 and Resample with Dataset filter in Paraview 5.5 In-Reply-To: References: Message-ID: Hi Evan, Thanks for sharing the data. I tried your script on my Linux desktop and the performance I see on both VTK and ParaView is similar and <1 second. This is even without threading enabled. I haven't tried this on Windows yet. BTW, there is an error in the script you shared. The inputs to the resample filter are in the wrong order and the "vtkXMLUnstructuredGridWriter" throws an error saying that the data passed to it is not an unstructured grid. I assume you want to resample the data values from the structured grid on to the geometry provided by the unstructured grid. The result will be an unstructured grid, which can be written by the "vtkXMLUnstructuredGridWrite". For this the input should be the "mesh" data and the source should be "image". So, currently I don't have a good explanation for what is causing the performance degradation for you. It might be some issues with the builds, or the Windows setup. You can maybe try building VTK yourself (make sure to build in "Release" mode), or try another machine and see if the problem persists. I will also try to reproduce this on a Windows machine. Thanks Sujin On Tue, May 15, 2018 at 4:47 PM, Evan Kao wrote: > Hello Sujin, > > Using the TimerLog, I got the following time from ParaView: > > Execute vtkResampleWithDataSet id: 10345, 0.42 seconds > > As for the timeit module, you can see how I use it in the attached Python > script. I only use timeit's default_timer function to grab the time before > and after completion of the vtkResampleWithDataSet method and take the > difference as the time elapsed. Regardless, qualitatively ParaView is > near-instant while VTK takes a while. > > Google drive links to the datasets themselves are here (hopefully this > doesn't trigger any mailing list filters): Unstructured Grid (35MB) > | Structured > Grid (70MB) > > > If I get a chance, I'll take a look at using smaller data sets. > > - Evan > > > On Tue, May 15, 2018 at 12:32 PM, Sujin Philip > wrote: > >> Hi Evan, >> >> I tried testing this on my end and I am seeing expected performance from >> VTK and ParaView. But the performance is dependent on the datasets used. Is >> it possible for you to share your datasets and scripts with us? Could you >> try this with smaller versions of your datasets and see if you are able to >> reproduce this? >> >> I am not familiar with the timeit module in Python. From the >> documentation it looks like it runs the code multiple times by default and >> prints the total time. Can you confirm if you have taken this into >> consideration in your script? >> >> A simple way to time operations in ParaView is to refer to the "Timer >> Log" under the "Tools" menu. You should see a line like: >> >> Execute vtkResampleWithDataSet id: 6788, 2.70556 seconds >> >> >> Thanks >> Sujin >> >> >> On Tue, May 15, 2018 at 1:05 PM, Evan Kao wrote: >> >>> Hi Shawn and Sujin, >>> >>> Thanks for the quick responses. The CPU on the computer I'm using is an >>> i7-6700 >>> >>> with 4 cores, 8 threads, and 3.4 GHz frequency. >>> >>> Multi-threading may be a factor, but it's hard to tell because >>> resampling in ParaView is so quick. ParaView is capable of using 100% of >>> the CPU, while VTK (in Python) will max out at 12-13%. However, for these >>> particular datasets, resampling doesn't appear to stress ParaView that much >>> (11-16% when observing the Windows Task Manager, and some of that may be >>> because of the rendering). However, I was under the impression that at >>> best multi-threading could only reduce the time it takes by N threads (ie >>> 8x), while the speed difference here is almost 1000x. I measured the times >>> for ParaView 5.5, VTK 8.1 (compiled elsewhere), and VTK 7.1 (compiled by >>> our group): >>> >>> 1. ParaView 5.5 - 1.1s, using a stopwatch, multiple trials. Timing >>> started the moment I clicked "Apply". >>> 2. VTK 8.1 - 922.47s, timed using Python's timeit module, measuring >>> only the vtkResampleWithDataSet.Update() method. >>> 3. VTK 7.1 - 950.47s, timed the same way as above. >>> >>> I'm aware of the difference in labeling between VTK and ParaView for >>> Source and Input (which confuses me all the time). I can verify the >>> correct data sets were assigned by saving the output (which should an >>> unstructured grid) and viewing it in ParaView - it looks identical to the >>> resampled data generated in ParaView (although it overwrites the point >>> scalars array and adds some ghost information that needs to be removed). >>> >>> Thanks, >>> Evan >>> >>> On Tue, May 15, 2018 at 7:38 AM, Sujin Philip >>> wrote: >>> >>>> Hi Evan, >>>> >>>> As Shawn mentioned it could be due to lack of multi-threading. Could >>>> you provide us the configuration of the system you are using? Like the >>>> number of cores/threads and the CPU frequency? Also please share the actual >>>> time that ParaView and VTK are taking. Is it possible for you to try out a >>>> slightly older VTK version and see if the performance difference is still >>>> there? >>>> >>>> Which dataset are you setting as input and which as source? The names >>>> are unfortunately opposite between VTK-m and ParaView due to legacy >>>> reasons. Probing with the unstructured grid as the source is much slower >>>> than probing with the structured grid as the source. So please confirm that >>>> the VTK pipeline is set up properly. >>>> >>>> Please let me know if none these seem to be the cause of your problem >>>> and I will dig deeper. >>>> >>>> Thanks >>>> Sujin >>>> >>>> >>>> >>>> On Tue, May 15, 2018 at 9:52 AM, Shawn Waldon >>> > wrote: >>>> >>>>> Hi Evan, >>>>> >>>>> I suspect the differece is that the ParaView binaries were compiled >>>>> with TBB multithreading support and the Anaconda VTK was not. >>>>> vtkResampleWithDataSet is set up to use TBB multithreading if available. >>>>> Check the utilization of the cores on your computer when running each and >>>>> you will see ParaView using all available cores and Anaconda's VTK probably >>>>> only using one. It is also possible the cell locator change improved >>>>> things further but I'm not familiar with that. >>>>> >>>>> HTH, >>>>> >>>>> Shawn >>>>> >>>>> On Mon, May 14, 2018 at 7:54 PM, Evan Kao wrote: >>>>> >>>>>> Hello all, >>>>>> >>>>>> I am trying to resample a structured grid data (~1.4M points, 1.3M >>>>>> cells) with an unstructured grid (~320K points, 480K cells). In Paraview >>>>>> 5.5, this resampling is nearly instant with the Resample With Dataset >>>>>> filter. Yet in a Python script using vtkResampleWithDataSet from VTK >>>>>> 8.1.0, the same operation takes about 15 minutes (>2 orders of magnitude >>>>>> difference in speed). As far as I can tell from the VTK repository on >>>>>> Gitlab, the only difference between the Paraview/release version and the >>>>>> 8.1.0 or 8.1.1 tagged releases is a switch in the cell locator. Is this >>>>>> enough to explain the difference in the performance? If not, could someone >>>>>> enlighten me as to what the possible factors are here? >>>>>> >>>>>> Also, if it matters, this is all on a Windows 7 64-bit machine. >>>>>> Paraview is installed from binaries, while VTK was downloaded from an >>>>>> Anaconda distribution compiled by a third party. >>>>>> >>>>>> Thanks for your time, >>>>>> Evan Kao >>>>>> >>>>>> _______________________________________________ >>>>>> Powered by www.kitware.com >>>>>> >>>>>> Visit other Kitware open-source projects at >>>>>> http://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: >>>>>> https://vtk.org/mailman/listinfo/vtkusers >>>>>> >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Powered by www.kitware.com >>>>> >>>>> Visit other Kitware open-source projects at >>>>> http://www.kitware.com/opensource/opensource.html >>>>> >>>>> Please keep messages on-topic and check the VTK FAQ at: >>>>> http://www.vtk.org/Wiki/VTK_FAQ >>>>> >>>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>>> >>>>> Follow this link to subscribe/unsubscribe: >>>>> https://vtk.org/mailman/listinfo/vtkusers >>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tossin at gmail.com Tue May 15 18:28:43 2018 From: tossin at gmail.com (Evan Kao) Date: Tue, 15 May 2018 15:28:43 -0700 Subject: [vtkusers] Large performance difference between vtkResampleWithDataSet in VTK 8.1.0 and Resample with Dataset filter in Paraview 5.5 In-Reply-To: References: Message-ID: Hi Sujin, I thought I had put in the correct source/input, but I suppose I should have checked more closely. Still, it didn't make that much of a difference (634s or 10.5 min). I'll continue checking if this problem persists for me on other platforms. I also tried using vtkResampleWithDataSet inside a Programmable Filter in ParaView, and it performed quickly (0.98s). Is it possible to see the build flags for your version of VTK, or the ones that were used for the ParaView binaries? Were you using testing on VTK 8.1 or the latest version? Thanks, Evan Kao On Tue, May 15, 2018 at 2:36 PM, Sujin Philip wrote: > Hi Evan, > > Thanks for sharing the data. I tried your script on my Linux desktop and > the performance I see on both VTK and ParaView is similar and <1 second. > This is even without threading enabled. I haven't tried this on Windows yet. > > BTW, there is an error in the script you shared. The inputs to the > resample filter are in the wrong order and the > "vtkXMLUnstructuredGridWriter" throws an error saying that the data passed > to it is not an unstructured grid. I assume you want to resample the data > values from the structured grid on to the geometry provided by the > unstructured grid. The result will be an unstructured grid, which can be > written by the "vtkXMLUnstructuredGridWrite". For this the input should be > the "mesh" data and the source should be "image". > > So, currently I don't have a good explanation for what is causing the > performance degradation for you. It might be some issues with the builds, > or the Windows setup. You can maybe try building VTK yourself (make sure to > build in "Release" mode), or try another machine and see if the problem > persists. I will also try to reproduce this on a Windows machine. > > Thanks > Sujin > > > On Tue, May 15, 2018 at 4:47 PM, Evan Kao wrote: > >> Hello Sujin, >> >> Using the TimerLog, I got the following time from ParaView: >> >> Execute vtkResampleWithDataSet id: 10345, 0.42 seconds >> >> As for the timeit module, you can see how I use it in the attached Python >> script. I only use timeit's default_timer function to grab the time before >> and after completion of the vtkResampleWithDataSet method and take the >> difference as the time elapsed. Regardless, qualitatively ParaView is >> near-instant while VTK takes a while. >> >> Google drive links to the datasets themselves are here (hopefully this >> doesn't trigger any mailing list filters): Unstructured Grid (35MB) >> | Structured >> Grid (70MB) >> >> >> If I get a chance, I'll take a look at using smaller data sets. >> >> - Evan >> >> >> On Tue, May 15, 2018 at 12:32 PM, Sujin Philip >> wrote: >> >>> Hi Evan, >>> >>> I tried testing this on my end and I am seeing expected performance from >>> VTK and ParaView. But the performance is dependent on the datasets used. Is >>> it possible for you to share your datasets and scripts with us? Could you >>> try this with smaller versions of your datasets and see if you are able to >>> reproduce this? >>> >>> I am not familiar with the timeit module in Python. From the >>> documentation it looks like it runs the code multiple times by default and >>> prints the total time. Can you confirm if you have taken this into >>> consideration in your script? >>> >>> A simple way to time operations in ParaView is to refer to the "Timer >>> Log" under the "Tools" menu. You should see a line like: >>> >>> Execute vtkResampleWithDataSet id: 6788, 2.70556 seconds >>> >>> >>> Thanks >>> Sujin >>> >>> >>> On Tue, May 15, 2018 at 1:05 PM, Evan Kao wrote: >>> >>>> Hi Shawn and Sujin, >>>> >>>> Thanks for the quick responses. The CPU on the computer I'm using is >>>> an i7-6700 >>>> >>>> with 4 cores, 8 threads, and 3.4 GHz frequency. >>>> >>>> Multi-threading may be a factor, but it's hard to tell because >>>> resampling in ParaView is so quick. ParaView is capable of using 100% of >>>> the CPU, while VTK (in Python) will max out at 12-13%. However, for these >>>> particular datasets, resampling doesn't appear to stress ParaView that much >>>> (11-16% when observing the Windows Task Manager, and some of that may be >>>> because of the rendering). However, I was under the impression that at >>>> best multi-threading could only reduce the time it takes by N threads (ie >>>> 8x), while the speed difference here is almost 1000x. I measured the times >>>> for ParaView 5.5, VTK 8.1 (compiled elsewhere), and VTK 7.1 (compiled by >>>> our group): >>>> >>>> 1. ParaView 5.5 - 1.1s, using a stopwatch, multiple trials. Timing >>>> started the moment I clicked "Apply". >>>> 2. VTK 8.1 - 922.47s, timed using Python's timeit module, measuring >>>> only the vtkResampleWithDataSet.Update() method. >>>> 3. VTK 7.1 - 950.47s, timed the same way as above. >>>> >>>> I'm aware of the difference in labeling between VTK and ParaView for >>>> Source and Input (which confuses me all the time). I can verify the >>>> correct data sets were assigned by saving the output (which should an >>>> unstructured grid) and viewing it in ParaView - it looks identical to the >>>> resampled data generated in ParaView (although it overwrites the point >>>> scalars array and adds some ghost information that needs to be removed). >>>> >>>> Thanks, >>>> Evan >>>> >>>> On Tue, May 15, 2018 at 7:38 AM, Sujin Philip >>> > wrote: >>>> >>>>> Hi Evan, >>>>> >>>>> As Shawn mentioned it could be due to lack of multi-threading. Could >>>>> you provide us the configuration of the system you are using? Like the >>>>> number of cores/threads and the CPU frequency? Also please share the actual >>>>> time that ParaView and VTK are taking. Is it possible for you to try out a >>>>> slightly older VTK version and see if the performance difference is still >>>>> there? >>>>> >>>>> Which dataset are you setting as input and which as source? The names >>>>> are unfortunately opposite between VTK-m and ParaView due to legacy >>>>> reasons. Probing with the unstructured grid as the source is much slower >>>>> than probing with the structured grid as the source. So please confirm that >>>>> the VTK pipeline is set up properly. >>>>> >>>>> Please let me know if none these seem to be the cause of your problem >>>>> and I will dig deeper. >>>>> >>>>> Thanks >>>>> Sujin >>>>> >>>>> >>>>> >>>>> On Tue, May 15, 2018 at 9:52 AM, Shawn Waldon < >>>>> shawn.waldon at kitware.com> wrote: >>>>> >>>>>> Hi Evan, >>>>>> >>>>>> I suspect the differece is that the ParaView binaries were compiled >>>>>> with TBB multithreading support and the Anaconda VTK was not. >>>>>> vtkResampleWithDataSet is set up to use TBB multithreading if available. >>>>>> Check the utilization of the cores on your computer when running each and >>>>>> you will see ParaView using all available cores and Anaconda's VTK probably >>>>>> only using one. It is also possible the cell locator change improved >>>>>> things further but I'm not familiar with that. >>>>>> >>>>>> HTH, >>>>>> >>>>>> Shawn >>>>>> >>>>>> On Mon, May 14, 2018 at 7:54 PM, Evan Kao wrote: >>>>>> >>>>>>> Hello all, >>>>>>> >>>>>>> I am trying to resample a structured grid data (~1.4M points, 1.3M >>>>>>> cells) with an unstructured grid (~320K points, 480K cells). In Paraview >>>>>>> 5.5, this resampling is nearly instant with the Resample With Dataset >>>>>>> filter. Yet in a Python script using vtkResampleWithDataSet from VTK >>>>>>> 8.1.0, the same operation takes about 15 minutes (>2 orders of magnitude >>>>>>> difference in speed). As far as I can tell from the VTK repository on >>>>>>> Gitlab, the only difference between the Paraview/release version and the >>>>>>> 8.1.0 or 8.1.1 tagged releases is a switch in the cell locator. Is this >>>>>>> enough to explain the difference in the performance? If not, could someone >>>>>>> enlighten me as to what the possible factors are here? >>>>>>> >>>>>>> Also, if it matters, this is all on a Windows 7 64-bit machine. >>>>>>> Paraview is installed from binaries, while VTK was downloaded from an >>>>>>> Anaconda distribution compiled by a third party. >>>>>>> >>>>>>> Thanks for your time, >>>>>>> Evan Kao >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Powered by www.kitware.com >>>>>>> >>>>>>> Visit other Kitware open-source projects at >>>>>>> http://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: >>>>>>> https://vtk.org/mailman/listinfo/vtkusers >>>>>>> >>>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Powered by www.kitware.com >>>>>> >>>>>> Visit other Kitware open-source projects at >>>>>> http://www.kitware.com/opensource/opensource.html >>>>>> >>>>>> Please keep messages on-topic and check the VTK FAQ at: >>>>>> http://www.vtk.org/Wiki/VTK_FAQ >>>>>> >>>>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>>>> >>>>>> Follow this link to subscribe/unsubscribe: >>>>>> https://vtk.org/mailman/listinfo/vtkusers >>>>>> >>>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rccm.kyoshimi at gmail.com Tue May 15 20:22:22 2018 From: rccm.kyoshimi at gmail.com (kenichiro yoshimi) Date: Wed, 16 May 2018 09:22:22 +0900 Subject: [vtkusers] Time Interpolation In-Reply-To: References: Message-ID: Hi Andrew, I use the second vtkExtractTimeSteps to extract the hoping time step from the output of vtkTemporalInterpolator which contains multiple time steps like [0, 1(index of specfiedTime), ...] in my code. Especially, specified time step index is needed to be "1" in extractTime2 filter: extractTime2.AddTimeStepIndex(1) because the index of hoping time is made indicate "1" in vtkTemporalInterpolator. Best Regards 2018-05-15 23:37 GMT+09:00 Slaughter, Andrew E : > This is great, thanks for taking time to get this working. I have one > question, what is the purpose of the second vtkExtractTimeSteps? > > On Tue, May 15, 2018 at 2:13 AM, kenichiro yoshimi > wrote: >> >> Hello Andrew, >> >> I found a dirty way using vtkTemporalInterpolator and >> vtkExtractTimeSteps as follows, and you can set an arbitrary time >> value to "specifiedTime" within the code: >> >> ---- >> #!/usr/bin/env python >> import os >> import vtk >> import numpy as np >> >> specifiedTime = 0.18 >> >> # Input file and variable >> filename = os.path.abspath('mug.e') >> nodal_var = 'convected' >> >> # Read Exodus Data >> reader = vtk.vtkExodusIIReader() >> reader.SetFileName(filename) >> reader.UpdateInformation() >> reader.SetTimeStep(10) >> reader.SetAllArrayStatus(vtk.vtkExodusIIReader.NODAL, 1) >> #reader.Update(); print reader >> >> info = >> reader.GetExecutive().GetOutputInformation().GetInformationObject(0) >> key = vtk.vtkStreamingDemandDrivenPipeline.TIME_STEPS() >> times = np.array([info.Get(key,i) for i in range(info.Length(key))]) >> index = np.max(np.where(times <= specifiedTime)) >> >> extractTime = vtk.vtkExtractTimeSteps() >> extractTime.SetInputConnection(0, reader.GetOutputPort(0)) >> extractTime.SetTimeStepIndices(2, [index, index+1]) >> >> # Time interpolation (How do I set this up?) >> time = vtk.vtkTemporalInterpolator() >> time.SetInputConnection(0, extractTime.GetOutputPort(0)) >> time.SetDiscreteTimeStepInterval(specifiedTime - times[index]) >> time.UpdateTimeStep(specifiedTime) >> >> extractTime2 = vtk.vtkExtractTimeSteps() >> extractTime2.SetInputConnection(0, time.GetOutputPort(0)) >> extractTime2.AddTimeStepIndex(1) >> >> # Create Geometry >> geometry = vtk.vtkCompositeDataGeometryFilter() >> geometry.SetInputConnection(0, extractTime2.GetOutputPort(0)) >> geometry.Update() >> >> writer = vtk.vtkExodusIIWriter() >> writer.SetInputConnection(0, geometry.GetOutputPort()) >> writer.SetFileName('time.e') >> writer.WriteAllTimeStepsOn() >> writer.Write() >> >> # Mapper >> mapper = vtk.vtkPolyDataMapper() >> mapper.SetInputConnection(geometry.GetOutputPort()) >> mapper.SelectColorArray(nodal_var) >> mapper.SetScalarModeToUsePointFieldData() >> mapper.InterpolateScalarsBeforeMappingOn() >> >> # Actor >> actor = vtk.vtkActor() >> actor.SetMapper(mapper) >> >> # Renderer >> renderer = vtk.vtkRenderer() >> renderer.AddViewProp(actor) >> >> # Window and Interactor >> window = vtk.vtkRenderWindow() >> window.AddRenderer(renderer) >> window.SetSize(600, 600) >> >> interactor = vtk.vtkRenderWindowInteractor() >> interactor.SetRenderWindow(window) >> interactor.Initialize() >> >> # Show the result >> window.Render() >> interactor.Start() >> ---- >> >> Best >> >> 2018-05-11 2:06 GMT+09:00 Slaughter, Andrew E : >> > I was hoping someone could help me setup interpolation for ExodusII >> > data. >> > The attached python scripts (I am using MacOS; python2.7; vtk7.1) reads >> > the >> > ExodusII file (mug.e). I would like to be able to set an arbitrary time >> > value and have VTK perform the interpolation, would someone please help >> > me >> > get this working? I have two versions I am working on, one using >> > vtkTemporalInterpolator and the other with >> > vtkInterpolateDataSetAttributes. >> > I am happy using either class, I just need it to work. >> > >> > I am aware that some of these features are built into Paraview, but my >> > project requires me to make this work with pure VTK. >> > >> > Thanks, >> > >> > Andrew >> > >> > _______________________________________________ >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at >> > >> > https://urldefense.proofpoint.com/v2/url?u=http-3A__www.kitware.com_opensource_opensource.html&d=DwIBaQ&c=54IZrppPQZKX9mLzcGdPfFD1hxrcB__aEkJFOKJFd00&r=h7heP8xwI1i_HikChvhFbEBurKirgfOCdwgBxB9lM8c&m=puHckBK1HPjYo6fLuDnW7Rsr9yj_a2niN1Z4KRui5BM&s=E7mpGidBh-HqQHk8zv6FqPKcN2BAfHg5FyshFS96aAM&e= >> > >> > Please keep messages on-topic and check the VTK FAQ at: >> > >> > https://urldefense.proofpoint.com/v2/url?u=http-3A__www.vtk.org_Wiki_VTK-5FFAQ&d=DwIBaQ&c=54IZrppPQZKX9mLzcGdPfFD1hxrcB__aEkJFOKJFd00&r=h7heP8xwI1i_HikChvhFbEBurKirgfOCdwgBxB9lM8c&m=puHckBK1HPjYo6fLuDnW7Rsr9yj_a2niN1Z4KRui5BM&s=__QxFPfkRQHlaX87BPaTQqC3-xiuwKePex8T9KtAD8Q&e= >> > >> > Search the list archives at: >> > https://urldefense.proofpoint.com/v2/url?u=http-3A__markmail.org_search_-3Fq-3Dvtkusers&d=DwIBaQ&c=54IZrppPQZKX9mLzcGdPfFD1hxrcB__aEkJFOKJFd00&r=h7heP8xwI1i_HikChvhFbEBurKirgfOCdwgBxB9lM8c&m=puHckBK1HPjYo6fLuDnW7Rsr9yj_a2niN1Z4KRui5BM&s=CNEA4K6JVEFn6AGYM0fYeW0rg6ENnWlIx_cTPpb7zHM&e= >> > >> > Follow this link to subscribe/unsubscribe: >> > >> > https://urldefense.proofpoint.com/v2/url?u=https-3A__vtk.org_mailman_listinfo_vtkusers&d=DwIBaQ&c=54IZrppPQZKX9mLzcGdPfFD1hxrcB__aEkJFOKJFd00&r=h7heP8xwI1i_HikChvhFbEBurKirgfOCdwgBxB9lM8c&m=puHckBK1HPjYo6fLuDnW7Rsr9yj_a2niN1Z4KRui5BM&s=DJXa7N2JNLCUAVjyuFKhbN5PDsErajyMP1cjw0MJQyg&e= >> > > > From bill.lorensen at gmail.com Tue May 15 23:10:53 2018 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Tue, 15 May 2018 20:10:53 -0700 Subject: [vtkusers] ANN: Latex and Markdown versions of the VTK textbook Message-ID: Folks, We have been busy converting the current online PDF version of the VTK Textbook. The two efforts include a Latex version led by Andrew Maclean and a markdown version led by Bill Lorensen. Will Schroeder provided encouragement and a high-resolution PDF of the textbook. Bernhard Meehan provided us with Latex versions for most of the 155 equations. Jon Haitz Legarreta helped with Latex formatting. The two versions serve two different goals. The Latex version is duplicating the original text that was written using Adobe's Framemaker. The goal is to produce a version with links to figures, references, equations, examples, etc. Figures that exist in the VTKExamples are kept up-to-date. Hopefully, by using a more familiar format (Latex), this version will serve as a base for community updates and future versions of the text. The Markdown version is an interactive, platform friendly version of the book. The entire text is available as a Chapter by Chapter web site. The figures that exist as VTK Examples are linked to the nightly output of the regression testing. Also, all vtk classes in the text are linked to the doxygen descripti0on of the class. Example code that produces book figures links back to the figure in the text. This allows easy movement from text to examples and back. This version is smartphone and tablet friendly. The current version of the Latex textbook is here: https://raw.githubusercontent.com/lorensen/VTKExamples/master/src/VTKBookLaTex/VTKTextBook.pdf The alpha version of all Chapters of the Markdown text starts here: https://lorensen.github.io/VTKExamples/site/VTKBook/01Chapter1/ A more detailed description of both efforts is here: https://lorensen.github.io/VTKExamples/site/VTKBook/ If you are on researchgate.net you can follow the VTKExamples at https://www.researchgate.net/project/VTK-Examples As always, we welcome positive and constructive comments. Enjoy, Bill -- Unpaid intern in BillsParadise at noware dot com From ashishbme at gmail.com Tue May 15 23:40:29 2018 From: ashishbme at gmail.com (ashishbme) Date: Tue, 15 May 2018 20:40:29 -0700 (MST) Subject: [vtkusers] VtkDistanceWidget label text font In-Reply-To: References: <1525327463658-0.post@n5.nabble.com> Message-ID: <1526442029141-0.post@n5.nabble.com> Hi kenichiro yoshimi, Thank you, solution provided by you worked for me. Regards Ashish -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From Andx_roo at live.com Wed May 16 02:49:42 2018 From: Andx_roo at live.com (Andaharoo) Date: Tue, 15 May 2018 23:49:42 -0700 (MST) Subject: [vtkusers] Wireframe and Volume Rendering Message-ID: <1526453382123-0.post@n5.nabble.com> Rendering wireframes over a volume doesn't seem to work correctly. The volume just disappears? Is there a simple fix/flag or something I'm missing? The lines intermix fine with the volume. But the volume behind the plane doesn't show. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From ochampao at hotmail.com Wed May 16 07:15:45 2018 From: ochampao at hotmail.com (ochampao) Date: Wed, 16 May 2018 04:15:45 -0700 (MST) Subject: [vtkusers] Correct anatomical orientation of volumes from Niftii and DICOM In-Reply-To: References: <1525886808408-0.post@n5.nabble.com> <1525946467407-0.post@n5.nabble.com> <1525966655394-0.post@n5.nabble.com> <1526046263006-0.post@n5.nabble.com> Message-ID: <1526469345889-0.post@n5.nabble.com> Hi David, I've used your suggestion to verify the camera configuration with vtkAxesActor. In combination with the AnatomicalOrientation [1] example, it was very helpful. I think now I've setup the camera in the 3 views to follow (hopefully correctly) the RAS coordinate system convention. See screenshot with the axes. I have also switched to using vtkDICOMReader (vtk-dicom 0.87 + VTK8.1) for loading from DICOM. This is so that I can make use of the vtkDICOMToRAS class to account for the change in coordinate system from LPS to RAS (until I am comfortable enough to write my own conversion methods). See loadDicom() method below. Despite making these changes I still see the images flipped horizontally (referring to the axial view and also comparing with Slicer which as I understand also uses RAS). Assumuing my camera setup is indeed correct, shouldn't vtkDICOMToRAS account for the switch in coordinates? Are some steps missing? Why do I see this horizontal flip? I've included below the relevant code for setting up the cameras and loading Dicom. Thanks for your help. Panos. [1] https://lorensen.github.io/VTKExamples/site/Cxx/VisualizationAlgorithms/AnatomicalOrientation/ // ================================================ // loadDicom() // ================================================ vtkSmartPointer QuadView::loadDicom(const char* path) const { vtkNew fileGlob; fileGlob->SetDirectory(path); fileGlob->AddFileNames("*.dcm"); vtkSmartPointer vtkStringFilenames = fileGlob->GetFileNames(); vtkNew reader; reader->SetFileNames(vtkStringFilenames); reader->SetMemoryRowOrderToFileNative(); reader->UpdateInformation(); vtkNew converterLPSToRAS; converterLPSToRAS->SetInputConnection(reader->GetOutputPort()); converterLPSToRAS->SetPatientMatrix(reader->GetPatientMatrix()); converterLPSToRAS->SetAllowRowReordering(true); converterLPSToRAS->SetAllowColumnReordering(true); converterLPSToRAS->UpdateMatrix(); converterLPSToRAS->Update(); return converterLPSToRAS->GetOutput(); } // ================================================ // resetCameras2D() // ================================================ void QuadView::resetCameras2D() const { // iterate through the active 2D views. for (const auto &view : mQuadViewUI.getQVTKOpenGLWidget2DKeyList()) { // Reset camera & clipping range mPipelineObject2DContainer.at(view).renderer->ResetCamera(); switch (view) { case IQuadViewUI::VTKDockWidget::TopLeft: //Axial { double viewUp[3] = { 0, 1, 0 }; double leftToRight[3] = { 1, 0, 0 }; vtkCamera* camera = mPipelineObject2DContainer.at(view).renderer->GetActiveCamera(); setImageOrientation(leftToRight, viewUp, *camera); camera->OrthogonalizeViewUp(); break; } case IQuadViewUI::VTKDockWidget::TopRight: //Sagittal { double viewUp[3] = { 0, 0, 1 }; double leftToRight[3] = { 0, -1, 0 }; vtkCamera* camera = mPipelineObject2DContainer.at(view).renderer->GetActiveCamera(); setImageOrientation(leftToRight, viewUp, *camera); camera->OrthogonalizeViewUp(); break; } case IQuadViewUI::VTKDockWidget::BottomLeft: //Coronal { double viewUp[3] = { 0, 0, 1 }; double leftToRight[3] = { 1, 0, 0 }; vtkCamera* camera = mPipelineObject2DContainer.at(view).renderer->GetActiveCamera(); setImageOrientation(leftToRight, viewUp, *camera); camera->OrthogonalizeViewUp(); break; } default: break; } } } // ================================================ // setImageOrientation() // ================================================ void QuadView::setImageOrientation(const double leftToRight[3], const double viewUp[3], vtkCamera &camera) const { // from vtkInteractorStyleImage::SetImageOrientation() // compute the view plane normal, which points out of the screen, through the cross product double normal[3]; vtkMath::Cross(leftToRight, viewUp, normal); // get the camera focus double focus[3]; camera.GetFocalPoint(focus); // get the camera distance from the focus double d = camera.GetDistance(); // position the camera on view plane normal keeping the focus and the distance from it fixed camera.SetPosition( focus[0] + d*normal[0], focus[1] + d*normal[1], focus[2] + d*normal[2]); // make sure focus is the same camera.SetFocalPoint(focus); // setup view up vector camera.SetViewUp(viewUp); } -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From p3tr.matousek at gmail.com Wed May 16 09:57:59 2018 From: p3tr.matousek at gmail.com (=?UTF-8?Q?Petr_Matou=c5=a1ek?=) Date: Wed, 16 May 2018 15:57:59 +0200 Subject: [vtkusers] nested vtkPropAssembly visibility In-Reply-To: References: Message-ID: <10e7edab-0cb8-505c-29ec-3303720214cd@gmail.com> Hello, I have the following assembly hierarchy: vtkPropAssembly1 -> vtkPropAssmebly2 -> vtkActor Calling vtkPropAssembly1.VisibilityOff() or vtkActor.VisibilityOff() will hide the vtkActor during render. But calling vtkPropAssembly2.VisibilityOff() has no effect. Is this intended behavior or a bug? I expected that calling vtkPropAssembly2.VisibilityOff() will hide the vtkActor too. This kind of behavior was already reported here: http://vtk.org/Bug/view.php?id=3312 https://gitlab.kitware.com/vtk/vtk/issues/3312 Best regards, Petr Matousek From sankhesh.jhaveri at kitware.com Wed May 16 11:24:26 2018 From: sankhesh.jhaveri at kitware.com (Sankhesh Jhaveri) Date: Wed, 16 May 2018 11:24:26 -0400 Subject: [vtkusers] Wireframe and Volume Rendering In-Reply-To: <1526453382123-0.post@n5.nabble.com> References: <1526453382123-0.post@n5.nabble.com> Message-ID: Hi, Could you share example code that reproduces this behavior? I don't see it in ParaView: [image: WireframeVolumeIntersection.png] Thanks, Sankhesh On Wed, May 16, 2018 at 2:49 AM Andaharoo wrote: > Rendering wireframes over a volume doesn't seem to work correctly. The > volume > just disappears? Is there a simple fix/flag or something I'm missing? The > lines intermix fine with the volume. But the volume behind the plane > doesn't > show. > > > > > > -- > 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: > https://vtk.org/mailman/listinfo/vtkusers > -- Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware | (518) 881-4417 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: WireframeVolumeIntersection.png Type: image/png Size: 168574 bytes Desc: not available URL: From allison.vacanti at kitware.com Wed May 16 11:30:30 2018 From: allison.vacanti at kitware.com (Allie Vacanti) Date: Wed, 16 May 2018 11:30:30 -0400 Subject: [vtkusers] Wireframe and Volume Rendering In-Reply-To: References: <1526453382123-0.post@n5.nabble.com> Message-ID: Something like this will happen if you enable hidden line removal (vtkRenderer::SetUseHiddenLineRemoval) since that overwrites the depth buffer. If that's what's happening, you'll need to disable HLR for this sort of scene. HTH, Allison On Wed, May 16, 2018 at 11:24 AM, Sankhesh Jhaveri < sankhesh.jhaveri at kitware.com> wrote: > Hi, > > Could you share example code that reproduces this behavior? > I don't see it in ParaView: > > [image: WireframeVolumeIntersection.png] > > Thanks, > Sankhesh > > On Wed, May 16, 2018 at 2:49 AM Andaharoo wrote: > >> Rendering wireframes over a volume doesn't seem to work correctly. The >> volume >> just disappears? Is there a simple fix/flag or something I'm missing? The >> lines intermix fine with the volume. But the volume behind the plane >> doesn't >> show. >> >> >> >> >> >> -- >> 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: >> https://vtk.org/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: > https://vtk.org/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: WireframeVolumeIntersection.png Type: image/png Size: 168574 bytes Desc: not available URL: From sujin.philip at kitware.com Wed May 16 11:48:09 2018 From: sujin.philip at kitware.com (Sujin Philip) Date: Wed, 16 May 2018 11:48:09 -0400 Subject: [vtkusers] Large performance difference between vtkResampleWithDataSet in VTK 8.1.0 and Resample with Dataset filter in Paraview 5.5 In-Reply-To: References: Message-ID: Hi Evan, I was finally able to reproduce this. So this is due to the poor performance of the old cell locator in 8.1.0. The new cell locator code is in ParaView 5.5 and VTK master. Sorry about the confusion. Let me know if you have any further questions. Thanks Sujin On Tue, May 15, 2018 at 6:28 PM, Evan Kao wrote: > Hi Sujin, > > I thought I had put in the correct source/input, but I suppose I should > have checked more closely. Still, it didn't make that much of a difference > (634s or 10.5 min). I'll continue checking if this problem persists for me > on other platforms. > > I also tried using vtkResampleWithDataSet inside a Programmable Filter in > ParaView, and it performed quickly (0.98s). > > Is it possible to see the build flags for your version of VTK, or the ones > that were used for the ParaView binaries? Were you using testing on VTK > 8.1 or the latest version? > > Thanks, > Evan Kao > > On Tue, May 15, 2018 at 2:36 PM, Sujin Philip > wrote: > >> Hi Evan, >> >> Thanks for sharing the data. I tried your script on my Linux desktop and >> the performance I see on both VTK and ParaView is similar and <1 second. >> This is even without threading enabled. I haven't tried this on Windows yet. >> >> BTW, there is an error in the script you shared. The inputs to the >> resample filter are in the wrong order and the >> "vtkXMLUnstructuredGridWriter" throws an error saying that the data passed >> to it is not an unstructured grid. I assume you want to resample the data >> values from the structured grid on to the geometry provided by the >> unstructured grid. The result will be an unstructured grid, which can be >> written by the "vtkXMLUnstructuredGridWrite". For this the input should be >> the "mesh" data and the source should be "image". >> >> So, currently I don't have a good explanation for what is causing the >> performance degradation for you. It might be some issues with the builds, >> or the Windows setup. You can maybe try building VTK yourself (make sure to >> build in "Release" mode), or try another machine and see if the problem >> persists. I will also try to reproduce this on a Windows machine. >> >> Thanks >> Sujin >> >> >> On Tue, May 15, 2018 at 4:47 PM, Evan Kao wrote: >> >>> Hello Sujin, >>> >>> Using the TimerLog, I got the following time from ParaView: >>> >>> Execute vtkResampleWithDataSet id: 10345, 0.42 seconds >>> >>> As for the timeit module, you can see how I use it in the attached >>> Python script. I only use timeit's default_timer function to grab the time >>> before and after completion of the vtkResampleWithDataSet method and take >>> the difference as the time elapsed. Regardless, qualitatively ParaView is >>> near-instant while VTK takes a while. >>> >>> Google drive links to the datasets themselves are here (hopefully this >>> doesn't trigger any mailing list filters): Unstructured Grid (35MB) >>> | Structured >>> Grid (70MB) >>> >>> >>> If I get a chance, I'll take a look at using smaller data sets. >>> >>> - Evan >>> >>> >>> On Tue, May 15, 2018 at 12:32 PM, Sujin Philip >> > wrote: >>> >>>> Hi Evan, >>>> >>>> I tried testing this on my end and I am seeing expected performance >>>> from VTK and ParaView. But the performance is dependent on the datasets >>>> used. Is it possible for you to share your datasets and scripts with us? >>>> Could you try this with smaller versions of your datasets and see if you >>>> are able to reproduce this? >>>> >>>> I am not familiar with the timeit module in Python. From the >>>> documentation it looks like it runs the code multiple times by default and >>>> prints the total time. Can you confirm if you have taken this into >>>> consideration in your script? >>>> >>>> A simple way to time operations in ParaView is to refer to the "Timer >>>> Log" under the "Tools" menu. You should see a line like: >>>> >>>> Execute vtkResampleWithDataSet id: 6788, 2.70556 seconds >>>> >>>> >>>> Thanks >>>> Sujin >>>> >>>> >>>> On Tue, May 15, 2018 at 1:05 PM, Evan Kao wrote: >>>> >>>>> Hi Shawn and Sujin, >>>>> >>>>> Thanks for the quick responses. The CPU on the computer I'm using is >>>>> an i7-6700 >>>>> >>>>> with 4 cores, 8 threads, and 3.4 GHz frequency. >>>>> >>>>> Multi-threading may be a factor, but it's hard to tell because >>>>> resampling in ParaView is so quick. ParaView is capable of using 100% of >>>>> the CPU, while VTK (in Python) will max out at 12-13%. However, for these >>>>> particular datasets, resampling doesn't appear to stress ParaView that much >>>>> (11-16% when observing the Windows Task Manager, and some of that may be >>>>> because of the rendering). However, I was under the impression that at >>>>> best multi-threading could only reduce the time it takes by N threads (ie >>>>> 8x), while the speed difference here is almost 1000x. I measured the times >>>>> for ParaView 5.5, VTK 8.1 (compiled elsewhere), and VTK 7.1 (compiled by >>>>> our group): >>>>> >>>>> 1. ParaView 5.5 - 1.1s, using a stopwatch, multiple trials. Timing >>>>> started the moment I clicked "Apply". >>>>> 2. VTK 8.1 - 922.47s, timed using Python's timeit module, >>>>> measuring only the vtkResampleWithDataSet.Update() method. >>>>> 3. VTK 7.1 - 950.47s, timed the same way as above. >>>>> >>>>> I'm aware of the difference in labeling between VTK and ParaView for >>>>> Source and Input (which confuses me all the time). I can verify the >>>>> correct data sets were assigned by saving the output (which should an >>>>> unstructured grid) and viewing it in ParaView - it looks identical to the >>>>> resampled data generated in ParaView (although it overwrites the point >>>>> scalars array and adds some ghost information that needs to be removed). >>>>> >>>>> Thanks, >>>>> Evan >>>>> >>>>> On Tue, May 15, 2018 at 7:38 AM, Sujin Philip < >>>>> sujin.philip at kitware.com> wrote: >>>>> >>>>>> Hi Evan, >>>>>> >>>>>> As Shawn mentioned it could be due to lack of multi-threading. Could >>>>>> you provide us the configuration of the system you are using? Like the >>>>>> number of cores/threads and the CPU frequency? Also please share the actual >>>>>> time that ParaView and VTK are taking. Is it possible for you to try out a >>>>>> slightly older VTK version and see if the performance difference is still >>>>>> there? >>>>>> >>>>>> Which dataset are you setting as input and which as source? The names >>>>>> are unfortunately opposite between VTK-m and ParaView due to legacy >>>>>> reasons. Probing with the unstructured grid as the source is much slower >>>>>> than probing with the structured grid as the source. So please confirm that >>>>>> the VTK pipeline is set up properly. >>>>>> >>>>>> Please let me know if none these seem to be the cause of your problem >>>>>> and I will dig deeper. >>>>>> >>>>>> Thanks >>>>>> Sujin >>>>>> >>>>>> >>>>>> >>>>>> On Tue, May 15, 2018 at 9:52 AM, Shawn Waldon < >>>>>> shawn.waldon at kitware.com> wrote: >>>>>> >>>>>>> Hi Evan, >>>>>>> >>>>>>> I suspect the differece is that the ParaView binaries were compiled >>>>>>> with TBB multithreading support and the Anaconda VTK was not. >>>>>>> vtkResampleWithDataSet is set up to use TBB multithreading if available. >>>>>>> Check the utilization of the cores on your computer when running each and >>>>>>> you will see ParaView using all available cores and Anaconda's VTK probably >>>>>>> only using one. It is also possible the cell locator change improved >>>>>>> things further but I'm not familiar with that. >>>>>>> >>>>>>> HTH, >>>>>>> >>>>>>> Shawn >>>>>>> >>>>>>> On Mon, May 14, 2018 at 7:54 PM, Evan Kao wrote: >>>>>>> >>>>>>>> Hello all, >>>>>>>> >>>>>>>> I am trying to resample a structured grid data (~1.4M points, 1.3M >>>>>>>> cells) with an unstructured grid (~320K points, 480K cells). In Paraview >>>>>>>> 5.5, this resampling is nearly instant with the Resample With Dataset >>>>>>>> filter. Yet in a Python script using vtkResampleWithDataSet from VTK >>>>>>>> 8.1.0, the same operation takes about 15 minutes (>2 orders of magnitude >>>>>>>> difference in speed). As far as I can tell from the VTK repository on >>>>>>>> Gitlab, the only difference between the Paraview/release version and the >>>>>>>> 8.1.0 or 8.1.1 tagged releases is a switch in the cell locator. Is this >>>>>>>> enough to explain the difference in the performance? If not, could someone >>>>>>>> enlighten me as to what the possible factors are here? >>>>>>>> >>>>>>>> Also, if it matters, this is all on a Windows 7 64-bit machine. >>>>>>>> Paraview is installed from binaries, while VTK was downloaded from an >>>>>>>> Anaconda distribution compiled by a third party. >>>>>>>> >>>>>>>> Thanks for your time, >>>>>>>> Evan Kao >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Powered by www.kitware.com >>>>>>>> >>>>>>>> Visit other Kitware open-source projects at >>>>>>>> http://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: >>>>>>>> https://vtk.org/mailman/listinfo/vtkusers >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Powered by www.kitware.com >>>>>>> >>>>>>> Visit other Kitware open-source projects at >>>>>>> http://www.kitware.com/opensource/opensource.html >>>>>>> >>>>>>> Please keep messages on-topic and check the VTK FAQ at: >>>>>>> http://www.vtk.org/Wiki/VTK_FAQ >>>>>>> >>>>>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>>>>> >>>>>>> Follow this link to subscribe/unsubscribe: >>>>>>> https://vtk.org/mailman/listinfo/vtkusers >>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tossin at gmail.com Wed May 16 15:33:03 2018 From: tossin at gmail.com (Evan Kao) Date: Wed, 16 May 2018 12:33:03 -0700 Subject: [vtkusers] Large performance difference between vtkResampleWithDataSet in VTK 8.1.0 and Resample with Dataset filter in Paraview 5.5 In-Reply-To: References: Message-ID: Hi Sujin, That makes sense. I had a colleague run the test script on a Mac using VTK 8.0.1, and it was fast. Just curious, but why does the old cell locator perform so badly on Windows? - Evan On Wed, May 16, 2018 at 8:48 AM, Sujin Philip wrote: > Hi Evan, > > I was finally able to reproduce this. So this is due to the poor > performance of the old cell locator in 8.1.0. The new cell locator code is > in ParaView 5.5 and VTK master. Sorry about the confusion. Let me know if > you have any further questions. > > Thanks > Sujin > > > On Tue, May 15, 2018 at 6:28 PM, Evan Kao wrote: > >> Hi Sujin, >> >> I thought I had put in the correct source/input, but I suppose I should >> have checked more closely. Still, it didn't make that much of a difference >> (634s or 10.5 min). I'll continue checking if this problem persists for me >> on other platforms. >> >> I also tried using vtkResampleWithDataSet inside a Programmable Filter in >> ParaView, and it performed quickly (0.98s). >> >> Is it possible to see the build flags for your version of VTK, or the >> ones that were used for the ParaView binaries? Were you using testing on >> VTK 8.1 or the latest version? >> >> Thanks, >> Evan Kao >> >> On Tue, May 15, 2018 at 2:36 PM, Sujin Philip >> wrote: >> >>> Hi Evan, >>> >>> Thanks for sharing the data. I tried your script on my Linux desktop and >>> the performance I see on both VTK and ParaView is similar and <1 second. >>> This is even without threading enabled. I haven't tried this on Windows yet. >>> >>> BTW, there is an error in the script you shared. The inputs to the >>> resample filter are in the wrong order and the >>> "vtkXMLUnstructuredGridWriter" throws an error saying that the data passed >>> to it is not an unstructured grid. I assume you want to resample the data >>> values from the structured grid on to the geometry provided by the >>> unstructured grid. The result will be an unstructured grid, which can be >>> written by the "vtkXMLUnstructuredGridWrite". For this the input should be >>> the "mesh" data and the source should be "image". >>> >>> So, currently I don't have a good explanation for what is causing the >>> performance degradation for you. It might be some issues with the builds, >>> or the Windows setup. You can maybe try building VTK yourself (make sure to >>> build in "Release" mode), or try another machine and see if the problem >>> persists. I will also try to reproduce this on a Windows machine. >>> >>> Thanks >>> Sujin >>> >>> >>> On Tue, May 15, 2018 at 4:47 PM, Evan Kao wrote: >>> >>>> Hello Sujin, >>>> >>>> Using the TimerLog, I got the following time from ParaView: >>>> >>>> Execute vtkResampleWithDataSet id: 10345, 0.42 seconds >>>> >>>> As for the timeit module, you can see how I use it in the attached >>>> Python script. I only use timeit's default_timer function to grab the time >>>> before and after completion of the vtkResampleWithDataSet method and take >>>> the difference as the time elapsed. Regardless, qualitatively ParaView is >>>> near-instant while VTK takes a while. >>>> >>>> Google drive links to the datasets themselves are here (hopefully this >>>> doesn't trigger any mailing list filters): Unstructured Grid (35MB) >>>> | Structured >>>> Grid (70MB) >>>> >>>> >>>> If I get a chance, I'll take a look at using smaller data sets. >>>> >>>> - Evan >>>> >>>> >>>> On Tue, May 15, 2018 at 12:32 PM, Sujin Philip < >>>> sujin.philip at kitware.com> wrote: >>>> >>>>> Hi Evan, >>>>> >>>>> I tried testing this on my end and I am seeing expected performance >>>>> from VTK and ParaView. But the performance is dependent on the datasets >>>>> used. Is it possible for you to share your datasets and scripts with us? >>>>> Could you try this with smaller versions of your datasets and see if you >>>>> are able to reproduce this? >>>>> >>>>> I am not familiar with the timeit module in Python. From the >>>>> documentation it looks like it runs the code multiple times by default and >>>>> prints the total time. Can you confirm if you have taken this into >>>>> consideration in your script? >>>>> >>>>> A simple way to time operations in ParaView is to refer to the "Timer >>>>> Log" under the "Tools" menu. You should see a line like: >>>>> >>>>> Execute vtkResampleWithDataSet id: 6788, 2.70556 seconds >>>>> >>>>> >>>>> Thanks >>>>> Sujin >>>>> >>>>> >>>>> On Tue, May 15, 2018 at 1:05 PM, Evan Kao wrote: >>>>> >>>>>> Hi Shawn and Sujin, >>>>>> >>>>>> Thanks for the quick responses. The CPU on the computer I'm using is >>>>>> an i7-6700 >>>>>> >>>>>> with 4 cores, 8 threads, and 3.4 GHz frequency. >>>>>> >>>>>> Multi-threading may be a factor, but it's hard to tell because >>>>>> resampling in ParaView is so quick. ParaView is capable of using 100% of >>>>>> the CPU, while VTK (in Python) will max out at 12-13%. However, for these >>>>>> particular datasets, resampling doesn't appear to stress ParaView that much >>>>>> (11-16% when observing the Windows Task Manager, and some of that may be >>>>>> because of the rendering). However, I was under the impression that at >>>>>> best multi-threading could only reduce the time it takes by N threads (ie >>>>>> 8x), while the speed difference here is almost 1000x. I measured the times >>>>>> for ParaView 5.5, VTK 8.1 (compiled elsewhere), and VTK 7.1 (compiled by >>>>>> our group): >>>>>> >>>>>> 1. ParaView 5.5 - 1.1s, using a stopwatch, multiple trials. >>>>>> Timing started the moment I clicked "Apply". >>>>>> 2. VTK 8.1 - 922.47s, timed using Python's timeit module, >>>>>> measuring only the vtkResampleWithDataSet.Update() method. >>>>>> 3. VTK 7.1 - 950.47s, timed the same way as above. >>>>>> >>>>>> I'm aware of the difference in labeling between VTK and ParaView for >>>>>> Source and Input (which confuses me all the time). I can verify the >>>>>> correct data sets were assigned by saving the output (which should an >>>>>> unstructured grid) and viewing it in ParaView - it looks identical to the >>>>>> resampled data generated in ParaView (although it overwrites the point >>>>>> scalars array and adds some ghost information that needs to be removed). >>>>>> >>>>>> Thanks, >>>>>> Evan >>>>>> >>>>>> On Tue, May 15, 2018 at 7:38 AM, Sujin Philip < >>>>>> sujin.philip at kitware.com> wrote: >>>>>> >>>>>>> Hi Evan, >>>>>>> >>>>>>> As Shawn mentioned it could be due to lack of multi-threading. Could >>>>>>> you provide us the configuration of the system you are using? Like the >>>>>>> number of cores/threads and the CPU frequency? Also please share the actual >>>>>>> time that ParaView and VTK are taking. Is it possible for you to try out a >>>>>>> slightly older VTK version and see if the performance difference is still >>>>>>> there? >>>>>>> >>>>>>> Which dataset are you setting as input and which as source? The >>>>>>> names are unfortunately opposite between VTK-m and ParaView due to legacy >>>>>>> reasons. Probing with the unstructured grid as the source is much slower >>>>>>> than probing with the structured grid as the source. So please confirm that >>>>>>> the VTK pipeline is set up properly. >>>>>>> >>>>>>> Please let me know if none these seem to be the cause of your >>>>>>> problem and I will dig deeper. >>>>>>> >>>>>>> Thanks >>>>>>> Sujin >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Tue, May 15, 2018 at 9:52 AM, Shawn Waldon < >>>>>>> shawn.waldon at kitware.com> wrote: >>>>>>> >>>>>>>> Hi Evan, >>>>>>>> >>>>>>>> I suspect the differece is that the ParaView binaries were compiled >>>>>>>> with TBB multithreading support and the Anaconda VTK was not. >>>>>>>> vtkResampleWithDataSet is set up to use TBB multithreading if available. >>>>>>>> Check the utilization of the cores on your computer when running each and >>>>>>>> you will see ParaView using all available cores and Anaconda's VTK probably >>>>>>>> only using one. It is also possible the cell locator change improved >>>>>>>> things further but I'm not familiar with that. >>>>>>>> >>>>>>>> HTH, >>>>>>>> >>>>>>>> Shawn >>>>>>>> >>>>>>>> On Mon, May 14, 2018 at 7:54 PM, Evan Kao wrote: >>>>>>>> >>>>>>>>> Hello all, >>>>>>>>> >>>>>>>>> I am trying to resample a structured grid data (~1.4M points, 1.3M >>>>>>>>> cells) with an unstructured grid (~320K points, 480K cells). In Paraview >>>>>>>>> 5.5, this resampling is nearly instant with the Resample With Dataset >>>>>>>>> filter. Yet in a Python script using vtkResampleWithDataSet from VTK >>>>>>>>> 8.1.0, the same operation takes about 15 minutes (>2 orders of magnitude >>>>>>>>> difference in speed). As far as I can tell from the VTK repository on >>>>>>>>> Gitlab, the only difference between the Paraview/release version and the >>>>>>>>> 8.1.0 or 8.1.1 tagged releases is a switch in the cell locator. Is this >>>>>>>>> enough to explain the difference in the performance? If not, could someone >>>>>>>>> enlighten me as to what the possible factors are here? >>>>>>>>> >>>>>>>>> Also, if it matters, this is all on a Windows 7 64-bit machine. >>>>>>>>> Paraview is installed from binaries, while VTK was downloaded from an >>>>>>>>> Anaconda distribution compiled by a third party. >>>>>>>>> >>>>>>>>> Thanks for your time, >>>>>>>>> Evan Kao >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> Powered by www.kitware.com >>>>>>>>> >>>>>>>>> Visit other Kitware open-source projects at >>>>>>>>> http://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: >>>>>>>>> https://vtk.org/mailman/listinfo/vtkusers >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Powered by www.kitware.com >>>>>>>> >>>>>>>> Visit other Kitware open-source projects at >>>>>>>> http://www.kitware.com/opensource/opensource.html >>>>>>>> >>>>>>>> Please keep messages on-topic and check the VTK FAQ at: >>>>>>>> http://www.vtk.org/Wiki/VTK_FAQ >>>>>>>> >>>>>>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>>>>>> >>>>>>>> Follow this link to subscribe/unsubscribe: >>>>>>>> https://vtk.org/mailman/listinfo/vtkusers >>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sujin.philip at kitware.com Wed May 16 15:46:46 2018 From: sujin.philip at kitware.com (Sujin Philip) Date: Wed, 16 May 2018 15:46:46 -0400 Subject: [vtkusers] Large performance difference between vtkResampleWithDataSet in VTK 8.1.0 and Resample with Dataset filter in Paraview 5.5 In-Reply-To: References: Message-ID: Its not just on Windows. Vtk 8.1.0 performs poorly on my Linux machine also. In my earlier tests I was building the wrong version that I thought had the old locator but actually had the new cell locator. That's why I was seeing good performance. Once I correctly checked out and built version 8.1, I could see the poor performance. Thanks Sujin On Wed, May 16, 2018 at 3:33 PM, Evan Kao wrote: > Hi Sujin, > > That makes sense. I had a colleague run the test script on a Mac using > VTK 8.0.1, and it was fast. > > Just curious, but why does the old cell locator perform so badly on > Windows? > > - Evan > > On Wed, May 16, 2018 at 8:48 AM, Sujin Philip > wrote: > >> Hi Evan, >> >> I was finally able to reproduce this. So this is due to the poor >> performance of the old cell locator in 8.1.0. The new cell locator code is >> in ParaView 5.5 and VTK master. Sorry about the confusion. Let me know if >> you have any further questions. >> >> Thanks >> Sujin >> >> >> On Tue, May 15, 2018 at 6:28 PM, Evan Kao wrote: >> >>> Hi Sujin, >>> >>> I thought I had put in the correct source/input, but I suppose I should >>> have checked more closely. Still, it didn't make that much of a difference >>> (634s or 10.5 min). I'll continue checking if this problem persists for me >>> on other platforms. >>> >>> I also tried using vtkResampleWithDataSet inside a Programmable Filter >>> in ParaView, and it performed quickly (0.98s). >>> >>> Is it possible to see the build flags for your version of VTK, or the >>> ones that were used for the ParaView binaries? Were you using testing on >>> VTK 8.1 or the latest version? >>> >>> Thanks, >>> Evan Kao >>> >>> On Tue, May 15, 2018 at 2:36 PM, Sujin Philip >>> wrote: >>> >>>> Hi Evan, >>>> >>>> Thanks for sharing the data. I tried your script on my Linux desktop >>>> and the performance I see on both VTK and ParaView is similar and <1 >>>> second. This is even without threading enabled. I haven't tried this on >>>> Windows yet. >>>> >>>> BTW, there is an error in the script you shared. The inputs to the >>>> resample filter are in the wrong order and the >>>> "vtkXMLUnstructuredGridWriter" throws an error saying that the data passed >>>> to it is not an unstructured grid. I assume you want to resample the data >>>> values from the structured grid on to the geometry provided by the >>>> unstructured grid. The result will be an unstructured grid, which can be >>>> written by the "vtkXMLUnstructuredGridWrite". For this the input should be >>>> the "mesh" data and the source should be "image". >>>> >>>> So, currently I don't have a good explanation for what is causing the >>>> performance degradation for you. It might be some issues with the builds, >>>> or the Windows setup. You can maybe try building VTK yourself (make sure to >>>> build in "Release" mode), or try another machine and see if the problem >>>> persists. I will also try to reproduce this on a Windows machine. >>>> >>>> Thanks >>>> Sujin >>>> >>>> >>>> On Tue, May 15, 2018 at 4:47 PM, Evan Kao wrote: >>>> >>>>> Hello Sujin, >>>>> >>>>> Using the TimerLog, I got the following time from ParaView: >>>>> >>>>> Execute vtkResampleWithDataSet id: 10345, 0.42 seconds >>>>> >>>>> As for the timeit module, you can see how I use it in the attached >>>>> Python script. I only use timeit's default_timer function to grab the time >>>>> before and after completion of the vtkResampleWithDataSet method and take >>>>> the difference as the time elapsed. Regardless, qualitatively ParaView is >>>>> near-instant while VTK takes a while. >>>>> >>>>> Google drive links to the datasets themselves are here (hopefully this >>>>> doesn't trigger any mailing list filters): Unstructured Grid (35MB) >>>>> >>>>> | Structured Grid (70MB) >>>>> >>>>> >>>>> If I get a chance, I'll take a look at using smaller data sets. >>>>> >>>>> - Evan >>>>> >>>>> >>>>> On Tue, May 15, 2018 at 12:32 PM, Sujin Philip < >>>>> sujin.philip at kitware.com> wrote: >>>>> >>>>>> Hi Evan, >>>>>> >>>>>> I tried testing this on my end and I am seeing expected performance >>>>>> from VTK and ParaView. But the performance is dependent on the datasets >>>>>> used. Is it possible for you to share your datasets and scripts with us? >>>>>> Could you try this with smaller versions of your datasets and see if you >>>>>> are able to reproduce this? >>>>>> >>>>>> I am not familiar with the timeit module in Python. From the >>>>>> documentation it looks like it runs the code multiple times by default and >>>>>> prints the total time. Can you confirm if you have taken this into >>>>>> consideration in your script? >>>>>> >>>>>> A simple way to time operations in ParaView is to refer to the "Timer >>>>>> Log" under the "Tools" menu. You should see a line like: >>>>>> >>>>>> Execute vtkResampleWithDataSet id: 6788, 2.70556 seconds >>>>>> >>>>>> >>>>>> Thanks >>>>>> Sujin >>>>>> >>>>>> >>>>>> On Tue, May 15, 2018 at 1:05 PM, Evan Kao wrote: >>>>>> >>>>>>> Hi Shawn and Sujin, >>>>>>> >>>>>>> Thanks for the quick responses. The CPU on the computer I'm using >>>>>>> is an i7-6700 >>>>>>> >>>>>>> with 4 cores, 8 threads, and 3.4 GHz frequency. >>>>>>> >>>>>>> Multi-threading may be a factor, but it's hard to tell because >>>>>>> resampling in ParaView is so quick. ParaView is capable of using 100% of >>>>>>> the CPU, while VTK (in Python) will max out at 12-13%. However, for these >>>>>>> particular datasets, resampling doesn't appear to stress ParaView that much >>>>>>> (11-16% when observing the Windows Task Manager, and some of that may be >>>>>>> because of the rendering). However, I was under the impression that at >>>>>>> best multi-threading could only reduce the time it takes by N threads (ie >>>>>>> 8x), while the speed difference here is almost 1000x. I measured the times >>>>>>> for ParaView 5.5, VTK 8.1 (compiled elsewhere), and VTK 7.1 (compiled by >>>>>>> our group): >>>>>>> >>>>>>> 1. ParaView 5.5 - 1.1s, using a stopwatch, multiple trials. >>>>>>> Timing started the moment I clicked "Apply". >>>>>>> 2. VTK 8.1 - 922.47s, timed using Python's timeit module, >>>>>>> measuring only the vtkResampleWithDataSet.Update() method. >>>>>>> 3. VTK 7.1 - 950.47s, timed the same way as above. >>>>>>> >>>>>>> I'm aware of the difference in labeling between VTK and ParaView for >>>>>>> Source and Input (which confuses me all the time). I can verify the >>>>>>> correct data sets were assigned by saving the output (which should an >>>>>>> unstructured grid) and viewing it in ParaView - it looks identical to the >>>>>>> resampled data generated in ParaView (although it overwrites the point >>>>>>> scalars array and adds some ghost information that needs to be removed). >>>>>>> >>>>>>> Thanks, >>>>>>> Evan >>>>>>> >>>>>>> On Tue, May 15, 2018 at 7:38 AM, Sujin Philip < >>>>>>> sujin.philip at kitware.com> wrote: >>>>>>> >>>>>>>> Hi Evan, >>>>>>>> >>>>>>>> As Shawn mentioned it could be due to lack of multi-threading. >>>>>>>> Could you provide us the configuration of the system you are using? Like >>>>>>>> the number of cores/threads and the CPU frequency? Also please share the >>>>>>>> actual time that ParaView and VTK are taking. Is it possible for you to try >>>>>>>> out a slightly older VTK version and see if the performance difference is >>>>>>>> still there? >>>>>>>> >>>>>>>> Which dataset are you setting as input and which as source? The >>>>>>>> names are unfortunately opposite between VTK-m and ParaView due to legacy >>>>>>>> reasons. Probing with the unstructured grid as the source is much slower >>>>>>>> than probing with the structured grid as the source. So please confirm that >>>>>>>> the VTK pipeline is set up properly. >>>>>>>> >>>>>>>> Please let me know if none these seem to be the cause of your >>>>>>>> problem and I will dig deeper. >>>>>>>> >>>>>>>> Thanks >>>>>>>> Sujin >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> On Tue, May 15, 2018 at 9:52 AM, Shawn Waldon < >>>>>>>> shawn.waldon at kitware.com> wrote: >>>>>>>> >>>>>>>>> Hi Evan, >>>>>>>>> >>>>>>>>> I suspect the differece is that the ParaView binaries were >>>>>>>>> compiled with TBB multithreading support and the Anaconda VTK was not. >>>>>>>>> vtkResampleWithDataSet is set up to use TBB multithreading if available. >>>>>>>>> Check the utilization of the cores on your computer when running each and >>>>>>>>> you will see ParaView using all available cores and Anaconda's VTK probably >>>>>>>>> only using one. It is also possible the cell locator change improved >>>>>>>>> things further but I'm not familiar with that. >>>>>>>>> >>>>>>>>> HTH, >>>>>>>>> >>>>>>>>> Shawn >>>>>>>>> >>>>>>>>> On Mon, May 14, 2018 at 7:54 PM, Evan Kao >>>>>>>>> wrote: >>>>>>>>> >>>>>>>>>> Hello all, >>>>>>>>>> >>>>>>>>>> I am trying to resample a structured grid data (~1.4M points, >>>>>>>>>> 1.3M cells) with an unstructured grid (~320K points, 480K cells). In >>>>>>>>>> Paraview 5.5, this resampling is nearly instant with the Resample With >>>>>>>>>> Dataset filter. Yet in a Python script using vtkResampleWithDataSet from >>>>>>>>>> VTK 8.1.0, the same operation takes about 15 minutes (>2 orders of >>>>>>>>>> magnitude difference in speed). As far as I can tell from the VTK >>>>>>>>>> repository on Gitlab, the only difference between the Paraview/release >>>>>>>>>> version and the 8.1.0 or 8.1.1 tagged releases is a switch in the cell >>>>>>>>>> locator. Is this enough to explain the difference in the performance? If >>>>>>>>>> not, could someone enlighten me as to what the possible factors are here? >>>>>>>>>> >>>>>>>>>> Also, if it matters, this is all on a Windows 7 64-bit machine. >>>>>>>>>> Paraview is installed from binaries, while VTK was downloaded from an >>>>>>>>>> Anaconda distribution compiled by a third party. >>>>>>>>>> >>>>>>>>>> Thanks for your time, >>>>>>>>>> Evan Kao >>>>>>>>>> >>>>>>>>>> _______________________________________________ >>>>>>>>>> Powered by www.kitware.com >>>>>>>>>> >>>>>>>>>> Visit other Kitware open-source projects at >>>>>>>>>> http://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: >>>>>>>>>> https://vtk.org/mailman/listinfo/vtkusers >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> Powered by www.kitware.com >>>>>>>>> >>>>>>>>> Visit other Kitware open-source projects at >>>>>>>>> http://www.kitware.com/opensource/opensource.html >>>>>>>>> >>>>>>>>> Please keep messages on-topic and check the VTK FAQ at: >>>>>>>>> http://www.vtk.org/Wiki/VTK_FAQ >>>>>>>>> >>>>>>>>> Search the list archives at: http://markmail.org/search/?q= >>>>>>>>> vtkusers >>>>>>>>> >>>>>>>>> Follow this link to subscribe/unsubscribe: >>>>>>>>> https://vtk.org/mailman/listinfo/vtkusers >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Wed May 16 16:42:52 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 16 May 2018 14:42:52 -0600 Subject: [vtkusers] Large performance difference between vtkResampleWithDataSet in VTK 8.1.0 and Resample with Dataset filter in Paraview 5.5 In-Reply-To: References: Message-ID: Does 8.1.1 also have the bad cell locator code? On Wed, May 16, 2018 at 1:46 PM, Sujin Philip wrote: > Its not just on Windows. Vtk 8.1.0 performs poorly on my Linux machine > also. In my earlier tests I was building the wrong version that I thought > had the old locator but actually had the new cell locator. That's why I was > seeing good performance. Once I correctly checked out and built version > 8.1, I could see the poor performance. > > Thanks > Sujin > > > On Wed, May 16, 2018 at 3:33 PM, Evan Kao wrote: > >> Hi Sujin, >> >> That makes sense. I had a colleague run the test script on a Mac using >> VTK 8.0.1, and it was fast. >> >> Just curious, but why does the old cell locator perform so badly on >> Windows? >> >> - Evan >> >> On Wed, May 16, 2018 at 8:48 AM, Sujin Philip >> wrote: >> >>> Hi Evan, >>> >>> I was finally able to reproduce this. So this is due to the poor >>> performance of the old cell locator in 8.1.0. The new cell locator code is >>> in ParaView 5.5 and VTK master. Sorry about the confusion. Let me know if >>> you have any further questions. >>> >>> Thanks >>> Sujin >>> >>> >>> On Tue, May 15, 2018 at 6:28 PM, Evan Kao wrote: >>> >>>> Hi Sujin, >>>> >>>> I thought I had put in the correct source/input, but I suppose I should >>>> have checked more closely. Still, it didn't make that much of a difference >>>> (634s or 10.5 min). I'll continue checking if this problem persists for me >>>> on other platforms. >>>> >>>> I also tried using vtkResampleWithDataSet inside a Programmable Filter >>>> in ParaView, and it performed quickly (0.98s). >>>> >>>> Is it possible to see the build flags for your version of VTK, or the >>>> ones that were used for the ParaView binaries? Were you using testing on >>>> VTK 8.1 or the latest version? >>>> >>>> Thanks, >>>> Evan Kao >>>> >>>> On Tue, May 15, 2018 at 2:36 PM, Sujin Philip >>> > wrote: >>>> >>>>> Hi Evan, >>>>> >>>>> Thanks for sharing the data. I tried your script on my Linux desktop >>>>> and the performance I see on both VTK and ParaView is similar and <1 >>>>> second. This is even without threading enabled. I haven't tried this on >>>>> Windows yet. >>>>> >>>>> BTW, there is an error in the script you shared. The inputs to the >>>>> resample filter are in the wrong order and the >>>>> "vtkXMLUnstructuredGridWriter" throws an error saying that the data passed >>>>> to it is not an unstructured grid. I assume you want to resample the data >>>>> values from the structured grid on to the geometry provided by the >>>>> unstructured grid. The result will be an unstructured grid, which can be >>>>> written by the "vtkXMLUnstructuredGridWrite". For this the input should be >>>>> the "mesh" data and the source should be "image". >>>>> >>>>> So, currently I don't have a good explanation for what is causing the >>>>> performance degradation for you. It might be some issues with the builds, >>>>> or the Windows setup. You can maybe try building VTK yourself (make sure to >>>>> build in "Release" mode), or try another machine and see if the problem >>>>> persists. I will also try to reproduce this on a Windows machine. >>>>> >>>>> Thanks >>>>> Sujin >>>>> >>>>> >>>>> On Tue, May 15, 2018 at 4:47 PM, Evan Kao wrote: >>>>> >>>>>> Hello Sujin, >>>>>> >>>>>> Using the TimerLog, I got the following time from ParaView: >>>>>> >>>>>> Execute vtkResampleWithDataSet id: 10345, 0.42 seconds >>>>>> >>>>>> As for the timeit module, you can see how I use it in the attached >>>>>> Python script. I only use timeit's default_timer function to grab the time >>>>>> before and after completion of the vtkResampleWithDataSet method and take >>>>>> the difference as the time elapsed. Regardless, qualitatively ParaView is >>>>>> near-instant while VTK takes a while. >>>>>> >>>>>> Google drive links to the datasets themselves are here (hopefully >>>>>> this doesn't trigger any mailing list filters): Unstructured Grid >>>>>> (35MB) >>>>>> >>>>>> | Structured Grid (70MB) >>>>>> >>>>>> >>>>>> If I get a chance, I'll take a look at using smaller data sets. >>>>>> >>>>>> - Evan >>>>>> >>>>>> >>>>>> On Tue, May 15, 2018 at 12:32 PM, Sujin Philip < >>>>>> sujin.philip at kitware.com> wrote: >>>>>> >>>>>>> Hi Evan, >>>>>>> >>>>>>> I tried testing this on my end and I am seeing expected performance >>>>>>> from VTK and ParaView. But the performance is dependent on the datasets >>>>>>> used. Is it possible for you to share your datasets and scripts with us? >>>>>>> Could you try this with smaller versions of your datasets and see if you >>>>>>> are able to reproduce this? >>>>>>> >>>>>>> I am not familiar with the timeit module in Python. From the >>>>>>> documentation it looks like it runs the code multiple times by default and >>>>>>> prints the total time. Can you confirm if you have taken this into >>>>>>> consideration in your script? >>>>>>> >>>>>>> A simple way to time operations in ParaView is to refer to the >>>>>>> "Timer Log" under the "Tools" menu. You should see a line like: >>>>>>> >>>>>>> Execute vtkResampleWithDataSet id: 6788, 2.70556 seconds >>>>>>> >>>>>>> >>>>>>> Thanks >>>>>>> Sujin >>>>>>> >>>>>>> >>>>>>> On Tue, May 15, 2018 at 1:05 PM, Evan Kao wrote: >>>>>>> >>>>>>>> Hi Shawn and Sujin, >>>>>>>> >>>>>>>> Thanks for the quick responses. The CPU on the computer I'm using >>>>>>>> is an i7-6700 >>>>>>>> >>>>>>>> with 4 cores, 8 threads, and 3.4 GHz frequency. >>>>>>>> >>>>>>>> Multi-threading may be a factor, but it's hard to tell because >>>>>>>> resampling in ParaView is so quick. ParaView is capable of using 100% of >>>>>>>> the CPU, while VTK (in Python) will max out at 12-13%. However, for these >>>>>>>> particular datasets, resampling doesn't appear to stress ParaView that much >>>>>>>> (11-16% when observing the Windows Task Manager, and some of that may be >>>>>>>> because of the rendering). However, I was under the impression that at >>>>>>>> best multi-threading could only reduce the time it takes by N threads (ie >>>>>>>> 8x), while the speed difference here is almost 1000x. I measured the times >>>>>>>> for ParaView 5.5, VTK 8.1 (compiled elsewhere), and VTK 7.1 (compiled by >>>>>>>> our group): >>>>>>>> >>>>>>>> 1. ParaView 5.5 - 1.1s, using a stopwatch, multiple trials. >>>>>>>> Timing started the moment I clicked "Apply". >>>>>>>> 2. VTK 8.1 - 922.47s, timed using Python's timeit module, >>>>>>>> measuring only the vtkResampleWithDataSet.Update() method. >>>>>>>> 3. VTK 7.1 - 950.47s, timed the same way as above. >>>>>>>> >>>>>>>> I'm aware of the difference in labeling between VTK and ParaView >>>>>>>> for Source and Input (which confuses me all the time). I can verify the >>>>>>>> correct data sets were assigned by saving the output (which should an >>>>>>>> unstructured grid) and viewing it in ParaView - it looks identical to the >>>>>>>> resampled data generated in ParaView (although it overwrites the point >>>>>>>> scalars array and adds some ghost information that needs to be removed). >>>>>>>> >>>>>>>> Thanks, >>>>>>>> Evan >>>>>>>> >>>>>>>> On Tue, May 15, 2018 at 7:38 AM, Sujin Philip < >>>>>>>> sujin.philip at kitware.com> wrote: >>>>>>>> >>>>>>>>> Hi Evan, >>>>>>>>> >>>>>>>>> As Shawn mentioned it could be due to lack of multi-threading. >>>>>>>>> Could you provide us the configuration of the system you are using? Like >>>>>>>>> the number of cores/threads and the CPU frequency? Also please share the >>>>>>>>> actual time that ParaView and VTK are taking. Is it possible for you to try >>>>>>>>> out a slightly older VTK version and see if the performance difference is >>>>>>>>> still there? >>>>>>>>> >>>>>>>>> Which dataset are you setting as input and which as source? The >>>>>>>>> names are unfortunately opposite between VTK-m and ParaView due to legacy >>>>>>>>> reasons. Probing with the unstructured grid as the source is much slower >>>>>>>>> than probing with the structured grid as the source. So please confirm that >>>>>>>>> the VTK pipeline is set up properly. >>>>>>>>> >>>>>>>>> Please let me know if none these seem to be the cause of your >>>>>>>>> problem and I will dig deeper. >>>>>>>>> >>>>>>>>> Thanks >>>>>>>>> Sujin >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> On Tue, May 15, 2018 at 9:52 AM, Shawn Waldon < >>>>>>>>> shawn.waldon at kitware.com> wrote: >>>>>>>>> >>>>>>>>>> Hi Evan, >>>>>>>>>> >>>>>>>>>> I suspect the differece is that the ParaView binaries were >>>>>>>>>> compiled with TBB multithreading support and the Anaconda VTK was not. >>>>>>>>>> vtkResampleWithDataSet is set up to use TBB multithreading if available. >>>>>>>>>> Check the utilization of the cores on your computer when running each and >>>>>>>>>> you will see ParaView using all available cores and Anaconda's VTK probably >>>>>>>>>> only using one. It is also possible the cell locator change improved >>>>>>>>>> things further but I'm not familiar with that. >>>>>>>>>> >>>>>>>>>> HTH, >>>>>>>>>> >>>>>>>>>> Shawn >>>>>>>>>> >>>>>>>>>> On Mon, May 14, 2018 at 7:54 PM, Evan Kao >>>>>>>>>> wrote: >>>>>>>>>> >>>>>>>>>>> Hello all, >>>>>>>>>>> >>>>>>>>>>> I am trying to resample a structured grid data (~1.4M points, >>>>>>>>>>> 1.3M cells) with an unstructured grid (~320K points, 480K cells). In >>>>>>>>>>> Paraview 5.5, this resampling is nearly instant with the Resample With >>>>>>>>>>> Dataset filter. Yet in a Python script using vtkResampleWithDataSet from >>>>>>>>>>> VTK 8.1.0, the same operation takes about 15 minutes (>2 orders of >>>>>>>>>>> magnitude difference in speed). As far as I can tell from the VTK >>>>>>>>>>> repository on Gitlab, the only difference between the Paraview/release >>>>>>>>>>> version and the 8.1.0 or 8.1.1 tagged releases is a switch in the cell >>>>>>>>>>> locator. Is this enough to explain the difference in the performance? If >>>>>>>>>>> not, could someone enlighten me as to what the possible factors are here? >>>>>>>>>>> >>>>>>>>>>> Also, if it matters, this is all on a Windows 7 64-bit machine. >>>>>>>>>>> Paraview is installed from binaries, while VTK was downloaded from an >>>>>>>>>>> Anaconda distribution compiled by a third party. >>>>>>>>>>> >>>>>>>>>>> Thanks for your time, >>>>>>>>>>> Evan Kao >>>>>>>>>>> >>>>>>>>>>> _______________________________________________ >>>>>>>>>>> Powered by www.kitware.com >>>>>>>>>>> >>>>>>>>>>> Visit other Kitware open-source projects at >>>>>>>>>>> http://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: >>>>>>>>>>> https://vtk.org/mailman/listinfo/vtkusers >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> _______________________________________________ >>>>>>>>>> Powered by www.kitware.com >>>>>>>>>> >>>>>>>>>> Visit other Kitware open-source projects at >>>>>>>>>> http://www.kitware.com/opensource/opensource.html >>>>>>>>>> >>>>>>>>>> Please keep messages on-topic and check the VTK FAQ at: >>>>>>>>>> http://www.vtk.org/Wiki/VTK_FAQ >>>>>>>>>> >>>>>>>>>> Search the list archives at: http://markmail.org/search/?q= >>>>>>>>>> vtkusers >>>>>>>>>> >>>>>>>>>> Follow this link to subscribe/unsubscribe: >>>>>>>>>> https://vtk.org/mailman/listinfo/vtkusers >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://vtk.org/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sujin.philip at kitware.com Wed May 16 16:56:06 2018 From: sujin.philip at kitware.com (Sujin Philip) Date: Wed, 16 May 2018 16:56:06 -0400 Subject: [vtkusers] Large performance difference between vtkResampleWithDataSet in VTK 8.1.0 and Resample with Dataset filter in Paraview 5.5 In-Reply-To: References: Message-ID: Hi David, Yes, the new code is not in 8.1.1. It's there in master. Thanks Sujin On Wed, May 16, 2018 at 4:42 PM, David Gobbi wrote: > Does 8.1.1 also have the bad cell locator code? > > > On Wed, May 16, 2018 at 1:46 PM, Sujin Philip > wrote: > >> Its not just on Windows. Vtk 8.1.0 performs poorly on my Linux machine >> also. In my earlier tests I was building the wrong version that I thought >> had the old locator but actually had the new cell locator. That's why I was >> seeing good performance. Once I correctly checked out and built version >> 8.1, I could see the poor performance. >> >> Thanks >> Sujin >> >> >> On Wed, May 16, 2018 at 3:33 PM, Evan Kao wrote: >> >>> Hi Sujin, >>> >>> That makes sense. I had a colleague run the test script on a Mac using >>> VTK 8.0.1, and it was fast. >>> >>> Just curious, but why does the old cell locator perform so badly on >>> Windows? >>> >>> - Evan >>> >>> On Wed, May 16, 2018 at 8:48 AM, Sujin Philip >>> wrote: >>> >>>> Hi Evan, >>>> >>>> I was finally able to reproduce this. So this is due to the poor >>>> performance of the old cell locator in 8.1.0. The new cell locator code is >>>> in ParaView 5.5 and VTK master. Sorry about the confusion. Let me know if >>>> you have any further questions. >>>> >>>> Thanks >>>> Sujin >>>> >>>> >>>> On Tue, May 15, 2018 at 6:28 PM, Evan Kao wrote: >>>> >>>>> Hi Sujin, >>>>> >>>>> I thought I had put in the correct source/input, but I suppose I >>>>> should have checked more closely. Still, it didn't make that much of a >>>>> difference (634s or 10.5 min). I'll continue checking if this problem >>>>> persists for me on other platforms. >>>>> >>>>> I also tried using vtkResampleWithDataSet inside a Programmable Filter >>>>> in ParaView, and it performed quickly (0.98s). >>>>> >>>>> Is it possible to see the build flags for your version of VTK, or the >>>>> ones that were used for the ParaView binaries? Were you using testing on >>>>> VTK 8.1 or the latest version? >>>>> >>>>> Thanks, >>>>> Evan Kao >>>>> >>>>> On Tue, May 15, 2018 at 2:36 PM, Sujin Philip < >>>>> sujin.philip at kitware.com> wrote: >>>>> >>>>>> Hi Evan, >>>>>> >>>>>> Thanks for sharing the data. I tried your script on my Linux desktop >>>>>> and the performance I see on both VTK and ParaView is similar and <1 >>>>>> second. This is even without threading enabled. I haven't tried this on >>>>>> Windows yet. >>>>>> >>>>>> BTW, there is an error in the script you shared. The inputs to the >>>>>> resample filter are in the wrong order and the >>>>>> "vtkXMLUnstructuredGridWriter" throws an error saying that the data passed >>>>>> to it is not an unstructured grid. I assume you want to resample the data >>>>>> values from the structured grid on to the geometry provided by the >>>>>> unstructured grid. The result will be an unstructured grid, which can be >>>>>> written by the "vtkXMLUnstructuredGridWrite". For this the input should be >>>>>> the "mesh" data and the source should be "image". >>>>>> >>>>>> So, currently I don't have a good explanation for what is causing the >>>>>> performance degradation for you. It might be some issues with the builds, >>>>>> or the Windows setup. You can maybe try building VTK yourself (make sure to >>>>>> build in "Release" mode), or try another machine and see if the problem >>>>>> persists. I will also try to reproduce this on a Windows machine. >>>>>> >>>>>> Thanks >>>>>> Sujin >>>>>> >>>>>> >>>>>> On Tue, May 15, 2018 at 4:47 PM, Evan Kao wrote: >>>>>> >>>>>>> Hello Sujin, >>>>>>> >>>>>>> Using the TimerLog, I got the following time from ParaView: >>>>>>> >>>>>>> Execute vtkResampleWithDataSet id: 10345, 0.42 seconds >>>>>>> >>>>>>> As for the timeit module, you can see how I use it in the attached >>>>>>> Python script. I only use timeit's default_timer function to grab the time >>>>>>> before and after completion of the vtkResampleWithDataSet method and take >>>>>>> the difference as the time elapsed. Regardless, qualitatively ParaView is >>>>>>> near-instant while VTK takes a while. >>>>>>> >>>>>>> Google drive links to the datasets themselves are here (hopefully >>>>>>> this doesn't trigger any mailing list filters): Unstructured Grid >>>>>>> (35MB) >>>>>>> >>>>>>> | Structured Grid (70MB) >>>>>>> >>>>>>> >>>>>>> If I get a chance, I'll take a look at using smaller data sets. >>>>>>> >>>>>>> - Evan >>>>>>> >>>>>>> >>>>>>> On Tue, May 15, 2018 at 12:32 PM, Sujin Philip < >>>>>>> sujin.philip at kitware.com> wrote: >>>>>>> >>>>>>>> Hi Evan, >>>>>>>> >>>>>>>> I tried testing this on my end and I am seeing expected performance >>>>>>>> from VTK and ParaView. But the performance is dependent on the datasets >>>>>>>> used. Is it possible for you to share your datasets and scripts with us? >>>>>>>> Could you try this with smaller versions of your datasets and see if you >>>>>>>> are able to reproduce this? >>>>>>>> >>>>>>>> I am not familiar with the timeit module in Python. From the >>>>>>>> documentation it looks like it runs the code multiple times by default and >>>>>>>> prints the total time. Can you confirm if you have taken this into >>>>>>>> consideration in your script? >>>>>>>> >>>>>>>> A simple way to time operations in ParaView is to refer to the >>>>>>>> "Timer Log" under the "Tools" menu. You should see a line like: >>>>>>>> >>>>>>>> Execute vtkResampleWithDataSet id: 6788, 2.70556 seconds >>>>>>>> >>>>>>>> >>>>>>>> Thanks >>>>>>>> Sujin >>>>>>>> >>>>>>>> >>>>>>>> On Tue, May 15, 2018 at 1:05 PM, Evan Kao wrote: >>>>>>>> >>>>>>>>> Hi Shawn and Sujin, >>>>>>>>> >>>>>>>>> Thanks for the quick responses. The CPU on the computer I'm using >>>>>>>>> is an i7-6700 >>>>>>>>> >>>>>>>>> with 4 cores, 8 threads, and 3.4 GHz frequency. >>>>>>>>> >>>>>>>>> Multi-threading may be a factor, but it's hard to tell because >>>>>>>>> resampling in ParaView is so quick. ParaView is capable of using 100% of >>>>>>>>> the CPU, while VTK (in Python) will max out at 12-13%. However, for these >>>>>>>>> particular datasets, resampling doesn't appear to stress ParaView that much >>>>>>>>> (11-16% when observing the Windows Task Manager, and some of that may be >>>>>>>>> because of the rendering). However, I was under the impression that at >>>>>>>>> best multi-threading could only reduce the time it takes by N threads (ie >>>>>>>>> 8x), while the speed difference here is almost 1000x. I measured the times >>>>>>>>> for ParaView 5.5, VTK 8.1 (compiled elsewhere), and VTK 7.1 (compiled by >>>>>>>>> our group): >>>>>>>>> >>>>>>>>> 1. ParaView 5.5 - 1.1s, using a stopwatch, multiple trials. >>>>>>>>> Timing started the moment I clicked "Apply". >>>>>>>>> 2. VTK 8.1 - 922.47s, timed using Python's timeit module, >>>>>>>>> measuring only the vtkResampleWithDataSet.Update() method. >>>>>>>>> 3. VTK 7.1 - 950.47s, timed the same way as above. >>>>>>>>> >>>>>>>>> I'm aware of the difference in labeling between VTK and ParaView >>>>>>>>> for Source and Input (which confuses me all the time). I can verify the >>>>>>>>> correct data sets were assigned by saving the output (which should an >>>>>>>>> unstructured grid) and viewing it in ParaView - it looks identical to the >>>>>>>>> resampled data generated in ParaView (although it overwrites the point >>>>>>>>> scalars array and adds some ghost information that needs to be removed). >>>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> Evan >>>>>>>>> >>>>>>>>> On Tue, May 15, 2018 at 7:38 AM, Sujin Philip < >>>>>>>>> sujin.philip at kitware.com> wrote: >>>>>>>>> >>>>>>>>>> Hi Evan, >>>>>>>>>> >>>>>>>>>> As Shawn mentioned it could be due to lack of multi-threading. >>>>>>>>>> Could you provide us the configuration of the system you are using? Like >>>>>>>>>> the number of cores/threads and the CPU frequency? Also please share the >>>>>>>>>> actual time that ParaView and VTK are taking. Is it possible for you to try >>>>>>>>>> out a slightly older VTK version and see if the performance difference is >>>>>>>>>> still there? >>>>>>>>>> >>>>>>>>>> Which dataset are you setting as input and which as source? The >>>>>>>>>> names are unfortunately opposite between VTK-m and ParaView due to legacy >>>>>>>>>> reasons. Probing with the unstructured grid as the source is much slower >>>>>>>>>> than probing with the structured grid as the source. So please confirm that >>>>>>>>>> the VTK pipeline is set up properly. >>>>>>>>>> >>>>>>>>>> Please let me know if none these seem to be the cause of your >>>>>>>>>> problem and I will dig deeper. >>>>>>>>>> >>>>>>>>>> Thanks >>>>>>>>>> Sujin >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On Tue, May 15, 2018 at 9:52 AM, Shawn Waldon < >>>>>>>>>> shawn.waldon at kitware.com> wrote: >>>>>>>>>> >>>>>>>>>>> Hi Evan, >>>>>>>>>>> >>>>>>>>>>> I suspect the differece is that the ParaView binaries were >>>>>>>>>>> compiled with TBB multithreading support and the Anaconda VTK was not. >>>>>>>>>>> vtkResampleWithDataSet is set up to use TBB multithreading if available. >>>>>>>>>>> Check the utilization of the cores on your computer when running each and >>>>>>>>>>> you will see ParaView using all available cores and Anaconda's VTK probably >>>>>>>>>>> only using one. It is also possible the cell locator change improved >>>>>>>>>>> things further but I'm not familiar with that. >>>>>>>>>>> >>>>>>>>>>> HTH, >>>>>>>>>>> >>>>>>>>>>> Shawn >>>>>>>>>>> >>>>>>>>>>> On Mon, May 14, 2018 at 7:54 PM, Evan Kao >>>>>>>>>>> wrote: >>>>>>>>>>> >>>>>>>>>>>> Hello all, >>>>>>>>>>>> >>>>>>>>>>>> I am trying to resample a structured grid data (~1.4M points, >>>>>>>>>>>> 1.3M cells) with an unstructured grid (~320K points, 480K cells). In >>>>>>>>>>>> Paraview 5.5, this resampling is nearly instant with the Resample With >>>>>>>>>>>> Dataset filter. Yet in a Python script using vtkResampleWithDataSet from >>>>>>>>>>>> VTK 8.1.0, the same operation takes about 15 minutes (>2 orders of >>>>>>>>>>>> magnitude difference in speed). As far as I can tell from the VTK >>>>>>>>>>>> repository on Gitlab, the only difference between the Paraview/release >>>>>>>>>>>> version and the 8.1.0 or 8.1.1 tagged releases is a switch in the cell >>>>>>>>>>>> locator. Is this enough to explain the difference in the performance? If >>>>>>>>>>>> not, could someone enlighten me as to what the possible factors are here? >>>>>>>>>>>> >>>>>>>>>>>> Also, if it matters, this is all on a Windows 7 64-bit >>>>>>>>>>>> machine. Paraview is installed from binaries, while VTK was downloaded >>>>>>>>>>>> from an Anaconda distribution compiled by a third party. >>>>>>>>>>>> >>>>>>>>>>>> Thanks for your time, >>>>>>>>>>>> Evan Kao >>>>>>>>>>>> >>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>> Powered by www.kitware.com >>>>>>>>>>>> >>>>>>>>>>>> Visit other Kitware open-source projects at >>>>>>>>>>>> http://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: >>>>>>>>>>>> https://vtk.org/mailman/listinfo/vtkusers >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> _______________________________________________ >>>>>>>>>>> Powered by www.kitware.com >>>>>>>>>>> >>>>>>>>>>> Visit other Kitware open-source projects at >>>>>>>>>>> http://www.kitware.com/opensource/opensource.html >>>>>>>>>>> >>>>>>>>>>> Please keep messages on-topic and check the VTK FAQ at: >>>>>>>>>>> http://www.vtk.org/Wiki/VTK_FAQ >>>>>>>>>>> >>>>>>>>>>> Search the list archives at: http://markmail.org/search/?q= >>>>>>>>>>> vtkusers >>>>>>>>>>> >>>>>>>>>>> Follow this link to subscribe/unsubscribe: >>>>>>>>>>> https://vtk.org/mailman/listinfo/vtkusers >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> https://vtk.org/mailman/listinfo/vtkusers >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From minpu.code at gmail.com Wed May 16 23:53:01 2018 From: minpu.code at gmail.com (pnt1614) Date: Wed, 16 May 2018 20:53:01 -0700 (MST) Subject: [vtkusers] How to use vtkbioeng with VTK 8.1? Message-ID: <1526529181497-0.post@n5.nabble.com> I am using VTK 8.1 and now I want to use vtkbioeng with VTK 8.1 but using CMake always returns an error message. First, an error message is "VTK_DIR-NOTFOUND". To solve this problem, I point VTK_DIR to a folder containing the VTKConfig.cmake file. Another error message is "unknow command VTK_MAKE_INSTANTIATOR3". Is there anyone knowing how to solve this problem and use vtkbioeng with VTK 8.1? Please, help me. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From 1krs1 at queensu.ca Thu May 17 12:10:22 2018 From: 1krs1 at queensu.ca (Kyle Sunderland) Date: Thu, 17 May 2018 16:10:22 +0000 Subject: [vtkusers] Questions About Python Wrapping Message-ID: Hi All, I'm trying to wrap a number of classes so that they can be used by the Python interactor in Slicer. (https://github.com/IGSIO/OpenIGTLinkIO) I created a macro for wrapping by copying and modifying the existing macro in Slicer (https://github.com/Slicer/Slicer/blob/master/CMake/vtkMacroKitPythonWrap.cmake). It (mostly) works, however I noticed that no functions are wrapped which have a definition that contains any of the wrapped classes. Does anyone have insight into what I might have missed? Also, as an additional question, is it still not possible to wrap functions that return a smart pointer? Thanks, Kyle -------------- next part -------------- An HTML attachment was scrubbed... URL: From lasso at queensu.ca Thu May 17 13:59:01 2018 From: lasso at queensu.ca (Andras Lasso) Date: Thu, 17 May 2018 17:59:01 +0000 Subject: [vtkusers] How to use vtkbioeng with VTK 8.1? In-Reply-To: <1526529181497-0.post@n5.nabble.com> References: <1526529181497-0.post@n5.nabble.com> Message-ID: Would you like to use vtkCollisionDetectionFilter? We have an updated version of this filter in SlicerRT, which works with latest VTK version: https://github.com/SlicerRt/SlicerRT/blob/master/SlicerRtCommon/vtkCollisionDetectionFilter.cxx This request comes up quite often, so it would make sense to add a collision detection filter to VTK proper. Andras -----Original Message----- From: vtkusers On Behalf Of pnt1614 Sent: Wednesday, May 16, 2018 11:53 PM To: vtkusers at vtk.org Subject: [vtkusers] How to use vtkbioeng with VTK 8.1? I am using VTK 8.1 and now I want to use vtkbioeng with VTK 8.1 but using CMake always returns an error message. First, an error message is "VTK_DIR-NOTFOUND". To solve this problem, I point VTK_DIR to a folder containing the VTKConfig.cmake file. Another error message is "unknow command VTK_MAKE_INSTANTIATOR3". Is there anyone knowing how to solve this problem and use vtkbioeng with VTK 8.1? Please, help me. -- 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%7C48e5c571254e46bbe5a908d5bba9b261%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636621259892659026&sdata=HHMTSa5rSZY9D0UVEhjzJ9Ea3VrRDjzEqcIeZR5B1fM%3D&reserved=0 _______________________________________________ Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7C48e5c571254e46bbe5a908d5bba9b261%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636621259892659026&sdata=pNXItKju%2FJhXUFUqrfiMd4dV593nx2zEtYdWQwQ3zgQ%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%7C48e5c571254e46bbe5a908d5bba9b261%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636621259892659026&sdata=gjbVRm8pnWSsYBWcAtRY4prCXCzUARNg94KOI%2BTJqoc%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%7C48e5c571254e46bbe5a908d5bba9b261%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636621259892659026&sdata=80RgKjCUdfLaeyCKfSeGOjbjB1sbfxwyK45maaXC1k8%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%7C48e5c571254e46bbe5a908d5bba9b261%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636621259892659026&sdata=5Qrc5I3W3YbiDitGUtR4RX2I8LFU3Zn8BTdep%2FXBlzk%3D&reserved=0 Follow this link to subscribe/unsubscribe: https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk.org%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%7C48e5c571254e46bbe5a908d5bba9b261%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636621259892659026&sdata=oSAlXd2qanA3Q3AiAIerAFB8OpbVYch7q99LQyeqcdE%3D&reserved=0 From bill.lorensen at gmail.com Thu May 17 14:05:22 2018 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Thu, 17 May 2018 11:05:22 -0700 Subject: [vtkusers] How to use vtkbioeng with VTK 8.1? In-Reply-To: References: <1526529181497-0.post@n5.nabble.com> Message-ID: Andras, I'll take a look at putting this into vtk, A first glance, the code looks pretty clean. What is the origin of the code? Is it based on the UNC collision detection? Bill On Thu, May 17, 2018 at 10:59 AM, Andras Lasso wrote: > Would you like to use vtkCollisionDetectionFilter? We have an updated version of this filter in SlicerRT, which works with latest VTK version: > > https://github.com/SlicerRt/SlicerRT/blob/master/SlicerRtCommon/vtkCollisionDetectionFilter.cxx > > This request comes up quite often, so it would make sense to add a collision detection filter to VTK proper. > > Andras > > -----Original Message----- > From: vtkusers On Behalf Of pnt1614 > Sent: Wednesday, May 16, 2018 11:53 PM > To: vtkusers at vtk.org > Subject: [vtkusers] How to use vtkbioeng with VTK 8.1? > > I am using VTK 8.1 and now I want to use vtkbioeng with VTK 8.1 but using CMake always returns an error message. First, an error message is "VTK_DIR-NOTFOUND". To solve this problem, I point VTK_DIR to a folder containing the VTKConfig.cmake file. Another error message is "unknow command VTK_MAKE_INSTANTIATOR3". > > Is there anyone knowing how to solve this problem and use vtkbioeng with VTK 8.1? Please, help me. > > > > -- > 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%7C48e5c571254e46bbe5a908d5bba9b261%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636621259892659026&sdata=HHMTSa5rSZY9D0UVEhjzJ9Ea3VrRDjzEqcIeZR5B1fM%3D&reserved=0 > _______________________________________________ > Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7C48e5c571254e46bbe5a908d5bba9b261%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636621259892659026&sdata=pNXItKju%2FJhXUFUqrfiMd4dV593nx2zEtYdWQwQ3zgQ%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%7C48e5c571254e46bbe5a908d5bba9b261%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636621259892659026&sdata=gjbVRm8pnWSsYBWcAtRY4prCXCzUARNg94KOI%2BTJqoc%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%7C48e5c571254e46bbe5a908d5bba9b261%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636621259892659026&sdata=80RgKjCUdfLaeyCKfSeGOjbjB1sbfxwyK45maaXC1k8%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%7C48e5c571254e46bbe5a908d5bba9b261%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636621259892659026&sdata=5Qrc5I3W3YbiDitGUtR4RX2I8LFU3Zn8BTdep%2FXBlzk%3D&reserved=0 > > Follow this link to subscribe/unsubscribe: > https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk.org%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%7C48e5c571254e46bbe5a908d5bba9b261%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636621259892659026&sdata=oSAlXd2qanA3Q3AiAIerAFB8OpbVYch7q99LQyeqcdE%3D&reserved=0 > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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: > https://vtk.org/mailman/listinfo/vtkusers -- Unpaid intern in BillsParadise at noware dot com From david.gobbi at gmail.com Thu May 17 14:13:47 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 17 May 2018 12:13:47 -0600 Subject: [vtkusers] Questions About Python Wrapping In-Reply-To: References: Message-ID: On Thu, May 17, 2018 at 10:10 AM, Kyle Sunderland <1krs1 at queensu.ca> wrote: > It (mostly) works, however I noticed that no functions are wrapped which have a definition that contains any of the wrapped classes. Does anyone have insight into what I might have missed? Is a vtk..Hierarchy.txt file generated for the wrapped module when you build it? If so, send it to me along with the header files you're wrapping, and I can take a look. > Also, as an additional question, is it still not possible to wrap functions that return a smart pointer? If this is a feature that you need, then add it to the bug tracker. Cheers, - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From lasso at queensu.ca Thu May 17 14:23:37 2018 From: lasso at queensu.ca (Andras Lasso) Date: Thu, 17 May 2018 18:23:37 +0000 Subject: [vtkusers] How to use vtkbioeng with VTK 8.1? In-Reply-To: References: <1526529181497-0.post@n5.nabble.com> Message-ID: The file headers indicate that the source is University College Dublin. // Goodwin Lawlor , University College Dublin, who wrote this class. // Thanks to Peter C. Everett for vtkOBBTree::IntersectWithOBBTree() in particular, // and all those who contributed to vtkOBBTree in general. Andras -----Original Message----- From: Bill Lorensen Sent: Thursday, May 17, 2018 2:05 PM To: Andras Lasso Cc: pnt1614 ; vtkusers at vtk.org Subject: Re: [vtkusers] How to use vtkbioeng with VTK 8.1? Andras, I'll take a look at putting this into vtk, A first glance, the code looks pretty clean. What is the origin of the code? Is it based on the UNC collision detection? Bill On Thu, May 17, 2018 at 10:59 AM, Andras Lasso wrote: > Would you like to use vtkCollisionDetectionFilter? We have an updated version of this filter in SlicerRT, which works with latest VTK version: > > https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithu > b.com%2FSlicerRt%2FSlicerRT%2Fblob%2Fmaster%2FSlicerRtCommon%2FvtkColl > isionDetectionFilter.cxx&data=02%7C01%7Classo%40queensu.ca%7C10dffbb24 > 8a44c57899608d5bc20c2d4%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C6 > 36621771249135173&sdata=SSHJGHmQ49QgnG1%2BLmin89ROMqYd0z42WwWusODU0NI% > 3D&reserved=0 > > This request comes up quite often, so it would make sense to add a collision detection filter to VTK proper. > > Andras > > -----Original Message----- > From: vtkusers On Behalf Of pnt1614 > Sent: Wednesday, May 16, 2018 11:53 PM > To: vtkusers at vtk.org > Subject: [vtkusers] How to use vtkbioeng with VTK 8.1? > > I am using VTK 8.1 and now I want to use vtkbioeng with VTK 8.1 but using CMake always returns an error message. First, an error message is "VTK_DIR-NOTFOUND". To solve this problem, I point VTK_DIR to a folder containing the VTKConfig.cmake file. Another error message is "unknow command VTK_MAKE_INSTANTIATOR3". > > Is there anyone knowing how to solve this problem and use vtkbioeng with VTK 8.1? Please, help me. > > > > -- > Sent from: > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fvtk.10 > 45678.n5.nabble.com%2FVTK-Users-f1224199.html&data=02%7C01%7Classo%40q > ueensu.ca%7C48e5c571254e46bbe5a908d5bba9b261%7Cd61ecb3b38b142d582c4efb > 2838b925c%7C1%7C0%7C636621259892659026&sdata=HHMTSa5rSZY9D0UVEhjzJ9Ea3 > VrRDjzEqcIeZR5B1fM%3D&reserved=0 > _______________________________________________ > Powered by > https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&dat > a=02%7C01%7Classo%40queensu.ca%7C48e5c571254e46bbe5a908d5bba9b261%7Cd6 > 1ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636621259892659026&sdata=pNXI > tKju%2FJhXUFUqrfiMd4dV593nx2zEtYdWQwQ3zgQ%3D&reserved=0 > > Visit other Kitware open-source projects at > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.ki > tware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40queens > u.ca%7C48e5c571254e46bbe5a908d5bba9b261%7Cd61ecb3b38b142d582c4efb2838b > 925c%7C1%7C0%7C636621259892659026&sdata=gjbVRm8pnWSsYBWcAtRY4prCXCzUAR > Ng94KOI%2BTJqoc%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.vt > k.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Classo%40queensu.ca%7C48e5c571254 > e46bbe5a908d5bba9b261%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636 > 621259892659026&sdata=80RgKjCUdfLaeyCKfSeGOjbjB1sbfxwyK45maaXC1k8%3D&r > eserved=0 > > Search the list archives at: > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkma > il.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Classo%40queensu.ca%7C > 48e5c571254e46bbe5a908d5bba9b261%7Cd61ecb3b38b142d582c4efb2838b925c%7C > 1%7C0%7C636621259892659026&sdata=5Qrc5I3W3YbiDitGUtR4RX2I8LFU3Zn8BTdep > %2FXBlzk%3D&reserved=0 > > Follow this link to subscribe/unsubscribe: > https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk.o > rg%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%7 > C48e5c571254e46bbe5a908d5bba9b261%7Cd61ecb3b38b142d582c4efb2838b925c%7 > C1%7C0%7C636621259892659026&sdata=oSAlXd2qanA3Q3AiAIerAFB8OpbVYch7q99L > QyeqcdE%3D&reserved=0 _______________________________________________ > Powered by > https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&dat > a=02%7C01%7Classo%40queensu.ca%7C10dffbb248a44c57899608d5bc20c2d4%7Cd6 > 1ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636621771249135173&sdata=%2BU > 2CKirLfva6Oo0M7%2FbXIy%2BuF4uqrA%2FLAyt%2BbHR2b1Q%3D&reserved=0 > > Visit other Kitware open-source projects at > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.ki > tware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40queens > u.ca%7C10dffbb248a44c57899608d5bc20c2d4%7Cd61ecb3b38b142d582c4efb2838b > 925c%7C1%7C0%7C636621771249135173&sdata=5%2BTV4X9N0ZXndHN5bg5vV1OcTYQC > ECKzNMrd1TK8v2o%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.vt > k.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Classo%40queensu.ca%7C10dffbb248a > 44c57899608d5bc20c2d4%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636 > 621771249135173&sdata=lD4Rmc4r1BucoIWNPhqbN0SdIqc%2B389MasPP%2FITa240% > 3D&reserved=0 > > Search the list archives at: > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkma > il.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Classo%40queensu.ca%7C > 10dffbb248a44c57899608d5bc20c2d4%7Cd61ecb3b38b142d582c4efb2838b925c%7C > 1%7C0%7C636621771249135173&sdata=UdTrOpw2TW2IdN5iO%2BD0STxfOlVtgMpu3Vq > %2BIwf3fBA%3D&reserved=0 > > Follow this link to subscribe/unsubscribe: > https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk.o > rg%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%7 > C10dffbb248a44c57899608d5bc20c2d4%7Cd61ecb3b38b142d582c4efb2838b925c%7 > C1%7C0%7C636621771249135173&sdata=hA1Z%2B1WL75VJEAM77Af%2Bl6Y9RRVmc5dU > w0Eelm9I%2FXE%3D&reserved=0 -- Unpaid intern in BillsParadise at noware dot com From david.gobbi at gmail.com Thu May 17 16:54:52 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 17 May 2018 14:54:52 -0600 Subject: [vtkusers] Questions About Python Wrapping In-Reply-To: References: Message-ID: Hi Kyle, Thanks for sending the files. I see that the parameters for those methods are actually smart pointers, and as you have already noted, smart pointers aren't wrapped. This has never been an issue in VTK proper or for most VTK projects, since VTK methods generally use raw pointers. The header file you sent is closer to ITK style than to VTK style. I definitely think that it would be worthwhile to add better smart pointer handling to the wrappers. - David On Thu, May 17, 2018 at 12:13 PM, David Gobbi wrote: > On Thu, May 17, 2018 at 10:10 AM, Kyle Sunderland <1krs1 at queensu.ca> > wrote: > > It (mostly) works, however I noticed that no functions are wrapped which > have a definition that contains any of the wrapped classes. Does anyone > have insight into what I might have missed? > > Is a vtk..Hierarchy.txt file generated for the wrapped module when you > build it? If so, send it to me along with the header files you're > wrapping, and I can take a look. > > > Also, as an additional question, is it still not possible to wrap > functions that return a smart pointer? > > If this is a feature that you need, then add it to the bug tracker. > > Cheers, > - David > -------------- next part -------------- An HTML attachment was scrubbed... URL: From 1krs1 at queensu.ca Thu May 17 17:43:41 2018 From: 1krs1 at queensu.ca (Kyle Sunderland) Date: Thu, 17 May 2018 21:43:41 +0000 Subject: [vtkusers] Questions About Python Wrapping In-Reply-To: References: , Message-ID: Hi David, Yes, many of the functions in OpenIGTLinkIO return smart pointers, and are not wrapped. Two of the testing functions take/return raw igtlioConnector pointers (igtlioConnector being a vtkObject), so I'm confused as to why they aren't wrapped. igtlioConnector* TestReturnWrap(); void TestArgumentWrap(igtlioConnector* a); Thanks again, Kyle ________________________________ From: David Gobbi Sent: May 17, 2018 4:54:52 PM To: Kyle Sunderland Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Questions About Python Wrapping Hi Kyle, Thanks for sending the files. I see that the parameters for those methods are actually smart pointers, and as you have already noted, smart pointers aren't wrapped. This has never been an issue in VTK proper or for most VTK projects, since VTK methods generally use raw pointers. The header file you sent is closer to ITK style than to VTK style. I definitely think that it would be worthwhile to add better smart pointer handling to the wrappers. - David On Thu, May 17, 2018 at 12:13 PM, David Gobbi > wrote: On Thu, May 17, 2018 at 10:10 AM, Kyle Sunderland <1krs1 at queensu.ca> wrote: > It (mostly) works, however I noticed that no functions are wrapped which have a definition that contains any of the wrapped classes. Does anyone have insight into what I might have missed? Is a vtk..Hierarchy.txt file generated for the wrapped module when you build it? If so, send it to me along with the header files you're wrapping, and I can take a look. > Also, as an additional question, is it still not possible to wrap functions that return a smart pointer? If this is a feature that you need, then add it to the bug tracker. Cheers, - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Thu May 17 17:51:12 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 17 May 2018 15:51:12 -0600 Subject: [vtkusers] Questions About Python Wrapping In-Reply-To: References: Message-ID: Probably because the wrappers are still tuned to only recognize parameters with class names that begin with "vtk" as valid. - David On Thu, May 17, 2018 at 3:43 PM, Kyle Sunderland <1krs1 at queensu.ca> wrote: > > Hi David, > > Yes, many of the functions in OpenIGTLinkIO return smart pointers, and are not wrapped. > > Two of the testing functions take/return raw igtlioConnector pointers (igtlioConnector being a vtkObject), so I'm confused as to why they aren't wrapped. > > igtlioConnector* TestReturnWrap(); > void TestArgumentWrap(igtlioConnector* a); > > Thanks again, > > Kyle > > ________________________________ > From: David Gobbi > Sent: May 17, 2018 4:54:52 PM > To: Kyle Sunderland > Cc: vtkusers at vtk.org > Subject: Re: [vtkusers] Questions About Python Wrapping > > Hi Kyle, > > Thanks for sending the files. I see that the parameters for those methods are actually smart pointers, and as you have already noted, smart pointers aren't wrapped. > > This has never been an issue in VTK proper or for most VTK projects, since VTK methods generally use raw pointers. The header file you sent is closer to ITK style than to VTK style. > > I definitely think that it would be worthwhile to add better smart pointer handling to the wrappers. > > - David > > > On Thu, May 17, 2018 at 12:13 PM, David Gobbi wrote: > > On Thu, May 17, 2018 at 10:10 AM, Kyle Sunderland <1krs1 at queensu.ca> wrote: > > It (mostly) works, however I noticed that no functions are wrapped which have a definition that contains any of the wrapped classes. Does anyone have insight into what I might have missed? > > Is a vtk..Hierarchy.txt file generated for the wrapped module when you build it? If so, send it to me along with the header files you're wrapping, and I can take a look. > > > Also, as an additional question, is it still not possible to wrap functions that return a smart pointer? > > If this is a feature that you need, then add it to the bug tracker. > > Cheers, > - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From lasso at queensu.ca Thu May 17 18:29:06 2018 From: lasso at queensu.ca (Andras Lasso) Date: Thu, 17 May 2018 22:29:06 +0000 Subject: [vtkusers] Questions About Python Wrapping In-Reply-To: References: , Message-ID: <41e7e0a8-65f5-4d81-a496-c0892530e044@queensu.ca> The main advantage of the ability to return smart pointers would be that ownership of VTK objects could be transferred safely to the caller, without requiring calling UnRegister(None). C++ developers are aware of pointers but for Python users it is a mistery why sometimes they need to call UnRegister to avoid memory leaks. Andras ________________________________ From: David Gobbi Sent: Thursday, May 17, 2018 4:55 PM To: Kyle Sunderland Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Questions About Python Wrapping Hi Kyle, Thanks for sending the files. I see that the parameters for those methods are actually smart pointers, and as you have already noted, smart pointers aren't wrapped. This has never been an issue in VTK proper or for most VTK projects, since VTK methods generally use raw pointers. The header file you sent is closer to ITK style than to VTK style. I definitely think that it would be worthwhile to add better smart pointer handling to the wrappers. - David On Thu, May 17, 2018 at 12:13 PM, David Gobbi > wrote: On Thu, May 17, 2018 at 10:10 AM, Kyle Sunderland <1krs1 at queensu.ca> wrote: > It (mostly) works, however I noticed that no functions are wrapped which have a definition that contains any of the wrapped classes. Does anyone have insight into what I might have missed? Is a vtk..Hierarchy.txt file generated for the wrapped module when you build it? If so, send it to me along with the header files you're wrapping, and I can take a look. > Also, as an additional question, is it still not possible to wrap functions that return a smart pointer? If this is a feature that you need, then add it to the bug tracker. Cheers, - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Thu May 17 19:04:10 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 17 May 2018 17:04:10 -0600 Subject: [vtkusers] Questions About Python Wrapping In-Reply-To: <41e7e0a8-65f5-4d81-a496-c0892530e044@queensu.ca> References: <41e7e0a8-65f5-4d81-a496-c0892530e044@queensu.ca> Message-ID: The vtkSmartPointer isn't very safe in this regard. It is easy to accidentally do the following, since VTK smart pointers implicitly convert to raw pointers: vtkSmartPointer MyMethod(); vtkObject *obj = MyMethod(); // ownership is not caught, object is autodeleted The preferred way of dealing with transfer of ownership for returned values in VTK is to add the VTK_NEWINSTANCE hint to the return value. Then the wrappers will automatically handle the reference count. As for people who use these methods from C++, they still have to worry about memory leaks, but at least they don't have to worry about memory corruption caused by mistakes like the one in the example above. - David On Thu, May 17, 2018 at 4:29 PM, Andras Lasso wrote: > The main advantage of the ability to return smart pointers would be that > ownership of VTK objects could be transferred safely to the caller, without > requiring calling UnRegister(None). C++ developers are aware of pointers > but for Python users it is a mistery why sometimes they need to call > UnRegister to avoid memory leaks. > > Andras > ------------------------------ > *From:* David Gobbi > *Sent:* Thursday, May 17, 2018 4:55 PM > *To:* Kyle Sunderland > *Cc:* vtkusers at vtk.org > *Subject:* Re: [vtkusers] Questions About Python Wrapping > > Hi Kyle, > > Thanks for sending the files. I see that the parameters for those methods > are actually smart pointers, and as you have already noted, smart pointers > aren't wrapped. > > This has never been an issue in VTK proper or for most VTK projects, since > VTK methods generally use raw pointers. The header file you sent is closer > to ITK style than to VTK style. > > I definitely think that it would be worthwhile to add better smart pointer > handling to the wrappers. > > - David > > > On Thu, May 17, 2018 at 12:13 PM, David Gobbi > wrote: > >> On Thu, May 17, 2018 at 10:10 AM, Kyle Sunderland <1krs1 at queensu.ca> >> wrote: >> > It (mostly) works, however I noticed that no functions are wrapped >> which have a definition that contains any of the wrapped classes. Does >> anyone have insight into what I might have missed? >> >> Is a vtk..Hierarchy.txt file generated for the wrapped module when you >> build it? If so, send it to me along with the header files you're >> wrapping, and I can take a look. >> >> > Also, as an additional question, is it still not possible to wrap >> functions that return a smart pointer? >> >> If this is a feature that you need, then add it to the bug tracker. >> >> Cheers, >> - David >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lasso at queensu.ca Thu May 17 21:05:36 2018 From: lasso at queensu.ca (Andras Lasso) Date: Fri, 18 May 2018 01:05:36 +0000 Subject: [vtkusers] Questions About Python Wrapping In-Reply-To: References: <41e7e0a8-65f5-4d81-a496-c0892530e044@queensu.ca> Message-ID: VTK_NEWINSTANCE hint is great! For Python, it solves the returned object ownership issue completely in a nice and robust way (now we just need to figure out how to update all our code base to use this). For C++, a new smart pointer type (vtkSafePointer?) could be added that is exclusively used for returning new instances. This smart pointer type would not have explicit converter to raw pointer but could be directly assigned to vtkSmartPointer. It could also have a helper method for backward compatibility, which would increment reference count and return a raw pointer. This new pointer type could be easily introduced for new classes, but for existing classes it would require small change in all code where new VTK object instances are returned, which developers would probably not like. Maybe it could be done when changes around this are required anyway for some other reasons. Andras From: David Gobbi Sent: Thursday, May 17, 2018 7:04 PM To: Andras Lasso Cc: Kyle Sunderland <1krs1 at queensu.ca>; vtkusers at vtk.org Subject: Re: [vtkusers] Questions About Python Wrapping The vtkSmartPointer isn't very safe in this regard. It is easy to accidentally do the following, since VTK smart pointers implicitly convert to raw pointers: vtkSmartPointer MyMethod(); vtkObject *obj = MyMethod(); // ownership is not caught, object is autodeleted The preferred way of dealing with transfer of ownership for returned values in VTK is to add the VTK_NEWINSTANCE hint to the return value. Then the wrappers will automatically handle the reference count. As for people who use these methods from C++, they still have to worry about memory leaks, but at least they don't have to worry about memory corruption caused by mistakes like the one in the example above. - David On Thu, May 17, 2018 at 4:29 PM, Andras Lasso > wrote: The main advantage of the ability to return smart pointers would be that ownership of VTK objects could be transferred safely to the caller, without requiring calling UnRegister(None). C++ developers are aware of pointers but for Python users it is a mistery why sometimes they need to call UnRegister to avoid memory leaks. Andras ________________________________ From: David Gobbi > Sent: Thursday, May 17, 2018 4:55 PM To: Kyle Sunderland Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Questions About Python Wrapping Hi Kyle, Thanks for sending the files. I see that the parameters for those methods are actually smart pointers, and as you have already noted, smart pointers aren't wrapped. This has never been an issue in VTK proper or for most VTK projects, since VTK methods generally use raw pointers. The header file you sent is closer to ITK style than to VTK style. I definitely think that it would be worthwhile to add better smart pointer handling to the wrappers. - David On Thu, May 17, 2018 at 12:13 PM, David Gobbi > wrote: On Thu, May 17, 2018 at 10:10 AM, Kyle Sunderland <1krs1 at queensu.ca> wrote: > It (mostly) works, however I noticed that no functions are wrapped which have a definition that contains any of the wrapped classes. Does anyone have insight into what I might have missed? Is a vtk..Hierarchy.txt file generated for the wrapped module when you build it? If so, send it to me along with the header files you're wrapping, and I can take a look. > Also, as an additional question, is it still not possible to wrap functions that return a smart pointer? If this is a feature that you need, then add it to the bug tracker. Cheers, - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From minpu.code at gmail.com Thu May 17 21:16:56 2018 From: minpu.code at gmail.com (pnt1614) Date: Thu, 17 May 2018 18:16:56 -0700 (MST) Subject: [vtkusers] How to use vtkbioeng with VTK 8.1? In-Reply-To: References: <1526529181497-0.post@n5.nabble.com> Message-ID: <1526606216479-0.post@n5.nabble.com> Thanks Andras, I try it and let you know the result. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From minpu.code at gmail.com Thu May 17 21:24:29 2018 From: minpu.code at gmail.com (pnt1614) Date: Thu, 17 May 2018 18:24:29 -0700 (MST) Subject: [vtkusers] How to use vtkIntersectionPolyDataFilter? Message-ID: <1526606669309-0.post@n5.nabble.com> I follow the example https://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/IntersectionPolyDataFilter to find an intersection of 2 polydata and it works. But when I use 2 loaded stl models, I got an error("Exception thrown at 0x010B6AEC (vtkFiltersGeneral-8.1.dll) in MFC_VTK.exe: 0xC0000005: Access violation reading location 0x4032EFEC." So is there any condition to use vtkIntersectionPolyDataFilter? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From cory.quammen at kitware.com Thu May 17 22:28:00 2018 From: cory.quammen at kitware.com (Cory Quammen) Date: Thu, 17 May 2018 22:28:00 -0400 Subject: [vtkusers] How to use vtkIntersectionPolyDataFilter? In-Reply-To: <1526606669309-0.post@n5.nabble.com> References: <1526606669309-0.post@n5.nabble.com> Message-ID: vtkIntersectionPolyDataFilter requires that the two surfaces intersect but that no triangles overlap in the same plane. If you'd like, you could post an issue withe the STL files at https://gitlab.kitware.com/vtk/vtk/issues Best regards, Cory On Thu, May 17, 2018 at 9:24 PM pnt1614 wrote: > I follow the example > > https://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/IntersectionPolyDataFilter > to find an intersection of 2 polydata and it works. But when I use 2 loaded > stl models, I got an error("Exception thrown at 0x010B6AEC > (vtkFiltersGeneral-8.1.dll) in MFC_VTK.exe: 0xC0000005: Access violation > reading location 0x4032EFEC." > > So is there any condition to use vtkIntersectionPolyDataFilter? > > > > -- > 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: > https://vtk.org/mailman/listinfo/vtkusers > -- Cory Quammen Staff R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Fri May 18 05:34:58 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Fri, 18 May 2018 11:34:58 +0200 Subject: [vtkusers] vtkMultiVolume and shading In-Reply-To: References: Message-ID: 2018-04-24 22:14 GMT+02:00 Csaba Pinter : > Hi Sankhesh and Elvis, > > The first issue that I was now able to confirm is that SetVisibility called on the individual vtkVolume objects within vtkMultiVolume has no effect. Not sure if this is intentional or not, but naively I'd think this is the way to show/hide a volume. I'm not fond of the idea to clear the connection in the mapper and set volume to null every time I want to hide one. > The way to reproduce this is for example adding these lines to line 118 in Rendering\Volume\Testing\Cxx\TestGPURayCastMultiVolumeOverlapping.cxx > else if (key == "w") > { > this->Volume->SetVisibility(!this->Volume->GetVisibility()); > } > If you start the test interactively (-I), then nothing happens if you press w. > > The other issue is that the user transform I set to the first volume seems to be ignored, while the second volume's transform is used properly. I haven't been able to reproduce it with this test yet, so I'll keep working on it until I find out what is the exact issue. Hi again Csaba. Were you ever able to reproduce the "transform first volume" problem? In my own experiments with vtkMultiVolume, I seem to be hitting a similar issue. In my case it's SetPosition that won't bite on the first volume (I think...), but I guess that is probably the same issue you were seeing. So far I've been unable to reproduce it in a minimal test case though :( Best regards, Elvis > > Cheers, > csaba > > -----Original Message----- > From: Elvis Stansvik > Sent: Tuesday, April 24, 2018 10:51 > To: Csaba Pinter > Cc: Sankhesh Jhaveri ; vtkusers at vtk.org > Subject: Re: [vtkusers] vtkMultiVolume and shading > > 2018-04-24 15:15 GMT+02:00 Csaba Pinter : >> Hi Sankhesh, >> >> >> >> Thanks for the quick answer! Just in a nutshell, what would be needed >> to do programming-wise to add shading in the code? >> >> >> >> Also I?m wondering if the situation about funding applies to bugfixes >> as well? I am struggling with issues related to per-volume visibility >> and user transforms, and I think I?ll get back to you soon with >> self-contained test cases once I was able to figure out which of these >> are on the VTK side and how to reproduce them easily. > > I'm also about to experiment with the multi-volume support. Would be interesting to hear from you what problems you ran into wrt to per-volume visibility / user transforms, so I know what to look out for :) So if you file issues for those it would be great if you could link to them here. > > Cheers, > Elvis > >> >> >> >> Thanks, >> >> csaba >> >> >> >> From: Sankhesh Jhaveri >> Sent: Monday, April 23, 2018 21:15 >> To: Csaba Pinter >> Cc: vtkusers at vtk.org >> Subject: Re: [vtkusers] vtkMultiVolume and shading >> >> >> >> Hi Csaba, >> >> I don?t believe there is a technical limitation. It was merely that >> the original effort for adding multiple overlapping volumes support >> was focused on selected features. I am not aware of current >> efforts/funding to add support for additional features like shading, different blend modes, etc. >> >> Thanks, >> Sankhesh >> >> >> >> On Mon, Apr 23, 2018 at 3:45 PM Csaba Pinter >> wrote: >> >> Hello, >> >> >> >> I?m experimenting with using vtkMultiVolume to add proper multi-volume >> rendering support into 3D Slicer. My main question is the reason >> behind this actor not supporting shading, as apparent when used, but >> also mentioned in the corresponding test: >> >> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithu >> b.com%2FKitware%2FVTK%2Fblob%2Fmaster%2FRendering%2FVolume%2FTesting%2 >> FCxx%2FTestGPURayCastMultiVolumeOverlapping.cxx%23L229&data=02%7C01%7C >> csaba.pinter%40queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3 >> b38b142d582c4efb2838b925c%7C1%7C0%7C636601782604952003&sdata=Ylx6UE%2B >> 0l7IeQEWU5OEkSYHXSAuBYLT8DzB1RobJY34%3D&reserved=0 >> >> Is this a technical limitation that would be very hard to overcome, or >> is it something simpler? I?m asking this because for this actor to be >> really used for volume rendering, shading would be necessary. >> >> >> >> Thank you, >> >> Csaba >> >> _______________________________________________ >> Powered by >> https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&dat >> a=02%7C01%7Ccsaba.pinter%40queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c9 >> 90%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636601782604952003&sda >> ta=OAQC2JW%2FBdByHi6rzs3UR3OuEYMXVtnIBzyO2DLUEBg%3D&reserved=0 >> >> Visit other Kitware open-source projects at >> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.ki >> tware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Ccsaba.pinter%4 >> 0queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4e >> fb2838b925c%7C1%7C0%7C636601782604952003&sdata=ILwtCl2ODMcW2PistT%2BUe >> pqKoQ7hCylxaWiGofVT5L8%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.vt >> k.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Ccsaba.pinter%40queensu.ca%7Ce394 >> ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C >> 0%7C636601782604952003&sdata=M05RBjDP8XffO2U1b2I%2BMOI2jswVhNERqdrgv%2 >> Fbd%2Bmo%3D&reserved=0 >> >> Search the list archives at: >> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkma >> il.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Ccsaba.pinter%40queens >> u.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb2838b >> 925c%7C1%7C0%7C636601782604952003&sdata=%2B9tRXKCTKzxtmbkE9hWJz1%2FooB >> fefTvNJWtuJta0b1o%3D&reserved=0 >> >> Follow this link to subscribe/unsubscribe: >> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk.o >> rg%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Ccsaba.pinter%40queen >> su.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb2838 >> b925c%7C1%7C0%7C636601782604952003&sdata=2HdbAKBlfe1JNhyMG%2BCo%2FnwJ2 >> o2IWDqQHl%2BCIjbu3Fs%3D&reserved=0 >> >> -- >> >> Sankhesh Jhaveri >> >> Sr. Research & Development Engineer | Kitware | (518) 881-4417 >> >> >> _______________________________________________ >> Powered by >> https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&dat >> a=02%7C01%7Ccsaba.pinter%40queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c9 >> 90%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636601782604952003&sda >> ta=OAQC2JW%2FBdByHi6rzs3UR3OuEYMXVtnIBzyO2DLUEBg%3D&reserved=0 >> >> Visit other Kitware open-source projects at >> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.ki >> tware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Ccsaba.pinter%4 >> 0queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4e >> fb2838b925c%7C1%7C0%7C636601782604952003&sdata=ILwtCl2ODMcW2PistT%2BUe >> pqKoQ7hCylxaWiGofVT5L8%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.vt >> k.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Ccsaba.pinter%40queensu.ca%7Ce394 >> ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C >> 0%7C636601782604952003&sdata=M05RBjDP8XffO2U1b2I%2BMOI2jswVhNERqdrgv%2 >> Fbd%2Bmo%3D&reserved=0 >> >> Search the list archives at: >> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkma >> il.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Ccsaba.pinter%40queens >> u.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb2838b >> 925c%7C1%7C0%7C636601782604952003&sdata=%2B9tRXKCTKzxtmbkE9hWJz1%2FooB >> fefTvNJWtuJta0b1o%3D&reserved=0 >> >> Follow this link to subscribe/unsubscribe: >> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk.o >> rg%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Ccsaba.pinter%40queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636601782604952003&sdata=2HdbAKBlfe1JNhyMG%2BCo%2FnwJ2o2IWDqQHl%2BCIjbu3Fs%3D&reserved=0 >> From lorfalwit at gmail.com Fri May 18 06:02:07 2018 From: lorfalwit at gmail.com (lor fal) Date: Fri, 18 May 2018 18:02:07 +0800 Subject: [vtkusers] Cannot render polygen data immediately Message-ID: Hi all: I have hundreds of images to display by using vtkResliceImageViewer. I need to draw a marker when the left mouse button is clicked. My current solution is to use vtkRegularPolygonSource to draw a circle. The problem is that the circle does not render immediately even if I called render() afterwards. However, if I scroll the mouse wheel, the circle will be rendered correctly. The code snippet is attached below: void add_marker() { auto _circle_source = vtkSmartPointer::New(); _circle_source->SetNormal(1, 0, 0); _circle_source->SetRadius(1); _circle_source->SetGeneratePolygon(false); _circle_source->SetNumberOfSides(50); _circle_source->Update(); auto _mapper = vtkSmartPointer::New(); _mapper->SetInputData(_circle_source->GetOutput()); auto _actor = vtkSmartPointer::New(); _actor->SetMapper(_mapper); auto _cam_pos_x = _in->GetRenderWindow()->GetRenderers()->GetFirstRenderer()->GetActiveCamera()->GetPosition()[0]; _actor->SetPosition(_cam_pos_x - 10, nipple[0], nipple[1]); _actor->GetProperty()->SetColor(1.0, 1.0, 0.0); _in->GetRenderWindow()->GetRenderers()->GetFirstRenderer()->AddActor(_actor); } The add_marker function was called in the callback of vtkCommand::LeftButtonPressEvent. Anyone could help me to solve this problem? Thank you. -- Best regards, Hugh Lo -------------- next part -------------- An HTML attachment was scrubbed... URL: From ochampao at hotmail.com Fri May 18 07:20:04 2018 From: ochampao at hotmail.com (ochampao) Date: Fri, 18 May 2018 04:20:04 -0700 (MST) Subject: [vtkusers] Correct anatomical orientation of volumes from Niftii and DICOM In-Reply-To: <1526469345889-0.post@n5.nabble.com> References: <1525886808408-0.post@n5.nabble.com> <1525946467407-0.post@n5.nabble.com> <1525966655394-0.post@n5.nabble.com> <1526046263006-0.post@n5.nabble.com> <1526469345889-0.post@n5.nabble.com> Message-ID: <1526642404423-0.post@n5.nabble.com> Hi David, Thanks for all the information you?ve been sending. It has been very helpful. Indeed, I have confused the RAS coordinate system with the neurological convention. I also assumed that because Slicer uses RAS it automatically meant that it also used the neurological viewing convention, which is not the case. My intention with the camera configuration posted in my previous comment was to use the neurological convention because I will be displaying images of the brain (this explains why I thought that all my images appeared flipped compared to Slicer). With the RAS coordinate system and the neurological viewing convention in mind, I think the camera configuration as posted above is correct now. To be more specific, this is what I am aiming for with that camera configuration: Axial (Looking towards patient?s inferior): * Patient's Right <= maps to => View Right * Patient's Anterior <= maps to => View Up * (Patient's Superior points "outside" the screen) Coronal (Looking towards Patient's Anterior): * Patient's Right <= maps to => View Right * Patient's Superior <= maps to => View Up * (Patient's Anterior points "inside" the screen) Sagittal (Looking towards Patient's Right): * Patient's Posterior <= maps to => View Right * Patient's Superior <= maps to => View Up * (Patient's Right points "inside" the screen) I found the following resources very helpful: Slicer Coordinate systems and all the links therein. Especially the table ""Radiological" vs "Neurological" Orientation in Viewers" from: Orientation Terms Regarding the computed vtkMatrix4x4 (RASMatrix, QFormMatrix), if it is not the identity, then this means that we need to either transform the data (e.g. flip the respective axis) or apply the vtkMatrix4x4 to the respective actor? Another source of confusion was (and probably still is), what is done by the readers for us and what remains to be done by the programmer to properly display the volume. Also, if nothing is done to the reconstructed output volume of the reader, how is it positioned/oriented in VTK's world? Here is my current understanding: * The reader loads the raw voxels which are stored in indexed/structured coordinates (scanner's i,j,k). * The reader reconstructs the volume and transforms the uniteless (i,j,k) coordinates to (x',y',z') data coordinates with dimensions (e.g. mm): - If, for example, the file format is using an RAS convention, then increasing i/j/k corresponds to increasing x'/y'/z' which in turn corresponds to moving towards R/A/S respectively. - This volume is not oriented or positioned in the Patient's coordinate system yet i.e. its origin (i.e. voxel 0,0,0) is still at (0,0,0)mm and its RAS axes have not been mapped to VTK's world (X,Y,Z) coordinates. -> This was probably my biggest point of confusion. I was assuming that even if the volume was not translated to the Patient's origin, it at least had its RAS axes mapped to VTK's positive X,Y,Z axes. - This is actually the output of the reader i.e. the volume is still not positioned and oriented in Patient's corrdinate system but has the correct dimensions. - The above coordinates refer to coordinates within the volume (user coordinates in VTK's terminology?). - How is this volume positioned in VTK's world, without applying the transofmration matrix? * the reader also computes the transformation matrix for orienting and positioning the reconstructed volume. The matrix should be applied by the programmer. * this is where the job of the reader stops * Let's assume that the file uses RAS and that the camera is setup using the neurological viewing convnetion. Then, if the volume is displayed using a vtkImageSlice prop without applying the UserMatrix, I was expecting VTK's world (X+,Y+,Z+) to map to the volumes (R,A,S) and the origin of VTK's world to coincide with the volume' s 0,0,0. When I apply this in prctice with a volume form a Nifti file, it clearly does not work. * This is where the computed vtkMatrix4x4 (RASMatrix, QFormMatrix) that you mentioned comes into play. - If the top left 3x3 of the matrix is identity, it means that the RAS axes are aligned with VTK's world positive XYZ coordinates, but the origin is at (0,0,0)mm, rather at the Patient's Origin. - If the top left 3x3 is not identiy, then we need to apply the computed vtkMatrix4x4 to the actor, or transform the data accordingly (e.g. flipping the respective dimension or maybe passing it through a vtkTransformFilter?) I apologise for the long post. I hope that the above are not completely wrong and may be helpful. --------------------------------------------------------------------------- From: David Gobbi [] Sent: 16 May 2018 19:28 To: ochampao <> Subject: Re: [vtkusers] Correct anatomical orientation of volumes from Niftii and DICOM This is a follow-up with more info about view orientations, since they are a common source of confusion when talking about RAS and LPS coordinates. As I mentioned in my previous email, RAS and LPS are two different ways of linking anatomical orientations to an x,y,z coordinate system. The RAS coordinate system is what the Montreal Neurological Institute chose as as the basis of its "MNI" coordinate system, which in turn has become a de-facto standard coordinate system for brain atlases. As a result RAS is used widely by neurological image processing software (FSL, Freesurfer, Slicer, to name a few). This is why it was chosen as the coordinate system for NIFTI files. In addition to considering RAS vs LPS, it is also necessary to consider the radiological vs. the neurological view orientations. The difference between these view orientation is that "radiological" places patient left on view right, while "neurological" places patient right on view right. So for a radiological view with RAS, -x points to the view right. And for a radiological view with LPS, +x points to the view right. For a neurological view, it is the opposite. There is some historical confusion that RAS implies a neurological view, and that LPS implies a radiological view. This was true of most software developed in the 1990s, but is demonstrably not true for many modern software packages. For example: - Slicer uses RAS but uses a radiological view (ditto for Freeview) - Commercial image-guided brain surgery software generally uses DICOM and LPS, but universally uses a neurological view In other words, when deciding whether to use neurological vs. radiological view orientation, you must consider your audience. Also note that neurological and radiological are not the only view conventions. There are conventions that are specific to cardiology, specific to viewing extremities, conventions for animals, etc. etc. Finally, when setting up the camera for a particular view, you have to consider (a) how the view orientations (view right, view up) correspond to anatomical orientations, and then (b) how these anatomical orientations map to x, y, z directions (which of course depends on whether you are using LPS or RAS). - David --------------------------------------------------------------------------- On Wed, May 16, 2018 at 9:38 AM, David Gobbi <> wrote: Hi Panos, Your cameras are not set up the same as Slicer's cameras. Consider your axial view: double viewUp[3] = { 0, 1, 0 }; double leftToRight[3] = { 1, 0, 0 }; You have set the camera so that +x points towards the right of the view (i.e. towards the right edge of the screen). In RAS coordinates, +x points to the patient's right. Hence, your view points the patient's right to the view right. By comparison, Slicer points the patient's left to the view right. So you need to use this instead, in both your axial and coronal: double leftToRight[3] = { -1, 0, 0 }; I think that I know where your confusion lies. The RAS and LPS coordinate systems specify anatomical orientation, not view orientation. View orientation has to do with how doctors/scientists prefer the anatomical directions to map to view directions. Slicer uses the convention that the patient's left is oriented to the view right. This convention is commonly called the radiological view convention, it also specifies that the anterior direction (nose) points to the top. One further issue that you're going to run into sooner or later is that you aren't using a vtkMatrix4x4 to orient the actors (when I say actors in this context, I mean the vtkImageSlice objects). VTK's vtkImageData just stores the voxels but doesn't specify orientation, which is why a vtkMatrix4x4 is needed to orient the images. In your case, you aren't using these matrices in your display pipeline yet, so you must at least verify that they are identity. What I mean by this is, after updating vtkDICOMToRAS, call GetRASMatrix() and check that the upper left 3x3 portion of this matrix is identity. Similarly, when you use vtkNIFTIImageReader, call GetQFormMatrix() and verify that it specifies an identity orientation. - David -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From nztoddler at yahoo.com Fri May 18 08:22:39 2018 From: nztoddler at yahoo.com (Todd) Date: Sat, 19 May 2018 00:22:39 +1200 Subject: [vtkusers] Cannot render polygen data immediately In-Reply-To: Message-ID: <248d6c4a-4bf7-4269-ba74-cf930d99ced2@email.android.com> An HTML attachment was scrubbed... URL: From lorfalwit at gmail.com Fri May 18 13:12:23 2018 From: lorfalwit at gmail.com (=?UTF-8?B?bG9yZmFsd2l0QGdtYWlsLmNvbQ==?=) Date: Sat, 19 May 2018 01:12:23 +0800 (GMT+08:00) Subject: [vtkusers] Cannot render polygen data immediately Message-ID: <5aff097a.1c69fb81.a62d.6c15@mx.google.com> An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Fri May 18 15:55:06 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 18 May 2018 13:55:06 -0600 Subject: [vtkusers] Correct anatomical orientation of volumes from Niftii and DICOM In-Reply-To: <1526642404423-0.post@n5.nabble.com> References: <1525886808408-0.post@n5.nabble.com> <1525946467407-0.post@n5.nabble.com> <1525966655394-0.post@n5.nabble.com> <1526046263006-0.post@n5.nabble.com> <1526469345889-0.post@n5.nabble.com> <1526642404423-0.post@n5.nabble.com> Message-ID: Hi Panos, Regarding the RASMatrix (or equivalently the QFormMatrix), there are two ways that it can be used. The first way is to apply it directly to the actor, e.g. actor->SetUserMatrix(reader->GetQFormMatrix()) where the 'actor' is a vtkImageSlice object or a vtkImageActor object. This will correctly place the data within VTK's world coordinate system, without the need for any image filters to flip or permute the IJK coordinates. A different way to use the matrix is to use it to reslice the data, i.e. use it to perform an image reformat. The easiest way to do this is by passing the vtkImageData through vtkImageReslice, with reslice->SetResliceAxes() set to the inverse of the matrix. The output will be a reoriented volume, where IJK are mapped to new directions. There are special considerations needed for oblique acquisitions, and I won't go into those here. Regarding what the reader does, let's start with vtkNIFTIImageReader. The IJ coordinates are the same as stored in the file. The K coordinate is flipped of necessary to make the IJK axes follow the right-hand-rule. This is done because it is required by the NIFTI qform, and also because coordinate systems that don't follow the right-hand-rule are troublesome. For more info, search for "qfac" in the NIFTI documentation or in the docs for vtkNIFTIImageReader. For vtkDICOMReader (from vtk-dicom), with SetRowOrderingToFileNative(), it also keeps the IJ coordinates as stored in the file. As for K, it also flips it as necessary so that the coordinates follow the right-hand-rule. The vtkDICOMImageReader and vtkGDCMImageReader will keep IJ the same if you use FileLowerLeftOn(), I won't go into how they manage K. All of the readers store the spacing (in mm) in the vtkImageData. So you call VTK's data coordinates (x',y',z') if you want to, but these are not RAS coords. To get RAS coords, you need to multiply (x',y',z') by the QFormMatrix, which will rotate them and shift them to give (x,y,z). Moving along the 'J' data axis will only move you along the 'y' RAS axis if the QFormMatrix encodes an identity rotation. Unfortunately I don't have time to give a longer answer today, so I've left some of your questions unanswered. But feel free to follow up if there are things you still aren't sure about after reading this. - David On Fri, May 18, 2018 at 5:20 AM, ochampao wrote: > Hi David, > > Thanks for all the information you?ve been sending. It has been very > helpful. > > Indeed, I have confused the RAS coordinate system with the neurological > convention. I also assumed that because Slicer uses RAS it automatically > meant that it also used the neurological viewing convention, which is not > the case. > > My intention with the camera configuration posted in my previous comment > was > to use the neurological convention because I will be displaying images of > the brain (this explains why I thought that all my images appeared flipped > compared to Slicer). With the RAS coordinate system and the neurological > viewing convention in mind, I think the camera configuration as posted > above > is correct now. To be more specific, this is what I am aiming for with that > camera configuration: > > Axial (Looking towards patient?s inferior): > * Patient's Right <= maps to => View Right > * Patient's Anterior <= maps to => View Up > * (Patient's Superior points "outside" the screen) > > Coronal (Looking towards Patient's Anterior): > * Patient's Right <= maps to => View Right > * Patient's Superior <= maps to => View Up > * (Patient's Anterior points "inside" the screen) > > Sagittal (Looking towards Patient's Right): > * Patient's Posterior <= maps to => View Right > * Patient's Superior <= maps to => View Up > * (Patient's Right points "inside" the screen) > > _52_58-kPlan_TPM.png> > > I found the following resources very helpful: > Slicer Coordinate systems > > and all the links therein. Especially the table ""Radiological" vs > "Neurological" Orientation in Viewers" from: Orientation Terms > > > Regarding the computed vtkMatrix4x4 (RASMatrix, QFormMatrix), if it is not > the identity, then this means that we need to either transform the data > (e.g. flip the respective axis) or apply the vtkMatrix4x4 to the respective > actor? > > Another source of confusion was (and probably still is), what is done by > the > readers for us and what remains to be done by the programmer to properly > display the volume. Also, if nothing is done to the reconstructed output > volume of the reader, how is it positioned/oriented in VTK's world? Here is > my current understanding: > * The reader loads the raw voxels which are stored in indexed/structured > coordinates (scanner's i,j,k). > * The reader reconstructs the volume and transforms the uniteless (i,j,k) > coordinates to (x',y',z') data coordinates with dimensions (e.g. mm): > - If, for example, the file format is using an RAS convention, then > increasing i/j/k corresponds to increasing x'/y'/z' which in turn > corresponds to moving towards R/A/S respectively. > - This volume is not oriented or positioned in the Patient's coordinate > system yet i.e. its origin (i.e. voxel 0,0,0) is still at (0,0,0)mm and its > RAS axes have not been mapped to VTK's world (X,Y,Z) coordinates. > -> This was probably my biggest point of confusion. I was > assuming that > even if the volume was not translated to the Patient's origin, it at least > had its RAS axes mapped to VTK's positive X,Y,Z axes. > - This is actually the output of the reader i.e. the volume is still > not > positioned and oriented in Patient's corrdinate system but has the correct > dimensions. > - The above coordinates refer to coordinates within the volume (user > coordinates in VTK's terminology?). > - How is this volume positioned in VTK's world, without applying the > transofmration matrix? > * the reader also computes the transformation matrix for orienting and > positioning the reconstructed volume. The matrix should be applied by the > programmer. > * this is where the job of the reader stops > > * Let's assume that the file uses RAS and that the camera is setup using > the neurological viewing convnetion. Then, if the volume is displayed using > a vtkImageSlice prop without applying the UserMatrix, I was expecting VTK's > world (X+,Y+,Z+) to map to the volumes (R,A,S) and the origin of VTK's > world > to coincide with the volume' s 0,0,0. When I apply this in prctice with a > volume form a Nifti file, it clearly does not work. > * This is where the computed vtkMatrix4x4 (RASMatrix, QFormMatrix) that > you mentioned comes into play. > - If the top left 3x3 of the matrix is identity, it means that the RAS > axes are aligned with VTK's world positive XYZ coordinates, but the origin > is at (0,0,0)mm, rather at the Patient's Origin. > - If the top left 3x3 is not identiy, then we need to apply the > computed > vtkMatrix4x4 to the actor, or transform the data accordingly (e.g. flipping > the respective dimension or maybe passing it through a vtkTransformFilter?) > > I apologise for the long post. I hope that the above are not completely > wrong and may be helpful. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Fri May 18 16:15:25 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 18 May 2018 14:15:25 -0600 Subject: [vtkusers] Correct anatomical orientation of volumes from Niftii and DICOM In-Reply-To: References: <1525886808408-0.post@n5.nabble.com> <1525946467407-0.post@n5.nabble.com> <1525966655394-0.post@n5.nabble.com> <1526046263006-0.post@n5.nabble.com> <1526469345889-0.post@n5.nabble.com> <1526642404423-0.post@n5.nabble.com> Message-ID: I'll briefly follow-up with a link that describes how vtkNIFTIImageReader handles coordinates. The (x,y,z) it mentions are RAS. https://gitlab.kitware.com/vtk/vtk/blob/master/IO/Image/vtkNIFTIImageReader.cxx#L738 - David On Fri, May 18, 2018 at 1:55 PM, David Gobbi wrote: > Hi Panos, > > Regarding the RASMatrix (or equivalently the QFormMatrix), there are > two ways that it can be used. The first way is to apply it directly to the > actor, e.g. actor->SetUserMatrix(reader->GetQFormMatrix()) where the > 'actor' is a vtkImageSlice object or a vtkImageActor object. This will > correctly place the data within VTK's world coordinate system, without > the need for any image filters to flip or permute the IJK coordinates. > > A different way to use the matrix is to use it to reslice the data, i.e. > use > it to perform an image reformat. The easiest way to do this is by passing > the vtkImageData through vtkImageReslice, with reslice->SetResliceAxes() > set to the inverse of the matrix. The output will be a reoriented volume, > where IJK are mapped to new directions. > > There are special considerations needed for oblique acquisitions, and I > won't go into those here. > > > Regarding what the reader does, let's start with vtkNIFTIImageReader. > The IJ coordinates are the same as stored in the file. The K coordinate > is flipped of necessary to make the IJK axes follow the right-hand-rule. > This is done because it is required by the NIFTI qform, and also because > coordinate systems that don't follow the right-hand-rule are troublesome. > For more info, search for "qfac" in the NIFTI documentation or in the > docs for vtkNIFTIImageReader. > > For vtkDICOMReader (from vtk-dicom), with SetRowOrderingToFileNative(), > it also keeps the IJ coordinates as stored in the file. As for K, it also > flips > it as necessary so that the coordinates follow the right-hand-rule. > The vtkDICOMImageReader and vtkGDCMImageReader will keep IJ the > same if you use FileLowerLeftOn(), I won't go into how they manage K. > > > All of the readers store the spacing (in mm) in the vtkImageData. So you > call VTK's data coordinates (x',y',z') if you want to, but these are not > RAS > coords. To get RAS coords, you need to multiply (x',y',z') by the > QFormMatrix, which will rotate them and shift them to give (x,y,z). > Moving along the 'J' data axis will only move you along the 'y' RAS axis > if the QFormMatrix encodes an identity rotation. > > Unfortunately I don't have time to give a longer answer today, so I've left > some of your questions unanswered. But feel free to follow up if there > are things you still aren't sure about after reading this. > > - David > > > > On Fri, May 18, 2018 at 5:20 AM, ochampao wrote: > >> Hi David, >> >> Thanks for all the information you?ve been sending. It has been very >> helpful. >> >> Indeed, I have confused the RAS coordinate system with the neurological >> convention. I also assumed that because Slicer uses RAS it automatically >> meant that it also used the neurological viewing convention, which is not >> the case. >> >> My intention with the camera configuration posted in my previous comment >> was >> to use the neurological convention because I will be displaying images of >> the brain (this explains why I thought that all my images appeared flipped >> compared to Slicer). With the RAS coordinate system and the neurological >> viewing convention in mind, I think the camera configuration as posted >> above >> is correct now. To be more specific, this is what I am aiming for with >> that >> camera configuration: >> >> Axial (Looking towards patient?s inferior): >> * Patient's Right <= maps to => View Right >> * Patient's Anterior <= maps to => View Up >> * (Patient's Superior points "outside" the screen) >> >> Coronal (Looking towards Patient's Anterior): >> * Patient's Right <= maps to => View Right >> * Patient's Superior <= maps to => View Up >> * (Patient's Anterior points "inside" the screen) >> >> Sagittal (Looking towards Patient's Right): >> * Patient's Posterior <= maps to => View Right >> * Patient's Superior <= maps to => View Up >> * (Patient's Right points "inside" the screen) >> >> > _52_58-kPlan_TPM.png> >> >> I found the following resources very helpful: >> Slicer Coordinate systems >> >> and all the links therein. Especially the table ""Radiological" vs >> "Neurological" Orientation in Viewers" from: Orientation Terms >> >> >> Regarding the computed vtkMatrix4x4 (RASMatrix, QFormMatrix), if it is not >> the identity, then this means that we need to either transform the data >> (e.g. flip the respective axis) or apply the vtkMatrix4x4 to the >> respective >> actor? >> >> Another source of confusion was (and probably still is), what is done by >> the >> readers for us and what remains to be done by the programmer to properly >> display the volume. Also, if nothing is done to the reconstructed output >> volume of the reader, how is it positioned/oriented in VTK's world? Here >> is >> my current understanding: >> * The reader loads the raw voxels which are stored in indexed/structured >> coordinates (scanner's i,j,k). >> * The reader reconstructs the volume and transforms the uniteless >> (i,j,k) >> coordinates to (x',y',z') data coordinates with dimensions (e.g. mm): >> - If, for example, the file format is using an RAS convention, then >> increasing i/j/k corresponds to increasing x'/y'/z' which in turn >> corresponds to moving towards R/A/S respectively. >> - This volume is not oriented or positioned in the Patient's >> coordinate >> system yet i.e. its origin (i.e. voxel 0,0,0) is still at (0,0,0)mm and >> its >> RAS axes have not been mapped to VTK's world (X,Y,Z) coordinates. >> -> This was probably my biggest point of confusion. I was >> assuming that >> even if the volume was not translated to the Patient's origin, it at least >> had its RAS axes mapped to VTK's positive X,Y,Z axes. >> - This is actually the output of the reader i.e. the volume is still >> not >> positioned and oriented in Patient's corrdinate system but has the correct >> dimensions. >> - The above coordinates refer to coordinates within the volume (user >> coordinates in VTK's terminology?). >> - How is this volume positioned in VTK's world, without applying the >> transofmration matrix? >> * the reader also computes the transformation matrix for orienting and >> positioning the reconstructed volume. The matrix should be applied by the >> programmer. >> * this is where the job of the reader stops >> >> * Let's assume that the file uses RAS and that the camera is setup using >> the neurological viewing convnetion. Then, if the volume is displayed >> using >> a vtkImageSlice prop without applying the UserMatrix, I was expecting >> VTK's >> world (X+,Y+,Z+) to map to the volumes (R,A,S) and the origin of VTK's >> world >> to coincide with the volume' s 0,0,0. When I apply this in prctice with a >> volume form a Nifti file, it clearly does not work. >> * This is where the computed vtkMatrix4x4 (RASMatrix, QFormMatrix) that >> you mentioned comes into play. >> - If the top left 3x3 of the matrix is identity, it means that the RAS >> axes are aligned with VTK's world positive XYZ coordinates, but the origin >> is at (0,0,0)mm, rather at the Patient's Origin. >> - If the top left 3x3 is not identiy, then we need to apply the >> computed >> vtkMatrix4x4 to the actor, or transform the data accordingly (e.g. >> flipping >> the respective dimension or maybe passing it through a >> vtkTransformFilter?) >> >> I apologise for the long post. I hope that the above are not completely >> wrong and may be helpful. >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vthomas at imajing.org Fri May 18 12:00:57 2018 From: vthomas at imajing.org (Vincent Thomas) Date: Fri, 18 May 2018 18:00:57 +0200 Subject: [vtkusers] VTK in a GIS software Message-ID: <3dd2c9d1-ea0b-1468-2422-0cdaf66d78ef@imajing.org> Hello all, I'm looking for guidance, I'm currently trying to determine if VTK would be a good fit to be the foundation of a Map component (as in 2D top-down view Map) in a new software i'll be working on. After searching for a bit I found vtkMap (https://github.com/OpenGeoscience/vtkMap). I looked into it and I found answers to almost every questions i had. The only "problem" I have right now is line representation. For example, I would like to be able to have lines represented by a wide red piece in the center surrounded by a black piece on each side. For this I understand that the lines have to have a surface so at the moment I have tested 2 solutions: 1) have something like vtkRibbonFilter to generate polygons around the lines then apply a texture on them. I have tested it and it works ok, but it's not perfect. The down side is that obviously the width of the lines depends on the zoom level, the more you zoom the wider they appear and potentially hides details. 2) write a geometry shader that will generate the ribbon and apply a texture to it. This way I can draw the lines with a width independent from the zoom level. The down side on this one is that in order to have a pretty lines I need to modify opengl's draw call primitive from GL_LINES to GL_LINE_ADJACENCY and also reorganize data in the VBOs/IBOs. So if I'm not mistaken I would have to derive from vtkOpenGLPolyDataMapper and make the necessary adjustments (this part I haven't tested yet). For now, I'm more inclined to go with 1) and add filters in the pipeline that would simplify the geometries and generate ribbons based on the zoom level of at least by ranges of zoom levels (like LOD for meshes). Those different level of details could be precomputed and stored in files when they are not in use to minimize memory and computation load. So I guess my question is am I missing something and I'm trying too hard to fix a problem that has already been solved ? (Since I'm discovering VTK at the same time I may have missed something). Or am I on the right path and I should pursue in that direction ? Thank you for taking the time to read me. Vincent -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.slaughter at inl.gov Sat May 19 00:21:15 2018 From: andrew.slaughter at inl.gov (Slaughter, Andrew E) Date: Fri, 18 May 2018 22:21:15 -0600 Subject: [vtkusers] Render Artifacts Message-ID: I am seeing some rendering artifacts and can't figure out the cause, I would appreciate any help trying to get rid of them. If you run the script attached it will produce "before.png", which shows the artifacts well. If you move the mouse at all in the interactive window the artifacts go away and things look great ("after.png"). I am using MacOS 10.12.6, VTK7.1, and python 2.7. I can't share the exact input file and I am unable to reproduce it on a smaller file. Thanks, Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: after.png Type: image/png Size: 417333 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: before.png Type: image/png Size: 555836 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: debug.py Type: text/x-python-script Size: 1743 bytes Desc: not available URL: From lorfalwit at gmail.com Sat May 19 03:40:42 2018 From: lorfalwit at gmail.com (lor fal) Date: Sat, 19 May 2018 15:40:42 +0800 Subject: [vtkusers] Cannot render polygen data immediately In-Reply-To: <5aff097a.1c69fb81.a62d.6c15@mx.google.com> References: <5aff097a.1c69fb81.a62d.6c15@mx.google.com> Message-ID: Strangely enough, If I called vtkRenderer::ResetCamera() after vtkRenderer::AddActor(), the polygon will be drawn correctly. It seems that just vtkRenderWindow::Render() does not work. On Sat, May 19, 2018 at 1:12 AM, lorfalwit at gmail.com wrote: > Thanks Todd. I am using Qt 5.10 on Windows 10. I have tried to call > update() function to refresh the window, but it doesn't work. > > ---Original--- > *From:* "Todd" > *Date:* Fri, May 18, 2018 20:22 PM > *To:* "lor fal"; > *Cc:* "vtkusers"; > *Subject:* Re: [vtkusers] Cannot render polygen data immediately > > Hi Hugh > > You haven't said what platform you're using. Try invalidating the window > region/rectangle, using the platform's window API. > > On 18 May 2018 10:02 p.m., lor fal wrote: > > Hi all: > I have hundreds of images to display by using vtkResliceImageViewer. I > need to draw a marker when the left mouse button is clicked. My current > solution is to use vtkRegularPolygonSource to draw a circle. The problem is > that the circle does not render immediately even if I called render() > afterwards. However, if I scroll the mouse wheel, the circle will be > rendered correctly. > The code snippet is attached below: > > void add_marker() > { > auto _circle_source = vtkSmartPointer< > vtkRegularPolygonSource>::New(); > _circle_source->SetNormal(1, 0, 0); > _circle_source->SetRadius(1); > _circle_source->SetGeneratePolygon(false); > _circle_source->SetNumberOfSides(50); > _circle_source->Update(); > auto _mapper = vtkSmartPointer::New(); > _mapper->SetInputData(_circle_source->GetOutput()); > auto _actor = vtkSmartPointer::New(); > _actor->SetMapper(_mapper); > auto _cam_pos_x = _in->GetRenderWindow()->GetRenderers()-> > GetFirstRenderer()->GetActiveCamera()->GetPosition()[0]; > _actor->SetPosition(_cam_pos_x - 10, nipple[0], nipple[1]); > > > _actor->GetProperty()->SetColor(1.0, 1.0, 0.0); > _in->GetRenderWindow()->GetRenderers()->GetFirstRenderer()->AddActor(_ > actor); > } > > The add_marker function was called in the callback of vtkCommand:: > LeftButtonPressEvent. > Anyone could help me to solve this problem? > Thank you. > > -- > Best regards, > Hugh Lo > > > -- Best regards, Hugh Lo -------------- next part -------------- An HTML attachment was scrubbed... URL: From ochampao at hotmail.com Sat May 19 07:58:44 2018 From: ochampao at hotmail.com (ochampao) Date: Sat, 19 May 2018 04:58:44 -0700 (MST) Subject: [vtkusers] Correct anatomical orientation of volumes from Niftii and DICOM In-Reply-To: References: <1526046263006-0.post@n5.nabble.com> <1526469345889-0.post@n5.nabble.com> <1526642404423-0.post@n5.nabble.com> Message-ID: <1526731124401-0.post@n5.nabble.com> Hi David. Thanks again for all the information. Things are more clear in my mind now and I've got information to work with. I'll keep future questions related to the subject within this post, to have the information in one place. Panos. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From minpu.code at gmail.com Sat May 19 20:06:48 2018 From: minpu.code at gmail.com (pnt1614) Date: Sat, 19 May 2018 17:06:48 -0700 (MST) Subject: [vtkusers] How to use vtkIntersectionPolyDataFilter? In-Reply-To: References: <1526606669309-0.post@n5.nabble.com> Message-ID: <1526774808338-0.post@n5.nabble.com> So we need to check that 2 polygons have any co-planar triangles or not before using vtkIntersectionPolyDataFilter. But is there anyway to check that 2 polygons have co-planar triangles? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From lasso at queensu.ca Sat May 19 20:55:07 2018 From: lasso at queensu.ca (Andras Lasso) Date: Sun, 20 May 2018 00:55:07 +0000 Subject: [vtkusers] How to use vtkIntersectionPolyDataFilter? In-Reply-To: <1526774808338-0.post@n5.nabble.com> References: <1526606669309-0.post@n5.nabble.com> <1526774808338-0.post@n5.nabble.com> Message-ID: > But is there anyway to check that 2 polygons have co-planar triangles? I don't think so. You may slightly move your inputs and retry. However, I got incorrect output in cases when inputs did not contain exactly coplanar triangles (they were generated from independent sources), so there may be other issues. It would be awesome to have this fixed, but this is a very hard problem. You can find more details and description of alternative solutions in the mailing list archives. Andras -----Original Message----- From: vtkusers On Behalf Of pnt1614 Sent: Saturday, May 19, 2018 8:07 PM To: vtkusers at vtk.org Subject: Re: [vtkusers] How to use vtkIntersectionPolyDataFilter? So we need to check that 2 polygons have any co-planar triangles or not before using vtkIntersectionPolyDataFilter. But is there anyway to check that 2 polygons have co-planar triangles? -- 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%7C01b93ecb63424bf8ed3f08d5bde596d3%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636623716143712225&sdata=SPBw2tgsRLEgWJgGAejQLyTwoNINpH%2FiL%2Fusy27U%2BX0%3D&reserved=0 _______________________________________________ Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7C01b93ecb63424bf8ed3f08d5bde596d3%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636623716143712225&sdata=XzlLKtRx1NTsScARv522QD0rr2CC3y7iabcSA7bBC2M%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%7C01b93ecb63424bf8ed3f08d5bde596d3%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636623716143712225&sdata=meopqmkwyLYyMsKT%2FjW9Fv8U82R8nEST3kQSRMKgZtE%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%7C01b93ecb63424bf8ed3f08d5bde596d3%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636623716143712225&sdata=bRnqHqcxFQMqp7YPjMEDq0StfgxDXa77fm5H7zNrsnc%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%7C01b93ecb63424bf8ed3f08d5bde596d3%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636623716143712225&sdata=jja3UJn0IGyYA0TXoAab7agrehL6S7Yii5XICZEOxNY%3D&reserved=0 Follow this link to subscribe/unsubscribe: https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk.org%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%7C01b93ecb63424bf8ed3f08d5bde596d3%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636623716143712225&sdata=6QSv1crarLiQ0vDz3pPACOqOIvk82ZFaDUOzv1wdYmI%3D&reserved=0 From rabysam28 at gmail.com Sun May 20 12:40:09 2018 From: rabysam28 at gmail.com (Sam Raby) Date: Sun, 20 May 2018 09:40:09 -0700 Subject: [vtkusers] one thread for reading, one thread for rendering Message-ID: Hello, Is there an example that shows how to construct data-reading pipeline in one thread and then hand it off to the main thread for rendering? This design helps because I am constantly reading data from incoming ascii files and want to visualize them consecutively like an animation, but data reading from each file takes 200 millisecond and should not block the user from interacting with the scene, however I am open if any better architecture is preferred. Thank you Sam -------------- next part -------------- An HTML attachment was scrubbed... URL: From jayavardhanravi at outlook.com Mon May 21 09:33:02 2018 From: jayavardhanravi at outlook.com (Jay) Date: Mon, 21 May 2018 06:33:02 -0700 (MST) Subject: [vtkusers] one thread for reading, one thread for rendering In-Reply-To: References: Message-ID: <1526909582828-0.post@n5.nabble.com> I think this example can help you, using vtkcommand this can be achieved https://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/Animation -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From rabysam28 at gmail.com Mon May 21 12:05:06 2018 From: rabysam28 at gmail.com (Sam Raby) Date: Mon, 21 May 2018 09:05:06 -0700 Subject: [vtkusers] one thread for reading, one thread for rendering In-Reply-To: <1526909582828-0.post@n5.nabble.com> References: <1526909582828-0.post@n5.nabble.com> Message-ID: Thanks Jay. The issue with using timer is that reading of each of my frames takes 200 milliseconds which freezes the screen. While I do not mind to give the reader 200 milliseconds to read the frame, I want to still be able to interact with the scene during the reading time. That is why I am looking for an example that shows how to read data in one thread and render it in another thread. Thanks On Monday, May 21, 2018, Jay wrote: > I think this example can help you, using vtkcommand this can be achieved > > https://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/Animation > > > > -- > 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: > https://vtk.org/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.slaughter at inl.gov Mon May 21 12:40:07 2018 From: andrew.slaughter at inl.gov (Slaughter, Andrew E) Date: Mon, 21 May 2018 10:40:07 -0600 Subject: [vtkusers] Render Artifacts In-Reply-To: References: Message-ID: Adding the following after setting the camera fixed my problem. renderer.ResetCameraClippingRange() On Fri, May 18, 2018 at 10:21 PM, Slaughter, Andrew E < andrew.slaughter at inl.gov> wrote: > I am seeing some rendering artifacts and can't figure out the cause, I > would appreciate any help trying to get rid of them. > > If you run the script attached it will produce "before.png", which shows > the artifacts well. If you move the mouse at all in the interactive window > the artifacts go away and things look great ("after.png"). > > I am using MacOS 10.12.6, VTK7.1, and python 2.7. I can't share the exact > input file and I am unable to reproduce it on a smaller file. > > Thanks, > > Andrew > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ochampao at hotmail.com Mon May 21 18:24:00 2018 From: ochampao at hotmail.com (ochampao) Date: Mon, 21 May 2018 15:24:00 -0700 (MST) Subject: [vtkusers] one thread for reading, one thread for rendering In-Reply-To: References: <1526909582828-0.post@n5.nabble.com> Message-ID: <1526941440118-0.post@n5.nabble.com> Hi, An approach that I am uing in my own applications with Qt/VTK, is to have a Worker class that calls the Update() method of vtkAlgorithm in a separate thread. Using this approach Qt's main thread is not blocked while waiting for the reader to read the data. Below I've included a method that reads from a folder multiple DICOM files and returns a vtkImageData object for rendering. The reader is setup as necessary in the main thread but the vtkDICOMImageReader::Update() method is called by the Worker object in a separate thread. While the data are loaded, the user sees a progress dialog. Hope this helps, Panos. // ============================================ // = Method for loading data // ============================================ vtkSmartPointer loadDicom(const char* filename) const { vtkNew reader; reader->FileLowerLeftOn(); reader->SetDirectoryName(filename); reader->UpdateInformation(); QProgressDialog progress( QString("Reading, please wait..."), QString("Close"), 0, 0); progress.show(); qApp->processEvents(); Worker thread(reader); // calls Update() thread.start(); while (!thread.isDone()) qApp->processEvents(); thread.quit(); // Stop thread's event loop. progress.hide(); return reader->GetOutput(); } // ============================================ // = Worker class for calling vtkAlgorithm::Update() in separate thread // ============================================ #ifndef WORKER_H #define WORKER_H #include #include class Worker : public QThread { Q_OBJECT public: Worker(vtkAlgorithm *f) : QThread(), filter(f), done(false) { } bool isDone() { return this->done; } protected: void run() { filter->Update(); // Read image. done = true; } private: volatile bool done; vtkAlgorithm *filter; }; #endif // !WORKER_H -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From ochampao at hotmail.com Mon May 21 18:28:04 2018 From: ochampao at hotmail.com (ochampao) Date: Mon, 21 May 2018 15:28:04 -0700 (MST) Subject: [vtkusers] one thread for reading, one thread for rendering In-Reply-To: <1526941440118-0.post@n5.nabble.com> References: <1526909582828-0.post@n5.nabble.com> <1526941440118-0.post@n5.nabble.com> Message-ID: <1526941684111-0.post@n5.nabble.com> Sorry, I forgot to mention that the code samle for the Worker class was inspired from here: http://www.comp.nus.edu.sg/~cs3249/lecture/multithreading.pdf -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From yii.guxing at gmail.com Tue May 22 01:06:01 2018 From: yii.guxing at gmail.com (Yii.Guxing) Date: Mon, 21 May 2018 22:06:01 -0700 (MST) Subject: [vtkusers] UnsatisfiedLinkError Message-ID: <1526965561261-0.post@n5.nabble.com> I try to run my vtk application, but got this error: java.lang.UnsatisfiedLinkError: D:\myAppDir\vtk\lib\vtkChartsCoreJava.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857) at java.lang.Runtime.loadLibrary0(Runtime.java:870) at java.lang.System.loadLibrary(System.java:1122) at vtk.vtkNativeLibrary.LoadLibrary(vtkNativeLibrary.java:240) at vtk.vtkNativeLibrary.LoadAllNativeLibraries(vtkNativeLibrary.java:175) My vtk application run with: C:\Program Files\Java\jdk1.8.0_162\jre\bin\java.exe" -Dvtk.lib.dir=myAppDir/vtk/lib ... I can not add " D:\myAppDir\vtk\lib\" to the PATH, because they are going to be packaged into my application. What can i do to fix it? Thanks for all! -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From Jesse.Kinross-Smith at bentley.com Tue May 22 01:33:36 2018 From: Jesse.Kinross-Smith at bentley.com (Jesse Kinross-Smith) Date: Tue, 22 May 2018 05:33:36 +0000 Subject: [vtkusers] Failed to get wglChoosePixelFormatARB on VM Message-ID: Getting the following errors when testing our app with VTK rendering on a Hyper-V virtual machine (works great on my laptop though): ERROR: In C:\hg\sharedlibs\VTK-8.1.0\Rendering\OpenGL2\vtkWin32OpenGLRenderWindow.cxx, line 685 vtkWin32OpenGLRenderWindow (000001D110ADE9F0): failed to get wglChoosePixelFormatARB ERROR: In C:\hg\sharedlibs\VTK-8.1.0\Rendering\OpenGL2\vtkWin32OpenGLRenderWindow.cxx, line 769 vtkWin32OpenGLRenderWindow (000001D110ADE9F0): failed to get valid pixel format. ERROR: In C:\hg\sharedlibs\VTK-8.1.0\Rendering\OpenGL2\vtkOpenGLRenderWindow.cxx, line 785 vtkWin32OpenGLRenderWindow (000001D110ADE9F0): GLEW could not be initialized. We're using the vtkMFCWindow class and I don't see any fallback options anywhere. Is there any way this can default to software rendering on low end machines like this? Jesse -- Jesse Kinross-Smith Senior Software Engineer - BSW Bentley Systems, Fremantle -------------- next part -------------- An HTML attachment was scrubbed... URL: From nztoddler at yahoo.com Tue May 22 01:56:22 2018 From: nztoddler at yahoo.com (Todd Martin) Date: Tue, 22 May 2018 05:56:22 +0000 (UTC) Subject: [vtkusers] Failed to get wglChoosePixelFormatARB on VM In-Reply-To: References: Message-ID: <1555399328.3930963.1526968582551@mail.yahoo.com> Did you install GLEW on the virtual machine? Todd Martin, Ph.D. Freelance Engineer/Software Architect. On Tuesday, May 22, 2018, 5:33:53 PM GMT+12, Jesse Kinross-Smith wrote: Getting the following errors when testing our app with VTK rendering on a Hyper-V virtual machine (works great on my laptop though): ? ERROR: In C:\hg\sharedlibs\VTK-8.1.0\Rendering\OpenGL2\vtkWin32OpenGLRenderWindow.cxx, line 685 vtkWin32OpenGLRenderWindow (000001D110ADE9F0): failed to get wglChoosePixelFormatARB ERROR: In C:\hg\sharedlibs\VTK-8.1.0\Rendering\OpenGL2\vtkWin32OpenGLRenderWindow.cxx, line 769 vtkWin32OpenGLRenderWindow (000001D110ADE9F0): failed to get valid pixel format. ERROR: In C:\hg\sharedlibs\VTK-8.1.0\Rendering\OpenGL2\vtkOpenGLRenderWindow.cxx, line 785 vtkWin32OpenGLRenderWindow (000001D110ADE9F0): GLEW could not be initialized. ? We?re using the vtkMFCWindow class and I don?t see any fallback options anywhere. Is there any way this can default to software rendering on low end machines like this? ? Jesse -- Jesse Kinross-Smith Senior Software Engineer - BSW Bentley Systems, Fremantle ? _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://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: https://vtk.org/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jesse.Kinross-Smith at bentley.com Tue May 22 02:56:55 2018 From: Jesse.Kinross-Smith at bentley.com (Jesse Kinross-Smith) Date: Tue, 22 May 2018 06:56:55 +0000 Subject: [vtkusers] Failed to get wglChoosePixelFormatARB on VM In-Reply-To: <1555399328.3930963.1526968582551@mail.yahoo.com> References: <1555399328.3930963.1526968582551@mail.yahoo.com> Message-ID: So it looks like Microsoft?s VM?s only support OpenGL 1.1, and of course our library is built using OpenGL2. Somehow I thought there?d be a fallback option in case it wasn?t supported, but this doesn?t seem to be the case. ? Jesse -- Jesse Kinross-Smith Senior Software Engineer - BSW Bentley Systems, Fremantle From: Todd Martin [mailto:nztoddler at yahoo.com] Sent: Tuesday, 22 May 2018 1:56 PM To: vtk ; Jesse Kinross-Smith Subject: Re: [vtkusers] Failed to get wglChoosePixelFormatARB on VM Did you install GLEW on the virtual machine? Todd Martin, Ph.D. Freelance Engineer/Software Architect. On Tuesday, May 22, 2018, 5:33:53 PM GMT+12, Jesse Kinross-Smith > wrote: Getting the following errors when testing our app with VTK rendering on a Hyper-V virtual machine (works great on my laptop though): ERROR: In C:\hg\sharedlibs\VTK-8.1.0\Rendering\OpenGL2\vtkWin32OpenGLRenderWindow.cxx, line 685 vtkWin32OpenGLRenderWindow (000001D110ADE9F0): failed to get wglChoosePixelFormatARB ERROR: In C:\hg\sharedlibs\VTK-8.1.0\Rendering\OpenGL2\vtkWin32OpenGLRenderWindow.cxx, line 769 vtkWin32OpenGLRenderWindow (000001D110ADE9F0): failed to get valid pixel format. ERROR: In C:\hg\sharedlibs\VTK-8.1.0\Rendering\OpenGL2\vtkOpenGLRenderWindow.cxx, line 785 vtkWin32OpenGLRenderWindow (000001D110ADE9F0): GLEW could not be initialized. We?re using the vtkMFCWindow class and I don?t see any fallback options anywhere. Is there any way this can default to software rendering on low end machines like this? Jesse -- Jesse Kinross-Smith Senior Software Engineer - BSW Bentley Systems, Fremantle _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://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: https://vtk.org/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From nztoddler at yahoo.com Tue May 22 03:12:40 2018 From: nztoddler at yahoo.com (Todd Martin) Date: Tue, 22 May 2018 07:12:40 +0000 (UTC) Subject: [vtkusers] Failed to get wglChoosePixelFormatARB on VM In-Reply-To: References: <1555399328.3930963.1526968582551@mail.yahoo.com> Message-ID: <529541918.3961241.1526973160815@mail.yahoo.com> Hi Jesse Have you tried building VTK with OpenGL rather than OpenGL2? VTK_RENDERING_BACKEND in cmake. Todd Martin, Ph.D. Freelance Engineer/Software Architect. On Tuesday, May 22, 2018, 6:56:58 PM GMT+12, Jesse Kinross-Smith wrote: #yiv9300875591 #yiv9300875591 -- _filtered #yiv9300875591 {font-family:Helvetica;panose-1:2 11 6 4 2 2 2 2 2 4;} _filtered #yiv9300875591 {panose-1:2 4 5 3 5 4 6 3 2 4;} _filtered #yiv9300875591 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;}#yiv9300875591 #yiv9300875591 p.yiv9300875591MsoNormal, #yiv9300875591 li.yiv9300875591MsoNormal, #yiv9300875591 div.yiv9300875591MsoNormal {margin:0cm;margin-bottom:.0001pt;font-size:11.0pt;font-family:sans-serif;}#yiv9300875591 a:link, #yiv9300875591 span.yiv9300875591MsoHyperlink {color:blue;text-decoration:underline;}#yiv9300875591 a:visited, #yiv9300875591 span.yiv9300875591MsoHyperlinkFollowed {color:purple;text-decoration:underline;}#yiv9300875591 p.yiv9300875591msonormal0, #yiv9300875591 li.yiv9300875591msonormal0, #yiv9300875591 div.yiv9300875591msonormal0 {margin-right:0cm;margin-left:0cm;font-size:11.0pt;font-family:sans-serif;}#yiv9300875591 p.yiv9300875591msonormal, #yiv9300875591 li.yiv9300875591msonormal, #yiv9300875591 div.yiv9300875591msonormal {margin-right:0cm;margin-left:0cm;font-size:11.0pt;font-family:sans-serif;}#yiv9300875591 p.yiv9300875591msochpdefault, #yiv9300875591 li.yiv9300875591msochpdefault, #yiv9300875591 div.yiv9300875591msochpdefault {margin-right:0cm;margin-left:0cm;font-size:11.0pt;font-family:sans-serif;}#yiv9300875591 span.yiv9300875591msohyperlink {}#yiv9300875591 span.yiv9300875591msohyperlinkfollowed {}#yiv9300875591 span.yiv9300875591emailstyle17 {}#yiv9300875591 p.yiv9300875591msonormal1, #yiv9300875591 li.yiv9300875591msonormal1, #yiv9300875591 div.yiv9300875591msonormal1 {margin:0cm;margin-bottom:.0001pt;font-size:11.0pt;font-family:sans-serif;}#yiv9300875591 span.yiv9300875591msohyperlink1 {color:#0563C1;text-decoration:underline;}#yiv9300875591 span.yiv9300875591msohyperlinkfollowed1 {color:#954F72;text-decoration:underline;}#yiv9300875591 span.yiv9300875591emailstyle171 {font-family:sans-serif;color:windowtext;}#yiv9300875591 p.yiv9300875591msochpdefault1, #yiv9300875591 li.yiv9300875591msochpdefault1, #yiv9300875591 div.yiv9300875591msochpdefault1 {margin-right:0cm;margin-left:0cm;font-size:11.0pt;font-family:sans-serif;}#yiv9300875591 span.yiv9300875591EmailStyle29 {font-family:sans-serif;color:windowtext;}#yiv9300875591 .yiv9300875591MsoChpDefault {font-size:10.0pt;} _filtered #yiv9300875591 {margin:72.0pt 72.0pt 72.0pt 72.0pt;}#yiv9300875591 div.yiv9300875591WordSection1 {}#yiv9300875591 So it looks like Microsoft?s VM?s only support OpenGL 1.1, and of course our library is built using OpenGL2. Somehow I thought there?d be a fallback option in case it wasn?t supported, but this doesn?t seem to be the case. ? ? Jesse -- Jesse Kinross-Smith Senior Software Engineer - BSW Bentley Systems, Fremantle ? From: Todd Martin [mailto:nztoddler at yahoo.com] Sent: Tuesday, 22 May 2018 1:56 PM To: vtk ; Jesse Kinross-Smith Subject: Re: [vtkusers] Failed to get wglChoosePixelFormatARB on VM ? Did you install GLEW on the virtual machine? ? ? Todd Martin, Ph.D. Freelance Engineer/Software Architect. ? ? ? On Tuesday, May 22, 2018, 5:33:53 PM GMT+12, Jesse Kinross-Smith wrote: ? ? Getting the following errors when testing our app with VTK rendering on a Hyper-V virtual machine (works great on my laptop though): ? ERROR: In C:\hg\sharedlibs\VTK-8.1.0\Rendering\OpenGL2\vtkWin32OpenGLRenderWindow.cxx, line 685 vtkWin32OpenGLRenderWindow (000001D110ADE9F0): failed to get wglChoosePixelFormatARB ERROR: In C:\hg\sharedlibs\VTK-8.1.0\Rendering\OpenGL2\vtkWin32OpenGLRenderWindow.cxx, line 769 vtkWin32OpenGLRenderWindow (000001D110ADE9F0): failed to get valid pixel format. ERROR: In C:\hg\sharedlibs\VTK-8.1.0\Rendering\OpenGL2\vtkOpenGLRenderWindow.cxx, line 785 vtkWin32OpenGLRenderWindow (000001D110ADE9F0): GLEW could not be initialized. ? We?re using the vtkMFCWindow class and I don?t see any fallback options anywhere. Is there any way this can default to software rendering on low end machines like this? ? Jesse -- Jesse Kinross-Smith Senior Software Engineer - BSW Bentley Systems, Fremantle ? _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://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: https://vtk.org/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From nztoddler at yahoo.com Tue May 22 03:47:55 2018 From: nztoddler at yahoo.com (Todd Martin) Date: Tue, 22 May 2018 07:47:55 +0000 (UTC) Subject: [vtkusers] Failed to get wglChoosePixelFormatARB on VM In-Reply-To: References: <1555399328.3930963.1526968582551@mail.yahoo.com> Message-ID: <1377566342.3947362.1526975275081@mail.yahoo.com> Failing that you could try using Virtualbox. Todd Martin, Ph.D. Freelance Engineer/Software Architect. On Tuesday, May 22, 2018, 6:56:58 PM GMT+12, Jesse Kinross-Smith wrote: #yiv9300875591 #yiv9300875591 -- _filtered #yiv9300875591 {font-family:Helvetica;panose-1:2 11 6 4 2 2 2 2 2 4;} _filtered #yiv9300875591 {panose-1:2 4 5 3 5 4 6 3 2 4;} _filtered #yiv9300875591 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;}#yiv9300875591 #yiv9300875591 p.yiv9300875591MsoNormal, #yiv9300875591 li.yiv9300875591MsoNormal, #yiv9300875591 div.yiv9300875591MsoNormal {margin:0cm;margin-bottom:.0001pt;font-size:11.0pt;font-family:sans-serif;}#yiv9300875591 a:link, #yiv9300875591 span.yiv9300875591MsoHyperlink {color:blue;text-decoration:underline;}#yiv9300875591 a:visited, #yiv9300875591 span.yiv9300875591MsoHyperlinkFollowed {color:purple;text-decoration:underline;}#yiv9300875591 p.yiv9300875591msonormal0, #yiv9300875591 li.yiv9300875591msonormal0, #yiv9300875591 div.yiv9300875591msonormal0 {margin-right:0cm;margin-left:0cm;font-size:11.0pt;font-family:sans-serif;}#yiv9300875591 p.yiv9300875591msonormal, #yiv9300875591 li.yiv9300875591msonormal, #yiv9300875591 div.yiv9300875591msonormal {margin-right:0cm;margin-left:0cm;font-size:11.0pt;font-family:sans-serif;}#yiv9300875591 p.yiv9300875591msochpdefault, #yiv9300875591 li.yiv9300875591msochpdefault, #yiv9300875591 div.yiv9300875591msochpdefault {margin-right:0cm;margin-left:0cm;font-size:11.0pt;font-family:sans-serif;}#yiv9300875591 span.yiv9300875591msohyperlink {}#yiv9300875591 span.yiv9300875591msohyperlinkfollowed {}#yiv9300875591 span.yiv9300875591emailstyle17 {}#yiv9300875591 p.yiv9300875591msonormal1, #yiv9300875591 li.yiv9300875591msonormal1, #yiv9300875591 div.yiv9300875591msonormal1 {margin:0cm;margin-bottom:.0001pt;font-size:11.0pt;font-family:sans-serif;}#yiv9300875591 span.yiv9300875591msohyperlink1 {color:#0563C1;text-decoration:underline;}#yiv9300875591 span.yiv9300875591msohyperlinkfollowed1 {color:#954F72;text-decoration:underline;}#yiv9300875591 span.yiv9300875591emailstyle171 {font-family:sans-serif;color:windowtext;}#yiv9300875591 p.yiv9300875591msochpdefault1, #yiv9300875591 li.yiv9300875591msochpdefault1, #yiv9300875591 div.yiv9300875591msochpdefault1 {margin-right:0cm;margin-left:0cm;font-size:11.0pt;font-family:sans-serif;}#yiv9300875591 span.yiv9300875591EmailStyle29 {font-family:sans-serif;color:windowtext;}#yiv9300875591 .yiv9300875591MsoChpDefault {font-size:10.0pt;} _filtered #yiv9300875591 {margin:72.0pt 72.0pt 72.0pt 72.0pt;}#yiv9300875591 div.yiv9300875591WordSection1 {}#yiv9300875591 So it looks like Microsoft?s VM?s only support OpenGL 1.1, and of course our library is built using OpenGL2. Somehow I thought there?d be a fallback option in case it wasn?t supported, but this doesn?t seem to be the case. ? ? Jesse -- Jesse Kinross-Smith Senior Software Engineer - BSW Bentley Systems, Fremantle ? From: Todd Martin [mailto:nztoddler at yahoo.com] Sent: Tuesday, 22 May 2018 1:56 PM To: vtk ; Jesse Kinross-Smith Subject: Re: [vtkusers] Failed to get wglChoosePixelFormatARB on VM ? Did you install GLEW on the virtual machine? ? ? Todd Martin, Ph.D. Freelance Engineer/Software Architect. ? ? ? On Tuesday, May 22, 2018, 5:33:53 PM GMT+12, Jesse Kinross-Smith wrote: ? ? Getting the following errors when testing our app with VTK rendering on a Hyper-V virtual machine (works great on my laptop though): ? ERROR: In C:\hg\sharedlibs\VTK-8.1.0\Rendering\OpenGL2\vtkWin32OpenGLRenderWindow.cxx, line 685 vtkWin32OpenGLRenderWindow (000001D110ADE9F0): failed to get wglChoosePixelFormatARB ERROR: In C:\hg\sharedlibs\VTK-8.1.0\Rendering\OpenGL2\vtkWin32OpenGLRenderWindow.cxx, line 769 vtkWin32OpenGLRenderWindow (000001D110ADE9F0): failed to get valid pixel format. ERROR: In C:\hg\sharedlibs\VTK-8.1.0\Rendering\OpenGL2\vtkOpenGLRenderWindow.cxx, line 785 vtkWin32OpenGLRenderWindow (000001D110ADE9F0): GLEW could not be initialized. ? We?re using the vtkMFCWindow class and I don?t see any fallback options anywhere. Is there any way this can default to software rendering on low end machines like this? ? Jesse -- Jesse Kinross-Smith Senior Software Engineer - BSW Bentley Systems, Fremantle ? _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://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: https://vtk.org/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From ochampao at hotmail.com Tue May 22 05:41:49 2018 From: ochampao at hotmail.com (ochampao) Date: Tue, 22 May 2018 02:41:49 -0700 (MST) Subject: [vtkusers] Layers of vtkImageStack not visible Message-ID: <1526982109056-0.post@n5.nabble.com> Hi vtkUsers, I am developing an application that uses 3 vtkImageStack instances for overlaying multiple layers of vtkImageSlice's. Each vtkImageStack corresponds to one of the anatomical views (axial, coronal, sagittal). I am observing a peculiar behaviour which I cannot explain/fix. In particular, although the 3 views use identical pipelines (except from camera orientation/position), the vtkImageStack of axial view does not always render all layers, whereas the coronal and sagittal views seem to be able to render any number of layers. In the attached screenshot below, you can see that the Second layer in the Axial view is not visible, even when slicing though the volume: In the example above the first volume is from a Dicom series whereas the second from a Nifti file, but the same behaviour is observed when both volumes are from Dicom. Also, applying the user matrix (vtkImageSlice::SetUserMatrix()) does not seem to make any difference in the observed behaviour. I have attached the relevant sections of my source code here: QuadView.cxx Brief explanation of the methods: * initStaticPipeline(): initializes the 3 empty views and configures each vtkImageStack * addImage(): is called whenever a new volume is loaded * renderViews2D(): forces the 3 views to render * resetCameras2D(): resets the 3 cameras and configures camera orientation and position. Does anyone have any ideas why this behaviour is observed and how to fix it? Thanks for your help. Panos. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From hh2699 at columbia.edu Tue May 22 13:09:32 2018 From: hh2699 at columbia.edu (Hengda He) Date: Tue, 22 May 2018 10:09:32 -0700 (MST) Subject: [vtkusers] InverseTransformPoint: no convergence in Thin-Plate Spline In-Reply-To: References: <1506700829387-0.post@n5.nabble.com> Message-ID: <1527008972475-0.post@n5.nabble.com> Hi David Thank you very much for the reply! Now I am wondering what's the difference between these two ways of using vtkThinPlateSplineTransform: (1) Getting vtkThinPlateSplineTransform and then inverse transform->SetSourceLandmarks( sourcepoints ); transform->SetTargetLandmarks( targetpoints ); transform->Inverse(); And apply the transform to source image using vtkImageReslice (2) Getting inverse vtkThinPlateSplineTransform directly transform->SetSourceLandmarks( targetpoints ); transform->SetTargetLandmarks( sourcepoints ); And apply the transform to source image using vtkImageReslice When I tried the first one, "InverseTransformPoint: no convergence" happens and its very likely because that we have too many landmarks. And when I tried the second one, there are many voxels clearly outside the boundary in the deformed volume which is wrong. I am using vtkThinPlateSplineTransform in 3D on binary images. Any help would be appreciated! Best, Hengda -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From david.gobbi at gmail.com Tue May 22 15:00:36 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 22 May 2018 13:00:36 -0600 Subject: [vtkusers] InverseTransformPoint: no convergence in Thin-Plate Spline In-Reply-To: <1527008972475-0.post@n5.nabble.com> References: <1506700829387-0.post@n5.nabble.com> <1527008972475-0.post@n5.nabble.com> Message-ID: Hi Hengda, The thin-plate spline is not inverse-consistent, so switching the source points with the target points will not give the inverse transform. There are probably modified algorithms based on the thin-plate spline that actually are inverse consistent, but vtkThinPlateSplineTransform only provides the basic algorithm as described by Bookstein in 1989. Inversion of the vtkThinPlateSplineTransform is done with an iterative solver based on Newton's method, which uses the derivative of the transform. Like all derivative-based solvers, it only works well if the function is smooth. If the thin-plate spline is given densely-packed landmarks, then perturbations in the landmark measurements can result in a non-smooth transformation that is not invertible. The usual solution to this is to use an approximating spline, but unfortunately this is not provided by vtkThinPlateSplineTransform. - David On Tue, May 22, 2018 at 11:09 AM, Hengda He wrote: > Hi David > > Thank you very much for the reply! > Now I am wondering what's the difference between these two ways of using > vtkThinPlateSplineTransform: > (1) Getting vtkThinPlateSplineTransform and then inverse > transform->SetSourceLandmarks( sourcepoints ); > transform->SetTargetLandmarks( targetpoints ); > transform->Inverse(); > And apply the transform to source image using vtkImageReslice > > (2) Getting inverse vtkThinPlateSplineTransform directly > transform->SetSourceLandmarks( targetpoints ); > transform->SetTargetLandmarks( sourcepoints ); > And apply the transform to source image using vtkImageReslice > > When I tried the first one, "InverseTransformPoint: no convergence" happens > and its very likely because that we have too many landmarks. And when I > tried the second one, there are many voxels clearly outside the boundary in > the deformed volume which is wrong. I am using vtkThinPlateSplineTransform > in 3D on binary images. Any help would be appreciated! > > Best, > Hengda > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Tue May 22 15:30:28 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 22 May 2018 13:30:28 -0600 Subject: [vtkusers] Layers of vtkImageStack not visible In-Reply-To: <1526982109056-0.post@n5.nabble.com> References: <1526982109056-0.post@n5.nabble.com> Message-ID: I don't know why it is happening, but there are checks that you can try: 1) In QuadView.cxx after you call Render() on all the views, loop through the axial image stack to verify that all of the images are actually present. Also, you can call GetBounds() on the actor and on the mapper to see if the size is as expected. Also, the bounds for the different data sets should overlap. Since your UserMatrix is identity, the mapper and actor should return the same bounds. 2) In the Property, set the Opacity to 0.5. Perhaps the layers aren't in the correct order (I'm not sure why this would happen, but maybe your UIDs aren't monotonically increasing as you add more data sets?) - David On Tue, May 22, 2018 at 3:41 AM, ochampao wrote: > Hi vtkUsers, > > I am developing an application that uses 3 vtkImageStack instances for > overlaying multiple layers of vtkImageSlice's. Each vtkImageStack > corresponds to one of the anatomical views (axial, coronal, sagittal). > > I am observing a peculiar behaviour which I cannot explain/fix. In > particular, although the 3 views use identical pipelines (except from > camera > orientation/position), the vtkImageStack of axial view does not always > render all layers, whereas the coronal and sagittal views seem to be able > to > render any number of layers. > > In the attached screenshot below, you can see that the Second layer in the > Axial view is not visible, even when slicing though the volume: > > > > In the example above the first volume is from a Dicom series whereas the > second from a Nifti file, but the same behaviour is observed when both > volumes are from Dicom. Also, applying the user matrix > (vtkImageSlice::SetUserMatrix()) does not seem to make any difference in > the > observed behaviour. > > I have attached the relevant sections of my source code here: QuadView.cxx > > > Brief explanation of the methods: > * initStaticPipeline(): initializes the 3 empty views and configures each > vtkImageStack > * addImage(): is called whenever a new volume is loaded > * renderViews2D(): forces the 3 views to render > * resetCameras2D(): resets the 3 cameras and configures camera orientation > and position. > > Does anyone have any ideas why this behaviour is observed and how to fix > it? > > Thanks for your help. > Panos. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Tue May 22 16:42:19 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Tue, 22 May 2018 16:42:19 -0400 Subject: [vtkusers] Failed to get wglChoosePixelFormatARB on VM In-Reply-To: <1377566342.3947362.1526975275081@mail.yahoo.com> References: <1555399328.3930963.1526968582551@mail.yahoo.com> <1377566342.3947362.1526975275081@mail.yahoo.com> Message-ID: In VTK 8.1.1 on windows, there is a helper that: 1) makes a system call intended to test openGL compatibility 2) lets you swap in mesa if required. See Rendering/OpenGL/vtkTestOpenGLVersion.h and https://gitlab.kitware. com/vtk/vtk/commit/2d10325efedca53a6262550db94484ccc8a12e49 David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Tue, May 22, 2018 at 3:47 AM, Todd Martin via vtkusers wrote: > Failing that you could try using Virtualbox. > > > Todd Martin, Ph.D. > Freelance Engineer/Software Architect. > > > > On Tuesday, May 22, 2018, 6:56:58 PM GMT+12, Jesse Kinross-Smith < > Jesse.Kinross-Smith at bentley.com> wrote: > > > So it looks like Microsoft?s VM?s only support OpenGL 1.1, and of course > our library is built using OpenGL2. > > Somehow I thought there?d be a fallback option in case it wasn?t > supported, but this doesn?t seem to be the case. > > > > ? > > Jesse > > -- > > Jesse Kinross-Smith > > Senior Software Engineer - BSW > > Bentley Systems, Fremantle > > > > *From:* Todd Martin [mailto:nztoddler at yahoo.com] > *Sent:* Tuesday, 22 May 2018 1:56 PM > *To:* vtk ; Jesse Kinross-Smith < > Jesse.Kinross-Smith at bentley.com> > *Subject:* Re: [vtkusers] Failed to get wglChoosePixelFormatARB on VM > > > > > Did you install GLEW on the virtual machine? > > > > > > Todd Martin, Ph.D. > > Freelance Engineer/Software Architect. > > > > > > > > On Tuesday, May 22, 2018, 5:33:53 PM GMT+12, Jesse Kinross-Smith < > Jesse.Kinross-Smith at bentley.com> wrote: > > > > > > Getting the following errors when testing our app with VTK rendering on a > Hyper-V virtual machine (works great on my laptop though): > > > > ERROR: In C:\hg\sharedlibs\VTK-8.1.0\Rendering\OpenGL2\vtkWin32OpenGLRenderWindow.cxx, > line 685 > > vtkWin32OpenGLRenderWindow (000001D110ADE9F0): failed to get > wglChoosePixelFormatARB > > ERROR: In C:\hg\sharedlibs\VTK-8.1.0\Rendering\OpenGL2\vtkWin32OpenGLRenderWindow.cxx, > line 769 > > vtkWin32OpenGLRenderWindow (000001D110ADE9F0): failed to get valid pixel > format. > > ERROR: In C:\hg\sharedlibs\VTK-8.1.0\Rendering\OpenGL2\vtkOpenGLRenderWindow.cxx, > line 785 > > vtkWin32OpenGLRenderWindow (000001D110ADE9F0): GLEW could not be > initialized. > > > > We?re using the vtkMFCWindow class and I don?t see any fallback options > anywhere. > > Is there any way this can default to software rendering on low end > machines like this? > > > > Jesse > > -- > > Jesse Kinross-Smith > > Senior Software Engineer - BSW > > Bentley Systems, Fremantle > > > > _______________________________________________ > 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: > https://vtk.org/mailman/listinfo/vtkusers > > > _______________________________________________ > 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: > https://vtk.org/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ochampao at hotmail.com Tue May 22 19:05:28 2018 From: ochampao at hotmail.com (ochampao) Date: Tue, 22 May 2018 16:05:28 -0700 (MST) Subject: [vtkusers] Layers of vtkImageStack not visible In-Reply-To: References: <1526982109056-0.post@n5.nabble.com> Message-ID: <1527030328808-0.post@n5.nabble.com> Hi David, I've tried all of your suggestions without any luck. * all images appear in the imageStack (checked using vtkImageStack::GetImages()) * vtkImageSlice::GetBounds() and vtkImageResliceMapper::GetBounds() return the same bounds * Bounds across images overlap * Layer numbers are assigned and monotonically increasing. * Even when opacity is set to 0.5 the second layer is still not visible. Another peculiar observation is that when I change something in my source code and recompile, the second layer appears (only after triggering slicing through the volume). But, when re-running the same executable for a second time, the layer does not appear at all. This makes me think that there might be something wrong with my VTK binaries, so I may recompile them tomorrow and report back. Thanks, Panos -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From Jesse.Kinross-Smith at bentley.com Tue May 22 23:33:00 2018 From: Jesse.Kinross-Smith at bentley.com (Jesse Kinross-Smith) Date: Wed, 23 May 2018 03:33:00 +0000 Subject: [vtkusers] Failed to get wglChoosePixelFormatARB on VM In-Reply-To: References: <1555399328.3930963.1526968582551@mail.yahoo.com> <1377566342.3947362.1526975275081@mail.yahoo.com> Message-ID: Ahh! Mesa.. of course! (I?d completely forgotten about that project) All I had to do was install Mesa on the VMs and that has enabled them to use software rendering without changing a line of code. https://github.com/pal1000/mesa-dist-win was really helpful here and just did a system wide deployment for my test VM. This enables us to at least deploy this on our automated test environment and get things going there. I?m using VTK 8.1.0 atm, but will look at the helper when I upgrade things and try and do this better. Thanks David! Regards, Jesse -- Jesse Kinross-Smith Senior Software Engineer - BSW Bentley Systems, Fremantle From: David E DeMarle [mailto:dave.demarle at kitware.com] Sent: Wednesday, 23 May 2018 4:42 AM To: Todd Martin Cc: vtk ; Jesse Kinross-Smith Subject: Re: [vtkusers] Failed to get wglChoosePixelFormatARB on VM In VTK 8.1.1 on windows, there is a helper that: 1) makes a system call intended to test openGL compatibility 2) lets you swap in mesa if required. See Rendering/OpenGL/vtkTestOpenGLVersion.h and https://gitlab.kitware.com/vtk/vtk/commit/2d10325efedca53a6262550db94484ccc8a12e49 David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Tue, May 22, 2018 at 3:47 AM, Todd Martin via vtkusers > wrote: Failing that you could try using Virtualbox. Todd Martin, Ph.D. Freelance Engineer/Software Architect. On Tuesday, May 22, 2018, 6:56:58 PM GMT+12, Jesse Kinross-Smith > wrote: So it looks like Microsoft?s VM?s only support OpenGL 1.1, and of course our library is built using OpenGL2. Somehow I thought there?d be a fallback option in case it wasn?t supported, but this doesn?t seem to be the case. ? Jesse -- Jesse Kinross-Smith Senior Software Engineer - BSW Bentley Systems, Fremantle From: Todd Martin [mailto:nztoddler at yahoo.com] Sent: Tuesday, 22 May 2018 1:56 PM To: vtk >; Jesse Kinross-Smith > Subject: Re: [vtkusers] Failed to get wglChoosePixelFormatARB on VM Did you install GLEW on the virtual machine? Todd Martin, Ph.D. Freelance Engineer/Software Architect. On Tuesday, May 22, 2018, 5:33:53 PM GMT+12, Jesse Kinross-Smith > wrote: Getting the following errors when testing our app with VTK rendering on a Hyper-V virtual machine (works great on my laptop though): ERROR: In C:\hg\sharedlibs\VTK-8.1.0\Rendering\OpenGL2\vtkWin32OpenGLRenderWindow.cxx, line 685 vtkWin32OpenGLRenderWindow (000001D110ADE9F0): failed to get wglChoosePixelFormatARB ERROR: In C:\hg\sharedlibs\VTK-8.1.0\Rendering\OpenGL2\vtkWin32OpenGLRenderWindow.cxx, line 769 vtkWin32OpenGLRenderWindow (000001D110ADE9F0): failed to get valid pixel format. ERROR: In C:\hg\sharedlibs\VTK-8.1.0\Rendering\OpenGL2\vtkOpenGLRenderWindow.cxx, line 785 vtkWin32OpenGLRenderWindow (000001D110ADE9F0): GLEW could not be initialized. We?re using the vtkMFCWindow class and I don?t see any fallback options anywhere. Is there any way this can default to software rendering on low end machines like this? Jesse -- Jesse Kinross-Smith Senior Software Engineer - BSW Bentley Systems, Fremantle _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://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: https://vtk.org/mailman/listinfo/vtkusers _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: https://vtk.org/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From nztoddler at yahoo.com Wed May 23 04:25:16 2018 From: nztoddler at yahoo.com (Todd) Date: Wed, 23 May 2018 20:25:16 +1200 Subject: [vtkusers] Failed to get wglChoosePixelFormatARB on VM In-Reply-To: Message-ID: <542e64e8-2733-4d81-9837-443e0b85f3a4@email.android.com> An HTML attachment was scrubbed... URL: From robertsawko at gmail.com Wed May 23 05:24:31 2018 From: robertsawko at gmail.com (Robert Sawko) Date: Wed, 23 May 2018 02:24:31 -0700 (MST) Subject: [vtkusers] Cannot use vtkConnectivty on GroupDataSet Message-ID: <1527067471692-0.post@n5.nabble.com> Hi, I am trying with ParaView to create a test data set for my VTK application. I simply want three spheres with varying radius. The application operates on vtk contour plots that are produced by OpenFOAM. Using vtkConnectivityFilter it computes disjoint surfaces and then it iterates over each surface to obtain mass properties: volume and surface area. In order to create my data set I use sources in ParaView to create three disjoint spheres and I combine them into a single set by GroupDatasets filter. Then I use SaveData and save into .vtm file format. If I try to apply Connectivity on the group it find sonly one group even though spheres are clearly disjoint. I tried various extract filters, but I am clearly missing something. Connectivity does work on my "production" data, but just not my mock set constructed through PV sources and GroupDatasets. I would like to understand why that happens and if there's a correct way of producing my three sphere data set. Thanks. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From robertsawko at gmail.com Wed May 23 05:41:09 2018 From: robertsawko at gmail.com (Robert Sawko) Date: Wed, 23 May 2018 02:41:09 -0700 (MST) Subject: [vtkusers] Cannot use vtkConnectivty on GroupDataSet In-Reply-To: <1527067471692-0.post@n5.nabble.com> References: <1527067471692-0.post@n5.nabble.com> Message-ID: <1527068469157-0.post@n5.nabble.com> Right, there's a perfect example on VTK Example Webiste in here . It seems that the correct combination of filters is Sphere->Delauney3D->AppendFilter. Everything can be done via PV interface. After creating this set vtkConnectivityFilter works correctly on the composite set. I would still appreciate a pointer or an explanation on the differences between these two pipelines. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From jamil.goettlich at gmail.com Wed May 23 08:17:42 2018 From: jamil.goettlich at gmail.com (Jamil Goettlich) Date: Wed, 23 May 2018 14:17:42 +0200 Subject: [vtkusers] Fast File I/O for VTK In-Reply-To: References: Message-ID: Thanks alot, using Windows swap actually works pretty good. I have another question concerning File I/O. I stumbled upon the file Format ".pvtp" looking at VTK File Formats ( https://www.vtk.org/wp-content/uploads/2015/04/file-formats.pdf). I would like to write parallel readable pvtp files by timestep. Let's say I have a simulation with 12 timesteps and I want to distribute the reading to 4 cores, letting each processor read 3 steps. Unfortunatly I did not find alot of information about it. There was only a similar question ( https://www.vtk.org/pipermail/vtkusers/2009-June/052257.html) which has seemingly not been answered and one about spatial partitioning ( https://www.vtk.org/pipermail/vtkusers/2017-January/097642.html). As I would like to read/write parallelly over time, I am stuck at this point. Plus, do I need to build VTK with MPI/ OpenMP packages for using those pvtp-files? Thanks alot in advance! 2018-05-03 15:04 GMT+02:00 Andras Lasso : > > it will be hard to get around streaming data (because of RAM > limitations). > > You may increase virtual memory size setting in your system and let the > operating system worry about how to save/restore physical memory content > to/from disk. You have less control over what is written to disk and when, > but everything is done at a very low level and you don't need file parsing, > so it may be simpler and faster than re-loading hdf files. > > Andras > > -----Original Message----- > From: vtkusers On Behalf Of David E DeMarle > Sent: Thursday, May 3, 2018 8:57 AM > To: Jamil Goettlich > Cc: vtk > Subject: Re: [vtkusers] Fast File I/O for VTK > > Sorry I can only answer one of your questions at this time. > > On Thu, May 3, 2018 at 6:10 AM, Jamil Goettlich > wrote: > > Hello vtkUsers, > > > > I am planning on writing some code for visualizing time sequential > > data and figured out that it will be hard to get around streaming data > > (because of RAM limitations). I am currently using vtp files for > > storing. They are loaded into multiblocks of vtkPolyData to be > > visualized further on. Since the data can be pretty big, its taking a > > while to import them, hence streaming data is alot about fast file I/O > (please correct me if I'm wrong). > > I am currently reading vtp files (only Point Data) with about six > > attributes (velocity, acceleration, pressure, ...) and with the > > vtkDataArraySelectionClass I am able to read in only selected arrays, > > which makes everything faster. I am happy with that, but as I do not > > know anything about File I/O, I guess there is alot of optimization > possible. > > > > My questions are the following and I'm happy about every answer on one > > of > > them: > > - I realized that for reading XML Data, there is only one CPU core > > being used. Is there a (c++) implementation to read parallelly? > > - When I stored all timestep files in vtkMultiBlockData (collection of > > vtp) and imported those ones with XMLMultiblockDataReader, the import > > took even longer than manually importing each timestep into polyData > > and putting them into a multiblock afterwards. Is it possible to > > parallelly read files of the multiblock, so reading each block is > > distributed on different cores? (Sorry if the question seems dumb, I > > have no idea of parallellism) > > - Has anyone got experience using the HDF5 format for storing and > > reading polydata?And is it faster than reading XML data/ are multiple > > cores being used? If so, how much effort does it take to write a > > custom HDF5 reader/writer (as I did not find any vtk-c++ implementation > on the web)? > > You could look at the source code of IO/Truchas. That reader took me > perhaps a week of effort to get to where it is now. > > It makes unstructured grids of volumetric cells types. For somple points > your code will be less complex. > > > - Or is there any better/ faster/ more flexible/ parallel file format > > than HDF5/vtp for this purpose? > > - Is there some good (vtk related) literature concerning that topic? > > > > I am sorry for asking many general questions at once but I thought it > > would help many users that struggle with the same problems to get an > > overview. I would be happy for any answers/experiences. > > > > Thanks alot > > > > Jamil > > > > > > > > _______________________________________________ > > Powered by > > https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&dat > > a=02%7C01%7Classo%40queensu.ca%7C5d51857638d640abfce308d5b0f5757a%7Cd6 > > 1ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636609490646480690&sdata=ZlZe > > F0bsckE9EbKlv9jspraeoJNwfP0OzeV2MTyDeyQ%3D&reserved=0 > > > > Visit other Kitware open-source projects at > > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.ki > > tware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40queens > > u.ca%7C5d51857638d640abfce308d5b0f5757a%7Cd61ecb3b38b142d582c4efb2838b > > 925c%7C1%7C0%7C636609490646480690&sdata=Yc6YnPgFfYMzrRIIX8FdjWNQe40UbF > > ojCPyQ7CDzckY%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.vt > > k.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Classo%40queensu.ca%7C5d51857638d > > 640abfce308d5b0f5757a%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636 > > 609490646480690&sdata=w8ravzj8oob5nwoV6WNIf3ITYJdJAkDmfINUy3wzR54%3D&r > > eserved=0 > > > > Search the list archives at: > > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkma > > il.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Classo%40queensu.ca%7C > > 5d51857638d640abfce308d5b0f5757a%7Cd61ecb3b38b142d582c4efb2838b925c%7C > > 1%7C0%7C636609490646480690&sdata=hDaOmlmp%2FMsuC2E463IMIAfdHqRZRI4rtAX > > 1x%2BuEDdo%3D&reserved=0 > > > > Follow this link to subscribe/unsubscribe: > > https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk.o > > rg%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%7 > > C5d51857638d640abfce308d5b0f5757a%7Cd61ecb3b38b142d582c4efb2838b925c%7 > > C1%7C0%7C636609490646480690&sdata=tZytuI3tWINvEA9vLmYV8q52awE56KpUGpaw > > yKsn9JM%3D&reserved=0 > > > _______________________________________________ > Powered by https://na01.safelinks.protection.outlook.com/?url= > www.kitware.com&data=02%7C01%7Classo%40queensu.ca% > 7C5d51857638d640abfce308d5b0f5757a%7Cd61ecb3b38b142d582c4efb2838b > 925c%7C1%7C0%7C636609490646480690&sdata=ZlZeF0bsckE9EbKlv9jspraeoJNwfP > 0OzeV2MTyDeyQ%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% > 7C5d51857638d640abfce308d5b0f5757a%7Cd61ecb3b38b142d582c4efb2838b > 925c%7C1%7C0%7C636609490646480690&sdata=Yc6YnPgFfYMzrRIIX8FdjWNQe40UbF > ojCPyQ7CDzckY%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%7C5d51857638d640abfce308d5b0f5757a% > 7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636609490646480690&sdata= > w8ravzj8oob5nwoV6WNIf3ITYJdJAkDmfINUy3wzR54%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% > 7C5d51857638d640abfce308d5b0f5757a%7Cd61ecb3b38b142d582c4efb2838b > 925c%7C1%7C0%7C636609490646480690&sdata=hDaOmlmp% > 2FMsuC2E463IMIAfdHqRZRI4rtAX1x%2BuEDdo%3D&reserved=0 > > Follow this link to subscribe/unsubscribe: > https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk.org% > 2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca% > 7C5d51857638d640abfce308d5b0f5757a%7Cd61ecb3b38b142d582c4efb2838b > 925c%7C1%7C0%7C636609490646480690&sdata=tZytuI3tWINvEA9vLmYV8q52awE56K > pUGpawyKsn9JM%3D&reserved=0 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ochampao at hotmail.com Wed May 23 12:16:56 2018 From: ochampao at hotmail.com (ochampao) Date: Wed, 23 May 2018 09:16:56 -0700 (MST) Subject: [vtkusers] Layers of vtkImageStack not visible In-Reply-To: <1527030328808-0.post@n5.nabble.com> References: <1526982109056-0.post@n5.nabble.com> <1527030328808-0.post@n5.nabble.com> Message-ID: <1527092216275-0.post@n5.nabble.com> I recompiled vtk and vtk-dicom today. Unfortunately the problem persists. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From marc.ruiz+vtk at gmail.com Wed May 23 13:29:06 2018 From: marc.ruiz+vtk at gmail.com (Marc Ruiz Altisent) Date: Wed, 23 May 2018 19:29:06 +0200 Subject: [vtkusers] vtkSmartVolumeMapper doesn't properly handle input changes Message-ID: Hi everyone, I have found an issue with vtkSmartVolumeMapper. If you create several vtkImageData objects, set one of them as the input of the mapper and render, then you won't be able to render one of the others at a later time: if you set one of the others as input the mapper will keep rendering the first one. The issue is in the method vtkSmartVolumeMapper::ConnectMapperInput. It doesn't pass the original input to its internal mapper, but a shallow copy of it. The first time it will always perform the shallow copy, but afterwards it will only do it if the new input has been modified after creating the previous shallow copy, which is not always the case (e.g. if you create all the data before the first render). Possible workarounds are to call Modified() on the input data when setting a new one or to create a new mapper each time. Below is a sample program (adapted from a couple of examples) to proof the issue. Pressing 1 or 2 alternates between 2 datasets but only the first one is always rendered. Uncommenting the 2 Modified() calls makes it work as expected. #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // Define interaction style class KeyPressInteractorStyle : public vtkInteractorStyleTrackballCamera { public: static KeyPressInteractorStyle* New(); vtkTypeMacro(KeyPressInteractorStyle, vtkInteractorStyleTrackballCamera); virtual void OnKeyPress() { // Get the keypress vtkRenderWindowInteractor *rwi = this->Interactor; std::string key = rwi->GetKeySym(); if(key == "1") { mapper->SetInputData(imageData1); //imageData1->Modified(); rwi->Render(); } else if(key == "2") { mapper->SetInputData(imageData2); //imageData2->Modified(); rwi->Render(); } // Forward events vtkInteractorStyleTrackballCamera::OnKeyPress(); } vtkSmartPointer mapper; vtkSmartPointer imageData1, imageData2; }; vtkStandardNewMacro(KeyPressInteractorStyle); static void CreateImageData(vtkImageData* im, bool); int main(int argc, char *argv[]) { vtkSmartPointer imageData = vtkSmartPointer::New(); vtkSmartPointer imageData2 = vtkSmartPointer::New(); CreateImageData(imageData, true); CreateImageData(imageData2, false); vtkSmartPointer renWin = vtkSmartPointer::New(); vtkSmartPointer ren1 = vtkSmartPointer::New(); ren1->SetBackground(0.1,0.4,0.2); renWin->AddRenderer(ren1); renWin->SetSize(301,300); // intentional odd and NPOT width/height vtkSmartPointer iren = vtkSmartPointer::New(); iren->SetRenderWindow(renWin); vtkSmartPointer style = vtkSmartPointer::New(); iren->SetInteractorStyle(style); style->SetCurrentRenderer(ren1); renWin->Render(); // make sure we have an OpenGL context. vtkSmartPointer volumeMapper = vtkSmartPointer::New(); volumeMapper->SetBlendModeToComposite(); // composite first volumeMapper->SetInputData(imageData); vtkSmartPointer volumeProperty = vtkSmartPointer::New(); volumeProperty->ShadeOff(); volumeProperty->SetInterpolationType(VTK_LINEAR_INTERPOLATION); style->mapper = volumeMapper; style->imageData1 = imageData; style->imageData2 = imageData2; vtkSmartPointer compositeOpacity = vtkSmartPointer::New(); compositeOpacity->AddPoint(0.0,0.0); compositeOpacity->AddPoint(80.0,1.0); compositeOpacity->AddPoint(80.1,0.0); compositeOpacity->AddPoint(255.0,0.0); volumeProperty->SetScalarOpacity(compositeOpacity); // composite first. vtkSmartPointer color = vtkSmartPointer::New(); color->AddRGBPoint(0.0 ,0.0,0.0,1.0); color->AddRGBPoint(40.0 ,1.0,0.0,0.0); color->AddRGBPoint(255.0,1.0,1.0,1.0); volumeProperty->SetColor(color); vtkSmartPointer volume = vtkSmartPointer::New(); volume->SetMapper(volumeMapper); volume->SetProperty(volumeProperty); ren1->AddViewProp(volume); ren1->ResetCamera(); // Render composite. In default mode. For coverage. renWin->Render(); iren->Start(); return EXIT_SUCCESS; } void CreateImageData(vtkImageData* imageData, bool spherical) { vtkSmartPointer implicitFunction; if (spherical) { vtkSmartPointer sphere = vtkSmartPointer::New(); sphere->SetRadius(0.1); sphere->SetCenter(0.0,0.0,0.0); implicitFunction = sphere; } else { vtkSmartPointer box = vtkSmartPointer::New(); box->SetBounds(-0.1, 0.1, -0.1, 0.1, -0.1, 0.1); implicitFunction = box; } vtkSmartPointer sampleFunction = vtkSmartPointer::New(); sampleFunction->SetImplicitFunction(implicitFunction); sampleFunction->SetOutputScalarTypeToDouble(); sampleFunction->SetSampleDimensions(127,127,127); // intentional NPOT dimensions. sampleFunction->SetModelBounds(-1.0,1.0,-1.0,1.0,-1.0,1.0); sampleFunction->SetCapping(false); sampleFunction->SetComputeNormals(false); sampleFunction->SetScalarArrayName("values"); sampleFunction->Update(); vtkDataArray* a = sampleFunction->GetOutput()->GetPointData()->GetScalars("values"); double range[2]; a->GetRange(range); vtkSmartPointer t = vtkSmartPointer::New(); t->SetInputConnection(sampleFunction->GetOutputPort()); t->SetShift(-range[0]); double magnitude=range[1]-range[0]; if(magnitude==0.0) { magnitude=1.0; } t->SetScale(255.0/magnitude); t->SetOutputScalarTypeToUnsignedChar(); t->Update(); imageData->ShallowCopy(t->GetOutput()); } -------------- next part -------------- An HTML attachment was scrubbed... URL: From csaba.pinter at queensu.ca Wed May 23 15:08:17 2018 From: csaba.pinter at queensu.ca (Csaba Pinter) Date: Wed, 23 May 2018 19:08:17 +0000 Subject: [vtkusers] vtkMultiVolume and shading In-Reply-To: References: Message-ID: Hi Elvis, Sorry for the late answer, I just got back from vacation. I haven't been able to reproduce it with a self-contained test case yet. I've been trying to modify TestGPURayCastMultiVolumeOverlapping, but it worked there. However in my work in Slicer, in which I'm adding a new volume rendering method with this actor, the first transform is always ignored. Here's the branch: https://github.com/cpinter/Slicer/tree/multi-volume-rendering I'll keep trying later this week, and will definitely let you know if I get lucky. Please do the same if you manage to reproduce it. Thanks, csaba -----Original Message----- From: Elvis Stansvik Sent: Friday, May 18, 2018 05:35 To: Csaba Pinter Cc: Sankhesh Jhaveri ; vtkusers at vtk.org Subject: Re: [vtkusers] vtkMultiVolume and shading 2018-04-24 22:14 GMT+02:00 Csaba Pinter : > Hi Sankhesh and Elvis, > > The first issue that I was now able to confirm is that SetVisibility called on the individual vtkVolume objects within vtkMultiVolume has no effect. Not sure if this is intentional or not, but naively I'd think this is the way to show/hide a volume. I'm not fond of the idea to clear the connection in the mapper and set volume to null every time I want to hide one. > The way to reproduce this is for example adding these lines to line 118 in Rendering\Volume\Testing\Cxx\TestGPURayCastMultiVolumeOverlapping.cxx > else if (key == "w") > { > this->Volume->SetVisibility(!this->Volume->GetVisibility()); > } > If you start the test interactively (-I), then nothing happens if you press w. > > The other issue is that the user transform I set to the first volume seems to be ignored, while the second volume's transform is used properly. I haven't been able to reproduce it with this test yet, so I'll keep working on it until I find out what is the exact issue. Hi again Csaba. Were you ever able to reproduce the "transform first volume" problem? In my own experiments with vtkMultiVolume, I seem to be hitting a similar issue. In my case it's SetPosition that won't bite on the first volume (I think...), but I guess that is probably the same issue you were seeing. So far I've been unable to reproduce it in a minimal test case though :( Best regards, Elvis > > Cheers, > csaba > > -----Original Message----- > From: Elvis Stansvik > Sent: Tuesday, April 24, 2018 10:51 > To: Csaba Pinter > Cc: Sankhesh Jhaveri ; vtkusers at vtk.org > Subject: Re: [vtkusers] vtkMultiVolume and shading > > 2018-04-24 15:15 GMT+02:00 Csaba Pinter : >> Hi Sankhesh, >> >> >> >> Thanks for the quick answer! Just in a nutshell, what would be needed >> to do programming-wise to add shading in the code? >> >> >> >> Also I?m wondering if the situation about funding applies to bugfixes >> as well? I am struggling with issues related to per-volume visibility >> and user transforms, and I think I?ll get back to you soon with >> self-contained test cases once I was able to figure out which of >> these are on the VTK side and how to reproduce them easily. > > I'm also about to experiment with the multi-volume support. Would be interesting to hear from you what problems you ran into wrt to per-volume visibility / user transforms, so I know what to look out for :) So if you file issues for those it would be great if you could link to them here. > > Cheers, > Elvis > >> >> >> >> Thanks, >> >> csaba >> >> >> >> From: Sankhesh Jhaveri >> Sent: Monday, April 23, 2018 21:15 >> To: Csaba Pinter >> Cc: vtkusers at vtk.org >> Subject: Re: [vtkusers] vtkMultiVolume and shading >> >> >> >> Hi Csaba, >> >> I don?t believe there is a technical limitation. It was merely that >> the original effort for adding multiple overlapping volumes support >> was focused on selected features. I am not aware of current >> efforts/funding to add support for additional features like shading, different blend modes, etc. >> >> Thanks, >> Sankhesh >> >> >> >> On Mon, Apr 23, 2018 at 3:45 PM Csaba Pinter >> >> wrote: >> >> Hello, >> >> >> >> I?m experimenting with using vtkMultiVolume to add proper >> multi-volume rendering support into 3D Slicer. My main question is >> the reason behind this actor not supporting shading, as apparent when >> used, but also mentioned in the corresponding test: >> >> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith >> u >> b.com%2FKitware%2FVTK%2Fblob%2Fmaster%2FRendering%2FVolume%2FTesting% >> 2 >> FCxx%2FTestGPURayCastMultiVolumeOverlapping.cxx%23L229&data=02%7C01%7 >> C >> csaba.pinter%40queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb >> 3 >> b38b142d582c4efb2838b925c%7C1%7C0%7C636601782604952003&sdata=Ylx6UE%2 >> B >> 0l7IeQEWU5OEkSYHXSAuBYLT8DzB1RobJY34%3D&reserved=0 >> >> Is this a technical limitation that would be very hard to overcome, >> or is it something simpler? I?m asking this because for this actor to >> be really used for volume rendering, shading would be necessary. >> >> >> >> Thank you, >> >> Csaba >> >> _______________________________________________ >> Powered by >> https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&da >> t >> a=02%7C01%7Ccsaba.pinter%40queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c >> 9 >> 90%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636601782604952003&sd >> a >> ta=OAQC2JW%2FBdByHi6rzs3UR3OuEYMXVtnIBzyO2DLUEBg%3D&reserved=0 >> >> Visit other Kitware open-source projects at >> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.k >> i >> tware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Ccsaba.pinter% >> 4 >> 0queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4 >> e >> fb2838b925c%7C1%7C0%7C636601782604952003&sdata=ILwtCl2ODMcW2PistT%2BU >> e >> pqKoQ7hCylxaWiGofVT5L8%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.v >> t >> k.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Ccsaba.pinter%40queensu.ca%7Ce39 >> 4 >> ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7 >> C >> 0%7C636601782604952003&sdata=M05RBjDP8XffO2U1b2I%2BMOI2jswVhNERqdrgv% >> 2 >> Fbd%2Bmo%3D&reserved=0 >> >> Search the list archives at: >> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkm >> a >> il.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Ccsaba.pinter%40queen >> s >> u.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb2838 >> b >> 925c%7C1%7C0%7C636601782604952003&sdata=%2B9tRXKCTKzxtmbkE9hWJz1%2Foo >> B >> fefTvNJWtuJta0b1o%3D&reserved=0 >> >> Follow this link to subscribe/unsubscribe: >> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk. >> o >> rg%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Ccsaba.pinter%40quee >> n >> su.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb283 >> 8 >> b925c%7C1%7C0%7C636601782604952003&sdata=2HdbAKBlfe1JNhyMG%2BCo%2FnwJ >> 2 >> o2IWDqQHl%2BCIjbu3Fs%3D&reserved=0 >> >> -- >> >> Sankhesh Jhaveri >> >> Sr. Research & Development Engineer | Kitware | (518) 881-4417 >> >> >> _______________________________________________ >> Powered by >> https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&da >> t >> a=02%7C01%7Ccsaba.pinter%40queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c >> 9 >> 90%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636601782604952003&sd >> a >> ta=OAQC2JW%2FBdByHi6rzs3UR3OuEYMXVtnIBzyO2DLUEBg%3D&reserved=0 >> >> Visit other Kitware open-source projects at >> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.k >> i >> tware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Ccsaba.pinter% >> 4 >> 0queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4 >> e >> fb2838b925c%7C1%7C0%7C636601782604952003&sdata=ILwtCl2ODMcW2PistT%2BU >> e >> pqKoQ7hCylxaWiGofVT5L8%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.v >> t >> k.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Ccsaba.pinter%40queensu.ca%7Ce39 >> 4 >> ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7 >> C >> 0%7C636601782604952003&sdata=M05RBjDP8XffO2U1b2I%2BMOI2jswVhNERqdrgv% >> 2 >> Fbd%2Bmo%3D&reserved=0 >> >> Search the list archives at: >> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkm >> a >> il.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Ccsaba.pinter%40queen >> s >> u.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb2838 >> b >> 925c%7C1%7C0%7C636601782604952003&sdata=%2B9tRXKCTKzxtmbkE9hWJz1%2Foo >> B >> fefTvNJWtuJta0b1o%3D&reserved=0 >> >> Follow this link to subscribe/unsubscribe: >> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk. >> o >> rg%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Ccsaba.pinter%40queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636601782604952003&sdata=2HdbAKBlfe1JNhyMG%2BCo%2FnwJ2o2IWDqQHl%2BCIjbu3Fs%3D&reserved=0 >> From elvis.stansvik at orexplore.com Wed May 23 15:16:13 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Wed, 23 May 2018 21:16:13 +0200 Subject: [vtkusers] vtkMultiVolume and shading In-Reply-To: References: Message-ID: 2018-05-23 21:08 GMT+02:00 Csaba Pinter : > Hi Elvis, > > Sorry for the late answer, I just got back from vacation. > > I haven't been able to reproduce it with a self-contained test case yet. I've been trying to modify TestGPURayCastMultiVolumeOverlapping, but it worked there. However in my work in Slicer, in which I'm adding a new volume rendering method with this actor, the first transform is always ignored. Here's the branch: https://github.com/cpinter/Slicer/tree/multi-volume-rendering > > I'll keep trying later this week, and will definitely let you know if I get lucky. Please do the same if you manage to reproduce it. Alright, looks like we're in the same boat. I'll probably have some more time to look at this next week. Elvis > > Thanks, > csaba > > -----Original Message----- > From: Elvis Stansvik > Sent: Friday, May 18, 2018 05:35 > To: Csaba Pinter > Cc: Sankhesh Jhaveri ; vtkusers at vtk.org > Subject: Re: [vtkusers] vtkMultiVolume and shading > > 2018-04-24 22:14 GMT+02:00 Csaba Pinter : >> Hi Sankhesh and Elvis, >> >> The first issue that I was now able to confirm is that SetVisibility called on the individual vtkVolume objects within vtkMultiVolume has no effect. Not sure if this is intentional or not, but naively I'd think this is the way to show/hide a volume. I'm not fond of the idea to clear the connection in the mapper and set volume to null every time I want to hide one. >> The way to reproduce this is for example adding these lines to line 118 in Rendering\Volume\Testing\Cxx\TestGPURayCastMultiVolumeOverlapping.cxx >> else if (key == "w") >> { >> this->Volume->SetVisibility(!this->Volume->GetVisibility()); >> } >> If you start the test interactively (-I), then nothing happens if you press w. >> >> The other issue is that the user transform I set to the first volume seems to be ignored, while the second volume's transform is used properly. I haven't been able to reproduce it with this test yet, so I'll keep working on it until I find out what is the exact issue. > > Hi again Csaba. Were you ever able to reproduce the "transform first volume" problem? > > In my own experiments with vtkMultiVolume, I seem to be hitting a similar issue. In my case it's SetPosition that won't bite on the first volume (I think...), but I guess that is probably the same issue you were seeing. > > So far I've been unable to reproduce it in a minimal test case though :( > > Best regards, > Elvis > >> >> Cheers, >> csaba >> >> -----Original Message----- >> From: Elvis Stansvik >> Sent: Tuesday, April 24, 2018 10:51 >> To: Csaba Pinter >> Cc: Sankhesh Jhaveri ; vtkusers at vtk.org >> Subject: Re: [vtkusers] vtkMultiVolume and shading >> >> 2018-04-24 15:15 GMT+02:00 Csaba Pinter : >>> Hi Sankhesh, >>> >>> >>> >>> Thanks for the quick answer! Just in a nutshell, what would be needed >>> to do programming-wise to add shading in the code? >>> >>> >>> >>> Also I?m wondering if the situation about funding applies to bugfixes >>> as well? I am struggling with issues related to per-volume visibility >>> and user transforms, and I think I?ll get back to you soon with >>> self-contained test cases once I was able to figure out which of >>> these are on the VTK side and how to reproduce them easily. >> >> I'm also about to experiment with the multi-volume support. Would be interesting to hear from you what problems you ran into wrt to per-volume visibility / user transforms, so I know what to look out for :) So if you file issues for those it would be great if you could link to them here. >> >> Cheers, >> Elvis >> >>> >>> >>> >>> Thanks, >>> >>> csaba >>> >>> >>> >>> From: Sankhesh Jhaveri >>> Sent: Monday, April 23, 2018 21:15 >>> To: Csaba Pinter >>> Cc: vtkusers at vtk.org >>> Subject: Re: [vtkusers] vtkMultiVolume and shading >>> >>> >>> >>> Hi Csaba, >>> >>> I don?t believe there is a technical limitation. It was merely that >>> the original effort for adding multiple overlapping volumes support >>> was focused on selected features. I am not aware of current >>> efforts/funding to add support for additional features like shading, different blend modes, etc. >>> >>> Thanks, >>> Sankhesh >>> >>> >>> >>> On Mon, Apr 23, 2018 at 3:45 PM Csaba Pinter >>> >>> wrote: >>> >>> Hello, >>> >>> >>> >>> I?m experimenting with using vtkMultiVolume to add proper >>> multi-volume rendering support into 3D Slicer. My main question is >>> the reason behind this actor not supporting shading, as apparent when >>> used, but also mentioned in the corresponding test: >>> >>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith >>> u >>> b.com%2FKitware%2FVTK%2Fblob%2Fmaster%2FRendering%2FVolume%2FTesting% >>> 2 >>> FCxx%2FTestGPURayCastMultiVolumeOverlapping.cxx%23L229&data=02%7C01%7 >>> C >>> csaba.pinter%40queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb >>> 3 >>> b38b142d582c4efb2838b925c%7C1%7C0%7C636601782604952003&sdata=Ylx6UE%2 >>> B >>> 0l7IeQEWU5OEkSYHXSAuBYLT8DzB1RobJY34%3D&reserved=0 >>> >>> Is this a technical limitation that would be very hard to overcome, >>> or is it something simpler? I?m asking this because for this actor to >>> be really used for volume rendering, shading would be necessary. >>> >>> >>> >>> Thank you, >>> >>> Csaba >>> >>> _______________________________________________ >>> Powered by >>> https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&da >>> t >>> a=02%7C01%7Ccsaba.pinter%40queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c >>> 9 >>> 90%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636601782604952003&sd >>> a >>> ta=OAQC2JW%2FBdByHi6rzs3UR3OuEYMXVtnIBzyO2DLUEBg%3D&reserved=0 >>> >>> Visit other Kitware open-source projects at >>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.k >>> i >>> tware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Ccsaba.pinter% >>> 4 >>> 0queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4 >>> e >>> fb2838b925c%7C1%7C0%7C636601782604952003&sdata=ILwtCl2ODMcW2PistT%2BU >>> e >>> pqKoQ7hCylxaWiGofVT5L8%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.v >>> t >>> k.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Ccsaba.pinter%40queensu.ca%7Ce39 >>> 4 >>> ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7 >>> C >>> 0%7C636601782604952003&sdata=M05RBjDP8XffO2U1b2I%2BMOI2jswVhNERqdrgv% >>> 2 >>> Fbd%2Bmo%3D&reserved=0 >>> >>> Search the list archives at: >>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkm >>> a >>> il.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Ccsaba.pinter%40queen >>> s >>> u.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb2838 >>> b >>> 925c%7C1%7C0%7C636601782604952003&sdata=%2B9tRXKCTKzxtmbkE9hWJz1%2Foo >>> B >>> fefTvNJWtuJta0b1o%3D&reserved=0 >>> >>> Follow this link to subscribe/unsubscribe: >>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk. >>> o >>> rg%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Ccsaba.pinter%40quee >>> n >>> su.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb283 >>> 8 >>> b925c%7C1%7C0%7C636601782604952003&sdata=2HdbAKBlfe1JNhyMG%2BCo%2FnwJ >>> 2 >>> o2IWDqQHl%2BCIjbu3Fs%3D&reserved=0 >>> >>> -- >>> >>> Sankhesh Jhaveri >>> >>> Sr. Research & Development Engineer | Kitware | (518) 881-4417 >>> >>> >>> _______________________________________________ >>> Powered by >>> https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&da >>> t >>> a=02%7C01%7Ccsaba.pinter%40queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c >>> 9 >>> 90%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636601782604952003&sd >>> a >>> ta=OAQC2JW%2FBdByHi6rzs3UR3OuEYMXVtnIBzyO2DLUEBg%3D&reserved=0 >>> >>> Visit other Kitware open-source projects at >>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.k >>> i >>> tware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Ccsaba.pinter% >>> 4 >>> 0queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4 >>> e >>> fb2838b925c%7C1%7C0%7C636601782604952003&sdata=ILwtCl2ODMcW2PistT%2BU >>> e >>> pqKoQ7hCylxaWiGofVT5L8%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.v >>> t >>> k.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Ccsaba.pinter%40queensu.ca%7Ce39 >>> 4 >>> ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7 >>> C >>> 0%7C636601782604952003&sdata=M05RBjDP8XffO2U1b2I%2BMOI2jswVhNERqdrgv% >>> 2 >>> Fbd%2Bmo%3D&reserved=0 >>> >>> Search the list archives at: >>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkm >>> a >>> il.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Ccsaba.pinter%40queen >>> s >>> u.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb2838 >>> b >>> 925c%7C1%7C0%7C636601782604952003&sdata=%2B9tRXKCTKzxtmbkE9hWJz1%2Foo >>> B >>> fefTvNJWtuJta0b1o%3D&reserved=0 >>> >>> Follow this link to subscribe/unsubscribe: >>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk. >>> o >>> rg%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Ccsaba.pinter%40queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636601782604952003&sdata=2HdbAKBlfe1JNhyMG%2BCo%2FnwJ2o2IWDqQHl%2BCIjbu3Fs%3D&reserved=0 >>> From elvis.stansvik at orexplore.com Wed May 23 15:24:48 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Wed, 23 May 2018 21:24:48 +0200 Subject: [vtkusers] vtkMultiVolume and shading In-Reply-To: References: Message-ID: 2018-05-23 21:16 GMT+02:00 Elvis Stansvik : > 2018-05-23 21:08 GMT+02:00 Csaba Pinter : >> Hi Elvis, >> >> Sorry for the late answer, I just got back from vacation. >> >> I haven't been able to reproduce it with a self-contained test case yet. I've been trying to modify TestGPURayCastMultiVolumeOverlapping, but it worked there. However in my work in Slicer, in which I'm adding a new volume rendering method with this actor, the first transform is always ignored. Here's the branch: https://github.com/cpinter/Slicer/tree/multi-volume-rendering >> >> I'll keep trying later this week, and will definitely let you know if I get lucky. Please do the same if you manage to reproduce it. > > Alright, looks like we're in the same boat. I'll probably have some > more time to look at this next week. FWIW the workaround I toyed around with was always keeping a single-voxel fully-transparent volume around on port 0, but obviously a proper solution would be better. Elvis > > Elvis > >> >> Thanks, >> csaba >> >> -----Original Message----- >> From: Elvis Stansvik >> Sent: Friday, May 18, 2018 05:35 >> To: Csaba Pinter >> Cc: Sankhesh Jhaveri ; vtkusers at vtk.org >> Subject: Re: [vtkusers] vtkMultiVolume and shading >> >> 2018-04-24 22:14 GMT+02:00 Csaba Pinter : >>> Hi Sankhesh and Elvis, >>> >>> The first issue that I was now able to confirm is that SetVisibility called on the individual vtkVolume objects within vtkMultiVolume has no effect. Not sure if this is intentional or not, but naively I'd think this is the way to show/hide a volume. I'm not fond of the idea to clear the connection in the mapper and set volume to null every time I want to hide one. >>> The way to reproduce this is for example adding these lines to line 118 in Rendering\Volume\Testing\Cxx\TestGPURayCastMultiVolumeOverlapping.cxx >>> else if (key == "w") >>> { >>> this->Volume->SetVisibility(!this->Volume->GetVisibility()); >>> } >>> If you start the test interactively (-I), then nothing happens if you press w. >>> >>> The other issue is that the user transform I set to the first volume seems to be ignored, while the second volume's transform is used properly. I haven't been able to reproduce it with this test yet, so I'll keep working on it until I find out what is the exact issue. >> >> Hi again Csaba. Were you ever able to reproduce the "transform first volume" problem? >> >> In my own experiments with vtkMultiVolume, I seem to be hitting a similar issue. In my case it's SetPosition that won't bite on the first volume (I think...), but I guess that is probably the same issue you were seeing. >> >> So far I've been unable to reproduce it in a minimal test case though :( >> >> Best regards, >> Elvis >> >>> >>> Cheers, >>> csaba >>> >>> -----Original Message----- >>> From: Elvis Stansvik >>> Sent: Tuesday, April 24, 2018 10:51 >>> To: Csaba Pinter >>> Cc: Sankhesh Jhaveri ; vtkusers at vtk.org >>> Subject: Re: [vtkusers] vtkMultiVolume and shading >>> >>> 2018-04-24 15:15 GMT+02:00 Csaba Pinter : >>>> Hi Sankhesh, >>>> >>>> >>>> >>>> Thanks for the quick answer! Just in a nutshell, what would be needed >>>> to do programming-wise to add shading in the code? >>>> >>>> >>>> >>>> Also I?m wondering if the situation about funding applies to bugfixes >>>> as well? I am struggling with issues related to per-volume visibility >>>> and user transforms, and I think I?ll get back to you soon with >>>> self-contained test cases once I was able to figure out which of >>>> these are on the VTK side and how to reproduce them easily. >>> >>> I'm also about to experiment with the multi-volume support. Would be interesting to hear from you what problems you ran into wrt to per-volume visibility / user transforms, so I know what to look out for :) So if you file issues for those it would be great if you could link to them here. >>> >>> Cheers, >>> Elvis >>> >>>> >>>> >>>> >>>> Thanks, >>>> >>>> csaba >>>> >>>> >>>> >>>> From: Sankhesh Jhaveri >>>> Sent: Monday, April 23, 2018 21:15 >>>> To: Csaba Pinter >>>> Cc: vtkusers at vtk.org >>>> Subject: Re: [vtkusers] vtkMultiVolume and shading >>>> >>>> >>>> >>>> Hi Csaba, >>>> >>>> I don?t believe there is a technical limitation. It was merely that >>>> the original effort for adding multiple overlapping volumes support >>>> was focused on selected features. I am not aware of current >>>> efforts/funding to add support for additional features like shading, different blend modes, etc. >>>> >>>> Thanks, >>>> Sankhesh >>>> >>>> >>>> >>>> On Mon, Apr 23, 2018 at 3:45 PM Csaba Pinter >>>> >>>> wrote: >>>> >>>> Hello, >>>> >>>> >>>> >>>> I?m experimenting with using vtkMultiVolume to add proper >>>> multi-volume rendering support into 3D Slicer. My main question is >>>> the reason behind this actor not supporting shading, as apparent when >>>> used, but also mentioned in the corresponding test: >>>> >>>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith >>>> u >>>> b.com%2FKitware%2FVTK%2Fblob%2Fmaster%2FRendering%2FVolume%2FTesting% >>>> 2 >>>> FCxx%2FTestGPURayCastMultiVolumeOverlapping.cxx%23L229&data=02%7C01%7 >>>> C >>>> csaba.pinter%40queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb >>>> 3 >>>> b38b142d582c4efb2838b925c%7C1%7C0%7C636601782604952003&sdata=Ylx6UE%2 >>>> B >>>> 0l7IeQEWU5OEkSYHXSAuBYLT8DzB1RobJY34%3D&reserved=0 >>>> >>>> Is this a technical limitation that would be very hard to overcome, >>>> or is it something simpler? I?m asking this because for this actor to >>>> be really used for volume rendering, shading would be necessary. >>>> >>>> >>>> >>>> Thank you, >>>> >>>> Csaba >>>> >>>> _______________________________________________ >>>> Powered by >>>> https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&da >>>> t >>>> a=02%7C01%7Ccsaba.pinter%40queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c >>>> 9 >>>> 90%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636601782604952003&sd >>>> a >>>> ta=OAQC2JW%2FBdByHi6rzs3UR3OuEYMXVtnIBzyO2DLUEBg%3D&reserved=0 >>>> >>>> Visit other Kitware open-source projects at >>>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.k >>>> i >>>> tware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Ccsaba.pinter% >>>> 4 >>>> 0queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4 >>>> e >>>> fb2838b925c%7C1%7C0%7C636601782604952003&sdata=ILwtCl2ODMcW2PistT%2BU >>>> e >>>> pqKoQ7hCylxaWiGofVT5L8%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.v >>>> t >>>> k.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Ccsaba.pinter%40queensu.ca%7Ce39 >>>> 4 >>>> ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7 >>>> C >>>> 0%7C636601782604952003&sdata=M05RBjDP8XffO2U1b2I%2BMOI2jswVhNERqdrgv% >>>> 2 >>>> Fbd%2Bmo%3D&reserved=0 >>>> >>>> Search the list archives at: >>>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkm >>>> a >>>> il.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Ccsaba.pinter%40queen >>>> s >>>> u.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb2838 >>>> b >>>> 925c%7C1%7C0%7C636601782604952003&sdata=%2B9tRXKCTKzxtmbkE9hWJz1%2Foo >>>> B >>>> fefTvNJWtuJta0b1o%3D&reserved=0 >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk. >>>> o >>>> rg%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Ccsaba.pinter%40quee >>>> n >>>> su.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb283 >>>> 8 >>>> b925c%7C1%7C0%7C636601782604952003&sdata=2HdbAKBlfe1JNhyMG%2BCo%2FnwJ >>>> 2 >>>> o2IWDqQHl%2BCIjbu3Fs%3D&reserved=0 >>>> >>>> -- >>>> >>>> Sankhesh Jhaveri >>>> >>>> Sr. Research & Development Engineer | Kitware | (518) 881-4417 >>>> >>>> >>>> _______________________________________________ >>>> Powered by >>>> https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&da >>>> t >>>> a=02%7C01%7Ccsaba.pinter%40queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c >>>> 9 >>>> 90%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636601782604952003&sd >>>> a >>>> ta=OAQC2JW%2FBdByHi6rzs3UR3OuEYMXVtnIBzyO2DLUEBg%3D&reserved=0 >>>> >>>> Visit other Kitware open-source projects at >>>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.k >>>> i >>>> tware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Ccsaba.pinter% >>>> 4 >>>> 0queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4 >>>> e >>>> fb2838b925c%7C1%7C0%7C636601782604952003&sdata=ILwtCl2ODMcW2PistT%2BU >>>> e >>>> pqKoQ7hCylxaWiGofVT5L8%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.v >>>> t >>>> k.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Ccsaba.pinter%40queensu.ca%7Ce39 >>>> 4 >>>> ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7 >>>> C >>>> 0%7C636601782604952003&sdata=M05RBjDP8XffO2U1b2I%2BMOI2jswVhNERqdrgv% >>>> 2 >>>> Fbd%2Bmo%3D&reserved=0 >>>> >>>> Search the list archives at: >>>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkm >>>> a >>>> il.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Ccsaba.pinter%40queen >>>> s >>>> u.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb2838 >>>> b >>>> 925c%7C1%7C0%7C636601782604952003&sdata=%2B9tRXKCTKzxtmbkE9hWJz1%2Foo >>>> B >>>> fefTvNJWtuJta0b1o%3D&reserved=0 >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk. >>>> o >>>> rg%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Ccsaba.pinter%40queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636601782604952003&sdata=2HdbAKBlfe1JNhyMG%2BCo%2FnwJ2o2IWDqQHl%2BCIjbu3Fs%3D&reserved=0 >>>> From csaba.pinter at queensu.ca Wed May 23 15:31:23 2018 From: csaba.pinter at queensu.ca (Csaba Pinter) Date: Wed, 23 May 2018 19:31:23 +0000 Subject: [vtkusers] vtkMultiVolume and shading In-Reply-To: References: Message-ID: That's a pretty resourceful workaround :) I'll keep trying to get to the bottom of this though. csaba -----Original Message----- From: Elvis Stansvik Sent: Wednesday, May 23, 2018 15:25 To: Csaba Pinter Cc: vtkusers at vtk.org Subject: Re: [vtkusers] vtkMultiVolume and shading 2018-05-23 21:16 GMT+02:00 Elvis Stansvik : > 2018-05-23 21:08 GMT+02:00 Csaba Pinter : >> Hi Elvis, >> >> Sorry for the late answer, I just got back from vacation. >> >> I haven't been able to reproduce it with a self-contained test case >> yet. I've been trying to modify TestGPURayCastMultiVolumeOverlapping, >> but it worked there. However in my work in Slicer, in which I'm >> adding a new volume rendering method with this actor, the first >> transform is always ignored. Here's the branch: >> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith >> ub.com%2Fcpinter%2FSlicer%2Ftree%2Fmulti-volume-rendering&data=02%7C0 >> 1%7Ccsaba.pinter%40queensu.ca%7Cc64f2f95b013430d7bbb08d5c0e2da87%7Cd6 >> 1ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636627002929271879&sdata=LZG >> VjR%2FE%2FEAfE3WQn%2BirX%2F8%2BrV%2BEOIb6cpo71f1%2BPM4%3D&reserved=0 >> >> I'll keep trying later this week, and will definitely let you know if I get lucky. Please do the same if you manage to reproduce it. > > Alright, looks like we're in the same boat. I'll probably have some > more time to look at this next week. FWIW the workaround I toyed around with was always keeping a single-voxel fully-transparent volume around on port 0, but obviously a proper solution would be better. Elvis > > Elvis > >> >> Thanks, >> csaba >> >> -----Original Message----- >> From: Elvis Stansvik >> Sent: Friday, May 18, 2018 05:35 >> To: Csaba Pinter >> Cc: Sankhesh Jhaveri ; vtkusers at vtk.org >> Subject: Re: [vtkusers] vtkMultiVolume and shading >> >> 2018-04-24 22:14 GMT+02:00 Csaba Pinter : >>> Hi Sankhesh and Elvis, >>> >>> The first issue that I was now able to confirm is that SetVisibility called on the individual vtkVolume objects within vtkMultiVolume has no effect. Not sure if this is intentional or not, but naively I'd think this is the way to show/hide a volume. I'm not fond of the idea to clear the connection in the mapper and set volume to null every time I want to hide one. >>> The way to reproduce this is for example adding these lines to line 118 in Rendering\Volume\Testing\Cxx\TestGPURayCastMultiVolumeOverlapping.cxx >>> else if (key == "w") >>> { >>> this->Volume->SetVisibility(!this->Volume->GetVisibility()); >>> } >>> If you start the test interactively (-I), then nothing happens if you press w. >>> >>> The other issue is that the user transform I set to the first volume seems to be ignored, while the second volume's transform is used properly. I haven't been able to reproduce it with this test yet, so I'll keep working on it until I find out what is the exact issue. >> >> Hi again Csaba. Were you ever able to reproduce the "transform first volume" problem? >> >> In my own experiments with vtkMultiVolume, I seem to be hitting a similar issue. In my case it's SetPosition that won't bite on the first volume (I think...), but I guess that is probably the same issue you were seeing. >> >> So far I've been unable to reproduce it in a minimal test case though >> :( >> >> Best regards, >> Elvis >> >>> >>> Cheers, >>> csaba >>> >>> -----Original Message----- >>> From: Elvis Stansvik >>> Sent: Tuesday, April 24, 2018 10:51 >>> To: Csaba Pinter >>> Cc: Sankhesh Jhaveri ; >>> vtkusers at vtk.org >>> Subject: Re: [vtkusers] vtkMultiVolume and shading >>> >>> 2018-04-24 15:15 GMT+02:00 Csaba Pinter : >>>> Hi Sankhesh, >>>> >>>> >>>> >>>> Thanks for the quick answer! Just in a nutshell, what would be >>>> needed to do programming-wise to add shading in the code? >>>> >>>> >>>> >>>> Also I?m wondering if the situation about funding applies to >>>> bugfixes as well? I am struggling with issues related to per-volume >>>> visibility and user transforms, and I think I?ll get back to you >>>> soon with self-contained test cases once I was able to figure out >>>> which of these are on the VTK side and how to reproduce them easily. >>> >>> I'm also about to experiment with the multi-volume support. Would be interesting to hear from you what problems you ran into wrt to per-volume visibility / user transforms, so I know what to look out for :) So if you file issues for those it would be great if you could link to them here. >>> >>> Cheers, >>> Elvis >>> >>>> >>>> >>>> >>>> Thanks, >>>> >>>> csaba >>>> >>>> >>>> >>>> From: Sankhesh Jhaveri >>>> Sent: Monday, April 23, 2018 21:15 >>>> To: Csaba Pinter >>>> Cc: vtkusers at vtk.org >>>> Subject: Re: [vtkusers] vtkMultiVolume and shading >>>> >>>> >>>> >>>> Hi Csaba, >>>> >>>> I don?t believe there is a technical limitation. It was merely that >>>> the original effort for adding multiple overlapping volumes support >>>> was focused on selected features. I am not aware of current >>>> efforts/funding to add support for additional features like shading, different blend modes, etc. >>>> >>>> Thanks, >>>> Sankhesh >>>> >>>> >>>> >>>> On Mon, Apr 23, 2018 at 3:45 PM Csaba Pinter >>>> >>>> wrote: >>>> >>>> Hello, >>>> >>>> >>>> >>>> I?m experimenting with using vtkMultiVolume to add proper >>>> multi-volume rendering support into 3D Slicer. My main question is >>>> the reason behind this actor not supporting shading, as apparent >>>> when used, but also mentioned in the corresponding test: >>>> >>>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgi >>>> th >>>> u >>>> b.com%2FKitware%2FVTK%2Fblob%2Fmaster%2FRendering%2FVolume%2FTestin >>>> g% >>>> 2 >>>> FCxx%2FTestGPURayCastMultiVolumeOverlapping.cxx%23L229&data=02%7C01 >>>> %7 >>>> C >>>> csaba.pinter%40queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61e >>>> cb >>>> 3 >>>> b38b142d582c4efb2838b925c%7C1%7C0%7C636601782604952003&sdata=Ylx6UE >>>> %2 >>>> B >>>> 0l7IeQEWU5OEkSYHXSAuBYLT8DzB1RobJY34%3D&reserved=0 >>>> >>>> Is this a technical limitation that would be very hard to overcome, >>>> or is it something simpler? I?m asking this because for this actor >>>> to be really used for volume rendering, shading would be necessary. >>>> >>>> >>>> >>>> Thank you, >>>> >>>> Csaba >>>> >>>> _______________________________________________ >>>> Powered by >>>> https://na01.safelinks.protection.outlook.com/?url=www.kitware.com& >>>> da >>>> t >>>> a=02%7C01%7Ccsaba.pinter%40queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f >>>> 2c >>>> 9 >>>> 90%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636601782604952003& >>>> sd >>>> a >>>> ta=OAQC2JW%2FBdByHi6rzs3UR3OuEYMXVtnIBzyO2DLUEBg%3D&reserved=0 >>>> >>>> Visit other Kitware open-source projects at >>>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww >>>> .k >>>> i >>>> tware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Ccsaba.pinte >>>> r% >>>> 4 >>>> 0queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582 >>>> c4 >>>> e >>>> fb2838b925c%7C1%7C0%7C636601782604952003&sdata=ILwtCl2ODMcW2PistT%2 >>>> BU >>>> e >>>> pqKoQ7hCylxaWiGofVT5L8%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 >>>> .v >>>> t >>>> k.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Ccsaba.pinter%40queensu.ca%7Ce >>>> 39 >>>> 4 >>>> ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb2838b925c%7C1 >>>> %7 >>>> C >>>> 0%7C636601782604952003&sdata=M05RBjDP8XffO2U1b2I%2BMOI2jswVhNERqdrg >>>> v% >>>> 2 >>>> Fbd%2Bmo%3D&reserved=0 >>>> >>>> Search the list archives at: >>>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmar >>>> km >>>> a >>>> il.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Ccsaba.pinter%40que >>>> en >>>> s >>>> u.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb28 >>>> 38 >>>> b >>>> 925c%7C1%7C0%7C636601782604952003&sdata=%2B9tRXKCTKzxtmbkE9hWJz1%2F >>>> oo >>>> B >>>> fefTvNJWtuJta0b1o%3D&reserved=0 >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk. >>>> o >>>> rg%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Ccsaba.pinter%40qu >>>> ee >>>> n >>>> su.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb2 >>>> 83 >>>> 8 >>>> b925c%7C1%7C0%7C636601782604952003&sdata=2HdbAKBlfe1JNhyMG%2BCo%2Fn >>>> wJ >>>> 2 >>>> o2IWDqQHl%2BCIjbu3Fs%3D&reserved=0 >>>> >>>> -- >>>> >>>> Sankhesh Jhaveri >>>> >>>> Sr. Research & Development Engineer | Kitware | (518) 881-4417 >>>> >>>> >>>> _______________________________________________ >>>> Powered by >>>> https://na01.safelinks.protection.outlook.com/?url=www.kitware.com& >>>> da >>>> t >>>> a=02%7C01%7Ccsaba.pinter%40queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f >>>> 2c >>>> 9 >>>> 90%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636601782604952003& >>>> sd >>>> a >>>> ta=OAQC2JW%2FBdByHi6rzs3UR3OuEYMXVtnIBzyO2DLUEBg%3D&reserved=0 >>>> >>>> Visit other Kitware open-source projects at >>>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww >>>> .k >>>> i >>>> tware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Ccsaba.pinte >>>> r% >>>> 4 >>>> 0queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582 >>>> c4 >>>> e >>>> fb2838b925c%7C1%7C0%7C636601782604952003&sdata=ILwtCl2ODMcW2PistT%2 >>>> BU >>>> e >>>> pqKoQ7hCylxaWiGofVT5L8%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 >>>> .v >>>> t >>>> k.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Ccsaba.pinter%40queensu.ca%7Ce >>>> 39 >>>> 4 >>>> ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb2838b925c%7C1 >>>> %7 >>>> C >>>> 0%7C636601782604952003&sdata=M05RBjDP8XffO2U1b2I%2BMOI2jswVhNERqdrg >>>> v% >>>> 2 >>>> Fbd%2Bmo%3D&reserved=0 >>>> >>>> Search the list archives at: >>>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmar >>>> km >>>> a >>>> il.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Ccsaba.pinter%40que >>>> en >>>> s >>>> u.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb28 >>>> 38 >>>> b >>>> 925c%7C1%7C0%7C636601782604952003&sdata=%2B9tRXKCTKzxtmbkE9hWJz1%2F >>>> oo >>>> B >>>> fefTvNJWtuJta0b1o%3D&reserved=0 >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk. >>>> o >>>> rg%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Ccsaba.pinter%40qu >>>> eensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636601782604952003&sdata=2HdbAKBlfe1JNhyMG%2BCo%2FnwJ2o2IWDqQHl%2BCIjbu3Fs%3D&reserved=0 >>>> From sankhesh.jhaveri at kitware.com Wed May 23 16:14:53 2018 From: sankhesh.jhaveri at kitware.com (Sankhesh Jhaveri) Date: Wed, 23 May 2018 16:14:53 -0400 Subject: [vtkusers] Deprecate vtkGeo* classes Message-ID: Folks, There have been some discussions about deprecating a bunch of classes from the vtkGeovisCore and vtkViewsGeovis module owing to the lack of users and maintainers. The tentative list of classes to be deprecated is as follows: - vtkGeoAdaptiveArcs - vtkGeoAlignedImageRepresentation - vtkGeoAlignedImageSource - vtkGeoAssignCoordinates - vtkGeoFileImageSource - vtkGeoFileTerrainSource - vtkGeoGlobeSource - vtkGeoGraticule - vtkGeoImageNode - vtkGeoRandomGraphSource - vtkGeoSampleArcs - vtkGeoSource - vtkGeoTerrain - vtkGeoTerrain2D - vtkGeoTerrainNode - vtkGeoTreeNode - vtkGeoTreeNodeCache - vtkGeoView - vtkGeoView2D The primary reason for deprecation is lack of known users and maintainers. Please reply to this email if you use these classes and intend to maintain them or if you think they shouldn?t be deprecated. Thank you! Sankhesh ? -- Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware | (518) 881-4417 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jesse.Kinross-Smith at bentley.com Wed May 23 21:18:13 2018 From: Jesse.Kinross-Smith at bentley.com (Jesse Kinross-Smith) Date: Thu, 24 May 2018 01:18:13 +0000 Subject: [vtkusers] Failed to get wglChoosePixelFormatARB on VM In-Reply-To: <542e64e8-2733-4d81-9837-443e0b85f3a4@email.android.com> References: <542e64e8-2733-4d81-9837-443e0b85f3a4@email.android.com> Message-ID: It?s very easy (and pretty safe) to test. Just go to the github below ? download their latest prebuilt release. Extract it somewhere, then copy the opengl32.dll appropriate for your application (32 or 64) into the same directory as your app and that?s it. To get back to normal just delete the opengl32.dll at the end I haven?t done an exhaustive test, but while it?s a little slower to load it seems to do everything we?re asking of it. Jesse -- Jesse Kinross-Smith Senior Software Engineer - BSW Bentley Systems, Fremantle From: Todd [mailto:nztoddler at yahoo.com] Sent: Wednesday, 23 May 2018 4:25 PM To: Jesse Kinross-Smith Cc: David E DeMarle ; vtk Subject: RE: [vtkusers] Failed to get wglChoosePixelFormatARB on VM I'd be interested to know whether or not you notice any performance issues using Mesa. On 23 May 2018 3:33 p.m., Jesse Kinross-Smith > wrote: Ahh! Mesa.. of course! (I?d completely forgotten about that project) All I had to do was install Mesa on the VMs and that has enabled them to use software rendering without changing a line of code. https://github.com/pal1000/mesa-dist-win was really helpful here and just did a system wide deployment for my test VM. This enables us to at least deploy this on our automated test environment and get things going there. I?m using VTK 8.1.0 atm, but will look at the helper when I upgrade things and try and do this better. Thanks David! Regards, Jesse -- Jesse Kinross-Smith Senior Software Engineer - BSW Bentley Systems, Fremantle From: David E DeMarle [mailto:dave.demarle at kitware.com] Sent: Wednesday, 23 May 2018 4:42 AM To: Todd Martin > Cc: vtk >; Jesse Kinross-Smith > Subject: Re: [vtkusers] Failed to get wglChoosePixelFormatARB on VM In VTK 8.1.1 on windows, there is a helper that: 1) makes a system call intended to test openGL compatibility 2) lets you swap in mesa if required. See Rendering/OpenGL/vtkTestOpenGLVersion.h and https://gitlab.kitware.com/vtk/vtk/commit/2d10325efedca53a6262550db94484ccc8a12e49 David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Tue, May 22, 2018 at 3:47 AM, Todd Martin via vtkusers > wrote: Failing that you could try using Virtualbox. Todd Martin, Ph.D. Freelance Engineer/Software Architect. On Tuesday, May 22, 2018, 6:56:58 PM GMT+12, Jesse Kinross-Smith > wrote: So it looks like Microsoft?s VM?s only support OpenGL 1.1, and of course our library is built using OpenGL2. Somehow I thought there?d be a fallback option in case it wasn?t supported, but this doesn?t seem to be the case. ? Jesse -- Jesse Kinross-Smith Senior Software Engineer - BSW Bentley Systems, Fremantle From: Todd Martin [mailto:nztoddler at yahoo.com] Sent: Tuesday, 22 May 2018 1:56 PM To: vtk >; Jesse Kinross-Smith > Subject: Re: [vtkusers] Failed to get wglChoosePixelFormatARB on VM Did you install GLEW on the virtual machine? Todd Martin, Ph.D. Freelance Engineer/Software Architect. On Tuesday, May 22, 2018, 5:33:53 PM GMT+12, Jesse Kinross-Smith > wrote: Getting the following errors when testing our app with VTK rendering on a Hyper-V virtual machine (works great on my laptop though): ERROR: In C:\hg\sharedlibs\VTK-8.1.0\Rendering\OpenGL2\vtkWin32OpenGLRenderWindow.cxx, line 685 vtkWin32OpenGLRenderWindow (000001D110ADE9F0): failed to get wglChoosePixelFormatARB ERROR: In C:\hg\sharedlibs\VTK-8.1.0\Rendering\OpenGL2\vtkWin32OpenGLRenderWindow.cxx, line 769 vtkWin32OpenGLRenderWindow (000001D110ADE9F0): failed to get valid pixel format. ERROR: In C:\hg\sharedlibs\VTK-8.1.0\Rendering\OpenGL2\vtkOpenGLRenderWindow.cxx, line 785 vtkWin32OpenGLRenderWindow (000001D110ADE9F0): GLEW could not be initialized. We?re using the vtkMFCWindow class and I don?t see any fallback options anywhere. Is there any way this can default to software rendering on low end machines like this? Jesse -- Jesse Kinross-Smith Senior Software Engineer - BSW Bentley Systems, Fremantle _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://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: https://vtk.org/mailman/listinfo/vtkusers _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: https://vtk.org/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From cartik.sharma at gmail.com Wed May 23 21:18:32 2018 From: cartik.sharma at gmail.com (Cartik Sharma) Date: Wed, 23 May 2018 21:18:32 -0400 Subject: [vtkusers] vtkusers Digest, Vol 169, Issue 23 In-Reply-To: References: Message-ID: Dear VTK Developers, Is there a quantum machine learning toolbox for VTK based on the premise of high energy physics and computing to leverage DWave's quantum architecture? If so, I'd be interested in applying . my skills in modeling and analysis for quantum machine learning for this VTK bridge toolkit. Best regards, Cartik Quantum Machine Learning program, U of Toronto. On Wed, May 16, 2018 at 11:24 AM, wrote: > Send vtkusers mailing list submissions to > vtkusers at vtk.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://vtk.org/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 integration in PyQt (wrong layout) (Aur?lien Marsan) > 2. Re: vtksmartvolumemapper issues (Maguire, Alister Owen) > 3. Re: Large performance difference between > vtkResampleWithDataSet in VTK 8.1.0 and Resample with Dataset > filter in Paraview 5.5 (Evan Kao) > 4. Re: vtksmartvolumemapper issues (mark.ostroot at lickenbrocktech.com) > 5. Re: Large performance difference between > vtkResampleWithDataSet in VTK 8.1.0 and Resample with Dataset > filter in Paraview 5.5 (Sujin Philip) > 6. Re: Large performance difference between > vtkResampleWithDataSet in VTK 8.1.0 and Resample with Dataset > filter in Paraview 5.5 (Evan Kao) > 7. Re: Large performance difference between > vtkResampleWithDataSet in VTK 8.1.0 and Resample with Dataset > filter in Paraview 5.5 (Sujin Philip) > 8. Re: Large performance difference between > vtkResampleWithDataSet in VTK 8.1.0 and Resample with Dataset > filter in Paraview 5.5 (Evan Kao) > 9. Re: Time Interpolation (kenichiro yoshimi) > 10. ANN: Latex and Markdown versions of the VTK textbook > (Bill Lorensen) > 11. Re: VtkDistanceWidget label text font (ashishbme) > 12. Wireframe and Volume Rendering (Andaharoo) > 13. Re: Correct anatomical orientation of volumes from Niftii and > DICOM (ochampao) > 14. nested vtkPropAssembly visibility (Petr Matou?ek) > 15. Re: Wireframe and Volume Rendering (Sankhesh Jhaveri) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 15 May 2018 12:06:24 -0400 > From: Aur?lien Marsan > To: mafiaskafia > Cc: vtkusers > Subject: Re: [vtkusers] VTK integration in PyQt (wrong layout) > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Hi, > > There is a fantastic tutorial on this topic. > See: https://github.com/diego0020/tutorial-vtk-pyqt > > Bests. > > > > 2018-05-09 9:26 GMT-04:00 mafiaskafia : > >> Hey, >> >> Yes of course! >> Here is a screenshot of what i'm seeing: >> >> >> >> And this is what i want: >> >> >> >> Cheers >> >> >> >> >> >> >> >> -- >> 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: >> https://vtk.org/mailman/listinfo/vtkusers >> > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 2 > Date: Tue, 15 May 2018 16:24:21 +0000 > From: "Maguire, Alister Owen" > To: "mark.ostroot at lickenbrocktech.com" > , "vtkusers at vtk.org" > > Subject: Re: [vtkusers] vtksmartvolumemapper issues > Message-ID: <2AD840EC-594A-43A5-8A89-9D27A9E846D0 at llnl.gov> > Content-Type: text/plain; charset="utf-8" > > Are you including the following two lines in your .C file? > > #include > VTK_MODULE_INIT(vtkRenderingVolumeOpenGL2); > > I?m not sure if this is the root of your issue, but I had run into problems while working with vtkSmartVolumeMapper a while back, and I ended up discovering that these two lines were needed for it to be used properly. > > You can find more info about it here > https://www.vtk.org/Wiki/VTK/VTK_6_Migration/Factories_now_require_defines > > Best, > Alister > > > > From: vtkusers on behalf of "mark.ostroot at lickenbrocktech.com" > Date: Tuesday, May 15, 2018 at 8:43 AM > To: "vtkusers at vtk.org" > Subject: [vtkusers] vtksmartvolumemapper issues > > Hello all, > > I am updating some old vtk 6.3 code to vtk 8.1, Currently the older code uses vtksmartvolumemapper, I am running into a run time error with a new smart pointer. > > my code: > > #include > .. > .. > .. > vtkSmartPointer vMapper = vtkSmartPointer::New(); < = this breaks with unhandled exception at (vtkRenderingVolume-8.1.dll) Access violation reading location 0x0000000000000000 > > > > The code compiles, but I hit this run time exception on execution. I don't believe the smartvolumemapper has been deprecated, does anyone have any idea of what I am doing wrong? > > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 3 > Date: Tue, 15 May 2018 10:05:01 -0700 > From: Evan Kao > To: Sujin Philip > Cc: Shawn Waldon , VTK Users > > Subject: Re: [vtkusers] Large performance difference between > vtkResampleWithDataSet in VTK 8.1.0 and Resample with Dataset filter > in Paraview 5.5 > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Hi Shawn and Sujin, > > Thanks for the quick responses. The CPU on the computer I'm using is an > i7-6700 > > with 4 cores, 8 threads, and 3.4 GHz frequency. > > Multi-threading may be a factor, but it's hard to tell because resampling > in ParaView is so quick. ParaView is capable of using 100% of the CPU, > while VTK (in Python) will max out at 12-13%. However, for these > particular datasets, resampling doesn't appear to stress ParaView that much > (11-16% when observing the Windows Task Manager, and some of that may be > because of the rendering). However, I was under the impression that at > best multi-threading could only reduce the time it takes by N threads (ie > 8x), while the speed difference here is almost 1000x. I measured the times > for ParaView 5.5, VTK 8.1 (compiled elsewhere), and VTK 7.1 (compiled by > our group): > > 1. ParaView 5.5 - 1.1s, using a stopwatch, multiple trials. Timing > started the moment I clicked "Apply". > 2. VTK 8.1 - 922.47s, timed using Python's timeit module, measuring only > the vtkResampleWithDataSet.Update() method. > 3. VTK 7.1 - 950.47s, timed the same way as above. > > I'm aware of the difference in labeling between VTK and ParaView for Source > and Input (which confuses me all the time). I can verify the correct data > sets were assigned by saving the output (which should an unstructured grid) > and viewing it in ParaView - it looks identical to the resampled data > generated in ParaView (although it overwrites the point scalars array and > adds some ghost information that needs to be removed). > > Thanks, > Evan > > On Tue, May 15, 2018 at 7:38 AM, Sujin Philip > wrote: > >> Hi Evan, >> >> As Shawn mentioned it could be due to lack of multi-threading. Could you >> provide us the configuration of the system you are using? Like the number >> of cores/threads and the CPU frequency? Also please share the actual time >> that ParaView and VTK are taking. Is it possible for you to try out a >> slightly older VTK version and see if the performance difference is still >> there? >> >> Which dataset are you setting as input and which as source? The names are >> unfortunately opposite between VTK-m and ParaView due to legacy reasons. >> Probing with the unstructured grid as the source is much slower than >> probing with the structured grid as the source. So please confirm that the >> VTK pipeline is set up properly. >> >> Please let me know if none these seem to be the cause of your problem and >> I will dig deeper. >> >> Thanks >> Sujin >> >> >> >> On Tue, May 15, 2018 at 9:52 AM, Shawn Waldon >> wrote: >> >>> Hi Evan, >>> >>> I suspect the differece is that the ParaView binaries were compiled with >>> TBB multithreading support and the Anaconda VTK was not. >>> vtkResampleWithDataSet is set up to use TBB multithreading if available. >>> Check the utilization of the cores on your computer when running each and >>> you will see ParaView using all available cores and Anaconda's VTK probably >>> only using one. It is also possible the cell locator change improved >>> things further but I'm not familiar with that. >>> >>> HTH, >>> >>> Shawn >>> >>> On Mon, May 14, 2018 at 7:54 PM, Evan Kao wrote: >>> >>>> Hello all, >>>> >>>> I am trying to resample a structured grid data (~1.4M points, 1.3M >>>> cells) with an unstructured grid (~320K points, 480K cells). In Paraview >>>> 5.5, this resampling is nearly instant with the Resample With Dataset >>>> filter. Yet in a Python script using vtkResampleWithDataSet from VTK >>>> 8.1.0, the same operation takes about 15 minutes (>2 orders of magnitude >>>> difference in speed). As far as I can tell from the VTK repository on >>>> Gitlab, the only difference between the Paraview/release version and the >>>> 8.1.0 or 8.1.1 tagged releases is a switch in the cell locator. Is this >>>> enough to explain the difference in the performance? If not, could someone >>>> enlighten me as to what the possible factors are here? >>>> >>>> Also, if it matters, this is all on a Windows 7 64-bit machine. >>>> Paraview is installed from binaries, while VTK was downloaded from an >>>> Anaconda distribution compiled by a third party. >>>> >>>> Thanks for your time, >>>> Evan Kao >>>> >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://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: >>>> https://vtk.org/mailman/listinfo/vtkusers >>>> >>>> >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> https://vtk.org/mailman/listinfo/vtkusers >>> >>> >> > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 4 > Date: Tue, 15 May 2018 10:07:52 -0700 > From: > To: "Maguire, Alister Owen" > Cc: vtkusers at vtk.org > Subject: Re: [vtkusers] vtksmartvolumemapper issues > Message-ID: > <20180515100752.c7db654a879d86b78cfcacc46040d57b.abe68c2fdf.mailapi at email09.godaddy.com> > > Content-Type: text/plain; charset="utf-8" > > Alister, > > Thanks for your help I managed to get the code working now It was a missing autoinit line. > > I ended up needing to add > #define vtkRenderingVolume_AUTOINIT 1(vtkRenderingVolumeOpenGL2) > > at the top of my code > -Thanks, > Mark > > > --------- Original Message --------- Subject: Re: [vtkusers] vtksmartvolumemapper issues > From: "Maguire, Alister Owen" > Date: 5/15/18 9:24 am > To: "mark.ostroot at lickenbrocktech.com" , "vtkusers at vtk.org" > > Are you including the following two lines in your .C file? > > #include > VTK_MODULE_INIT(vtkRenderingVolumeOpenGL2); > > I'm not sure if this is the root of your issue, but I had run into problems while working with vtkSmartVolumeMapper a while back, and I ended up discovering that these two lines were needed for it to be used properly. > > You can find more info about it here > https://www.vtk.org/Wiki/VTK/VTK_6_Migration/Factories_now_require_defines > > Best, > Alister > > > > From: vtkusers on behalf of "mark.ostroot at lickenbrocktech.com" > Date: Tuesday, May 15, 2018 at 8:43 AM > To: "vtkusers at vtk.org" > Subject: [vtkusers] vtksmartvolumemapper issues > > > > Hello all, > > > > I am updating some old vtk 6.3 code to vtk 8.1, Currently the older code uses vtksmartvolumemapper, I am running into a run time error with a new smart pointer. > > > > my code: > > > > #include > > .. > > .. > > .. > > vtkSmartPointer vMapper = vtkSmartPointer::New(); < = this breaks with unhandled exception at (vtkRenderingVolume-8.1.dll) Access violation reading location 0x0000000000000000 > > > > > > > > The code compiles, but I hit this run time exception on execution. I don't believe the smartvolumemapper has been deprecated, does anyone have any idea of what I am doing wrong? > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 5 > Date: Tue, 15 May 2018 15:32:23 -0400 > From: Sujin Philip > To: Evan Kao > Cc: Shawn Waldon , VTK Users > > Subject: Re: [vtkusers] Large performance difference between > vtkResampleWithDataSet in VTK 8.1.0 and Resample with Dataset filter > in Paraview 5.5 > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Hi Evan, > > I tried testing this on my end and I am seeing expected performance from > VTK and ParaView. But the performance is dependent on the datasets used. Is > it possible for you to share your datasets and scripts with us? Could you > try this with smaller versions of your datasets and see if you are able to > reproduce this? > > I am not familiar with the timeit module in Python. From the documentation > it looks like it runs the code multiple times by default and prints the > total time. Can you confirm if you have taken this into consideration in > your script? > > A simple way to time operations in ParaView is to refer to the "Timer Log" > under the "Tools" menu. You should see a line like: > > Execute vtkResampleWithDataSet id: 6788, 2.70556 seconds > > > Thanks > Sujin > > > On Tue, May 15, 2018 at 1:05 PM, Evan Kao wrote: > >> Hi Shawn and Sujin, >> >> Thanks for the quick responses. The CPU on the computer I'm using is an >> i7-6700 >> >> with 4 cores, 8 threads, and 3.4 GHz frequency. >> >> Multi-threading may be a factor, but it's hard to tell because resampling >> in ParaView is so quick. ParaView is capable of using 100% of the CPU, >> while VTK (in Python) will max out at 12-13%. However, for these >> particular datasets, resampling doesn't appear to stress ParaView that much >> (11-16% when observing the Windows Task Manager, and some of that may be >> because of the rendering). However, I was under the impression that at >> best multi-threading could only reduce the time it takes by N threads (ie >> 8x), while the speed difference here is almost 1000x. I measured the times >> for ParaView 5.5, VTK 8.1 (compiled elsewhere), and VTK 7.1 (compiled by >> our group): >> >> 1. ParaView 5.5 - 1.1s, using a stopwatch, multiple trials. Timing >> started the moment I clicked "Apply". >> 2. VTK 8.1 - 922.47s, timed using Python's timeit module, measuring >> only the vtkResampleWithDataSet.Update() method. >> 3. VTK 7.1 - 950.47s, timed the same way as above. >> >> I'm aware of the difference in labeling between VTK and ParaView for >> Source and Input (which confuses me all the time). I can verify the >> correct data sets were assigned by saving the output (which should an >> unstructured grid) and viewing it in ParaView - it looks identical to the >> resampled data generated in ParaView (although it overwrites the point >> scalars array and adds some ghost information that needs to be removed). >> >> Thanks, >> Evan >> >> On Tue, May 15, 2018 at 7:38 AM, Sujin Philip >> wrote: >> >>> Hi Evan, >>> >>> As Shawn mentioned it could be due to lack of multi-threading. Could you >>> provide us the configuration of the system you are using? Like the number >>> of cores/threads and the CPU frequency? Also please share the actual time >>> that ParaView and VTK are taking. Is it possible for you to try out a >>> slightly older VTK version and see if the performance difference is still >>> there? >>> >>> Which dataset are you setting as input and which as source? The names are >>> unfortunately opposite between VTK-m and ParaView due to legacy reasons. >>> Probing with the unstructured grid as the source is much slower than >>> probing with the structured grid as the source. So please confirm that the >>> VTK pipeline is set up properly. >>> >>> Please let me know if none these seem to be the cause of your problem and >>> I will dig deeper. >>> >>> Thanks >>> Sujin >>> >>> >>> >>> On Tue, May 15, 2018 at 9:52 AM, Shawn Waldon >>> wrote: >>> >>>> Hi Evan, >>>> >>>> I suspect the differece is that the ParaView binaries were compiled with >>>> TBB multithreading support and the Anaconda VTK was not. >>>> vtkResampleWithDataSet is set up to use TBB multithreading if available. >>>> Check the utilization of the cores on your computer when running each and >>>> you will see ParaView using all available cores and Anaconda's VTK probably >>>> only using one. It is also possible the cell locator change improved >>>> things further but I'm not familiar with that. >>>> >>>> HTH, >>>> >>>> Shawn >>>> >>>> On Mon, May 14, 2018 at 7:54 PM, Evan Kao wrote: >>>> >>>>> Hello all, >>>>> >>>>> I am trying to resample a structured grid data (~1.4M points, 1.3M >>>>> cells) with an unstructured grid (~320K points, 480K cells). In Paraview >>>>> 5.5, this resampling is nearly instant with the Resample With Dataset >>>>> filter. Yet in a Python script using vtkResampleWithDataSet from VTK >>>>> 8.1.0, the same operation takes about 15 minutes (>2 orders of magnitude >>>>> difference in speed). As far as I can tell from the VTK repository on >>>>> Gitlab, the only difference between the Paraview/release version and the >>>>> 8.1.0 or 8.1.1 tagged releases is a switch in the cell locator. Is this >>>>> enough to explain the difference in the performance? If not, could someone >>>>> enlighten me as to what the possible factors are here? >>>>> >>>>> Also, if it matters, this is all on a Windows 7 64-bit machine. >>>>> Paraview is installed from binaries, while VTK was downloaded from an >>>>> Anaconda distribution compiled by a third party. >>>>> >>>>> Thanks for your time, >>>>> Evan Kao >>>>> >>>>> _______________________________________________ >>>>> Powered by www.kitware.com >>>>> >>>>> Visit other Kitware open-source projects at >>>>> http://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: >>>>> https://vtk.org/mailman/listinfo/vtkusers >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ at: >>>> http://www.vtk.org/Wiki/VTK_FAQ >>>> >>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> https://vtk.org/mailman/listinfo/vtkusers >>>> >>>> >>> >> > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 6 > Date: Tue, 15 May 2018 13:47:44 -0700 > From: Evan Kao > To: Sujin Philip > Cc: Shawn Waldon , VTK Users > > Subject: Re: [vtkusers] Large performance difference between > vtkResampleWithDataSet in VTK 8.1.0 and Resample with Dataset filter > in Paraview 5.5 > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Hello Sujin, > > Using the TimerLog, I got the following time from ParaView: > > Execute vtkResampleWithDataSet id: 10345, 0.42 seconds > > As for the timeit module, you can see how I use it in the attached Python > script. I only use timeit's default_timer function to grab the time before > and after completion of the vtkResampleWithDataSet method and take the > difference as the time elapsed. Regardless, qualitatively ParaView is > near-instant while VTK takes a while. > > Google drive links to the datasets themselves are here (hopefully this > doesn't trigger any mailing list filters): Unstructured Grid (35MB) > | > Structured > Grid (70MB) > > > If I get a chance, I'll take a look at using smaller data sets. > > - Evan > > > On Tue, May 15, 2018 at 12:32 PM, Sujin Philip > wrote: > >> Hi Evan, >> >> I tried testing this on my end and I am seeing expected performance from >> VTK and ParaView. But the performance is dependent on the datasets used. Is >> it possible for you to share your datasets and scripts with us? Could you >> try this with smaller versions of your datasets and see if you are able to >> reproduce this? >> >> I am not familiar with the timeit module in Python. From the documentation >> it looks like it runs the code multiple times by default and prints the >> total time. Can you confirm if you have taken this into consideration in >> your script? >> >> A simple way to time operations in ParaView is to refer to the "Timer Log" >> under the "Tools" menu. You should see a line like: >> >> Execute vtkResampleWithDataSet id: 6788, 2.70556 seconds >> >> >> Thanks >> Sujin >> >> >> On Tue, May 15, 2018 at 1:05 PM, Evan Kao wrote: >> >>> Hi Shawn and Sujin, >>> >>> Thanks for the quick responses. The CPU on the computer I'm using is an >>> i7-6700 >>> >>> with 4 cores, 8 threads, and 3.4 GHz frequency. >>> >>> Multi-threading may be a factor, but it's hard to tell because resampling >>> in ParaView is so quick. ParaView is capable of using 100% of the CPU, >>> while VTK (in Python) will max out at 12-13%. However, for these >>> particular datasets, resampling doesn't appear to stress ParaView that much >>> (11-16% when observing the Windows Task Manager, and some of that may be >>> because of the rendering). However, I was under the impression that at >>> best multi-threading could only reduce the time it takes by N threads (ie >>> 8x), while the speed difference here is almost 1000x. I measured the times >>> for ParaView 5.5, VTK 8.1 (compiled elsewhere), and VTK 7.1 (compiled by >>> our group): >>> >>> 1. ParaView 5.5 - 1.1s, using a stopwatch, multiple trials. Timing >>> started the moment I clicked "Apply". >>> 2. VTK 8.1 - 922.47s, timed using Python's timeit module, measuring >>> only the vtkResampleWithDataSet.Update() method. >>> 3. VTK 7.1 - 950.47s, timed the same way as above. >>> >>> I'm aware of the difference in labeling between VTK and ParaView for >>> Source and Input (which confuses me all the time). I can verify the >>> correct data sets were assigned by saving the output (which should an >>> unstructured grid) and viewing it in ParaView - it looks identical to the >>> resampled data generated in ParaView (although it overwrites the point >>> scalars array and adds some ghost information that needs to be removed). >>> >>> Thanks, >>> Evan >>> >>> On Tue, May 15, 2018 at 7:38 AM, Sujin Philip >>> wrote: >>> >>>> Hi Evan, >>>> >>>> As Shawn mentioned it could be due to lack of multi-threading. Could you >>>> provide us the configuration of the system you are using? Like the number >>>> of cores/threads and the CPU frequency? Also please share the actual time >>>> that ParaView and VTK are taking. Is it possible for you to try out a >>>> slightly older VTK version and see if the performance difference is still >>>> there? >>>> >>>> Which dataset are you setting as input and which as source? The names >>>> are unfortunately opposite between VTK-m and ParaView due to legacy >>>> reasons. Probing with the unstructured grid as the source is much slower >>>> than probing with the structured grid as the source. So please confirm that >>>> the VTK pipeline is set up properly. >>>> >>>> Please let me know if none these seem to be the cause of your problem >>>> and I will dig deeper. >>>> >>>> Thanks >>>> Sujin >>>> >>>> >>>> >>>> On Tue, May 15, 2018 at 9:52 AM, Shawn Waldon >>>> wrote: >>>> >>>>> Hi Evan, >>>>> >>>>> I suspect the differece is that the ParaView binaries were compiled >>>>> with TBB multithreading support and the Anaconda VTK was not. >>>>> vtkResampleWithDataSet is set up to use TBB multithreading if available. >>>>> Check the utilization of the cores on your computer when running each and >>>>> you will see ParaView using all available cores and Anaconda's VTK probably >>>>> only using one. It is also possible the cell locator change improved >>>>> things further but I'm not familiar with that. >>>>> >>>>> HTH, >>>>> >>>>> Shawn >>>>> >>>>> On Mon, May 14, 2018 at 7:54 PM, Evan Kao wrote: >>>>> >>>>>> Hello all, >>>>>> >>>>>> I am trying to resample a structured grid data (~1.4M points, 1.3M >>>>>> cells) with an unstructured grid (~320K points, 480K cells). In Paraview >>>>>> 5.5, this resampling is nearly instant with the Resample With Dataset >>>>>> filter. Yet in a Python script using vtkResampleWithDataSet from VTK >>>>>> 8.1.0, the same operation takes about 15 minutes (>2 orders of magnitude >>>>>> difference in speed). As far as I can tell from the VTK repository on >>>>>> Gitlab, the only difference between the Paraview/release version and the >>>>>> 8.1.0 or 8.1.1 tagged releases is a switch in the cell locator. Is this >>>>>> enough to explain the difference in the performance? If not, could someone >>>>>> enlighten me as to what the possible factors are here? >>>>>> >>>>>> Also, if it matters, this is all on a Windows 7 64-bit machine. >>>>>> Paraview is installed from binaries, while VTK was downloaded from an >>>>>> Anaconda distribution compiled by a third party. >>>>>> >>>>>> Thanks for your time, >>>>>> Evan Kao >>>>>> >>>>>> _______________________________________________ >>>>>> Powered by www.kitware.com >>>>>> >>>>>> Visit other Kitware open-source projects at >>>>>> http://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: >>>>>> https://vtk.org/mailman/listinfo/vtkusers >>>>>> >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Powered by www.kitware.com >>>>> >>>>> Visit other Kitware open-source projects at >>>>> http://www.kitware.com/opensource/opensource.html >>>>> >>>>> Please keep messages on-topic and check the VTK FAQ at: >>>>> http://www.vtk.org/Wiki/VTK_FAQ >>>>> >>>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>>> >>>>> Follow this link to subscribe/unsubscribe: >>>>> https://vtk.org/mailman/listinfo/vtkusers >>>>> >>>>> >>>> >>> >> > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: test_vtkresamplewithdataset.py > Type: application/octet-stream > Size: 1287 bytes > Desc: not available > URL: > > ------------------------------ > > Message: 7 > Date: Tue, 15 May 2018 17:36:10 -0400 > From: Sujin Philip > To: Evan Kao > Cc: Shawn Waldon , VTK Users > > Subject: Re: [vtkusers] Large performance difference between > vtkResampleWithDataSet in VTK 8.1.0 and Resample with Dataset filter > in Paraview 5.5 > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Hi Evan, > > Thanks for sharing the data. I tried your script on my Linux desktop and > the performance I see on both VTK and ParaView is similar and <1 second. > This is even without threading enabled. I haven't tried this on Windows yet. > > BTW, there is an error in the script you shared. The inputs to the resample > filter are in the wrong order and the "vtkXMLUnstructuredGridWriter" throws > an error saying that the data passed to it is not an unstructured grid. I > assume you want to resample the data values from the structured grid on to > the geometry provided by the unstructured grid. The result will be an > unstructured grid, which can be written by the > "vtkXMLUnstructuredGridWrite". For this the input should be the "mesh" data > and the source should be "image". > > So, currently I don't have a good explanation for what is causing the > performance degradation for you. It might be some issues with the builds, > or the Windows setup. You can maybe try building VTK yourself (make sure to > build in "Release" mode), or try another machine and see if the problem > persists. I will also try to reproduce this on a Windows machine. > > Thanks > Sujin > > > On Tue, May 15, 2018 at 4:47 PM, Evan Kao wrote: > >> Hello Sujin, >> >> Using the TimerLog, I got the following time from ParaView: >> >> Execute vtkResampleWithDataSet id: 10345, 0.42 seconds >> >> As for the timeit module, you can see how I use it in the attached Python >> script. I only use timeit's default_timer function to grab the time before >> and after completion of the vtkResampleWithDataSet method and take the >> difference as the time elapsed. Regardless, qualitatively ParaView is >> near-instant while VTK takes a while. >> >> Google drive links to the datasets themselves are here (hopefully this >> doesn't trigger any mailing list filters): Unstructured Grid (35MB) >> | Structured >> Grid (70MB) >> >> >> If I get a chance, I'll take a look at using smaller data sets. >> >> - Evan >> >> >> On Tue, May 15, 2018 at 12:32 PM, Sujin Philip >> wrote: >> >>> Hi Evan, >>> >>> I tried testing this on my end and I am seeing expected performance from >>> VTK and ParaView. But the performance is dependent on the datasets used. Is >>> it possible for you to share your datasets and scripts with us? Could you >>> try this with smaller versions of your datasets and see if you are able to >>> reproduce this? >>> >>> I am not familiar with the timeit module in Python. From the >>> documentation it looks like it runs the code multiple times by default and >>> prints the total time. Can you confirm if you have taken this into >>> consideration in your script? >>> >>> A simple way to time operations in ParaView is to refer to the "Timer >>> Log" under the "Tools" menu. You should see a line like: >>> >>> Execute vtkResampleWithDataSet id: 6788, 2.70556 seconds >>> >>> >>> Thanks >>> Sujin >>> >>> >>> On Tue, May 15, 2018 at 1:05 PM, Evan Kao wrote: >>> >>>> Hi Shawn and Sujin, >>>> >>>> Thanks for the quick responses. The CPU on the computer I'm using is an >>>> i7-6700 >>>> >>>> with 4 cores, 8 threads, and 3.4 GHz frequency. >>>> >>>> Multi-threading may be a factor, but it's hard to tell because >>>> resampling in ParaView is so quick. ParaView is capable of using 100% of >>>> the CPU, while VTK (in Python) will max out at 12-13%. However, for these >>>> particular datasets, resampling doesn't appear to stress ParaView that much >>>> (11-16% when observing the Windows Task Manager, and some of that may be >>>> because of the rendering). However, I was under the impression that at >>>> best multi-threading could only reduce the time it takes by N threads (ie >>>> 8x), while the speed difference here is almost 1000x. I measured the times >>>> for ParaView 5.5, VTK 8.1 (compiled elsewhere), and VTK 7.1 (compiled by >>>> our group): >>>> >>>> 1. ParaView 5.5 - 1.1s, using a stopwatch, multiple trials. Timing >>>> started the moment I clicked "Apply". >>>> 2. VTK 8.1 - 922.47s, timed using Python's timeit module, measuring >>>> only the vtkResampleWithDataSet.Update() method. >>>> 3. VTK 7.1 - 950.47s, timed the same way as above. >>>> >>>> I'm aware of the difference in labeling between VTK and ParaView for >>>> Source and Input (which confuses me all the time). I can verify the >>>> correct data sets were assigned by saving the output (which should an >>>> unstructured grid) and viewing it in ParaView - it looks identical to the >>>> resampled data generated in ParaView (although it overwrites the point >>>> scalars array and adds some ghost information that needs to be removed). >>>> >>>> Thanks, >>>> Evan >>>> >>>> On Tue, May 15, 2018 at 7:38 AM, Sujin Philip >>>> wrote: >>>> >>>>> Hi Evan, >>>>> >>>>> As Shawn mentioned it could be due to lack of multi-threading. Could >>>>> you provide us the configuration of the system you are using? Like the >>>>> number of cores/threads and the CPU frequency? Also please share the actual >>>>> time that ParaView and VTK are taking. Is it possible for you to try out a >>>>> slightly older VTK version and see if the performance difference is still >>>>> there? >>>>> >>>>> Which dataset are you setting as input and which as source? The names >>>>> are unfortunately opposite between VTK-m and ParaView due to legacy >>>>> reasons. Probing with the unstructured grid as the source is much slower >>>>> than probing with the structured grid as the source. So please confirm that >>>>> the VTK pipeline is set up properly. >>>>> >>>>> Please let me know if none these seem to be the cause of your problem >>>>> and I will dig deeper. >>>>> >>>>> Thanks >>>>> Sujin >>>>> >>>>> >>>>> >>>>> On Tue, May 15, 2018 at 9:52 AM, Shawn Waldon >>>> > wrote: >>>>> >>>>>> Hi Evan, >>>>>> >>>>>> I suspect the differece is that the ParaView binaries were compiled >>>>>> with TBB multithreading support and the Anaconda VTK was not. >>>>>> vtkResampleWithDataSet is set up to use TBB multithreading if available. >>>>>> Check the utilization of the cores on your computer when running each and >>>>>> you will see ParaView using all available cores and Anaconda's VTK probably >>>>>> only using one. It is also possible the cell locator change improved >>>>>> things further but I'm not familiar with that. >>>>>> >>>>>> HTH, >>>>>> >>>>>> Shawn >>>>>> >>>>>> On Mon, May 14, 2018 at 7:54 PM, Evan Kao wrote: >>>>>> >>>>>>> Hello all, >>>>>>> >>>>>>> I am trying to resample a structured grid data (~1.4M points, 1.3M >>>>>>> cells) with an unstructured grid (~320K points, 480K cells). In Paraview >>>>>>> 5.5, this resampling is nearly instant with the Resample With Dataset >>>>>>> filter. Yet in a Python script using vtkResampleWithDataSet from VTK >>>>>>> 8.1.0, the same operation takes about 15 minutes (>2 orders of magnitude >>>>>>> difference in speed). As far as I can tell from the VTK repository on >>>>>>> Gitlab, the only difference between the Paraview/release version and the >>>>>>> 8.1.0 or 8.1.1 tagged releases is a switch in the cell locator. Is this >>>>>>> enough to explain the difference in the performance? If not, could someone >>>>>>> enlighten me as to what the possible factors are here? >>>>>>> >>>>>>> Also, if it matters, this is all on a Windows 7 64-bit machine. >>>>>>> Paraview is installed from binaries, while VTK was downloaded from an >>>>>>> Anaconda distribution compiled by a third party. >>>>>>> >>>>>>> Thanks for your time, >>>>>>> Evan Kao >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Powered by www.kitware.com >>>>>>> >>>>>>> Visit other Kitware open-source projects at >>>>>>> http://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: >>>>>>> https://vtk.org/mailman/listinfo/vtkusers >>>>>>> >>>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Powered by www.kitware.com >>>>>> >>>>>> Visit other Kitware open-source projects at >>>>>> http://www.kitware.com/opensource/opensource.html >>>>>> >>>>>> Please keep messages on-topic and check the VTK FAQ at: >>>>>> http://www.vtk.org/Wiki/VTK_FAQ >>>>>> >>>>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>>>> >>>>>> Follow this link to subscribe/unsubscribe: >>>>>> https://vtk.org/mailman/listinfo/vtkusers >>>>>> >>>>>> >>>>> >>>> >>> >> > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 8 > Date: Tue, 15 May 2018 15:28:43 -0700 > From: Evan Kao > To: Sujin Philip > Cc: Shawn Waldon , VTK Users > > Subject: Re: [vtkusers] Large performance difference between > vtkResampleWithDataSet in VTK 8.1.0 and Resample with Dataset filter > in Paraview 5.5 > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Hi Sujin, > > I thought I had put in the correct source/input, but I suppose I should > have checked more closely. Still, it didn't make that much of a difference > (634s or 10.5 min). I'll continue checking if this problem persists for me > on other platforms. > > I also tried using vtkResampleWithDataSet inside a Programmable Filter in > ParaView, and it performed quickly (0.98s). > > Is it possible to see the build flags for your version of VTK, or the ones > that were used for the ParaView binaries? Were you using testing on VTK > 8.1 or the latest version? > > Thanks, > Evan Kao > > On Tue, May 15, 2018 at 2:36 PM, Sujin Philip > wrote: > >> Hi Evan, >> >> Thanks for sharing the data. I tried your script on my Linux desktop and >> the performance I see on both VTK and ParaView is similar and <1 second. >> This is even without threading enabled. I haven't tried this on Windows yet. >> >> BTW, there is an error in the script you shared. The inputs to the >> resample filter are in the wrong order and the >> "vtkXMLUnstructuredGridWriter" throws an error saying that the data passed >> to it is not an unstructured grid. I assume you want to resample the data >> values from the structured grid on to the geometry provided by the >> unstructured grid. The result will be an unstructured grid, which can be >> written by the "vtkXMLUnstructuredGridWrite". For this the input should be >> the "mesh" data and the source should be "image". >> >> So, currently I don't have a good explanation for what is causing the >> performance degradation for you. It might be some issues with the builds, >> or the Windows setup. You can maybe try building VTK yourself (make sure to >> build in "Release" mode), or try another machine and see if the problem >> persists. I will also try to reproduce this on a Windows machine. >> >> Thanks >> Sujin >> >> >> On Tue, May 15, 2018 at 4:47 PM, Evan Kao wrote: >> >>> Hello Sujin, >>> >>> Using the TimerLog, I got the following time from ParaView: >>> >>> Execute vtkResampleWithDataSet id: 10345, 0.42 seconds >>> >>> As for the timeit module, you can see how I use it in the attached Python >>> script. I only use timeit's default_timer function to grab the time before >>> and after completion of the vtkResampleWithDataSet method and take the >>> difference as the time elapsed. Regardless, qualitatively ParaView is >>> near-instant while VTK takes a while. >>> >>> Google drive links to the datasets themselves are here (hopefully this >>> doesn't trigger any mailing list filters): Unstructured Grid (35MB) >>> | Structured >>> Grid (70MB) >>> >>> >>> If I get a chance, I'll take a look at using smaller data sets. >>> >>> - Evan >>> >>> >>> On Tue, May 15, 2018 at 12:32 PM, Sujin Philip >>> wrote: >>> >>>> Hi Evan, >>>> >>>> I tried testing this on my end and I am seeing expected performance from >>>> VTK and ParaView. But the performance is dependent on the datasets used. Is >>>> it possible for you to share your datasets and scripts with us? Could you >>>> try this with smaller versions of your datasets and see if you are able to >>>> reproduce this? >>>> >>>> I am not familiar with the timeit module in Python. From the >>>> documentation it looks like it runs the code multiple times by default and >>>> prints the total time. Can you confirm if you have taken this into >>>> consideration in your script? >>>> >>>> A simple way to time operations in ParaView is to refer to the "Timer >>>> Log" under the "Tools" menu. You should see a line like: >>>> >>>> Execute vtkResampleWithDataSet id: 6788, 2.70556 seconds >>>> >>>> >>>> Thanks >>>> Sujin >>>> >>>> >>>> On Tue, May 15, 2018 at 1:05 PM, Evan Kao wrote: >>>> >>>>> Hi Shawn and Sujin, >>>>> >>>>> Thanks for the quick responses. The CPU on the computer I'm using is >>>>> an i7-6700 >>>>> >>>>> with 4 cores, 8 threads, and 3.4 GHz frequency. >>>>> >>>>> Multi-threading may be a factor, but it's hard to tell because >>>>> resampling in ParaView is so quick. ParaView is capable of using 100% of >>>>> the CPU, while VTK (in Python) will max out at 12-13%. However, for these >>>>> particular datasets, resampling doesn't appear to stress ParaView that much >>>>> (11-16% when observing the Windows Task Manager, and some of that may be >>>>> because of the rendering). However, I was under the impression that at >>>>> best multi-threading could only reduce the time it takes by N threads (ie >>>>> 8x), while the speed difference here is almost 1000x. I measured the times >>>>> for ParaView 5.5, VTK 8.1 (compiled elsewhere), and VTK 7.1 (compiled by >>>>> our group): >>>>> >>>>> 1. ParaView 5.5 - 1.1s, using a stopwatch, multiple trials. Timing >>>>> started the moment I clicked "Apply". >>>>> 2. VTK 8.1 - 922.47s, timed using Python's timeit module, measuring >>>>> only the vtkResampleWithDataSet.Update() method. >>>>> 3. VTK 7.1 - 950.47s, timed the same way as above. >>>>> >>>>> I'm aware of the difference in labeling between VTK and ParaView for >>>>> Source and Input (which confuses me all the time). I can verify the >>>>> correct data sets were assigned by saving the output (which should an >>>>> unstructured grid) and viewing it in ParaView - it looks identical to the >>>>> resampled data generated in ParaView (although it overwrites the point >>>>> scalars array and adds some ghost information that needs to be removed). >>>>> >>>>> Thanks, >>>>> Evan >>>>> >>>>> On Tue, May 15, 2018 at 7:38 AM, Sujin Philip >>>> > wrote: >>>>> >>>>>> Hi Evan, >>>>>> >>>>>> As Shawn mentioned it could be due to lack of multi-threading. Could >>>>>> you provide us the configuration of the system you are using? Like the >>>>>> number of cores/threads and the CPU frequency? Also please share the actual >>>>>> time that ParaView and VTK are taking. Is it possible for you to try out a >>>>>> slightly older VTK version and see if the performance difference is still >>>>>> there? >>>>>> >>>>>> Which dataset are you setting as input and which as source? The names >>>>>> are unfortunately opposite between VTK-m and ParaView due to legacy >>>>>> reasons. Probing with the unstructured grid as the source is much slower >>>>>> than probing with the structured grid as the source. So please confirm that >>>>>> the VTK pipeline is set up properly. >>>>>> >>>>>> Please let me know if none these seem to be the cause of your problem >>>>>> and I will dig deeper. >>>>>> >>>>>> Thanks >>>>>> Sujin >>>>>> >>>>>> >>>>>> >>>>>> On Tue, May 15, 2018 at 9:52 AM, Shawn Waldon < >>>>>> shawn.waldon at kitware.com> wrote: >>>>>> >>>>>>> Hi Evan, >>>>>>> >>>>>>> I suspect the differece is that the ParaView binaries were compiled >>>>>>> with TBB multithreading support and the Anaconda VTK was not. >>>>>>> vtkResampleWithDataSet is set up to use TBB multithreading if available. >>>>>>> Check the utilization of the cores on your computer when running each and >>>>>>> you will see ParaView using all available cores and Anaconda's VTK probably >>>>>>> only using one. It is also possible the cell locator change improved >>>>>>> things further but I'm not familiar with that. >>>>>>> >>>>>>> HTH, >>>>>>> >>>>>>> Shawn >>>>>>> >>>>>>> On Mon, May 14, 2018 at 7:54 PM, Evan Kao wrote: >>>>>>> >>>>>>>> Hello all, >>>>>>>> >>>>>>>> I am trying to resample a structured grid data (~1.4M points, 1.3M >>>>>>>> cells) with an unstructured grid (~320K points, 480K cells). In Paraview >>>>>>>> 5.5, this resampling is nearly instant with the Resample With Dataset >>>>>>>> filter. Yet in a Python script using vtkResampleWithDataSet from VTK >>>>>>>> 8.1.0, the same operation takes about 15 minutes (>2 orders of magnitude >>>>>>>> difference in speed). As far as I can tell from the VTK repository on >>>>>>>> Gitlab, the only difference between the Paraview/release version and the >>>>>>>> 8.1.0 or 8.1.1 tagged releases is a switch in the cell locator. Is this >>>>>>>> enough to explain the difference in the performance? If not, could someone >>>>>>>> enlighten me as to what the possible factors are here? >>>>>>>> >>>>>>>> Also, if it matters, this is all on a Windows 7 64-bit machine. >>>>>>>> Paraview is installed from binaries, while VTK was downloaded from an >>>>>>>> Anaconda distribution compiled by a third party. >>>>>>>> >>>>>>>> Thanks for your time, >>>>>>>> Evan Kao >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Powered by www.kitware.com >>>>>>>> >>>>>>>> Visit other Kitware open-source projects at >>>>>>>> http://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: >>>>>>>> https://vtk.org/mailman/listinfo/vtkusers >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Powered by www.kitware.com >>>>>>> >>>>>>> Visit other Kitware open-source projects at >>>>>>> http://www.kitware.com/opensource/opensource.html >>>>>>> >>>>>>> Please keep messages on-topic and check the VTK FAQ at: >>>>>>> http://www.vtk.org/Wiki/VTK_FAQ >>>>>>> >>>>>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>>>>> >>>>>>> Follow this link to subscribe/unsubscribe: >>>>>>> https://vtk.org/mailman/listinfo/vtkusers >>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 9 > Date: Wed, 16 May 2018 09:22:22 +0900 > From: kenichiro yoshimi > To: "Slaughter, Andrew E" > Cc: vtk > Subject: Re: [vtkusers] Time Interpolation > Message-ID: > > Content-Type: text/plain; charset="UTF-8" > > Hi Andrew, > > I use the second vtkExtractTimeSteps to extract the hoping time step > from the output of vtkTemporalInterpolator > which contains multiple time steps like [0, 1(index of specfiedTime), > ...] in my code. Especially, specified time step index is needed to be > "1" in extractTime2 filter: > extractTime2.AddTimeStepIndex(1) > because the index of hoping time is made indicate "1" in > vtkTemporalInterpolator. > > Best Regards > > 2018-05-15 23:37 GMT+09:00 Slaughter, Andrew E : >> This is great, thanks for taking time to get this working. I have one >> question, what is the purpose of the second vtkExtractTimeSteps? >> >> On Tue, May 15, 2018 at 2:13 AM, kenichiro yoshimi >> wrote: >>> >>> Hello Andrew, >>> >>> I found a dirty way using vtkTemporalInterpolator and >>> vtkExtractTimeSteps as follows, and you can set an arbitrary time >>> value to "specifiedTime" within the code: >>> >>> ---- >>> #!/usr/bin/env python >>> import os >>> import vtk >>> import numpy as np >>> >>> specifiedTime = 0.18 >>> >>> # Input file and variable >>> filename = os.path.abspath('mug.e') >>> nodal_var = 'convected' >>> >>> # Read Exodus Data >>> reader = vtk.vtkExodusIIReader() >>> reader.SetFileName(filename) >>> reader.UpdateInformation() >>> reader.SetTimeStep(10) >>> reader.SetAllArrayStatus(vtk.vtkExodusIIReader.NODAL, 1) >>> #reader.Update(); print reader >>> >>> info = >>> reader.GetExecutive().GetOutputInformation().GetInformationObject(0) >>> key = vtk.vtkStreamingDemandDrivenPipeline.TIME_STEPS() >>> times = np.array([info.Get(key,i) for i in range(info.Length(key))]) >>> index = np.max(np.where(times <= specifiedTime)) >>> >>> extractTime = vtk.vtkExtractTimeSteps() >>> extractTime.SetInputConnection(0, reader.GetOutputPort(0)) >>> extractTime.SetTimeStepIndices(2, [index, index+1]) >>> >>> # Time interpolation (How do I set this up?) >>> time = vtk.vtkTemporalInterpolator() >>> time.SetInputConnection(0, extractTime.GetOutputPort(0)) >>> time.SetDiscreteTimeStepInterval(specifiedTime - times[index]) >>> time.UpdateTimeStep(specifiedTime) >>> >>> extractTime2 = vtk.vtkExtractTimeSteps() >>> extractTime2.SetInputConnection(0, time.GetOutputPort(0)) >>> extractTime2.AddTimeStepIndex(1) >>> >>> # Create Geometry >>> geometry = vtk.vtkCompositeDataGeometryFilter() >>> geometry.SetInputConnection(0, extractTime2.GetOutputPort(0)) >>> geometry.Update() >>> >>> writer = vtk.vtkExodusIIWriter() >>> writer.SetInputConnection(0, geometry.GetOutputPort()) >>> writer.SetFileName('time.e') >>> writer.WriteAllTimeStepsOn() >>> writer.Write() >>> >>> # Mapper >>> mapper = vtk.vtkPolyDataMapper() >>> mapper.SetInputConnection(geometry.GetOutputPort()) >>> mapper.SelectColorArray(nodal_var) >>> mapper.SetScalarModeToUsePointFieldData() >>> mapper.InterpolateScalarsBeforeMappingOn() >>> >>> # Actor >>> actor = vtk.vtkActor() >>> actor.SetMapper(mapper) >>> >>> # Renderer >>> renderer = vtk.vtkRenderer() >>> renderer.AddViewProp(actor) >>> >>> # Window and Interactor >>> window = vtk.vtkRenderWindow() >>> window.AddRenderer(renderer) >>> window.SetSize(600, 600) >>> >>> interactor = vtk.vtkRenderWindowInteractor() >>> interactor.SetRenderWindow(window) >>> interactor.Initialize() >>> >>> # Show the result >>> window.Render() >>> interactor.Start() >>> ---- >>> >>> Best >>> >>> 2018-05-11 2:06 GMT+09:00 Slaughter, Andrew E : >>> > I was hoping someone could help me setup interpolation for ExodusII >>> > data. >>> > The attached python scripts (I am using MacOS; python2.7; vtk7.1) reads >>> > the >>> > ExodusII file (mug.e). I would like to be able to set an arbitrary time >>> > value and have VTK perform the interpolation, would someone please help >>> > me >>> > get this working? I have two versions I am working on, one using >>> > vtkTemporalInterpolator and the other with >>> > vtkInterpolateDataSetAttributes. >>> > I am happy using either class, I just need it to work. >>> > >>> > I am aware that some of these features are built into Paraview, but my >>> > project requires me to make this work with pure VTK. >>> > >>> > Thanks, >>> > >>> > Andrew >>> > >>> > _______________________________________________ >>> > Powered by www.kitware.com >>> > >>> > Visit other Kitware open-source projects at >>> > >>> > https://urldefense.proofpoint.com/v2/url?u=http-3A__www.kitware.com_opensource_opensource.html&d=DwIBaQ&c=54IZrppPQZKX9mLzcGdPfFD1hxrcB__aEkJFOKJFd00&r=h7heP8xwI1i_HikChvhFbEBurKirgfOCdwgBxB9lM8c&m=puHckBK1HPjYo6fLuDnW7Rsr9yj_a2niN1Z4KRui5BM&s=E7mpGidBh-HqQHk8zv6FqPKcN2BAfHg5FyshFS96aAM&e= >>> > >>> > Please keep messages on-topic and check the VTK FAQ at: >>> > >>> > https://urldefense.proofpoint.com/v2/url?u=http-3A__www.vtk.org_Wiki_VTK-5FFAQ&d=DwIBaQ&c=54IZrppPQZKX9mLzcGdPfFD1hxrcB__aEkJFOKJFd00&r=h7heP8xwI1i_HikChvhFbEBurKirgfOCdwgBxB9lM8c&m=puHckBK1HPjYo6fLuDnW7Rsr9yj_a2niN1Z4KRui5BM&s=__QxFPfkRQHlaX87BPaTQqC3-xiuwKePex8T9KtAD8Q&e= >>> > >>> > Search the list archives at: >>> > https://urldefense.proofpoint.com/v2/url?u=http-3A__markmail.org_search_-3Fq-3Dvtkusers&d=DwIBaQ&c=54IZrppPQZKX9mLzcGdPfFD1hxrcB__aEkJFOKJFd00&r=h7heP8xwI1i_HikChvhFbEBurKirgfOCdwgBxB9lM8c&m=puHckBK1HPjYo6fLuDnW7Rsr9yj_a2niN1Z4KRui5BM&s=CNEA4K6JVEFn6AGYM0fYeW0rg6ENnWlIx_cTPpb7zHM&e= >>> > >>> > Follow this link to subscribe/unsubscribe: >>> > >>> > https://urldefense.proofpoint.com/v2/url?u=https-3A__vtk.org_mailman_listinfo_vtkusers&d=DwIBaQ&c=54IZrppPQZKX9mLzcGdPfFD1hxrcB__aEkJFOKJFd00&r=h7heP8xwI1i_HikChvhFbEBurKirgfOCdwgBxB9lM8c&m=puHckBK1HPjYo6fLuDnW7Rsr9yj_a2niN1Z4KRui5BM&s=DJXa7N2JNLCUAVjyuFKhbN5PDsErajyMP1cjw0MJQyg&e= >>> > >> >> > > > ------------------------------ > > Message: 10 > Date: Tue, 15 May 2018 20:10:53 -0700 > From: Bill Lorensen > To: VTK Users , VTK Developers > > Subject: [vtkusers] ANN: Latex and Markdown versions of the VTK > textbook > Message-ID: > > Content-Type: text/plain; charset="UTF-8" > > Folks, > > We have been busy converting the current online PDF version of the VTK > Textbook. The two efforts include a Latex version led by Andrew > Maclean and a markdown version led by Bill Lorensen. Will > Schroeder provided encouragement and a high-resolution PDF of the > textbook. Bernhard Meehan provided us with Latex versions for most of > the 155 equations. Jon Haitz Legarreta helped with Latex formatting. > > The two versions serve two different goals. The Latex version is > duplicating the original text that was written using Adobe's > Framemaker. The goal is to produce a version with links to figures, > references, equations, examples, etc. Figures that exist in the > VTKExamples are kept up-to-date. Hopefully, by using a more familiar > format (Latex), this version will serve as a base for community > updates and future versions of the text. > > The Markdown version is an interactive, platform friendly version of > the book. The entire text is available as a Chapter by Chapter web > site. The figures that exist as VTK Examples are linked to the nightly > output of the regression testing. Also, all vtk classes in the text > are linked to the doxygen descripti0on of the class. Example code that > produces book figures links back to the figure in the text. This > allows easy movement from text to examples and back. This version is > smartphone and tablet friendly. > > The current version of the Latex textbook is here: > https://raw.githubusercontent.com/lorensen/VTKExamples/master/src/VTKBookLaTex/VTKTextBook.pdf > > The alpha version of all Chapters of the Markdown text starts here: > https://lorensen.github.io/VTKExamples/site/VTKBook/01Chapter1/ > > A more detailed description of both efforts is here: > https://lorensen.github.io/VTKExamples/site/VTKBook/ > > > If you are on researchgate.net you can follow the VTKExamples at > https://www.researchgate.net/project/VTK-Examples > > As always, we welcome positive and constructive comments. > > Enjoy, > > Bill > > > -- > Unpaid intern in BillsParadise at noware dot com > > > ------------------------------ > > Message: 11 > Date: Tue, 15 May 2018 20:40:29 -0700 (MST) > From: ashishbme > To: vtkusers at vtk.org > Subject: Re: [vtkusers] VtkDistanceWidget label text font > Message-ID: <1526442029141-0.post at n5.nabble.com> > Content-Type: text/plain; charset=us-ascii > > Hi kenichiro yoshimi, > > Thank you, solution provided by you worked for me. > > Regards > Ashish > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > > > ------------------------------ > > Message: 12 > Date: Tue, 15 May 2018 23:49:42 -0700 (MST) > From: Andaharoo > To: vtkusers at vtk.org > Subject: [vtkusers] Wireframe and Volume Rendering > Message-ID: <1526453382123-0.post at n5.nabble.com> > Content-Type: text/plain; charset=us-ascii > > Rendering wireframes over a volume doesn't seem to work correctly. The volume > just disappears? Is there a simple fix/flag or something I'm missing? The > lines intermix fine with the volume. But the volume behind the plane doesn't > show. > > > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > > > ------------------------------ > > Message: 13 > Date: Wed, 16 May 2018 04:15:45 -0700 (MST) > From: ochampao > To: vtkusers at vtk.org > Subject: Re: [vtkusers] Correct anatomical orientation of volumes from > Niftii and DICOM > Message-ID: <1526469345889-0.post at n5.nabble.com> > Content-Type: text/plain; charset=us-ascii > > Hi David, > > I've used your suggestion to verify the camera configuration with > vtkAxesActor. In combination with the AnatomicalOrientation [1] example, it > was very helpful. I think now I've setup the camera in the 3 views to follow > (hopefully correctly) the RAS coordinate system convention. See screenshot > with the axes. > > > > I have also switched to using vtkDICOMReader (vtk-dicom 0.87 + VTK8.1) for > loading from DICOM. This is so that I can make use of the vtkDICOMToRAS > class to account for the change in coordinate system from LPS to RAS (until > I am comfortable enough to write my own conversion methods). See loadDicom() > method below. Despite making these changes I still see the images flipped > horizontally (referring to the axial view and also comparing with Slicer > which as I understand also uses RAS). > > > > Assumuing my camera setup is indeed correct, shouldn't vtkDICOMToRAS account > for the switch in coordinates? Are some steps missing? Why do I see this > horizontal flip? > > I've included below the relevant code for setting up the cameras and loading > Dicom. > > Thanks for your help. > Panos. > > [1] > https://lorensen.github.io/VTKExamples/site/Cxx/VisualizationAlgorithms/AnatomicalOrientation/ > > > // ================================================ > // loadDicom() > // ================================================ > vtkSmartPointer QuadView::loadDicom(const char* path) const > { > vtkNew fileGlob; > fileGlob->SetDirectory(path); > fileGlob->AddFileNames("*.dcm"); > vtkSmartPointer vtkStringFilenames = > fileGlob->GetFileNames(); > > vtkNew reader; > reader->SetFileNames(vtkStringFilenames); > reader->SetMemoryRowOrderToFileNative(); > reader->UpdateInformation(); > > vtkNew converterLPSToRAS; > converterLPSToRAS->SetInputConnection(reader->GetOutputPort()); > converterLPSToRAS->SetPatientMatrix(reader->GetPatientMatrix()); > converterLPSToRAS->SetAllowRowReordering(true); > converterLPSToRAS->SetAllowColumnReordering(true); > converterLPSToRAS->UpdateMatrix(); > converterLPSToRAS->Update(); > > return converterLPSToRAS->GetOutput(); > } > > // ================================================ > // resetCameras2D() > // ================================================ > void QuadView::resetCameras2D() const > { > // iterate through the active 2D views. > for (const auto &view : mQuadViewUI.getQVTKOpenGLWidget2DKeyList()) > { > // Reset camera & clipping range > mPipelineObject2DContainer.at(view).renderer->ResetCamera(); > > switch (view) > { > case IQuadViewUI::VTKDockWidget::TopLeft: //Axial > { > double viewUp[3] = { 0, 1, 0 }; > double leftToRight[3] = { 1, 0, 0 }; > vtkCamera* camera = > mPipelineObject2DContainer.at(view).renderer->GetActiveCamera(); > > setImageOrientation(leftToRight, viewUp, *camera); > camera->OrthogonalizeViewUp(); > break; > } > case IQuadViewUI::VTKDockWidget::TopRight: //Sagittal > { > double viewUp[3] = { 0, 0, 1 }; > double leftToRight[3] = { 0, -1, 0 }; > vtkCamera* camera = > mPipelineObject2DContainer.at(view).renderer->GetActiveCamera(); > > setImageOrientation(leftToRight, viewUp, *camera); > camera->OrthogonalizeViewUp(); > break; > } > case IQuadViewUI::VTKDockWidget::BottomLeft: //Coronal > { > double viewUp[3] = { 0, 0, 1 }; > double leftToRight[3] = { 1, 0, 0 }; > vtkCamera* camera = > mPipelineObject2DContainer.at(view).renderer->GetActiveCamera(); > > setImageOrientation(leftToRight, viewUp, *camera); > camera->OrthogonalizeViewUp(); > break; > } > default: > break; > } > } > } > > // ================================================ > // setImageOrientation() > // ================================================ > void QuadView::setImageOrientation(const double leftToRight[3], const double > viewUp[3], vtkCamera &camera) const > { > // from vtkInteractorStyleImage::SetImageOrientation() > > // compute the view plane normal, which points out of the screen, through > the cross product > double normal[3]; > vtkMath::Cross(leftToRight, viewUp, normal); > > // get the camera focus > double focus[3]; > camera.GetFocalPoint(focus); > > // get the camera distance from the focus > double d = camera.GetDistance(); > > // position the camera on view plane normal keeping the focus and the > distance from it fixed > camera.SetPosition( > focus[0] + d*normal[0], > focus[1] + d*normal[1], > focus[2] + d*normal[2]); > > // make sure focus is the same > camera.SetFocalPoint(focus); > > // setup view up vector > camera.SetViewUp(viewUp); > } > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > > > ------------------------------ > > Message: 14 > Date: Wed, 16 May 2018 15:57:59 +0200 > From: Petr Matou?ek > To: vtkusers at vtk.org > Subject: [vtkusers] nested vtkPropAssembly visibility > Message-ID: <10e7edab-0cb8-505c-29ec-3303720214cd at gmail.com> > Content-Type: text/plain; charset=iso-8859-2; format=flowed > > Hello, > > I have the following assembly hierarchy: > > vtkPropAssembly1 -> vtkPropAssmebly2 -> vtkActor > > Calling vtkPropAssembly1.VisibilityOff() or vtkActor.VisibilityOff() > will hide the vtkActor during render. But calling > vtkPropAssembly2.VisibilityOff() has no effect. > > Is this intended behavior or a bug? I expected that calling > vtkPropAssembly2.VisibilityOff() will hide the vtkActor too. > > This kind of behavior was already reported here: > > http://vtk.org/Bug/view.php?id=3312 > https://gitlab.kitware.com/vtk/vtk/issues/3312 > > Best regards, Petr Matousek > > > ------------------------------ > > Message: 15 > Date: Wed, 16 May 2018 11:24:26 -0400 > From: Sankhesh Jhaveri > To: Andaharoo > Cc: vtkusers at vtk.org > Subject: Re: [vtkusers] Wireframe and Volume Rendering > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Hi, > > Could you share example code that reproduces this behavior? > I don't see it in ParaView: > > [image: WireframeVolumeIntersection.png] > > Thanks, > Sankhesh > > On Wed, May 16, 2018 at 2:49 AM Andaharoo wrote: > >> Rendering wireframes over a volume doesn't seem to work correctly. The >> volume >> just disappears? Is there a simple fix/flag or something I'm missing? The >> lines intermix fine with the volume. But the volume behind the plane >> doesn't >> show. >> >> >> >> >> >> -- >> 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: >> https://vtk.org/mailman/listinfo/vtkusers >> > -- > Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware > | (518) 881-4417 > ? > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: WireframeVolumeIntersection.png > Type: image/png > Size: 168574 bytes > Desc: not available > 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: > https://vtk.org/mailman/listinfo/vtkusers > > > ------------------------------ > > End of vtkusers Digest, Vol 169, Issue 23 > ***************************************** -- Cartik Sharma about.me/sharmacartik From madaramh at gmail.com Thu May 24 07:07:54 2018 From: madaramh at gmail.com (madz) Date: Thu, 24 May 2018 04:07:54 -0700 (MST) Subject: [vtkusers] Interpolated edges with mid-side nodes Message-ID: <1527160074874-0.post@n5.nabble.com> I have a grid made with tetrahedral cells. Each cell has 10 points (4 - corner points and 6 - mid-side points). I've given an example of the method used to create the grid but I can't seem to get the cell edges to go through the mid-side points. How can I get the edges to appear as in the black line shown in the right image. The left one is what I have now. Image - Code- vtkSmartPointer points = vtkSmartPointer::New(); points->InsertNextPoint(-7.1374208222357446e-002,8.5031050836294406e-002,1.2763288004142873e-001); points->InsertNextPoint(-8.0855828124495405e-002,7.4990717996207365e-002,1.1777091844875046e-001); points->InsertNextPoint(-7.1736895273477944e-002,8.4576899052732968e-002,1.1760875416048089e-001); points->InsertNextPoint(-7.1683111292242127e-002,7.6559876311458649e-002,1.1936078137875390e-001); points->InsertNextPoint(-7.6115018173426419e-002,8.0010884416250899e-002,1.2270189924508959e-001); points->InsertNextPoint(-7.6296361698986681e-002,8.0783808524470173e-002,1.1768983630461567e-001); points->InsertNextPoint(-7.1555551747917695e-002,8.4803974944513694e-002,1.2262081710095481e-001); points->InsertNextPoint(-7.1528659757299787e-002,8.0795463573876528e-002,1.2349683071009131e-001); points->InsertNextPoint(-7.6269469708368759e-002,7.5775297153833007e-002,1.1856584991375219e-001); points->InsertNextPoint(-7.1710003282860035e-002,8.0568387682095816e-002,1.1848476776961739e-001); //points->InsertNextPoint(0, 0, 0); //points->InsertNextPoint(0, 0, 0); //points->InsertNextPoint(0, 0, 0); //points->InsertNextPoint(0, 0, 0); //points->InsertNextPoint(0, 0, 0); //points->InsertNextPoint(0, 0, 0); vtkSmartPointer tetra = vtkSmartPointer::New(); tetra->GetPointIds()->SetId(0, 0); tetra->GetPointIds()->SetId(1, 1); tetra->GetPointIds()->SetId(2, 2); tetra->GetPointIds()->SetId(3, 3); tetra->GetPointIds()->SetId(4, 4); tetra->GetPointIds()->SetId(5, 5); tetra->GetPointIds()->SetId(6, 6); tetra->GetPointIds()->SetId(7, 7); tetra->GetPointIds()->SetId(8, 8); tetra->GetPointIds()->SetId(9, 9); vtkSmartPointer cellArray = vtkSmartPointer::New(); cellArray->InsertNextCell(tetra); vtkSmartPointer unstructuredGrid = vtkSmartPointer::New(); unstructuredGrid->SetPoints(points); unstructuredGrid->SetCells(VTK_TETRA, cellArray); Any help will be appreciated. Thanks. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From madaramh at gmail.com Thu May 24 08:17:16 2018 From: madaramh at gmail.com (madz) Date: Thu, 24 May 2018 05:17:16 -0700 (MST) Subject: [vtkusers] Interpolated edges with mid-side nodes In-Reply-To: <1527160074874-0.post@n5.nabble.com> References: <1527160074874-0.post@n5.nabble.com> Message-ID: <1527164236941-0.post@n5.nabble.com> I discovered that if I can use vtkQuadraticTetra instead of vtkTetra and use cell type VTK_QUADRATIC_TETRA, I can get the mid-side nodes to connect as in the shown image. But I still can't get it to look curved shaped/smooth. Is there a way to achieve this through vtk? Thanks. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From marc.ruiz+vtk at gmail.com Thu May 24 10:35:39 2018 From: marc.ruiz+vtk at gmail.com (Marc Ruiz Altisent) Date: Thu, 24 May 2018 16:35:39 +0200 Subject: [vtkusers] vtkSmartVolumeMapper in CPU mode stays always in low resolution Message-ID: Hi, I have found another bug in vtkSmartVolumeMapper. This time the issue is that if you set CPU render mode and keep the rest of the mapper settings as default, when you manipulate visualization the mapper will lower the resolution to achieve an interactive framerate, as expected, but after the interaction it stays in the low resolution, which is the bug. It can be seen easily when visualizing a typical CT dataset for example. I don't understand the specific cause of the bug, but it doesn't happen if you disable InteractiveAdjustSampleDistances. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.ostroot at lickenbrocktech.com Thu May 24 12:11:09 2018 From: mark.ostroot at lickenbrocktech.com (mark.ostroot) Date: Thu, 24 May 2018 09:11:09 -0700 (MST) Subject: [vtkusers] vtkSmartVolumeMapper in CPU mode stays always in low resolution In-Reply-To: References: Message-ID: <1527178269056-0.post@n5.nabble.com> I'm seeing this same issue with the smart volume mapper in vtkFixedPointVolumeRayCast mode. Not to introduce another bug, but have you tried using some of the other rendering modes in the smart volume mapper? I've only been able to get the vtkFixedPointVolumeRayCast mode working at all. The other rendering modes don't produce images for me. -Mark O -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From 1krs1 at queensu.ca Thu May 24 12:14:10 2018 From: 1krs1 at queensu.ca (Kyle Sunderland) Date: Thu, 24 May 2018 16:14:10 +0000 Subject: [vtkusers] Questions About Python Wrapping In-Reply-To: References: <41e7e0a8-65f5-4d81-a496-c0892530e044@queensu.ca> , Message-ID: Hi David, When wrapping classes, does the wrapping rely on the "vtk" prefix for both filenames and class names? I imagine that renaming the classes would fix the issue, but are there any other workarounds for wrapping classes that begin with a different prefix, or to wrap functions using these classes as arguments? Is it possible to specify a prefix other than "vtk" for use with the wrapper? Thanks again for your help! - Kyle ________________________________ From: Andras Lasso Sent: May 17, 2018 9:05:36 PM To: David Gobbi Cc: Kyle Sunderland; vtkusers at vtk.org Subject: RE: [vtkusers] Questions About Python Wrapping VTK_NEWINSTANCE hint is great! For Python, it solves the returned object ownership issue completely in a nice and robust way (now we just need to figure out how to update all our code base to use this). For C++, a new smart pointer type (vtkSafePointer?) could be added that is exclusively used for returning new instances. This smart pointer type would not have explicit converter to raw pointer but could be directly assigned to vtkSmartPointer. It could also have a helper method for backward compatibility, which would increment reference count and return a raw pointer. This new pointer type could be easily introduced for new classes, but for existing classes it would require small change in all code where new VTK object instances are returned, which developers would probably not like. Maybe it could be done when changes around this are required anyway for some other reasons. Andras From: David Gobbi Sent: Thursday, May 17, 2018 7:04 PM To: Andras Lasso Cc: Kyle Sunderland <1krs1 at queensu.ca>; vtkusers at vtk.org Subject: Re: [vtkusers] Questions About Python Wrapping The vtkSmartPointer isn't very safe in this regard. It is easy to accidentally do the following, since VTK smart pointers implicitly convert to raw pointers: vtkSmartPointer MyMethod(); vtkObject *obj = MyMethod(); // ownership is not caught, object is autodeleted The preferred way of dealing with transfer of ownership for returned values in VTK is to add the VTK_NEWINSTANCE hint to the return value. Then the wrappers will automatically handle the reference count. As for people who use these methods from C++, they still have to worry about memory leaks, but at least they don't have to worry about memory corruption caused by mistakes like the one in the example above. - David On Thu, May 17, 2018 at 4:29 PM, Andras Lasso > wrote: The main advantage of the ability to return smart pointers would be that ownership of VTK objects could be transferred safely to the caller, without requiring calling UnRegister(None). C++ developers are aware of pointers but for Python users it is a mistery why sometimes they need to call UnRegister to avoid memory leaks. Andras ________________________________ From: David Gobbi > Sent: Thursday, May 17, 2018 4:55 PM To: Kyle Sunderland Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Questions About Python Wrapping Hi Kyle, Thanks for sending the files. I see that the parameters for those methods are actually smart pointers, and as you have already noted, smart pointers aren't wrapped. This has never been an issue in VTK proper or for most VTK projects, since VTK methods generally use raw pointers. The header file you sent is closer to ITK style than to VTK style. I definitely think that it would be worthwhile to add better smart pointer handling to the wrappers. - David On Thu, May 17, 2018 at 12:13 PM, David Gobbi > wrote: On Thu, May 17, 2018 at 10:10 AM, Kyle Sunderland <1krs1 at queensu.ca> wrote: > It (mostly) works, however I noticed that no functions are wrapped which have a definition that contains any of the wrapped classes. Does anyone have insight into what I might have missed? Is a vtk..Hierarchy.txt file generated for the wrapped module when you build it? If so, send it to me along with the header files you're wrapping, and I can take a look. > Also, as an additional question, is it still not possible to wrap functions that return a smart pointer? If this is a feature that you need, then add it to the bug tracker. Cheers, - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Thu May 24 12:50:02 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 24 May 2018 10:50:02 -0600 Subject: [vtkusers] Questions About Python Wrapping In-Reply-To: References: <41e7e0a8-65f5-4d81-a496-c0892530e044@queensu.ca> Message-ID: The filenames shouldn't matter. The check for the vtk prefix is hard-coded into the wrappers but it doesn't really need to be. If you do your own VTK build, you can try removing the hard-coding to see what happens. Look in vtkWrap.c for vtkWrap_IsVTKObject(), vtkWrap_IsSpecialObject(), and vtkWrap_IsPythonObject(). You might just have to change vtkWrap_IsSpecialObject() so that it reads like this: int vtkWrap_IsSpecialObject(ValueInfo *val) { unsigned int t = (val->Type & VTK_PARSE_UNQUALIFIED_TYPE); return ((t == VTK_PARSE_OBJECT || t == VTK_PARSE_OBJECT_REF || t == VTK_PARSE_UNKNOWN || t == VTK_PARSE_UNKNOWN_REF) && !val->IsEnum && !vtkWrap_IsPythonObject(val)); } - David On Thu, May 24, 2018 at 10:14 AM, Kyle Sunderland <1krs1 at queensu.ca> wrote: > Hi David, > > > When wrapping classes, does the wrapping rely on the "vtk" prefix > for both filenames and class names? > > > I imagine that renaming the classes would fix the issue, but are there > any other workarounds for wrapping classes that begin with a different > prefix, or to wrap functions using these classes as arguments? > > Is it possible to specify a prefix other than "vtk" for use with the > wrapper? > > > Thanks again for your help! > > - Kyle > ------------------------------ > *From:* Andras Lasso > *Sent:* May 17, 2018 9:05:36 PM > *To:* David Gobbi > *Cc:* Kyle Sunderland; vtkusers at vtk.org > *Subject:* RE: [vtkusers] Questions About Python Wrapping > > > VTK_NEWINSTANCE hint is great! For Python, it solves the returned object > ownership issue completely in a nice and robust way (now we just need to > figure out how to update all our code base to use this). > > > > For C++, a new smart pointer type (vtkSafePointer?) could be added that > is exclusively used for returning new instances. This smart pointer type > would not have explicit converter to raw pointer but could be directly > assigned to vtkSmartPointer. It could also have a helper method for > backward compatibility, which would increment reference count and return a > raw pointer. This new pointer type could be easily introduced for new > classes, but for existing classes it would require small change in all code > where new VTK object instances are returned, which developers would > probably not like. Maybe it could be done when changes around this are > required anyway for some other reasons. > > > > Andras > > > > *From:* David Gobbi > *Sent:* Thursday, May 17, 2018 7:04 PM > *To:* Andras Lasso > *Cc:* Kyle Sunderland <1krs1 at queensu.ca>; vtkusers at vtk.org > *Subject:* Re: [vtkusers] Questions About Python Wrapping > > > > The vtkSmartPointer isn't very safe in this regard. It is easy to > accidentally do the following, since VTK smart pointers implicitly convert > to raw pointers: > > > > vtkSmartPointer MyMethod(); > > vtkObject *obj = MyMethod(); // ownership is not caught, object is > autodeleted > > > > The preferred way of dealing with transfer of ownership for returned > values in VTK is to add the VTK_NEWINSTANCE hint to the return value. Then > the wrappers will automatically handle the reference count. As for people > who use these methods from C++, they still have to worry about memory > leaks, but at least they don't have to worry about memory corruption caused > by mistakes like the one in the example above. > > > > - David > > > > > > On Thu, May 17, 2018 at 4:29 PM, Andras Lasso wrote: > > The main advantage of the ability to return smart pointers would be that > ownership of VTK objects could be transferred safely to the caller, without > requiring calling UnRegister(None). C++ developers are aware of pointers > but for Python users it is a mistery why sometimes they need to call > UnRegister to avoid memory leaks. > > > > Andras > ------------------------------ > > *From:* David Gobbi > *Sent:* Thursday, May 17, 2018 4:55 PM > *To:* Kyle Sunderland > *Cc:* vtkusers at vtk.org > *Subject:* Re: [vtkusers] Questions About Python Wrapping > > > > Hi Kyle, > > > > Thanks for sending the files. I see that the parameters for those methods > are actually smart pointers, and as you have already noted, smart pointers > aren't wrapped. > > > > This has never been an issue in VTK proper or for most VTK projects, since > VTK methods generally use raw pointers. The header file you sent is closer > to ITK style than to VTK style. > > > > I definitely think that it would be worthwhile to add better smart pointer > handling to the wrappers. > > > > - David > > > > > > On Thu, May 17, 2018 at 12:13 PM, David Gobbi > wrote: > > On Thu, May 17, 2018 at 10:10 AM, Kyle Sunderland <1krs1 at queensu.ca> > wrote: > > It (mostly) works, however I noticed that no functions are wrapped which > have a definition that contains any of the wrapped classes. Does anyone > have insight into what I might have missed? > > Is a vtk..Hierarchy.txt file generated for the wrapped module when you > build it? If so, send it to me along with the header files you're > wrapping, and I can take a look. > > > Also, as an additional question, is it still not possible to wrap > functions that return a smart pointer? > > If this is a feature that you need, then add it to the bug tracker. > > > > Cheers, > > - David > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc.ruiz+vtk at gmail.com Thu May 24 13:34:28 2018 From: marc.ruiz+vtk at gmail.com (Marc Ruiz Altisent) Date: Thu, 24 May 2018 19:34:28 +0200 Subject: [vtkusers] vtkSmartVolumeMapper in CPU mode stays always in low resolution In-Reply-To: <1527178269056-0.post@n5.nabble.com> References: <1527178269056-0.post@n5.nabble.com> Message-ID: GPU mode works well for me (without the mentioned low res issue) and the default uses GPU in my case. I haven't tried OSPRay because I haven't built it. Missatge de mark.ostroot del dia dj., 24 de maig 2018 a les 18:11: > I'm seeing this same issue with the smart volume mapper in > vtkFixedPointVolumeRayCast mode. > > Not to introduce another bug, but have you tried using some of the other > rendering modes in the smart volume mapper? I've only been able to get the > vtkFixedPointVolumeRayCast mode working at all. The other rendering modes > don't produce images for me. > > -Mark O > > > > -- > 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: > https://vtk.org/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.ostroot at lickenbrocktech.com Thu May 24 13:57:53 2018 From: mark.ostroot at lickenbrocktech.com (mark.ostroot at lickenbrocktech.com) Date: Thu, 24 May 2018 10:57:53 -0700 Subject: [vtkusers] vtkSmartVolumeMapper in CPU mode stays always in low resolution In-Reply-To: Message-ID: <20180524105753.c7db654a879d86b78cfcacc46040d57b.6adc7c959a.mailapi@email09.godaddy.com> Thanks, I must have something configured wrong on my end. -Mark O --------- Original Message --------- Subject: Re: [vtkusers] vtkSmartVolumeMapper in CPU mode stays always in low resolution From: "Marc Ruiz Altisent" Date: 5/24/18 10:34 am To: mark.ostroot at lickenbrocktech.com Cc: "vtkusers" GPU mode works well for me (without the mentioned low res issue) and the default uses GPU in my case. I haven't tried OSPRay because I haven't built it. Missatge de mark.ostroot del dia dj., 24 de maig 2018 a les 18:11: I'm seeing this same issue with the smart volume mapper in vtkFixedPointVolumeRayCast mode. Not to introduce another bug, but have you tried using some of the other rendering modes in the smart volume mapper? I've only been able to get the vtkFixedPointVolumeRayCast mode working at all. The other rendering modes don't produce images for me. -Mark O -- 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: https://vtk.org/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From sankhesh.jhaveri at kitware.com Thu May 24 15:07:50 2018 From: sankhesh.jhaveri at kitware.com (Sankhesh Jhaveri) Date: Thu, 24 May 2018 15:07:50 -0400 Subject: [vtkusers] vtkSmartVolumeMapper in CPU mode stays always in low resolution In-Reply-To: <20180524105753.c7db654a879d86b78cfcacc46040d57b.6adc7c959a.mailapi@email09.godaddy.com> References: <20180524105753.c7db654a879d86b78cfcacc46040d57b.6adc7c959a.mailapi@email09.godaddy.com> Message-ID: Hi Marc, Could you please create a small example and report an issue on the VTK issue tracker ? Feel free to assign it to me(@sankhesh). That would help keep track of it better. Thanks, Sankhesh ? On Thu, May 24, 2018 at 1:58 PM wrote: > > Thanks, > I must have something configured wrong on my end. > > -Mark O > > > --------- Original Message --------- > Subject: Re: [vtkusers] vtkSmartVolumeMapper in CPU mode stays always in > low resolution > From: "Marc Ruiz Altisent" > Date: 5/24/18 10:34 am > To: mark.ostroot at lickenbrocktech.com > Cc: "vtkusers" > > GPU mode works well for me (without the mentioned low res issue) and the > default uses GPU in my case. I haven't tried OSPRay because I haven't built > it. > > Missatge de mark.ostroot del dia dj., > 24 de maig 2018 a les 18:11: > >> I'm seeing this same issue with the smart volume mapper in >> vtkFixedPointVolumeRayCast mode. >> >> Not to introduce another bug, but have you tried using some of the other >> rendering modes in the smart volume mapper? I've only been able to get the >> vtkFixedPointVolumeRayCast mode working at all. The other rendering modes >> don't produce images for me. >> >> -Mark O >> >> >> >> -- >> 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: >> https://vtk.org/mailman/listinfo/vtkusers > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://vtk.org/mailman/listinfo/vtkusers > -- Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware | (518) 881-4417 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.chen at gmail.com Thu May 24 16:37:40 2018 From: elvis.chen at gmail.com (Elvis Chen) Date: Thu, 24 May 2018 16:37:40 -0400 Subject: [vtkusers] Qt Designer (5.10.1), QVTKOpenGLWidget, and size policy questions Message-ID: <5b072294.1c69fb81.facc8.8c84@mx.google.com> Hi all, I have 2 questions related to the integration of QVTKOpenGLWidget into Qt Designer and sizing policy, I seek your help. First of, I?ve installed both 32/64-bits of Qt 5.10.1 onto my Windows 10 environment. I am using Visual Studio 2015 Enterprise edition, CMake 3.11.2, and vtk 9.0. Everything was compiled as 32bit application. Question #1: In order to integrate QVTKOpenGLWidget into Qt Designer, I had to copy QVTKWidgetPlugin.dll/pdb into a path that?s accessible to Qt Designer. There is no QVTKOpenGLWidgetPlugin.* as far as I can tell. In Qt Designer, I do have access to QVTKWidget but not QVTKOpenGLWidget. The generated .ui file hence contained QVTKWidget and I had to manually edit the .ui file to replace QVTKWidget with QVTKOpenGLWidget. Is this the correct way of doing things? Is manual editing required? Question #2: I tried to follow VTK/Qt examples such as https://lorensen.github.io/VTKExamples/site/Cxx/Qt/ShareCameraQt/. Suppose I have generated a Qt app based on QMainWindow, with a QWidget as the centralWidget and a QVTKOpenGLWidget on top of the centralWidget (as seen on the example above). This was accomplished using Qt Designer and the resulting .ui file resembles to the example above. While it works, I am having difficulties in setting up the size policy. In short, no matter what sizePolicy I set to both (or either) the QWidget and QVTKOpenGLWidget, their sizes are fixed. If I maximize the window, the QVTKOpenGLWidget does not maximize. Can anyone shed some light into this issue? I can attach the .ui file if it is appropriate. Any help is very much appreciated, -- Elvis C.S. Chen, PhD, LEL -------------- next part -------------- An HTML attachment was scrubbed... URL: From bebe0705 at colorado.edu Thu May 24 22:44:33 2018 From: bebe0705 at colorado.edu (BBerco) Date: Thu, 24 May 2018 19:44:33 -0700 (MST) Subject: [vtkusers] Ray-Casting in VTK and parallel processing Message-ID: <1527216273935-0.post@n5.nabble.com> I am using a vtkModifiedBSPTree to ray-trace a vtkPolydata. I gave a shot to using *#pragma omp parallel for*, but this causes a segfault from within the vtkModifiedBSPTree. I think this is no else but the behavior ilustrated in this post . As of today, it does not seem like the vtkAbstractCellLocator class is thread-safe. So I was wondering what approach you would recommend for parallel ray-tracing using either multicore CPUs or GPUs. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From andrew.amaclean at gmail.com Fri May 25 00:31:56 2018 From: andrew.amaclean at gmail.com (Andrew Maclean) Date: Fri, 25 May 2018 14:31:56 +1000 Subject: [vtkusers] Deprecate vtkGeo* classes (Sankhesh Jhaveri) In-Reply-To: References: Message-ID: Sankesh, for your information,. With respect to VTKExamples. In looking at C++ examples, https://lorensen.github.io/VTKExamples/site/Coverage/CxxVTKClassesUsed/ I can only see vtkGeoAssignCoordinates being used in https://lorensen.github.io/VTKExamples/site/Cxx/Geovis/GeoAssignCoordinates/ and vtkGeoGraticule, vtkGeoProjection, vtkGeoTransform used in https://lorensen.github.io/VTKExamples/site/Cxx/Geovis/GeoGraticle/ Nothing in the Python examples. So, in my opinion, deprecation would be appropriate if there are no users/maintainers. Regards Andrew > ---------- Forwarded message ---------- > From: Sankhesh Jhaveri > To: vtk-developers , "vtkusers at vtk.org" < > vtkusers at vtk.org> > Cc: > Bcc: > Date: Wed, 23 May 2018 16:14:53 -0400 > Subject: [vtk-developers] Deprecate vtkGeo* classes > > Folks, > > There have been some discussions about deprecating a bunch of classes from > the vtkGeovisCore and vtkViewsGeovis module owing to the lack of users > and maintainers. The tentative list of classes to be deprecated is as > follows: > > - vtkGeoAdaptiveArcs > - vtkGeoAlignedImageRepresentation > - vtkGeoAlignedImageSource > - vtkGeoAssignCoordinates > - vtkGeoFileImageSource > - vtkGeoFileTerrainSource > - vtkGeoGlobeSource > - vtkGeoGraticule > - vtkGeoImageNode > - vtkGeoRandomGraphSource > - vtkGeoSampleArcs > - vtkGeoSource > - vtkGeoTerrain > - vtkGeoTerrain2D > - vtkGeoTerrainNode > - vtkGeoTreeNode > - vtkGeoTreeNodeCache > - vtkGeoView > - vtkGeoView2D > > The primary reason for deprecation is lack of known users and maintainers. > Please reply to this email if you use these classes and intend to maintain > them or if you think they shouldn?t be deprecated. > > Thank you! > Sankhesh > ? > -- > 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 > > Search the list archives at: http://markmail.org/search/?q=vtk-developers > > Follow this link to subscribe/unsubscribe: > https://vtk.org/mailman/listinfo/vtk-developers > -- ___________________________________________ Andrew J. P. Maclean ___________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Fri May 25 02:58:12 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Fri, 25 May 2018 08:58:12 +0200 Subject: [vtkusers] Qt Designer (5.10.1), QVTKOpenGLWidget, and size policy questions In-Reply-To: <5b072294.1c69fb81.facc8.8c84@mx.google.com> References: <5b072294.1c69fb81.facc8.8c84@mx.google.com> Message-ID: Den tors 24 maj 2018 22:37Elvis Chen skrev: > Hi all, > > > > I have 2 questions related to the integration of QVTKOpenGLWidget into Qt > Designer and sizing policy, I seek your help. > > > > First of, I?ve installed both 32/64-bits of Qt 5.10.1 onto my Windows 10 > environment. I am using Visual Studio 2015 Enterprise edition, CMake > 3.11.2, and vtk 9.0. Everything was compiled as 32bit application. > > > > Question #1: > > > > In order to integrate QVTKOpenGLWidget into Qt Designer, I had to copy > QVTKWidgetPlugin.dll/pdb into a path that?s accessible to Qt Designer. > There is no QVTKOpenGLWidgetPlugin.* as far as I can tell. In Qt Designer, > I do have access to QVTKWidget but not QVTKOpenGLWidget. > > > > The generated .ui file hence contained QVTKWidget and I had to manually > edit the .ui file to replace QVTKWidget with QVTKOpenGLWidget. > > > > Is this the correct way of doing things? Is manual editing required? > I believe you're right in that there's no designer plugin for QVTKOpenGLWidget. What I usually do is insert a QOpenGLWidget in designer and the "promote" it to a QVTKOpenGLWidget. See http://doc.qt.io/qt-5/designer-using-custom-widgets.html#promoting-widgets Manual editing should not be required. > > Question #2: > > > > I tried to follow VTK/Qt examples such as > https://lorensen.github.io/VTKExamples/site/Cxx/Qt/ShareCameraQt/. > Suppose I have generated a Qt app based on QMainWindow, with a QWidget as > the centralWidget and a QVTKOpenGLWidget on top of the centralWidget (as > seen on the example above). This was accomplished using Qt Designer and > the resulting .ui file resembles to the example above. > > > > While it works, I am having difficulties in setting up the size policy. > In short, no matter what sizePolicy I set to both (or either) the QWidget > and QVTKOpenGLWidget, their sizes are fixed. If I maximize the window, the > QVTKOpenGLWidget does not maximize. > > > > Can anyone shed some light into this issue? I can attach the .ui file if > it is appropriate. > It sounds like you don't have a layout set on the centralWidget? Try setting it by selecting the centralWidget and using one of the layout buttons in the toolbars. The containing widget must have a layout set for size policies to take effect. HTH Elvis > > > Any help is very much appreciated, > > > > -- > > Elvis C.S. Chen, PhD, LEL > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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: > https://vtk.org/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc.ruiz+vtk at gmail.com Fri May 25 04:27:13 2018 From: marc.ruiz+vtk at gmail.com (Marc Ruiz Altisent) Date: Fri, 25 May 2018 10:27:13 +0200 Subject: [vtkusers] vtkSmartVolumeMapper in CPU mode stays always in low resolution In-Reply-To: References: <20180524105753.c7db654a879d86b78cfcacc46040d57b.6adc7c959a.mailapi@email09.godaddy.com> Message-ID: Thanks, I will prepare an example now and report the issue. Have you seen my other reported issue from one day before (titled "vtkSmartVolumeMapper doesn't properly handle input changes")? Missatge de Sankhesh Jhaveri del dia dj., 24 de maig 2018 a les 21:08: > Hi Marc, > > Could you please create a small example and report an issue on the VTK > issue tracker ? > > Feel free to assign it to me(@sankhesh). That would help keep track of it > better. > > Thanks, > Sankhesh > ? > > On Thu, May 24, 2018 at 1:58 PM wrote: > >> >> Thanks, >> I must have something configured wrong on my end. >> >> -Mark O >> >> >> --------- Original Message --------- >> Subject: Re: [vtkusers] vtkSmartVolumeMapper in CPU mode stays always in >> low resolution >> From: "Marc Ruiz Altisent" >> Date: 5/24/18 10:34 am >> To: mark.ostroot at lickenbrocktech.com >> Cc: "vtkusers" >> >> GPU mode works well for me (without the mentioned low res issue) and the >> default uses GPU in my case. I haven't tried OSPRay because I haven't built >> it. >> >> Missatge de mark.ostroot del dia dj., >> 24 de maig 2018 a les 18:11: >> >>> I'm seeing this same issue with the smart volume mapper in >>> vtkFixedPointVolumeRayCast mode. >>> >>> Not to introduce another bug, but have you tried using some of the other >>> rendering modes in the smart volume mapper? I've only been able to get >>> the >>> vtkFixedPointVolumeRayCast mode working at all. The other rendering modes >>> don't produce images for me. >>> >>> -Mark O >>> >>> >>> >>> -- >>> 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: >>> https://vtk.org/mailman/listinfo/vtkusers >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> https://vtk.org/mailman/listinfo/vtkusers >> > -- > Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware > | (518) 881-4417 > ? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc.ruiz+vtk at gmail.com Fri May 25 05:05:58 2018 From: marc.ruiz+vtk at gmail.com (Marc Ruiz Altisent) Date: Fri, 25 May 2018 11:05:58 +0200 Subject: [vtkusers] vtkSmartVolumeMapper in CPU mode stays always in low resolution In-Reply-To: References: <20180524105753.c7db654a879d86b78cfcacc46040d57b.6adc7c959a.mailapi@email09.godaddy.com> Message-ID: Reported at https://gitlab.kitware.com/vtk/vtk/issues/17323, but I can't assign it. Missatge de Marc Ruiz Altisent del dia dv., 25 de maig 2018 a les 10:27: > Thanks, I will prepare an example now and report the issue. > > Have you seen my other reported issue from one day before (titled > "vtkSmartVolumeMapper doesn't properly handle input changes")? > > Missatge de Sankhesh Jhaveri del dia dj., > 24 de maig 2018 a les 21:08: > >> Hi Marc, >> >> Could you please create a small example and report an issue on the VTK >> issue tracker ? >> >> Feel free to assign it to me(@sankhesh). That would help keep track of it >> better. >> >> Thanks, >> Sankhesh >> ? >> >> On Thu, May 24, 2018 at 1:58 PM wrote: >> >>> >>> Thanks, >>> I must have something configured wrong on my end. >>> >>> -Mark O >>> >>> >>> --------- Original Message --------- >>> Subject: Re: [vtkusers] vtkSmartVolumeMapper in CPU mode stays always in >>> low resolution >>> From: "Marc Ruiz Altisent" >>> Date: 5/24/18 10:34 am >>> To: mark.ostroot at lickenbrocktech.com >>> Cc: "vtkusers" >>> >>> GPU mode works well for me (without the mentioned low res issue) and the >>> default uses GPU in my case. I haven't tried OSPRay because I haven't built >>> it. >>> >>> Missatge de mark.ostroot del dia >>> dj., 24 de maig 2018 a les 18:11: >>> >>>> I'm seeing this same issue with the smart volume mapper in >>>> vtkFixedPointVolumeRayCast mode. >>>> >>>> Not to introduce another bug, but have you tried using some of the other >>>> rendering modes in the smart volume mapper? I've only been able to get >>>> the >>>> vtkFixedPointVolumeRayCast mode working at all. The other rendering >>>> modes >>>> don't produce images for me. >>>> >>>> -Mark O >>>> >>>> >>>> >>>> -- >>>> 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: >>>> https://vtk.org/mailman/listinfo/vtkusers >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> https://vtk.org/mailman/listinfo/vtkusers >>> >> -- >> Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware >> | (518) 881-4417 >> ? >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sankhesh.jhaveri at kitware.com Fri May 25 05:54:40 2018 From: sankhesh.jhaveri at kitware.com (Sankhesh Jhaveri) Date: Fri, 25 May 2018 05:54:40 -0400 Subject: [vtkusers] Deprecate vtkGeo* classes (Sankhesh Jhaveri) In-Reply-To: References: Message-ID: Thank you for checking, Andrew. ? On Fri, May 25, 2018 at 12:32 AM Andrew Maclean wrote: > Sankesh, for your information,. > > With respect to VTKExamples. > In looking at C++ examples, > https://lorensen.github.io/VTKExamples/site/Coverage/CxxVTKClassesUsed/ I > can only see vtkGeoAssignCoordinates being used in > https://lorensen.github.io/VTKExamples/site/Cxx/Geovis/GeoAssignCoordinates/ > and vtkGeoGraticule, vtkGeoProjection, vtkGeoTransform used in > https://lorensen.github.io/VTKExamples/site/Cxx/Geovis/GeoGraticle/ > > Nothing in the Python examples. > > So, in my opinion, deprecation would be appropriate if there are no > users/maintainers. > > Regards > Andrew > > >> ---------- Forwarded message ---------- >> From: Sankhesh Jhaveri >> To: vtk-developers , "vtkusers at vtk.org" < >> vtkusers at vtk.org> >> Cc: >> Bcc: >> Date: Wed, 23 May 2018 16:14:53 -0400 >> Subject: [vtk-developers] Deprecate vtkGeo* classes >> >> Folks, >> >> There have been some discussions about deprecating a bunch of classes >> from the vtkGeovisCore and vtkViewsGeovis module owing to the lack of >> users and maintainers. The tentative list of classes to be deprecated is as >> follows: >> >> - vtkGeoAdaptiveArcs >> - vtkGeoAlignedImageRepresentation >> - vtkGeoAlignedImageSource >> - vtkGeoAssignCoordinates >> - vtkGeoFileImageSource >> - vtkGeoFileTerrainSource >> - vtkGeoGlobeSource >> - vtkGeoGraticule >> - vtkGeoImageNode >> - vtkGeoRandomGraphSource >> - vtkGeoSampleArcs >> - vtkGeoSource >> - vtkGeoTerrain >> - vtkGeoTerrain2D >> - vtkGeoTerrainNode >> - vtkGeoTreeNode >> - vtkGeoTreeNodeCache >> - vtkGeoView >> - vtkGeoView2D >> >> The primary reason for deprecation is lack of known users and maintainers. >> Please reply to this email if you use these classes and intend to >> maintain them or if you think they shouldn?t be deprecated. >> >> Thank you! >> Sankhesh >> ? >> -- >> 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 >> >> Search the list archives at: http://markmail.org/search/?q=vtk-developers >> >> Follow this link to subscribe/unsubscribe: >> https://vtk.org/mailman/listinfo/vtk-developers >> > > > -- > ___________________________________________ > Andrew J. P. Maclean > > ___________________________________________ > -- Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware | (518) 881-4417 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.chen at gmail.com Fri May 25 09:49:08 2018 From: elvis.chen at gmail.com (Elvis Chen) Date: Fri, 25 May 2018 09:49:08 -0400 Subject: [vtkusers] Qt Designer (5.10.1), QVTKOpenGLWidget, and sizepolicy questions In-Reply-To: References: <5b072294.1c69fb81.facc8.8c84@mx.google.com> Message-ID: <5b081454.1c69fb81.8c44b.0f73@mx.google.com> Hi, Thank you very much. The 2nd problem was indeed related to the layout. As for the 1st problem, I?ve tried to promote a widget but the ?promote? button is always grayed-out in Qt Designer. I?ll have to look deeper into this issue. Very much appreciated, Regards, -- Elvis C.S. Chen, PhD, LEL ? Imaging, Robarts Research Institute Department of Electrical and Computer Engineering Biomedical Engineering Medical Biophysics, Western University London, Ontario, Canada From: Elvis Stansvik Sent: May 25, 2018 2:58 AM To: Elvis Chen Cc: VTK Users Subject: Re: [vtkusers] Qt Designer (5.10.1), QVTKOpenGLWidget, and sizepolicy questions Den tors 24 maj 2018 22:37Elvis Chen skrev: Hi all, ? I have 2 questions related to the integration of QVTKOpenGLWidget into Qt Designer and sizing policy, I seek your help. ? First of, I?ve installed both 32/64-bits of Qt 5.10.1 onto my Windows 10 environment. I am using Visual Studio 2015 Enterprise edition, CMake 3.11.2, and vtk 9.0. Everything was compiled as 32bit application. ? Question #1: ? In order to integrate QVTKOpenGLWidget into Qt Designer, I had to copy QVTKWidgetPlugin.dll/pdb into a path that?s accessible to Qt Designer. There is no QVTKOpenGLWidgetPlugin.* as far as I can tell. In Qt Designer, I do have access to QVTKWidget but not QVTKOpenGLWidget. ? The generated .ui file hence contained QVTKWidget and I had to manually edit the .ui file to replace QVTKWidget with QVTKOpenGLWidget. ? Is this the correct way of doing things?? Is manual editing required? I believe you're right in that there's no designer plugin for QVTKOpenGLWidget. What I usually do is insert a QOpenGLWidget in designer and the "promote" it to a QVTKOpenGLWidget. See?http://doc.qt.io/qt-5/designer-using-custom-widgets.html#promoting-widgets Manual editing should not be required. ? Question #2: ? I tried to follow VTK/Qt examples such as https://lorensen.github.io/VTKExamples/site/Cxx/Qt/ShareCameraQt/.? Suppose I have generated a Qt app based on QMainWindow, with a QWidget as the centralWidget and a QVTKOpenGLWidget on top of the centralWidget (as seen on the example above).? This was accomplished using Qt Designer and the resulting .ui file resembles to the example above. ? While it works, I am having difficulties in setting up the size policy.? In short, no matter what sizePolicy I set to both (or either) the QWidget and QVTKOpenGLWidget, their sizes are fixed. If I maximize the window, the QVTKOpenGLWidget does not maximize. ? Can anyone shed some light into this issue?? I can attach the .ui file if it is appropriate. It sounds like you don't have a layout set on the centralWidget? Try setting it by selecting the centralWidget and using one of the layout buttons in the toolbars. The containing widget must have a layout set for size policies to take effect. HTH Elvis ? Any help is very much appreciated, ? -- Elvis C.S. Chen, PhD, LEL ? _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://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: https://vtk.org/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From Sateeshlearner at gmail.com Fri May 25 11:26:53 2018 From: Sateeshlearner at gmail.com (Itsme) Date: Fri, 25 May 2018 08:26:53 -0700 (MST) Subject: [vtkusers] Overlay slice on vtkResliceImageViewer and change slice when scrolling In-Reply-To: <1519403055490-0.post@n5.nabble.com> References: <1519251776356-0.post@n5.nabble.com> <1519289412827-0.post@n5.nabble.com> <1519319549805-0.post@n5.nabble.com> <1519403055490-0.post@n5.nabble.com> Message-ID: <1527262013183-0.post@n5.nabble.com> Hi Actually Im trying on the similiar issue ...any improvements..pls suggest. Regards Itsme -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From Sateeshlearner at gmail.com Fri May 25 11:56:24 2018 From: Sateeshlearner at gmail.com (Itsme) Date: Fri, 25 May 2018 08:56:24 -0700 (MST) Subject: [vtkusers] Contouring on multiple slice In-Reply-To: References: Message-ID: <1527263784933-0.post@n5.nabble.com> Hii, I'm working on similar issue. Did u solve this? If so please provide suggestions and code if possible.. Thanks in advance ! -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From elvis.stansvik at orexplore.com Fri May 25 12:27:38 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Fri, 25 May 2018 18:27:38 +0200 Subject: [vtkusers] Qt Designer (5.10.1), QVTKOpenGLWidget, and sizepolicy questions In-Reply-To: <5b081454.1c69fb81.8c44b.0f73@mx.google.com> References: <5b072294.1c69fb81.facc8.8c84@mx.google.com> <5b081454.1c69fb81.8c44b.0f73@mx.google.com> Message-ID: You have to add QVTKOpenGLWidget as a class that can be promoted to. O can make a screenshot of how you do it when I get home. You basically fill in the class name, base class and name of the header. Then you can pick it from the list of classes when promoting. Elvis Den fre 25 maj 2018 15:49Elvis Chen skrev: > Hi, > > > > Thank you very much. The 2nd problem was indeed related to the layout. > As for the 1st problem, I?ve tried to promote a widget but the ?promote? > button is always grayed-out in Qt Designer. I?ll have to look deeper into > this issue. > > > > Very much appreciated, > > > > Regards, > > > > > > -- > > Elvis C.S. Chen, PhD, LEL > > > > Imaging, Robarts Research Institute > > Department of Electrical and Computer Engineering > > Biomedical Engineering > > Medical Biophysics, Western University > > London, Ontario, Canada > > > > > > *From: *Elvis Stansvik > *Sent: *May 25, 2018 2:58 AM > *To: *Elvis Chen > *Cc: *VTK Users > *Subject: *Re: [vtkusers] Qt Designer (5.10.1), QVTKOpenGLWidget, and > sizepolicy questions > > > > Den tors 24 maj 2018 22:37Elvis Chen skrev: > > Hi all, > > > > I have 2 questions related to the integration of QVTKOpenGLWidget into Qt > Designer and sizing policy, I seek your help. > > > > First of, I?ve installed both 32/64-bits of Qt 5.10.1 onto my Windows 10 > environment. I am using Visual Studio 2015 Enterprise edition, CMake > 3.11.2, and vtk 9.0. Everything was compiled as 32bit application. > > > > Question #1: > > > > In order to integrate QVTKOpenGLWidget into Qt Designer, I had to copy > QVTKWidgetPlugin.dll/pdb into a path that?s accessible to Qt Designer. > There is no QVTKOpenGLWidgetPlugin.* as far as I can tell. In Qt Designer, > I do have access to QVTKWidget but not QVTKOpenGLWidget. > > > > The generated .ui file hence contained QVTKWidget and I had to manually > edit the .ui file to replace QVTKWidget with QVTKOpenGLWidget. > > > > Is this the correct way of doing things? Is manual editing required? > > > > I believe you're right in that there's no designer plugin for > QVTKOpenGLWidget. > > > > What I usually do is insert a QOpenGLWidget in designer and the "promote" > it to a QVTKOpenGLWidget. See > http://doc.qt.io/qt-5/designer-using-custom-widgets.html#promoting-widgets > > > > Manual editing should not be required. > > > > > > Question #2: > > > > I tried to follow VTK/Qt examples such as > https://lorensen.github.io/VTKExamples/site/Cxx/Qt/ShareCameraQt/. > Suppose I have generated a Qt app based on QMainWindow, with a QWidget as > the centralWidget and a QVTKOpenGLWidget on top of the centralWidget (as > seen on the example above). This was accomplished using Qt Designer and > the resulting .ui file resembles to the example above. > > > > While it works, I am having difficulties in setting up the size policy. > In short, no matter what sizePolicy I set to both (or either) the QWidget > and QVTKOpenGLWidget, their sizes are fixed. If I maximize the window, the > QVTKOpenGLWidget does not maximize. > > > > Can anyone shed some light into this issue? I can attach the .ui file if > it is appropriate. > > > > It sounds like you don't have a layout set on the centralWidget? Try > setting it by selecting the centralWidget and using one of the layout > buttons in the toolbars. > > > > The containing widget must have a layout set for size policies to take > effect. > > > > HTH > > Elvis > > > > Any help is very much appreciated, > > > > -- > > Elvis C.S. Chen, PhD, LEL > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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: > https://vtk.org/mailman/listinfo/vtkusers > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From csaba.pinter at queensu.ca Fri May 25 14:12:02 2018 From: csaba.pinter at queensu.ca (Csaba Pinter) Date: Fri, 25 May 2018 18:12:02 +0000 Subject: [vtkusers] vtkMultiVolume and shading In-Reply-To: References: Message-ID: I created an issue for this bug https://gitlab.kitware.com/vtk/vtk/issues/17325 I'll add comments there when I have any luck reproducing the problem with a minimal test case. csaba -----Original Message----- From: vtkusers On Behalf Of Csaba Pinter Sent: Wednesday, May 23, 2018 15:31 To: Elvis Stansvik Cc: vtkusers at vtk.org Subject: Re: [vtkusers] vtkMultiVolume and shading That's a pretty resourceful workaround :) I'll keep trying to get to the bottom of this though. csaba -----Original Message----- From: Elvis Stansvik Sent: Wednesday, May 23, 2018 15:25 To: Csaba Pinter Cc: vtkusers at vtk.org Subject: Re: [vtkusers] vtkMultiVolume and shading 2018-05-23 21:16 GMT+02:00 Elvis Stansvik : > 2018-05-23 21:08 GMT+02:00 Csaba Pinter : >> Hi Elvis, >> >> Sorry for the late answer, I just got back from vacation. >> >> I haven't been able to reproduce it with a self-contained test case >> yet. I've been trying to modify TestGPURayCastMultiVolumeOverlapping, >> but it worked there. However in my work in Slicer, in which I'm >> adding a new volume rendering method with this actor, the first >> transform is always ignored. Here's the branch: >> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith >> ub.com%2Fcpinter%2FSlicer%2Ftree%2Fmulti-volume-rendering&data=02%7C0 >> 1%7Ccsaba.pinter%40queensu.ca%7Cc64f2f95b013430d7bbb08d5c0e2da87%7Cd6 >> 1ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636627002929271879&sdata=LZG >> VjR%2FE%2FEAfE3WQn%2BirX%2F8%2BrV%2BEOIb6cpo71f1%2BPM4%3D&reserved=0 >> >> I'll keep trying later this week, and will definitely let you know if I get lucky. Please do the same if you manage to reproduce it. > > Alright, looks like we're in the same boat. I'll probably have some > more time to look at this next week. FWIW the workaround I toyed around with was always keeping a single-voxel fully-transparent volume around on port 0, but obviously a proper solution would be better. Elvis > > Elvis > >> >> Thanks, >> csaba >> >> -----Original Message----- >> From: Elvis Stansvik >> Sent: Friday, May 18, 2018 05:35 >> To: Csaba Pinter >> Cc: Sankhesh Jhaveri ; vtkusers at vtk.org >> Subject: Re: [vtkusers] vtkMultiVolume and shading >> >> 2018-04-24 22:14 GMT+02:00 Csaba Pinter : >>> Hi Sankhesh and Elvis, >>> >>> The first issue that I was now able to confirm is that SetVisibility called on the individual vtkVolume objects within vtkMultiVolume has no effect. Not sure if this is intentional or not, but naively I'd think this is the way to show/hide a volume. I'm not fond of the idea to clear the connection in the mapper and set volume to null every time I want to hide one. >>> The way to reproduce this is for example adding these lines to line 118 in Rendering\Volume\Testing\Cxx\TestGPURayCastMultiVolumeOverlapping.cxx >>> else if (key == "w") >>> { >>> this->Volume->SetVisibility(!this->Volume->GetVisibility()); >>> } >>> If you start the test interactively (-I), then nothing happens if you press w. >>> >>> The other issue is that the user transform I set to the first volume seems to be ignored, while the second volume's transform is used properly. I haven't been able to reproduce it with this test yet, so I'll keep working on it until I find out what is the exact issue. >> >> Hi again Csaba. Were you ever able to reproduce the "transform first volume" problem? >> >> In my own experiments with vtkMultiVolume, I seem to be hitting a similar issue. In my case it's SetPosition that won't bite on the first volume (I think...), but I guess that is probably the same issue you were seeing. >> >> So far I've been unable to reproduce it in a minimal test case though >> :( >> >> Best regards, >> Elvis >> >>> >>> Cheers, >>> csaba >>> >>> -----Original Message----- >>> From: Elvis Stansvik >>> Sent: Tuesday, April 24, 2018 10:51 >>> To: Csaba Pinter >>> Cc: Sankhesh Jhaveri ; >>> vtkusers at vtk.org >>> Subject: Re: [vtkusers] vtkMultiVolume and shading >>> >>> 2018-04-24 15:15 GMT+02:00 Csaba Pinter : >>>> Hi Sankhesh, >>>> >>>> >>>> >>>> Thanks for the quick answer! Just in a nutshell, what would be >>>> needed to do programming-wise to add shading in the code? >>>> >>>> >>>> >>>> Also I?m wondering if the situation about funding applies to >>>> bugfixes as well? I am struggling with issues related to per-volume >>>> visibility and user transforms, and I think I?ll get back to you >>>> soon with self-contained test cases once I was able to figure out >>>> which of these are on the VTK side and how to reproduce them easily. >>> >>> I'm also about to experiment with the multi-volume support. Would be interesting to hear from you what problems you ran into wrt to per-volume visibility / user transforms, so I know what to look out for :) So if you file issues for those it would be great if you could link to them here. >>> >>> Cheers, >>> Elvis >>> >>>> >>>> >>>> >>>> Thanks, >>>> >>>> csaba >>>> >>>> >>>> >>>> From: Sankhesh Jhaveri >>>> Sent: Monday, April 23, 2018 21:15 >>>> To: Csaba Pinter >>>> Cc: vtkusers at vtk.org >>>> Subject: Re: [vtkusers] vtkMultiVolume and shading >>>> >>>> >>>> >>>> Hi Csaba, >>>> >>>> I don?t believe there is a technical limitation. It was merely that >>>> the original effort for adding multiple overlapping volumes support >>>> was focused on selected features. I am not aware of current >>>> efforts/funding to add support for additional features like shading, different blend modes, etc. >>>> >>>> Thanks, >>>> Sankhesh >>>> >>>> >>>> >>>> On Mon, Apr 23, 2018 at 3:45 PM Csaba Pinter >>>> >>>> wrote: >>>> >>>> Hello, >>>> >>>> >>>> >>>> I?m experimenting with using vtkMultiVolume to add proper >>>> multi-volume rendering support into 3D Slicer. My main question is >>>> the reason behind this actor not supporting shading, as apparent >>>> when used, but also mentioned in the corresponding test: >>>> >>>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgi >>>> th >>>> u >>>> b.com%2FKitware%2FVTK%2Fblob%2Fmaster%2FRendering%2FVolume%2FTestin >>>> g% >>>> 2 >>>> FCxx%2FTestGPURayCastMultiVolumeOverlapping.cxx%23L229&data=02%7C01 >>>> %7 >>>> C >>>> csaba.pinter%40queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61e >>>> cb >>>> 3 >>>> b38b142d582c4efb2838b925c%7C1%7C0%7C636601782604952003&sdata=Ylx6UE >>>> %2 >>>> B >>>> 0l7IeQEWU5OEkSYHXSAuBYLT8DzB1RobJY34%3D&reserved=0 >>>> >>>> Is this a technical limitation that would be very hard to overcome, >>>> or is it something simpler? I?m asking this because for this actor >>>> to be really used for volume rendering, shading would be necessary. >>>> >>>> >>>> >>>> Thank you, >>>> >>>> Csaba >>>> >>>> _______________________________________________ >>>> Powered by >>>> https://na01.safelinks.protection.outlook.com/?url=www.kitware.com& >>>> da >>>> t >>>> a=02%7C01%7Ccsaba.pinter%40queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f >>>> 2c >>>> 9 >>>> 90%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636601782604952003& >>>> sd >>>> a >>>> ta=OAQC2JW%2FBdByHi6rzs3UR3OuEYMXVtnIBzyO2DLUEBg%3D&reserved=0 >>>> >>>> Visit other Kitware open-source projects at >>>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww >>>> .k >>>> i >>>> tware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Ccsaba.pinte >>>> r% >>>> 4 >>>> 0queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582 >>>> c4 >>>> e >>>> fb2838b925c%7C1%7C0%7C636601782604952003&sdata=ILwtCl2ODMcW2PistT%2 >>>> BU >>>> e >>>> pqKoQ7hCylxaWiGofVT5L8%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 >>>> .v >>>> t >>>> k.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Ccsaba.pinter%40queensu.ca%7Ce >>>> 39 >>>> 4 >>>> ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb2838b925c%7C1 >>>> %7 >>>> C >>>> 0%7C636601782604952003&sdata=M05RBjDP8XffO2U1b2I%2BMOI2jswVhNERqdrg >>>> v% >>>> 2 >>>> Fbd%2Bmo%3D&reserved=0 >>>> >>>> Search the list archives at: >>>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmar >>>> km >>>> a >>>> il.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Ccsaba.pinter%40que >>>> en >>>> s >>>> u.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb28 >>>> 38 >>>> b >>>> 925c%7C1%7C0%7C636601782604952003&sdata=%2B9tRXKCTKzxtmbkE9hWJz1%2F >>>> oo >>>> B >>>> fefTvNJWtuJta0b1o%3D&reserved=0 >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk. >>>> o >>>> rg%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Ccsaba.pinter%40qu >>>> ee >>>> n >>>> su.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb2 >>>> 83 >>>> 8 >>>> b925c%7C1%7C0%7C636601782604952003&sdata=2HdbAKBlfe1JNhyMG%2BCo%2Fn >>>> wJ >>>> 2 >>>> o2IWDqQHl%2BCIjbu3Fs%3D&reserved=0 >>>> >>>> -- >>>> >>>> Sankhesh Jhaveri >>>> >>>> Sr. Research & Development Engineer | Kitware | (518) 881-4417 >>>> >>>> >>>> _______________________________________________ >>>> Powered by >>>> https://na01.safelinks.protection.outlook.com/?url=www.kitware.com& >>>> da >>>> t >>>> a=02%7C01%7Ccsaba.pinter%40queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f >>>> 2c >>>> 9 >>>> 90%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636601782604952003& >>>> sd >>>> a >>>> ta=OAQC2JW%2FBdByHi6rzs3UR3OuEYMXVtnIBzyO2DLUEBg%3D&reserved=0 >>>> >>>> Visit other Kitware open-source projects at >>>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww >>>> .k >>>> i >>>> tware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Ccsaba.pinte >>>> r% >>>> 4 >>>> 0queensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582 >>>> c4 >>>> e >>>> fb2838b925c%7C1%7C0%7C636601782604952003&sdata=ILwtCl2ODMcW2PistT%2 >>>> BU >>>> e >>>> pqKoQ7hCylxaWiGofVT5L8%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 >>>> .v >>>> t >>>> k.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Ccsaba.pinter%40queensu.ca%7Ce >>>> 39 >>>> 4 >>>> ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb2838b925c%7C1 >>>> %7 >>>> C >>>> 0%7C636601782604952003&sdata=M05RBjDP8XffO2U1b2I%2BMOI2jswVhNERqdrg >>>> v% >>>> 2 >>>> Fbd%2Bmo%3D&reserved=0 >>>> >>>> Search the list archives at: >>>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmar >>>> km >>>> a >>>> il.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Ccsaba.pinter%40que >>>> en >>>> s >>>> u.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4efb28 >>>> 38 >>>> b >>>> 925c%7C1%7C0%7C636601782604952003&sdata=%2B9tRXKCTKzxtmbkE9hWJz1%2F >>>> oo >>>> B >>>> fefTvNJWtuJta0b1o%3D&reserved=0 >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk. >>>> o >>>> rg%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Ccsaba.pinter%40qu >>>> eensu.ca%7Ce394ec9b8b0a4e6be41b08d5a9f2c990%7Cd61ecb3b38b142d582c4e >>>> fb2838b925c%7C1%7C0%7C636601782604952003&sdata=2HdbAKBlfe1JNhyMG%2B >>>> Co%2FnwJ2o2IWDqQHl%2BCIjbu3Fs%3D&reserved=0 >>>> _______________________________________________ Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Ccsaba.pinter%40queensu.ca%7Cc8397173011a4631c53d08d5c0e3c805%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636627006900645962&sdata=TQJPbGU3DoyRoqtocqmVA7I9p5%2F2aUPbhrzw2ZPOH%2BU%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%7Ccsaba.pinter%40queensu.ca%7Cc8397173011a4631c53d08d5c0e3c805%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636627006900645962&sdata=2l708ALHoceV%2BxYxkTJn%2BdtL4ttKsOwt%2FP4KbMogGZ0%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%7Ccsaba.pinter%40queensu.ca%7Cc8397173011a4631c53d08d5c0e3c805%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636627006900645962&sdata=mh3dXPPz9qX0oyxUTrQDN16VG5NcoUybE17rqWyVY40%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%7Ccsaba.pinter%40queensu.ca%7Cc8397173011a4631c53d08d5c0e3c805%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636627006900645962&sdata=0g37QCb2V1osEicu%2F%2Ff%2BEtt3eUp5ms7JuBNn3sl2f7E%3D&reserved=0 Follow this link to subscribe/unsubscribe: https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk.org%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Ccsaba.pinter%40queensu.ca%7Cc8397173011a4631c53d08d5c0e3c805%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636627006900645962&sdata=xcODYsLmAzW5OI7FKniONE0mS64G2tFSBmIFLtLELCs%3D&reserved=0 From lasso at queensu.ca Fri May 25 15:15:08 2018 From: lasso at queensu.ca (Andras Lasso) Date: Fri, 25 May 2018 19:15:08 +0000 Subject: [vtkusers] Contouring on multiple slice In-Reply-To: <1527263784933-0.post@n5.nabble.com> References: <1527263784933-0.post@n5.nabble.com> Message-ID: For you information, there are several open-source projects that implement complete medical image computing applications, including contouring on multiple slices and many other features that you'll need. Instead of developing everything from scratch again, you may just extend/customize those applications. Have a look at 3D Slicer (www.slicer.org) , MITK (http://mitk.org/), ITK-Snap (http://www.itksnap.org), etc. Andras -----Original Message----- From: vtkusers On Behalf Of Itsme Sent: Friday, May 25, 2018 11:56 AM To: vtkusers at vtk.org Subject: Re: [vtkusers] Contouring on multiple slice Hii, I'm working on similar issue. Did u solve this? If so please provide suggestions and code if possible.. 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%7C179a948d9dfb441d935508d5c25813ad%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636628605904880827&sdata=zR7sxJfXYKX9fE2zV2Iv6f5Yn0wTefxzhQmLT8S4oDQ%3D&reserved=0 _______________________________________________ Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7C179a948d9dfb441d935508d5c25813ad%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636628605904880827&sdata=WJa3lZG5D%2B1F1ovdxMWSXS4Drz%2B0YAoMAdM3iCZwzTQ%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%7C179a948d9dfb441d935508d5c25813ad%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636628605904880827&sdata=f55kLzztUNo1oBhGQg1rmlsY%2BFBsoWoT1hSEIyOD5kQ%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%7C179a948d9dfb441d935508d5c25813ad%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636628605904880827&sdata=7BMsF4DQZ7cVUK5MjFwN%2BqLNPieM7tp6DREGG3MN498%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%7C179a948d9dfb441d935508d5c25813ad%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636628605904880827&sdata=0wUDnagEMQhiifihPNh%2Bs%2BqGySL3jAqISvch4QxVM1A%3D&reserved=0 Follow this link to subscribe/unsubscribe: https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk.org%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%7C179a948d9dfb441d935508d5c25813ad%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636628605904880827&sdata=JuJA0wHyZVmiLvUbXi9Ism%2BP99PirlHjKQSPMKBy3eg%3D&reserved=0 From aur.marsan at gmail.com Fri May 25 16:51:04 2018 From: aur.marsan at gmail.com (aur.marsan) Date: Fri, 25 May 2018 13:51:04 -0700 (MST) Subject: [vtkusers] Reset vtkActor rotation? In-Reply-To: References: Message-ID: <1527281464061-0.post@n5.nabble.com> You can use the SetOrientation method of the vtkActor. vtkActor.SetOrientation(0, 0, 0) -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From aur.marsan at gmail.com Fri May 25 17:18:19 2018 From: aur.marsan at gmail.com (aur.marsan) Date: Fri, 25 May 2018 14:18:19 -0700 (MST) Subject: [vtkusers] Reset vtkActor rotation? In-Reply-To: <1527281464061-0.post@n5.nabble.com> References: <1527281464061-0.post@n5.nabble.com> Message-ID: <1527283099158-0.post@n5.nabble.com> Sorry my mistake. SetOrientation only reset the orientation value. So you would need to used the GetOrientation. Set rotate manually toward the initial location. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From ftpronk at engits.com Mon May 28 07:43:02 2018 From: ftpronk at engits.com (Fcs) Date: Mon, 28 May 2018 04:43:02 -0700 (MST) Subject: [vtkusers] Understanding vtkSmartPointers Message-ID: <1527507782405-0.post@n5.nabble.com> Using VTK for one of our projects, we are encountering some memory leaks which, in time, cripple our system. So I'm trying to have a better understanding of the VTK pointers . It was my (erroneous..?) belief that the *vtkSmartPointer*s would destroy the object they were holding when getting out of scope. Carefully reading the kitware blog post linked hereinabove, and playing around with a test code (code sample below), I now understand that it is objects held by *vtkNew* that will be destroyed when out-of-scope, and that *vtkSmartPointer*s, on the contrary, will keep them alive as long as the reference count is non-zero. Is this correct? Now, from a practical point of view: does this mean that I can, in a class, create an entire VTK pipeline with *vtkSmartPointer*s, and only store the latest object in a member variable to keep every object alive (So, in my code below, only bookkeep the object returned by applyFilters())? And that when I'm finished, I can call ->Delete() on that object to clean-up the entire pipeline? Is this a good practice? Until now, I was painstakingly storing every object created for the lifetime of a pipeline, and I would like to know if I can simplify my code.. Thank you! Francois. Toy code: (returns vtkDebugLeaks has found no leaks) #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vtkSmartPointer applyFilters(vtkSmartPointer grid) { // Convert cell data to point data vtkSmartPointer c2p = vtkSmartPointer::New(); c2p->PassCellDataOn(); c2p->SetInputData(grid); // Clip at value r = 4.5 vtkSmartPointer clip = vtkSmartPointer::New(); clip->SetInputConnection(c2p->GetOutputPort()); clip->SetInputArrayToProcess(0, 0, 0, 0, "R"); clip->SetValue(4.5); clip->InsideOutOn(); // Make plane vtkSmartPointer plane = vtkSmartPointer::New(); plane->SetOrigin(0.,0.,0.); plane->SetNormal(0, 0, 1); // Cut vtkSmartPointer cutter = vtkSmartPointer::New(); cutter->SetCutFunction(plane); cutter->SetInputConnection(clip->GetOutputPort()); return cutter; } int main() { // Create structured grid int nx = 101, ny = 101, nz = 101; double dx, dy, dz; dx = dy = dz = 10./(nx-1); vtkSmartPointer grid = vtkSmartPointer::New(); grid->SetDimensions(nx, ny, nz); vtkSmartPointer pts = vtkSmartPointer::New(); for (int i = 0; i < nx; ++i) { for (int j = 0; j < ny; ++j) { for (int k = 0; k < nz; ++k) { pts->InsertNextPoint(-5+dx*i, -5+dy*j, -5+dz*k); } } } grid->SetPoints(pts); // Create cell scalar field vtkSmartPointer arr = vtkSmartPointer::New(); arr->SetNumberOfComponents(1); arr->SetName("R"); vtkSmartPointer cell_centres = vtkSmartPointer::New(); cell_centres->SetInputData(grid); cell_centres->Update(); for (int i = 0; i < grid->GetNumberOfCells(); ++i) { double pt[3]; cell_centres->GetOutput()->GetPoint(i, pt); double r = pt[0]*pt[0] + pt[1]*pt[1] + pt[2]*pt[2]; arr->InsertNextValue(r); } grid->GetCellData()->AddArray(arr); // Call clipping functions vtkSmartPointer poly_algo = applyFilters(grid); // Create a mapper and actor vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(poly_algo->GetOutputPort()); vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); // Create a renderer, render window and interactor vtkSmartPointer renderer = vtkSmartPointer::New(); vtkSmartPointer render_window = vtkSmartPointer::New(); render_window->SetWindowName("Plane"); render_window->AddRenderer(renderer); vtkSmartPointer window_interactor = vtkSmartPointer::New(); window_interactor->SetRenderWindow(render_window); // Add the actors to the scene renderer->AddActor(actor); // Render and interact render_window->Render(); window_interactor->Start(); return EXIT_SUCCESS; } -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From mathieu.westphal at kitware.com Mon May 28 07:49:32 2018 From: mathieu.westphal at kitware.com (Mathieu Westphal) Date: Mon, 28 May 2018 13:49:32 +0200 Subject: [vtkusers] Understanding vtkSmartPointers In-Reply-To: <1527507782405-0.post@n5.nabble.com> References: <1527507782405-0.post@n5.nabble.com> Message-ID: Dear Francois, The simplest way to go here would be to use only vtkNew and to not use applyFilters but put the applyFilters code in your main. Best regards, Mathieu Westphal On Mon, May 28, 2018 at 1:43 PM, Fcs wrote: > Using VTK for one of our projects, we are encountering some memory leaks > which, in time, cripple our system. So I'm trying to have a better > understanding of the VTK pointers > . > > It was my (erroneous..?) belief that the *vtkSmartPointer*s would destroy > the object they were holding when getting out of scope. Carefully reading > the kitware blog post linked hereinabove, and playing around with a test > code (code sample below), I now understand that it is objects held by > *vtkNew* that will be destroyed when out-of-scope, and that > *vtkSmartPointer*s, on the contrary, will keep them alive as long as the > reference count is non-zero. Is this correct? > > Now, from a practical point of view: does this mean that I can, in a > class, > create an entire VTK pipeline with *vtkSmartPointer*s, and only store the > latest object in a member variable to keep every object alive (So, in my > code below, only bookkeep the object returned by applyFilters())? And that > when I'm finished, I can call ->Delete() on that object to clean-up the > entire pipeline? Is this a good practice? Until now, I was painstakingly > storing every object created for the lifetime of a pipeline, and I would > like to know if I can simplify my code.. > > Thank you! > > Francois. > > > > Toy code: > (returns vtkDebugLeaks has found no leaks) > > > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > > > vtkSmartPointer > applyFilters(vtkSmartPointer grid) > { > // Convert cell data to point data > vtkSmartPointer c2p = > vtkSmartPointer::New(); > c2p->PassCellDataOn(); > c2p->SetInputData(grid); > > // Clip at value r = 4.5 > vtkSmartPointer clip = > vtkSmartPointer::New(); > clip->SetInputConnection(c2p->GetOutputPort()); > clip->SetInputArrayToProcess(0, 0, 0, 0, "R"); > clip->SetValue(4.5); > clip->InsideOutOn(); > > // Make plane > vtkSmartPointer plane = > vtkSmartPointer::New(); > plane->SetOrigin(0.,0.,0.); > plane->SetNormal(0, 0, 1); > > // Cut > vtkSmartPointer cutter = > vtkSmartPointer::New(); > cutter->SetCutFunction(plane); > cutter->SetInputConnection(clip->GetOutputPort()); > > return cutter; > } > > > int main() > { > // Create structured grid > int nx = 101, ny = 101, nz = 101; > double dx, dy, dz; > dx = dy = dz = 10./(nx-1); > vtkSmartPointer grid = > vtkSmartPointer::New(); > grid->SetDimensions(nx, ny, nz); > vtkSmartPointer pts = vtkSmartPointer::New(); > for (int i = 0; i < nx; ++i) { > for (int j = 0; j < ny; ++j) { > for (int k = 0; k < nz; ++k) { > pts->InsertNextPoint(-5+dx*i, -5+dy*j, -5+dz*k); > } > } > } > grid->SetPoints(pts); > > // Create cell scalar field > vtkSmartPointer arr = > vtkSmartPointer::New(); > arr->SetNumberOfComponents(1); > arr->SetName("R"); > vtkSmartPointer cell_centres = > vtkSmartPointer::New(); > cell_centres->SetInputData(grid); > cell_centres->Update(); > for (int i = 0; i < grid->GetNumberOfCells(); ++i) { > double pt[3]; > cell_centres->GetOutput()->GetPoint(i, pt); > double r = pt[0]*pt[0] + pt[1]*pt[1] + pt[2]*pt[2]; > arr->InsertNextValue(r); > } > grid->GetCellData()->AddArray(arr); > > // Call clipping functions > vtkSmartPointer poly_algo = applyFilters(grid); > > // Create a mapper and actor > vtkSmartPointer mapper = > vtkSmartPointer::New(); > mapper->SetInputConnection(poly_algo->GetOutputPort()); > vtkSmartPointer actor = vtkSmartPointer::New(); > actor->SetMapper(mapper); > > // Create a renderer, render window and interactor > vtkSmartPointer renderer = > vtkSmartPointer::New(); > vtkSmartPointer render_window = > vtkSmartPointer::New(); > render_window->SetWindowName("Plane"); > render_window->AddRenderer(renderer); > vtkSmartPointer window_interactor = > vtkSmartPointer::New(); > window_interactor->SetRenderWindow(render_window); > > // Add the actors to the scene > renderer->AddActor(actor); > > // Render and interact > render_window->Render(); > window_interactor->Start(); > > return EXIT_SUCCESS; > } > > > > > -- > 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: > https://vtk.org/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc.ruiz+vtk at gmail.com Mon May 28 07:55:09 2018 From: marc.ruiz+vtk at gmail.com (Marc Ruiz Altisent) Date: Mon, 28 May 2018 13:55:09 +0200 Subject: [vtkusers] vtkSmartVolumeMapper doesn't properly handle input changes In-Reply-To: References: Message-ID: Should I create a new issue for this in the bug tracker? Missatge de Marc Ruiz Altisent del dia dc., 23 de maig 2018 a les 19:29: > Hi everyone, > > I have found an issue with vtkSmartVolumeMapper. If you create several > vtkImageData objects, set one of them as the input of the mapper and > render, then you won't be able to render one of the others at a later time: > if you set one of the others as input the mapper will keep rendering the > first one. > > The issue is in the method vtkSmartVolumeMapper::ConnectMapperInput. It > doesn't pass the original input to its internal mapper, but a shallow copy > of it. The first time it will always perform the shallow copy, but > afterwards it will only do it if the new input has been modified after > creating the previous shallow copy, which is not always the case (e.g. if > you create all the data before the first render). > > Possible workarounds are to call Modified() on the input data when setting > a new one or to create a new mapper each time. > > Below is a sample program (adapted from a couple of examples) to proof the > issue. Pressing 1 or 2 alternates between 2 datasets but only the first one > is always rendered. Uncommenting the 2 Modified() calls makes it work as > expected. > > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > > // Define interaction style > class KeyPressInteractorStyle : public vtkInteractorStyleTrackballCamera > { > public: > static KeyPressInteractorStyle* New(); > vtkTypeMacro(KeyPressInteractorStyle, > vtkInteractorStyleTrackballCamera); > > virtual void OnKeyPress() > { > // Get the keypress > vtkRenderWindowInteractor *rwi = this->Interactor; > std::string key = rwi->GetKeySym(); > > if(key == "1") > { > mapper->SetInputData(imageData1); > //imageData1->Modified(); > rwi->Render(); > } > else if(key == "2") > { > mapper->SetInputData(imageData2); > //imageData2->Modified(); > rwi->Render(); > } > > // Forward events > vtkInteractorStyleTrackballCamera::OnKeyPress(); > } > vtkSmartPointer mapper; > vtkSmartPointer imageData1, imageData2; > }; > vtkStandardNewMacro(KeyPressInteractorStyle); > > static void CreateImageData(vtkImageData* im, bool); > > int main(int argc, char *argv[]) > { > vtkSmartPointer imageData = > vtkSmartPointer::New(); > vtkSmartPointer imageData2 = > vtkSmartPointer::New(); > > CreateImageData(imageData, true); > CreateImageData(imageData2, false); > > vtkSmartPointer renWin = > vtkSmartPointer::New(); > vtkSmartPointer ren1 = > vtkSmartPointer::New(); > ren1->SetBackground(0.1,0.4,0.2); > > renWin->AddRenderer(ren1); > > renWin->SetSize(301,300); // intentional odd and NPOT width/height > > vtkSmartPointer iren = > vtkSmartPointer::New(); > iren->SetRenderWindow(renWin); > > vtkSmartPointer style = > vtkSmartPointer::New(); > iren->SetInteractorStyle(style); > style->SetCurrentRenderer(ren1); > > renWin->Render(); // make sure we have an OpenGL context. > > vtkSmartPointer volumeMapper = > vtkSmartPointer::New(); > volumeMapper->SetBlendModeToComposite(); // composite first > volumeMapper->SetInputData(imageData); > vtkSmartPointer volumeProperty = > vtkSmartPointer::New(); > volumeProperty->ShadeOff(); > volumeProperty->SetInterpolationType(VTK_LINEAR_INTERPOLATION); > > style->mapper = volumeMapper; > style->imageData1 = imageData; > style->imageData2 = imageData2; > > vtkSmartPointer compositeOpacity = > vtkSmartPointer::New(); > compositeOpacity->AddPoint(0.0,0.0); > compositeOpacity->AddPoint(80.0,1.0); > compositeOpacity->AddPoint(80.1,0.0); > compositeOpacity->AddPoint(255.0,0.0); > volumeProperty->SetScalarOpacity(compositeOpacity); // composite first. > > vtkSmartPointer color = > vtkSmartPointer::New(); > color->AddRGBPoint(0.0 ,0.0,0.0,1.0); > color->AddRGBPoint(40.0 ,1.0,0.0,0.0); > color->AddRGBPoint(255.0,1.0,1.0,1.0); > volumeProperty->SetColor(color); > > vtkSmartPointer volume = > vtkSmartPointer::New(); > volume->SetMapper(volumeMapper); > volume->SetProperty(volumeProperty); > ren1->AddViewProp(volume); > ren1->ResetCamera(); > > // Render composite. In default mode. For coverage. > renWin->Render(); > > iren->Start(); > > return EXIT_SUCCESS; > } > > void CreateImageData(vtkImageData* imageData, bool spherical) > { > vtkSmartPointer implicitFunction; > > if (spherical) > { > vtkSmartPointer sphere = > vtkSmartPointer::New(); > sphere->SetRadius(0.1); > sphere->SetCenter(0.0,0.0,0.0); > implicitFunction = sphere; > } > else > { > vtkSmartPointer box = > vtkSmartPointer::New(); > box->SetBounds(-0.1, 0.1, -0.1, 0.1, -0.1, 0.1); > implicitFunction = box; > } > > vtkSmartPointer sampleFunction = > vtkSmartPointer::New(); > sampleFunction->SetImplicitFunction(implicitFunction); > sampleFunction->SetOutputScalarTypeToDouble(); > sampleFunction->SetSampleDimensions(127,127,127); // intentional NPOT > dimensions. > sampleFunction->SetModelBounds(-1.0,1.0,-1.0,1.0,-1.0,1.0); > sampleFunction->SetCapping(false); > sampleFunction->SetComputeNormals(false); > sampleFunction->SetScalarArrayName("values"); > sampleFunction->Update(); > > vtkDataArray* a = > sampleFunction->GetOutput()->GetPointData()->GetScalars("values"); > double range[2]; > a->GetRange(range); > > vtkSmartPointer t = > vtkSmartPointer::New(); > t->SetInputConnection(sampleFunction->GetOutputPort()); > > t->SetShift(-range[0]); > double magnitude=range[1]-range[0]; > if(magnitude==0.0) > { > magnitude=1.0; > } > t->SetScale(255.0/magnitude); > t->SetOutputScalarTypeToUnsignedChar(); > > t->Update(); > > imageData->ShallowCopy(t->GetOutput()); > } > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.chen at gmail.com Mon May 28 09:57:46 2018 From: elvis.chen at gmail.com (Elvis Chen) Date: Mon, 28 May 2018 09:57:46 -0400 Subject: [vtkusers] Qt Designer (5.10.1), QVTKOpenGLWidget, and sizepolicyquestions In-Reply-To: References: <5b072294.1c69fb81.facc8.8c84@mx.google.com> <5b081454.1c69fb81.8c44b.0f73@mx.google.com> Message-ID: <5b0c0ada.1c69fb81.8aadc.2917@mx.google.com> Thank you. My mistake was that I was using QWidget (instead of QOpenGLWidget) as the base widget. Now it works great. Really appreciated. -- Elvis C.S. Chen, PhD, LEL ? Imaging, Robarts Research Institute Department of Electrical and Computer Engineering Biomedical Engineering Medical Biophysics, Western University London, Ontario, Canada From: Elvis Stansvik Sent: May 25, 2018 12:49 PM To: Elvis Chen Cc: VTK Users Subject: Re: [vtkusers] Qt Designer (5.10.1), QVTKOpenGLWidget, and sizepolicyquestions Here's how you do it: Step 1: Right-click the QOpenGLWidget and pick "Promote to...": Step 2: Fill in base class, class name and header name and click "Add": Step 3: With the new entry selected in the list, click "Promote": Step 4: Done, the class is now promoted to a QVTKOpenGLWidget: HTH, Elvis ? 2018-05-25 18:27 GMT+02:00 Elvis Stansvik : You have to add QVTKOpenGLWidget as a class that can be promoted to. O can make a screenshot of how you do it when I get home. You basically fill in the class name, base class and name of the header. Then you can pick it from the list of classes when promoting. Elvis Den fre 25 maj 2018 15:49Elvis Chen skrev: Hi, ? Thank you very much.? The 2nd problem was indeed related to the layout. As for the 1st problem, I?ve tried to promote a widget but the ?promote? button is always grayed-out in Qt Designer. I?ll have to look deeper into this issue. ? Very much appreciated, ? Regards, ? ? -- Elvis C.S. Chen, PhD, LEL ? Imaging, Robarts Research Institute Department of Electrical and Computer Engineering Biomedical Engineering Medical Biophysics, Western University London, Ontario, Canada ? ? From: Elvis Stansvik Sent: May 25, 2018 2:58 AM To: Elvis Chen Cc: VTK Users Subject: Re: [vtkusers] Qt Designer (5.10.1), QVTKOpenGLWidget, and sizepolicy questions ? Den tors 24 maj 2018 22:37Elvis Chen skrev: Hi all, ? I have 2 questions related to the integration of QVTKOpenGLWidget into Qt Designer and sizing policy, I seek your help. ? First of, I?ve installed both 32/64-bits of Qt 5.10.1 onto my Windows 10 environment. I am using Visual Studio 2015 Enterprise edition, CMake 3.11.2, and vtk 9.0. Everything was compiled as 32bit application. ? Question #1: ? In order to integrate QVTKOpenGLWidget into Qt Designer, I had to copy QVTKWidgetPlugin.dll/pdb into a path that?s accessible to Qt Designer. There is no QVTKOpenGLWidgetPlugin.* as far as I can tell. In Qt Designer, I do have access to QVTKWidget but not QVTKOpenGLWidget. ? The generated .ui file hence contained QVTKWidget and I had to manually edit the .ui file to replace QVTKWidget with QVTKOpenGLWidget. ? Is this the correct way of doing things?? Is manual editing required? ? I believe you're right in that there's no designer plugin for QVTKOpenGLWidget. ? What I usually do is insert a QOpenGLWidget in designer and the "promote" it to a QVTKOpenGLWidget. See?http://doc.qt.io/qt-5/designer-using-custom-widgets.html#promoting-widgets ? Manual editing should not be required. ? ? Question #2: ? I tried to follow VTK/Qt examples such as https://lorensen.github.io/VTKExamples/site/Cxx/Qt/ShareCameraQt/.? Suppose I have generated a Qt app based on QMainWindow, with a QWidget as the centralWidget and a QVTKOpenGLWidget on top of the centralWidget (as seen on the example above).? This was accomplished using Qt Designer and the resulting .ui file resembles to the example above. ? While it works, I am having difficulties in setting up the size policy.? In short, no matter what sizePolicy I set to both (or either) the QWidget and QVTKOpenGLWidget, their sizes are fixed. If I maximize the window, the QVTKOpenGLWidget does not maximize. ? Can anyone shed some light into this issue?? I can attach the .ui file if it is appropriate. ? It sounds like you don't have a layout set on the centralWidget? Try setting it by selecting the centralWidget and using one of the layout buttons in the toolbars. ? The containing widget must have a layout set for size policies to take effect. ? HTH Elvis ? Any help is very much appreciated, ? -- Elvis C.S. Chen, PhD, LEL ? _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://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: https://vtk.org/mailman/listinfo/vtkusers ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcus.hanwell at kitware.com Mon May 28 10:12:24 2018 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Mon, 28 May 2018 10:12:24 -0400 Subject: [vtkusers] Understanding vtkSmartPointers In-Reply-To: <1527507782405-0.post@n5.nabble.com> References: <1527507782405-0.post@n5.nabble.com> Message-ID: On Mon, May 28, 2018 at 7:43 AM, Fcs wrote: > Using VTK for one of our projects, we are encountering some memory leaks > which, in time, cripple our system. So I'm trying to have a better > understanding of the VTK pointers > . > > It was my (erroneous..?) belief that the *vtkSmartPointer*s would destroy > the object they were holding when getting out of scope. Carefully reading > the kitware blog post linked hereinabove, and playing around with a test > code (code sample below), I now understand that it is objects held by > *vtkNew* that will be destroyed when out-of-scope, and that > *vtkSmartPointer*s, on the contrary, will keep them alive as long as the > reference count is non-zero. Is this correct? > No, that is not correct. The vtkNew class instantiates a vtkObject derived instance and will decrement its reference count when it goes out of scope. You can still store what was created by vtkNew in a vtkSmartPointer, increasing the reference count to two, and keeping that object alive even when the containing vtkNew goes out of scope. In its simplest form, if you don't use other smart pointer classes with it then vtkNew acts much like a stack allocated object, where the object created is automatically deleted when it goes out of scope. You must remember that all vtkObject derived classes are implicitly reference counted - it is built into the API. The smart pointer classes just take care of incremementing/decrementing the reference count. > > Now, from a practical point of view: does this mean that I can, in a > class, > create an entire VTK pipeline with *vtkSmartPointer*s, and only store the > latest object in a member variable to keep every object alive (So, in my > code below, only bookkeep the object returned by applyFilters())? And that > when I'm finished, I can call ->Delete() on that object to clean-up the > entire pipeline? Is this a good practice? Until now, I was painstakingly > storing every object created for the lifetime of a pipeline, and I would > like to know if I can simplify my code.. > > In my opinion you should aim to never call Delete, but to have a smart pointer contain the things needed. I think all pipeline API will increase the reference count, and so you only usually need to keep a reference to the pipeline objects you are going to keep around/use. The debug leaks code will help you verify you got it right. I would add that we have found in bigger applications that a passing debug leaks is not always enough, ensuring objects are deleted when they are done with is more difficult but necessary, especially in graphical applications that might run for some time. My honest summary of using the smart pointers (in classes, local code, etc) is: vtkNew - when you will instantiate the object, and want to keep a strong reference (you can't change what instance a vtkNew variable points to) vtkSmartPointer - when you might create, or use an instance passed in, and ensure it stays around for when you want to make calls. Assigning a different instance to one will decrement the one it points to before switching it to point to the new instance and incrementing. vtkWeakPointer - when you want to call API if something is still around, check for nullptr before using, will not affect reference count. I think I wrote something similar back then. Whenever I see code like vtkSmartPointer renderer = vtkSmartPointer::New(); I want to replace it with vtkNew renderer; It does the exact same thing with no repetition, and is clearer. The examples require backwards compatibility with older VTK, and I don't think Bill liked calling .GetPointer()/.Get() on the vtkNew object. You no longer have to do that, but it is a more recent addition to the vtkNew API - it will implicitly return the pointer to the contained object as vtkSmartPointer does. Hopefully this makes things a little clearer. At the end of the day all vtkObject derived classes (read most of the vtk* classes) are implicitly reference counted, the choice of vtkNew/vtkSmartPointer should be made depending upon how those instances will be used in your code - both will decrement the reference count by one when they go out of scope. Marcus -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.thompson at kitware.com Mon May 28 10:30:06 2018 From: david.thompson at kitware.com (David Thompson) Date: Mon, 28 May 2018 10:30:06 -0400 Subject: [vtkusers] Understanding vtkSmartPointers In-Reply-To: References: <1527507782405-0.post@n5.nabble.com> Message-ID: <90DCC5A7-D18E-462F-8C52-391152298BB1@kitware.com> > ... > I think I wrote something similar back then. Whenever I see code like > > vtkSmartPointer renderer = vtkSmartPointer::New(); > > I want to replace it with > > vtkNew renderer; With c++11, you can also say auto renderer = vtkSmartPointer::New(); which cleans up the smart-pointer case a little bit. David From marcus.hanwell at kitware.com Mon May 28 10:50:35 2018 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Mon, 28 May 2018 10:50:35 -0400 Subject: [vtkusers] Understanding vtkSmartPointers In-Reply-To: <90DCC5A7-D18E-462F-8C52-391152298BB1@kitware.com> References: <1527507782405-0.post@n5.nabble.com> <90DCC5A7-D18E-462F-8C52-391152298BB1@kitware.com> Message-ID: On Mon, May 28, 2018 at 10:30 AM, David Thompson wrote: > > ... > > I think I wrote something similar back then. Whenever I see code like > > > > vtkSmartPointer renderer = vtkSmartPointer:: > New(); > > > > I want to replace it with > > > > vtkNew renderer; > > With c++11, you can also say > > auto renderer = vtkSmartPointer::New(); > > which cleans up the smart-pointer case a little bit. > > For sure, although in the case of class member variables it doesn't help, and I would argue vtkNew is cleaner (and vtkNew still uses far fewer characters, you got to preserve the finite resources on disk :P ). -------------- next part -------------- An HTML attachment was scrubbed... URL: From ftpronk at engits.com Mon May 28 11:45:51 2018 From: ftpronk at engits.com (Fcs) Date: Mon, 28 May 2018 08:45:51 -0700 (MST) Subject: [vtkusers] Understanding vtkSmartPointers In-Reply-To: References: <1527507782405-0.post@n5.nabble.com> Message-ID: <1527522351895-0.post@n5.nabble.com> Dear Mathieu, Marcus and David, thank you for your replies and tips, with a special thank to Marcus for his extensive explanations which really clarified a few of the subtleties of the VTK pointers. Marcus, I had few extra questions linked to your reply. > I In my opinion you should aim to never call Delete, but to have a smart > pointer contain the things needed. Is there any danger in calling Delete()? The case I had in mind was to perhaps free the memory occupied by a big structured/unstructured grid object which would need to live until a sub-grid is extracted from it. > I think all pipeline API will increase > the reference count, and so you only usually need to keep a reference to > the pipeline objects you are going to keep around/use. The debug leaks > code > will help you verify you got it right. How good is the guarantee that this will work? "I think" and "usually" seem to imply that my mileage might vary on this one.. :-) Does it mean that this should work in general, but that perhaps some exotic or slightly buggy newer features might not behave correctly? The use case I'm trying to implement has a variable number of pre-definied filters which I'm chaining together. If I test all the possible combinations, and they work, do I have the guarantee they will always work? > I would add that we have found in bigger applications that a passing debug > leaks is not always enough, ensuring objects are deleted when they are > done with is more difficult but necessary, especially in graphical > applications that might run for some time. Does this not imply that every vtkObject created should be stored and deleted manually afterwards? Or are there other ways to detect living vtkObjects when you don't have a direct member variable pointing to it? (say, like the vtkPlane created in applyFilters() in my example code..) > It does the exact same thing with no repetition, and is clearer. The > examples require backwards compatibility with older VTK, and I don't think > Bill liked calling .GetPointer()/.Get() on the vtkNew object. You no > longer have to do that, but it is a more recent addition to the vtkNew API > - it will implicitly return the pointer to the contained object as > vtkSmartPointer does. Good to know! Starting from which version is the call to .GetPointer()/.Get() no longer needed? We are developing in vtk 6 at the moment, but we should update to a new version at some point in the near future. Kind regards, Francois. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From marcus.hanwell at kitware.com Mon May 28 12:19:47 2018 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Mon, 28 May 2018 12:19:47 -0400 Subject: [vtkusers] Understanding vtkSmartPointers In-Reply-To: <1527522351895-0.post@n5.nabble.com> References: <1527507782405-0.post@n5.nabble.com> <1527522351895-0.post@n5.nabble.com> Message-ID: On Mon, May 28, 2018 at 11:45 AM, Fcs wrote: > > I In my opinion you should aim to never call Delete, but to have a smart > > pointer contain the things needed. > > Is there any danger in calling Delete()? The case I had in mind was to > perhaps free the memory occupied by a big structured/unstructured grid > object which would need to live until a sub-grid is extracted from it. > > You know your use case better than I do, once the reference count reaches zero the object will be deleted. If you have a routine where you work on a large grid, extract out the subgrids, and no longer need it then this is absolutely an exception to the goal I mentioned. It is more a general goal in modern C++ code to avoid manual memory management, unless absolutely necessary. This may well the that case, in which case certainly do it. I call it in places that warrant it, no additional danger in doing so. > > > I think all pipeline API will increase > > the reference count, and so you only usually need to keep a reference to > > the pipeline objects you are going to keep around/use. The debug leaks > > code > > will help you verify you got it right. > > How good is the guarantee that this will work? "I think" and "usually" seem > to imply that my mileage might vary on this one.. :-) Does it mean that > this should work in general, but that perhaps some exotic or slightly buggy > newer features might not behave correctly? The use case I'm trying to > implement has a variable number of pre-definied filters which I'm chaining > together. If I test all the possible combinations, and they work, do I have > the guarantee they will always work? > > It means it works in my experience, and it would normally be a bug should it not work. I hold on to a very small number of references in general, deferring many to the pipelines, etc. Where possible and something else owns it I avoid using smart pointers, and just grab the object as and when I need it from the owning object. > > > I would add that we have found in bigger applications that a passing > debug > > leaks is not always enough, ensuring objects are deleted when they are > > done with is more difficult but necessary, especially in graphical > > applications that might run for some time. > > Does this not imply that every vtkObject created should be stored and > deleted manually afterwards? Or are there other ways to detect living > vtkObjects when you don't have a direct member variable pointing to it? > (say, like the vtkPlane created in applyFilters() in my example code..) > > No, it means you need to get object lifetimes right, which can be achieved using smart pointers. This is a general issue in software engineering, even something that has no leaks according to valgrind, debug leaks etc shouldn't accumulate objects. In Qt I see it where people new a dialog, show it, parent it to the main window, close it, and then new another dialog. It will be deleted as the application closes down, they kind of did the right thing, but you could have a thousand or more instances of that dialog parented to main window. Valgrind etc will normally tell you there are no leaks in these cases, but you got the object lifetime wrong. In that case, having a member variable, and lazily initializing it, then reusing, or setting the flag to delete the dialog on close would have worked better. When we load data in pipelines we need to be careful to ensure the pipelines get deleted as they are removed from the UI, along with all of their data, rather than when the main window/application shuts down. Valgrind/debug leaks would be happy, not specific to VTK as such. > > > It does the exact same thing with no repetition, and is clearer. The > > examples require backwards compatibility with older VTK, and I don't > think > > Bill liked calling .GetPointer()/.Get() on the vtkNew object. You no > > longer have to do that, but it is a more recent addition to the vtkNew > API > > - it will implicitly return the pointer to the contained object as > > vtkSmartPointer does. > > Good to know! Starting from which version is the call to > .GetPointer()/.Get() no longer needed? We are developing in vtk 6 at the > moment, but we should update to a new version at some point in the near > future. > > I think it was more recent than that, I live on or near master and it has been this way for a while. The commit was from Jun 24, 2017, and it looks like that was in VTK 8.1.0 (our most recent release). Marcus -------------- next part -------------- An HTML attachment was scrubbed... URL: From ftpronk at engits.com Mon May 28 13:29:11 2018 From: ftpronk at engits.com (Fcs) Date: Mon, 28 May 2018 10:29:11 -0700 (MST) Subject: [vtkusers] Understanding vtkSmartPointers In-Reply-To: References: <1527507782405-0.post@n5.nabble.com> <1527522351895-0.post@n5.nabble.com> Message-ID: <1527528551710-0.post@n5.nabble.com> Dear Marcus, Thank you for the clarifications, it lifted the uncertainties I had and helped me put the pieces of the puzzle together. Qt object lifetime management is a familiar territory, so the analogy was also helpful. It the end, it's good to understand exactly what the expected behaviour of VTK is, and using that to reduce the number of references we hold on to will hopefully help reducing the bug count on our side. Kind regards, Francois. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From babybishops at gmail.com Mon May 28 16:16:34 2018 From: babybishops at gmail.com (Gaiajack) Date: Mon, 28 May 2018 13:16:34 -0700 (MST) Subject: [vtkusers] Text does not appear to be working, in particular vtkCaptionActor2D Message-ID: <1527538594740-0.post@n5.nabble.com> I'm using the Python library version 6.3 with Python 2.7. I've been having trouble getting text to appear. For example, using this code: https://www.vtk.org/gitweb?p=VTK.git;a=blob;f=Rendering/Annotation/Testing/Python/TestCaptionActor.py the text labels do not appear for me. I did have to add iren.Start() to the script, right before renWin.Render(), so that the window would stay open, but other than I ran the code as-is. The program runs without errors, and I can see a sphere with a red arrow coming out of it, but no text. Any ideas? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From bill.lorensen at gmail.com Mon May 28 18:06:08 2018 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Mon, 28 May 2018 15:06:08 -0700 Subject: [vtkusers] Deprecate vtkGeo* classes (Sankhesh Jhaveri) In-Reply-To: References: Message-ID: I can easily remove that example. Bill On Fri, May 25, 2018 at 2:54 AM, Sankhesh Jhaveri wrote: > Thank you for checking, Andrew. > > > On Fri, May 25, 2018 at 12:32 AM Andrew Maclean > wrote: >> >> Sankesh, for your information,. >> >> With respect to VTKExamples. >> In looking at C++ examples, >> https://lorensen.github.io/VTKExamples/site/Coverage/CxxVTKClassesUsed/ I >> can only see vtkGeoAssignCoordinates being used in >> https://lorensen.github.io/VTKExamples/site/Cxx/Geovis/GeoAssignCoordinates/ >> and vtkGeoGraticule, vtkGeoProjection, vtkGeoTransform used in >> https://lorensen.github.io/VTKExamples/site/Cxx/Geovis/GeoGraticle/ >> >> Nothing in the Python examples. >> >> So, in my opinion, deprecation would be appropriate if there are no >> users/maintainers. >> >> Regards >> Andrew >> >>> >>> ---------- Forwarded message ---------- >>> From: Sankhesh Jhaveri >>> To: vtk-developers , "vtkusers at vtk.org" >>> >>> Cc: >>> Bcc: >>> Date: Wed, 23 May 2018 16:14:53 -0400 >>> Subject: [vtk-developers] Deprecate vtkGeo* classes >>> >>> Folks, >>> >>> There have been some discussions about deprecating a bunch of classes >>> from the vtkGeovisCore and vtkViewsGeovis module owing to the lack of users >>> and maintainers. The tentative list of classes to be deprecated is as >>> follows: >>> >>> vtkGeoAdaptiveArcs >>> vtkGeoAlignedImageRepresentation >>> vtkGeoAlignedImageSource >>> vtkGeoAssignCoordinates >>> vtkGeoFileImageSource >>> vtkGeoFileTerrainSource >>> vtkGeoGlobeSource >>> vtkGeoGraticule >>> vtkGeoImageNode >>> vtkGeoRandomGraphSource >>> vtkGeoSampleArcs >>> vtkGeoSource >>> vtkGeoTerrain >>> vtkGeoTerrain2D >>> vtkGeoTerrainNode >>> vtkGeoTreeNode >>> vtkGeoTreeNodeCache >>> vtkGeoView >>> vtkGeoView2D >>> >>> The primary reason for deprecation is lack of known users and >>> maintainers. >>> Please reply to this email if you use these classes and intend to >>> maintain them or if you think they shouldn?t be deprecated. >>> >>> Thank you! >>> Sankhesh >>> >>> -- >>> >>> 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 >>> >>> Search the list archives at: http://markmail.org/search/?q=vtk-developers >>> >>> Follow this link to subscribe/unsubscribe: >>> https://vtk.org/mailman/listinfo/vtk-developers >> >> >> >> -- >> ___________________________________________ >> Andrew J. P. Maclean >> >> ___________________________________________ > > -- > > 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: > https://vtk.org/mailman/listinfo/vtkusers > -- Unpaid intern in BillsParadise at noware dot com From berti_krueger at hotmail.com Mon May 28 18:41:19 2018 From: berti_krueger at hotmail.com (=?iso-8859-1?Q?Berti_Kr=FCger?=) Date: Mon, 28 May 2018 22:41:19 +0000 Subject: [vtkusers] Solid Voxelization with VTK Message-ID: Hello Everyone. For my Project i have to voxelize a 3D-Triangle-Mesh. I already found the vtkVoxelModeller which, while somewhat slow (only around 200 Triangles per second), works, but only voxelizes the outer shell where the mesh boundary triangles are. The inner part of the mesh stays hollow. Is there some way to get solid voxelization of 3D-Triangle-Meshes out of the box with VTK ? Thank you very much in advance, Berti From david.gobbi at gmail.com Mon May 28 19:13:01 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 28 May 2018 17:13:01 -0600 Subject: [vtkusers] Solid Voxelization with VTK In-Reply-To: References: Message-ID: Hi Berti, If its a triangulated surface that you want to fill with voxels, use vtkPolyDataToImageStencil: https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/ PolyDataToImageData/ If its a mesh of 3D elements and you want to sample the elements to create voxels, try vtkResampleToImage. - David On Mon, May 28, 2018 at 4:41 PM, Berti Kr?ger wrote: > Hello Everyone. > > For my Project i have to voxelize a 3D-Triangle-Mesh. I already found the > vtkVoxelModeller which, while somewhat slow (only around 200 Triangles per > second), works, but only voxelizes the outer shell where the mesh boundary > triangles are. The inner part of the mesh stays hollow. > > Is there some way to get solid voxelization of 3D-Triangle-Meshes out of > the > box with VTK ? > > > Thank you very much in advance, > > Berti > -------------- next part -------------- An HTML attachment was scrubbed... URL: From srbn.ghosh99 at gmail.com Mon May 28 20:51:19 2018 From: srbn.ghosh99 at gmail.com (Shrabani Ghosh) Date: Mon, 28 May 2018 17:51:19 -0700 (MST) Subject: [vtkusers] /vtkDelaunay3D.cxx:533: undefined reference to `vtkEdgeTable::New() Message-ID: <1527555079842-0.post@n5.nabble.com> I am getting a lot of error similar like this. I have added include directory and library directories in the project properties, Why am I getting this errors. /home/sghos003/vtk-5.10.1/Filtering/vtkPolyData.cxx:72: undefined reference to `vtkSimpleCriticalSection::Lock()' /home/sghos003/vtk-5.10.1/Filtering/vtkPolyData.cxx:83: undefined reference to `vtkSimpleCriticalSection::Unlock()' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyData.cxx.o): In function `vtkPolyData::~vtkPolyData()': /home/sghos003/vtk-5.10.1/Filtering/vtkPolyData.cxx:96: undefined reference to `vtkSimpleCriticalSection::Lock()' /home/sghos003/vtk-5.10.1/Filtering/vtkPolyData.cxx:106: undefined reference to `vtkSimpleCriticalSection::Unlock()' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyData.cxx.o): In function `__static_initialization_and_destruction_0(int, int)': /home/sghos003/vtk-5.10.1/Filtering/vtkPolyData.cxx:45: undefined reference to `vtkSimpleCriticalSection::~vtkSimpleCriticalSection()' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyData.cxx.o): In function `vtkSimpleCriticalSection::vtkSimpleCriticalSection()': /home/sghos003/vtk-5.10.1/Common/vtkCriticalSection.h:69: undefined reference to `vtable for vtkSimpleCriticalSection' /home/sghos003/vtk-5.10.1/Common/vtkCriticalSection.h:70: undefined reference to `vtkSimpleCriticalSection::Init()' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolygon.cxx.o): In function `vtkPolygon::EvaluatePosition(double*, double*, int&, double*, double&, double*)': /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:279: undefined reference to `vtkPlane::ProjectPoint(double*, double*, double*, double*)' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolygon.cxx.o): In function `vtkPolyVertexList::RemoveVertex(int, vtkIdList*, vtkPriorityQueue*)': /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1084: undefined reference to `vtkPriorityQueue::Insert(double, long long)' /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1089: undefined reference to `vtkPriorityQueue::Insert(double, long long)' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolygon.cxx.o): In function `vtkPolygon::EarCutTriangulation()': /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1256: undefined reference to `vtkPriorityQueue::New()' /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1257: undefined reference to `vtkPriorityQueue::Allocate(long long, long long)' /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1263: undefined reference to `vtkPriorityQueue::Insert(double, long long)' /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1280: undefined reference to `vtkPriorityQueue::Pop(long long)' /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1285: undefined reference to `vtkPriorityQueue::Pop(long long)' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolygon.cxx.o): In function `vtkPolygon::IntersectWithLine(double*, double*, double, double&, double*, double*, int&)': /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1475: undefined reference to `vtkPlane::IntersectWithLine(double*, double*, double*, double*, double&, double*)' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolygon.cxx.o): In function `vtkPolygon::IntersectPolygonWithPolygon(int, double*, double*, int, double*, double*, double, double*)': /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1713: undefined reference to `vtkBox::IntersectBox(double*, double*, double*, double*, double&)' /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1718: undefined reference to `vtkPlane::IntersectWithLine(double*, double*, double*, double*, double&, double*)' /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1749: undefined reference to `vtkBox::IntersectBox(double*, double*, double*, double*, double&)' /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1754: undefined reference to `vtkPlane::IntersectWithLine(double*, double*, double*, double*, double&, double*)' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolygon.cxx.o): In function `vtkPriorityQueue::DeleteId(long long)': /home/sghos003/vtk-5.10.1/Common/vtkPriorityQueue.h:139: undefined reference to `vtkPriorityQueue::Pop(long long, double&)' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkQuad.cxx.o): In function `vtkQuad::EvaluatePosition(double*, double*, int&, double*, double&, double*)': /home/sghos003/vtk-5.10.1/Filtering/vtkQuad.cxx:100: undefined reference to `vtkPlane::ProjectPoint(double*, double*, double*, double*)' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkStreamingDemandDrivenPipeline.cxx.o): In function `vtkStreamingDemandDrivenPipeline::CopyDefaultInformation(vtkInformation*, int, vtkInformationVector**, vtkInformationVector*)': /home/sghos003/vtk-5.10.1/Filtering/vtkStreamingDemandDrivenPipeline.cxx:494: undefined reference to `vtkExtentTranslator::New()' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkStreamingDemandDrivenPipeline.cxx.o): In function `vtkStreamingDemandDrivenPipeline::GetExtentTranslator(vtkInformation*)': /home/sghos003/vtk-5.10.1/Filtering/vtkStreamingDemandDrivenPipeline.cxx:2033: undefined reference to `vtkExtentTranslator::New()' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkTriangle.cxx.o): In function `vtkTriangle::EvaluatePosition(double*, double*, int&, double*, double&, double*)': /home/sghos003/vtk-5.10.1/Filtering/vtkTriangle.cxx:96: undefined reference to `vtkPlane::GeneralizedProjectPoint(double*, double*, double*, double*)' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkTriangle.cxx.o): In function `vtkTriangle::IntersectWithLine(double*, double*, double, double&, double*, double*, int&)': /home/sghos003/vtk-5.10.1/Filtering/vtkTriangle.cxx:507: undefined reference to `vtkPlane::IntersectWithLine(double*, double*, double*, double*, double&, double*)' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkTriangle.cxx.o): In function `vtkTriangle::ComputeQuadric(double*, double*, double*, vtkQuadric*)': /home/sghos003/vtk-5.10.1/Filtering/vtkTriangle.cxx:1100: undefined reference to `vtkQuadric::SetCoefficients(double, double, double, double, double, double, double, double, double, double)' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkAlgorithm.cxx.o): In function `vtkAlgorithm::PrintSelf(std::ostream&, vtkIndent)': /home/sghos003/vtk-5.10.1/Filtering/vtkAlgorithm.cxx:588: undefined reference to `vtkErrorCode::GetStringFromErrorCode(unsigned long)' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkDemandDrivenPipeline.cxx.o): In function `__static_initialization_and_destruction_0(int, int)': /home/sghos003/vtk-5.10.1/Common/vtkInstantiator.h:130: undefined reference to `vtkInstantiatorInitialize::vtkInstantiatorInitialize()' /home/sghos003/vtk-5.10.1/Common/vtkInstantiator.h:130: undefined reference to `vtkInstantiatorInitialize::~vtkInstantiatorInitialize()' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPixel.cxx.o): In function `vtkPixel::EvaluatePosition(double*, double*, int&, double*, double&, double*)': /home/sghos003/vtk-5.10.1/Filtering/vtkPixel.cxx:80: undefined reference to `vtkPlane::ProjectPoint(double*, double*, double*, double*)' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPixel.cxx.o): In function `vtkPixel::IntersectWithLine(double*, double*, double, double&, double*, double*, int&)': /home/sghos003/vtk-5.10.1/Filtering/vtkPixel.cxx:372: undefined reference to `vtkPlane::IntersectWithLine(double*, double*, double*, double*, double&, double*)' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyhedron.cxx.o): In function `vtkPolyhedron::vtkPolyhedron()': /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:1336: undefined reference to `vtkEdgeTable::New()' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyhedron.cxx.o): In function `vtkPolyhedron::Initialize()': /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:1498: undefined reference to `vtkEdgeTable::Reset()' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyhedron.cxx.o): In function `vtkPolyhedron::GenerateEdges()': /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:1583: undefined reference to `vtkEdgeTable::InitEdgeInsertion(long long, int)' /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:1591: undefined reference to `vtkEdgeTable::IsEdge(long long, long long)' /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:1593: undefined reference to `vtkEdgeTable::InsertEdge(long long, long long)' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyhedron.cxx.o): In function `vtkPolyhedron::InternalContour(double, int, vtkIncrementalPointLocator*, vtkDataArray*, vtkDataArray*, vtkPointData*, vtkPointData*, vtkCellArray*, vtkIdToIdVectorMapType&, vtkIdToIdVectorMapType&, vtkIdToIdMapType&)': /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:2354: undefined reference to `vtkEdgeTable::InitTraversal()' /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:2355: undefined reference to `vtkEdgeTable::GetNextEdge(long long&, long long&, void*&)' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyhedron.cxx.o): In function `vtkPolyhedron::vtkInternal::RemoveDuplicatedPointsFromFaceArrayAndEdgeTable(vtkPoints*, vtkIdTypeArray*&, vtkEdgeTable*&, double*)': /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:220: undefined reference to `vtkEdgeTable::New()' -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From bill.lorensen at gmail.com Mon May 28 21:17:04 2018 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Mon, 28 May 2018 18:17:04 -0700 Subject: [vtkusers] /vtkDelaunay3D.cxx:533: undefined reference to `vtkEdgeTable::New() In-Reply-To: <1527555079842-0.post@n5.nabble.com> References: <1527555079842-0.post@n5.nabble.com> Message-ID: Are you including in your code the #includes for the missing objects?./ On Mon, May 28, 2018, 5:51 PM Shrabani Ghosh wrote: > I am getting a lot of error similar like this. I have added include > directory > and library directories in the project properties, Why am I getting this > errors. > > /home/sghos003/vtk-5.10.1/Filtering/vtkPolyData.cxx:72: undefined reference > to `vtkSimpleCriticalSection::Lock()' > /home/sghos003/vtk-5.10.1/Filtering/vtkPolyData.cxx:83: undefined reference > to `vtkSimpleCriticalSection::Unlock()' > > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyData.cxx.o): > In function `vtkPolyData::~vtkPolyData()': > /home/sghos003/vtk-5.10.1/Filtering/vtkPolyData.cxx:96: undefined reference > to `vtkSimpleCriticalSection::Lock()' > /home/sghos003/vtk-5.10.1/Filtering/vtkPolyData.cxx:106: undefined > reference > to `vtkSimpleCriticalSection::Unlock()' > > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyData.cxx.o): > In function `__static_initialization_and_destruction_0(int, int)': > /home/sghos003/vtk-5.10.1/Filtering/vtkPolyData.cxx:45: undefined reference > to `vtkSimpleCriticalSection::~vtkSimpleCriticalSection()' > > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyData.cxx.o): > In function `vtkSimpleCriticalSection::vtkSimpleCriticalSection()': > /home/sghos003/vtk-5.10.1/Common/vtkCriticalSection.h:69: undefined > reference to `vtable for vtkSimpleCriticalSection' > /home/sghos003/vtk-5.10.1/Common/vtkCriticalSection.h:70: undefined > reference to `vtkSimpleCriticalSection::Init()' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolygon.cxx.o): > In function `vtkPolygon::EvaluatePosition(double*, double*, int&, double*, > double&, double*)': > /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:279: undefined reference > to `vtkPlane::ProjectPoint(double*, double*, double*, double*)' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolygon.cxx.o): > In function `vtkPolyVertexList::RemoveVertex(int, vtkIdList*, > vtkPriorityQueue*)': > /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1084: undefined > reference > to `vtkPriorityQueue::Insert(double, long long)' > /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1089: undefined > reference > to `vtkPriorityQueue::Insert(double, long long)' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolygon.cxx.o): > In function `vtkPolygon::EarCutTriangulation()': > /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1256: undefined > reference > to `vtkPriorityQueue::New()' > /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1257: undefined > reference > to `vtkPriorityQueue::Allocate(long long, long long)' > /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1263: undefined > reference > to `vtkPriorityQueue::Insert(double, long long)' > /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1280: undefined > reference > to `vtkPriorityQueue::Pop(long long)' > /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1285: undefined > reference > to `vtkPriorityQueue::Pop(long long)' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolygon.cxx.o): > In function `vtkPolygon::IntersectWithLine(double*, double*, double, > double&, double*, double*, int&)': > /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1475: undefined > reference > to `vtkPlane::IntersectWithLine(double*, double*, double*, double*, > double&, > double*)' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolygon.cxx.o): > In function `vtkPolygon::IntersectPolygonWithPolygon(int, double*, double*, > int, double*, double*, double, double*)': > /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1713: undefined > reference > to `vtkBox::IntersectBox(double*, double*, double*, double*, double&)' > /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1718: undefined > reference > to `vtkPlane::IntersectWithLine(double*, double*, double*, double*, > double&, > double*)' > /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1749: undefined > reference > to `vtkBox::IntersectBox(double*, double*, double*, double*, double&)' > /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1754: undefined > reference > to `vtkPlane::IntersectWithLine(double*, double*, double*, double*, > double&, > double*)' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolygon.cxx.o): > In function `vtkPriorityQueue::DeleteId(long long)': > /home/sghos003/vtk-5.10.1/Common/vtkPriorityQueue.h:139: undefined > reference > to `vtkPriorityQueue::Pop(long long, double&)' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkQuad.cxx.o): In > function `vtkQuad::EvaluatePosition(double*, double*, int&, double*, > double&, double*)': > /home/sghos003/vtk-5.10.1/Filtering/vtkQuad.cxx:100: undefined reference to > `vtkPlane::ProjectPoint(double*, double*, double*, double*)' > > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkStreamingDemandDrivenPipeline.cxx.o): > In function > `vtkStreamingDemandDrivenPipeline::CopyDefaultInformation(vtkInformation*, > int, vtkInformationVector**, vtkInformationVector*)': > > /home/sghos003/vtk-5.10.1/Filtering/vtkStreamingDemandDrivenPipeline.cxx:494: > undefined reference to `vtkExtentTranslator::New()' > > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkStreamingDemandDrivenPipeline.cxx.o): > In function > `vtkStreamingDemandDrivenPipeline::GetExtentTranslator(vtkInformation*)': > > /home/sghos003/vtk-5.10.1/Filtering/vtkStreamingDemandDrivenPipeline.cxx:2033: > undefined reference to `vtkExtentTranslator::New()' > > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkTriangle.cxx.o): > In function `vtkTriangle::EvaluatePosition(double*, double*, int&, double*, > double&, double*)': > /home/sghos003/vtk-5.10.1/Filtering/vtkTriangle.cxx:96: undefined reference > to `vtkPlane::GeneralizedProjectPoint(double*, double*, double*, double*)' > > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkTriangle.cxx.o): > In function `vtkTriangle::IntersectWithLine(double*, double*, double, > double&, double*, double*, int&)': > /home/sghos003/vtk-5.10.1/Filtering/vtkTriangle.cxx:507: undefined > reference > to `vtkPlane::IntersectWithLine(double*, double*, double*, double*, > double&, > double*)' > > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkTriangle.cxx.o): > In function `vtkTriangle::ComputeQuadric(double*, double*, double*, > vtkQuadric*)': > /home/sghos003/vtk-5.10.1/Filtering/vtkTriangle.cxx:1100: undefined > reference to `vtkQuadric::SetCoefficients(double, double, double, double, > double, double, double, double, double, double)' > > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkAlgorithm.cxx.o): > In function `vtkAlgorithm::PrintSelf(std::ostream&, vtkIndent)': > /home/sghos003/vtk-5.10.1/Filtering/vtkAlgorithm.cxx:588: undefined > reference to `vtkErrorCode::GetStringFromErrorCode(unsigned long)' > > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkDemandDrivenPipeline.cxx.o): > In function `__static_initialization_and_destruction_0(int, int)': > /home/sghos003/vtk-5.10.1/Common/vtkInstantiator.h:130: undefined reference > to `vtkInstantiatorInitialize::vtkInstantiatorInitialize()' > /home/sghos003/vtk-5.10.1/Common/vtkInstantiator.h:130: undefined reference > to `vtkInstantiatorInitialize::~vtkInstantiatorInitialize()' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPixel.cxx.o): > In > function `vtkPixel::EvaluatePosition(double*, double*, int&, double*, > double&, double*)': > /home/sghos003/vtk-5.10.1/Filtering/vtkPixel.cxx:80: undefined reference to > `vtkPlane::ProjectPoint(double*, double*, double*, double*)' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPixel.cxx.o): > In > function `vtkPixel::IntersectWithLine(double*, double*, double, double&, > double*, double*, int&)': > /home/sghos003/vtk-5.10.1/Filtering/vtkPixel.cxx:372: undefined reference > to > `vtkPlane::IntersectWithLine(double*, double*, double*, double*, double&, > double*)' > > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyhedron.cxx.o): > In function `vtkPolyhedron::vtkPolyhedron()': > /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:1336: undefined > reference to `vtkEdgeTable::New()' > > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyhedron.cxx.o): > In function `vtkPolyhedron::Initialize()': > /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:1498: undefined > reference to `vtkEdgeTable::Reset()' > > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyhedron.cxx.o): > In function `vtkPolyhedron::GenerateEdges()': > /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:1583: undefined > reference to `vtkEdgeTable::InitEdgeInsertion(long long, int)' > /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:1591: undefined > reference to `vtkEdgeTable::IsEdge(long long, long long)' > /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:1593: undefined > reference to `vtkEdgeTable::InsertEdge(long long, long long)' > > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyhedron.cxx.o): > In function `vtkPolyhedron::InternalContour(double, int, > vtkIncrementalPointLocator*, vtkDataArray*, vtkDataArray*, vtkPointData*, > vtkPointData*, vtkCellArray*, vtkIdToIdVectorMapType&, > vtkIdToIdVectorMapType&, vtkIdToIdMapType&)': > /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:2354: undefined > reference to `vtkEdgeTable::InitTraversal()' > /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:2355: undefined > reference to `vtkEdgeTable::GetNextEdge(long long&, long long&, void*&)' > > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyhedron.cxx.o): > In function > > `vtkPolyhedron::vtkInternal::RemoveDuplicatedPointsFromFaceArrayAndEdgeTable(vtkPoints*, > vtkIdTypeArray*&, vtkEdgeTable*&, double*)': > /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:220: undefined > reference to `vtkEdgeTable::New()' > > > > > -- > 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: > https://vtk.org/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From srbn.ghosh99 at gmail.com Mon May 28 22:08:48 2018 From: srbn.ghosh99 at gmail.com (Shrabani Ghosh) Date: Mon, 28 May 2018 22:08:48 -0400 Subject: [vtkusers] /vtkDelaunay3D.cxx:533: undefined reference to `vtkEdgeTable::New() In-Reply-To: References: <1527555079842-0.post@n5.nabble.com> Message-ID: Yep see these all are vtk files. I didn't do anything with these files. And I checked the header files are included. On Mon, May 28, 2018 at 9:17 PM, Bill Lorensen wrote: > Are you including in your code the #includes for the missing objects?./ > > On Mon, May 28, 2018, 5:51 PM Shrabani Ghosh > wrote: > >> I am getting a lot of error similar like this. I have added include >> directory >> and library directories in the project properties, Why am I getting this >> errors. >> >> /home/sghos003/vtk-5.10.1/Filtering/vtkPolyData.cxx:72: undefined >> reference >> to `vtkSimpleCriticalSection::Lock()' >> /home/sghos003/vtk-5.10.1/Filtering/vtkPolyData.cxx:83: undefined >> reference >> to `vtkSimpleCriticalSection::Unlock()' >> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( >> vtkPolyData.cxx.o): >> In function `vtkPolyData::~vtkPolyData()': >> /home/sghos003/vtk-5.10.1/Filtering/vtkPolyData.cxx:96: undefined >> reference >> to `vtkSimpleCriticalSection::Lock()' >> /home/sghos003/vtk-5.10.1/Filtering/vtkPolyData.cxx:106: undefined >> reference >> to `vtkSimpleCriticalSection::Unlock()' >> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( >> vtkPolyData.cxx.o): >> In function `__static_initialization_and_destruction_0(int, int)': >> /home/sghos003/vtk-5.10.1/Filtering/vtkPolyData.cxx:45: undefined >> reference >> to `vtkSimpleCriticalSection::~vtkSimpleCriticalSection()' >> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( >> vtkPolyData.cxx.o): >> In function `vtkSimpleCriticalSection::vtkSimpleCriticalSection()': >> /home/sghos003/vtk-5.10.1/Common/vtkCriticalSection.h:69: undefined >> reference to `vtable for vtkSimpleCriticalSection' >> /home/sghos003/vtk-5.10.1/Common/vtkCriticalSection.h:70: undefined >> reference to `vtkSimpleCriticalSection::Init()' >> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( >> vtkPolygon.cxx.o): >> In function `vtkPolygon::EvaluatePosition(double*, double*, int&, >> double*, >> double&, double*)': >> /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:279: undefined >> reference >> to `vtkPlane::ProjectPoint(double*, double*, double*, double*)' >> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( >> vtkPolygon.cxx.o): >> In function `vtkPolyVertexList::RemoveVertex(int, vtkIdList*, >> vtkPriorityQueue*)': >> /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1084: undefined >> reference >> to `vtkPriorityQueue::Insert(double, long long)' >> /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1089: undefined >> reference >> to `vtkPriorityQueue::Insert(double, long long)' >> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( >> vtkPolygon.cxx.o): >> In function `vtkPolygon::EarCutTriangulation()': >> /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1256: undefined >> reference >> to `vtkPriorityQueue::New()' >> /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1257: undefined >> reference >> to `vtkPriorityQueue::Allocate(long long, long long)' >> /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1263: undefined >> reference >> to `vtkPriorityQueue::Insert(double, long long)' >> /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1280: undefined >> reference >> to `vtkPriorityQueue::Pop(long long)' >> /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1285: undefined >> reference >> to `vtkPriorityQueue::Pop(long long)' >> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( >> vtkPolygon.cxx.o): >> In function `vtkPolygon::IntersectWithLine(double*, double*, double, >> double&, double*, double*, int&)': >> /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1475: undefined >> reference >> to `vtkPlane::IntersectWithLine(double*, double*, double*, double*, >> double&, >> double*)' >> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( >> vtkPolygon.cxx.o): >> In function `vtkPolygon::IntersectPolygonWithPolygon(int, double*, >> double*, >> int, double*, double*, double, double*)': >> /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1713: undefined >> reference >> to `vtkBox::IntersectBox(double*, double*, double*, double*, double&)' >> /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1718: undefined >> reference >> to `vtkPlane::IntersectWithLine(double*, double*, double*, double*, >> double&, >> double*)' >> /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1749: undefined >> reference >> to `vtkBox::IntersectBox(double*, double*, double*, double*, double&)' >> /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1754: undefined >> reference >> to `vtkPlane::IntersectWithLine(double*, double*, double*, double*, >> double&, >> double*)' >> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( >> vtkPolygon.cxx.o): >> In function `vtkPriorityQueue::DeleteId(long long)': >> /home/sghos003/vtk-5.10.1/Common/vtkPriorityQueue.h:139: undefined >> reference >> to `vtkPriorityQueue::Pop(long long, double&)' >> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkQuad.cxx.o): >> In >> function `vtkQuad::EvaluatePosition(double*, double*, int&, double*, >> double&, double*)': >> /home/sghos003/vtk-5.10.1/Filtering/vtkQuad.cxx:100: undefined reference >> to >> `vtkPlane::ProjectPoint(double*, double*, double*, double*)' >> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( >> vtkStreamingDemandDrivenPipeline.cxx.o): >> In function >> `vtkStreamingDemandDrivenPipeline::CopyDefaultInformation( >> vtkInformation*, >> int, vtkInformationVector**, vtkInformationVector*)': >> /home/sghos003/vtk-5.10.1/Filtering/vtkStreamingDemandDrivenPipeli >> ne.cxx:494: >> undefined reference to `vtkExtentTranslator::New()' >> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( >> vtkStreamingDemandDrivenPipeline.cxx.o): >> In function >> `vtkStreamingDemandDrivenPipeline::GetExtentTranslator(vtkInformation*)': >> /home/sghos003/vtk-5.10.1/Filtering/vtkStreamingDemandDrivenPipeli >> ne.cxx:2033: >> undefined reference to `vtkExtentTranslator::New()' >> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( >> vtkTriangle.cxx.o): >> In function `vtkTriangle::EvaluatePosition(double*, double*, int&, >> double*, >> double&, double*)': >> /home/sghos003/vtk-5.10.1/Filtering/vtkTriangle.cxx:96: undefined >> reference >> to `vtkPlane::GeneralizedProjectPoint(double*, double*, double*, >> double*)' >> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( >> vtkTriangle.cxx.o): >> In function `vtkTriangle::IntersectWithLine(double*, double*, double, >> double&, double*, double*, int&)': >> /home/sghos003/vtk-5.10.1/Filtering/vtkTriangle.cxx:507: undefined >> reference >> to `vtkPlane::IntersectWithLine(double*, double*, double*, double*, >> double&, >> double*)' >> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( >> vtkTriangle.cxx.o): >> In function `vtkTriangle::ComputeQuadric(double*, double*, double*, >> vtkQuadric*)': >> /home/sghos003/vtk-5.10.1/Filtering/vtkTriangle.cxx:1100: undefined >> reference to `vtkQuadric::SetCoefficients(double, double, double, double, >> double, double, double, double, double, double)' >> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( >> vtkAlgorithm.cxx.o): >> In function `vtkAlgorithm::PrintSelf(std::ostream&, vtkIndent)': >> /home/sghos003/vtk-5.10.1/Filtering/vtkAlgorithm.cxx:588: undefined >> reference to `vtkErrorCode::GetStringFromErrorCode(unsigned long)' >> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( >> vtkDemandDrivenPipeline.cxx.o): >> In function `__static_initialization_and_destruction_0(int, int)': >> /home/sghos003/vtk-5.10.1/Common/vtkInstantiator.h:130: undefined >> reference >> to `vtkInstantiatorInitialize::vtkInstantiatorInitialize()' >> /home/sghos003/vtk-5.10.1/Common/vtkInstantiator.h:130: undefined >> reference >> to `vtkInstantiatorInitialize::~vtkInstantiatorInitialize()' >> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPixel.cxx.o): >> In >> function `vtkPixel::EvaluatePosition(double*, double*, int&, double*, >> double&, double*)': >> /home/sghos003/vtk-5.10.1/Filtering/vtkPixel.cxx:80: undefined reference >> to >> `vtkPlane::ProjectPoint(double*, double*, double*, double*)' >> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPixel.cxx.o): >> In >> function `vtkPixel::IntersectWithLine(double*, double*, double, double&, >> double*, double*, int&)': >> /home/sghos003/vtk-5.10.1/Filtering/vtkPixel.cxx:372: undefined >> reference to >> `vtkPlane::IntersectWithLine(double*, double*, double*, double*, double&, >> double*)' >> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( >> vtkPolyhedron.cxx.o): >> In function `vtkPolyhedron::vtkPolyhedron()': >> /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:1336: undefined >> reference to `vtkEdgeTable::New()' >> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( >> vtkPolyhedron.cxx.o): >> In function `vtkPolyhedron::Initialize()': >> /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:1498: undefined >> reference to `vtkEdgeTable::Reset()' >> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( >> vtkPolyhedron.cxx.o): >> In function `vtkPolyhedron::GenerateEdges()': >> /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:1583: undefined >> reference to `vtkEdgeTable::InitEdgeInsertion(long long, int)' >> /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:1591: undefined >> reference to `vtkEdgeTable::IsEdge(long long, long long)' >> /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:1593: undefined >> reference to `vtkEdgeTable::InsertEdge(long long, long long)' >> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( >> vtkPolyhedron.cxx.o): >> In function `vtkPolyhedron::InternalContour(double, int, >> vtkIncrementalPointLocator*, vtkDataArray*, vtkDataArray*, vtkPointData*, >> vtkPointData*, vtkCellArray*, vtkIdToIdVectorMapType&, >> vtkIdToIdVectorMapType&, vtkIdToIdMapType&)': >> /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:2354: undefined >> reference to `vtkEdgeTable::InitTraversal()' >> /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:2355: undefined >> reference to `vtkEdgeTable::GetNextEdge(long long&, long long&, void*&)' >> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( >> vtkPolyhedron.cxx.o): >> In function >> `vtkPolyhedron::vtkInternal::RemoveDuplicatedPointsFromFace >> ArrayAndEdgeTable(vtkPoints*, >> vtkIdTypeArray*&, vtkEdgeTable*&, double*)': >> /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:220: undefined >> reference to `vtkEdgeTable::New()' >> >> >> >> >> -- >> 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: >> https://vtk.org/mailman/listinfo/vtkusers >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Mon May 28 22:21:24 2018 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Mon, 28 May 2018 19:21:24 -0700 Subject: [vtkusers] /vtkDelaunay3D.cxx:533: undefined reference to `vtkEdgeTable::New() In-Reply-To: References: <1527555079842-0.post@n5.nabble.com> Message-ID: Post your program. On Mon, May 28, 2018, 7:08 PM Shrabani Ghosh wrote: > Yep see these all are vtk files. I didn't do anything with these files. > And I checked the header files are included. > > On Mon, May 28, 2018 at 9:17 PM, Bill Lorensen > wrote: > >> Are you including in your code the #includes for the missing objects?./ >> >> On Mon, May 28, 2018, 5:51 PM Shrabani Ghosh >> wrote: >> >>> I am getting a lot of error similar like this. I have added include >>> directory >>> and library directories in the project properties, Why am I getting this >>> errors. >>> >>> /home/sghos003/vtk-5.10.1/Filtering/vtkPolyData.cxx:72: undefined >>> reference >>> to `vtkSimpleCriticalSection::Lock()' >>> /home/sghos003/vtk-5.10.1/Filtering/vtkPolyData.cxx:83: undefined >>> reference >>> to `vtkSimpleCriticalSection::Unlock()' >>> >>> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyData.cxx.o): >>> In function `vtkPolyData::~vtkPolyData()': >>> /home/sghos003/vtk-5.10.1/Filtering/vtkPolyData.cxx:96: undefined >>> reference >>> to `vtkSimpleCriticalSection::Lock()' >>> /home/sghos003/vtk-5.10.1/Filtering/vtkPolyData.cxx:106: undefined >>> reference >>> to `vtkSimpleCriticalSection::Unlock()' >>> >>> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyData.cxx.o): >>> In function `__static_initialization_and_destruction_0(int, int)': >>> /home/sghos003/vtk-5.10.1/Filtering/vtkPolyData.cxx:45: undefined >>> reference >>> to `vtkSimpleCriticalSection::~vtkSimpleCriticalSection()' >>> >>> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyData.cxx.o): >>> In function `vtkSimpleCriticalSection::vtkSimpleCriticalSection()': >>> /home/sghos003/vtk-5.10.1/Common/vtkCriticalSection.h:69: undefined >>> reference to `vtable for vtkSimpleCriticalSection' >>> /home/sghos003/vtk-5.10.1/Common/vtkCriticalSection.h:70: undefined >>> reference to `vtkSimpleCriticalSection::Init()' >>> >>> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolygon.cxx.o): >>> In function `vtkPolygon::EvaluatePosition(double*, double*, int&, >>> double*, >>> double&, double*)': >>> /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:279: undefined >>> reference >>> to `vtkPlane::ProjectPoint(double*, double*, double*, double*)' >>> >>> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolygon.cxx.o): >>> In function `vtkPolyVertexList::RemoveVertex(int, vtkIdList*, >>> vtkPriorityQueue*)': >>> /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1084: undefined >>> reference >>> to `vtkPriorityQueue::Insert(double, long long)' >>> /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1089: undefined >>> reference >>> to `vtkPriorityQueue::Insert(double, long long)' >>> >>> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolygon.cxx.o): >>> In function `vtkPolygon::EarCutTriangulation()': >>> /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1256: undefined >>> reference >>> to `vtkPriorityQueue::New()' >>> /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1257: undefined >>> reference >>> to `vtkPriorityQueue::Allocate(long long, long long)' >>> /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1263: undefined >>> reference >>> to `vtkPriorityQueue::Insert(double, long long)' >>> /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1280: undefined >>> reference >>> to `vtkPriorityQueue::Pop(long long)' >>> /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1285: undefined >>> reference >>> to `vtkPriorityQueue::Pop(long long)' >>> >>> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolygon.cxx.o): >>> In function `vtkPolygon::IntersectWithLine(double*, double*, double, >>> double&, double*, double*, int&)': >>> /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1475: undefined >>> reference >>> to `vtkPlane::IntersectWithLine(double*, double*, double*, double*, >>> double&, >>> double*)' >>> >>> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolygon.cxx.o): >>> In function `vtkPolygon::IntersectPolygonWithPolygon(int, double*, >>> double*, >>> int, double*, double*, double, double*)': >>> /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1713: undefined >>> reference >>> to `vtkBox::IntersectBox(double*, double*, double*, double*, double&)' >>> /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1718: undefined >>> reference >>> to `vtkPlane::IntersectWithLine(double*, double*, double*, double*, >>> double&, >>> double*)' >>> /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1749: undefined >>> reference >>> to `vtkBox::IntersectBox(double*, double*, double*, double*, double&)' >>> /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1754: undefined >>> reference >>> to `vtkPlane::IntersectWithLine(double*, double*, double*, double*, >>> double&, >>> double*)' >>> >>> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolygon.cxx.o): >>> In function `vtkPriorityQueue::DeleteId(long long)': >>> /home/sghos003/vtk-5.10.1/Common/vtkPriorityQueue.h:139: undefined >>> reference >>> to `vtkPriorityQueue::Pop(long long, double&)' >>> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkQuad.cxx.o): >>> In >>> function `vtkQuad::EvaluatePosition(double*, double*, int&, double*, >>> double&, double*)': >>> /home/sghos003/vtk-5.10.1/Filtering/vtkQuad.cxx:100: undefined reference >>> to >>> `vtkPlane::ProjectPoint(double*, double*, double*, double*)' >>> >>> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkStreamingDemandDrivenPipeline.cxx.o): >>> In function >>> >>> `vtkStreamingDemandDrivenPipeline::CopyDefaultInformation(vtkInformation*, >>> int, vtkInformationVector**, vtkInformationVector*)': >>> >>> /home/sghos003/vtk-5.10.1/Filtering/vtkStreamingDemandDrivenPipeline.cxx:494: >>> undefined reference to `vtkExtentTranslator::New()' >>> >>> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkStreamingDemandDrivenPipeline.cxx.o): >>> In function >>> `vtkStreamingDemandDrivenPipeline::GetExtentTranslator(vtkInformation*)': >>> >>> /home/sghos003/vtk-5.10.1/Filtering/vtkStreamingDemandDrivenPipeline.cxx:2033: >>> undefined reference to `vtkExtentTranslator::New()' >>> >>> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkTriangle.cxx.o): >>> In function `vtkTriangle::EvaluatePosition(double*, double*, int&, >>> double*, >>> double&, double*)': >>> /home/sghos003/vtk-5.10.1/Filtering/vtkTriangle.cxx:96: undefined >>> reference >>> to `vtkPlane::GeneralizedProjectPoint(double*, double*, double*, >>> double*)' >>> >>> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkTriangle.cxx.o): >>> In function `vtkTriangle::IntersectWithLine(double*, double*, double, >>> double&, double*, double*, int&)': >>> /home/sghos003/vtk-5.10.1/Filtering/vtkTriangle.cxx:507: undefined >>> reference >>> to `vtkPlane::IntersectWithLine(double*, double*, double*, double*, >>> double&, >>> double*)' >>> >>> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkTriangle.cxx.o): >>> In function `vtkTriangle::ComputeQuadric(double*, double*, double*, >>> vtkQuadric*)': >>> /home/sghos003/vtk-5.10.1/Filtering/vtkTriangle.cxx:1100: undefined >>> reference to `vtkQuadric::SetCoefficients(double, double, double, double, >>> double, double, double, double, double, double)' >>> >>> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkAlgorithm.cxx.o): >>> In function `vtkAlgorithm::PrintSelf(std::ostream&, vtkIndent)': >>> /home/sghos003/vtk-5.10.1/Filtering/vtkAlgorithm.cxx:588: undefined >>> reference to `vtkErrorCode::GetStringFromErrorCode(unsigned long)' >>> >>> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkDemandDrivenPipeline.cxx.o): >>> In function `__static_initialization_and_destruction_0(int, int)': >>> /home/sghos003/vtk-5.10.1/Common/vtkInstantiator.h:130: undefined >>> reference >>> to `vtkInstantiatorInitialize::vtkInstantiatorInitialize()' >>> /home/sghos003/vtk-5.10.1/Common/vtkInstantiator.h:130: undefined >>> reference >>> to `vtkInstantiatorInitialize::~vtkInstantiatorInitialize()' >>> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPixel.cxx.o): >>> In >>> function `vtkPixel::EvaluatePosition(double*, double*, int&, double*, >>> double&, double*)': >>> /home/sghos003/vtk-5.10.1/Filtering/vtkPixel.cxx:80: undefined reference >>> to >>> `vtkPlane::ProjectPoint(double*, double*, double*, double*)' >>> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPixel.cxx.o): >>> In >>> function `vtkPixel::IntersectWithLine(double*, double*, double, double&, >>> double*, double*, int&)': >>> /home/sghos003/vtk-5.10.1/Filtering/vtkPixel.cxx:372: undefined >>> reference to >>> `vtkPlane::IntersectWithLine(double*, double*, double*, double*, double&, >>> double*)' >>> >>> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyhedron.cxx.o): >>> In function `vtkPolyhedron::vtkPolyhedron()': >>> /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:1336: undefined >>> reference to `vtkEdgeTable::New()' >>> >>> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyhedron.cxx.o): >>> In function `vtkPolyhedron::Initialize()': >>> /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:1498: undefined >>> reference to `vtkEdgeTable::Reset()' >>> >>> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyhedron.cxx.o): >>> In function `vtkPolyhedron::GenerateEdges()': >>> /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:1583: undefined >>> reference to `vtkEdgeTable::InitEdgeInsertion(long long, int)' >>> /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:1591: undefined >>> reference to `vtkEdgeTable::IsEdge(long long, long long)' >>> /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:1593: undefined >>> reference to `vtkEdgeTable::InsertEdge(long long, long long)' >>> >>> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyhedron.cxx.o): >>> In function `vtkPolyhedron::InternalContour(double, int, >>> vtkIncrementalPointLocator*, vtkDataArray*, vtkDataArray*, vtkPointData*, >>> vtkPointData*, vtkCellArray*, vtkIdToIdVectorMapType&, >>> vtkIdToIdVectorMapType&, vtkIdToIdMapType&)': >>> /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:2354: undefined >>> reference to `vtkEdgeTable::InitTraversal()' >>> /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:2355: undefined >>> reference to `vtkEdgeTable::GetNextEdge(long long&, long long&, void*&)' >>> >>> ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyhedron.cxx.o): >>> In function >>> >>> `vtkPolyhedron::vtkInternal::RemoveDuplicatedPointsFromFaceArrayAndEdgeTable(vtkPoints*, >>> vtkIdTypeArray*&, vtkEdgeTable*&, double*)': >>> /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:220: undefined >>> reference to `vtkEdgeTable::New()' >>> >>> >>> >>> >>> -- >>> 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: >>> https://vtk.org/mailman/listinfo/vtkusers >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jesse.Kinross-Smith at bentley.com Mon May 28 22:30:54 2018 From: Jesse.Kinross-Smith at bentley.com (Jesse Kinross-Smith) Date: Tue, 29 May 2018 02:30:54 +0000 Subject: [vtkusers] /vtkDelaunay3D.cxx:533: undefined reference to `vtkEdgeTable::New() In-Reply-To: References: <1527555079842-0.post@n5.nabble.com> Message-ID: These are linker errors ? you?ve defined stuff in your #includes, but it doesn?t know where the implementation is. When you #include something in your code you also need to include the appropriate libraries to your project so that the linker can resolve these references. Jesse -- Jesse Kinross-Smith Senior Software Engineer - BSW Bentley Systems, Fremantle From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Shrabani Ghosh Sent: Tuesday, 29 May 2018 10:09 AM To: Bill Lorensen Cc: VTK Users Subject: Re: [vtkusers] /vtkDelaunay3D.cxx:533: undefined reference to `vtkEdgeTable::New() Yep see these all are vtk files. I didn't do anything with these files. And I checked the header files are included. On Mon, May 28, 2018 at 9:17 PM, Bill Lorensen > wrote: Are you including in your code the #includes for the missing objects?./ On Mon, May 28, 2018, 5:51 PM Shrabani Ghosh > wrote: I am getting a lot of error similar like this. I have added include directory and library directories in the project properties, Why am I getting this errors. /home/sghos003/vtk-5.10.1/Filtering/vtkPolyData.cxx:72: undefined reference to `vtkSimpleCriticalSection::Lock()' /home/sghos003/vtk-5.10.1/Filtering/vtkPolyData.cxx:83: undefined reference to `vtkSimpleCriticalSection::Unlock()' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyData.cxx.o): In function `vtkPolyData::~vtkPolyData()': /home/sghos003/vtk-5.10.1/Filtering/vtkPolyData.cxx:96: undefined reference to `vtkSimpleCriticalSection::Lock()' /home/sghos003/vtk-5.10.1/Filtering/vtkPolyData.cxx:106: undefined reference to `vtkSimpleCriticalSection::Unlock()' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyData.cxx.o): In function `__static_initialization_and_destruction_0(int, int)': /home/sghos003/vtk-5.10.1/Filtering/vtkPolyData.cxx:45: undefined reference to `vtkSimpleCriticalSection::~vtkSimpleCriticalSection()' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyData.cxx.o): In function `vtkSimpleCriticalSection::vtkSimpleCriticalSection()': /home/sghos003/vtk-5.10.1/Common/vtkCriticalSection.h:69: undefined reference to `vtable for vtkSimpleCriticalSection' /home/sghos003/vtk-5.10.1/Common/vtkCriticalSection.h:70: undefined reference to `vtkSimpleCriticalSection::Init()' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolygon.cxx.o): In function `vtkPolygon::EvaluatePosition(double*, double*, int&, double*, double&, double*)': /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:279: undefined reference to `vtkPlane::ProjectPoint(double*, double*, double*, double*)' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolygon.cxx.o): In function `vtkPolyVertexList::RemoveVertex(int, vtkIdList*, vtkPriorityQueue*)': /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1084: undefined reference to `vtkPriorityQueue::Insert(double, long long)' /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1089: undefined reference to `vtkPriorityQueue::Insert(double, long long)' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolygon.cxx.o): In function `vtkPolygon::EarCutTriangulation()': /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1256: undefined reference to `vtkPriorityQueue::New()' /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1257: undefined reference to `vtkPriorityQueue::Allocate(long long, long long)' /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1263: undefined reference to `vtkPriorityQueue::Insert(double, long long)' /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1280: undefined reference to `vtkPriorityQueue::Pop(long long)' /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1285: undefined reference to `vtkPriorityQueue::Pop(long long)' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolygon.cxx.o): In function `vtkPolygon::IntersectWithLine(double*, double*, double, double&, double*, double*, int&)': /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1475: undefined reference to `vtkPlane::IntersectWithLine(double*, double*, double*, double*, double&, double*)' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolygon.cxx.o): In function `vtkPolygon::IntersectPolygonWithPolygon(int, double*, double*, int, double*, double*, double, double*)': /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1713: undefined reference to `vtkBox::IntersectBox(double*, double*, double*, double*, double&)' /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1718: undefined reference to `vtkPlane::IntersectWithLine(double*, double*, double*, double*, double&, double*)' /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1749: undefined reference to `vtkBox::IntersectBox(double*, double*, double*, double*, double&)' /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1754: undefined reference to `vtkPlane::IntersectWithLine(double*, double*, double*, double*, double&, double*)' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolygon.cxx.o): In function `vtkPriorityQueue::DeleteId(long long)': /home/sghos003/vtk-5.10.1/Common/vtkPriorityQueue.h:139: undefined reference to `vtkPriorityQueue::Pop(long long, double&)' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkQuad.cxx.o): In function `vtkQuad::EvaluatePosition(double*, double*, int&, double*, double&, double*)': /home/sghos003/vtk-5.10.1/Filtering/vtkQuad.cxx:100: undefined reference to `vtkPlane::ProjectPoint(double*, double*, double*, double*)' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkStreamingDemandDrivenPipeline.cxx.o): In function `vtkStreamingDemandDrivenPipeline::CopyDefaultInformation(vtkInformation*, int, vtkInformationVector**, vtkInformationVector*)': /home/sghos003/vtk-5.10.1/Filtering/vtkStreamingDemandDrivenPipeline.cxx:494: undefined reference to `vtkExtentTranslator::New()' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkStreamingDemandDrivenPipeline.cxx.o): In function `vtkStreamingDemandDrivenPipeline::GetExtentTranslator(vtkInformation*)': /home/sghos003/vtk-5.10.1/Filtering/vtkStreamingDemandDrivenPipeline.cxx:2033: undefined reference to `vtkExtentTranslator::New()' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkTriangle.cxx.o): In function `vtkTriangle::EvaluatePosition(double*, double*, int&, double*, double&, double*)': /home/sghos003/vtk-5.10.1/Filtering/vtkTriangle.cxx:96: undefined reference to `vtkPlane::GeneralizedProjectPoint(double*, double*, double*, double*)' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkTriangle.cxx.o): In function `vtkTriangle::IntersectWithLine(double*, double*, double, double&, double*, double*, int&)': /home/sghos003/vtk-5.10.1/Filtering/vtkTriangle.cxx:507: undefined reference to `vtkPlane::IntersectWithLine(double*, double*, double*, double*, double&, double*)' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkTriangle.cxx.o): In function `vtkTriangle::ComputeQuadric(double*, double*, double*, vtkQuadric*)': /home/sghos003/vtk-5.10.1/Filtering/vtkTriangle.cxx:1100: undefined reference to `vtkQuadric::SetCoefficients(double, double, double, double, double, double, double, double, double, double)' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkAlgorithm.cxx.o): In function `vtkAlgorithm::PrintSelf(std::ostream&, vtkIndent)': /home/sghos003/vtk-5.10.1/Filtering/vtkAlgorithm.cxx:588: undefined reference to `vtkErrorCode::GetStringFromErrorCode(unsigned long)' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkDemandDrivenPipeline.cxx.o): In function `__static_initialization_and_destruction_0(int, int)': /home/sghos003/vtk-5.10.1/Common/vtkInstantiator.h:130: undefined reference to `vtkInstantiatorInitialize::vtkInstantiatorInitialize()' /home/sghos003/vtk-5.10.1/Common/vtkInstantiator.h:130: undefined reference to `vtkInstantiatorInitialize::~vtkInstantiatorInitialize()' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPixel.cxx.o): In function `vtkPixel::EvaluatePosition(double*, double*, int&, double*, double&, double*)': /home/sghos003/vtk-5.10.1/Filtering/vtkPixel.cxx:80: undefined reference to `vtkPlane::ProjectPoint(double*, double*, double*, double*)' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPixel.cxx.o): In function `vtkPixel::IntersectWithLine(double*, double*, double, double&, double*, double*, int&)': /home/sghos003/vtk-5.10.1/Filtering/vtkPixel.cxx:372: undefined reference to `vtkPlane::IntersectWithLine(double*, double*, double*, double*, double&, double*)' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyhedron.cxx.o): In function `vtkPolyhedron::vtkPolyhedron()': /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:1336: undefined reference to `vtkEdgeTable::New()' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyhedron.cxx.o): In function `vtkPolyhedron::Initialize()': /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:1498: undefined reference to `vtkEdgeTable::Reset()' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyhedron.cxx.o): In function `vtkPolyhedron::GenerateEdges()': /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:1583: undefined reference to `vtkEdgeTable::InitEdgeInsertion(long long, int)' /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:1591: undefined reference to `vtkEdgeTable::IsEdge(long long, long long)' /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:1593: undefined reference to `vtkEdgeTable::InsertEdge(long long, long long)' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyhedron.cxx.o): In function `vtkPolyhedron::InternalContour(double, int, vtkIncrementalPointLocator*, vtkDataArray*, vtkDataArray*, vtkPointData*, vtkPointData*, vtkCellArray*, vtkIdToIdVectorMapType&, vtkIdToIdVectorMapType&, vtkIdToIdMapType&)': /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:2354: undefined reference to `vtkEdgeTable::InitTraversal()' /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:2355: undefined reference to `vtkEdgeTable::GetNextEdge(long long&, long long&, void*&)' ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPolyhedron.cxx.o): In function `vtkPolyhedron::vtkInternal::RemoveDuplicatedPointsFromFaceArrayAndEdgeTable(vtkPoints*, vtkIdTypeArray*&, vtkEdgeTable*&, double*)': /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:220: undefined reference to `vtkEdgeTable::New()' -- 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: https://vtk.org/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From srbn.ghosh99 at gmail.com Mon May 28 22:35:58 2018 From: srbn.ghosh99 at gmail.com (Shrabani Ghosh) Date: Mon, 28 May 2018 22:35:58 -0400 Subject: [vtkusers] /vtkDelaunay3D.cxx:533: undefined reference to `vtkEdgeTable::New() In-Reply-To: References: <1527555079842-0.post@n5.nabble.com> Message-ID: It's a big project which early implemented. It does not have any cmake. I am running it on netbeans on ubuntu. I added the include and lib directories in the project. On Mon, May 28, 2018 at 10:30 PM, Jesse Kinross-Smith < Jesse.Kinross-Smith at bentley.com> wrote: > These are linker errors ? you?ve defined stuff in your #includes, but it > doesn?t know where the implementation is. > > When you #include something in your code you also need to include the > appropriate libraries to your project so that the linker can resolve these > references. > > > > Jesse > > -- > > Jesse Kinross-Smith > > Senior Software Engineer - BSW > > Bentley Systems, Fremantle > > > > *From:* vtkusers [mailto:vtkusers-bounces at vtk.org] *On Behalf Of *Shrabani > Ghosh > *Sent:* Tuesday, 29 May 2018 10:09 AM > *To:* Bill Lorensen > *Cc:* VTK Users > *Subject:* Re: [vtkusers] /vtkDelaunay3D.cxx:533: undefined reference to > `vtkEdgeTable::New() > > > > Yep see these all are vtk files. I didn't do anything with these files. > And I checked the header files are included. > > > > On Mon, May 28, 2018 at 9:17 PM, Bill Lorensen > wrote: > > Are you including in your code the #includes for the missing objects?./ > > > > On Mon, May 28, 2018, 5:51 PM Shrabani Ghosh > wrote: > > I am getting a lot of error similar like this. I have added include > directory > and library directories in the project properties, Why am I getting this > errors. > > /home/sghos003/vtk-5.10.1/Filtering/vtkPolyData.cxx:72: undefined > reference > to `vtkSimpleCriticalSection::Lock()' > /home/sghos003/vtk-5.10.1/Filtering/vtkPolyData.cxx:83: undefined > reference > to `vtkSimpleCriticalSection::Unlock()' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( > vtkPolyData.cxx.o): > In function `vtkPolyData::~vtkPolyData()': > /home/sghos003/vtk-5.10.1/Filtering/vtkPolyData.cxx:96: undefined > reference > to `vtkSimpleCriticalSection::Lock()' > /home/sghos003/vtk-5.10.1/Filtering/vtkPolyData.cxx:106: undefined > reference > to `vtkSimpleCriticalSection::Unlock()' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( > vtkPolyData.cxx.o): > In function `__static_initialization_and_destruction_0(int, int)': > /home/sghos003/vtk-5.10.1/Filtering/vtkPolyData.cxx:45: undefined > reference > to `vtkSimpleCriticalSection::~vtkSimpleCriticalSection()' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( > vtkPolyData.cxx.o): > In function `vtkSimpleCriticalSection::vtkSimpleCriticalSection()': > /home/sghos003/vtk-5.10.1/Common/vtkCriticalSection.h:69: undefined > reference to `vtable for vtkSimpleCriticalSection' > /home/sghos003/vtk-5.10.1/Common/vtkCriticalSection.h:70: undefined > reference to `vtkSimpleCriticalSection::Init()' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( > vtkPolygon.cxx.o): > In function `vtkPolygon::EvaluatePosition(double*, double*, int&, double*, > double&, double*)': > /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:279: undefined > reference > to `vtkPlane::ProjectPoint(double*, double*, double*, double*)' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( > vtkPolygon.cxx.o): > In function `vtkPolyVertexList::RemoveVertex(int, vtkIdList*, > vtkPriorityQueue*)': > /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1084: undefined > reference > to `vtkPriorityQueue::Insert(double, long long)' > /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1089: undefined > reference > to `vtkPriorityQueue::Insert(double, long long)' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( > vtkPolygon.cxx.o): > In function `vtkPolygon::EarCutTriangulation()': > /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1256: undefined > reference > to `vtkPriorityQueue::New()' > /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1257: undefined > reference > to `vtkPriorityQueue::Allocate(long long, long long)' > /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1263: undefined > reference > to `vtkPriorityQueue::Insert(double, long long)' > /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1280: undefined > reference > to `vtkPriorityQueue::Pop(long long)' > /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1285: undefined > reference > to `vtkPriorityQueue::Pop(long long)' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( > vtkPolygon.cxx.o): > In function `vtkPolygon::IntersectWithLine(double*, double*, double, > double&, double*, double*, int&)': > /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1475: undefined > reference > to `vtkPlane::IntersectWithLine(double*, double*, double*, double*, > double&, > double*)' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( > vtkPolygon.cxx.o): > In function `vtkPolygon::IntersectPolygonWithPolygon(int, double*, > double*, > int, double*, double*, double, double*)': > /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1713: undefined > reference > to `vtkBox::IntersectBox(double*, double*, double*, double*, double&)' > /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1718: undefined > reference > to `vtkPlane::IntersectWithLine(double*, double*, double*, double*, > double&, > double*)' > /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1749: undefined > reference > to `vtkBox::IntersectBox(double*, double*, double*, double*, double&)' > /home/sghos003/vtk-5.10.1/Filtering/vtkPolygon.cxx:1754: undefined > reference > to `vtkPlane::IntersectWithLine(double*, double*, double*, double*, > double&, > double*)' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( > vtkPolygon.cxx.o): > In function `vtkPriorityQueue::DeleteId(long long)': > /home/sghos003/vtk-5.10.1/Common/vtkPriorityQueue.h:139: undefined > reference > to `vtkPriorityQueue::Pop(long long, double&)' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkQuad.cxx.o): > In > function `vtkQuad::EvaluatePosition(double*, double*, int&, double*, > double&, double*)': > /home/sghos003/vtk-5.10.1/Filtering/vtkQuad.cxx:100: undefined reference > to > `vtkPlane::ProjectPoint(double*, double*, double*, double*)' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( > vtkStreamingDemandDrivenPipeline.cxx.o): > In function > `vtkStreamingDemandDrivenPipeline::CopyDefaultInformation(vtkInformation*, > int, vtkInformationVector**, vtkInformationVector*)': > /home/sghos003/vtk-5.10.1/Filtering/vtkStreamingDemandDrivenPipeli > ne.cxx:494: > undefined reference to `vtkExtentTranslator::New()' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( > vtkStreamingDemandDrivenPipeline.cxx.o): > In function > `vtkStreamingDemandDrivenPipeline::GetExtentTranslator(vtkInformation*)': > /home/sghos003/vtk-5.10.1/Filtering/vtkStreamingDemandDrivenPipeli > ne.cxx:2033: > undefined reference to `vtkExtentTranslator::New()' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( > vtkTriangle.cxx.o): > In function `vtkTriangle::EvaluatePosition(double*, double*, int&, > double*, > double&, double*)': > /home/sghos003/vtk-5.10.1/Filtering/vtkTriangle.cxx:96: undefined > reference > to `vtkPlane::GeneralizedProjectPoint(double*, double*, double*, double*)' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( > vtkTriangle.cxx.o): > In function `vtkTriangle::IntersectWithLine(double*, double*, double, > double&, double*, double*, int&)': > /home/sghos003/vtk-5.10.1/Filtering/vtkTriangle.cxx:507: undefined > reference > to `vtkPlane::IntersectWithLine(double*, double*, double*, double*, > double&, > double*)' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( > vtkTriangle.cxx.o): > In function `vtkTriangle::ComputeQuadric(double*, double*, double*, > vtkQuadric*)': > /home/sghos003/vtk-5.10.1/Filtering/vtkTriangle.cxx:1100: undefined > reference to `vtkQuadric::SetCoefficients(double, double, double, double, > double, double, double, double, double, double)' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( > vtkAlgorithm.cxx.o): > In function `vtkAlgorithm::PrintSelf(std::ostream&, vtkIndent)': > /home/sghos003/vtk-5.10.1/Filtering/vtkAlgorithm.cxx:588: undefined > reference to `vtkErrorCode::GetStringFromErrorCode(unsigned long)' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( > vtkDemandDrivenPipeline.cxx.o): > In function `__static_initialization_and_destruction_0(int, int)': > /home/sghos003/vtk-5.10.1/Common/vtkInstantiator.h:130: undefined > reference > to `vtkInstantiatorInitialize::vtkInstantiatorInitialize()' > /home/sghos003/vtk-5.10.1/Common/vtkInstantiator.h:130: undefined > reference > to `vtkInstantiatorInitialize::~vtkInstantiatorInitialize()' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPixel.cxx.o): > In > function `vtkPixel::EvaluatePosition(double*, double*, int&, double*, > double&, double*)': > /home/sghos003/vtk-5.10.1/Filtering/vtkPixel.cxx:80: undefined reference > to > `vtkPlane::ProjectPoint(double*, double*, double*, double*)' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a(vtkPixel.cxx.o): > In > function `vtkPixel::IntersectWithLine(double*, double*, double, double&, > double*, double*, int&)': > /home/sghos003/vtk-5.10.1/Filtering/vtkPixel.cxx:372: undefined reference > to > `vtkPlane::IntersectWithLine(double*, double*, double*, double*, double&, > double*)' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( > vtkPolyhedron.cxx.o): > In function `vtkPolyhedron::vtkPolyhedron()': > /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:1336: undefined > reference to `vtkEdgeTable::New()' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( > vtkPolyhedron.cxx.o): > In function `vtkPolyhedron::Initialize()': > /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:1498: undefined > reference to `vtkEdgeTable::Reset()' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( > vtkPolyhedron.cxx.o): > In function `vtkPolyhedron::GenerateEdges()': > /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:1583: undefined > reference to `vtkEdgeTable::InitEdgeInsertion(long long, int)' > /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:1591: undefined > reference to `vtkEdgeTable::IsEdge(long long, long long)' > /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:1593: undefined > reference to `vtkEdgeTable::InsertEdge(long long, long long)' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( > vtkPolyhedron.cxx.o): > In function `vtkPolyhedron::InternalContour(double, int, > vtkIncrementalPointLocator*, vtkDataArray*, vtkDataArray*, vtkPointData*, > vtkPointData*, vtkCellArray*, vtkIdToIdVectorMapType&, > vtkIdToIdVectorMapType&, vtkIdToIdMapType&)': > /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:2354: undefined > reference to `vtkEdgeTable::InitTraversal()' > /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:2355: undefined > reference to `vtkEdgeTable::GetNextEdge(long long&, long long&, void*&)' > ../../vtk-5.10.1/vtk-5.10/lib/vtk-5.10/libvtkFiltering.a( > vtkPolyhedron.cxx.o): > In function > `vtkPolyhedron::vtkInternal::RemoveDuplicatedPointsFromFace > ArrayAndEdgeTable(vtkPoints*, > vtkIdTypeArray*&, vtkEdgeTable*&, double*)': > /home/sghos003/vtk-5.10.1/Filtering/vtkPolyhedron.cxx:220: undefined > reference to `vtkEdgeTable::New()' > > > > > -- > 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: > https://vtk.org/mailman/listinfo/vtkusers > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kor1581 at gmail.com Tue May 29 05:06:43 2018 From: kor1581 at gmail.com (ran) Date: Tue, 29 May 2018 02:06:43 -0700 (MST) Subject: [vtkusers] Grouping vtkLineWidget2 for interation Message-ID: <1527584803524-0.post@n5.nabble.com> Hi, I'm using vtkLineWidget2 in my application to draw a set of lines in the same renderwindow (actually using vtkImageReslicer) and setting the same interactor for the widgets. I need to group the line widgets, so as to correlate the response of the line widgets to interactions. for example, when moving one line I need to synchronously move all the lines. Currently what I doing is, I have set a callback for tracking each line intentions and in response to that, I manually updating new settings to other lines in the set. Have any mechanism in vtk to group the vtkWidgets ( vtkLineWidget2) to synchronise interactions? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From aida.ninyerola at gmail.com Tue May 29 07:52:22 2018 From: aida.ninyerola at gmail.com (Aida Ninyerola) Date: Tue, 29 May 2018 13:52:22 +0200 Subject: [vtkusers] VTK 8.1 in Ubuntu 16.04 Message-ID: Hi, I've built VTK 8.1 in Ubuntu 16.04 without problems. Now that I'm trying to build my project I've found a problem that I think could be related with VTK compilation. One it's a warning: /usr/local/include/vtk-8.1/vtkOStrStreamWrapper.h:45:25: warning: override controls (override/final) only available with -std=c++11 or -std=gnu++11 And the error appears as /usr/local/include/vtk-8.1/vtkWeakPointerBase.h:39:33: error: ?nullptr? was not declared in this scope I've tried to find a solution and all I found was related to c++11 but I'm afraid that my low level of C++ expertise doesn't allow me to correctly edit ccmake options to built VTK 8.1 with c++11 support (if this is the real problem). Is this error a result of an incorrect VTK compilation? How can I avoid this error? Many thanks, Aida -------------- next part -------------- An HTML attachment was scrubbed... URL: From mathieu.westphal at kitware.com Tue May 29 08:04:44 2018 From: mathieu.westphal at kitware.com (Mathieu Westphal) Date: Tue, 29 May 2018 14:04:44 +0200 Subject: [vtkusers] VTK 8.1 in Ubuntu 16.04 In-Reply-To: References: Message-ID: Dear Aida, Please make sure you are building your project with C++11 activated. One way to do that would be to add the following in your CMakeLists.txt target_compile_features(target PUBLIC cxx_std_11) Best regards, Mathieu Westphal On Tue, May 29, 2018 at 1:52 PM, Aida Ninyerola wrote: > Hi, > > I've built VTK 8.1 in Ubuntu 16.04 without problems. Now that I'm trying > to build my project I've found a problem that I think could be related with > VTK compilation. > > One it's a warning: /usr/local/include/vtk-8.1/vtkOStrStreamWrapper.h:45:25: > warning: override controls (override/final) only available with -std=c++11 > or -std=gnu++11 > > And the error appears as /usr/local/include/vtk-8.1/vtkWeakPointerBase.h:39:33: > error: ?nullptr? was not declared in this scope > > I've tried to find a solution and all I found was related to c++11 but I'm > afraid that my low level of C++ expertise doesn't allow me to correctly > edit ccmake options to built VTK 8.1 with c++11 support (if this is the > real problem). > > Is this error a result of an incorrect VTK compilation? How can I avoid > this error? > > Many thanks, > Aida > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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: > https://vtk.org/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ftpronk at engits.com Tue May 29 08:07:12 2018 From: ftpronk at engits.com (Fcs) Date: Tue, 29 May 2018 05:07:12 -0700 (MST) Subject: [vtkusers] VTK 8.1 in Ubuntu 16.04 In-Reply-To: References: Message-ID: <1527595632183-0.post@n5.nabble.com> I don't have the vtk 8.1 on my system, but with vtk 7.1, there is a flag called *VTK_USE_CXX11_FEATURES*. Try toggling it to ON. You can can search in ccmake using "/", and then typing the string you are looking for. You can try seraching for CXX11. Kind regards. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From chinander at gmail.com Tue May 29 08:21:51 2018 From: chinander at gmail.com (Mike Chinander) Date: Tue, 29 May 2018 07:21:51 -0500 Subject: [vtkusers] VTK 8.1 in Ubuntu 16.04 In-Reply-To: References: Message-ID: Override and nullptr are features of c++ that were introduced in c++11 but it looks like whatever you are building didn't ask to use c++11 features. What compiler and version are you using? Try adding the following to your CMakeLists.txt file for your project: set(CMAKE_CXX_STANDARD 11) You could also, use 14 instead of 11. I'm not sure if VTK 8.1 using c++14 features or not. Your compilation of VTK 8.1 is most likely fine. It should probably be forcing CMAKE_CXX_STANDARD to be 11 though. --Mike Chinander On Tue, May 29, 2018 at 6:52 AM, Aida Ninyerola wrote: > Hi, > > I've built VTK 8.1 in Ubuntu 16.04 without problems. Now that I'm trying > to build my project I've found a problem that I think could be related with > VTK compilation. > > One it's a warning: /usr/local/include/vtk-8.1/vtkOStrStreamWrapper.h:45:25: > warning: override controls (override/final) only available with -std=c++11 > or -std=gnu++11 > > And the error appears as /usr/local/include/vtk-8.1/vtkWeakPointerBase.h:39:33: > error: ?nullptr? was not declared in this scope > > I've tried to find a solution and all I found was related to c++11 but I'm > afraid that my low level of C++ expertise doesn't allow me to correctly > edit ccmake options to built VTK 8.1 with c++11 support (if this is the > real problem). > > Is this error a result of an incorrect VTK compilation? How can I avoid > this error? > > Many thanks, > Aida > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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: > https://vtk.org/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aida.ninyerola at gmail.com Tue May 29 10:01:54 2018 From: aida.ninyerola at gmail.com (Aida Ninyerola) Date: Tue, 29 May 2018 16:01:54 +0200 Subject: [vtkusers] VTK 8.1 in Ubuntu 16.04 In-Reply-To: References: Message-ID: Thanks to all for your quick responses! The error disappeared by adding set(CMAKE_CXX_STANDARD 11) into my CMakeLists.txt . Thank your very much, Aida On 29 May 2018 at 14:21, Mike Chinander wrote: > Override and nullptr are features of c++ that were introduced in c++11 > but it looks like whatever you are building didn't ask to use c++11 > features. What compiler and version are you using? Try adding the following > to your CMakeLists.txt file for your project: > > set(CMAKE_CXX_STANDARD 11) > > You could also, use 14 instead of 11. I'm not sure if VTK 8.1 using c++14 > features or not. Your compilation of VTK 8.1 is most likely fine. It should > probably be forcing CMAKE_CXX_STANDARD to be 11 though. > > --Mike Chinander > > On Tue, May 29, 2018 at 6:52 AM, Aida Ninyerola > wrote: > >> Hi, >> >> I've built VTK 8.1 in Ubuntu 16.04 without problems. Now that I'm trying >> to build my project I've found a problem that I think could be related with >> VTK compilation. >> >> One it's a warning: /usr/local/include/vtk-8.1/vtkOStrStreamWrapper.h:45:25: >> warning: override controls (override/final) only available with -std=c++11 >> or -std=gnu++11 >> >> And the error appears as /usr/local/include/vtk-8.1/vtkWeakPointerBase.h:39:33: >> error: ?nullptr? was not declared in this scope >> >> I've tried to find a solution and all I found was related to c++11 but >> I'm afraid that my low level of C++ expertise doesn't allow me to correctly >> edit ccmake options to built VTK 8.1 with c++11 support (if this is the >> real problem). >> >> Is this error a result of an incorrect VTK compilation? How can I avoid >> this error? >> >> Many thanks, >> Aida >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://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: >> https://vtk.org/mailman/listinfo/vtkusers >> >> > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://vtk.org/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Sateeshlearner at gmail.com Tue May 29 11:40:24 2018 From: Sateeshlearner at gmail.com (Itsme) Date: Tue, 29 May 2018 08:40:24 -0700 (MST) Subject: [vtkusers] How to display different axis slice for drawing contours In-Reply-To: References: Message-ID: <1527608424139-0.post@n5.nabble.com> Can u share ur code.. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From Sateeshlearner at gmail.com Tue May 29 11:44:23 2018 From: Sateeshlearner at gmail.com (Itsme) Date: Tue, 29 May 2018 08:44:23 -0700 (MST) Subject: [vtkusers] Contouring on multiple slice In-Reply-To: References: <1527263784933-0.post@n5.nabble.com> Message-ID: <1527608663182-0.post@n5.nabble.com> Hii Thanks for the suggestion. I'm trying to use only vtk. And slicer 3d which is my option is not providing solid code. I was not able to find their implementations. Please suggest or provide some real valued suggestions and samples. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From dave.demarle at kitware.com Tue May 29 12:18:21 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Tue, 29 May 2018 12:18:21 -0400 Subject: [vtkusers] vtkSmartVolumeMapper doesn't properly handle input changes In-Reply-To: References: Message-ID: Yes please do file a bug report on gitlab issue tracker. Thanks David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Mon, May 28, 2018 at 7:55 AM, Marc Ruiz Altisent wrote: > Should I create a new issue for this in the bug tracker? > > Missatge de Marc Ruiz Altisent del dia dc., 23 > de maig 2018 a les 19:29: > >> Hi everyone, >> >> I have found an issue with vtkSmartVolumeMapper. If you create several >> vtkImageData objects, set one of them as the input of the mapper and >> render, then you won't be able to render one of the others at a later time: >> if you set one of the others as input the mapper will keep rendering the >> first one. >> >> The issue is in the method vtkSmartVolumeMapper::ConnectMapperInput. It >> doesn't pass the original input to its internal mapper, but a shallow copy >> of it. The first time it will always perform the shallow copy, but >> afterwards it will only do it if the new input has been modified after >> creating the previous shallow copy, which is not always the case (e.g. if >> you create all the data before the first render). >> >> Possible workarounds are to call Modified() on the input data when >> setting a new one or to create a new mapper each time. >> >> Below is a sample program (adapted from a couple of examples) to proof >> the issue. Pressing 1 or 2 alternates between 2 datasets but only the first >> one is always rendered. Uncommenting the 2 Modified() calls makes it work >> as expected. >> >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> >> // Define interaction style >> class KeyPressInteractorStyle : public vtkInteractorStyleTrackballCamera >> { >> public: >> static KeyPressInteractorStyle* New(); >> vtkTypeMacro(KeyPressInteractorStyle, vtkInteractorStyleTrackballCam >> era); >> >> virtual void OnKeyPress() >> { >> // Get the keypress >> vtkRenderWindowInteractor *rwi = this->Interactor; >> std::string key = rwi->GetKeySym(); >> >> if(key == "1") >> { >> mapper->SetInputData(imageData1); >> //imageData1->Modified(); >> rwi->Render(); >> } >> else if(key == "2") >> { >> mapper->SetInputData(imageData2); >> //imageData2->Modified(); >> rwi->Render(); >> } >> >> // Forward events >> vtkInteractorStyleTrackballCamera::OnKeyPress(); >> } >> vtkSmartPointer mapper; >> vtkSmartPointer imageData1, imageData2; >> }; >> vtkStandardNewMacro(KeyPressInteractorStyle); >> >> static void CreateImageData(vtkImageData* im, bool); >> >> int main(int argc, char *argv[]) >> { >> vtkSmartPointer imageData = >> vtkSmartPointer::New(); >> vtkSmartPointer imageData2 = >> vtkSmartPointer::New(); >> >> CreateImageData(imageData, true); >> CreateImageData(imageData2, false); >> >> vtkSmartPointer renWin = >> vtkSmartPointer::New(); >> vtkSmartPointer ren1 = >> vtkSmartPointer::New(); >> ren1->SetBackground(0.1,0.4,0.2); >> >> renWin->AddRenderer(ren1); >> >> renWin->SetSize(301,300); // intentional odd and NPOT width/height >> >> vtkSmartPointer iren = >> vtkSmartPointer::New(); >> iren->SetRenderWindow(renWin); >> >> vtkSmartPointer style = >> vtkSmartPointer::New(); >> iren->SetInteractorStyle(style); >> style->SetCurrentRenderer(ren1); >> >> renWin->Render(); // make sure we have an OpenGL context. >> >> vtkSmartPointer volumeMapper = >> vtkSmartPointer::New(); >> volumeMapper->SetBlendModeToComposite(); // composite first >> volumeMapper->SetInputData(imageData); >> vtkSmartPointer volumeProperty = >> vtkSmartPointer::New(); >> volumeProperty->ShadeOff(); >> volumeProperty->SetInterpolationType(VTK_LINEAR_INTERPOLATION); >> >> style->mapper = volumeMapper; >> style->imageData1 = imageData; >> style->imageData2 = imageData2; >> >> vtkSmartPointer compositeOpacity = >> vtkSmartPointer::New(); >> compositeOpacity->AddPoint(0.0,0.0); >> compositeOpacity->AddPoint(80.0,1.0); >> compositeOpacity->AddPoint(80.1,0.0); >> compositeOpacity->AddPoint(255.0,0.0); >> volumeProperty->SetScalarOpacity(compositeOpacity); // composite first. >> >> vtkSmartPointer color = >> vtkSmartPointer::New(); >> color->AddRGBPoint(0.0 ,0.0,0.0,1.0); >> color->AddRGBPoint(40.0 ,1.0,0.0,0.0); >> color->AddRGBPoint(255.0,1.0,1.0,1.0); >> volumeProperty->SetColor(color); >> >> vtkSmartPointer volume = >> vtkSmartPointer::New(); >> volume->SetMapper(volumeMapper); >> volume->SetProperty(volumeProperty); >> ren1->AddViewProp(volume); >> ren1->ResetCamera(); >> >> // Render composite. In default mode. For coverage. >> renWin->Render(); >> >> iren->Start(); >> >> return EXIT_SUCCESS; >> } >> >> void CreateImageData(vtkImageData* imageData, bool spherical) >> { >> vtkSmartPointer implicitFunction; >> >> if (spherical) >> { >> vtkSmartPointer sphere = >> vtkSmartPointer::New(); >> sphere->SetRadius(0.1); >> sphere->SetCenter(0.0,0.0,0.0); >> implicitFunction = sphere; >> } >> else >> { >> vtkSmartPointer box = >> vtkSmartPointer::New(); >> box->SetBounds(-0.1, 0.1, -0.1, 0.1, -0.1, 0.1); >> implicitFunction = box; >> } >> >> vtkSmartPointer sampleFunction = >> vtkSmartPointer::New(); >> sampleFunction->SetImplicitFunction(implicitFunction); >> sampleFunction->SetOutputScalarTypeToDouble(); >> sampleFunction->SetSampleDimensions(127,127,127); // intentional NPOT >> dimensions. >> sampleFunction->SetModelBounds(-1.0,1.0,-1.0,1.0,-1.0,1.0); >> sampleFunction->SetCapping(false); >> sampleFunction->SetComputeNormals(false); >> sampleFunction->SetScalarArrayName("values"); >> sampleFunction->Update(); >> >> vtkDataArray* a = sampleFunction->GetOutput()-> >> GetPointData()->GetScalars("values"); >> double range[2]; >> a->GetRange(range); >> >> vtkSmartPointer t = >> vtkSmartPointer::New(); >> t->SetInputConnection(sampleFunction->GetOutputPort()); >> >> t->SetShift(-range[0]); >> double magnitude=range[1]-range[0]; >> if(magnitude==0.0) >> { >> magnitude=1.0; >> } >> t->SetScale(255.0/magnitude); >> t->SetOutputScalarTypeToUnsignedChar(); >> >> t->Update(); >> >> imageData->ShallowCopy(t->GetOutput()); >> } >> > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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: > https://vtk.org/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ochampao at hotmail.com Tue May 29 12:21:00 2018 From: ochampao at hotmail.com (ochampao) Date: Tue, 29 May 2018 09:21:00 -0700 (MST) Subject: [vtkusers] Layers of vtkImageStack not visible In-Reply-To: <1527092216275-0.post@n5.nabble.com> References: <1526982109056-0.post@n5.nabble.com> <1527030328808-0.post@n5.nabble.com> <1527092216275-0.post@n5.nabble.com> Message-ID: <1527610860886-0.post@n5.nabble.com> I am able to more consistently reproduce the problem now. I am using two monitors on my computer. I've observed that whenever the executable loads on the right monitor (identified as primary on windows), the layers are all properly displayed on all three anatomical views. However, when the application loads on the left monitor (identified as secondary on windows) the layers beyond the first one do not appear on the axial view. I've also tried unplugging one of the monitors. The problem persists on one port but not on the other, when only one monitor is plugged in. Has anyone observed such an issue before? Thanks Panos. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From lasso at queensu.ca Tue May 29 12:38:10 2018 From: lasso at queensu.ca (Andras Lasso) Date: Tue, 29 May 2018 16:38:10 +0000 Subject: [vtkusers] Contouring on multiple slice In-Reply-To: <1527608663182-0.post@n5.nabble.com> References: <1527263784933-0.post@n5.nabble.com> <1527608663182-0.post@n5.nabble.com> Message-ID: 3D Slicer is solid enough to be used on patients during various clinical procedures (under IRB approval) and as basis of several commercial products - in large part because of high quality of underlying libraries, such as VTK. If you build an application that uses VTK, ITK, DCMTK, Qt, and Python then your application's source code is 95% common with 3D Slicer. Slicer just adds a framework and many useful components so that you can easily use these libraries in a single application for medical image computing and computer aided interventions. Source code is available here: https://github.com/Slicer/Slicer Andras -----Original Message----- From: vtkusers On Behalf Of Itsme Sent: Tuesday, May 29, 2018 11:44 AM To: vtkusers at vtk.org Subject: Re: [vtkusers] Contouring on multiple slice Hii Thanks for the suggestion. I'm trying to use only vtk. And slicer 3d which is my option is not providing solid code. I was not able to find their implementations. Please suggest or provide some real valued suggestions and samples. -- 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%7C802e64cfea044d865b3a08d5c57b0e86%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636632054678037062&sdata=B%2BZZ0oUZnnx9RfBBBnP%2FsdbY%2BQYPbpnDJTRYhK0I9O8%3D&reserved=0 _______________________________________________ Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7C802e64cfea044d865b3a08d5c57b0e86%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636632054678037062&sdata=PqDr9zBUFdeYwKzq%2FvPNQ%2F8bN8PTKqM7K5%2BJNdqi0lQ%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%7C802e64cfea044d865b3a08d5c57b0e86%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636632054678037062&sdata=ur%2FwQPKv2%2ButWL8pkng%2FuZ%2FOwzgCbFB2nDlQzO4Hyyw%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%7C802e64cfea044d865b3a08d5c57b0e86%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636632054678037062&sdata=hJ7%2BOJrmjYzT8pFUgtmgc60sDV%2BYujTrg%2Bc0uWXvSL4%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%7C802e64cfea044d865b3a08d5c57b0e86%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636632054678037062&sdata=81ELDv73zq9xXSGlCoMoYgotIiIWyGiX8OkmcrTPlME%3D&reserved=0 Follow this link to subscribe/unsubscribe: https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk.org%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%7C802e64cfea044d865b3a08d5c57b0e86%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636632054678037062&sdata=0h94TsY6N%2BaCOAeVcWgJSbTrs4OVyGRLG1g%2FJ9up1Dk%3D&reserved=0 From Sateeshlearner at gmail.com Tue May 29 13:20:44 2018 From: Sateeshlearner at gmail.com (Itsme) Date: Tue, 29 May 2018 10:20:44 -0700 (MST) Subject: [vtkusers] Contouring on multiple slice In-Reply-To: References: <1527263784933-0.post@n5.nabble.com> <1527608663182-0.post@n5.nabble.com> Message-ID: <1527614444292-0.post@n5.nabble.com> Hii andras I've already gone through 3dslicer source code. But the schematic of codes is a little bit hard. I mean im new to these type of arrangement. Your help will be highly appreciated if you help me finding exact files for contouring. Cheers, Itsme. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From marc.ruiz+vtk at gmail.com Tue May 29 13:33:40 2018 From: marc.ruiz+vtk at gmail.com (Marc Ruiz Altisent) Date: Tue, 29 May 2018 19:33:40 +0200 Subject: [vtkusers] vtkSmartVolumeMapper doesn't properly handle input changes In-Reply-To: References: Message-ID: Done: https://gitlab.kitware.com/vtk/vtk/issues/17328 Thanks Missatge de David E DeMarle del dia dt., 29 de maig 2018 a les 18:18: > Yes please do file a bug report on gitlab issue tracker. > > Thanks > > > David E DeMarle > Kitware, Inc. > Principal Engineer > 21 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-881-4909 > > On Mon, May 28, 2018 at 7:55 AM, Marc Ruiz Altisent < > marc.ruiz+vtk at gmail.com> wrote: > >> Should I create a new issue for this in the bug tracker? >> >> Missatge de Marc Ruiz Altisent del dia dc., 23 >> de maig 2018 a les 19:29: >> >>> Hi everyone, >>> >>> I have found an issue with vtkSmartVolumeMapper. If you create several >>> vtkImageData objects, set one of them as the input of the mapper and >>> render, then you won't be able to render one of the others at a later time: >>> if you set one of the others as input the mapper will keep rendering the >>> first one. >>> >>> The issue is in the method vtkSmartVolumeMapper::ConnectMapperInput. It >>> doesn't pass the original input to its internal mapper, but a shallow copy >>> of it. The first time it will always perform the shallow copy, but >>> afterwards it will only do it if the new input has been modified after >>> creating the previous shallow copy, which is not always the case (e.g. if >>> you create all the data before the first render). >>> >>> Possible workarounds are to call Modified() on the input data when >>> setting a new one or to create a new mapper each time. >>> >>> Below is a sample program (adapted from a couple of examples) to proof >>> the issue. Pressing 1 or 2 alternates between 2 datasets but only the first >>> one is always rendered. Uncommenting the 2 Modified() calls makes it work >>> as expected. >>> >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> >>> // Define interaction style >>> class KeyPressInteractorStyle : public vtkInteractorStyleTrackballCamera >>> { >>> public: >>> static KeyPressInteractorStyle* New(); >>> vtkTypeMacro(KeyPressInteractorStyle, >>> vtkInteractorStyleTrackballCamera); >>> >>> virtual void OnKeyPress() >>> { >>> // Get the keypress >>> vtkRenderWindowInteractor *rwi = this->Interactor; >>> std::string key = rwi->GetKeySym(); >>> >>> if(key == "1") >>> { >>> mapper->SetInputData(imageData1); >>> //imageData1->Modified(); >>> rwi->Render(); >>> } >>> else if(key == "2") >>> { >>> mapper->SetInputData(imageData2); >>> //imageData2->Modified(); >>> rwi->Render(); >>> } >>> >>> // Forward events >>> vtkInteractorStyleTrackballCamera::OnKeyPress(); >>> } >>> vtkSmartPointer mapper; >>> vtkSmartPointer imageData1, imageData2; >>> }; >>> vtkStandardNewMacro(KeyPressInteractorStyle); >>> >>> static void CreateImageData(vtkImageData* im, bool); >>> >>> int main(int argc, char *argv[]) >>> { >>> vtkSmartPointer imageData = >>> vtkSmartPointer::New(); >>> vtkSmartPointer imageData2 = >>> vtkSmartPointer::New(); >>> >>> CreateImageData(imageData, true); >>> CreateImageData(imageData2, false); >>> >>> vtkSmartPointer renWin = >>> vtkSmartPointer::New(); >>> vtkSmartPointer ren1 = >>> vtkSmartPointer::New(); >>> ren1->SetBackground(0.1,0.4,0.2); >>> >>> renWin->AddRenderer(ren1); >>> >>> renWin->SetSize(301,300); // intentional odd and NPOT width/height >>> >>> vtkSmartPointer iren = >>> vtkSmartPointer::New(); >>> iren->SetRenderWindow(renWin); >>> >>> vtkSmartPointer style = >>> vtkSmartPointer::New(); >>> iren->SetInteractorStyle(style); >>> style->SetCurrentRenderer(ren1); >>> >>> renWin->Render(); // make sure we have an OpenGL context. >>> >>> vtkSmartPointer volumeMapper = >>> vtkSmartPointer::New(); >>> volumeMapper->SetBlendModeToComposite(); // composite first >>> volumeMapper->SetInputData(imageData); >>> vtkSmartPointer volumeProperty = >>> vtkSmartPointer::New(); >>> volumeProperty->ShadeOff(); >>> volumeProperty->SetInterpolationType(VTK_LINEAR_INTERPOLATION); >>> >>> style->mapper = volumeMapper; >>> style->imageData1 = imageData; >>> style->imageData2 = imageData2; >>> >>> vtkSmartPointer compositeOpacity = >>> vtkSmartPointer::New(); >>> compositeOpacity->AddPoint(0.0,0.0); >>> compositeOpacity->AddPoint(80.0,1.0); >>> compositeOpacity->AddPoint(80.1,0.0); >>> compositeOpacity->AddPoint(255.0,0.0); >>> volumeProperty->SetScalarOpacity(compositeOpacity); // composite first. >>> >>> vtkSmartPointer color = >>> vtkSmartPointer::New(); >>> color->AddRGBPoint(0.0 ,0.0,0.0,1.0); >>> color->AddRGBPoint(40.0 ,1.0,0.0,0.0); >>> color->AddRGBPoint(255.0,1.0,1.0,1.0); >>> volumeProperty->SetColor(color); >>> >>> vtkSmartPointer volume = >>> vtkSmartPointer::New(); >>> volume->SetMapper(volumeMapper); >>> volume->SetProperty(volumeProperty); >>> ren1->AddViewProp(volume); >>> ren1->ResetCamera(); >>> >>> // Render composite. In default mode. For coverage. >>> renWin->Render(); >>> >>> iren->Start(); >>> >>> return EXIT_SUCCESS; >>> } >>> >>> void CreateImageData(vtkImageData* imageData, bool spherical) >>> { >>> vtkSmartPointer implicitFunction; >>> >>> if (spherical) >>> { >>> vtkSmartPointer sphere = >>> vtkSmartPointer::New(); >>> sphere->SetRadius(0.1); >>> sphere->SetCenter(0.0,0.0,0.0); >>> implicitFunction = sphere; >>> } >>> else >>> { >>> vtkSmartPointer box = >>> vtkSmartPointer::New(); >>> box->SetBounds(-0.1, 0.1, -0.1, 0.1, -0.1, 0.1); >>> implicitFunction = box; >>> } >>> >>> vtkSmartPointer sampleFunction = >>> vtkSmartPointer::New(); >>> sampleFunction->SetImplicitFunction(implicitFunction); >>> sampleFunction->SetOutputScalarTypeToDouble(); >>> sampleFunction->SetSampleDimensions(127,127,127); // intentional NPOT >>> dimensions. >>> sampleFunction->SetModelBounds(-1.0,1.0,-1.0,1.0,-1.0,1.0); >>> sampleFunction->SetCapping(false); >>> sampleFunction->SetComputeNormals(false); >>> sampleFunction->SetScalarArrayName("values"); >>> sampleFunction->Update(); >>> >>> vtkDataArray* a = >>> sampleFunction->GetOutput()->GetPointData()->GetScalars("values"); >>> double range[2]; >>> a->GetRange(range); >>> >>> vtkSmartPointer t = >>> vtkSmartPointer::New(); >>> t->SetInputConnection(sampleFunction->GetOutputPort()); >>> >>> t->SetShift(-range[0]); >>> double magnitude=range[1]-range[0]; >>> if(magnitude==0.0) >>> { >>> magnitude=1.0; >>> } >>> t->SetScale(255.0/magnitude); >>> t->SetOutputScalarTypeToUnsignedChar(); >>> >>> t->Update(); >>> >>> imageData->ShallowCopy(t->GetOutput()); >>> } >>> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://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: >> https://vtk.org/mailman/listinfo/vtkusers >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lasso at queensu.ca Tue May 29 13:47:03 2018 From: lasso at queensu.ca (Andras Lasso) Date: Tue, 29 May 2018 17:47:03 +0000 Subject: [vtkusers] Contouring on multiple slice In-Reply-To: <1527614444292-0.post@n5.nabble.com> References: <1527263784933-0.post@n5.nabble.com> <1527608663182-0.post@n5.nabble.com> <1527614444292-0.post@n5.nabble.com> Message-ID: I would be happy to provide further details, but probably it would be more appropriate to continue this on the Slicer forum (https://discourse.slicer.org/). Andras -----Original Message----- From: vtkusers On Behalf Of Itsme Sent: Tuesday, May 29, 2018 1:21 PM To: vtkusers at vtk.org Subject: Re: [vtkusers] Contouring on multiple slice Hii andras I've already gone through 3dslicer source code. But the schematic of codes is a little bit hard. I mean im new to these type of arrangement. Your help will be highly appreciated if you help me finding exact files for contouring. Cheers, Itsme. -- 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%7Cfe390888bce140fbece708d5c58885bb%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636632112509854369&sdata=6z9F%2BeWjWfREpT23gWj5R%2B6lAlR%2B0kO9ZyZxkY9%2BpX4%3D&reserved=0 _______________________________________________ Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7Cfe390888bce140fbece708d5c58885bb%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636632112509854369&sdata=1i2Nqd9uB%2BG%2BbYTSsML4EGzHvHu4ltNRASKvLrUbikk%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%7Cfe390888bce140fbece708d5c58885bb%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636632112509854369&sdata=e3YccuIlyZ54ubUgClNppMEq9ndrLOIw3xjsIuNBo4c%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%7Cfe390888bce140fbece708d5c58885bb%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636632112509854369&sdata=ifcddwNJjVZd3ohzqz2uVyLlAwuE6CzXn%2BI7bhUB0kY%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%7Cfe390888bce140fbece708d5c58885bb%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636632112509864385&sdata=4rVNbHSD6YmOKnoDKjcOikfuWea0WfS6I5xCoAKT3%2Fo%3D&reserved=0 Follow this link to subscribe/unsubscribe: https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%7Cfe390888bce140fbece708d5c58885bb%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636632112509864385&sdata=TvujL%2FU3KX7HXwJWrcmTvD2%2FaLJgcJvfOUSuY%2B4sFD0%3D&reserved=0 From zmanvortex at gmail.com Tue May 29 14:13:42 2018 From: zmanvortex at gmail.com (zmantorn) Date: Tue, 29 May 2018 11:13:42 -0700 (MST) Subject: [vtkusers] Deprecate vtkGeo* classes (Sankhesh Jhaveri) In-Reply-To: References: Message-ID: <1527617622636-0.post@n5.nabble.com> I use several of these classes in my weather radar application. I use vtkGlobeSource to visualize the curvature of the earth with respect to the radar data. I also use vtkGeoAssignCoordinates to convert my map data (roads, cities) from lat,lon coordinates into world coordinates. I realize I may be the only one using these classes, but if they were deprecated I would have 3 options: 1. Quit using the latest vtk sources and stick with the last release that supported these classes. 2. Have a custom version of vtk that included the classes I use (I would have to repeat this with every vtk release). 3. Quit using vtk and look for another library that supports earth rendering features. Thanks. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From dave.demarle at kitware.com Tue May 29 14:22:13 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Tue, 29 May 2018 14:22:13 -0400 Subject: [vtkusers] Deprecate vtkGeo* classes (Sankhesh Jhaveri) In-Reply-To: <1527617622636-0.post@n5.nabble.com> References: <1527617622636-0.post@n5.nabble.com> Message-ID: Option 4 - move these to the external module framework and set up a regression test submitter. That is much like option 2 except the hassle of maintaining code compatibility as VTK evolves is (hopefully) shared and lessened among many. David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Tue, May 29, 2018 at 2:13 PM, zmantorn wrote: > I use several of these classes in my weather radar application. I use > vtkGlobeSource to visualize the curvature of the earth with respect to the > radar data. I also use vtkGeoAssignCoordinates to convert my map data > (roads, cities) from lat,lon coordinates into world coordinates. I realize > I > may be the only one using these classes, but if they were deprecated I > would > have 3 options: 1. Quit using the latest vtk sources and stick with the > last > release that supported these classes. 2. Have a custom version of vtk that > included the classes I use (I would have to repeat this with every vtk > release). 3. Quit using vtk and look for another library that supports > earth > rendering features. > > Thanks. > > > > -- > 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: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zmanvortex at gmail.com Tue May 29 14:28:06 2018 From: zmanvortex at gmail.com (zmantorn) Date: Tue, 29 May 2018 11:28:06 -0700 (MST) Subject: [vtkusers] Deprecate vtkGeo* classes (Sankhesh Jhaveri) In-Reply-To: References: <1527617622636-0.post@n5.nabble.com> Message-ID: <1527618486169-0.post@n5.nabble.com> Option 4 sounds like the correct way to go. What steps can I take to make this happen? Thanks, -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From aashish.chaudhary at kitware.com Tue May 29 14:53:10 2018 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Tue, 29 May 2018 14:53:10 -0400 Subject: [vtkusers] Deprecate vtkGeo* classes (Sankhesh Jhaveri) In-Reply-To: <1527618486169-0.post@n5.nabble.com> References: <1527617622636-0.post@n5.nabble.com> <1527618486169-0.post@n5.nabble.com> Message-ID: Hi Donny, Would it be possible for you to share your work with us? (Source code, articles etc?). One option we are thinking that we could keep only the classes that you are using (which would still mean few more than we originally thought). Part of this email is also to know if there are community users still willing to use C++ VTK code for geospatial visualization so we will try to keep what is usable. - aashish On Tue, May 29, 2018 at 2:28 PM zmantorn wrote: > Option 4 sounds like the correct way to go. What steps can I take to make > this happen? > > Thanks, > > > > -- > 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: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zmanvortex at gmail.com Tue May 29 15:19:52 2018 From: zmanvortex at gmail.com (zmantorn) Date: Tue, 29 May 2018 12:19:52 -0700 (MST) Subject: [vtkusers] Deprecate vtkGeo* classes (Sankhesh Jhaveri) In-Reply-To: References: <1527617622636-0.post@n5.nabble.com> <1527618486169-0.post@n5.nabble.com> Message-ID: <1527621592853-0.post@n5.nabble.com> This has been a work in progress for about 10 years. I have not been able to work on it as much as I would like the last few years, but my oldest just graduated high school so I am hoping to get back to work on it. It is a 3D application written in C++ and C# that shows near real time high resolution radar data by radar angle sweeps and by visualizing a volume of all sweep angles. It is important to show the radar sweep in relation to the curvature of the earth since the radar beam does not follow the curve of the earth. I am not sure what you mean by share my work with you? Do you mean share my entire code base with the community? Share the geo parts only? Unfortunately this software is kind of a hobby at this time so there are not any articles published. Thanks. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From bjhulsey at gmail.com Tue May 29 18:21:04 2018 From: bjhulsey at gmail.com (B.J. Hulsey) Date: Tue, 29 May 2018 17:21:04 -0500 Subject: [vtkusers] PyPi Wheels for VTK 8.1.0 Message-ID: Hello, world. I've been struggling to install VTK on CentOS 7.2 for several days. I've followed several recommendations on the web, including this one point to from the VTK FAQ: https://www.paraview.org/Wiki/ParaView/ParaView_And_Mesa_3D. In most cases I end up with the following OpenGL2 error no matter which version of Mesa is installed: ERROR: In /work/standalone-x64-build/VTK-source/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, line 797 vtkXOpenGLRenderWindow (0x18f1c10): GL version 2.1 with the gpu_shader4 extension is not supported by your graphics driver but is required for the new OpenGL rendering backend. Please update your OpenGL driver. If you are using Mesa please make sure you have version 10.6.5 or later and make sure your driver in Mesa supports OpenGL 3.2. In any case, I found the PyPi wheels for 8.1.0 and simply installed with pip. I am still getting the OpenGL2 error when using Python 3.5, but the code runs under Python 2.7 (system version). glxinfo reports: OpenGL vendor string: VMware, Inc. OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.6, 128 bits) OpenGL version string: 2.1 Mesa 10.6.5 OpenGL shading language version string: 1.30 Any pointers? According to https://prabhuramachandran.blogspot.com/2018/01/vtk-810-wheels-for-all-platforms-on-pypi.html this should work for Python 3.5.x. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chuck.atkins at kitware.com Tue May 29 18:26:31 2018 From: chuck.atkins at kitware.com (Chuck Atkins) Date: Tue, 29 May 2018 18:26:31 -0400 Subject: [vtkusers] PyPi Wheels for VTK 8.1.0 In-Reply-To: References: Message-ID: With older versions of Mesa you need to forcibly override the opengl version reported. Trying setting the environment variable MESA_GL_VERSION_OVERRIDE=3.2 . - Chuck On Tue, May 29, 2018, 18:21 B.J. Hulsey wrote: > Hello, world. > > I've been struggling to install VTK on CentOS 7.2 for several days. I've > followed several recommendations on the web, including this one point to > from the VTK FAQ: > https://www.paraview.org/Wiki/ParaView/ParaView_And_Mesa_3D. In most > cases I end up with the following OpenGL2 error no matter which version of > Mesa is installed: > > ERROR: In > /work/standalone-x64-build/VTK-source/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, > line 797 > vtkXOpenGLRenderWindow (0x18f1c10): GL version 2.1 with the gpu_shader4 > extension is not supported by your graphics driver but is required for the > new OpenGL rendering backend. Please update your OpenGL driver. If you are > using Mesa please make sure you have version 10.6.5 or later and make sure > your driver in Mesa supports OpenGL 3.2. > > > In any case, I found the PyPi wheels for 8.1.0 and simply installed with > pip. I am still getting the OpenGL2 error when using Python 3.5, but the > code runs under Python 2.7 (system version). > > glxinfo reports: > OpenGL vendor string: VMware, Inc. > OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.6, 128 bits) > OpenGL version string: 2.1 Mesa 10.6.5 > OpenGL shading language version string: 1.30 > > Any pointers? According to > https://prabhuramachandran.blogspot.com/2018/01/vtk-810-wheels-for-all-platforms-on-pypi.html > this should work for Python 3.5.x. > > Thanks. > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.amaclean at gmail.com Tue May 29 18:39:32 2018 From: andrew.amaclean at gmail.com (Andrew Maclean) Date: Wed, 30 May 2018 08:39:32 +1000 Subject: [vtkusers] Understanding vtkSmartPointers In-Reply-To: References: Message-ID: Hi Marcus, This is a very clear and succinct explanation of the usage of ? vtkNew / ? vtkSmartPointer / ? vtkWeakPointer . If you have time would it be possible to do a nice C++11 demonstration example to be added into VTK Examples? I have a suspicion that this will be an issue arising again and again. I'll be glad to help. Personally (like Bill) I have never liked: .GetPointer()/.Get() in vtkNew so I haven't used it much. However ... since it implicitly returns the pointer now, I'll probably use it more. Rgeards Andrew > > > ---------- Forwarded message ---------- > From: "Marcus D. Hanwell" > To: Fcs > Cc: VTK Users > Bcc: > Date: Mon, 28 May 2018 10:12:24 -0400 > Subject: Re: [vtkusers] Understanding vtkSmartPointers > On Mon, May 28, 2018 at 7:43 AM, Fcs wrote: > >> Using VTK for one of our projects, we are encountering some memory leaks >> which, in time, cripple our system. So I'm trying to have a better >> understanding of the VTK pointers >> . >> >> It was my (erroneous..?) belief that the *vtkSmartPointer*s would destroy >> the object they were holding when getting out of scope. Carefully reading >> the kitware blog post linked hereinabove, and playing around with a test >> code (code sample below), I now understand that it is objects held by >> *vtkNew* that will be destroyed when out-of-scope, and that >> *vtkSmartPointer*s, on the contrary, will keep them alive as long as the >> reference count is non-zero. Is this correct? >> > > No, that is not correct. The vtkNew class instantiates a vtkObject derived > instance and will decrement its reference count when it goes out of scope. > You can still store what was created by vtkNew in a vtkSmartPointer, > increasing the reference count to two, and keeping that object alive even > when the containing vtkNew goes out of scope. > > In its simplest form, if you don't use other smart pointer classes with it > then vtkNew acts much like a stack allocated object, where the object > created is automatically deleted when it goes out of scope. You must > remember that all vtkObject derived classes are implicitly reference > counted - it is built into the API. The smart pointer classes just take > care of incremementing/decrementing the reference count. > >> >> Now, from a practical point of view: does this mean that I can, in a >> class, >> create an entire VTK pipeline with *vtkSmartPointer*s, and only store the >> latest object in a member variable to keep every object alive (So, in my >> code below, only bookkeep the object returned by applyFilters())? And >> that >> when I'm finished, I can call ->Delete() on that object to clean-up the >> entire pipeline? Is this a good practice? Until now, I was painstakingly >> storing every object created for the lifetime of a pipeline, and I would >> like to know if I can simplify my code.. >> >> In my opinion you should aim to never call Delete, but to have a smart > pointer contain the things needed. I think all pipeline API will increase > the reference count, and so you only usually need to keep a reference to > the pipeline objects you are going to keep around/use. The debug leaks code > will help you verify you got it right. > > I would add that we have found in bigger applications that a passing debug > leaks is not always enough, ensuring objects are deleted when they are done > with is more difficult but necessary, especially in graphical applications > that might run for some time. My honest summary of using the smart pointers > (in classes, local code, etc) is: > > ?? > vtkNew - when you will instantiate the object, and want to keep a strong > reference (you can't change what instance a vtkNew variable points to) > > ?? > vtkSmartPointer - when you might create, or use an instance passed in, and > ensure it stays around for when you want to make calls. Assigning a > different instance to one will decrement the one it points to before > switching it to point to the new instance and incrementing. > > ?? > vtkWeakPointer - when you want to call API if something is still around, > check for nullptr before using, will not affect reference count. > > I think I wrote something similar back then. Whenever I see code like > > vtkSmartPointer renderer = > vtkSmartPointer::New(); > > I want to replace it with > > vtkNew renderer; > > It does the exact same thing with no repetition, and is clearer. The > examples require backwards compatibility with older VTK, and I don't think > Bill liked calling .GetPointer()/.Get() on the vtkNew object. You no longer > have to do that, but it is a more recent addition to the vtkNew API - it > will implicitly return the pointer to the contained object as > vtkSmartPointer does. > > Hopefully this makes things a little clearer. At the end of the day all > vtkObject derived classes (read most of the vtk* classes) are implicitly > reference counted, the choice of vtkNew/vtkSmartPointer should be made > depending upon how those instances will be used in your code - both will > decrement the reference count by one when they go out of scope. > > Marcus > > > > ---------- Forwarded message ---------- > From: David Thompson > To: "Marcus D. Hanwell" > Cc: Fcs , VTK Users > Bcc: > Date: Mon, 28 May 2018 10:30:06 -0400 > Subject: Re: [vtkusers] Understanding vtkSmartPointers > > ... > > I think I wrote something similar back then. Whenever I see code like > > > > vtkSmartPointer renderer = > vtkSmartPointer::New(); > > > > I want to replace it with > > > > vtkNew renderer; > > With c++11, you can also say > > auto renderer = vtkSmartPointer::New(); > > which cleans up the smart-pointer case a little bit. > > David > > > > ---------- Forwarded message ---------- > From: "Marcus D. Hanwell" > To: David Thompson > Cc: Fcs , VTK Users > Bcc: > Date: Mon, 28 May 2018 10:50:35 -0400 > Subject: Re: [vtkusers] Understanding vtkSmartPointers > On Mon, May 28, 2018 at 10:30 AM, David Thompson < > david.thompson at kitware.com> wrote: > >> > ... >> > I think I wrote something similar back then. Whenever I see code like >> > >> > vtkSmartPointer renderer = >> vtkSmartPointer::New(); >> > >> > I want to replace it with >> > >> > vtkNew renderer; >> >> With c++11, you can also say >> >> auto renderer = vtkSmartPointer::New(); >> >> which cleans up the smart-pointer case a little bit. >> >> For sure, although in the case of class member variables it doesn't help, > and I would argue vtkNew is cleaner (and vtkNew still uses far fewer > characters, you got to preserve the finite resources on disk :P ). > > > > ---------- Forwarded message ---------- > From: Fcs > To: vtkusers at vtk.org > Cc: > Bcc: > Date: Mon, 28 May 2018 08:45:51 -0700 (MST) > Subject: Re: [vtkusers] Understanding vtkSmartPointers > Dear Mathieu, Marcus and David, thank you for your replies and tips, with a > special thank to Marcus for his extensive explanations which really > clarified a few of the subtleties of the VTK pointers. > > Marcus, I had few extra questions linked to your reply. > > > > I In my opinion you should aim to never call Delete, but to have a smart > > pointer contain the things needed. > > Is there any danger in calling Delete()? The case I had in mind was to > perhaps free the memory occupied by a big structured/unstructured grid > object which would need to live until a sub-grid is extracted from it. > > > > I think all pipeline API will increase > > the reference count, and so you only usually need to keep a reference to > > the pipeline objects you are going to keep around/use. The debug leaks > > code > > will help you verify you got it right. > > How good is the guarantee that this will work? "I think" and "usually" seem > to imply that my mileage might vary on this one.. :-) Does it mean that > this should work in general, but that perhaps some exotic or slightly buggy > newer features might not behave correctly? The use case I'm trying to > implement has a variable number of pre-definied filters which I'm chaining > together. If I test all the possible combinations, and they work, do I have > the guarantee they will always work? > > > > I would add that we have found in bigger applications that a passing > debug > > leaks is not always enough, ensuring objects are deleted when they are > > done with is more difficult but necessary, especially in graphical > > applications that might run for some time. > > Does this not imply that every vtkObject created should be stored and > deleted manually afterwards? Or are there other ways to detect living > vtkObjects when you don't have a direct member variable pointing to it? > (say, like the vtkPlane created in applyFilters() in my example code..) > > > > It does the exact same thing with no repetition, and is clearer. The > > examples require backwards compatibility with older VTK, and I don't > think > > Bill liked calling .GetPointer()/.Get() on the vtkNew object. You no > > longer have to do that, but it is a more recent addition to the vtkNew > API > > - it will implicitly return the pointer to the contained object as > > vtkSmartPointer does. > > Good to know! Starting from which version is the call to > .GetPointer()/.Get() no longer needed? We are developing in vtk 6 at the > moment, but we should update to a new version at some point in the near > future. > > Kind regards, > > Francois. > > > > > > > -- > 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: > https://vtk.org/mailman/listinfo/vtkusers > -- ___________________________________________ Andrew J. P. Maclean ___________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Tue May 29 20:11:55 2018 From: cory.quammen at kitware.com (Cory Quammen) Date: Tue, 29 May 2018 20:11:55 -0400 Subject: [vtkusers] Cannot use vtkConnectivty on GroupDataSet In-Reply-To: <1527067471692-0.post@n5.nabble.com> References: <1527067471692-0.post@n5.nabble.com> Message-ID: Robert, The GroupDatasets filter produces a vtkMultiBlockDataSet as output. A vtkMultiBlockDataSet is a tree with leaves consisting of vtkDataObjects. It is common for filters to operate on these data sets block-by-block, and vtkConnectivity is no exception. It essentially runs on each leaf vtkDataObject independently. As a consequence, different connected components in different blocks may be assigned the same RegionId. Unfortunately, this does not really make sense and is a bug. I have filed an issue here: https://gitlab.kitware.com/vtk/vtk/issues/17329. For you to make a test data set, however, you do not need to wait until the bug is fixed. Within ParaView use the Append Geometry filter instead of Group Datasets on your three input Spheres. This will produce a vtkPolyData as output that you can then set as input to the vtkConnectivity filter and get the output you expect. HTH, Cory On Wed, May 23, 2018 at 5:24 AM Robert Sawko wrote: > Hi, > > I am trying with ParaView to create a test data set for my VTK application. > I simply want three spheres with varying radius. The application operates > on > vtk contour plots that are produced by OpenFOAM. Using > vtkConnectivityFilter > it computes disjoint surfaces and then it iterates over each surface to > obtain mass properties: volume and surface area. > > In order to create my data set I use sources in ParaView to create three > disjoint spheres and I combine them into a single set by GroupDatasets > filter. Then I use SaveData and save into .vtm file format. If I try to > apply Connectivity on the group it find sonly one group even though spheres > are clearly disjoint. I tried various extract filters, but I am clearly > missing something. > > Connectivity does work on my "production" data, but just not my mock set > constructed through PV sources and GroupDatasets. I would like to > understand > why that happens and if there's a correct way of producing my three sphere > data set. > > Thanks. > > > > -- > 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: > https://vtk.org/mailman/listinfo/vtkusers > -- Cory Quammen Staff R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From moonmoon95 at naver.com Wed May 30 03:20:24 2018 From: moonmoon95 at naver.com (=?utf-8?B?67CV6riw7Jq0?=) Date: Wed, 30 May 2018 16:20:24 +0900 Subject: [vtkusers] =?utf-8?q?How_to_access_to_stl_coordinate=2E?= In-Reply-To: <7bb55cfc3e9c29893823c339c3c21d2@cweb23.nm.nhnsystem.com> References: <7bb55cfc3e9c29893823c339c3c21d2@cweb23.nm.nhnsystem.com> Message-ID: <4797aebfa0588c5cc2570138e674a52@cweb02.nm.nhnsystem.com> I did example which read STL format file example.(https://lorensen.github.io/VTKExamples/site/Cxx/IO/ReadSTL/) but I don't know how to access to this STL coordinate and where does it saved. There are function like decimation STL file(https://www.vtk.org/Wiki/VTK/Examples/Cxx/Meshes/Decimation) , so I think I can access to STL mesh coordinate. However I can't find where the mesh coordinate save. Where does coordinate saved and how can I access to this? Sincerely yours, thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Wed May 30 07:45:18 2018 From: cory.quammen at kitware.com (Cory Quammen) Date: Wed, 30 May 2018 07:45:18 -0400 Subject: [vtkusers] How to access to stl coordinate. In-Reply-To: <4797aebfa0588c5cc2570138e674a52@cweb02.nm.nhnsystem.com> References: <7bb55cfc3e9c29893823c339c3c21d2@cweb23.nm.nhnsystem.com> <4797aebfa0588c5cc2570138e674a52@cweb02.nm.nhnsystem.com> Message-ID: https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/PolyDataGetPoint/ On Wed, May 30, 2018 at 3:30 AM ??? wrote: > I did example which read STL format file example.( > https://lorensen.github.io/VTKExamples/site/Cxx/IO/ReadSTL/) > > > > but I don't know how to access to this STL coordinate and where does it > saved. > > > > There are function like decimation STL file( > https://www.vtk.org/Wiki/VTK/Examples/Cxx/Meshes/Decimation) > > > > , so I think I can access to STL mesh coordinate. > > > > > > However I can't find where the mesh coordinate save. > > > > Where does coordinate saved and how can I access to this? > > > > > > Sincerely yours, thanks. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -- Cory Quammen Staff R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aida.ninyerola at gmail.com Wed May 30 08:21:26 2018 From: aida.ninyerola at gmail.com (Aida Ninyerola) Date: Wed, 30 May 2018 14:21:26 +0200 Subject: [vtkusers] undefined reference Message-ID: Hi, While compiling my project I get some linking problems. tlQuantification.cpp:(.text+0x1623): undefined reference to `vtkPolyDataToImageStencil::New()' tlQuantification.cpp:(.text+0x162b): undefined reference to `vtkImageAccumulate::New()' tlQuantification.cpp:(.text+0x168e): undefined reference to `vtkImageAccumulate::SetStencilData(vtkImageStencilData*)' I found that I sould add in CmakeLists.txt the following lines but I doesn't work: if(VTK_LIBRARIES) target_link_libraries(quantification ${VTK_LIBRARIES} ) else() target_link_libraries(quantification vtkHybrid vtkWidgets) endif() I'm trying to compile and old project that work properly with a former VTK version (I can't remember the VTK version). I was thinking that maybe is a migration problem but I'm not able to find what I need to change. What I'm doing is clipping an image by a cylinder (m_rotate_tformer[id]) to calculate the mean activity of the image inside the cylinder. Maybe there is a better way to perform it. vtkPolyDataToImageStencil* sts = vtkPolyDataToImageStencil::New(); vtkImageAccumulate* act = vtkImageAccumulate::New(); sts->SetInputData(m_rotate_tformer[id]->GetPolyDataOutput()); sts->SetInformationInput(vtkInputImage.GetPointer()); sts->Update(); act->SetInputData(vtkInputImage.GetPointer()); act->SetStencilData(sts->GetOutput()); act->Update(); I'm running out of ideas. I'll appreciate any idea. Thanks, Aida -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc.ruiz+vtk at gmail.com Wed May 30 09:11:22 2018 From: marc.ruiz+vtk at gmail.com (Marc Ruiz Altisent) Date: Wed, 30 May 2018 15:11:22 +0200 Subject: [vtkusers] undefined reference In-Reply-To: References: Message-ID: Hi Aida, VTK changed to a modular system some time ago and the library names changed. You just need to find the new ones. The names match the directory containg the classes: for example vtkPolyDataToImageStencil is in Imaging/Stencil and the library is vtkImagingStencil, with a suffix of the VTK version, e.g. vtkImagingStencil-8.1. Similarly, for vtkImageAccumulate you need vtkImagingStatistics (+ suffix). Missatge de Aida Ninyerola del dia dc., 30 de maig 2018 a les 14:22: > Hi, > > While compiling my project I get some linking problems. > tlQuantification.cpp:(.text+0x1623): undefined reference to > `vtkPolyDataToImageStencil::New()' > tlQuantification.cpp:(.text+0x162b): undefined reference to > `vtkImageAccumulate::New()' > tlQuantification.cpp:(.text+0x168e): undefined reference to > `vtkImageAccumulate::SetStencilData(vtkImageStencilData*)' > > I found that I sould add in CmakeLists.txt the following lines but I > doesn't work: > if(VTK_LIBRARIES) > target_link_libraries(quantification ${VTK_LIBRARIES} ) > else() > target_link_libraries(quantification vtkHybrid vtkWidgets) > endif() > > I'm trying to compile and old project that work properly with a former VTK > version (I can't remember the VTK version). > > I was thinking that maybe is a migration problem but I'm not able to find > what I need to change. > > What I'm doing is clipping an image by a cylinder (m_rotate_tformer[id]) > to calculate the mean activity of the image inside the cylinder. Maybe > there is a better way to perform it. > > vtkPolyDataToImageStencil* sts = vtkPolyDataToImageStencil::New(); > vtkImageAccumulate* act = vtkImageAccumulate::New(); > > sts->SetInputData(m_rotate_tformer[id]->GetPolyDataOutput()); > sts->SetInformationInput(vtkInputImage.GetPointer()); > sts->Update(); > > act->SetInputData(vtkInputImage.GetPointer()); > act->SetStencilData(sts->GetOutput()); > act->Update(); > > I'm running out of ideas. I'll appreciate any idea. > > Thanks, > Aida > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://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: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bjhulsey at gmail.com Wed May 30 10:44:00 2018 From: bjhulsey at gmail.com (B.J. Hulsey) Date: Wed, 30 May 2018 09:44:00 -0500 Subject: [vtkusers] PyPi Wheels for VTK 8.1.0 In-Reply-To: References: Message-ID: Thanks but no dice. I tried many of the env variables Mesa suggests: https://www.mesa3d.org/envvars.html My goal is to run a python3/vtk UI on a remote Linux box with no graphics hardware from a Windows desktop. I'd also like decent performance. What is the recommended method (and versions) to optimize this setup? On Tue, May 29, 2018 at 5:26 PM, Chuck Atkins wrote: > With older versions of Mesa you need to forcibly override the opengl > version reported. Trying setting the environment variable > MESA_GL_VERSION_OVERRIDE=3.2 . > > - Chuck > > On Tue, May 29, 2018, 18:21 B.J. Hulsey wrote: > >> Hello, world. >> >> I've been struggling to install VTK on CentOS 7.2 for several days. I've >> followed several recommendations on the web, including this one point to >> from the VTK FAQ: https://www.paraview.org/Wiki/ >> ParaView/ParaView_And_Mesa_3D. In most cases I end up with the following >> OpenGL2 error no matter which version of Mesa is installed: >> >> ERROR: In /work/standalone-x64-build/VTK-source/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, >> line 797 >> vtkXOpenGLRenderWindow (0x18f1c10): GL version 2.1 with the gpu_shader4 >> extension is not supported by your graphics driver but is required for the >> new OpenGL rendering backend. Please update your OpenGL driver. If you are >> using Mesa please make sure you have version 10.6.5 or later and make sure >> your driver in Mesa supports OpenGL 3.2. >> >> >> In any case, I found the PyPi wheels for 8.1.0 and simply installed with >> pip. I am still getting the OpenGL2 error when using Python 3.5, but the >> code runs under Python 2.7 (system version). >> >> glxinfo reports: >> OpenGL vendor string: VMware, Inc. >> OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.6, 128 bits) >> OpenGL version string: 2.1 Mesa 10.6.5 >> OpenGL shading language version string: 1.30 >> >> Any pointers? According to https://prabhuramachandran. >> blogspot.com/2018/01/vtk-810-wheels-for-all-platforms-on-pypi.html this >> should work for Python 3.5.x. >> >> Thanks. >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at http://www.kitware.com/ >> opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> https://public.kitware.com/mailman/listinfo/vtkusers >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcus.hanwell at kitware.com Wed May 30 11:07:30 2018 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Wed, 30 May 2018 11:07:30 -0400 Subject: [vtkusers] Understanding vtkSmartPointers In-Reply-To: References: Message-ID: Hi Andrew, To the best of my knowledge the examples require backward compatibility, and so I couldn't show the "best" form for people who dislike calling .Get() until the minimum is bumped to VTK 8.1.0 I think. Most of my work is done on that, or even more recent SHAs, so I don't think about it too much. Is there an answer for this, can we make an example that requires 8.1+, as we add more new features it seems like a reasonable request. I am really swamped right now, but was hoping to get to some charting examples too. Thanks, Marcus On Tue, May 29, 2018 at 6:39 PM, Andrew Maclean wrote: > Hi Marcus, > This is a very clear and succinct explanation of the usage of > ? > vtkNew / > ? > vtkSmartPointer / > ? > vtkWeakPointer . > If you have time would it be possible to do a nice C++11 demonstration > example to be added into VTK Examples? > I have a suspicion that this will be an issue arising again and again. > > I'll be glad to help. > > Personally (like Bill) I have never liked: .GetPointer()/.Get() in > vtkNew so I haven't used it much. However ... since it implicitly returns > the pointer now, I'll probably use it more. > > Rgeards > Andrew > > > >> >> >> ---------- Forwarded message ---------- >> From: "Marcus D. Hanwell" >> To: Fcs >> Cc: VTK Users >> Bcc: >> Date: Mon, 28 May 2018 10:12:24 -0400 >> Subject: Re: [vtkusers] Understanding vtkSmartPointers >> On Mon, May 28, 2018 at 7:43 AM, Fcs wrote: >> >>> Using VTK for one of our projects, we are encountering some memory leaks >>> which, in time, cripple our system. So I'm trying to have a better >>> understanding of the VTK pointers >>> . >>> >>> It was my (erroneous..?) belief that the *vtkSmartPointer*s would destroy >>> the object they were holding when getting out of scope. Carefully >>> reading >>> the kitware blog post linked hereinabove, and playing around with a test >>> code (code sample below), I now understand that it is objects held by >>> *vtkNew* that will be destroyed when out-of-scope, and that >>> *vtkSmartPointer*s, on the contrary, will keep them alive as long as the >>> reference count is non-zero. Is this correct? >>> >> >> No, that is not correct. The vtkNew class instantiates a vtkObject >> derived instance and will decrement its reference count when it goes out of >> scope. You can still store what was created by vtkNew in a vtkSmartPointer, >> increasing the reference count to two, and keeping that object alive even >> when the containing vtkNew goes out of scope. >> >> In its simplest form, if you don't use other smart pointer classes with >> it then vtkNew acts much like a stack allocated object, where the object >> created is automatically deleted when it goes out of scope. You must >> remember that all vtkObject derived classes are implicitly reference >> counted - it is built into the API. The smart pointer classes just take >> care of incremementing/decrementing the reference count. >> >>> >>> Now, from a practical point of view: does this mean that I can, in a >>> class, >>> create an entire VTK pipeline with *vtkSmartPointer*s, and only store the >>> latest object in a member variable to keep every object alive (So, in my >>> code below, only bookkeep the object returned by applyFilters())? And >>> that >>> when I'm finished, I can call ->Delete() on that object to clean-up the >>> entire pipeline? Is this a good practice? Until now, I was >>> painstakingly >>> storing every object created for the lifetime of a pipeline, and I would >>> like to know if I can simplify my code.. >>> >>> In my opinion you should aim to never call Delete, but to have a smart >> pointer contain the things needed. I think all pipeline API will increase >> the reference count, and so you only usually need to keep a reference to >> the pipeline objects you are going to keep around/use. The debug leaks code >> will help you verify you got it right. >> >> I would add that we have found in bigger applications that a passing >> debug leaks is not always enough, ensuring objects are deleted when they >> are done with is more difficult but necessary, especially in graphical >> applications that might run for some time. My honest summary of using the >> smart pointers (in classes, local code, etc) is: >> >> ?? >> vtkNew - when you will instantiate the object, and want to keep a strong >> reference (you can't change what instance a vtkNew variable points to) >> >> ?? >> vtkSmartPointer - when you might create, or use an instance passed in, >> and ensure it stays around for when you want to make calls. Assigning a >> different instance to one will decrement the one it points to before >> switching it to point to the new instance and incrementing. >> >> ?? >> vtkWeakPointer - when you want to call API if something is still around, >> check for nullptr before using, will not affect reference count. >> >> I think I wrote something similar back then. Whenever I see code like >> >> vtkSmartPointer renderer = vtkSmartPointer:: >> New(); >> >> I want to replace it with >> >> vtkNew renderer; >> >> It does the exact same thing with no repetition, and is clearer. The >> examples require backwards compatibility with older VTK, and I don't think >> Bill liked calling .GetPointer()/.Get() on the vtkNew object. You no longer >> have to do that, but it is a more recent addition to the vtkNew API - it >> will implicitly return the pointer to the contained object as >> vtkSmartPointer does. >> >> Hopefully this makes things a little clearer. At the end of the day all >> vtkObject derived classes (read most of the vtk* classes) are implicitly >> reference counted, the choice of vtkNew/vtkSmartPointer should be made >> depending upon how those instances will be used in your code - both will >> decrement the reference count by one when they go out of scope. >> >> Marcus >> >> >> >> ---------- Forwarded message ---------- >> From: David Thompson >> To: "Marcus D. Hanwell" >> Cc: Fcs , VTK Users >> Bcc: >> Date: Mon, 28 May 2018 10:30:06 -0400 >> Subject: Re: [vtkusers] Understanding vtkSmartPointers >> > ... >> > I think I wrote something similar back then. Whenever I see code like >> > >> > vtkSmartPointer renderer = vtkSmartPointer:: >> New(); >> > >> > I want to replace it with >> > >> > vtkNew renderer; >> >> With c++11, you can also say >> >> auto renderer = vtkSmartPointer::New(); >> >> which cleans up the smart-pointer case a little bit. >> >> David >> >> >> >> >> ---------- Forwarded message ---------- >> From: "Marcus D. Hanwell" >> To: David Thompson >> Cc: Fcs , VTK Users >> Bcc: >> Date: Mon, 28 May 2018 10:50:35 -0400 >> Subject: Re: [vtkusers] Understanding vtkSmartPointers >> On Mon, May 28, 2018 at 10:30 AM, David Thompson < >> david.thompson at kitware.com> wrote: >> >>> > ... >>> > I think I wrote something similar back then. Whenever I see code like >>> > >>> > vtkSmartPointer renderer = vtkSmartPointer:: >>> New(); >>> > >>> > I want to replace it with >>> > >>> > vtkNew renderer; >>> >>> With c++11, you can also say >>> >>> auto renderer = vtkSmartPointer::New(); >>> >>> which cleans up the smart-pointer case a little bit. >>> >>> For sure, although in the case of class member variables it doesn't >> help, and I would argue vtkNew is cleaner (and vtkNew still uses far fewer >> characters, you got to preserve the finite resources on disk :P ). >> >> >> >> ---------- Forwarded message ---------- >> From: Fcs >> To: vtkusers at vtk.org >> Cc: >> Bcc: >> Date: Mon, 28 May 2018 08:45:51 -0700 (MST) >> Subject: Re: [vtkusers] Understanding vtkSmartPointers >> Dear Mathieu, Marcus and David, thank you for your replies and tips, with >> a >> special thank to Marcus for his extensive explanations which really >> clarified a few of the subtleties of the VTK pointers. >> >> Marcus, I had few extra questions linked to your reply. >> >> >> > I In my opinion you should aim to never call Delete, but to have a smart >> > pointer contain the things needed. >> >> Is there any danger in calling Delete()? The case I had in mind was to >> perhaps free the memory occupied by a big structured/unstructured grid >> object which would need to live until a sub-grid is extracted from it. >> >> >> > I think all pipeline API will increase >> > the reference count, and so you only usually need to keep a reference to >> > the pipeline objects you are going to keep around/use. The debug leaks >> > code >> > will help you verify you got it right. >> >> How good is the guarantee that this will work? "I think" and "usually" >> seem >> to imply that my mileage might vary on this one.. :-) Does it mean that >> this should work in general, but that perhaps some exotic or slightly >> buggy >> newer features might not behave correctly? The use case I'm trying to >> implement has a variable number of pre-definied filters which I'm chaining >> together. If I test all the possible combinations, and they work, do I >> have >> the guarantee they will always work? >> >> >> > I would add that we have found in bigger applications that a passing >> debug >> > leaks is not always enough, ensuring objects are deleted when they are >> > done with is more difficult but necessary, especially in graphical >> > applications that might run for some time. >> >> Does this not imply that every vtkObject created should be stored and >> deleted manually afterwards? Or are there other ways to detect living >> vtkObjects when you don't have a direct member variable pointing to it? >> (say, like the vtkPlane created in applyFilters() in my example code..) >> >> >> > It does the exact same thing with no repetition, and is clearer. The >> > examples require backwards compatibility with older VTK, and I don't >> think >> > Bill liked calling .GetPointer()/.Get() on the vtkNew object. You no >> > longer have to do that, but it is a more recent addition to the vtkNew >> API >> > - it will implicitly return the pointer to the contained object as >> > vtkSmartPointer does. >> >> Good to know! Starting from which version is the call to >> .GetPointer()/.Get() no longer needed? We are developing in vtk 6 at the >> moment, but we should update to a new version at some point in the near >> future. >> >> Kind regards, >> >> Francois. >> >> >> >> >> >> >> -- >> 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: >> https://vtk.org/mailman/listinfo/vtkusers >> > > > -- > ___________________________________________ > Andrew J. P. Maclean > > ___________________________________________ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Wed May 30 11:42:50 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Wed, 30 May 2018 17:42:50 +0200 Subject: [vtkusers] Understanding vtkSmartPointers In-Reply-To: References: Message-ID: Den ons 30 maj 2018 17:07Marcus D. Hanwell skrev: > Hi Andrew, > > To the best of my knowledge the examples require backward compatibility, > and so I couldn't show the "best" form for people who dislike calling > .Get() until the minimum is bumped to VTK 8.1.0 I think. Most of my work is > done on that, or even more recent SHAs, so I don't think about it too much. > > Is there an answer for this, can we make an example that requires 8.1+, as > we add more new features it seems like a reasonable request. I am really > swamped right now, but was hoping to get to some charting examples too. > Speaking as an outsider, I think it would be fine if the examples dropped the requirement that they be backwards compatible, and only show the best practice with current stable release. It's what I see in most other projects I've used, and I think people accept that they'll have do do some work to get examples working with old releases. Others probably disagree though :) Elvis > Thanks, > > Marcus > > On Tue, May 29, 2018 at 6:39 PM, Andrew Maclean > wrote: > >> Hi Marcus, >> This is a very clear and succinct explanation of the usage of >> ? >> vtkNew / >> ? >> vtkSmartPointer / >> ? >> vtkWeakPointer . >> If you have time would it be possible to do a nice C++11 demonstration >> example to be added into VTK Examples? >> I have a suspicion that this will be an issue arising again and again. >> >> I'll be glad to help. >> >> Personally (like Bill) I have never liked: .GetPointer()/.Get() in >> vtkNew so I haven't used it much. However ... since it implicitly returns >> the pointer now, I'll probably use it more. >> >> Rgeards >> Andrew >> >> >> >>> >>> >>> ---------- Forwarded message ---------- >>> From: "Marcus D. Hanwell" >>> To: Fcs >>> Cc: VTK Users >>> Bcc: >>> Date: Mon, 28 May 2018 10:12:24 -0400 >>> Subject: Re: [vtkusers] Understanding vtkSmartPointers >>> On Mon, May 28, 2018 at 7:43 AM, Fcs wrote: >>> >>>> Using VTK for one of our projects, we are encountering some memory leaks >>>> which, in time, cripple our system. So I'm trying to have a better >>>> understanding of the VTK pointers >>>> . >>>> >>>> It was my (erroneous..?) belief that the *vtkSmartPointer*s would >>>> destroy >>>> the object they were holding when getting out of scope. Carefully >>>> reading >>>> the kitware blog post linked hereinabove, and playing around with a test >>>> code (code sample below), I now understand that it is objects held by >>>> *vtkNew* that will be destroyed when out-of-scope, and that >>>> *vtkSmartPointer*s, on the contrary, will keep them alive as long as the >>>> reference count is non-zero. Is this correct? >>>> >>> >>> No, that is not correct. The vtkNew class instantiates a vtkObject >>> derived instance and will decrement its reference count when it goes out of >>> scope. You can still store what was created by vtkNew in a vtkSmartPointer, >>> increasing the reference count to two, and keeping that object alive even >>> when the containing vtkNew goes out of scope. >>> >>> In its simplest form, if you don't use other smart pointer classes with >>> it then vtkNew acts much like a stack allocated object, where the object >>> created is automatically deleted when it goes out of scope. You must >>> remember that all vtkObject derived classes are implicitly reference >>> counted - it is built into the API. The smart pointer classes just take >>> care of incremementing/decrementing the reference count. >>> >>>> >>>> Now, from a practical point of view: does this mean that I can, in a >>>> class, >>>> create an entire VTK pipeline with *vtkSmartPointer*s, and only store >>>> the >>>> latest object in a member variable to keep every object alive (So, in my >>>> code below, only bookkeep the object returned by applyFilters())? And >>>> that >>>> when I'm finished, I can call ->Delete() on that object to clean-up the >>>> entire pipeline? Is this a good practice? Until now, I was >>>> painstakingly >>>> storing every object created for the lifetime of a pipeline, and I would >>>> like to know if I can simplify my code.. >>>> >>>> In my opinion you should aim to never call Delete, but to have a smart >>> pointer contain the things needed. I think all pipeline API will increase >>> the reference count, and so you only usually need to keep a reference to >>> the pipeline objects you are going to keep around/use. The debug leaks code >>> will help you verify you got it right. >>> >>> I would add that we have found in bigger applications that a passing >>> debug leaks is not always enough, ensuring objects are deleted when they >>> are done with is more difficult but necessary, especially in graphical >>> applications that might run for some time. My honest summary of using the >>> smart pointers (in classes, local code, etc) is: >>> >>> ?? >>> vtkNew - when you will instantiate the object, and want to keep a strong >>> reference (you can't change what instance a vtkNew variable points to) >>> >>> ?? >>> vtkSmartPointer - when you might create, or use an instance passed in, >>> and ensure it stays around for when you want to make calls. Assigning a >>> different instance to one will decrement the one it points to before >>> switching it to point to the new instance and incrementing. >>> >>> ?? >>> vtkWeakPointer - when you want to call API if something is still around, >>> check for nullptr before using, will not affect reference count. >>> >>> I think I wrote something similar back then. Whenever I see code like >>> >>> vtkSmartPointer renderer = >>> vtkSmartPointer::New(); >>> >>> I want to replace it with >>> >>> vtkNew renderer; >>> >>> It does the exact same thing with no repetition, and is clearer. The >>> examples require backwards compatibility with older VTK, and I don't think >>> Bill liked calling .GetPointer()/.Get() on the vtkNew object. You no longer >>> have to do that, but it is a more recent addition to the vtkNew API - it >>> will implicitly return the pointer to the contained object as >>> vtkSmartPointer does. >>> >>> Hopefully this makes things a little clearer. At the end of the day all >>> vtkObject derived classes (read most of the vtk* classes) are implicitly >>> reference counted, the choice of vtkNew/vtkSmartPointer should be made >>> depending upon how those instances will be used in your code - both will >>> decrement the reference count by one when they go out of scope. >>> >>> Marcus >>> >>> >>> >>> ---------- Forwarded message ---------- >>> From: David Thompson >>> To: "Marcus D. Hanwell" >>> Cc: Fcs , VTK Users >>> Bcc: >>> Date: Mon, 28 May 2018 10:30:06 -0400 >>> Subject: Re: [vtkusers] Understanding vtkSmartPointers >>> > ... >>> > I think I wrote something similar back then. Whenever I see code like >>> > >>> > vtkSmartPointer renderer = >>> vtkSmartPointer::New(); >>> > >>> > I want to replace it with >>> > >>> > vtkNew renderer; >>> >>> With c++11, you can also say >>> >>> auto renderer = vtkSmartPointer::New(); >>> >>> which cleans up the smart-pointer case a little bit. >>> >>> David >>> >>> >>> >>> >>> ---------- Forwarded message ---------- >>> From: "Marcus D. Hanwell" >>> To: David Thompson >>> Cc: Fcs , VTK Users >>> Bcc: >>> Date: Mon, 28 May 2018 10:50:35 -0400 >>> Subject: Re: [vtkusers] Understanding vtkSmartPointers >>> On Mon, May 28, 2018 at 10:30 AM, David Thompson < >>> david.thompson at kitware.com> wrote: >>> >>>> > ... >>>> > I think I wrote something similar back then. Whenever I see code like >>>> > >>>> > vtkSmartPointer renderer = >>>> vtkSmartPointer::New(); >>>> > >>>> > I want to replace it with >>>> > >>>> > vtkNew renderer; >>>> >>>> With c++11, you can also say >>>> >>>> auto renderer = vtkSmartPointer::New(); >>>> >>>> which cleans up the smart-pointer case a little bit. >>>> >>>> For sure, although in the case of class member variables it doesn't >>> help, and I would argue vtkNew is cleaner (and vtkNew still uses far fewer >>> characters, you got to preserve the finite resources on disk :P ). >>> >>> >>> >>> ---------- Forwarded message ---------- >>> From: Fcs >>> To: vtkusers at vtk.org >>> Cc: >>> Bcc: >>> Date: Mon, 28 May 2018 08:45:51 -0700 (MST) >>> Subject: Re: [vtkusers] Understanding vtkSmartPointers >>> Dear Mathieu, Marcus and David, thank you for your replies and tips, >>> with a >>> special thank to Marcus for his extensive explanations which really >>> clarified a few of the subtleties of the VTK pointers. >>> >>> Marcus, I had few extra questions linked to your reply. >>> >>> >>> > I In my opinion you should aim to never call Delete, but to have a >>> smart >>> > pointer contain the things needed. >>> >>> Is there any danger in calling Delete()? The case I had in mind was to >>> perhaps free the memory occupied by a big structured/unstructured grid >>> object which would need to live until a sub-grid is extracted from it. >>> >>> >>> > I think all pipeline API will increase >>> > the reference count, and so you only usually need to keep a reference >>> to >>> > the pipeline objects you are going to keep around/use. The debug leaks >>> > code >>> > will help you verify you got it right. >>> >>> How good is the guarantee that this will work? "I think" and "usually" >>> seem >>> to imply that my mileage might vary on this one.. :-) Does it mean that >>> this should work in general, but that perhaps some exotic or slightly >>> buggy >>> newer features might not behave correctly? The use case I'm trying to >>> implement has a variable number of pre-definied filters which I'm >>> chaining >>> together. If I test all the possible combinations, and they work, do I >>> have >>> the guarantee they will always work? >>> >>> >>> > I would add that we have found in bigger applications that a passing >>> debug >>> > leaks is not always enough, ensuring objects are deleted when they are >>> > done with is more difficult but necessary, especially in graphical >>> > applications that might run for some time. >>> >>> Does this not imply that every vtkObject created should be stored and >>> deleted manually afterwards? Or are there other ways to detect living >>> vtkObjects when you don't have a direct member variable pointing to it? >>> (say, like the vtkPlane created in applyFilters() in my example code..) >>> >>> >>> > It does the exact same thing with no repetition, and is clearer. The >>> > examples require backwards compatibility with older VTK, and I don't >>> think >>> > Bill liked calling .GetPointer()/.Get() on the vtkNew object. You no >>> > longer have to do that, but it is a more recent addition to the vtkNew >>> API >>> > - it will implicitly return the pointer to the contained object as >>> > vtkSmartPointer does. >>> >>> Good to know! Starting from which version is the call to >>> .GetPointer()/.Get() no longer needed? We are developing in vtk 6 at the >>> moment, but we should update to a new version at some point in the near >>> future. >>> >>> Kind regards, >>> >>> Francois. >>> >>> >>> >>> >>> >>> >>> -- >>> 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: >>> https://vtk.org/mailman/listinfo/vtkusers >>> >> >> >> -- >> ___________________________________________ >> 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: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aida.ninyerola at gmail.com Wed May 30 12:51:07 2018 From: aida.ninyerola at gmail.com (Aida Ninyerola) Date: Wed, 30 May 2018 18:51:07 +0200 Subject: [vtkusers] undefined reference In-Reply-To: References: Message-ID: Hi, Thanks for your response but I'm not sure if I understand what you say. Do you mean I need to add these libraries in CMakeLists.txt of my project or do I need to make changes in my code? Thank you in advance! Aida On 30 May 2018 at 15:11, Marc Ruiz Altisent wrote: > Hi Aida, > > VTK changed to a modular system some time ago and the library names > changed. You just need to find the new ones. The names match the directory > containg the classes: for example vtkPolyDataToImageStencil is in > Imaging/Stencil and the library is vtkImagingStencil, with a suffix of the > VTK version, e.g. vtkImagingStencil-8.1. Similarly, for vtkImageAccumulate > you need vtkImagingStatistics (+ suffix). > > Missatge de Aida Ninyerola del dia dc., 30 de > maig 2018 a les 14:22: > >> Hi, >> >> While compiling my project I get some linking problems. >> tlQuantification.cpp:(.text+0x1623): undefined reference to >> `vtkPolyDataToImageStencil::New()' >> tlQuantification.cpp:(.text+0x162b): undefined reference to >> `vtkImageAccumulate::New()' >> tlQuantification.cpp:(.text+0x168e): undefined reference to >> `vtkImageAccumulate::SetStencilData(vtkImageStencilData*)' >> >> I found that I sould add in CmakeLists.txt the following lines but I >> doesn't work: >> if(VTK_LIBRARIES) >> target_link_libraries(quantification ${VTK_LIBRARIES} ) >> else() >> target_link_libraries(quantification vtkHybrid vtkWidgets) >> endif() >> >> I'm trying to compile and old project that work properly with a former >> VTK version (I can't remember the VTK version). >> >> I was thinking that maybe is a migration problem but I'm not able to find >> what I need to change. >> >> What I'm doing is clipping an image by a cylinder (m_rotate_tformer[id]) >> to calculate the mean activity of the image inside the cylinder. Maybe >> there is a better way to perform it. >> >> vtkPolyDataToImageStencil* sts = vtkPolyDataToImageStencil::New(); >> vtkImageAccumulate* act = vtkImageAccumulate::New(); >> >> sts->SetInputData(m_rotate_tformer[id]->GetPolyDataOutput()); >> sts->SetInformationInput(vtkInputImage.GetPointer()); >> sts->Update(); >> >> act->SetInputData(vtkInputImage.GetPointer()); >> act->SetStencilData(sts->GetOutput()); >> act->Update(); >> >> I'm running out of ideas. I'll appreciate any idea. >> >> Thanks, >> Aida >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at http://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: >> https://public.kitware.com/mailman/listinfo/vtkusers >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc.ruiz+vtk at gmail.com Wed May 30 13:07:18 2018 From: marc.ruiz+vtk at gmail.com (Marc Ruiz Altisent) Date: Wed, 30 May 2018 19:07:18 +0200 Subject: [vtkusers] undefined reference In-Reply-To: References: Message-ID: I mean putting them in your CMakeLists.txt in target_link_libraries. Missatge de Aida Ninyerola del dia dc., 30 de maig 2018 a les 18:51: > Hi, > > Thanks for your response but I'm not sure if I understand what you say. > > Do you mean I need to add these libraries in CMakeLists.txt of my project > or do I need to make changes in my code? > > Thank you in advance! > Aida > > On 30 May 2018 at 15:11, Marc Ruiz Altisent > wrote: > >> Hi Aida, >> >> VTK changed to a modular system some time ago and the library names >> changed. You just need to find the new ones. The names match the directory >> containg the classes: for example vtkPolyDataToImageStencil is in >> Imaging/Stencil and the library is vtkImagingStencil, with a suffix of the >> VTK version, e.g. vtkImagingStencil-8.1. Similarly, for vtkImageAccumulate >> you need vtkImagingStatistics (+ suffix). >> >> Missatge de Aida Ninyerola del dia dc., 30 de >> maig 2018 a les 14:22: >> >>> Hi, >>> >>> While compiling my project I get some linking problems. >>> tlQuantification.cpp:(.text+0x1623): undefined reference to >>> `vtkPolyDataToImageStencil::New()' >>> tlQuantification.cpp:(.text+0x162b): undefined reference to >>> `vtkImageAccumulate::New()' >>> tlQuantification.cpp:(.text+0x168e): undefined reference to >>> `vtkImageAccumulate::SetStencilData(vtkImageStencilData*)' >>> >>> I found that I sould add in CmakeLists.txt the following lines but I >>> doesn't work: >>> if(VTK_LIBRARIES) >>> target_link_libraries(quantification ${VTK_LIBRARIES} ) >>> else() >>> target_link_libraries(quantification vtkHybrid vtkWidgets) >>> endif() >>> >>> I'm trying to compile and old project that work properly with a former >>> VTK version (I can't remember the VTK version). >>> >>> I was thinking that maybe is a migration problem but I'm not able to >>> find what I need to change. >>> >>> What I'm doing is clipping an image by a cylinder (m_rotate_tformer[id]) >>> to calculate the mean activity of the image inside the cylinder. Maybe >>> there is a better way to perform it. >>> >>> vtkPolyDataToImageStencil* sts = vtkPolyDataToImageStencil::New(); >>> vtkImageAccumulate* act = vtkImageAccumulate::New(); >>> >>> sts->SetInputData(m_rotate_tformer[id]->GetPolyDataOutput()); >>> sts->SetInformationInput(vtkInputImage.GetPointer()); >>> sts->Update(); >>> >>> act->SetInputData(vtkInputImage.GetPointer()); >>> act->SetStencilData(sts->GetOutput()); >>> act->Update(); >>> >>> I'm running out of ideas. I'll appreciate any idea. >>> >>> Thanks, >>> Aida >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://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: >>> https://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: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sankhesh.jhaveri at kitware.com Wed May 30 14:42:55 2018 From: sankhesh.jhaveri at kitware.com (Sankhesh Jhaveri) Date: Wed, 30 May 2018 14:42:55 -0400 Subject: [vtkusers] Deprecate vtkGeo* classes (Sankhesh Jhaveri) In-Reply-To: <1527621592853-0.post@n5.nabble.com> References: <1527617622636-0.post@n5.nabble.com> <1527618486169-0.post@n5.nabble.com> <1527621592853-0.post@n5.nabble.com> Message-ID: Hi Donny, Seems like going the remote module route is the best way to go. We can deprecate and eventually remove the classes from core VTK. If you like, you can create (and maintain) a repository for the classes you need and add a simple CMake script to your local VTK source checkout for adding these classes back in. See the CMake scripts for other remote modules for examples. Hope that helps. Thanks, Sankhesh ? On Tue, May 29, 2018 at 3:19 PM zmantorn wrote: > This has been a work in progress for about 10 years. I have not been able > to > work on it as much as I would like the last few years, but my oldest just > graduated high school so I am hoping to get back to work on it. It is a 3D > application written in C++ and C# that shows near real time high resolution > radar data by radar angle sweeps and by visualizing a volume of all sweep > angles. It is important to show the radar sweep in relation to the > curvature > of the earth since the radar beam does not follow the curve of the earth. > > I am not sure what you mean by share my work with you? Do you mean share my > entire code base with the community? Share the geo parts only? > Unfortunately > this software is kind of a hobby at this time so there are not any articles > published. > > Thanks. > > > > > > -- > 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: > https://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 sur.chiranjib at gmail.com Wed May 30 14:47:53 2018 From: sur.chiranjib at gmail.com (Chiranjib Sur) Date: Thu, 31 May 2018 00:17:53 +0530 Subject: [vtkusers] undefined reference In-Reply-To: References: Message-ID: While running cmake use the option -DVTK_Dir=. This will solve the undefined search of the "development" libraries your code need. Hope that helps. Thanks and regards, Chiranjib On Wed, May 30, 2018 at 10:37 PM, Marc Ruiz Altisent < marc.ruiz+vtk at gmail.com> wrote: > I mean putting them in your CMakeLists.txt in target_link_libraries. > > Missatge de Aida Ninyerola del dia dc., 30 de > maig 2018 a les 18:51: > >> Hi, >> >> Thanks for your response but I'm not sure if I understand what you say. >> >> Do you mean I need to add these libraries in CMakeLists.txt of my project >> or do I need to make changes in my code? >> >> Thank you in advance! >> Aida >> >> On 30 May 2018 at 15:11, Marc Ruiz Altisent >> wrote: >> >>> Hi Aida, >>> >>> VTK changed to a modular system some time ago and the library names >>> changed. You just need to find the new ones. The names match the directory >>> containg the classes: for example vtkPolyDataToImageStencil is in >>> Imaging/Stencil and the library is vtkImagingStencil, with a suffix of the >>> VTK version, e.g. vtkImagingStencil-8.1. Similarly, for vtkImageAccumulate >>> you need vtkImagingStatistics (+ suffix). >>> >>> Missatge de Aida Ninyerola del dia dc., 30 >>> de maig 2018 a les 14:22: >>> >>>> Hi, >>>> >>>> While compiling my project I get some linking problems. >>>> tlQuantification.cpp:(.text+0x1623): undefined reference to >>>> `vtkPolyDataToImageStencil::New()' >>>> tlQuantification.cpp:(.text+0x162b): undefined reference to >>>> `vtkImageAccumulate::New()' >>>> tlQuantification.cpp:(.text+0x168e): undefined reference to >>>> `vtkImageAccumulate::SetStencilData(vtkImageStencilData*)' >>>> >>>> I found that I sould add in CmakeLists.txt the following lines but I >>>> doesn't work: >>>> if(VTK_LIBRARIES) >>>> target_link_libraries(quantification ${VTK_LIBRARIES} ) >>>> else() >>>> target_link_libraries(quantification vtkHybrid vtkWidgets) >>>> endif() >>>> >>>> I'm trying to compile and old project that work properly with a former >>>> VTK version (I can't remember the VTK version). >>>> >>>> I was thinking that maybe is a migration problem but I'm not able to >>>> find what I need to change. >>>> >>>> What I'm doing is clipping an image by a cylinder >>>> (m_rotate_tformer[id]) to calculate the mean activity of the image inside >>>> the cylinder. Maybe there is a better way to perform it. >>>> >>>> vtkPolyDataToImageStencil* sts = vtkPolyDataToImageStencil::New(); >>>> vtkImageAccumulate* act = vtkImageAccumulate::New(); >>>> >>>> sts->SetInputData(m_rotate_tformer[id]->GetPolyDataOutput()); >>>> sts->SetInformationInput(vtkInputImage.GetPointer()); >>>> sts->Update(); >>>> >>>> act->SetInputData(vtkInputImage.GetPointer()); >>>> act->SetStencilData(sts->GetOutput()); >>>> act->Update(); >>>> >>>> I'm running out of ideas. I'll appreciate any idea. >>>> >>>> Thanks, >>>> Aida >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at http://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: >>>> https://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: >> https://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: > https://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zmanvortex at gmail.com Wed May 30 15:18:16 2018 From: zmanvortex at gmail.com (Donny Zimmerman) Date: Wed, 30 May 2018 14:18:16 -0500 Subject: [vtkusers] Deprecate vtkGeo* classes (Sankhesh Jhaveri) In-Reply-To: References: <1527617622636-0.post@n5.nabble.com> <1527618486169-0.post@n5.nabble.com> <1527621592853-0.post@n5.nabble.com> Message-ID: Thanks Sankhesh. Would this remote repository still be a part of the VTK project so others can utilize these classes? I do not mind maintaining the repository, but I have never utilized remote modules in VTK so I am not too familiar with the process. On Wed, May 30, 2018 at 1:42 PM, Sankhesh Jhaveri < sankhesh.jhaveri at kitware.com> wrote: > Hi Donny, > > Seems like going the remote module route is the best way to go. We can > deprecate and eventually remove the classes from core VTK. > If you like, you can create (and maintain) a repository for the classes > you need and add a simple CMake script to your local VTK source checkout > for adding these classes back in. > > See the CMake scripts for other remote modules > for examples. > > Hope that helps. > > Thanks, > Sankhesh > ? > > On Tue, May 29, 2018 at 3:19 PM zmantorn wrote: > >> This has been a work in progress for about 10 years. I have not been able >> to >> work on it as much as I would like the last few years, but my oldest just >> graduated high school so I am hoping to get back to work on it. It is a 3D >> application written in C++ and C# that shows near real time high >> resolution >> radar data by radar angle sweeps and by visualizing a volume of all sweep >> angles. It is important to show the radar sweep in relation to the >> curvature >> of the earth since the radar beam does not follow the curve of the earth. >> >> I am not sure what you mean by share my work with you? Do you mean share >> my >> entire code base with the community? Share the geo parts only? >> Unfortunately >> this software is kind of a hobby at this time so there are not any >> articles >> published. >> >> Thanks. >> >> >> >> >> >> -- >> 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: >> https://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 tavares at fe.up.pt Wed May 30 17:16:42 2018 From: tavares at fe.up.pt (=?utf-8?Q?=22Jo=C3=A3o_Manuel_R=2E_S=2E_Tavares=22?=) Date: Wed, 30 May 2018 22:16:42 +0100 Subject: [vtkusers] DEADLINE EXTENDED: IWCIA 2018, Porto, Portugal, November 22-24, 2018 References: <2E35BC36-07F7-4593-AAE9-9B1CAC4F1FBF@fe.up.pt> Message-ID: <1E739377-F725-47E5-8CCB-FDE7E40430F1@fe.up.pt> WEB SITE: https://sites.google.com/view/iwcia18/ Dear Colleague, I am pleased to invite you to IWCIA'18 - https://sites.google.com/view/iwcia18 , which is going to be held in Porto, Portugal, in November 22-24, 2018. IWCIA'18 is the nineteenth of a series of international meetings on combinatorial image analysis. Image analysis is a scientific discipline providing theoretical foundations and methods for solving problems appearing in a wide range of areas, as diverse as medicine, robotics, defense, and security. As a rule, the processed data are discrete; therefore, the "discrete approach" to image analysis appears to be a natural one and has an increasing importance. It is based on studying combinatorial properties of the considered digital data sets. Combinatorial image analysis often features various advantages (in terms of efficiency and accuracy) over the more traditional approaches based on continuous models requiring numeric computation. The scientific program of the workshop consists of keynote talks, contributed papers, and posters. TOPICS: The Workshop is a forum for current research on the following (or similar) research subjects which are directly or potentially applicable to image analysis: - Combinatorial problems in the discrete plane and space; Lattice polygons and polytopes - Digital/combinatorial geometry and topology - Digital manifolds; Geometry of digital curves and surfaces - Analysis and processing of digital surfaces with singularities (such as "pinched digital surfaces") - Homotopy of digital manifolds; Thinning algorithms and skeletons - Boundary tracking of digital solids; Geometric characteristics of object boundaries - Multigrid convergence analysis of metric-based descriptors - Tilings and patterns; Combinatorial pattern matching - Computational geometry and imaging sciences - Integer programming, linear programming, and graph theoretic models and approaches to problems of image analysis - Image representation, segmentation, grouping, and reconstruction - Processing "very large" digital pictures; Methods for image compression - Parallel architectures and algorithms - Fuzzy and stochastic image analysis - Discrete tomography - Grammars and models for image or scene analysis and recognition; Cellular automata - Mathematical morphology and image analysis - Applications in medical imaging, biometrics, computer vision, image understanding, robotics, metrology, and others KEYNOTES: - Patch-based Inverse Problems in Interferometric Phase Imaging, Prof. Jos? M. Bioucas-Dias, Universidade de Lisboa, Portugal - Geometric Representations of Graphs, Prof. Jan Kratochvil, Charles University, Czech Republic - Representation learning with trainable COSFIRE filters, Prof. Nicolai Petkov, University of Groningen, The Netherlands DATES: Full paper submission due - June 15, 2018 (EXTENDED) Notification of acceptance - July 20, 2018 (EXTENDED) Final camera-ready papers - August 15, 2018 Workshop dates - November 22-24, 2018, Porto, Portugal PUBLICATION: The conference proceedings will be published in the Springer's "Lecture Notes in Computer Science" series. REVIEW PROCESS: The submitted papers are expected to meet high standards satisfying serious evaluation criteria. Each paper will be reviewed thoroughly by at least two members of the Program Committee. Double-blind review process will be applied to ensure maximal objectiveness. JOURNAL SPECIAL ISSUE: After the Workshop, the authors can submit extended versions of their works for publication in special journal issues. A thematic special issue of Computer Methods in Biomechanics and Biomedical Engineering: Imaging & Visualization (Taylor & Francis) has already been arranged. Looking forward to meet you in Porto, in November, Jo?o Manuel R.S. Tavares - Universidade do Porto, Portugal (General Chair IWCIA'18) -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.amaclean at gmail.com Wed May 30 17:27:06 2018 From: andrew.amaclean at gmail.com (Andrew Maclean) Date: Thu, 31 May 2018 07:27:06 +1000 Subject: [vtkusers] Understanding vtkSmartPointers In-Reply-To: References: Message-ID: Marcus Take your time there is no compulsion to produce an example. It is a case of .... 'Hmmm this may be a good example, when I have time I "may" do one one day'. I also think you should be demonstrating current best practice with the caveat that all tests pass. After all, we learn from the examples, and how else can you showcase new and great features of VTK? Elvis, I agree with you here. However there is no point in a wholesale reworking of existing code to use new and great features of VTK. As these are examples for a broad audience, we should keep a wide variety of code until it actually fails. Then fix it. Bill, do you have any views here? Regards Andrew On Thu, May 31, 2018 at 1:43 AM Elvis Stansvik wrote: > Den ons 30 maj 2018 17:07Marcus D. Hanwell > skrev: > >> Hi Andrew, >> >> To the best of my knowledge the examples require backward compatibility, >> and so I couldn't show the "best" form for people who dislike calling >> .Get() until the minimum is bumped to VTK 8.1.0 I think. Most of my work is >> done on that, or even more recent SHAs, so I don't think about it too much. >> >> Is there an answer for this, can we make an example that requires 8.1+, >> as we add more new features it seems like a reasonable request. I am really >> swamped right now, but was hoping to get to some charting examples too. >> > > Speaking as an outsider, I think it would be fine if the examples dropped > the requirement that they be backwards compatible, and only show the best > practice with current stable release. It's what I see in most other > projects I've used, and I think people accept that they'll have do do some > work to get examples working with old releases. > > Others probably disagree though :) > > Elvis > > >> Thanks, >> >> Marcus >> >> On Tue, May 29, 2018 at 6:39 PM, Andrew Maclean < >> andrew.amaclean at gmail.com> wrote: >> >>> Hi Marcus, >>> This is a very clear and succinct explanation of the usage of >>> ? >>> vtkNew / >>> ? >>> vtkSmartPointer / >>> ? >>> vtkWeakPointer . >>> If you have time would it be possible to do a nice C++11 demonstration >>> example to be added into VTK Examples? >>> I have a suspicion that this will be an issue arising again and again. >>> >>> I'll be glad to help. >>> >>> Personally (like Bill) I have never liked: .GetPointer()/.Get() in >>> vtkNew so I haven't used it much. However ... since it implicitly returns >>> the pointer now, I'll probably use it more. >>> >>> Rgeards >>> Andrew >>> >>> >>> >>>> >>>> >>>> ---------- Forwarded message ---------- >>>> From: "Marcus D. Hanwell" >>>> To: Fcs >>>> Cc: VTK Users >>>> Bcc: >>>> Date: Mon, 28 May 2018 10:12:24 -0400 >>>> Subject: Re: [vtkusers] Understanding vtkSmartPointers >>>> On Mon, May 28, 2018 at 7:43 AM, Fcs wrote: >>>> >>>>> Using VTK for one of our projects, we are encountering some memory >>>>> leaks >>>>> which, in time, cripple our system. So I'm trying to have a better >>>>> understanding of the VTK pointers >>>>> . >>>>> >>>>> It was my (erroneous..?) belief that the *vtkSmartPointer*s would >>>>> destroy >>>>> the object they were holding when getting out of scope. Carefully >>>>> reading >>>>> the kitware blog post linked hereinabove, and playing around with a >>>>> test >>>>> code (code sample below), I now understand that it is objects held by >>>>> *vtkNew* that will be destroyed when out-of-scope, and that >>>>> *vtkSmartPointer*s, on the contrary, will keep them alive as long as >>>>> the >>>>> reference count is non-zero. Is this correct? >>>>> >>>> >>>> No, that is not correct. The vtkNew class instantiates a vtkObject >>>> derived instance and will decrement its reference count when it goes out of >>>> scope. You can still store what was created by vtkNew in a vtkSmartPointer, >>>> increasing the reference count to two, and keeping that object alive even >>>> when the containing vtkNew goes out of scope. >>>> >>>> In its simplest form, if you don't use other smart pointer classes with >>>> it then vtkNew acts much like a stack allocated object, where the object >>>> created is automatically deleted when it goes out of scope. You must >>>> remember that all vtkObject derived classes are implicitly reference >>>> counted - it is built into the API. The smart pointer classes just take >>>> care of incremementing/decrementing the reference count. >>>> >>>>> >>>>> Now, from a practical point of view: does this mean that I can, in a >>>>> class, >>>>> create an entire VTK pipeline with *vtkSmartPointer*s, and only store >>>>> the >>>>> latest object in a member variable to keep every object alive (So, in >>>>> my >>>>> code below, only bookkeep the object returned by applyFilters())? And >>>>> that >>>>> when I'm finished, I can call ->Delete() on that object to clean-up the >>>>> entire pipeline? Is this a good practice? Until now, I was >>>>> painstakingly >>>>> storing every object created for the lifetime of a pipeline, and I >>>>> would >>>>> like to know if I can simplify my code.. >>>>> >>>>> In my opinion you should aim to never call Delete, but to have a smart >>>> pointer contain the things needed. I think all pipeline API will increase >>>> the reference count, and so you only usually need to keep a reference to >>>> the pipeline objects you are going to keep around/use. The debug leaks code >>>> will help you verify you got it right. >>>> >>>> I would add that we have found in bigger applications that a passing >>>> debug leaks is not always enough, ensuring objects are deleted when they >>>> are done with is more difficult but necessary, especially in graphical >>>> applications that might run for some time. My honest summary of using the >>>> smart pointers (in classes, local code, etc) is: >>>> >>>> ?? >>>> vtkNew - when you will instantiate the object, and want to keep a >>>> strong reference (you can't change what instance a vtkNew variable points >>>> to) >>>> >>>> ?? >>>> vtkSmartPointer - when you might create, or use an instance passed in, >>>> and ensure it stays around for when you want to make calls. Assigning a >>>> different instance to one will decrement the one it points to before >>>> switching it to point to the new instance and incrementing. >>>> >>>> ?? >>>> vtkWeakPointer - when you want to call API if something is still >>>> around, check for nullptr before using, will not affect reference count. >>>> >>>> I think I wrote something similar back then. Whenever I see code like >>>> >>>> vtkSmartPointer renderer = >>>> vtkSmartPointer::New(); >>>> >>>> I want to replace it with >>>> >>>> vtkNew renderer; >>>> >>>> It does the exact same thing with no repetition, and is clearer. The >>>> examples require backwards compatibility with older VTK, and I don't think >>>> Bill liked calling .GetPointer()/.Get() on the vtkNew object. You no longer >>>> have to do that, but it is a more recent addition to the vtkNew API - it >>>> will implicitly return the pointer to the contained object as >>>> vtkSmartPointer does. >>>> >>>> Hopefully this makes things a little clearer. At the end of the day all >>>> vtkObject derived classes (read most of the vtk* classes) are implicitly >>>> reference counted, the choice of vtkNew/vtkSmartPointer should be made >>>> depending upon how those instances will be used in your code - both will >>>> decrement the reference count by one when they go out of scope. >>>> >>>> Marcus >>>> >>>> >>>> >>>> ---------- Forwarded message ---------- >>>> From: David Thompson >>>> To: "Marcus D. Hanwell" >>>> Cc: Fcs , VTK Users >>>> Bcc: >>>> Date: Mon, 28 May 2018 10:30:06 -0400 >>>> Subject: Re: [vtkusers] Understanding vtkSmartPointers >>>> > ... >>>> > I think I wrote something similar back then. Whenever I see code like >>>> > >>>> > vtkSmartPointer renderer = >>>> vtkSmartPointer::New(); >>>> > >>>> > I want to replace it with >>>> > >>>> > vtkNew renderer; >>>> >>>> With c++11, you can also say >>>> >>>> auto renderer = vtkSmartPointer::New(); >>>> >>>> which cleans up the smart-pointer case a little bit. >>>> >>>> David >>>> >>>> >>>> >>>> >>>> ---------- Forwarded message ---------- >>>> From: "Marcus D. Hanwell" >>>> To: David Thompson >>>> Cc: Fcs , VTK Users >>>> Bcc: >>>> Date: Mon, 28 May 2018 10:50:35 -0400 >>>> Subject: Re: [vtkusers] Understanding vtkSmartPointers >>>> On Mon, May 28, 2018 at 10:30 AM, David Thompson < >>>> david.thompson at kitware.com> wrote: >>>> >>>>> > ... >>>>> > I think I wrote something similar back then. Whenever I see code like >>>>> > >>>>> > vtkSmartPointer renderer = >>>>> vtkSmartPointer::New(); >>>>> > >>>>> > I want to replace it with >>>>> > >>>>> > vtkNew renderer; >>>>> >>>>> With c++11, you can also say >>>>> >>>>> auto renderer = vtkSmartPointer::New(); >>>>> >>>>> which cleans up the smart-pointer case a little bit. >>>>> >>>>> For sure, although in the case of class member variables it doesn't >>>> help, and I would argue vtkNew is cleaner (and vtkNew still uses far fewer >>>> characters, you got to preserve the finite resources on disk :P ). >>>> >>>> >>>> >>>> ---------- Forwarded message ---------- >>>> From: Fcs >>>> To: vtkusers at vtk.org >>>> Cc: >>>> Bcc: >>>> Date: Mon, 28 May 2018 08:45:51 -0700 (MST) >>>> Subject: Re: [vtkusers] Understanding vtkSmartPointers >>>> Dear Mathieu, Marcus and David, thank you for your replies and tips, >>>> with a >>>> special thank to Marcus for his extensive explanations which really >>>> clarified a few of the subtleties of the VTK pointers. >>>> >>>> Marcus, I had few extra questions linked to your reply. >>>> >>>> >>>> > I In my opinion you should aim to never call Delete, but to have a >>>> smart >>>> > pointer contain the things needed. >>>> >>>> Is there any danger in calling Delete()? The case I had in mind was to >>>> perhaps free the memory occupied by a big structured/unstructured grid >>>> object which would need to live until a sub-grid is extracted from it. >>>> >>>> >>>> > I think all pipeline API will increase >>>> > the reference count, and so you only usually need to keep a reference >>>> to >>>> > the pipeline objects you are going to keep around/use. The debug leaks >>>> > code >>>> > will help you verify you got it right. >>>> >>>> How good is the guarantee that this will work? "I think" and "usually" >>>> seem >>>> to imply that my mileage might vary on this one.. :-) Does it mean that >>>> this should work in general, but that perhaps some exotic or slightly >>>> buggy >>>> newer features might not behave correctly? The use case I'm trying to >>>> implement has a variable number of pre-definied filters which I'm >>>> chaining >>>> together. If I test all the possible combinations, and they work, do I >>>> have >>>> the guarantee they will always work? >>>> >>>> >>>> > I would add that we have found in bigger applications that a passing >>>> debug >>>> > leaks is not always enough, ensuring objects are deleted when they are >>>> > done with is more difficult but necessary, especially in graphical >>>> > applications that might run for some time. >>>> >>>> Does this not imply that every vtkObject created should be stored and >>>> deleted manually afterwards? Or are there other ways to detect living >>>> vtkObjects when you don't have a direct member variable pointing to it? >>>> (say, like the vtkPlane created in applyFilters() in my example code..) >>>> >>>> >>>> > It does the exact same thing with no repetition, and is clearer. The >>>> > examples require backwards compatibility with older VTK, and I don't >>>> think >>>> > Bill liked calling .GetPointer()/.Get() on the vtkNew object. You no >>>> > longer have to do that, but it is a more recent addition to the >>>> vtkNew API >>>> > - it will implicitly return the pointer to the contained object as >>>> > vtkSmartPointer does. >>>> >>>> Good to know! Starting from which version is the call to >>>> .GetPointer()/.Get() no longer needed? We are developing in vtk 6 at the >>>> moment, but we should update to a new version at some point in the near >>>> future. >>>> >>>> Kind regards, >>>> >>>> Francois. >>>> >>>> >>>> >>>> >>>> >>>> >>>> -- >>>> 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: >>>> https://vtk.org/mailman/listinfo/vtkusers >>>> >>> >>> >>> -- >>> ___________________________________________ >>> 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: >> https://public.kitware.com/mailman/listinfo/vtkusers >> > -- ___________________________________________ Andrew J. P. Maclean ___________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From bebe0705 at colorado.edu Wed May 30 17:38:24 2018 From: bebe0705 at colorado.edu (BBerco) Date: Wed, 30 May 2018 14:38:24 -0700 (MST) Subject: [vtkusers] vtkChartHistogram2D use case Message-ID: <1527716304307-0.post@n5.nabble.com> I am trying to use an instance of vtkChartHistogram2D to visualize a vtkImageData. I think it is a possibility in VTK given the partial example on page 48 of this document . Unfortunately, the above example is incomplete, and replicating it has been unsuccessful. Below is what I have so far: a QVTKOpenGLWidget sharing a vtkGenericOpenGLRenderWindow with a vtkContextView. Any advice? * vtkSmartPointer render_window = vtkSmartPointer< vtkGenericOpenGLRenderWindow>::New(); this -> view = vtkSmartPointer::New (); this -> view -> SetRenderWindow(render_window); this -> qvtkWidget = new QVTKOpenGLWidget(this); this -> qvtkWidget -> SetRenderWindow(render_window); // Normalizing the image vtkDataArray * scalars = this -> images[0] -> GetPointData() -> GetScalars(); double max_val = -1; for (vtkIdType tupleIdx = 0; tupleIdx < scalars -> GetNumberOfTuples(); ++tupleIdx){ max_val = std::max(scalars -> GetTuple1(tupleIdx),max_val); } vtkSmartPointer histo = vtkSmartPointer::New(); vtkSmartPointer fun = vtkSmartPointer::New(); fun -> AddRGBPoint(0, 0.0, 0.0, 0.0); fun -> AddRGBPoint(max_value, 1.0, 1, 1); fun -> Build(); histo -> SetInputData(this -> images[0]); histo -> SetTransferFunction(fun); vtkSmartPointer label = vtkSmartPointer::New(); label -> InsertNextValue("Range (m)"); label -> InsertNextValue("Range-rate (m/s)"); histo -> GetPlot(0) -> SetLabels(label); histo -> Update(); // CRASHES HERE * -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From bill.lorensen at gmail.com Wed May 30 17:49:43 2018 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Wed, 30 May 2018 14:49:43 -0700 Subject: [vtkusers] Understanding vtkSmartPointers In-Reply-To: References: Message-ID: For now I'd like to keep using SmartPointers in the examples. On Wed, May 30, 2018, 2:27 PM Andrew Maclean wrote: > Marcus > Take your time there is no compulsion to produce an example. It is a > case of .... 'Hmmm this may be a good example, when I have time I "may" do > one one day'. I also think you should be demonstrating current best > practice with the caveat that all tests pass. After all, we learn from the > examples, and how else can you showcase new and great features of VTK? > > Elvis, I agree with you here. However there is no point in a wholesale > reworking of existing code to use new and great features of VTK. As these > are examples for a broad audience, we should keep a wide variety of code > until it actually fails. Then fix it. > > Bill, do you have any views here? > > Regards > Andrew > > On Thu, May 31, 2018 at 1:43 AM Elvis Stansvik < > elvis.stansvik at orexplore.com> wrote: > >> Den ons 30 maj 2018 17:07Marcus D. Hanwell >> skrev: >> >>> Hi Andrew, >>> >>> To the best of my knowledge the examples require backward compatibility, >>> and so I couldn't show the "best" form for people who dislike calling >>> .Get() until the minimum is bumped to VTK 8.1.0 I think. Most of my work is >>> done on that, or even more recent SHAs, so I don't think about it too much. >>> >>> Is there an answer for this, can we make an example that requires 8.1+, >>> as we add more new features it seems like a reasonable request. I am really >>> swamped right now, but was hoping to get to some charting examples too. >>> >> >> Speaking as an outsider, I think it would be fine if the examples dropped >> the requirement that they be backwards compatible, and only show the best >> practice with current stable release. It's what I see in most other >> projects I've used, and I think people accept that they'll have do do some >> work to get examples working with old releases. >> >> Others probably disagree though :) >> >> Elvis >> >> >>> Thanks, >>> >>> Marcus >>> >>> On Tue, May 29, 2018 at 6:39 PM, Andrew Maclean < >>> andrew.amaclean at gmail.com> wrote: >>> >>>> Hi Marcus, >>>> This is a very clear and succinct explanation of the usage of >>>> ? >>>> vtkNew / >>>> ? >>>> vtkSmartPointer / >>>> ? >>>> vtkWeakPointer . >>>> If you have time would it be possible to do a nice C++11 demonstration >>>> example to be added into VTK Examples? >>>> I have a suspicion that this will be an issue arising again and again. >>>> >>>> I'll be glad to help. >>>> >>>> Personally (like Bill) I have never liked: .GetPointer()/.Get() in >>>> vtkNew so I haven't used it much. However ... since it implicitly returns >>>> the pointer now, I'll probably use it more. >>>> >>>> Rgeards >>>> Andrew >>>> >>>> >>>> >>>>> >>>>> >>>>> ---------- Forwarded message ---------- >>>>> From: "Marcus D. Hanwell" >>>>> To: Fcs >>>>> Cc: VTK Users >>>>> Bcc: >>>>> Date: Mon, 28 May 2018 10:12:24 -0400 >>>>> Subject: Re: [vtkusers] Understanding vtkSmartPointers >>>>> On Mon, May 28, 2018 at 7:43 AM, Fcs wrote: >>>>> >>>>>> Using VTK for one of our projects, we are encountering some memory >>>>>> leaks >>>>>> which, in time, cripple our system. So I'm trying to have a better >>>>>> understanding of the VTK pointers >>>>>> . >>>>>> >>>>>> It was my (erroneous..?) belief that the *vtkSmartPointer*s would >>>>>> destroy >>>>>> the object they were holding when getting out of scope. Carefully >>>>>> reading >>>>>> the kitware blog post linked hereinabove, and playing around with a >>>>>> test >>>>>> code (code sample below), I now understand that it is objects held by >>>>>> *vtkNew* that will be destroyed when out-of-scope, and that >>>>>> *vtkSmartPointer*s, on the contrary, will keep them alive as long as >>>>>> the >>>>>> reference count is non-zero. Is this correct? >>>>>> >>>>> >>>>> No, that is not correct. The vtkNew class instantiates a vtkObject >>>>> derived instance and will decrement its reference count when it goes out of >>>>> scope. You can still store what was created by vtkNew in a vtkSmartPointer, >>>>> increasing the reference count to two, and keeping that object alive even >>>>> when the containing vtkNew goes out of scope. >>>>> >>>>> In its simplest form, if you don't use other smart pointer classes >>>>> with it then vtkNew acts much like a stack allocated object, where the >>>>> object created is automatically deleted when it goes out of scope. You must >>>>> remember that all vtkObject derived classes are implicitly reference >>>>> counted - it is built into the API. The smart pointer classes just take >>>>> care of incremementing/decrementing the reference count. >>>>> >>>>>> >>>>>> Now, from a practical point of view: does this mean that I can, in a >>>>>> class, >>>>>> create an entire VTK pipeline with *vtkSmartPointer*s, and only store >>>>>> the >>>>>> latest object in a member variable to keep every object alive (So, in >>>>>> my >>>>>> code below, only bookkeep the object returned by applyFilters())? >>>>>> And that >>>>>> when I'm finished, I can call ->Delete() on that object to clean-up >>>>>> the >>>>>> entire pipeline? Is this a good practice? Until now, I was >>>>>> painstakingly >>>>>> storing every object created for the lifetime of a pipeline, and I >>>>>> would >>>>>> like to know if I can simplify my code.. >>>>>> >>>>>> In my opinion you should aim to never call Delete, but to have a >>>>> smart pointer contain the things needed. I think all pipeline API will >>>>> increase the reference count, and so you only usually need to keep a >>>>> reference to the pipeline objects you are going to keep around/use. The >>>>> debug leaks code will help you verify you got it right. >>>>> >>>>> I would add that we have found in bigger applications that a passing >>>>> debug leaks is not always enough, ensuring objects are deleted when they >>>>> are done with is more difficult but necessary, especially in graphical >>>>> applications that might run for some time. My honest summary of using the >>>>> smart pointers (in classes, local code, etc) is: >>>>> >>>>> ?? >>>>> vtkNew - when you will instantiate the object, and want to keep a >>>>> strong reference (you can't change what instance a vtkNew variable points >>>>> to) >>>>> >>>>> ?? >>>>> vtkSmartPointer - when you might create, or use an instance passed in, >>>>> and ensure it stays around for when you want to make calls. Assigning a >>>>> different instance to one will decrement the one it points to before >>>>> switching it to point to the new instance and incrementing. >>>>> >>>>> ?? >>>>> vtkWeakPointer - when you want to call API if something is still >>>>> around, check for nullptr before using, will not affect reference count. >>>>> >>>>> I think I wrote something similar back then. Whenever I see code like >>>>> >>>>> vtkSmartPointer renderer = >>>>> vtkSmartPointer::New(); >>>>> >>>>> I want to replace it with >>>>> >>>>> vtkNew renderer; >>>>> >>>>> It does the exact same thing with no repetition, and is clearer. The >>>>> examples require backwards compatibility with older VTK, and I don't think >>>>> Bill liked calling .GetPointer()/.Get() on the vtkNew object. You no longer >>>>> have to do that, but it is a more recent addition to the vtkNew API - it >>>>> will implicitly return the pointer to the contained object as >>>>> vtkSmartPointer does. >>>>> >>>>> Hopefully this makes things a little clearer. At the end of the day >>>>> all vtkObject derived classes (read most of the vtk* classes) are >>>>> implicitly reference counted, the choice of vtkNew/vtkSmartPointer should >>>>> be made depending upon how those instances will be used in your code - both >>>>> will decrement the reference count by one when they go out of scope. >>>>> >>>>> Marcus >>>>> >>>>> >>>>> >>>>> ---------- Forwarded message ---------- >>>>> From: David Thompson >>>>> To: "Marcus D. Hanwell" >>>>> Cc: Fcs , VTK Users >>>>> Bcc: >>>>> Date: Mon, 28 May 2018 10:30:06 -0400 >>>>> Subject: Re: [vtkusers] Understanding vtkSmartPointers >>>>> > ... >>>>> > I think I wrote something similar back then. Whenever I see code like >>>>> > >>>>> > vtkSmartPointer renderer = >>>>> vtkSmartPointer::New(); >>>>> > >>>>> > I want to replace it with >>>>> > >>>>> > vtkNew renderer; >>>>> >>>>> With c++11, you can also say >>>>> >>>>> auto renderer = vtkSmartPointer::New(); >>>>> >>>>> which cleans up the smart-pointer case a little bit. >>>>> >>>>> David >>>>> >>>>> >>>>> >>>>> >>>>> ---------- Forwarded message ---------- >>>>> From: "Marcus D. Hanwell" >>>>> To: David Thompson >>>>> Cc: Fcs , VTK Users >>>>> Bcc: >>>>> Date: Mon, 28 May 2018 10:50:35 -0400 >>>>> Subject: Re: [vtkusers] Understanding vtkSmartPointers >>>>> On Mon, May 28, 2018 at 10:30 AM, David Thompson < >>>>> david.thompson at kitware.com> wrote: >>>>> >>>>>> > ... >>>>>> > I think I wrote something similar back then. Whenever I see code >>>>>> like >>>>>> > >>>>>> > vtkSmartPointer renderer = >>>>>> vtkSmartPointer::New(); >>>>>> > >>>>>> > I want to replace it with >>>>>> > >>>>>> > vtkNew renderer; >>>>>> >>>>>> With c++11, you can also say >>>>>> >>>>>> auto renderer = vtkSmartPointer::New(); >>>>>> >>>>>> which cleans up the smart-pointer case a little bit. >>>>>> >>>>>> For sure, although in the case of class member variables it doesn't >>>>> help, and I would argue vtkNew is cleaner (and vtkNew still uses far fewer >>>>> characters, you got to preserve the finite resources on disk :P ). >>>>> >>>>> >>>>> >>>>> ---------- Forwarded message ---------- >>>>> From: Fcs >>>>> To: vtkusers at vtk.org >>>>> Cc: >>>>> Bcc: >>>>> Date: Mon, 28 May 2018 08:45:51 -0700 (MST) >>>>> Subject: Re: [vtkusers] Understanding vtkSmartPointers >>>>> Dear Mathieu, Marcus and David, thank you for your replies and tips, >>>>> with a >>>>> special thank to Marcus for his extensive explanations which really >>>>> clarified a few of the subtleties of the VTK pointers. >>>>> >>>>> Marcus, I had few extra questions linked to your reply. >>>>> >>>>> >>>>> > I In my opinion you should aim to never call Delete, but to have a >>>>> smart >>>>> > pointer contain the things needed. >>>>> >>>>> Is there any danger in calling Delete()? The case I had in mind was to >>>>> perhaps free the memory occupied by a big structured/unstructured grid >>>>> object which would need to live until a sub-grid is extracted from it. >>>>> >>>>> >>>>> > I think all pipeline API will increase >>>>> > the reference count, and so you only usually need to keep a >>>>> reference to >>>>> > the pipeline objects you are going to keep around/use. The debug >>>>> leaks >>>>> > code >>>>> > will help you verify you got it right. >>>>> >>>>> How good is the guarantee that this will work? "I think" and "usually" >>>>> seem >>>>> to imply that my mileage might vary on this one.. :-) Does it mean >>>>> that >>>>> this should work in general, but that perhaps some exotic or slightly >>>>> buggy >>>>> newer features might not behave correctly? The use case I'm trying to >>>>> implement has a variable number of pre-definied filters which I'm >>>>> chaining >>>>> together. If I test all the possible combinations, and they work, do I >>>>> have >>>>> the guarantee they will always work? >>>>> >>>>> >>>>> > I would add that we have found in bigger applications that a passing >>>>> debug >>>>> > leaks is not always enough, ensuring objects are deleted when they >>>>> are >>>>> > done with is more difficult but necessary, especially in graphical >>>>> > applications that might run for some time. >>>>> >>>>> Does this not imply that every vtkObject created should be stored and >>>>> deleted manually afterwards? Or are there other ways to detect living >>>>> vtkObjects when you don't have a direct member variable pointing to >>>>> it? >>>>> (say, like the vtkPlane created in applyFilters() in my example code..) >>>>> >>>>> >>>>> > It does the exact same thing with no repetition, and is clearer. The >>>>> > examples require backwards compatibility with older VTK, and I don't >>>>> think >>>>> > Bill liked calling .GetPointer()/.Get() on the vtkNew object. You no >>>>> > longer have to do that, but it is a more recent addition to the >>>>> vtkNew API >>>>> > - it will implicitly return the pointer to the contained object as >>>>> > vtkSmartPointer does. >>>>> >>>>> Good to know! Starting from which version is the call to >>>>> .GetPointer()/.Get() no longer needed? We are developing in vtk 6 at >>>>> the >>>>> moment, but we should update to a new version at some point in the near >>>>> future. >>>>> >>>>> Kind regards, >>>>> >>>>> Francois. >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> 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: >>>>> https://vtk.org/mailman/listinfo/vtkusers >>>>> >>>> >>>> >>>> -- >>>> ___________________________________________ >>>> 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: >>> https://public.kitware.com/mailman/listinfo/vtkusers >>> >> > > -- > ___________________________________________ > Andrew J. P. Maclean > > ___________________________________________ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From leodelcarpio at hotmail.com Thu May 31 07:32:51 2018 From: leodelcarpio at hotmail.com (Jota Manrique Del Carpio) Date: Thu, 31 May 2018 11:32:51 +0000 Subject: [vtkusers] (no subject) Message-ID: <2E80AFDB-7A7B-431F-EB32-9B15A53E1015@centurionalarm.com> sup Vtkusers https://goo.gl/ZZANK6 From marcus.hanwell at kitware.com Thu May 31 09:45:57 2018 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Thu, 31 May 2018 09:45:57 -0400 Subject: [vtkusers] vtkChartHistogram2D use case In-Reply-To: <1527716304307-0.post@n5.nabble.com> References: <1527716304307-0.post@n5.nabble.com> Message-ID: On Wed, May 30, 2018 at 5:38 PM, BBerco wrote: > I am trying to use an instance of vtkChartHistogram2D to visualize a > vtkImageData. I think it is a possibility in VTK given the partial example > on page 48 of this document > c9861a548bb1e8807a1d39b43e526a7c4564.pdf> > . > > Unfortunately, the above example is incomplete, and replicating it has been > unsuccessful. Below is what I have so far: a QVTKOpenGLWidget sharing a > vtkGenericOpenGLRenderWindow with a vtkContextView. > > Any advice? > I wrote a number of tests for the charts, such as this one which is fully functional with image regression testing, https://github.com/Kitware/VTK/blob/master/Charts/Core/Testing/Cxx/TestHistogram2D.cxx It shows all elements including using a vtkImageData in the plot. You should be able to use that as a starting point, and adapt. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aida.ninyerola at gmail.com Thu May 31 10:19:11 2018 From: aida.ninyerola at gmail.com (Aida Ninyerola) Date: Thu, 31 May 2018 16:19:11 +0200 Subject: [vtkusers] undefined reference In-Reply-To: References: Message-ID: Hi, I'm sorry but I've tried both proposals and I still get "undefined reference". Can I check something else? Thank you in adavance, Aida On 30 May 2018 at 20:47, Chiranjib Sur wrote: > While running cmake use the option -DVTK_Dir=. > This will solve the undefined search of the "development" libraries your > code need. > Hope that helps. > > > Thanks and regards, > Chiranjib > > On Wed, May 30, 2018 at 10:37 PM, Marc Ruiz Altisent < > marc.ruiz+vtk at gmail.com> wrote: > >> I mean putting them in your CMakeLists.txt in target_link_libraries. >> >> Missatge de Aida Ninyerola del dia dc., 30 de >> maig 2018 a les 18:51: >> >>> Hi, >>> >>> Thanks for your response but I'm not sure if I understand what you say. >>> >>> Do you mean I need to add these libraries in CMakeLists.txt of my >>> project or do I need to make changes in my code? >>> >>> Thank you in advance! >>> Aida >>> >>> On 30 May 2018 at 15:11, Marc Ruiz Altisent >>> wrote: >>> >>>> Hi Aida, >>>> >>>> VTK changed to a modular system some time ago and the library names >>>> changed. You just need to find the new ones. The names match the directory >>>> containg the classes: for example vtkPolyDataToImageStencil is in >>>> Imaging/Stencil and the library is vtkImagingStencil, with a suffix of the >>>> VTK version, e.g. vtkImagingStencil-8.1. Similarly, for vtkImageAccumulate >>>> you need vtkImagingStatistics (+ suffix). >>>> >>>> Missatge de Aida Ninyerola del dia dc., 30 >>>> de maig 2018 a les 14:22: >>>> >>>>> Hi, >>>>> >>>>> While compiling my project I get some linking problems. >>>>> tlQuantification.cpp:(.text+0x1623): undefined reference to >>>>> `vtkPolyDataToImageStencil::New()' >>>>> tlQuantification.cpp:(.text+0x162b): undefined reference to >>>>> `vtkImageAccumulate::New()' >>>>> tlQuantification.cpp:(.text+0x168e): undefined reference to >>>>> `vtkImageAccumulate::SetStencilData(vtkImageStencilData*)' >>>>> >>>>> I found that I sould add in CmakeLists.txt the following lines but I >>>>> doesn't work: >>>>> if(VTK_LIBRARIES) >>>>> target_link_libraries(quantification ${VTK_LIBRARIES} ) >>>>> else() >>>>> target_link_libraries(quantification vtkHybrid vtkWidgets) >>>>> endif() >>>>> >>>>> I'm trying to compile and old project that work properly with a former >>>>> VTK version (I can't remember the VTK version). >>>>> >>>>> I was thinking that maybe is a migration problem but I'm not able to >>>>> find what I need to change. >>>>> >>>>> What I'm doing is clipping an image by a cylinder >>>>> (m_rotate_tformer[id]) to calculate the mean activity of the image inside >>>>> the cylinder. Maybe there is a better way to perform it. >>>>> >>>>> vtkPolyDataToImageStencil* sts = vtkPolyDataToImageStencil::New(); >>>>> vtkImageAccumulate* act = vtkImageAccumulate::New(); >>>>> >>>>> sts->SetInputData(m_rotate_tformer[id]->GetPolyDataOutput()); >>>>> sts->SetInformationInput(vtkInputImage.GetPointer()); >>>>> sts->Update(); >>>>> >>>>> act->SetInputData(vtkInputImage.GetPointer()); >>>>> act->SetStencilData(sts->GetOutput()); >>>>> act->Update(); >>>>> >>>>> I'm running out of ideas. I'll appreciate any idea. >>>>> >>>>> Thanks, >>>>> Aida >>>>> _______________________________________________ >>>>> Powered by www.kitware.com >>>>> >>>>> Visit other Kitware open-source projects at >>>>> http://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: >>>>> https://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: >>> https://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: >> https://public.kitware.com/mailman/listinfo/vtkusers >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jhlegarreta at vicomtech.org Thu May 31 10:46:34 2018 From: jhlegarreta at vicomtech.org (Jon Haitz Legarreta) Date: Thu, 31 May 2018 16:46:34 +0200 Subject: [vtkusers] Deprecate vtkGeo* classes (Sankhesh Jhaveri) In-Reply-To: References: <1527617622636-0.post@n5.nabble.com> <1527618486169-0.post@n5.nabble.com> <1527621592853-0.post@n5.nabble.com> Message-ID: Hi Donny, yes, the remote modules are available to any VTK user by checking the corresponding checkbox/making the corresponding flag be ON in CMake/CMakeLists.txt. The current remotes are available under the Module group of CMake. The examples Andrew identified could also be part of the remote module. If the classes that should be transferred to the remote are all those Sankhesh listed, and we are set to go, I can help you in the process. HTH, JON HAITZ -- On 30 May 2018 at 21:18, Donny Zimmerman wrote: > Thanks Sankhesh. Would this remote repository still be a part of the VTK > project so others can utilize these classes? I do not mind maintaining the > repository, but I have never utilized remote modules in VTK so I am not too > familiar with the process. > > > On Wed, May 30, 2018 at 1:42 PM, Sankhesh Jhaveri > wrote: >> >> Hi Donny, >> >> Seems like going the remote module route is the best way to go. We can >> deprecate and eventually remove the classes from core VTK. >> If you like, you can create (and maintain) a repository for the classes >> you need and add a simple CMake script to your local VTK source checkout for >> adding these classes back in. >> >> See the CMake scripts for other remote modules for examples. >> >> Hope that helps. >> >> Thanks, >> Sankhesh >> >> >> On Tue, May 29, 2018 at 3:19 PM zmantorn wrote: >>> >>> This has been a work in progress for about 10 years. I have not been able >>> to >>> work on it as much as I would like the last few years, but my oldest just >>> graduated high school so I am hoping to get back to work on it. It is a >>> 3D >>> application written in C++ and C# that shows near real time high >>> resolution >>> radar data by radar angle sweeps and by visualizing a volume of all sweep >>> angles. It is important to show the radar sweep in relation to the >>> curvature >>> of the earth since the radar beam does not follow the curve of the earth. >>> >>> I am not sure what you mean by share my work with you? Do you mean share >>> my >>> entire code base with the community? Share the geo parts only? >>> Unfortunately >>> this software is kind of a hobby at this time so there are not any >>> articles >>> published. >>> >>> Thanks. >>> >>> >>> >>> >>> >>> -- >>> 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: >>> https://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: > https://public.kitware.com/mailman/listinfo/vtkusers > From sebastien.murphy at gmail.com Thu May 31 10:49:00 2018 From: sebastien.murphy at gmail.com (smurphy) Date: Thu, 31 May 2018 07:49:00 -0700 (MST) Subject: [vtkusers] Orthographic projection onto arbitrary plane In-Reply-To: References: Message-ID: <1527778140580-0.post@n5.nabble.com> Hello, I am (desperately) trying to make an orthographic projection in a plane of a geometry (see picture attached). The only help I can find online is this thread so I am replying to this old post. I tried to do the following code but without success. It simply place the camera in the correct position but does not actually make the transformation. Am I missing a line, should I pass the transform to the camera in a certain way? Thanks a lot, Sebastien #center of the geometry volume is 0,0, -500 FocalPoint=[0,0,-500] Position=[0,0,-500] ViewUp=[0,0,-500] Transform=vtk.vtkPerspectiveTransform() Transform.SetupCamera(Position, FocalPoint, ViewUp) Transform.Ortho(-1000,1000,-1500,1500,-500,500) -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From rubendibattista at gmail.com Thu May 31 10:57:13 2018 From: rubendibattista at gmail.com (Ruben Di Battista) Date: Thu, 31 May 2018 16:57:13 +0200 Subject: [vtkusers] Display different ImageData Scalar to different Viewport Message-ID: Hello, I'm playing a bit with VTK and its Python bindings. I wrote down a simple case where I generate the distance function of a sphere, I extract the surface from it using the FlyingEdge3D algorithm, then I calculate the curvatures using the vtkCurvatures filter, and then I'd like to show the Mean_Curvature and the Gauss_Curvature in two different viewports. What I tried to do is to use the `SetActiveScalars` method of the `PointData` associated to my `ImageData` dataset, but at the end I get two Viewports showing the same scalar (the last one activated). I also tried to stop the program execution using a debugger and triggering the render before the second scalar is made "active", and it correctly shows the first scalar field. So It's like that the two mappers rendered are "linked". Do I need to do a ShallowCopy somewhere? Here below the `Sphere.show` method. The full code is attached. `self.surface` is an `ImageData` dataset. def show(self): # Render Window rw = vtk.vtkRenderWindow() rw.SetSize(800, 800) # Defining Bounds of Viewports xmins = [0, 0.5] xmaxs = [0.5, 1] ymins = [0, 0] ymaxs = [1, 1] # Curvature Types curv_types = ['Mean_Curvature', 'Gauss_Curvature'] for i in six.moves.range(2): render = vtk.vtkRenderer() rw.AddRenderer(render) # Mean Curvature View render.SetViewport(xmins[i], ymins[i], xmaxs[i], ymaxs[i]) # Create mapper mapper = vtk.vtkPolyDataMapper() self.surface.GetPointData().SetActiveScalars(curv_types[i]) mapper.SetInputData(self.surface) mapper.SetScalarRange(-1, 1) mapper.Update() # ColorBar color_bar = vtk.vtkScalarBarActor() color_bar.SetLookupTable(mapper.GetLookupTable()) # Surface Actor actor = vtk.vtkActor() actor.SetMapper(mapper) actor.GetProperty().EdgeVisibilityOn() render.AddActor(actor) render.AddActor2D(color_bar) # Render Window Interactor rwi = vtk.vtkRenderWindowInteractor() rwi.SetRenderWindow(rw) rwi.Initialize() rwi.Start() -- _ -. .? |???? ', ; |?????? ?? |????????? RdB ,., |?????? .' '. |???? -' `' http://rdb.is -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: sphere.py Type: text/x-python Size: 6763 bytes Desc: not available URL: From sankhesh.jhaveri at kitware.com Thu May 31 11:19:56 2018 From: sankhesh.jhaveri at kitware.com (Sankhesh Jhaveri) Date: Thu, 31 May 2018 11:19:56 -0400 Subject: [vtkusers] Deprecate vtkGeo* classes (Sankhesh Jhaveri) In-Reply-To: References: <1527617622636-0.post@n5.nabble.com> <1527618486169-0.post@n5.nabble.com> <1527621592853-0.post@n5.nabble.com> Message-ID: Hi Donny, Jon beat me to a response. :) But yes, we could possibly check-in the module.remote.cmake script to the VTK repository for vtkGeoVis remote module. Although, I am not sure how useful it would be given that we know of only one user. The remote module infrastructure allows you to drop your own custom module.remote.cmake scripts to your local checkout of VTK source tree. Just by virtue of having this cmake file in the /Remote directory would add a flag for the module to the VTK configuration step. You can read all about it on the wiki page: https://www.vtk.org/Wiki/VTK/Remote_Modules Having said that, this is still a ways from now. The next major version (VTK 9) would just deprecate the classes. They would be removed from VTK in the version that follows - 9.1?. Once they?re removed, you?ll need the remote module for using them. Hope that helps. Sankhesh ? On Thu, May 31, 2018 at 10:47 AM Jon Haitz Legarreta < jhlegarreta at vicomtech.org> wrote: > Hi Donny, > yes, the remote modules are available to any VTK user by checking the > corresponding checkbox/making the corresponding flag be ON in > CMake/CMakeLists.txt. > > The current remotes are available under the Module group of CMake. > > The examples Andrew identified could also be part of the remote module. > > If the classes that should be transferred to the remote are all those > Sankhesh listed, and we are set to go, I can help you in the process. > > HTH, > JON HAITZ > -- > > > > On 30 May 2018 at 21:18, Donny Zimmerman wrote: > > Thanks Sankhesh. Would this remote repository still be a part of the VTK > > project so others can utilize these classes? I do not mind maintaining > the > > repository, but I have never utilized remote modules in VTK so I am not > too > > familiar with the process. > > > > > > On Wed, May 30, 2018 at 1:42 PM, Sankhesh Jhaveri > > wrote: > >> > >> Hi Donny, > >> > >> Seems like going the remote module route is the best way to go. We can > >> deprecate and eventually remove the classes from core VTK. > >> If you like, you can create (and maintain) a repository for the classes > >> you need and add a simple CMake script to your local VTK source > checkout for > >> adding these classes back in. > >> > >> See the CMake scripts for other remote modules for examples. > >> > >> Hope that helps. > >> > >> Thanks, > >> Sankhesh > >> > >> > >> On Tue, May 29, 2018 at 3:19 PM zmantorn wrote: > >>> > >>> This has been a work in progress for about 10 years. I have not been > able > >>> to > >>> work on it as much as I would like the last few years, but my oldest > just > >>> graduated high school so I am hoping to get back to work on it. It is a > >>> 3D > >>> application written in C++ and C# that shows near real time high > >>> resolution > >>> radar data by radar angle sweeps and by visualizing a volume of all > sweep > >>> angles. It is important to show the radar sweep in relation to the > >>> curvature > >>> of the earth since the radar beam does not follow the curve of the > earth. > >>> > >>> I am not sure what you mean by share my work with you? Do you mean > share > >>> my > >>> entire code base with the community? Share the geo parts only? > >>> Unfortunately > >>> this software is kind of a hobby at this time so there are not any > >>> articles > >>> published. > >>> > >>> Thanks. > >>> > >>> > >>> > >>> > >>> > >>> -- > >>> 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: > >>> https://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: > > https://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 zmanvortex at gmail.com Thu May 31 12:37:35 2018 From: zmanvortex at gmail.com (Donny Zimmerman) Date: Thu, 31 May 2018 11:37:35 -0500 Subject: [vtkusers] Deprecate vtkGeo* classes (Sankhesh Jhaveri) In-Reply-To: References: <1527617622636-0.post@n5.nabble.com> <1527618486169-0.post@n5.nabble.com> <1527621592853-0.post@n5.nabble.com> Message-ID: Thanks Jon and Sankhesh. This definitely sounds like the way to go. I will do a little more research on remote modules with the links you provided. I will try to coordinate with you guys to get these classes moved into a remote module before they get deprecated. Can we start on this before they get deprecated, or should we wait until deprecation actually happens? Thanks. On Thu, May 31, 2018 at 10:19 AM, Sankhesh Jhaveri < sankhesh.jhaveri at kitware.com> wrote: > Hi Donny, > > Jon beat me to a response. :) > But yes, we could possibly check-in the module.remote.cmake script to the > VTK repository for vtkGeoVis remote module. Although, I am not sure how > useful it would be given that we know of only one user. The remote module > infrastructure allows you to drop your own custom module.remote.cmake > scripts to your local checkout of VTK source tree. Just by virtue of having > this cmake file in the /Remote directory would add a flag for > the module to the VTK configuration step. You can read all about it on the > wiki page: https://www.vtk.org/Wiki/VTK/Remote_Modules > > Having said that, this is still a ways from now. The next major version > (VTK 9) would just deprecate the classes. They would be removed from VTK in > the version that follows - 9.1?. Once they?re removed, you?ll need the > remote module for using them. > > Hope that helps. > Sankhesh > ? > > On Thu, May 31, 2018 at 10:47 AM Jon Haitz Legarreta < > jhlegarreta at vicomtech.org> wrote: > >> Hi Donny, >> yes, the remote modules are available to any VTK user by checking the >> corresponding checkbox/making the corresponding flag be ON in >> CMake/CMakeLists.txt. >> >> The current remotes are available under the Module group of CMake. >> >> The examples Andrew identified could also be part of the remote module. >> >> If the classes that should be transferred to the remote are all those >> Sankhesh listed, and we are set to go, I can help you in the process. >> >> HTH, >> JON HAITZ >> -- >> >> >> >> On 30 May 2018 at 21:18, Donny Zimmerman wrote: >> > Thanks Sankhesh. Would this remote repository still be a part of the VTK >> > project so others can utilize these classes? I do not mind maintaining >> the >> > repository, but I have never utilized remote modules in VTK so I am not >> too >> > familiar with the process. >> > >> > >> > On Wed, May 30, 2018 at 1:42 PM, Sankhesh Jhaveri >> > wrote: >> >> >> >> Hi Donny, >> >> >> >> Seems like going the remote module route is the best way to go. We can >> >> deprecate and eventually remove the classes from core VTK. >> >> If you like, you can create (and maintain) a repository for the classes >> >> you need and add a simple CMake script to your local VTK source >> checkout for >> >> adding these classes back in. >> >> >> >> See the CMake scripts for other remote modules for examples. >> >> >> >> Hope that helps. >> >> >> >> Thanks, >> >> Sankhesh >> >> >> >> >> >> On Tue, May 29, 2018 at 3:19 PM zmantorn wrote: >> >>> >> >>> This has been a work in progress for about 10 years. I have not been >> able >> >>> to >> >>> work on it as much as I would like the last few years, but my oldest >> just >> >>> graduated high school so I am hoping to get back to work on it. It is >> a >> >>> 3D >> >>> application written in C++ and C# that shows near real time high >> >>> resolution >> >>> radar data by radar angle sweeps and by visualizing a volume of all >> sweep >> >>> angles. It is important to show the radar sweep in relation to the >> >>> curvature >> >>> of the earth since the radar beam does not follow the curve of the >> earth. >> >>> >> >>> I am not sure what you mean by share my work with you? Do you mean >> share >> >>> my >> >>> entire code base with the community? Share the geo parts only? >> >>> Unfortunately >> >>> this software is kind of a hobby at this time so there are not any >> >>> articles >> >>> published. >> >>> >> >>> Thanks. >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> -- >> >>> 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: >> >>> https://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: >> > https://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 bebe0705 at colorado.edu Thu May 31 13:01:44 2018 From: bebe0705 at colorado.edu (BBerco) Date: Thu, 31 May 2018 10:01:44 -0700 (MST) Subject: [vtkusers] vtkChartHistogram2D use case In-Reply-To: References: <1527716304307-0.post@n5.nabble.com> Message-ID: <1527786104721-0.post@n5.nabble.com> Thanks, I got the example to work on its own. Wrapping Qt around the example is still problematic, as I want to display the histogram in a QDialog that comes with a Qt/VTK Widget, and several Qt buttons use for image browsing or window termination. Basically, I haven't been able to figure out the right combination of Qt/VTK Widget and rendering window types that would make this work: [1.] Using a *QVTKOpenGLWidget* and *vtkGenericOpenGLRenderWindow* leaves the rendering window dark, just as if *this -> view -> GetScene() -> AddItem(histo);* had had no effect [2.] Using a *QVTKWidget* and a *vtkRenderWindow* appears to "work" at first (see below), with two snags: - I get a deprecation warning : *warning: 'QVTKWidget::QVTKWidget(QWidget*, Qt::WindowFlags)' is deprecated * - More importantly, I cannot with the buttons underneath the QVTKWidget anymore. The only way I can close the QDialog is by clicking on the close button in the upper left corner -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From bebe0705 at colorado.edu Thu May 31 13:31:56 2018 From: bebe0705 at colorado.edu (BBerco) Date: Thu, 31 May 2018 10:31:56 -0700 (MST) Subject: [vtkusers] vtkChartHistogram2D use case In-Reply-To: <1527786104721-0.post@n5.nabble.com> References: <1527716304307-0.post@n5.nabble.com> <1527786104721-0.post@n5.nabble.com> Message-ID: <1527787916000-0.post@n5.nabble.com> Turns out the vtkGenericOpenGLRenderWindow / QVTKOpenGLWidget is giving me an image. But not the one I want. There appears to be an encoding error of some kind after the chart has been passed to the context view and the QVTKOpenGLWidget is rendering: Generic Warning: In /tmp/vtk-20180515-93342-16fritw/VTK-8.1.1/Common/Core/vtkUnicodeString.cxx, line 183 vtkUnicodeString::from_utf8(): not a valid UTF-8 string. The Widget itself behaves as expected (the buttons can be interacted with), but the image does not show. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From mark.ostroot at lickenbrocktech.com Thu May 31 13:43:49 2018 From: mark.ostroot at lickenbrocktech.com (mark.ostroot at lickenbrocktech.com) Date: Thu, 31 May 2018 10:43:49 -0700 Subject: [vtkusers] vtkVolumeMapper::IsoSurface_Blend missing, Real time Isosurface help Message-ID: <20180531104349.c7db654a879d86b78cfcacc46040d57b.c54b348532.mailapi@email09.godaddy.com> Hello, I am trying to implement a real time isoSurface on a volume and I was looking into using the vtkVolumeMapper::ISOSURFACE_BLEND for this application. I came across this on the VTK website: https://blog.kitware.com/gpu-rendering-of-isosurfaces/ However in vtk 8.1 Isosurface_blend is not exposed in the vtkVolumeMapper::BlendModes. I was wondering if this has been implemented and exposed in vtk, I know the feature is in paraview at the moment. Also if anyone has any ideas on implementing a real time Isosurface on a volume I would appreciate any input. Thanks in advance, Mark O -------------- next part -------------- An HTML attachment was scrubbed... URL: From bjhulsey at gmail.com Thu May 31 13:58:17 2018 From: bjhulsey at gmail.com (B.J. Hulsey) Date: Thu, 31 May 2018 12:58:17 -0500 Subject: [vtkusers] Pip install vtk for Python 3.x Message-ID: Hello, When I install vtk using "pip3.5 install vtk" it is installed under python 2. Why is that and how do I install under python 3? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Thu May 31 14:13:03 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Thu, 31 May 2018 14:13:03 -0400 Subject: [vtkusers] vtkVolumeMapper::IsoSurface_Blend missing, Real time Isosurface help In-Reply-To: <20180531104349.c7db654a879d86b78cfcacc46040d57b.c54b348532.mailapi@email09.godaddy.com> References: <20180531104349.c7db654a879d86b78cfcacc46040d57b.c54b348532.mailapi@email09.godaddy.com> Message-ID: Michael added this after 8.1. It will appear in the next VTK release. Try VTK master until then. David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Thu, May 31, 2018 at 1:43 PM, wrote: > Hello, > > I am trying to implement a real time isoSurface on a volume and I was > looking into using the vtkVolumeMapper::ISOSURFACE_BLEND for this > application. > I came across this on the VTK website: https://blog.kitware.com/gpu- > rendering-of-isosurfaces/ > However in vtk 8.1 Isosurface_blend is not exposed in the > vtkVolumeMapper::BlendModes. I was wondering if this has been implemented > and exposed in vtk, I know the feature is in paraview at the moment. > > Also if anyone has any ideas on implementing a real time Isosurface on a > volume I would appreciate any input. > > Thanks in advance, > Mark O > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://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: > https://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.mccormick at kitware.com Thu May 31 14:18:08 2018 From: matt.mccormick at kitware.com (Matt McCormick) Date: Thu, 31 May 2018 14:18:08 -0400 Subject: [vtkusers] Pip install vtk for Python 3.x In-Reply-To: References: Message-ID: Hello, Please try python3 -m pip install vtk to ensure the desired Python starts the process. HTH, Matt On Thu, May 31, 2018 at 1:58 PM B.J. Hulsey wrote: > Hello, > > When I install vtk using "pip3.5 install vtk" it is installed under python > 2. Why is that and how do I install under python 3? > > > > Thanks. > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From geoff.woodcock at velo3d.com Thu May 31 14:24:32 2018 From: geoff.woodcock at velo3d.com (Geoff Woodcock) Date: Thu, 31 May 2018 18:24:32 +0000 Subject: [vtkusers] pipeline setup question Message-ID: Hi, I've created a pipeline to try and do "collision detection" for use with copy/paste using vtkIntersectionPolyDataFilter. Basically, I get a set of bounding boxes for objects already in the scene and then another set for the objects being pasted. Then I move the position of the pasted objects around, recalculate the bounding boxes, and test for intersection until it fails. The pipeline is like this: CubeSource(1..n) -> appendfilter -> geometry filter -> trianglefilter -intersectfilter 2 pipelines, one for objects already in scene, one for objects being pasted. I have several problems: * vtkIntersectionPolyDataFilter crashes sometimes when there are multiple objects in the scene or being pasted. It might be a known bug related to https://gitlab.kitware.com/vtk/vtk/commit/eb975a3742de5aa5592fbb7ba2dd4726c9a51313 * vtkIntersectionPolyDataFilter does not handle the case where one object is inside of the other (no intersection occurs) * I tried to work around this bug by testing each bounding box separately. So I assign the cubesources one at a time to the appendfilter. When I do this, I get a message, "Can't build OBB tree, no data available", followed by a crash in vtkOBBTree::DisjointOBBNodes. ("nodeA was nullPtr") Other than an any general advice anyone can give me, can anyone explain the third item? If I assign the cubesources as I build the pipeline, it works correctly. But if I assign them after the pipeline is built, it crashes...why? There is something fundamental I am not understanding about the pipeline. Here is my messy test code... commenting and uncommenting the two indicated lines makes the crash come and go... vtkSmartPointer intersectFilter = vtkSmartPointer::New(); vtkSmartPointer appendFilter = vtkSmartPointer::New(); // get bounding box of all existing actors std::vector> bboxes; std::vector> cubes; double bounds[6]; double maxBounds[3] = {0}; for (const auto& object : doc->getChildren()) { auto actor = vtkProp3D::SafeDownCast(Core::Application::get()->getContext().getActorForPart(object)); if (actor->GetPickable()) { double origin[3]; actor->GetOrigin(origin); actor->GetBounds(bounds); if (bounds[1] > maxBounds[0]) { maxBounds[0] = bounds[1]; } if (bounds[3] > maxBounds[1]) { maxBounds[1] = bounds[3]; } if (bounds[5] > maxBounds[2]) { maxBounds[2] = bounds[5]; } } std::vector values = {bounds[0], bounds[1], bounds[2], bounds[3], bounds[4], bounds[5], bounds[6]}; bboxes.push_back(values); vtkSmartPointer cube = vtkSmartPointer::New(); cube->SetBounds(bounds); cube->Update(); cubes.push_back(cube); appendFilter->AddInputConnection(cube->GetOutputPort()); // <---- works if I add connections here. } vtkSmartPointer geometryFilter = vtkSmartPointer::New(); geometryFilter->SetInputConnection(appendFilter->GetOutputPort()); vtkSmartPointer triFilter = vtkSmartPointer::New(); triFilter->SetInputConnection(geometryFilter->GetOutputPort(0)); intersectFilter->SetInputConnection(0, triFilter->GetOutputPort()); // get bounding box of all objects std::vector> pasteObjectBounds; vtkSmartPointer pastedObjAppendFilter = vtkSmartPointer::New(); for (const auto& object : _copyPasteBuffer) { vtkSmartPointer polyData = vtkSmartPointer::New(); polyData->ShallowCopy(object->data()); polyData->ComputeBounds(); polyData->GetBounds(bounds); vtkSmartPointer cube = vtkSmartPointer::New(); auto layout = object->layout(); auto x = layout._matrix->GetElement(0, 3); auto y = layout._matrix->GetElement(1, 3); cube->SetBounds(bounds); cube->SetCenter(x, y, 0); cube->Update(); pastedObjAppendFilter->AddInputConnection(cube->GetOutputPort()); pasteObjectBounds.push_back(cube); } pastedObjAppendFilter->Update(); vtkSmartPointer pastedObjGeometryFilter = vtkSmartPointer::New(); pastedObjGeometryFilter->SetInputConnection(pastedObjAppendFilter->GetOutputPort()); pastedObjGeometryFilter->Update(); vtkSmartPointer pasteTriFilter = vtkSmartPointer::New(); pasteTriFilter->SetInputConnection(pastedObjGeometryFilter->GetOutputPort(0)); pasteTriFilter->Update(); vtkSmartPointer pasteCleanData = vtkSmartPointer::New(); pasteCleanData->SetInputConnection(pasteTriFilter->GetOutputPort()); pasteCleanData->Update(); intersectFilter->SetInputConnection(1, pasteCleanData->GetOutputPort()); bool foundASpot = false; auto polyData = vtkPolyData::SafeDownCast(pastedObjGeometryFilter->GetOutputDataObject(0)); polyData->ComputeBounds(); polyData->GetBounds(bounds); double p1[3] = {bounds[0], bounds[2], 0}; double p2[3] = {bounds[1], bounds[3], 0}; double length = sqrt(vtkMath::Distance2BetweenPoints(p1, p2)); double step = length / 4.0; double radius = 0; while (!foundASpot) { for (int ii = 0; ii < 6 && !foundASpot; ii++) { double angle = 45 * ii; double x = radius * sin(angle); double y = radius * cos(angle); for (auto cube : pasteObjectBounds) { double center[3]; cube->GetCenter(center); center[0] += x; center[1] += y; cube->SetCenter(center); cube->Update(); cube->Modified(); } // check for intersection. foundASpot = true; for (auto cube : cubes) { //appendFilter->SetInputConnection(cube->GetOutputPort());// <----fails if I set input connection here. appendFilter->Update(); appendFilter->Modified(); geometryFilter->Update(); geometryFilter->Modified(); triFilter->Update(); triFilter->Modified(); intersectFilter->Update(); if (intersectFilter->GetNumberOfIntersectionPoints()) { foundASpot = false; } } if (!foundASpot) { for (auto pasteCubes : pasteObjectBounds) { double center[3]; pasteCubes->GetCenter(center); center[0] -= x; center[1] -= y; pasteCubes->SetCenter(center); pasteCubes->Update(); pasteCubes->Modified(); } } else { // found a spot! foundASpot = true; maxBounds[0] = x; maxBounds[1] = y; } } radius += step; } CONFIDENTIALITY NOTICE:This message (including any attachments) may contain confidential, proprietary, privileged and/or private information. If you are not the intended recipient of this message, please notify the sender immediately, and delete the message and any attachments. Any disclosure, reproduction, distribution or other use of this message or any attachments by an individual or entity other than the intended recipient is prohibited -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.ostroot at lickenbrocktech.com Thu May 31 15:49:12 2018 From: mark.ostroot at lickenbrocktech.com (mark.ostroot at lickenbrocktech.com) Date: Thu, 31 May 2018 12:49:12 -0700 Subject: [vtkusers] vtkVolumeMapper::IsoSurface_Blend missing, Real time Isosurface help In-Reply-To: Message-ID: <20180531124912.c7db654a879d86b78cfcacc46040d57b.257ec69ef7.mailapi@email09.godaddy.com> Thanks, Do you know if that will be in the next vtk 8 patch, or would that be vtk 9? I'll check out the master branch in the mean time. -Mark --------- Original Message --------- Subject: Re: [vtkusers] vtkVolumeMapper::IsoSurface_Blend missing, Real time Isosurface help From: "David E DeMarle" Date: 5/31/18 11:13 am To: mark.ostroot at lickenbrocktech.com Cc: "vtkusers at vtk.org" Michael added this after 8.1. It will appear in the next VTK release. Try VTK master until then. David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Thu, May 31, 2018 at 1:43 PM, wrote: Hello, I am trying to implement a real time isoSurface on a volume and I was looking into using the vtkVolumeMapper::ISOSURFACE_BLEND for this application. I came across this on the VTK website: https://blog.kitware.com/gpu-rendering-of-isosurfaces/ However in vtk 8.1 Isosurface_blend is not exposed in the vtkVolumeMapper::BlendModes. I was wondering if this has been implemented and exposed in vtk, I know the feature is in paraview at the moment. Also if anyone has any ideas on implementing a real time Isosurface on a volume I would appreciate any input. Thanks in advance, Mark O _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://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: https://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Thu May 31 16:07:13 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 31 May 2018 14:07:13 -0600 Subject: [vtkusers] Display different ImageData Scalar to different Viewport In-Reply-To: References: Message-ID: Hi Ruben, Instead of data.SetActiveScalars(), use mapper.SetArrayId(i) or mapper.SetArrayName(name). - David On Thu, May 31, 2018 at 8:57 AM, Ruben Di Battista < rubendibattista at gmail.com> wrote: > Hello, > I'm playing a bit with VTK and its Python bindings. I wrote down a simple > case where I generate the distance function of a sphere, I extract the > surface from it using the FlyingEdge3D algorithm, then I calculate the > curvatures using the vtkCurvatures filter, and then I'd like to show the > Mean_Curvature and the Gauss_Curvature in two different viewports. > > What I tried to do is to use the `SetActiveScalars` method of the > `PointData` associated to my `ImageData` dataset, but at the end I get two > Viewports showing the same scalar (the last one activated). I also tried to > stop the program execution using a debugger and triggering the render > before the second scalar is made "active", and it correctly shows the first > scalar field. So It's like that the two mappers rendered are "linked". > > Do I need to do a ShallowCopy somewhere? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Thu May 31 16:21:47 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 31 May 2018 14:21:47 -0600 Subject: [vtkusers] Orthographic projection onto arbitrary plane In-Reply-To: <1527778140580-0.post@n5.nabble.com> References: <1527778140580-0.post@n5.nabble.com> Message-ID: Hi Sebastien, So your goal is to make VTK do an orthographic projection instead of a perspective projection? If so then you don't have to build your own transform, the camera has an orthographic mode that it calls the "ParallelProjection" mode: camera = renderer.GetActiveCamera() camera.ParallelProjectionOn() camera.SetParallelScale(500.0) # tweak as needed Set the camera pose in the usual way: camera.SetFocalPoint(0.0, 0.0, 0.0) camera.Position(0.0, 0.0, -500.0) camera.SetViewUp(0.0, 1.0, 0.0) Hope this helps. - David On Thu, May 31, 2018 at 8:49 AM, smurphy wrote: > Hello, > > I am (desperately) trying to make an orthographic projection in a plane of > a > geometry (see picture attached). > The only help I can find online is this thread so I am replying to this old > post. > I tried to do the following code but without success. It simply place the > camera in the correct position but does not actually make the > transformation. Am I missing a line, should I pass the transform to the > camera in a certain way? > Thanks a lot, > Sebastien > > #center of the geometry volume is 0,0, -500 > FocalPoint=[0,0,-500] > Position=[0,0,-500] > ViewUp=[0,0,-500] > Transform=vtk.vtkPerspectiveTransform() > Transform.SetupCamera(Position, FocalPoint, ViewUp) > Transform.Ortho(-1000,1000,-1500,1500,-500,500) > 2018-05-31_at_16.png> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Thu May 31 16:25:58 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Thu, 31 May 2018 16:25:58 -0400 Subject: [vtkusers] vtkVolumeMapper::IsoSurface_Blend missing, Real time Isosurface help In-Reply-To: <20180531124912.c7db654a879d86b78cfcacc46040d57b.257ec69ef7.mailapi@email09.godaddy.com> References: <20180531124912.c7db654a879d86b78cfcacc46040d57b.257ec69ef7.mailapi@email09.godaddy.com> Message-ID: It is a new feature not a bug fix so it would not show up in a hypothetical 8.1.2 patch release. But otherwise, yes it will be in the next release. Most likely that will be 9.0.0, but there is a chance it will be called 8.2.0. In either case it is going to be a few months until it appears in an official VTK release. David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Thu, May 31, 2018 at 3:49 PM, wrote: > Thanks, > > Do you know if that will be in the next vtk 8 patch, or would that be vtk > 9? I'll check out the master branch in the mean time. > > -Mark > > > --------- Original Message --------- > Subject: Re: [vtkusers] vtkVolumeMapper::IsoSurface_Blend missing, Real > time Isosurface help > From: "David E DeMarle" > Date: 5/31/18 11:13 am > To: mark.ostroot at lickenbrocktech.com > Cc: "vtkusers at vtk.org" > > Michael added this after 8.1. It will appear in the next VTK release. > > Try VTK master until then. > > > David E DeMarle > Kitware, Inc. > Principal Engineer > 21 Corporate Drive > > Clifton Park, NY 12065 > > -8662 > Phone: 518-881-4909 > > On Thu, May 31, 2018 at 1:43 PM, wrote: > >> Hello, >> >> I am trying to implement a real time isoSurface on a volume and I was >> looking into using the vtkVolumeMapper::ISOSURFACE_BLEND for this >> application. >> I came across this on the VTK website: https://blog.kitware.com/gpu- >> rendering-of-isosurfaces/ >> However in vtk 8.1 Isosurface_blend is not exposed in the >> vtkVolumeMapper::BlendModes. I was wondering if this has been implemented >> and exposed in vtk, I know the feature is in paraview at the moment. >> >> Also if anyone has any ideas on implementing a real time Isosurface on a >> volume I would appreciate any input. >> >> Thanks in advance, >> Mark O >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at http://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: >> https://public.kitware.com/mailman/listinfo/vtkusers >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Thu May 31 16:26:37 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 31 May 2018 14:26:37 -0600 Subject: [vtkusers] Orthographic projection onto arbitrary plane In-Reply-To: References: <1527778140580-0.post@n5.nabble.com> Message-ID: The camera also has a SetViewShear() method you might find useful: camera.SetViewShear(0.1, 0.1, 0.0) - David On Thu, May 31, 2018 at 2:21 PM, David Gobbi wrote: > Hi Sebastien, > > So your goal is to make VTK do an orthographic projection instead of > a perspective projection? If so then you don't have to build your own > transform, the camera has an orthographic mode that it calls the > "ParallelProjection" mode: > > camera = renderer.GetActiveCamera() > camera.ParallelProjectionOn() > camera.SetParallelScale(500.0) # tweak as needed > > Set the camera pose in the usual way: > > camera.SetFocalPoint(0.0, 0.0, 0.0) > camera.Position(0.0, 0.0, -500.0) > camera.SetViewUp(0.0, 1.0, 0.0) > > Hope this helps. > > - David > > > > On Thu, May 31, 2018 at 8:49 AM, smurphy > wrote: > >> Hello, >> >> I am (desperately) trying to make an orthographic projection in a plane >> of a >> geometry (see picture attached). >> The only help I can find online is this thread so I am replying to this >> old >> post. >> I tried to do the following code but without success. It simply place the >> camera in the correct position but does not actually make the >> transformation. Am I missing a line, should I pass the transform to the >> camera in a certain way? >> Thanks a lot, >> Sebastien >> >> #center of the geometry volume is 0,0, -500 >> FocalPoint=[0,0,-500] >> Position=[0,0,-500] >> ViewUp=[0,0,-500] >> Transform=vtk.vtkPerspectiveTransform() >> Transform.SetupCamera(Position, FocalPoint, ViewUp) >> Transform.Ortho(-1000,1000,-1500,1500,-500,500) >> > 018-05-31_at_16.png> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bebe0705 at colorado.edu Thu May 31 16:40:46 2018 From: bebe0705 at colorado.edu (BBerco) Date: Thu, 31 May 2018 13:40:46 -0700 (MST) Subject: [vtkusers] vtkChartHistogram2D use case In-Reply-To: <1527786104721-0.post@n5.nabble.com> References: <1527716304307-0.post@n5.nabble.com> <1527786104721-0.post@n5.nabble.com> Message-ID: <1527799246003-0.post@n5.nabble.com> Got it! It turns out that I had to manually resize the enclosing QDialog prior to calling Render() for the first time for the plot to show. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html