From masterwangzx at gmail.com Thu Nov 1 08:44:52 2018 From: masterwangzx at gmail.com (Franks) Date: Thu, 1 Nov 2018 05:44:52 -0700 (MST) Subject: [vtkusers] the question about smart pointer Message-ID: <1541076292538-0.post@n5.nabble.com> Hi list, I have got a problem about the use of vtkSmartPointer. For vtkSmartPointer Reader = vtkSmartPointer::New(); vtkPolyData* pd = Reader->GetOutput(); , /VTK/Tutorials/SmartPointers/ says *when the reader object goes out of scope, the data is deleted*. I just can not understand What is the meaning of out of scope. Does it means out of {}? I write some code to confirm it. vtkSmartPointer test() { auto reader = vtkSmartPointer::New(); reader->SetFileName("../res/lena.bmp"); reader->Update(); auto changer = vtkSmartPointer::New(); changer->SetInputData(reader->GetOutput()); return changer; } TEST_F(VTKTest,Execute){ auto changer = test(); auto imgActor = vtkSmartPointer::New(); imgActor->GetMapper()->SetInputConnection(changer->GetOutputPort()); auto renderer = vtkSmartPointer::New(); renderer->AddActor(imgActor); renderer->SetBackground(1.0, 1.0, 1.0); auto renderWindow = vtkSmartPointer::New(); renderWindow->AddRenderer(renderer); renderWindow->Render(); auto renderWindowInteractor = vtkSmartPointer::New(); auto style = vtkSmartPointer::New(); renderWindowInteractor->SetInteractorStyle(style); renderWindowInteractor->SetRenderWindow(renderWindow); renderWindowInteractor->Initialize(); renderWindowInteractor->Start(); } >From the above code, I think the object reader will delete when the function test() return. When the object reader deleted, the reader's output data delete and no data streams to object changer and the following object. But my thought was wrong, the program run well. I do not konw where am I wrong. I look forward to hearing from you. Best regards, Frank -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From dave.demarle at kitware.com Thu Nov 1 12:36:31 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Thu, 1 Nov 2018 12:36:31 -0400 Subject: [vtkusers] VTK 8.2 and deprecation of visual studio 2013 Message-ID: Hi folks, A couple of items for the group. 1. I am going to branch for VTK 8.2 on Monday. We'll do release candidates so you can expect 8.2.0 to be out in about a month. I will also put out a VTK 8.1.2 on Monday. This is what is now in the release branch. It has just a couple of fixes in it over 8.1.1. 2. We are going to deprecate Visual Studio 2013 support in 8.2. The reason being that we need the more complete C++11 feature set in VS 2015. 8.2 will still work with VS 2013, you will just get a warning when you configure it with CMake. At some point after the 8.2 branch, VTK master will no longer build with 2013. You feedback on either item is appreciated. thanks David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Thu Nov 1 13:04:19 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Thu, 1 Nov 2018 18:04:19 +0100 Subject: [vtkusers] [vtk-developers] VTK 8.2 and deprecation of visual studio 2013 In-Reply-To: References: Message-ID: Den tors 1 nov. 2018 17:36David E DeMarle skrev: > Hi folks, > > A couple of items for the group. > > 1. I am going to branch for VTK 8.2 on Monday. We'll do release candidates > so you can expect 8.2.0 to be out in about a month. I will also put out a > VTK 8.1.2 on Monday. This is what is now in the release branch. It has just > a couple of fixes in it over 8.1.1. > > 2. We are going to deprecate Visual Studio 2013 support in 8.2. The reason > being that we need the more complete C++11 feature set in VS 2015. 8.2 will > still work with VS 2013, you will just get a warning when you configure it > with CMake. At some point after the 8.2 branch, VTK master will no longer > build with 2013. > > You feedback on either item is appreciated. > All sounds sensible, so only positive feedback here. We're on VS 2015, planning to move to 2017 soon. Elvis > thanks > > David E DeMarle > Kitware, Inc. > Principal Engineer > 21 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-881-4909 > _______________________________________________ > 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://public.kitware.com/mailman/listinfo/vtk-developers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From avcs_silwal at hotmail.com Thu Nov 1 18:32:13 2018 From: avcs_silwal at hotmail.com (avcs2080) Date: Thu, 1 Nov 2018 15:32:13 -0700 (MST) Subject: [vtkusers] RemoveVertices chnages the vertex list Message-ID: <1541111533799-0.post@n5.nabble.com> Let's say I have a graph which has 10 vertices. When I use the vertex iterator and print the vertex list it looks like this. "001", "002"............ "010" These are essentially the pedigree Ids. Now, I delete two vertices ("001" and "010") using the RemoveVertices(vertex_id_array) function and the print the new vertex list. Surprisingly, the sequence of the vertex list is not maintained, it looks something like this. "009", "002","003".................."008". How do I maintain the sequence once I remove vertices or reorder the new vertex list? This is essential for my algorithm -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From meakcey at gmail.com Thu Nov 1 20:22:18 2018 From: meakcey at gmail.com (meakcey) Date: Thu, 1 Nov 2018 17:22:18 -0700 (MST) Subject: [vtkusers] Point Smoothing In-Reply-To: <1540995648660-0.post@n5.nabble.com> References: <1540995648660-0.post@n5.nabble.com> Message-ID: <1541118138400-0.post@n5.nabble.com> Somehow any of PointSmoothing related functions did not work. Finally that has resolved by adding glEnable(GL_POINT_SMOOTH) before renderVTK(); Much better like below ... actor->SetMapper(mapper) renderer->AddActor(actor); glEnable( GL_POINT_SMOOTH ); glEnable( GL_BLEND ); glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); glPointSize( 2.0 ); renderVTK(); -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From isalako1 at sheffield.ac.uk Fri Nov 2 04:30:46 2018 From: isalako1 at sheffield.ac.uk (Idayat Salako) Date: Fri, 2 Nov 2018 08:30:46 +0000 Subject: [vtkusers] missing vtk library for vtk5 compilation In-Reply-To: References: Message-ID: Still missing library issue after downgrading to visual studio 2013. Any suggestions on how to fix this please? On Wed, Oct 24, 2018, 11:57 Idayat Salako wrote: > Cmake: v3.12.2-win64-x64 > OS: Windows > Visual studio: Community 2017 > > I am building a program that requires an older version of vtk due to > compatibility issues. I have currently downloaded VTK v5.0.0 from ( > https://gitlab.kitware.com/vtk/vtk/tree/v5.0.0) but I get missing library > error (cannot open input file......vtkRendering.lib) when i compile in > visual studio; this is after i have configured/generated in cmake. Any idea > how I might get this library or how to avoid this error to compile vtk 5.0? > > [image: image.png] > Thanks in advance for your help. > > Thank you > Idayat Salako > > ***Whoever wakes up in the morning and is safe in his home, in good health > and has enough provision for the day, it is as if he has all the good > things of this world [HadithTirmidhi 2346]*** > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 216896 bytes Desc: not available URL: From will.schroeder at kitware.com Fri Nov 2 06:34:38 2018 From: will.schroeder at kitware.com (Will Schroeder) Date: Fri, 2 Nov 2018 06:34:38 -0400 Subject: [vtkusers] New class for contouring unstructured grids Message-ID: If you are interested in a new class for fast contouring of 3D unstructured grids, read on. The class VTK/Filters/Core/vtkContour3DLinearGrid is a threaded, high-performance filter for generating isocontours from unstructured grids. It is specialized for 3D linear cells: any combination of tetrahedra, hexahedra, voxels, pyramids, and/or wedges. (Other cell types are skipped.) In practice we routinely see 10-20x speed ups. In an extreme case we saw a 1000x speedup (a customer's tetrahedral mesh with over 500millions tets). Of course this depends on the number of threads and the particulars of the data so YMMV. By default the class has a fast path where it just generates output triangles and points, and the points are not merged (i.e., coincident points exist in the output). Other available features, at the cost of some speed, are point merging, attribute interpolation, and/or point normal generation. (Note that for dense input meshes the fast path often produces acceptable results; other options can be enabled as needed or in a progressive rendering approach.) The speed comes from 1) threading, 2) a new edge locator (vtkStaticEdgeLocatorTemplate.h/.txx) which identifies coincident points by sorting edge tuples (v0,v1), 3) templating, and 4) better and more efficient algorithm design. In particular,#2) above: contouring in VTK typically relies on point locators to merge coincident points. This is not only a parallel computing bottleneck, but the locator binning can execute very slowly when lots of points fall into the same locator bin. (For example: an unstructured mesh that resolves tiny flow features like a boundary layer etc.) The edge locator eliminates this behavior. Furthermore, duplicate points are identified by using a parallel sort of edge tuples using vtkSMPTools:Sort() - much faster than the point locator's InsertUniquePoint(). The effect of threading on performance is modest - it doesn't scale all that well on the tests we've tried. My guess is that the data bus is saturated as the algorithm does a small amount of computation which can produce a large amount of output. (Set the CMake variable VTK_SMP_IMPLEMENTATION_TYPE to something other than Sequential- I use TBB - to enable threading. See this blog for more information.) Like any new algorithm I'm sure there are issues. If you are so inclined, please try the filter and provide feedback. At some point we'll integrate the algorithm into ParaView but it may be awhile as we are swamped :-) Best, -- William J. Schroeder, PhD Kitware, Inc. - Building the World's Technical Computing Software 28 Corporate Drive Clifton Park, NY 12065 will.schroeder at kitware.com http://www.kitware.com (518) 881-4902 -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Fri Nov 2 07:34:24 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Fri, 2 Nov 2018 07:34:24 -0400 Subject: [vtkusers] missing vtk library for vtk5 compilation In-Reply-To: References: Message-ID: Were there any compilation problems of vtk 5.0 itself in vis studio 2013? vtk5.0 predated vs2013 so it is entirely possible what it is incompatible without modification. You might have more luck with vtk 5.8 or .10. Application side changes might be less extensive with them. On Fri, Nov 2, 2018, 4:31 AM Idayat Salako Still missing library issue after downgrading to visual studio 2013. Any > suggestions on how to fix this please? > > On Wed, Oct 24, 2018, 11:57 Idayat Salako > wrote: > >> Cmake: v3.12.2-win64-x64 >> OS: Windows >> Visual studio: Community 2017 >> >> I am building a program that requires an older version of vtk due to >> compatibility issues. I have currently downloaded VTK v5.0.0 from ( >> https://gitlab.kitware.com/vtk/vtk/tree/v5.0.0) but I get missing >> library error (cannot open input file......vtkRendering.lib) when i compile >> in visual studio; this is after i have configured/generated in cmake. Any >> idea how I might get this library or how to avoid this error to compile vtk >> 5.0? >> >> [image: image.png] >> Thanks in advance for your help. >> >> Thank you >> Idayat Salako >> >> ***Whoever wakes up in the morning and is safe in his home, in good >> health and has enough provision for the day, it is as if he has all the >> good things of this world [HadithTirmidhi 2346]*** >> >> _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 216896 bytes Desc: not available URL: From david.gobbi at gmail.com Fri Nov 2 14:08:48 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 2 Nov 2018 12:08:48 -0600 Subject: [vtkusers] the question about smart pointer In-Reply-To: <1541076292538-0.post@n5.nabble.com> References: <1541076292538-0.post@n5.nabble.com> Message-ID: Hi Frank, The scope is essentially the enclosing "{ }", but you are missing a bit of information about how VTK objects are reference counted. When you create a VTK object with vtkSmartPointer<...>::New(), the object is created with a reference count of 1, and the New() returns a smart pointer. When that smart pointer goes out of scope, the reference count of the object is decremented. It's important to note that the reference count is stored in the object, not in the smart pointer! So if the reference count of an object is greater than 1, then the object will not be deleted when the smart pointer goes out of scope. But in the case of your reader, its reference count is 1, so it will be deleted. The reason its output isn't deleted is because you have done this: changer->SetInputData(reader->GetOutput()); The 'output' object has its own reference count, which is incremented when you call SetInputData( output ). In other words, after you give the reader's output to the changer, the changer holds a reference to it. So at the end of the scope of your test() function, the reader will be deleted, but its output will not be deleted. David On Thu, Nov 1, 2018 at 6:45 AM Franks wrote: > Hi list, > > I have got a problem about the use of vtkSmartPointer. For > vtkSmartPointer Reader = > vtkSmartPointer::New(); > vtkPolyData* pd = Reader->GetOutput(); , > /VTK/Tutorials/SmartPointers/ says *when the reader object goes out of > scope, the data is deleted*. I just can not understand What is the meaning > of out of scope. Does it means out of {}? I write some code to confirm it. > > vtkSmartPointer test() { > auto reader = vtkSmartPointer::New(); > reader->SetFileName("../res/lena.bmp"); > reader->Update(); > auto changer = vtkSmartPointer::New(); > changer->SetInputData(reader->GetOutput()); > > return changer; > } > > TEST_F(VTKTest,Execute){ > auto changer = test(); > auto imgActor = vtkSmartPointer::New(); > imgActor->GetMapper()->SetInputConnection(changer->GetOutputPort()); > > auto renderer = vtkSmartPointer::New(); > renderer->AddActor(imgActor); > renderer->SetBackground(1.0, 1.0, 1.0); > > auto renderWindow = vtkSmartPointer::New(); > renderWindow->AddRenderer(renderer); > renderWindow->Render(); > > auto renderWindowInteractor = > vtkSmartPointer::New(); > auto style = vtkSmartPointer::New(); > > renderWindowInteractor->SetInteractorStyle(style); > renderWindowInteractor->SetRenderWindow(renderWindow); > renderWindowInteractor->Initialize(); > > renderWindowInteractor->Start(); > } > > From the above code, I think the object reader will delete when the > function > test() return. When the object reader deleted, the reader's output data > delete and no data streams to object changer and the following object. But > my thought was wrong, the program run well. I do not konw where am I wrong. > > I look forward to hearing from you. > Best regards, > Frank > -------------- next part -------------- An HTML attachment was scrubbed... URL: From masterwangzx at gmail.com Fri Nov 2 20:28:06 2018 From: masterwangzx at gmail.com (Franks) Date: Fri, 2 Nov 2018 17:28:06 -0700 (MST) Subject: [vtkusers] the question about smart pointer In-Reply-To: References: <1541076292538-0.post@n5.nabble.com> Message-ID: <1541204886358-0.post@n5.nabble.com> Thank you for getting back to me. I still have some question about it. As to VTK/Tutorials, it may run like you said when I write /vtkSmartPointer pd = Reader->GetOutput();/ . However, the output is just a normal pointer, so it may depend on the reader. I may misunderstand the tutorials, you can check out this link https://www.vtk.org/Wiki/VTK/Tutorials/SmartPointers (under the title /Getting an Object with a Smart Pointer/ ). Does the changer get a copy of output? Thank you for your attention to this matter. Frank -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From masterwangzx at gmail.com Fri Nov 2 23:28:35 2018 From: masterwangzx at gmail.com (Franks) Date: Fri, 2 Nov 2018 20:28:35 -0700 (MST) Subject: [vtkusers] Clarification and help using vtkLookupTable In-Reply-To: References: <1502150683321-5744313.post@n5.nabble.com> Message-ID: <1541215715006-0.post@n5.nabble.com> I have the same problem as Neel. I read your answer, but still don't understand why it works like that. Could you do me a favour to have a look and tell me what does *SetRange()* work. Thank you, and I look forward to hearing from you. Best regards, Frank David E DeMarle wrote > Take out the calls to set ramp and especially build. Build replaces all of > the value:colors you've set with automatically generated ones. > > On Aug 7, 2017 8:04 PM, "Neel Patel 0-0-0" < > siva.yedithi@ > > wrote: > >> Hi All, >> >> I'm trying to use vtkLookupTable to add color in my image, something >> like what they show on the weather forecasts. From what I understand, >> SetRange(0,255) means that any pixel value in the image that is in >> between >> the min and max, will be assigned a value that has been set by >> SetTableValue(0, 0, 0, 0, 0) and SetTableValue(255, 255, 255, 255, 1). To >> test this out I made a simple lookupTable where everything except for 0 >> was >> given a rgb value of 255, 0, 0; >> >> vtkLookupTable table = vtkLookupTable.New(); >> table.SetRange(0, 255); >> table.SetTableValue(0, 0, 0, 0, 0); >> >> for (int i = 1; i < 255; i++) >> { >> table.SetTableValue(i, 255, 0, 0, 0.3); >> } >> table.SetRampToLinear(); >> table.Build(); >> >> This however still gives me and image with red, green, and blue showing >> up >> instead of just red. Also just to note this is on top of a black/white >> image, so there aren't any other places from which the colors could come >> from. Any help would be appreciated. Thanks. >> >> Regards, >> Neel Patel >> >> >> >> >> >> -- >> View this message in context: http://vtk.1045678.n5.nabble. >> com/Clarification-and-help-using-vtkLookupTable-tp5744313.html >> Sent from the VTK - Users mailing list archive at Nabble.com. >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at http://www.kitware.com/ >> opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From rccm.kyoshimi at gmail.com Sat Nov 3 02:19:38 2018 From: rccm.kyoshimi at gmail.com (kenichiro yoshimi) Date: Sat, 3 Nov 2018 15:19:38 +0900 Subject: [vtkusers] Question to use the vtkStreamTracer In-Reply-To: References: Message-ID: Hi, You need to call setActivectors on the point data: reader.GetOutput().GetPointData().SetActiveVectors('velocity') Regards 2018?10?30?(?) 7:27 Yu Zhou : > > Hello, > > > I have a problem with vtkStreamTracer. > > Here is the code: > > > ``` > > def generate_streamline(source_file, dest_file, axis, resolution=1): > reader = vtk.vtkXMLImageDataReader() > reader.SetFileName(source_file) > reader.GetPointDataArraySelection().DisableArray('density') > reader.Update() > extent = reader.GetOutput().GetExtent() > center = [np.mean(extent[0:2]), np.mean(extent[2:4]), np.mean(extent[4:6])] > > seeds = vtk.vtkPointSource() > seeds.SetCenter(center) > seeds.SetRadius(10.5) > seeds.SetNumberOfPoints(100) > seeds.Update() > > streamTracer = vtk.vtkStreamTracer() > streamTracer.SetInterpolatorTypeToDataSetPointLocator() > streamTracer.SetInputData(reader.GetOutputDataObject(0)) > streamTracer.SetSourceData(seeds.GetOutputDataObject(0)) > streamTracer.SetIntegratorTypeToRungeKutta45() > streamTracer.SetMaximumPropagation(104) > streamTracer.SetInitialIntegrationStep(0.2) > streamTracer.SetMaximumIntegrationStep(0.5) > streamTracer.SetIntegrationDirectionToBoth() > streamTracer.SetStartPosition(center) > streamTracer.SurfaceStreamlinesOn() > streamTracer.Update() > > print(streamTracer.GetOutputDataObject(0)) > > ``` > > The output is: > ``` > > vtkPolyData (0x273ece0) > Debug: Off > Modified Time: 2638 > Reference Count: 2 > Registered Events: (none) > Information: 0x2ccb540 > Data Released: False > Global Release Data: Off > UpdateTime: 2680 > Field Data: > Debug: Off > Modified Time: 2628 > 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: 2636 > Reference Count: 1 > Registered Events: > Registered Observers: > vtkObserver (0x2ccc370) > Event: 33 > EventName: ModifiedEvent > Command: 0x2ccb880 > 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: 2638 > Reference Count: 1 > Registered Events: > Registered Observers: > vtkObserver (0x2ccc210) > Event: 33 > EventName: ModifiedEvent > Command: 0x2ccb880 > 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: 2692 > Number Of Points: 0 > Point Coordinates: 0 > Locator: 0 > 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 > ``` > > And I get an empty vtkPolyData without any streamline in it. > > Attached please find the testing dataset. > > > Please help me. > > > Thanks, > > > Joey > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: 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 fujiang.yu at kit.edu Sat Nov 3 11:49:37 2018 From: fujiang.yu at kit.edu (Fujiang Yu) Date: Sat, 3 Nov 2018 08:49:37 -0700 (MST) Subject: [vtkusers] How to enable vtkRenderingOculus compling in VTK 7 and 8 Message-ID: <1541260177649-0.post@n5.nabble.com> Dear guys, Got one simple problem which troubling me for twodays. In VTK 7 and 8, Oculus and OpenVR are supported and becomes a module vtkRendering. However, it seems like by the default setting of CmakeList, the Oculus module will not be enabled. Everytime I'm configuring the packing in Cmake, it will show: /... Backend OpenGL2 modules: vtkDomainsChemistryOpenGL2;vtkIOExportOpenGL2;vtkImagingOpenGL2;vtkRenderingContextOpenGL2;vtkRenderingGL2PSOpenGL2;vtkRenderingLICOpenGL2;vtkRenderingOculus;vtkRenderingOpenGL2;vtkRenderingOpenVR;vtkRenderingVolumeOpenGL2 Enabling modules for OpenGL2. Backend OpenGL modules: vtkIOExportOpenGL;vtkRenderingContextOpenGL;vtkRenderingGL2PS;vtkRenderingLIC;vtkRenderingOpenGL;vtkRenderingVolumeOpenGL .../ which means vtkRenderingOculus is not enabled Wish to know how can I enable the Oculus module in VTKRending? Thanks -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From david.gobbi at gmail.com Sat Nov 3 12:35:47 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Sat, 3 Nov 2018 10:35:47 -0600 Subject: [vtkusers] the question about smart pointer In-Reply-To: <1541204886358-0.post@n5.nabble.com> References: <1541076292538-0.post@n5.nabble.com> <1541204886358-0.post@n5.nabble.com> Message-ID: Hi Frank, Yes, the output is a normal pointer, and the changer just gets the pointer to the output, it doesn't get a copy of the output. However: when the changer gets the output, it increments the reference count of the output. So now there are two references to the output: one from the reader, and one from the changer. So the existence of the output depends on both the reader and the changer: the output will not destruct until both the reader and the changer have destructed. As I stated in my previous email, the important point is that the reference count is stored within the VTK object itself. An object doesn't need a smart pointer in order to have a reference count. Even a VTK object pointed to by a normal pointer will have a reference count that can be incremented/decremented by other VTK objects. David On Fri, Nov 2, 2018 at 6:28 PM Franks wrote: > Thank you for getting back to me. I still have some question about it. As > to VTK/Tutorials, it may run like you said when I write *vtkSmartPointer > pd = Reader->GetOutput();* . However, the output is just a normal > pointer, so it may depend on the reader. I may misunderstand the tutorials, > you can check out this link > https://www.vtk.org/Wiki/VTK/Tutorials/SmartPointers (under the title *Getting > an Object with a Smart Pointer* ). Does the changer get a copy of output? > > Thank you for your attention to this matter. > Frank > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lasso at queensu.ca Sat Nov 3 12:57:03 2018 From: lasso at queensu.ca (Andras Lasso) Date: Sat, 3 Nov 2018 16:57:03 +0000 Subject: [vtkusers] How to enable vtkRenderingOculus compling in VTK 7 and 8 In-Reply-To: <1541260177649-0.post@n5.nabble.com> References: <1541260177649-0.post@n5.nabble.com> Message-ID: You can use OpenVR module with all OpenVR-compatible headsets, including HTC Vive, Oculus Rift, and all Windows Mixed Reality headsets. The old Oculus-only interface has been removed from VTK in April (https://github.com/Kitware/VTK/commit/97f76e8bbb547ee0a6cc07664048e6cf97f7c694). Andras -----Original Message----- From: vtkusers On Behalf Of Fujiang Yu Sent: Saturday, November 3, 2018 11:50 AM To: vtkusers at vtk.org Subject: [vtkusers] How to enable vtkRenderingOculus compling in VTK 7 and 8 Dear guys, Got one simple problem which troubling me for twodays. In VTK 7 and 8, Oculus and OpenVR are supported and becomes a module vtkRendering. However, it seems like by the default setting of CmakeList, the Oculus module will not be enabled. Everytime I'm configuring the packing in Cmake, it will show: /... Backend OpenGL2 modules: vtkDomainsChemistryOpenGL2;vtkIOExportOpenGL2;vtkImagingOpenGL2;vtkRenderingContextOpenGL2;vtkRenderingGL2PSOpenGL2;vtkRenderingLICOpenGL2;vtkRenderingOculus;vtkRenderingOpenGL2;vtkRenderingOpenVR;vtkRenderingVolumeOpenGL2 Enabling modules for OpenGL2. Backend OpenGL modules: vtkIOExportOpenGL;vtkRenderingContextOpenGL;vtkRenderingGL2PS;vtkRenderingLIC;vtkRenderingOpenGL;vtkRenderingVolumeOpenGL .../ which means vtkRenderingOculus is not enabled Wish to know how can I enable the Oculus module in VTKRending? Thanks -- 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%7C7f72cf188c7e48b17bda08d641a3f8a9%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636768569845769738&sdata=RczvemxevZysbcTV9cuQcyyP7nFJSbn7HuzRTv%2B4s1k%3D&reserved=0 _______________________________________________ Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7C7f72cf188c7e48b17bda08d641a3f8a9%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636768569845769738&sdata=9tFVfWwQ7er%2BbXya96b4PpGrpBGossdbxifmFsagGVA%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%7C7f72cf188c7e48b17bda08d641a3f8a9%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636768569845769738&sdata=mJQ%2FLb4oc2u5zc%2BjjHnQvvHt%2FgFMxzweFpSbkBoyUPc%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%7C7f72cf188c7e48b17bda08d641a3f8a9%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636768569845769738&sdata=vzJkhUlqtoeiPGpaP76htY6GtK%2BCtfBwGaW7Zayjgo4%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%7C7f72cf188c7e48b17bda08d641a3f8a9%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636768569845769738&sdata=Lmbdj6JdI495UtwDC4cBSHolxzFgEsWUXPjWRwRghK8%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%7C7f72cf188c7e48b17bda08d641a3f8a9%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636768569845769738&sdata=wxUkFfNFyPxxVFZ3cSAIsLiIXA%2FiuJ7Z7BdgH1jdy14%3D&reserved=0 From lasso at queensu.ca Sat Nov 3 13:14:34 2018 From: lasso at queensu.ca (Andras Lasso) Date: Sat, 3 Nov 2018 17:14:34 +0000 Subject: [vtkusers] Clarification and help using vtkLookupTable In-Reply-To: <1541215715006-0.post@n5.nabble.com> References: <1502150683321-5744313.post@n5.nabble.com> <1541215715006-0.post@n5.nabble.com> Message-ID: Probably the most efficient way of learning exact behavior of simple classes is to read their source code. vtkLookupTable is a really simple one and its source code is available here: https://github.com/Kitware/VTK/blob/master/Common/Core/vtkLookupTable.cxx Andras -----Original Message----- From: vtkusers On Behalf Of Franks Sent: Friday, November 2, 2018 11:29 PM To: vtkusers at vtk.org Subject: Re: [vtkusers] Clarification and help using vtkLookupTable I have the same problem as Neel. I read your answer, but still don't understand why it works like that. Could you do me a favour to have a look and tell me what does *SetRange()* work. Thank you, and I look forward to hearing from you. Best regards, Frank David E DeMarle wrote > Take out the calls to set ramp and especially build. Build replaces > all of the value:colors you've set with automatically generated ones. > > On Aug 7, 2017 8:04 PM, "Neel Patel 0-0-0" < > siva.yedithi@ > > wrote: > >> Hi All, >> >> I'm trying to use vtkLookupTable to add color in my image, >> something like what they show on the weather forecasts. From what I >> understand, >> SetRange(0,255) means that any pixel value in the image that is in >> between the min and max, will be assigned a value that has been set >> by SetTableValue(0, 0, 0, 0, 0) and SetTableValue(255, 255, 255, 255, >> 1). To test this out I made a simple lookupTable where everything >> except for 0 was given a rgb value of 255, 0, 0; >> >> vtkLookupTable table = vtkLookupTable.New(); >> table.SetRange(0, 255); >> table.SetTableValue(0, 0, 0, 0, 0); >> >> for (int i = 1; i < 255; i++) >> { >> table.SetTableValue(i, 255, 0, 0, 0.3); >> } >> table.SetRampToLinear(); >> table.Build(); >> >> This however still gives me and image with red, green, and blue >> showing up instead of just red. Also just to note this is on top of a >> black/white image, so there aren't any other places from which the >> colors could come from. Any help would be appreciated. Thanks. >> >> Regards, >> Neel Patel >> >> >> >> >> >> -- >> View this message in context: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fvtk.1045678.n5.nabble&data=02%7C01%7Classo%40queensu.ca%7Cf443d9033aaf448c833408d6413c720f%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636768125213390066&sdata=Gr5TWFZL9U8pp5Dt9OtA0h%2BqhjqtFJcgOPZkFPtTmu4%3D&reserved=0. >> com/Clarification-and-help-using-vtkLookupTable-tp5744313.html >> Sent from the VTK - Users mailing list archive at Nabble.com. >> _______________________________________________ >> Powered by >> https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&am >> p;data=02%7C01%7Classo%40queensu.ca%7Cf443d9033aaf448c833408d6413c720 >> f%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636768125213390066& >> ;sdata=xKCvyP7b1fzlB7CY14vKNEMzZ57wfNnfn3IokUb0GRY%3D&reserved=0 >> >> Visit other Kitware open-source projects at >> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.k >> itware.com%2F&data=02%7C01%7Classo%40queensu.ca%7Cf443d9033aaf448 >> c833408d6413c720f%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636768 >> 125213390066&sdata=K5Sha9ew1zZ3uimPY0L%2BDk1JPv9Zf1GdYut0SHaMw4E% >> 3D&reserved=0 >> opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.v >> tk.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Classo%40queensu.ca%7Cf443d >> 9033aaf448c833408d6413c720f%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C >> 0%7C636768125213390066&sdata=rT3yPFdComh%2BWQFBOgo8vYgfSgKvIUozhY >> %2BTrblTrFA%3D&reserved=0 >> >> Search the list archives at: >> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkm >> ail.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Classo%40queensu >> .ca%7Cf443d9033aaf448c833408d6413c720f%7Cd61ecb3b38b142d582c4efb2838b >> 925c%7C1%7C0%7C636768125213390066&sdata=3CK1X5hAIJCIn6Lu0NjX6i%2F >> rq61WKKj3r3q131nGNMY%3D&reserved=0 >> >> Follow this link to subscribe/unsubscribe: >> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpubli >> c.kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Class >> o%40queensu.ca%7Cf443d9033aaf448c833408d6413c720f%7Cd61ecb3b38b142d58 >> 2c4efb2838b925c%7C1%7C0%7C636768125213390066&sdata=JFhq5aqab5TP%2 >> BVA5dZWvbVXD6tLY4x0gJ9oTJn5sf%2Bk%3D&reserved=0 >> > > _______________________________________________ > Powered by > https://na01.safelinks.protection.outlook.com/?url=www.kitware.com& > ;data=02%7C01%7Classo%40queensu.ca%7Cf443d9033aaf448c833408d6413c720f% > 7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636768125213390066&sd > ata=xKCvyP7b1fzlB7CY14vKNEMzZ57wfNnfn3IokUb0GRY%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%40qu > eensu.ca%7Cf443d9033aaf448c833408d6413c720f%7Cd61ecb3b38b142d582c4efb2 > 838b925c%7C1%7C0%7C636768125213390066&sdata=zSv2RJkpcvZInQHLsgnHK2 > xF5Mbj8dAHD2piThqfAVo%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%7Cf443d90 > 33aaf448c833408d6413c720f%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7 > C636768125213390066&sdata=rT3yPFdComh%2BWQFBOgo8vYgfSgKvIUozhY%2BT > rblTrFA%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.c > a%7Cf443d9033aaf448c833408d6413c720f%7Cd61ecb3b38b142d582c4efb2838b925 > c%7C1%7C0%7C636768125213390066&sdata=3CK1X5hAIJCIn6Lu0NjX6i%2Frq61 > WKKj3r3q131nGNMY%3D&reserved=0 > > Follow this link to subscribe/unsubscribe: > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpublic > .kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo% > 40queensu.ca%7Cf443d9033aaf448c833408d6413c720f%7Cd61ecb3b38b142d582c4 > efb2838b925c%7C1%7C0%7C636768125213390066&sdata=JFhq5aqab5TP%2BVA5 > dZWvbVXD6tLY4x0gJ9oTJn5sf%2Bk%3D&reserved=0 -- 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%7Cf443d9033aaf448c833408d6413c720f%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636768125213390066&sdata=cFaWLyy1Ofe82rlhMqKaG7hKoKXkSU69%2BUYIcvTX7Nw%3D&reserved=0 _______________________________________________ Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7Cf443d9033aaf448c833408d6413c720f%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636768125213390066&sdata=xKCvyP7b1fzlB7CY14vKNEMzZ57wfNnfn3IokUb0GRY%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%7Cf443d9033aaf448c833408d6413c720f%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636768125213390066&sdata=zSv2RJkpcvZInQHLsgnHK2xF5Mbj8dAHD2piThqfAVo%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%7Cf443d9033aaf448c833408d6413c720f%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636768125213390066&sdata=rT3yPFdComh%2BWQFBOgo8vYgfSgKvIUozhY%2BTrblTrFA%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%7Cf443d9033aaf448c833408d6413c720f%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636768125213390066&sdata=3CK1X5hAIJCIn6Lu0NjX6i%2Frq61WKKj3r3q131nGNMY%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%7Cf443d9033aaf448c833408d6413c720f%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636768125213390066&sdata=DnXjuCp5k%2Fv89Vn7jM5QZ3HfyiVzINHqlLU8TnnNwJI%3D&reserved=0 From zhouyu at live.com Sat Nov 3 17:09:50 2018 From: zhouyu at live.com (Yu Zhou) Date: Sat, 3 Nov 2018 21:09:50 +0000 Subject: [vtkusers] Question to use the vtkStreamTracer In-Reply-To: References: , Message-ID: Hi Kenichiro, It works! Thank you so much! You saved my day! Best regards, Joey ________________________________ From: kenichiro yoshimi Sent: Saturday, November 3, 2018 0:19 To: zhouyu at live.com Cc: vtkusers at public.kitware.com Subject: Re: [vtkusers] Question to use the vtkStreamTracer Hi, You need to call setActivectors on the point data: reader.GetOutput().GetPointData().SetActiveVectors('velocity') Regards 2018?10?30?(?) 7:27 Yu Zhou : > > Hello, > > > I have a problem with vtkStreamTracer. > > Here is the code: > > > ``` > > def generate_streamline(source_file, dest_file, axis, resolution=1): > reader = vtk.vtkXMLImageDataReader() > reader.SetFileName(source_file) > reader.GetPointDataArraySelection().DisableArray('density') > reader.Update() > extent = reader.GetOutput().GetExtent() > center = [np.mean(extent[0:2]), np.mean(extent[2:4]), np.mean(extent[4:6])] > > seeds = vtk.vtkPointSource() > seeds.SetCenter(center) > seeds.SetRadius(10.5) > seeds.SetNumberOfPoints(100) > seeds.Update() > > streamTracer = vtk.vtkStreamTracer() > streamTracer.SetInterpolatorTypeToDataSetPointLocator() > streamTracer.SetInputData(reader.GetOutputDataObject(0)) > streamTracer.SetSourceData(seeds.GetOutputDataObject(0)) > streamTracer.SetIntegratorTypeToRungeKutta45() > streamTracer.SetMaximumPropagation(104) > streamTracer.SetInitialIntegrationStep(0.2) > streamTracer.SetMaximumIntegrationStep(0.5) > streamTracer.SetIntegrationDirectionToBoth() > streamTracer.SetStartPosition(center) > streamTracer.SurfaceStreamlinesOn() > streamTracer.Update() > > print(streamTracer.GetOutputDataObject(0)) > > ``` > > The output is: > ``` > > vtkPolyData (0x273ece0) > Debug: Off > Modified Time: 2638 > Reference Count: 2 > Registered Events: (none) > Information: 0x2ccb540 > Data Released: False > Global Release Data: Off > UpdateTime: 2680 > Field Data: > Debug: Off > Modified Time: 2628 > 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: 2636 > Reference Count: 1 > Registered Events: > Registered Observers: > vtkObserver (0x2ccc370) > Event: 33 > EventName: ModifiedEvent > Command: 0x2ccb880 > 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: 2638 > Reference Count: 1 > Registered Events: > Registered Observers: > vtkObserver (0x2ccc210) > Event: 33 > EventName: ModifiedEvent > Command: 0x2ccb880 > 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: 2692 > Number Of Points: 0 > Point Coordinates: 0 > Locator: 0 > 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 > ``` > > And I get an empty vtkPolyData without any streamline in it. > > Attached please find the testing dataset. > > > Please help me. > > > Thanks, > > > Joey > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: 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 masterwangzx at gmail.com Sat Nov 3 23:59:56 2018 From: masterwangzx at gmail.com (Franks) Date: Sat, 3 Nov 2018 20:59:56 -0700 (MST) Subject: [vtkusers] the question about smart pointer In-Reply-To: References: <1541076292538-0.post@n5.nabble.com> <1541204886358-0.post@n5.nabble.com> Message-ID: <1541303996352-0.post@n5.nabble.com> Thank you for your help and patience! I have already understood. Best Regards Frank -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From abhishekworld at gmail.com Mon Nov 5 00:10:08 2018 From: abhishekworld at gmail.com (Abhishek) Date: Mon, 5 Nov 2018 16:10:08 +1100 Subject: [vtkusers] Retriving vtkInformation from the actor Message-ID: Hello, I have multiple actors in the scene, and I have re-implemented the vtkInteractorStyleTrackballCamera to capture the click event on them (modified https://lorensen.github.io/VTKExamples/site/Python/Interaction/HighlightPickedActor/ ) In the click event, I want to know which actor has been clicked to do so I am adding vtkInformationStringKey to every actor. But at the click event, I am not able to retrieve it back. Please let me know what am I missing? Or what am I doing wrong? Here is my code: ``` import vtk NUMBER_OF_SPHERES = 10 class MouseInteractorHighLightActor(vtk.vtkInteractorStyleTrackballCamera): def __init__(self, parent=None): self.AddObserver("LeftButtonPressEvent", self.leftButtonPressEvent) self.LastPickedActor = None self.LastPickedProperty = vtk.vtkProperty() def leftButtonPressEvent(self, obj, event): clickPos = self.GetInteractor().GetEventPosition() picker = vtk.vtkPropPicker() picker.Pick(clickPos[0], clickPos[1], 0, self.GetDefaultRenderer()) # get the new self.NewPickedActor = picker.GetActor() # If something was selected if self.NewPickedActor: # get the information from the new Actor info = self.NewPickedActor.GetProperty().GetInformation() # prepare the key key = vtk.vtkInformationStringKey.MakeKey("CPHY_ID", "vtkActor") # get the value for the key id = info.Get(key) print("Id is : ") print(id) # If we picked something before, reset its property if self.LastPickedActor: self.LastPickedActor.GetProperty().DeepCopy(self.LastPickedProperty) # Save the property of the picked actor so that we can # restore it next time self.LastPickedProperty.DeepCopy(self.NewPickedActor.GetProperty()) # Highlight the picked actor by changing its properties self.NewPickedActor.GetProperty().SetColor(1.0, 0.0, 0.0) self.NewPickedActor.GetProperty().SetDiffuse(1.0) self.NewPickedActor.GetProperty().SetSpecular(0.0) # save the last picked actor self.LastPickedActor = self.NewPickedActor self.OnLeftButtonDown() return # A renderer and render window renderer = vtk.vtkRenderer() renderer.SetBackground(.3, .4, .5) renwin = vtk.vtkRenderWindow() renwin.AddRenderer(renderer) # An interactor interactor = vtk.vtkRenderWindowInteractor() interactor.SetRenderWindow(renwin) # add the custom style style = MouseInteractorHighLightActor() style.SetDefaultRenderer(renderer) interactor.SetInteractorStyle(style) # Add spheres to play with for i in range(NUMBER_OF_SPHERES): source = vtk.vtkSphereSource() # random position and radius x = vtk.vtkMath.Random(-5, 5) y = vtk.vtkMath.Random(-5, 5) z = vtk.vtkMath.Random(-5, 5) radius = vtk.vtkMath.Random(.5, 1.0) source.SetRadius(radius) source.SetCenter(x, y, z) source.SetPhiResolution(11) source.SetThetaResolution(21) mapper = vtk.vtkPolyDataMapper() mapper.SetInputConnection(source.GetOutputPort()) actor = vtk.vtkActor() actor.SetMapper(mapper) r = vtk.vtkMath.Random(.4, 1.0) g = vtk.vtkMath.Random(.4, 1.0) b = vtk.vtkMath.Random(.4, 1.0) actor.GetProperty().SetDiffuseColor(r, g, b) actor.GetProperty().SetDiffuse(.8) actor.GetProperty().SetSpecular(.5) actor.GetProperty().SetSpecularColor(1.0, 1.0, 1.0) actor.GetProperty().SetSpecularPower(30.0) info = actor.GetProperty().GetInformation() key = vtk.vtkInformationStringKey.MakeKey("CPHY_ID", "vtkActor") info.Set(key, "SPH_"+str(i)) #actor.GetProperty().SetInformation(info) renderer.AddActor(actor) for i in range(NUMBER_OF_SPHERES): source = vtk.vtkConeSource() # random position and radius x = vtk.vtkMath.Random(-8, 5) y = vtk.vtkMath.Random(-8, 5) z = vtk.vtkMath.Random(-8, 5) radius = vtk.vtkMath.Random(.5, 1.0) angle = vtk.vtkMath.Random(5, 10) source.SetAngle(angle) source.SetRadius(radius) source.SetCenter(x, y, z) # source.SetPhiResolution(11) # source.SetThetaResolution(21) mapper = vtk.vtkPolyDataMapper() mapper.SetInputConnection(source.GetOutputPort()) actor = vtk.vtkActor() actor.SetMapper(mapper) r = vtk.vtkMath.Random(.4, 1.0) g = vtk.vtkMath.Random(.4, 1.0) b = vtk.vtkMath.Random(.4, 1.0) actor.GetProperty().SetDiffuseColor(r, g, b) actor.GetProperty().SetDiffuse(.8) actor.GetProperty().SetSpecular(.5) actor.GetProperty().SetSpecularColor(1.0, 1.0, 1.0) actor.GetProperty().SetSpecularPower(30.0) info = actor.GetProperty().GetInformation() key = vtk.vtkInformationStringKey.MakeKey("CPHY_ID", "vtkActor") info.Set(key, "CON_"+str(i)) #actor.GetProperty().SetInformation(info) renderer.AddActor(actor) # Start interactor.Initialize() interactor.Start() ``` Regards, -- Abhishek http://zeroth.me -------------- next part -------------- An HTML attachment was scrubbed... URL: From isalako1 at sheffield.ac.uk Mon Nov 5 03:54:23 2018 From: isalako1 at sheffield.ac.uk (Idayat Salako) Date: Mon, 5 Nov 2018 08:54:23 +0000 Subject: [vtkusers] missing vtk library for vtk5 compilation In-Reply-To: References: Message-ID: Hi David, Thank you very much for your response. I downgraded to vtk 5.10 and compiled with visual studio 2013 but I still get missing library errors and some compiler errors (pic below). I don't know if it matters that I also had some warning when configuring/genertaing in cmake (cmake log files). Would you have any idea as to how to solve this? [image: image.png] Thank you Idayat Salako ***Whoever wakes up in the morning and is safe in his home, in good health and has enough provision for the day, it is as if he has all the good things of this world [HadithTirmidhi 2346]*** On Fri, 2 Nov 2018 at 11:34, David E DeMarle wrote: > Were there any compilation problems of vtk 5.0 itself in vis studio 2013? > vtk5.0 predated vs2013 so it is entirely possible what it is incompatible > without modification. You might have more luck with vtk 5.8 or .10. > Application side changes might be less extensive with them. > > On Fri, Nov 2, 2018, 4:31 AM Idayat Salako wrote: > >> Still missing library issue after downgrading to visual studio 2013. Any >> suggestions on how to fix this please? >> >> On Wed, Oct 24, 2018, 11:57 Idayat Salako >> wrote: >> >>> Cmake: v3.12.2-win64-x64 >>> OS: Windows >>> Visual studio: Community 2017 >>> >>> I am building a program that requires an older version of vtk due to >>> compatibility issues. I have currently downloaded VTK v5.0.0 from ( >>> https://gitlab.kitware.com/vtk/vtk/tree/v5.0.0) but I get missing >>> library error (cannot open input file......vtkRendering.lib) when i compile >>> in visual studio; this is after i have configured/generated in cmake. Any >>> idea how I might get this library or how to avoid this error to compile vtk >>> 5.0? >>> >>> [image: image.png] >>> Thanks in advance for your help. >>> >>> Thank you >>> Idayat Salako >>> >>> ***Whoever wakes up in the morning and is safe in his home, in good >>> health and has enough provision for the day, it is as if he has all the >>> good things of this world [HadithTirmidhi 2346]*** >>> >>> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 252557 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 216896 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: CMakeError.log Type: application/octet-stream Size: 455768 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: CMakeOutput.log Type: application/octet-stream Size: 600161 bytes Desc: not available URL: From ftpronk at engits.com Mon Nov 5 06:05:24 2018 From: ftpronk at engits.com (Fcs) Date: Mon, 5 Nov 2018 04:05:24 -0700 (MST) Subject: [vtkusers] missing vtk library for vtk5 compilation In-Reply-To: References: Message-ID: <1541415924692-0.post@n5.nabble.com> Hello Idayat, By looking at your CMakeErrorLog, your build is trying to find files like pthread.h and unistd.h, which are header files belonging to of the POSIX (thread) API. As you are building under Windows with Visual Studio, these files don't exist, and you need to link to the Win32 API, and not the POSIX API. This means something is wrong with your build. Did you use the correct generator with CMake? I personally haven't built vtk5 under windows, but I expect their CMake setup to correctly deal with the POSIX/Win32 issue. Have a look here for more information about CMake generators. It could also be a bug introduced in the specific commit your are trying to compile. Did you try using an earlier release? Also, keep in mind that Visual Studio 2013 did not exist when vtk 5.10 was released, and it might simply not be compatible with that compiler. Would it be acceptable for your project to use an earlier compiler? If all else fails, you could try using a toolchain that is guaranteed to be compatible with vtk 5. Last but not least, if I remember properly, the earlier versions of vtk 5 where defining macros conflicting with c++11. I don't remember if that was also the case for the later versions of vtk 5, or if you could disable those macros in CMake and use their c++11 equivalent, but keep in mind that Visual Studio 2013 has (some....) c++11 support which might conflict with vtk 5. Kind regards -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From mathieu.westphal at kitware.com Mon Nov 5 08:22:27 2018 From: mathieu.westphal at kitware.com (Mathieu Westphal) Date: Mon, 5 Nov 2018 14:22:27 +0100 Subject: [vtkusers] VTK/ParaView beginner course in March 2019 Message-ID: Hello list, Kitware will be holding a 2-day VTK and ParaView course on May 19th and 20th 2017 in Lyon, France. Please visit our web site for more information and registration details at VTK : https://training.kitware.fr/browse/205 ParaView : https://training.kitware.fr/browse/206 Note that the course will be taught in English. If you have any question, please contact us at formations at kitware.fr Thank you, Mathieu Westphal -------------- next part -------------- An HTML attachment was scrubbed... URL: From mathieu.westphal at kitware.com Mon Nov 5 09:32:39 2018 From: mathieu.westphal at kitware.com (Mathieu Westphal) Date: Mon, 5 Nov 2018 15:32:39 +0100 Subject: [vtkusers] VTK/ParaView beginner course in March 2019 In-Reply-To: References: Message-ID: The courses will take place on *March* 19th and 20th *2019,* Best Regards, Mathieu Westphal On Mon, Nov 5, 2018 at 2:22 PM Mathieu Westphal < mathieu.westphal at kitware.com> wrote: > Hello list, > > Kitware will be holding a 2-day VTK and ParaView course on May 19th and > 20th 2017 in Lyon, France. > > Please visit our web site for more information and registration details at > VTK : https://training.kitware.fr/browse/205 > ParaView : https://training.kitware.fr/browse/206 > > Note that the course will be taught in English. If you have any question, > please contact us at formations at kitware.fr > > Thank you, > > Mathieu Westphal > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lasso at queensu.ca Mon Nov 5 09:17:49 2018 From: lasso at queensu.ca (Andras Lasso) Date: Mon, 5 Nov 2018 14:17:49 +0000 Subject: [vtkusers] How to enable vtkRenderingOculus compling in VTK 7 and 8 In-Reply-To: <1541406062028.87171@kit.edu> References: <1541260177649-0.post@n5.nabble.com>, <1541406062028.87171@kit.edu> Message-ID: There is a complete working example of using OpenVR interface in VTK in SlicerVirtualReality extension: https://github.com/KitwareMedical/SlicerVirtualReality. You can copy the relevant CMake files into your project and start from there. If you are in the field of medical imaging then I would recommend to use 3D Slicer with this extension as is; but you may even consider this if you are working in a different field (3D Slicer is used in various other application areas, from astronomy to paleontology). Andras -----Original Message----- From: Yu, Fujiang (IKET) Sent: Monday, November 5, 2018 2:17 AM To: Andras Lasso Subject: Re: [vtkusers] How to enable vtkRenderingOculus compling in VTK 7 and 8 Dear Andras, Thanks a lot for your kind reply. However, it seems like the CmakeList in OpenVR folder and the one in Oculus folder are not so different. When trying to do cmake on the project. Both the module of Oculus and OpenVR are totally neglected without configuring. No project will be generated for these two sub-modules. I've checked the CmakeList in the main folder and the ones above, there seems nothing in the script on turning on these options. So any tips on how to switch on the the Oculus or OPenVR sub-module in the rendering module for doing cmake? Sincerely, Fujiang ________________________________________ From: Andras Lasso Sent: Saturday, November 3, 2018 17:57 To: Yu, Fujiang (IKET); vtkusers at vtk.org Subject: RE: [vtkusers] How to enable vtkRenderingOculus compling in VTK 7 and 8 You can use OpenVR module with all OpenVR-compatible headsets, including HTC Vive, Oculus Rift, and all Windows Mixed Reality headsets. The old Oculus-only interface has been removed from VTK in April (https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FKitware%2FVTK%2Fcommit%2F97f76e8bbb547ee0a6cc07664048e6cf97f7c694&data=02%7C01%7Classo%40queensu.ca%7Cf0ee49e40cf6445c4de808d642eeaddc%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636769990218593037&sdata=EX4pM4icSV9dgTIkSx42qtIThfYg%2Fu1rG537XXm50Ls%3D&reserved=0). Andras -----Original Message----- From: vtkusers On Behalf Of Fujiang Yu Sent: Saturday, November 3, 2018 11:50 AM To: vtkusers at vtk.org Subject: [vtkusers] How to enable vtkRenderingOculus compling in VTK 7 and 8 Dear guys, Got one simple problem which troubling me for twodays. In VTK 7 and 8, Oculus and OpenVR are supported and becomes a module vtkRendering. However, it seems like by the default setting of CmakeList, the Oculus module will not be enabled. Everytime I'm configuring the packing in Cmake, it will show: /... Backend OpenGL2 modules: vtkDomainsChemistryOpenGL2;vtkIOExportOpenGL2;vtkImagingOpenGL2;vtkRenderingContextOpenGL2;vtkRenderingGL2PSOpenGL2;vtkRenderingLICOpenGL2;vtkRenderingOculus;vtkRenderingOpenGL2;vtkRenderingOpenVR;vtkRenderingVolumeOpenGL2 Enabling modules for OpenGL2. Backend OpenGL modules: vtkIOExportOpenGL;vtkRenderingContextOpenGL;vtkRenderingGL2PS;vtkRenderingLIC;vtkRenderingOpenGL;vtkRenderingVolumeOpenGL .../ which means vtkRenderingOculus is not enabled Wish to know how can I enable the Oculus module in VTKRending? Thanks -- 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%7Cf0ee49e40cf6445c4de808d642eeaddc%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636769990218593037&sdata=JImqlnqDb2VrqkuwCmJuvZ6RyMXDc7ijeHquX3sQwog%3D&reserved=0 _______________________________________________ Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7Cf0ee49e40cf6445c4de808d642eeaddc%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636769990218593037&sdata=ftrw1VRGiIMhfrZUel%2FrnhcEeu1XV%2BZ9%2BeSO5e0c2mI%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%7Cf0ee49e40cf6445c4de808d642eeaddc%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636769990218593037&sdata=WfrsRpsTlJOXMzzmSFyDs8QEdW0vnzTT0muRiQQnV1g%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%7Cf0ee49e40cf6445c4de808d642eeaddc%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636769990218593037&sdata=AYzSUtryGsdMMjUqOPi5dthEi6CEh2Lz%2FJNhOwYfEKo%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%7Cf0ee49e40cf6445c4de808d642eeaddc%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636769990218593037&sdata=oqvmdAbVi5hlb%2FC8c7c%2B2h7npSnzHpa%2Ff%2BHl5mM7we4%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%7Cf0ee49e40cf6445c4de808d642eeaddc%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636769990218593037&sdata=3tSAb5rVV8AhwI0NFtBMrxDNUUVO0wuYONU8gZw2zHs%3D&reserved=0 From jjh at dantecdynamics.com Mon Nov 5 10:00:56 2018 From: jjh at dantecdynamics.com (jesper1266) Date: Mon, 5 Nov 2018 08:00:56 -0700 (MST) Subject: [vtkusers] vtkButtonWidget event not fireing (c#) Message-ID: <1541430056081-0.post@n5.nabble.com> Hi I'm trying to get a LeftButtonPressEvt to fire from a vtkButtonWidget. The button shows up in the UI and is able to be pressed whit the left mouse button, but the assosciated eventhandler is never executed. My code looks as follows: public static void ButtonPressedEvent(vtkObject sender, vtkObjectEventArgs e) { System.Diagnostics.Trace.WriteLine("left mouse button pressed"); } . . . interactorStyle = vtkInteractorStyleTrackballCamera.New(); m_renderWindow.GetInteractor().SetInteractorStyle(interactorStyle); vtkButtonWidget buttonWidget = vtkButtonWidget.New(); buttonWidget.SetRepresentation(representation); buttonWidget.LeftButtonPressEvt += new vtkObject.vtkObjectEventHandler(ButtonPressedEvent); buttonWidget.SetInteractor(m_renderWindow.GetInteractor()); buttonWidget.On(); If I hook the event handler up to the interaction style like below it works (except when the mouse is over the button) interactorStyle.LeftButtonPressEvt += new vtkObject.vtkObjectEventHandler(ButtonPressedEvent); I've trawled the lists and google for a solution, but have been unable to find any answers. Any help will be greatly appreciated, thank you :-) -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From Zoltan.Kovacs at esi-group.com Mon Nov 5 10:35:31 2018 From: Zoltan.Kovacs at esi-group.com (Zoltan Kovacs) Date: Mon, 5 Nov 2018 15:35:31 +0000 Subject: [vtkusers] Accessing the original IDs of selected points in vtkPolyData or vtkUnstructuredGrid Message-ID: Dear All, I try to access the ID list of nodes which are selected in a grid. Based on the example https://lorensen.github.io/VTKExamples/site/Cxx/Picking/HighlightSelectedPoints/ I copied the class InteractorStyle : public vtkInteractorStyleRubberBandPick {...} from the example to catch mouse events. In the function calling the member functions of this class I have the code ... vtkSmartPointer grid = vtkSmartPointer::New(); vtkSmartPointer polydata = vtkSmartPointer::New(); vtkSmartPointer points = vtkSmartPointer::New(); ... filling 'points' with points from a point list ... grid->SetPoints(points); polydata->SetPoints(points); mapper->SetInputData(grid); actor->SetMapper(mapper); renderer->AddActor(actor); renderer->ResetCamera(); renderWindowInteractor->SetPicker(picker); interactorStyle->SetPoints(polydata); renderWindowInteractor->SetInteractorStyle(interactorStyle); This code can render the nodes from the grid and let one select nodes from the polydata via the rubber band picker. However, when I insert a vtkIdFilter and a vtkSurfaceFilter in the pipeline to save the original node IDs and use them in the selection, the selection does not work: .. vtkSmartPointer grid = vtkSmartPointer::New(); vtkSmartPointer polydata = vtkSmartPointer::New(); vtkSmartPointer idFilter = vtkSmartPointer::New(); vtkSmartPointer surfaceFilter = vtkSmartPointer::New(); vtkSmartPointer points = vtkSmartPointer::New(); ... filling 'points' with points from a point list. ... grid->SetPoints(points); polydata->SetPoints(points); idFilter->SetInputData(polydata); idFilter->SetIdsArrayName("OriginalIds"); idFilter->Update(); surfaceFilter->SetInputConnection(idFilter->GetOutputPort()); surfaceFilter->Update(); vtkPolyData *input = surfaceFilter->GetOutput(); mapper->SetInputData(grid); actor->SetMapper(mapper); renderer->AddActor(actor); renderer->ResetCamera(); renderWindowInteractor->SetPicker(picker); interactorStyle->SetPoints(input); renderWindowInteractor->SetInteractorStyle(interactorStyle); The code still renders the nodes from the grid but the rubber band picking does not select nodes from polydata -> idFilter -> surfaceFilter -> input. Is there any simple way to access the selected node IDs from vtkPolyData? Or, even better, from vktUnstructuredGrid instead of vtkPolyData? Thanks a lot! Kind regards, Zoltan -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthew.troke at avalonholographics.com Mon Nov 5 11:31:12 2018 From: matthew.troke at avalonholographics.com (Matthew Troke) Date: Mon, 5 Nov 2018 13:01:12 -0330 Subject: [vtkusers] Third party libraries as binary Message-ID: I've noticed that 3rd party libraries in VTK are included with their source code and built along with VTK. Can a 3rd party library be include in VTK that is precompiled (either with .lib or dll) and linked with the project? If so, is there a procedure or guide to show how this would be done within the VTK build system? Thanks, Matt -- Matthew Troke Software Engineer Office: 1-709-701-0239 Email: matthew.troke at avalonholographics.com -- _This email and any attachments are confidential and may be privileged. Any unauthorized use, disclosure, copying or distribution of the information received is prohibited. If you are not the intended recipient please contact the sender immediately by return email confirming that you have and will delete all communications related to the email and any attachments sent to you in error._ -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan.lipsa at kitware.com Mon Nov 5 11:39:50 2018 From: dan.lipsa at kitware.com (Dan Lipsa) Date: Mon, 5 Nov 2018 11:39:50 -0500 Subject: [vtkusers] Third party libraries as binary In-Reply-To: References: Message-ID: You'll have to recompile VTK using VTK_USE_SYSTEM_ set to ON. In this case VTK will use from your system and not compile the version included with the source code. Dan On Mon, Nov 5, 2018 at 11:31 AM Matthew Troke < matthew.troke at avalonholographics.com> wrote: > I've noticed that 3rd party libraries in VTK are included with their > source code and built along with VTK. Can a 3rd party library be include in > VTK that is precompiled (either with .lib or dll) and linked with the > project? If so, is there a procedure or guide to show how this would be > done within the VTK build system? > > Thanks, > Matt > > -- > Matthew Troke > Software Engineer > Office: 1-709-701-0239 > Email: matthew.troke at avalonholographics.com > > *This email and any attachments are confidential and may be privileged. > Any unauthorized use, disclosure, copying or distribution of the > information received is prohibited. If you are not the intended recipient > please contact the sender immediately by return email confirming that you > have and will delete all communications related to the email and any > attachments sent to you in error.* > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 ben.boeckel at kitware.com Mon Nov 5 13:12:21 2018 From: ben.boeckel at kitware.com (Ben Boeckel) Date: Mon, 5 Nov 2018 13:12:21 -0500 Subject: [vtkusers] Third party libraries as binary In-Reply-To: References: Message-ID: <20181105181221.GA10754@rotor.localdomain> On Mon, Nov 05, 2018 at 13:01:12 -0330, Matthew Troke wrote: > I've noticed that 3rd party libraries in VTK are included with their source > code and built along with VTK. Can a 3rd party library be include in VTK > that is precompiled (either with .lib or dll) and linked with the project? Assuming that you're not trying to compile against a copy that you have of something VTK also contains (which Dan's answer applies to) and instead asking to include a new third-party library, the answer is "no". VTK compiles on many platforms and having to recompile these artifacts for each platform/compiler/flag combination is too burdensome. It's just easier to have them built along with VTK's build system. --Ben From dave.demarle at kitware.com Mon Nov 5 16:22:45 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Mon, 5 Nov 2018 16:22:45 -0500 Subject: [vtkusers] announce: VTK 8.2.0.rc1 is ready to try Message-ID: Hi folks, VTK 8.2.0 release candidate 1 is out^1. Please give the release candidate a try and report any problems that you find to us via the gitlab issue tracker with an "8.2.0" milestone. Developers, use the milestone to let us know of any fixes that you want integrated to the release branch in time for 8.2.0 final in a few weeks time. Ideally your branches will start at or above the 8.2.0 tag. We are still gathering feedback from the 108 committers to make up the official release notes but in the meantime here is my summary of some of the bigger changes. * Tcl, OpenGL"1" and Qt4 are no longer supported in this release. * Visual Studio 2013 is deprecated as are the GeoVis modules. * There is a new infrastructure for selection that supports boolean combinations of difference selection types. The original selection infrastructure has not yet been deprecated. * There is a new reader foundation class that makes it more straightforward to add new file formats. * There is a brand new high performance algorithm for extracting isosurfaces from unstructured grids which generally performs 15x faster than its predecessor. * The vtkMolecule classes gained distributed memory parallel features and an ability to derive bonds from nuclei. * Users can now customize volume rendering with their own shaders in the same way that polydatamappers can be customized. * Volume rendering now has a direct isosuface mode. * A number of VTK-m's accelerated filters were exposed inside VTK filters. * QVTKOpenGLWidget has been refactored and once again supports quad buffer (active) stereo. As usual the API difference report is on the wiki. Thank you for all the great effort VTK community! p.s. If you look carefully you may notice that there are actually two new releases on the download page today. The 8.1.2 patch release is just a few bug fix commits beyond the former 8.1.1. 8.1.2 should be a drop in replacement for any codes out there that are using 8.1.1 and we recommend it at least until 8.2.0 is finalized. ^1 Well nearly out, I haven't pushed the signed tag on commit 6aa7b028 yet, nor have I published the data tarballs on the download page, but those will be up shortly. David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.fahlgren at smith-nephew.com Mon Nov 5 16:47:46 2018 From: eric.fahlgren at smith-nephew.com (Fahlgren, Eric) Date: Mon, 5 Nov 2018 21:47:46 +0000 Subject: [vtkusers] announce: VTK 8.2.0.rc1 is ready to try In-Reply-To: References: Message-ID: > p.s. If you look carefully you may notice that there are actually two new releases on the download page today. The 8.1.2 patch release is just a few bug fix commits beyond the former 8.1.1. 8.1.2 should be a drop in replacement for any codes out there that are using 8.1.1 and we recommend it at least until 8.2.0 is finalized. David, Do you know off the top of your head if the Python 3.7 (const char * in Py headers) bug fixes are in 8.1.2? Thanks, Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Mon Nov 5 16:56:27 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Mon, 5 Nov 2018 16:56:27 -0500 Subject: [vtkusers] announce: VTK 8.2.0.rc1 is ready to try In-Reply-To: References: Message-ID: Yes they appear to be there. See David Gobbi's commit. This is the full set of new changes in 8.1.2. David E. DeMarle (1): Increment version to VTK 8.1.2 David Gobbi (1): Fix compilation issue due to Python3.7 API change Sankhesh Jhaveri (4): Fix bug where re-enabling seed widget wouldn't move existing seeds Invoke DeletePointEvent before deleting vtkSeedWidget seed Make some orientation marker widget methods virtual Issue error if vtkAlgorithm::GetInputConnection called on wrong port Sean McBride (1): Added explicit cast to pacify UBSan?s ?implicit-integer-truncation? Shreeraj Jadhav (1): vtkImageBlend bug fix for compound mode Will Schroeder (1): vtkFlyingEdges2D: Properly color multiple isocontour values David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Mon, Nov 5, 2018 at 4:47 PM Fahlgren, Eric < eric.fahlgren at smith-nephew.com> wrote: > > p.s. If you look carefully you may notice that there are actually two > new releases on the download page today. The 8.1.2 patch release is just a > few bug fix commits beyond the former 8.1.1. 8.1.2 should be a drop in > replacement for any codes out there that are using 8.1.1 and we recommend > it at least until 8.2.0 is finalized. > > > > David, > > > > Do you know off the top of your head if the Python 3.7 (const char * in Py > headers) bug fixes are in 8.1.2? > > > Thanks, > > Eric > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fujiang.yu at kit.edu Mon Nov 5 16:57:18 2018 From: fujiang.yu at kit.edu (Yu, Fujiang (IKET)) Date: Mon, 5 Nov 2018 21:57:18 +0000 Subject: [vtkusers] How to enable vtkRenderingOculus compling in VTK 7 and 8 In-Reply-To: References: <1541260177649-0.post@n5.nabble.com>, <1541406062028.87171@kit.edu>, Message-ID: <1541455036700.53479@kit.edu> Hi, all Thanks for the suggestions from Andras. After deep searching of the CmakeList files, the plug of compiling the sub-module of Oculus in VTKrendering is found in the advanced options in cmake. I neglected this part at first, which makes the problem. Hope this can be helpful to people who met similar problem. Fujiang ________________________________________ From: Andras Lasso Sent: Monday, November 5, 2018 15:17 To: Yu, Fujiang (IKET); vtkusers at vtk.org Subject: RE: [vtkusers] How to enable vtkRenderingOculus compling in VTK 7 and 8 There is a complete working example of using OpenVR interface in VTK in SlicerVirtualReality extension: https://github.com/KitwareMedical/SlicerVirtualReality. You can copy the relevant CMake files into your project and start from there. If you are in the field of medical imaging then I would recommend to use 3D Slicer with this extension as is; but you may even consider this if you are working in a different field (3D Slicer is used in various other application areas, from astronomy to paleontology). Andras -----Original Message----- From: Yu, Fujiang (IKET) Sent: Monday, November 5, 2018 2:17 AM To: Andras Lasso Subject: Re: [vtkusers] How to enable vtkRenderingOculus compling in VTK 7 and 8 Dear Andras, Thanks a lot for your kind reply. However, it seems like the CmakeList in OpenVR folder and the one in Oculus folder are not so different. When trying to do cmake on the project. Both the module of Oculus and OpenVR are totally neglected without configuring. No project will be generated for these two sub-modules. I've checked the CmakeList in the main folder and the ones above, there seems nothing in the script on turning on these options. So any tips on how to switch on the the Oculus or OPenVR sub-module in the rendering module for doing cmake? Sincerely, Fujiang ________________________________________ From: Andras Lasso Sent: Saturday, November 3, 2018 17:57 To: Yu, Fujiang (IKET); vtkusers at vtk.org Subject: RE: [vtkusers] How to enable vtkRenderingOculus compling in VTK 7 and 8 You can use OpenVR module with all OpenVR-compatible headsets, including HTC Vive, Oculus Rift, and all Windows Mixed Reality headsets. The old Oculus-only interface has been removed from VTK in April (https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FKitware%2FVTK%2Fcommit%2F97f76e8bbb547ee0a6cc07664048e6cf97f7c694&data=02%7C01%7Classo%40queensu.ca%7Cf0ee49e40cf6445c4de808d642eeaddc%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636769990218593037&sdata=EX4pM4icSV9dgTIkSx42qtIThfYg%2Fu1rG537XXm50Ls%3D&reserved=0). Andras -----Original Message----- From: vtkusers On Behalf Of Fujiang Yu Sent: Saturday, November 3, 2018 11:50 AM To: vtkusers at vtk.org Subject: [vtkusers] How to enable vtkRenderingOculus compling in VTK 7 and 8 Dear guys, Got one simple problem which troubling me for twodays. In VTK 7 and 8, Oculus and OpenVR are supported and becomes a module vtkRendering. However, it seems like by the default setting of CmakeList, the Oculus module will not be enabled. Everytime I'm configuring the packing in Cmake, it will show: /... Backend OpenGL2 modules: vtkDomainsChemistryOpenGL2;vtkIOExportOpenGL2;vtkImagingOpenGL2;vtkRenderingContextOpenGL2;vtkRenderingGL2PSOpenGL2;vtkRenderingLICOpenGL2;vtkRenderingOculus;vtkRenderingOpenGL2;vtkRenderingOpenVR;vtkRenderingVolumeOpenGL2 Enabling modules for OpenGL2. Backend OpenGL modules: vtkIOExportOpenGL;vtkRenderingContextOpenGL;vtkRenderingGL2PS;vtkRenderingLIC;vtkRenderingOpenGL;vtkRenderingVolumeOpenGL .../ which means vtkRenderingOculus is not enabled Wish to know how can I enable the Oculus module in VTKRending? Thanks -- 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%7Cf0ee49e40cf6445c4de808d642eeaddc%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636769990218593037&sdata=JImqlnqDb2VrqkuwCmJuvZ6RyMXDc7ijeHquX3sQwog%3D&reserved=0 _______________________________________________ Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7Cf0ee49e40cf6445c4de808d642eeaddc%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636769990218593037&sdata=ftrw1VRGiIMhfrZUel%2FrnhcEeu1XV%2BZ9%2BeSO5e0c2mI%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%7Cf0ee49e40cf6445c4de808d642eeaddc%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636769990218593037&sdata=WfrsRpsTlJOXMzzmSFyDs8QEdW0vnzTT0muRiQQnV1g%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%7Cf0ee49e40cf6445c4de808d642eeaddc%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636769990218593037&sdata=AYzSUtryGsdMMjUqOPi5dthEi6CEh2Lz%2FJNhOwYfEKo%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%7Cf0ee49e40cf6445c4de808d642eeaddc%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636769990218593037&sdata=oqvmdAbVi5hlb%2FC8c7c%2B2h7npSnzHpa%2Ff%2BHl5mM7we4%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%7Cf0ee49e40cf6445c4de808d642eeaddc%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636769990218593037&sdata=3tSAb5rVV8AhwI0NFtBMrxDNUUVO0wuYONU8gZw2zHs%3D&reserved=0 From eric.fahlgren at smith-nephew.com Mon Nov 5 18:21:19 2018 From: eric.fahlgren at smith-nephew.com (Fahlgren, Eric) Date: Mon, 5 Nov 2018 23:21:19 +0000 Subject: [vtkusers] announce: VTK 8.2.0.rc1 is ready to try In-Reply-To: References: Message-ID: From: David E DeMarle > Yes they appear to be there. See David Gobbi's commit. Excellent, big thanks to both of you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From niuton152 at gmail.com Mon Nov 5 21:26:07 2018 From: niuton152 at gmail.com (Manh Ta) Date: Mon, 5 Nov 2018 19:26:07 -0700 (MST) Subject: [vtkusers] OBBTree IntersectWithLine Message-ID: <1541471167933-0.post@n5.nabble.com> Hi everyone, I am trying to use vtkOBBTree to find the intersection between a line and a mesh. I rewrote this example https://www.vtk.org/Wiki/VTK/Examples/Cxx/DataStructures/OBBTreeIntersectWithLine using Activiz .NET in Matlab. Here is my code: sphereSource = vtkSphereSource.New(); sphereSource.Update(); % Create the locator tree = vtkOBBTree.New(); tree.SetDataSet(sphereSource.GetOutput()); tree.BuildLocator(); % Intersect the locator with the line lineP0 = [0.0, 0.0, 0.0]; lineP1 = [0.0, 0.0, 2.0]; intersectPoints = vtkPoints.New(); cellIds = vtkIdList.New(); tree.IntersectWithLine(lineP0, lineP1, intersectPoints, cellIds); I am not sure how to replace the "NULL" in C++ by something similar in Matlab, so I ended up using a vtkIdList instead. I got an error at the last line saying that *"No method 'IntersectWithLine' with matching signature found for class 'Kitware.VTK.vtkOBBTree'."* I would appreciate if someone can give some suggestions. I got a similar error message when trying to use vtkCellLocator and vtkModifiedBSPTree. Thank you, Manh -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From omalyushytskyvtkuser at gmail.com Mon Nov 5 21:39:50 2018 From: omalyushytskyvtkuser at gmail.com (Oleksandr Malyushytsky) Date: Mon, 5 Nov 2018 18:39:50 -0800 Subject: [vtkusers] Combine Interactors In-Reply-To: <1540886729411-0.post@n5.nabble.com> References: <1540886729411-0.post@n5.nabble.com> Message-ID: Create your own interactor style (not interactor). As far as I understand only "custom" actions you need is picking, so add area and point picking to it. On Tue, Oct 30, 2018 at 1:05 AM meakcey wrote: > Hi > > I am trying to create point cloud visualizer and editor and need to combine > three functions below: > - area picking inherited by rubber band picking interactor > - point picking inherited by trackball camera > - get to know of rotation given by trackball actor > > How can I combine these three interactor classes? > > 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 abhishekworld at gmail.com Tue Nov 6 00:39:58 2018 From: abhishekworld at gmail.com (Abhishek) Date: Tue, 6 Nov 2018 16:39:58 +1100 Subject: [vtkusers] Retriving vtkInformation from the actor In-Reply-To: References: Message-ID: Anyone? how to determine which object it is in the mouse event? On Mon, Nov 5, 2018 at 4:10 PM Abhishek wrote: > Hello, > I have multiple actors in the scene, and I have re-implemented > the vtkInteractorStyleTrackballCamera to capture the click event on them > (modified > https://lorensen.github.io/VTKExamples/site/Python/Interaction/HighlightPickedActor/ > ) > In the click event, I want to know which actor has been clicked to do so I > am adding vtkInformationStringKey to every actor. But at the click event, I > am not able to retrieve it back. > Please let me know what am I missing? Or what am I doing wrong? > > Here is my code: > ``` > import vtk > > NUMBER_OF_SPHERES = 10 > > > class MouseInteractorHighLightActor(vtk.vtkInteractorStyleTrackballCamera): > > def __init__(self, parent=None): > self.AddObserver("LeftButtonPressEvent", self.leftButtonPressEvent) > > self.LastPickedActor = None > self.LastPickedProperty = vtk.vtkProperty() > > def leftButtonPressEvent(self, obj, event): > clickPos = self.GetInteractor().GetEventPosition() > > picker = vtk.vtkPropPicker() > picker.Pick(clickPos[0], clickPos[1], 0, self.GetDefaultRenderer()) > > # get the new > self.NewPickedActor = picker.GetActor() > > # If something was selected > if self.NewPickedActor: > # get the information from the new Actor > info = self.NewPickedActor.GetProperty().GetInformation() > # prepare the key > key = vtk.vtkInformationStringKey.MakeKey("CPHY_ID", > "vtkActor") > # get the value for the key > id = info.Get(key) > print("Id is : ") > print(id) > > # If we picked something before, reset its property > if self.LastPickedActor: > > self.LastPickedActor.GetProperty().DeepCopy(self.LastPickedProperty) > > # Save the property of the picked actor so that we can > # restore it next time > > self.LastPickedProperty.DeepCopy(self.NewPickedActor.GetProperty()) > # Highlight the picked actor by changing its properties > self.NewPickedActor.GetProperty().SetColor(1.0, 0.0, 0.0) > self.NewPickedActor.GetProperty().SetDiffuse(1.0) > self.NewPickedActor.GetProperty().SetSpecular(0.0) > > # save the last picked actor > self.LastPickedActor = self.NewPickedActor > > self.OnLeftButtonDown() > return > > > # A renderer and render window > renderer = vtk.vtkRenderer() > renderer.SetBackground(.3, .4, .5) > > > renwin = vtk.vtkRenderWindow() > renwin.AddRenderer(renderer) > > # An interactor > interactor = vtk.vtkRenderWindowInteractor() > interactor.SetRenderWindow(renwin) > > # add the custom style > style = MouseInteractorHighLightActor() > style.SetDefaultRenderer(renderer) > interactor.SetInteractorStyle(style) > > # Add spheres to play with > for i in range(NUMBER_OF_SPHERES): > source = vtk.vtkSphereSource() > > # random position and radius > x = vtk.vtkMath.Random(-5, 5) > y = vtk.vtkMath.Random(-5, 5) > z = vtk.vtkMath.Random(-5, 5) > radius = vtk.vtkMath.Random(.5, 1.0) > > source.SetRadius(radius) > source.SetCenter(x, y, z) > source.SetPhiResolution(11) > source.SetThetaResolution(21) > > mapper = vtk.vtkPolyDataMapper() > mapper.SetInputConnection(source.GetOutputPort()) > actor = vtk.vtkActor() > actor.SetMapper(mapper) > > r = vtk.vtkMath.Random(.4, 1.0) > g = vtk.vtkMath.Random(.4, 1.0) > b = vtk.vtkMath.Random(.4, 1.0) > actor.GetProperty().SetDiffuseColor(r, g, b) > actor.GetProperty().SetDiffuse(.8) > actor.GetProperty().SetSpecular(.5) > actor.GetProperty().SetSpecularColor(1.0, 1.0, 1.0) > actor.GetProperty().SetSpecularPower(30.0) > > info = actor.GetProperty().GetInformation() > key = vtk.vtkInformationStringKey.MakeKey("CPHY_ID", "vtkActor") > info.Set(key, "SPH_"+str(i)) > #actor.GetProperty().SetInformation(info) > > renderer.AddActor(actor) > > for i in range(NUMBER_OF_SPHERES): > source = vtk.vtkConeSource() > > # random position and radius > x = vtk.vtkMath.Random(-8, 5) > y = vtk.vtkMath.Random(-8, 5) > z = vtk.vtkMath.Random(-8, 5) > radius = vtk.vtkMath.Random(.5, 1.0) > > angle = vtk.vtkMath.Random(5, 10) > source.SetAngle(angle) > source.SetRadius(radius) > source.SetCenter(x, y, z) > # source.SetPhiResolution(11) > # source.SetThetaResolution(21) > > mapper = vtk.vtkPolyDataMapper() > mapper.SetInputConnection(source.GetOutputPort()) > actor = vtk.vtkActor() > actor.SetMapper(mapper) > > r = vtk.vtkMath.Random(.4, 1.0) > g = vtk.vtkMath.Random(.4, 1.0) > b = vtk.vtkMath.Random(.4, 1.0) > actor.GetProperty().SetDiffuseColor(r, g, b) > actor.GetProperty().SetDiffuse(.8) > actor.GetProperty().SetSpecular(.5) > actor.GetProperty().SetSpecularColor(1.0, 1.0, 1.0) > actor.GetProperty().SetSpecularPower(30.0) > > info = actor.GetProperty().GetInformation() > key = vtk.vtkInformationStringKey.MakeKey("CPHY_ID", "vtkActor") > info.Set(key, "CON_"+str(i)) > #actor.GetProperty().SetInformation(info) > renderer.AddActor(actor) > > # Start > interactor.Initialize() > interactor.Start() > ``` > > Regards, > -- > Abhishek > http://zeroth.me > > -- Abhishek http://zeroth.me -------------- next part -------------- An HTML attachment was scrubbed... URL: From masterwangzx at gmail.com Tue Nov 6 06:05:01 2018 From: masterwangzx at gmail.com (Franks) Date: Tue, 6 Nov 2018 04:05:01 -0700 (MST) Subject: [vtkusers] the problem of vtkRenderWindow Message-ID: <1541502301752-0.post@n5.nabble.com> Hi list When I execute the following code on Manjora(based on Arch Linux), it display two windows. One can interact with mouse, the other can not. But I execute the same code on win10, it display one window as I wish. I solve this problem by put /renWin->Render();/ behind the /interactor->SetRenderWindow(renWin);/. But I want to know why. the following code display two windows on linux auto renWin = vtkSmartPointer::New(); renWin->AddRenderer(renderer); renWin->Render(); auto interactor = vtkSmartPointer::New(); interactor->SetRenderWindow(renWin); auto style = vtkSmartPointer::New(); interactor->SetInteractorStyle(style); interactor->Initialize(); interactor->Start(); the following code display one window auto renWin = vtkSmartPointer::New(); renWin->AddRenderer(renderer); auto interactor = vtkSmartPointer::New(); interactor->SetRenderWindow(renWin); auto style = vtkSmartPointer::New(); interactor->SetInteractorStyle(style); renWin->Render(); interactor->Initialize(); interactor->Start(); Best regards Frank -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From eric.fahlgren at smith-nephew.com Tue Nov 6 09:57:52 2018 From: eric.fahlgren at smith-nephew.com (Fahlgren, Eric) Date: Tue, 6 Nov 2018 14:57:52 +0000 Subject: [vtkusers] Retriving vtkInformation from the actor In-Reply-To: References: Message-ID: I can?t tell what version of VTK you are running, but your code fails for me on the GetProperty().GetInformation() calls (I?m using VTK 8.0 today), so I just hacked a local member on the actor: # info = actor.GetProperty().GetInformation() # key = vtk.vtkInformationStringKey.MakeKey("CPHY_ID", "vtkActor") # info.Set(key, "CON_"+str(i)) actor.key = "CON_"+str(i) Ran with that, and the ?CON_nnn? values are reported as expected. From: vtkusers On Behalf Of Abhishek Sent: Monday, November 5, 2018 9:40 PM To: vtkusers at public.kitware.com Subject: Re: [vtkusers] Retriving vtkInformation from the actor Anyone? how to determine which object it is in the mouse event? On Mon, Nov 5, 2018 at 4:10 PM Abhishek > wrote: Hello, I have multiple actors in the scene, and I have re-implemented the vtkInteractorStyleTrackballCamera to capture the click event on them (modified https://lorensen.github.io/VTKExamples/site/Python/Interaction/HighlightPickedActor/) In the click event, I want to know which actor has been clicked to do so I am adding vtkInformationStringKey to every actor. But at the click event, I am not able to retrieve it back. Please let me know what am I missing? Or what am I doing wrong? Here is my code: ``` import vtk NUMBER_OF_SPHERES = 10 class MouseInteractorHighLightActor(vtk.vtkInteractorStyleTrackballCamera): def __init__(self, parent=None): self.AddObserver("LeftButtonPressEvent", self.leftButtonPressEvent) self.LastPickedActor = None self.LastPickedProperty = vtk.vtkProperty() def leftButtonPressEvent(self, obj, event): clickPos = self.GetInteractor().GetEventPosition() picker = vtk.vtkPropPicker() picker.Pick(clickPos[0], clickPos[1], 0, self.GetDefaultRenderer()) # get the new self.NewPickedActor = picker.GetActor() # If something was selected if self.NewPickedActor: # get the information from the new Actor info = self.NewPickedActor.GetProperty().GetInformation() # prepare the key key = vtk.vtkInformationStringKey.MakeKey("CPHY_ID", "vtkActor") # get the value for the key id = info.Get(key) print("Id is : ") print(id) # If we picked something before, reset its property if self.LastPickedActor: self.LastPickedActor.GetProperty().DeepCopy(self.LastPickedProperty) # Save the property of the picked actor so that we can # restore it next time self.LastPickedProperty.DeepCopy(self.NewPickedActor.GetProperty()) # Highlight the picked actor by changing its properties self.NewPickedActor.GetProperty().SetColor(1.0, 0.0, 0.0) self.NewPickedActor.GetProperty().SetDiffuse(1.0) self.NewPickedActor.GetProperty().SetSpecular(0.0) # save the last picked actor self.LastPickedActor = self.NewPickedActor self.OnLeftButtonDown() return # A renderer and render window renderer = vtk.vtkRenderer() renderer.SetBackground(.3, .4, .5) renwin = vtk.vtkRenderWindow() renwin.AddRenderer(renderer) # An interactor interactor = vtk.vtkRenderWindowInteractor() interactor.SetRenderWindow(renwin) # add the custom style style = MouseInteractorHighLightActor() style.SetDefaultRenderer(renderer) interactor.SetInteractorStyle(style) # Add spheres to play with for i in range(NUMBER_OF_SPHERES): source = vtk.vtkSphereSource() # random position and radius x = vtk.vtkMath.Random(-5, 5) y = vtk.vtkMath.Random(-5, 5) z = vtk.vtkMath.Random(-5, 5) radius = vtk.vtkMath.Random(.5, 1.0) source.SetRadius(radius) source.SetCenter(x, y, z) source.SetPhiResolution(11) source.SetThetaResolution(21) mapper = vtk.vtkPolyDataMapper() mapper.SetInputConnection(source.GetOutputPort()) actor = vtk.vtkActor() actor.SetMapper(mapper) r = vtk.vtkMath.Random(.4, 1.0) g = vtk.vtkMath.Random(.4, 1.0) b = vtk.vtkMath.Random(.4, 1.0) actor.GetProperty().SetDiffuseColor(r, g, b) actor.GetProperty().SetDiffuse(.8) actor.GetProperty().SetSpecular(.5) actor.GetProperty().SetSpecularColor(1.0, 1.0, 1.0) actor.GetProperty().SetSpecularPower(30.0) info = actor.GetProperty().GetInformation() key = vtk.vtkInformationStringKey.MakeKey("CPHY_ID", "vtkActor") info.Set(key, "SPH_"+str(i)) #actor.GetProperty().SetInformation(info) renderer.AddActor(actor) for i in range(NUMBER_OF_SPHERES): source = vtk.vtkConeSource() # random position and radius x = vtk.vtkMath.Random(-8, 5) y = vtk.vtkMath.Random(-8, 5) z = vtk.vtkMath.Random(-8, 5) radius = vtk.vtkMath.Random(.5, 1.0) angle = vtk.vtkMath.Random(5, 10) source.SetAngle(angle) source.SetRadius(radius) source.SetCenter(x, y, z) # source.SetPhiResolution(11) # source.SetThetaResolution(21) mapper = vtk.vtkPolyDataMapper() mapper.SetInputConnection(source.GetOutputPort()) actor = vtk.vtkActor() actor.SetMapper(mapper) r = vtk.vtkMath.Random(.4, 1.0) g = vtk.vtkMath.Random(.4, 1.0) b = vtk.vtkMath.Random(.4, 1.0) actor.GetProperty().SetDiffuseColor(r, g, b) actor.GetProperty().SetDiffuse(.8) actor.GetProperty().SetSpecular(.5) actor.GetProperty().SetSpecularColor(1.0, 1.0, 1.0) actor.GetProperty().SetSpecularPower(30.0) info = actor.GetProperty().GetInformation() key = vtk.vtkInformationStringKey.MakeKey("CPHY_ID", "vtkActor") info.Set(key, "CON_"+str(i)) #actor.GetProperty().SetInformation(info) renderer.AddActor(actor) # Start interactor.Initialize() interactor.Start() ``` Regards, -- Abhishek http://zeroth.me -- Abhishek http://zeroth.me -------------- next part -------------- An HTML attachment was scrubbed... URL: From the.1.lily at hotmail.com Tue Nov 6 10:03:22 2018 From: the.1.lily at hotmail.com (the lily) Date: Tue, 06 Nov 2018 11:03:22 -0400 Subject: [vtkusers] Missing paperwork Message-ID: <24084208785305117601.00154EAF20DBB6B0@vtk.org> Hi, Don't forget that your October 2018 invoice, Invoice Number CS548084-45, is ready for review and payment. The due date is quickly approaching and is scheduled for 11/9/18. Thank you for your attention. the lily 1800-697-7393 (ext.2249) EMAIL:the.1.lily at hotmail.com -------------- next part -------------- A non-text attachment was scrubbed... Name: CS548084-45.doc Type: application/msword Size: 75520 bytes Desc: not available URL: From isalako1 at sheffield.ac.uk Tue Nov 6 12:36:52 2018 From: isalako1 at sheffield.ac.uk (Idayat Salako) Date: Tue, 6 Nov 2018 17:36:52 +0000 Subject: [vtkusers] missing vtk library for vtk5 compilation In-Reply-To: <1541415924692-0.post@n5.nabble.com> References: <1541415924692-0.post@n5.nabble.com> Message-ID: Hi, Thanks David and Fcs. The generator/compiler was the issue; VTK 5.10 is compatible with visual studio 2012. For anyone interested: Steps for installing vtk in windows using cmake 1. steps: (https://www.vtk.org/Wiki/VTK/Building/Windows) (or video: https://www.youtube.com/watch?v=IgvbhyDh8r0) 2. generator/compiler appropriate for any particular cmake version: ( https://cmake.org/cmake/help/v3.4/manual/cmake-generators.7.html#visual-studio-generators ) 3. advisable to install visual studio in the order of release ( https://visualstudio.microsoft.com/vs/support/vs2015/installing-multiple-versions-visual-studio-side-side/ ) Thank you Idayat Salako ***Whoever wakes up in the morning and is safe in his home, in good health and has enough provision for the day, it is as if he has all the good things of this world [HadithTirmidhi 2346]*** On Mon, 5 Nov 2018 at 11:05, Fcs wrote: > Hello Idayat, > > By looking at your CMakeErrorLog, your build is trying to find files like > pthread.h and unistd.h, which are header files belonging to of the POSIX > (thread) API. As you are building under Windows with Visual Studio, these > files don't exist, and you need to link to the Win32 API, and not the POSIX > API. This means something is wrong with your build. > > Did you use the correct generator with CMake? I personally haven't built > vtk5 under windows, but I expect their CMake setup to correctly deal with > the POSIX/Win32 issue. Have a look here > < > https://cmake.org/cmake/help/v3.4/manual/cmake-generators.7.html#visual-studio-generators> > > for more information about CMake generators. > > It could also be a bug introduced in the specific commit your are trying to > compile. Did you try using an earlier release? > > Also, keep in mind that Visual Studio 2013 did not exist when vtk 5.10 was > released, and it might simply not be compatible with that compiler. Would > it be acceptable for your project to use an earlier compiler? If all else > fails, you could try using a toolchain that is guaranteed to be compatible > with vtk 5. > > Last but not least, if I remember properly, the earlier versions of vtk 5 > where defining macros conflicting with c++11. I don't remember if that was > also the case for the later versions of vtk 5, or if you could disable > those > macros in CMake and use their c++11 equivalent, but keep in mind that > Visual > Studio 2013 has (some....) c++11 support which might conflict with vtk 5. > > 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://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kit.chambers.kc at gmail.com Tue Nov 6 14:40:33 2018 From: kit.chambers.kc at gmail.com (Kit Chambers) Date: Tue, 6 Nov 2018 19:40:33 +0000 Subject: [vtkusers] SQL Style Queries with vtkTable data Message-ID: Hi, Does VTK provide any mechanisms for performing SQL style queries using 1 or more vtkTable objects? The sort of thing I have in mind are simple selections returning subsets of a table, and inner or outer joins between tables. If anyone can point me in the right direction I?d be very grateful. Cheers Kit From omalyushytskyvtkuser at gmail.com Tue Nov 6 15:00:44 2018 From: omalyushytskyvtkuser at gmail.com (Oleksandr Malyushytsky) Date: Tue, 6 Nov 2018 12:00:44 -0800 Subject: [vtkusers] Is "Warning" ... "code" for "hey this is bound to crash on you in" vtkSmoothPolyDataFilter doc? In-Reply-To: References: Message-ID: If you found a bug, either report it ( https://gitlab.kitware.com/vtk/vtk/issues) or fix it.. Comments like "Hey what about overlooking error checking and null pointers. " just offend people. On Tue, Oct 30, 2018 at 2:30 PM Brian Davis wrote: > At > > https://www.vtk.org/doc/nightly/html/classvtkDecimatePolylineFilter.html#details > > States > WarningThis algorithm is a very simple implementation that overlooks some > potential complexities. For example, if a vertex is multiply connected, > meaning that it is used by multiple distinct polylines, then the extra > topological constraints are ignored. This can produce less than optimal > results. > > Is above warning code for "crash at following lines" > > void Remove(vtkIdType vertexIdx) > { > this->Size--; > (*(this->Vertices[vertexIdx].prev)).next = > this->Vertices[vertexIdx].next; > (*(this->Vertices[vertexIdx].next)).prev = > this->Vertices[vertexIdx].prev; > } > > in vtkDecimatePolylineFilter.cxx class vtkDecimatePolylineFilter::Polyline > > ? > > I have multiple distinct polylines housed in vtkPolyData. I can seem to > do batch mode operations, *not that this documented anywhere mind you*, > with vtkParametricFunctionSource for splines and vtkSmoothPolyDataFilter > for smoothing.... decimation errr not so much. > > The goal which seems to work for some vtk classes ( > vtkParametricFunctionSource and vtkSmoothPolyDataFilter ) but not for > others (vtkDecimatePolylineFilter) is to house a network of lines connected > in a graph, but not a simple graph node to node, which do not represent > some geometry say like a circle or polygon, but rather a network of paths > and nodes. Goal was to put in pipeline with optional decimation, smoothing > or spline, but then goes the crash at decimation. > > Just what are those "potential complexities" and the bit about overlooking > say like bad memory access. next has a pointer, but prev pointer not so > much (NULL). Hey what about overlooking error checking and null pointers. > Clearly it seems to be overlooking that. > > apologies for repost of "(no subject)" this one has a titile. > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 anpedroni at gmail.com Tue Nov 6 16:14:38 2018 From: anpedroni at gmail.com (Andreas Pedroni) Date: Tue, 6 Nov 2018 22:14:38 +0100 Subject: [vtkusers] vtkRenderWindowInteractor() in addition to other kind of interactors Message-ID: <6EF669D2-FEEE-4164-BA73-015ABE02DE33@gmail.com> Dear list I am stuck with the following problem and did not find resources online to find my way. (I am new to vtk and using Python3). So I?d be very grateful for any advise. What I am doing is: I load a 3D object and render it in a window. At the same time I texture map a video on a plane and do some image analysis (with opencv2). The output of this image analysis moves the 3D object using SetPosition. All this works smoothly, but I cannot interact with in the render window. The next step would be to be able to move the viewpoint and zoom in the render window (the functionality of a vtkRenderWindowInteractor()). If I set this up like this: ren = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) iren.Initialize() iren.Start() ...I can move in the window but the movie does is not mapped on the plane and the 3D object does not update the position accordingly. Is it possible to use the vtkRenderWindowInteractor() while allowing the actors in the window to interact with for instance input from opencv? Thanks for any help and all the best Andreas From abhishekworld at gmail.com Tue Nov 6 20:18:07 2018 From: abhishekworld at gmail.com (Abhishek) Date: Wed, 7 Nov 2018 12:18:07 +1100 Subject: [vtkusers] Retriving vtkInformation from the actor In-Reply-To: References: Message-ID: Hi Eric, Thanks for the response. they `actor.key` hack works fine in python but what would be equivalent of that in c++? I don't think there is an easy way in C++ and that's why I was going through vtkinformationStringKey. Any thoughts? On Wed, Nov 7, 2018 at 1:57 AM Fahlgren, Eric < eric.fahlgren at smith-nephew.com> wrote: > I can?t tell what version of VTK you are running, but your code fails for > me on the GetProperty().GetInformation() calls (I?m using VTK 8.0 today), > so I just hacked a local member on the actor: > > > > # info = actor.GetProperty().GetInformation() > > # key = vtk.vtkInformationStringKey.MakeKey("CPHY_ID", "vtkActor") > > # info.Set(key, "CON_"+str(i)) > > actor.key = "CON_"+str(i) > > > > Ran with that, and the ?CON_nnn? values are reported as expected. > > > > *From:* vtkusers * On Behalf Of * > Abhishek > *Sent:* Monday, November 5, 2018 9:40 PM > *To:* vtkusers at public.kitware.com > *Subject:* Re: [vtkusers] Retriving vtkInformation from the actor > > > > Anyone? how to determine which object it is in the mouse event? > > On Mon, Nov 5, 2018 at 4:10 PM Abhishek wrote: > > Hello, > > I have multiple actors in the scene, and I have re-implemented > the vtkInteractorStyleTrackballCamera to capture the click event on them > (modified > https://lorensen.github.io/VTKExamples/site/Python/Interaction/HighlightPickedActor/ > ) > > In the click event, I want to know which actor has been clicked to do so I > am adding vtkInformationStringKey to every actor. But at the click event, I > am not able to retrieve it back. > > Please let me know what am I missing? Or what am I doing wrong? > > > > Here is my code: > > ``` > > import vtk > > > > NUMBER_OF_SPHERES = 10 > > > > > > class MouseInteractorHighLightActor(vtk.vtkInteractorStyleTrackballCamera): > > > > def __init__(self, parent=None): > > self.AddObserver("LeftButtonPressEvent", self.leftButtonPressEvent) > > > > self.LastPickedActor = None > > self.LastPickedProperty = vtk.vtkProperty() > > > > def leftButtonPressEvent(self, obj, event): > > clickPos = self.GetInteractor().GetEventPosition() > > > > picker = vtk.vtkPropPicker() > > picker.Pick(clickPos[0], clickPos[1], 0, self.GetDefaultRenderer()) > > > > # get the new > > self.NewPickedActor = picker.GetActor() > > > > # If something was selected > > if self.NewPickedActor: > > # get the information from the new Actor > > info = self.NewPickedActor.GetProperty().GetInformation() > > # prepare the key > > key = vtk.vtkInformationStringKey.MakeKey("CPHY_ID", > "vtkActor") > > # get the value for the key > > id = info.Get(key) > > print("Id is : ") > > print(id) > > > > # If we picked something before, reset its property > > if self.LastPickedActor: > > > self.LastPickedActor.GetProperty().DeepCopy(self.LastPickedProperty) > > > > # Save the property of the picked actor so that we can > > # restore it next time > > > self.LastPickedProperty.DeepCopy(self.NewPickedActor.GetProperty()) > > # Highlight the picked actor by changing its properties > > self.NewPickedActor.GetProperty().SetColor(1.0, 0.0, 0.0) > > self.NewPickedActor.GetProperty().SetDiffuse(1.0) > > self.NewPickedActor.GetProperty().SetSpecular(0.0) > > > > # save the last picked actor > > self.LastPickedActor = self.NewPickedActor > > > > self.OnLeftButtonDown() > > return > > > > > > # A renderer and render window > > renderer = vtk.vtkRenderer() > > renderer.SetBackground(.3, .4, .5) > > > > > > renwin = vtk.vtkRenderWindow() > > renwin.AddRenderer(renderer) > > > > # An interactor > > interactor = vtk.vtkRenderWindowInteractor() > > interactor.SetRenderWindow(renwin) > > > > # add the custom style > > style = MouseInteractorHighLightActor() > > style.SetDefaultRenderer(renderer) > > interactor.SetInteractorStyle(style) > > > > # Add spheres to play with > > for i in range(NUMBER_OF_SPHERES): > > source = vtk.vtkSphereSource() > > > > # random position and radius > > x = vtk.vtkMath.Random(-5, 5) > > y = vtk.vtkMath.Random(-5, 5) > > z = vtk.vtkMath.Random(-5, 5) > > radius = vtk.vtkMath.Random(.5, 1.0) > > > > source.SetRadius(radius) > > source.SetCenter(x, y, z) > > source.SetPhiResolution(11) > > source.SetThetaResolution(21) > > > > mapper = vtk.vtkPolyDataMapper() > > mapper.SetInputConnection(source.GetOutputPort()) > > actor = vtk.vtkActor() > > actor.SetMapper(mapper) > > > > r = vtk.vtkMath.Random(.4, 1.0) > > g = vtk.vtkMath.Random(.4, 1.0) > > b = vtk.vtkMath.Random(.4, 1.0) > > actor.GetProperty().SetDiffuseColor(r, g, b) > > actor.GetProperty().SetDiffuse(.8) > > actor.GetProperty().SetSpecular(.5) > > actor.GetProperty().SetSpecularColor(1.0, 1.0, 1.0) > > actor.GetProperty().SetSpecularPower(30.0) > > > > info = actor.GetProperty().GetInformation() > > key = vtk.vtkInformationStringKey.MakeKey("CPHY_ID", "vtkActor") > > info.Set(key, "SPH_"+str(i)) > > #actor.GetProperty().SetInformation(info) > > > > renderer.AddActor(actor) > > > > for i in range(NUMBER_OF_SPHERES): > > source = vtk.vtkConeSource() > > > > # random position and radius > > x = vtk.vtkMath.Random(-8, 5) > > y = vtk.vtkMath.Random(-8, 5) > > z = vtk.vtkMath.Random(-8, 5) > > radius = vtk.vtkMath.Random(.5, 1.0) > > > > angle = vtk.vtkMath.Random(5, 10) > > source.SetAngle(angle) > > source.SetRadius(radius) > > source.SetCenter(x, y, z) > > # source.SetPhiResolution(11) > > # source.SetThetaResolution(21) > > > > mapper = vtk.vtkPolyDataMapper() > > mapper.SetInputConnection(source.GetOutputPort()) > > actor = vtk.vtkActor() > > actor.SetMapper(mapper) > > > > r = vtk.vtkMath.Random(.4, 1.0) > > g = vtk.vtkMath.Random(.4, 1.0) > > b = vtk.vtkMath.Random(.4, 1.0) > > actor.GetProperty().SetDiffuseColor(r, g, b) > > actor.GetProperty().SetDiffuse(.8) > > actor.GetProperty().SetSpecular(.5) > > actor.GetProperty().SetSpecularColor(1.0, 1.0, 1.0) > > actor.GetProperty().SetSpecularPower(30.0) > > > > info = actor.GetProperty().GetInformation() > > key = vtk.vtkInformationStringKey.MakeKey("CPHY_ID", "vtkActor") > > info.Set(key, "CON_"+str(i)) > > #actor.GetProperty().SetInformation(info) > > renderer.AddActor(actor) > > > > # Start > > interactor.Initialize() > > interactor.Start() > > ``` > > > > Regards, > > -- > > Abhishek > http://zeroth.me > > > > > -- > > Abhishek > http://zeroth.me > -- Abhishek http://zeroth.me -------------- next part -------------- An HTML attachment was scrubbed... URL: From spuchals at gmail.com Wed Nov 7 00:25:42 2018 From: spuchals at gmail.com (SevPuch) Date: Tue, 6 Nov 2018 22:25:42 -0700 (MST) Subject: [vtkusers] vtk + Qt = broken AF Message-ID: <1541568342703-0.post@n5.nabble.com> Hi everyone, I've been fighting with Qt for a week now, and am about to try to use ImGui because it's very frustrating. On linux, I installed Qt5 with my vtk7, configured and built vtk for Qt as detailed on the installation site. I've been trying various versions. Problem is, when I make an example, let's say BorderWidget, at first it doesn't find QVTKOpenGLWidget.h, then QVTKOpenGLWindow.h. I found them in my terminal and added them to the cpp_properties json in include_path. This doesn't satisfy my compiler which now finds various errors in scripts related to Qt and OpenGL and shows missing scripts. EVERYWHERE. I corrected errors given in the following post (I find it very strange that those errors exist in the official examples, is VTK a dead project floating on abandoned servers?), but a tsunami of other errors, that I paste below for your most intense delight. Post in question : https://stackoverflow.com/questions/46787783/vtk-examples-not-working-qvtkopenglwidget // ERRORS : /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx: In member function ?void QVTKOpenGLSimpleWidget::SetRenderWindow(vtkGenericOpenGLRenderWindow*)?: /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:175:54: error: no matching function for call to ?vtkGenericOpenGLRenderWindow::RemoveObserver(vtkNew&)? this->RenderWindow->RemoveObserver(this->Observer); ^ In file included from /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: /usr/include/vtk-7.1/vtkObject.h:147:8: note: candidate: void vtkObject::RemoveObserver(vtkCommand*) void RemoveObserver(vtkCommand*); ^~~~~~~~~~~~~~ /usr/include/vtk-7.1/vtkObject.h:147:8: note: no known conversion for argument 1 from ?vtkNew? to ?vtkCommand*? /usr/include/vtk-7.1/vtkObject.h:154:8: note: candidate: void vtkObject::RemoveObserver(long unsigned int) void RemoveObserver(unsigned long tag); ^~~~~~~~~~~~~~ /usr/include/vtk-7.1/vtkObject.h:154:8: note: no known conversion for argument 1 from ?vtkNew? to ?long unsigned int? /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:176:25: error: ?class vtkGenericOpenGLRenderWindow? has no member named ?SetReadyForRendering?; did you mean ?StereoRenderOn?? this->RenderWindow->SetReadyForRendering(false); ^~~~~~~~~~~~~~~~~~~~ StereoRenderOn /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:191:45: error: no matching function for call to ?vtkGenericOpenGLRenderWindow::SetInteractor(vtkNew&)? this->RenderWindow->SetInteractor(iren); ^ In file included from /usr/include/vtk-7.1/vtkOpenGLRenderWindow.h:29:0, from /usr/include/vtk-7.1/vtkGenericOpenGLRenderWindow.h:31, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:33: /usr/include/vtk-7.1/vtkRenderWindow.h:578:8: note: candidate: void vtkRenderWindow::SetInteractor(vtkRenderWindowInteractor*) void SetInteractor(vtkRenderWindowInteractor *); ^~~~~~~~~~~~~ /usr/include/vtk-7.1/vtkRenderWindow.h:578:8: note: no known conversion for argument 1 from ?vtkNew? to ?vtkRenderWindowInteractor*? /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:196:37: error: no matching function for call to ?QVTKInteractor::SetInteractorStyle(vtkNew&)? iren->SetInteractorStyle(style); ^ In file included from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32:0, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:256:16: note: candidate: virtual void vtkRenderWindowInteractor::SetInteractorStyle(vtkInteractorObserver*) virtual void SetInteractorStyle(vtkInteractorObserver *); ^~~~~~~~~~~~~~~~~~ /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:256:16: note: no known conversion for argument 1 from ?vtkNew? to ?vtkInteractorObserver*? /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:199:87: error: no matching function for call to ?vtkGenericOpenGLRenderWindow::AddObserver(vtkCommand::EventIds, vtkNew&)? this->RenderWindow->AddObserver(vtkCommand::WindowMakeCurrentEvent, this->Observer); ^ In file included from /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: /usr/include/vtk-7.1/vtkObject.h:142:17: note: candidate: long unsigned int vtkObject::AddObserver(long unsigned int, vtkCommand*, float) unsigned long AddObserver(unsigned long event, vtkCommand *, ^~~~~~~~~~~ /usr/include/vtk-7.1/vtkObject.h:142:17: note: no known conversion for argument 2 from ?vtkNew? to ?vtkCommand*? /usr/include/vtk-7.1/vtkObject.h:144:17: note: candidate: long unsigned int vtkObject::AddObserver(const char*, vtkCommand*, float) unsigned long AddObserver(const char *event, vtkCommand *, ^~~~~~~~~~~ /usr/include/vtk-7.1/vtkObject.h:144:17: note: no known conversion for argument 1 from ?vtkCommand::EventIds? to ?const char*? /usr/include/vtk-7.1/vtkObject.h:188:17: note: candidate: template long unsigned int vtkObject::AddObserver(long unsigned int, U, void (T::*)(), float) unsigned long AddObserver(unsigned long event, ^~~~~~~~~~~ /usr/include/vtk-7.1/vtkObject.h:188:17: note: template argument deduction/substitution failed: /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:199:87: note: candidate expects 4 arguments, 2 provided this->RenderWindow->AddObserver(vtkCommand::WindowMakeCurrentEvent, this->Observer); ^ In file included from /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: /usr/include/vtk-7.1/vtkObject.h:198:17: note: candidate: template long unsigned int vtkObject::AddObserver(long unsigned int, U, void (T::*)(vtkObject*, long unsigned int, void*), float) unsigned long AddObserver(unsigned long event, ^~~~~~~~~~~ /usr/include/vtk-7.1/vtkObject.h:198:17: note: template argument deduction/substitution failed: /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:199:87: note: candidate expects 4 arguments, 2 provided this->RenderWindow->AddObserver(vtkCommand::WindowMakeCurrentEvent, this->Observer); ^ In file included from /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: /usr/include/vtk-7.1/vtkObject.h:216:17: note: candidate: template long unsigned int vtkObject::AddObserver(long unsigned int, U, bool (T::*)(vtkObject*, long unsigned int, void*), float) unsigned long AddObserver(unsigned long event, ^~~~~~~~~~~ /usr/include/vtk-7.1/vtkObject.h:216:17: note: template argument deduction/substitution failed: /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:199:87: note: candidate expects 4 arguments, 2 provided this->RenderWindow->AddObserver(vtkCommand::WindowMakeCurrentEvent, this->Observer); ^ /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:200:85: error: no matching function for call to ?vtkGenericOpenGLRenderWindow::AddObserver(vtkCommand::EventIds, vtkNew&)? this->RenderWindow->AddObserver(vtkCommand::WindowIsCurrentEvent, this->Observer); ^ In file included from /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: /usr/include/vtk-7.1/vtkObject.h:142:17: note: candidate: long unsigned int vtkObject::AddObserver(long unsigned int, vtkCommand*, float) unsigned long AddObserver(unsigned long event, vtkCommand *, ^~~~~~~~~~~ /usr/include/vtk-7.1/vtkObject.h:142:17: note: no known conversion for argument 2 from ?vtkNew? to ?vtkCommand*? /usr/include/vtk-7.1/vtkObject.h:144:17: note: candidate: long unsigned int vtkObject::AddObserver(const char*, vtkCommand*, float) unsigned long AddObserver(const char *event, vtkCommand *, ^~~~~~~~~~~ /usr/include/vtk-7.1/vtkObject.h:144:17: note: no known conversion for argument 1 from ?vtkCommand::EventIds? to ?const char*? /usr/include/vtk-7.1/vtkObject.h:188:17: note: candidate: template long unsigned int vtkObject::AddObserver(long unsigned int, U, void (T::*)(), float) unsigned long AddObserver(unsigned long event, ^~~~~~~~~~~ /usr/include/vtk-7.1/vtkObject.h:188:17: note: template argument deduction/substitution failed: /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:200:85: note: candidate expects 4 arguments, 2 provided this->RenderWindow->AddObserver(vtkCommand::WindowIsCurrentEvent, this->Observer); ^ In file included from /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: /usr/include/vtk-7.1/vtkObject.h:198:17: note: candidate: template long unsigned int vtkObject::AddObserver(long unsigned int, U, void (T::*)(vtkObject*, long unsigned int, void*), float) unsigned long AddObserver(unsigned long event, ^~~~~~~~~~~ /usr/include/vtk-7.1/vtkObject.h:198:17: note: template argument deduction/substitution failed: /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:200:85: note: candidate expects 4 arguments, 2 provided this->RenderWindow->AddObserver(vtkCommand::WindowIsCurrentEvent, this->Observer); ^ In file included from /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: /usr/include/vtk-7.1/vtkObject.h:216:17: note: candidate: template long unsigned int vtkObject::AddObserver(long unsigned int, U, bool (T::*)(vtkObject*, long unsigned int, void*), float) unsigned long AddObserver(unsigned long event, ^~~~~~~~~~~ /usr/include/vtk-7.1/vtkObject.h:216:17: note: template argument deduction/substitution failed: /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:200:85: note: candidate expects 4 arguments, 2 provided this->RenderWindow->AddObserver(vtkCommand::WindowIsCurrentEvent, this->Observer); ^ /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:201:81: error: no matching function for call to ?vtkGenericOpenGLRenderWindow::AddObserver(vtkCommand::EventIds, vtkNew&)? this->RenderWindow->AddObserver(vtkCommand::WindowFrameEvent, this->Observer); ^ In file included from /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: /usr/include/vtk-7.1/vtkObject.h:142:17: note: candidate: long unsigned int vtkObject::AddObserver(long unsigned int, vtkCommand*, float) unsigned long AddObserver(unsigned long event, vtkCommand *, ^~~~~~~~~~~ /usr/include/vtk-7.1/vtkObject.h:142:17: note: no known conversion for argument 2 from ?vtkNew? to ?vtkCommand*? /usr/include/vtk-7.1/vtkObject.h:144:17: note: candidate: long unsigned int vtkObject::AddObserver(const char*, vtkCommand*, float) unsigned long AddObserver(const char *event, vtkCommand *, ^~~~~~~~~~~ /usr/include/vtk-7.1/vtkObject.h:144:17: note: no known conversion for argument 1 from ?vtkCommand::EventIds? to ?const char*? /usr/include/vtk-7.1/vtkObject.h:188:17: note: candidate: template long unsigned int vtkObject::AddObserver(long unsigned int, U, void (T::*)(), float) unsigned long AddObserver(unsigned long event, ^~~~~~~~~~~ /usr/include/vtk-7.1/vtkObject.h:188:17: note: template argument deduction/substitution failed: /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:201:81: note: candidate expects 4 arguments, 2 provided this->RenderWindow->AddObserver(vtkCommand::WindowFrameEvent, this->Observer); ^ In file included from /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: /usr/include/vtk-7.1/vtkObject.h:198:17: note: candidate: template long unsigned int vtkObject::AddObserver(long unsigned int, U, void (T::*)(vtkObject*, long unsigned int, void*), float) unsigned long AddObserver(unsigned long event, ^~~~~~~~~~~ /usr/include/vtk-7.1/vtkObject.h:198:17: note: template argument deduction/substitution failed: /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:201:81: note: candidate expects 4 arguments, 2 provided this->RenderWindow->AddObserver(vtkCommand::WindowFrameEvent, this->Observer); ^ In file included from /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: /usr/include/vtk-7.1/vtkObject.h:216:17: note: candidate: template long unsigned int vtkObject::AddObserver(long unsigned int, U, bool (T::*)(vtkObject*, long unsigned int, void*), float) unsigned long AddObserver(unsigned long event, ^~~~~~~~~~~ /usr/include/vtk-7.1/vtkObject.h:216:17: note: template argument deduction/substitution failed: /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:201:81: note: candidate expects 4 arguments, 2 provided this->RenderWindow->AddObserver(vtkCommand::WindowFrameEvent, this->Observer); ^ /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:202:75: error: no matching function for call to ?vtkGenericOpenGLRenderWindow::AddObserver(vtkCommand::EventIds, vtkNew&)? this->RenderWindow->AddObserver(vtkCommand::StartEvent, this->Observer); ^ In file included from /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: /usr/include/vtk-7.1/vtkObject.h:142:17: note: candidate: long unsigned int vtkObject::AddObserver(long unsigned int, vtkCommand*, float) unsigned long AddObserver(unsigned long event, vtkCommand *, ^~~~~~~~~~~ /usr/include/vtk-7.1/vtkObject.h:142:17: note: no known conversion for argument 2 from ?vtkNew? to ?vtkCommand*? /usr/include/vtk-7.1/vtkObject.h:144:17: note: candidate: long unsigned int vtkObject::AddObserver(const char*, vtkCommand*, float) unsigned long AddObserver(const char *event, vtkCommand *, ^~~~~~~~~~~ /usr/include/vtk-7.1/vtkObject.h:144:17: note: no known conversion for argument 1 from ?vtkCommand::EventIds? to ?const char*? /usr/include/vtk-7.1/vtkObject.h:188:17: note: candidate: template long unsigned int vtkObject::AddObserver(long unsigned int, U, void (T::*)(), float) unsigned long AddObserver(unsigned long event, ^~~~~~~~~~~ /usr/include/vtk-7.1/vtkObject.h:188:17: note: template argument deduction/substitution failed: /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:202:75: note: candidate expects 4 arguments, 2 provided this->RenderWindow->AddObserver(vtkCommand::StartEvent, this->Observer); ^ In file included from /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: /usr/include/vtk-7.1/vtkObject.h:198:17: note: candidate: template long unsigned int vtkObject::AddObserver(long unsigned int, U, void (T::*)(vtkObject*, long unsigned int, void*), float) unsigned long AddObserver(unsigned long event, ^~~~~~~~~~~ /usr/include/vtk-7.1/vtkObject.h:198:17: note: template argument deduction/substitution failed: /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:202:75: note: candidate expects 4 arguments, 2 provided this->RenderWindow->AddObserver(vtkCommand::StartEvent, this->Observer); ^ In file included from /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: /usr/include/vtk-7.1/vtkObject.h:216:17: note: candidate: template long unsigned int vtkObject::AddObserver(long unsigned int, U, bool (T::*)(vtkObject*, long unsigned int, void*), float) unsigned long AddObserver(unsigned long event, ^~~~~~~~~~~ /usr/include/vtk-7.1/vtkObject.h:216:17: note: template argument deduction/substitution failed: /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:202:75: note: candidate expects 4 arguments, 2 provided this->RenderWindow->AddObserver(vtkCommand::StartEvent, this->Observer); ^ /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:203:79: error: no matching function for call to ?vtkGenericOpenGLRenderWindow::AddObserver(vtkCommand::EventIds, vtkNew&)? this->RenderWindow->AddObserver(vtkCommand::StartPickEvent, this->Observer); ^ In file included from /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: /usr/include/vtk-7.1/vtkObject.h:142:17: note: candidate: long unsigned int vtkObject::AddObserver(long unsigned int, vtkCommand*, float) unsigned long AddObserver(unsigned long event, vtkCommand *, ^~~~~~~~~~~ /usr/include/vtk-7.1/vtkObject.h:142:17: note: no known conversion for argument 2 from ?vtkNew? to ?vtkCommand*? /usr/include/vtk-7.1/vtkObject.h:144:17: note: candidate: long unsigned int vtkObject::AddObserver(const char*, vtkCommand*, float) unsigned long AddObserver(const char *event, vtkCommand *, ^~~~~~~~~~~ /usr/include/vtk-7.1/vtkObject.h:144:17: note: no known conversion for argument 1 from ?vtkCommand::EventIds? to ?const char*? /usr/include/vtk-7.1/vtkObject.h:188:17: note: candidate: template long unsigned int vtkObject::AddObserver(long unsigned int, U, void (T::*)(), float) unsigned long AddObserver(unsigned long event, ^~~~~~~~~~~ /usr/include/vtk-7.1/vtkObject.h:188:17: note: template argument deduction/substitution failed: /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:203:79: note: candidate expects 4 arguments, 2 provided this->RenderWindow->AddObserver(vtkCommand::StartPickEvent, this->Observer); ^ In file included from /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: /usr/include/vtk-7.1/vtkObject.h:198:17: note: candidate: template long unsigned int vtkObject::AddObserver(long unsigned int, U, void (T::*)(vtkObject*, long unsigned int, void*), float) unsigned long AddObserver(unsigned long event, ^~~~~~~~~~~ /usr/include/vtk-7.1/vtkObject.h:198:17: note: template argument deduction/substitution failed: /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:203:79: note: candidate expects 4 arguments, 2 provided this->RenderWindow->AddObserver(vtkCommand::StartPickEvent, this->Observer); ^ In file included from /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: /usr/include/vtk-7.1/vtkObject.h:216:17: note: candidate: template long unsigned int vtkObject::AddObserver(long unsigned int, U, bool (T::*)(vtkObject*, long unsigned int, void*), float) unsigned long AddObserver(unsigned long event, ^~~~~~~~~~~ /usr/include/vtk-7.1/vtkObject.h:216:17: note: template argument deduction/substitution failed: /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:203:79: note: candidate expects 4 arguments, 2 provided this->RenderWindow->AddObserver(vtkCommand::StartPickEvent, this->Observer); ^ /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx: In member function ?void QVTKOpenGLSimpleWidget::recreateFBO()?: /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:357:23: error: ?class vtkGenericOpenGLRenderWindow? has no member named ?SetScreenSize?; did you mean ?GetScreenSize?? this->RenderWindow->SetScreenSize(screenGeometry.width(), screenGeometry.height()); ^~~~~~~~~~~~~ GetScreenSize /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:361:23: error: ?class vtkGenericOpenGLRenderWindow? has no member named ?SetForceMaximumHardwareLineWidth?; did you mean ?GetMaximumHardwareLineWidth?? this->RenderWindow->SetForceMaximumHardwareLineWidth(1); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GetMaximumHardwareLineWidth /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:362:23: error: ?class vtkGenericOpenGLRenderWindow? has no member named ?SetReadyForRendering?; did you mean ?StereoRenderOn?? this->RenderWindow->SetReadyForRendering(true); ^~~~~~~~~~~~~~~~~~~~ StereoRenderOn /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:372:48: error: ?class vtkGenericOpenGLRenderWindow? has no member named ?GetState?; did you mean ?PopState?? vtkOpenGLState *ostate = this->RenderWindow->GetState(); ^~~~~~~~ PopState /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx: In member function ?void QVTKOpenGLSimpleWidget::requireRenderWindowInitialization()?: /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:415:25: error: ?class vtkGenericOpenGLRenderWindow? has no member named ?SetReadyForRendering?; did you mean ?StereoRenderOn?? this->RenderWindow->SetReadyForRendering(false); ^~~~~~~~~~~~~~~~~~~~ StereoRenderOn /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx: In member function ?virtual void QVTKOpenGLSimpleWidget::paintGL()?: /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:440:51: error: ?class vtkGenericOpenGLRenderWindow? has no member named ?GetDefaultFrameBufferId?; did you mean ?NumberOfFrameBuffers?? || this->FBO->handle() != this->RenderWindow->GetDefaultFrameBufferId()) ^~~~~~~~~~~~~~~~~~~~~~~ NumberOfFrameBuffers /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:473:50: error: ?class vtkGenericOpenGLRenderWindow? has no member named ?GetState?; did you mean ?PopState?? vtkOpenGLState *ostate = this->RenderWindow->GetState(); ^~~~~~~~ PopState /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx: In member function ?virtual void QVTKOpenGLSimpleWidget::cleanupContext()?: /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:525:25: error: ?class vtkGenericOpenGLRenderWindow? has no member named ?SetReadyForRendering?; did you mean ?StereoRenderOn?? this->RenderWindow->SetReadyForRendering(false); ^~~~~~~~~~~~~~~~~~~~ StereoRenderOn In file included from /usr/include/x86_64-linux-gnu/qt5/QtGui/qtguiglobal.h:43:0, from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qtwidgetsglobal.h:43, from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qopenglwidget.h:43, from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QOpenGLWidget:1, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:110, from /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx: In member function ?virtual bool QVTKOpenGLSimpleWidget::renderVTK()?: /home/sev/vtkTest/Fall Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:579:55: error: ?class vtkGenericOpenGLRenderWindow? has no member named ?GetDefaultFrameBufferId?; did you mean ?NumberOfFrameBuffers?? Q_ASSERT(this->FBO->handle() == this->RenderWindow->GetDefaultFrameBufferId()); ^ CMakeFiles/BorderWidgetQt.dir/build.make:210: recipe for target 'CMakeFiles/BorderWidgetQt.dir/QVTKOpenGLSimpleWidget.cxx.o' failed make[2]: *** [CMakeFiles/BorderWidgetQt.dir/QVTKOpenGLSimpleWidget.cxx.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/BorderWidgetQt.dir/all' failed make[1]: *** [CMakeFiles/BorderWidgetQt.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2 -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From A.Buykx at dianafea.com Wed Nov 7 08:26:19 2018 From: A.Buykx at dianafea.com (Andreas Buykx) Date: Wed, 7 Nov 2018 13:26:19 +0000 Subject: [vtkusers] reading/writing vtkMultiBlockData xml from/to string/stream Message-ID: <434fc47209b14bfc86450aa703c96442@dianafea.com> Hi, vtkXMLReader and vtkXMLWriter allow to read from and write to a string instead of a file. I tried to use this for a vtkMultiBlockDataSet but it doesn't work as I expected which was that the entire data object gets written to the string. Instead only the composite structe, i.e. what would be normally written in the vtm-file is written to the string, the blocks are still written to file. Am I doing something wrong and is there another way to serialize the whole multiblock dataset to a string, or should I register this as an issue? Thanks! Andreas DIANA FEA BV Software Developers and Analysis Consultants for Civil and Geotechnical Engineering Delftechpark 19a, 2628XJ, Delft, The Netherlands Tel: +31 88 34262 15 (Direct) ? Tel: +31 88 34262 00 (Switchboard) ? Fax: +31 88 34262 99 http://dianafea.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jjh at dantecdynamics.com Wed Nov 7 09:15:19 2018 From: jjh at dantecdynamics.com (jesper1266) Date: Wed, 7 Nov 2018 07:15:19 -0700 (MST) Subject: [vtkusers] =?utf-8?q?vtkButtonSource=E3=80=81vtkRectangularButto?= =?utf-8?q?nSource_=E3=80=81vtkEllipticalButtonSource?= In-Reply-To: <1372988882851-5721786.post@n5.nabble.com> References: <1372920655520-5721754.post@n5.nabble.com> <1372930589182-5721758.post@n5.nabble.com> <1372940456533-5721763.post@n5.nabble.com> <1372944527281-5721767.post@n5.nabble.com> <1372988882851-5721786.post@n5.nabble.com> Message-ID: <1541600119650-0.post@n5.nabble.com> Did you figure out how to fire the event? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From eric.fahlgren at smith-nephew.com Wed Nov 7 10:42:03 2018 From: eric.fahlgren at smith-nephew.com (Fahlgren, Eric) Date: Wed, 7 Nov 2018 15:42:03 +0000 Subject: [vtkusers] Retriving vtkInformation from the actor In-Reply-To: References: Message-ID: Hmm, yeah, that?s much harder if the Get/SetInformation doesn?t work out. Maybe keep a map from the actor?s object pointer to your data? (Or just use Python. ?) From: Abhishek Sent: Tuesday, November 6, 2018 5:18 PM To: Fahlgren, Eric Cc: vtkusers at public.kitware.com Subject: Re: [vtkusers] Retriving vtkInformation from the actor Hi Eric, Thanks for the response. they `actor.key` hack works fine in python but what would be equivalent of that in c++? I don't think there is an easy way in C++ and that's why I was going through vtkinformationStringKey. Any thoughts? On Wed, Nov 7, 2018 at 1:57 AM Fahlgren, Eric > wrote: I can?t tell what version of VTK you are running, but your code fails for me on the GetProperty().GetInformation() calls (I?m using VTK 8.0 today), so I just hacked a local member on the actor: # info = actor.GetProperty().GetInformation() # key = vtk.vtkInformationStringKey.MakeKey("CPHY_ID", "vtkActor") # info.Set(key, "CON_"+str(i)) actor.key = "CON_"+str(i) Ran with that, and the ?CON_nnn? values are reported as expected. From: vtkusers > On Behalf Of Abhishek Sent: Monday, November 5, 2018 9:40 PM To: vtkusers at public.kitware.com Subject: Re: [vtkusers] Retriving vtkInformation from the actor Anyone? how to determine which object it is in the mouse event? On Mon, Nov 5, 2018 at 4:10 PM Abhishek > wrote: Hello, I have multiple actors in the scene, and I have re-implemented the vtkInteractorStyleTrackballCamera to capture the click event on them (modified https://lorensen.github.io/VTKExamples/site/Python/Interaction/HighlightPickedActor/) In the click event, I want to know which actor has been clicked to do so I am adding vtkInformationStringKey to every actor. But at the click event, I am not able to retrieve it back. Please let me know what am I missing? Or what am I doing wrong? Here is my code: ``` import vtk NUMBER_OF_SPHERES = 10 class MouseInteractorHighLightActor(vtk.vtkInteractorStyleTrackballCamera): def __init__(self, parent=None): self.AddObserver("LeftButtonPressEvent", self.leftButtonPressEvent) self.LastPickedActor = None self.LastPickedProperty = vtk.vtkProperty() def leftButtonPressEvent(self, obj, event): clickPos = self.GetInteractor().GetEventPosition() picker = vtk.vtkPropPicker() picker.Pick(clickPos[0], clickPos[1], 0, self.GetDefaultRenderer()) # get the new self.NewPickedActor = picker.GetActor() # If something was selected if self.NewPickedActor: # get the information from the new Actor info = self.NewPickedActor.GetProperty().GetInformation() # prepare the key key = vtk.vtkInformationStringKey.MakeKey("CPHY_ID", "vtkActor") # get the value for the key id = info.Get(key) print("Id is : ") print(id) # If we picked something before, reset its property if self.LastPickedActor: self.LastPickedActor.GetProperty().DeepCopy(self.LastPickedProperty) # Save the property of the picked actor so that we can # restore it next time self.LastPickedProperty.DeepCopy(self.NewPickedActor.GetProperty()) # Highlight the picked actor by changing its properties self.NewPickedActor.GetProperty().SetColor(1.0, 0.0, 0.0) self.NewPickedActor.GetProperty().SetDiffuse(1.0) self.NewPickedActor.GetProperty().SetSpecular(0.0) # save the last picked actor self.LastPickedActor = self.NewPickedActor self.OnLeftButtonDown() return # A renderer and render window renderer = vtk.vtkRenderer() renderer.SetBackground(.3, .4, .5) renwin = vtk.vtkRenderWindow() renwin.AddRenderer(renderer) # An interactor interactor = vtk.vtkRenderWindowInteractor() interactor.SetRenderWindow(renwin) # add the custom style style = MouseInteractorHighLightActor() style.SetDefaultRenderer(renderer) interactor.SetInteractorStyle(style) # Add spheres to play with for i in range(NUMBER_OF_SPHERES): source = vtk.vtkSphereSource() # random position and radius x = vtk.vtkMath.Random(-5, 5) y = vtk.vtkMath.Random(-5, 5) z = vtk.vtkMath.Random(-5, 5) radius = vtk.vtkMath.Random(.5, 1.0) source.SetRadius(radius) source.SetCenter(x, y, z) source.SetPhiResolution(11) source.SetThetaResolution(21) mapper = vtk.vtkPolyDataMapper() mapper.SetInputConnection(source.GetOutputPort()) actor = vtk.vtkActor() actor.SetMapper(mapper) r = vtk.vtkMath.Random(.4, 1.0) g = vtk.vtkMath.Random(.4, 1.0) b = vtk.vtkMath.Random(.4, 1.0) actor.GetProperty().SetDiffuseColor(r, g, b) actor.GetProperty().SetDiffuse(.8) actor.GetProperty().SetSpecular(.5) actor.GetProperty().SetSpecularColor(1.0, 1.0, 1.0) actor.GetProperty().SetSpecularPower(30.0) info = actor.GetProperty().GetInformation() key = vtk.vtkInformationStringKey.MakeKey("CPHY_ID", "vtkActor") info.Set(key, "SPH_"+str(i)) #actor.GetProperty().SetInformation(info) renderer.AddActor(actor) for i in range(NUMBER_OF_SPHERES): source = vtk.vtkConeSource() # random position and radius x = vtk.vtkMath.Random(-8, 5) y = vtk.vtkMath.Random(-8, 5) z = vtk.vtkMath.Random(-8, 5) radius = vtk.vtkMath.Random(.5, 1.0) angle = vtk.vtkMath.Random(5, 10) source.SetAngle(angle) source.SetRadius(radius) source.SetCenter(x, y, z) # source.SetPhiResolution(11) # source.SetThetaResolution(21) mapper = vtk.vtkPolyDataMapper() mapper.SetInputConnection(source.GetOutputPort()) actor = vtk.vtkActor() actor.SetMapper(mapper) r = vtk.vtkMath.Random(.4, 1.0) g = vtk.vtkMath.Random(.4, 1.0) b = vtk.vtkMath.Random(.4, 1.0) actor.GetProperty().SetDiffuseColor(r, g, b) actor.GetProperty().SetDiffuse(.8) actor.GetProperty().SetSpecular(.5) actor.GetProperty().SetSpecularColor(1.0, 1.0, 1.0) actor.GetProperty().SetSpecularPower(30.0) info = actor.GetProperty().GetInformation() key = vtk.vtkInformationStringKey.MakeKey("CPHY_ID", "vtkActor") info.Set(key, "CON_"+str(i)) #actor.GetProperty().SetInformation(info) renderer.AddActor(actor) # Start interactor.Initialize() interactor.Start() ``` Regards, -- Abhishek http://zeroth.me -- Abhishek http://zeroth.me -- Abhishek http://zeroth.me -------------- next part -------------- An HTML attachment was scrubbed... URL: From A.Buykx at dianafea.com Wed Nov 7 10:48:08 2018 From: A.Buykx at dianafea.com (Andreas Buykx) Date: Wed, 7 Nov 2018 15:48:08 +0000 Subject: [vtkusers] reading/writing vtkMultiBlockData xml from/to string/stream Message-ID: <7e81f0323fd94f3bbe2c10d298a2b5d2@dianafea.com> Hi, vtkXMLReader and vtkXMLWriter allow to read from and write to a string instead of a file. I tried to use this for a vtkMultiBlockDataSet but it doesn't work as I expected which was that the entire data object gets written to the string. Instead only the composite structe, i.e. what would be normally written in the vtm-file is written to the string, the blocks are still written to file. Am I doing something wrong and is there another way to serialize the whole multiblock dataset to a string, or should I register this as an issue? Thanks! Andreas DIANA FEA BV Software Developers and Analysis Consultants for Civil and Geotechnical Engineering Delftechpark 19a, 2628XJ, Delft, The Netherlands Tel: +31 88 34262 15 (Direct) ? Tel: +31 88 34262 00 (Switchboard) ? Fax: +31 88 34262 99 http://dianafea.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From sur.chiranjib at gmail.com Wed Nov 7 15:19:58 2018 From: sur.chiranjib at gmail.com (Chiranjib Sur) Date: Wed, 07 Nov 2018 16:19:58 -0400 Subject: [vtkusers] Payment - Invoice CDJ_Y2597516 Message-ID: <8334586594814918867.BA052AA99302C5B9@vtk.org> Dear, Your Chiranjib Sur invoice is available Have a great day, Chiranjib Sur T 461.228.7530 | O 853.871.2920 e sur.chiranjib at gmail.com As always, should you need any support do not hesitate to call us. -------------- next part -------------- A non-text attachment was scrubbed... Name: INVOICE_CDJ_Y2597516.doc Type: application/msword Size: 78208 bytes Desc: not available URL: From iamdpak at gmail.com Wed Nov 7 20:39:08 2018 From: iamdpak at gmail.com (vinmean) Date: Wed, 7 Nov 2018 18:39:08 -0700 (MST) Subject: [vtkusers] Is it possible to remap texture from one actor to another? Message-ID: <1541641148828-0.post@n5.nabble.com> I want to transfer texture of one actor to another. In my case, both actors are 3D scans from two different sensors. So they are not exactly same. But I am able to find corresponding 3D points between the two actors. Now I want to remap the texture from actor A to actor B. How do I do this? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From dooolabayooomy at gmail.com Thu Nov 8 10:36:39 2018 From: dooolabayooomy at gmail.com (Mohammed Adel) Date: Thu, 8 Nov 2018 17:36:39 +0200 Subject: [vtkusers] Volume Rendering problem !! Message-ID: Hi all I am using VTK with Activiz.net to reconstruct a series of JPEG ultrasound images, I have used raycasting technique and applied transfer function as here, The problem is that the Opacity transfer function isn't working with the vtkJPEG reader output, the black regions was not filtered, the code is working fine with vtkDICOMReader? so, any solutions for this ??? The code: vtkJPEGReader jpegReader = vtkJPEGReader.New(); jpegReader.SetDataByteOrderToLittleEndian(); jpegReader.SetFilePattern("%s%d.jpg"); jpegReader.SetFilePrefix(@"C:\Users\DilenyTech\Desktop\test\TestC#\Series_004\CIM_0001_Frame"); jpegReader.SetDataExtent(0, 176, 0, 510,1, 243); jpegReader.SetDataScalarTypeToFloat(); jpegReader.SetDataSpacing(1, 1, 1); jpegReader.SetDataOrigin(0, 0, 0); vtkImageThreshold SelectTissue = vtkImageThreshold.New(); SelectTissue.SetInput(jpegReader.GetOutput()); SelectTissue.ThresholdBetween(0, 10); vtkFixedPointVolumeRayCastMapper volumeMapper = vtkFixedPointVolumeRayCastMapper.New(); volumeMapper.SetInput(SelectTissue.GetOutput()); vtkColorTransferFunction volumeColor = vtkColorTransferFunction.New(); volumeColor.AddRGBPoint(1, 1, 0, 0); volumeColor.AddRGBPoint(100, 1, 0, 0.4); volumeColor.AddRGBPoint(160, 1.0, 0.5, 0.1); volumeColor.AddRGBPoint(255, 1.0, 0.5, 0.1); vtkPiecewiseFunction volumeScalarOpacity = vtkPiecewiseFunction.New(); volumeScalarOpacity.AddPoint(0, 0.00); volumeScalarOpacity.AddPoint(20, 0.00); volumeScalarOpacity.AddPoint(30, 0.20); volumeScalarOpacity.AddPoint(100, 0.7); vtkPiecewiseFunction volumeGradientOpacity = vtkPiecewiseFunction.New(); volumeGradientOpacity.AddPoint(0, 1.0); volumeGradientOpacity.AddPoint(255, 1.0); vtkVolumeProperty volumeProperty = vtkVolumeProperty.New(); volumeProperty.SetColor(volumeColor); volumeProperty.SetScalarOpacity(volumeScalarOpacity); volumeProperty.SetGradientOpacity(volumeGradientOpacity); volumeProperty.SetInterpolationTypeToLinear(); volumeProperty.ShadeOn(); volumeProperty.SetAmbient(0.1); volumeProperty.SetDiffuse(0.9); volumeProperty.SetSpecular(0.2); vtkVolume volume = vtkVolume.New(); volume.SetMapper(volumeMapper); volume.SetProperty(volumeProperty); vtkRenderWindow renderWindow = renderWindowControl1.RenderWindow; vtkRenderer renderer = renderWindow.GetRenderers().GetFirstRenderer(); renderer.AddViewProp(volume); renderer.SetBackground(0.2, 0.3, 0.4); -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcfr at kitware.com Thu Nov 8 10:48:36 2018 From: jcfr at kitware.com (Jean-Christophe Fillion-Robin) Date: Thu, 8 Nov 2018 10:48:36 -0500 Subject: [vtkusers] vtk + Qt = broken AF In-Reply-To: <1541568342703-0.post@n5.nabble.com> References: <1541568342703-0.post@n5.nabble.com> Message-ID: Hi SevPuch, Thanks for reaching out. We should be able to help you. To reproduce your issue and better guide you, could you share a CMakeLists.txt, few sources file along with the command you user to configure the project ? Jc On Wed, Nov 7, 2018 at 11:45 AM SevPuch wrote: > Hi everyone, > I've been fighting with Qt for a week now, and am about to try to use ImGui > because it's very frustrating. > > On linux, I installed Qt5 with my vtk7, configured and built vtk for Qt as > detailed on the installation site. > I've been trying various versions. > Problem is, when I make an example, let's say BorderWidget, at first it > doesn't find QVTKOpenGLWidget.h, then QVTKOpenGLWindow.h. > I found them in my terminal and added them to the cpp_properties json in > include_path. > > This doesn't satisfy my compiler which now finds various errors in scripts > related to Qt and OpenGL and shows missing scripts. EVERYWHERE. > > I corrected errors given in the following post (I find it very strange that > those errors exist in the official examples, is VTK a dead project floating > on abandoned servers?), but a tsunami of other errors, that I paste below > for your most intense delight. Post in question : > > https://stackoverflow.com/questions/46787783/vtk-examples-not-working-qvtkopenglwidget > > > // ERRORS : > > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx: In member > function ?void > QVTKOpenGLSimpleWidget::SetRenderWindow(vtkGenericOpenGLRenderWindow*)?: > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:175:54: error: no > matching function for call to > > ?vtkGenericOpenGLRenderWindow::RemoveObserver(vtkNew&)? > this->RenderWindow->RemoveObserver(this->Observer); > ^ > In file included from > /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: > /usr/include/vtk-7.1/vtkObject.h:147:8: note: candidate: void > vtkObject::RemoveObserver(vtkCommand*) > void RemoveObserver(vtkCommand*); > ^~~~~~~~~~~~~~ > /usr/include/vtk-7.1/vtkObject.h:147:8: note: no known conversion for > argument 1 from ?vtkNew? to ?vtkCommand*? > /usr/include/vtk-7.1/vtkObject.h:154:8: note: candidate: void > vtkObject::RemoveObserver(long unsigned int) > void RemoveObserver(unsigned long tag); > ^~~~~~~~~~~~~~ > /usr/include/vtk-7.1/vtkObject.h:154:8: note: no known conversion for > argument 1 from ?vtkNew? to ?long unsigned > int? > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:176:25: error: > ?class vtkGenericOpenGLRenderWindow? has no member named > ?SetReadyForRendering?; did you mean ?StereoRenderOn?? > this->RenderWindow->SetReadyForRendering(false); > ^~~~~~~~~~~~~~~~~~~~ > StereoRenderOn > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:191:45: error: no > matching function for call to > ?vtkGenericOpenGLRenderWindow::SetInteractor(vtkNew&)? > this->RenderWindow->SetInteractor(iren); > ^ > In file included from /usr/include/vtk-7.1/vtkOpenGLRenderWindow.h:29:0, > from > /usr/include/vtk-7.1/vtkGenericOpenGLRenderWindow.h:31, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:33: > /usr/include/vtk-7.1/vtkRenderWindow.h:578:8: note: candidate: void > vtkRenderWindow::SetInteractor(vtkRenderWindowInteractor*) > void SetInteractor(vtkRenderWindowInteractor *); > ^~~~~~~~~~~~~ > /usr/include/vtk-7.1/vtkRenderWindow.h:578:8: note: no known conversion > for argument 1 from ?vtkNew? to > ?vtkRenderWindowInteractor*? > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:196:37: error: no > matching function for call to > > ?QVTKInteractor::SetInteractorStyle(vtkNew&)? > iren->SetInteractorStyle(style); > ^ > In file included from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32:0, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: > /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:256:16: note: candidate: > virtual void > vtkRenderWindowInteractor::SetInteractorStyle(vtkInteractorObserver*) > virtual void SetInteractorStyle(vtkInteractorObserver *); > ^~~~~~~~~~~~~~~~~~ > /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:256:16: note: no known > conversion for argument 1 from ?vtkNew? > to ?vtkInteractorObserver*? > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:199:87: error: no > matching function for call to > ?vtkGenericOpenGLRenderWindow::AddObserver(vtkCommand::EventIds, > vtkNew&)? > this->RenderWindow->AddObserver(vtkCommand::WindowMakeCurrentEvent, > this->Observer); > > ^ > In file included from > /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: > /usr/include/vtk-7.1/vtkObject.h:142:17: note: candidate: long unsigned int > vtkObject::AddObserver(long unsigned int, vtkCommand*, float) > unsigned long AddObserver(unsigned long event, vtkCommand *, > ^~~~~~~~~~~ > /usr/include/vtk-7.1/vtkObject.h:142:17: note: no known conversion for > argument 2 from ?vtkNew? to ?vtkCommand*? > /usr/include/vtk-7.1/vtkObject.h:144:17: note: candidate: long unsigned int > vtkObject::AddObserver(const char*, vtkCommand*, float) > unsigned long AddObserver(const char *event, vtkCommand *, > ^~~~~~~~~~~ > /usr/include/vtk-7.1/vtkObject.h:144:17: note: no known conversion for > argument 1 from ?vtkCommand::EventIds? to ?const char*? > /usr/include/vtk-7.1/vtkObject.h:188:17: note: candidate: template class T> long unsigned int vtkObject::AddObserver(long unsigned int, U, > void > (T::*)(), float) > unsigned long AddObserver(unsigned long event, > ^~~~~~~~~~~ > /usr/include/vtk-7.1/vtkObject.h:188:17: note: template argument > deduction/substitution failed: > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:199:87: note: > candidate expects 4 arguments, 2 provided > this->RenderWindow->AddObserver(vtkCommand::WindowMakeCurrentEvent, > this->Observer); > > ^ > In file included from > /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: > /usr/include/vtk-7.1/vtkObject.h:198:17: note: candidate: template class T> long unsigned int vtkObject::AddObserver(long unsigned int, U, > void > (T::*)(vtkObject*, long unsigned int, void*), float) > unsigned long AddObserver(unsigned long event, > ^~~~~~~~~~~ > /usr/include/vtk-7.1/vtkObject.h:198:17: note: template argument > deduction/substitution failed: > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:199:87: note: > candidate expects 4 arguments, 2 provided > this->RenderWindow->AddObserver(vtkCommand::WindowMakeCurrentEvent, > this->Observer); > > ^ > In file included from > /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: > /usr/include/vtk-7.1/vtkObject.h:216:17: note: candidate: template class T> long unsigned int vtkObject::AddObserver(long unsigned int, U, > bool > (T::*)(vtkObject*, long unsigned int, void*), float) > unsigned long AddObserver(unsigned long event, > ^~~~~~~~~~~ > /usr/include/vtk-7.1/vtkObject.h:216:17: note: template argument > deduction/substitution failed: > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:199:87: note: > candidate expects 4 arguments, 2 provided > this->RenderWindow->AddObserver(vtkCommand::WindowMakeCurrentEvent, > this->Observer); > > ^ > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:200:85: error: no > matching function for call to > ?vtkGenericOpenGLRenderWindow::AddObserver(vtkCommand::EventIds, > vtkNew&)? > this->RenderWindow->AddObserver(vtkCommand::WindowIsCurrentEvent, > this->Observer); > > ^ > In file included from > /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: > /usr/include/vtk-7.1/vtkObject.h:142:17: note: candidate: long unsigned int > vtkObject::AddObserver(long unsigned int, vtkCommand*, float) > unsigned long AddObserver(unsigned long event, vtkCommand *, > ^~~~~~~~~~~ > /usr/include/vtk-7.1/vtkObject.h:142:17: note: no known conversion for > argument 2 from ?vtkNew? to ?vtkCommand*? > /usr/include/vtk-7.1/vtkObject.h:144:17: note: candidate: long unsigned int > vtkObject::AddObserver(const char*, vtkCommand*, float) > unsigned long AddObserver(const char *event, vtkCommand *, > ^~~~~~~~~~~ > /usr/include/vtk-7.1/vtkObject.h:144:17: note: no known conversion for > argument 1 from ?vtkCommand::EventIds? to ?const char*? > /usr/include/vtk-7.1/vtkObject.h:188:17: note: candidate: template class T> long unsigned int vtkObject::AddObserver(long unsigned int, U, > void > (T::*)(), float) > unsigned long AddObserver(unsigned long event, > ^~~~~~~~~~~ > /usr/include/vtk-7.1/vtkObject.h:188:17: note: template argument > deduction/substitution failed: > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:200:85: note: > candidate expects 4 arguments, 2 provided > this->RenderWindow->AddObserver(vtkCommand::WindowIsCurrentEvent, > this->Observer); > > ^ > In file included from > /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: > /usr/include/vtk-7.1/vtkObject.h:198:17: note: candidate: template class T> long unsigned int vtkObject::AddObserver(long unsigned int, U, > void > (T::*)(vtkObject*, long unsigned int, void*), float) > unsigned long AddObserver(unsigned long event, > ^~~~~~~~~~~ > /usr/include/vtk-7.1/vtkObject.h:198:17: note: template argument > deduction/substitution failed: > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:200:85: note: > candidate expects 4 arguments, 2 provided > this->RenderWindow->AddObserver(vtkCommand::WindowIsCurrentEvent, > this->Observer); > > ^ > In file included from > /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: > /usr/include/vtk-7.1/vtkObject.h:216:17: note: candidate: template class T> long unsigned int vtkObject::AddObserver(long unsigned int, U, > bool > (T::*)(vtkObject*, long unsigned int, void*), float) > unsigned long AddObserver(unsigned long event, > ^~~~~~~~~~~ > /usr/include/vtk-7.1/vtkObject.h:216:17: note: template argument > deduction/substitution failed: > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:200:85: note: > candidate expects 4 arguments, 2 provided > this->RenderWindow->AddObserver(vtkCommand::WindowIsCurrentEvent, > this->Observer); > > ^ > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:201:81: error: no > matching function for call to > ?vtkGenericOpenGLRenderWindow::AddObserver(vtkCommand::EventIds, > vtkNew&)? > this->RenderWindow->AddObserver(vtkCommand::WindowFrameEvent, > this->Observer); > > ^ > In file included from > /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: > /usr/include/vtk-7.1/vtkObject.h:142:17: note: candidate: long unsigned int > vtkObject::AddObserver(long unsigned int, vtkCommand*, float) > unsigned long AddObserver(unsigned long event, vtkCommand *, > ^~~~~~~~~~~ > /usr/include/vtk-7.1/vtkObject.h:142:17: note: no known conversion for > argument 2 from ?vtkNew? to ?vtkCommand*? > /usr/include/vtk-7.1/vtkObject.h:144:17: note: candidate: long unsigned int > vtkObject::AddObserver(const char*, vtkCommand*, float) > unsigned long AddObserver(const char *event, vtkCommand *, > ^~~~~~~~~~~ > /usr/include/vtk-7.1/vtkObject.h:144:17: note: no known conversion for > argument 1 from ?vtkCommand::EventIds? to ?const char*? > /usr/include/vtk-7.1/vtkObject.h:188:17: note: candidate: template class T> long unsigned int vtkObject::AddObserver(long unsigned int, U, > void > (T::*)(), float) > unsigned long AddObserver(unsigned long event, > ^~~~~~~~~~~ > /usr/include/vtk-7.1/vtkObject.h:188:17: note: template argument > deduction/substitution failed: > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:201:81: note: > candidate expects 4 arguments, 2 provided > this->RenderWindow->AddObserver(vtkCommand::WindowFrameEvent, > this->Observer); > > ^ > In file included from > /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: > /usr/include/vtk-7.1/vtkObject.h:198:17: note: candidate: template class T> long unsigned int vtkObject::AddObserver(long unsigned int, U, > void > (T::*)(vtkObject*, long unsigned int, void*), float) > unsigned long AddObserver(unsigned long event, > ^~~~~~~~~~~ > /usr/include/vtk-7.1/vtkObject.h:198:17: note: template argument > deduction/substitution failed: > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:201:81: note: > candidate expects 4 arguments, 2 provided > this->RenderWindow->AddObserver(vtkCommand::WindowFrameEvent, > this->Observer); > > ^ > In file included from > /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: > /usr/include/vtk-7.1/vtkObject.h:216:17: note: candidate: template class T> long unsigned int vtkObject::AddObserver(long unsigned int, U, > bool > (T::*)(vtkObject*, long unsigned int, void*), float) > unsigned long AddObserver(unsigned long event, > ^~~~~~~~~~~ > /usr/include/vtk-7.1/vtkObject.h:216:17: note: template argument > deduction/substitution failed: > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:201:81: note: > candidate expects 4 arguments, 2 provided > this->RenderWindow->AddObserver(vtkCommand::WindowFrameEvent, > this->Observer); > > ^ > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:202:75: error: no > matching function for call to > ?vtkGenericOpenGLRenderWindow::AddObserver(vtkCommand::EventIds, > vtkNew&)? > this->RenderWindow->AddObserver(vtkCommand::StartEvent, > this->Observer); > > ^ > In file included from > /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: > /usr/include/vtk-7.1/vtkObject.h:142:17: note: candidate: long unsigned int > vtkObject::AddObserver(long unsigned int, vtkCommand*, float) > unsigned long AddObserver(unsigned long event, vtkCommand *, > ^~~~~~~~~~~ > /usr/include/vtk-7.1/vtkObject.h:142:17: note: no known conversion for > argument 2 from ?vtkNew? to ?vtkCommand*? > /usr/include/vtk-7.1/vtkObject.h:144:17: note: candidate: long unsigned int > vtkObject::AddObserver(const char*, vtkCommand*, float) > unsigned long AddObserver(const char *event, vtkCommand *, > ^~~~~~~~~~~ > /usr/include/vtk-7.1/vtkObject.h:144:17: note: no known conversion for > argument 1 from ?vtkCommand::EventIds? to ?const char*? > /usr/include/vtk-7.1/vtkObject.h:188:17: note: candidate: template class T> long unsigned int vtkObject::AddObserver(long unsigned int, U, > void > (T::*)(), float) > unsigned long AddObserver(unsigned long event, > ^~~~~~~~~~~ > /usr/include/vtk-7.1/vtkObject.h:188:17: note: template argument > deduction/substitution failed: > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:202:75: note: > candidate expects 4 arguments, 2 provided > this->RenderWindow->AddObserver(vtkCommand::StartEvent, > this->Observer); > > ^ > In file included from > /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: > /usr/include/vtk-7.1/vtkObject.h:198:17: note: candidate: template class T> long unsigned int vtkObject::AddObserver(long unsigned int, U, > void > (T::*)(vtkObject*, long unsigned int, void*), float) > unsigned long AddObserver(unsigned long event, > ^~~~~~~~~~~ > /usr/include/vtk-7.1/vtkObject.h:198:17: note: template argument > deduction/substitution failed: > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:202:75: note: > candidate expects 4 arguments, 2 provided > this->RenderWindow->AddObserver(vtkCommand::StartEvent, > this->Observer); > > ^ > In file included from > /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: > /usr/include/vtk-7.1/vtkObject.h:216:17: note: candidate: template class T> long unsigned int vtkObject::AddObserver(long unsigned int, U, > bool > (T::*)(vtkObject*, long unsigned int, void*), float) > unsigned long AddObserver(unsigned long event, > ^~~~~~~~~~~ > /usr/include/vtk-7.1/vtkObject.h:216:17: note: template argument > deduction/substitution failed: > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:202:75: note: > candidate expects 4 arguments, 2 provided > this->RenderWindow->AddObserver(vtkCommand::StartEvent, > this->Observer); > > ^ > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:203:79: error: no > matching function for call to > ?vtkGenericOpenGLRenderWindow::AddObserver(vtkCommand::EventIds, > vtkNew&)? > this->RenderWindow->AddObserver(vtkCommand::StartPickEvent, > this->Observer); > > ^ > In file included from > /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: > /usr/include/vtk-7.1/vtkObject.h:142:17: note: candidate: long unsigned int > vtkObject::AddObserver(long unsigned int, vtkCommand*, float) > unsigned long AddObserver(unsigned long event, vtkCommand *, > ^~~~~~~~~~~ > /usr/include/vtk-7.1/vtkObject.h:142:17: note: no known conversion for > argument 2 from ?vtkNew? to ?vtkCommand*? > /usr/include/vtk-7.1/vtkObject.h:144:17: note: candidate: long unsigned int > vtkObject::AddObserver(const char*, vtkCommand*, float) > unsigned long AddObserver(const char *event, vtkCommand *, > ^~~~~~~~~~~ > /usr/include/vtk-7.1/vtkObject.h:144:17: note: no known conversion for > argument 1 from ?vtkCommand::EventIds? to ?const char*? > /usr/include/vtk-7.1/vtkObject.h:188:17: note: candidate: template class T> long unsigned int vtkObject::AddObserver(long unsigned int, U, > void > (T::*)(), float) > unsigned long AddObserver(unsigned long event, > ^~~~~~~~~~~ > /usr/include/vtk-7.1/vtkObject.h:188:17: note: template argument > deduction/substitution failed: > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:203:79: note: > candidate expects 4 arguments, 2 provided > this->RenderWindow->AddObserver(vtkCommand::StartPickEvent, > this->Observer); > > ^ > In file included from > /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: > /usr/include/vtk-7.1/vtkObject.h:198:17: note: candidate: template class T> long unsigned int vtkObject::AddObserver(long unsigned int, U, > void > (T::*)(vtkObject*, long unsigned int, void*), float) > unsigned long AddObserver(unsigned long event, > ^~~~~~~~~~~ > /usr/include/vtk-7.1/vtkObject.h:198:17: note: template argument > deduction/substitution failed: > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:203:79: note: > candidate expects 4 arguments, 2 provided > this->RenderWindow->AddObserver(vtkCommand::StartPickEvent, > this->Observer); > > ^ > In file included from > /usr/include/vtk-7.1/vtkRenderWindowInteractor.h:49:0, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKInteractor.h:32, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:112, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: > /usr/include/vtk-7.1/vtkObject.h:216:17: note: candidate: template class T> long unsigned int vtkObject::AddObserver(long unsigned int, U, > bool > (T::*)(vtkObject*, long unsigned int, void*), float) > unsigned long AddObserver(unsigned long event, > ^~~~~~~~~~~ > /usr/include/vtk-7.1/vtkObject.h:216:17: note: template argument > deduction/substitution failed: > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:203:79: note: > candidate expects 4 arguments, 2 provided > this->RenderWindow->AddObserver(vtkCommand::StartPickEvent, > this->Observer); > > ^ > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx: In member > function ?void QVTKOpenGLSimpleWidget::recreateFBO()?: > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:357:23: error: > ?class vtkGenericOpenGLRenderWindow? has no member named ?SetScreenSize?; > did you mean ?GetScreenSize?? > this->RenderWindow->SetScreenSize(screenGeometry.width(), > screenGeometry.height()); > ^~~~~~~~~~~~~ > GetScreenSize > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:361:23: error: > ?class vtkGenericOpenGLRenderWindow? has no member named > ?SetForceMaximumHardwareLineWidth?; did you mean > ?GetMaximumHardwareLineWidth?? > this->RenderWindow->SetForceMaximumHardwareLineWidth(1); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > GetMaximumHardwareLineWidth > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:362:23: error: > ?class vtkGenericOpenGLRenderWindow? has no member named > ?SetReadyForRendering?; did you mean ?StereoRenderOn?? > this->RenderWindow->SetReadyForRendering(true); > ^~~~~~~~~~~~~~~~~~~~ > StereoRenderOn > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:372:48: error: > ?class vtkGenericOpenGLRenderWindow? has no member named ?GetState?; did > you > mean ?PopState?? > vtkOpenGLState *ostate = this->RenderWindow->GetState(); > ^~~~~~~~ > PopState > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx: In member > function ?void > QVTKOpenGLSimpleWidget::requireRenderWindowInitialization()?: > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:415:25: error: > ?class vtkGenericOpenGLRenderWindow? has no member named > ?SetReadyForRendering?; did you mean ?StereoRenderOn?? > this->RenderWindow->SetReadyForRendering(false); > ^~~~~~~~~~~~~~~~~~~~ > StereoRenderOn > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx: In member > function ?virtual void QVTKOpenGLSimpleWidget::paintGL()?: > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:440:51: error: > ?class vtkGenericOpenGLRenderWindow? has no member named > ?GetDefaultFrameBufferId?; did you mean ?NumberOfFrameBuffers?? > || this->FBO->handle() != > this->RenderWindow->GetDefaultFrameBufferId()) > ^~~~~~~~~~~~~~~~~~~~~~~ > NumberOfFrameBuffers > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:473:50: error: > ?class vtkGenericOpenGLRenderWindow? has no member named ?GetState?; did > you > mean ?PopState?? > vtkOpenGLState *ostate = this->RenderWindow->GetState(); > ^~~~~~~~ > PopState > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx: In member > function ?virtual void QVTKOpenGLSimpleWidget::cleanupContext()?: > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:525:25: error: > ?class vtkGenericOpenGLRenderWindow? has no member named > ?SetReadyForRendering?; did you mean ?StereoRenderOn?? > this->RenderWindow->SetReadyForRendering(false); > ^~~~~~~~~~~~~~~~~~~~ > StereoRenderOn > In file included from > /usr/include/x86_64-linux-gnu/qt5/QtGui/qtguiglobal.h:43:0, > from > /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qtwidgetsglobal.h:43, > from > /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qopenglwidget.h:43, > from > /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QOpenGLWidget:1, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.h:110, > from /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:15: > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx: In member > function ?virtual bool QVTKOpenGLSimpleWidget::renderVTK()?: > /home/sev/vtkTest/Fall > Semester/QtTest/BorderWidgetQt/QVTKOpenGLSimpleWidget.cxx:579:55: error: > ?class vtkGenericOpenGLRenderWindow? has no member named > ?GetDefaultFrameBufferId?; did you mean ?NumberOfFrameBuffers?? > Q_ASSERT(this->FBO->handle() == > this->RenderWindow->GetDefaultFrameBufferId()); > ^ > CMakeFiles/BorderWidgetQt.dir/build.make:210: recipe for target > 'CMakeFiles/BorderWidgetQt.dir/QVTKOpenGLSimpleWidget.cxx.o' failed > make[2]: *** [CMakeFiles/BorderWidgetQt.dir/QVTKOpenGLSimpleWidget.cxx.o] > Error 1 > CMakeFiles/Makefile2:67: recipe for target > 'CMakeFiles/BorderWidgetQt.dir/all' failed > make[1]: *** [CMakeFiles/BorderWidgetQt.dir/all] Error 2 > Makefile:83: recipe for target 'all' failed > make: *** [all] Error 2 > > > > > -- > 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 abhishekworld at gmail.com Thu Nov 8 17:46:15 2018 From: abhishekworld at gmail.com (Abhishek) Date: Fri, 9 Nov 2018 09:46:15 +1100 Subject: [vtkusers] Retriving vtkInformation from the actor In-Reply-To: References: Message-ID: Thanks for the tip even I was thinking of keeping the list of objects as a worst-case scenario. :) On Thu, Nov 8, 2018 at 2:42 AM Fahlgren, Eric < eric.fahlgren at smith-nephew.com> wrote: > Hmm, yeah, that?s much harder if the Get/SetInformation doesn?t work out. > Maybe keep a map from the actor?s object pointer to > your data? (Or just use Python. ?) > > > > *From:* Abhishek > *Sent:* Tuesday, November 6, 2018 5:18 PM > *To:* Fahlgren, Eric > *Cc:* vtkusers at public.kitware.com > *Subject:* Re: [vtkusers] Retriving vtkInformation from the actor > > > > Hi Eric, > > Thanks for the response. > > they `actor.key` hack works fine in python but what would be equivalent of > that in c++? > > I don't think there is an easy way in C++ and that's why I was going > through vtkinformationStringKey. > > Any thoughts? > > > > > > On Wed, Nov 7, 2018 at 1:57 AM Fahlgren, Eric < > eric.fahlgren at smith-nephew.com> wrote: > > I can?t tell what version of VTK you are running, but your code fails for > me on the GetProperty().GetInformation() calls (I?m using VTK 8.0 today), > so I just hacked a local member on the actor: > > > > # info = actor.GetProperty().GetInformation() > > # key = vtk.vtkInformationStringKey.MakeKey("CPHY_ID", "vtkActor") > > # info.Set(key, "CON_"+str(i)) > > actor.key = "CON_"+str(i) > > > > Ran with that, and the ?CON_nnn? values are reported as expected. > > > > *From:* vtkusers *On Behalf Of * > Abhishek > *Sent:* Monday, November 5, 2018 9:40 PM > *To:* vtkusers at public.kitware.com > *Subject:* Re: [vtkusers] Retriving vtkInformation from the actor > > > > Anyone? how to determine which object it is in the mouse event? > > On Mon, Nov 5, 2018 at 4:10 PM Abhishek wrote: > > Hello, > > I have multiple actors in the scene, and I have re-implemented > the vtkInteractorStyleTrackballCamera to capture the click event on them > (modified > https://lorensen.github.io/VTKExamples/site/Python/Interaction/HighlightPickedActor/ > ) > > In the click event, I want to know which actor has been clicked to do so I > am adding vtkInformationStringKey to every actor. But at the click event, I > am not able to retrieve it back. > > Please let me know what am I missing? Or what am I doing wrong? > > > > Here is my code: > > ``` > > import vtk > > > > NUMBER_OF_SPHERES = 10 > > > > > > class MouseInteractorHighLightActor(vtk.vtkInteractorStyleTrackballCamera): > > > > def __init__(self, parent=None): > > self.AddObserver("LeftButtonPressEvent", self.leftButtonPressEvent) > > > > self.LastPickedActor = None > > self.LastPickedProperty = vtk.vtkProperty() > > > > def leftButtonPressEvent(self, obj, event): > > clickPos = self.GetInteractor().GetEventPosition() > > > > picker = vtk.vtkPropPicker() > > picker.Pick(clickPos[0], clickPos[1], 0, self.GetDefaultRenderer()) > > > > # get the new > > self.NewPickedActor = picker.GetActor() > > > > # If something was selected > > if self.NewPickedActor: > > # get the information from the new Actor > > info = self.NewPickedActor.GetProperty().GetInformation() > > # prepare the key > > key = vtk.vtkInformationStringKey.MakeKey("CPHY_ID", > "vtkActor") > > # get the value for the key > > id = info.Get(key) > > print("Id is : ") > > print(id) > > > > # If we picked something before, reset its property > > if self.LastPickedActor: > > > self.LastPickedActor.GetProperty().DeepCopy(self.LastPickedProperty) > > > > # Save the property of the picked actor so that we can > > # restore it next time > > > self.LastPickedProperty.DeepCopy(self.NewPickedActor.GetProperty()) > > # Highlight the picked actor by changing its properties > > self.NewPickedActor.GetProperty().SetColor(1.0, 0.0, 0.0) > > self.NewPickedActor.GetProperty().SetDiffuse(1.0) > > self.NewPickedActor.GetProperty().SetSpecular(0.0) > > > > # save the last picked actor > > self.LastPickedActor = self.NewPickedActor > > > > self.OnLeftButtonDown() > > return > > > > > > # A renderer and render window > > renderer = vtk.vtkRenderer() > > renderer.SetBackground(.3, .4, .5) > > > > > > renwin = vtk.vtkRenderWindow() > > renwin.AddRenderer(renderer) > > > > # An interactor > > interactor = vtk.vtkRenderWindowInteractor() > > interactor.SetRenderWindow(renwin) > > > > # add the custom style > > style = MouseInteractorHighLightActor() > > style.SetDefaultRenderer(renderer) > > interactor.SetInteractorStyle(style) > > > > # Add spheres to play with > > for i in range(NUMBER_OF_SPHERES): > > source = vtk.vtkSphereSource() > > > > # random position and radius > > x = vtk.vtkMath.Random(-5, 5) > > y = vtk.vtkMath.Random(-5, 5) > > z = vtk.vtkMath.Random(-5, 5) > > radius = vtk.vtkMath.Random(.5, 1.0) > > > > source.SetRadius(radius) > > source.SetCenter(x, y, z) > > source.SetPhiResolution(11) > > source.SetThetaResolution(21) > > > > mapper = vtk.vtkPolyDataMapper() > > mapper.SetInputConnection(source.GetOutputPort()) > > actor = vtk.vtkActor() > > actor.SetMapper(mapper) > > > > r = vtk.vtkMath.Random(.4, 1.0) > > g = vtk.vtkMath.Random(.4, 1.0) > > b = vtk.vtkMath.Random(.4, 1.0) > > actor.GetProperty().SetDiffuseColor(r, g, b) > > actor.GetProperty().SetDiffuse(.8) > > actor.GetProperty().SetSpecular(.5) > > actor.GetProperty().SetSpecularColor(1.0, 1.0, 1.0) > > actor.GetProperty().SetSpecularPower(30.0) > > > > info = actor.GetProperty().GetInformation() > > key = vtk.vtkInformationStringKey.MakeKey("CPHY_ID", "vtkActor") > > info.Set(key, "SPH_"+str(i)) > > #actor.GetProperty().SetInformation(info) > > > > renderer.AddActor(actor) > > > > for i in range(NUMBER_OF_SPHERES): > > source = vtk.vtkConeSource() > > > > # random position and radius > > x = vtk.vtkMath.Random(-8, 5) > > y = vtk.vtkMath.Random(-8, 5) > > z = vtk.vtkMath.Random(-8, 5) > > radius = vtk.vtkMath.Random(.5, 1.0) > > > > angle = vtk.vtkMath.Random(5, 10) > > source.SetAngle(angle) > > source.SetRadius(radius) > > source.SetCenter(x, y, z) > > # source.SetPhiResolution(11) > > # source.SetThetaResolution(21) > > > > mapper = vtk.vtkPolyDataMapper() > > mapper.SetInputConnection(source.GetOutputPort()) > > actor = vtk.vtkActor() > > actor.SetMapper(mapper) > > > > r = vtk.vtkMath.Random(.4, 1.0) > > g = vtk.vtkMath.Random(.4, 1.0) > > b = vtk.vtkMath.Random(.4, 1.0) > > actor.GetProperty().SetDiffuseColor(r, g, b) > > actor.GetProperty().SetDiffuse(.8) > > actor.GetProperty().SetSpecular(.5) > > actor.GetProperty().SetSpecularColor(1.0, 1.0, 1.0) > > actor.GetProperty().SetSpecularPower(30.0) > > > > info = actor.GetProperty().GetInformation() > > key = vtk.vtkInformationStringKey.MakeKey("CPHY_ID", "vtkActor") > > info.Set(key, "CON_"+str(i)) > > #actor.GetProperty().SetInformation(info) > > renderer.AddActor(actor) > > > > # Start > > interactor.Initialize() > > interactor.Start() > > ``` > > > > Regards, > > -- > > Abhishek > http://zeroth.me > > > > > -- > > Abhishek > http://zeroth.me > > > > > -- > > Abhishek > http://zeroth.me > -- Abhishek http://zeroth.me -------------- next part -------------- An HTML attachment was scrubbed... URL: From minpu.code at gmail.com Thu Nov 8 23:08:37 2018 From: minpu.code at gmail.com (pnt1614) Date: Thu, 8 Nov 2018 21:08:37 -0700 (MST) Subject: [vtkusers] Error when building VTK 8.1.1 with Qt 5.6.3 (64 bits) Message-ID: <1541736517781-0.post@n5.nabble.com> I want to use VTK with Qt in Visual Studio 2015 64 bits so I use CMake (3.12.4) to build VTK 8.1.1 with Qt 5.6.3. Everything is fine in CMake but I get the following errors when running ALL_BUILD in visual studio 2015: error LNK2001: unresolved external symbol "protected: virtual void __cdecl QGLWidget::glDraw(void)" (?glDraw at QGLWidget@@MEAAXXZ) error LNK2001: unresolved external symbol "protected: virtual void __cdecl QGLWidget::glInit(void)" (?glInit at QGLWidget@@MEAAXXZ) error LNK2001: unresolved external symbol "protected: virtual void __cdecl QGLWidget::initializeOverlayGL(void)" (?initializeOverlayGL at QGLWidget@@MEAAXXZ) error LNK2001: unresolved external symbol "public: virtual class QPaintEngine * __cdecl QGLWidget::paintEngine(void)const " (?paintEngine at QGLWidget@@UEBAPEAVQPaintEngine@@XZ) error LNK2001: unresolved external symbol "protected: virtual void __cdecl QGLWidget::paintEvent(class QPaintEvent *)" (?paintEvent at QGLWidget@@MEAAXPEAVQPaintEvent@@@Z) error LNK2001: unresolved external symbol "protected: virtual void __cdecl QGLWidget::paintOverlayGL(void)" (?paintOverlayGL at QGLWidget@@MEAAXXZ) error LNK2001: unresolved external symbol "protected: virtual void __cdecl QGLWidget::resizeEvent(class QResizeEvent *)" (?resizeEvent at QGLWidget@@MEAAXPEAVQResizeEvent@@@Z) error LNK2001: unresolved external symbol "protected: virtual void __cdecl QGLWidget::resizeOverlayGL(int,int)" (?resizeOverlayGL at QGLWidget@@MEAAXHH at Z) error LNK2001: unresolved external symbol "public: virtual void __cdecl QGLWidget::updateGL(void)" (?updateGL at QGLWidget@@UEAAXXZ) error LNK2001: unresolved external symbol "public: virtual void __cdecl QGLWidget::updateOverlayGL(void)" (?updateOverlayGL at QGLWidget@@UEAAXXZ) The following image shows how I configured in CMake Anybody experienced this problem? Please, help me. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From polly_sukting at hotmail.com Fri Nov 9 01:13:58 2018 From: polly_sukting at hotmail.com (Polly Pui) Date: Fri, 9 Nov 2018 06:13:58 +0000 Subject: [vtkusers] Extract csv row and column into points Message-ID: Hi, Is there any clue that i can extract the row and column data from a csv file and read them as points? Currently I am using vtkpoints to read points by inserting points manually to my .cpp . Is it possible for me to call the csv directly and read the data (eg. column 3-5, row 2-10)? I attach my code here. ...... int main(int, char*[]) { vtkSmartPointer points = vtkSmartPointer::New(); points->InsertNextPoint(8.4312, -36.489, -1500.7); points->InsertNextPoint(8.8408, -37.726, -1500.4); points->InsertNextPoint(11.372, -37.787, -1501.5); points->InsertNextPoint(11.263, -36.384, -1501.9); points->InsertNextPoint(9.3914, -40.819, -1500.8); points->InsertNextPoint(11.685, -42.482, -1502.7); points->InsertNextPoint(14.235, -38.096, -1503.5); points->InsertNextPoint(13.972, -43.051, -1504.2); points->InsertNextPoint(9.22, -43.904, -1504); vtkSmartPointer inputData = vtkSmartPointer::New(); for (int c = 0; c < 3; ++c) { std::stringstream colName; colName << "coord " << c; vtkSmartPointer doubleArray = vtkSmartPointer::New(); doubleArray->SetNumberOfComponents(1); doubleArray->SetName(colName.str().c_str()); doubleArray->SetNumberOfTuples(points->GetNumberOfPoints()); for (int r = 0; r < points->GetNumberOfPoints(); ++r) { double p[3]; points->GetPoint(r, p); doubleArray->SetValue(r, p[c]); } inputData->AddColumn(doubleArray); } Thank you very much. Regards, Polly -------------- next part -------------- An HTML attachment was scrubbed... URL: From iamdpak at gmail.com Fri Nov 9 03:15:33 2018 From: iamdpak at gmail.com (vinmean) Date: Fri, 9 Nov 2018 01:15:33 -0700 (MST) Subject: [vtkusers] Is it possible to remap texture from one actor to another? In-Reply-To: <1541641148828-0.post@n5.nabble.com> References: <1541641148828-0.post@n5.nabble.com> Message-ID: <1541751333855-0.post@n5.nabble.com> Just an added information. I have loaded one of the actors from a obj file (Has an mtl file and uv texture png). The destination actor was loaded from a ply file. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From matusikova.lucia at gmail.com Fri Nov 9 07:05:27 2018 From: matusikova.lucia at gmail.com (Lucy) Date: Fri, 9 Nov 2018 05:05:27 -0700 (MST) Subject: [vtkusers] Create 3D model from 3D points using Marching Cubes Message-ID: <1541765127553-0.post@n5.nabble.com> Hi, I need to create a 3D model of the mask using the marching cubes algorithm. I have 3D coordinates of the points of each slice (CT). I am trying to use example available here: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Modelling/MarchingCubes, but the model is of poor quality and contains holes. I'm new to VTK. Can anyone tell me what steps to use? Thanks, Lucy -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From cory.quammen at kitware.com Fri Nov 9 09:07:52 2018 From: cory.quammen at kitware.com (Cory Quammen) Date: Fri, 9 Nov 2018 09:07:52 -0500 Subject: [vtkusers] Extract csv row and column into points In-Reply-To: References: Message-ID: vtkDelimitedTextReader -> vtkTableToPolyData is a pipeline that should make this much simpler. On Fri, Nov 9, 2018 at 1:14 AM Polly Pui wrote: > Hi, > Is there any clue that i can extract the row and column data from a csv > file and read them as points? > Currently I am using vtkpoints to read points by inserting points > manually to my .cpp . > Is it possible for me to call the csv directly and read the data (eg. > column 3-5, row 2-10)? > > I attach my code here. > ...... > int main(int, char*[]) > { > > vtkSmartPointer points = > vtkSmartPointer::New(); > points->InsertNextPoint(8.4312, -36.489, -1500.7); > points->InsertNextPoint(8.8408, -37.726, -1500.4); > points->InsertNextPoint(11.372, -37.787, -1501.5); > points->InsertNextPoint(11.263, -36.384, -1501.9); > points->InsertNextPoint(9.3914, -40.819, -1500.8); > points->InsertNextPoint(11.685, -42.482, -1502.7); > points->InsertNextPoint(14.235, -38.096, -1503.5); > points->InsertNextPoint(13.972, -43.051, -1504.2); > points->InsertNextPoint(9.22, -43.904, -1504); > > vtkSmartPointer inputData = > vtkSmartPointer::New(); > for (int c = 0; c < 3; ++c) > { > std::stringstream colName; > colName << "coord " << c; > vtkSmartPointer doubleArray = > vtkSmartPointer::New(); > doubleArray->SetNumberOfComponents(1); > doubleArray->SetName(colName.str().c_str()); > doubleArray->SetNumberOfTuples(points->GetNumberOfPoints()); > > for (int r = 0; r < points->GetNumberOfPoints(); ++r) > { > double p[3]; > points->GetPoint(r, p); > doubleArray->SetValue(r, p[c]); > } > inputData->AddColumn(doubleArray); > } > > Thank you very much. > > Regards, > Polly > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 anpedroni at gmail.com Fri Nov 9 09:26:16 2018 From: anpedroni at gmail.com (Andreas Pedroni) Date: Fri, 9 Nov 2018 15:26:16 +0100 Subject: [vtkusers] vtkRenderWindowInteractor() in addition to other kind of interactors Message-ID: Dear list I am stuck in interacting with the render window in VTK. I am using VTK with pyhton and opencv2 on a mac. Specifically, I load a 3D object and render it . At the same time I map a video on a plane and in parallel do some image analysis (with opencv2). The output of this image analysis moves the rendered 3D object using SetPosition. All this works smoothly, but I cannot interact with the render window in the default way (e.g. moving around the viewpoint and zooming) using the vtkRenderWindowInteractor(). If I start it as follows: ren = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) iren.Initialize() iren.Start() ...I can move in the window but then movie does is not mapped on the plane and the 3D object does not update the position accordingly. Is it possible to use the vtkRenderWindowInteractor() while allowing the actors in the window to interact with for instance input from opencv? Thanks for any help and all the best Andreas From polly_sukting at hotmail.com Fri Nov 9 10:16:25 2018 From: polly_sukting at hotmail.com (Polly Pui) Date: Fri, 9 Nov 2018 15:16:25 +0000 Subject: [vtkusers] Extract csv row and column into points In-Reply-To: References: , Message-ID: Hi, Thanks for your reply. Is it possible to have more elaborations from you? How can I get the number of points from vtkTableToPolyData? I got an error saying that vtkTableToPolyData has no members of GetNumberOfPoints. I need those points to proceed to KmeansStatistics. This is my code: ...... std::string inputFilename = argv[1]; vtkSmartPointer reader = vtkSmartPointer::New(); reader->SetFileName(inputFilename.c_str()); reader->SetFieldDelimiterCharacters(" "); reader->DetectNumericColumnsOn(); reader->Update(); int numberOfRows = reader->GetOutput()->GetNumberOfRows(); vtkSmartPointer inputData = vtkSmartPointer::New(); inputData->SetInputConnection(reader->GetOutputPort); for (int c = 0; c < 3; ++c) { std::stringstream colName; colName << "coord " << c; vtkSmartPointer doubleArray = vtkSmartPointer::New(); doubleArray->SetNumberOfComponents(1); doubleArray->SetName(colName.str().c_str()); doubleArray->SetNumberOfTuples(inputData->GetNumberOfPoints()); for (int r = 0; r < inputData->GetNumberOfPoints(); ++r) { double p[3]; inputData->GetPoint(r, p); doubleArray->SetValue(r, p[c]); } inputData->AddColumn(doubleArray); } vtkSmartPointer kMeansStatistics = vtkSmartPointer::New(); #if VTK_MAJOR_VERSION <= 5 kMeansStatistics->SetInput(vtkStatisticsAlgorithm::INPUT_DATA, inputData); #else kMeansStatistics->SetInputData(vtkStatisticsAlgorithm::INPUT_DATA, inputData); #endif kMeansStatistics->SetColumnStatus(inputData->GetColumnName(0), 1); kMeansStatistics->SetColumnStatus(inputData->GetColumnName(1), 1); kMeansStatistics->SetColumnStatus(inputData->GetColumnName(2), 1); kMeansStatistics->RequestSelectedColumns(); kMeansStatistics->SetAssessOption(true); kMeansStatistics->SetDefaultNumberOfClusters(1); //kMeansStatistics->SetMaxNumIterations(15); kMeansStatistics->Update(); Thanks again. Regards, Polly ________________________________ From: Cory Quammen Sent: Friday, November 9, 2018 10:07 PM To: Polly Pui Cc: vtkusers Subject: Re: [vtkusers] Extract csv row and column into points vtkDelimitedTextReader -> vtkTableToPolyData is a pipeline that should make this much simpler. On Fri, Nov 9, 2018 at 1:14 AM Polly Pui > wrote: Hi, Is there any clue that i can extract the row and column data from a csv file and read them as points? Currently I am using vtkpoints to read points by inserting points manually to my .cpp . Is it possible for me to call the csv directly and read the data (eg. column 3-5, row 2-10)? I attach my code here. ...... int main(int, char*[]) { vtkSmartPointer points = vtkSmartPointer::New(); points->InsertNextPoint(8.4312, -36.489, -1500.7); points->InsertNextPoint(8.8408, -37.726, -1500.4); points->InsertNextPoint(11.372, -37.787, -1501.5); points->InsertNextPoint(11.263, -36.384, -1501.9); points->InsertNextPoint(9.3914, -40.819, -1500.8); points->InsertNextPoint(11.685, -42.482, -1502.7); points->InsertNextPoint(14.235, -38.096, -1503.5); points->InsertNextPoint(13.972, -43.051, -1504.2); points->InsertNextPoint(9.22, -43.904, -1504); vtkSmartPointer inputData = vtkSmartPointer::New(); for (int c = 0; c < 3; ++c) { std::stringstream colName; colName << "coord " << c; vtkSmartPointer doubleArray = vtkSmartPointer::New(); doubleArray->SetNumberOfComponents(1); doubleArray->SetName(colName.str().c_str()); doubleArray->SetNumberOfTuples(points->GetNumberOfPoints()); for (int r = 0; r < points->GetNumberOfPoints(); ++r) { double p[3]; points->GetPoint(r, p); doubleArray->SetValue(r, p[c]); } inputData->AddColumn(doubleArray); } Thank you very much. Regards, Polly _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: 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 paulo.r.m.carvalho at gmail.com Fri Nov 9 13:12:01 2018 From: paulo.r.m.carvalho at gmail.com (Paulo Carvalho) Date: Fri, 9 Nov 2018 11:12:01 -0700 (MST) Subject: [vtkusers] Issue compiling VTK 8.1.2 - MinGW64 - Windows 7 Message-ID: <1541787121742-0.post@n5.nabble.com> Greetings all. I'm trying to build VTK and I'm getting the following error: [ 62%] Building CXX object Rendering/OpenGL2/CMakeFiles/vtkRenderingOpenGL2.dir/vtkWin32RenderWindowInteractor.cxx.obj C:\Users\ur5m\Desktop\VTK64\VTK-8.1.2\Rendering\OpenGL2\vtkWin32RenderWindowInteractor.cxx:72:3: error: conflicting declaration 'typedef struct _TOUCHINPUT TOUCHINPUT' } TOUCHINPUT, *PTOUCHINPUT; ^~~~~~~~~~ In file included from C:/Users/ur5m/Desktop/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:72, from C:/Users/ur5m/Desktop/VTK64/VTK-8.1.2/Common/Core/vtkWindows.h:58, from C:\Users\ur5m\Desktop\VTK64\VTK-8.1.2\Rendering\OpenGL2\vtkWin32OpenGLRenderWindow.h:31, from C:\Users\ur5m\Desktop\VTK64\VTK-8.1.2\Rendering\OpenGL2\vtkWin32RenderWindowInteractor.cxx:26: C:/Users/ur5m/Desktop/msys64/mingw64/x86_64-w64-mingw32/include/winuser.h:2694:5: note: previous declaration as 'typedef struct tagTOUCHINPUT TOUCHINPUT' } TOUCHINPUT,*PTOUCHINPUT; ^~~~~~~~~~ C:\Users\ur5m\Desktop\VTK64\VTK-8.1.2\Rendering\OpenGL2\vtkWin32RenderWindowInteractor.cxx:72:16: error: conflicting declaration 'typedef struct _TOUCHINPUT* PTOUCHINPUT' } TOUCHINPUT, *PTOUCHINPUT; ^~~~~~~~~~~ In file included from C:/Users/ur5m/Desktop/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:72, from C:/Users/ur5m/Desktop/VTK64/VTK-8.1.2/Common/Core/vtkWindows.h:58, from C:\Users\ur5m\Desktop\VTK64\VTK-8.1.2\Rendering\OpenGL2\vtkWin32OpenGLRenderWindow.h:31, from C:\Users\ur5m\Desktop\VTK64\VTK-8.1.2\Rendering\OpenGL2\vtkWin32RenderWindowInteractor.cxx:26: C:/Users/ur5m/Desktop/msys64/mingw64/x86_64-w64-mingw32/include/winuser.h:2694:17: note: previous declaration as 'typedef struct tagTOUCHINPUT* PTOUCHINPUT' } TOUCHINPUT,*PTOUCHINPUT; ^~~~~~~~~~~ In file included from C:/Users/ur5m/Desktop/msys64/mingw64/x86_64-w64-mingw32/include/minwindef.h:163, from C:/Users/ur5m/Desktop/msys64/mingw64/x86_64-w64-mingw32/include/windef.h:8, from C:/Users/ur5m/Desktop/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:69, from C:/Users/ur5m/Desktop/VTK64/VTK-8.1.2/Common/Core/vtkWindows.h:58, from C:\Users\ur5m\Desktop\VTK64\VTK-8.1.2\Rendering\OpenGL2\vtkWin32OpenGLRenderWindow.h:31, from C:\Users\ur5m\Desktop\VTK64\VTK-8.1.2\Rendering\OpenGL2\vtkWin32RenderWindowInteractor.cxx:26: C:\Users\ur5m\Desktop\VTK64\VTK-8.1.2\Rendering\OpenGL2\vtkWin32RenderWindowInteractor.cxx:73:16: error: redefinition of 'struct HTOUCHINPUT__' DECLARE_HANDLE(HTOUCHINPUT); ^~~~~~~~~~~ C:/Users/ur5m/Desktop/msys64/mingw64/x86_64-w64-mingw32/include/winuser.h:2681:3: note: previous definition of 'struct HTOUCHINPUT__' DECLARE_HANDLE (HTOUCHINPUT); ^~~~~~~~~~~~~~ C:\Users\ur5m\Desktop\VTK64\VTK-8.1.2\Rendering\OpenGL2\vtkWin32RenderWindowInteractor.cxx: In member function 'virtual int vtkWin32RenderWindowInteractor::OnTouch(HWND, UINT, UINT)': C:\Users\ur5m\Desktop\VTK64\VTK-8.1.2\Rendering\OpenGL2\vtkWin32RenderWindowInteractor.cxx:764:27: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] if (GTII((HTOUCHINPUT)lParam, cInputs, pInputs, sizeof(TOUCHINPUT))) ^~~~~~ C:\Users\ur5m\Desktop\VTK64\VTK-8.1.2\Rendering\OpenGL2\vtkWin32RenderWindowInteractor.cxx:819:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] CTIH((HTOUCHINPUT)lParam); ^~~~~~ mingw32-make[2]: *** [Rendering\OpenGL2\CMakeFiles\vtkRenderingOpenGL2.dir\build.make:1733: Rendering/OpenGL2/CMakeFiles/vtkRenderingOpenGL2.dir/vtkWin32RenderWindowInteractor.cxx.obj] Error 1 mingw32-make[1]: *** [CMakeFiles\Makefile2:2510: Rendering/OpenGL2/CMakeFiles/vtkRenderingOpenGL2.dir/all] Error 2 mingw32-make: *** [Makefile:129: all] Error 2 Any help will be much appreciated. Thanks. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From Wang.Liqin at mayo.edu Fri Nov 9 17:47:03 2018 From: Wang.Liqin at mayo.edu (Wang, Liqin, M.S.) Date: Fri, 09 Nov 2018 22:47:03 +0000 Subject: [vtkusers] build VTK with java Message-ID: HI, All, I followed the instruction of: https://www.particleincell.com/2011/vtk-java-visualization/ To build VTK with java. In step 6, All_BUILD, I got the following warning and error, then build was aborted. Severity Code Description Project File Line Suppression State Warning [options] bootstrap class path not set in conjunction with -source 1.6 VTKJavaClasses D:\VTKSource\VTK-8.1.2-bin\Wrapping\Java\CUSTOMBUILD 1 Severity Code Description Project File Line Suppression State Error MSB6006 "cmd.exe" exited with code 1. VTKJavaClasses C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets 171 Could anyone please let me know how to fix this? Thanks Liqin From sebastien.jourdain at kitware.com Fri Nov 9 18:07:55 2018 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Fri, 9 Nov 2018 16:07:55 -0700 Subject: [vtkusers] build VTK with java In-Reply-To: References: Message-ID: Maybe this can help? https://github.com/Kitware/VTK/blob/master/Wrapping/Java/README.txt On Fri, Nov 9, 2018 at 3:56 PM Wang, Liqin, M.S. via vtkusers < vtkusers at public.kitware.com> wrote: > HI, All, > > I followed the instruction of: > https://www.particleincell.com/2011/vtk-java-visualization/ > > To build VTK with java. > > In step 6, All_BUILD, I got the following warning and error, then build > was aborted. > > Severity Code Description Project File Line > Suppression State > Warning [options] bootstrap class path not set in conjunction with > -source 1.6 VTKJavaClasses > D:\VTKSource\VTK-8.1.2-bin\Wrapping\Java\CUSTOMBUILD 1 > > > > Severity Code Description Project File Line > Suppression State > Error MSB6006 "cmd.exe" exited with code 1. VTKJavaClasses C:\Program > Files (x86)\Microsoft Visual > Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets > 171 > > > Could anyone please let me know how to fix this? > > > Thanks > > Liqin > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 elvis.stansvik at orexplore.com Sat Nov 10 05:34:10 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Sat, 10 Nov 2018 11:34:10 +0100 Subject: [vtkusers] vtkExternalOpenGLRenderWindow not Python-wrapped? Message-ID: Hi all, I found the example at https://github.com/nicanor-romero/QtVtk quite interesting (VTK inside Qt Quick as a FBO item), and for a fun weekend project wanted to see if it would at all be possible to port it to Python. But hit a snag quite quickly as it seems vtkExternalOpenGLRenderWindow is not Python-wrapped: Python 3.6.6 (default, Sep 12 2018, 18:26:19) [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from vtk import vtkExternalOpenGLRenderWindow Traceback (most recent call last): File "", line 1, in ImportError: cannot import name 'vtkExternalOpenGLRenderWindow' >>> I couldn't find it tagged with WRAP_EXCLUDE_PYTHON though. Is this class supposed to be wrapped? David? Cheers, Elvis From elvis.stansvik at orexplore.com Sat Nov 10 07:58:37 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Sat, 10 Nov 2018 13:58:37 +0100 Subject: [vtkusers] vtkExternalOpenGLRenderWindow not Python-wrapped? In-Reply-To: References: Message-ID: My bad, I was using a different VTK than what I thought I was. Elvis Den l?r 10 nov. 2018 kl 11:34 skrev Elvis Stansvik : > > Hi all, > > I found the example at https://github.com/nicanor-romero/QtVtk quite > interesting (VTK inside Qt Quick as a FBO item), and for a fun weekend > project wanted to see if it would at all be possible to port it to > Python. > > But hit a snag quite quickly as it seems vtkExternalOpenGLRenderWindow > is not Python-wrapped: > > Python 3.6.6 (default, Sep 12 2018, 18:26:19) > [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux > Type "help", "copyright", "credits" or "license" for more information. > >>> from vtk import vtkExternalOpenGLRenderWindow > Traceback (most recent call last): > File "", line 1, in > ImportError: cannot import name 'vtkExternalOpenGLRenderWindow' > >>> > > I couldn't find it tagged with WRAP_EXCLUDE_PYTHON though. Is this > class supposed to be wrapped? David? > > Cheers, > Elvis From mat at mgvs.org Sun Nov 11 05:21:32 2018 From: mat at mgvs.org (Matthew D) Date: Sun, 11 Nov 2018 03:21:32 -0700 (MST) Subject: [vtkusers] How to put vtkDiskSource on vtkPolyDataMapper Message-ID: <1541931692878-0.post@n5.nabble.com> I need to put multiple vtkDiskSource over the mesh surface (represented as vtkPolyDataMapper) so that the disks lay on the mesh surface. Objects like vtkRegularPolygonSource has SetNormal method which could be used for "rotation". Also there is vtkTransform but I don't know how to calculate X,Y,Z values. Can anybody help me with that? disk = vtk.vtkDiskSource() disk.SetInnerRadius(1.0) disk.SetOuterRadius(2.0) <---- rotation mapper = vtk.vtkPolyDataMapper() mapper.SetInputConnection(disk.GetOutputPort()) -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From Andx_roo at live.com Mon Nov 12 02:08:16 2018 From: Andx_roo at live.com (Andaharoo) Date: Mon, 12 Nov 2018 00:08:16 -0700 (MST) Subject: [vtkusers] How to put vtkDiskSource on vtkPolyDataMapper In-Reply-To: <1541931692878-0.post@n5.nabble.com> References: <1541931692878-0.post@n5.nabble.com> Message-ID: <1542006496759-0.post@n5.nabble.com> Do the disks need to be "apart" of the polygon for exporting and other things? Or do you just need to render/visualize them? If they need to be apart of the dataset then you need to join the disk's polyData with your target polyData using vtkTransformFilter to move and transform the disks and use vtkAppendPolyData or vtkBooleanOperationPolyDataFilter to join all the disks with the target. If you just need to render them then it's much easier: For just a few of them you can simply specify a different vtkActor for each disk and use SetPosition and SetOrientation to get them where you want them. For visualizing many of them I would highly suggest using the glyphing features of VTK as long as the disks only vary in position, scale, and/or color. You can use vtkOpenGLGlyph3DMapper to render hundreds of thousands of them on the latest gpus (assuming the disks are relatively low poly). Or use vtkGlyph3DMapper if you don't have a gpu. Just supply it with the source, in your case vtkDiskSource's output. And supply it with an input data object. Which should contain point data, orientation data, and/or scalars in the input data object. I'd use this to draw the normals of a polygon or a vector field from image data as polygonal arrows. It's a little tricky and undocumented currently and lacking examples. I can supply one if this is what you need. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From Andx_roo at live.com Mon Nov 12 03:52:08 2018 From: Andx_roo at live.com (Andaharoo) Date: Mon, 12 Nov 2018 01:52:08 -0700 (MST) Subject: [vtkusers] vtkRenderWindowInteractor() in addition to other kind of interactors In-Reply-To: References: Message-ID: <1542012728242-0.post@n5.nabble.com> How are you updating your data? There is a timer you can add to the interactors that you can use for updating things whilst keeping the interactors working. https://www.vtk.org/Wiki/VTK/Examples/Python/Animation -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From mat at mgvs.org Mon Nov 12 04:15:59 2018 From: mat at mgvs.org (Matthew D) Date: Mon, 12 Nov 2018 02:15:59 -0700 (MST) Subject: [vtkusers] How to put vtkDiskSource on vtkPolyDataMapper In-Reply-To: <1542006496759-0.post@n5.nabble.com> References: <1541931692878-0.post@n5.nabble.com> <1542006496759-0.post@n5.nabble.com> Message-ID: <1542014159510-0.post@n5.nabble.com> I need differect vtkActor for each Ring. But the problem I don't know how to calculate SetPosition and SetOrientation for each of them (which function filter use to do that). https://image.ibb.co/g8c9yV/rings.png Current picture, at top two images from different coordinate positions, and at the bottom how it should be in any place. The surface is a "head" (vtkPolyData), coordinate system begins in head center. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From m.sambin at gmail.com Mon Nov 12 11:15:14 2018 From: m.sambin at gmail.com (Marco Sambin) Date: Mon, 12 Nov 2018 17:15:14 +0100 Subject: [vtkusers] 3D rendering with VTK from Java application Message-ID: Hi VTK experts. I am starting a development requiring some VTK-based 3D rendering from within a Java desktop application, and in particular inside a panel embedded into the GUI of this Java application. This application will need to work at least on Windows, Mac OS, and Linux. Will using JOGL-based rendering components be the best option for my task? Are JOGL-based rendering components reliable and robust enough with the current version of VTK? I made some JOGL-related tests with VTK some years ago (using VTK 6), but at that time I ended up using vtkCanvas-derived rendering components in my application (which required compatibility with Windows OS only), since JOGL-based components had some issues (I do not recall exactly, but I seem to remember there were issues related to the size of the viewport...). So, I was wondering if JOGL-based rendering components are now more robust and reliable with the current version of VTK, or if there are other preferable options. Thanks in advance for your feedback. Best regards, Marco Sambin -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.jourdain at kitware.com Mon Nov 12 13:25:38 2018 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Mon, 12 Nov 2018 11:25:38 -0700 Subject: [vtkusers] 3D rendering with VTK from Java application In-Reply-To: References: Message-ID: Hi Marco, The JOGL is the only component that can work on mac. I'm not sure they are much better than when they get out in VTK 6. The tricky part may be if you do interactive widgets but truly you need to do a validation on your end through the various platform to be sure. I'm don't know how much the code is used by the community. HTH, Seb On Mon, Nov 12, 2018 at 9:15 AM Marco Sambin wrote: > Hi VTK experts. > > I am starting a development requiring some VTK-based 3D rendering from > within a Java desktop application, and in particular inside a panel > embedded into the GUI of this Java application. > This application will need to work at least on Windows, Mac OS, and Linux. > Will using JOGL-based rendering components be the best option for my task? > > Are JOGL-based rendering components reliable and robust enough with the > current version of VTK? > > I made some JOGL-related tests with VTK some years ago (using VTK 6), but > at that time I ended up using vtkCanvas-derived rendering components in my > application (which required compatibility with Windows OS only), since > JOGL-based components had some issues (I do not recall exactly, but I seem > to remember there were issues related to the size of the viewport...). > So, I was wondering if JOGL-based rendering components are now more robust > and reliable with the current version of VTK, or if there are other > preferable options. > > Thanks in advance for your feedback. > > Best regards, > > Marco Sambin > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 anpedroni at gmail.com Tue Nov 13 03:07:10 2018 From: anpedroni at gmail.com (Andreas Pedroni) Date: Tue, 13 Nov 2018 09:07:10 +0100 Subject: [vtkusers] vtkRenderWindowInteractor() in addition to other kind of interactors In-Reply-To: <1542012728242-0.post@n5.nabble.com> References: <1542012728242-0.post@n5.nabble.com> Message-ID: <9FDBF2DB-015E-4490-84F2-FD90E27882A5@gmail.com> Thank you very much for reaching out! I got actually one step further and could implement and understand the EventTimer as in the Python animation example. However, instead of updating the position or any other property of an actor I would like to update the texture of a plane to play a video on this plane. To do this I would need to pass more than just the actor (as in the https://www.vtk.org/Wiki/VTK/Examples/Python/Animation ) to the vtkTimerCallback() and update it by the timercount. I think I need to pass the VideoCapture (cap) object, and execute everything after ?while cap.isOpened():? I am new to object oriented programming and I don?t see how to pass more than the actor object to the vtkTimerCallback() class. Below is a code snippet to show how I map the texture on the plane repeatedly to play a video, but without being able to interact with the 3D scene. Best and thanks for any help! Andreas import vtk import cv2 from vtk.util import numpy_support VIDEOPATH= "/Users/apedroni/AnacondaProjects/objecttracking/ressources/MRI-Video/Videos/20180816-133303.mp4" def setup3dScene(frame): frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) vtkArray = numpy_support.numpy_to_vtk(frame.reshape((-1, 3), order='F'), deep=False) # Create a vtkImage Object. This is filled with the vtkArray data later vtkImage = vtk.vtkImageData() vtkImage.SetDimensions(720, 1280, 1) vtkImage.SetSpacing(720, 1280, 1) vtkImage.SetOrigin(720, 1280, 0) vtkImage.GetPointData().SetScalars(vtkArray) # create the Texture for a plane atext = vtk.vtkTexture() atext.SetInputData(vtkImage) atext.InterpolateOn() # The Screen where the movie is mapped onto plane = vtk.vtkPlaneSource() planeMapper = vtk.vtkPolyDataMapper() planeMapper.SetInputConnection(plane.GetOutputPort()) planeActor = vtk.vtkActor() planeActor.SetMapper(planeMapper) planeActor.SetTexture(atext) planeActor.SetScale(0.5625, 1, 1) planeActor.SetOrientation(180, 180, 90) # set up the renderer and the window ren = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() ren.AddActor(planeActor) renWin.AddRenderer(ren) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) ren.SetBackground(0.1, 1, 0.4) renWin.SetSize(1500, 1500) iren.Initialize() iren.Enable() ren.ResetCamera() renWin.Render() return vtkImage, renWin, iren #1 set up the 3D scene #2 Open CV2 Video Capture and update the actors in the 3D scene # Create a video capture object to read videos cap = cv2.VideoCapture(VIDEOPATH) success, frame = cap.read() vtkImage, renWin, iren = setup3dScene(frame) while cap.isOpened(): # read video videoOk, frame = cap.read() if not videoOk: break frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) vtkArray = numpy_support.numpy_to_vtk(frame.reshape((-1, 3), order='F'), deep=False) vtkImage.GetPointData().SetScalars(vtkArray) renWin.Render() > Am 12.11.2018 um 09:52 schrieb Andaharoo : > > How are you updating your data? There is a timer you can add to the > interactors that you can use for updating things whilst keeping the > interactors working. https://www.vtk.org/Wiki/VTK/Examples/Python/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://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From alessandro.volz at gmail.com Tue Nov 13 06:11:33 2018 From: alessandro.volz at gmail.com (Alessandro Volz) Date: Tue, 13 Nov 2018 12:11:33 +0100 Subject: [vtkusers] Custom VTK Cocoa window flickers gray on new macOS Message-ID: <53C0B8F4-09DE-4215-B86F-519F3A89697F@gmail.com> Hi, I am a contributor to the Horos project (the FOSS inherited from OsiriX). In this project, we use VTK for the Volume Rendering window. When I say 'custom', I mean that we assign our own NSView and NSWindow to the vtkCocoaRenderWindow (through SetWindowId and SetRootWindow), and initialize the vtkRenderWindowInteractor inside the first drawRect: call. With the latest macOS update we have this strange behavior in the VR window. Somehow, the VTK render sometimes doesn't successfully get drawn on screen: - the window is initially gray - when resizing, it flickers between gray and render - when calling the underlying interactor, the resulting updated image is rendered on screen (for example when rotating). Do you have any advice how to fix this? Thanks, Alessandro From cory.quammen at kitware.com Tue Nov 13 10:34:21 2018 From: cory.quammen at kitware.com (Cory Quammen) Date: Tue, 13 Nov 2018 10:34:21 -0500 Subject: [vtkusers] Extract csv row and column into points In-Reply-To: References: Message-ID: Ah, so you want to use the vtkKMeansStatistics filter. That filter operates on vtkTable data. To use it, you don't need to create points at all. Instead, you can connect the vtkDelimitedTextReader directly to the vtkKMeansStatistics filter like so: vtkSmartPointer kMeansStatistics = vtkSmartPointer::New(); kMeansStatistics->SetInputConnection(reader->GetOutputPort()); kMeansStatistics->SetColumnStatus("column1", 1); kMeansStatistics->SetColumnStatus("column2", 1); kMeansStatistics->SetColumnStatus("column3, 1); kMeansStatistics->RequestSelectedColumns(); kMeansStatistics->SetAssessOption(true); kMeansStatistics->SetDefaultNumberOfClusters(1); //kMeansStatistics->SetMaxNumIterations(15); kMeansStatistics->Update(); Here, I've altered your calls to SetColumnStatus() under the assumption you know the column names of interest. HTH, Cory On Fri, Nov 9, 2018 at 10:16 AM Polly Pui wrote: > Hi, > Thanks for your reply. > Is it possible to have more elaborations from you? > > How can I get the number of points from vtkTableToPolyData? > I got an error saying that vtkTableToPolyData has no members of > GetNumberOfPoints. > I need those points to proceed to KmeansStatistics. > > This is my code: > ...... > std::string inputFilename = argv[1]; > > vtkSmartPointer reader = > vtkSmartPointer::New(); > reader->SetFileName(inputFilename.c_str()); > reader->SetFieldDelimiterCharacters(" "); > reader->DetectNumericColumnsOn(); > reader->Update(); > int numberOfRows = reader->GetOutput()->GetNumberOfRows(); > > vtkSmartPointer inputData = > vtkSmartPointer::New(); > inputData->SetInputConnection(reader->GetOutputPort); > > for (int c = 0; c < 3; ++c) > { > std::stringstream colName; > colName << "coord " << c; > vtkSmartPointer doubleArray = > vtkSmartPointer::New(); > doubleArray->SetNumberOfComponents(1); > doubleArray->SetName(colName.str().c_str()); > doubleArray->SetNumberOfTuples(inputData->GetNumberOfPoints()); > > > for (int r = 0; r < inputData->GetNumberOfPoints(); ++r) > { > double p[3]; > inputData->GetPoint(r, p); > doubleArray->SetValue(r, p[c]); > } > inputData->AddColumn(doubleArray); > } > > vtkSmartPointer kMeansStatistics = > vtkSmartPointer::New(); > > #if VTK_MAJOR_VERSION <= 5 > kMeansStatistics->SetInput(vtkStatisticsAlgorithm::INPUT_DATA, inputData); > #else > kMeansStatistics->SetInputData(vtkStatisticsAlgorithm::INPUT_DATA, > inputData); > #endif > kMeansStatistics->SetColumnStatus(inputData->GetColumnName(0), 1); > kMeansStatistics->SetColumnStatus(inputData->GetColumnName(1), 1); > kMeansStatistics->SetColumnStatus(inputData->GetColumnName(2), 1); > kMeansStatistics->RequestSelectedColumns(); > kMeansStatistics->SetAssessOption(true); > kMeansStatistics->SetDefaultNumberOfClusters(1); > //kMeansStatistics->SetMaxNumIterations(15); > kMeansStatistics->Update(); > > Thanks again. > > Regards, > Polly > ------------------------------ > *From:* Cory Quammen > *Sent:* Friday, November 9, 2018 10:07 PM > *To:* Polly Pui > *Cc:* vtkusers > *Subject:* Re: [vtkusers] Extract csv row and column into points > > vtkDelimitedTextReader -> vtkTableToPolyData is a pipeline that should > make this much simpler. > > On Fri, Nov 9, 2018 at 1:14 AM Polly Pui > wrote: > > Hi, > Is there any clue that i can extract the row and column data from a csv > file and read them as points? > Currently I am using vtkpoints to read points by inserting points > manually to my .cpp . > Is it possible for me to call the csv directly and read the data (eg. > column 3-5, row 2-10)? > > I attach my code here. > ...... > int main(int, char*[]) > { > > vtkSmartPointer points = > vtkSmartPointer::New(); > points->InsertNextPoint(8.4312, -36.489, -1500.7); > points->InsertNextPoint(8.8408, -37.726, -1500.4); > points->InsertNextPoint(11.372, -37.787, -1501.5); > points->InsertNextPoint(11.263, -36.384, -1501.9); > points->InsertNextPoint(9.3914, -40.819, -1500.8); > points->InsertNextPoint(11.685, -42.482, -1502.7); > points->InsertNextPoint(14.235, -38.096, -1503.5); > points->InsertNextPoint(13.972, -43.051, -1504.2); > points->InsertNextPoint(9.22, -43.904, -1504); > > vtkSmartPointer inputData = > vtkSmartPointer::New(); > for (int c = 0; c < 3; ++c) > { > std::stringstream colName; > colName << "coord " << c; > vtkSmartPointer doubleArray = > vtkSmartPointer::New(); > doubleArray->SetNumberOfComponents(1); > doubleArray->SetName(colName.str().c_str()); > doubleArray->SetNumberOfTuples(points->GetNumberOfPoints()); > > for (int r = 0; r < points->GetNumberOfPoints(); ++r) > { > double p[3]; > points->GetPoint(r, p); > doubleArray->SetValue(r, p[c]); > } > inputData->AddColumn(doubleArray); > } > > Thank you very much. > > Regards, > Polly > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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. > -- Cory Quammen Staff R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tavares at fe.up.pt Tue Nov 13 12:19:59 2018 From: tavares at fe.up.pt (=?utf-8?Q?=22Jo=C3=A3o_Manuel_R=2E_S=2E_Tavares=22?=) Date: Tue, 13 Nov 2018 17:19:59 +0000 Subject: [vtkusers] VipIMAGE 2019 - ANNOUNCEMENT & CALL FOR CONTRIBUTIONS References: Message-ID: <9B2336CF-297C-4100-8BC7-F7A85EC4E291@fe.up.pt> --------------------------------------------------------------------------------------------------- VII ECCOMAS Thematic Conference VipIMAGE 2019 www.fe.up.pt/vipimage October 16-18, 2019, Porto, Portugal Chairs: Jo?o Manuel R. S. Tavares & Renato Natal Jorge, Universidade do Porto --------------------------------------------------------------------------------------------------- Dear Colleague, We are pleased to announce the International Conference VipIMAGE 2019 - VII ECCOMAS THEMATIC CONFERENCE ON COMPUTATIONAL VISION AND MEDICAL IMAGE PROCESSING (www.fe.up.pt/vipimage) to be held in October 16-18, 2019, in Axis Vermar Conference & Beach Hotel, Porto, Portugal. Possible Topics (not limited to) - Signal and Image Processing - Computational Vision - Medical Imaging - Physics of Medical Imaging - Tracking and Analysis of Movement - Simulation and Modeling - Image Acquisition - Industrial Applications - Shape Reconstruction - Segmentation, Matching, Simulation - Data Interpolation, Registration, Acquisition and Compression - 3D Vision - Machine Learning, Deep Learning and Big Data - Virtual Reality - Visual Inspection - Software Development for Image Processing and Analysis - Computer Aided Diagnosis, Surgery, Therapy, and Treatment - Computational Bioimaging and Visualization - Telemedicine Systems and Applications Invited Lecturers - Aur?lio Campilho, Universidade do Porto, Portugal - Danail Stoyanov, University College London, UK - Daniela Iacoviello, Sapienza University of Rome, Italy - Jo?o Paulo Papa, Universidade Estadual de S?o Paulo, Brazil - Jos Vander Sloten, KU Leven, Netherlands - Wafa Skalli, Arts et M?tiers ParisTech, France Thematic Sessions Proposals to organize Thematic Sessions under the auspicious Proposals for Thematic Sessions should be submitted by email to the conference co-chairs (tavares at fe.up.pt, rnatal at fe.up.pt). Publications Proceedings: The proceedings book will be published by Springer under the book series "Lecture Notes in Computational Vision and Biomechanics" indexed by Elsevier Scopus. Journal Publication: A dedicated special issue of the Taylor & Francis international journal "Computer Methods in Biomechanics and Biomedical Engineering: Imaging & Visualization" indexed in Scopus, DBLP and Clarivate Analytics Emerging Sources Index will be published with extended versions of the best works presented in the conference. Springer Book: A book with invited works from the ones presented in the conference will be organized for publishing by Springer. Important Dates - Deadline for Thematic Session Proposals: January 31, 2019 - Deadline for Extended Abstracts: March 31, 2019 - Authors Notification: April 30, 2019 - Deadline for Papers: June 15, 2019 We are looking forward to see you in Porto in October, 2019, Jo?o Manuel R. S. Tavares Renato Natal Jorge (VipIMAGE 2019 co-chairs) For further details, please, have a look in the conferencewww.fe.up.pt/vipimage, the Facebook page at: www.facebook.com/ECCOMASVipIMAGE, or join the LinkedIn group at: www.linkedin.com/groups/4752820. -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthew.troke at avalonholographics.com Tue Nov 13 13:00:33 2018 From: matthew.troke at avalonholographics.com (Matthew Troke) Date: Tue, 13 Nov 2018 14:30:33 -0330 Subject: [vtkusers] Extending vtkOpenGLRenderer Message-ID: I am adding a new module to VTK that extends vtkOpenGLRenderer (let's call it vtkMyOpenGLRenderer). I would like to be able to use this in an application such that when I instantiate a vtkRenderer (such as with vtkRenderer::New()), it creates a vtkMyOpenGLRenderer. I'm not clear on the correct way to set this up via CMake. Do I need to create a new backend, or just enable the object factory? Matt -- Matthew Troke Software Engineer Office: 1-709-701-0239 Email: matthew.troke at avalonholographics.com -- _This email and any attachments are confidential and may be privileged. Any unauthorized use, disclosure, copying or distribution of the information received is prohibited. If you are not the intended recipient please contact the sender immediately by return email confirming that you have and will delete all communications related to the email and any attachments sent to you in error._ -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean at rogue-research.com Tue Nov 13 13:34:55 2018 From: sean at rogue-research.com (Sean McBride) Date: Tue, 13 Nov 2018 13:34:55 -0500 Subject: [vtkusers] Custom VTK Cocoa window flickers gray on new macOS In-Reply-To: <53C0B8F4-09DE-4215-B86F-519F3A89697F@gmail.com> References: <53C0B8F4-09DE-4215-B86F-519F3A89697F@gmail.com> Message-ID: <20181113183455.1754111005@mail.rogue-research.com> On Tue, 13 Nov 2018 12:11:33 +0100, Alessandro Volz said: >I am a contributor to the Horos project (the FOSS inherited from >OsiriX). In this project, we use VTK for the Volume Rendering window. >When I say 'custom', I mean that we assign our own NSView and NSWindow >to the vtkCocoaRenderWindow (through SetWindowId and SetRootWindow), and >initialize the vtkRenderWindowInteractor inside the first drawRect: call. > >With the latest macOS update we have this strange behavior in the VR >window. Somehow, the VTK render sometimes doesn't successfully get drawn >on screen: >- the window is initially gray >- when resizing, it flickers between gray and render >- when calling the underlying interactor, the resulting updated image is >rendered on screen (for example when rotating). > >Do you have any advice how to fix this? When you say new macOS, which do you mean? 10.14.1 vs 10.14? 10.14.x vs 10.13.x? Could you try to create a repro case based on the SimpleCocoaVTK example? Our usage of VTK is similar, but we haven't seen this issue. Cheers, -- ____________________________________________________________ Sean McBride, B. Eng sean at rogue-research.com Rogue Research www.rogue-research.com Mac Software Developer Montr?al, Qu?bec, Canada From dan.lipsa at kitware.com Tue Nov 13 13:27:37 2018 From: dan.lipsa at kitware.com (Dan Lipsa) Date: Tue, 13 Nov 2018 13:27:37 -0500 Subject: [vtkusers] Dan Lipsa October 18 Invoice Message-ID: <17468016083516020050.2067E38903C754D2@public.kitware.com> Dear Customer, Please find attached invoice for services provided during October. We look forward to receiving payment at your earliest convenience. Thank you and have a wonderful day! - Dan Lipsa 856-030-7442 / 856-030-7211 (fax) E:dan.lipsa at kitware.com -------------- next part -------------- A non-text attachment was scrubbed... Name: Invoice_No_U168103.doc Type: application/msword Size: 89472 bytes Desc: not available URL: From marcus.hanwell at kitware.com Tue Nov 13 13:52:32 2018 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Tue, 13 Nov 2018 13:52:32 -0500 Subject: [vtkusers] Extending vtkOpenGLRenderer In-Reply-To: References: Message-ID: On Tue, Nov 13, 2018 at 1:00 PM Matthew Troke < matthew.troke at avalonholographics.com> wrote: > I am adding a new module to VTK that extends vtkOpenGLRenderer (let's call > it vtkMyOpenGLRenderer). I would like to be able to use this in an > application such that when I instantiate a vtkRenderer (such as with > vtkRenderer::New()), it creates a vtkMyOpenGLRenderer. I'm not clear on the > correct way to set this up via CMake. Do I need to create a new backend, or > just enable the object factory? > This is really just a runtime thing, and you would achieve it by manipulating the object factory. All the CMake code does is ensure the appropriate calls are made before any of the classes are instantiated, as part of your application start up logic you would want to remove the standard vtkOpenGLRenderer override, and add your own. You don't even need this to be in a module, it just needs to derive from the vtkRenderer class so that it is possible to return a vtkRenderer pointer from the static ::New() method. Hope that makes sense, the entire object factory thing is runtime. We just added convenience functions in the form of defines passed into the build system, or calls you can add to your code that is compiled into your application somewhere. -------------- next part -------------- An HTML attachment was scrubbed... URL: From alessandro.volz at gmail.com Tue Nov 13 14:06:37 2018 From: alessandro.volz at gmail.com (Alessandro Volz) Date: Tue, 13 Nov 2018 20:06:37 +0100 Subject: [vtkusers] Custom VTK Cocoa window flickers gray on new macOS In-Reply-To: <20181113183455.1754111005@mail.rogue-research.com> References: <53C0B8F4-09DE-4215-B86F-519F3A89697F@gmail.com> <20181113183455.1754111005@mail.rogue-research.com> Message-ID: <0494C070-F4C7-476C-8DE1-AA440989F3CA@gmail.com> Hi, thanks for your reply, I mean, from 10.13 to 10.14, no change in 10.14.1. We also noticed this only happens when linking against the 10.14 SDK (Xcode 10.x) or with dark mode support enabled on Xcode 9.3.x (through the Info.plist). I can try reproduce, no guarantee. It?ll also take me a while to do, so if anyone has any pointers, please please :) Alessandro > On 13 Nov 2018, at 19:34, Sean McBride wrote: > > On Tue, 13 Nov 2018 12:11:33 +0100, Alessandro Volz said: > >> I am a contributor to the Horos project (the FOSS inherited from >> OsiriX). In this project, we use VTK for the Volume Rendering window. >> When I say 'custom', I mean that we assign our own NSView and NSWindow >> to the vtkCocoaRenderWindow (through SetWindowId and SetRootWindow), and >> initialize the vtkRenderWindowInteractor inside the first drawRect: call. >> >> With the latest macOS update we have this strange behavior in the VR >> window. Somehow, the VTK render sometimes doesn't successfully get drawn >> on screen: >> - the window is initially gray >> - when resizing, it flickers between gray and render >> - when calling the underlying interactor, the resulting updated image is >> rendered on screen (for example when rotating). >> >> Do you have any advice how to fix this? > > When you say new macOS, which do you mean? 10.14.1 vs 10.14? 10.14.x vs 10.13.x? > > Could you try to create a repro case based on the SimpleCocoaVTK example? > > Our usage of VTK is similar, but we haven't seen this issue. > > Cheers, > > -- > ____________________________________________________________ > Sean McBride, B. Eng sean at rogue-research.com > Rogue Research www.rogue-research.com > Mac Software Developer Montr?al, Qu?bec, Canada > > From matthew.troke at avalonholographics.com Tue Nov 13 14:10:20 2018 From: matthew.troke at avalonholographics.com (Matthew Troke) Date: Tue, 13 Nov 2018 15:40:20 -0330 Subject: [vtkusers] Extending vtkOpenGLRenderer In-Reply-To: References: Message-ID: What I don't understand is how does vtkRenderer::New() know what type of renderer to create? Normally, this would be a vtkOpenGLRenderer, so something must be telling VTK to override the class type with vtkOpenGLRenderer. How do I tell my application to create a vtkMyOpenGLRenderer instead? I don't know what you mean by "manipulate the object factory". Matt On Tue, Nov 13, 2018 at 3:22 PM Marcus D. Hanwell < marcus.hanwell at kitware.com> wrote: > On Tue, Nov 13, 2018 at 1:00 PM Matthew Troke < > matthew.troke at avalonholographics.com> wrote: > >> I am adding a new module to VTK that extends vtkOpenGLRenderer (let's >> call it vtkMyOpenGLRenderer). I would like to be able to use this in an >> application such that when I instantiate a vtkRenderer (such as with >> vtkRenderer::New()), it creates a vtkMyOpenGLRenderer. I'm not clear on the >> correct way to set this up via CMake. Do I need to create a new backend, or >> just enable the object factory? >> > > This is really just a runtime thing, and you would achieve it by > manipulating the object factory. All the CMake code does is ensure the > appropriate calls are made before any of the classes are instantiated, as > part of your application start up logic you would want to remove the > standard vtkOpenGLRenderer override, and add your own. You don't even need > this to be in a module, it just needs to derive from the vtkRenderer class > so that it is possible to return a vtkRenderer pointer from the static > ::New() method. > > Hope that makes sense, the entire object factory thing is runtime. We just > added convenience functions in the form of defines passed into the build > system, or calls you can add to your code that is compiled into your > application somewhere. > -- Matthew Troke Software Engineer Office: 1-709-701-0239 Email: matthew.troke at avalonholographics.com -- _This email and any attachments are confidential and may be privileged. Any unauthorized use, disclosure, copying or distribution of the information received is prohibited. If you are not the intended recipient please contact the sender immediately by return email confirming that you have and will delete all communications related to the email and any attachments sent to you in error._ -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthew.troke at avalonholographics.com Tue Nov 13 14:18:35 2018 From: matthew.troke at avalonholographics.com (Matthew Troke) Date: Tue, 13 Nov 2018 15:48:35 -0330 Subject: [vtkusers] Extending vtkOpenGLRenderer In-Reply-To: References: Message-ID: I think I've figured out that the abstract New() searches all registered object factories for an override. My question is if you have 2 modules with object factories that override the same base object, which one wins out? And can you ensure that a particular override gets chosen? On Tue, Nov 13, 2018 at 3:40 PM Matthew Troke < matthew.troke at avalonholographics.com> wrote: > What I don't understand is how does vtkRenderer::New() know what type of > renderer to create? Normally, this would be a vtkOpenGLRenderer, so > something must be telling VTK to override the class type with > vtkOpenGLRenderer. How do I tell my application to create a > vtkMyOpenGLRenderer instead? I don't know what you mean by "manipulate the > object factory". > > Matt > > On Tue, Nov 13, 2018 at 3:22 PM Marcus D. Hanwell < > marcus.hanwell at kitware.com> wrote: > >> On Tue, Nov 13, 2018 at 1:00 PM Matthew Troke < >> matthew.troke at avalonholographics.com> wrote: >> >>> I am adding a new module to VTK that extends vtkOpenGLRenderer (let's >>> call it vtkMyOpenGLRenderer). I would like to be able to use this in an >>> application such that when I instantiate a vtkRenderer (such as with >>> vtkRenderer::New()), it creates a vtkMyOpenGLRenderer. I'm not clear on the >>> correct way to set this up via CMake. Do I need to create a new backend, or >>> just enable the object factory? >>> >> >> This is really just a runtime thing, and you would achieve it by >> manipulating the object factory. All the CMake code does is ensure the >> appropriate calls are made before any of the classes are instantiated, as >> part of your application start up logic you would want to remove the >> standard vtkOpenGLRenderer override, and add your own. You don't even need >> this to be in a module, it just needs to derive from the vtkRenderer class >> so that it is possible to return a vtkRenderer pointer from the static >> ::New() method. >> >> Hope that makes sense, the entire object factory thing is runtime. We >> just added convenience functions in the form of defines passed into the >> build system, or calls you can add to your code that is compiled into your >> application somewhere. >> > > > -- > Matthew Troke > Software Engineer > Office: 1-709-701-0239 > Email: matthew.troke at avalonholographics.com > -- Matthew Troke Software Engineer Office: 1-709-701-0239 Email: matthew.troke at avalonholographics.com -- _This email and any attachments are confidential and may be privileged. Any unauthorized use, disclosure, copying or distribution of the information received is prohibited. If you are not the intended recipient please contact the sender immediately by return email confirming that you have and will delete all communications related to the email and any attachments sent to you in error._ -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcus.hanwell at kitware.com Tue Nov 13 15:34:54 2018 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Tue, 13 Nov 2018 15:34:54 -0500 Subject: [vtkusers] Extending vtkOpenGLRenderer In-Reply-To: References: Message-ID: On Tue, Nov 13, 2018 at 2:18 PM Matthew Troke < matthew.troke at avalonholographics.com> wrote: > I think I've figured out that the abstract New() searches all registered > object factories for an override. My question is if you have 2 modules with > object factories that override the same base object, which one wins out? > And can you ensure that a particular override gets chosen? > Take a look at https://github.com/Kitware/VTK/blob/master/Common/Core/Testing/Cxx/TestObjectFactory.cxx for the object factory in use, figuring out which override wins, etc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Andx_roo at live.com Tue Nov 13 19:39:59 2018 From: Andx_roo at live.com (Andaharoo) Date: Tue, 13 Nov 2018 17:39:59 -0700 (MST) Subject: [vtkusers] vtkRenderWindowInteractor() in addition to other kind of interactors In-Reply-To: <9FDBF2DB-015E-4490-84F2-FD90E27882A5@gmail.com> References: <1542012728242-0.post@n5.nabble.com> <9FDBF2DB-015E-4490-84F2-FD90E27882A5@gmail.com> Message-ID: <1542155999239-0.post@n5.nabble.com> I rarely write python so I'm not the best help. This doesn't have much to do with VTK this is just basic oop. I'd suggest reading/learning about it online. Here's the absolute simplest solution. If you simply want to hold a reference to the VideoCapture object in the class then create a variable of it in the class. I don't write python so excuse my example but it should get the idea across. Ex: class vtkTimerCallback(): cap = None # Create an empty reference to an object ... All the other stuff Then in the Python Animation example before starting the timer, right under "cb.actor = actor" you can add "cb.cap = cap" to give vtkTimerCallback a reference to the capture object. If you don't do this cb.cap will be None and not work. Note: In python objects are passed by reference so "_cap" will be a reference to "cap" after "=" operator. IE: It's the same object. NOT a copy. Both "_cap" and "cap" point to the same data. Also I'd recommend using vtkImageActor which is both a mapper and actor that directly takes vtkImageData for display on a 3d plane. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From masterwangzx at gmail.com Tue Nov 13 20:09:50 2018 From: masterwangzx at gmail.com (Franks) Date: Tue, 13 Nov 2018 18:09:50 -0700 (MST) Subject: [vtkusers] volume mapper error Message-ID: <1542157790625-0.post@n5.nabble.com> Hi, I want to test the volume mapper. I read the data from .vtk file and change its points attributes(vtkUnsignedCharArray with one component) to the vtkFloatArray with two components. Then I volume render it. But I get the "Segmentation fault". auto reader = vtkSmartPointer::New(); reader->SetFileName("../mummy.128.vtk"); reader->Update(); auto tuples = vtkSmartPointer::New(); tuples->DeepCopy(reader->GetOutput()->GetPointData()->GetScalars()); tuples->SetNumberOfComponents(2); for (int i = 0; i < tuples->GetNumberOfTuples(); ++i) { tuples->SetTuple2(i,80,80); } reader->GetOutput()->GetPointData()->RemoveArray(0); reader->GetOutput()->GetPointData()->SetScalars(tuples); auto volumeMapper = vtkSmartPointer::New(); volumeMapper->SetInputConnection(reader->GetOutputPort()); auto volumeProperty = vtkSmartPointer::New(); auto compositeOpacity = vtkSmartPointer::New(); compositeOpacity->AddPoint(40, 0.00); compositeOpacity->AddPoint(60, 0.40); volumeProperty->SetScalarOpacity(compositeOpacity); auto color = vtkSmartPointer::New(); color->AddRGBPoint(0.000, 0.00, 0.00, 0.00); color->AddRGBPoint(64.00, 1.00, 0.52, 0.30); volumeProperty->SetColor(color); auto volume = vtkSmartPointer::New(); volume->SetMapper(volumeMapper); volume->SetProperty(volumeProperty); auto ren = vtkSmartPointer::New(); ren->AddVolume(volume); ren->SetBackground(1, 1, 1); auto renWin = vtkSmartPointer::New(); renWin->AddRenderer(ren); auto style = vtkSmartPointer::New(); auto iren = vtkSmartPointer::New(); iren->SetRenderWindow(renWin); iren->SetInteractorStyle(style); iren->Initialize(); iren->Start(); Best regards Frank -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From anpedroni at gmail.com Wed Nov 14 03:17:56 2018 From: anpedroni at gmail.com (Andreas Pedroni) Date: Wed, 14 Nov 2018 09:17:56 +0100 Subject: [vtkusers] vtkRenderWindowInteractor() in addition to other kind of interactors In-Reply-To: <1542155999239-0.post@n5.nabble.com> References: <1542012728242-0.post@n5.nabble.com> <9FDBF2DB-015E-4490-84F2-FD90E27882A5@gmail.com> <1542155999239-0.post@n5.nabble.com> Message-ID: <6E5BDB62-2951-44A3-9727-952FEA7A5750@gmail.com> Hi, Thank you very much for the help. Indeed, I am not used to oop and I was a confused in the https://www.vtk.org/Wiki/VTK/Examples/Python/Animation that the ?actor? was not defined in class vtkTimerCallback. Best Andreas > Am 14.11.2018 um 01:39 schrieb Andaharoo : > > I rarely write python so I'm not the best help. This doesn't have much to do > with VTK this is just basic oop. I'd suggest reading/learning about it > online. Here's the absolute simplest solution. > > If you simply want to hold a reference to the VideoCapture object in the > class then create a variable of it in the class. I don't write python so > excuse my example but it should get the idea across. Ex: > > class vtkTimerCallback(): > cap = None # Create an empty reference to an object > ... All the other stuff > > Then in the Python Animation example before starting the timer, right under > "cb.actor = actor" you can add "cb.cap = cap" to give vtkTimerCallback a > reference to the capture object. If you don't do this cb.cap will be None > and not work. > > Note: In python objects are passed by reference so "_cap" will be a > reference to "cap" after "=" operator. IE: It's the same object. NOT a copy. > Both "_cap" and "cap" point to the same data. > > Also I'd recommend using vtkImageActor which is both a mapper and actor that > directly takes vtkImageData for display on a 3d plane. > > > > -- > 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 iamdpak at gmail.com Wed Nov 14 03:37:35 2018 From: iamdpak at gmail.com (vinmean) Date: Wed, 14 Nov 2018 01:37:35 -0700 (MST) Subject: [vtkusers] Overlapping texture on polydata Message-ID: <1542184655550-0.post@n5.nabble.com> I have a model imported from a ply file which has a texture. I want to overlap a small portion of this model with another texture. Is it possible to do this? Please direct me to examples if this can be done. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From pdhahn at compintensehpc.com Wed Nov 14 05:30:59 2018 From: pdhahn at compintensehpc.com (Paul Douglas Hahn) Date: Wed, 14 Nov 2018 04:30:59 -0600 Subject: [vtkusers] drawing with OpenGL primitives within Paint() in a sub-class of vtkContextItem Message-ID: <13a5d92e-a480-88d1-79f2-a91a6e9c3b50@compintensehpc.com> Does anyone know if it is feasible to call OpenGL2 primitives directly within the overridden Paint() method of a sub-class of vtkContextItem (i.e., as found in Rendering/Context2D)? I am using VTK 8.1 specifically. If so, is there an example somewhere? Thanks! -- From allison.vacanti at kitware.com Wed Nov 14 10:15:48 2018 From: allison.vacanti at kitware.com (Allie Vacanti) Date: Wed, 14 Nov 2018 10:15:48 -0500 Subject: [vtkusers] drawing with OpenGL primitives within Paint() in a sub-class of vtkContextItem In-Reply-To: <13a5d92e-a480-88d1-79f2-a91a6e9c3b50@compintensehpc.com> References: <13a5d92e-a480-88d1-79f2-a91a6e9c3b50@compintensehpc.com> Message-ID: There's nothing stopping you from doing this, but it is generally considered bad design. The ContextItems are expected to go through the Context2D painter interface, since that can draw to a variety of backends (PDF, SVG, etc) that aren't OpenGL. You'll lose the ability to have this flexibility when you bypass the painter. But if it's for a one-off application that doesn't care about other backends, it should be fine. Your best bet is have a look at the vtkOpenGLContextDevice2D source code and see the conventions it uses and try to match them within your item's Paint() method. HTH, Allie On Wed, Nov 14, 2018 at 6:09 AM Paul Douglas Hahn wrote: > Does anyone know if it is feasible to call OpenGL2 primitives directly > within the overridden Paint() method of a sub-class of vtkContextItem > (i.e., as found in Rendering/Context2D)? I am using VTK 8.1 specifically. > > If so, is there an example somewhere? > > 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 liuqinqing94 at gmail.com Wed Nov 14 10:41:53 2018 From: liuqinqing94 at gmail.com (Micro_Coconut) Date: Wed, 14 Nov 2018 08:41:53 -0700 (MST) Subject: [vtkusers] Remeshing using Octree Filter In-Reply-To: <00B22B68-A9CF-4A2A-9561-E305D5860EA9@icloud.com> References: <00B22B68-A9CF-4A2A-9561-E305D5860EA9@icloud.com> Message-ID: <1542210113049-0.post@n5.nabble.com> Hi, Could you please tell me how to do the visualization as your 1st picture shows? (Mesh/point cloud with Octree) Thank you! -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From sean at rogue-research.com Wed Nov 14 11:57:19 2018 From: sean at rogue-research.com (Sean McBride) Date: Wed, 14 Nov 2018 11:57:19 -0500 Subject: [vtkusers] Custom VTK Cocoa window flickers gray on new macOS In-Reply-To: <0494C070-F4C7-476C-8DE1-AA440989F3CA@gmail.com> References: <53C0B8F4-09DE-4215-B86F-519F3A89697F@gmail.com> <20181113183455.1754111005@mail.rogue-research.com> <0494C070-F4C7-476C-8DE1-AA440989F3CA@gmail.com> Message-ID: <20181114165719.536919287@mail.rogue-research.com> On Tue, 13 Nov 2018 20:06:37 +0100, Alessandro Volz said: >Hi, thanks for your reply, > >I mean, from 10.13 to 10.14, no change in 10.14.1. > >We also noticed this only happens when linking against the 10.14 SDK >(Xcode 10.x) or with dark mode support enabled on Xcode 9.3.x (through >the Info.plist). That being the case, it could be a macOS bug. No harm filing a ticket with Apple: >I can try reproduce, no guarantee. It?ll also take me a while to do, so >if anyone has any pointers, please please :) Did you try on various Mac models? Perhaps it's only with certain GPUs? Cheers, -- ____________________________________________________________ Sean McBride, B. Eng sean at rogue-research.com Rogue Research www.rogue-research.com Mac Software Developer Montr?al, Qu?bec, Canada From meakcey at gmail.com Wed Nov 14 18:54:13 2018 From: meakcey at gmail.com (meakcey) Date: Wed, 14 Nov 2018 16:54:13 -0700 (MST) Subject: [vtkusers] Highlight Picked Point Message-ID: <1542239653085-0.post@n5.nabble.com> Hi How can i extend Point Pick example to highlighted point pick. Something like combination of examples below: https://lorensen.github.io/VTKExamples/site/Cxx/Interaction/PointPicker/ https://lorensen.github.io/VTKExamples/site/Cxx/Picking/HighlightSelectedPoints/ Is there any direct way to reach point ids and properties and also setting properties by point picker? Thanks -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From abhishekworld at gmail.com Wed Nov 14 20:07:13 2018 From: abhishekworld at gmail.com (Abhishek) Date: Thu, 15 Nov 2018 12:07:13 +1100 Subject: [vtkusers] volume mapper error In-Reply-To: <1542157790625-0.post@n5.nabble.com> References: <1542157790625-0.post@n5.nabble.com> Message-ID: Hi Frank, I am not entirely sure but looking at the code looks like you have to do ren->AddViewProp(volume); instead of ren->AddVolume(volume); have a look at https://lorensen.github.io/VTKExamples/site/Cxx/Medical/MedicalDemo4/ Cheers, Abhishek On Wed, Nov 14, 2018 at 12:09 PM Franks wrote: > Hi, > I want to test the volume mapper. I read the data from .vtk file and change > its points attributes(vtkUnsignedCharArray with one component) to the > vtkFloatArray with two components. Then I volume render it. But I get the > "Segmentation fault". > > auto reader = vtkSmartPointer::New(); > reader->SetFileName("../mummy.128.vtk"); > reader->Update(); > > auto tuples = vtkSmartPointer::New(); > tuples->DeepCopy(reader->GetOutput()->GetPointData()->GetScalars()); > tuples->SetNumberOfComponents(2); > for (int i = 0; i < tuples->GetNumberOfTuples(); ++i) { > tuples->SetTuple2(i,80,80); > } > > reader->GetOutput()->GetPointData()->RemoveArray(0); > reader->GetOutput()->GetPointData()->SetScalars(tuples); > > auto volumeMapper = vtkSmartPointer::New(); > volumeMapper->SetInputConnection(reader->GetOutputPort()); > > auto volumeProperty = vtkSmartPointer::New(); > > auto compositeOpacity = vtkSmartPointer::New(); > compositeOpacity->AddPoint(40, 0.00); > compositeOpacity->AddPoint(60, 0.40); > volumeProperty->SetScalarOpacity(compositeOpacity); > > auto color = vtkSmartPointer::New(); > color->AddRGBPoint(0.000, 0.00, 0.00, 0.00); > color->AddRGBPoint(64.00, 1.00, 0.52, 0.30); > volumeProperty->SetColor(color); > > auto volume = vtkSmartPointer::New(); > volume->SetMapper(volumeMapper); > volume->SetProperty(volumeProperty); > > auto ren = vtkSmartPointer::New(); > ren->AddVolume(volume); > ren->SetBackground(1, 1, 1); > > auto renWin = vtkSmartPointer::New(); > renWin->AddRenderer(ren); > > auto style = vtkSmartPointer::New(); > auto iren = vtkSmartPointer::New(); > iren->SetRenderWindow(renWin); > iren->SetInteractorStyle(style); > > iren->Initialize(); > iren->Start(); > > Best regards > Frank > > > > -- > 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 > -- Abhishek http://zeroth.me -------------- next part -------------- An HTML attachment was scrubbed... URL: From masterwangzx at gmail.com Wed Nov 14 21:06:39 2018 From: masterwangzx at gmail.com (Franks) Date: Wed, 14 Nov 2018 19:06:39 -0700 (MST) Subject: [vtkusers] volume mapper error In-Reply-To: References: <1542157790625-0.post@n5.nabble.com> Message-ID: <1542247599632-0.post@n5.nabble.com> Hi Abhishek Thank you for getting back to me. I do what you said. But I still get the "SIGSEGV : Segmentation fault". Best regards Frank -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From karanovicm at gmail.com Wed Nov 14 22:32:56 2018 From: karanovicm at gmail.com (KM) Date: Wed, 14 Nov 2018 20:32:56 -0700 (MST) Subject: [vtkusers] Interesting issue with vtkBalloonWidget Message-ID: <1542252776127-0.post@n5.nabble.com> Hi All I have interesting problem with BalloonWidget which I'm using to show some info about displayed points in 3D space. On my desktop everything works as suppose, I hover the mouse on top of the point and balloon pops up. But on my laptop it pops up if point are displayed as spheres using the vtkSphereSource, but not if I chose to show them as a cube using the vtkCubeSource. I checked further and found that vtkConeSource doesn't work and vtkDiskSource does. I checked if BalloonWidget finds the actor using balloonWidget.GetCurrentProp() and function returns null; Again, everything works on my desktop, which doesn't make sense. Any direction is welcome. Not sure if that mothers, i'm using ActViz version 6.3 Thanks MK -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From abhishekworld at gmail.com Wed Nov 14 22:46:57 2018 From: abhishekworld at gmail.com (Abhishek) Date: Thu, 15 Nov 2018 14:46:57 +1100 Subject: [vtkusers] volume mapper error In-Reply-To: <1542247599632-0.post@n5.nabble.com> References: <1542157790625-0.post@n5.nabble.com> <1542247599632-0.post@n5.nabble.com> Message-ID: Sorry, Frank without the sample data I can't give you a better answer. On Thu, Nov 15, 2018 at 1:06 PM Franks wrote: > Hi Abhishek > > Thank you for getting back to me. I do what you said. But I still get the > "SIGSEGV : Segmentation fault". > > Best regards > Frank > > > > -- > 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 > -- Abhishek http://zeroth.me -------------- next part -------------- An HTML attachment was scrubbed... URL: From masterwangzx at gmail.com Wed Nov 14 23:18:51 2018 From: masterwangzx at gmail.com (Franks) Date: Wed, 14 Nov 2018 21:18:51 -0700 (MST) Subject: [vtkusers] volume mapper error In-Reply-To: References: <1542157790625-0.post@n5.nabble.com> <1542247599632-0.post@n5.nabble.com> Message-ID: <1542255531523-0.post@n5.nabble.com> mummy.vtk Sorry, I forget to upload the file. I used the VTK8. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From abhishekworld at gmail.com Thu Nov 15 00:20:19 2018 From: abhishekworld at gmail.com (Abhishek) Date: Thu, 15 Nov 2018 16:20:19 +1100 Subject: [vtkusers] volume mapper error In-Reply-To: <1542255531523-0.post@n5.nabble.com> References: <1542157790625-0.post@n5.nabble.com> <1542247599632-0.post@n5.nabble.com> <1542255531523-0.post@n5.nabble.com> Message-ID: Hi Frank, I tried running the program with your data. I am getting runtime error. Generic Warning: In /home/cellphylab/Code/Projects/VTK-8.1.1/Rendering/Volume/vtkRayCastImageDisplayHelper.cxx, line 20 Error: no override found for 'vtkRayCastImageDisplayHelper'. Any idea? On Thu, Nov 15, 2018 at 3:18 PM Franks wrote: > mummy.vtk > Sorry, I forget to upload the file. I used the VTK8. > > > > -- > 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 > -- Abhishek http://zeroth.me -------------- next part -------------- An HTML attachment was scrubbed... URL: From masterwangzx at gmail.com Thu Nov 15 00:34:43 2018 From: masterwangzx at gmail.com (Franks) Date: Wed, 14 Nov 2018 22:34:43 -0700 (MST) Subject: [vtkusers] volume mapper error In-Reply-To: References: <1542157790625-0.post@n5.nabble.com> <1542247599632-0.post@n5.nabble.com> <1542255531523-0.post@n5.nabble.com> Message-ID: <1542260083378-0.post@n5.nabble.com> I run the following program with my data and get no error. When I uncomment out the code, I get the error as I said before. #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include int main(int argc, char **argv) { auto reader = vtkSmartPointer::New(); reader->SetFileName("mummy.vtk"); reader->Update(); // auto tuples = vtkSmartPointer::New(); // tuples->DeepCopy(reader->GetOutput()->GetPointData()->GetScalars()); // tuples->SetNumberOfComponents(2); // for (int i = 0; i < tuples->GetNumberOfTuples(); ++i) { // tuples->SetTuple2(i,80,80); // } // // reader->GetOutput()->GetPointData()->RemoveArray(0); // reader->GetOutput()->GetPointData()->SetScalars(tuples); auto volumeMapper = vtkSmartPointer::New(); volumeMapper->SetInputConnection(reader->GetOutputPort()); auto volumeProperty = vtkSmartPointer::New(); auto compositeOpacity = vtkSmartPointer::New(); compositeOpacity->AddPoint(40, 0.00); compositeOpacity->AddPoint(60, 0.40); volumeProperty->SetScalarOpacity(compositeOpacity); auto color = vtkSmartPointer::New(); color->AddRGBPoint(0.000, 0.00, 0.00, 0.00); color->AddRGBPoint(64.00, 1.00, 0.52, 0.30); volumeProperty->SetColor(color); auto volume = vtkSmartPointer::New(); volume->SetMapper(volumeMapper); volume->SetProperty(volumeProperty); auto ren = vtkSmartPointer::New(); ren->AddViewProp(volume); ren->SetBackground(1, 1, 1); auto renWin = vtkSmartPointer::New(); renWin->AddRenderer(ren); auto style = vtkSmartPointer::New(); auto iren = vtkSmartPointer::New(); iren->SetRenderWindow(renWin); iren->SetInteractorStyle(style); iren->Initialize(); iren->Start(); return 0; } -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From polly_sukting at hotmail.com Thu Nov 15 01:25:59 2018 From: polly_sukting at hotmail.com (Polly Pui) Date: Thu, 15 Nov 2018 06:25:59 +0000 Subject: [vtkusers] Extract csv row and column into points In-Reply-To: References: , Message-ID: Hi Cory, Thanks for your reply. I edited my codes by following your advice. However, I am not able to visualize the point of cluster and got an error message. I have a few questions here. Is it possible to call VTK unstructured grid data into vtkKmeansStatistics? Actually what i wanted to do is very simple. I want to read my csv or vtk file and then cluster the points using kmeansclustering. Initially, I extracted points from csv file manually and I could get my desired output. But it is too time consuming. Currently, I want to input the csv or vtk file and get the cluster automatically and store in a datasheet. I attach my code as follows: #include #include "library.h" #include #include #include #include #include std::string inputFilename = argv[1]; vtkSmartPointer reader = vtkSmartPointer::New(); reader->SetFileName(inputFilename.c_str()); reader->SetFieldDelimiterCharacters(","); reader->DetectNumericColumnsOn(); reader->Update(); ///////KmeansCluster vtkSmartPointer kMeansStatistics = vtkSmartPointer::New(); kMeansStatistics->SetInputConnection(reader->GetOutputPort()); kMeansStatistics->SetColumnStatus("Column 3", 1); kMeansStatistics->SetColumnStatus("Column 4", 1); kMeansStatistics->SetColumnStatus("Column 5", 1); kMeansStatistics->RequestSelectedColumns(); kMeansStatistics->SetAssessOption(true); kMeansStatistics->SetDefaultNumberOfClusters(2); //kMeansStatistics->SetMaxNumIterations(15); kMeansStatistics->Update(); // Display the results in CMD (each row) kMeansStatistics->GetOutput()->Dump(); //Group the points according to ID number vtkSmartPointer clusterArray = vtkSmartPointer::New(); clusterArray->SetNumberOfComponents(1); clusterArray->SetName("ClusterId"); for (int r = 0; r < kMeansStatistics->GetOutput()->GetNumberOfRows(); r++) { vtkVariant v = kMeansStatistics->GetOutput()->GetValue(r, kMeansStatistics->GetOutput()->GetNumberOfColumns() - 1); std::cout << "Point " << r << " is in cluster " << v.ToInt() << std::endl; clusterArray->InsertNextValue(v.ToInt()); } // Create a lookup table to map cell data to colors vtkSmartPointer lut = vtkSmartPointer::New(); int tableSize = (kMeansStatistics + 1, 10); lut->SetNumberOfTableValues(tableSize); lut->Build(); //ColorCells vtkSmartPointer colors = vtkSmartPointer::New(); lut->SetTableValue(0, colors->GetColor4d("Black").GetData()); lut->SetTableValue(1, colors->GetColor4d("Banana").GetData()); lut->SetTableValue(2, colors->GetColor4d("Tomato").GetData()); lut->SetTableValue(3, colors->GetColor4d("Peacock").GetData()); lut->SetTableValue(4, colors->GetColor4d("Lavender").GetData()); lut->SetTableValue(5, colors->GetColor4d("Flesh").GetData()); lut->SetTableValue(6, colors->GetColor4d("Raspberry").GetData()); lut->SetTableValue(7, colors->GetColor4d("Salmon").GetData()); lut->SetTableValue(8, colors->GetColor4d("Mint").GetData()); lut->SetTableValue(9, colors->GetColor4d("Wheat").GetData()); // Output the cluster centers vtkMultiBlockDataSet* outputMetaDS = vtkMultiBlockDataSet::SafeDownCast(kMeansStatistics->GetOutputDataObject(vtkStatisticsAlgorithm::OUTPUT_MODEL)); vtkSmartPointer outputMeta = vtkTable::SafeDownCast(outputMetaDS->GetBlock(0)); //vtkSmartPointer outputMeta = vtkTable::SafeDownCast( outputMetaDS->GetBlock( 1 ) ); vtkDoubleArray* coord0 = vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("Column 0")); vtkDoubleArray* coord1 = vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("Column 1")); vtkDoubleArray* coord2 = vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("Column 2")); for (unsigned int i = 0; i < coord0->GetNumberOfTuples(); ++i) { std::cout << coord0->GetValue(i) << " " << coord1->GetValue(i) << " " << coord2->GetValue(i) << std::endl; } vtkSmartPointer polydata = vtkSmartPointer::New(); polydata->GetPointData()->SetScalars(clusterArray); vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(kMeansStatistics->GetOutputPort()); vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); actor->GetProperty()->SetPointSize(3); actor->GetProperty()->SetColor(1, 0, 0); vtkSmartPointer renderer = vtkSmartPointer::New(); vtkSmartPointer renderWindow = vtkSmartPointer::New(); renderWindow->AddRenderer(renderer); renderWindow->SetSize(640, 480); vtkSmartPointer renderWindowInteractor = vtkSmartPointer::New(); renderWindowInteractor->SetRenderWindow(renderWindow); renderer->AddActor(actor); renderer->SetBackground(0, 0, 0); // Background color black renderWindow->Render(); renderWindowInteractor->Start(); return EXIT_SUCCESS; } Thank you so much. Regards, Polly ________________________________ From: Cory Quammen Sent: Tuesday, November 13, 2018 11:34 PM To: Polly Pui Cc: vtkusers Subject: Re: [vtkusers] Extract csv row and column into points Ah, so you want to use the vtkKMeansStatistics filter. That filter operates on vtkTable data. To use it, you don't need to create points at all. Instead, you can connect the vtkDelimitedTextReader directly to the vtkKMeansStatistics filter like so: vtkSmartPointer kMeansStatistics = vtkSmartPointer::New(); kMeansStatistics->SetInputConnection(reader->GetOutputPort()); kMeansStatistics->SetColumnStatus("column1", 1); kMeansStatistics->SetColumnStatus("column2", 1); kMeansStatistics->SetColumnStatus("column3, 1); kMeansStatistics->RequestSelectedColumns(); kMeansStatistics->SetAssessOption(true); kMeansStatistics->SetDefaultNumberOfClusters(1); //kMeansStatistics->SetMaxNumIterations(15); kMeansStatistics->Update(); Here, I've altered your calls to SetColumnStatus() under the assumption you know the column names of interest. HTH, Cory On Fri, Nov 9, 2018 at 10:16 AM Polly Pui > wrote: Hi, Thanks for your reply. Is it possible to have more elaborations from you? How can I get the number of points from vtkTableToPolyData? I got an error saying that vtkTableToPolyData has no members of GetNumberOfPoints. I need those points to proceed to KmeansStatistics. This is my code: ...... std::string inputFilename = argv[1]; vtkSmartPointer reader = vtkSmartPointer::New(); reader->SetFileName(inputFilename.c_str()); reader->SetFieldDelimiterCharacters(" "); reader->DetectNumericColumnsOn(); reader->Update(); int numberOfRows = reader->GetOutput()->GetNumberOfRows(); vtkSmartPointer inputData = vtkSmartPointer::New(); inputData->SetInputConnection(reader->GetOutputPort); for (int c = 0; c < 3; ++c) { std::stringstream colName; colName << "coord " << c; vtkSmartPointer doubleArray = vtkSmartPointer::New(); doubleArray->SetNumberOfComponents(1); doubleArray->SetName(colName.str().c_str()); doubleArray->SetNumberOfTuples(inputData->GetNumberOfPoints()); for (int r = 0; r < inputData->GetNumberOfPoints(); ++r) { double p[3]; inputData->GetPoint(r, p); doubleArray->SetValue(r, p[c]); } inputData->AddColumn(doubleArray); } vtkSmartPointer kMeansStatistics = vtkSmartPointer::New(); #if VTK_MAJOR_VERSION <= 5 kMeansStatistics->SetInput(vtkStatisticsAlgorithm::INPUT_DATA, inputData); #else kMeansStatistics->SetInputData(vtkStatisticsAlgorithm::INPUT_DATA, inputData); #endif kMeansStatistics->SetColumnStatus(inputData->GetColumnName(0), 1); kMeansStatistics->SetColumnStatus(inputData->GetColumnName(1), 1); kMeansStatistics->SetColumnStatus(inputData->GetColumnName(2), 1); kMeansStatistics->RequestSelectedColumns(); kMeansStatistics->SetAssessOption(true); kMeansStatistics->SetDefaultNumberOfClusters(1); //kMeansStatistics->SetMaxNumIterations(15); kMeansStatistics->Update(); Thanks again. Regards, Polly ________________________________ From: Cory Quammen > Sent: Friday, November 9, 2018 10:07 PM To: Polly Pui Cc: vtkusers Subject: Re: [vtkusers] Extract csv row and column into points vtkDelimitedTextReader -> vtkTableToPolyData is a pipeline that should make this much simpler. On Fri, Nov 9, 2018 at 1:14 AM Polly Pui > wrote: Hi, Is there any clue that i can extract the row and column data from a csv file and read them as points? Currently I am using vtkpoints to read points by inserting points manually to my .cpp . Is it possible for me to call the csv directly and read the data (eg. column 3-5, row 2-10)? I attach my code here. ...... int main(int, char*[]) { vtkSmartPointer points = vtkSmartPointer::New(); points->InsertNextPoint(8.4312, -36.489, -1500.7); points->InsertNextPoint(8.8408, -37.726, -1500.4); points->InsertNextPoint(11.372, -37.787, -1501.5); points->InsertNextPoint(11.263, -36.384, -1501.9); points->InsertNextPoint(9.3914, -40.819, -1500.8); points->InsertNextPoint(11.685, -42.482, -1502.7); points->InsertNextPoint(14.235, -38.096, -1503.5); points->InsertNextPoint(13.972, -43.051, -1504.2); points->InsertNextPoint(9.22, -43.904, -1504); vtkSmartPointer inputData = vtkSmartPointer::New(); for (int c = 0; c < 3; ++c) { std::stringstream colName; colName << "coord " << c; vtkSmartPointer doubleArray = vtkSmartPointer::New(); doubleArray->SetNumberOfComponents(1); doubleArray->SetName(colName.str().c_str()); doubleArray->SetNumberOfTuples(points->GetNumberOfPoints()); for (int r = 0; r < points->GetNumberOfPoints(); ++r) { double p[3]; points->GetPoint(r, p); doubleArray->SetValue(r, p[c]); } inputData->AddColumn(doubleArray); } Thank you very much. Regards, Polly _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: 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. -- Cory Quammen Staff R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From abhishekworld at gmail.com Thu Nov 15 01:52:44 2018 From: abhishekworld at gmail.com (Abhishek) Date: Thu, 15 Nov 2018 17:52:44 +1100 Subject: [vtkusers] volume mapper error In-Reply-To: <1542260083378-0.post@n5.nabble.com> References: <1542157790625-0.post@n5.nabble.com> <1542247599632-0.post@n5.nabble.com> <1542255531523-0.post@n5.nabble.com> <1542260083378-0.post@n5.nabble.com> Message-ID: I am still getting the same error message. can you tell me which version of VTK are you using? On Thu, Nov 15, 2018 at 4:34 PM Franks wrote: > I run the following program with my data and get no error. When I uncomment > out the code, I get the error as I said before. > > > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > > > int main(int argc, char **argv) { > auto reader = vtkSmartPointer::New(); > reader->SetFileName("mummy.vtk"); > reader->Update(); > > // auto tuples = vtkSmartPointer::New(); > // tuples->DeepCopy(reader->GetOutput()->GetPointData()->GetScalars()); > // tuples->SetNumberOfComponents(2); > // for (int i = 0; i < tuples->GetNumberOfTuples(); ++i) { > // tuples->SetTuple2(i,80,80); > // } > // > // reader->GetOutput()->GetPointData()->RemoveArray(0); > // reader->GetOutput()->GetPointData()->SetScalars(tuples); > > auto volumeMapper = vtkSmartPointer::New(); > volumeMapper->SetInputConnection(reader->GetOutputPort()); > > auto volumeProperty = vtkSmartPointer::New(); > > auto compositeOpacity = vtkSmartPointer::New(); > compositeOpacity->AddPoint(40, 0.00); > compositeOpacity->AddPoint(60, 0.40); > volumeProperty->SetScalarOpacity(compositeOpacity); > > auto color = vtkSmartPointer::New(); > color->AddRGBPoint(0.000, 0.00, 0.00, 0.00); > color->AddRGBPoint(64.00, 1.00, 0.52, 0.30); > volumeProperty->SetColor(color); > > auto volume = vtkSmartPointer::New(); > volume->SetMapper(volumeMapper); > volume->SetProperty(volumeProperty); > > auto ren = vtkSmartPointer::New(); > ren->AddViewProp(volume); > ren->SetBackground(1, 1, 1); > > auto renWin = vtkSmartPointer::New(); > renWin->AddRenderer(ren); > > auto style = vtkSmartPointer::New(); > auto iren = vtkSmartPointer::New(); > iren->SetRenderWindow(renWin); > iren->SetInteractorStyle(style); > > iren->Initialize(); > iren->Start(); > > 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://public.kitware.com/mailman/listinfo/vtkusers > -- Abhishek http://zeroth.me -------------- next part -------------- An HTML attachment was scrubbed... URL: From masterwangzx at gmail.com Thu Nov 15 02:32:33 2018 From: masterwangzx at gmail.com (Franks) Date: Thu, 15 Nov 2018 00:32:33 -0700 (MST) Subject: [vtkusers] volume mapper error In-Reply-To: References: <1542157790625-0.post@n5.nabble.com> <1542247599632-0.post@n5.nabble.com> <1542255531523-0.post@n5.nabble.com> <1542260083378-0.post@n5.nabble.com> Message-ID: <1542267153689-0.post@n5.nabble.com> I am using VTK8.1.1 on arch linux. I don't know much about your problem since I am the beginner of the VTK. I hope my following suggestion would be beneficial for you. 1. Do you link all required libraries? "vtkSmartVolumeMapper" will call "vtkOpenGLGPUVolumeRayCastMapper ". Here is my CmakeLists.txt cmake_minimum_required(VERSION 3.12) project(test) set(CMAKE_CXX_STANDARD 11) #vtk # the root to find Config set(VTK_ROOT /opt/VTK/DEBUG) find_package(VTK REQUIRED) include(${VTK_USE_FILE}) add_executable(${PROJECT_NAME} main.cpp) target_link_libraries(${PROJECT_NAME} ${VTK_LIBRARIES}) 2. this link may help you. http://vtk.1045678.n5.nabble.com/Error-no-override-found-for-vtkRayCastImageDisplayHelper-td5735445.html -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From rccm.kyoshimi at gmail.com Thu Nov 15 06:57:19 2018 From: rccm.kyoshimi at gmail.com (kenichiro yoshimi) Date: Thu, 15 Nov 2018 20:57:19 +0900 Subject: [vtkusers] Highlight Picked Point In-Reply-To: <1542239653085-0.post@n5.nabble.com> References: <1542239653085-0.post@n5.nabble.com> Message-ID: Hi, The following code highlights a picked point tentatively, although I don't know if this is really a formal and correct way of using vtk. ------- #include #include #include #include #include #include #include #include #include #include #include #include #include // Define interaction style class MouseInteractorStylePP : public vtkInteractorStyleTrackballCamera { public: static MouseInteractorStylePP* New(); vtkTypeMacro(MouseInteractorStylePP, vtkInteractorStyleTrackballCamera); MouseInteractorStylePP() { this->PointPicker = vtkSmartPointer::New(); // Setup ghost glyph vtkSmartPointer points = vtkSmartPointer::New(); points->InsertNextPoint(0,0,0); this->SelectedPolyData = vtkSmartPointer::New(); this->SelectedPolyData->SetPoints(points); this->SelectedGlyphFilter = vtkSmartPointer::New(); #if VTK_MAJOR_VERSION <= 5 this->SelectedGlyphFilter->SetInputConnection( this->SelectedPolyData->GetProducerPort()); #else this->SelectedGlyphFilter->SetInputData(this->SelectedPolyData); #endif this->SelectedGlyphFilter->Update(); this->SelectedMapper = vtkSmartPointer::New(); this->SelectedMapper->SetInputConnection(this->SelectedGlyphFilter->GetOutputPort()); this->SelectedActor = vtkSmartPointer::New(); this->SelectedActor->SetMapper(SelectedMapper); this->SelectedActor->VisibilityOff(); this->SelectedActor->GetProperty()->SetPointSize(10); this->SelectedActor->GetProperty()->SetColor(1,0,0); } virtual void OnLeftButtonDown() { // Forward events vtkInteractorStyleTrackballCamera::OnLeftButtonDown(); // Get the selected point int x = this->Interactor->GetEventPosition()[0]; int y = this->Interactor->GetEventPosition()[1]; this->FindPokedRenderer(x, y); std::cout << "Picking pixel: " << this->Interactor->GetEventPosition()[0] << " " << this->Interactor->GetEventPosition()[1] << std::endl; this->PointPicker->Pick(this->Interactor->GetEventPosition()[0], this->Interactor->GetEventPosition()[1], 0, // always zero. this->Interactor->GetRenderWindow()->GetRenderers()->GetFirstRenderer()); if (this->PointPicker->GetPointId() >= 0) { this->SelectedActor->VisibilityOn(); this->HighlightProp(NULL); this->SelectedPoint = this->PointPicker->GetPointId(); double p[3]; this->Points->GetPoint(this->SelectedPoint, p); this->SelectedActor->SetPosition(p); this->GetCurrentRenderer()->AddActor(this->SelectedActor); } } void SetPoints(vtkSmartPointer points) {this->Points = points;} private: vtkSmartPointer Points; vtkSmartPointer PointPicker; vtkSmartPointer SelectedActor; vtkSmartPointer SelectedMapper; vtkSmartPointer SelectedPolyData; vtkSmartPointer SelectedGlyphFilter; vtkIdType SelectedPoint; }; vtkStandardNewMacro(MouseInteractorStylePP); int main(int, char *[]) { vtkSmartPointer sphereSource = vtkSmartPointer::New(); sphereSource->Update(); vtkSmartPointer pointPicker = vtkSmartPointer::New(); vtkSmartPointer points = vtkSmartPointer::New(); points->SetPoints(sphereSource->GetOutput()->GetPoints()); // Create a mapper and actor vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(sphereSource->GetOutputPort()); vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); actor->GetProperty()->EdgeVisibilityOn(); // Create a renderer, render window, and interactor vtkSmartPointer renderer = vtkSmartPointer::New(); vtkSmartPointer renderWindow = vtkSmartPointer::New(); renderWindow->AddRenderer(renderer); vtkSmartPointer renderWindowInteractor = vtkSmartPointer::New(); renderWindowInteractor->SetPicker(pointPicker); renderWindowInteractor->SetRenderWindow(renderWindow); vtkSmartPointer style = vtkSmartPointer::New(); style->SetPoints(points); renderWindowInteractor->SetInteractorStyle( style ); // Add the actor to the scene renderer->AddActor(actor); renderer->SetBackground(1,1,1); // Background color white // Render and interact renderWindow->Render(); renderWindowInteractor->Start(); return EXIT_SUCCESS; } ----- Hope that helps 2018?11?15?(?) 8:54 meakcey : > > Hi > How can i extend Point Pick example to highlighted point pick. Something > like combination of examples below: > https://lorensen.github.io/VTKExamples/site/Cxx/Interaction/PointPicker/ > https://lorensen.github.io/VTKExamples/site/Cxx/Picking/HighlightSelectedPoints/ > > Is there any direct way to reach point ids and properties and also setting > properties by point picker? > 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 From piotrek.konarski1 at gmail.com Thu Nov 15 15:52:55 2018 From: piotrek.konarski1 at gmail.com (Piotrek Konarski) Date: Thu, 15 Nov 2018 21:52:55 +0100 Subject: [vtkusers] Rendering, cannot get rid of hidden edges Message-ID: Hello I try to write a python script to plot unstructured grid data. Everything goes fine except for rendering. VTK renders mesh edges that should be normally invisible. Those edges disappear when I click on the interactor window which rotates the plotted object. No matter if I use an interactor, render a widow or save a screenshot to a file without rendering a window the result is always the same, the edges are visible. I attach files to illustrate the problem. I use VTK 8.1.1 on Fedora linux. Any ideas? Regards, Piotr -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: after.png Type: image/png Size: 43777 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: before.png Type: image/png Size: 52148 bytes Desc: not available URL: From sankhesh.jhaveri at kitware.com Thu Nov 15 16:19:23 2018 From: sankhesh.jhaveri at kitware.com (Sankhesh Jhaveri) Date: Thu, 15 Nov 2018 16:19:23 -0500 Subject: [vtkusers] volume mapper error In-Reply-To: <1542267153689-0.post@n5.nabble.com> References: <1542157790625-0.post@n5.nabble.com> <1542247599632-0.post@n5.nabble.com> <1542255531523-0.post@n5.nabble.com> <1542260083378-0.post@n5.nabble.com> <1542267153689-0.post@n5.nabble.com> Message-ID: Hi Franks, My guess is the issue lies in the RemoveArray(0) call. Mind posting the backtrace? Thanks, Sankhesh ? On Thu, Nov 15, 2018 at 2:32 AM Franks wrote: > I am using VTK8.1.1 on arch linux. I don't know much about your problem > since > I am the beginner of the VTK. I hope my following suggestion would be > beneficial for you. > > 1. Do you link all required libraries? "vtkSmartVolumeMapper" will call > "vtkOpenGLGPUVolumeRayCastMapper ". Here is my CmakeLists.txt > > cmake_minimum_required(VERSION 3.12) > project(test) > > set(CMAKE_CXX_STANDARD 11) > > #vtk > # the root to find Config > set(VTK_ROOT /opt/VTK/DEBUG) > find_package(VTK REQUIRED) > include(${VTK_USE_FILE}) > > add_executable(${PROJECT_NAME} main.cpp) > target_link_libraries(${PROJECT_NAME} ${VTK_LIBRARIES}) > > 2. this link may help you. > > http://vtk.1045678.n5.nabble.com/Error-no-override-found-for-vtkRayCastImageDisplayHelper-td5735445.html > < > http://vtk.1045678.n5.nabble.com/Error-no-override-found-for-vtkRayCastImageDisplayHelper-td5735445.html> > > > > > -- > 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 masterwangzx at gmail.com Thu Nov 15 20:18:23 2018 From: masterwangzx at gmail.com (Franks) Date: Thu, 15 Nov 2018 18:18:23 -0700 (MST) Subject: [vtkusers] volume mapper error In-Reply-To: References: <1542157790625-0.post@n5.nabble.com> <1542247599632-0.post@n5.nabble.com> <1542255531523-0.post@n5.nabble.com> <1542260083378-0.post@n5.nabble.com> <1542267153689-0.post@n5.nabble.com> Message-ID: <1542331103569-0.post@n5.nabble.com> 1. When I commet out the the line of 'RemoveArray(0)', I still get the problem. When I change number of NumberOfComponents to 1, I get no error. Why the mapper can not handle with the two-components data? The following code can run with no error. auto tuples = vtkSmartPointer::New(); tuples->DeepCopy(reader->GetOutput()->GetPointData()->GetScalars()); tuples->SetNumberOfComponents(1); for (int i = 0; i < tuples->GetNumberOfTuples(); ++i) { tuples->SetTuple1(i,80); } reader->GetOutput()->GetPointData()->RemoveArray(0); reader->GetOutput()->GetPointData()->SetScalars(tuples); 2. I am the beginner. I ?can not understand the meaning of backtrace well. The console only print "Signal: SIGSEGV (Segmentation fault)" and the clion debugger display the following picture. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From sean at rogue-research.com Fri Nov 16 10:34:22 2018 From: sean at rogue-research.com (Sean McBride) Date: Fri, 16 Nov 2018 10:34:22 -0500 Subject: [vtkusers] Custom VTK Cocoa window flickers gray on new macOS In-Reply-To: <0494C070-F4C7-476C-8DE1-AA440989F3CA@gmail.com> References: <53C0B8F4-09DE-4215-B86F-519F3A89697F@gmail.com> <20181113183455.1754111005@mail.rogue-research.com> <0494C070-F4C7-476C-8DE1-AA440989F3CA@gmail.com> Message-ID: <20181116153422.1426165175@mail.rogue-research.com> On Tue, 13 Nov 2018 20:06:37 +0100, Alessandro Volz said: >I mean, from 10.13 to 10.14, no change in 10.14.1. > >We also noticed this only happens when linking against the 10.14 SDK >(Xcode 10.x) or with dark mode support enabled on Xcode 9.3.x (through >the Info.plist). > >I can try reproduce, no guarantee. It?ll also take me a while to do, so >if anyone has any pointers, please please :) Another thought: do any of VTK's existing unit tests exhibit the problem? Cheers, -- ____________________________________________________________ Sean McBride, B. Eng sean at rogue-research.com Rogue Research www.rogue-research.com Mac Software Developer Montr?al, Qu?bec, Canada From trinian.gordon at outlook.com Fri Nov 16 16:28:15 2018 From: trinian.gordon at outlook.com (Trinian Gordon) Date: Fri, 16 Nov 2018 21:28:15 +0000 Subject: [vtkusers] How to configure cmake to include /Accelerators/Vtkm classes Message-ID: Hello, I have read that it is possible to include a select number of VTKm classes into a VTK pipeline. I see that there are a few of those classes included in the vtk repository under /Accelerators/Vtkm, but are not found by cmake. How do I build VTK so I can use the VTKm filters? Building vtk with the cmake gui, changing only the basic options for output filepaths and using TBB for the VTK_SMP_IMPLEMENTATION_TYPE works fine. When I try to use the accelerators, they appear to be missing from my build. Thanks, Trinian -------------- next part -------------- An HTML attachment was scrubbed... URL: From alessandro.volz at gmail.com Fri Nov 16 16:52:11 2018 From: alessandro.volz at gmail.com (Alessandro Volz) Date: Fri, 16 Nov 2018 22:52:11 +0100 Subject: [vtkusers] Custom VTK Cocoa window flickers gray on new macOS In-Reply-To: <20181116153422.1426165175@mail.rogue-research.com> References: <53C0B8F4-09DE-4215-B86F-519F3A89697F@gmail.com> <20181113183455.1754111005@mail.rogue-research.com> <0494C070-F4C7-476C-8DE1-AA440989F3CA@gmail.com> <20181116153422.1426165175@mail.rogue-research.com> Message-ID: Hi again, I actually came around and got the SimpleCocoaVTK example to build against my VTK libs. Is it supposed to just show a gray window with two "Do Something" buttons? I suppose not. So, chances are, I'm building VTK the wrong way. Here is my CMake: cmake /Users/ale/Work/VTK -DVTK_USE_X:BOOL=OFF -DVTK_USE_COCOA:BOOL=ON -DBUILD_DOCUMENTATION=OFF -DBUILD_EXAMPLES=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 -DCMAKE_OSX_ARCHITECTURES=x86_64 -DVTK_Group_StandAlone=OFF -DVTK_Group_Rendering=OFF -DModule_vtkIOImage=ON -DModule_vtkFiltersGeneral=ON -DModule_vtkImagingMorphological=ON -DModule_vtkImagingStencil=ON -DModule_vtkRenderingOpenGL2=ON -DModule_vtkRenderingVolumeOpenGL2=ON -DModule_vtkRenderingAnnotation=ON -DModule_vtkInteractionWidgets=ON -DModule_vtkIOGeometry=ON -DModule_vtkIOExport=ON -DModule_vtkFiltersTexture=ON -DModule_vtktiff=ON -DVTK_USE_SYSTEM_ZLIB:BOOL=ON -DVTK_USE_SYSTEM_EXPAT=ON -DVTK_USE_SYSTEM_LIBXML2=ON -DCMAKE_INSTALL_PREFIX=/Users/ale/Work/VTK-Install -DVTK_INSTALL_INCLUDE_DIR=include '-DCMAKE_CXX_FLAGS=-w -fvisibility=default -stdlib=libc++ -std=c++0x' Do you see anything suspicious? Could you build the SimpleCocoaVTK on your mac, zip it up and send it to me, to test if the problem is at hardware level or at build level? Best, Alessandro > On Nov 16, 2018, at 4:34 PM, Sean McBride wrote: > > On Tue, 13 Nov 2018 20:06:37 +0100, Alessandro Volz said: > >> I mean, from 10.13 to 10.14, no change in 10.14.1. >> >> We also noticed this only happens when linking against the 10.14 SDK >> (Xcode 10.x) or with dark mode support enabled on Xcode 9.3.x (through >> the Info.plist). >> >> I can try reproduce, no guarantee. It?ll also take me a while to do, so >> if anyone has any pointers, please please :) > > Another thought: do any of VTK's existing unit tests exhibit the problem? > > Cheers, > > -- > ____________________________________________________________ > Sean McBride, B. Eng sean at rogue-research.com > Rogue Research www.rogue-research.com > Mac Software Developer Montr?al, Qu?bec, Canada -------------- next part -------------- An HTML attachment was scrubbed... URL: From yang_jiao at brown.edu Fri Nov 16 23:43:58 2018 From: yang_jiao at brown.edu (Yang Jiao) Date: Fri, 16 Nov 2018 21:43:58 -0700 (MST) Subject: [vtkusers] "missing: DOXYGEN_EXECUTABLE" error while installing VTK Message-ID: <1542429838976-0.post@n5.nabble.com> Hi, I am installing VTK-8.1.2 using CMake and I got an error message from CMake saying that Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE). I have seen a previous post which said the reason is BUILD_DOCUMENTATION configuration. However, I looked through my CMake configurations and found there was not a configuration called "BUILD_DOCUMENTATION". I even added a "BUILD_DOCUMENTATION" entry manually and set it as unchecked, but it did not work. My operation system is Windows 10 1803 and the current generator is Visual Studio 15 2017. Do you have any ideas on how to solve this? Thanks, Yang -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From leonid_dulman at yahoo.co.uk Sat Nov 17 01:28:51 2018 From: leonid_dulman at yahoo.co.uk (Leonid Dulman) Date: Sat, 17 Nov 2018 06:28:51 +0000 (UTC) Subject: [vtkusers] Build VTK 8.2.0 in Windows with VS 2017 (15.9) References: <702003951.3224995.1542436131221.ref@mail.yahoo.com> Message-ID: <702003951.3224995.1542436131221@mail.yahoo.com> Hi to allI can not to configure CMAKE to build VTK-8.2 with Visual Studio 2017 (last update 15.9)?I have? got next message CMake Error at CMakeLists.txt:7 (project): Failed to run MSBuild command: MSBuild.exe to get the value of VCTargetsPath:?can not found this file Thank you for any help. Leonid -------------- next part -------------- An HTML attachment was scrubbed... URL: From alessandro.volz at gmail.com Sat Nov 17 07:47:54 2018 From: alessandro.volz at gmail.com (Alessandro Volz) Date: Sat, 17 Nov 2018 13:47:54 +0100 Subject: [vtkusers] Custom VTK Cocoa window flickers gray on new macOS In-Reply-To: References: <53C0B8F4-09DE-4215-B86F-519F3A89697F@gmail.com> <20181113183455.1754111005@mail.rogue-research.com> <0494C070-F4C7-476C-8DE1-AA440989F3CA@gmail.com> <20181116153422.1426165175@mail.rogue-research.com> Message-ID: After some off-list exchanges, I want to get this thread back on the mailing list. There is indeed a problem that also comes up with the SimpleCocoaVTK sample project. In Mojave, when built using the 10.14 SDK, SimpleCocoaVTK opens without displaying the rendered images. Interacting with the view displays the results. If you modify the project so the views are resized along with the window, the problem gets worse. When resizing, the render will flicker while resizing, and the result after resizing will depend on the latest state. Generally speaking, it seems to me, it works until you call [MyVTKView setNeedsDisplay:YES] or [MyVTKView display]. I also feel like this problem has something to do with double buffering, but I haven't gotten around it. This thread suggests a solution: https://stackoverflow.com/questions/52938516/opengl-not-rendering-on-macos-mojave But that doesn't fix it for us. However, it explains the changes that are probably causing the problem. Other OpenGL-on-Mojave-related threads I found suggest calling [NSOpenGLContext update] at the right moments to fix it. I've tried, I've failed. Any suggestions? Thanks, Alessandro > On Nov 16, 2018, at 10:52 PM, Alessandro Volz wrote: > > Hi again, > > I actually came around and got the SimpleCocoaVTK example to build against my VTK libs. > > Is it supposed to just show a gray window with two "Do Something" buttons? I suppose not. > > So, chances are, I'm building VTK the wrong way. Here is my CMake: > > cmake /Users/ale/Work/VTK -DVTK_USE_X:BOOL=OFF -DVTK_USE_COCOA:BOOL=ON -DBUILD_DOCUMENTATION=OFF -DBUILD_EXAMPLES=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 -DCMAKE_OSX_ARCHITECTURES=x86_64 -DVTK_Group_StandAlone=OFF -DVTK_Group_Rendering=OFF -DModule_vtkIOImage=ON -DModule_vtkFiltersGeneral=ON -DModule_vtkImagingMorphological=ON -DModule_vtkImagingStencil=ON -DModule_vtkRenderingOpenGL2=ON -DModule_vtkRenderingVolumeOpenGL2=ON -DModule_vtkRenderingAnnotation=ON -DModule_vtkInteractionWidgets=ON -DModule_vtkIOGeometry=ON -DModule_vtkIOExport=ON -DModule_vtkFiltersTexture=ON -DModule_vtktiff=ON -DVTK_USE_SYSTEM_ZLIB:BOOL=ON -DVTK_USE_SYSTEM_EXPAT=ON -DVTK_USE_SYSTEM_LIBXML2=ON -DCMAKE_INSTALL_PREFIX=/Users/ale/Work/VTK-Install -DVTK_INSTALL_INCLUDE_DIR=include '-DCMAKE_CXX_FLAGS=-w -fvisibility=default -stdlib=libc++ -std=c++0x' > > Do you see anything suspicious? > > Could you build the SimpleCocoaVTK on your mac, zip it up and send it to me, to test if the problem is at hardware level or at build level? > > Best, > > Alessandro > >> On Nov 16, 2018, at 4:34 PM, Sean McBride > wrote: >> >> On Tue, 13 Nov 2018 20:06:37 +0100, Alessandro Volz said: >> >>> I mean, from 10.13 to 10.14, no change in 10.14.1. >>> >>> We also noticed this only happens when linking against the 10.14 SDK >>> (Xcode 10.x) or with dark mode support enabled on Xcode 9.3.x (through >>> the Info.plist). >>> >>> I can try reproduce, no guarantee. It?ll also take me a while to do, so >>> if anyone has any pointers, please please :) >> >> Another thought: do any of VTK's existing unit tests exhibit the problem? >> >> Cheers, >> >> -- >> ____________________________________________________________ >> Sean McBride, B. Eng sean at rogue-research.com >> Rogue Research www.rogue-research.com >> Mac Software Developer Montr?al, Qu?bec, Canada > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.musy at gmail.com Sat Nov 17 08:39:55 2018 From: marco.musy at gmail.com (mmusy) Date: Sat, 17 Nov 2018 06:39:55 -0700 (MST) Subject: [vtkusers] VTK python module for analysis and simulations Message-ID: <1542461995694-0.post@n5.nabble.com> Hi I recently wrote a python module which I think it makes a lot of frequent operations easier and help exploiting the full power of vtk without hiding access to native vtk objects: https://github.com/marcomusy/vtkplotter It includes more than 70 example scripts to perform basic functions and a bit more advanced analyses and simulations. Far from being perfect or complete I hope it may turn out useful to the vtk community. Any feedback/suggestion from vtk experts and users is surely very welcome. Regards -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From flagada15 at gmail.com Sat Nov 17 14:20:32 2018 From: flagada15 at gmail.com (Flagada) Date: Sat, 17 Nov 2018 20:20:32 +0100 Subject: [vtkusers] Animation performance with cell color Message-ID: Hi all ! I am trying to animate a mesh deformation with quite a large number of nodes (about 300000). For now the best solution I have found is to make a list containing the vtkpoints for each animation frame and loop by changing the vtkpoints of the displayed polydata (or unstructuredgrid). On a simple model without applying any color to the cells I can obtain an animation rate of about 50fps wich is a good frame rate for me. But if I apply colors with a PolyData.GetCellData().SetScalars() the framerate goes down to 13fps. Does anybody knows if it could be a better method to display mesh animation or to improve the display rate of a mesh with colors ? Here below is the python code I use. It draws a disk of 800x400 nodes and if you press on F1 it animates a kind of sinus wave. First it calculate each frame, then it display the animation without color and finally it display the animation with random color on cells. Thanks ! ############################ import vtk import math from time import time import random ############################ # Creating disk mesh disk = vtk.vtkDiskSource() disk.SetInnerRadius(0.1) disk.SetOuterRadius(2.0) disk.SetRadialResolution(400) disk.SetCircumferentialResolution(800) disk.Update() PolyData = disk.GetOutput() print("%d nodes" % PolyData.GetNumberOfPoints()) print("%d elms" % PolyData.GetNumberOfCells()) # Setup actor and mapper mapper = vtk.vtkPolyDataMapper() mapper.SetInputData(PolyData) actor = vtk.vtkActor() actor.SetMapper(mapper) # Setup render window, renderer, interactor and camera renderer = vtk.vtkRenderer() renderWindow = vtk.vtkRenderWindow() renderWindow.AddRenderer(renderer) renderWindowInteractor = vtk.vtkRenderWindowInteractor() renderWindowInteractor.SetRenderWindow(renderWindow) style = vtk.vtkInteractorStyleTrackballCamera() renderWindowInteractor.SetInteractorStyle(style) camera = vtk.vtkCamera() camera.Elevation(-45) renderer.SetActiveCamera(camera) ################################# def KeyPress(object, event): if object.GetInteractor().GetKeySym() == "F1": # Calculate each frame and store the vtkPoints into vtkPointsList PolyData = disk.GetOutput() vtkPointsList = {} print("Calculate...") for ph in range(0, 360, 20): start_time = time() vtkPointsList[ph] = vtk.vtkPoints() vtkPointsList[ph].DeepCopy(PolyData.GetPoints()) for i in range(0, PolyData.GetNumberOfPoints()): NodePos = vtkPointsList[ph].GetPoint(i) vtkPointsList[ph].SetPoint(i, NodePos[0], NodePos[1], 0.3 * math.sin(NodePos[0] * 2 + ph * math.pi / 180)) PolyData.SetPoints(vtkPointsList[ph]) renderWindow.Render() print("Done. Animate.") # First animation without color start_time = time() for ph in range(0, 360, 20): PolyData.SetPoints(vtkPointsList[ph]) renderWindow.Render() print("%.2f FPS" % (18 / (time() - start_time))) # Activate cells colors ELMcolors = vtk.vtkUnsignedCharArray() ELMcolors.SetNumberOfComponents(3) ELMcolors.SetName("Colors") for i in range(0, PolyData.GetNumberOfCells()): ELMcolors.InsertNextTuple([random.random() * 255, random.random() * 255, random.random() * 255]) PolyData.GetCellData().SetScalars(ELMcolors) # Second animation with color start_time = time() for ph in range(0, 360, 20): PolyData.SetPoints(vtkPointsList[ph]) renderWindow.Render() print("%.2f FPS" % (18 / (time() - start_time))) #################################### style.AddObserver("KeyPressEvent", KeyPress) renderer.AddActor(actor) renderWindow.Render() renderer.ResetCamera() renderWindowInteractor.Start() ############################ -------------- next part -------------- An HTML attachment was scrubbed... URL: From yang_jiao at brown.edu Sat Nov 17 15:38:11 2018 From: yang_jiao at brown.edu (Yang Jiao) Date: Sat, 17 Nov 2018 13:38:11 -0700 (MST) Subject: [vtkusers] "missing: DOXYGEN_EXECUTABLE" error while installing VTK In-Reply-To: <1542429838976-0.post@n5.nabble.com> References: <1542429838976-0.post@n5.nabble.com> Message-ID: <1542487091272-0.post@n5.nabble.com> Problem solved. Need to check the "Advanced" box then unchecked the "BUILD_DOCUMENTATION" box. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From anpedroni at gmail.com Sun Nov 18 06:43:23 2018 From: anpedroni at gmail.com (Andreas Pedroni) Date: Sun, 18 Nov 2018 12:43:23 +0100 Subject: [vtkusers] vtkImageActor erases other actors? References: Message-ID: Dear list I would like to display a 3D object in front of a vtkImageActor (using Python 3.6 and vtk on Mac OS, see code below). However, the vtkImageActor erases the 3D object. I read in the manual that one should use AddProp() with the renderer to add a vtkImageActor to a render scene. But there is no AddProp() method for the renderer class. I?d be very thankful for any suggestions. Best Andreas import vtk import cv2 from vtk.util import numpy_support IMAGEPATH = ?/models3d/' VIDEOPATH = "20180816-133303.mp4? def main(): cap = cv2.VideoCapture(VIDEOPATH) success, frame = cap.read() frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) vtk_array = numpy_support.numpy_to_vtk(frame.reshape((-1, 3), order='F'), deep=False) # Create a vtkImage Object. This is filled with the vtkArray data later vtk_image = vtk.vtkImageData() vtk_image.SetDimensions(720, 1280, 1) vtk_image.SetSpacing(720, 1280, 1) vtk_image.SetOrigin(720, 1280, 0) vtk_image.GetPointData().SetScalars(vtk_array) # create the Texture for a plane # The Screen where the movie is mapped onto plane = vtk.vtkPlaneSource() plane_mapper = vtk.vtkPolyDataMapper() plane_mapper.SetInputConnection(plane.GetOutputPort()) plane_actor = vtk.vtkImageActor() plane_actor.SetInputData(vtk_image) plane_actor.SetScale(1, 0.5625, 1) plane_actor.SetOrientation(180, 180, 90) # add the spine object obj_importer = vtk.vtkOBJReader() obj_importer.SetFileName(IMAGEPATH + 'Spine.obj') obj_importer.Update() spine_mapper = vtk.vtkPolyDataMapper() spine_mapper.SetInputConnection(obj_importer.GetOutputPort()) spine_actor = vtk.vtkActor() spine_actor.SetMapper(spine_mapper) spine_actor.SetOrientation(90, 10, 90) spine_actor.SetScale(0.3, 0.3, 0.3) # set up the renderer and the window ren = vtk.vtkRenderer() ren_win = vtk.vtkRenderWindow() ren_win.AddRenderer(ren) ren_win.SetSize(1500, 1500) ren.AddActor(spine_actor) ren.AddActor(plane_actor) ren.SetBackground(0, 0, 0.1) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(ren_win) # Initialize must be called prior to creating timer events. iren.Initialize() # start the interaction and timer iren.Start() if __name__ == '__main__': main() From david.gobbi at gmail.com Sun Nov 18 08:52:30 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Sun, 18 Nov 2018 06:52:30 -0700 Subject: [vtkusers] vtkImageActor erases other actors? In-Reply-To: References: Message-ID: Hi Andreas, Thanks for sending the code along with your question. The method you want is AddViewProp(), but it's just a new name for AddActor() and it actually has the same behavior. For the image actor, you probably want code like the following. vtk_image = vtk.vtkImageData() vtk_image.SetDimensions(720, 1280, 1) vtk_image.SetSpacing(1.0, 1.0, 1.0) vtk_image.SetOrigin(-(720 - 1)/2.0, -(1280 - 1)/2.0, 0.0) The "Spacing" is the size of each pixel, and the "Origin" is the position of the first pixel in the image (in this case, I set it so that the center of the image will be at (0,0,0), I'm not sure if this is what you want but it is a good place to start). After creating the image data, it is a good idea to add an assert to ensure the array is the correct size: assert vtk_image.GetNumberOfPoints() == vtk_array.GetNumberOfTuples() For the following code, I'm not sure what you are trying to do, but the effect will be to vertically squash the frame so that it is square: plane_actor.SetScale(1, 0.5625, 1) I hope this helps, David On Sun, Nov 18, 2018 at 4:43 AM Andreas Pedroni wrote: > Dear list > > I would like to display a 3D object in front of a vtkImageActor (using > Python 3.6 and vtk on Mac OS, see code below). However, the vtkImageActor > erases the 3D object. I read in the manual that one should use AddProp() > with the renderer to add a vtkImageActor to a render scene. But there is no > AddProp() method for the renderer class. I?d be very thankful for any > suggestions. > > Best > Andreas > > > import vtk > import cv2 > from vtk.util import numpy_support > > IMAGEPATH = ?/models3d/' > VIDEOPATH = "20180816-133303.mp4? > > def main(): > cap = cv2.VideoCapture(VIDEOPATH) > success, frame = cap.read() > > frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) > vtk_array = numpy_support.numpy_to_vtk(frame.reshape((-1, 3), > order='F'), deep=False) > > # Create a vtkImage Object. This is filled with the vtkArray data later > vtk_image = vtk.vtkImageData() > vtk_image.SetDimensions(720, 1280, 1) > vtk_image.SetSpacing(720, 1280, 1) > vtk_image.SetOrigin(720, 1280, 0) > vtk_image.GetPointData().SetScalars(vtk_array) > # create the Texture for a plane > > # The Screen where the movie is mapped onto > plane = vtk.vtkPlaneSource() > > plane_mapper = vtk.vtkPolyDataMapper() > plane_mapper.SetInputConnection(plane.GetOutputPort()) > > plane_actor = vtk.vtkImageActor() > plane_actor.SetInputData(vtk_image) > plane_actor.SetScale(1, 0.5625, 1) > plane_actor.SetOrientation(180, 180, 90) > > # add the spine object > obj_importer = vtk.vtkOBJReader() > obj_importer.SetFileName(IMAGEPATH + 'Spine.obj') > obj_importer.Update() > > spine_mapper = vtk.vtkPolyDataMapper() > spine_mapper.SetInputConnection(obj_importer.GetOutputPort()) > > spine_actor = vtk.vtkActor() > spine_actor.SetMapper(spine_mapper) > spine_actor.SetOrientation(90, 10, 90) > spine_actor.SetScale(0.3, 0.3, 0.3) > > # set up the renderer and the window > ren = vtk.vtkRenderer() > ren_win = vtk.vtkRenderWindow() > ren_win.AddRenderer(ren) > ren_win.SetSize(1500, 1500) > > ren.AddActor(spine_actor) > ren.AddActor(plane_actor) > > ren.SetBackground(0, 0, 0.1) > > iren = vtk.vtkRenderWindowInteractor() > iren.SetRenderWindow(ren_win) > > # Initialize must be called prior to creating timer events. > iren.Initialize() > > # start the interaction and timer > iren.Start() > > if __name__ == '__main__': > main() > -------------- next part -------------- An HTML attachment was scrubbed... URL: From anpedroni at gmail.com Sun Nov 18 15:26:27 2018 From: anpedroni at gmail.com (Andreas Pedroni) Date: Sun, 18 Nov 2018 21:26:27 +0100 Subject: [vtkusers] vtkImageActor erases other actors? In-Reply-To: References: Message-ID: <24C0D1AB-4841-48DA-B87B-D7775B0E0728@gmail.com> Dear David Thank you very much for your answer. I tried your suggestions but unfortunately I did not lead to a solution to my problem. It seems that only the ren.AddActor(plane_actor) has an effect on the rendered image. The ren.AddActor(spine_actor) is not shown. But when I comment out ren.AddActor(plane_actor) the spine_actor is shown. It is also only a problem if I use a vtk.vtkImageActor(), which I have chosen as it is supposed to be more efficient(?) than doing it with a vtk.vtkPlaneSource(). Thanks again for helping! Cheers Andreas > Am 18.11.2018 um 14:52 schrieb David Gobbi : > > Hi Andreas, > > Thanks for sending the code along with your question. The method you want is AddViewProp(), but it's just a new name for AddActor() and it actually has the same behavior. > > For the image actor, you probably want code like the following. > vtk_image = vtk.vtkImageData() > vtk_image.SetDimensions(720, 1280, 1) > vtk_image.SetSpacing(1.0, 1.0, 1.0) > vtk_image.SetOrigin(-(720 - 1)/2.0, -(1280 - 1)/2.0, 0.0) > > The "Spacing" is the size of each pixel, and the "Origin" is the position of the first pixel in the image (in this case, I set it so that the center of the image will be at (0,0,0), I'm not sure if this is what you want but it is a good place to start). > > After creating the image data, it is a good idea to add an assert to ensure the array is the correct size: > assert vtk_image.GetNumberOfPoints() == vtk_array.GetNumberOfTuples() > > For the following code, I'm not sure what you are trying to do, but the effect will be to vertically squash the frame so that it is square: > plane_actor.SetScale(1, 0.5625, 1) > > I hope this helps, > David > > On Sun, Nov 18, 2018 at 4:43 AM Andreas Pedroni > wrote: > Dear list > > I would like to display a 3D object in front of a vtkImageActor (using Python 3.6 and vtk on Mac OS, see code below). However, the vtkImageActor erases the 3D object. I read in the manual that one should use AddProp() with the renderer to add a vtkImageActor to a render scene. But there is no AddProp() method for the renderer class. I?d be very thankful for any suggestions. > > Best > Andreas > > > import vtk > import cv2 > from vtk.util import numpy_support > > IMAGEPATH = ?/models3d/' > VIDEOPATH = "20180816-133303.mp4? > > def main(): > cap = cv2.VideoCapture(VIDEOPATH) > success, frame = cap.read() > > frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) > vtk_array = numpy_support.numpy_to_vtk(frame.reshape((-1, 3), order='F'), deep=False) > > # Create a vtkImage Object. This is filled with the vtkArray data later > vtk_image = vtk.vtkImageData() > vtk_image.SetDimensions(720, 1280, 1) > vtk_image.SetSpacing(720, 1280, 1) > vtk_image.SetOrigin(720, 1280, 0) > vtk_image.GetPointData().SetScalars(vtk_array) > # create the Texture for a plane > > # The Screen where the movie is mapped onto > plane = vtk.vtkPlaneSource() > > plane_mapper = vtk.vtkPolyDataMapper() > plane_mapper.SetInputConnection(plane.GetOutputPort()) > > plane_actor = vtk.vtkImageActor() > plane_actor.SetInputData(vtk_image) > plane_actor.SetScale(1, 0.5625, 1) > plane_actor.SetOrientation(180, 180, 90) > > # add the spine object > obj_importer = vtk.vtkOBJReader() > obj_importer.SetFileName(IMAGEPATH + 'Spine.obj') > obj_importer.Update() > > spine_mapper = vtk.vtkPolyDataMapper() > spine_mapper.SetInputConnection(obj_importer.GetOutputPort()) > > spine_actor = vtk.vtkActor() > spine_actor.SetMapper(spine_mapper) > spine_actor.SetOrientation(90, 10, 90) > spine_actor.SetScale(0.3, 0.3, 0.3) > > # set up the renderer and the window > ren = vtk.vtkRenderer() > ren_win = vtk.vtkRenderWindow() > ren_win.AddRenderer(ren) > ren_win.SetSize(1500, 1500) > > ren.AddActor(spine_actor) > ren.AddActor(plane_actor) > > ren.SetBackground(0, 0, 0.1) > > iren = vtk.vtkRenderWindowInteractor() > iren.SetRenderWindow(ren_win) > > # Initialize must be called prior to creating timer events. > iren.Initialize() > > # start the interaction and timer > iren.Start() > > if __name__ == '__main__': > main() -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Sun Nov 18 16:39:37 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Sun, 18 Nov 2018 14:39:37 -0700 Subject: [vtkusers] vtkImageActor erases other actors? In-Reply-To: <24C0D1AB-4841-48DA-B87B-D7775B0E0728@gmail.com> References: <24C0D1AB-4841-48DA-B87B-D7775B0E0728@gmail.com> Message-ID: Hi Andreas, My comments about vtkImageActor might not be the full solution, but I can guarantee that they are part of the solution. If the objects cannot be displayed together, it is probably because they are either too far apart in world coordinates, or perhaps the image actor is simply obscuring (in front of) the spine actor. To help with debugging the coordinates, you can print the bounding box for the image data and for the poly data to make sure they are in roughly the same location. Use the data's GetBounds() method to do this. Note that the actors also have a GetBounds method, which returns the bounding box after the actor transformations have taken place. David On Sun, Nov 18, 2018 at 1:26 PM Andreas Pedroni wrote: > Dear David > > Thank you very much for your answer. I tried your suggestions but > unfortunately I did not lead to a solution to my problem. > It seems that only the ren.AddActor(plane_actor) has an effect on the > rendered image. The ren.AddActor(spine_actor) is not shown. But when I > comment out ren.AddActor(plane_actor) the spine_actor is shown. > It is also only a problem if I use a vtk.vtkImageActor(), which I have > chosen as it is supposed to be more efficient(?) than doing it with a > vtk.vtkPlaneSource(). > > Thanks again for helping! > Cheers > Andreas > > > > Am 18.11.2018 um 14:52 schrieb David Gobbi : > > Hi Andreas, > > Thanks for sending the code along with your question. The method you want > is AddViewProp(), but it's just a new name for AddActor() and it actually > has the same behavior. > > For the image actor, you probably want code like the following. > vtk_image = vtk.vtkImageData() > vtk_image.SetDimensions(720, 1280, 1) > vtk_image.SetSpacing(1.0, 1.0, 1.0) > vtk_image.SetOrigin(-(720 - 1)/2.0, -(1280 - 1)/2.0, 0.0) > > The "Spacing" is the size of each pixel, and the "Origin" is the position > of the first pixel in the image (in this case, I set it so that the center > of the image will be at (0,0,0), I'm not sure if this is what you want but > it is a good place to start). > > After creating the image data, it is a good idea to add an assert to > ensure the array is the correct size: > assert vtk_image.GetNumberOfPoints() == vtk_array.GetNumberOfTuples() > > For the following code, I'm not sure what you are trying to do, but the > effect will be to vertically squash the frame so that it is square: > plane_actor.SetScale(1, 0.5625, 1) > > I hope this helps, > David > > On Sun, Nov 18, 2018 at 4:43 AM Andreas Pedroni > wrote: > >> Dear list >> >> I would like to display a 3D object in front of a vtkImageActor (using >> Python 3.6 and vtk on Mac OS, see code below). However, the vtkImageActor >> erases the 3D object. I read in the manual that one should use AddProp() >> with the renderer to add a vtkImageActor to a render scene. But there is no >> AddProp() method for the renderer class. I?d be very thankful for any >> suggestions. >> >> Best >> Andreas >> >> >> import vtk >> import cv2 >> from vtk.util import numpy_support >> >> IMAGEPATH = ?/models3d/' >> VIDEOPATH = "20180816-133303.mp4? >> >> def main(): >> cap = cv2.VideoCapture(VIDEOPATH) >> success, frame = cap.read() >> >> frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) >> vtk_array = numpy_support.numpy_to_vtk(frame.reshape((-1, 3), >> order='F'), deep=False) >> >> # Create a vtkImage Object. This is filled with the vtkArray data later >> vtk_image = vtk.vtkImageData() >> vtk_image.SetDimensions(720, 1280, 1) >> vtk_image.SetSpacing(720, 1280, 1) >> vtk_image.SetOrigin(720, 1280, 0) >> vtk_image.GetPointData().SetScalars(vtk_array) >> # create the Texture for a plane >> >> # The Screen where the movie is mapped onto >> plane = vtk.vtkPlaneSource() >> >> plane_mapper = vtk.vtkPolyDataMapper() >> plane_mapper.SetInputConnection(plane.GetOutputPort()) >> >> plane_actor = vtk.vtkImageActor() >> plane_actor.SetInputData(vtk_image) >> plane_actor.SetScale(1, 0.5625, 1) >> plane_actor.SetOrientation(180, 180, 90) >> >> # add the spine object >> obj_importer = vtk.vtkOBJReader() >> obj_importer.SetFileName(IMAGEPATH + 'Spine.obj') >> obj_importer.Update() >> >> spine_mapper = vtk.vtkPolyDataMapper() >> spine_mapper.SetInputConnection(obj_importer.GetOutputPort()) >> >> spine_actor = vtk.vtkActor() >> spine_actor.SetMapper(spine_mapper) >> spine_actor.SetOrientation(90, 10, 90) >> spine_actor.SetScale(0.3, 0.3, 0.3) >> >> # set up the renderer and the window >> ren = vtk.vtkRenderer() >> ren_win = vtk.vtkRenderWindow() >> ren_win.AddRenderer(ren) >> ren_win.SetSize(1500, 1500) >> >> ren.AddActor(spine_actor) >> ren.AddActor(plane_actor) >> >> ren.SetBackground(0, 0, 0.1) >> >> iren = vtk.vtkRenderWindowInteractor() >> iren.SetRenderWindow(ren_win) >> >> # Initialize must be called prior to creating timer events. >> iren.Initialize() >> >> # start the interaction and timer >> iren.Start() >> >> if __name__ == '__main__': >> main() >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From iamdpak at gmail.com Sun Nov 18 20:40:23 2018 From: iamdpak at gmail.com (vinmean) Date: Sun, 18 Nov 2018 18:40:23 -0700 (MST) Subject: [vtkusers] Need help in using vtkProjectedTexture class. Texture missaligned. Message-ID: <1542591623325-0.post@n5.nabble.com> I want to project an image as a texture to a small region on a large 3D model. I have the 3D model as an actor. I wrote the below function to test the projected texture class. I followed the example in the link https://lorensen.github.io/VTKExamples/site/Cxx/Texture/ProjectedTexture/ I am able to set the set the desired camera view as a first step. However, I am then unable to overlay the texture properly. The texture seems to be stretched and doesn't seem to be centered at the point of focus. I even drew a frustum to demonstrate the correctness of the camera parameters like position, focal point and up vector. Please find the screenshot of the rendered scene attached. Why would this stretching happen? What are the other parameters that needs to be set? I couldn't find much examples or documentation on this. //viz is my visuzalizer class. It has access to renderwindow, renderer, interactor //This function sets the camera pose and then applies projected texture to the polydata of input actor void test_projected_texture(vtkSmartPointer actor, viz* v, pose& pv_cam) { //I am able to set the camera view using pv_cam variable and the view looks as I expected vtkSmartPointer camera = v->renderWindow->GetRenderers()->GetFirstRenderer()->GetActiveCamera(); v->setCameraPose(pv_cam.pp); v->renderWindow->Render(); //using actor vtkPolyData* polyData = vtkPolyData::SafeDownCast(actor->GetMapper()->GetInput()); vtkSmartPointer projectedTexture = vtkSmartPointer::New(); double aspect[3]; aspect[1] = 1; aspect[2] = 1; aspect[0] = (1.0/ (vtkMath::RadiansFromDegrees(std::tan(camera->GetViewAngle())))) / 2.0; projectedTexture->SetAspectRatio(aspect); projectedTexture->SetPosition(camera->GetPosition()); projectedTexture->SetFocalPoint(camera->GetFocalPoint()); projectedTexture->SetUp(camera->GetViewUp()[0], camera->GetViewUp()[1], camera->GetViewUp()[2]); projectedTexture->SetInputData( polyData); //this can be the same as the one to project on projectedTexture->Update(); //Map Texture on Surface polyData->GetPointData()->SetTCoords(projectedTexture->GetOutput()->GetPointData()->GetTCoords()); // Read texture file vtkSmartPointer readerFactory = vtkSmartPointer::New(); vtkImageReader2 *imageReader = readerFactory->CreateImageReader2("images/0003.jpg"); imageReader->SetFileName("images/0003.jpg"); imageReader->Update(); vtkSmartPointer texture = vtkSmartPointer::New(); texture->SetInputData(imageReader->GetOutput()); texture->RepeatOff(); actor->SetTexture(texture); } -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From anpedroni at gmail.com Sun Nov 18 23:54:05 2018 From: anpedroni at gmail.com (Andreas Pedroni) Date: Mon, 19 Nov 2018 05:54:05 +0100 Subject: [vtkusers] vtkImageActor erases other actors? In-Reply-To: References: <24C0D1AB-4841-48DA-B87B-D7775B0E0728@gmail.com> Message-ID: <41E4D014-F1C7-414B-BCA8-A1049F846C49@gmail.com> Dear David Thanks for your answer. You were indeed right, the poly data object was hidden within the margins of the plane (I thought a plane has no thickness) and using GetBounds() showed that it did. All the best Andreas Andreas Pedroni Weinbergweg 2 5408 Ennetbaden Schweiz anpedroni at gmail.com +41(0)79 300 17 42 > Am 18.11.2018 um 22:39 schrieb David Gobbi : > > Hi Andreas, > > My comments about vtkImageActor might not be the full solution, but I can guarantee that they are part of the solution. > > If the objects cannot be displayed together, it is probably because they are either too far apart in world coordinates, or perhaps the image actor is simply obscuring (in front of) the spine actor. To help with debugging the coordinates, you can print the bounding box for the image data and for the poly data to make sure they are in roughly the same location. Use the data's GetBounds() method to do this. Note that the actors also have a GetBounds method, which returns the bounding box after the actor transformations have taken place. > > David > > > > On Sun, Nov 18, 2018 at 1:26 PM Andreas Pedroni > wrote: > Dear David > > Thank you very much for your answer. I tried your suggestions but unfortunately I did not lead to a solution to my problem. > It seems that only the ren.AddActor(plane_actor) has an effect on the rendered image. The ren.AddActor(spine_actor) is not shown. But when I comment out ren.AddActor(plane_actor) the spine_actor is shown. > It is also only a problem if I use a vtk.vtkImageActor(), which I have chosen as it is supposed to be more efficient(?) than doing it with a vtk.vtkPlaneSource(). > > Thanks again for helping! > Cheers > Andreas > > > >> Am 18.11.2018 um 14:52 schrieb David Gobbi >: >> >> Hi Andreas, >> >> Thanks for sending the code along with your question. The method you want is AddViewProp(), but it's just a new name for AddActor() and it actually has the same behavior. >> >> For the image actor, you probably want code like the following. >> vtk_image = vtk.vtkImageData() >> vtk_image.SetDimensions(720, 1280, 1) >> vtk_image.SetSpacing(1.0, 1.0, 1.0) >> vtk_image.SetOrigin(-(720 - 1)/2.0, -(1280 - 1)/2.0, 0.0) >> >> The "Spacing" is the size of each pixel, and the "Origin" is the position of the first pixel in the image (in this case, I set it so that the center of the image will be at (0,0,0), I'm not sure if this is what you want but it is a good place to start). >> >> After creating the image data, it is a good idea to add an assert to ensure the array is the correct size: >> assert vtk_image.GetNumberOfPoints() == vtk_array.GetNumberOfTuples() >> >> For the following code, I'm not sure what you are trying to do, but the effect will be to vertically squash the frame so that it is square: >> plane_actor.SetScale(1, 0.5625, 1) >> >> I hope this helps, >> David >> >> On Sun, Nov 18, 2018 at 4:43 AM Andreas Pedroni > wrote: >> Dear list >> >> I would like to display a 3D object in front of a vtkImageActor (using Python 3.6 and vtk on Mac OS, see code below). However, the vtkImageActor erases the 3D object. I read in the manual that one should use AddProp() with the renderer to add a vtkImageActor to a render scene. But there is no AddProp() method for the renderer class. I?d be very thankful for any suggestions. >> >> Best >> Andreas >> >> >> import vtk >> import cv2 >> from vtk.util import numpy_support >> >> IMAGEPATH = ?/models3d/' >> VIDEOPATH = "20180816-133303.mp4? >> >> def main(): >> cap = cv2.VideoCapture(VIDEOPATH) >> success, frame = cap.read() >> >> frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) >> vtk_array = numpy_support.numpy_to_vtk(frame.reshape((-1, 3), order='F'), deep=False) >> >> # Create a vtkImage Object. This is filled with the vtkArray data later >> vtk_image = vtk.vtkImageData() >> vtk_image.SetDimensions(720, 1280, 1) >> vtk_image.SetSpacing(720, 1280, 1) >> vtk_image.SetOrigin(720, 1280, 0) >> vtk_image.GetPointData().SetScalars(vtk_array) >> # create the Texture for a plane >> >> # The Screen where the movie is mapped onto >> plane = vtk.vtkPlaneSource() >> >> plane_mapper = vtk.vtkPolyDataMapper() >> plane_mapper.SetInputConnection(plane.GetOutputPort()) >> >> plane_actor = vtk.vtkImageActor() >> plane_actor.SetInputData(vtk_image) >> plane_actor.SetScale(1, 0.5625, 1) >> plane_actor.SetOrientation(180, 180, 90) >> >> # add the spine object >> obj_importer = vtk.vtkOBJReader() >> obj_importer.SetFileName(IMAGEPATH + 'Spine.obj') >> obj_importer.Update() >> >> spine_mapper = vtk.vtkPolyDataMapper() >> spine_mapper.SetInputConnection(obj_importer.GetOutputPort()) >> >> spine_actor = vtk.vtkActor() >> spine_actor.SetMapper(spine_mapper) >> spine_actor.SetOrientation(90, 10, 90) >> spine_actor.SetScale(0.3, 0.3, 0.3) >> >> # set up the renderer and the window >> ren = vtk.vtkRenderer() >> ren_win = vtk.vtkRenderWindow() >> ren_win.AddRenderer(ren) >> ren_win.SetSize(1500, 1500) >> >> ren.AddActor(spine_actor) >> ren.AddActor(plane_actor) >> >> ren.SetBackground(0, 0, 0.1) >> >> iren = vtk.vtkRenderWindowInteractor() >> iren.SetRenderWindow(ren_win) >> >> # Initialize must be called prior to creating timer events. >> iren.Initialize() >> >> # start the interaction and timer >> iren.Start() >> >> if __name__ == '__main__': >> main() > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ftpronk at engits.com Mon Nov 19 04:47:41 2018 From: ftpronk at engits.com (Fcs) Date: Mon, 19 Nov 2018 02:47:41 -0700 (MST) Subject: [vtkusers] VTK python module for analysis and simulations In-Reply-To: <1542461995694-0.post@n5.nabble.com> References: <1542461995694-0.post@n5.nabble.com> Message-ID: <1542620861333-0.post@n5.nabble.com> Nice work! Definitely something worth trying! -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From robert.maynard at kitware.com Mon Nov 19 08:45:45 2018 From: robert.maynard at kitware.com (Robert Maynard) Date: Mon, 19 Nov 2018 08:45:45 -0500 Subject: [vtkusers] How to configure cmake to include /Accelerators/Vtkm classes In-Reply-To: References: Message-ID: Hi Trinian, To enable the VTK-m algorithms you will need to enable `Module_vtkAcceleratorsVTKm`. The option can be enabled on the command line with '-DModule_vtkAcceleratorsVTKm:BOOL=ON ' or found under advanced in the GUI. On Fri, Nov 16, 2018 at 4:28 PM Trinian Gordon wrote: > Hello, > > I have read that it is possible to include a select number of VTKm classes > into a VTK pipeline. I see that there are a few of those classes included > in the vtk repository under /Accelerators/Vtkm, but are not found by cmake. > How do I build VTK so I can use the VTKm filters? > > Building vtk with the cmake gui, changing only the basic options for > output filepaths and using TBB for the VTK_SMP_IMPLEMENTATION_TYPE works > fine. When I try to use the accelerators, they appear to be missing from my > build. > > Thanks, > Trinian > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 cory.quammen at kitware.com Mon Nov 19 09:52:58 2018 From: cory.quammen at kitware.com (Cory Quammen) Date: Mon, 19 Nov 2018 09:52:58 -0500 Subject: [vtkusers] Extract csv row and column into points In-Reply-To: References: Message-ID: On Thu, Nov 15, 2018 at 1:26 AM Polly Pui wrote: > Hi Cory, > Thanks for your reply. > I edited my codes by following your advice. However, I am not able to > visualize the point of cluster and got an error message. > > I have a few questions here. > Is it possible to call VTK unstructured grid data into vtkKmeansStatistics? > No, vtkKMeansStatistics requires a vtkTable input (it is a subclass of vtkTableAlgorithm). vtkTable is different from a vtkPolyData, which is what you are trying to create. See more inline comments further down. > Actually what i wanted to do is very simple. > I want to read my csv or vtk file and then cluster the points using > kmeansclustering. > Initially, I extracted points from csv file manually and I could get my > desired output. But it is too time consuming. > Currently, I want to input the csv or vtk file and get the cluster > automatically and store in a datasheet. > I attach my code as follows: > > #include > #include "library.h" > > #include > #include > #include > #include > #include > > > std::string inputFilename = argv[1]; > > vtkSmartPointer reader = > vtkSmartPointer::New(); > reader->SetFileName(inputFilename.c_str()); > reader->SetFieldDelimiterCharacters(","); > reader->DetectNumericColumnsOn(); > reader->Update(); > > ///////KmeansCluster > > vtkSmartPointer kMeansStatistics = > vtkSmartPointer::New(); > kMeansStatistics->SetInputConnection(reader->GetOutputPort()); > kMeansStatistics->SetColumnStatus("Column 3", 1); > kMeansStatistics->SetColumnStatus("Column 4", 1); > kMeansStatistics->SetColumnStatus("Column 5", 1); > kMeansStatistics->RequestSelectedColumns(); > kMeansStatistics->SetAssessOption(true); > kMeansStatistics->SetDefaultNumberOfClusters(2); > //kMeansStatistics->SetMaxNumIterations(15); > kMeansStatistics->Update(); > > // Display the results in CMD (each row) > kMeansStatistics->GetOutput()->Dump(); > > > //Group the points according to ID number > vtkSmartPointer clusterArray = > vtkSmartPointer::New(); > clusterArray->SetNumberOfComponents(1); > clusterArray->SetName("ClusterId"); > > for (int r = 0; r < kMeansStatistics->GetOutput()->GetNumberOfRows(); r++) > { > vtkVariant v = kMeansStatistics->GetOutput()->GetValue(r, > kMeansStatistics->GetOutput()->GetNumberOfColumns() - 1); > std::cout << "Point " << r << " is in cluster " << v.ToInt() << std::endl; > clusterArray->InsertNextValue(v.ToInt()); > } > > // Create a lookup table to map cell data to colors > vtkSmartPointer lut = > vtkSmartPointer::New(); > int tableSize = (kMeansStatistics + 1, 10); > lut->SetNumberOfTableValues(tableSize); > lut->Build(); > > //ColorCells > vtkSmartPointer colors = > vtkSmartPointer::New(); > lut->SetTableValue(0, colors->GetColor4d("Black").GetData()); > lut->SetTableValue(1, colors->GetColor4d("Banana").GetData()); > lut->SetTableValue(2, colors->GetColor4d("Tomato").GetData()); > lut->SetTableValue(3, colors->GetColor4d("Peacock").GetData()); > lut->SetTableValue(4, colors->GetColor4d("Lavender").GetData()); > lut->SetTableValue(5, colors->GetColor4d("Flesh").GetData()); > lut->SetTableValue(6, colors->GetColor4d("Raspberry").GetData()); > lut->SetTableValue(7, colors->GetColor4d("Salmon").GetData()); > lut->SetTableValue(8, colors->GetColor4d("Mint").GetData()); > lut->SetTableValue(9, colors->GetColor4d("Wheat").GetData()); > > // Output the cluster centers > > vtkMultiBlockDataSet* outputMetaDS = > vtkMultiBlockDataSet::SafeDownCast(kMeansStatistics->GetOutputDataObject(vtkStatisticsAlgorithm::OUTPUT_MODEL)); > vtkSmartPointer outputMeta = > vtkTable::SafeDownCast(outputMetaDS->GetBlock(0)); > //vtkSmartPointer outputMeta = vtkTable::SafeDownCast( > outputMetaDS->GetBlock( 1 ) ); > vtkDoubleArray* coord0 = > vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("Column 0")); > vtkDoubleArray* coord1 = > vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("Column 1")); > vtkDoubleArray* coord2 = > vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("Column 2")); > > for (unsigned int i = 0; i < coord0->GetNumberOfTuples(); ++i) > { > std::cout << coord0->GetValue(i) << " " << coord1->GetValue(i) << " " << > coord2->GetValue(i) << std::endl; > > } > > vtkSmartPointer polydata = > vtkSmartPointer::New(); > polydata->GetPointData()->SetScalars(clusterArray); > > The below won't work. vtkKMeansStatistics produces a vtkTable, while the vtkPolyDataMapper requires a vtkPolyData. To convert a vtkTable to a vtkPolyData, which is the key piece you are missing, use vtkTableToPolyData. This class iterates over the rows, treats the columns you designate as X, Y, Z coordinates, and adds the remaining columns as point data arrays in the output vtkPolyData. It will look something like this: vtkSmartPointer t2pd = vtkSmartPointer::New(); t2pd->SetInputConnection(kMeansStatistics->GetOutputPort()); t2pd->SetXColumn("name of column to be used as x-coordinate"); t2pd->SetYColumn("name of column to be used as y-coordinate"); t2pd->SetZColumn("name of column to be used as z-coordinate"); Now, change, the code below from: > vtkSmartPointer mapper = > vtkSmartPointer::New(); > mapper->SetInputConnection(kMeansStatistics->GetOutputPort()); > to vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(t2pd->GetOutputPort()); That should do it. Cory > vtkSmartPointer actor = > vtkSmartPointer::New(); > actor->SetMapper(mapper); > actor->GetProperty()->SetPointSize(3); > actor->GetProperty()->SetColor(1, 0, 0); > > vtkSmartPointer renderer = > vtkSmartPointer::New(); > vtkSmartPointer renderWindow = > vtkSmartPointer::New(); > renderWindow->AddRenderer(renderer); > renderWindow->SetSize(640, 480); > > vtkSmartPointer renderWindowInteractor = > vtkSmartPointer::New(); > renderWindowInteractor->SetRenderWindow(renderWindow); > > renderer->AddActor(actor); > renderer->SetBackground(0, 0, 0); // Background color black > > renderWindow->Render(); > renderWindowInteractor->Start(); > > return EXIT_SUCCESS; > } > > > Thank you so much. > > Regards, > Polly > ------------------------------ > *From:* Cory Quammen > *Sent:* Tuesday, November 13, 2018 11:34 PM > *To:* Polly Pui > *Cc:* vtkusers > *Subject:* Re: [vtkusers] Extract csv row and column into points > > Ah, so you want to use the vtkKMeansStatistics filter. That filter > operates on vtkTable data. To use it, you don't need to create points at > all. Instead, you can connect the vtkDelimitedTextReader directly to the vtkKMeansStatistics > filter like so: > > vtkSmartPointer kMeansStatistics = > vtkSmartPointer::New(); > kMeansStatistics->SetInputConnection(reader->GetOutputPort()); > kMeansStatistics->SetColumnStatus("column1", 1); > kMeansStatistics->SetColumnStatus("column2", 1); > kMeansStatistics->SetColumnStatus("column3, 1); > kMeansStatistics->RequestSelectedColumns(); > kMeansStatistics->SetAssessOption(true); > kMeansStatistics->SetDefaultNumberOfClusters(1); > //kMeansStatistics->SetMaxNumIterations(15); > kMeansStatistics->Update(); > > Here, I've altered your calls to SetColumnStatus() under the assumption > you know the column names of interest. > > HTH, > Cory > > > On Fri, Nov 9, 2018 at 10:16 AM Polly Pui > wrote: > > Hi, > Thanks for your reply. > Is it possible to have more elaborations from you? > > How can I get the number of points from vtkTableToPolyData? > I got an error saying that vtkTableToPolyData has no members of > GetNumberOfPoints. > I need those points to proceed to KmeansStatistics. > > This is my code: > ...... > std::string inputFilename = argv[1]; > > vtkSmartPointer reader = > vtkSmartPointer::New(); > reader->SetFileName(inputFilename.c_str()); > reader->SetFieldDelimiterCharacters(" "); > reader->DetectNumericColumnsOn(); > reader->Update(); > int numberOfRows = reader->GetOutput()->GetNumberOfRows(); > > vtkSmartPointer inputData = > vtkSmartPointer::New(); > inputData->SetInputConnection(reader->GetOutputPort); > > for (int c = 0; c < 3; ++c) > { > std::stringstream colName; > colName << "coord " << c; > vtkSmartPointer doubleArray = > vtkSmartPointer::New(); > doubleArray->SetNumberOfComponents(1); > doubleArray->SetName(colName.str().c_str()); > doubleArray->SetNumberOfTuples(inputData->GetNumberOfPoints()); > > > for (int r = 0; r < inputData->GetNumberOfPoints(); ++r) > { > double p[3]; > inputData->GetPoint(r, p); > doubleArray->SetValue(r, p[c]); > } > inputData->AddColumn(doubleArray); > } > > vtkSmartPointer kMeansStatistics = > vtkSmartPointer::New(); > > #if VTK_MAJOR_VERSION <= 5 > kMeansStatistics->SetInput(vtkStatisticsAlgorithm::INPUT_DATA, inputData); > #else > kMeansStatistics->SetInputData(vtkStatisticsAlgorithm::INPUT_DATA, > inputData); > #endif > kMeansStatistics->SetColumnStatus(inputData->GetColumnName(0), 1); > kMeansStatistics->SetColumnStatus(inputData->GetColumnName(1), 1); > kMeansStatistics->SetColumnStatus(inputData->GetColumnName(2), 1); > kMeansStatistics->RequestSelectedColumns(); > kMeansStatistics->SetAssessOption(true); > kMeansStatistics->SetDefaultNumberOfClusters(1); > //kMeansStatistics->SetMaxNumIterations(15); > kMeansStatistics->Update(); > > Thanks again. > > Regards, > Polly > ------------------------------ > *From:* Cory Quammen > *Sent:* Friday, November 9, 2018 10:07 PM > *To:* Polly Pui > *Cc:* vtkusers > *Subject:* Re: [vtkusers] Extract csv row and column into points > > vtkDelimitedTextReader -> vtkTableToPolyData is a pipeline that should > make this much simpler. > > On Fri, Nov 9, 2018 at 1:14 AM Polly Pui > wrote: > > Hi, > Is there any clue that i can extract the row and column data from a csv > file and read them as points? > Currently I am using vtkpoints to read points by inserting points > manually to my .cpp . > Is it possible for me to call the csv directly and read the data (eg. > column 3-5, row 2-10)? > > I attach my code here. > ...... > int main(int, char*[]) > { > > vtkSmartPointer points = > vtkSmartPointer::New(); > points->InsertNextPoint(8.4312, -36.489, -1500.7); > points->InsertNextPoint(8.8408, -37.726, -1500.4); > points->InsertNextPoint(11.372, -37.787, -1501.5); > points->InsertNextPoint(11.263, -36.384, -1501.9); > points->InsertNextPoint(9.3914, -40.819, -1500.8); > points->InsertNextPoint(11.685, -42.482, -1502.7); > points->InsertNextPoint(14.235, -38.096, -1503.5); > points->InsertNextPoint(13.972, -43.051, -1504.2); > points->InsertNextPoint(9.22, -43.904, -1504); > > vtkSmartPointer inputData = > vtkSmartPointer::New(); > for (int c = 0; c < 3; ++c) > { > std::stringstream colName; > colName << "coord " << c; > vtkSmartPointer doubleArray = > vtkSmartPointer::New(); > doubleArray->SetNumberOfComponents(1); > doubleArray->SetName(colName.str().c_str()); > doubleArray->SetNumberOfTuples(points->GetNumberOfPoints()); > > for (int r = 0; r < points->GetNumberOfPoints(); ++r) > { > double p[3]; > points->GetPoint(r, p); > doubleArray->SetValue(r, p[c]); > } > inputData->AddColumn(doubleArray); > } > > Thank you very much. > > Regards, > Polly > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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. > > > > -- > Cory Quammen > Staff R&D Engineer > Kitware, Inc. > -- Cory Quammen Staff R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthew.troke at avalonholographics.com Mon Nov 19 09:52:46 2018 From: matthew.troke at avalonholographics.com (Matthew Troke) Date: Mon, 19 Nov 2018 11:22:46 -0330 Subject: [vtkusers] World Units Message-ID: What units are world dimensions in VTK? For example, if I create a cube that is 1.0 in width, is that considered to be 1 meter, 1 cm, etc? Or are they unitless and defined by the source data? I assume if you are loading in some type of medical data, units are important. Matt -- Matthew Troke Software Engineer Office: 1-709-701-0239 Email: matthew.troke at avalonholographics.com -- _This email and any attachments are confidential and may be privileged. Any unauthorized use, disclosure, copying or distribution of the information received is prohibited. If you are not the intended recipient please contact the sender immediately by return email confirming that you have and will delete all communications related to the email and any attachments sent to you in error._ -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Mon Nov 19 09:57:44 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Mon, 19 Nov 2018 09:57:44 -0500 Subject: [vtkusers] World Units In-Reply-To: References: Message-ID: vtk itself is unitless. it is up to the application to keep track of that. David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Mon, Nov 19, 2018 at 9:53 AM Matthew Troke < matthew.troke at avalonholographics.com> wrote: > What units are world dimensions in VTK? For example, if I create a cube > that is 1.0 in width, is that considered to be 1 meter, 1 cm, etc? Or are > they unitless and defined by the source data? I assume if you are loading > in some type of medical data, units are important. > > Matt > > -- > Matthew Troke > Software Engineer > Office: 1-709-701-0239 > Email: matthew.troke at avalonholographics.com > > *This email and any attachments are confidential and may be privileged. > Any unauthorized use, disclosure, copying or distribution of the > information received is prohibited. If you are not the intended recipient > please contact the sender immediately by return email confirming that you > have and will delete all communications related to the email and any > attachments sent to you in error.* > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 ruurd.kuiper at gmail.com Mon Nov 19 10:57:02 2018 From: ruurd.kuiper at gmail.com (Ruurd Kuiper) Date: Mon, 19 Nov 2018 16:57:02 +0100 Subject: [vtkusers] vtkWarpInverseTransformPoint Message-ID: Dear all, I am trying to understand the vtkWarpTransform method vtkWarpInverseTransformPoint, so I can implement it in my own code. My goal is to inverse a 3D displacement field image (so 4 dimensions including the displacement vector). However, my results are always different from the results I get by using the vtk. I think my problem might be caused either by the way points that reside on the borders of the image are handled, or by a misunderstanding of TemplateTransformPoint(inverse,deltaP,derivative) (line 145) in vtkWarpTransform. I was not able to find the source code in which either of this is described. Does anyone have a link to this? Kind regards, RK -------------- next part -------------- An HTML attachment was scrubbed... URL: From romain.leguay at gmail.com Mon Nov 19 11:04:57 2018 From: romain.leguay at gmail.com (Romain LEGUAY) Date: Mon, 19 Nov 2018 17:04:57 +0100 Subject: [vtkusers] vtkChartXY: custom label text for axes Message-ID: <834D5000-1EAD-40D6-A300-CAE4F6A330B6@gmail.com> Hello everyone, I try to use vtkChartXY. I use QChartTable.cxx example as starting point. I can do practically all things I want except to customize the label text for the axes. For example, for the X-axis, I want to put a string instead of the ? real ? value contained in the vtkFloatArray. Is-it possible? Thank you, Romain From david.gobbi at gmail.com Mon Nov 19 11:21:16 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 19 Nov 2018 09:21:16 -0700 Subject: [vtkusers] vtkWarpInverseTransformPoint In-Reply-To: References: Message-ID: Hi RK, Take a look at the subclasses of vtkWarpTransform shown here: https://www.vtk.org/doc/nightly/html/classvtkWarpTransform.html The vtkGridTransform and vtkBSplineTransform subclasses probably already do what you need, i.e. both of them can be used to invert a 3D displacement field image. The vtkGridTransform method is easier to use, while the vtkBSplineTransform provides a smoother result. More information about the vtkBSplineTransform is provided at the following link (use the "Download Paper" button). In order to use this class, the displacement field image must be converted into spline coefficients via the vtkBSplineCoefficients class. The following code shows how vtkBSplineCoefficients can be used for this purpose: https://gitlab.kitware.com/vtk/vtk/blob/master/Filters/Hybrid/Testing/Cxx/TestBSplineTransform.cxx#L158 A description of the implementation of vtkWarpTransform and vtkGridTransform is provided in the following publication. Apologies for the paywall. https://www.ncbi.nlm.nih.gov/pubmed/12631510 Regards, David On Mon, Nov 19, 2018 at 8:57 AM Ruurd Kuiper wrote: > Dear all, > > I am trying to understand the vtkWarpTransform > method vtkWarpInverseTransformPoint, so I can implement it in my own code. > My goal is to inverse a 3D displacement field image (so 4 dimensions > including the displacement vector). However, my results are always > different from the results I get by using the vtk. > > I think my problem might be caused either by the way points that reside on > the borders of the image are handled, or by a misunderstanding of > TemplateTransformPoint(inverse,deltaP,derivative) (line 145) in > vtkWarpTransform. I was not able to find the source code in which either of > this is described. Does anyone have a link to this? > > Kind regards, > > RK > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.martin at kitware.com Mon Nov 19 11:22:12 2018 From: ken.martin at kitware.com (Ken Martin) Date: Mon, 19 Nov 2018 11:22:12 -0500 Subject: [vtkusers] World Units In-Reply-To: References: Message-ID: Although the OpenVR module does use the notion of a physical to world transformation to map between meters in the VR room and the world coordinates. On Mon, Nov 19, 2018 at 9:57 AM David E DeMarle wrote: > vtk itself is unitless. it is up to the application to keep track of that. > > David E DeMarle > Kitware, Inc. > Principal Engineer > 21 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-881-4909 > > > On Mon, Nov 19, 2018 at 9:53 AM Matthew Troke < > matthew.troke at avalonholographics.com> wrote: > >> What units are world dimensions in VTK? For example, if I create a cube >> that is 1.0 in width, is that considered to be 1 meter, 1 cm, etc? Or are >> they unitless and defined by the source data? I assume if you are loading >> in some type of medical data, units are important. >> >> Matt >> >> -- >> Matthew Troke >> Software Engineer >> Office: 1-709-701-0239 >> Email: matthew.troke at avalonholographics.com >> >> *This email and any attachments are confidential and may be privileged. >> Any unauthorized use, disclosure, copying or distribution of the >> information received is prohibited. If you are not the intended recipient >> please contact the sender immediately by return email confirming that you >> have and will delete all communications related to the email and any >> attachments sent to you in error.* >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> 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 > -- 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 kmallick2000 at hotmail.com Mon Nov 19 12:37:05 2018 From: kmallick2000 at hotmail.com (Kaushik Mallick) Date: Mon, 19 Nov 2018 17:37:05 +0000 Subject: [vtkusers] Need help in using the Source file in GeometryViewer Message-ID: First disclosure: I am not very familar with JS and how to use a JS source file in websites. I am interested in using VTKjs, particularly its GeometryViewer module to display a vtp file I have created by exporting my model in Paraview. I can use the html file loader here: https://kitware.github.io/vtk-js/examples/GeometryViewer/GeometryViewer.html and I am able to load my vtp file to view my model and interact with it very nicely. I would like to use this same html file from my own web server for other users to load their own individual files. How do I use (or embed) the Source file in this page in my website? https://kitware.github.io/vtk-js/examples/GeometryViewer.html Any hint or pointers would be greatly appreciated. From sean at rogue-research.com Mon Nov 19 15:34:27 2018 From: sean at rogue-research.com (Sean McBride) Date: Mon, 19 Nov 2018 15:34:27 -0500 Subject: [vtkusers] Custom VTK Cocoa window flickers gray on new macOS In-Reply-To: References: <53C0B8F4-09DE-4215-B86F-519F3A89697F@gmail.com> <20181113183455.1754111005@mail.rogue-research.com> <0494C070-F4C7-476C-8DE1-AA440989F3CA@gmail.com> <20181116153422.1426165175@mail.rogue-research.com> Message-ID: <20181119203427.107429209@mail.rogue-research.com> On Sat, 17 Nov 2018 13:47:54 +0100, Alessandro Volz said: >After some off-list exchanges, I want to get this thread back on the >mailing list. > >There is indeed a problem that also comes up with the SimpleCocoaVTK >sample project. In Mojave, when built using the 10.14 SDK, >SimpleCocoaVTK opens without displaying the rendered images. Interacting >with the view displays the results. On a hunch, I updated my 10.14 bot from macOS 10.14.1 to 10.14.2beta3, and the bug is fixed! Perhaps you guys could do the same to confirm? Cheers, -- ____________________________________________________________ Sean McBride, B. Eng sean at rogue-research.com Rogue Research www.rogue-research.com Mac Software Developer Montr?al, Qu?bec, Canada From eric.fahlgren at smith-nephew.com Mon Nov 19 17:20:31 2018 From: eric.fahlgren at smith-nephew.com (Fahlgren, Eric) Date: Mon, 19 Nov 2018 22:20:31 +0000 Subject: [vtkusers] announce: VTK 8.2.0.rc1 is ready to try In-Reply-To: References: Message-ID: Did the v8.1.2 and v8.2.0.rc1 tags get pushed out to gitlab/github yet? I?ve been trying to check them out, and they don?t appear to be there. > git clone https://gitlab.kitware.com/vtk/vtk.git Cloning into 'vtk'... blah blah blah? > cd vtk/ > git checkout v8.1.2 error: pathspec 'v8.1.2' did not match any file(s) known to git. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Mon Nov 19 18:06:50 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Mon, 19 Nov 2018 18:06:50 -0500 Subject: [vtkusers] announce: VTK 8.2.0.rc1 is ready to try In-Reply-To: References: Message-ID: No not yet, I've been out of the office. Will do shortly. David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Mon, Nov 19, 2018 at 5:20 PM Fahlgren, Eric < eric.fahlgren at smith-nephew.com> wrote: > Did the v8.1.2 and v8.2.0.rc1 tags get pushed out to gitlab/github yet? > I?ve been trying to check them out, and they don?t appear to be there. > > > > > git clone https://gitlab.kitware.com/vtk/vtk.git > > Cloning into 'vtk'... > > blah blah blah? > > > > > cd vtk/ > > > git checkout v8.1.2 > > error: pathspec 'v8.1.2' did not match any file(s) known to git. > > > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 pdhahn at compintensehpc.com Mon Nov 19 17:20:38 2018 From: pdhahn at compintensehpc.com (Paul Douglas Hahn) Date: Mon, 19 Nov 2018 16:20:38 -0600 Subject: [vtkusers] vtkChartXY: custom label text for axes In-Reply-To: <834D5000-1EAD-40D6-A300-CAE4F6A330B6@gmail.com> References: <834D5000-1EAD-40D6-A300-CAE4F6A330B6@gmail.com> Message-ID: <661c7208-6ba2-80ad-1f67-1c612fa9a049@compintensehpc.com> Yes. At least for VTK 8.1, see for example /VTK_ROOT//Charts/Core/Testing/Cxx/TestStackedPlot.cxx; the code calls SetCustomTickPositions() to set month labels along the X axis. On 11/19/2018 10:04 AM, Romain LEGUAY wrote: > Hello everyone, > > I try to use vtkChartXY. > I use QChartTable.cxx example as starting point. > > I can do practically all things I want except to customize the label text for the axes. > > For example, for the X-axis, I want to put a string instead of the ? real ? value contained in the vtkFloatArray. > > Is-it possible? > > Thank you, > > Romain > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: 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 eric.fahlgren at smith-nephew.com Mon Nov 19 18:15:58 2018 From: eric.fahlgren at smith-nephew.com (Fahlgren, Eric) Date: Mon, 19 Nov 2018 23:15:58 +0000 Subject: [vtkusers] announce: VTK 8.2.0.rc1 is ready to try In-Reply-To: References: Message-ID: Thanks! From: David E DeMarle Sent: Monday, November 19, 2018 3:07 PM To: Fahlgren, Eric ; Ben Boeckel Cc: vtkusers at vtk.org Subject: Re: [vtkusers] announce: VTK 8.2.0.rc1 is ready to try No not yet, I've been out of the office. Will do shortly. David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Mon, Nov 19, 2018 at 5:20 PM Fahlgren, Eric > wrote: Did the v8.1.2 and v8.2.0.rc1 tags get pushed out to gitlab/github yet? I?ve been trying to check them out, and they don?t appear to be there. > git clone https://gitlab.kitware.com/vtk/vtk.git Cloning into 'vtk'... blah blah blah? > cd vtk/ > git checkout v8.1.2 error: pathspec 'v8.1.2' did not match any file(s) known to git. _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: 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 iamdpak at gmail.com Mon Nov 19 20:22:35 2018 From: iamdpak at gmail.com (vinmean) Date: Mon, 19 Nov 2018 18:22:35 -0700 (MST) Subject: [vtkusers] vtkProjectedTexture example In-Reply-To: <57EE86D11538B44096C712532DBB6C5A0131C17E0450@DKFZEX01.ad.dkfz-heidelberg.de> References: <41A97F3464883247A39A022E96C3DD50924EC405@mail-server.ntb.ch> <1436811191010-5732867.post@n5.nabble.com> <57EE86D11538B44096C712532DBB6C5A0131C17E0450@DKFZEX01.ad.dkfz-heidelberg.de> Message-ID: <1542676955420-0.post@n5.nabble.com> Hi, I am stuck with my texture projection application. The texture that I project gets applied to the entire poly data. Do you know how to restrict the projection within the region of focus? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From dave.demarle at kitware.com Mon Nov 19 23:04:18 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Mon, 19 Nov 2018 23:04:18 -0500 Subject: [vtkusers] Build VTK 8.2.0 in Windows with VS 2017 (15.9) In-Reply-To: <702003951.3224995.1542436131221@mail.yahoo.com> References: <702003951.3224995.1542436131221.ref@mail.yahoo.com> <702003951.3224995.1542436131221@mail.yahoo.com> Message-ID: I think that either your visual studio is configured incorrectly or you picked the wrong generator from cmake. Either one could explain why cmake cannot find that compiler helper application when it tried to set up vtk. David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Sat, Nov 17, 2018 at 1:28 AM Leonid Dulman via vtkusers < vtkusers at public.kitware.com> wrote: > Hi to all > I can not to configure CMAKE to build VTK-8.2 with Visual Studio 2017 > (last update 15.9) > I have got next message > > CMake Error at CMakeLists.txt:7 (project): > Failed to run MSBuild command: > > MSBuild.exe > > to get the value of VCTargetsPath: > can not found this file > > Thank you for any help. Leonid > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 mikhail.sazonov at opencascade.com Tue Nov 20 04:52:20 2018 From: mikhail.sazonov at opencascade.com (Mikhail SAZONOV) Date: Tue, 20 Nov 2018 09:52:20 +0000 Subject: [vtkusers] vtkQuadricDecimation does not propagate Pedigree IDs to output Message-ID: Hello, I am wondering if there is possibility to propagate Pedigree IDs of cells from input of vtkQuadricDecimation to its output. I was tried many ways, with and without pipelines. Every time the array of pedigree ids is a null pointer.
  vtkSmartPointer aPolyData = vtkSmartPointer::New ();
  vtkSmartPointer aVertData = vtkSmartPointer::New ();
 aPolyData->SetPoints (aVertData);
...
  vtkSmartPointer aIdFilter = vtkIdFilter::New ();
  aIdFilter->SetInputData (aPolyData);
  aIdFilter->SetFieldData (1);
  aIdFilter->SetPointIds (0);
  aIdFilter->SetCellIds (1);
  aIdFilter->SetIdsArrayName ("id");

  vtkSmartPointer anAlgo = vtkSmartPointer::New();
  anAlgo->SetInputConnection (aIdFilter->GetOutputPort ());
  anAlgo->SetTargetReduction (theTargetRatio);
  anAlgo->Update ();

  auto* aNewPolyData = anAlgo->GetOutput();
  vtkIntArray* aNewPedIds = static_cast(aNewPolyData->GetCellData()->GetPedigreeIds());
aNewPedIds is null. Thanks in advance. Best regards, Mikhail -------------- next part -------------- An HTML attachment was scrubbed... URL: From mikhail.sazonov at opencascade.com Tue Nov 20 05:02:01 2018 From: mikhail.sazonov at opencascade.com (Mikhail SAZONOV) Date: Tue, 20 Nov 2018 10:02:01 +0000 Subject: [vtkusers] vtkQuadricDecimation does not propagate Pedigree IDs to output Message-ID: Hello, I am wondering if there is possibility to propagate Pedigree IDs of cells from input of vtkQuadricDecimation to its output. I was tried many ways, with and without pipelines. Every time the array of pedigree ids is a null pointer.
  vtkSmartPointer aPolyData = vtkSmartPointer::New ();
  vtkSmartPointer aVertData = vtkSmartPointer::New ();
 aPolyData->SetPoints (aVertData);
...
  vtkSmartPointer aIdFilter = vtkIdFilter::New ();
  aIdFilter->SetInputData (aPolyData);
  aIdFilter->SetFieldData (1);
  aIdFilter->SetPointIds (0);
  aIdFilter->SetCellIds (1);
  aIdFilter->SetIdsArrayName ("id");

  vtkSmartPointer anAlgo = vtkSmartPointer::New();
  anAlgo->SetInputConnection (aIdFilter->GetOutputPort ());
  anAlgo->SetTargetReduction (theTargetRatio);
  anAlgo->Update ();

  auto* aNewPolyData = anAlgo->GetOutput();
  vtkIntArray* aNewPedIds = static_cast(aNewPolyData->GetCellData()->GetPedigreeIds());
aNewPedIds is null. Thanks in advance. Best regards, Mikhail -------------- next part -------------- An HTML attachment was scrubbed... URL: From sfaisal.ali91 at gmail.com Tue Nov 20 08:51:17 2018 From: sfaisal.ali91 at gmail.com (sfaisalali91) Date: Tue, 20 Nov 2018 06:51:17 -0700 (MST) Subject: [vtkusers] VtkResliceImageViewer cordinate system (world and display) Message-ID: <1542721877714-0.post@n5.nabble.com> Hey Guys, Can someone please help me with understanding of display cordinates and world cordinates on the image plane represented in vtkResliceImageViewer. I am trying to add a node(restricted to a particular slice) on sagittal view and replicate the same on coronal and axial views , based on others opinions i tried two approaches , *1) using vtkCordinate* int pickPosition[2]; vtkRenderWindowInteractor *rwi = dynamic_cast< vtkRenderWindowInteractor * >(caller); rwi->GetEventPosition(pickPosition); vtkSmartPointer coordinate = vtkSmartPointer::New(); coordinate->SetCoordinateSystemToDisplay(); coordinate->SetValue(pickPosition[0], pickPosition[1], 0); double* world = coordinate->GetComputedWorldValue(this->RIW[0]->GetRenderer()); int* Display = coordinate->GetComputedDisplayValue(this->RIW[0]->GetRenderer()); std::cout << "Mouse World coordinate: " << world[0] << ", " << world[1] << ", " << world[2] << std::endl; std::cout << "Mouse Display coordinate: " << Display[0] << ", " << Display[1] << ", " << Display[2] << std::endl; *2) using vtkPropPicker* vtkImageActor* actor = this->RIW[0]->GetImageActor(); vtkSmartPointer m_propPicker = vtkSmartPointer::New(); m_propPicker->PickFromListOn(); m_propPicker->AddPickList(actor); this->RIW[0]->GetImageActor()->InterpolateOff(); m_propPicker->Pick(pickPosition[0], pickPosition[1], 0.0, this->RIW[0]->GetRenderer()); vtkAssemblyPath* path = m_propPicker->GetPath(); bool validPick = false; if (path) { vtkCollectionSimpleIterator sit; path->InitTraversal(sit); vtkAssemblyNode *node; for (int i = 0; i < path->GetNumberOfItems() && !validPick; ++i) { node = path->GetNextNode(sit); if (actor == vtkImageActor::SafeDownCast(node->GetViewProp())) {validPick = true;} } } if (!validPick){return;} double pos[3]; m_propPicker->GetPickPosition(pos); std::cout << "Picker World coordinate: " << pos[0] << ", " << pos[1] << ", " << pos[2] << std::endl; I am able to achieve the conversion from display to world, but there is a shift in points when visualized in other two views, to fix this i implemented the logic below. I believe that always first slice cordinates are being considered rather than the current slice. int image_coordinate[3]; int axis = this->RIW[0]->GetSliceOrientation(); switch (axis) { case vtkImageViewer2::SLICE_ORIENTATION_XZ: image_coordinate[0] = vtkMath::Round(pos[0]); image_coordinate[1] = this->RIW[1]->GetSlice(); image_coordinate[2] = vtkMath::Round(pos[2]); break; case vtkImageViewer2::SLICE_ORIENTATION_YZ: image_coordinate[0] = (this->RIW[0]->GetSliceMax())-(this->RIW[0]->GetSlice()); image_coordinate[1] = vtkMath::Round(pos[1]); image_coordinate[2] = vtkMath::Round(pos[2]); break; default: // vtkImageViewer2::SLICE_ORIENTATION_XY image_coordinate[0] = vtkMath::Round(pos[0]); image_coordinate[1] = vtkMath::Round(pos[1]); image_coordinate[2] = this->RIW[2]->GetSlice(); break; } Still no luck, please can someone guide me with what have i been missing in this logic!? *Note* - Reslice cursor widget is disabled in all views.* Thank you for the help in advance. Regards Syed Faisal Ali -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From gavin.wheeler at kcl.ac.uk Tue Nov 20 10:00:36 2018 From: gavin.wheeler at kcl.ac.uk (Wheeler, Gavin) Date: Tue, 20 Nov 2018 15:00:36 +0000 Subject: [vtkusers] World Units In-Reply-To: References: Message-ID: We?ve not been using OpenVR directly, but have been using it indirectly with medical data. We ended up using m as the real world units, and then scaling loaded medical data by a factor of 1000 to convert from the commonly used mm, to m. This has worked well, but there are the odd gotchas when doing this? watch out for things like volume rendering step size which you may also need to scale. Gavin Wheeler From: vtkusers On Behalf Of Ken Martin Sent: 19 November 2018 16:22 To: Dave Demarle Cc: vtkusers at public.kitware.com Subject: Re: [vtkusers] World Units Although the OpenVR module does use the notion of a physical to world transformation to map between meters in the VR room and the world coordinates. On Mon, Nov 19, 2018 at 9:57 AM David E DeMarle > wrote: vtk itself is unitless. it is up to the application to keep track of that. David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Mon, Nov 19, 2018 at 9:53 AM Matthew Troke > wrote: What units are world dimensions in VTK? For example, if I create a cube that is 1.0 in width, is that considered to be 1 meter, 1 cm, etc? Or are they unitless and defined by the source data? I assume if you are loading in some type of medical data, units are important. Matt -- Matthew Troke Software Engineer [http://www.avalonholographics.com/img/logo.png] Office: 1-709-701-0239 Email: matthew.troke at avalonholographics.com This email and any attachments are confidential and may be privileged. Any unauthorized use, disclosure, copying or distribution of the information received is prohibited. If you are not the intended recipient please contact the sender immediately by return email confirming that you have and will delete all communications related to the email and any attachments sent to you in error. _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: 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 -- 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 david.gobbi at gmail.com Tue Nov 20 10:13:27 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 20 Nov 2018 08:13:27 -0700 Subject: [vtkusers] World Units In-Reply-To: References: Message-ID: Hi Gavin, Using mm for medical image data (with the exception of microscopy) is the most common choice. I certainly wouldn't recommend using anything else. I've also noticed the need to tweak volume rendering depending on resolution. David On Tue, Nov 20, 2018 at 8:00 AM Wheeler, Gavin via vtkusers < vtkusers at public.kitware.com> wrote: > We?ve not been using OpenVR directly, but have been using it indirectly > with medical data. We ended up using m as the real world units, and then > scaling loaded medical data by a factor of 1000 to convert from the > commonly used mm, to m. This has worked well, but there are the odd gotchas > when doing this? watch out for things like volume rendering step size which > you may also need to scale. > > > > Gavin Wheeler > > > > *From:* vtkusers *On Behalf Of *Ken > Martin > *Sent:* 19 November 2018 16:22 > *To:* Dave Demarle > *Cc:* vtkusers at public.kitware.com > *Subject:* Re: [vtkusers] World Units > > > > Although the OpenVR module does use the notion of a physical to world > transformation to map between meters in the VR room and the world > coordinates. > > > > > > On Mon, Nov 19, 2018 at 9:57 AM David E DeMarle > wrote: > > vtk itself is unitless. it is up to the application to keep track of that. > > > > David E DeMarle > Kitware, Inc. > Principal Engineer > 21 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-881-4909 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From caseywang777 at gmail.com Tue Nov 20 14:30:01 2018 From: caseywang777 at gmail.com (caseywang777) Date: Tue, 20 Nov 2018 12:30:01 -0700 (MST) Subject: [vtkusers] Volume rendering - cannot make the image semi-transparecy Message-ID: <1542742201771-0.post@n5.nabble.com> Hi, I am using VTK to do volume rendering for IEEE SciVis 2018 contest. This is the time step I am using, http://oceans11.lanl.gov/deepwaterimpact/yA31/300x300x300-FourScalars_resolution/pv_insitu_300x300x300_30068.vti I found that I cannot make the data (semi)transparent even if I have already set the opacity to very low (lower than 0.001). My question is how can I make it transparent? Or do I do anything wrong? The following is the code (Python-vtk) import vtk import numpy as np import vtk.util.numpy_support as VN fileName = '/home/caseywang777/Downloads/pv_insitu_300x300x300_30068.vti' #download from http://oceans11.lanl.gov/deepwaterimpact/yA31/300x300x300-FourScalars_resolution/pv_insitu_300x300x300_30068.vti colors = vtk.vtkNamedColors() ren1 = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren1) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) # Create the reader for the data. # reader = vtk.vtkStructuredPointsReader() # reader.SetFileName(fileName) # Create the reader for the data reader = vtk.vtkXMLImageDataReader() reader.SetFileName(fileName) reader.Update() # specify the data array in the file to process reader.GetOutput().GetPointData().SetActiveAttribute('v02',0) # convert the data array to numpy array and get the min and maximum valule dary = VN.vtk_to_numpy(reader.GetOutput().GetPointData().GetScalars('v02')) dMax = np.amax(dary) #data min value dMin = np.amin(dary) #data max value dRange = dMax - dMin # Create transfer mapping scalar value to opacity. opacityTransferFunction = vtk.vtkPiecewiseFunction() opacityTransferFunction.AddPoint(dMin, 0.0) #opacityTransferFunction.AddPoint(dMin + dRange/2, 0.005) opacityTransferFunction.AddPoint(dMax, 0.001) ###### very small, still opaque # Create transfer mapping scalar value to color. colorTransferFunction = vtk.vtkColorTransferFunction() colorTransferFunction.AddRGBPoint(dMin, 0.2, 0.0, 0.0) colorTransferFunction.AddRGBPoint(dMin + (dRange/4)*1, 1.0, 0.0, 0.0) colorTransferFunction.AddRGBPoint(dMin + (dRange/4)*2, 0.0, 0.0, 1.0) colorTransferFunction.AddRGBPoint(dMin + (dRange/4)*3, 0.0, 1.0, 0.0) colorTransferFunction.AddRGBPoint(dMin + (dRange/4)*4, 0.0, 0.2, 0.0) # The property describes how the data will look. volumeProperty = vtk.vtkVolumeProperty() volumeProperty.SetColor(colorTransferFunction) volumeProperty.SetScalarOpacity(opacityTransferFunction) volumeProperty.ShadeOn() volumeProperty.SetInterpolationTypeToLinear() # The mapper / ray cast function know how to render the data. # volumeMapper = vtk.vtkFixedPointVolumeRayCastMapper() # too slow? does not work? volumeMapper = vtk.vtkGPUVolumeRayCastMapper() volumeMapper.SetInputConnection(reader.GetOutputPort()) # The volume holds the mapper and the property and # can be used to position/orient the volume. volume = vtk.vtkVolume() volume.SetMapper(volumeMapper) volume.SetProperty(volumeProperty) ren1.AddVolume(volume) ren1.SetBackground(colors.GetColor3d("Wheat")) ren1.GetActiveCamera().Azimuth(45) ren1.GetActiveCamera().Elevation(30) ren1.ResetCameraClippingRange() ren1.ResetCamera() renWin.SetSize(600, 600) renWin.Render() iren.Start() Thanks foro you help!! -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From elvis.stansvik at orexplore.com Tue Nov 20 14:54:48 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Tue, 20 Nov 2018 20:54:48 +0100 Subject: [vtkusers] Volume rendering - cannot make the image semi-transparecy In-Reply-To: <1542742201771-0.post@n5.nabble.com> References: <1542742201771-0.post@n5.nabble.com> Message-ID: I haven't finished downloading all of your example data file yet, but I can already see that it has a very large Spacing: [estan at newton H?mtningar]$ head pv_insitu_300x300x300_30068.vti.part 1604.21 30068 [estan at newton H?mtningar]$ Try adjusting the ScalarOpacityUnitDistance of your vtkVolumeProperty to account for this. E.g. set it to something like 10000. See the docs for that property for more info: https://www.vtk.org/doc/nightly/html/classvtkVolumeProperty.html#a7dfb2d52c36821254ed078ce00cdab2a "Set/Get the unit distance on which the scalar opacity transfer function is defined. By default this is 1.0, meaning that over a distance of 1.0 units, a given opacity (from the transfer function) is accumulated. This is adjusted for the actual sampling distance during rendering." Elvis Den tis 20 nov. 2018 kl 20:30 skrev caseywang777 : > > > Hi, > > I am using VTK to do volume rendering for IEEE SciVis 2018 contest. > This is the time step I am using, > http://oceans11.lanl.gov/deepwaterimpact/yA31/300x300x300-FourScalars_resolution/pv_insitu_300x300x300_30068.vti > > I found that I cannot make the data (semi)transparent even if I have > already set the opacity to very low (lower than 0.001). > My question is how can I make it transparent? Or do I do anything wrong? > > The following is the code (Python-vtk) > > > import vtk > import numpy as np > import vtk.util.numpy_support as VN > > fileName = '/home/caseywang777/Downloads/pv_insitu_300x300x300_30068.vti' > #download from > http://oceans11.lanl.gov/deepwaterimpact/yA31/300x300x300-FourScalars_resolution/pv_insitu_300x300x300_30068.vti > > colors = vtk.vtkNamedColors() > ren1 = vtk.vtkRenderer() > renWin = vtk.vtkRenderWindow() > renWin.AddRenderer(ren1) > iren = vtk.vtkRenderWindowInteractor() > iren.SetRenderWindow(renWin) > > # Create the reader for the data. > # reader = vtk.vtkStructuredPointsReader() > # reader.SetFileName(fileName) > # Create the reader for the data > reader = vtk.vtkXMLImageDataReader() > reader.SetFileName(fileName) > reader.Update() > > # specify the data array in the file to process > reader.GetOutput().GetPointData().SetActiveAttribute('v02',0) > > # convert the data array to numpy array and get the min and maximum valule > dary = VN.vtk_to_numpy(reader.GetOutput().GetPointData().GetScalars('v02')) > dMax = np.amax(dary) #data min value > dMin = np.amin(dary) #data max value > dRange = dMax - dMin > > # Create transfer mapping scalar value to opacity. > opacityTransferFunction = vtk.vtkPiecewiseFunction() > opacityTransferFunction.AddPoint(dMin, 0.0) > #opacityTransferFunction.AddPoint(dMin + dRange/2, 0.005) > opacityTransferFunction.AddPoint(dMax, 0.001) ###### very small, still > opaque > > # Create transfer mapping scalar value to color. > colorTransferFunction = vtk.vtkColorTransferFunction() > colorTransferFunction.AddRGBPoint(dMin, 0.2, 0.0, 0.0) > colorTransferFunction.AddRGBPoint(dMin + (dRange/4)*1, 1.0, 0.0, 0.0) > colorTransferFunction.AddRGBPoint(dMin + (dRange/4)*2, 0.0, 0.0, 1.0) > colorTransferFunction.AddRGBPoint(dMin + (dRange/4)*3, 0.0, 1.0, 0.0) > colorTransferFunction.AddRGBPoint(dMin + (dRange/4)*4, 0.0, 0.2, 0.0) > > # The property describes how the data will look. > volumeProperty = vtk.vtkVolumeProperty() > volumeProperty.SetColor(colorTransferFunction) > volumeProperty.SetScalarOpacity(opacityTransferFunction) > volumeProperty.ShadeOn() > volumeProperty.SetInterpolationTypeToLinear() > > # The mapper / ray cast function know how to render the data. > # volumeMapper = vtk.vtkFixedPointVolumeRayCastMapper() # too slow? does > not work? > volumeMapper = vtk.vtkGPUVolumeRayCastMapper() > volumeMapper.SetInputConnection(reader.GetOutputPort()) > > # The volume holds the mapper and the property and > # can be used to position/orient the volume. > volume = vtk.vtkVolume() > volume.SetMapper(volumeMapper) > volume.SetProperty(volumeProperty) > > ren1.AddVolume(volume) > ren1.SetBackground(colors.GetColor3d("Wheat")) > ren1.GetActiveCamera().Azimuth(45) > ren1.GetActiveCamera().Elevation(30) > ren1.ResetCameraClippingRange() > ren1.ResetCamera() > > renWin.SetSize(600, 600) > renWin.Render() > > iren.Start() > > > > Thanks foro you help!! > > > > > -- > 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 From caseywang777 at gmail.com Tue Nov 20 15:06:00 2018 From: caseywang777 at gmail.com (caseywang777) Date: Tue, 20 Nov 2018 13:06:00 -0700 (MST) Subject: [vtkusers] Volume rendering - cannot make the image semi-transparecy In-Reply-To: References: <1542742201771-0.post@n5.nabble.com> Message-ID: <1542744360951-0.post@n5.nabble.com> Hi, Elvis, Yes, this solves my problem. :) Thank you very much, Bests, KC -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From elvis.stansvik at orexplore.com Tue Nov 20 15:09:41 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Tue, 20 Nov 2018 21:09:41 +0100 Subject: [vtkusers] Volume rendering - cannot make the image semi-transparecy In-Reply-To: <1542744360951-0.post@n5.nabble.com> References: <1542742201771-0.post@n5.nabble.com> <1542744360951-0.post@n5.nabble.com> Message-ID: Den tis 20 nov. 2018 kl 21:06 skrev caseywang777 : > > Hi, Elvis, > > Yes, this solves my problem. :) > > Thank you very much, No problem, glad it worked out. Cheers, Elvis > Bests, > KC > > > > > -- > 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 From jcfr at kitware.com Tue Nov 20 15:13:54 2018 From: jcfr at kitware.com (Jean-Christophe Fillion-Robin) Date: Tue, 20 Nov 2018 14:13:54 -0600 Subject: [vtkusers] World Units In-Reply-To: References: Message-ID: Hi Gavin, If you are working with medical data, you could look at 3D slicer ( https://slicer.org), it leverages VTK and ITK and also has the notion of units built-in. Hth Jc On Tue, Nov 20, 2018, 9:13 AM David Gobbi Hi Gavin, > > Using mm for medical image data (with the exception of microscopy) is the > most common choice. I certainly wouldn't recommend using anything else. > I've also noticed the need to tweak volume rendering depending on > resolution. > > David > > > On Tue, Nov 20, 2018 at 8:00 AM Wheeler, Gavin via vtkusers < > vtkusers at public.kitware.com> wrote: > >> We?ve not been using OpenVR directly, but have been using it indirectly >> with medical data. We ended up using m as the real world units, and then >> scaling loaded medical data by a factor of 1000 to convert from the >> commonly used mm, to m. This has worked well, but there are the odd gotchas >> when doing this? watch out for things like volume rendering step size which >> you may also need to scale. >> >> >> >> Gavin Wheeler >> >> >> >> *From:* vtkusers *On Behalf Of *Ken >> Martin >> *Sent:* 19 November 2018 16:22 >> *To:* Dave Demarle >> *Cc:* vtkusers at public.kitware.com >> *Subject:* Re: [vtkusers] World Units >> >> >> >> Although the OpenVR module does use the notion of a physical to world >> transformation to map between meters in the VR room and the world >> coordinates. >> >> >> >> >> >> On Mon, Nov 19, 2018 at 9:57 AM David E DeMarle >> wrote: >> >> vtk itself is unitless. it is up to the application to keep track of that. >> >> >> >> David E DeMarle >> Kitware, Inc. >> Principal Engineer >> 21 Corporate Drive >> Clifton Park, NY 12065-8662 >> Phone: 518-881-4909 >> >> _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 anpedroni at gmail.com Tue Nov 20 15:48:56 2018 From: anpedroni at gmail.com (Andreas Pedroni) Date: Tue, 20 Nov 2018 21:48:56 +0100 Subject: [vtkusers] CreateRepeatingTimer Loop with memory Message-ID: Dear list Is there a way to use a RepeatingTimer as in this example: https://www.vtk.org/Wiki/VTK/Examples/Python/Animation in which the loop for the animation (in the example the method execute()) can return output in each iteration that is used in the the next iteration? In other words, is there a way to use information that is calculated in one iteration for the next iteration? Sorry, I am not sure if the question is understandable. best Andreas -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Tue Nov 20 16:06:42 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Tue, 20 Nov 2018 22:06:42 +0100 Subject: [vtkusers] CreateRepeatingTimer Loop with memory In-Reply-To: References: Message-ID: Den tis 20 nov. 2018 kl 21:49 skrev Andreas Pedroni : > > Dear list > > Is there a way to use a RepeatingTimer as in this example: https://www.vtk.org/Wiki/VTK/Examples/Python/Animation in which the loop for the animation (in the example the method execute()) can return output in each iteration that is used in the the next iteration? In other words, is there a way to use information that is calculated in one iteration for the next iteration? Sorry, I am not sure if the question is understandable. I think you have your answer right there in that example :) In each iteration, the self.timer_count field holds the output from the previous iteration. So yes, I think you can simply save the output from one iteration in a field of the callback class, and use that as input in the next iteration. Hope that makes sense. Cheers, Elvis > > best > Andreas > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers From david.gobbi at gmail.com Tue Nov 20 16:24:10 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 20 Nov 2018 14:24:10 -0700 Subject: [vtkusers] CreateRepeatingTimer Loop with memory In-Reply-To: References: Message-ID: Basically what Elvis said: you can store whatever you want in the callback. For example, you can do this: cb.actor = actor cb.mapper = mapper And then in the callback execute() method, you can do whatever you want with cb.mapper, i.e. you can give the mapper a new input. Whether you really want to do this, though, depends on exactly what you are trying to achieve at each iteration. If you just want to adjust the position or orientation, then it's best to just do something similar to what the example does. Actually getting the output and using it as the next input is computationally expensive, whereas changing the position and orientation of an actor is cheap. If you are hoping to get the output of the Render() and feed it back into the mapper, that is actually impossible. The Render() draws to the screen, so its output is a 2D bitmap, which isn't something you can feed back into the pipeline as a replacement of the original polydata. David On Tue, Nov 20, 2018 at 2:07 PM Elvis Stansvik wrote: > Den tis 20 nov. 2018 kl 21:49 skrev Andreas Pedroni : > > > > Dear list > > > > Is there a way to use a RepeatingTimer as in this example: > https://www.vtk.org/Wiki/VTK/Examples/Python/Animation in which the loop > for the animation (in the example the method execute()) can return output > in each iteration that is used in the the next iteration? In other words, > is there a way to use information that is calculated in one iteration for > the next iteration? Sorry, I am not sure if the question is understandable. > > I think you have your answer right there in that example :) In each > iteration, the self.timer_count field holds the output from the > previous iteration. > > So yes, I think you can simply save the output from one iteration in a > field of the callback class, and use that as input in the next > iteration. > > Hope that makes sense. > > Cheers, > Elvis > > > > > best > > Andreas > -------------- next part -------------- An HTML attachment was scrubbed... URL: From polly_sukting at hotmail.com Wed Nov 21 01:01:36 2018 From: polly_sukting at hotmail.com (Polly Pui) Date: Wed, 21 Nov 2018 06:01:36 +0000 Subject: [vtkusers] Extract csv row and column into points In-Reply-To: References: , Message-ID: Hi Cory, Thanks for your reply. I followed your advice and changed the lines as you mentioned. But I still couldn't get the output successfully. I would like to clarify if I called the column of interest correctly. Please refer to the attachment. The columns that to be called as X,Y,Z coordinates are named as "X", "Y", "Z". When i run the exe file. It failed to load and couldn't get the correct cluster. This is the codes that I am using. .............. int main(int argc, char* argv[]) { std::string inputFilename = argv[1]; vtkSmartPointer reader = vtkSmartPointer::New(); reader->SetFileName(inputFilename.c_str()); reader->SetFieldDelimiterCharacters(","); reader->DetectNumericColumnsOn(); //reader->GetHaveHeaders(); reader->Update(); ///////KmeansCluster vtkSmartPointer kMeansStatistics = vtkSmartPointer::New(); kMeansStatistics->SetInputConnection(reader->GetOutputPort()); kMeansStatistics->SetColumnStatus("X", 1); kMeansStatistics->SetColumnStatus("Y", 1); kMeansStatistics->SetColumnStatus("Z", 1); kMeansStatistics->RequestSelectedColumns(); kMeansStatistics->SetAssessOption(true); kMeansStatistics->SetDefaultNumberOfClusters(5); //kMeansStatistics->SetLearnOption(1);//to learn the cluster value kMeansStatistics->SetMaxNumIterations(15); kMeansStatistics->Update(); //// Display the results in CMD (each row) kMeansStatistics->GetOutput()->Dump(); ////Group the points according to ID number vtkSmartPointer clusterArray = vtkSmartPointer::New(); clusterArray->SetNumberOfComponents(1); clusterArray->SetName("ClusterId"); for (int r = 0; r < kMeansStatistics->GetOutput()->GetNumberOfRows(); r++) { vtkVariant v = kMeansStatistics->GetOutput()->GetValue(r, kMeansStatistics->GetOutput()->GetNumberOfColumns() - 1); std::cout << "Point " << r << " is in cluster " << v.ToInt() << std::endl; clusterArray->InsertNextValue(v.ToInt()); } //// Create a lookup table to map cell data to colors vtkSmartPointer lut = vtkSmartPointer::New(); int tableSize = (kMeansStatistics + 1, 10); lut->SetNumberOfTableValues(tableSize); lut->Build(); ////ColorCells vtkSmartPointer colors = vtkSmartPointer::New(); lut->SetTableValue(0, colors->GetColor4d("Black").GetData()); lut->SetTableValue(1, colors->GetColor4d("Banana").GetData()); lut->SetTableValue(2, colors->GetColor4d("Tomato").GetData()); lut->SetTableValue(3, colors->GetColor4d("Peacock").GetData()); lut->SetTableValue(4, colors->GetColor4d("Lavender").GetData()); lut->SetTableValue(5, colors->GetColor4d("Flesh").GetData()); lut->SetTableValue(6, colors->GetColor4d("Raspberry").GetData()); lut->SetTableValue(7, colors->GetColor4d("Salmon").GetData()); lut->SetTableValue(8, colors->GetColor4d("Mint").GetData()); lut->SetTableValue(9, colors->GetColor4d("Wheat").GetData()); // Output the cluster centers vtkMultiBlockDataSet* outputMetaDS = vtkMultiBlockDataSet::SafeDownCast(kMeansStatistics->GetOutputDataObject(vtkStatisticsAlgorithm::OUTPUT_MODEL)); vtkTable* outputMeta = vtkTable::SafeDownCast(outputMetaDS->GetBlock(0)); vtkDoubleArray* coord0 = vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("X")); vtkDoubleArray* coord1 = vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("Y")); vtkDoubleArray* coord2 = vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("Z")); for (unsigned int i = 0; i < coord0->GetNumberOfTuples(); ++i) { std::cout << coord0->GetValue(i) << " " << coord1->GetValue(i) << " " << coord2->GetValue(i) << std::endl; } vtkSmartPointer t2pd = vtkSmartPointer::New(); t2pd->SetInputConnection(kMeansStatistics->GetOutputPort()); t2pd->SetXColumn("X"); t2pd->SetYColumn("Y"); t2pd->SetZColumn("Z"); vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(t2pd->GetOutputPort()); vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); actor->GetProperty()->SetPointSize(3); actor->GetProperty()->SetColor(1, 1, 1); vtkSmartPointer renderer = vtkSmartPointer::New(); vtkSmartPointer renderWindow = vtkSmartPointer::New(); renderWindow->AddRenderer(renderer); renderWindow->SetSize(640, 480); vtkSmartPointer renderWindowInteractor = vtkSmartPointer::New(); renderWindowInteractor->SetRenderWindow(renderWindow); //renderer->AddActor(actor); renderer->SetBackground(0, 0, 0); // Background color black renderWindow->Render(); renderWindowInteractor->Start(); return EXIT_SUCCESS; } ......... Please advice. Thank you again! Regards, Polly ________________________________ From: Cory Quammen Sent: Monday, November 19, 2018 10:52 PM To: Polly Pui Cc: vtkusers Subject: Re: [vtkusers] Extract csv row and column into points On Thu, Nov 15, 2018 at 1:26 AM Polly Pui > wrote: Hi Cory, Thanks for your reply. I edited my codes by following your advice. However, I am not able to visualize the point of cluster and got an error message. I have a few questions here. Is it possible to call VTK unstructured grid data into vtkKmeansStatistics? No, vtkKMeansStatistics requires a vtkTable input (it is a subclass of vtkTableAlgorithm). vtkTable is different from a vtkPolyData, which is what you are trying to create. See more inline comments further down. Actually what i wanted to do is very simple. I want to read my csv or vtk file and then cluster the points using kmeansclustering. Initially, I extracted points from csv file manually and I could get my desired output. But it is too time consuming. Currently, I want to input the csv or vtk file and get the cluster automatically and store in a datasheet. I attach my code as follows: #include #include "library.h" #include #include #include #include #include std::string inputFilename = argv[1]; vtkSmartPointer reader = vtkSmartPointer::New(); reader->SetFileName(inputFilename.c_str()); reader->SetFieldDelimiterCharacters(","); reader->DetectNumericColumnsOn(); reader->Update(); ///////KmeansCluster vtkSmartPointer kMeansStatistics = vtkSmartPointer::New(); kMeansStatistics->SetInputConnection(reader->GetOutputPort()); kMeansStatistics->SetColumnStatus("Column 3", 1); kMeansStatistics->SetColumnStatus("Column 4", 1); kMeansStatistics->SetColumnStatus("Column 5", 1); kMeansStatistics->RequestSelectedColumns(); kMeansStatistics->SetAssessOption(true); kMeansStatistics->SetDefaultNumberOfClusters(2); //kMeansStatistics->SetMaxNumIterations(15); kMeansStatistics->Update(); // Display the results in CMD (each row) kMeansStatistics->GetOutput()->Dump(); //Group the points according to ID number vtkSmartPointer clusterArray = vtkSmartPointer::New(); clusterArray->SetNumberOfComponents(1); clusterArray->SetName("ClusterId"); for (int r = 0; r < kMeansStatistics->GetOutput()->GetNumberOfRows(); r++) { vtkVariant v = kMeansStatistics->GetOutput()->GetValue(r, kMeansStatistics->GetOutput()->GetNumberOfColumns() - 1); std::cout << "Point " << r << " is in cluster " << v.ToInt() << std::endl; clusterArray->InsertNextValue(v.ToInt()); } // Create a lookup table to map cell data to colors vtkSmartPointer lut = vtkSmartPointer::New(); int tableSize = (kMeansStatistics + 1, 10); lut->SetNumberOfTableValues(tableSize); lut->Build(); //ColorCells vtkSmartPointer colors = vtkSmartPointer::New(); lut->SetTableValue(0, colors->GetColor4d("Black").GetData()); lut->SetTableValue(1, colors->GetColor4d("Banana").GetData()); lut->SetTableValue(2, colors->GetColor4d("Tomato").GetData()); lut->SetTableValue(3, colors->GetColor4d("Peacock").GetData()); lut->SetTableValue(4, colors->GetColor4d("Lavender").GetData()); lut->SetTableValue(5, colors->GetColor4d("Flesh").GetData()); lut->SetTableValue(6, colors->GetColor4d("Raspberry").GetData()); lut->SetTableValue(7, colors->GetColor4d("Salmon").GetData()); lut->SetTableValue(8, colors->GetColor4d("Mint").GetData()); lut->SetTableValue(9, colors->GetColor4d("Wheat").GetData()); // Output the cluster centers vtkMultiBlockDataSet* outputMetaDS = vtkMultiBlockDataSet::SafeDownCast(kMeansStatistics->GetOutputDataObject(vtkStatisticsAlgorithm::OUTPUT_MODEL)); vtkSmartPointer outputMeta = vtkTable::SafeDownCast(outputMetaDS->GetBlock(0)); //vtkSmartPointer outputMeta = vtkTable::SafeDownCast( outputMetaDS->GetBlock( 1 ) ); vtkDoubleArray* coord0 = vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("Column 0")); vtkDoubleArray* coord1 = vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("Column 1")); vtkDoubleArray* coord2 = vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("Column 2")); for (unsigned int i = 0; i < coord0->GetNumberOfTuples(); ++i) { std::cout << coord0->GetValue(i) << " " << coord1->GetValue(i) << " " << coord2->GetValue(i) << std::endl; } vtkSmartPointer polydata = vtkSmartPointer::New(); polydata->GetPointData()->SetScalars(clusterArray); The below won't work. vtkKMeansStatistics produces a vtkTable, while the vtkPolyDataMapper requires a vtkPolyData. To convert a vtkTable to a vtkPolyData, which is the key piece you are missing, use vtkTableToPolyData. This class iterates over the rows, treats the columns you designate as X, Y, Z coordinates, and adds the remaining columns as point data arrays in the output vtkPolyData. It will look something like this: vtkSmartPointer t2pd = vtkSmartPointer::New(); t2pd->SetInputConnection(kMeansStatistics->GetOutputPort()); t2pd->SetXColumn("name of column to be used as x-coordinate"); t2pd->SetYColumn("name of column to be used as y-coordinate"); t2pd->SetZColumn("name of column to be used as z-coordinate"); Now, change, the code below from: vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(kMeansStatistics->GetOutputPort()); to vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(t2pd->GetOutputPort()); That should do it. Cory vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); actor->GetProperty()->SetPointSize(3); actor->GetProperty()->SetColor(1, 0, 0); vtkSmartPointer renderer = vtkSmartPointer::New(); vtkSmartPointer renderWindow = vtkSmartPointer::New(); renderWindow->AddRenderer(renderer); renderWindow->SetSize(640, 480); vtkSmartPointer renderWindowInteractor = vtkSmartPointer::New(); renderWindowInteractor->SetRenderWindow(renderWindow); renderer->AddActor(actor); renderer->SetBackground(0, 0, 0); // Background color black renderWindow->Render(); renderWindowInteractor->Start(); return EXIT_SUCCESS; } Thank you so much. Regards, Polly ________________________________ From: Cory Quammen > Sent: Tuesday, November 13, 2018 11:34 PM To: Polly Pui Cc: vtkusers Subject: Re: [vtkusers] Extract csv row and column into points Ah, so you want to use the vtkKMeansStatistics filter. That filter operates on vtkTable data. To use it, you don't need to create points at all. Instead, you can connect the vtkDelimitedTextReader directly to the vtkKMeansStatistics filter like so: vtkSmartPointer kMeansStatistics = vtkSmartPointer::New(); kMeansStatistics->SetInputConnection(reader->GetOutputPort()); kMeansStatistics->SetColumnStatus("column1", 1); kMeansStatistics->SetColumnStatus("column2", 1); kMeansStatistics->SetColumnStatus("column3, 1); kMeansStatistics->RequestSelectedColumns(); kMeansStatistics->SetAssessOption(true); kMeansStatistics->SetDefaultNumberOfClusters(1); //kMeansStatistics->SetMaxNumIterations(15); kMeansStatistics->Update(); Here, I've altered your calls to SetColumnStatus() under the assumption you know the column names of interest. HTH, Cory On Fri, Nov 9, 2018 at 10:16 AM Polly Pui > wrote: Hi, Thanks for your reply. Is it possible to have more elaborations from you? How can I get the number of points from vtkTableToPolyData? I got an error saying that vtkTableToPolyData has no members of GetNumberOfPoints. I need those points to proceed to KmeansStatistics. This is my code: ...... std::string inputFilename = argv[1]; vtkSmartPointer reader = vtkSmartPointer::New(); reader->SetFileName(inputFilename.c_str()); reader->SetFieldDelimiterCharacters(" "); reader->DetectNumericColumnsOn(); reader->Update(); int numberOfRows = reader->GetOutput()->GetNumberOfRows(); vtkSmartPointer inputData = vtkSmartPointer::New(); inputData->SetInputConnection(reader->GetOutputPort); for (int c = 0; c < 3; ++c) { std::stringstream colName; colName << "coord " << c; vtkSmartPointer doubleArray = vtkSmartPointer::New(); doubleArray->SetNumberOfComponents(1); doubleArray->SetName(colName.str().c_str()); doubleArray->SetNumberOfTuples(inputData->GetNumberOfPoints()); for (int r = 0; r < inputData->GetNumberOfPoints(); ++r) { double p[3]; inputData->GetPoint(r, p); doubleArray->SetValue(r, p[c]); } inputData->AddColumn(doubleArray); } vtkSmartPointer kMeansStatistics = vtkSmartPointer::New(); #if VTK_MAJOR_VERSION <= 5 kMeansStatistics->SetInput(vtkStatisticsAlgorithm::INPUT_DATA, inputData); #else kMeansStatistics->SetInputData(vtkStatisticsAlgorithm::INPUT_DATA, inputData); #endif kMeansStatistics->SetColumnStatus(inputData->GetColumnName(0), 1); kMeansStatistics->SetColumnStatus(inputData->GetColumnName(1), 1); kMeansStatistics->SetColumnStatus(inputData->GetColumnName(2), 1); kMeansStatistics->RequestSelectedColumns(); kMeansStatistics->SetAssessOption(true); kMeansStatistics->SetDefaultNumberOfClusters(1); //kMeansStatistics->SetMaxNumIterations(15); kMeansStatistics->Update(); Thanks again. Regards, Polly ________________________________ From: Cory Quammen > Sent: Friday, November 9, 2018 10:07 PM To: Polly Pui Cc: vtkusers Subject: Re: [vtkusers] Extract csv row and column into points vtkDelimitedTextReader -> vtkTableToPolyData is a pipeline that should make this much simpler. On Fri, Nov 9, 2018 at 1:14 AM Polly Pui > wrote: Hi, Is there any clue that i can extract the row and column data from a csv file and read them as points? Currently I am using vtkpoints to read points by inserting points manually to my .cpp . Is it possible for me to call the csv directly and read the data (eg. column 3-5, row 2-10)? I attach my code here. ...... int main(int, char*[]) { vtkSmartPointer points = vtkSmartPointer::New(); points->InsertNextPoint(8.4312, -36.489, -1500.7); points->InsertNextPoint(8.8408, -37.726, -1500.4); points->InsertNextPoint(11.372, -37.787, -1501.5); points->InsertNextPoint(11.263, -36.384, -1501.9); points->InsertNextPoint(9.3914, -40.819, -1500.8); points->InsertNextPoint(11.685, -42.482, -1502.7); points->InsertNextPoint(14.235, -38.096, -1503.5); points->InsertNextPoint(13.972, -43.051, -1504.2); points->InsertNextPoint(9.22, -43.904, -1504); vtkSmartPointer inputData = vtkSmartPointer::New(); for (int c = 0; c < 3; ++c) { std::stringstream colName; colName << "coord " << c; vtkSmartPointer doubleArray = vtkSmartPointer::New(); doubleArray->SetNumberOfComponents(1); doubleArray->SetName(colName.str().c_str()); doubleArray->SetNumberOfTuples(points->GetNumberOfPoints()); for (int r = 0; r < points->GetNumberOfPoints(); ++r) { double p[3]; points->GetPoint(r, p); doubleArray->SetValue(r, p[c]); } inputData->AddColumn(doubleArray); } Thank you very much. Regards, Polly _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: 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. -- Cory Quammen Staff R&D Engineer Kitware, Inc. -- Cory Quammen Staff R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: CSV.jpg Type: image/jpeg Size: 512449 bytes Desc: CSV.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Error.jpg Type: image/jpeg Size: 306192 bytes Desc: Error.jpg URL: From polly_sukting at hotmail.com Wed Nov 21 01:16:46 2018 From: polly_sukting at hotmail.com (Polly Pui) Date: Wed, 21 Nov 2018 06:16:46 +0000 Subject: [vtkusers] Extract csv row and column into points In-Reply-To: References: , , Message-ID: And also I tried to remove the lines in order to test if the columns are called successfully. I received the error stated "Failed to locate the columns to use for the point coordinates". These are the codes: std::string inputFilename = argv[1]; vtkSmartPointer reader = vtkSmartPointer::New(); reader->SetFileName(inputFilename.c_str()); reader->SetFieldDelimiterCharacters(","); reader->DetectNumericColumnsOn(); //reader->GetHaveHeaders(); reader->Update(); reader->GetOutput()->Dump(); ///////KmeansCluster vtkSmartPointer kMeansStatistics = vtkSmartPointer::New(); kMeansStatistics->SetInputConnection(reader->GetOutputPort()); kMeansStatistics->SetColumnStatus("X", 1); kMeansStatistics->SetColumnStatus("Y", 1); kMeansStatistics->SetColumnStatus("Z", 1); kMeansStatistics->RequestSelectedColumns(); kMeansStatistics->SetAssessOption(true); kMeansStatistics->SetDefaultNumberOfClusters(5); //kMeansStatistics->SetLearnOption(1);//to learn the cluster value kMeansStatistics->SetMaxNumIterations(15); kMeansStatistics->Update(); vtkSmartPointer t2pd = vtkSmartPointer::New(); t2pd->SetInputConnection(kMeansStatistics->GetOutputPort()); t2pd->SetXColumn("X"); t2pd->SetYColumn("Y"); t2pd->SetZColumn("Z"); vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(t2pd->GetOutputPort()); vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); actor->GetProperty()->SetPointSize(3); actor->GetProperty()->SetColor(1, 1, 1); vtkSmartPointer renderer = vtkSmartPointer::New(); vtkSmartPointer renderWindow = vtkSmartPointer::New(); renderWindow->AddRenderer(renderer); renderWindow->SetSize(640, 480); vtkSmartPointer renderWindowInteractor = vtkSmartPointer::New(); renderWindowInteractor->SetRenderWindow(renderWindow); renderer->AddActor(actor); renderer->SetBackground(0, 0, 0); // Background color black renderWindow->Render(); renderWindowInteractor->Start(); return EXIT_SUCCESS; } I supposed the column of interest to be called are "X", "Y" and "Z". Please advice. Thank you very much. Regards, Polly ________________________________ From: vtkusers on behalf of Polly Pui Sent: Wednesday, November 21, 2018 2:01 PM To: Cory Quammen Cc: vtkusers Subject: Re: [vtkusers] Extract csv row and column into points Hi Cory, Thanks for your reply. I followed your advice and changed the lines as you mentioned. But I still couldn't get the output successfully. I would like to clarify if I called the column of interest correctly. Please refer to the attachment. The columns that to be called as X,Y,Z coordinates are named as "X", "Y", "Z". When i run the exe file. It failed to load and couldn't get the correct cluster. This is the codes that I am using. .............. int main(int argc, char* argv[]) { std::string inputFilename = argv[1]; vtkSmartPointer reader = vtkSmartPointer::New(); reader->SetFileName(inputFilename.c_str()); reader->SetFieldDelimiterCharacters(","); reader->DetectNumericColumnsOn(); //reader->GetHaveHeaders(); reader->Update(); ///////KmeansCluster vtkSmartPointer kMeansStatistics = vtkSmartPointer::New(); kMeansStatistics->SetInputConnection(reader->GetOutputPort()); kMeansStatistics->SetColumnStatus("X", 1); kMeansStatistics->SetColumnStatus("Y", 1); kMeansStatistics->SetColumnStatus("Z", 1); kMeansStatistics->RequestSelectedColumns(); kMeansStatistics->SetAssessOption(true); kMeansStatistics->SetDefaultNumberOfClusters(5); //kMeansStatistics->SetLearnOption(1);//to learn the cluster value kMeansStatistics->SetMaxNumIterations(15); kMeansStatistics->Update(); //// Display the results in CMD (each row) kMeansStatistics->GetOutput()->Dump(); ////Group the points according to ID number vtkSmartPointer clusterArray = vtkSmartPointer::New(); clusterArray->SetNumberOfComponents(1); clusterArray->SetName("ClusterId"); for (int r = 0; r < kMeansStatistics->GetOutput()->GetNumberOfRows(); r++) { vtkVariant v = kMeansStatistics->GetOutput()->GetValue(r, kMeansStatistics->GetOutput()->GetNumberOfColumns() - 1); std::cout << "Point " << r << " is in cluster " << v.ToInt() << std::endl; clusterArray->InsertNextValue(v.ToInt()); } //// Create a lookup table to map cell data to colors vtkSmartPointer lut = vtkSmartPointer::New(); int tableSize = (kMeansStatistics + 1, 10); lut->SetNumberOfTableValues(tableSize); lut->Build(); ////ColorCells vtkSmartPointer colors = vtkSmartPointer::New(); lut->SetTableValue(0, colors->GetColor4d("Black").GetData()); lut->SetTableValue(1, colors->GetColor4d("Banana").GetData()); lut->SetTableValue(2, colors->GetColor4d("Tomato").GetData()); lut->SetTableValue(3, colors->GetColor4d("Peacock").GetData()); lut->SetTableValue(4, colors->GetColor4d("Lavender").GetData()); lut->SetTableValue(5, colors->GetColor4d("Flesh").GetData()); lut->SetTableValue(6, colors->GetColor4d("Raspberry").GetData()); lut->SetTableValue(7, colors->GetColor4d("Salmon").GetData()); lut->SetTableValue(8, colors->GetColor4d("Mint").GetData()); lut->SetTableValue(9, colors->GetColor4d("Wheat").GetData()); // Output the cluster centers vtkMultiBlockDataSet* outputMetaDS = vtkMultiBlockDataSet::SafeDownCast(kMeansStatistics->GetOutputDataObject(vtkStatisticsAlgorithm::OUTPUT_MODEL)); vtkTable* outputMeta = vtkTable::SafeDownCast(outputMetaDS->GetBlock(0)); vtkDoubleArray* coord0 = vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("X")); vtkDoubleArray* coord1 = vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("Y")); vtkDoubleArray* coord2 = vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("Z")); for (unsigned int i = 0; i < coord0->GetNumberOfTuples(); ++i) { std::cout << coord0->GetValue(i) << " " << coord1->GetValue(i) << " " << coord2->GetValue(i) << std::endl; } vtkSmartPointer t2pd = vtkSmartPointer::New(); t2pd->SetInputConnection(kMeansStatistics->GetOutputPort()); t2pd->SetXColumn("X"); t2pd->SetYColumn("Y"); t2pd->SetZColumn("Z"); vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(t2pd->GetOutputPort()); vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); actor->GetProperty()->SetPointSize(3); actor->GetProperty()->SetColor(1, 1, 1); vtkSmartPointer renderer = vtkSmartPointer::New(); vtkSmartPointer renderWindow = vtkSmartPointer::New(); renderWindow->AddRenderer(renderer); renderWindow->SetSize(640, 480); vtkSmartPointer renderWindowInteractor = vtkSmartPointer::New(); renderWindowInteractor->SetRenderWindow(renderWindow); //renderer->AddActor(actor); renderer->SetBackground(0, 0, 0); // Background color black renderWindow->Render(); renderWindowInteractor->Start(); return EXIT_SUCCESS; } ......... Please advice. Thank you again! Regards, Polly ________________________________ From: Cory Quammen Sent: Monday, November 19, 2018 10:52 PM To: Polly Pui Cc: vtkusers Subject: Re: [vtkusers] Extract csv row and column into points On Thu, Nov 15, 2018 at 1:26 AM Polly Pui > wrote: Hi Cory, Thanks for your reply. I edited my codes by following your advice. However, I am not able to visualize the point of cluster and got an error message. I have a few questions here. Is it possible to call VTK unstructured grid data into vtkKmeansStatistics? No, vtkKMeansStatistics requires a vtkTable input (it is a subclass of vtkTableAlgorithm). vtkTable is different from a vtkPolyData, which is what you are trying to create. See more inline comments further down. Actually what i wanted to do is very simple. I want to read my csv or vtk file and then cluster the points using kmeansclustering. Initially, I extracted points from csv file manually and I could get my desired output. But it is too time consuming. Currently, I want to input the csv or vtk file and get the cluster automatically and store in a datasheet. I attach my code as follows: #include #include "library.h" #include #include #include #include #include std::string inputFilename = argv[1]; vtkSmartPointer reader = vtkSmartPointer::New(); reader->SetFileName(inputFilename.c_str()); reader->SetFieldDelimiterCharacters(","); reader->DetectNumericColumnsOn(); reader->Update(); ///////KmeansCluster vtkSmartPointer kMeansStatistics = vtkSmartPointer::New(); kMeansStatistics->SetInputConnection(reader->GetOutputPort()); kMeansStatistics->SetColumnStatus("Column 3", 1); kMeansStatistics->SetColumnStatus("Column 4", 1); kMeansStatistics->SetColumnStatus("Column 5", 1); kMeansStatistics->RequestSelectedColumns(); kMeansStatistics->SetAssessOption(true); kMeansStatistics->SetDefaultNumberOfClusters(2); //kMeansStatistics->SetMaxNumIterations(15); kMeansStatistics->Update(); // Display the results in CMD (each row) kMeansStatistics->GetOutput()->Dump(); //Group the points according to ID number vtkSmartPointer clusterArray = vtkSmartPointer::New(); clusterArray->SetNumberOfComponents(1); clusterArray->SetName("ClusterId"); for (int r = 0; r < kMeansStatistics->GetOutput()->GetNumberOfRows(); r++) { vtkVariant v = kMeansStatistics->GetOutput()->GetValue(r, kMeansStatistics->GetOutput()->GetNumberOfColumns() - 1); std::cout << "Point " << r << " is in cluster " << v.ToInt() << std::endl; clusterArray->InsertNextValue(v.ToInt()); } // Create a lookup table to map cell data to colors vtkSmartPointer lut = vtkSmartPointer::New(); int tableSize = (kMeansStatistics + 1, 10); lut->SetNumberOfTableValues(tableSize); lut->Build(); //ColorCells vtkSmartPointer colors = vtkSmartPointer::New(); lut->SetTableValue(0, colors->GetColor4d("Black").GetData()); lut->SetTableValue(1, colors->GetColor4d("Banana").GetData()); lut->SetTableValue(2, colors->GetColor4d("Tomato").GetData()); lut->SetTableValue(3, colors->GetColor4d("Peacock").GetData()); lut->SetTableValue(4, colors->GetColor4d("Lavender").GetData()); lut->SetTableValue(5, colors->GetColor4d("Flesh").GetData()); lut->SetTableValue(6, colors->GetColor4d("Raspberry").GetData()); lut->SetTableValue(7, colors->GetColor4d("Salmon").GetData()); lut->SetTableValue(8, colors->GetColor4d("Mint").GetData()); lut->SetTableValue(9, colors->GetColor4d("Wheat").GetData()); // Output the cluster centers vtkMultiBlockDataSet* outputMetaDS = vtkMultiBlockDataSet::SafeDownCast(kMeansStatistics->GetOutputDataObject(vtkStatisticsAlgorithm::OUTPUT_MODEL)); vtkSmartPointer outputMeta = vtkTable::SafeDownCast(outputMetaDS->GetBlock(0)); //vtkSmartPointer outputMeta = vtkTable::SafeDownCast( outputMetaDS->GetBlock( 1 ) ); vtkDoubleArray* coord0 = vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("Column 0")); vtkDoubleArray* coord1 = vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("Column 1")); vtkDoubleArray* coord2 = vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("Column 2")); for (unsigned int i = 0; i < coord0->GetNumberOfTuples(); ++i) { std::cout << coord0->GetValue(i) << " " << coord1->GetValue(i) << " " << coord2->GetValue(i) << std::endl; } vtkSmartPointer polydata = vtkSmartPointer::New(); polydata->GetPointData()->SetScalars(clusterArray); The below won't work. vtkKMeansStatistics produces a vtkTable, while the vtkPolyDataMapper requires a vtkPolyData. To convert a vtkTable to a vtkPolyData, which is the key piece you are missing, use vtkTableToPolyData. This class iterates over the rows, treats the columns you designate as X, Y, Z coordinates, and adds the remaining columns as point data arrays in the output vtkPolyData. It will look something like this: vtkSmartPointer t2pd = vtkSmartPointer::New(); t2pd->SetInputConnection(kMeansStatistics->GetOutputPort()); t2pd->SetXColumn("name of column to be used as x-coordinate"); t2pd->SetYColumn("name of column to be used as y-coordinate"); t2pd->SetZColumn("name of column to be used as z-coordinate"); Now, change, the code below from: vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(kMeansStatistics->GetOutputPort()); to vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(t2pd->GetOutputPort()); That should do it. Cory vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); actor->GetProperty()->SetPointSize(3); actor->GetProperty()->SetColor(1, 0, 0); vtkSmartPointer renderer = vtkSmartPointer::New(); vtkSmartPointer renderWindow = vtkSmartPointer::New(); renderWindow->AddRenderer(renderer); renderWindow->SetSize(640, 480); vtkSmartPointer renderWindowInteractor = vtkSmartPointer::New(); renderWindowInteractor->SetRenderWindow(renderWindow); renderer->AddActor(actor); renderer->SetBackground(0, 0, 0); // Background color black renderWindow->Render(); renderWindowInteractor->Start(); return EXIT_SUCCESS; } Thank you so much. Regards, Polly ________________________________ From: Cory Quammen > Sent: Tuesday, November 13, 2018 11:34 PM To: Polly Pui Cc: vtkusers Subject: Re: [vtkusers] Extract csv row and column into points Ah, so you want to use the vtkKMeansStatistics filter. That filter operates on vtkTable data. To use it, you don't need to create points at all. Instead, you can connect the vtkDelimitedTextReader directly to the vtkKMeansStatistics filter like so: vtkSmartPointer kMeansStatistics = vtkSmartPointer::New(); kMeansStatistics->SetInputConnection(reader->GetOutputPort()); kMeansStatistics->SetColumnStatus("column1", 1); kMeansStatistics->SetColumnStatus("column2", 1); kMeansStatistics->SetColumnStatus("column3, 1); kMeansStatistics->RequestSelectedColumns(); kMeansStatistics->SetAssessOption(true); kMeansStatistics->SetDefaultNumberOfClusters(1); //kMeansStatistics->SetMaxNumIterations(15); kMeansStatistics->Update(); Here, I've altered your calls to SetColumnStatus() under the assumption you know the column names of interest. HTH, Cory On Fri, Nov 9, 2018 at 10:16 AM Polly Pui > wrote: Hi, Thanks for your reply. Is it possible to have more elaborations from you? How can I get the number of points from vtkTableToPolyData? I got an error saying that vtkTableToPolyData has no members of GetNumberOfPoints. I need those points to proceed to KmeansStatistics. This is my code: ...... std::string inputFilename = argv[1]; vtkSmartPointer reader = vtkSmartPointer::New(); reader->SetFileName(inputFilename.c_str()); reader->SetFieldDelimiterCharacters(" "); reader->DetectNumericColumnsOn(); reader->Update(); int numberOfRows = reader->GetOutput()->GetNumberOfRows(); vtkSmartPointer inputData = vtkSmartPointer::New(); inputData->SetInputConnection(reader->GetOutputPort); for (int c = 0; c < 3; ++c) { std::stringstream colName; colName << "coord " << c; vtkSmartPointer doubleArray = vtkSmartPointer::New(); doubleArray->SetNumberOfComponents(1); doubleArray->SetName(colName.str().c_str()); doubleArray->SetNumberOfTuples(inputData->GetNumberOfPoints()); for (int r = 0; r < inputData->GetNumberOfPoints(); ++r) { double p[3]; inputData->GetPoint(r, p); doubleArray->SetValue(r, p[c]); } inputData->AddColumn(doubleArray); } vtkSmartPointer kMeansStatistics = vtkSmartPointer::New(); #if VTK_MAJOR_VERSION <= 5 kMeansStatistics->SetInput(vtkStatisticsAlgorithm::INPUT_DATA, inputData); #else kMeansStatistics->SetInputData(vtkStatisticsAlgorithm::INPUT_DATA, inputData); #endif kMeansStatistics->SetColumnStatus(inputData->GetColumnName(0), 1); kMeansStatistics->SetColumnStatus(inputData->GetColumnName(1), 1); kMeansStatistics->SetColumnStatus(inputData->GetColumnName(2), 1); kMeansStatistics->RequestSelectedColumns(); kMeansStatistics->SetAssessOption(true); kMeansStatistics->SetDefaultNumberOfClusters(1); //kMeansStatistics->SetMaxNumIterations(15); kMeansStatistics->Update(); Thanks again. Regards, Polly ________________________________ From: Cory Quammen > Sent: Friday, November 9, 2018 10:07 PM To: Polly Pui Cc: vtkusers Subject: Re: [vtkusers] Extract csv row and column into points vtkDelimitedTextReader -> vtkTableToPolyData is a pipeline that should make this much simpler. On Fri, Nov 9, 2018 at 1:14 AM Polly Pui > wrote: Hi, Is there any clue that i can extract the row and column data from a csv file and read them as points? Currently I am using vtkpoints to read points by inserting points manually to my .cpp . Is it possible for me to call the csv directly and read the data (eg. column 3-5, row 2-10)? I attach my code here. ...... int main(int, char*[]) { vtkSmartPointer points = vtkSmartPointer::New(); points->InsertNextPoint(8.4312, -36.489, -1500.7); points->InsertNextPoint(8.8408, -37.726, -1500.4); points->InsertNextPoint(11.372, -37.787, -1501.5); points->InsertNextPoint(11.263, -36.384, -1501.9); points->InsertNextPoint(9.3914, -40.819, -1500.8); points->InsertNextPoint(11.685, -42.482, -1502.7); points->InsertNextPoint(14.235, -38.096, -1503.5); points->InsertNextPoint(13.972, -43.051, -1504.2); points->InsertNextPoint(9.22, -43.904, -1504); vtkSmartPointer inputData = vtkSmartPointer::New(); for (int c = 0; c < 3; ++c) { std::stringstream colName; colName << "coord " << c; vtkSmartPointer doubleArray = vtkSmartPointer::New(); doubleArray->SetNumberOfComponents(1); doubleArray->SetName(colName.str().c_str()); doubleArray->SetNumberOfTuples(points->GetNumberOfPoints()); for (int r = 0; r < points->GetNumberOfPoints(); ++r) { double p[3]; points->GetPoint(r, p); doubleArray->SetValue(r, p[c]); } inputData->AddColumn(doubleArray); } Thank you very much. Regards, Polly _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: 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. -- Cory Quammen Staff R&D Engineer Kitware, Inc. -- Cory Quammen Staff R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From peterhczaja at gmail.com Wed Nov 21 02:14:21 2018 From: peterhczaja at gmail.com (Peter Czaja) Date: Wed, 21 Nov 2018 07:14:21 +0000 Subject: [vtkusers] Mayavi and VTK Message-ID: Hi Guys, I've downloaded the 32 bit windows exe file vtkpython-6.3.0-Windows-32bit.exe and have installed into C:\Program Files\VTK 6.3.0. When I use pip to install mayavi as - pip install mayavi, the install comes back with an error saying vtk not found ! Any ideas ? Peter From anpedroni at gmail.com Wed Nov 21 03:04:04 2018 From: anpedroni at gmail.com (Andreas Pedroni) Date: Wed, 21 Nov 2018 09:04:04 +0100 Subject: [vtkusers] CreateRepeatingTimer Loop with memory In-Reply-To: References: Message-ID: Thanks a lot David and Elvis, I?ll try your suggestion tonight. And sorry for the rather stupid question. I?m both new to Python and VTK and at times struggling at different fronts, especially with oop. :) David, actually, I need this updating mechanism to temporally smooth some movement of one of the actors and for this I need to store previous movements. all the best Andreas > Am 20.11.2018 um 22:24 schrieb David Gobbi : > > Basically what Elvis said: you can store whatever you want in the callback. > For example, you can do this: > > cb.actor = actor > cb.mapper = mapper > > And then in the callback execute() method, you can do whatever you want with cb.mapper, i.e. you can give the mapper a new input. > > Whether you really want to do this, though, depends on exactly what you are trying to achieve at each iteration. If you just want to adjust the position or orientation, then it's best to just do something similar to what the example does. Actually getting the output and using it as the next input is computationally expensive, whereas changing the position and orientation of an actor is cheap. > > If you are hoping to get the output of the Render() and feed it back into the mapper, that is actually impossible. The Render() draws to the screen, so its output is a 2D bitmap, which isn't something you can feed back into the pipeline as a replacement of the original polydata. > > David > > > > On Tue, Nov 20, 2018 at 2:07 PM Elvis Stansvik > wrote: > Den tis 20 nov. 2018 kl 21:49 skrev Andreas Pedroni >: > > > > Dear list > > > > Is there a way to use a RepeatingTimer as in this example: https://www.vtk.org/Wiki/VTK/Examples/Python/Animation in which the loop for the animation (in the example the method execute()) can return output in each iteration that is used in the the next iteration? In other words, is there a way to use information that is calculated in one iteration for the next iteration? Sorry, I am not sure if the question is understandable. > > I think you have your answer right there in that example :) In each > iteration, the self.timer_count field holds the output from the > previous iteration. > > So yes, I think you can simply save the output from one iteration in a > field of the callback class, and use that as input in the next > iteration. > > Hope that makes sense. > > Cheers, > Elvis > > > > > best > > Andreas -------------- next part -------------- An HTML attachment was scrubbed... URL: From matusikova.lucia at gmail.com Wed Nov 21 05:28:47 2018 From: matusikova.lucia at gmail.com (Lucy) Date: Wed, 21 Nov 2018 03:28:47 -0700 (MST) Subject: [vtkusers] Rendering and refreshing windowRender in C# Message-ID: <1542796127539-0.post@n5.nabble.com> Hi, I created application in C#, that contains renderWindowControl, some trackbars to set parameters for Marching cubes algorithm and button to apply. After running the app, window will appear, but nothing will be rendered and after setting parameters, the original window closes, new opens and nothing happens. How to render output from polyDataMapper?And how do i update renderwindow so that it can view change (after setting parameters) in real time? ---- code ---- public Form1() { InitializeComponent(); } public void renderWindowControl1_Load(object sender, EventArgs e) { try { MarchingCubes(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Exception", MessageBoxButtons.OK); } } private void applyButton_Click(object sender, EventArgs e) { MarchingCubes(); } private void MarchingCubes() { marching cubes code ..... vtkPolyDataMapper mapper = vtkPolyDataMapper.New(); mapper.SetInputConnection(surface.GetOutputPort()); mapper.ScalarVisibilityOff(); vtkActor actor = vtkActor.New(); actor.SetMapper(mapper); vtkRenderWindow renderWindow = renderWindowControl1.RenderWindow; vtkRenderer renderer = renderWindow.GetRenderers().GetFirstRenderer(); renderer.SetBackground(0, 0, 0); renderer.AddActor(actor); } Thanks, Lucy -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From marco.musy at gmail.com Wed Nov 21 05:54:04 2018 From: marco.musy at gmail.com (mmusy) Date: Wed, 21 Nov 2018 03:54:04 -0700 (MST) Subject: [vtkusers] CreateRepeatingTimer Loop with memory In-Reply-To: References: Message-ID: <1542797644674-0.post@n5.nabble.com> ..maybe it's "dirty" but one may achieve the same with using global variables (var in the example). BTW, the vtkInteractorStyleTrackballCamera has a weird behaviour in rotating the scene. from __future__ import print_function import vtk var = 0 class vtkTimerCallback(): def __init__(self): self.timer_count = 0 def execute(self,obj,event): global var print(self.timer_count, var) self.actor.SetPosition(self.timer_count, self.timer_count,0); iren = obj iren.GetRenderWindow().Render() self.timer_count += 1 var += 1 def main(): ... if __name__ == '__main__': main() -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From marco.musy at gmail.com Wed Nov 21 06:57:07 2018 From: marco.musy at gmail.com (mmusy) Date: Wed, 21 Nov 2018 04:57:07 -0700 (MST) Subject: [vtkusers] Animation performance with cell color In-Reply-To: References: Message-ID: <1542801427547-0.post@n5.nabble.com> I only see a drop from 60 fps to 40fps (with vtk 8.1.1, python 3.6, ubuntu workstation) -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From sfaisal.ali91 at gmail.com Wed Nov 21 08:30:08 2018 From: sfaisal.ali91 at gmail.com (sfaisalali91) Date: Wed, 21 Nov 2018 06:30:08 -0700 (MST) Subject: [vtkusers] VtkResliceImageViewer cordinate system (world and display) In-Reply-To: <1542721877714-0.post@n5.nabble.com> References: <1542721877714-0.post@n5.nabble.com> Message-ID: <1542807008857-0.post@n5.nabble.com> I modified my call back to pick a point and add a node on it , strangely i realized that when ever i click on the image, the prop picker returns NULL! Please can any one help me with this, i am using 3 vtkResliceImageViewers with orientations set to axial, coronal and saggital. and below is my call back for picking a point on sagittal view. if (ev == vtkCommand::LeftButtonPressEvent) { vtkRenderWindowInteractor *rwi = dynamic_cast< vtkRenderWindowInteractor * >(caller); int X = rwi->GetEventPosition()[0]; int Y = rwi->GetEventPosition()[1]; // Okay, making sure that the pick is in the current renderer if (!this->RIW[0]->GetRenderer() || !this->RIW[0]->GetRenderer()->IsInViewport(X, Y)) { return; } //PropPicker Initialized earlier this->PropPicker->Pick(X, Y, 0.0, this->RIW[0]->GetRenderer()); vtkAssemblyPath* path = this->PropPicker->GetPath(); int found = 0; int i; if (path != NULL) { // lets consider the possibility that we may be using a shared picker vtkCollectionSimpleIterator sit; path->InitTraversal(sit); vtkAssemblyNode *node; for (i = 0; i < path->GetNumberOfItems() && !found; ++i) { node = path->GetNextNode(sit); if (node->GetViewProp() == this->Prop) { found = 1; } } } if (found) { double q[3]; this->PropPicker->GetPickPosition(q); for (int i = 0; i < 3; i++) { NodeCreation(this->RIW[i], q[0], q[1], q[2]); this->RIW[i]->Render(); } } else { // the above implementation Always returns Null with no paths detected! why ??? return; } } Please can some one help me with this, Thank you. Regards Ali -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From david.gobbi at gmail.com Wed Nov 21 08:35:21 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 21 Nov 2018 06:35:21 -0700 Subject: [vtkusers] CreateRepeatingTimer Loop with memory In-Reply-To: <1542797644674-0.post@n5.nabble.com> References: <1542797644674-0.post@n5.nabble.com> Message-ID: Hi Marco, Yes, global variables could be used here, but global variables are evil ;) The issue with vtkInteractorStyleTrackballInteractor sounded familiar, so I searched the bugtracker: https://gitlab.kitware.com/vtk/vtk/issues/15966 http://vtk.1045678.n5.nabble.com/interaction-problem-after-timer-added-td5736076.html I just tried the code listed in the discussion, it looks like the bug is still present in VTK. David On Wed, Nov 21, 2018 at 3:54 AM mmusy wrote: > ..maybe it's "dirty" but one may achieve the same with using global > variables > (var in the example). > > BTW, the vtkInteractorStyleTrackballCamera has a weird behaviour in > rotating > the scene. > > > > from __future__ import print_function > import vtk > > var = 0 > > class vtkTimerCallback(): > def __init__(self): > self.timer_count = 0 > > def execute(self,obj,event): > global var > print(self.timer_count, var) > self.actor.SetPosition(self.timer_count, self.timer_count,0); > iren = obj > iren.GetRenderWindow().Render() > self.timer_count += 1 > var += 1 > > def main(): > ... > > > if __name__ == '__main__': > main() > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lriedel at iup.uni-heidelberg.de Wed Nov 21 08:46:08 2018 From: lriedel at iup.uni-heidelberg.de (Lukas Riedel) Date: Wed, 21 Nov 2018 14:46:08 +0100 Subject: [vtkusers] Wheels for Python3.7 ('pip3 install vtk' fails) Message-ID: <4640A5F0-2ADB-4FA3-8814-DFD3F19AB9D0@iup.uni-heidelberg.de> Hello, being able to install the VTK library for Python into a virtual environment is really handy. However, PyPI currently lacks wheels for the most recent version 3.7 of Python. Are there any plans for a release? The information reported by ?pip? is already quite confusing: $ python3 --version Python 3.7.1 $ python3 -m pip search vtk vtk (8.1.1) - VTK is an open-source toolkit for 3D computer graphics, image processing, and visualization [?] $ python3 -m pip install vtk Collecting vtk Could not find a version that satisfies the requirement vtk (from versions: ) No matching distribution found for vtk I realized there are no distributions of ?vtk? for Python 3.7 when looking at the files overview in PyPI, https://pypi.org/project/vtk/#files . I did not find any major issues concerning the compatibility of VTK with Python 3.7. Is there a reason no wheels have been distributed yet? Is there any way one can help? Thank you in advance! Lukas Riedel -------------- next part -------------- An HTML attachment was scrubbed... URL: From masterwangzx at gmail.com Wed Nov 21 09:07:32 2018 From: masterwangzx at gmail.com (Franks) Date: Wed, 21 Nov 2018 07:07:32 -0700 (MST) Subject: [vtkusers] Wheels for Python3.7 ('pip3 install vtk' fails) In-Reply-To: <4640A5F0-2ADB-4FA3-8814-DFD3F19AB9D0@iup.uni-heidelberg.de> References: <4640A5F0-2ADB-4FA3-8814-DFD3F19AB9D0@iup.uni-heidelberg.de> Message-ID: <1542809252440-0.post@n5.nabble.com> Hi,Lukas The current VTK in pip do not support python3.7. Solution: 1. You can use python3.6 or 3.5, 3.4. See the supported python version in the link https://pypi.org/project/vtk/#files 2. You can build VTK source with "VTK_WRAP_PYTHON" on. Frank -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From cory.quammen at kitware.com Wed Nov 21 09:21:37 2018 From: cory.quammen at kitware.com (Cory Quammen) Date: Wed, 21 Nov 2018 09:21:37 -0500 Subject: [vtkusers] Mayavi and VTK In-Reply-To: References: Message-ID: Hi Peter, I think you'll have better luck asking this question on a mayavi support forum or mailing list. Regards, Cory On Wed, Nov 21, 2018 at 2:14 AM Peter Czaja wrote: > Hi Guys, > > I've downloaded the 32 bit windows exe file > vtkpython-6.3.0-Windows-32bit.exe and have installed into C:\Program > Files\VTK 6.3.0. > > When I use pip to install mayavi as - pip install mayavi, the install > comes back with an error saying vtk not found ! > > Any ideas ? > > > Peter > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -- Cory Quammen Staff R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthew.troke at avalonholographics.com Wed Nov 21 09:28:29 2018 From: matthew.troke at avalonholographics.com (Matthew Troke) Date: Wed, 21 Nov 2018 10:58:29 -0330 Subject: [vtkusers] World Units In-Reply-To: References: Message-ID: Could you elaborate a little more on support for units in Slicer? What do you mean by "built-in"? Matt On Tue, Nov 20, 2018 at 10:41 PM Jean-Christophe Fillion-Robin < jcfr at kitware.com> wrote: > Hi Gavin, > > If you are working with medical data, you could look at 3D slicer ( > https://slicer.org), it leverages VTK and ITK and also has the notion of > units built-in. > > Hth > Jc > > On Tue, Nov 20, 2018, 9:13 AM David Gobbi >> Hi Gavin, >> >> Using mm for medical image data (with the exception of microscopy) is the >> most common choice. I certainly wouldn't recommend using anything else. >> I've also noticed the need to tweak volume rendering depending on >> resolution. >> >> David >> >> >> On Tue, Nov 20, 2018 at 8:00 AM Wheeler, Gavin via vtkusers < >> vtkusers at public.kitware.com> wrote: >> >>> We?ve not been using OpenVR directly, but have been using it indirectly >>> with medical data. We ended up using m as the real world units, and then >>> scaling loaded medical data by a factor of 1000 to convert from the >>> commonly used mm, to m. This has worked well, but there are the odd gotchas >>> when doing this? watch out for things like volume rendering step size which >>> you may also need to scale. >>> >>> >>> >>> Gavin Wheeler >>> >>> >>> >>> *From:* vtkusers *On Behalf Of *Ken >>> Martin >>> *Sent:* 19 November 2018 16:22 >>> *To:* Dave Demarle >>> *Cc:* vtkusers at public.kitware.com >>> *Subject:* Re: [vtkusers] World Units >>> >>> >>> >>> Although the OpenVR module does use the notion of a physical to world >>> transformation to map between meters in the VR room and the world >>> coordinates. >>> >>> >>> >>> >>> >>> On Mon, Nov 19, 2018 at 9:57 AM David E DeMarle < >>> dave.demarle at kitware.com> wrote: >>> >>> vtk itself is unitless. it is up to the application to keep track of >>> that. >>> >>> >>> >>> David E DeMarle >>> Kitware, Inc. >>> Principal Engineer >>> 21 Corporate Drive >>> Clifton Park, NY 12065-8662 >>> Phone: 518-881-4909 >>> >>> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> 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 > -- Matthew Troke Software Engineer Office: 1-709-701-0239 Email: matthew.troke at avalonholographics.com -- _This email and any attachments are confidential and may be privileged. Any unauthorized use, disclosure, copying or distribution of the information received is prohibited. If you are not the intended recipient please contact the sender immediately by return email confirming that you have and will delete all communications related to the email and any attachments sent to you in error._ -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.fahlgren at smith-nephew.com Wed Nov 21 09:37:43 2018 From: eric.fahlgren at smith-nephew.com (Fahlgren, Eric) Date: Wed, 21 Nov 2018 14:37:43 +0000 Subject: [vtkusers] Mayavi and VTK In-Reply-To: References: Message-ID: Peter, The old VTK .exe installers don?t create a manifest in the python site-packages directory (which is what pip uses to recognize their installation and to resolve dependencies). You might try ?pip install --no-deps mayavi? and see if that works. If it shows other dependencies, then you?ll need to install those separately as in ?pip install ?. Eric From: vtkusers On Behalf Of Cory Quammen Sent: Wednesday, November 21, 2018 6:22 AM To: peterhczaja at gmail.com Cc: vtkusers at public.kitware.com Subject: Re: [vtkusers] Mayavi and VTK Hi Peter, I think you'll have better luck asking this question on a mayavi support forum or mailing list. Regards, Cory On Wed, Nov 21, 2018 at 2:14 AM Peter Czaja > wrote: Hi Guys, I've downloaded the 32 bit windows exe file vtkpython-6.3.0-Windows-32bit.exe and have installed into C:\Program Files\VTK 6.3.0. When I use pip to install mayavi as - pip install mayavi, the install comes back with an error saying vtk not found ! Any ideas ? Peter _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: https://public.kitware.com/mailman/listinfo/vtkusers -- Cory Quammen Staff R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Wed Nov 21 09:41:21 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 21 Nov 2018 07:41:21 -0700 Subject: [vtkusers] Wheels for Python3.7 ('pip3 install vtk' fails) In-Reply-To: <1542809252440-0.post@n5.nabble.com> References: <4640A5F0-2ADB-4FA3-8814-DFD3F19AB9D0@iup.uni-heidelberg.de> <1542809252440-0.post@n5.nabble.com> Message-ID: Hi Lukas, There was a change in the Python 3.7 API that caused compatibility problems with VTK. This has been fixed in VTK 8.1.2, which was released a few days ago. Unfortunately I don't know the timeline for getting VTK 8.1.2 into PyPI. David On Wed, Nov 21, 2018 at 7:07 AM Franks wrote: > Hi,Lukas > > The current VTK in pip do not support python3.7. > > Solution: > 1. You can use python3.6 or 3.5, 3.4. See the supported python version in > the link https://pypi.org/project/vtk/#files > > 2. You can build VTK source with "VTK_WRAP_PYTHON" on. > > Frank > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.fahlgren at smith-nephew.com Wed Nov 21 09:42:09 2018 From: eric.fahlgren at smith-nephew.com (Fahlgren, Eric) Date: Wed, 21 Nov 2018 14:42:09 +0000 Subject: [vtkusers] Wheels for Python3.7 ('pip3 install vtk' fails) In-Reply-To: <1542809252440-0.post@n5.nabble.com> References: <4640A5F0-2ADB-4FA3-8814-DFD3F19AB9D0@iup.uni-heidelberg.de> <1542809252440-0.post@n5.nabble.com> Message-ID: Yup, like Frank says in #2, I just built 8.1.2 on Windows last night using Python 3.7.1 (3.7.0 can't be used, https://gitlab.kitware.com/vtk/vtk/issues/17363 ). Ran our full regression suite using those and it works just fine. -----Original Message----- From: vtkusers On Behalf Of Franks Sent: Wednesday, November 21, 2018 6:08 AM To: vtkusers at vtk.org Subject: Re: [vtkusers] Wheels for Python3.7 ('pip3 install vtk' fails) Hi,Lukas The current VTK in pip do not support python3.7. Solution: 1. You can use python3.6 or 3.5, 3.4. See the supported python version in the link https://pypi.org/project/vtk/#files 2. You can build VTK source with "VTK_WRAP_PYTHON" on. Frank -- 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 From david.gobbi at gmail.com Wed Nov 21 09:48:08 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 21 Nov 2018 07:48:08 -0700 Subject: [vtkusers] Wheels for Python3.7 ('pip3 install vtk' fails) In-Reply-To: References: <4640A5F0-2ADB-4FA3-8814-DFD3F19AB9D0@iup.uni-heidelberg.de> <1542809252440-0.post@n5.nabble.com> Message-ID: On Wed, Nov 21, 2018 at 7:42 AM Fahlgren, Eric < eric.fahlgren at smith-nephew.com> wrote: > Yup, like Frank says in #2, I just built 8.1.2 on Windows last night using > Python 3.7.1 (3.7.0 can't be used, > https://gitlab.kitware.com/vtk/vtk/issues/17363 ). Ran our full > regression suite using those and it works just fine. > To be fair, VTK 8.1.2 "mostly" works with the old Python 3.7.0 release. What doesn't work is the vtkpython executable and embedding the interpreter. Definitely recommend Python 3.7.1, though. David -------------- next part -------------- An HTML attachment was scrubbed... URL: From jjackso2 at matrox.com Wed Nov 21 09:58:52 2018 From: jjackso2 at matrox.com (jjackso2) Date: Wed, 21 Nov 2018 07:58:52 -0700 (MST) Subject: [vtkusers] Why does deletion of vtkpolydatamapper cause an infinite loop in vtkclearopenglerrors? In-Reply-To: References: Message-ID: <1542812332368-0.post@n5.nabble.com> It seems the issue is also present in another datapath. I am getting the same issue in vtkOpenGLRenderWindow.cxx with the infinite loop in vtkOpenGLRenderWindow::ReadPixels: 1116 while(glGetError() != GL_NO_ERROR) 1117 { 1118 ; 1119 } -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From masterwangzx at gmail.com Wed Nov 21 10:23:46 2018 From: masterwangzx at gmail.com (Franks) Date: Wed, 21 Nov 2018 08:23:46 -0700 (MST) Subject: [vtkusers] how to deal with the stl file Message-ID: <1542813826992-0.post@n5.nabble.com> Hi,list I use "vtkSTLReader" to read the *.stl file(generate by some CAD softwares). The origin data(it contains three cylinders) disply like pic1, and I want to join these cylinders like pic2. pic1 pic2 I have some problems. 1. The cells in data are all "VTK_TRIANGLE". I do not know how to change the height of the cylinder. 2. I still do not know how to deal with the junction of three cylinders. Frank -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From jcfr at kitware.com Wed Nov 21 11:41:59 2018 From: jcfr at kitware.com (Jean-Christophe Fillion-Robin) Date: Wed, 21 Nov 2018 11:41:59 -0500 Subject: [vtkusers] World Units In-Reply-To: References: Message-ID: Hi Matt, Units are intended to be used to describe the quantity of a given object. Units should help the application to be smarter about how the user can access/view/interact with the data. For example, units help the user by displaying the current unit in spinboxes as a suffix (1.3mm instead of 1.3). For more details, see here Jc On Wed, Nov 21, 2018 at 9:28 AM Matthew Troke < matthew.troke at avalonholographics.com> wrote: > Could you elaborate a little more on support for units in Slicer? What do > you mean by "built-in"? > > Matt > > On Tue, Nov 20, 2018 at 10:41 PM Jean-Christophe Fillion-Robin < > jcfr at kitware.com> wrote: > >> Hi Gavin, >> >> If you are working with medical data, you could look at 3D slicer ( >> https://slicer.org), it leverages VTK and ITK and also has the notion of >> units built-in. >> >> Hth >> Jc >> >> On Tue, Nov 20, 2018, 9:13 AM David Gobbi > >>> Hi Gavin, >>> >>> Using mm for medical image data (with the exception of microscopy) is >>> the most common choice. I certainly wouldn't recommend using anything >>> else. I've also noticed the need to tweak volume rendering depending on >>> resolution. >>> >>> David >>> >>> >>> On Tue, Nov 20, 2018 at 8:00 AM Wheeler, Gavin via vtkusers < >>> vtkusers at public.kitware.com> wrote: >>> >>>> We?ve not been using OpenVR directly, but have been using it indirectly >>>> with medical data. We ended up using m as the real world units, and then >>>> scaling loaded medical data by a factor of 1000 to convert from the >>>> commonly used mm, to m. This has worked well, but there are the odd gotchas >>>> when doing this? watch out for things like volume rendering step size which >>>> you may also need to scale. >>>> >>>> >>>> >>>> Gavin Wheeler >>>> >>>> >>>> >>>> *From:* vtkusers *On Behalf Of *Ken >>>> Martin >>>> *Sent:* 19 November 2018 16:22 >>>> *To:* Dave Demarle >>>> *Cc:* vtkusers at public.kitware.com >>>> *Subject:* Re: [vtkusers] World Units >>>> >>>> >>>> >>>> Although the OpenVR module does use the notion of a physical to world >>>> transformation to map between meters in the VR room and the world >>>> coordinates. >>>> >>>> >>>> >>>> >>>> >>>> On Mon, Nov 19, 2018 at 9:57 AM David E DeMarle < >>>> dave.demarle at kitware.com> wrote: >>>> >>>> vtk itself is unitless. it is up to the application to keep track of >>>> that. >>>> >>>> >>>> >>>> David E DeMarle >>>> Kitware, Inc. >>>> Principal Engineer >>>> 21 Corporate Drive >>>> Clifton Park, NY 12065-8662 >>>> Phone: 518-881-4909 >>>> >>>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> 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 >> > > > -- > Matthew Troke > Software Engineer > Office: 1-709-701-0239 > Email: matthew.troke at avalonholographics.com > > *This email and any attachments are confidential and may be privileged. > Any unauthorized use, disclosure, copying or distribution of the > information received is prohibited. If you are not the intended recipient > please contact the sender immediately by return email confirming that you > have and will delete all communications related to the email and any > attachments sent to you in error.* > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcfr at kitware.com Wed Nov 21 11:44:27 2018 From: jcfr at kitware.com (Jean-Christophe Fillion-Robin) Date: Wed, 21 Nov 2018 11:44:27 -0500 Subject: [vtkusers] Wheels for Python3.7 ('pip3 install vtk' fails) In-Reply-To: References: <4640A5F0-2ADB-4FA3-8814-DFD3F19AB9D0@iup.uni-heidelberg.de> <1542809252440-0.post@n5.nabble.com> Message-ID: Hi, To allow generating the wheel for python 3.7, this project would need to be fixed/updated: https://github.com/KitwareMedical/VTKPythonPackage Jc On Wed, Nov 21, 2018 at 9:48 AM David Gobbi wrote: > On Wed, Nov 21, 2018 at 7:42 AM Fahlgren, Eric < > eric.fahlgren at smith-nephew.com> wrote: > >> Yup, like Frank says in #2, I just built 8.1.2 on Windows last night >> using Python 3.7.1 (3.7.0 can't be used, >> https://gitlab.kitware.com/vtk/vtk/issues/17363 ). Ran our full >> regression suite using those and it works just fine. >> > > To be fair, VTK 8.1.2 "mostly" works with the old Python 3.7.0 release. > What doesn't work is the vtkpython executable and embedding the > interpreter. Definitely recommend Python 3.7.1, though. > > David > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > 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 marco.musy at gmail.com Wed Nov 21 13:21:48 2018 From: marco.musy at gmail.com (mmusy) Date: Wed, 21 Nov 2018 11:21:48 -0700 (MST) Subject: [vtkusers] how to deal with the stl file In-Reply-To: <1542813826992-0.post@n5.nabble.com> References: <1542813826992-0.post@n5.nabble.com> Message-ID: <1542824508860-0.post@n5.nabble.com> You might use vtkTransformPolyDataFilter (https://www.vtk.org/Wiki/VTK/Examples/Cxx/Filtering/TransformPolyData) to move the meshes along with vtkBooleanOperationPolyDataFilter().SetOperationToUnion() to join the surfaces. Or have a look at this: https://github.com/marcomusy/vtkplotter/blob/master/examples/basic/boolean.py -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From nztoddler at yahoo.com Wed Nov 21 19:06:43 2018 From: nztoddler at yahoo.com (Todd Martin) Date: Thu, 22 Nov 2018 00:06:43 +0000 (UTC) Subject: [vtkusers] Rendering and refreshing windowRender in C# In-Reply-To: <1542796127539-0.post@n5.nabble.com> References: <1542796127539-0.post@n5.nabble.com> Message-ID: <790304544.4948967.1542845203176@mail.yahoo.com> Hi Lucy Try this private void MarchingCubes() { ? ? ? ? ? ? ? marching cubes code ..... ????????????? renderer.ResetCamera(); ????????????? renderWindowControl1.Invalidate();} Todd Martin, PhD. Freelance Engineer/Software Architect. On Wednesday, 21 November 2018, 11:28:54 PM NZDT, Lucy wrote: Hi, I created application in C#, that contains renderWindowControl, some trackbars to set parameters for Marching cubes algorithm and button to apply. After running the app, window will appear, but nothing will be rendered and after setting parameters, the original window closes, new opens and nothing happens. How to render output from polyDataMapper?And how do i update renderwindow so that it can view change (after setting parameters) in real time? ---- code ---- ? ? ? ? public Form1() ? ? ? ? { ? ? ? ? ? ? InitializeComponent(); ? ? ? ? } ? ? ? ? public void renderWindowControl1_Load(object sender, EventArgs e) ? ? ? ? { ? ? ? ? ? ? try ? ? ? ? ? ? { ? ? ? ? ? ? ? ? MarchingCubes(); ? ? ? ? ? ? } ? ? ? ? ? ? catch (Exception ex) ? ? ? ? ? ? { ? ? ? ? ? ? ? ? MessageBox.Show(ex.Message, "Exception", MessageBoxButtons.OK); ? ? ? ? ? ? } ? ? ? ? } ? ? ? ? private void applyButton_Click(object sender, EventArgs e) ? ? ? ? { ? ? ? ? ? ? MarchingCubes(); ? ? ? ? } ? ? ? ? private void MarchingCubes() ? ? ? ? { ? ? ? ? ? ? ? marching cubes code ..... ? ? ? ? ? ? vtkPolyDataMapper mapper = vtkPolyDataMapper.New(); ? ? ? ? ? ? mapper.SetInputConnection(surface.GetOutputPort()); ? ? ? ? ? ? mapper.ScalarVisibilityOff(); ? ? ? ? ? ? vtkActor actor = vtkActor.New(); ? ? ? ? ? ? actor.SetMapper(mapper); ? ? ? ? ? ? vtkRenderWindow renderWindow = renderWindowControl1.RenderWindow; ? ? ? ? ? ? vtkRenderer renderer = renderWindow.GetRenderers().GetFirstRenderer(); ? ? ? ? ? ? renderer.SetBackground(0, 0, 0); ? ? ? ? ? ? renderer.AddActor(actor); ? ? ? ? } Thanks, Lucy -- 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 j.robinson at kepler-systems.com Thu Nov 22 05:27:36 2018 From: j.robinson at kepler-systems.com (JimRobinson) Date: Thu, 22 Nov 2018 03:27:36 -0700 (MST) Subject: [vtkusers] Building ACTIVIZ 8.0 (or later) Message-ID: <1542882456367-0.post@n5.nabble.com> Dear All, As you know Kitware have made VTK available for use with C# in the form of ACTIVIZ. One can purchase the compiled, ready-to-use library, but they also kindly give the option of downloading the source and building it oneself. I have been trying to find instructions on how to do this, but the only information (even on the Kitware site) is legacy instructions going back to ACTIVIZ 5.8. Obviously a lot has changed since then, so trying to map those instructions onto version 8.0 (or later) is nigh on impossible (for someone with my limited knowledge and expertise in CMake etc.). Has anybody a clear and complete set of instructions on the steps required to build the latest version of ACTIVIZ (or is this a naive request :-)?)? Many thanks in advance for any pointers. Jim -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From meakcey at gmail.com Thu Nov 22 16:21:09 2018 From: meakcey at gmail.com (meakcey) Date: Thu, 22 Nov 2018 14:21:09 -0700 (MST) Subject: [vtkusers] Extract Selection of Polydata Message-ID: <1542921669319-0.post@n5.nabble.com> Hi In the example of ExtractSelectedIds, if I replace vtkUnstructuredGrid template to vtkPolyData, and render the actor, nothing is seen. https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/ExtractSelectedIds/ I am working through PolyData and trying to delete selected points on the render window like below. It would be better to directly modify PolyData and assign back but could not succeeded. class interactorArea : public vtkInteractorStyleRubberBandPick{ public: static interactorArea* New(); vtkTypeMacro(interactorArea, vtkInteractorStyleRubberBandPick); interactorArea(); virtual void OnLeftButtonUp(); virtual void OnKeyPress(); virtual void OnKeyUp(); void SetPoints(vtkSmartPointer points) {this->Points = points;} private: bool areaSelected = false; vtkSmartPointer selectedIds; vtkSmartPointer Points; vtkSmartPointer SelectedActor; vtkSmartPointer SelectedMapper; }; vtkStandardNewMacro(interactorArea); interactorArea::interactorArea(){ this->SelectedMapper = vtkSmartPointer::New(); this->SelectedActor = vtkSmartPointer::New(); this->SelectedActor->SetMapper(SelectedMapper); } void interactorArea::OnLeftButtonUp(){ qInfo() << "Area interactor left button up"; vtkInteractorStyleRubberBandPick::OnLeftButtonUp(); areaSelected = false; if(this->CurrentMode == VTKISRBP_SELECT){ vtkPlanes* frustum = static_cast(this->GetInteractor()->GetPicker())->GetFrustum(); vtkSmartPointer extractGeometry = vtkSmartPointer::New(); extractGeometry->SetImplicitFunction(frustum); extractGeometry->SetInputData(this->Points); extractGeometry->Update(); vtkSmartPointer visiblePoints = vtkSmartPointer::New(); visiblePoints->SetInputConnection(extractGeometry->GetOutputPort()); visiblePoints->SetRenderer(this->GetInteractor()->GetRenderWindow()->GetRenderers()->GetFirstRenderer()); visiblePoints->Update(); vtkSmartPointer glyphFilter = vtkSmartPointer::New(); glyphFilter->SetInputConnection(extractGeometry->GetOutputPort()); glyphFilter->Update(); vtkPolyData* selected = glyphFilter->GetOutput(); vtkSmartPointer visibleFilter = vtkSmartPointer::New(); visibleFilter->SetInputConnection(visiblePoints->GetOutputPort()); visibleFilter->Update(); vtkPolyData* visibles = visibleFilter->GetOutput(); std::cout << "Selected points " << selected->GetNumberOfPoints() << std::endl; std::cout << "Visible points " << visibles->GetNumberOfPoints() << std::endl; //std::cout << "Selected " << selected->GetNumberOfCells() << " cells." << std::endl; if(selected->GetNumberOfPoints() <= 0){ std::cout << "Nothing selected" << std::endl; return; } areaSelected = true; selectedIds = vtkSmartPointer::New(); selectedIds = vtkIdTypeArray::SafeDownCast(visibles->GetPointData()->GetArray("pointIds")); unsigned int idsize = selectedIds->GetNumberOfTuples(); this->SelectedMapper->SetInputData(visibles); this->SelectedMapper->ScalarVisibilityOff(); areaSelected = true; this->SelectedActor->GetProperty()->SetColor(1.0, 0.0, 0.0); //(R,G,B) this->SelectedActor->GetProperty()->SetPointSize(12); //this->CurrentRenderer->AddActor(SelectedActor); this->GetInteractor()->GetRenderWindow()->GetRenderers()->GetFirstRenderer()->AddActor(SelectedActor); this->GetInteractor()->GetRenderWindow()->Render(); this->HighlightProp(NULL); } } void interactorArea::OnKeyUp(){ vtkInteractorStyleTrackballCamera::OnKeyUp(); vtkRenderWindowInteractor *rwi = this->Interactor; std::string key = rwi->GetKeySym(); if(key == "Delete" && areaSelected){ vtkSmartPointer actorCollection = vtkSmartPointer::New(); actorCollection = this->GetInteractor()->GetRenderWindow()->GetRenderers()->GetFirstRenderer()->GetActors(); unsigned int actors = actorCollection->GetNumberOfItems(); for(unsigned int j=0; jGetInteractor()->GetRenderWindow()->GetRenderers()->GetFirstRenderer()->RemoveActor(actorCollection->GetLastActor()); //this->GetInteractor()->GetRenderWindow()->GetRenderers()->GetFirstRenderer()->RemoveAllViewProps(); //this->GetInteractor()->GetRenderWindow()->Render(); vtkSmartPointer extractedPoints = vtkSmartPointer::New(); unsigned int selsize = selectedIds->GetNumberOfTuples(); unsigned int allsize = Points->GetNumberOfPoints(); vtkSmartPointer selectionNode = vtkSmartPointer::New(); selectionNode->SetFieldType(vtkSelectionNode::POINT); selectionNode->SetContentType(vtkSelectionNode::INDICES); selectionNode->SetSelectionList(selectedIds); vtkSmartPointer selection = vtkSmartPointer::New(); selection->AddNode(selectionNode); vtkSmartPointer extractSelectedIds = vtkSmartPointer::New(); extractSelectedIds->SetInputData(0, Points); extractSelectedIds->SetInputData(1, selection); extractSelectedIds->Update(); vtkSmartPointer selected = vtkSmartPointer::New(); //vtkSmartPointer selected = vtkSmartPointer::New(); // This one does not getting rendered selected->ShallowCopy(extractSelectedIds->GetOutput()); std::cout << "There are " << selected->GetNumberOfPoints() << " points in the selection." << std::endl; selectionNode->GetProperties()->Set(vtkSelectionNode::INVERSE(), 1); //invert the selection extractSelectedIds->Update(); vtkSmartPointer notSelected = vtkSmartPointer::New(); //vtkSmartPointer notSelected = vtkSmartPointer::New(); // This one does not getting rendered notSelected->ShallowCopy(extractSelectedIds->GetOutput()); std::cout << "There are " << notSelected->GetNumberOfPoints() << " points NOT in the selection." << std::endl; vtkSmartPointer leftMapper = vtkSmartPointer::New(); leftMapper->SetInputData(notSelected); vtkSmartPointer leftActor = vtkSmartPointer::New(); leftActor->SetMapper(leftMapper); vtkSmartPointer geometryFilter = vtkSmartPointer::New(); geometryFilter->SetInputData(notSelected); geometryFilter->Update(); this->Points = geometryFilter->GetOutput(); leftActor->GetProperty()->SetPointSize(12); leftActor->GetProperty()->EdgeVisibilityOff(); this->GetInteractor()->GetRenderWindow()->GetRenderers()->GetFirstRenderer()->AddActor(leftActor); this->GetInteractor()->GetRenderWindow()->Render(); this->HighlightProp(NULL); areaSelected = false; } } Also another problem is, I could not delete after first deletion. Selection is working but, when I press delete nothing is getting deleted. I dont know is it related with vtkUnstructuredGrid and vtkPolyData conversion. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From meakcey at gmail.com Thu Nov 22 19:07:17 2018 From: meakcey at gmail.com (meakcey) Date: Thu, 22 Nov 2018 17:07:17 -0700 (MST) Subject: [vtkusers] Delete point from PolyData Message-ID: <1542931637379-0.post@n5.nabble.com> I am working on a polydata which includes points, normals, colors and ids. I have managed that by reading point cloud data like below pcl::PointCloud::Ptr pointCloud(new pcl::PointCloud); pcl::io::loadPLYFile("sample.ply", *pointCloud); vtkSmartPointer points = vtkSmartPointer::New(); vtkSmartPointer colors = vtkSmartPointer::New(); colors->SetNumberOfComponents(3); colors->SetName ("Colors"); // Set point normals vtkSmartPointer pointNormalsArray = vtkSmartPointer::New(); pointNormalsArray->SetNumberOfComponents(3); //3d normals (ie x,y,z) pointNormalsArray->SetName("Normals"); vtkSmartPointer pointIds = vtkSmartPointer::New(); pointIds->SetNumberOfComponents(1); pointIds->SetName("pointIds"); unsigned char tmpColor[3] = {200, 200, 100}; for(unsigned int i=0; isize(); i++){ points->InsertNextPoint(pointCloud->points[i].x, pointCloud->points[i].y, pointCloud->points[i].z); double pn[3] = {pointCloud->points[i].normal_x, pointCloud->points[i].normal_y, pointCloud->points[i].normal_z}; pointNormalsArray->InsertNextTypedTuple(pn); colors->InsertNextTypedTuple(tmpColor); pointIds->InsertNextValue(i); } vtkSmartPointer pointsPoly = vtkSmartPointer::New(); pointsPoly->SetPoints(points); vtkSmartPointer vertexFilter = vtkSmartPointer::New(); vertexFilter->SetInputConnection(idFilter->GetOutputPort()); vertexFilter->SetInputData(pointsPoly); vertexFilter->Update(); vtkPointCloud = vtkSmartPointer::New(); vtkPointCloud ->ShallowCopy(vertexFilter->GetOutput()); vtkPointCloud ->GetPointData()->SetScalars(colors); vtkPointCloud ->GetPointData()->SetNormals(pointNormalsArray); vtkPointCloud ->GetPointData()->AddArray(pointIds); I am able to render this created polydata and can select areas by getting know ids and so on. Now I want to some of the points from this set with code below but it is getting crashed. for(unsigned int j=20; j<30; j++){ vPointCloud->DeletePoint(j); } sceneActor->Modified(); How can delete points referring to ids assigned? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From matthew.troke at avalonholographics.com Fri Nov 23 11:00:00 2018 From: matthew.troke at avalonholographics.com (Matthew Troke) Date: Fri, 23 Nov 2018 12:30:00 -0330 Subject: [vtkusers] Moving Renderer to another Window Message-ID: Once a vtkRenderer is attached to a vtkRenderWindow, can it be removed and added to a another vtkRenderWindow temporarily to perform an operation in isolation? Here is what I tried: - removed renderer from its current window with RemoveRenderer() - created a new vtkRenderWindow with vtkNew and added renderer with AddRenderer() - I called a method on the renderer (which is my own derived class of vtkOpenGLRenderer); inside this method, I create a new vtkTextureObject using the context from the renderwindow and Create2DFromRaw(). This method fails with an exception in vtkTextureObject::Bind() (Handle is null) If I don't remove and add the renderer to another window, I don't get the exception. -- Matthew Troke Software Engineer Office: 1-709-701-0239 Email: matthew.troke at avalonholographics.com -- _This email and any attachments are confidential and may be privileged. Any unauthorized use, disclosure, copying or distribution of the information received is prohibited. If you are not the intended recipient please contact the sender immediately by return email confirming that you have and will delete all communications related to the email and any attachments sent to you in error._ -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Fri Nov 23 11:34:55 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Fri, 23 Nov 2018 17:34:55 +0100 Subject: [vtkusers] Moving Renderer to another Window In-Reply-To: References: Message-ID: I think a colleague did something like this for an "export image" feature at work where we wanted to control the resolution of the exported inage. I can have a look at how he worked around gotchas/crashes, but not until Monday (on my way home). I think the window and renderer have mutual references to each other and need to be broken apart in the right order... Something like that.. Elvis Den fre 23 nov. 2018 17:00Matthew Troke < matthew.troke at avalonholographics.com> skrev: > Once a vtkRenderer is attached to a vtkRenderWindow, can it be removed and > added to a another vtkRenderWindow temporarily to perform an operation in > isolation? > > Here is what I tried: > - removed renderer from its current window with RemoveRenderer() > - created a new vtkRenderWindow with vtkNew and added renderer with > AddRenderer() > - I called a method on the renderer (which is my own derived class of > vtkOpenGLRenderer); inside this method, I create a new vtkTextureObject > using the context from the renderwindow and Create2DFromRaw(). This method > fails with an exception in vtkTextureObject::Bind() (Handle is null) > > If I don't remove and add the renderer to another window, I don't get the > exception. > > -- > Matthew Troke > Software Engineer > Office: 1-709-701-0239 > Email: matthew.troke at avalonholographics.com > > *This email and any attachments are confidential and may be privileged. > Any unauthorized use, disclosure, copying or distribution of the > information received is prohibited. If you are not the intended recipient > please contact the sender immediately by return email confirming that you > have and will delete all communications related to the email and any > attachments sent to you in error.* > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 meakcey at gmail.com Sat Nov 24 09:17:20 2018 From: meakcey at gmail.com (meakcey) Date: Sat, 24 Nov 2018 07:17:20 -0700 (MST) Subject: [vtkusers] Crashing on GetGlobalIds Message-ID: <1543069040005-0.post@n5.nabble.com> Hi I am trying to set and get GlobalIds which assigned in PolyData Creating polydata snippet as follows pcl::PointCloud::Ptr pointCloud(new pcl::PointCloud); pcl::io::loadPLYFile("scansample/constructedcloud.ply", *pointCloud); qInfo() << "Size of point cloud " << pointCloud->size(); vtkSmartPointer points = vtkSmartPointer::New(); vtkSmartPointer colors = vtkSmartPointer::New(); colors->SetNumberOfComponents(3); colors->SetName ("Colors"); // Set point normals vtkSmartPointer pointNormalsArray = vtkSmartPointer::New(); pointNormalsArray->SetNumberOfComponents(3); //3d normals (ie x,y,z) pointNormalsArray->SetName("Normals"); vtkSmartPointer pointIds = vtkSmartPointer::New(); pointIds->SetNumberOfComponents(1); pointIds->SetName("pointIds"); vtkSmartPointer globalIds = vtkSmartPointer::New(); globalIds->SetNumberOfComponents(1); globalIds->SetName("globalIds"); unsigned char tmpColor[3] = {200, 200, 100}; for(unsigned int i=0; isize(); i++){ points->InsertNextPoint(pointCloud->points[i].x, pointCloud->points[i].y, pointCloud->points[i].z); double pn[3] = {pointCloud->points[i].normal_x, pointCloud->points[i].normal_y, pointCloud->points[i].normal_z}; pointNormalsArray->InsertNextTypedTuple(pn); colors->InsertNextTypedTuple(tmpColor); pointIds->InsertNextValue(i); globalIds->InsertNextValue(i); } vtkSmartPointer pointsPoly = vtkSmartPointer::New(); pointsPoly->SetPoints(points); vtkSmartPointer vertexFilter = vtkSmartPointer::New(); //vertexFilter->SetInputConnection(idFilter->GetOutputPort()); vertexFilter->SetInputData(pointsPoly); vertexFilter->Update(); vPointCloud = vtkSmartPointer::New(); vPointCloud->ShallowCopy(vertexFilter->GetOutput()); vPointCloud->GetPointData()->SetScalars(colors); vPointCloud->GetPointData()->SetNormals(pointNormalsArray); vPointCloud->GetPointData()->AddArray(pointIds); vPointCloud->GetPointData()->SetGlobalIds(globalIds); vPointCloud->GetPointData()->CopyGlobalIdsOn(); Trying to reach pointdata through rubber band pick as follows void interactorArea::OnLeftButtonUp(){ // Forward events vtkInteractorStyleRubberBandPick::OnLeftButtonUp(); if(this->CurrentMode == VTKISRBP_SELECT){ vtkPlanes* frustum = static_cast(this->GetInteractor()->GetPicker())->GetFrustum(); vtkSmartPointer extractGeometry = vtkSmartPointer::New(); extractGeometry->SetImplicitFunction(frustum); extractGeometry->SetInputData(this->Points); extractGeometry->Update(); vtkSmartPointer visiblePoints = vtkSmartPointer::New(); extractGeometry->GetOutput()->GetPointData()->CopyGlobalIdsOn(); visiblePoints->SetInputConnection(extractGeometry->GetOutputPort()); visiblePoints->SetRenderer(this->GetInteractor()->GetRenderWindow()->GetRenderers()->GetFirstRenderer()); visiblePoints->Update(); vtkSmartPointer visibleFilter = vtkSmartPointer::New(); visiblePoints->GetOutput()->GetPointData()->CopyGlobalIdsOn(); visibleFilter->SetInputConnection(visiblePoints->GetOutputPort()); visibleFilter->Update(); vtkPolyData* visibles = visibleFilter->GetOutput(); std::cout << "Visible points " << visibles->GetNumberOfPoints() << std::endl; if(selected->GetNumberOfPoints() <= 0){ std::cout << "Nothing selected" << std::endl; return; } selectedIds = vtkSmartPointer::New(); selectedIds = vtkIdTypeArray::SafeDownCast(visibles->GetPointData()->GetArray("pointIds")); unsigned int idsize = selectedIds->GetNumberOfTuples(); for(unsigned int j=0; jGetValue(j) << " "; std::cout << std::endl; vtkSmartPointer globalIds = vtkSmartPointer::New(); globalIds = vtkIdTypeArray::SafeDownCast(visibles->GetPointData()->GetGlobalIds()); assert(globalIds); std::cout << "Nof globalIds " << globalIds->GetNumberOfComponents() << " " << globalIds->GetNumberOfTuples() << std::endl; } } I could get pointIds but could not get any part of the globalIds. Program crashing at the line of std::cout << "Nof globalIds " << globalIds->GetNumberOfComponents() << " " << globalIds->GetNumberOfTuples() << std::endl; What's wrong with that? Thanks -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From meakcey at gmail.com Sat Nov 24 09:47:44 2018 From: meakcey at gmail.com (meakcey) Date: Sat, 24 Nov 2018 07:47:44 -0700 (MST) Subject: [vtkusers] Crashing on GetGlobalIds In-Reply-To: <1543069040005-0.post@n5.nabble.com> References: <1543069040005-0.post@n5.nabble.com> Message-ID: <1543070864626-0.post@n5.nabble.com> Cleaner comparison to problem *Code below is working* vtkPlanes* frustum = static_cast(this->GetInteractor()->GetPicker())->GetFrustum(); vtkSmartPointer extractGeometry = vtkSmartPointer::New(); extractGeometry->SetImplicitFunction(frustum); extractGeometry->SetInputData(this->Points); extractGeometry->Update(); extractGeometry->GetOutput()->GetPointData()->CopyGlobalIdsOn(); vtkSmartPointer glyphFilter = vtkSmartPointer::New(); glyphFilter->SetInputConnection(extractGeometry->GetOutputPort()); glyphFilter->Update(); glyphFilter->GetOutput()->GetPointData()->CopyGlobalIdsOn(); vtkPolyData* selected = glyphFilter->GetOutput(); vtkSmartPointer globalIds = vtkSmartPointer::New(); globalIds = vtkIdTypeArray::SafeDownCast(selected->GetPointData()->GetGlobalIds()); assert(globalIds); std::cout << "Nof globalIds " << globalIds->GetNumberOfComponents() << " " << globalIds->GetNumberOfTuples() << std::endl; *Code below is crashing at the line of cout * vtkPlanes* frustum = static_cast(this->GetInteractor()->GetPicker())->GetFrustum(); vtkSmartPointer extractGeometry = vtkSmartPointer::New(); extractGeometry->SetImplicitFunction(frustum); extractGeometry->SetInputData(this->Points); extractGeometry->Update(); extractGeometry->GetOutput()->GetPointData()->CopyGlobalIdsOn(); vtkSmartPointer visiblePoints = vtkSmartPointer::New(); visiblePoints->SetInputConnection(extractGeometry->GetOutputPort()); visiblePoints->SetRenderer(this->GetInteractor()->GetRenderWindow()->GetRenderers()->GetFirstRenderer()); visiblePoints->Update(); visiblePoints->GetOutput()->GetPointData()->CopyGlobalIdsOn(); vtkSmartPointer visibleFilter = vtkSmartPointer::New(); visibleFilter->SetInputConnection(visiblePoints->GetOutputPort()); visibleFilter->Update(); visibleFilter->GetOutput()->GetPointData()->CopyGlobalIdsOn(); vtkPolyData* visibles = visibleFilter->GetOutput(); vtkSmartPointer globalIds = vtkSmartPointer::New(); globalIds = vtkIdTypeArray::SafeDownCast(visibles->GetPointData()->GetGlobalIds()); assert(globalIds); std::cout << "Nof globalIds " << globalIds->GetNumberOfComponents() << " " << globalIds->GetNumberOfTuples() << std::endl; -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From simakov.w at gmail.com Sun Nov 25 07:52:02 2018 From: simakov.w at gmail.com (Met@ll) Date: Sun, 25 Nov 2018 05:52:02 -0700 (MST) Subject: [vtkusers] Bug in vtkXYPlotActor Message-ID: <1543150322595-0.post@n5.nabble.com> Hello! I found the following bug in the vtkXYPlotActor class: when using the ChartBoxOn method, the background does not move with the graph when the window size is changed (VTK-8.2.0.rc1) thank) -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From sankhesh.jhaveri at kitware.com Sun Nov 25 08:55:52 2018 From: sankhesh.jhaveri at kitware.com (Sankhesh Jhaveri) Date: Sun, 25 Nov 2018 08:55:52 -0500 Subject: [vtkusers] Moving Renderer to another Window In-Reply-To: References: Message-ID: Did you call Render on the new render window after adding the renderer and before invoking the renderer method? ? On Fri, Nov 23, 2018 at 11:35 AM Elvis Stansvik < elvis.stansvik at orexplore.com> wrote: > I think a colleague did something like this for an "export image" feature > at work where we wanted to control the resolution of the exported inage. > > I can have a look at how he worked around gotchas/crashes, but not until > Monday (on my way home). > > I think the window and renderer have mutual references to each other and > need to be broken apart in the right order... Something like that.. > > Elvis > > Den fre 23 nov. 2018 17:00Matthew Troke < > matthew.troke at avalonholographics.com> skrev: > >> Once a vtkRenderer is attached to a vtkRenderWindow, can it be removed >> and added to a another vtkRenderWindow temporarily to perform an operation >> in isolation? >> >> Here is what I tried: >> - removed renderer from its current window with RemoveRenderer() >> - created a new vtkRenderWindow with vtkNew and added renderer with >> AddRenderer() >> - I called a method on the renderer (which is my own derived class of >> vtkOpenGLRenderer); inside this method, I create a new vtkTextureObject >> using the context from the renderwindow and Create2DFromRaw(). This method >> fails with an exception in vtkTextureObject::Bind() (Handle is null) >> >> If I don't remove and add the renderer to another window, I don't get the >> exception. >> >> -- >> Matthew Troke >> Software Engineer >> Office: 1-709-701-0239 <(709)%20701-0239> >> Email: matthew.troke at avalonholographics.com >> >> *This email and any attachments are confidential and may be privileged. >> Any unauthorized use, disclosure, copying or distribution of the >> information received is prohibited. If you are not the intended recipient >> please contact the sender immediately by return email confirming that you >> have and will delete all communications related to the email and any >> attachments sent to you in error.* >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> 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 > -- Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware | (518) 881-4417 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.fahlgren at smith-nephew.com Sun Nov 25 09:39:42 2018 From: eric.fahlgren at smith-nephew.com (Fahlgren, Eric) Date: Sun, 25 Nov 2018 14:39:42 +0000 Subject: [vtkusers] vtkPoints.SetPoints bug? Message-ID: I've just been testing with my build of VTK 8.1.2 built with VS 2017 using Python 3.7.1 on Windows 10 and came across this bad behavior when resetting the values of a vtkPoints object. tl;dr Using SetPoint fails to update the bounds on the vtkPoints object and anything that subsequently uses the points object (a vtkPolyData in my case) draws incorrectly. This worked in 8.0... Here's a small script that shows the problem. Is anyone else seeing this, or maybe it's my build??? #!/bin/env python import vtk nPts = 5 points = vtk.vtkPoints() points.SetNumberOfPoints(nPts * 2) for i in range(nPts): id = i*2 points.SetPoint(id+0, 0, 0, 0) points.SetPoint(id+1, 0, 0, 0) print('Initial values:\n', points) for i in range(nPts): id = i*2 x = y = z = float(i) points.SetPoint(id+0, x, y, z) points.SetPoint(id+1, x+1, y+2, z+3) print('After setting them to non-zero, bad bounds:\n', points) print('Point data:') for i in range(nPts): id = i*2 print(id, points.GetPoint(id), points.GetPoint(id+1)) print('Bounds:\n', points.GetBounds()) points.ComputeBounds() print('Bounds after re-computing:\n', points.GetBounds()) points.SetNumberOfPoints(0) for i in range(nPts): x = y = z = float(i) points.InsertNextPoint(x, y, z) points.InsertNextPoint(x+1, y+2, z+3) print('After reallocation, now they are fine:\n', points) Which gives this output: Initial values: vtkPoints (000001FE00289E00) Debug: Off Modified Time: 80 Reference Count: 1 RenderDepth: 0 Registered Events: (none) Data: 000001FE7FD059E0 Data Array Name: Points Number Of Points: 10 Bounds: Xmin,Xmax: (0, 0) Ymin,Ymax: (0, 0) Zmin,Zmax: (0, 0) After setting them to non-zero, bad bounds: vtkPoints (000001FE00289E00) Debug: Off Modified Time: 80 Reference Count: 1 RenderDepth: 0 Registered Events: (none) Data: 000001FE7FD059E0 Data Array Name: Points Number Of Points: 10 Bounds: Xmin,Xmax: (0, 0) Ymin,Ymax: (0, 0) Zmin,Zmax: (0, 0) Point data: 0 (0.0, 0.0, 0.0) (1.0, 2.0, 3.0) 2 (1.0, 1.0, 1.0) (2.0, 3.0, 4.0) 4 (2.0, 2.0, 2.0) (3.0, 4.0, 5.0) 6 (3.0, 3.0, 3.0) (4.0, 5.0, 6.0) 8 (4.0, 4.0, 4.0) (5.0, 6.0, 7.0) Bounds: (0.0, 0.0, 0.0, 0.0, 0.0, 0.0) Bounds after re-computing: (0.0, 0.0, 0.0, 0.0, 0.0, 0.0) After reallocation, now they are fine: vtkPoints (000001FE00289E00) Debug: Off Modified Time: 87 Reference Count: 1 RenderDepth: 0 Registered Events: (none) Data: 000001FE7FD059E0 Data Array Name: Points Number Of Points: 10 Bounds: Xmin,Xmax: (0, 5) Ymin,Ymax: (0, 6) Zmin,Zmax: (0, 7) -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Sun Nov 25 11:25:28 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Sun, 25 Nov 2018 09:25:28 -0700 Subject: [vtkusers] vtkPoints.SetPoints bug? In-Reply-To: References: Message-ID: Hi Eric, It's necessary to call Modified() after calling SetPoint() in order for ComputeBounds() to re-compute the bounds. This is because ComputeBounds() checks the timestamp and does nothing if the timestamp shows that the previous bounds are still good. As far as I understand, vtkPoints has behaved this way for many years. Recently, however, there have been many changes to the VTK rendering pipeline that increase the reliance on timestamps. Perhaps in VTK 8.0 something was triggering a Modified() call or was otherwise forcing a re-computation of the bounds. David -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.fahlgren at smith-nephew.com Sun Nov 25 13:00:38 2018 From: eric.fahlgren at smith-nephew.com (Fahlgren, Eric) Date: Sun, 25 Nov 2018 18:00:38 +0000 Subject: [vtkusers] vtkPoints.SetPoints bug? In-Reply-To: References: Message-ID: Thanks, David, that fixes it. I?m pretty surprised at this since the code was actually written back in the 5.2 days and hasn?t been touched since? Eric From: David Gobbi [mailto:david.gobbi at gmail.com] Sent: Sunday, November 25, 2018 8:25 AM To: Fahlgren, Eric Cc: vtkusers at public.kitware.com Subject: Re: [vtkusers] vtkPoints.SetPoints bug? Hi Eric, It's necessary to call Modified() after calling SetPoint() in order for ComputeBounds() to re-compute the bounds. This is because ComputeBounds() checks the timestamp and does nothing if the timestamp shows that the previous bounds are still good. As far as I understand, vtkPoints has behaved this way for many years. Recently, however, there have been many changes to the VTK rendering pipeline that increase the reliance on timestamps. Perhaps in VTK 8.0 something was triggering a Modified() call or was otherwise forcing a re-computation of the bounds. David -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.fahlgren at smith-nephew.com Sun Nov 25 15:09:11 2018 From: eric.fahlgren at smith-nephew.com (Fahlgren, Eric) Date: Sun, 25 Nov 2018 20:09:11 +0000 Subject: [vtkusers] vtkPoints.SetPoints bug? In-Reply-To: References: Message-ID: Using InsertPoint alone instead of SetPoint+Modified also pings the modified time, which brings us to an interesting side point. We apparently had avoided InsertPoint due to performance issues in the past, so I benchmarked them and InsertPoint is now about 10% faster than SetPoint (which seems odd, since you?d think InsertPoint would be doing some extra mallocs that are clearly ? more expensive than simple indexing). Maybe the extra data marshalling for the id parameter is the difference? from tools.timethis import timethis import vtk nPts = 5 points = vtk.vtkPoints() for iteration in range(21): print(f'{iteration:3d} {nPts:9_d}') with timethis('Insert'): points.SetNumberOfPoints(0) for i in range(nPts): x = y = z = float(i) points.InsertNextPoint(x, y, z) points.InsertNextPoint(x+1, y+2, z+3) with timethis('Set'): points.SetNumberOfPoints(nPts * 2) for i in range(nPts): id = i*2 x = y = z = float(i) points.SetPoint(id+0, x, y, z) points.SetPoint(id+1, x+1, y+2, z+3) points.Modified() nPts *= 2 0 5 1 10 2 20 ... 18 1_310_720 19 2_621_440 20 5_242_880 Insert : 0.367240s : N= 21 : stddev=0.89898 Set : 0.417269s : N= 21 : stddev=1.01908 From: vtkusers [mailto:vtkusers-bounces at public.kitware.com] On Behalf Of Fahlgren, Eric Sent: Sunday, November 25, 2018 10:01 AM To: David Gobbi Cc: vtkusers at public.kitware.com Subject: Re: [vtkusers] vtkPoints.SetPoints bug? Thanks, David, that fixes it. I?m pretty surprised at this since the code was actually written back in the 5.2 days and hasn?t been touched since? Eric From: David Gobbi [mailto:david.gobbi at gmail.com] Sent: Sunday, November 25, 2018 8:25 AM To: Fahlgren, Eric Cc: vtkusers at public.kitware.com Subject: Re: [vtkusers] vtkPoints.SetPoints bug? Hi Eric, It's necessary to call Modified() after calling SetPoint() in order for ComputeBounds() to re-compute the bounds. This is because ComputeBounds() checks the timestamp and does nothing if the timestamp shows that the previous bounds are still good. As far as I understand, vtkPoints has behaved this way for many years. Recently, however, there have been many changes to the VTK rendering pipeline that increase the reliance on timestamps. Perhaps in VTK 8.0 something was triggering a Modified() call or was otherwise forcing a re-computation of the bounds. David -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Sun Nov 25 15:47:46 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Sun, 25 Nov 2018 13:47:46 -0700 Subject: [vtkusers] vtkPoints.SetPoints bug? In-Reply-To: References: Message-ID: Hi Eric, In your benchmarks, most of the time is going to the Python overhead. So I agree with your hypothesis: in Python, InsertPoint() will be faster than SetPoint() simply because the InsertPoint() only has 3 parameters while SetPoint() has 4. It's all about the time that Python takes to build the args tuple (function calls in Python are not cheap). David On Sun, Nov 25, 2018 at 1:09 PM Fahlgren, Eric < eric.fahlgren at smith-nephew.com> wrote: > Using InsertPoint alone instead of SetPoint+Modified also pings the > modified time, which brings us to an interesting side point. > > > > We apparently had avoided InsertPoint due to performance issues in the > past, so I benchmarked them and InsertPoint is now about 10% faster than > SetPoint (which seems odd, since you?d think InsertPoint would be doing > some extra mallocs that are clearly J more expensive than simple > indexing). Maybe the extra data marshalling for the id parameter is the > difference? > > > > from tools.timethis import timethis > > import vtk > > > > nPts = 5 > > points = vtk.vtkPoints() > > > > for iteration in range(21): > > print(f'{iteration:3d} {nPts:9_d}') > > > > with timethis('Insert'): > > points.SetNumberOfPoints(0) > > for i in range(nPts): > > x = y = z = float(i) > > points.InsertNextPoint(x, y, z) > > points.InsertNextPoint(x+1, y+2, z+3) > > > > with timethis('Set'): > > points.SetNumberOfPoints(nPts * 2) > > for i in range(nPts): > > id = i*2 > > x = y = z = float(i) > > points.SetPoint(id+0, x, y, z) > > points.SetPoint(id+1, x+1, y+2, z+3) > > points.Modified() > > > > nPts *= 2 > > > > > > 0 5 > > 1 10 > > 2 20 > > ... > > 18 1_310_720 > > 19 2_621_440 > > 20 5_242_880 > > Insert : 0.367240s : N= 21 : stddev=0.89898 > > Set : 0.417269s : N= 21 : stddev=1.01908 > > > > > > *From:* vtkusers [mailto:vtkusers-bounces at public.kitware.com] *On Behalf > Of *Fahlgren, Eric > *Sent:* Sunday, November 25, 2018 10:01 AM > *To:* David Gobbi > *Cc:* vtkusers at public.kitware.com > *Subject:* Re: [vtkusers] vtkPoints.SetPoints bug? > > > > Thanks, David, that fixes it. I?m pretty surprised at this since the code > was actually written back in the 5.2 days and hasn?t been touched since? > > > > Eric > > > > *From:* David Gobbi [mailto:david.gobbi at gmail.com] > *Sent:* Sunday, November 25, 2018 8:25 AM > *To:* Fahlgren, Eric > *Cc:* vtkusers at public.kitware.com > *Subject:* Re: [vtkusers] vtkPoints.SetPoints bug? > > > > Hi Eric, > > > > It's necessary to call Modified() after calling SetPoint() in order for > ComputeBounds() to re-compute the bounds. This is because ComputeBounds() > checks the timestamp and does nothing if the timestamp shows that the > previous bounds are still good. > > > > As far as I understand, vtkPoints has behaved this way for many years. > Recently, however, there have been many changes to the VTK rendering > pipeline that increase the reliance on timestamps. Perhaps in VTK 8.0 > something was triggering a Modified() call or was otherwise forcing a > re-computation of the bounds. > > > > David > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Sun Nov 25 16:18:58 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Sun, 25 Nov 2018 14:18:58 -0700 Subject: [vtkusers] vtkPoints.SetPoints bug? In-Reply-To: References: Message-ID: On Sun, Nov 25, 2018 at 1:47 PM David Gobbi wrote: > Hi Eric, > > In your benchmarks, most of the time is going to the Python overhead. So > I agree with your hypothesis: in Python, InsertPoint() will be faster than > SetPoint() simply because the InsertPoint() only has 3 parameters while > SetPoint() has 4. It's all about the time that Python takes to build the > args tuple (function calls in Python are not cheap). > Actually it's probably not just the Python function call overhead. The benchmark loop for SetPoint() also contains more operations and creates an additional variable. David On Sun, Nov 25, 2018 at 1:09 PM Fahlgren, Eric < > eric.fahlgren at smith-nephew.com> wrote: > >> Using InsertPoint alone instead of SetPoint+Modified also pings the >> modified time, which brings us to an interesting side point. >> >> >> >> We apparently had avoided InsertPoint due to performance issues in the >> past, so I benchmarked them and InsertPoint is now about 10% faster than >> SetPoint (which seems odd, since you?d think InsertPoint would be doing >> some extra mallocs that are clearly J more expensive than simple >> indexing). Maybe the extra data marshalling for the id parameter is the >> difference? >> >> >> >> from tools.timethis import timethis >> >> import vtk >> >> >> >> nPts = 5 >> >> points = vtk.vtkPoints() >> >> >> >> for iteration in range(21): >> >> print(f'{iteration:3d} {nPts:9_d}') >> >> >> >> with timethis('Insert'): >> >> points.SetNumberOfPoints(0) >> >> for i in range(nPts): >> >> x = y = z = float(i) >> >> points.InsertNextPoint(x, y, z) >> >> points.InsertNextPoint(x+1, y+2, z+3) >> >> >> >> with timethis('Set'): >> >> points.SetNumberOfPoints(nPts * 2) >> >> for i in range(nPts): >> >> id = i*2 >> >> x = y = z = float(i) >> >> points.SetPoint(id+0, x, y, z) >> >> points.SetPoint(id+1, x+1, y+2, z+3) >> >> points.Modified() >> >> >> >> nPts *= 2 >> >> >> >> >> >> 0 5 >> >> 1 10 >> >> 2 20 >> >> ... >> >> 18 1_310_720 >> >> 19 2_621_440 >> >> 20 5_242_880 >> >> Insert : 0.367240s : N= 21 : stddev=0.89898 >> >> Set : 0.417269s : N= 21 : stddev=1.01908 >> >> >> >> >> >> *From:* vtkusers [mailto:vtkusers-bounces at public.kitware.com] *On Behalf >> Of *Fahlgren, Eric >> *Sent:* Sunday, November 25, 2018 10:01 AM >> *To:* David Gobbi >> *Cc:* vtkusers at public.kitware.com >> *Subject:* Re: [vtkusers] vtkPoints.SetPoints bug? >> >> >> >> Thanks, David, that fixes it. I?m pretty surprised at this since the >> code was actually written back in the 5.2 days and hasn?t been touched >> since? >> >> >> >> Eric >> >> >> >> *From:* David Gobbi [mailto:david.gobbi at gmail.com] >> *Sent:* Sunday, November 25, 2018 8:25 AM >> *To:* Fahlgren, Eric >> *Cc:* vtkusers at public.kitware.com >> *Subject:* Re: [vtkusers] vtkPoints.SetPoints bug? >> >> >> >> Hi Eric, >> >> >> >> It's necessary to call Modified() after calling SetPoint() in order for >> ComputeBounds() to re-compute the bounds. This is because ComputeBounds() >> checks the timestamp and does nothing if the timestamp shows that the >> previous bounds are still good. >> >> >> >> As far as I understand, vtkPoints has behaved this way for many years. >> Recently, however, there have been many changes to the VTK rendering >> pipeline that increase the reliance on timestamps. Perhaps in VTK 8.0 >> something was triggering a Modified() call or was otherwise forcing a >> re-computation of the bounds. >> >> >> >> David >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From poweruserm at live.com.au Sun Nov 25 22:58:15 2018 From: poweruserm at live.com.au (A Z) Date: Mon, 26 Nov 2018 03:58:15 +0000 Subject: [vtkusers] Questions about getting started with VTK. Message-ID: -Are there precompiled Windows .dll files that I download, particularly 64 bit ones? Is it possible to download VTK like this without having to try and fail at compiling this myself? If not, could someone change this and post these .dll files on the internet somewhere? -If I only want to produce 2D or 3D plotting, is it possible to use a subset of the VTK .dll files, so as to not have to include them all alongside a program? -I know that it is possible to put a VTK plot into a popular graphics library format. Does VTK have in place compatability for WXWidgets image drawing classes and drawing elements? -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Mon Nov 26 02:11:54 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Mon, 26 Nov 2018 08:11:54 +0100 Subject: [vtkusers] Questions about getting started with VTK. In-Reply-To: References: Message-ID: Den m?n 26 nov. 2018 kl 04:58 skrev A Z : > > -Are there precompiled Windows .dll files that I download, particularly 64 bit ones? > Is it possible to download VTK like this without having to try and fail > at compiling this myself? If not, could someone change this and post these .dll files > on the internet somewhere? I don't think there are any precompiled DLLs, you have to build from source. > > -If I only want to produce 2D or 3D plotting, is it possible to use a subset of the VTK > .dll files, so as to not have to include them all alongside a program? Yes, you only have to include the DLLs you are using. Utilities/Maintenance/WhatModulesVTK.py is a handy script that is included with the VTK source that you can run to see what exact modules you need to link with, based on what you're including in your source. Run it without arguments to get a help message. > > -I know that it is possible to put a VTK plot into a popular graphics library format. > Does VTK have in place compatability for WXWidgets image drawing classes > and drawing elements? I'm only aware of official support for Qt and MFC. This seems to be a third party class for wx integration: https://github.com/harshn05/wxvtk-UpdatedOnJan23_2018 HTH, Elvis > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: 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 mohamadreza.shariati at mathmods.eu Mon Nov 26 08:18:34 2018 From: mohamadreza.shariati at mathmods.eu (mohamadreza.shariati at mathmods.eu) Date: Mon, 26 Nov 2018 14:18:34 +0100 Subject: [vtkusers] Error installing Triangulate in Ubuntu 18.04.1 LTS Message-ID: after I tried to instal the Triangulate from source with this command: cmd at cmd:~/Triangulate$ make I recieved two errors: Scanning dependencies of target Triangulate [ 50%] Building CXX object CMakeFiles/Triangulate.dir/Triangulate.cxx.o make[2]: *** No rule to make target '/home/cmd/VTK/lib/libvtkDomainsChemistryOpenGL2-8.1.so.1', needed by 'Triangulate'. Stop. CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/Triangulate.dir/all' failed make[1]: *** [CMakeFiles/Triangulate.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2 -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Mon Nov 26 09:15:29 2018 From: cory.quammen at kitware.com (Cory Quammen) Date: Mon, 26 Nov 2018 09:15:29 -0500 Subject: [vtkusers] Bug in vtkXYPlotActor In-Reply-To: <1543150322595-0.post@n5.nabble.com> References: <1543150322595-0.post@n5.nabble.com> Message-ID: Hi, Please file a bug report at https://gitlab.kitware.com/vtk/vtk/issues. Ideally, please include a short compilable standalone example that shows the problem with steps how to recreate it. Thanks, Cory On Sun, Nov 25, 2018 at 7:52 AM Met at ll wrote: > Hello! > I found the following bug in the vtkXYPlotActor class: when using the > ChartBoxOn method, the background does not move with the graph when the > window size is changed (VTK-8.2.0.rc1) > thank) > > > > -- > 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 > -- Cory Quammen Staff R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sankhesh.jhaveri at kitware.com Mon Nov 26 10:42:38 2018 From: sankhesh.jhaveri at kitware.com (Sankhesh Jhaveri) Date: Mon, 26 Nov 2018 15:42:38 +0000 Subject: [vtkusers] Moving Renderer to another Window In-Reply-To: References: Message-ID: Yes, all the graphics allocations/deallocations happen during Render. The render call should ensure that the texture object is bound correctly. ? On Sun, Nov 25, 2018 at 11:32 AM Matthew Troke < matthew.troke at avalonholographics.com> wrote: > No I did not - I'm assuming that's important? I appear to be having > trouble binding a texture in a render pass if the texture was created with > another render window as the context. > > > On Sun, Nov 25, 2018, 10:25 AM Sankhesh Jhaveri < > sankhesh.jhaveri at kitware.com wrote: > >> Did you call Render on the new render window after adding the renderer >> and before invoking the renderer method? >> ? >> >> On Fri, Nov 23, 2018 at 11:35 AM Elvis Stansvik < >> elvis.stansvik at orexplore.com> wrote: >> >>> I think a colleague did something like this for an "export image" >>> feature at work where we wanted to control the resolution of the exported >>> inage. >>> >>> I can have a look at how he worked around gotchas/crashes, but not until >>> Monday (on my way home). >>> >>> I think the window and renderer have mutual references to each other and >>> need to be broken apart in the right order... Something like that.. >>> >>> Elvis >>> >>> Den fre 23 nov. 2018 17:00Matthew Troke < >>> matthew.troke at avalonholographics.com> skrev: >>> >>>> Once a vtkRenderer is attached to a vtkRenderWindow, can it be removed >>>> and added to a another vtkRenderWindow temporarily to perform an operation >>>> in isolation? >>>> >>>> Here is what I tried: >>>> - removed renderer from its current window with RemoveRenderer() >>>> - created a new vtkRenderWindow with vtkNew and added renderer with >>>> AddRenderer() >>>> - I called a method on the renderer (which is my own derived class of >>>> vtkOpenGLRenderer); inside this method, I create a new vtkTextureObject >>>> using the context from the renderwindow and Create2DFromRaw(). This method >>>> fails with an exception in vtkTextureObject::Bind() (Handle is null) >>>> >>>> If I don't remove and add the renderer to another window, I don't get >>>> the exception. >>>> >>>> -- >>>> Matthew Troke >>>> Software Engineer >>>> Office: 1-709-701-0239 <(709)%20701-0239> >>>> Email: matthew.troke at avalonholographics.com >>>> >>>> *This email and any attachments are confidential and may be privileged. >>>> Any unauthorized use, disclosure, copying or distribution of the >>>> information received is prohibited. If you are not the intended recipient >>>> please contact the sender immediately by return email confirming that you >>>> have and will delete all communications related to the email and any >>>> attachments sent to you in error.* >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ at: >>>> 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 >>> >> -- >> Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware >> | (518) 881-4417 >> ? >> > > *This email and any attachments are confidential and may be privileged. > Any unauthorized use, disclosure, copying or distribution of the > information received is prohibited. If you are not the intended recipient > please contact the sender immediately by return email confirming that you > have and will delete all communications related to the email and any > attachments sent to you in error.* > -- Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware | (518) 881-4417 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.martin at kitware.com Mon Nov 26 10:55:04 2018 From: ken.martin at kitware.com (Ken Martin) Date: Mon, 26 Nov 2018 10:55:04 -0500 Subject: [vtkusers] Animation performance with cell color In-Reply-To: References: Message-ID: Unfortunately changing the points causes a lot of recomputation for cell coloring which is what you are using. It is because the changing points could make a triangle become degenerate (which opengl does not count as a cell, while VTK does) If you have the memory on the GPU you could instead create an array of actors, each with their own mappers and polydata and then loop over them by changing their visibility (e.g. all are visibleOff except the current time step). If that fits in memory it should be very fast. On Sat, Nov 17, 2018 at 2:20 PM Flagada wrote: > Hi all ! > I am trying to animate a mesh deformation with quite a large number of > nodes (about 300000). > For now the best solution I have found is to make a list containing the > vtkpoints for each animation frame and loop by changing the vtkpoints of > the displayed polydata (or unstructuredgrid). > On a simple model without applying any color to the cells I can obtain an > animation rate of about 50fps wich is a good frame rate for me. > But if I apply colors with a PolyData.GetCellData().SetScalars() the > framerate goes down to 13fps. > Does anybody knows if it could be a better method to display mesh > animation or to improve the display rate of a mesh with colors ? > > Here below is the python code I use. > It draws a disk of 800x400 nodes and if you press on F1 it animates a kind > of sinus wave. > First it calculate each frame, then it display the animation without color > and finally it display the animation with random color on cells. > > Thanks ! > > ############################ > > import vtk > import math > from time import time > import random > > ############################ > # Creating disk mesh > disk = vtk.vtkDiskSource() > disk.SetInnerRadius(0.1) > disk.SetOuterRadius(2.0) > disk.SetRadialResolution(400) > disk.SetCircumferentialResolution(800) > disk.Update() > PolyData = disk.GetOutput() > > print("%d nodes" % PolyData.GetNumberOfPoints()) > print("%d elms" % PolyData.GetNumberOfCells()) > > # Setup actor and mapper > mapper = vtk.vtkPolyDataMapper() > mapper.SetInputData(PolyData) > actor = vtk.vtkActor() > actor.SetMapper(mapper) > > # Setup render window, renderer, interactor and camera > renderer = vtk.vtkRenderer() > renderWindow = vtk.vtkRenderWindow() > renderWindow.AddRenderer(renderer) > renderWindowInteractor = vtk.vtkRenderWindowInteractor() > renderWindowInteractor.SetRenderWindow(renderWindow) > style = vtk.vtkInteractorStyleTrackballCamera() > renderWindowInteractor.SetInteractorStyle(style) > camera = vtk.vtkCamera() > camera.Elevation(-45) > renderer.SetActiveCamera(camera) > > ################################# > > def KeyPress(object, event): > if object.GetInteractor().GetKeySym() == "F1": > # Calculate each frame and store the vtkPoints into vtkPointsList > PolyData = disk.GetOutput() > vtkPointsList = {} > > print("Calculate...") > > for ph in range(0, 360, 20): > start_time = time() > vtkPointsList[ph] = vtk.vtkPoints() > vtkPointsList[ph].DeepCopy(PolyData.GetPoints()) > for i in range(0, PolyData.GetNumberOfPoints()): > NodePos = vtkPointsList[ph].GetPoint(i) > vtkPointsList[ph].SetPoint(i, NodePos[0], NodePos[1], 0.3 * > math.sin(NodePos[0] * 2 + ph * math.pi / 180)) > PolyData.SetPoints(vtkPointsList[ph]) > renderWindow.Render() > > print("Done. Animate.") > > # First animation without color > start_time = time() > for ph in range(0, 360, 20): > PolyData.SetPoints(vtkPointsList[ph]) > renderWindow.Render() > print("%.2f FPS" % (18 / (time() - start_time))) > > # Activate cells colors > ELMcolors = vtk.vtkUnsignedCharArray() > ELMcolors.SetNumberOfComponents(3) > ELMcolors.SetName("Colors") > for i in range(0, PolyData.GetNumberOfCells()): > ELMcolors.InsertNextTuple([random.random() * 255, random.random() > * 255, random.random() * 255]) > PolyData.GetCellData().SetScalars(ELMcolors) > > # Second animation with color > start_time = time() > for ph in range(0, 360, 20): > PolyData.SetPoints(vtkPointsList[ph]) > renderWindow.Render() > print("%.2f FPS" % (18 / (time() - start_time))) > > #################################### > > style.AddObserver("KeyPressEvent", KeyPress) > > renderer.AddActor(actor) > renderWindow.Render() > renderer.ResetCamera() > renderWindowInteractor.Start() > > ############################ > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/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 gavin.wheeler at kcl.ac.uk Mon Nov 26 11:23:49 2018 From: gavin.wheeler at kcl.ac.uk (Wheeler, Gavin) Date: Mon, 26 Nov 2018 16:23:49 +0000 Subject: [vtkusers] World Units In-Reply-To: References: Message-ID: Hi, 3D Slicer does indeed have a lot of functionality, and we use it within our department. However, the project I am working on is primarily concerned with Interaction and User Interface, so we are using VTK within Unity. By default Unity?s units are metres, and we stuck with that. However, since we made that decision we now know more about Unity, and their advice is to scale assets/worlds etc. as appropriate if metres isn?t appropriate. So effectively it?s unitless, but by default the unitless units are metres. If that makes sense. In the end metres works for us pretty well as we are developing room scale applications. I think it is similar for VTK, for one application there may be a default unit, but for another application a different one. I imagine tracking these and ensuring they all work would be a bit of a nightmare/ basically impossible to ensure. So it and responsibility are left up to the user. My solution to this isn?t elegant ? for variables with a unit I suffix them ?m? or ?mm? or ?s? etc. Best regards, Gavin From: vtkusers On Behalf Of Jean-Christophe Fillion-Robin Sent: 21 November 2018 16:42 To: matthew.troke at avalonholographics.com Cc: David Gobbi ; Steve Pieper ; vtkusers at public.kitware.com Subject: Re: [vtkusers] World Units Hi Matt, Units are intended to be used to describe the quantity of a given object. Units should help the application to be smarter about how the user can access/view/interact with the data. For example, units help the user by displaying the current unit in spinboxes as a suffix (1.3mm instead of 1.3). For more details, see here Jc On Wed, Nov 21, 2018 at 9:28 AM Matthew Troke > wrote: Could you elaborate a little more on support for units in Slicer? What do you mean by "built-in"? Matt On Tue, Nov 20, 2018 at 10:41 PM Jean-Christophe Fillion-Robin > wrote: Hi Gavin, If you are working with medical data, you could look at 3D slicer (https://slicer.org), it leverages VTK and ITK and also has the notion of units built-in. Hth Jc On Tue, Nov 20, 2018, 9:13 AM David Gobbi wrote: Hi Gavin, Using mm for medical image data (with the exception of microscopy) is the most common choice. I certainly wouldn't recommend using anything else. I've also noticed the need to tweak volume rendering depending on resolution. David On Tue, Nov 20, 2018 at 8:00 AM Wheeler, Gavin via vtkusers > wrote: We?ve not been using OpenVR directly, but have been using it indirectly with medical data. We ended up using m as the real world units, and then scaling loaded medical data by a factor of 1000 to convert from the commonly used mm, to m. This has worked well, but there are the odd gotchas when doing this? watch out for things like volume rendering step size which you may also need to scale. Gavin Wheeler From: vtkusers > On Behalf Of Ken Martin Sent: 19 November 2018 16:22 To: Dave Demarle > Cc: vtkusers at public.kitware.com Subject: Re: [vtkusers] World Units Although the OpenVR module does use the notion of a physical to world transformation to map between meters in the VR room and the world coordinates. On Mon, Nov 19, 2018 at 9:57 AM David E DeMarle > wrote: vtk itself is unitless. it is up to the application to keep track of that. David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: 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 -- Matthew Troke Software Engineer [http://www.avalonholographics.com/img/logo.png] Office: 1-709-701-0239 Email: matthew.troke at avalonholographics.com This email and any attachments are confidential and may be privileged. Any unauthorized use, disclosure, copying or distribution of the information received is prohibited. If you are not the intended recipient please contact the sender immediately by return email confirming that you have and will delete all communications related to the email and any attachments sent to you in error. -------------- next part -------------- An HTML attachment was scrubbed... URL: From allison.vacanti at kitware.com Mon Nov 26 12:05:17 2018 From: allison.vacanti at kitware.com (Allie Vacanti) Date: Mon, 26 Nov 2018 12:05:17 -0500 Subject: [vtkusers] Rendering, cannot get rid of hidden edges In-Reply-To: References: Message-ID: Try calling UseHiddenLineRemovalOn() on your vtkRenderer to always get the "after" result. On Thu, Nov 15, 2018 at 3:53 PM Piotrek Konarski < piotrek.konarski1 at gmail.com> wrote: > Hello > > I try to write a python script to plot unstructured grid data. Everything > goes fine except for rendering. VTK renders mesh edges that should be > normally invisible. Those edges disappear when I click on the interactor > window which rotates the plotted object. No matter if I use an interactor, > render a widow or save a screenshot to a file without rendering a window > the result is always the same, the edges are visible. I attach files to > illustrate the problem. > > I use VTK 8.1.1 on Fedora linux. > > Any ideas? > Regards, > Piotr > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 piotrek.konarski1 at gmail.com Mon Nov 26 13:04:04 2018 From: piotrek.konarski1 at gmail.com (Piotrek Konarski) Date: Mon, 26 Nov 2018 19:04:04 +0100 Subject: [vtkusers] Rendering, cannot get rid of hidden edges In-Reply-To: References: Message-ID: Thanks for your answer but it didn't work. On Mon, Nov 26, 2018 at 6:05 PM Allie Vacanti wrote: > Try calling UseHiddenLineRemovalOn() on your vtkRenderer to always get the > "after" result. > > On Thu, Nov 15, 2018 at 3:53 PM Piotrek Konarski < > piotrek.konarski1 at gmail.com> wrote: > >> Hello >> >> I try to write a python script to plot unstructured grid data. Everything >> goes fine except for rendering. VTK renders mesh edges that should be >> normally invisible. Those edges disappear when I click on the interactor >> window which rotates the plotted object. No matter if I use an interactor, >> render a widow or save a screenshot to a file without rendering a window >> the result is always the same, the edges are visible. I attach files to >> illustrate the problem. >> >> I use VTK 8.1.1 on Fedora linux. >> >> Any ideas? >> Regards, >> Piotr >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> 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.slaughter at inl.gov Mon Nov 26 13:09:55 2018 From: andrew.slaughter at inl.gov (Andrew E. Slaughter) Date: Mon, 26 Nov 2018 18:09:55 +0000 Subject: [vtkusers] Mesh Interpolation Message-ID: <6E629094-F85F-4D0D-834D-42FFB00D6C0F@inl.gov> I need to perform interpolation of data between two ExodusII files that differ because of refinement. I was hoping someone could point me in the correct direction for performing this action. I have attached the Exodus files that I am working with as well as a script that reads and displays the two files. I am using VTK7.1 (I can use 8 if needed) on MacOS. Here is the steps that I envision, but I am open to all options: 1. Interpolate the result from the coarse mesh to the fine mesh (I don?t know how to do this step). 2. Use vtkInterpolateDataSetAttributes to interpolate between the result from (1) and the fine mesh. Thanks for the help, Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: input_out.e Type: application/octet-stream Size: 39028 bytes Desc: input_out.e URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: input_out.e-s002 Type: application/octet-stream Size: 25636 bytes Desc: input_out.e-s002 URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: interpolate.py Type: text/x-python-script Size: 1825 bytes Desc: interpolate.py URL: From jonathan.borduas at caboma.com Mon Nov 26 13:17:32 2018 From: jonathan.borduas at caboma.com (Jonathan Borduas) Date: Mon, 26 Nov 2018 18:17:32 +0000 Subject: [vtkusers] Mesh Interpolation In-Reply-To: <6E629094-F85F-4D0D-834D-42FFB00D6C0F@inl.gov> References: <6E629094-F85F-4D0D-834D-42FFB00D6C0F@inl.gov> Message-ID: Hi Andrew, One way to interpolate point and cell data between two mesh: you can use the vtkPointInterpolator with a Voronoi Kernel (or other kernel), do a itk::DiscreteGaussianImageFilter over the 3D image to smooth the interpolation and then do a vtkProbeFilter. Best, Jonathan Get Outlook for iOS ________________________________ From: vtkusers on behalf of Andrew E. Slaughter via vtkusers Sent: Monday, November 26, 2018 1:09:55 PM To: vtkusers Subject: [vtkusers] Mesh Interpolation I need to perform interpolation of data between two ExodusII files that differ because of refinement. I was hoping someone could point me in the correct direction for performing this action. I have attached the Exodus files that I am working with as well as a script that reads and displays the two files. I am using VTK7.1 (I can use 8 if needed) on MacOS. Here is the steps that I envision, but I am open to all options: 1. Interpolate the result from the coarse mesh to the fine mesh (I don?t know how to do this step). 2. Use vtkInterpolateDataSetAttributes to interpolate between the result from (1) and the fine mesh. Thanks for the help, Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Mon Nov 26 13:23:01 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 26 Nov 2018 11:23:01 -0700 Subject: [vtkusers] Rendering, cannot get rid of hidden edges In-Reply-To: References: Message-ID: Hi Piotr, If the lines disappear when you interact with the window, then the problem might be related to the depth buffer precision. It's possible that the initial clipping range is too large, and interaction causes it to be reset to something more reasonable. You can try calling ResetCamera() or ResetCameraClippingRange() on the renderer to see what happens. David On Mon, Nov 26, 2018 at 11:04 AM Piotrek Konarski < piotrek.konarski1 at gmail.com> wrote: > Thanks for your answer but it didn't work. > > On Mon, Nov 26, 2018 at 6:05 PM Allie Vacanti > wrote: > >> Try calling UseHiddenLineRemovalOn() on your vtkRenderer to always get >> the "after" result. >> >> On Thu, Nov 15, 2018 at 3:53 PM Piotrek Konarski < >> piotrek.konarski1 at gmail.com> wrote: >> >>> Hello >>> >>> I try to write a python script to plot unstructured grid data. >>> Everything goes fine except for rendering. VTK renders mesh edges that >>> should be normally invisible. Those edges disappear when I click on the >>> interactor window which rotates the plotted object. No matter if I use an >>> interactor, render a widow or save a screenshot to a file without rendering >>> a window the result is always the same, the edges are visible. I attach >>> files to illustrate the problem. >>> >>> I use VTK 8.1.1 on Fedora linux. >>> >>> Any ideas? >>> Regards, >>> Piotr >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From piotrek.konarski1 at gmail.com Mon Nov 26 14:22:25 2018 From: piotrek.konarski1 at gmail.com (Piotrek Konarski) Date: Mon, 26 Nov 2018 20:22:25 +0100 Subject: [vtkusers] Rendering, cannot get rid of hidden edges In-Reply-To: References: Message-ID: ResetCameraClippingRange() works perfectly. Thanks a lot! On Mon, Nov 26, 2018 at 7:23 PM David Gobbi wrote: > Hi Piotr, > > If the lines disappear when you interact with the window, then the problem > might be related to the depth buffer precision. It's possible that the > initial clipping range is too large, and interaction causes it to be reset > to something more reasonable. You can try calling ResetCamera() or > ResetCameraClippingRange() on the renderer to see what happens. > > David > > On Mon, Nov 26, 2018 at 11:04 AM Piotrek Konarski < > piotrek.konarski1 at gmail.com> wrote: > >> Thanks for your answer but it didn't work. >> >> On Mon, Nov 26, 2018 at 6:05 PM Allie Vacanti < >> allison.vacanti at kitware.com> wrote: >> >>> Try calling UseHiddenLineRemovalOn() on your vtkRenderer to always get >>> the "after" result. >>> >>> On Thu, Nov 15, 2018 at 3:53 PM Piotrek Konarski < >>> piotrek.konarski1 at gmail.com> wrote: >>> >>>> Hello >>>> >>>> I try to write a python script to plot unstructured grid data. >>>> Everything goes fine except for rendering. VTK renders mesh edges that >>>> should be normally invisible. Those edges disappear when I click on the >>>> interactor window which rotates the plotted object. No matter if I use an >>>> interactor, render a widow or save a screenshot to a file without rendering >>>> a window the result is always the same, the edges are visible. I attach >>>> files to illustrate the problem. >>>> >>>> I use VTK 8.1.1 on Fedora linux. >>>> >>>> Any ideas? >>>> Regards, >>>> Piotr >>>> >>> -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.slaughter at inl.gov Mon Nov 26 19:16:21 2018 From: andrew.slaughter at inl.gov (Andrew E. Slaughter) Date: Tue, 27 Nov 2018 00:16:21 +0000 Subject: [vtkusers] Mesh Interpolation In-Reply-To: References: <6E629094-F85F-4D0D-834D-42FFB00D6C0F@inl.gov> Message-ID: <88DD1D01-21C4-433A-B2DE-77E1B7517FED@inl.gov> If possible I need to maintain the UnstructuredGrid, I started an attempt to get this working. If anyone is willing I would appreciate the help. I will keep working on it as well. From: Jonathan Borduas Date: Monday, November 26, 2018 at 11:17 AM To: "Andrew E. Slaughter" , vtkusers Subject: Re: [vtkusers] Mesh Interpolation Hi Andrew, One way to interpolate point and cell data between two mesh: you can use the vtkPointInterpolator with a Voronoi Kernel (or other kernel), do a itk::DiscreteGaussianImageFilter over the 3D image to smooth the interpolation and then do a vtkProbeFilter. Best, Jonathan Get Outlook for iOS ________________________________ From: vtkusers on behalf of Andrew E. Slaughter via vtkusers Sent: Monday, November 26, 2018 1:09:55 PM To: vtkusers Subject: [vtkusers] Mesh Interpolation I need to perform interpolation of data between two ExodusII files that differ because of refinement. I was hoping someone could point me in the correct direction for performing this action. I have attached the Exodus files that I am working with as well as a script that reads and displays the two files. I am using VTK7.1 (I can use 8 if needed) on MacOS. Here is the steps that I envision, but I am open to all options: 1. Interpolate the result from the coarse mesh to the fine mesh (I don?t know how to do this step). 2. Use vtkInterpolateDataSetAttributes to interpolate between the result from (1) and the fine mesh. Thanks for the help, Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: interpolate.py Type: text/x-python-script Size: 3844 bytes Desc: interpolate.py URL: From andrew.slaughter at inl.gov Mon Nov 26 19:25:48 2018 From: andrew.slaughter at inl.gov (Andrew E. Slaughter) Date: Tue, 27 Nov 2018 00:25:48 +0000 Subject: [vtkusers] Mesh Interpolation In-Reply-To: References: <6E629094-F85F-4D0D-834D-42FFB00D6C0F@inl.gov> Message-ID: <44EB7FF4-C918-447A-B338-2D8297097286@inl.gov> In my previous reply I included the wrong script, this one still doesn?t work, but runs. Sorry. From: Jonathan Borduas Date: Monday, November 26, 2018 at 11:17 AM To: "Andrew E. Slaughter" , vtkusers Subject: Re: [vtkusers] Mesh Interpolation Hi Andrew, One way to interpolate point and cell data between two mesh: you can use the vtkPointInterpolator with a Voronoi Kernel (or other kernel), do a itk::DiscreteGaussianImageFilter over the 3D image to smooth the interpolation and then do a vtkProbeFilter. Best, Jonathan Get Outlook for iOS ________________________________ From: vtkusers on behalf of Andrew E. Slaughter via vtkusers Sent: Monday, November 26, 2018 1:09:55 PM To: vtkusers Subject: [vtkusers] Mesh Interpolation I need to perform interpolation of data between two ExodusII files that differ because of refinement. I was hoping someone could point me in the correct direction for performing this action. I have attached the Exodus files that I am working with as well as a script that reads and displays the two files. I am using VTK7.1 (I can use 8 if needed) on MacOS. Here is the steps that I envision, but I am open to all options: 1. Interpolate the result from the coarse mesh to the fine mesh (I don?t know how to do this step). 2. Use vtkInterpolateDataSetAttributes to interpolate between the result from (1) and the fine mesh. Thanks for the help, Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: interpolate.py Type: text/x-python-script Size: 3844 bytes Desc: interpolate.py URL: From andrew.slaughter at inl.gov Mon Nov 26 23:42:36 2018 From: andrew.slaughter at inl.gov (Andrew E. Slaughter) Date: Tue, 27 Nov 2018 04:42:36 +0000 Subject: [vtkusers] Mesh Interpolation In-Reply-To: References: <6E629094-F85F-4D0D-834D-42FFB00D6C0F@inl.gov> Message-ID: <38071330-363A-4128-B275-1D866C701329@inl.gov> I nearly have the problem figured out, but I cannot get vtkInterpolateDataSetAttributes to run. If anyone has experience with this class I would appreciate some insight into it use. I am using the object on line 114 of the attached script. Thanks. From: Jonathan Borduas Date: Monday, November 26, 2018 at 11:17 AM To: "Andrew E. Slaughter" , vtkusers Subject: Re: [vtkusers] Mesh Interpolation Hi Andrew, One way to interpolate point and cell data between two mesh: you can use the vtkPointInterpolator with a Voronoi Kernel (or other kernel), do a itk::DiscreteGaussianImageFilter over the 3D image to smooth the interpolation and then do a vtkProbeFilter. Best, Jonathan Get Outlook for iOS ________________________________ From: vtkusers on behalf of Andrew E. Slaughter via vtkusers Sent: Monday, November 26, 2018 1:09:55 PM To: vtkusers Subject: [vtkusers] Mesh Interpolation I need to perform interpolation of data between two ExodusII files that differ because of refinement. I was hoping someone could point me in the correct direction for performing this action. I have attached the Exodus files that I am working with as well as a script that reads and displays the two files. I am using VTK7.1 (I can use 8 if needed) on MacOS. Here is the steps that I envision, but I am open to all options: 1. Interpolate the result from the coarse mesh to the fine mesh (I don?t know how to do this step). 2. Use vtkInterpolateDataSetAttributes to interpolate between the result from (1) and the fine mesh. Thanks for the help, Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: interpolate.py Type: text/x-python-script Size: 4915 bytes Desc: interpolate.py URL: From jonathan.borduas at caboma.com Mon Nov 26 23:59:44 2018 From: jonathan.borduas at caboma.com (Jonathan Borduas) Date: Tue, 27 Nov 2018 04:59:44 +0000 Subject: [vtkusers] Mesh Interpolation In-Reply-To: <38071330-363A-4128-B275-1D866C701329@inl.gov> References: <6E629094-F85F-4D0D-834D-42FFB00D6C0F@inl.gov> <38071330-363A-4128-B275-1D866C701329@inl.gov> Message-ID: See the test of the vtkInterpolateDataSetAttributes: https://www.vtk.org/gitweb?p=VTK.git;a=blob;f=Filters/Hybrid/Testing/Python/3DMorph.py Didn?t understand why you would need to use that class though. I think the name is misleading you. If you look at the example, this isn?t for data interpolation ! It is for the interpolation of implicit functions (as seen in the test). More on implicit functions: https://www.vtk.org/doc/nightly/html/classvtkImplicitFunction.html vtkInterpolateDataSetAttributes actually looks more like an Optimal Transport Interpolator: https://www.youtube.com/watch?v=6nhfArEM4Sg Jonathan From: Andrew E. Slaughter Sent: Monday, November 26, 2018 11:43 PM To: Jonathan Borduas ; vtkusers Subject: Re: [vtkusers] Mesh Interpolation I nearly have the problem figured out, but I cannot get vtkInterpolateDataSetAttributes to run. If anyone has experience with this class I would appreciate some insight into it use. I am using the object on line 114 of the attached script. Thanks. From: Jonathan Borduas > Date: Monday, November 26, 2018 at 11:17 AM To: "Andrew E. Slaughter" >, vtkusers > Subject: Re: [vtkusers] Mesh Interpolation Hi Andrew, One way to interpolate point and cell data between two mesh: you can use the vtkPointInterpolator with a Voronoi Kernel (or other kernel), do a itk::DiscreteGaussianImageFilter over the 3D image to smooth the interpolation and then do a vtkProbeFilter. Best, Jonathan Get Outlook for iOS ________________________________ From: vtkusers > on behalf of Andrew E. Slaughter via vtkusers > Sent: Monday, November 26, 2018 1:09:55 PM To: vtkusers Subject: [vtkusers] Mesh Interpolation I need to perform interpolation of data between two ExodusII files that differ because of refinement. I was hoping someone could point me in the correct direction for performing this action. I have attached the Exodus files that I am working with as well as a script that reads and displays the two files. I am using VTK7.1 (I can use 8 if needed) on MacOS. Here is the steps that I envision, but I am open to all options: 1. Interpolate the result from the coarse mesh to the fine mesh (I don?t know how to do this step). 2. Use vtkInterpolateDataSetAttributes to interpolate between the result from (1) and the fine mesh. Thanks for the help, Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.slaughter at inl.gov Tue Nov 27 00:39:35 2018 From: andrew.slaughter at inl.gov (Andrew E. Slaughter) Date: Tue, 27 Nov 2018 05:39:35 +0000 Subject: [vtkusers] Mesh Interpolation In-Reply-To: References: <6E629094-F85F-4D0D-834D-42FFB00D6C0F@inl.gov> <38071330-363A-4128-B275-1D866C701329@inl.gov> Message-ID: Thanks for the information, but I don?t see where the vtkInterpolateDataSetAttribute documentation discusses implicit functions. My reason for going down this path is as follows: The documentation states ?vtkInterpolateDataSetAttributes is a filter that interpolates data set attribute values between input data sets.? This is exactly my situation. I have two vtkUnstructuredGrid objects (which is a vtkDataSet). Each of these objects contain vtkPointData (which is a vtkDataSetAttributes). These two objects are exactly the same with respect to the number of nodes, cells, etc. If you can explain why my understanding of this class is wrong I would appreciate it. I used the example you provided as a guide to setting up the vtkInterpolateDataSetAttribute object, but a problem I am seeing with the interpolation is that the number of input ports is always reporting 1 in the vtkInterpolateDataSetAttribute object, regardless of how many items I add. I can?t set the number of points in python, since the SetNumberOfInputPorts is a protected member, thus not part of the python API. I will keep investigating this, thanks for your help. From: Jonathan Borduas Date: Monday, November 26, 2018 at 10:00 PM To: "Andrew E. Slaughter" , vtkusers Subject: RE: [vtkusers] Mesh Interpolation See the test of the vtkInterpolateDataSetAttributes: https://www.vtk.org/gitweb?p=VTK.git;a=blob;f=Filters/Hybrid/Testing/Python/3DMorph.py Didn?t understand why you would need to use that class though. I think the name is misleading you. If you look at the example, this isn?t for data interpolation ! It is for the interpolation of implicit functions (as seen in the test). More on implicit functions: https://www.vtk.org/doc/nightly/html/classvtkImplicitFunction.html vtkInterpolateDataSetAttributes actually looks more like an Optimal Transport Interpolator: https://www.youtube.com/watch?v=6nhfArEM4Sg Jonathan From: Andrew E. Slaughter Sent: Monday, November 26, 2018 11:43 PM To: Jonathan Borduas ; vtkusers Subject: Re: [vtkusers] Mesh Interpolation I nearly have the problem figured out, but I cannot get vtkInterpolateDataSetAttributes to run. If anyone has experience with this class I would appreciate some insight into it use. I am using the object on line 114 of the attached script. Thanks. From: Jonathan Borduas > Date: Monday, November 26, 2018 at 11:17 AM To: "Andrew E. Slaughter" >, vtkusers > Subject: Re: [vtkusers] Mesh Interpolation Hi Andrew, One way to interpolate point and cell data between two mesh: you can use the vtkPointInterpolator with a Voronoi Kernel (or other kernel), do a itk::DiscreteGaussianImageFilter over the 3D image to smooth the interpolation and then do a vtkProbeFilter. Best, Jonathan Get Outlook for iOS ________________________________ From: vtkusers > on behalf of Andrew E. Slaughter via vtkusers > Sent: Monday, November 26, 2018 1:09:55 PM To: vtkusers Subject: [vtkusers] Mesh Interpolation I need to perform interpolation of data between two ExodusII files that differ because of refinement. I was hoping someone could point me in the correct direction for performing this action. I have attached the Exodus files that I am working with as well as a script that reads and displays the two files. I am using VTK7.1 (I can use 8 if needed) on MacOS. Here is the steps that I envision, but I am open to all options: 1. Interpolate the result from the coarse mesh to the fine mesh (I don?t know how to do this step). 2. Use vtkInterpolateDataSetAttributes to interpolate between the result from (1) and the fine mesh. Thanks for the help, Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonathan.borduas at caboma.com Tue Nov 27 01:08:05 2018 From: jonathan.borduas at caboma.com (Jonathan Borduas) Date: Tue, 27 Nov 2018 06:08:05 +0000 Subject: [vtkusers] Mesh Interpolation In-Reply-To: References: <6E629094-F85F-4D0D-834D-42FFB00D6C0F@inl.gov> <38071330-363A-4128-B275-1D866C701329@inl.gov> , Message-ID: Humm, yes, I think you are right. Mea Culpa It should works. I will try to review your script tomorrow. Get Outlook for iOS ________________________________ From: Andrew E. Slaughter Sent: Tuesday, November 27, 2018 12:39:35 AM To: Jonathan Borduas; vtkusers Subject: Re: [vtkusers] Mesh Interpolation Thanks for the information, but I don?t see where the vtkInterpolateDataSetAttribute documentation discusses implicit functions. My reason for going down this path is as follows: The documentation states ?vtkInterpolateDataSetAttributes is a filter that interpolates data set attribute values between input data sets.? This is exactly my situation. I have two vtkUnstructuredGrid objects (which is a vtkDataSet). Each of these objects contain vtkPointData (which is a vtkDataSetAttributes). These two objects are exactly the same with respect to the number of nodes, cells, etc. If you can explain why my understanding of this class is wrong I would appreciate it. I used the example you provided as a guide to setting up the vtkInterpolateDataSetAttribute object, but a problem I am seeing with the interpolation is that the number of input ports is always reporting 1 in the vtkInterpolateDataSetAttribute object, regardless of how many items I add. I can?t set the number of points in python, since the SetNumberOfInputPorts is a protected member, thus not part of the python API. I will keep investigating this, thanks for your help. From: Jonathan Borduas Date: Monday, November 26, 2018 at 10:00 PM To: "Andrew E. Slaughter" , vtkusers Subject: RE: [vtkusers] Mesh Interpolation See the test of the vtkInterpolateDataSetAttributes: https://www.vtk.org/gitweb?p=VTK.git;a=blob;f=Filters/Hybrid/Testing/Python/3DMorph.py Didn?t understand why you would need to use that class though. I think the name is misleading you. If you look at the example, this isn?t for data interpolation ! It is for the interpolation of implicit functions (as seen in the test). More on implicit functions: https://www.vtk.org/doc/nightly/html/classvtkImplicitFunction.html vtkInterpolateDataSetAttributes actually looks more like an Optimal Transport Interpolator: https://www.youtube.com/watch?v=6nhfArEM4Sg Jonathan From: Andrew E. Slaughter Sent: Monday, November 26, 2018 11:43 PM To: Jonathan Borduas ; vtkusers Subject: Re: [vtkusers] Mesh Interpolation I nearly have the problem figured out, but I cannot get vtkInterpolateDataSetAttributes to run. If anyone has experience with this class I would appreciate some insight into it use. I am using the object on line 114 of the attached script. Thanks. From: Jonathan Borduas > Date: Monday, November 26, 2018 at 11:17 AM To: "Andrew E. Slaughter" >, vtkusers > Subject: Re: [vtkusers] Mesh Interpolation Hi Andrew, One way to interpolate point and cell data between two mesh: you can use the vtkPointInterpolator with a Voronoi Kernel (or other kernel), do a itk::DiscreteGaussianImageFilter over the 3D image to smooth the interpolation and then do a vtkProbeFilter. Best, Jonathan Get Outlook for iOS ________________________________ From: vtkusers > on behalf of Andrew E. Slaughter via vtkusers > Sent: Monday, November 26, 2018 1:09:55 PM To: vtkusers Subject: [vtkusers] Mesh Interpolation I need to perform interpolation of data between two ExodusII files that differ because of refinement. I was hoping someone could point me in the correct direction for performing this action. I have attached the Exodus files that I am working with as well as a script that reads and displays the two files. I am using VTK7.1 (I can use 8 if needed) on MacOS. Here is the steps that I envision, but I am open to all options: 1. Interpolate the result from the coarse mesh to the fine mesh (I don?t know how to do this step). 2. Use vtkInterpolateDataSetAttributes to interpolate between the result from (1) and the fine mesh. Thanks for the help, Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.slaughter at inl.gov Tue Nov 27 01:13:50 2018 From: andrew.slaughter at inl.gov (Andrew E. Slaughter) Date: Tue, 27 Nov 2018 06:13:50 +0000 Subject: [vtkusers] Mesh Interpolation In-Reply-To: References: <6E629094-F85F-4D0D-834D-42FFB00D6C0F@inl.gov> <38071330-363A-4128-B275-1D866C701329@inl.gov> Message-ID: <82A521C5-2FB9-4D64-935E-2E3F71AE127A@inl.gov> Thank you again, here is the latest version of the script and data (I changed the ranges to make thinks a bit easier to see). I will keep plugging away at it tomorrow as well. From: Jonathan Borduas Date: Monday, November 26, 2018 at 11:08 PM To: "Andrew E. Slaughter" , vtkusers Subject: Re: [vtkusers] Mesh Interpolation Mea Culpa -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: input_out.e Type: application/octet-stream Size: 39028 bytes Desc: input_out.e URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: input_out.e-s002 Type: application/octet-stream Size: 25636 bytes Desc: input_out.e-s002 URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: interpolate.py Type: text/x-python-script Size: 4956 bytes Desc: interpolate.py URL: From vincentrivola at hotmail.com Tue Nov 27 01:29:58 2018 From: vincentrivola at hotmail.com (vincentrivola) Date: Mon, 26 Nov 2018 23:29:58 -0700 (MST) Subject: [vtkusers] Mesh Interpolation In-Reply-To: <82A521C5-2FB9-4D64-935E-2E3F71AE127A@inl.gov> References: <6E629094-F85F-4D0D-834D-42FFB00D6C0F@inl.gov> <38071330-363A-4128-B275-1D866C701329@inl.gov> <82A521C5-2FB9-4D64-935E-2E3F71AE127A@inl.gov> Message-ID: <1543300198454-0.post@n5.nabble.com> Hi Andrew, I saw your message on linkedin. I did not use the filter you describe on my side. My script is based on the vtkDistancePolyDataFilter that I compute between the two meshes. Then I loop over cells of one mesh to get the closest points on the other mesh using a kdTree and finally compute the interpolated with a distance weighting of these closest points values. Hope this helps -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From andrewkeeling at hotmail.com Tue Nov 27 03:22:14 2018 From: andrewkeeling at hotmail.com (andyjk) Date: Tue, 27 Nov 2018 01:22:14 -0700 (MST) Subject: [vtkusers] Correct way to return input polydata as output from filter Message-ID: <1543306934948-0.post@n5.nabble.com> Basics please! I have a function: void foo(vtksmartpointer& in_out); In foo I run several filters in a pipeline, starting with in_out as an input. My first question: To return the modified in_out, currently I create a temporary polydata, get the final filter output, then deepcopy temporary to in_out. Is this the best way? Second question: I find if I don't pass smartpointer by reference, things don't work. This can be shown with the VTK test for normals demo too (which passes polydata*). I have to change to referenced smartpointers to get the results of the function to persist. Somehow I think this is wrong? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From sfaisal.ali91 at gmail.com Tue Nov 27 05:04:29 2018 From: sfaisal.ali91 at gmail.com (sfaisalali91) Date: Tue, 27 Nov 2018 03:04:29 -0700 (MST) Subject: [vtkusers] VtkResliceImageViewer cordinate system (world and display) In-Reply-To: <1542807008857-0.post@n5.nabble.com> References: <1542721877714-0.post@n5.nabble.com> <1542807008857-0.post@n5.nabble.com> Message-ID: <1543313069551-0.post@n5.nabble.com> I guess i got the solution :) took a while for understanding the implementation. here is the solution to convert image cordinates to world cordinates. vtkIdType ptId = this->ImageData->FindPoint(q); if (ptId == -1) { return 0; } double closestPt[3]; this->ImageData->GetPoint(ptId, closestPt); double origin[3]; this->ImageData->GetOrigin(origin); double spacing[3]; this->ImageData->GetSpacing(spacing); int extent[6]; this->ImageData->GetExtent(extent); int iq[3]; int iqtemp; for (int i = 0; i < 3; ++i) { // compute world to image coords iqtemp = vtkMath::Round((closestPt[i] - origin[i]) / spacing[i]); // we have a valid pick already, just enforce bounds check iq[i] = (iqtemp < extent[2 * i]) ? extent[2 * i] : \ ((iqtemp > extent[2 * i + 1]) ? extent[2 * i + 1] : iqtemp); // compute image to world coords q[i] = iq[i] * spacing[i] + origin[i]; CurrentWorldPosition[i] = q[i]; this->CurrentPosition[i] = iq[i]; } std::cout << "Image to world:" << q[0] << ", " << q[1] << ", " << q[2] << std::endl; vtkImageCoordinateWidget helped me with the implementation :) Thank you. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From matthew.troke at avalonholographics.com Tue Nov 27 08:10:54 2018 From: matthew.troke at avalonholographics.com (Matthew Troke) Date: Tue, 27 Nov 2018 09:40:54 -0330 Subject: [vtkusers] Invisible render window? Message-ID: Is is possible to create a render window for offscreen rendering but also hide the window completely? Currently, during offscreen rendering, a black window is shown. Matt -- Matthew Troke Software Engineer Office: 1-709-701-0239 Email: matthew.troke at avalonholographics.com -- _This email and any attachments are confidential and may be privileged. Any unauthorized use, disclosure, copying or distribution of the information received is prohibited. If you are not the intended recipient please contact the sender immediately by return email confirming that you have and will delete all communications related to the email and any attachments sent to you in error._ -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.martin at kitware.com Tue Nov 27 08:24:26 2018 From: ken.martin at kitware.com (Ken Martin) Date: Tue, 27 Nov 2018 08:24:26 -0500 Subject: [vtkusers] Invisible render window? In-Reply-To: References: Message-ID: Have you tried this against VTK master? The offscreen code was reworked a couple weeks ago. - Ken On Tue, Nov 27, 2018 at 8:11 AM Matthew Troke < matthew.troke at avalonholographics.com> wrote: > Is is possible to create a render window for offscreen rendering but also > hide the window completely? Currently, during offscreen rendering, a black > window is shown. > > Matt > > -- > Matthew Troke > Software Engineer > Office: 1-709-701-0239 > Email: matthew.troke at avalonholographics.com > > *This email and any attachments are confidential and may be privileged. > Any unauthorized use, disclosure, copying or distribution of the > information received is prohibited. If you are not the intended recipient > please contact the sender immediately by return email confirming that you > have and will delete all communications related to the email and any > attachments sent to you in error.* > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 > -- 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 scbiradar at gmail.com Tue Nov 27 08:55:03 2018 From: scbiradar at gmail.com (Santosh Biradar) Date: Tue, 27 Nov 2018 19:25:03 +0530 Subject: [vtkusers] vtkAVIWriter with renderer gradient background shows distinct lines Message-ID: I am trying to create a movie of an animation using vtkAVIWriter. The renderer has a gradient background. The .avi file created has distinct lines/bands in the background because of the gradient. Is it possible to get rid of these lines. I notice that if I use a vtkBMPWriter and write an image, the image seems fine without any such lines/bands. A code snippet of what I am doing: window_to_image = vtk.vtkWindowToImageFilter() window_to_image.SetInput(renWin.GetRenderWindow()) window_to_image.SetInputBufferTypeToRGB() window_to_image.ReadFrontBufferOff() writer = vtk.vtkAVIWriter() writer.SetInputConnection(window_to_image.GetOutputPort()) I am running python wrapper of VTK-6.3.0 on windows Thanks, Santosh -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Tue Nov 27 09:01:14 2018 From: cory.quammen at kitware.com (Cory Quammen) Date: Tue, 27 Nov 2018 09:01:14 -0500 Subject: [vtkusers] vtkAVIWriter with renderer gradient background shows distinct lines In-Reply-To: References: Message-ID: Sounds like quantization/compression artifacts. You can try changing the quality setting to reduce compression via vtkAVIWriter::SetQuality(). HTH, Cory On Tue, Nov 27, 2018 at 8:55 AM Santosh Biradar wrote: > I am trying to create a movie of an animation using vtkAVIWriter. > The renderer has a gradient background. The .avi file created has distinct > lines/bands in the background because of the gradient. Is it possible to > get rid of these lines. I notice that if I use a vtkBMPWriter and write an > image, the image seems fine without any such lines/bands. > > A code snippet of what I am doing: > > window_to_image = vtk.vtkWindowToImageFilter() > window_to_image.SetInput(renWin.GetRenderWindow()) > window_to_image.SetInputBufferTypeToRGB() > window_to_image.ReadFrontBufferOff() > > writer = vtk.vtkAVIWriter() > writer.SetInputConnection(window_to_image.GetOutputPort()) > > I am running python wrapper of VTK-6.3.0 on windows > > Thanks, > Santosh > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 scbiradar at gmail.com Tue Nov 27 09:26:17 2018 From: scbiradar at gmail.com (Santosh Biradar) Date: Tue, 27 Nov 2018 19:56:17 +0530 Subject: [vtkusers] vtkAVIWriter with renderer gradient background shows distinct lines In-Reply-To: References: Message-ID: Thanks for the quick response Cory. I tried setting quality to 0,1,2. The quality of the movie was best for 2 and worst for 0 but the background remained the same in each case. The quality of the output of the filter (in this case, a vtkContourFilter) reduces with reduction in SetQuality but the background remains of the same quality. There is no difference in the quality of the background. I also get the same behavior in Paraview's Save Animation feature (version 5.5 on windows) Thanks, Santosh On Tue, Nov 27, 2018 at 7:29 PM Cory Quammen wrote: > Sounds like quantization/compression artifacts. You can try changing the > quality setting to reduce compression via vtkAVIWriter::SetQuality(). > > HTH, > Cory > > On Tue, Nov 27, 2018 at 8:55 AM Santosh Biradar > wrote: > >> I am trying to create a movie of an animation using vtkAVIWriter. >> The renderer has a gradient background. The .avi file created has >> distinct lines/bands in the background because of the gradient. Is it >> possible to get rid of these lines. I notice that if I use a vtkBMPWriter >> and write an image, the image seems fine without any such lines/bands. >> >> A code snippet of what I am doing: >> >> window_to_image = vtk.vtkWindowToImageFilter() >> window_to_image.SetInput(renWin.GetRenderWindow()) >> window_to_image.SetInputBufferTypeToRGB() >> window_to_image.ReadFrontBufferOff() >> >> writer = vtk.vtkAVIWriter() >> writer.SetInputConnection(window_to_image.GetOutputPort()) >> >> I am running python wrapper of VTK-6.3.0 on windows >> >> Thanks, >> Santosh >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> 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 michelmuerner at gmx.ch Tue Nov 27 09:40:05 2018 From: michelmuerner at gmx.ch (=?UTF-8?Q?=22Michel_M=C3=BCrner=22?=) Date: Tue, 27 Nov 2018 15:40:05 +0100 Subject: [vtkusers] Depth Peeling VTK example not working on macOS Message-ID: An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Tue Nov 27 10:46:17 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Tue, 27 Nov 2018 10:46:17 -0500 Subject: [vtkusers] announce: VTK 8.2.0 release candidate two is out Message-ID: Please give it a try. More info here: https://blog.kitware.com/vtk-8-2-0-rc2-ready-for-testing/ David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Tue Nov 27 11:11:16 2018 From: cory.quammen at kitware.com (Cory Quammen) Date: Tue, 27 Nov 2018 11:11:16 -0500 Subject: [vtkusers] vtkAVIWriter with renderer gradient background shows distinct lines In-Reply-To: References: Message-ID: I'm afraid I don't have a lot of experience with the AVI compression options. You might experiment with vtkAVIWriter::SetCompressorFourCC() to see if you can find a compressor that gives more satisfactory results. Personally I prefer to dump animation frames and assemble them with outside video software. Cory On Tue, Nov 27, 2018 at 9:26 AM Santosh Biradar wrote: > Thanks for the quick response Cory. > I tried setting quality to 0,1,2. The quality of the movie was best for 2 > and worst for 0 but the background remained the same in each case. > The quality of the output of the filter (in this case, a > vtkContourFilter) reduces with reduction in SetQuality but the background > remains of the same quality. > There is no difference in the quality of the background. > > I also get the same behavior in Paraview's Save Animation feature (version > 5.5 on windows) > > Thanks, > Santosh > > > On Tue, Nov 27, 2018 at 7:29 PM Cory Quammen > wrote: > >> Sounds like quantization/compression artifacts. You can try changing the >> quality setting to reduce compression via vtkAVIWriter::SetQuality(). >> >> HTH, >> Cory >> >> On Tue, Nov 27, 2018 at 8:55 AM Santosh Biradar >> wrote: >> >>> I am trying to create a movie of an animation using vtkAVIWriter. >>> The renderer has a gradient background. The .avi file created has >>> distinct lines/bands in the background because of the gradient. Is it >>> possible to get rid of these lines. I notice that if I use a vtkBMPWriter >>> and write an image, the image seems fine without any such lines/bands. >>> >>> A code snippet of what I am doing: >>> >>> window_to_image = vtk.vtkWindowToImageFilter() >>> window_to_image.SetInput(renWin.GetRenderWindow()) >>> window_to_image.SetInputBufferTypeToRGB() >>> window_to_image.ReadFrontBufferOff() >>> >>> writer = vtk.vtkAVIWriter() >>> writer.SetInputConnection(window_to_image.GetOutputPort()) >>> >>> I am running python wrapper of VTK-6.3.0 on windows >>> >>> Thanks, >>> Santosh >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> 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. >> > -- Cory Quammen Staff R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Tue Nov 27 11:53:11 2018 From: cory.quammen at kitware.com (Cory Quammen) Date: Tue, 27 Nov 2018 11:53:11 -0500 Subject: [vtkusers] Extract csv row and column into points In-Reply-To: References: Message-ID: Polly, It seems I was mistaken about the output of the vtkKMeansStatistics filter. It looks like it does not pass through the input columns with something like a cluster label. I have no experience with the filter, so I'm not sure how to guide you from here. David Thompson (CC'ed) would know more since he was an author of the filter. He may be able to help if he has time. Some resources that may help: Doxygen page: https://www.vtk.org/doc/nightly/html/classvtkKMeansStatistics.html#details Example: https://www.vtk.org/gitweb?p=VTK.git;a=blob;f=Examples/Statistics/ExampleKMeansStatistics.cxx Cory On Wed, Nov 21, 2018 at 1:16 AM Polly Pui wrote: > And also I tried to remove the lines in order to test if the columns are > called successfully. I received the error stated "Failed to locate the > columns to use for the point coordinates". > > These are the codes: > std::string inputFilename = argv[1]; > > vtkSmartPointer reader = > vtkSmartPointer::New(); > reader->SetFileName(inputFilename.c_str()); > reader->SetFieldDelimiterCharacters(","); > reader->DetectNumericColumnsOn(); > //reader->GetHaveHeaders(); > reader->Update(); > > reader->GetOutput()->Dump(); > ///////KmeansCluster > > vtkSmartPointer kMeansStatistics = > vtkSmartPointer::New(); > kMeansStatistics->SetInputConnection(reader->GetOutputPort()); > kMeansStatistics->SetColumnStatus("X", 1); > kMeansStatistics->SetColumnStatus("Y", 1); > kMeansStatistics->SetColumnStatus("Z", 1); > kMeansStatistics->RequestSelectedColumns(); > kMeansStatistics->SetAssessOption(true); > kMeansStatistics->SetDefaultNumberOfClusters(5); > //kMeansStatistics->SetLearnOption(1);//to learn the cluster value > kMeansStatistics->SetMaxNumIterations(15); > kMeansStatistics->Update(); > > vtkSmartPointer t2pd = > vtkSmartPointer::New(); > t2pd->SetInputConnection(kMeansStatistics->GetOutputPort()); > t2pd->SetXColumn("X"); > t2pd->SetYColumn("Y"); > t2pd->SetZColumn("Z"); > > vtkSmartPointer mapper = > vtkSmartPointer::New(); > mapper->SetInputConnection(t2pd->GetOutputPort()); > > vtkSmartPointer actor = > vtkSmartPointer::New(); > actor->SetMapper(mapper); > actor->GetProperty()->SetPointSize(3); > actor->GetProperty()->SetColor(1, 1, 1); > > vtkSmartPointer renderer = > vtkSmartPointer::New(); > vtkSmartPointer renderWindow = > vtkSmartPointer::New(); > renderWindow->AddRenderer(renderer); > renderWindow->SetSize(640, 480); > > vtkSmartPointer renderWindowInteractor = > vtkSmartPointer::New(); > renderWindowInteractor->SetRenderWindow(renderWindow); > > renderer->AddActor(actor); > renderer->SetBackground(0, 0, 0); // Background color black > > renderWindow->Render(); > renderWindowInteractor->Start(); > > return EXIT_SUCCESS; > } > > I supposed the column of interest to be called are "X", "Y" and "Z". > Please advice. > Thank you very much. > > Regards, > Polly > ------------------------------ > *From:* vtkusers on behalf of Polly > Pui > *Sent:* Wednesday, November 21, 2018 2:01 PM > *To:* Cory Quammen > *Cc:* vtkusers > *Subject:* Re: [vtkusers] Extract csv row and column into points > > Hi Cory, > Thanks for your reply. > I followed your advice and changed the lines as you mentioned. > But I still couldn't get the output successfully. > > I would like to clarify if I called the column of interest correctly. > Please refer to the attachment. The columns that to be called as X,Y,Z > coordinates are named as "X", "Y", "Z". > When i run the exe file. It failed to load and couldn't get the correct > cluster. > > This is the codes that I am using. > .............. > int main(int argc, char* argv[]) > { > std::string inputFilename = argv[1]; > > vtkSmartPointer reader = > vtkSmartPointer::New(); > reader->SetFileName(inputFilename.c_str()); > reader->SetFieldDelimiterCharacters(","); > reader->DetectNumericColumnsOn(); > //reader->GetHaveHeaders(); > reader->Update(); > > ///////KmeansCluster > > vtkSmartPointer kMeansStatistics = > vtkSmartPointer::New(); > kMeansStatistics->SetInputConnection(reader->GetOutputPort()); > kMeansStatistics->SetColumnStatus("X", 1); > kMeansStatistics->SetColumnStatus("Y", 1); > kMeansStatistics->SetColumnStatus("Z", 1); > kMeansStatistics->RequestSelectedColumns(); > kMeansStatistics->SetAssessOption(true); > kMeansStatistics->SetDefaultNumberOfClusters(5); > //kMeansStatistics->SetLearnOption(1);//to learn the cluster value > kMeansStatistics->SetMaxNumIterations(15); > kMeansStatistics->Update(); > > //// Display the results in CMD (each row) > kMeansStatistics->GetOutput()->Dump(); > > ////Group the points according to ID number > vtkSmartPointer clusterArray = > vtkSmartPointer::New(); > clusterArray->SetNumberOfComponents(1); > clusterArray->SetName("ClusterId"); > > for (int r = 0; r < kMeansStatistics->GetOutput()->GetNumberOfRows(); r++) > { > vtkVariant v = kMeansStatistics->GetOutput()->GetValue(r, > kMeansStatistics->GetOutput()->GetNumberOfColumns() - 1); > std::cout << "Point " << r << " is in cluster " << v.ToInt() << std::endl; > clusterArray->InsertNextValue(v.ToInt()); > } > > //// Create a lookup table to map cell data to colors > vtkSmartPointer lut = > vtkSmartPointer::New(); > int tableSize = (kMeansStatistics + 1, 10); > lut->SetNumberOfTableValues(tableSize); > lut->Build(); > > ////ColorCells > vtkSmartPointer colors = > vtkSmartPointer::New(); > lut->SetTableValue(0, colors->GetColor4d("Black").GetData()); > lut->SetTableValue(1, colors->GetColor4d("Banana").GetData()); > lut->SetTableValue(2, colors->GetColor4d("Tomato").GetData()); > lut->SetTableValue(3, colors->GetColor4d("Peacock").GetData()); > lut->SetTableValue(4, colors->GetColor4d("Lavender").GetData()); > lut->SetTableValue(5, colors->GetColor4d("Flesh").GetData()); > lut->SetTableValue(6, colors->GetColor4d("Raspberry").GetData()); > lut->SetTableValue(7, colors->GetColor4d("Salmon").GetData()); > lut->SetTableValue(8, colors->GetColor4d("Mint").GetData()); > lut->SetTableValue(9, colors->GetColor4d("Wheat").GetData()); > > // Output the cluster centers > > vtkMultiBlockDataSet* outputMetaDS = > vtkMultiBlockDataSet::SafeDownCast(kMeansStatistics->GetOutputDataObject(vtkStatisticsAlgorithm::OUTPUT_MODEL)); > vtkTable* outputMeta = vtkTable::SafeDownCast(outputMetaDS->GetBlock(0)); > > vtkDoubleArray* coord0 = > vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("X")); > vtkDoubleArray* coord1 = > vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("Y")); > vtkDoubleArray* coord2 = > vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("Z")); > > for (unsigned int i = 0; i < coord0->GetNumberOfTuples(); ++i) > { > std::cout << coord0->GetValue(i) << " " << coord1->GetValue(i) << " " << > coord2->GetValue(i) << std::endl; > } > > vtkSmartPointer t2pd = > vtkSmartPointer::New(); > t2pd->SetInputConnection(kMeansStatistics->GetOutputPort()); > t2pd->SetXColumn("X"); > t2pd->SetYColumn("Y"); > t2pd->SetZColumn("Z"); > > vtkSmartPointer mapper = > vtkSmartPointer::New(); > mapper->SetInputConnection(t2pd->GetOutputPort()); > > vtkSmartPointer actor = > vtkSmartPointer::New(); > actor->SetMapper(mapper); > actor->GetProperty()->SetPointSize(3); > actor->GetProperty()->SetColor(1, 1, 1); > > vtkSmartPointer renderer = > vtkSmartPointer::New(); > vtkSmartPointer renderWindow = > vtkSmartPointer::New(); > renderWindow->AddRenderer(renderer); > renderWindow->SetSize(640, 480); > > vtkSmartPointer renderWindowInteractor = > vtkSmartPointer::New(); > renderWindowInteractor->SetRenderWindow(renderWindow); > > //renderer->AddActor(actor); > renderer->SetBackground(0, 0, 0); // Background color black > > renderWindow->Render(); > renderWindowInteractor->Start(); > > return EXIT_SUCCESS; > } > ......... > Please advice. Thank you again! > > Regards, > Polly > > ------------------------------ > *From:* Cory Quammen > *Sent:* Monday, November 19, 2018 10:52 PM > *To:* Polly Pui > *Cc:* vtkusers > *Subject:* Re: [vtkusers] Extract csv row and column into points > > > > On Thu, Nov 15, 2018 at 1:26 AM Polly Pui > wrote: > > Hi Cory, > Thanks for your reply. > I edited my codes by following your advice. However, I am not able to > visualize the point of cluster and got an error message. > > I have a few questions here. > Is it possible to call VTK unstructured grid data into vtkKmeansStatistics? > > > No, vtkKMeansStatistics requires a vtkTable input (it is a subclass of > vtkTableAlgorithm). vtkTable is different from a vtkPolyData, which is what > you are trying to create. See more inline comments further down. > > > Actually what i wanted to do is very simple. > I want to read my csv or vtk file and then cluster the points using > kmeansclustering. > Initially, I extracted points from csv file manually and I could get my > desired output. But it is too time consuming. > Currently, I want to input the csv or vtk file and get the cluster > automatically and store in a datasheet. > I attach my code as follows: > > #include > #include "library.h" > > #include > #include > #include > #include > #include > > > std::string inputFilename = argv[1]; > > vtkSmartPointer reader = > vtkSmartPointer::New(); > reader->SetFileName(inputFilename.c_str()); > reader->SetFieldDelimiterCharacters(","); > reader->DetectNumericColumnsOn(); > reader->Update(); > > ///////KmeansCluster > > vtkSmartPointer kMeansStatistics = > vtkSmartPointer::New(); > kMeansStatistics->SetInputConnection(reader->GetOutputPort()); > kMeansStatistics->SetColumnStatus("Column 3", 1); > kMeansStatistics->SetColumnStatus("Column 4", 1); > kMeansStatistics->SetColumnStatus("Column 5", 1); > kMeansStatistics->RequestSelectedColumns(); > kMeansStatistics->SetAssessOption(true); > kMeansStatistics->SetDefaultNumberOfClusters(2); > //kMeansStatistics->SetMaxNumIterations(15); > kMeansStatistics->Update(); > > // Display the results in CMD (each row) > kMeansStatistics->GetOutput()->Dump(); > > > > > //Group the points according to ID number > vtkSmartPointer clusterArray = > vtkSmartPointer::New(); > clusterArray->SetNumberOfComponents(1); > clusterArray->SetName("ClusterId"); > > for (int r = 0; r < kMeansStatistics->GetOutput()->GetNumberOfRows(); r++) > { > vtkVariant v = kMeansStatistics->GetOutput()->GetValue(r, > kMeansStatistics->GetOutput()->GetNumberOfColumns() - 1); > std::cout << "Point " << r << " is in cluster " << v.ToInt() << std::endl; > clusterArray->InsertNextValue(v.ToInt()); > } > > // Create a lookup table to map cell data to colors > vtkSmartPointer lut = > vtkSmartPointer::New(); > int tableSize = (kMeansStatistics + 1, 10); > lut->SetNumberOfTableValues(tableSize); > lut->Build(); > > //ColorCells > vtkSmartPointer colors = > vtkSmartPointer::New(); > lut->SetTableValue(0, colors->GetColor4d("Black").GetData()); > lut->SetTableValue(1, colors->GetColor4d("Banana").GetData()); > lut->SetTableValue(2, colors->GetColor4d("Tomato").GetData()); > lut->SetTableValue(3, colors->GetColor4d("Peacock").GetData()); > lut->SetTableValue(4, colors->GetColor4d("Lavender").GetData()); > lut->SetTableValue(5, colors->GetColor4d("Flesh").GetData()); > lut->SetTableValue(6, colors->GetColor4d("Raspberry").GetData()); > lut->SetTableValue(7, colors->GetColor4d("Salmon").GetData()); > lut->SetTableValue(8, colors->GetColor4d("Mint").GetData()); > lut->SetTableValue(9, colors->GetColor4d("Wheat").GetData()); > > // Output the cluster centers > > vtkMultiBlockDataSet* outputMetaDS = > vtkMultiBlockDataSet::SafeDownCast(kMeansStatistics->GetOutputDataObject(vtkStatisticsAlgorithm::OUTPUT_MODEL)); > vtkSmartPointer outputMeta = > vtkTable::SafeDownCast(outputMetaDS->GetBlock(0)); > //vtkSmartPointer outputMeta = vtkTable::SafeDownCast( > outputMetaDS->GetBlock( 1 ) ); > vtkDoubleArray* coord0 = > vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("Column 0")); > vtkDoubleArray* coord1 = > vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("Column 1")); > vtkDoubleArray* coord2 = > vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("Column 2")); > > for (unsigned int i = 0; i < coord0->GetNumberOfTuples(); ++i) > { > std::cout << coord0->GetValue(i) << " " << coord1->GetValue(i) << " " << > coord2->GetValue(i) << std::endl; > > } > > vtkSmartPointer polydata = > vtkSmartPointer::New(); > polydata->GetPointData()->SetScalars(clusterArray); > > > The below won't work. vtkKMeansStatistics produces a vtkTable, while the > vtkPolyDataMapper requires a vtkPolyData. To convert a vtkTable to a > vtkPolyData, which is the key piece you are missing, use > vtkTableToPolyData. This class iterates over the rows, treats the columns > you designate as X, Y, Z coordinates, and adds the remaining columns as > point data arrays in the output vtkPolyData. > > It will look something like this: > > vtkSmartPointer t2pd = > vtkSmartPointer::New(); > t2pd->SetInputConnection(kMeansStatistics->GetOutputPort()); > t2pd->SetXColumn("name of column to be used as x-coordinate"); > t2pd->SetYColumn("name of column to be used as y-coordinate"); > t2pd->SetZColumn("name of column to be used as z-coordinate"); > > Now, change, the code below from: > > > vtkSmartPointer mapper = > vtkSmartPointer::New(); > mapper->SetInputConnection(kMeansStatistics->GetOutputPort()); > > > to > > vtkSmartPointer mapper = > vtkSmartPointer::New(); > mapper->SetInputConnection(t2pd->GetOutputPort()); > > That should do it. > > Cory > > > vtkSmartPointer actor = > vtkSmartPointer::New(); > actor->SetMapper(mapper); > actor->GetProperty()->SetPointSize(3); > actor->GetProperty()->SetColor(1, 0, 0); > > vtkSmartPointer renderer = > vtkSmartPointer::New(); > vtkSmartPointer renderWindow = > vtkSmartPointer::New(); > renderWindow->AddRenderer(renderer); > renderWindow->SetSize(640, 480); > > vtkSmartPointer renderWindowInteractor = > vtkSmartPointer::New(); > renderWindowInteractor->SetRenderWindow(renderWindow); > > renderer->AddActor(actor); > renderer->SetBackground(0, 0, 0); // Background color black > > renderWindow->Render(); > renderWindowInteractor->Start(); > > return EXIT_SUCCESS; > } > > > Thank you so much. > > Regards, > Polly > ------------------------------ > *From:* Cory Quammen > *Sent:* Tuesday, November 13, 2018 11:34 PM > *To:* Polly Pui > *Cc:* vtkusers > *Subject:* Re: [vtkusers] Extract csv row and column into points > > Ah, so you want to use the vtkKMeansStatistics filter. That filter > operates on vtkTable data. To use it, you don't need to create points at > all. Instead, you can connect the vtkDelimitedTextReader directly to the vtkKMeansStatistics > filter like so: > > vtkSmartPointer kMeansStatistics = > vtkSmartPointer::New(); > kMeansStatistics->SetInputConnection(reader->GetOutputPort()); > kMeansStatistics->SetColumnStatus("column1", 1); > kMeansStatistics->SetColumnStatus("column2", 1); > kMeansStatistics->SetColumnStatus("column3, 1); > kMeansStatistics->RequestSelectedColumns(); > kMeansStatistics->SetAssessOption(true); > kMeansStatistics->SetDefaultNumberOfClusters(1); > //kMeansStatistics->SetMaxNumIterations(15); > kMeansStatistics->Update(); > > Here, I've altered your calls to SetColumnStatus() under the assumption > you know the column names of interest. > > HTH, > Cory > > > On Fri, Nov 9, 2018 at 10:16 AM Polly Pui > wrote: > > Hi, > Thanks for your reply. > Is it possible to have more elaborations from you? > > How can I get the number of points from vtkTableToPolyData? > I got an error saying that vtkTableToPolyData has no members of > GetNumberOfPoints. > I need those points to proceed to KmeansStatistics. > > This is my code: > ...... > std::string inputFilename = argv[1]; > > vtkSmartPointer reader = > vtkSmartPointer::New(); > reader->SetFileName(inputFilename.c_str()); > reader->SetFieldDelimiterCharacters(" "); > reader->DetectNumericColumnsOn(); > reader->Update(); > int numberOfRows = reader->GetOutput()->GetNumberOfRows(); > > vtkSmartPointer inputData = > vtkSmartPointer::New(); > inputData->SetInputConnection(reader->GetOutputPort); > > for (int c = 0; c < 3; ++c) > { > std::stringstream colName; > colName << "coord " << c; > vtkSmartPointer doubleArray = > vtkSmartPointer::New(); > doubleArray->SetNumberOfComponents(1); > doubleArray->SetName(colName.str().c_str()); > doubleArray->SetNumberOfTuples(inputData->GetNumberOfPoints()); > > > for (int r = 0; r < inputData->GetNumberOfPoints(); ++r) > { > double p[3]; > inputData->GetPoint(r, p); > doubleArray->SetValue(r, p[c]); > } > inputData->AddColumn(doubleArray); > } > > vtkSmartPointer kMeansStatistics = > vtkSmartPointer::New(); > > #if VTK_MAJOR_VERSION <= 5 > kMeansStatistics->SetInput(vtkStatisticsAlgorithm::INPUT_DATA, inputData); > #else > kMeansStatistics->SetInputData(vtkStatisticsAlgorithm::INPUT_DATA, > inputData); > #endif > kMeansStatistics->SetColumnStatus(inputData->GetColumnName(0), 1); > kMeansStatistics->SetColumnStatus(inputData->GetColumnName(1), 1); > kMeansStatistics->SetColumnStatus(inputData->GetColumnName(2), 1); > kMeansStatistics->RequestSelectedColumns(); > kMeansStatistics->SetAssessOption(true); > kMeansStatistics->SetDefaultNumberOfClusters(1); > //kMeansStatistics->SetMaxNumIterations(15); > kMeansStatistics->Update(); > > Thanks again. > > Regards, > Polly > ------------------------------ > *From:* Cory Quammen > *Sent:* Friday, November 9, 2018 10:07 PM > *To:* Polly Pui > *Cc:* vtkusers > *Subject:* Re: [vtkusers] Extract csv row and column into points > > vtkDelimitedTextReader -> vtkTableToPolyData is a pipeline that should > make this much simpler. > > On Fri, Nov 9, 2018 at 1:14 AM Polly Pui > wrote: > > Hi, > Is there any clue that i can extract the row and column data from a csv > file and read them as points? > Currently I am using vtkpoints to read points by inserting points > manually to my .cpp . > Is it possible for me to call the csv directly and read the data (eg. > column 3-5, row 2-10)? > > I attach my code here. > ...... > int main(int, char*[]) > { > > vtkSmartPointer points = > vtkSmartPointer::New(); > points->InsertNextPoint(8.4312, -36.489, -1500.7); > points->InsertNextPoint(8.8408, -37.726, -1500.4); > points->InsertNextPoint(11.372, -37.787, -1501.5); > points->InsertNextPoint(11.263, -36.384, -1501.9); > points->InsertNextPoint(9.3914, -40.819, -1500.8); > points->InsertNextPoint(11.685, -42.482, -1502.7); > points->InsertNextPoint(14.235, -38.096, -1503.5); > points->InsertNextPoint(13.972, -43.051, -1504.2); > points->InsertNextPoint(9.22, -43.904, -1504); > > vtkSmartPointer inputData = > vtkSmartPointer::New(); > for (int c = 0; c < 3; ++c) > { > std::stringstream colName; > colName << "coord " << c; > vtkSmartPointer doubleArray = > vtkSmartPointer::New(); > doubleArray->SetNumberOfComponents(1); > doubleArray->SetName(colName.str().c_str()); > doubleArray->SetNumberOfTuples(points->GetNumberOfPoints()); > > for (int r = 0; r < points->GetNumberOfPoints(); ++r) > { > double p[3]; > points->GetPoint(r, p); > doubleArray->SetValue(r, p[c]); > } > inputData->AddColumn(doubleArray); > } > > Thank you very much. > > Regards, > Polly > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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. > > > > -- > Cory Quammen > Staff R&D Engineer > Kitware, Inc. > > > > -- > Cory Quammen > Staff R&D Engineer > Kitware, Inc. > -- Cory Quammen Staff R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From florian.benedetti at cea.fr Tue Nov 27 12:00:28 2018 From: florian.benedetti at cea.fr (Florian Benedetti) Date: Tue, 27 Nov 2018 18:00:28 +0100 Subject: [vtkusers] vtkUnstructuredGrid output from a vtkLinearToQuadraticCellsFilter Message-ID: Hi folks, I'm new to VTK (I'm using VTK8 C++ API). I have a vtkUnstructuredGrid dataset, consisting of linear triangle/tetrahedral cells, and I'm trying to convert it into a dataset of quadratic cells with a vtkLinearToQuadraticCellsFilter object. It works fine on visualization. Now, I would like to get an vtkUnstructuredGrid dataset from filter but I didn't manage to do that since I didn't clearly understand the documentation. How I can get an output dataset from a filter ? // Code example ... vtkSmartPointer dataSet = vtkDataSet::SafeDownCast(input_file->GetOutput()); vtkSmartPointer quadCells = vtkSmartPointer::New(); quadCells->SetInputData(dataSet); // How to recover an output dataset from filter ... Thanks in advance for your help. Regards, From lasso at queensu.ca Wed Nov 28 02:31:33 2018 From: lasso at queensu.ca (Andras Lasso) Date: Wed, 28 Nov 2018 07:31:33 +0000 Subject: [vtkusers] vtkAVIWriter with renderer gradient background shows distinct lines In-Reply-To: References: Message-ID: In 3D Slicer we use VP9 codec with MKV container and it works well. VP9 is not as widely used as H264 but it is completely royalty-free and offers good compression ratio and acceptable speed even with lossless settings. We build required libraries (VP9, libwbm, yasm) using CMake superbuild on Windows/Linux/Mac. Container file reading/writing implementation is here: https://github.com/IGSIO/IGSIO/blob/master/Source/VideoIO/MKV/vtkMKVWriter.cxx, and VP9 codec is here: https://github.com/IGSIO/SlicerIGSIO/blob/master/VideoIO/Codecs/vtkVP9VolumeCodec.cxx. Andras From: vtkusers On Behalf Of Cory Quammen Sent: Tuesday, November 27, 2018 10:11 AM To: santosh Cc: vtkusers Subject: Re: [vtkusers] vtkAVIWriter with renderer gradient background shows distinct lines I'm afraid I don't have a lot of experience with the AVI compression options. You might experiment with vtkAVIWriter::SetCompressorFourCC() to see if you can find a compressor that gives more satisfactory results. Personally I prefer to dump animation frames and assemble them with outside video software. Cory On Tue, Nov 27, 2018 at 9:26 AM Santosh Biradar > wrote: Thanks for the quick response Cory. I tried setting quality to 0,1,2. The quality of the movie was best for 2 and worst for 0 but the background remained the same in each case. The quality of the output of the filter (in this case, a vtkContourFilter) reduces with reduction in SetQuality but the background remains of the same quality. There is no difference in the quality of the background. I also get the same behavior in Paraview's Save Animation feature (version 5.5 on windows) Thanks, Santosh On Tue, Nov 27, 2018 at 7:29 PM Cory Quammen > wrote: Sounds like quantization/compression artifacts. You can try changing the quality setting to reduce compression via vtkAVIWriter::SetQuality(). HTH, Cory On Tue, Nov 27, 2018 at 8:55 AM Santosh Biradar > wrote: I am trying to create a movie of an animation using vtkAVIWriter. The renderer has a gradient background. The .avi file created has distinct lines/bands in the background because of the gradient. Is it possible to get rid of these lines. I notice that if I use a vtkBMPWriter and write an image, the image seems fine without any such lines/bands. A code snippet of what I am doing: window_to_image = vtk.vtkWindowToImageFilter() window_to_image.SetInput(renWin.GetRenderWindow()) window_to_image.SetInputBufferTypeToRGB() window_to_image.ReadFrontBufferOff() writer = vtk.vtkAVIWriter() writer.SetInputConnection(window_to_image.GetOutputPort()) I am running python wrapper of VTK-6.3.0 on windows Thanks, Santosh _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: 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. -- Cory Quammen Staff R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Zoltan.Kovacs at esi-group.com Wed Nov 28 06:28:38 2018 From: Zoltan.Kovacs at esi-group.com (Zoltan Kovacs) Date: Wed, 28 Nov 2018 11:28:38 +0000 Subject: [vtkusers] vtkParallelCoordinatesView with Qt Message-ID: Dear all, Based on the example https://www.vtk.org/Wiki/VTK/Examples/Cxx/InfoVis/ParallelCoordinatesView I created a simple Qt project using the class vtkParallelCoordinatesView. It has only a main window with a PushButton and a QWidget to launch a file opening dialog for any CSV file and view its content. I also created a Qt Form Class called "ParallelCoordinatesView" with the public function "View", which contains the CSV file reading and the parallel coordinates visualization code from the example. I attached the files. There are two issues with the functions setting up the render window and the interactor in the public function "View". These function calls are commented out in the code: // Set up render window view->GetRenderer()->SetBackground(1.0, 1.0, 1.0); view->GetRenderer()->GradientBackgroundOff(); view->GetRenderWindow()->SetSize(1200,600); //view->SetInteractor(renderWindowInteractor); //view->SetRenderWindow(renderWindow); view->ResetCamera(); view->Render(); //view->GetInteractor()->Start(); When I compile and run the code in this form, the parallel coordinates view appears in a window detached from the Qt MainWindow after the file test.csv has been read from the file opening dialog. If I remove the comments only from //view->SetInteractor(renderWindowInteractor); //view->SetRenderWindow(renderWindow); and compile and run the code then the view window appears in the QWidget in the MainWindow, as expected, but as soon as I start to move the cursor, everything blacks out in the Mainwindow. If remove the comment only from the line //view->GetInteractor()->Start(); the I can select lines in the parallel coodinates view vindow, as expected with starting the interactor, but the Mainwindow hangs. I would like to ask if there is a proper setup of the render window and the interactor for the class vtkParallelCoordinatesView with Qt? Thank you very much for your help. Kind regards, Zoltan -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: main.cpp Type: text/x-c++src Size: 172 bytes Desc: main.cpp URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mainwindow.cpp Type: text/x-c++src Size: 517 bytes Desc: mainwindow.cpp URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mainwindow.h Type: text/x-chdr Size: 479 bytes Desc: mainwindow.h URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mainwindow.ui Type: application/x-designer Size: 1474 bytes Desc: mainwindow.ui URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: parallelcoordinatesview.cpp Type: text/x-c++src Size: 3092 bytes Desc: parallelcoordinatesview.cpp URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: parallelcoordinatesview.h Type: text/x-chdr Size: 1817 bytes Desc: parallelcoordinatesview.h URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: parallelcoordinatesview.ui Type: application/x-designer Size: 416 bytes Desc: parallelcoordinatesview.ui URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ParCoordView.pro Type: application/octet-stream Size: 4329 bytes Desc: ParCoordView.pro URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: test.csv Type: application/octet-stream Size: 1335 bytes Desc: test.csv URL: From ftpronk at engits.com Wed Nov 28 07:00:17 2018 From: ftpronk at engits.com (Fcs) Date: Wed, 28 Nov 2018 05:00:17 -0700 (MST) Subject: [vtkusers] vtkUnstructuredGrid output from a vtkLinearToQuadraticCellsFilter In-Reply-To: References: Message-ID: <1543406417903-0.post@n5.nabble.com> quadCells->GetOuput() ? See: https://www.vtk.org/doc/nightly/html/classvtkLinearToQuadraticCellsFilter-members.html -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From srbn.ghosh99 at gmail.com Wed Nov 28 16:12:06 2018 From: srbn.ghosh99 at gmail.com (Shrabani Ghosh) Date: Wed, 28 Nov 2018 14:12:06 -0700 (MST) Subject: [vtkusers] Get edges for simplex mesh Message-ID: <1543439526391-0.post@n5.nabble.com> Hi, I am trying to iterate through a multimaterial simplex mesh's cells and I want to get the information of the current cell id and all the edges of that cell. I need to label all the cell edges. I have found something similar in this link but it does not give the cell id information. https://lorensen.github.io/VTKExamples/site/Cxx/Meshes/ExtractEdges/ -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From trlsmax at gmail.com Wed Nov 28 22:33:15 2018 From: trlsmax at gmail.com (Max Chen) Date: Wed, 28 Nov 2018 20:33:15 -0700 (MST) Subject: [vtkusers] VTK with imgui In-Reply-To: References: Message-ID: <1543462395849-0.post@n5.nabble.com> I'm trying to integrate vtk into my imgui + glfw project with externalVTKWidget. But after externalVTKWidget->GetRenderWindow()->Render() , imgui can't display it's windows. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From masterwangzx at gmail.com Wed Nov 28 22:43:04 2018 From: masterwangzx at gmail.com (Franks) Date: Wed, 28 Nov 2018 20:43:04 -0700 (MST) Subject: [vtkusers] how to deal with the stl file In-Reply-To: <1542824508860-0.post@n5.nabble.com> References: <1542813826992-0.post@n5.nabble.com> <1542824508860-0.post@n5.nabble.com> Message-ID: <1543462984286-0.post@n5.nabble.com> Thanks for the quick response mmusy. I want to generate the curved face by vtk to join three cylinders surface but not transform the polydata. /vtkBooleanOperationPolyDataFilter().SetOperationToUnion()/ does not meet my need. I want vtk to do *three-tube mixing* like Rhino to generate the curved face by curvature and boundary. Any ideas or demos? Frank -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.slaughter at inl.gov Thu Nov 29 11:13:28 2018 From: andrew.slaughter at inl.gov (Andrew E. Slaughter) Date: Thu, 29 Nov 2018 16:13:28 +0000 Subject: [vtkusers] Help with vtkInterpolateDataSetAttributes Message-ID: I am attempting to interpolate between two ExodusII (vtkExodusIIReader) results using the vtkInterpolateDataSetAttributes, but am having trouble getting it to work. I was able to perform an interpolation that mimics the behavior with calls to vtkAbstractArray::InterpolateTuple, but this doesn?t seem like the correct solution. I have attached a script that show what I am trying to do, including what is working and what is not. I know that for this problem I could use vtkTemporalInterpolator, but for the actual problem I am trying to solve it isn?t appropriate. I am using python bindings with VTK7.1 on MacOS. I would appreciate any help I can get making this work. Thanks, Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: input_no_adapt_out.e Type: application/octet-stream Size: 36560 bytes Desc: input_no_adapt_out.e URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: interpolate_data_set.py Type: text/x-python-script Size: 2003 bytes Desc: interpolate_data_set.py URL: From sebastien.jourdain at kitware.com Thu Nov 29 11:56:59 2018 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Thu, 29 Nov 2018 11:56:59 -0500 Subject: [vtkusers] Change of your fee Message-ID: <39606835012351616578.D73631A32F28AC7A@vtk.org> Morning, Your fee document appears below. Thank you and have a wonderful day! - Sebastien Jourdain 983-114-2635, direct (pls. try here first, during business hours) 983-114-7297, office 983-114-8871, fax 983-114-5282, mobile 0539/5236478, WhatsApp E-Mail:sebastien.jourdain at kitware.com This email message is for the sole use of the intended recipients and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail and destroy all copies of the original message. -------------- next part -------------- A non-text attachment was scrubbed... Name: project-docs-11292018.doc Type: application/msword Size: 95104 bytes Desc: not available URL: From g.bogle at auckland.ac.nz Thu Nov 29 16:16:26 2018 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Thu, 29 Nov 2018 21:16:26 +0000 Subject: [vtkusers] Set orientation of a clipped cone Message-ID: <1543526181164.39239@auckland.ac.nz> I want to be able to render many clipped cones. I've been playing with the capclip.cxx example, changing from sphereSource to coneSource. The clipActor created can be given position, and scaled, but I can't see how to set its orientation. It does have a member function setOrientation(double a[3]), but when I invoke this with a = (0,1,0) nothing happens (the default orientation of the cone is (1,0,0)). Is it possible to set the orientation of an actor that uses a mapper created from a clipped polydata? Thanks Gib -------------- next part -------------- An HTML attachment was scrubbed... URL: From rccm.kyoshimi at gmail.com Thu Nov 29 19:14:50 2018 From: rccm.kyoshimi at gmail.com (kenichiro yoshimi) Date: Fri, 30 Nov 2018 09:14:50 +0900 Subject: [vtkusers] Set orientation of a clipped cone In-Reply-To: <1543526181164.39239@auckland.ac.nz> References: <1543526181164.39239@auckland.ac.nz> Message-ID: Hi, The SetOrientation function is used to rotate the actor in degrees. So you need to specify the rotation degrees instead of an orientation vector. Regards 2018?11?30?(?) 6:27 Gib Bogle : > > I want to be able to render many clipped cones. I've been playing with the capclip.cxx example, changing from sphereSource to coneSource. The clipActor created can be given position, and scaled, but I can't see how to set its orientation. It does have a member function setOrientation(double a[3]), but when I invoke this with a = (0,1,0) nothing happens (the default orientation of the cone is (1,0,0)). > > Is it possible to set the orientation of an actor that uses a mapper created from a clipped polydata? > > > Thanks > > Gib > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > 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 g.bogle at auckland.ac.nz Thu Nov 29 19:33:53 2018 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Fri, 30 Nov 2018 00:33:53 +0000 Subject: [vtkusers] Set orientation of a clipped cone In-Reply-To: References: <1543526181164.39239@auckland.ac.nz>, Message-ID: <1543538026892.6470@auckland.ac.nz> Thanks Kenichiro. I finally did RTFM for vtkActor and found how orientation is handled. I was just about to reply saying that when your message arrived. Cheers, Gib ________________________________________ From: kenichiro yoshimi Sent: Friday, 30 November 2018 1:14 p.m. To: Gib Bogle Cc: vtkusers Subject: Re: [vtkusers] Set orientation of a clipped cone Hi, The SetOrientation function is used to rotate the actor in degrees. So you need to specify the rotation degrees instead of an orientation vector. Regards 2018?11?30?(?) 6:27 Gib Bogle : > > I want to be able to render many clipped cones. I've been playing with the capclip.cxx example, changing from sphereSource to coneSource. The clipActor created can be given position, and scaled, but I can't see how to set its orientation. It does have a member function setOrientation(double a[3]), but when I invoke this with a = (0,1,0) nothing happens (the default orientation of the cone is (1,0,0)). > > Is it possible to set the orientation of an actor that uses a mapper created from a clipped polydata? > > > Thanks > > Gib > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > 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 newcfd at yahoo.com Fri Nov 30 00:12:05 2018 From: newcfd at yahoo.com (newcfd) Date: Thu, 29 Nov 2018 22:12:05 -0700 (MST) Subject: [vtkusers] isosurface update issue Message-ID: <1543554725951-0.post@n5.nabble.com> I have the following code to draw isosurface. No problem when this func is called by the first time. However, two isosurfaces show up when this func is called with a different value by the second time. The first isosurface is not replaced by the second one although I am using the same actor. What is wrong? void MyApp::redraw( const double value ) { vtkStructuredGrid * mesh =... vtkSmartPointer filter = vtkSmartPointer::New(); filter->SetInputData( mesh ); filter->SetNumberOfContours( 1 ); filter->Setvalue( 0, value ); // value is passed in vtkSmartPointer mapper = vtkSmartPointer::New(); mapSphere->SetInputConnection( filter->GetOutputPort() ); mapSphere->SetScalarRange(0.0, 1.0); if ( m_pActor == nullptr ) { m_pActor = vtkActor::New(); m_pActor->SetMapper( mapper ); } renderer->AddActor( m_pActor ); renderer->SetBackground(1,1,1); // Background color white renderWindow->Render(); } -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From scbiradar at gmail.com Fri Nov 30 08:30:20 2018 From: scbiradar at gmail.com (Santosh Biradar) Date: Fri, 30 Nov 2018 19:00:20 +0530 Subject: [vtkusers] vtkAVIWriter with renderer gradient background shows distinct lines In-Reply-To: References: Message-ID: Thanks Cory. I was able to try different compression options and was able to remove the background lines appearing because of the gradient albeit with large size of the AVI files. Thanks Andras for pointing me to an alternate to vtkAVIWriter. I will explore the MKV container. Santosh On Wed, Nov 28, 2018 at 1:01 PM Andras Lasso wrote: > In 3D Slicer we use VP9 codec with MKV container and it works well. VP9 is > not as widely used as H264 but it is completely royalty-free and offers > good compression ratio and acceptable speed even with lossless settings. > > > > We build required libraries (VP9, libwbm, yasm) using CMake superbuild on > Windows/Linux/Mac. Container file reading/writing implementation is here: > https://github.com/IGSIO/IGSIO/blob/master/Source/VideoIO/MKV/vtkMKVWriter.cxx, > and VP9 codec is here: > https://github.com/IGSIO/SlicerIGSIO/blob/master/VideoIO/Codecs/vtkVP9VolumeCodec.cxx. > > > > > Andras > > > > *From:* vtkusers * On Behalf Of *Cory > Quammen > *Sent:* Tuesday, November 27, 2018 10:11 AM > *To:* santosh > *Cc:* vtkusers > *Subject:* Re: [vtkusers] vtkAVIWriter with renderer gradient background > shows distinct lines > > > > I'm afraid I don't have a lot of experience with the AVI compression > options. You might experiment with vtkAVIWriter::SetCompressorFourCC() to > see if you can find a compressor that gives more satisfactory results. > > > > Personally I prefer to dump animation frames and assemble them with > outside video software. > > > > Cory > > > > On Tue, Nov 27, 2018 at 9:26 AM Santosh Biradar > wrote: > > Thanks for the quick response Cory. > > I tried setting quality to 0,1,2. The quality of the movie was best for 2 > and worst for 0 but the background remained the same in each case. > > The quality of the output of the filter (in this case, a > vtkContourFilter) reduces with reduction in SetQuality but the background > remains of the same quality. > > There is no difference in the quality of the background. > > > > I also get the same behavior in Paraview's Save Animation feature (version > 5.5 on windows) > > > > Thanks, > > Santosh > > > > > > On Tue, Nov 27, 2018 at 7:29 PM Cory Quammen > wrote: > > Sounds like quantization/compression artifacts. You can try changing the > quality setting to reduce compression via vtkAVIWriter::SetQuality(). > > > > HTH, > > Cory > > > > On Tue, Nov 27, 2018 at 8:55 AM Santosh Biradar > wrote: > > I am trying to create a movie of an animation using vtkAVIWriter. > > The renderer has a gradient background. The .avi file created has distinct > lines/bands in the background because of the gradient. Is it possible to > get rid of these lines. I notice that if I use a vtkBMPWriter and write an > image, the image seems fine without any such lines/bands. > > > > A code snippet of what I am doing: > > > > window_to_image = vtk.vtkWindowToImageFilter() > window_to_image.SetInput(renWin.GetRenderWindow()) > window_to_image.SetInputBufferTypeToRGB() > window_to_image.ReadFrontBufferOff() > > writer = vtk.vtkAVIWriter() > writer.SetInputConnection(window_to_image.GetOutputPort()) > > I am running python wrapper of VTK-6.3.0 on windows > > > > Thanks, > > Santosh > > > > _______________________________________________ > Powered by www.kitware.com > > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > > Please keep messages on-topic and check the VTK FAQ at: > 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. > > > > > -- > > Cory Quammen > Staff R&D Engineer > Kitware, Inc. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Fri Nov 30 09:22:47 2018 From: cory.quammen at kitware.com (Cory Quammen) Date: Fri, 30 Nov 2018 09:22:47 -0500 Subject: [vtkusers] vtkAVIWriter with renderer gradient background shows distinct lines In-Reply-To: References: Message-ID: Great, glad to hear it. What compression options did you settle on in case someone runs into this issue in the future? On Fri, Nov 30, 2018 at 8:30 AM Santosh Biradar wrote: > > Thanks Cory. I was able to try different compression options and was able to remove the background lines appearing because of the gradient albeit with large size of the AVI files. > Thanks Andras for pointing me to an alternate to vtkAVIWriter. I will explore the MKV container. > > Santosh > > On Wed, Nov 28, 2018 at 1:01 PM Andras Lasso wrote: >> >> In 3D Slicer we use VP9 codec with MKV container and it works well. VP9 is not as widely used as H264 but it is completely royalty-free and offers good compression ratio and acceptable speed even with lossless settings. >> >> >> >> We build required libraries (VP9, libwbm, yasm) using CMake superbuild on Windows/Linux/Mac. Container file reading/writing implementation is here: https://github.com/IGSIO/IGSIO/blob/master/Source/VideoIO/MKV/vtkMKVWriter.cxx, and VP9 codec is here: https://github.com/IGSIO/SlicerIGSIO/blob/master/VideoIO/Codecs/vtkVP9VolumeCodec.cxx. >> >> >> >> Andras >> >> >> >> From: vtkusers On Behalf Of Cory Quammen >> Sent: Tuesday, November 27, 2018 10:11 AM >> To: santosh >> Cc: vtkusers >> Subject: Re: [vtkusers] vtkAVIWriter with renderer gradient background shows distinct lines >> >> >> >> I'm afraid I don't have a lot of experience with the AVI compression options. You might experiment with vtkAVIWriter::SetCompressorFourCC() to see if you can find a compressor that gives more satisfactory results. >> >> >> >> Personally I prefer to dump animation frames and assemble them with outside video software. >> >> >> >> Cory >> >> >> >> On Tue, Nov 27, 2018 at 9:26 AM Santosh Biradar wrote: >> >> Thanks for the quick response Cory. >> >> I tried setting quality to 0,1,2. The quality of the movie was best for 2 and worst for 0 but the background remained the same in each case. >> >> The quality of the output of the filter (in this case, a vtkContourFilter) reduces with reduction in SetQuality but the background remains of the same quality. >> >> There is no difference in the quality of the background. >> >> >> >> I also get the same behavior in Paraview's Save Animation feature (version 5.5 on windows) >> >> >> >> Thanks, >> >> Santosh >> >> >> >> >> >> On Tue, Nov 27, 2018 at 7:29 PM Cory Quammen wrote: >> >> Sounds like quantization/compression artifacts. You can try changing the quality setting to reduce compression via vtkAVIWriter::SetQuality(). >> >> >> >> HTH, >> >> Cory >> >> >> >> On Tue, Nov 27, 2018 at 8:55 AM Santosh Biradar wrote: >> >> I am trying to create a movie of an animation using vtkAVIWriter. >> >> The renderer has a gradient background. The .avi file created has distinct lines/bands in the background because of the gradient. Is it possible to get rid of these lines. I notice that if I use a vtkBMPWriter and write an image, the image seems fine without any such lines/bands. >> >> >> >> A code snippet of what I am doing: >> >> >> >> window_to_image = vtk.vtkWindowToImageFilter() >> window_to_image.SetInput(renWin.GetRenderWindow()) >> window_to_image.SetInputBufferTypeToRGB() >> window_to_image.ReadFrontBufferOff() >> >> writer = vtk.vtkAVIWriter() >> writer.SetInputConnection(window_to_image.GetOutputPort()) >> >> I am running python wrapper of VTK-6.3.0 on windows >> >> >> >> Thanks, >> >> Santosh >> >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: 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. >> >> >> >> >> -- >> >> Cory Quammen >> Staff R&D Engineer >> Kitware, Inc. -- Cory Quammen Staff R&D Engineer Kitware, Inc. From dave.demarle at kitware.com Fri Nov 30 09:40:31 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Fri, 30 Nov 2018 09:40:31 -0500 Subject: [vtkusers] isosurface update issue In-Reply-To: <1543554725951-0.post@n5.nabble.com> References: <1543554725951-0.post@n5.nabble.com> Message-ID: Can't tell from this code fragment what is going on but these look fishy to me: > vtkSmartPointer mapper = > vtkSmartPointer::New(); > mapSphere->SetInputConnection( filter->GetOutputPort() ); You make "mapper" and then work with "mapSphere". Where did mapSphere come from? You call renderer->AddActor(m_pActor) everytime in this function. If "renderer" is persistent or in otherwords not created from scratch in between calls to redraw, you should only have to do that once. On Fri, Nov 30, 2018 at 12:12 AM newcfd via vtkusers < vtkusers at public.kitware.com> wrote: > I have the following code to draw isosurface. No problem when this func is > called by the first time. > However, two isosurfaces show up when this func is called with a different > value by the second time. > The first isosurface is not replaced by the second one although I am using > the same actor. What is > wrong? > > void MyApp::redraw( const double value ) > { > vtkStructuredGrid * mesh =... > > vtkSmartPointer filter = > vtkSmartPointer::New(); > filter->SetInputData( mesh ); > filter->SetNumberOfContours( 1 ); > filter->Setvalue( 0, value ); // value is passed in > > vtkSmartPointer mapper = > vtkSmartPointer::New(); > mapSphere->SetInputConnection( filter->GetOutputPort() ); > mapSphere->SetScalarRange(0.0, 1.0); > > if ( m_pActor == nullptr ) > { > m_pActor = vtkActor::New(); > m_pActor->SetMapper( mapper ); > } > > renderer->AddActor( m_pActor ); > renderer->SetBackground(1,1,1); // Background color white > > renderWindow->Render(); > } > > > > -- > 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 dave.demarle at kitware.com Fri Nov 30 10:30:25 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Fri, 30 Nov 2018 10:30:25 -0500 Subject: [vtkusers] Crashing on GetGlobalIds In-Reply-To: <1543070864626-0.post@n5.nabble.com> References: <1543069040005-0.post@n5.nabble.com> <1543070864626-0.post@n5.nabble.com> Message-ID: vtkSmartPointer globalIds = vtkSmartPointer::New(); globalIds = vtkIdTypeArray::SafeDownCast(selected->GetPointData()->GetGlobalIds()); assert(globalIds); I think the assert tells you that the smartpointer itself exists, but it doesn't say anything about the vtkIdTypeArray pointed to by the smartpointer. I suspect if you assert(globalIds.GetPointer()) it will fail. If that is the case, since it is null, gloablids->* crashes on the next line. Why it is null will take some more tracking down. One thing to note about globalids is that VTK is conservative about preserving their meaning and throws them away when it can't do that. For example they won't be interpolated like most arrays are because averaging ids or (i.e. names) is undefined. Likewise filters that don't simply copy cells/points across won't attempt to preserve globalids. So what you should do is trace through the filters you are using to see where specifically the globalids are lost. hth David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Sat, Nov 24, 2018 at 9:47 AM meakcey wrote: > Cleaner comparison to problem > > *Code below is working* > > vtkPlanes* frustum = > > static_cast(this->GetInteractor()->GetPicker())->GetFrustum(); > vtkSmartPointer extractGeometry = > vtkSmartPointer::New(); > extractGeometry->SetImplicitFunction(frustum); > extractGeometry->SetInputData(this->Points); > extractGeometry->Update(); > extractGeometry->GetOutput()->GetPointData()->CopyGlobalIdsOn(); > > vtkSmartPointer glyphFilter = > vtkSmartPointer::New(); > glyphFilter->SetInputConnection(extractGeometry->GetOutputPort()); > glyphFilter->Update(); > glyphFilter->GetOutput()->GetPointData()->CopyGlobalIdsOn(); > vtkPolyData* selected = glyphFilter->GetOutput(); > > vtkSmartPointer globalIds = > vtkSmartPointer::New(); > globalIds = > vtkIdTypeArray::SafeDownCast(selected->GetPointData()->GetGlobalIds()); > assert(globalIds); > std::cout << "Nof globalIds " << globalIds->GetNumberOfComponents() << " " > << globalIds->GetNumberOfTuples() << std::endl; > > *Code below is crashing at the line of cout > * > vtkPlanes* frustum = > > static_cast(this->GetInteractor()->GetPicker())->GetFrustum(); > vtkSmartPointer extractGeometry = > vtkSmartPointer::New(); > extractGeometry->SetImplicitFunction(frustum); > extractGeometry->SetInputData(this->Points); > extractGeometry->Update(); > extractGeometry->GetOutput()->GetPointData()->CopyGlobalIdsOn(); > > vtkSmartPointer visiblePoints = > vtkSmartPointer::New(); > visiblePoints->SetInputConnection(extractGeometry->GetOutputPort()); > > visiblePoints->SetRenderer(this->GetInteractor()->GetRenderWindow()->GetRenderers()->GetFirstRenderer()); > visiblePoints->Update(); > visiblePoints->GetOutput()->GetPointData()->CopyGlobalIdsOn(); > > vtkSmartPointer visibleFilter = > vtkSmartPointer::New(); > visibleFilter->SetInputConnection(visiblePoints->GetOutputPort()); > visibleFilter->Update(); > visibleFilter->GetOutput()->GetPointData()->CopyGlobalIdsOn(); > vtkPolyData* visibles = visibleFilter->GetOutput(); > > vtkSmartPointer globalIds = > vtkSmartPointer::New(); > globalIds = > vtkIdTypeArray::SafeDownCast(visibles->GetPointData()->GetGlobalIds()); > assert(globalIds); > std::cout << "Nof globalIds " << globalIds->GetNumberOfComponents() << " " > << globalIds->GetNumberOfTuples() << std::endl; > > > > > > > -- > 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 g.bogle at auckland.ac.nz Fri Nov 30 13:12:14 2018 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Fri, 30 Nov 2018 18:12:14 +0000 Subject: [vtkusers] Freeing actor memory Message-ID: <1543601528571.35049@auckland.ac.nz> I am sequentially rendering a scene composed of an increasing number of actors, each of which is a clipped and capped cone (to be precise, each member of the scene is made up of two actors - the clipped cone and the cap). I am not sure about the right way to remove the actors and free the associated memory when the time comes. The list of things created with New() for each composite actor is quite long (the code is based on the CapClip example.): coneSource = vtkSmartPointer::New(); plane = vtkSmartPointer::New(); clipMapper = vtkSmartPointer::New(); clipActor = vtkSmartPointer::New(); boundaryEdges = vtkSmartPointer::New(); boundaryStrips = vtkSmartPointer::New(); boundaryPoly = vtkSmartPointer::New(); boundaryMapper = vtkSmartPointer::New(); boundaryActor = vtkSmartPointer::New(); My proposed approach is to use a struct to hold all the vtkSmartPointers, creating a new ACTOR_STRUCT (stored in an array or list) every time a composite actor is created: struct actor_struct { vtkSmartPointer coneSource; vtkSmartPointer plane; vtkSmartPointer clipper; vtkSmartPointer clipMapper; vtkSmartPointer clipActor; vtkSmartPointer boundaryEdges; vtkSmartPointer boundaryStrips; vtkSmartPointer boundaryPoly; vtkSmartPointer boundaryMapper; vtkSmartPointer boundaryActor; }; typedef actor_struct ACTOR_STRUCT; The motivation is to be able to locate all the allocated objects when memory needs to be freed, but I suspect it is neither the conventional nor the best way. I have two questions: What is the usual way to handle this situation? If my proposed method is OK, how should all the actor memory be freed? I'd be grateful if somebody with a better understanding of VTK and C++ could advise me. Thanks Gib -------------- next part -------------- An HTML attachment was scrubbed... URL: From jim at jslengineeringsoftware.com Fri Nov 30 15:19:41 2018 From: jim at jslengineeringsoftware.com (James Labiak) Date: Sat, 01 Dec 2018 03:19:41 +0700 Subject: [vtkusers] Invoice from December 01 Message-ID: <1987958372341717572.48180E862BB7F030@vtk.org> Sorry for the delay?. I adjusted the invoice. Your invoice E4863 for you is attached. Please remit payment at your earliest convenience. Thank you in advance James Labiak T 488.930.9206 | O 846.730.1109 e:jim at jslengineeringsoftware.com - Your Data Protection & Privacy James Labiak takes your privacy very seriously. Our policy is only to process personal data in accordance with data protection laws and rights of individuals. -------------- next part -------------- A non-text attachment was scrubbed... Name: INVOICE_NO_E4863.doc Type: application/msword Size: 136192 bytes Desc: not available URL: