From elvis.stansvik at orexplore.com Thu Dec 1 02:35:18 2016 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Thu, 1 Dec 2016 08:35:18 +0100 Subject: [vtkusers] Cannot use vtkParallelCoordinatesActor in VTK 7.0.0 and how to report a bug? In-Reply-To: References: Message-ID: Den 30 nov. 2016 2:38 em skrev "Cory Quammen" : > > [snip] > > > Ah yes, I know the information is there, if you care to do some pusseling :) > > > > I just meant it would be nice if it was visible in a more prominent way, > > kind of like how the Qt docs has a list of modules [1], a page for each > > module (e.g QtNetwork [2]), a list of classes in each module [3], and where > > the module a class resides in is visible at the top of the class docs (e.g. > > QNetworkReply [4], see the breadcrumb at the top). > > > > I think it would help make the VTK docs less flat and hard to navigate. > > Agreed, that would be nice to have. As you know, we welcome > contributions that work towards this goal. Absolutely :) If I get some spare time I'll try to see how it could be done (ah, time...). > > > Not sure it's easily doable with just Doxygen though. Qt has its own > > tooling. > > > > BTW the heuristic you used above, will it work for all classes? I mean, are > > all modules laid out in the file system like this, and all module names > > correspond to directory names like that? > > As far as I know. This won't necessarily find you all the modules you > need to add as dependencies, though, as there may be additional module > dependencies brought in when using interface modules that support > different implementations. For example, if you are using classes in > vtkRenderingContext2D, I believe you need to add the implementation > that is used, either vtkRenderingContextOpenGL or > vtkRenderingContextOpenGL2 depending on which OpenGL backend you are > using. This can be a little harder to suss out. Right, I believe the WhatModulesVTK.py has some of the intelligence needed to sort this out, and also some flag to let the user specify explicitly what backend he/she intends to use. A doc generation tool would have to present both GL and GL2 as alternatives. Elvis > > - Cory > > > Elvis > > > > [1] https://doc.qt.io/qt-5/qtmodules.html > > [2] https://doc.qt.io/qt-5/qtnetwork-index.html > > [3] https://doc.qt.io/qt-5/qtnetwork-module.html > > [4] https://doc.qt.io/qt-5/qnetworkreply.html > > > >> > >> - Cory > >> > >> > but you can > >> > run the Utilities/Maintenance/WhatModules.py script from VTK against > >> > your > >> > sources, to find out the list of modules you need to link against based > >> > on > >> > what headers you are including. > >> > > >> > E.g: > >> > > >> > estan at newton:~/orexplore/VTK$ ./Utilities/Maintenance/WhatModulesVTK.py > >> > . > >> > Filters/Modeling/Testing/Cxx/TestRotationalExtrusion.cxx > >> > Modules and their dependencies: > >> > find_package(VTK COMPONENTS > >> > vtkCommonCore > >> > vtkCommonDataModel > >> > vtkCommonExecutionModel > >> > vtkCommonMath > >> > vtkCommonMisc > >> > vtkCommonTransforms > >> > vtkFiltersCore > >> > vtkFiltersGeneral > >> > vtkFiltersModeling > >> > vtkFiltersSources > >> > vtkInteractionStyle > >> > vtkRenderingCore > >> > vtkRenderingOpenGL > >> > vtkTestingCore > >> > vtkTestingRendering > >> > vtkkwiml > >> > ) > >> > Your application code includes 16 of 189 vtk modules. > >> > > >> > All modules referenced in the files: > >> > find_package(VTK COMPONENTS > >> > vtkCommonCore > >> > vtkFiltersCore > >> > vtkFiltersModeling > >> > vtkFiltersSources > >> > vtkInteractionStyle > >> > vtkRenderingCore > >> > vtkRenderingOpenGL > >> > vtkTestingCore > >> > vtkTestingRendering > >> > ) > >> > Your application code includes 9 of 189 vtk modules. > >> > > >> > Minimal set of modules: > >> > find_package(VTK COMPONENTS > >> > vtkFiltersModeling > >> > vtkFiltersSources > >> > vtkInteractionStyle > >> > vtkRenderingOpenGL > >> > vtkTestingRendering > >> > ) > >> > Your application code includes 5 of 189 vtk modules. > >> > > >> > > >> > estan at newton:~/orexplore/VTK$ > >> > > >> > It's the middle one of these three sets of modules that you probably > >> > wants > >> > to use (the one listed under "All modules referenced in the files:"). > >> > > >> > The script is not perfect, but has been a great help to me. > >> > > >> > Elvis > >> > > >> >> > >> >> How can I report a bug? Sent to vtkdevelopers at vtk.org but with no > >> >> success. > >> >> > >> >> Best > >> >> CP > >> >> > >> >> > >> >> _______________________________________________ > >> >> Powered by www.kitware.com > >> >> > >> >> Visit other Kitware open-source projects at > >> >> http://www.kitware.com/opensource/opensource.html > >> >> > >> >> Please keep messages on-topic and check the VTK FAQ at: > >> >> 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 > >> > > >> > >> > >> > >> -- > >> 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 ich_daniel at habmalnefrage.de Thu Dec 1 04:53:37 2016 From: ich_daniel at habmalnefrage.de (-Daniel-) Date: Thu, 1 Dec 2016 02:53:37 -0700 (MST) Subject: [vtkusers] Missing functions after building of VTK 7.1.0 with Java-wrapper In-Reply-To: References: <1480513322165-5741366.post@n5.nabble.com> Message-ID: <1480586017723-5741384.post@n5.nabble.com> Okay, thanks for the feedback! This means that it is currently not possible to build the vtk version 7.1.0 with Java wrappers. -- View this message in context: http://vtk.1045678.n5.nabble.com/Missing-functions-after-building-of-VTK-7-1-0-with-Java-wrapper-tp5741366p5741384.html Sent from the VTK - Users mailing list archive at Nabble.com. From david.lonie at kitware.com Thu Dec 1 11:28:37 2016 From: david.lonie at kitware.com (David Lonie) Date: Thu, 1 Dec 2016 11:28:37 -0500 Subject: [vtkusers] No override found for 'vtkPolyDataMapper'. In-Reply-To: References: Message-ID: You need to link either the vtkRenderingOpenGL or vtkRenderingOpenGL2 library (depending on which was built) to your application. On Wed, Nov 30, 2016 at 10:14 PM, Priya Vashistha wrote: > Dear vtk users and developers, > > I haven't been able to find a solution to this problem, hence posting this > again. Please let me know if something worked for you for the following > issue. > > *Generic Warning:* In/home/direction/Downloads/VTK-.0.0/Rendering/Core/vtkPolyDataMapper.cxx, > line 28 > *Error*: no override found for 'vtkPolyDataMapper'. > > I am using VTK7.0.0 (built using CMake on win 10) and running a project in > Visual studio 15 express. This error appears in vtkOutputWindow. > > I saw the same issue been posted on forum online but I haven't been able to > find a clear solution. > > Any help would be greatly appreciated. > > Thank You, > Priya > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sankhesh.jhaveri at kitware.com Thu Dec 1 11:59:33 2016 From: sankhesh.jhaveri at kitware.com (Sankhesh Jhaveri) Date: Thu, 01 Dec 2016 16:59:33 +0000 Subject: [vtkusers] vtkGPUVolumeRayCastMapper (OpenGL2) - Mask Input update In-Reply-To: <1480530396414-5741375.post@n5.nabble.com> References: <1480373793774-5741322.post@n5.nabble.com> <1480530396414-5741375.post@n5.nabble.com> Message-ID: Seems like you've exposed a bug. Mind creating a merge request to VTK. You can tag me on the MR for review. Thanks, Sankhesh On Wed, Nov 30, 2016 at 1:26 PM meow_fiz wrote: I've downloaded latest VTK from GIT (git clone https://gitlab.kitware.com/vtk/vtk.git VTK). I guess it's the latest. But the problem remains. calling MaskInputData->Modified(); does not do any update to volume Mask My temp solution until I find the right one: (temporarily i've edited vtkOpenGLGPUVolumeRayCastMapper.cxx file - GPURender( ... ) by forcing to call LoadMask when mask was modified: if (this->Impl->NeedToInitializeResources || (input->GetMTime() > this->Impl->InputUpdateTime.GetMTime())) { volumeModified = true; input->GetDimensions(this->Impl->Dimensions); // Update bounds, data, and geometry this->Impl->ComputeBounds(input); this->Impl->LoadVolume(ren, input, volumeProperty, scalars, independentComponents); this->Impl->ComputeCellToPointMatrix(); this->Impl->LoadMask(ren, input, this->MaskInput, this->Impl->Extents, vol); } else { ///---------------------changed lines if (MaskInput->GetMTime() >Impl->ShaderBuildTime.GetMTime()) this->Impl->LoadMask(ren, input, this->MaskInput, this->Impl->Extents, vol); //-------------------- end of changed lines this->Impl->UpdateVolume(volumeProperty); } Regards, Michal -- View this message in context: http://vtk.1045678.n5.nabble.com/vtkGPUVolumeRayCastMapper-OpenGL2-Mask-Input-update-tp5741322p5741375.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 -- Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware | (518) 881-4417 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From technword at gmail.com Thu Dec 1 12:24:05 2016 From: technword at gmail.com (High Techno) Date: Thu, 1 Dec 2016 17:24:05 +0000 Subject: [vtkusers] VTKMarchingCube Error Message-ID: Hi I'm working on 3D surface rendering of CT data using marching cube in VTK 6.3.0. with 300 slices the surface rendering work without error.but when i use a number of slice greater than 300 i get the folowing error: *ERROR: In c:\vtk\vtk-6.3.0.source\vtk-6.3.0\common\core\vtkDataArrayTemplate.txx, line 142* *vtkShortArray (02E9C0B0): Unable to allocate 104857600 elements of size 2 bytes.* I have 16Go of RAM and PC core I5. thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From czuba at utexas.edu Thu Dec 1 15:29:17 2016 From: czuba at utexas.edu (Thad Czuba) Date: Thu, 1 Dec 2016 14:29:17 -0600 Subject: [vtkusers] vtk 4.2 download? Message-ID: Dude! Thank you. That is exactly what I was searching for. ...I naively thought that the git repository accessible through the kitware.com/vtk site (https://gitlab.kitware.com/vtk/vtk ; which only lists branches, not releases) reflected the complete repository. Lesson learned. -------------- next part -------------- An HTML attachment was scrubbed... URL: From DLRdave at aol.com Thu Dec 1 15:49:14 2016 From: DLRdave at aol.com (David Cole) Date: Thu, 1 Dec 2016 15:49:14 -0500 Subject: [vtkusers] vtk 4.2 download? In-Reply-To: References: Message-ID: If you look at the tags, you will find tags for all the old releases. Seems pretty complete from this angle: https://gitlab.kitware.com/vtk/vtk/tags https://gitlab.kitware.com/vtk/vtk/tags?utf8=?&search=v4.2 HTH, David C. On Thu, Dec 1, 2016 at 3:29 PM, Thad Czuba wrote: > Dude! Thank you. That is exactly what I was searching for. > > ...I naively thought that the git repository accessible through the > kitware.com/vtk site (https://gitlab.kitware.com/vtk/vtk; which only lists > branches, not releases) reflected the complete repository. Lesson learned. > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > From meow at mat.uni.torun.pl Fri Dec 2 06:57:20 2016 From: meow at mat.uni.torun.pl (meow_fiz) Date: Fri, 2 Dec 2016 04:57:20 -0700 (MST) Subject: [vtkusers] vtkGPUVolumeRayCastMapper (OpenGL2) - Mask Input update In-Reply-To: References: <1480373793774-5741322.post@n5.nabble.com> <1480530396414-5741375.post@n5.nabble.com> Message-ID: <1480679840076-5741390.post@n5.nabble.com> I'm not sure it's the best solution. It seems like it's slower than in Vtk6.3 &OpenGl1.x backend. Is it optimal solution to update modified mask volume to call LoadMaskMethod? The whole volume rendering on GPU doesn't look faster than in previous approach. I've read some threads about changing SetMaximumImageSampleDistance &SetAutoAdjustSampleDistances but it didn't affect the rendering frame rates ... -- View this message in context: http://vtk.1045678.n5.nabble.com/vtkGPUVolumeRayCastMapper-OpenGL2-Mask-Input-update-tp5741322p5741390.html Sent from the VTK - Users mailing list archive at Nabble.com. From cp.vtk.user at googlemail.com Fri Dec 2 08:56:03 2016 From: cp.vtk.user at googlemail.com (C P) Date: Fri, 2 Dec 2016 14:56:03 +0100 Subject: [vtkusers] Show tooltip Message-ID: Dear vtk users, how can I show a tooltip at some 2D position on the screen? I checked the vtkTooltipItem class but I do not know how to make it show something. I cannot add it to the vtkRenderer like a 2D actors. I tired this but it doesn't work (in Oython): tooltip = vtk.vtkTooltipItem() tooltip.SetText("some text") tooltip.SetVisible(1) How is it done? Thanks. Best CP -------------- next part -------------- An HTML attachment was scrubbed... URL: From sankhesh.jhaveri at kitware.com Fri Dec 2 09:06:08 2016 From: sankhesh.jhaveri at kitware.com (Sankhesh Jhaveri) Date: Fri, 02 Dec 2016 14:06:08 +0000 Subject: [vtkusers] vtkGPUVolumeRayCastMapper (OpenGL2) - Mask Input update In-Reply-To: <1480679840076-5741390.post@n5.nabble.com> References: <1480373793774-5741322.post@n5.nabble.com> <1480530396414-5741375.post@n5.nabble.com> <1480679840076-5741390.post@n5.nabble.com> Message-ID: Hi, Updating the mask texture when the mask input has been modified is the optimum solution. Regarding performance, could you share some details about your data (size, data type, etc.) and pipeline? Thanks, Sankhesh ? On Fri, Dec 2, 2016 at 6:57 AM meow_fiz wrote: > I'm not sure it's the best solution. It seems like it's slower than in > Vtk6.3 > &OpenGl1.x backend. > > Is it optimal solution to update modified mask volume to call > LoadMaskMethod? > > The whole volume rendering on GPU doesn't look faster than in previous > approach. I've read some threads about changing > SetMaximumImageSampleDistance &SetAutoAdjustSampleDistances but it didn't > affect the rendering frame rates ... > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/vtkGPUVolumeRayCastMapper-OpenGL2-Mask-Input-update-tp5741322p5741390.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 > -- Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware | (518) 881-4417 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From sankhesh.jhaveri at kitware.com Fri Dec 2 09:48:31 2016 From: sankhesh.jhaveri at kitware.com (Sankhesh Jhaveri) Date: Fri, 02 Dec 2016 14:48:31 +0000 Subject: [vtkusers] restrict polydata to area of other polydata In-Reply-To: References: Message-ID: Hi, Take a look at vtkBooleanOperationPolyDataFilter . There is an example here: http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/BooleanOperationPolyDataFilter Hope that helps. Sankhesh ? On Mon, Nov 28, 2016 at 1:55 PM M. Jordan wrote: > I have a polydata consisting out of many little unconnected pieces. > I would like to get a resulting polydata just containing pieces which are > inside of another big (connected) polydata. > > How can I do this? Is there a filter for it? > > Thank you > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware | (518) 881-4417 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From meow at mat.uni.torun.pl Fri Dec 2 09:57:33 2016 From: meow at mat.uni.torun.pl (meow_fiz) Date: Fri, 2 Dec 2016 07:57:33 -0700 (MST) Subject: [vtkusers] vtkGPUVolumeRayCastMapper (OpenGL2) - Mask Input update In-Reply-To: References: <1480373793774-5741322.post@n5.nabble.com> <1480530396414-5741375.post@n5.nabble.com> <1480679840076-5741390.post@n5.nabble.com> Message-ID: <1480690653577-5741394.post@n5.nabble.com> DataSet 512x512x219 unsigned short RenderWindow - 1300x1000 VolumeMapper->SetMaxMemoryInBytes(2.04e+9); VolumeMapper->SetBlendModeToComposite(); VolumeMapper->SetMaximumImageSampleDistance(4.0); olumeMapper->SetAutoAdjustSampleDistances(1); VolumeProperty->SetInterpolationTypeToNearest(); VolumeProperty->DisableGradientOpacityOff(); VolumeProperty->SetShade(0); Volume zoomed in to fill window - I get 12fps maximum -- View this message in context: http://vtk.1045678.n5.nabble.com/vtkGPUVolumeRayCastMapper-OpenGL2-Mask-Input-update-tp5741322p5741394.html Sent from the VTK - Users mailing list archive at Nabble.com. From alvaro.sanchez at kitware.com Fri Dec 2 10:03:46 2016 From: alvaro.sanchez at kitware.com (Alvaro Sanchez) Date: Fri, 2 Dec 2016 10:03:46 -0500 Subject: [vtkusers] vtkGPUVolumeRayCastMapper (OpenGL2) - Mask Input update In-Reply-To: <1480690653577-5741394.post@n5.nabble.com> References: <1480373793774-5741322.post@n5.nabble.com> <1480530396414-5741375.post@n5.nabble.com> <1480679840076-5741390.post@n5.nabble.com> <1480690653577-5741394.post@n5.nabble.com> Message-ID: Hi Michal, could you also share your system's specs? On Fri, Dec 2, 2016 at 9:57 AM, meow_fiz wrote: > DataSet 512x512x219 unsigned short > RenderWindow - 1300x1000 > > VolumeMapper->SetMaxMemoryInBytes(2.04e+9); > VolumeMapper->SetBlendModeToComposite(); > VolumeMapper->SetMaximumImageSampleDistance(4.0); > olumeMapper->SetAutoAdjustSampleDistances(1); > VolumeProperty->SetInterpolationTypeToNearest(); > VolumeProperty->DisableGradientOpacityOff(); > VolumeProperty->SetShade(0); > > Volume zoomed in to fill window - I get 12fps maximum > > > > > > > > > > > -- > View this message in context: http://vtk.1045678.n5.nabble. > com/vtkGPUVolumeRayCastMapper-OpenGL2-Mask-Input-update- > tp5741322p5741394.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 > -- Alvaro Sanchez Kitware, Inc. Senior R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4901 -------------- next part -------------- An HTML attachment was scrubbed... URL: From meow at mat.uni.torun.pl Fri Dec 2 10:10:57 2016 From: meow at mat.uni.torun.pl (meow_fiz) Date: Fri, 2 Dec 2016 08:10:57 -0700 (MST) Subject: [vtkusers] vtkGPUVolumeRayCastMapper (OpenGL2) - Mask Input update In-Reply-To: References: <1480373793774-5741322.post@n5.nabble.com> <1480530396414-5741375.post@n5.nabble.com> <1480679840076-5741390.post@n5.nabble.com> <1480690653577-5741394.post@n5.nabble.com> Message-ID: <1480691457365-5741396.post@n5.nabble.com> Tested on: i7 980/ 2x GTX 580 / 24GB RAM Also tested on notebook: i7-4810MQ 2.8/3.8GHz / GTX 960M / 16GB RAM Laptop is a bit faster -- View this message in context: http://vtk.1045678.n5.nabble.com/vtkGPUVolumeRayCastMapper-OpenGL2-Mask-Input-update-tp5741322p5741396.html Sent from the VTK - Users mailing list archive at Nabble.com. From andrea.gavana at gmail.com Fri Dec 2 10:18:44 2016 From: andrea.gavana at gmail.com (Andrea Gavana) Date: Fri, 2 Dec 2016 16:18:44 +0100 Subject: [vtkusers] vtkArrowSource and vtkGlyph3D Message-ID: Dear All, I am trying to combine a vtkArrowSource and vtkGlyph3D. I have been (naively) thinking that by specifying a polydata with two points (start and end) and assigning its points to the vtkGlyph3D I would obtain an arrow that starts at the start point and end at the end point. I have created a small, self-contained following Python script to demonstrate what I mean - I get 4 arrows, one at each point I define, instead of two arrows. What am I missing? Any suggestion is more than welcome. Thank you in advance. Andrea. import vtk import numpy # First set of points - first arrow points1 = numpy.array([[ 11271.915, 7538.686, 6245.661], [ 11271.915, 7538.686, 5897.034]]) # Second set of points - second arrow points2 = numpy.array([[ 10532.274, 9101.572, 6313.167], [ 10532.274, 9101.572, 5964.539]]) # Create an arrow source with some attributes arrow_source = vtk.vtkArrowSource() arrow_source.SetTipRadius(0.2) arrow_source.SetShaftRadius(0.075) # Create the vtkGlyph3D arrow_glyph = vtk.vtkGlyph3D() arrow_glyph.SetScaleModeToDataScalingOff() # Usual mapper arrow_mapper = vtk.vtkPolyDataMapper() arrow_mapper.SetInputConnection(arrow_glyph.GetOutputPort()) # Usual actor arrow_actor = vtk.vtkActor() arrow_actor.SetMapper(arrow_mapper) append_poly_data = vtk.vtkAppendPolyData() # Loop through points1 and points2 for p in [points1, points2]: arrow_poly_data = vtk.vtkPolyData() vtk_arrow_lines = vtk.vtkCellArray() vtk_arrow_lines.InsertNextCell(2) vtk_arrow_lines.InsertCellPoint(0) vtk_arrow_lines.InsertCellPoint(1) vtk_arrow_points = vtk.vtkPoints() # Loop through the head and tail of a single arrow for j in xrange(2): vtk_arrow_points.InsertNextPoint(p[j]) arrow_poly_data.SetPoints(vtk_arrow_points) arrow_poly_data.SetLines(vtk_arrow_lines) append_poly_data.AddInputData(arrow_poly_data) arrow_glyph.SetInputConnection(append_poly_data.GetOutputPort()) arrow_glyph.SetSourceConnection(arrow_source.GetOutputPort()) arrow_glyph.SetScaleFactor(100) arrow_actor.GetProperty().SetColor(1, 1, 1) # ------------------------------------------------------------ # Create the RenderWindow, Renderer and both Actors # ------------------------------------------------------------ ren = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) # add actors ren.AddActor(arrow_actor) ren.ResetCamera() iren.Start() -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickfrank at me.com Fri Dec 2 10:20:12 2016 From: rickfrank at me.com (Richard Frank) Date: Fri, 02 Dec 2016 10:20:12 -0500 Subject: [vtkusers] vtkusers Digest, Vol 151, Issue 35 In-Reply-To: References: Message-ID: <002d01d24caf$94ce1fd0$be6a5f70$@me.com> Hi, This impacts me as well. Is there a bug filed on this? For display of volume segmentation, it would seem that the mask feature would be the thing to use. I couldn't get it to work, and wasn't sure if it was a bug or just my missing something. Thanks Rick > ------------------------------ > > Message: 4 > Date: Mon, 28 Nov 2016 15:56:33 -0700 (MST) > From: meow_fiz > To: vtkusers at vtk.org > Subject: [vtkusers] vtkGPUVolumeRayCastMapper (OpenGL2) - Mask Input > update > Message-ID: <1480373793774-5741322.post at n5.nabble.com> > Content-Type: text/plain; charset=us-ascii > > For a long time I've used vtkGPUVolumeRayCastMapper in vtk 6.3 (OpenGL > 1.x). > I could change interactively volume mask voxel values set by: > > volMapper->SetMaskInput (myMask); > > > Now when i switched to VTK 7.1RC & OpenGL2 I can't make any modifications > to > volume mask interactively. Calling Update(), Modified() on every element of > the pipeline (volume, input data, mask input, mapper) does not affect visual > result. > > The only way I can get the updated mask volume is to call: > > Renderer->RemoveVolume(Volume); > Renderer->AddVolume(Volume); > > Is there any way that I could force volume mask update for > vtkGPUVolumeRayCastMapper ? > > Regards, > Michal > > > > **************************** From sankhesh.jhaveri at kitware.com Fri Dec 2 10:28:19 2016 From: sankhesh.jhaveri at kitware.com (Sankhesh Jhaveri) Date: Fri, 02 Dec 2016 15:28:19 +0000 Subject: [vtkusers] vtkusers Digest, Vol 151, Issue 35 In-Reply-To: <002d01d24caf$94ce1fd0$be6a5f70$@me.com> References: <002d01d24caf$94ce1fd0$be6a5f70$@me.com> Message-ID: Richard, There isn't a bug filed yet for the mask update issue. Please feel free to do so. Although, Michal has a patch for the mask update issue already. Michal, would you be able to create a merge request with your patch? Or should Alvaro do it? We can look into the performance woes that Michal experiences, as a separate issue. Thanks, Sankhesh On Fri, Dec 2, 2016 at 10:20 AM Richard Frank wrote: > Hi, > > > This impacts me as well. Is there a bug filed on this? > > For display of volume segmentation, it would seem that the mask feature > would be the thing to use. I couldn't get it to work, and wasn't sure if it > was a bug or just my missing something. > > Thanks > > Rick > > > ------------------------------ > > > > Message: 4 > > Date: Mon, 28 Nov 2016 15:56:33 -0700 (MST) > > From: meow_fiz > > To: vtkusers at vtk.org > > Subject: [vtkusers] vtkGPUVolumeRayCastMapper (OpenGL2) - Mask Input > > update > > Message-ID: <1480373793774-5741322.post at n5.nabble.com> > > Content-Type: text/plain; charset=us-ascii > > > > For a long time I've used vtkGPUVolumeRayCastMapper in vtk 6.3 (OpenGL > > 1.x). > > I could change interactively volume mask voxel values set by: > > > > volMapper->SetMaskInput (myMask); > > > > > > Now when i switched to VTK 7.1RC & OpenGL2 I can't make any modifications > > to > > volume mask interactively. Calling Update(), Modified() on every element > of > > the pipeline (volume, input data, mask input, mapper) does not affect > visual > > result. > > > > The only way I can get the updated mask volume is to call: > > > > Renderer->RemoveVolume(Volume); > > Renderer->AddVolume(Volume); > > > > Is there any way that I could force volume mask update for > > vtkGPUVolumeRayCastMapper ? > > > > Regards, > > Michal > > > > > > > > > **************************** > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware | (518) 881-4417 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.martin at kitware.com Fri Dec 2 10:29:59 2016 From: ken.martin at kitware.com (Ken Martin) Date: Fri, 2 Dec 2016 10:29:59 -0500 Subject: [vtkusers] vtkArrowSource and vtkGlyph3D In-Reply-To: References: Message-ID: Be aware Glyph3D is a filter and will actually generate all those arrows in memory. Glyph3DMapper is a mapper and uses OpenGL tricks to render the same arrow lots of times. Both classes place a glyph at the location of each input point. The orientation is controlled by a different array in your point data ala the comments below: Thanks Ken //@{ /** * Turn on/off orienting of input geometry. * When turned on, the orientation array specified * using SetOrientationArray() will be used. */ vtkSetMacro(Orient, bool); vtkGetMacro(Orient, bool); vtkBooleanMacro(Orient, bool); //@} //@{ /** * Orientation mode indicates if the OrientationArray provides the direction * vector for the orientation or the rotations around each axes. Default is * DIRECTION */ vtkSetClampMacro(OrientationMode, int, DIRECTION, ROTATION); vtkGetMacro(OrientationMode, int); void SetOrientationModeToDirection() { this->SetOrientationMode(vtkGlyph3DMapper::DIRECTION); } void SetOrientationModeToRotation() { this->SetOrientationMode(vtkGlyph3DMapper::ROTATION); } const char* GetOrientationModeAsString(); //@} enum OrientationModes { DIRECTION=0, ROTATION=1 }; /** * Tells the mapper to use an orientation array if Orient is true. * An orientation array is a vtkDataArray with 3 components. The first * component is the angle of rotation along the X axis. The second * component is the angle of rotation along the Y axis. The third * component is the angle of rotation along the Z axis. Orientation is * specified in X,Y,Z order but the rotations are performed in Z,X an Y. * This definition is compliant with SetOrientation method on vtkProp3D. * By using vector or normal there is a degree of freedom or rotation * left (underconstrained). With the orientation array, there is no degree of * freedom left. * This is convenience method. The same effect can be achieved by using * SetInputArrayToProcess(vtkGlyph3DMapper::ORIENTATION, 0, 0, * vtkDataObject::FIELD_ASSOCIATION_POINTS, orientationarrayname); */ void SetOrientationArray(const char* orientationarrayname); On Fri, Dec 2, 2016 at 10:18 AM, Andrea Gavana wrote: > Dear All, > > I am trying to combine a vtkArrowSource and vtkGlyph3D. I have been > (naively) thinking that by specifying a polydata with two points (start and > end) and assigning its points to the vtkGlyph3D I would obtain an arrow > that starts at the start point and end at the end point. > > I have created a small, self-contained following Python script to > demonstrate what I mean - I get 4 arrows, one at each point I define, > instead of two arrows. What am I missing? Any suggestion is more than > welcome. > > Thank you in advance. > > Andrea. > > > import vtk > import numpy > > # First set of points - first arrow > points1 = numpy.array([[ 11271.915, 7538.686, 6245.661], > [ 11271.915, 7538.686, 5897.034]]) > > # Second set of points - second arrow > points2 = numpy.array([[ 10532.274, 9101.572, 6313.167], > [ 10532.274, 9101.572, 5964.539]]) > > # Create an arrow source with some attributes > arrow_source = vtk.vtkArrowSource() > arrow_source.SetTipRadius(0.2) > arrow_source.SetShaftRadius(0.075) > > # Create the vtkGlyph3D > arrow_glyph = vtk.vtkGlyph3D() > arrow_glyph.SetScaleModeToDataScalingOff() > > # Usual mapper > arrow_mapper = vtk.vtkPolyDataMapper() > arrow_mapper.SetInputConnection(arrow_glyph.GetOutputPort()) > > # Usual actor > arrow_actor = vtk.vtkActor() > arrow_actor.SetMapper(arrow_mapper) > > append_poly_data = vtk.vtkAppendPolyData() > > # Loop through points1 and points2 > for p in [points1, points2]: > > arrow_poly_data = vtk.vtkPolyData() > vtk_arrow_lines = vtk.vtkCellArray() > > vtk_arrow_lines.InsertNextCell(2) > vtk_arrow_lines.InsertCellPoint(0) > vtk_arrow_lines.InsertCellPoint(1) > > vtk_arrow_points = vtk.vtkPoints() > # Loop through the head and tail of a single arrow > for j in xrange(2): > vtk_arrow_points.InsertNextPoint(p[j]) > > arrow_poly_data.SetPoints(vtk_arrow_points) > arrow_poly_data.SetLines(vtk_arrow_lines) > append_poly_data.AddInputData(arrow_poly_data) > > > arrow_glyph.SetInputConnection(append_poly_data.GetOutputPort()) > arrow_glyph.SetSourceConnection(arrow_source.GetOutputPort()) > arrow_glyph.SetScaleFactor(100) > arrow_actor.GetProperty().SetColor(1, 1, 1) > > # ------------------------------------------------------------ > # Create the RenderWindow, Renderer and both Actors > # ------------------------------------------------------------ > ren = vtk.vtkRenderer() > renWin = vtk.vtkRenderWindow() > renWin.AddRenderer(ren) > iren = vtk.vtkRenderWindowInteractor() > iren.SetRenderWindow(renWin) > > # add actors > ren.AddActor(arrow_actor) > ren.ResetCamera() > iren.Start() > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -- Ken Martin PhD Chairman & CFO Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 518 371 3971 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 andrea.gavana at gmail.com Fri Dec 2 10:45:06 2016 From: andrea.gavana at gmail.com (Andrea Gavana) Date: Fri, 02 Dec 2016 15:45:06 +0000 Subject: [vtkusers] vtkArrowSource and vtkGlyph3D In-Reply-To: References: Message-ID: Hi Ken, Thank you very much for your answer. I hadn't understood that vtkGlyph3D would create all the arrows in memory. However, it may still be the only choice I have as I would like to be able to assign a different color (based on a scalar) to each arrow, and some arrows should point downward while others upwards. The size of the arrow will stay constant but the color I would like to be able to change it on an arrow-by arrow basis, and I don't know if this can be done using vtkGlyph3DMapper... Of course, I would be more than happy to be proven wrong ?. Thank you again. Andrea. On Fri, 2 Dec 2016 at 16:30, Ken Martin wrote: > Be aware Glyph3D is a filter and will actually generate all those arrows > in memory. Glyph3DMapper is a mapper and uses OpenGL tricks to render the > same arrow lots of times. > > Both classes place a glyph at the location of each input point. The > orientation is controlled by a different array in your point data ala the > comments below: > > Thanks > Ken > > //@{ > /** > * Turn on/off orienting of input geometry. > * When turned on, the orientation array specified > * using SetOrientationArray() will be used. > */ > vtkSetMacro(Orient, bool); > vtkGetMacro(Orient, bool); > vtkBooleanMacro(Orient, bool); > //@} > > //@{ > /** > * Orientation mode indicates if the OrientationArray provides the > direction > * vector for the orientation or the rotations around each axes. Default > is > * DIRECTION > */ > vtkSetClampMacro(OrientationMode, int, DIRECTION, ROTATION); > vtkGetMacro(OrientationMode, int); > void SetOrientationModeToDirection() > { this->SetOrientationMode(vtkGlyph3DMapper::DIRECTION); } > void SetOrientationModeToRotation() > { this->SetOrientationMode(vtkGlyph3DMapper::ROTATION); } > const char* GetOrientationModeAsString(); > //@} > > enum OrientationModes > { > DIRECTION=0, > ROTATION=1 > }; > > > /** > * Tells the mapper to use an orientation array if Orient is true. > * An orientation array is a vtkDataArray with 3 components. The first > * component is the angle of rotation along the X axis. The second > * component is the angle of rotation along the Y axis. The third > * component is the angle of rotation along the Z axis. Orientation is > * specified in X,Y,Z order but the rotations are performed in Z,X an Y. > * This definition is compliant with SetOrientation method on vtkProp3D. > * By using vector or normal there is a degree of freedom or rotation > * left (underconstrained). With the orientation array, there is no > degree of > * freedom left. > * This is convenience method. The same effect can be achieved by using > * SetInputArrayToProcess(vtkGlyph3DMapper::ORIENTATION, 0, 0, > * vtkDataObject::FIELD_ASSOCIATION_POINTS, orientationarrayname); > */ > void SetOrientationArray(const char* orientationarrayname); > > > On Fri, Dec 2, 2016 at 10:18 AM, Andrea Gavana > wrote: > > Dear All, > > I am trying to combine a vtkArrowSource and vtkGlyph3D. I have been > (naively) thinking that by specifying a polydata with two points (start and > end) and assigning its points to the vtkGlyph3D I would obtain an arrow > that starts at the start point and end at the end point. > > I have created a small, self-contained following Python script to > demonstrate what I mean - I get 4 arrows, one at each point I define, > instead of two arrows. What am I missing? Any suggestion is more than > welcome. > > Thank you in advance. > > Andrea. > > > import vtk > import numpy > > # First set of points - first arrow > points1 = numpy.array([[ 11271.915, 7538.686, 6245.661], > [ 11271.915, 7538.686, 5897.034]]) > > # Second set of points - second arrow > points2 = numpy.array([[ 10532.274, 9101.572, 6313.167], > [ 10532.274, 9101.572, 5964.539]]) > > # Create an arrow source with some attributes > arrow_source = vtk.vtkArrowSource() > arrow_source.SetTipRadius(0.2) > arrow_source.SetShaftRadius(0.075) > > # Create the vtkGlyph3D > arrow_glyph = vtk.vtkGlyph3D() > arrow_glyph.SetScaleModeToDataScalingOff() > > # Usual mapper > arrow_mapper = vtk.vtkPolyDataMapper() > arrow_mapper.SetInputConnection(arrow_glyph.GetOutputPort()) > > # Usual actor > arrow_actor = vtk.vtkActor() > arrow_actor.SetMapper(arrow_mapper) > > append_poly_data = vtk.vtkAppendPolyData() > > # Loop through points1 and points2 > for p in [points1, points2]: > > arrow_poly_data = vtk.vtkPolyData() > vtk_arrow_lines = vtk.vtkCellArray() > > vtk_arrow_lines.InsertNextCell(2) > vtk_arrow_lines.InsertCellPoint(0) > vtk_arrow_lines.InsertCellPoint(1) > > vtk_arrow_points = vtk.vtkPoints() > # Loop through the head and tail of a single arrow > for j in xrange(2): > vtk_arrow_points.InsertNextPoint(p[j]) > > arrow_poly_data.SetPoints(vtk_arrow_points) > arrow_poly_data.SetLines(vtk_arrow_lines) > append_poly_data.AddInputData(arrow_poly_data) > > > arrow_glyph.SetInputConnection(append_poly_data.GetOutputPort()) > arrow_glyph.SetSourceConnection(arrow_source.GetOutputPort()) > arrow_glyph.SetScaleFactor(100) > arrow_actor.GetProperty().SetColor(1, 1, 1) > > # ------------------------------------------------------------ > # Create the RenderWindow, Renderer and both Actors > # ------------------------------------------------------------ > ren = vtk.vtkRenderer() > renWin = vtk.vtkRenderWindow() > renWin.AddRenderer(ren) > iren = vtk.vtkRenderWindowInteractor() > iren.SetRenderWindow(renWin) > > # add actors > ren.AddActor(arrow_actor) > ren.ResetCamera() > iren.Start() > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > > > > -- > Ken Martin PhD > Chairman & CFO > Kitware Inc. > 28 Corporate Drive > Clifton Park NY 12065 > 518 371 3971 > > 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 ken.martin at kitware.com Fri Dec 2 10:52:37 2016 From: ken.martin at kitware.com (Ken Martin) Date: Fri, 2 Dec 2016 10:52:37 -0500 Subject: [vtkusers] vtkArrowSource and vtkGlyph3D In-Reply-To: References: Message-ID: It can color/scale/orient/mask on a per glyph basis. It can even index into multiple glyph models on a per point basis. So you should be good. Just takes a while to wade through all the options as there is a lot in there. Thanks Ken On Fri, Dec 2, 2016 at 10:45 AM, Andrea Gavana wrote: > Hi Ken, > > Thank you very much for your answer. I hadn't understood that vtkGlyph3D > would create all the arrows in memory. > > However, it may still be the only choice I have as I would like to be able > to assign a different color (based on a scalar) to each arrow, and some > arrows should point downward while others upwards. The size of the arrow > will stay constant but the color I would like to be able to change it on an > arrow-by arrow basis, and I don't know if this can be done using > vtkGlyph3DMapper... > > Of course, I would be more than happy to be proven wrong ?. > > Thank you again. > > Andrea. > > On Fri, 2 Dec 2016 at 16:30, Ken Martin wrote: > >> Be aware Glyph3D is a filter and will actually generate all those arrows >> in memory. Glyph3DMapper is a mapper and uses OpenGL tricks to render the >> same arrow lots of times. >> >> Both classes place a glyph at the location of each input point. The >> orientation is controlled by a different array in your point data ala the >> comments below: >> >> Thanks >> Ken >> >> //@{ >> /** >> * Turn on/off orienting of input geometry. >> * When turned on, the orientation array specified >> * using SetOrientationArray() will be used. >> */ >> vtkSetMacro(Orient, bool); >> vtkGetMacro(Orient, bool); >> vtkBooleanMacro(Orient, bool); >> //@} >> >> //@{ >> /** >> * Orientation mode indicates if the OrientationArray provides the >> direction >> * vector for the orientation or the rotations around each axes. >> Default is >> * DIRECTION >> */ >> vtkSetClampMacro(OrientationMode, int, DIRECTION, ROTATION); >> vtkGetMacro(OrientationMode, int); >> void SetOrientationModeToDirection() >> { this->SetOrientationMode(vtkGlyph3DMapper::DIRECTION); } >> void SetOrientationModeToRotation() >> { this->SetOrientationMode(vtkGlyph3DMapper::ROTATION); } >> const char* GetOrientationModeAsString(); >> //@} >> >> enum OrientationModes >> { >> DIRECTION=0, >> ROTATION=1 >> }; >> >> >> /** >> * Tells the mapper to use an orientation array if Orient is true. >> * An orientation array is a vtkDataArray with 3 components. The first >> * component is the angle of rotation along the X axis. The second >> * component is the angle of rotation along the Y axis. The third >> * component is the angle of rotation along the Z axis. Orientation is >> * specified in X,Y,Z order but the rotations are performed in Z,X an Y. >> * This definition is compliant with SetOrientation method on vtkProp3D. >> * By using vector or normal there is a degree of freedom or rotation >> * left (underconstrained). With the orientation array, there is no >> degree of >> * freedom left. >> * This is convenience method. The same effect can be achieved by using >> * SetInputArrayToProcess(vtkGlyph3DMapper::ORIENTATION, 0, 0, >> * vtkDataObject::FIELD_ASSOCIATION_POINTS, orientationarrayname); >> */ >> void SetOrientationArray(const char* orientationarrayname); >> >> >> On Fri, Dec 2, 2016 at 10:18 AM, Andrea Gavana >> wrote: >> >> Dear All, >> >> I am trying to combine a vtkArrowSource and vtkGlyph3D. I have been >> (naively) thinking that by specifying a polydata with two points (start and >> end) and assigning its points to the vtkGlyph3D I would obtain an arrow >> that starts at the start point and end at the end point. >> >> I have created a small, self-contained following Python script to >> demonstrate what I mean - I get 4 arrows, one at each point I define, >> instead of two arrows. What am I missing? Any suggestion is more than >> welcome. >> >> Thank you in advance. >> >> Andrea. >> >> >> import vtk >> import numpy >> >> # First set of points - first arrow >> points1 = numpy.array([[ 11271.915, 7538.686, 6245.661], >> [ 11271.915, 7538.686, 5897.034]]) >> >> # Second set of points - second arrow >> points2 = numpy.array([[ 10532.274, 9101.572, 6313.167], >> [ 10532.274, 9101.572, 5964.539]]) >> >> # Create an arrow source with some attributes >> arrow_source = vtk.vtkArrowSource() >> arrow_source.SetTipRadius(0.2) >> arrow_source.SetShaftRadius(0.075) >> >> # Create the vtkGlyph3D >> arrow_glyph = vtk.vtkGlyph3D() >> arrow_glyph.SetScaleModeToDataScalingOff() >> >> # Usual mapper >> arrow_mapper = vtk.vtkPolyDataMapper() >> arrow_mapper.SetInputConnection(arrow_glyph.GetOutputPort()) >> >> # Usual actor >> arrow_actor = vtk.vtkActor() >> arrow_actor.SetMapper(arrow_mapper) >> >> append_poly_data = vtk.vtkAppendPolyData() >> >> # Loop through points1 and points2 >> for p in [points1, points2]: >> >> arrow_poly_data = vtk.vtkPolyData() >> vtk_arrow_lines = vtk.vtkCellArray() >> >> vtk_arrow_lines.InsertNextCell(2) >> vtk_arrow_lines.InsertCellPoint(0) >> vtk_arrow_lines.InsertCellPoint(1) >> >> vtk_arrow_points = vtk.vtkPoints() >> # Loop through the head and tail of a single arrow >> for j in xrange(2): >> vtk_arrow_points.InsertNextPoint(p[j]) >> >> arrow_poly_data.SetPoints(vtk_arrow_points) >> arrow_poly_data.SetLines(vtk_arrow_lines) >> append_poly_data.AddInputData(arrow_poly_data) >> >> >> arrow_glyph.SetInputConnection(append_poly_data.GetOutputPort()) >> arrow_glyph.SetSourceConnection(arrow_source.GetOutputPort()) >> arrow_glyph.SetScaleFactor(100) >> arrow_actor.GetProperty().SetColor(1, 1, 1) >> >> # ------------------------------------------------------------ >> # Create the RenderWindow, Renderer and both Actors >> # ------------------------------------------------------------ >> ren = vtk.vtkRenderer() >> renWin = vtk.vtkRenderWindow() >> renWin.AddRenderer(ren) >> iren = vtk.vtkRenderWindowInteractor() >> iren.SetRenderWindow(renWin) >> >> # add actors >> ren.AddActor(arrow_actor) >> ren.ResetCamera() >> iren.Start() >> >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at http://www.kitware.com/ >> opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> >> >> >> -- >> Ken Martin PhD >> Chairman & CFO >> Kitware Inc. >> 28 Corporate Drive >> Clifton Park NY 12065 >> 518 371 3971 >> >> This communication, including all attachments, contains confidential and >> legally privileged information, and it is intended only for the use of the >> addressee. Access to this email by anyone else is unauthorized. If you are >> not the intended recipient, any disclosure, copying, distribution or any >> action taken in reliance on it is prohibited and may be unlawful. If you >> received this communication in error please notify us immediately and >> destroy the original message. Thank you. >> > -- Ken Martin PhD Chairman & CFO Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 518 371 3971 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 rec88 at msstate.edu Fri Dec 2 12:58:56 2016 From: rec88 at msstate.edu (rec88) Date: Fri, 2 Dec 2016 10:58:56 -0700 (MST) Subject: [vtkusers] Quadric Decimation stoping at 20% Message-ID: <1480701536715-5741405.post@n5.nabble.com> I have a few large mesh datasets I am working with, over 1.5 gb, per mesh and and am trying to reduce them using the Quadric error metrics. While the first one seems to have worked well, the others seem to stop reducing at 20%. I was wondering if anybody has run into a similar problem. Here is an example of my decimation code in python. import os import sys import vtk import subprocess import time from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot # time0=time.time() reductionF = .995 filein="FILEIN" fileout="FILEOUT" #set up the pipeline reader=vtk.vtkXMLPolyDataReader() reader.SetFileName(filein) reader.Update() reader_output=reader.GetOutput() #set filters gf=vtk.vtkGeometryFilter() gf.SetInputData(reader_output) tf=vtk.vtkTriangleFilter() tf.SetInputConnection(gf.GetOutputPort()) #set mappers and actors gMapper = vtk.vtkPolyDataMapper() gMapper.SetInputConnection(gf.GetOutputPort()) time1=time0-time.time() gActor = vtk.vtkActor() gActor.SetMapper(gMapper) mapper=vtk.vtkPolyDataMapper() mapper.SetInputData(reader.GetOutput()) #do the decimation mesh = vtk.vtkQuadricDecimation() mesh.SetInputConnection(tf.GetOutputPort()) mesh.SetTargetReduction(reductionF) #mesh.AttributeErrorMetricOn() print "SET REDUCTION SUCCSEFUL" mesh.Update() time2=time0-time.time() #set directory to write. os.chdir("LOCATION") #Setup the out pipes and write it out extract = vtk.vtkExtractPolyDataPiece() extract.SetInputConnection(mesh.GetOutputPort()) pdWriter = vtk.vtkXMLPolyDataWriter() pdWriter.SetFileName(fileout) pdWriter.SetInputConnection(mesh.GetOutputPort()) pdWriter.SetDataModeToAppended() #pdWriter.SetNumberOfPieces(2) #originally 2 pdWriter.Write() mapper = vtk.vtkPolyDataMapper() mapper.SetInputConnection(mesh.GetOutputPort()) os.chdir("script location") -- View this message in context: http://vtk.1045678.n5.nabble.com/Quadric-Decimation-stoping-at-20-tp5741405.html Sent from the VTK - Users mailing list archive at Nabble.com. From leonid.gluhovsky at gmail.com Sat Dec 3 06:40:37 2016 From: leonid.gluhovsky at gmail.com (leonid) Date: Sat, 3 Dec 2016 04:40:37 -0700 (MST) Subject: [vtkusers] depth sorting? render passes? Message-ID: <1480765237095-5741407.post@n5.nabble.com> Hello, I need to render two polydata objects, A and B. Each of them should be opaque, in the sense that their "back walls" should not be seen on the screen. However, even though object A is fully contained within object B, I need object A to be always seen on the screen. I.e., A and B should be opaque except for the fact that A should be visible through the surface of B. How can it be achieved? I read up on vtkRenderPass, but I cannot figure out if I can attach different objects to different render passes. Many thanks. leonid -- View this message in context: http://vtk.1045678.n5.nabble.com/depth-sorting-render-passes-tp5741407.html Sent from the VTK - Users mailing list archive at Nabble.com. From leonid_dulman at yahoo.co.uk Sat Dec 3 07:14:59 2016 From: leonid_dulman at yahoo.co.uk (Leonid Dulman) Date: Sat, 3 Dec 2016 12:14:59 +0000 (UTC) Subject: [vtkusers] VTK 7.1. 0 vtkGuiSupportQtSQLCxxTests References: <1278626484.9374574.1480767299063.ref@mail.yahoo.com> Message-ID: <1278626484.9374574.1480767299063@mail.yahoo.com> HiI tried to execute? vtkGuiSupportQtSQLCxxTests.exe , but have got next message :QT_MODELE_SQL not enebled in this edition, so nothing to test How to solve this problem ? Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Sat Dec 3 08:11:32 2016 From: dave.demarle at kitware.com (David E DeMarle) Date: Sat, 3 Dec 2016 08:11:32 -0500 Subject: [vtkusers] depth sorting? render passes? In-Reply-To: <1480765237095-5741407.post@n5.nabble.com> References: <1480765237095-5741407.post@n5.nabble.com> Message-ID: Instead of render passes try using separate renderers. B goes into the renderer at layer 0. A goes into the renderer at layer 1. Then make sure both renderers's cameras have the same state. On Dec 3, 2016 6:41 AM, "leonid" wrote: > Hello, > > I need to render two polydata objects, A and B. Each of them should be > opaque, in the sense that their "back walls" should not be seen on the > screen. However, even though object A is fully contained within object B, > I > need object A to be always seen on the screen. I.e., A and B should be > opaque except for the fact that A should be visible through the surface of > B. > > How can it be achieved? > > I read up on vtkRenderPass, but I cannot figure out if I can attach > different objects to different render passes. > > Many thanks. > > leonid > > > > -- > View this message in context: http://vtk.1045678.n5.nabble. > com/depth-sorting-render-passes-tp5741407.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From f_magician at mac.com Sat Dec 3 20:57:23 2016 From: f_magician at mac.com (Magician) Date: Sun, 04 Dec 2016 10:57:23 +0900 Subject: [vtkusers] vtk.vtkDistributedDataFilter() not works In-Reply-To: References: <1C21FF27-6B83-4CD1-9577-D72E1B2A0092@mac.com> Message-ID: Hi Cory, Thanks for your advice. Hmmm...I already run the script with MPI. The attached script is a minimal sample. -------------- next part -------------- A non-text attachment was scrubbed... Name: pvpython_dd.py Type: text/x-python-script Size: 717 bytes Desc: not available URL: -------------- next part -------------- If I execute it, pvtu file is exported. But the all piece sources are exactly same, and not partitioned. -------------- next part -------------- A non-text attachment was scrubbed... Name: dd.pvtu Type: application/octet-stream Size: 387 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: dd_0.vtu Type: application/octet-stream Size: 3095 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: dd_1.vtu Type: application/octet-stream Size: 3383 bytes Desc: not available URL: -------------- next part -------------- Magician > On Nov 28, 2016, at 06:19, Cory Quammen wrote: > > I think you need to run your script in parallel with MPI for the > partitioning to work. See [1] for an example of how to use this > filter. > > Hope that helps, > Cory > > [1] http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=Filters/Parallel/Testing/Cxx/DistributedData.cxx > > On Sun, Nov 27, 2016 at 10:39 AM, Magician wrote: >> Does anyone use the vtkDistributedDataFilter? >> >> >> On Nov 19, 2016, at 18:16, Magician wrote: >> >> Hi all, >> >> >> I posted the message about partitioning datasets. >> >> >> I still trying vtk.vtkDistributedDataFilter(), but the exported data aren?t >> partitioned. >> My VTK version is 7.1.0 (pvpython with ParaView 5.2.0 RC3) and executing on >> 2 CPUs. >> >> Here is the sample code: >> >> import vtk >> >> source = vtk.vtkPointSource() >> source.SetCenter((0.0, 0.0, 0.0)) >> source.SetNumberOfPoints(1000000) >> source.SetRadius(1.0) >> source.Update() >> >> d3 = vtk.vtkDistributedDataFilter() >> d3.SetInputData(source.GetOutput()) >> d3.SetBoundaryMode(0) >> d3.Update() >> >> writer = vtk.vtkXMLPUnstructuredGridWriter() >> writer.SetInputData(d3.GetOutput()) >> writer.SetFileName(?test.pvtu?) >> writer.SetNumberOfPieces(2) >> writer.WriteSummaryFileOn() >> writer.SetStartPiece(0) >> writer.SetEndPiece(1) >> writer.Write() >> >> How to partition data? >> >> >> Magician >> >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> > > > > -- > Cory Quammen > Staff R&D Engineer > Kitware, Inc. From bebe0705 at colorado.edu Sun Dec 4 19:33:13 2016 From: bebe0705 at colorado.edu (BBerco) Date: Sun, 4 Dec 2016 17:33:13 -0700 (MST) Subject: [vtkusers] Reverse color in vtkScalarsToColors? Message-ID: <1480897993963-5741412.post@n5.nabble.com> Hi all, I am using a vtkColorBarActor provided with an instance of vtkScalarsToColors obtained from a vtkPolyDataMapper to display a range of scalar values shown on the vtkPolyData connected to the mapper. My problem is that the maximum scalar value (i.e the max in "surface_data" below) corresponds to the blue end of the colorbar, while the minimum scalar value is associated with its red end. I have been looking for a way to reverse this behavior (so as to have the maximum value matched with the red and the minimum with the blue), to no avail. I thought I had found what I was looking for there , but this was unsuccessful as the GetLookupTable method returns an instance of vtkScalarsToColors and not vtkLookUpTable... Any suggestions? Thanks! ps: below is how I construct the colorbar from the input data mapper associated with the polydata the data corresponds to vtkSmartPointer shape_actor = this -> parent -> get_actor_vector()[0]; shape_actor -> GetMapper() -> SetScalarRange(min_magnitude, max_magnitude); shape_actor -> GetMapper() -> GetInput() -> GetCellData() -> SetScalars(surface_data); shape_actor -> GetMapper() -> ScalarVisibilityOn(); shape_actor -> GetMapper() -> SetScalarModeToUseCellData(); vtkSmartPointer scalarBar = vtkSmartPointer::New(); scalarBar -> SetLookupTable(shape_actor -> GetMapper() -> GetLookupTable()); scalarBar -> SetTitle("Orthonormal acceleration magnitude (m/s^2)"); scalarBar -> SetUnconstrainedFontSize (true); scalarBar -> GetTitleTextProperty() -> SetFontSize(10); scalarBar -> GetLabelTextProperty() -> SetFontSize(10); scalarBar -> SetNumberOfLabels(4); this -> parent -> get_renderer() -> AddActor2D(scalarBar); this -> parent -> qvtkWidget -> GetRenderWindow() -> Render(); -- View this message in context: http://vtk.1045678.n5.nabble.com/Reverse-color-in-vtkScalarsToColors-tp5741412.html Sent from the VTK - Users mailing list archive at Nabble.com. From bill.lorensen at gmail.com Sun Dec 4 21:56:02 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Sun, 4 Dec 2016 21:56:02 -0500 Subject: [vtkusers] Reverse color in vtkScalarsToColors? In-Reply-To: <1480897993963-5741412.post@n5.nabble.com> References: <1480897993963-5741412.post@n5.nabble.com> Message-ID: Set the hue range of the lookup table to .667,0 On Dec 4, 2016 7:33 PM, "BBerco" wrote: > Hi all, > > I am using a vtkColorBarActor provided with an instance of > vtkScalarsToColors obtained from a vtkPolyDataMapper to display a range of > scalar values shown on the vtkPolyData connected to the mapper. > > My problem is that the maximum scalar value (i.e the max in "surface_data" > below) corresponds to the blue end of the colorbar, while the minimum > scalar > value is associated with its red end. > > I have been looking for a way to reverse this behavior (so as to have the > maximum value matched with the red and the minimum with the blue), to no > avail. I thought I had found what I was looking for there > ElevationBandsWithGlyphs> > , but this was unsuccessful as the GetLookupTable method returns an > instance > of vtkScalarsToColors and not vtkLookUpTable... > > Any suggestions? > > Thanks! > > ps: below is how I construct the colorbar from the input data mapper > associated with the polydata > the data corresponds to > > > vtkSmartPointer shape_actor = this -> parent -> > get_actor_vector()[0]; > > shape_actor -> GetMapper() -> SetScalarRange(min_magnitude, > max_magnitude); > > shape_actor -> GetMapper() -> GetInput() -> GetCellData() -> > SetScalars(surface_data); > shape_actor -> GetMapper() -> ScalarVisibilityOn(); > shape_actor -> GetMapper() -> SetScalarModeToUseCellData(); > > vtkSmartPointer scalarBar = > vtkSmartPointer::New(); > > scalarBar -> SetLookupTable(shape_actor -> GetMapper() -> > GetLookupTable()); > scalarBar -> SetTitle("Orthonormal acceleration magnitude > (m/s^2)"); > scalarBar -> SetUnconstrainedFontSize (true); > scalarBar -> GetTitleTextProperty() -> SetFontSize(10); > scalarBar -> GetLabelTextProperty() -> SetFontSize(10); > scalarBar -> SetNumberOfLabels(4); > > this -> parent -> get_renderer() -> AddActor2D(scalarBar); > this -> parent -> qvtkWidget -> GetRenderWindow() -> Render(); > > > > -- > View this message in context: http://vtk.1045678.n5.nabble. > com/Reverse-color-in-vtkScalarsToColors-tp5741412.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bebe0705 at colorado.edu Sun Dec 4 23:33:21 2016 From: bebe0705 at colorado.edu (BBerco) Date: Sun, 4 Dec 2016 21:33:21 -0700 (MST) Subject: [vtkusers] Reverse color in vtkScalarsToColors? In-Reply-To: References: <1480897993963-5741412.post@n5.nabble.com> Message-ID: <1480912401660-5741414.post@n5.nabble.com> Bill, the issue is that SetHueRange is a method of vtkLookUpTable and not vtkScalarsToColors. I am getting an instance of the latter with *shape_actor -> GetMapper() ->GetLookupTable()*, which is rather counter-intuitive. -- View this message in context: http://vtk.1045678.n5.nabble.com/Reverse-color-in-vtkScalarsToColors-tp5741412p5741414.html Sent from the VTK - Users mailing list archive at Nabble.com. From mathieu.westphal at kitware.com Mon Dec 5 04:19:08 2016 From: mathieu.westphal at kitware.com (Mathieu Westphal) Date: Mon, 5 Dec 2016 10:19:08 +0100 Subject: [vtkusers] VTK/Paraview Courses in May Message-ID: Hello Kitware will be holding a 2-day VTK and ParaView course on May 14th and 15th 2017 in Lyon, France. Please visit our web site for more information and registration details at VTK (English) : http://www.kitware.fr/browse/144 VTK (French) : http://formations.kitware.fr/browse/144 ParaView (English) : http://training.kitware.fr/browse/145 ParaView (French) : http://formations.kitware.fr/browse/145 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 mjordan at live.at Mon Dec 5 06:25:03 2016 From: mjordan at live.at (M. Jordan) Date: Mon, 5 Dec 2016 11:25:03 +0000 Subject: [vtkusers] How to change the color of a single polydata cell? Message-ID: Hi, i have the cell ID of the closest cell to a specific point. Now I want to change the color of this cell in my polydata. How can I do this? Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Mon Dec 5 09:04:34 2016 From: daviddoria at gmail.com (David Doria) Date: Mon, 5 Dec 2016 08:04:34 -0600 Subject: [vtkusers] How to change the color of a single polydata cell? In-Reply-To: References: Message-ID: > > Hi, > > i have the cell ID of the closest cell to a specific point. Now I want to > change the color of this cell in my polydata. > How can I do this? > > Thank you! > You have to set the color of *all* of the cells, like this: http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ColorCellsWithRGB David -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Mon Dec 5 09:52:39 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Mon, 5 Dec 2016 09:52:39 -0500 Subject: [vtkusers] Reverse color in vtkScalarsToColors? In-Reply-To: <1480912401660-5741414.post@n5.nabble.com> References: <1480897993963-5741412.post@n5.nabble.com> <1480912401660-5741414.post@n5.nabble.com> Message-ID: vtkScalarsToColors is the base class for color maps. Try SafeDownCasting the pointer returned by the mapper to vtkLookupTable. If the returned color map is not an instance of vtkLookupTable, try setting your own lookup table with something like vtkSmartPointer myTable = vtkSmartPointer::New(); myTable->SetHueRange(...); // other lookup table setup here. shape_actor->GetMapper->SetLookupTable(myTable); HTH, Cory On Sun, Dec 4, 2016 at 11:33 PM, BBerco wrote: > Bill, > > the issue is that SetHueRange is a method of vtkLookUpTable and not > vtkScalarsToColors. I am getting an instance of the latter with *shape_actor > -> GetMapper() ->GetLookupTable()*, which is rather counter-intuitive. > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/Reverse-color-in-vtkScalarsToColors-tp5741412p5741414.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 -- Cory Quammen Staff R&D Engineer Kitware, Inc. From bebe0705 at colorado.edu Mon Dec 5 11:13:54 2016 From: bebe0705 at colorado.edu (BBerco) Date: Mon, 5 Dec 2016 09:13:54 -0700 (MST) Subject: [vtkusers] Reverse color in vtkScalarsToColors? In-Reply-To: References: <1480897993963-5741412.post@n5.nabble.com> <1480912401660-5741414.post@n5.nabble.com> Message-ID: <1480954434047-5741422.post@n5.nabble.com> The SafeDownCast worked, thanks! -- View this message in context: http://vtk.1045678.n5.nabble.com/Reverse-color-in-vtkScalarsToColors-tp5741412p5741422.html Sent from the VTK - Users mailing list archive at Nabble.com. From cory.quammen at kitware.com Mon Dec 5 11:33:20 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Mon, 5 Dec 2016 11:33:20 -0500 Subject: [vtkusers] vtk.vtkDistributedDataFilter() not works In-Reply-To: References: <1C21FF27-6B83-4CD1-9577-D72E1B2A0092@mac.com> Message-ID: I'm not 100% sure of this, but the vtkPointSource produces an output with only 1 cell. That may not be partitionable by the vtkDistributeDataFilter. You shouldn't get duplicate output in each piece, but let's not worry about that for now. Try swapping out the vtkPointSource with a vtkSphereSource and see if the data is partitioned. HTH, Cory On Sat, Dec 3, 2016 at 8:57 PM, Magician wrote: > Hi Cory, > > > Thanks for your advice. > > Hmmm...I already run the script with MPI. > The attached script is a minimal sample. > > > If I execute it, pvtu file is exported. > But the all piece sources are exactly same, and not partitioned. > > > > Magician > > >> On Nov 28, 2016, at 06:19, Cory Quammen wrote: >> >> I think you need to run your script in parallel with MPI for the >> partitioning to work. See [1] for an example of how to use this >> filter. >> >> Hope that helps, >> Cory >> >> [1] http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=Filters/Parallel/Testing/Cxx/DistributedData.cxx >> >> On Sun, Nov 27, 2016 at 10:39 AM, Magician wrote: >>> Does anyone use the vtkDistributedDataFilter? >>> >>> >>> On Nov 19, 2016, at 18:16, Magician wrote: >>> >>> Hi all, >>> >>> >>> I posted the message about partitioning datasets. >>> >>> >>> I still trying vtk.vtkDistributedDataFilter(), but the exported data aren?t >>> partitioned. >>> My VTK version is 7.1.0 (pvpython with ParaView 5.2.0 RC3) and executing on >>> 2 CPUs. >>> >>> Here is the sample code: >>> >>> import vtk >>> >>> source = vtk.vtkPointSource() >>> source.SetCenter((0.0, 0.0, 0.0)) >>> source.SetNumberOfPoints(1000000) >>> source.SetRadius(1.0) >>> source.Update() >>> >>> d3 = vtk.vtkDistributedDataFilter() >>> d3.SetInputData(source.GetOutput()) >>> d3.SetBoundaryMode(0) >>> d3.Update() >>> >>> writer = vtk.vtkXMLPUnstructuredGridWriter() >>> writer.SetInputData(d3.GetOutput()) >>> writer.SetFileName(?test.pvtu?) >>> writer.SetNumberOfPieces(2) >>> writer.WriteSummaryFileOn() >>> writer.SetStartPiece(0) >>> writer.SetEndPiece(1) >>> writer.Write() >>> >>> How to partition data? >>> >>> >>> Magician >>> >>> >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/vtkusers >>> >> >> >> >> -- >> Cory Quammen >> Staff R&D Engineer >> Kitware, Inc. > > -- Cory Quammen Staff R&D Engineer Kitware, Inc. From jwpeterson at gmail.com Mon Dec 5 12:50:51 2016 From: jwpeterson at gmail.com (John Peterson) Date: Mon, 5 Dec 2016 10:50:51 -0700 Subject: [vtkusers] Different behavior of vtkXMLPUnstructuredGridWriter in VTK 7.1 Message-ID: Hi, It appears that the behavior of the vtkXMLPUnstructuredGridWriter has changed in VTK 7.1. Can anyone comment on this? I am using the 7.1.0 tarball downloaded from: http://www.vtk.org/files/release/7.1/VTK-7.1.0.tar.gz We have a test case in the MOOSE library ( https://github.com/idaholab/moose/tree/devel/test/tests/outputs/vtk) which demonstrates the problem, but I can also work on creating a standalone test code which demonstrates this issue if necessary. In versions of VTK prior to 7.1 this test, which runs on two processors, writes the following .pvtu file: (note the two "Piece Source" lines corresponding to each processor's part): While in version 7.1, the same test now writes (note the single "Piece Source" line) The file opens fine in Paraview, but the part of the mesh corresponding to processor 1 is missing. We haven't changed anything substantial in our application code that calls the writer. Thanks, John -------------- next part -------------- An HTML attachment was scrubbed... URL: From fboli94 at gmail.com Mon Dec 5 13:15:47 2016 From: fboli94 at gmail.com (fblupi) Date: Mon, 5 Dec 2016 11:15:47 -0700 (MST) Subject: [vtkusers] Pick all voxels through the pick ray Message-ID: <1480961747198-5741426.post@n5.nabble.com> Hi, I'm trying to get all the voxels that the pick ray find in the volume I have in the window. By now I just get the first one by using these lines: --- vtkSmartPointer picker = vtkSmartPointer::New(); picker->SetUseVolumeGradientOpacity(true); picker->SetVolumeOpacityIsovalue(0.1); int* pos = this->GetInteractor()->GetEventPosition(); picker->Pick(pos[0], pos[1], pos[2], this->GetDefaultRenderer()); int* ijk = picker->GetPointIJK(); --- I would like to obtain the ijk positions of all the voxels the ray cross, not only the first. Can someone help me? Thanks in advice. -- View this message in context: http://vtk.1045678.n5.nabble.com/Pick-all-voxels-through-the-pick-ray-tp5741426.html Sent from the VTK - Users mailing list archive at Nabble.com. From andy.bauer at kitware.com Mon Dec 5 13:32:48 2016 From: andy.bauer at kitware.com (Andy Bauer) Date: Mon, 5 Dec 2016 13:32:48 -0500 Subject: [vtkusers] Different behavior of vtkXMLPUnstructuredGridWriter in VTK 7.1 In-Reply-To: References: Message-ID: Hi, Can you verify that there are indeed points in vtk_diff_serial_mesh_parallel_out_005_1.vtu in the older version of VTK? The PXML writers were changed such that they wouldn't write out data files for data set pieces that didn't have any points. Cheers, Andy On Mon, Dec 5, 2016 at 12:50 PM, John Peterson wrote: > Hi, > > It appears that the behavior of the vtkXMLPUnstructuredGridWriter has > changed in VTK 7.1. Can anyone comment on this? I am using the 7.1.0 > tarball downloaded from: > > http://www.vtk.org/files/release/7.1/VTK-7.1.0.tar.gz > > We have a test case in the MOOSE library (https://github.com/idaholab/ > moose/tree/devel/test/tests/outputs/vtk) which demonstrates the problem, > but I can also work on creating a standalone test code which demonstrates > this issue if necessary. > > In versions of VTK prior to 7.1 this test, which runs on two processors, > writes the following .pvtu file: (note the two "Piece Source" lines > corresponding to each processor's part): > > > header_type="UInt32" compressor="vtkZLibDataCompressor"> > > > > > > > > > > > > > > > > > > > > While in version 7.1, the same test now writes (note the single "Piece > Source" line) > > > header_type="UInt32" compressor="vtkZLibDataCompressor"> > > > > > > > > > > > > > > > > > > > The file opens fine in Paraview, but the part of the mesh corresponding to > processor 1 is missing. We haven't changed anything substantial in our > application code that calls the writer. > > Thanks, > John > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jwpeterson at gmail.com Mon Dec 5 14:02:23 2016 From: jwpeterson at gmail.com (John Peterson) Date: Mon, 5 Dec 2016 12:02:23 -0700 Subject: [vtkusers] Different behavior of vtkXMLPUnstructuredGridWriter in VTK 7.1 In-Reply-To: References: Message-ID: On Mon, Dec 5, 2016 at 11:32 AM, Andy Bauer wrote: > Hi, > > Can you verify that there are indeed points in > vtk_diff_serial_mesh_parallel_out_005_1.vtu in the older version of VTK? > The PXML writers were changed such that they wouldn't write out data files > for data set pieces that didn't have any points. > Yes, there are points in both files. It's a 2x2 mesh of Quad4 elements split into two halves. Here are the contents of the file you mentioned. 0 0 0 0 0 0 1.0000000002 1.0000000002 1.0000000002 0.074429857677 0.074429857773 0.074429857977 1 3 0 0 1 1 1 0 0 1 0.5 0 1 1 0 0.5 0 0 0.5 0.5 0 0.5 1 0 3 0 1 4 4 1 2 5 4 8 9 9 -- John -------------- next part -------------- An HTML attachment was scrubbed... URL: From dhoppes at mbfbioscience.com Mon Dec 5 13:56:23 2016 From: dhoppes at mbfbioscience.com (Doug Hoppes) Date: Mon, 5 Dec 2016 18:56:23 +0000 Subject: [vtkusers] Scalar to opacity mapping for vtkImageProperty Message-ID: <46CB11F12B9DC24D860D4082451B318A36CF9CFA@exchange3.microbrightfield.com> Hey All, In the vtkVolumeProperty, there are methods to set the scalar opacity. Is there an equivalent method for the vtkImageProperty? In my case, I have a vtkvolume that I use the resliced mapper to get individual slices. The user loves the ability to set the opacities in the volume individually (we do this using the setScalarOpacity) and would like to do this for the slices. However, I don't see that the vtkImageProperty has a function to do this.... Or I'm missing something. Dougie -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Mon Dec 5 14:18:35 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 5 Dec 2016 12:18:35 -0700 Subject: [vtkusers] Scalar to opacity mapping for vtkImageProperty In-Reply-To: <46CB11F12B9DC24D860D4082451B318A36CF9CFA@exchange3.microbrightfield.com> References: <46CB11F12B9DC24D860D4082451B318A36CF9CFA@exchange3.microbrightfield.com> Message-ID: Hi Doug, The opacity is the fourth column of the lookup table (i.e. the lookup table is RGBA). So you can use the lookup table to set the opacities. - David On Mon, Dec 5, 2016 at 11:56 AM, Doug Hoppes wrote: > Hey All, > > > > In the vtkVolumeProperty, there are methods to set the > scalar opacity. Is there an equivalent method for the vtkImageProperty? > In my case, I have a vtkvolume that I use the resliced mapper to get > individual slices. The user loves the ability to set the opacities in the > volume individually (we do this using the setScalarOpacity) and would like > to do this for the slices. However, I don?t see that the vtkImageProperty > has a function to do this?. Or I?m missing something. > > > > Dougie > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy.bauer at kitware.com Mon Dec 5 14:45:49 2016 From: andy.bauer at kitware.com (Andy Bauer) Date: Mon, 5 Dec 2016 14:45:49 -0500 Subject: [vtkusers] Different behavior of vtkXMLPUnstructuredGridWriter in VTK 7.1 In-Reply-To: References: Message-ID: Beyond this I can't think of any change off the top of my head that would cause your issue. I looked at the repo but can't figure out the VTK configurations from that. If you can share a simple test case which demonstrates the issue I may be able to easily diagnose it. Thanks, Andy On Mon, Dec 5, 2016 at 2:02 PM, John Peterson wrote: > > > On Mon, Dec 5, 2016 at 11:32 AM, Andy Bauer > wrote: > >> Hi, >> >> Can you verify that there are indeed points in >> vtk_diff_serial_mesh_parallel_out_005_1.vtu in the older version of VTK? >> The PXML writers were changed such that they wouldn't write out data files >> for data set pieces that didn't have any points. >> > > Yes, there are points in both files. It's a 2x2 mesh of Quad4 elements > split into two halves. Here are the contents of the file you mentioned. > > > header_type="UInt32" compressor="vtkZLibDataCompressor"> > > > > RangeMax="0"> > 0 0 0 0 0 0 > > RangeMin="0.074429857677" RangeMax="1.0000000002"> > 1.0000000002 1.0000000002 1.0000000002 0.074429857677 > 0.074429857773 0.074429857977 > > > > RangeMin="1" RangeMax="3"> > 1 3 > > RangeMin="0" RangeMax="0"> > 0 0 > > RangeMin="1" RangeMax="1"> > 1 1 > > > > format="ascii" RangeMin="0.5" RangeMax="1.4142135624"> > 1 0 0 1 0.5 0 > 1 1 0 0.5 0 0 > 0.5 0.5 0 0.5 1 0 > > > > RangeMin="0" RangeMax="5"> > 3 0 1 4 4 1 > 2 5 > > RangeMax="8"> > 4 8 > > RangeMax="9"> > 9 9 > > > > > > > > -- > John > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jwpeterson at gmail.com Mon Dec 5 18:06:11 2016 From: jwpeterson at gmail.com (John Peterson) Date: Mon, 5 Dec 2016 16:06:11 -0700 Subject: [vtkusers] Different behavior of vtkXMLPUnstructuredGridWriter in VTK 7.1 In-Reply-To: References: Message-ID: On Mon, Dec 5, 2016 at 12:45 PM, Andy Bauer wrote: > Beyond this I can't think of any change off the top of my head that would > cause your issue. I looked at the repo but can't figure out the VTK > configurations from that. If you can share a simple test case which > demonstrates the issue I may be able to easily diagnose it. > Here's a standalone test code that reproduces the issue for me: https://gist.github.com/jwpeterson/92f4b8422d6fbb1056e848c9b14ee1d7 Run on two procs with: mpiexec -np 2 and I get the following test.pvtu file: > header_type="UInt32" compressor="vtkZLibDataCompressor"> > > > > > > > > > > > > > > > As you can see, only one "Piece Source" is listed, but the output of the program is actually all 3 files (test.pvtu, test_0.vtu, test_1.vtu) and both the _0 and _1 files have nodes in them. Furthermore, if I simply add a second "Piece Source" line corresponding to "test_1.vtu", the whole thing opens up just fine in Paraview. I am a novice VTK programmer so it's very possible I'm doing something wrong, but this code definitely worked in VTK 6.x, and 7.0. Thanks for your help, John -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjordan at live.at Tue Dec 6 04:47:49 2016 From: mjordan at live.at (M. Jordan) Date: Tue, 6 Dec 2016 09:47:49 +0000 Subject: [vtkusers] Project Nifti/Analyse Image onto PolyData Surface Message-ID: Hi, i have a Nifti/Analyse Image which contains voxels whose brightness depends on fMRI activation (t-map). Now I would like to map/project this image onto the surface of the cortex (polydata) to see activation areas surface based. I found the "vtkProbeFilter" but I don't know if this is the right way to do this. Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrea.gavana at gmail.com Tue Dec 6 10:35:16 2016 From: andrea.gavana at gmail.com (Andrea Gavana) Date: Tue, 6 Dec 2016 16:35:16 +0100 Subject: [vtkusers] vtkArrowSource and vtkGlyph3D In-Reply-To: References: Message-ID: Hi Ken & All, thank you for your suggestions, vtkGlyph3DMapper worked beautifully in the end. I have only a couple of issues (which may or may not related to the VTK version I am using and the fact that I am using VTK through the Python bindings): 1. If I zoom in and out (with the mouse) in the render window I can see visual glitches for the spheres I am using (that's another vtkGlyph3DMapper, unrelated to the arrow ones) - see attached screenshot 2. If I do the following: >>> import vtk >>> vtk.vtkVersion().GetVTKVersion() '7.0.0' >>> g = vtk.vtkGlyph3DMapper() >>> g.SetOrientationModeToRotation() >>> g.GetOrientationModeAsString() 'Invalid' >>> g.SetOrientationMode(vtk.vtkGlyph3DMapper.ORIENTATION) >>> g.GetOrientationModeAsString() 'Invalid' >>> g.SetOrientationModeToDirection() >>> g.GetOrientationModeAsString() 'Direction' Notice the "Invalid" string printed out when I try to set the orientation mode to "ORIENTATION". Not a big deal, I can use the DIRECTION thing as well, I just wanted to let you know... Andrea. On 2 December 2016 at 16:52, Ken Martin wrote: > It can color/scale/orient/mask on a per glyph basis. It can even index > into multiple glyph models on a per point basis. So you should be good. > Just takes a while to wade through all the options as there is a lot in > there. > > Thanks > Ken > > On Fri, Dec 2, 2016 at 10:45 AM, Andrea Gavana > wrote: > >> Hi Ken, >> >> Thank you very much for your answer. I hadn't understood that vtkGlyph3D >> would create all the arrows in memory. >> >> However, it may still be the only choice I have as I would like to be >> able to assign a different color (based on a scalar) to each arrow, and >> some arrows should point downward while others upwards. The size of the >> arrow will stay constant but the color I would like to be able to change it >> on an arrow-by arrow basis, and I don't know if this can be done using >> vtkGlyph3DMapper... >> >> Of course, I would be more than happy to be proven wrong ?. >> >> Thank you again. >> >> Andrea. >> >> On Fri, 2 Dec 2016 at 16:30, Ken Martin wrote: >> >>> Be aware Glyph3D is a filter and will actually generate all those arrows >>> in memory. Glyph3DMapper is a mapper and uses OpenGL tricks to render the >>> same arrow lots of times. >>> >>> Both classes place a glyph at the location of each input point. The >>> orientation is controlled by a different array in your point data ala the >>> comments below: >>> >>> Thanks >>> Ken >>> >>> //@{ >>> /** >>> * Turn on/off orienting of input geometry. >>> * When turned on, the orientation array specified >>> * using SetOrientationArray() will be used. >>> */ >>> vtkSetMacro(Orient, bool); >>> vtkGetMacro(Orient, bool); >>> vtkBooleanMacro(Orient, bool); >>> //@} >>> >>> //@{ >>> /** >>> * Orientation mode indicates if the OrientationArray provides the >>> direction >>> * vector for the orientation or the rotations around each axes. >>> Default is >>> * DIRECTION >>> */ >>> vtkSetClampMacro(OrientationMode, int, DIRECTION, ROTATION); >>> vtkGetMacro(OrientationMode, int); >>> void SetOrientationModeToDirection() >>> { this->SetOrientationMode(vtkGlyph3DMapper::DIRECTION); } >>> void SetOrientationModeToRotation() >>> { this->SetOrientationMode(vtkGlyph3DMapper::ROTATION); } >>> const char* GetOrientationModeAsString(); >>> //@} >>> >>> enum OrientationModes >>> { >>> DIRECTION=0, >>> ROTATION=1 >>> }; >>> >>> >>> /** >>> * Tells the mapper to use an orientation array if Orient is true. >>> * An orientation array is a vtkDataArray with 3 components. The first >>> * component is the angle of rotation along the X axis. The second >>> * component is the angle of rotation along the Y axis. The third >>> * component is the angle of rotation along the Z axis. Orientation is >>> * specified in X,Y,Z order but the rotations are performed in Z,X an >>> Y. >>> * This definition is compliant with SetOrientation method on >>> vtkProp3D. >>> * By using vector or normal there is a degree of freedom or rotation >>> * left (underconstrained). With the orientation array, there is no >>> degree of >>> * freedom left. >>> * This is convenience method. The same effect can be achieved by using >>> * SetInputArrayToProcess(vtkGlyph3DMapper::ORIENTATION, 0, 0, >>> * vtkDataObject::FIELD_ASSOCIATION_POINTS, orientationarrayname); >>> */ >>> void SetOrientationArray(const char* orientationarrayname); >>> >>> >>> On Fri, Dec 2, 2016 at 10:18 AM, Andrea Gavana >>> wrote: >>> >>> Dear All, >>> >>> I am trying to combine a vtkArrowSource and vtkGlyph3D. I have been >>> (naively) thinking that by specifying a polydata with two points (start and >>> end) and assigning its points to the vtkGlyph3D I would obtain an arrow >>> that starts at the start point and end at the end point. >>> >>> I have created a small, self-contained following Python script to >>> demonstrate what I mean - I get 4 arrows, one at each point I define, >>> instead of two arrows. What am I missing? Any suggestion is more than >>> welcome. >>> >>> Thank you in advance. >>> >>> Andrea. >>> >>> >>> import vtk >>> import numpy >>> >>> # First set of points - first arrow >>> points1 = numpy.array([[ 11271.915, 7538.686, 6245.661], >>> [ 11271.915, 7538.686, 5897.034]]) >>> >>> # Second set of points - second arrow >>> points2 = numpy.array([[ 10532.274, 9101.572, 6313.167], >>> [ 10532.274, 9101.572, 5964.539]]) >>> >>> # Create an arrow source with some attributes >>> arrow_source = vtk.vtkArrowSource() >>> arrow_source.SetTipRadius(0.2) >>> arrow_source.SetShaftRadius(0.075) >>> >>> # Create the vtkGlyph3D >>> arrow_glyph = vtk.vtkGlyph3D() >>> arrow_glyph.SetScaleModeToDataScalingOff() >>> >>> # Usual mapper >>> arrow_mapper = vtk.vtkPolyDataMapper() >>> arrow_mapper.SetInputConnection(arrow_glyph.GetOutputPort()) >>> >>> # Usual actor >>> arrow_actor = vtk.vtkActor() >>> arrow_actor.SetMapper(arrow_mapper) >>> >>> append_poly_data = vtk.vtkAppendPolyData() >>> >>> # Loop through points1 and points2 >>> for p in [points1, points2]: >>> >>> arrow_poly_data = vtk.vtkPolyData() >>> vtk_arrow_lines = vtk.vtkCellArray() >>> >>> vtk_arrow_lines.InsertNextCell(2) >>> vtk_arrow_lines.InsertCellPoint(0) >>> vtk_arrow_lines.InsertCellPoint(1) >>> >>> vtk_arrow_points = vtk.vtkPoints() >>> # Loop through the head and tail of a single arrow >>> for j in xrange(2): >>> vtk_arrow_points.InsertNextPoint(p[j]) >>> >>> arrow_poly_data.SetPoints(vtk_arrow_points) >>> arrow_poly_data.SetLines(vtk_arrow_lines) >>> append_poly_data.AddInputData(arrow_poly_data) >>> >>> >>> arrow_glyph.SetInputConnection(append_poly_data.GetOutputPort()) >>> arrow_glyph.SetSourceConnection(arrow_source.GetOutputPort()) >>> arrow_glyph.SetScaleFactor(100) >>> arrow_actor.GetProperty().SetColor(1, 1, 1) >>> >>> # ------------------------------------------------------------ >>> # Create the RenderWindow, Renderer and both Actors >>> # ------------------------------------------------------------ >>> ren = vtk.vtkRenderer() >>> renWin = vtk.vtkRenderWindow() >>> renWin.AddRenderer(ren) >>> iren = vtk.vtkRenderWindowInteractor() >>> iren.SetRenderWindow(renWin) >>> >>> # add actors >>> ren.AddActor(arrow_actor) >>> ren.ResetCamera() >>> iren.Start() >>> >>> >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/vtkusers >>> >>> >>> >>> >>> -- >>> Ken Martin PhD >>> Chairman & CFO >>> Kitware Inc. >>> 28 Corporate Drive >>> Clifton Park NY 12065 >>> 518 371 3971 >>> >>> This communication, including all attachments, contains confidential and >>> legally privileged information, and it is intended only for the use of the >>> addressee. Access to this email by anyone else is unauthorized. If you are >>> not the intended recipient, any disclosure, copying, distribution or any >>> action taken in reliance on it is prohibited and may be unlawful. If you >>> received this communication in error please notify us immediately and >>> destroy the original message. Thank you. >>> >> > > > -- > Ken Martin PhD > Chairman & CFO > Kitware Inc. > 28 Corporate Drive > Clifton Park NY 12065 > 518 371 3971 > > This communication, including all attachments, contains confidential and > legally privileged information, and it is intended only for the use of the > addressee. Access to this email by anyone else is unauthorized. If you are > not the intended recipient, any disclosure, copying, distribution or any > action taken in reliance on it is prohibited and may be unlawful. If you > received this communication in error please notify us immediately and > destroy the original message. Thank you. > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: vtk_glitches.png Type: image/png Size: 75797 bytes Desc: not available URL: From ken.martin at kitware.com Tue Dec 6 10:53:28 2016 From: ken.martin at kitware.com (Ken Martin) Date: Tue, 6 Dec 2016 10:53:28 -0500 Subject: [vtkusers] vtkArrowSource and vtkGlyph3D In-Reply-To: References: Message-ID: Well we did fix a few bounding box issues in the Glyph3dMapper about a month ago. But, your artifacts don't look like what I would expect from those issues. If it only happens when you zoom in a lot, that is often a zbuffer/clipping range issue. Where the near clipping distance is too small causing farther objects to not have enough zbuffer resolution, but that is just a guess. On Tue, Dec 6, 2016 at 10:35 AM, Andrea Gavana wrote: > Hi Ken & All, > > thank you for your suggestions, vtkGlyph3DMapper worked beautifully in > the end. I have only a couple of issues (which may or may not related to > the VTK version I am using and the fact that I am using VTK through the > Python bindings): > > 1. If I zoom in and out (with the mouse) in the render window I can see > visual glitches for the spheres I am using (that's another > vtkGlyph3DMapper, unrelated to the arrow ones) - see attached screenshot > > 2. If I do the following: > > >>> import vtk > >>> vtk.vtkVersion().GetVTKVersion() > '7.0.0' > >>> g = vtk.vtkGlyph3DMapper() > >>> g.SetOrientationModeToRotation() > >>> g.GetOrientationModeAsString() > 'Invalid' > >>> g.SetOrientationMode(vtk.vtkGlyph3DMapper.ORIENTATION) > >>> g.GetOrientationModeAsString() > 'Invalid' > >>> g.SetOrientationModeToDirection() > >>> g.GetOrientationModeAsString() > 'Direction' > > > Notice the "Invalid" string printed out when I try to set the orientation > mode to "ORIENTATION". > > Not a big deal, I can use the DIRECTION thing as well, I just wanted to > let you know... > > Andrea. > > > > On 2 December 2016 at 16:52, Ken Martin wrote: > >> It can color/scale/orient/mask on a per glyph basis. It can even index >> into multiple glyph models on a per point basis. So you should be good. >> Just takes a while to wade through all the options as there is a lot in >> there. >> >> Thanks >> Ken >> >> On Fri, Dec 2, 2016 at 10:45 AM, Andrea Gavana >> wrote: >> >>> Hi Ken, >>> >>> Thank you very much for your answer. I hadn't understood that vtkGlyph3D >>> would create all the arrows in memory. >>> >>> However, it may still be the only choice I have as I would like to be >>> able to assign a different color (based on a scalar) to each arrow, and >>> some arrows should point downward while others upwards. The size of the >>> arrow will stay constant but the color I would like to be able to change it >>> on an arrow-by arrow basis, and I don't know if this can be done using >>> vtkGlyph3DMapper... >>> >>> Of course, I would be more than happy to be proven wrong ?. >>> >>> Thank you again. >>> >>> Andrea. >>> >>> On Fri, 2 Dec 2016 at 16:30, Ken Martin wrote: >>> >>>> Be aware Glyph3D is a filter and will actually generate all those >>>> arrows in memory. Glyph3DMapper is a mapper and uses OpenGL tricks to >>>> render the same arrow lots of times. >>>> >>>> Both classes place a glyph at the location of each input point. The >>>> orientation is controlled by a different array in your point data ala the >>>> comments below: >>>> >>>> Thanks >>>> Ken >>>> >>>> //@{ >>>> /** >>>> * Turn on/off orienting of input geometry. >>>> * When turned on, the orientation array specified >>>> * using SetOrientationArray() will be used. >>>> */ >>>> vtkSetMacro(Orient, bool); >>>> vtkGetMacro(Orient, bool); >>>> vtkBooleanMacro(Orient, bool); >>>> //@} >>>> >>>> //@{ >>>> /** >>>> * Orientation mode indicates if the OrientationArray provides the >>>> direction >>>> * vector for the orientation or the rotations around each axes. >>>> Default is >>>> * DIRECTION >>>> */ >>>> vtkSetClampMacro(OrientationMode, int, DIRECTION, ROTATION); >>>> vtkGetMacro(OrientationMode, int); >>>> void SetOrientationModeToDirection() >>>> { this->SetOrientationMode(vtkGlyph3DMapper::DIRECTION); } >>>> void SetOrientationModeToRotation() >>>> { this->SetOrientationMode(vtkGlyph3DMapper::ROTATION); } >>>> const char* GetOrientationModeAsString(); >>>> //@} >>>> >>>> enum OrientationModes >>>> { >>>> DIRECTION=0, >>>> ROTATION=1 >>>> }; >>>> >>>> >>>> /** >>>> * Tells the mapper to use an orientation array if Orient is true. >>>> * An orientation array is a vtkDataArray with 3 components. The first >>>> * component is the angle of rotation along the X axis. The second >>>> * component is the angle of rotation along the Y axis. The third >>>> * component is the angle of rotation along the Z axis. Orientation is >>>> * specified in X,Y,Z order but the rotations are performed in Z,X an >>>> Y. >>>> * This definition is compliant with SetOrientation method on >>>> vtkProp3D. >>>> * By using vector or normal there is a degree of freedom or rotation >>>> * left (underconstrained). With the orientation array, there is no >>>> degree of >>>> * freedom left. >>>> * This is convenience method. The same effect can be achieved by >>>> using >>>> * SetInputArrayToProcess(vtkGlyph3DMapper::ORIENTATION, 0, 0, >>>> * vtkDataObject::FIELD_ASSOCIATION_POINTS, orientationarrayname); >>>> */ >>>> void SetOrientationArray(const char* orientationarrayname); >>>> >>>> >>>> On Fri, Dec 2, 2016 at 10:18 AM, Andrea Gavana >>> > wrote: >>>> >>>> Dear All, >>>> >>>> I am trying to combine a vtkArrowSource and vtkGlyph3D. I have been >>>> (naively) thinking that by specifying a polydata with two points (start and >>>> end) and assigning its points to the vtkGlyph3D I would obtain an arrow >>>> that starts at the start point and end at the end point. >>>> >>>> I have created a small, self-contained following Python script to >>>> demonstrate what I mean - I get 4 arrows, one at each point I define, >>>> instead of two arrows. What am I missing? Any suggestion is more than >>>> welcome. >>>> >>>> Thank you in advance. >>>> >>>> Andrea. >>>> >>>> >>>> import vtk >>>> import numpy >>>> >>>> # First set of points - first arrow >>>> points1 = numpy.array([[ 11271.915, 7538.686, 6245.661], >>>> [ 11271.915, 7538.686, 5897.034]]) >>>> >>>> # Second set of points - second arrow >>>> points2 = numpy.array([[ 10532.274, 9101.572, 6313.167], >>>> [ 10532.274, 9101.572, 5964.539]]) >>>> >>>> # Create an arrow source with some attributes >>>> arrow_source = vtk.vtkArrowSource() >>>> arrow_source.SetTipRadius(0.2) >>>> arrow_source.SetShaftRadius(0.075) >>>> >>>> # Create the vtkGlyph3D >>>> arrow_glyph = vtk.vtkGlyph3D() >>>> arrow_glyph.SetScaleModeToDataScalingOff() >>>> >>>> # Usual mapper >>>> arrow_mapper = vtk.vtkPolyDataMapper() >>>> arrow_mapper.SetInputConnection(arrow_glyph.GetOutputPort()) >>>> >>>> # Usual actor >>>> arrow_actor = vtk.vtkActor() >>>> arrow_actor.SetMapper(arrow_mapper) >>>> >>>> append_poly_data = vtk.vtkAppendPolyData() >>>> >>>> # Loop through points1 and points2 >>>> for p in [points1, points2]: >>>> >>>> arrow_poly_data = vtk.vtkPolyData() >>>> vtk_arrow_lines = vtk.vtkCellArray() >>>> >>>> vtk_arrow_lines.InsertNextCell(2) >>>> vtk_arrow_lines.InsertCellPoint(0) >>>> vtk_arrow_lines.InsertCellPoint(1) >>>> >>>> vtk_arrow_points = vtk.vtkPoints() >>>> # Loop through the head and tail of a single arrow >>>> for j in xrange(2): >>>> vtk_arrow_points.InsertNextPoint(p[j]) >>>> >>>> arrow_poly_data.SetPoints(vtk_arrow_points) >>>> arrow_poly_data.SetLines(vtk_arrow_lines) >>>> append_poly_data.AddInputData(arrow_poly_data) >>>> >>>> >>>> arrow_glyph.SetInputConnection(append_poly_data.GetOutputPort()) >>>> arrow_glyph.SetSourceConnection(arrow_source.GetOutputPort()) >>>> arrow_glyph.SetScaleFactor(100) >>>> arrow_actor.GetProperty().SetColor(1, 1, 1) >>>> >>>> # ------------------------------------------------------------ >>>> # Create the RenderWindow, Renderer and both Actors >>>> # ------------------------------------------------------------ >>>> ren = vtk.vtkRenderer() >>>> renWin = vtk.vtkRenderWindow() >>>> renWin.AddRenderer(ren) >>>> iren = vtk.vtkRenderWindowInteractor() >>>> iren.SetRenderWindow(renWin) >>>> >>>> # add actors >>>> ren.AddActor(arrow_actor) >>>> ren.ResetCamera() >>>> iren.Start() >>>> >>>> >>>> >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ at: >>>> http://www.vtk.org/Wiki/VTK_FAQ >>>> >>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://public.kitware.com/mailman/listinfo/vtkusers >>>> >>>> >>>> >>>> >>>> -- >>>> Ken Martin PhD >>>> Chairman & CFO >>>> Kitware Inc. >>>> 28 Corporate Drive >>>> Clifton Park NY 12065 >>>> 518 371 3971 >>>> >>>> This communication, including all attachments, contains confidential >>>> and legally privileged information, and it is intended only for the use of >>>> the addressee. Access to this email by anyone else is unauthorized. If you >>>> are not the intended recipient, any disclosure, copying, distribution or >>>> any action taken in reliance on it is prohibited and may be unlawful. If >>>> you received this communication in error please notify us immediately and >>>> destroy the original message. Thank you. >>>> >>> >> >> >> -- >> Ken Martin PhD >> Chairman & CFO >> Kitware Inc. >> 28 Corporate Drive >> Clifton Park NY 12065 >> 518 371 3971 >> >> This communication, including all attachments, contains confidential and >> legally privileged information, and it is intended only for the use of the >> addressee. Access to this email by anyone else is unauthorized. If you are >> not the intended recipient, any disclosure, copying, distribution or any >> action taken in reliance on it is prohibited and may be unlawful. If you >> received this communication in error please notify us immediately and >> destroy the original message. Thank you. >> > > -- Ken Martin PhD Chairman & CFO Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 518 371 3971 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 andy.bauer at kitware.com Tue Dec 6 11:12:39 2016 From: andy.bauer at kitware.com (Andy Bauer) Date: Tue, 6 Dec 2016 11:12:39 -0500 Subject: [vtkusers] Different behavior of vtkXMLPUnstructuredGridWriter in VTK 7.1 In-Reply-To: References: Message-ID: Hi John, The issue is indeed due to changes that I mentioned before (i.e. only data sets that have data get written out and the .pvtu file is adjusted accordingly). With this change though interprocess communication is required which is done the the vtkMultiProcessController::GetGlobalController() object which essentially acts as MPI_COMM_WORLD within VTK. You need to create a vtkMPIController which derives from vtkMultiProcessController. See the attached files for how that is done. This should also be backwards compatible but if it isn't, please let us know. Best, Andy ps. Ignore the ADIOS stuff in there (it's commented out). I was trying to do two things at once and that's why the ADIOS stuff is in the CMakeLists.txt. On Mon, Dec 5, 2016 at 6:06 PM, John Peterson wrote: > > > On Mon, Dec 5, 2016 at 12:45 PM, Andy Bauer > wrote: > >> Beyond this I can't think of any change off the top of my head that would >> cause your issue. I looked at the repo but can't figure out the VTK >> configurations from that. If you can share a simple test case which >> demonstrates the issue I may be able to easily diagnose it. >> > > Here's a standalone test code that reproduces the issue for me: > > https://gist.github.com/jwpeterson/92f4b8422d6fbb1056e848c9b14ee1d7 > > Run on two procs with: mpiexec -np 2 and I get the following test.pvtu > file: > > >> > header_type="UInt32" compressor="vtkZLibDataCompressor"> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> > > > > As you can see, only one "Piece Source" is listed, but the output of the > program is actually all 3 files (test.pvtu, test_0.vtu, test_1.vtu) and > both the _0 and _1 files have nodes in them. Furthermore, if I simply add > a second "Piece Source" line corresponding to "test_1.vtu", the whole thing > opens up just fine in Paraview. I am a novice VTK programmer so it's very > possible I'm doing something wrong, but this code definitely worked in VTK > 6.x, and 7.0. > > Thanks for your help, > John > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- cmake_minimum_required(VERSION 2.8) PROJECT(TestPXMLWriter) find_package(VTK REQUIRED) include(${VTK_USE_FILE}) find_package(MPI REQUIRED) include_directories(SYSTEM ${MPI_C_INCLUDE_PATH}) add_executable(TestWriter MACOSX_BUNDLE vtk_test.C) if(VTK_LIBRARIES) target_link_libraries(TestWriter ${VTK_LIBRARIES}) else() target_link_libraries(TestWriter vtkIOParallelXML vtkParallelMPI) endif() include(vtkModuleMacros) include(vtkMPI) vtk_mpi_link(TestWriter) #find_package(ADIOS 1.11 REQUIRED) #include_directories(SYSTEM ${ADIOS_INCLUDE_DIRS}) -------------- next part -------------- A non-text attachment was scrubbed... Name: vtk_test.C Type: text/x-csrc Size: 4987 bytes Desc: not available URL: From saeedbakhshmand at gmail.com Tue Dec 6 11:45:29 2016 From: saeedbakhshmand at gmail.com (Saeed Bakhshmand) Date: Tue, 6 Dec 2016 11:45:29 -0500 Subject: [vtkusers] Points inside a Cylinder Message-ID: Hello, I am trying to generate a list of points that lay inside an object (such as cylinder) and have no success finding the right method and would appreciate any hints. Best, Saeed -------------- next part -------------- An HTML attachment was scrubbed... URL: From jwpeterson at gmail.com Tue Dec 6 12:06:48 2016 From: jwpeterson at gmail.com (John Peterson) Date: Tue, 6 Dec 2016 10:06:48 -0700 Subject: [vtkusers] Different behavior of vtkXMLPUnstructuredGridWriter in VTK 7.1 In-Reply-To: References: Message-ID: On Tue, Dec 6, 2016 at 9:12 AM, Andy Bauer wrote: > Hi John, > > The issue is indeed due to changes that I mentioned before (i.e. only data > sets that have data get written out and the .pvtu file is adjusted > accordingly). With this change though interprocess communication is > required which is done the the vtkMultiProcessController::GetGlobalController() > object which essentially acts as MPI_COMM_WORLD within VTK. You need to > create a vtkMPIController which derives from vtkMultiProcessController. See > the attached files for how that is done. This should also be backwards > compatible but if it isn't, please let us know. > Thanks for your help. It looks like the VTK I built from source apparently does not have MPI enabled (neither vtkMPIController.h nor libvtkParallelMPI-7.1.dylib is present in my installation) as it was never required for our code prior to VTK-7.1. Since I'm very much of a cmake novice, do you know what flag I would pass to cmake when building VTK to turn this on? My guess is something like: -DModule_vtkParallelMPI:BOOL=ON ? -- John -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Tue Dec 6 12:11:46 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Tue, 6 Dec 2016 12:11:46 -0500 Subject: [vtkusers] vtkArrowSource and vtkGlyph3D In-Reply-To: References: Message-ID: Your Get usage uncovered a bug in vtkGlyph3DMapper. I submoiteed a patch here: https://gitlab.kitware.com/vtk/vtk/merge_requests/2232 On Tue, Dec 6, 2016 at 10:35 AM, Andrea Gavana wrote: > Hi Ken & All, > > thank you for your suggestions, vtkGlyph3DMapper worked beautifully in > the end. I have only a couple of issues (which may or may not related to > the VTK version I am using and the fact that I am using VTK through the > Python bindings): > > 1. If I zoom in and out (with the mouse) in the render window I can see > visual glitches for the spheres I am using (that's another > vtkGlyph3DMapper, unrelated to the arrow ones) - see attached screenshot > > 2. If I do the following: > > >>> import vtk > >>> vtk.vtkVersion().GetVTKVersion() > '7.0.0' > >>> g = vtk.vtkGlyph3DMapper() > >>> g.SetOrientationModeToRotation() > >>> g.GetOrientationModeAsString() > 'Invalid' > >>> g.SetOrientationMode(vtk.vtkGlyph3DMapper.ORIENTATION) > >>> g.GetOrientationModeAsString() > 'Invalid' > >>> g.SetOrientationModeToDirection() > >>> g.GetOrientationModeAsString() > 'Direction' > > > Notice the "Invalid" string printed out when I try to set the orientation > mode to "ORIENTATION". > > Not a big deal, I can use the DIRECTION thing as well, I just wanted to > let you know... > > Andrea. > > > > On 2 December 2016 at 16:52, Ken Martin wrote: > >> It can color/scale/orient/mask on a per glyph basis. It can even index >> into multiple glyph models on a per point basis. So you should be good. >> Just takes a while to wade through all the options as there is a lot in >> there. >> >> Thanks >> Ken >> >> On Fri, Dec 2, 2016 at 10:45 AM, Andrea Gavana >> wrote: >> >>> Hi Ken, >>> >>> Thank you very much for your answer. I hadn't understood that vtkGlyph3D >>> would create all the arrows in memory. >>> >>> However, it may still be the only choice I have as I would like to be >>> able to assign a different color (based on a scalar) to each arrow, and >>> some arrows should point downward while others upwards. The size of the >>> arrow will stay constant but the color I would like to be able to change it >>> on an arrow-by arrow basis, and I don't know if this can be done using >>> vtkGlyph3DMapper... >>> >>> Of course, I would be more than happy to be proven wrong ?. >>> >>> Thank you again. >>> >>> Andrea. >>> >>> On Fri, 2 Dec 2016 at 16:30, Ken Martin wrote: >>> >>>> Be aware Glyph3D is a filter and will actually generate all those >>>> arrows in memory. Glyph3DMapper is a mapper and uses OpenGL tricks to >>>> render the same arrow lots of times. >>>> >>>> Both classes place a glyph at the location of each input point. The >>>> orientation is controlled by a different array in your point data ala the >>>> comments below: >>>> >>>> Thanks >>>> Ken >>>> >>>> //@{ >>>> /** >>>> * Turn on/off orienting of input geometry. >>>> * When turned on, the orientation array specified >>>> * using SetOrientationArray() will be used. >>>> */ >>>> vtkSetMacro(Orient, bool); >>>> vtkGetMacro(Orient, bool); >>>> vtkBooleanMacro(Orient, bool); >>>> //@} >>>> >>>> //@{ >>>> /** >>>> * Orientation mode indicates if the OrientationArray provides the >>>> direction >>>> * vector for the orientation or the rotations around each axes. >>>> Default is >>>> * DIRECTION >>>> */ >>>> vtkSetClampMacro(OrientationMode, int, DIRECTION, ROTATION); >>>> vtkGetMacro(OrientationMode, int); >>>> void SetOrientationModeToDirection() >>>> { this->SetOrientationMode(vtkGlyph3DMapper::DIRECTION); } >>>> void SetOrientationModeToRotation() >>>> { this->SetOrientationMode(vtkGlyph3DMapper::ROTATION); } >>>> const char* GetOrientationModeAsString(); >>>> //@} >>>> >>>> enum OrientationModes >>>> { >>>> DIRECTION=0, >>>> ROTATION=1 >>>> }; >>>> >>>> >>>> /** >>>> * Tells the mapper to use an orientation array if Orient is true. >>>> * An orientation array is a vtkDataArray with 3 components. The first >>>> * component is the angle of rotation along the X axis. The second >>>> * component is the angle of rotation along the Y axis. The third >>>> * component is the angle of rotation along the Z axis. Orientation is >>>> * specified in X,Y,Z order but the rotations are performed in Z,X an >>>> Y. >>>> * This definition is compliant with SetOrientation method on >>>> vtkProp3D. >>>> * By using vector or normal there is a degree of freedom or rotation >>>> * left (underconstrained). With the orientation array, there is no >>>> degree of >>>> * freedom left. >>>> * This is convenience method. The same effect can be achieved by >>>> using >>>> * SetInputArrayToProcess(vtkGlyph3DMapper::ORIENTATION, 0, 0, >>>> * vtkDataObject::FIELD_ASSOCIATION_POINTS, orientationarrayname); >>>> */ >>>> void SetOrientationArray(const char* orientationarrayname); >>>> >>>> >>>> On Fri, Dec 2, 2016 at 10:18 AM, Andrea Gavana >>> > wrote: >>>> >>>> Dear All, >>>> >>>> I am trying to combine a vtkArrowSource and vtkGlyph3D. I have been >>>> (naively) thinking that by specifying a polydata with two points (start and >>>> end) and assigning its points to the vtkGlyph3D I would obtain an arrow >>>> that starts at the start point and end at the end point. >>>> >>>> I have created a small, self-contained following Python script to >>>> demonstrate what I mean - I get 4 arrows, one at each point I define, >>>> instead of two arrows. What am I missing? Any suggestion is more than >>>> welcome. >>>> >>>> Thank you in advance. >>>> >>>> Andrea. >>>> >>>> >>>> import vtk >>>> import numpy >>>> >>>> # First set of points - first arrow >>>> points1 = numpy.array([[ 11271.915, 7538.686, 6245.661], >>>> [ 11271.915, 7538.686, 5897.034]]) >>>> >>>> # Second set of points - second arrow >>>> points2 = numpy.array([[ 10532.274, 9101.572, 6313.167], >>>> [ 10532.274, 9101.572, 5964.539]]) >>>> >>>> # Create an arrow source with some attributes >>>> arrow_source = vtk.vtkArrowSource() >>>> arrow_source.SetTipRadius(0.2) >>>> arrow_source.SetShaftRadius(0.075) >>>> >>>> # Create the vtkGlyph3D >>>> arrow_glyph = vtk.vtkGlyph3D() >>>> arrow_glyph.SetScaleModeToDataScalingOff() >>>> >>>> # Usual mapper >>>> arrow_mapper = vtk.vtkPolyDataMapper() >>>> arrow_mapper.SetInputConnection(arrow_glyph.GetOutputPort()) >>>> >>>> # Usual actor >>>> arrow_actor = vtk.vtkActor() >>>> arrow_actor.SetMapper(arrow_mapper) >>>> >>>> append_poly_data = vtk.vtkAppendPolyData() >>>> >>>> # Loop through points1 and points2 >>>> for p in [points1, points2]: >>>> >>>> arrow_poly_data = vtk.vtkPolyData() >>>> vtk_arrow_lines = vtk.vtkCellArray() >>>> >>>> vtk_arrow_lines.InsertNextCell(2) >>>> vtk_arrow_lines.InsertCellPoint(0) >>>> vtk_arrow_lines.InsertCellPoint(1) >>>> >>>> vtk_arrow_points = vtk.vtkPoints() >>>> # Loop through the head and tail of a single arrow >>>> for j in xrange(2): >>>> vtk_arrow_points.InsertNextPoint(p[j]) >>>> >>>> arrow_poly_data.SetPoints(vtk_arrow_points) >>>> arrow_poly_data.SetLines(vtk_arrow_lines) >>>> append_poly_data.AddInputData(arrow_poly_data) >>>> >>>> >>>> arrow_glyph.SetInputConnection(append_poly_data.GetOutputPort()) >>>> arrow_glyph.SetSourceConnection(arrow_source.GetOutputPort()) >>>> arrow_glyph.SetScaleFactor(100) >>>> arrow_actor.GetProperty().SetColor(1, 1, 1) >>>> >>>> # ------------------------------------------------------------ >>>> # Create the RenderWindow, Renderer and both Actors >>>> # ------------------------------------------------------------ >>>> ren = vtk.vtkRenderer() >>>> renWin = vtk.vtkRenderWindow() >>>> renWin.AddRenderer(ren) >>>> iren = vtk.vtkRenderWindowInteractor() >>>> iren.SetRenderWindow(renWin) >>>> >>>> # add actors >>>> ren.AddActor(arrow_actor) >>>> ren.ResetCamera() >>>> iren.Start() >>>> >>>> >>>> >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ at: >>>> http://www.vtk.org/Wiki/VTK_FAQ >>>> >>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://public.kitware.com/mailman/listinfo/vtkusers >>>> >>>> >>>> >>>> >>>> -- >>>> Ken Martin PhD >>>> Chairman & CFO >>>> Kitware Inc. >>>> 28 Corporate Drive >>>> Clifton Park NY 12065 >>>> 518 371 3971 >>>> >>>> This communication, including all attachments, contains confidential >>>> and legally privileged information, and it is intended only for the use of >>>> the addressee. Access to this email by anyone else is unauthorized. If you >>>> are not the intended recipient, any disclosure, copying, distribution or >>>> any action taken in reliance on it is prohibited and may be unlawful. If >>>> you received this communication in error please notify us immediately and >>>> destroy the original message. Thank you. >>>> >>> >> >> >> -- >> Ken Martin PhD >> Chairman & CFO >> Kitware Inc. >> 28 Corporate Drive >> Clifton Park NY 12065 >> 518 371 3971 <(518)%20371-3971> >> >> This communication, including all attachments, contains confidential and >> legally privileged information, and it is intended only for the use of the >> addressee. Access to this email by anyone else is unauthorized. If you are >> not the intended recipient, any disclosure, copying, distribution or any >> action taken in reliance on it is prohibited and may be unlawful. If you >> received this communication in error please notify us immediately and >> destroy the original message. Thank you. >> > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -- Unpaid intern in BillsBasement at noware dot com -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy.bauer at kitware.com Tue Dec 6 12:11:51 2016 From: andy.bauer at kitware.com (Andy Bauer) Date: Tue, 6 Dec 2016 12:11:51 -0500 Subject: [vtkusers] Different behavior of vtkXMLPUnstructuredGridWriter in VTK 7.1 In-Reply-To: References: Message-ID: Hi, You'll want to enable VTK_Group_MPI (i.e. -DVTK_Group_MPI:BOOL=ON). Technically the "p" in the pvtu writer really corresponds to piece and not necessarily parallel. The pieces do map well to SIMD parallelism though. Best, Andy On Tue, Dec 6, 2016 at 12:06 PM, John Peterson wrote: > > > On Tue, Dec 6, 2016 at 9:12 AM, Andy Bauer wrote: > >> Hi John, >> >> The issue is indeed due to changes that I mentioned before (i.e. only >> data sets that have data get written out and the .pvtu file is adjusted >> accordingly). With this change though interprocess communication is >> required which is done the the vtkMultiProcessController::GetGlobalController() >> object which essentially acts as MPI_COMM_WORLD within VTK. You need to >> create a vtkMPIController which derives from vtkMultiProcessController. See >> the attached files for how that is done. This should also be backwards >> compatible but if it isn't, please let us know. >> > > Thanks for your help. > > It looks like the VTK I built from source apparently does not have MPI > enabled (neither vtkMPIController.h nor libvtkParallelMPI-7.1.dylib is > present in my installation) as it was never required for our code prior to > VTK-7.1. Since I'm very much of a cmake novice, do you know what flag I > would pass to cmake when building VTK to turn this on? My guess is > something like: > > -DModule_vtkParallelMPI:BOOL=ON > > ? > > -- > John > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Tue Dec 6 12:13:36 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Tue, 6 Dec 2016 12:13:36 -0500 Subject: [vtkusers] Different behavior of vtkXMLPUnstructuredGridWriter in VTK 7.1 In-Reply-To: References: Message-ID: Andy, Isn't there a way to handle the issue in a backward compatible way? Seems like this user was surprised and a fix to his code was not obvious. Bill On Tue, Dec 6, 2016 at 12:11 PM, Andy Bauer wrote: > Hi, > > You'll want to enable VTK_Group_MPI (i.e. -DVTK_Group_MPI:BOOL=ON). > Technically the "p" in the pvtu writer really corresponds to piece and not > necessarily parallel. The pieces do map well to SIMD parallelism though. > > Best, > Andy > > On Tue, Dec 6, 2016 at 12:06 PM, John Peterson wrote: >> >> >> >> On Tue, Dec 6, 2016 at 9:12 AM, Andy Bauer wrote: >>> >>> Hi John, >>> >>> The issue is indeed due to changes that I mentioned before (i.e. only >>> data sets that have data get written out and the .pvtu file is adjusted >>> accordingly). With this change though interprocess communication is required >>> which is done the the vtkMultiProcessController::GetGlobalController() >>> object which essentially acts as MPI_COMM_WORLD within VTK. You need to >>> create a vtkMPIController which derives from vtkMultiProcessController. See >>> the attached files for how that is done. This should also be backwards >>> compatible but if it isn't, please let us know. >> >> >> Thanks for your help. >> >> It looks like the VTK I built from source apparently does not have MPI >> enabled (neither vtkMPIController.h nor libvtkParallelMPI-7.1.dylib is >> present in my installation) as it was never required for our code prior to >> VTK-7.1. Since I'm very much of a cmake novice, do you know what flag I >> would pass to cmake when building VTK to turn this on? My guess is >> something like: >> >> -DModule_vtkParallelMPI:BOOL=ON >> >> ? >> >> -- >> John > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Unpaid intern in BillsBasement at noware dot com From andy.bauer at kitware.com Tue Dec 6 12:26:43 2016 From: andy.bauer at kitware.com (Andy Bauer) Date: Tue, 6 Dec 2016 12:26:43 -0500 Subject: [vtkusers] Different behavior of vtkXMLPUnstructuredGridWriter in VTK 7.1 In-Reply-To: References: Message-ID: Hi Bill, I think that this was a bug in the way that VTK was being used but because of the way that the XMLPUnstructuredGridWriter was implemented, it ended up not being manifested in VTK pre 7.1. If they tried to do most other parallel operations (e.g. streamlines, etc.) they would not get the desired behavior. If you don't agree with this sentiment, any suggestions on how this would be fixed? The new behavior is much better for a variety of reasons when writing out files in parallel when not all MPI processes have data to be written out and therefore I would think should be the default. Andy On Tue, Dec 6, 2016 at 12:13 PM, Bill Lorensen wrote: > Andy, > > Isn't there a way to handle the issue in a backward compatible way? > Seems like this user was surprised and a fix to his code was not > obvious. > > Bill > > > On Tue, Dec 6, 2016 at 12:11 PM, Andy Bauer > wrote: > > Hi, > > > > You'll want to enable VTK_Group_MPI (i.e. -DVTK_Group_MPI:BOOL=ON). > > Technically the "p" in the pvtu writer really corresponds to piece and > not > > necessarily parallel. The pieces do map well to SIMD parallelism though. > > > > Best, > > Andy > > > > On Tue, Dec 6, 2016 at 12:06 PM, John Peterson > wrote: > >> > >> > >> > >> On Tue, Dec 6, 2016 at 9:12 AM, Andy Bauer > wrote: > >>> > >>> Hi John, > >>> > >>> The issue is indeed due to changes that I mentioned before (i.e. only > >>> data sets that have data get written out and the .pvtu file is adjusted > >>> accordingly). With this change though interprocess communication is > required > >>> which is done the the vtkMultiProcessController::GetGlobalController() > >>> object which essentially acts as MPI_COMM_WORLD within VTK. You need to > >>> create a vtkMPIController which derives from > vtkMultiProcessController. See > >>> the attached files for how that is done. This should also be backwards > >>> compatible but if it isn't, please let us know. > >> > >> > >> Thanks for your help. > >> > >> It looks like the VTK I built from source apparently does not have MPI > >> enabled (neither vtkMPIController.h nor libvtkParallelMPI-7.1.dylib is > >> present in my installation) as it was never required for our code prior > to > >> VTK-7.1. Since I'm very much of a cmake novice, do you know what flag I > >> would pass to cmake when building VTK to turn this on? My guess is > >> something like: > >> > >> -DModule_vtkParallelMPI:BOOL=ON > >> > >> ? > >> > >> -- > >> John > > > > > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Please keep messages on-topic and check the VTK FAQ at: > > http://www.vtk.org/Wiki/VTK_FAQ > > > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/vtkusers > > > > > > -- > Unpaid intern in BillsBasement at noware dot com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jwpeterson at gmail.com Tue Dec 6 12:35:25 2016 From: jwpeterson at gmail.com (John Peterson) Date: Tue, 6 Dec 2016 10:35:25 -0700 Subject: [vtkusers] Different behavior of vtkXMLPUnstructuredGridWriter in VTK 7.1 In-Reply-To: References: Message-ID: On Tue, Dec 6, 2016 at 10:26 AM, Andy Bauer wrote: > Hi Bill, > > I think that this was a bug in the way that VTK was being used but because > of the way that the XMLPUnstructuredGridWriter was implemented, it ended up > not being manifested in VTK pre 7.1. If they tried to do most other > parallel operations (e.g. streamlines, etc.) they would not get the desired > behavior. > I will second this. It looks like we have been "getting away with" using the XMLPUnstructuredGridWriter in the wrong way for quite a while, and we need to update our code to use it the right way. -- John -------------- next part -------------- An HTML attachment was scrubbed... URL: From rsanthanam85 at gmail.com Tue Dec 6 12:47:46 2016 From: rsanthanam85 at gmail.com (ramesh santhanam) Date: Tue, 6 Dec 2016 12:47:46 -0500 Subject: [vtkusers] Build VTK module without OpenGL Message-ID: Hi A while back (2015) a similar query was posted. I have version 7.1 of the Vtk src and am interested in only the modules viz. vtkIOImport, vtkIOEnsight which should be void of any OpenGL dependency (based on my understanding). I tried following the solution suggested in the thread but without much success. I am possibly missing something. Any pointers would be appreciated. cmake -DVTK_Group_StandAlone:BOOL=OFF -DVTK_Group_Rendering:BOOL=OFF -DVTK_RENDERING_BACKGROUND=OpenGL2 -DModule_vtkIOEnSight:BOOL=ON -DVTK_BUILD_ALL_MODULES_FOR_TESTS:BOOL=OFF .. but get errors as shown below: -- * vtktiff, needed by vtkIOImage. -- * vtkzlib, needed by 6 modules: vtkIOCore vtkIOImage vtkMetaIO vtkfreetype vtkpng vtktiff CMake Error at /usr/local/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message): Could NOT find OpenGL (missing: OPENGL_gl_LIBRARY OPENGL_INCLUDE_DIR) Call Stack (most recent call first): /usr/local/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE) /usr/local/share/cmake-3.5/Modules/FindOpenGL.cmake:172 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) src/Components/VTK/CMake/vtkOpenGL.cmake:77 (find_package) src/Components/VTK/ThirdParty/glew/vtkglew/CMakeLists.txt:3 (include) ==== Thanks Ramesh -------------- next part -------------- An HTML attachment was scrubbed... URL: From sur.chiranjib at gmail.com Tue Dec 6 12:49:15 2016 From: sur.chiranjib at gmail.com (Chiranjib Sur) Date: Tue, 6 Dec 2016 23:19:15 +0530 Subject: [vtkusers] Points inside a Cylinder In-Reply-To: References: Message-ID: Saeed, there is no ready made solution available ( atleast I am not aware of). You can implement the solution in the following way 1. Consider the cylinder is within a cubic volume for which you know the bounds 2. Generate points of your desired resolution on a 3d grid for the entire cube (this will be on a regular grid) 3. Consider the boundary condition for cylinder and create an array of "vtkpoints" after step 2 4. This boundary condition can give you option to create point inside or outside of your cylinder Here is an example which you can look to understand how to determine inside outside of the closed surface http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PointInsideObject Hope that helps, Chiranjib On Tue, Dec 6, 2016 at 10:15 PM, Saeed Bakhshmand wrote: > Hello, > > I am trying to generate a list of points that lay inside an object (such > as cylinder) and have no success finding the right method and would > appreciate any hints. > > Best, > Saeed > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Tue Dec 6 12:58:01 2016 From: dave.demarle at kitware.com (David E DeMarle) Date: Tue, 6 Dec 2016 12:58:01 -0500 Subject: [vtkusers] Build VTK module without OpenGL In-Reply-To: References: Message-ID: On Tue, Dec 6, 2016 at 12:47 PM, ramesh santhanam wrote: > cmake -DVTK_Group_StandAlone:BOOL=OFF -DVTK_Group_Rendering:BOOL=OFF > -DVTK_RENDERING_BACKGROUND=OpenGL2 -DModule_vtkIOEnSight:BOOL=ON > -DVTK_BUILD_ALL_MODULES_FOR_TESTS:BOOL=OFF .. This slight variation of your incantation worked for me: cmake -DVTK_Group_StandAlone:BOOL=OFF -DVTK_Group_Rendering:BOOL=OFF -DModule_vtkIOEnSight:BOOL=ON -DBUILD_TESTING:BOOL=OFF /path/to/VTK7.1 David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 -------------- next part -------------- An HTML attachment was scrubbed... URL: From saeedbakhshmand at gmail.com Tue Dec 6 13:14:45 2016 From: saeedbakhshmand at gmail.com (Saeed Bakhshmand) Date: Tue, 6 Dec 2016 13:14:45 -0500 Subject: [vtkusers] Points inside a Cylinder In-Reply-To: References: Message-ID: Thanks Chiranjib, I was trying to avoid an implementation as you described, also boundary condition for a constrained cylinder mathematically is not straightforward. I will keep you posted once I solve this. Cheers, Saeed On Tue, Dec 6, 2016 at 12:49 PM, Chiranjib Sur wrote: > Saeed, > there is no ready made solution available ( atleast I am not aware of). > You can implement the solution in the following way > > 1. Consider the cylinder is within a cubic volume for which you know the > bounds > 2. Generate points of your desired resolution on a 3d grid for the entire > cube (this will be on a regular grid) > 3. Consider the boundary condition for cylinder and create an array of > "vtkpoints" after step 2 > 4. This boundary condition can give you option to create point inside or > outside of your cylinder > > Here is an example which you can look to understand how to determine > inside outside of the closed surface > http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PointInsideObject > > Hope that helps, > Chiranjib > > On Tue, Dec 6, 2016 at 10:15 PM, Saeed Bakhshmand < > saeedbakhshmand at gmail.com> wrote: > >> Hello, >> >> I am trying to generate a list of points that lay inside an object (such >> as cylinder) and have no success finding the right method and would >> appreciate any hints. >> >> Best, >> Saeed >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Tue Dec 6 13:30:17 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Tue, 6 Dec 2016 13:30:17 -0500 Subject: [vtkusers] Build VTK module without OpenGL In-Reply-To: References: Message-ID: Here is what you need: cmake -DVTK_Group_StandAlone:BOOL=OFF -DVTK_Group_Rendering:BOOL=OFF -DModule_vtkIOEnSight:BOOL=ON -DBUILD_TESTING:BOOL=OFF It will just build these libs: libvtkCommonCore-7.1.so libvtkCommonSystem-7.1.so libvtkCommonDataModel-7.1.so libvtkCommonTransforms-7.1.so libvtkCommonExecutionModel-7.1.so libvtkIOEnSight-7.1.so libvtkCommonMath-7.1.so libvtksys-7.1.so libvtkCommonMisc-7.1.so On Tue, Dec 6, 2016 at 12:47 PM, ramesh santhanam wrote: > Hi > A while back (2015) a similar query was posted. I have version 7.1 of the > Vtk src and am interested in only > the modules viz. vtkIOImport, vtkIOEnsight which should be void of any > OpenGL dependency (based on my understanding). I tried following the > solution suggested in the thread but without much success. I am possibly > missing something. Any pointers would be appreciated. > > cmake -DVTK_Group_StandAlone:BOOL=OFF -DVTK_Group_Rendering:BOOL=OFF > -DVTK_RENDERING_BACKGROUND=OpenGL2 -DModule_vtkIOEnSight:BOOL=ON > -DVTK_BUILD_ALL_MODULES_FOR_TESTS:BOOL=OFF .. > > > but get errors as shown below: > > -- * vtktiff, needed by vtkIOImage. > > -- * vtkzlib, needed by 6 modules: > > vtkIOCore > > vtkIOImage > > vtkMetaIO > > vtkfreetype > > vtkpng > > vtktiff > > CMake Error at > /usr/local/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 > (message): > > Could NOT find OpenGL (missing: OPENGL_gl_LIBRARY OPENGL_INCLUDE_DIR) > > Call Stack (most recent call first): > > /usr/local/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 > (_FPHSA_FAILURE_MESSAGE) > > /usr/local/share/cmake-3.5/Modules/FindOpenGL.cmake:172 > (FIND_PACKAGE_HANDLE_STANDARD_ARGS) > > src/Components/VTK/CMake/vtkOpenGL.cmake:77 (find_package) > > src/Components/VTK/ThirdParty/glew/vtkglew/CMakeLists.txt:3 (include) > > ==== > > > Thanks > > Ramesh > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Unpaid intern in BillsBasement at noware dot com From bill.lorensen at gmail.com Tue Dec 6 13:32:25 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Tue, 6 Dec 2016 13:32:25 -0500 Subject: [vtkusers] Different behavior of vtkXMLPUnstructuredGridWriter in VTK 7.1 In-Reply-To: References: Message-ID: Sounds OK to me. Just checking... On Tue, Dec 6, 2016 at 12:35 PM, John Peterson wrote: > > > On Tue, Dec 6, 2016 at 10:26 AM, Andy Bauer wrote: >> >> Hi Bill, >> >> I think that this was a bug in the way that VTK was being used but because >> of the way that the XMLPUnstructuredGridWriter was implemented, it ended up >> not being manifested in VTK pre 7.1. If they tried to do most other parallel >> operations (e.g. streamlines, etc.) they would not get the desired behavior. > > > I will second this. It looks like we have been "getting away with" using > the XMLPUnstructuredGridWriter in the wrong way for quite a while, and we > need to update our code to use it the right way. > > -- > John -- Unpaid intern in BillsBasement at noware dot com From andy.bauer at kitware.com Tue Dec 6 13:38:26 2016 From: andy.bauer at kitware.com (Andy Bauer) Date: Tue, 6 Dec 2016 13:38:26 -0500 Subject: [vtkusers] Different behavior of vtkXMLPUnstructuredGridWriter in VTK 7.1 In-Reply-To: References: Message-ID: Backwards compatibility is something I should work harder on in general so having someone check on me for this isn't a bad thing. I just hit a backwards compatibility issue with a separate library today and it's certainly annoying and a good way to anger users. On Tue, Dec 6, 2016 at 1:32 PM, Bill Lorensen wrote: > Sounds OK to me. > > Just checking... > > On Tue, Dec 6, 2016 at 12:35 PM, John Peterson > wrote: > > > > > > On Tue, Dec 6, 2016 at 10:26 AM, Andy Bauer > wrote: > >> > >> Hi Bill, > >> > >> I think that this was a bug in the way that VTK was being used but > because > >> of the way that the XMLPUnstructuredGridWriter was implemented, it > ended up > >> not being manifested in VTK pre 7.1. If they tried to do most other > parallel > >> operations (e.g. streamlines, etc.) they would not get the desired > behavior. > > > > > > I will second this. It looks like we have been "getting away with" using > > the XMLPUnstructuredGridWriter in the wrong way for quite a while, and we > > need to update our code to use it the right way. > > > > -- > > John > > > > -- > Unpaid intern in BillsBasement at noware dot com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidlandry93 at gmail.com Tue Dec 6 16:24:53 2016 From: davidlandry93 at gmail.com (davidlandry93) Date: Tue, 6 Dec 2016 14:24:53 -0700 (MST) Subject: [vtkusers] Actors dissapear on interaction Message-ID: <1481059493708-5741452.post@n5.nabble.com> Hello all, I'm working on a visualization combining a point cloud with many ellipsoids. In the current state of things the visualization works correctly until I click on it and try to interact. At that point, everything disappears except the orientation marker widget. I don't think the problem is a violent camera movement that takes all the objects out of sight, because I tried with many interactors and small movements. The most relevant code is here The header of that class is here Feel free to browse around the repo if some informations are missing. I run this code on linux. Thanks in advance for all the help, David Landry -- View this message in context: http://vtk.1045678.n5.nabble.com/Actors-dissapear-on-interaction-tp5741452.html Sent from the VTK - Users mailing list archive at Nabble.com. From rsanthanam85 at gmail.com Wed Dec 7 10:01:08 2016 From: rsanthanam85 at gmail.com (ramesh santhanam) Date: Wed, 7 Dec 2016 10:01:08 -0500 Subject: [vtkusers] Build VTK module without OpenGL In-Reply-To: References: Message-ID: Thanks Bill and David. Using the cmake command line as you both mentioned earlier, I have just the required modules compiling and dso's built. Regards ramesh On Tue, Dec 6, 2016 at 1:30 PM, Bill Lorensen wrote: > Here is what you need: > cmake -DVTK_Group_StandAlone:BOOL=OFF -DVTK_Group_Rendering:BOOL=OFF > -DModule_vtkIOEnSight:BOOL=ON -DBUILD_TESTING:BOOL=OFF > > It will just build these libs: > libvtkCommonCore-7.1.so > libvtkCommonSystem-7.1.so > libvtkCommonDataModel-7.1.so > libvtkCommonTransforms-7.1.so > libvtkCommonExecutionModel-7.1.so > libvtkIOEnSight-7.1.so > libvtkCommonMath-7.1.so > libvtksys-7.1.so > libvtkCommonMisc-7.1.so > > > On Tue, Dec 6, 2016 at 12:47 PM, ramesh santhanam > wrote: > > Hi > > A while back (2015) a similar query was posted. I have version 7.1 of > the > > Vtk src and am interested in only > > the modules viz. vtkIOImport, vtkIOEnsight which should be void of any > > OpenGL dependency (based on my understanding). I tried following the > > solution suggested in the thread but without much success. I am possibly > > missing something. Any pointers would be appreciated. > > > > cmake -DVTK_Group_StandAlone:BOOL=OFF -DVTK_Group_Rendering:BOOL=OFF > > -DVTK_RENDERING_BACKGROUND=OpenGL2 -DModule_vtkIOEnSight:BOOL=ON > > -DVTK_BUILD_ALL_MODULES_FOR_TESTS:BOOL=OFF .. > > > > > > but get errors as shown below: > > > > -- * vtktiff, needed by vtkIOImage. > > > > -- * vtkzlib, needed by 6 modules: > > > > vtkIOCore > > > > vtkIOImage > > > > vtkMetaIO > > > > vtkfreetype > > > > vtkpng > > > > vtktiff > > > > CMake Error at > > /usr/local/share/cmake-3.5/Modules/FindPackageHandleStandardArgs. > cmake:148 > > (message): > > > > Could NOT find OpenGL (missing: OPENGL_gl_LIBRARY OPENGL_INCLUDE_DIR) > > > > Call Stack (most recent call first): > > > > /usr/local/share/cmake-3.5/Modules/FindPackageHandleStandardArgs. > cmake:388 > > (_FPHSA_FAILURE_MESSAGE) > > > > /usr/local/share/cmake-3.5/Modules/FindOpenGL.cmake:172 > > (FIND_PACKAGE_HANDLE_STANDARD_ARGS) > > > > src/Components/VTK/CMake/vtkOpenGL.cmake:77 (find_package) > > > > src/Components/VTK/ThirdParty/glew/vtkglew/CMakeLists.txt:3 (include) > > > > ==== > > > > > > Thanks > > > > Ramesh > > > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Please keep messages on-topic and check the VTK FAQ at: > > http://www.vtk.org/Wiki/VTK_FAQ > > > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/vtkusers > > > > > > -- > Unpaid intern in BillsBasement at noware dot com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrea.gavana at gmail.com Wed Dec 7 10:57:37 2016 From: andrea.gavana at gmail.com (Andrea Gavana) Date: Wed, 7 Dec 2016 16:57:37 +0100 Subject: [vtkusers] Version mismatch in Python bindings? Message-ID: Dear VTK users, I have downloaded the official VTK 7.1 binaries with Python bindings from the VTK website, at this address: http://www.vtk.org/files/release/7.1/vtkpython-7.1.0-Windows-64bit.exe Notice the 7.1 in the name. This is the only installation of VTK I have on my machine. Also, from the attached screenshot, please notice that the DLLs on my system have a "7.1" label attached. However, when I import vtk in my system I get this: >>> import vtk >>> vtk >>> version = vtk.vtkVersion() >>> version.GetVTKVersion() '7.0.0' >>> version.GetVTKMajorVersion(), version.GetVTKMinorVersion() (7, 0) >>> version.GetVTKSourceVersion() 'vtk version 7.0.0' >>> Am I doing something wrong or is it possible that there is a version mismatch in the Python bindings? It's of course not an issue, I just wanted to check if my setup was broken or not... Thank you. Andrea. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: vtk_version.png Type: image/png Size: 53810 bytes Desc: not available URL: From alvaro.sanchez at kitware.com Wed Dec 7 11:09:56 2016 From: alvaro.sanchez at kitware.com (Alvaro Sanchez) Date: Wed, 7 Dec 2016 11:09:56 -0500 Subject: [vtkusers] vtkGPUVolumeRayCastMapper (OpenGL2) - Mask Input update In-Reply-To: <1480679840076-5741390.post@n5.nabble.com> References: <1480373793774-5741322.post@n5.nabble.com> <1480530396414-5741375.post@n5.nabble.com> <1480679840076-5741390.post@n5.nabble.com> Message-ID: Hi Michal, there is a merge request [1] which fixes the mask update issue, it should make it for 7.1.1. Please give it a try, thanks! [1] https://gitlab.kitware.com/vtk/vtk/merge_requests/2240 On Fri, Dec 2, 2016 at 6:57 AM, meow_fiz wrote: > I'm not sure it's the best solution. It seems like it's slower than in > Vtk6.3 > &OpenGl1.x backend. > > Is it optimal solution to update modified mask volume to call > LoadMaskMethod? > > The whole volume rendering on GPU doesn't look faster than in previous > approach. I've read some threads about changing > SetMaximumImageSampleDistance &SetAutoAdjustSampleDistances but it didn't > affect the rendering frame rates ... > > > > -- > View this message in context: http://vtk.1045678.n5.nabble. > com/vtkGPUVolumeRayCastMapper-OpenGL2-Mask-Input-update- > tp5741322p5741390.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 > -- Alvaro Sanchez Kitware, Inc. Senior R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4901 -------------- next part -------------- An HTML attachment was scrubbed... URL: From franz at znarfsoft.de Wed Dec 7 11:38:28 2016 From: franz at znarfsoft.de (polybos) Date: Wed, 7 Dec 2016 09:38:28 -0700 (MST) Subject: [vtkusers] Distortions in Volumerendering in VR-Mode (HTC Vive) In-Reply-To: References: Message-ID: <1481128708774-5741457.post@n5.nabble.com> Sebastian Heerwald wrote > If I look onto the volume rendering and move around it, there appear > "refraction" lines. Unfortunately I cannot help with this issue but I would also be very pleased if someone could help here. Or did you, Sebastian, already achieve some more insights into this problem? I also get such distortions on the HTC Vive when using vtkVolumeRayCastMapper, while everything seems perfectly well in a mesh-only rendering. Does anyone have similar issues? Maybe with Occulus Rift? As far as I understand Sebastian just test with a HTC Vive. At least I can only test with a HTC Vive. -- View this message in context: http://vtk.1045678.n5.nabble.com/Distortions-in-Volumerendering-in-VR-Mode-HTC-Vive-tp5741338p5741457.html Sent from the VTK - Users mailing list archive at Nabble.com. From alvaro.sanchez at kitware.com Wed Dec 7 12:14:20 2016 From: alvaro.sanchez at kitware.com (Alvaro Sanchez) Date: Wed, 7 Dec 2016 12:14:20 -0500 Subject: [vtkusers] Distortions in Volumerendering in VR-Mode (HTC Vive) In-Reply-To: <1481128708774-5741457.post@n5.nabble.com> References: <1481128708774-5741457.post@n5.nabble.com> Message-ID: Hi, I have never tested the GPUVolumeRCMapper with OpenVR but as far as I remember Ken mentioned some time ago that he encountered a clipping/bbox related issue when adjusting the volume's orientation and position. Could you try rendering a volume with an identity matrix set as its transformation?, this might give you a hint of what the mapper is doing wrong. Cheers, Alvaro On Wed, Dec 7, 2016 at 11:38 AM, polybos wrote: > Sebastian Heerwald wrote > > If I look onto the volume rendering and move around it, there appear > > "refraction" lines. > > Unfortunately I cannot help with this issue but I would also be very > pleased > if someone could help here. Or did you, Sebastian, already achieve some > more > insights into this problem? > I also get such distortions on the HTC Vive when using > vtkVolumeRayCastMapper, while everything seems perfectly well in a > mesh-only > rendering. > > Does anyone have similar issues? Maybe with Occulus Rift? As far as I > understand Sebastian just test with a HTC Vive. At least I can only test > with a HTC Vive. > > > > -- > View this message in context: http://vtk.1045678.n5.nabble. > com/Distortions-in-Volumerendering-in-VR-Mode-HTC-Vive-tp5741338p5741457. > 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 > -- Alvaro Sanchez Kitware, Inc. Senior R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4901 -------------- next part -------------- An HTML attachment was scrubbed... URL: From seongmo.yeon at gmail.com Wed Dec 7 12:20:10 2016 From: seongmo.yeon at gmail.com (Seong Mo Yeon) Date: Thu, 8 Dec 2016 02:20:10 +0900 Subject: [vtkusers] Status of vtk c# support (vs2015)? Message-ID: <36c10771-c0ca-4714-bd69-161a4ff527cc@Spark> I would like to use vtk with c#. I have searched in the web and found activiz is on the web. But it looks like working with vs2013 cause in vs2015, the library is not recognized as working library. Could anyone tell me the status of c# support in vtk 5, 6, 7 or if any, how to integrate vtk into c# wpf? -------------- next part -------------- An HTML attachment was scrubbed... URL: From saeedbakhshmand at gmail.com Wed Dec 7 15:28:39 2016 From: saeedbakhshmand at gmail.com (Saeed Bakhshmand) Date: Wed, 7 Dec 2016 15:28:39 -0500 Subject: [vtkusers] Points inside a Cylinder In-Reply-To: References: Message-ID: Thanks Mike, I can't easily access ITK due to the platform that I develop my software (3D Slicer). I eventually ended up using a vtkPointSource with a radius equal to the Cylinder length and center set to the center of Cylinder and used vtkPointLocator to scan through cylinder axis and find part of point cloud that is closer to the considered (iterative) point than cylinder radius. By aggregating results of this loop, I could generate a point cloud that is situated inside cylinder. On Tue, Dec 6, 2016 at 1:39 PM, Mike Chinander wrote: > It's not VTK, but the ITKSpatialObjectToImageFilter (itk.org/Doxygen/html/ > classitk_1_1SpatialObjectToImageFilter.html) may be useful to you. I > think the actual algorithm is similar to what Chiranjib described. Check > out the example: itk.org/Doxygen/html/Examples_2Filtering_ > 2SpatialObjectToImage1_8cxx-example.html > > If you're are checking if particular point(s) is inside a cylinder, ITK's > cylinderSpatialObject (and other spatial object's) has an isInside() method. > > itk.org/Doxygen/html/classitk_1_1CylinderSpatialObject.html > > On Tue, Dec 6, 2016 at 12:14 PM, Saeed Bakhshmand < > saeedbakhshmand at gmail.com> wrote: > >> Thanks Chiranjib, >> >> I was trying to avoid an implementation as you described, also boundary >> condition for a constrained cylinder mathematically is not straightforward. >> I will keep you posted once I solve this. >> >> Cheers, >> Saeed >> >> On Tue, Dec 6, 2016 at 12:49 PM, Chiranjib Sur >> wrote: >> >>> Saeed, >>> there is no ready made solution available ( atleast I am not aware of). >>> You can implement the solution in the following way >>> >>> 1. Consider the cylinder is within a cubic volume for which you know the >>> bounds >>> 2. Generate points of your desired resolution on a 3d grid for the >>> entire cube (this will be on a regular grid) >>> 3. Consider the boundary condition for cylinder and create an array of >>> "vtkpoints" after step 2 >>> 4. This boundary condition can give you option to create point inside or >>> outside of your cylinder >>> >>> Here is an example which you can look to understand how to determine >>> inside outside of the closed surface >>> http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PointInsideObject >>> >>> Hope that helps, >>> Chiranjib >>> >>> On Tue, Dec 6, 2016 at 10:15 PM, Saeed Bakhshmand < >>> saeedbakhshmand at gmail.com> wrote: >>> >>>> Hello, >>>> >>>> I am trying to generate a list of points that lay inside an object >>>> (such as cylinder) and have no success finding the right method and would >>>> appreciate any hints. >>>> >>>> Best, >>>> Saeed >>>> >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ at: >>>> http://www.vtk.org/Wiki/VTK_FAQ >>>> >>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://public.kitware.com/mailman/listinfo/vtkusers >>>> >>>> >>> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjlp at netease.com Thu Dec 8 07:52:54 2016 From: tjlp at netease.com (Liu_tj) Date: Thu, 8 Dec 2016 20:52:54 +0800 (CST) Subject: [vtkusers] Status of vtk c# support (vs2015)? In-Reply-To: <36c10771-c0ca-4714-bd69-161a4ff527cc@Spark> References: <36c10771-c0ca-4714-bd69-161a4ff527cc@Spark> Message-ID: <23c9427d.10.158de7e6159.Coremail.tjlp@netease.com> You can build Activiz for vtk 5, 6, or 7 yourself. ?2016-12-08?"Seong Mo Yeon" ??? -----????----- ???:"Seong Mo Yeon" ????:2016?12?8? ??? ???:"vtkusers" ??:[vtkusers] Status of vtk c# support (vs2015)? I would like to use vtk with c#. I have searched in the web and found activiz is on the web. But it looks like working with vs2013 cause in vs2015, the library is not recognized as working library. Could anyone tell me the status of c# support in vtk 5, 6, 7 or if any, how to integrate vtk into c# wpf? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bastiheerwald at live.de Thu Dec 8 08:40:02 2016 From: bastiheerwald at live.de (Sebastian Heerwald) Date: Thu, 8 Dec 2016 13:40:02 +0000 Subject: [vtkusers] Distortions in Volumerendering in VR-Mode (HTC Vive) In-Reply-To: References: <1481128708774-5741457.post@n5.nabble.com>, Message-ID: Hey, Thank you for your reply. I have build a little program which only loads a volume dataset and displays it within the RenderWindow. Since the OpenVR interface is a little bit hackish within VTK the only thing that decides whether it renders for OpenVR or for normal 2D-Display is whether we link against vtkOpenVR and vtkRenderingOpenVR modules or not. Everything code related is the same. So to reply to your Question: > Could you try rendering a volume with an identity matrix set as its transformation? I've build this simple program and it only places a volume dataset within the world without any transformation. The volume is directly given to the GPUVolumeRCMapper without any transformation. In "2D"-Renderwindow everything is fine. Also in anaglyph rendering I get a nice 3D View. But when I link against OpenVR module the view dependend distortions appear within VR. I've tried some things. All I can say is, that the errors appear if I look at any edge or corner of the surrounding (invisible) boundingbox around the rendered volume. If I look directly on one side of the boundingbox everything seems fine. The only thing I can imagine from this perspective is, that the GPUVolumeRCMapper gets wrong view directions for the eyes. But the vtkOpenVRCamera objects seems to do everything right. I don't know how to adjust the clipping box / bounding box you mentioned. Can you explain how I can do this, maybe this helps me to debug further? Sincerely, Sebastian ________________________________ Von: vtkusers im Auftrag von Alvaro Sanchez Gesendet: Mittwoch, 7. Dezember 2016 18:14 An: polybos Cc: VTK Users Betreff: Re: [vtkusers] Distortions in Volumerendering in VR-Mode (HTC Vive) Hi, I have never tested the GPUVolumeRCMapper with OpenVR but as far as I remember Ken mentioned some time ago that he encountered a clipping/bbox related issue when adjusting the volume's orientation and position. Could you try rendering a volume with an identity matrix set as its transformation?, this might give you a hint of what the mapper is doing wrong. Cheers, Alvaro On Wed, Dec 7, 2016 at 11:38 AM, polybos > wrote: Sebastian Heerwald wrote > If I look onto the volume rendering and move around it, there appear > "refraction" lines. Unfortunately I cannot help with this issue but I would also be very pleased if someone could help here. Or did you, Sebastian, already achieve some more insights into this problem? I also get such distortions on the HTC Vive when using vtkVolumeRayCastMapper, while everything seems perfectly well in a mesh-only rendering. Does anyone have similar issues? Maybe with Occulus Rift? As far as I understand Sebastian just test with a HTC Vive. At least I can only test with a HTC Vive. -- View this message in context: http://vtk.1045678.n5.nabble.com/Distortions-in-Volumerendering-in-VR-Mode-HTC-Vive-tp5741338p5741457.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 -- Alvaro Sanchez Kitware, Inc. Senior R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4901 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.boeckel at kitware.com Thu Dec 8 08:48:32 2016 From: ben.boeckel at kitware.com (Ben Boeckel) Date: Thu, 8 Dec 2016 08:48:32 -0500 Subject: [vtkusers] building VTK 7.1.0 on MSYS2: undefined references In-Reply-To: References: <5b7f6ad8-5793-6148-f755-e1741e43e5ed@emmenlauer.de> Message-ID: <20161208134832.GA17430@megas.kitware.com> On Mon, Nov 28, 2016 at 11:44:00 -0500, David Lonie wrote: > According to Common/DataModel/module.cmake, vtkCommonDataModel already has > a dependency on vtkCommonCore inside of VTK. Everything should be linked > already. Hmm. CommonCore and CommonDataModel have a bit of a circular dependency, but it is around the vtkInformationKey stuff, not the data array bits. > It's likely that the mingw support needs some love. I don't think we have > any customers that rely on it at the moment, but maybe someone can pick it > up. Yeah, we don't test it currently. It may have something to do with type and size detection and VTK not instantiating all of the specializations correctly on mingw? --Ben From ken.martin at kitware.com Thu Dec 8 09:09:29 2016 From: ken.martin at kitware.com (Ken Martin) Date: Thu, 8 Dec 2016 09:09:29 -0500 Subject: [vtkusers] Distortions in Volumerendering in VR-Mode (HTC Vive) In-Reply-To: References: <1481128708774-5741457.post@n5.nabble.com> Message-ID: Not exactly related to this, but I did find a bug in our OpenVR code that I will be pushing to a topic soon. It also includes some other performance tweaks. The bug can have a big impact on performance as it could cause the VR display to wait for the screen display vsync. I'll be pushing the fix for the 7.1.1 release as well. On Thu, Dec 8, 2016 at 8:40 AM, Sebastian Heerwald wrote: > Hey, > > > Thank you for your reply. > > I have build a little program which only loads a volume dataset and > displays it within the RenderWindow. > > Since the OpenVR interface is a little bit hackish within VTK the only > thing that decides whether it renders for OpenVR or for normal 2D-Display > is whether we link against vtkOpenVR and vtkRenderingOpenVR modules or not. > > Everything code related is the same. > > > So to reply to your Question: > > > Could you try rendering a volume with an identity matrix set as its > transformation? > > > I've build this simple program and it only places a volume dataset within > the world without any transformation. The volume is directly given to the GPUVolumeRCMapper > without any transformation. In "2D"-Renderwindow everything is fine. Also > in anaglyph rendering I get a nice 3D View. > > But when I link against OpenVR module the view dependend distortions > appear within VR. I've tried some things. > > All I can say is, that the errors appear if I look at any edge or corner > of the surrounding (invisible) boundingbox around the rendered volume. If I > look directly on one side of the boundingbox everything seems fine. > > > The only thing I can imagine from this perspective is, that the GPUVolumeRCMapper > gets wrong view directions for the eyes. But the vtkOpenVRCamera objects > seems to do everything right. > > > I don't know how to adjust the clipping box / bounding box you mentioned. > Can you explain how I can do this, maybe this helps me to debug further? > > > Sincerely, > > Sebastian > > ------------------------------ > *Von:* vtkusers im Auftrag von Alvaro Sanchez < > alvaro.sanchez at kitware.com> > *Gesendet:* Mittwoch, 7. Dezember 2016 18:14 > *An:* polybos > *Cc:* VTK Users > *Betreff:* Re: [vtkusers] Distortions in Volumerendering in VR-Mode (HTC > Vive) > > Hi, > > I have never tested the GPUVolumeRCMapper with OpenVR but as far as I > remember Ken mentioned some time ago that he encountered a clipping/bbox > related issue when adjusting the volume's orientation and position. Could > you try rendering a volume with an identity matrix set as its > transformation?, this might give you a hint of what the mapper is doing > wrong. > > Cheers, > Alvaro > > On Wed, Dec 7, 2016 at 11:38 AM, polybos wrote: > >> Sebastian Heerwald wrote >> > If I look onto the volume rendering and move around it, there appear >> > "refraction" lines. >> >> Unfortunately I cannot help with this issue but I would also be very >> pleased >> if someone could help here. Or did you, Sebastian, already achieve some >> more >> insights into this problem? >> I also get such distortions on the HTC Vive when using >> vtkVolumeRayCastMapper, while everything seems perfectly well in a >> mesh-only >> rendering. >> >> Does anyone have similar issues? Maybe with Occulus Rift? As far as I >> understand Sebastian just test with a HTC Vive. At least I can only test >> with a HTC Vive. >> >> >> >> -- >> View this message in context: http://vtk.1045678.n5.nabble.c >> om/Distortions-in-Volumerendering-in-VR-Mode-HTC-Vive- >> tp5741338p5741457.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 >> > > > > -- > Alvaro Sanchez > Kitware, Inc. > Senior R&D Engineer > 21 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-881-4901 > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -- Ken Martin PhD Chairman & CFO Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 518 371 3971 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 ken.martin at kitware.com Thu Dec 8 09:21:37 2016 From: ken.martin at kitware.com (Ken Martin) Date: Thu, 8 Dec 2016 09:21:37 -0500 Subject: [vtkusers] Distortions in Volumerendering in VR-Mode (HTC Vive) In-Reply-To: References: <1481128708774-5741457.post@n5.nabble.com> Message-ID: > Since the OpenVR interface is a little bit hackish within VTK the only > thing that decides whether it renders for OpenVR or for normal 2D-Display > is whether we link against vtkOpenVR and vtkRenderingOpenVR modules or not. > > Ohh, actually that is a CMake option. If you turn VTK_OPENVR_OBJECT_FACTORY off then the normal rendering is the default and you can explicitly create OpenVR objects when/where you want them. Just make sure you create these 4 objects as the default factory will not create the OpenVR versions vtkOpenVRRenderWindow vtkOpenVRRenderer ren->SetActiveCamera(a vtkOpenVRCamera) renWin->SetInteractor(a vtkOpenVRRenderWindowInteractor); and when using OpenVR you need to start the OpenVR interactor otherwise it will not work. That is what I do for ParaView right now to support both on screen and VR in the same executable. > Everything code related is the same. > > > So to reply to your Question: > > > Could you try rendering a volume with an identity matrix set as its > transformation? > > > I've build this simple program and it only places a volume dataset within > the world without any transformation. The volume is directly given to the GPUVolumeRCMapper > without any transformation. In "2D"-Renderwindow everything is fine. Also > in anaglyph rendering I get a nice 3D View. > > But when I link against OpenVR module the view dependend distortions > appear within VR. I've tried some things. > > All I can say is, that the errors appear if I look at any edge or corner > of the surrounding (invisible) boundingbox around the rendered volume. If I > look directly on one side of the boundingbox everything seems fine. > > > The only thing I can imagine from this perspective is, that the GPUVolumeRCMapper > gets wrong view directions for the eyes. But the vtkOpenVRCamera objects > seems to do everything right. > > > I don't know how to adjust the clipping box / bounding box you mentioned. > Can you explain how I can do this, maybe this helps me to debug further? > > > Sincerely, > > Sebastian > > ------------------------------ > *Von:* vtkusers im Auftrag von Alvaro Sanchez < > alvaro.sanchez at kitware.com> > *Gesendet:* Mittwoch, 7. Dezember 2016 18:14 > *An:* polybos > *Cc:* VTK Users > *Betreff:* Re: [vtkusers] Distortions in Volumerendering in VR-Mode (HTC > Vive) > > Hi, > > I have never tested the GPUVolumeRCMapper with OpenVR but as far as I > remember Ken mentioned some time ago that he encountered a clipping/bbox > related issue when adjusting the volume's orientation and position. Could > you try rendering a volume with an identity matrix set as its > transformation?, this might give you a hint of what the mapper is doing > wrong. > > Cheers, > Alvaro > > On Wed, Dec 7, 2016 at 11:38 AM, polybos wrote: > >> Sebastian Heerwald wrote >> > If I look onto the volume rendering and move around it, there appear >> > "refraction" lines. >> >> Unfortunately I cannot help with this issue but I would also be very >> pleased >> if someone could help here. Or did you, Sebastian, already achieve some >> more >> insights into this problem? >> I also get such distortions on the HTC Vive when using >> vtkVolumeRayCastMapper, while everything seems perfectly well in a >> mesh-only >> rendering. >> >> Does anyone have similar issues? Maybe with Occulus Rift? As far as I >> understand Sebastian just test with a HTC Vive. At least I can only test >> with a HTC Vive. >> >> >> >> -- >> View this message in context: http://vtk.1045678.n5.nabble.c >> om/Distortions-in-Volumerendering-in-VR-Mode-HTC-Vive- >> tp5741338p5741457.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 >> > > > > -- > Alvaro Sanchez > Kitware, Inc. > Senior R&D Engineer > 21 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-881-4901 > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -- Ken Martin PhD Chairman & CFO Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 518 371 3971 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 kit.chambers.kc at gmail.com Thu Dec 8 09:50:28 2016 From: kit.chambers.kc at gmail.com (Kit Chambers) Date: Thu, 8 Dec 2016 14:50:28 +0000 Subject: [vtkusers] Internal data source memory leak Message-ID: <4F991BB8-2D9B-4FBF-A2D2-35EF574E5338@googlemail.com> Hi, For a variety of reasons I want to write a VTK filter which can take it input from a connection or an internal data source. I have come up with a method that works, but it is showing up a memory leak when i run with VTK_DEBUG_LEAKS=ON. Essentially I have a data source which looks something like this: class vtkDataSource : public vtkImageAlgorithm { public: ?. blah blah ? //! Set the internal data source virtual int SetInputData(vtkImageData* data) { this->InternalData=data; this->Modified(); return 1; } protected: vtkDataSource(){ this->SetNumberOfInputPorts(0); this->SetNumberOfOutputPorts(1); this->InternalData=nullptr; } ~vtkDataSource(){} int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *){ if(this->InternalData==nullptr){ vtkErrorMacro("no input data"); return 0; } vtkSmartPointer outData = vtkImageData::GetData(outputVector); outData->ShallowCopy(this->InternalData); return 1; } private: vtkSmartPointer InternalData; }; And then I have a filter which looks like this: class vtkInternalDataSourceFilter : public vtkImageAlgorithm { public: ? blah blah ... //! Set the internal data source virtual int SetInputData(vtkImageData* data) { this->InternalData = vtkSmartPointer::New(); this->InternalData->SetInputData(data); // This line triggers the memory leak this->SetInputConnection(0,this->InternalData->GetOutputPort(0)); this->Modified(); return 1; } protected: vtkInternalDataSourceFilter(){ this->SetNumberOfInputPorts(1); this->SetNumberOfOutputPorts(1); } ~vtkInternalDataSourceFilter(){} int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *){ vtkSmartPointer input = vtkImageData::GetData(inputVector[0],0); ? do something ? return 1; } private: vtkSmartPointer InternalData; }; You then run the filter using vtkSmartPointer flt = vtkSmartPointer::New(); flt->SetInputData(Img); flt->Update(); Specifically I get vtkDebugLeaks has detected LEAKS! Class "vtkDataSource" has 1 instance still around. Class "vtkCellData" has 2 instances still around. Class "vtkInformationIntegerVectorValue" has 3 instances still around. Class "vtkInformationVector" has 4 instances still around. Class "vtkPointData" has 2 instances still around. Class "vtkCompositeDataPipeline" has 1 instance still around. Class "vtkPoints" has 2 instances still around. Class "vtkInformation" has 16 instances still around. Class "vtkInformationIntegerPointerValue" has 2 instances still around. Class "vtkIdList" has 2 instances still around. Class "vtkDoubleArray" has 2 instances still around. Class "vtkAlgorithmOutput" has 1 instance still around. Class "vtkInformationIntegerValue" has 32 instances still around. Class "vtkImageData" has 2 instances still around. Class "vtkFloatArray" has 1 instance still around. Class "vtkInformationStringValue" has 1 instance still around. Class "vtkInformationExecutivePortVectorValue" has 1 instance still around. Class "vtkVoxel" has 2 instances still around. Class "vtkFieldData" has 2 instances still around. Class "vtkCommand or subclass" has 2 instances still around. Class "vtkInformationExecutivePortValue" has 1 instance still around. however if I run everything normally it works fine. // Create a data source vtkSmartPointer src = vtkSmartPointer::New(); src->SetInputData(Img); src->Update(); vtkSmartPointer flt = vtkSmartPointer::New(); lt->SetInputConnection(0,src->GetOutputPort(0)); flt->Update(); Any help would be appreciated and apologies for the large amount of code in this message. Kit From rustem.khabetdinov at gmail.com Thu Dec 8 10:30:20 2016 From: rustem.khabetdinov at gmail.com (Rustem Khabetdinov) Date: Thu, 8 Dec 2016 18:30:20 +0300 Subject: [vtkusers] Subactors Message-ID: Hello Is it possible to add a feature that allows to make sub actors for existing actors? For example, this would be useful when we want to make some labels on screen and remove them when parent actor was removed. Sincerely, Rustem Khabetdinov. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Thu Dec 8 10:32:03 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Thu, 8 Dec 2016 10:32:03 -0500 Subject: [vtkusers] Subactors In-Reply-To: References: Message-ID: vtkAssembly can be used for this kind of task. Best regards, Cory On Thu, Dec 8, 2016 at 10:30 AM, Rustem Khabetdinov wrote: > Hello > Is it possible to add a feature that allows to make sub actors for existing > actors? For example, this would be useful when we want to make some labels > on screen and remove them when parent actor was removed. > > Sincerely, > Rustem Khabetdinov. > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Cory Quammen Staff R&D Engineer Kitware, Inc. From rustem.khabetdinov at gmail.com Thu Dec 8 10:34:30 2016 From: rustem.khabetdinov at gmail.com (Rustem Khabetdinov) Date: Thu, 8 Dec 2016 18:34:30 +0300 Subject: [vtkusers] Multitexturing in OpenGL2 background Message-ID: Hello, Is it possible to make multitexturing work when using python wrapper? I tried to take OpenGL/Testing/Cxx/TestMultiTexturing.cxx and reimplement it using python wrapper and opengl2 background but all I got was a message that said "vtkOpenGLPolyDataMapper: Not implemented at this level.". Sincerely, Rustem Khabetdinov. -------------- next part -------------- An HTML attachment was scrubbed... URL: From colin at cdfh.org.uk Thu Dec 8 10:41:11 2016 From: colin at cdfh.org.uk (Colin Horne) Date: Thu, 8 Dec 2016 15:41:11 +0000 Subject: [vtkusers] Reorienting the reslice plane with vtkResliceImageViewer In-Reply-To: References: Message-ID: Hi all, In case it's of interest to anyone else, here's how I ended up solving my problem: // Note that all viewers share the same vtkResliceCursor instance, as par the FourPaneViewer example program. vtkResliceCursor *cursor = ...; double *ptrs[3] = { x_axis, y_axis, z_axis }; double *origin = ...; for (int i=0; i<3; ++i) { cursor->GetPlane(i)->SetNormal(ptrs[i]); cursor->GetPlane(i)->SetOrigin(origin); } cursor->SetCenter(origin); // Now call Render() on each viewer, as necessary. Cheers, Colin On 12 October 2016 at 00:07, Colin Horne wrote: > Hi all, > > I'm using the vtkResliceImageViewer class to display a 3D volume in oblique > mode, essentially as is done in the FourPaneViewer example program.The > reslice cursor widget lets me reorient a given reslice plane with the mouse, > but I would also like to set its orientation via the API. To this end, I > have tried: > > viewer->GetResliceCursor()->SetYAxis(yaxis); > viewer->GetResliceCursor()->Modified(); > viewer->Render(); > > where 'viewer' is an instance of vtkResliceImageViewer and 'yaxis' has type > double[3]. > > Unfortunately, however, the code has no effect on the orientation of the > slice. Indeed, after the call to Render(), calling GetYAxis() reveals that > the changes have been overwritten. > > I'm afraid that I'm entirely new to VTK, and so am perhaps missing something > embarrassingly obvious. I would be very grateful for any suggestions. I > should mention that I'm hoping there might be a solution that is compatible > with the existing vtkResliceCursorWidget (i.e., rather than using > vtkResliceImage directly), as I still need to allow reorienting via the > mouse. > > Many thanks! > > Colin From seun at rogue-research.com Thu Dec 8 13:50:37 2016 From: seun at rogue-research.com (Seun Odutola) Date: Thu, 8 Dec 2016 13:50:37 -0500 Subject: [vtkusers] vtkBillboardTextActor3D overlay effect desired. Message-ID: Hi everyone, I am currently trying out vtkBillboardTextActor3D and was hoping someone here could give me couple of pointers. I have a situation where I have a caption which is basically a text (vtkBillboardTextActor3D) paired with an electrode (vtkActor) on a Mesh. vtkBillboardTextActor3D gives the desired effect of always being oriented with the camera, it?s also occluded by the mesh if the camera rotates away from the electrode (which is fine) however depending on text (number of characters) I run into a situation where when rotating the scene (camera rotates) the bill board rotates the text in such a way in intersects the mesh (this is not desirable). I was wondering if there was a way to have the caption (the vtkBillboardTextActor3D) preserve its behaviour but still be able to have its text overlay on the mesh. See attached screenshots, notice how electrode 3 gets clipped as it intersects the mesh but when rotated it?s visible. link to screenshots: https://www.rogue-research.com/vtkBillboard1.png https://www.rogue-research.com/vtkBillboard2.png -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.lonie at kitware.com Thu Dec 8 14:13:04 2016 From: david.lonie at kitware.com (David Lonie) Date: Thu, 8 Dec 2016 14:13:04 -0500 Subject: [vtkusers] vtkBillboardTextActor3D overlay effect desired. In-Reply-To: References: Message-ID: Try vtkTextActor, it should give you what you want. vtkBillboardTextActor3D was written to behave like vtkTextActor but be embedded in the scene and interact with 3D geometry, while vtkTextActor will always be rendered as an overlay, on top of any 3D geometry. If you still want to hide the text when the anchor points are occluded, you probably want to use vtkLabeledDataMapper with vtkSelectVisiblePoints. You'll need to create a dataset with the anchor points, and add a vtkStringArray to the dataset's PointData that contains the labels. Then, call SetLabelMode(VTK_LABEL_FIELD_DATA) and vtkSetFieldDataName(stringArray->GetName()) on the mapper. HTH, Dave On Thu, Dec 8, 2016 at 1:50 PM, Seun Odutola wrote: > Hi everyone, > > I am currently trying out vtkBillboardTextActor3D and was hoping > someone here could give me couple of pointers. I have a situation where I > have a caption which is basically a text (vtkBillboardTextActor3D) paired > with an electrode (vtkActor) on a Mesh. vtkBillboardTextActor3D gives the > desired effect of always being oriented with the camera, it?s also occluded > by the mesh if the camera rotates away from the electrode (which is fine) > however depending on text (number of characters) I run into a situation > where when rotating the scene (camera rotates) the bill board rotates the > text in such a way in intersects the mesh (this is not desirable). I was > wondering if there was a way to have the caption (the > vtkBillboardTextActor3D) preserve its behaviour but still be able to have > its text overlay on the mesh. See attached screenshots, notice how > electrode 3 gets clipped as it intersects the mesh but when rotated it?s > visible. > > link to screenshots: > https://www.rogue-research.com/vtkBillboard1.png > https://www.rogue-research.com/vtkBillboard2.png > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdrahos at aurisrobotics.com Thu Dec 8 16:43:55 2016 From: mdrahos at aurisrobotics.com (Miroslav Drahos) Date: Thu, 8 Dec 2016 21:43:55 +0000 Subject: [vtkusers] interactor with one renwin and multiple renderers Message-ID: Hi VTK folks, I am trying to optimize my application, and am thinking to replace multiple QVTKWidget2 instances with only one widget + multiple viewports/renderers. Then I could issue only one expensive call to vtkRenderWindow::Render() and re-draw everything. I saw the example for multiple viewports (http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/MultipleViewports) and it all looks very straightforward, but... How do I handle interaction? Let's say in a typical quad view setup of a medical application, with 3 orthogonal slices and one 3D view there are different interactor styles needed. But it is the renderwindow that provides interactor, so in the tiled version I would end up with only one common interactor/interactor style. Any advice is greatly appreciated! Miro -------------- next part -------------- An HTML attachment was scrubbed... URL: From spir.robert at gmail.com Thu Dec 8 23:49:10 2016 From: spir.robert at gmail.com (=?iso-8859-2?B?UvNiZXJ0IKlwaXI=?=) Date: Fri, 9 Dec 2016 05:49:10 +0100 Subject: [vtkusers] interactor with one renwin and multiple renderers In-Reply-To: References: Message-ID: <000901d251d7$9532d240$bf9876c0$@gmail.com> Hi Miro, I'm doing similar task. You can derive your own interactorstyle class from one of the vtkInteractorStyle classes. There you can override mouse and key event functions and using this->Interactor->FindPokedRenderer(mouseX, mouseY); you can detect to which of the multiple renderers the user clicked and handle the interaction according to your needs. Robert From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Miroslav Drahos Sent: Thursday, December 8, 2016 10:44 PM To: vtkusers at vtk.org Subject: [vtkusers] interactor with one renwin and multiple renderers Hi VTK folks, I am trying to optimize my application, and am thinking to replace multiple QVTKWidget2 instances with only one widget + multiple viewports/renderers. Then I could issue only one expensive call to vtkRenderWindow::Render() and re-draw everything. I saw the example for multiple viewports (http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/MultipleViewports) and it all looks very straightforward, but... How do I handle interaction? Let's say in a typical quad view setup of a medical application, with 3 orthogonal slices and one 3D view there are different interactor styles needed. But it is the renderwindow that provides interactor, so in the tiled version I would end up with only one common interactor/interactor style. Any advice is greatly appreciated! Miro -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjordan at live.at Fri Dec 9 07:19:50 2016 From: mjordan at live.at (M. Jordan) Date: Fri, 9 Dec 2016 12:19:50 +0000 Subject: [vtkusers] Compute Concave Hull in VTK Message-ID: Hi, i would like to compute the concave (not convex!) hull of a vtk polydata surface. I have a brain model and would like to get a flat surface without furrows. I tried vtkDelaunay3D with some values for alpha and subsequently a geometry filter to get the surface, but the result is not that good. (the surface isn't closed and i think that there are some triangles inside the surface). Is there another method to compute the concave hull? Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From ptbauman at gmail.com Fri Dec 9 10:36:20 2016 From: ptbauman at gmail.com (Paul T. Bauman) Date: Fri, 9 Dec 2016 10:36:20 -0500 Subject: [vtkusers] Build VTK without OpenGL and with MPI Message-ID: Greetings, I'm updating my build script for VTK. Ala the discussion in this thread, http://public.kitware.com/pipermail/vtkusers/2016-December/097359.html I would like to build VTK with MPI enabled. However, the (automated testing) server I'm building VTK on does not have OpenGL on it (we're not doing rendering or anything, just I/O of VTK formats for visualization using ParaView). Previously, before needing MPI, the following CMake options got the job done for me: cmake \ -DBUILD_SHARED_LIBS:BOOL=ON \ -DCMAKE_INSTALL_PREFIX:PATH=$VTK_DIR \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DBUILD_EXAMPLES:BOOL=OFF \ -DBUILD_TESTING:BOOL=OFF \ -DVTK_BUILD_ALL_MODULES_FOR_TESTS:BOOL=OFF \ -DVTK_Group_Rendering:BOOL=OFF \ -DVTK_Group_StandAlone:BOOL=OFF \ -DModule_vtkCommonCore:BOOL=ON \ -DModule_vtkCommonDataModel:BOOL=ON \ $BUILDDIR/VTK-$VTK_VERSION However, if I now add -DVTK_Group_MPI:BOOL=ON, then it seems to re-enable OpenGL in my CMake build script. Anyway to have both? Thanks for any suggestions. Best, Paul P.S. I'm a CMake newb, so I'm happy to be pointed to a command to list the options I can specify to the cmake command to try and figure it out for myself without having to bug the list, i.e. an analog to Autotools `configure --help`. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Fri Dec 9 12:06:05 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Fri, 9 Dec 2016 12:06:05 -0500 Subject: [vtkusers] Build VTK without OpenGL and with MPI In-Reply-To: References: Message-ID: -- * vtkFiltersParallelDIY2, needed by VTK_Group_MPI. -- * vtkFiltersParallelGeometry, needed by VTK_Group_MPI. -- * vtkFiltersParallelMPI, needed by VTK_Group_MPI. -- * vtkIOMPIImage, needed by VTK_Group_MPI. -- * vtkIOMPIParallel, needed by VTK_Group_MPI. -- * vtkIOParallelNetCDF, needed by VTK_Group_MPI. vtkRenderingCore is needed by vtkFiltersParallel vtkFiltersParallel is needed by vtkFiltersParallelMPI On Fri, Dec 9, 2016 at 10:36 AM, Paul T. Bauman wrote: > Greetings, > > I'm updating my build script for VTK. Ala the discussion in this thread, > http://public.kitware.com/pipermail/vtkusers/2016-December/097359.html I > would like to build VTK with MPI enabled. However, the (automated testing) > server I'm building VTK on does not have OpenGL on it (we're not doing > rendering or anything, just I/O of VTK formats for visualization using > ParaView). Previously, before needing MPI, the following CMake options got > the job done for me: > > cmake \ > -DBUILD_SHARED_LIBS:BOOL=ON \ > -DCMAKE_INSTALL_PREFIX:PATH=$VTK_DIR \ > -DCMAKE_BUILD_TYPE:STRING=Release \ > -DBUILD_EXAMPLES:BOOL=OFF \ > -DBUILD_TESTING:BOOL=OFF \ > -DVTK_BUILD_ALL_MODULES_FOR_TESTS:BOOL=OFF \ > -DVTK_Group_Rendering:BOOL=OFF \ > -DVTK_Group_StandAlone:BOOL=OFF \ > -DModule_vtkCommonCore:BOOL=ON \ > -DModule_vtkCommonDataModel:BOOL=ON \ > $BUILDDIR/VTK-$VTK_VERSION > > However, if I now add -DVTK_Group_MPI:BOOL=ON, then it seems to re-enable > OpenGL in my CMake build script. Anyway to have both? > > Thanks for any suggestions. > > Best, > > Paul > > P.S. I'm a CMake newb, so I'm happy to be pointed to a command to list the > options I can specify to the cmake command to try and figure it out for > myself without having to bug the list, i.e. an analog to Autotools > `configure --help`. > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Unpaid intern in BillsBasement at noware dot com From David.Edmunds at icr.ac.uk Fri Dec 9 12:35:59 2016 From: David.Edmunds at icr.ac.uk (David Edmunds) Date: Fri, 9 Dec 2016 17:35:59 +0000 Subject: [vtkusers] Monitoring progress of vtkIterativeClosestPointTransform Message-ID: <0AA8C14B-D6CC-4A60-A13E-FF83242309FA@icr.ac.uk> Hi all, I am using vtkIterativeClosestPointTransform to register two objects together. I would like to monitor the progress of this transform (i.e. number of completed iterations / maximum number of iterations), so that I can create a GUI progress dialog. Does anyone know how to do this? Kind regards, Dave Edmunds The Institute of Cancer Research: Royal Cancer Hospital, a charitable Company Limited by Guarantee, Registered in England under Company No. 534147 with its Registered Office at 123 Old Brompton Road, London SW7 3RP. This e-mail message is confidential and for use by the addressee only. If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer and network. From giovanna.maria.dimitri at gmail.com Fri Dec 9 14:38:21 2016 From: giovanna.maria.dimitri at gmail.com (Giovanna Maria Dimitri) Date: Fri, 9 Dec 2016 20:38:21 +0100 Subject: [vtkusers] HELP IN vtk Use Message-ID: Hello, I have downloaded and installed Vtk and ITK in my computer Mac Airbook Pro. I have two issues: 1) When using Vtk I get an error with all the examples that is that I can't find the libvtkDomainsChemistryOpenGL2-7.1.1.dylib library, how can I get it? 2) when running the examples with itkvtkglue it can't find the package even though I have correctly said it as on during installation and I can also see the package in the right directory installed. What can I do? thanks in advance! Giovanna -------------- next part -------------- An HTML attachment was scrubbed... URL: From ptbauman at gmail.com Fri Dec 9 14:54:15 2016 From: ptbauman at gmail.com (Paul T. Bauman) Date: Fri, 9 Dec 2016 14:54:15 -0500 Subject: [vtkusers] Build VTK without OpenGL and with MPI In-Reply-To: References: Message-ID: On Fri, Dec 9, 2016 at 12:06 PM, Bill Lorensen wrote: > -- * vtkFiltersParallelDIY2, needed by VTK_Group_MPI. > -- * vtkFiltersParallelGeometry, needed by VTK_Group_MPI. > -- * vtkFiltersParallelMPI, needed by VTK_Group_MPI. > -- * vtkIOMPIImage, needed by VTK_Group_MPI. > -- * vtkIOMPIParallel, needed by VTK_Group_MPI. > -- * vtkIOParallelNetCDF, needed by VTK_Group_MPI. > > > vtkRenderingCore is needed by vtkFiltersParallel > vtkFiltersParallel is needed by vtkFiltersParallelMPI > Thank you for pointing out this dependency. Since I only need, presumably, the I/O portions of MPI and not the imaging, it is possible to enable only those parts? Or is vtkFiltersParallelMPI not negotiable for any MPI capabilities in VTK? I've just now tried cmake \ -DBUILD_SHARED_LIBS:BOOL=ON \ -DCMAKE_INSTALL_PREFIX:PATH=$VTK_DIR \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DBUILD_EXAMPLES:BOOL=OFF \ -DBUILD_TESTING:BOOL=OFF \ -DVTK_BUILD_ALL_MODULES_FOR_TESTS:BOOL=OFF \ -DVTK_Group_Rendering:BOOL=OFF \ -DVTK_Group_StandAlone:BOOL=OFF \ -DModule_vtkCommonCore:BOOL=ON \ -DModule_vtkCommonDataModel:BOOL=ON \ -DModule_vtkIOMPIParallel:BOOL=ON \ $BUILDDIR/VTK-$VTK_VERSION which gave me (extracting only the last few lines) -- Found MPI_C: /femputer/pbauman/swstack/libs/mpich/3.1.4/gcc/6.2.0/lib/libmpi.so -- Found MPI_CXX: /femputer/pbauman/swstack/libs/mpich/3.1.4/gcc/6.2.0/lib/libmpicxx.so;/femputer/pbauman/swstack/libs/mpich/3.1.4/gcc/6.2.0/lib/libmpi.so CMake Error at IO/MPIParallel/CMakeLists.txt:15 (vtk_add_override): Unknown CMake command "vtk_add_override". -- Configuring incomplete, errors occurred! See also "/femputer/pbauman/swstack/builddir/vtk-VQfIYE/build/CMakeFiles/CMakeOutput.log". See also "/femputer/pbauman/swstack/builddir/vtk-VQfIYE/build/CMakeFiles/CMakeError.log". Thanks again. > On Fri, Dec 9, 2016 at 10:36 AM, Paul T. Bauman > wrote: > > Greetings, > > > > I'm updating my build script for VTK. Ala the discussion in this thread, > > http://public.kitware.com/pipermail/vtkusers/2016-December/097359.html I > > would like to build VTK with MPI enabled. However, the (automated > testing) > > server I'm building VTK on does not have OpenGL on it (we're not doing > > rendering or anything, just I/O of VTK formats for visualization using > > ParaView). Previously, before needing MPI, the following CMake options > got > > the job done for me: > > > > cmake \ > > -DBUILD_SHARED_LIBS:BOOL=ON \ > > -DCMAKE_INSTALL_PREFIX:PATH=$VTK_DIR \ > > -DCMAKE_BUILD_TYPE:STRING=Release \ > > -DBUILD_EXAMPLES:BOOL=OFF \ > > -DBUILD_TESTING:BOOL=OFF \ > > -DVTK_BUILD_ALL_MODULES_FOR_TESTS:BOOL=OFF \ > > -DVTK_Group_Rendering:BOOL=OFF \ > > -DVTK_Group_StandAlone:BOOL=OFF \ > > -DModule_vtkCommonCore:BOOL=ON \ > > -DModule_vtkCommonDataModel:BOOL=ON \ > > $BUILDDIR/VTK-$VTK_VERSION > > > > However, if I now add -DVTK_Group_MPI:BOOL=ON, then it seems to re-enable > > OpenGL in my CMake build script. Anyway to have both? > > > > Thanks for any suggestions. > > > > Best, > > > > Paul > > > > P.S. I'm a CMake newb, so I'm happy to be pointed to a command to list > the > > options I can specify to the cmake command to try and figure it out for > > myself without having to bug the list, i.e. an analog to Autotools > > `configure --help`. > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Please keep messages on-topic and check the VTK FAQ at: > > http://www.vtk.org/Wiki/VTK_FAQ > > > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/vtkusers > > > > > > -- > Unpaid intern in BillsBasement at noware dot com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Fri Dec 9 15:11:43 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Fri, 9 Dec 2016 15:11:43 -0500 Subject: [vtkusers] Build VTK without OpenGL and with MPI In-Reply-To: References: Message-ID: Don't turn on the MPI group. Just turn on the MIP modules you want. On Fri, Dec 9, 2016 at 2:54 PM, Paul T. Bauman wrote: > > > On Fri, Dec 9, 2016 at 12:06 PM, Bill Lorensen > wrote: >> >> -- * vtkFiltersParallelDIY2, needed by VTK_Group_MPI. >> -- * vtkFiltersParallelGeometry, needed by VTK_Group_MPI. >> -- * vtkFiltersParallelMPI, needed by VTK_Group_MPI. >> -- * vtkIOMPIImage, needed by VTK_Group_MPI. >> -- * vtkIOMPIParallel, needed by VTK_Group_MPI. >> -- * vtkIOParallelNetCDF, needed by VTK_Group_MPI. >> >> >> vtkRenderingCore is needed by vtkFiltersParallel >> vtkFiltersParallel is needed by vtkFiltersParallelMPI > > > Thank you for pointing out this dependency. Since I only need, presumably, > the I/O portions of MPI and not the imaging, it is possible to enable only > those parts? Or is vtkFiltersParallelMPI not negotiable for any MPI > capabilities in VTK? I've just now tried > > cmake \ > -DBUILD_SHARED_LIBS:BOOL=ON \ > -DCMAKE_INSTALL_PREFIX:PATH=$VTK_DIR \ > -DCMAKE_BUILD_TYPE:STRING=Release \ > -DBUILD_EXAMPLES:BOOL=OFF \ > -DBUILD_TESTING:BOOL=OFF \ > -DVTK_BUILD_ALL_MODULES_FOR_TESTS:BOOL=OFF \ > -DVTK_Group_Rendering:BOOL=OFF \ > -DVTK_Group_StandAlone:BOOL=OFF \ > -DModule_vtkCommonCore:BOOL=ON \ > -DModule_vtkCommonDataModel:BOOL=ON \ > -DModule_vtkIOMPIParallel:BOOL=ON \ > $BUILDDIR/VTK-$VTK_VERSION > > which gave me (extracting only the last few lines) > > > -- Found MPI_C: > /femputer/pbauman/swstack/libs/mpich/3.1.4/gcc/6.2.0/lib/libmpi.so > -- Found MPI_CXX: > /femputer/pbauman/swstack/libs/mpich/3.1.4/gcc/6.2.0/lib/libmpicxx.so;/femputer/pbauman/swstack/libs/mpich/3.1.4/gcc/6.2.0/lib/libmpi.so > CMake Error at IO/MPIParallel/CMakeLists.txt:15 (vtk_add_override): > Unknown CMake command "vtk_add_override". > > > -- Configuring incomplete, errors occurred! > See also > "/femputer/pbauman/swstack/builddir/vtk-VQfIYE/build/CMakeFiles/CMakeOutput.log". > See also > "/femputer/pbauman/swstack/builddir/vtk-VQfIYE/build/CMakeFiles/CMakeError.log". > > > Thanks again. > >> >> On Fri, Dec 9, 2016 at 10:36 AM, Paul T. Bauman >> wrote: >> > Greetings, >> > >> > I'm updating my build script for VTK. Ala the discussion in this thread, >> > http://public.kitware.com/pipermail/vtkusers/2016-December/097359.html I >> > would like to build VTK with MPI enabled. However, the (automated >> > testing) >> > server I'm building VTK on does not have OpenGL on it (we're not doing >> > rendering or anything, just I/O of VTK formats for visualization using >> > ParaView). Previously, before needing MPI, the following CMake options >> > got >> > the job done for me: >> > >> > cmake \ >> > -DBUILD_SHARED_LIBS:BOOL=ON \ >> > -DCMAKE_INSTALL_PREFIX:PATH=$VTK_DIR \ >> > -DCMAKE_BUILD_TYPE:STRING=Release \ >> > -DBUILD_EXAMPLES:BOOL=OFF \ >> > -DBUILD_TESTING:BOOL=OFF \ >> > -DVTK_BUILD_ALL_MODULES_FOR_TESTS:BOOL=OFF \ >> > -DVTK_Group_Rendering:BOOL=OFF \ >> > -DVTK_Group_StandAlone:BOOL=OFF \ >> > -DModule_vtkCommonCore:BOOL=ON \ >> > -DModule_vtkCommonDataModel:BOOL=ON \ >> > $BUILDDIR/VTK-$VTK_VERSION >> > >> > However, if I now add -DVTK_Group_MPI:BOOL=ON, then it seems to >> > re-enable >> > OpenGL in my CMake build script. Anyway to have both? >> > >> > Thanks for any suggestions. >> > >> > Best, >> > >> > Paul >> > >> > P.S. I'm a CMake newb, so I'm happy to be pointed to a command to list >> > the >> > options I can specify to the cmake command to try and figure it out for >> > myself without having to bug the list, i.e. an analog to Autotools >> > `configure --help`. >> > >> > _______________________________________________ >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at >> > http://www.kitware.com/opensource/opensource.html >> > >> > Please keep messages on-topic and check the VTK FAQ at: >> > http://www.vtk.org/Wiki/VTK_FAQ >> > >> > Search the list archives at: http://markmail.org/search/?q=vtkusers >> > >> > Follow this link to subscribe/unsubscribe: >> > http://public.kitware.com/mailman/listinfo/vtkusers >> > >> >> >> >> -- >> Unpaid intern in BillsBasement at noware dot com > > -- Unpaid intern in BillsBasement at noware dot com From mdrahos at aurisrobotics.com Fri Dec 9 16:27:03 2016 From: mdrahos at aurisrobotics.com (Miroslav Drahos) Date: Fri, 9 Dec 2016 21:27:03 +0000 Subject: [vtkusers] interactor with one renwin and multiple renderers In-Reply-To: <000901d251d7$9532d240$bf9876c0$@gmail.com> References: , <000901d251d7$9532d240$bf9876c0$@gmail.com> Message-ID: Hi Robert, thanks for the reply, it makes sense. From your experience, would you say it is worth the effort for ~6 views? Would you say the performance improvement is noticeable and worth the extra effort? I did some experiments, and I get a bit of a delay on interaction; between the mouse down and the scene starting to rotate (using stock vtkInteractorStyleTrackballCamera for now). I am guessing it may be the FindPokedRenderer() taking time to figure out which renderer the interaction falls into... Some of my viewports also have a vtkOrientationMarkerWidget, which creates its own renderer, and a couple views have overlay (non-interactive) renderer as well, so the total number of renderers is even higher, maybe 12 altogether. Thank you! Miro ________________________________ From: R?bert ?pir Sent: Thursday, December 8, 2016 8:49:10 PM To: Miroslav Drahos; vtkusers at vtk.org Subject: RE: [vtkusers] interactor with one renwin and multiple renderers Hi Miro, I'm doing similar task. You can derive your own interactorstyle class from one of the vtkInteractorStyle classes. There you can override mouse and key event functions and using this->Interactor->FindPokedRenderer(mouseX, mouseY); you can detect to which of the multiple renderers the user clicked and handle the interaction according to your needs. Robert From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Miroslav Drahos Sent: Thursday, December 8, 2016 10:44 PM To: vtkusers at vtk.org Subject: [vtkusers] interactor with one renwin and multiple renderers Hi VTK folks, I am trying to optimize my application, and am thinking to replace multiple QVTKWidget2 instances with only one widget + multiple viewports/renderers. Then I could issue only one expensive call to vtkRenderWindow::Render() and re-draw everything. I saw the example for multiple viewports (http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/MultipleViewports) and it all looks very straightforward, but... How do I handle interaction? Let's say in a typical quad view setup of a medical application, with 3 orthogonal slices and one 3D view there are different interactor styles needed. But it is the renderwindow that provides interactor, so in the tiled version I would end up with only one common interactor/interactor style. Any advice is greatly appreciated! Miro -------------- next part -------------- An HTML attachment was scrubbed... URL: From chesterdavidb at gmail.com Fri Dec 9 17:04:11 2016 From: chesterdavidb at gmail.com (thorbjorn88) Date: Fri, 9 Dec 2016 15:04:11 -0700 (MST) Subject: [vtkusers] converting 32bit application to 64bit causes VTK problems Message-ID: <1481321051229-5741487.post@n5.nabble.com> I'm trying to build an application which was originally written for 32 bit with 64 bit for memory needs. This application uses Qt 4.8.5 and VTK 6.1. I am using 64 bit versions of those libraries which in general seem to be working. There are about 5 VTK functions which are giving unresolved external errors despite all other VTK externals working correctly. One function causes these errors. Why is this unresolved when other externals work? Why does it think I'm trying to use (int,int,int *) as my arguments when I'm clearly using (int,int,vtkIdType*)? Error 2 error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __cdecl vtkPolyData::InsertNextCell(int,int,int *)" (__imp_?InsertNextCell at vtkPolyData@@QEAAHHHPEAH at Z) Error 1 error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __cdecl vtkPolyData::InsertNextCell(int,int,int *)" (__imp_?InsertNextCell at vtkPolyData@@QEAAHHHPEAH at Z) referenced in function "public: void __cdecl cailAcu::loadAcu(class QString,class QVector &)" (?loadAcu at cailAcu@@QEAAXVQString@@AEAV?$QVector at PEAVvtkDataSet@@@@@Z the code these erros reference is as follows vtkIdType * id = new vtkIdType[numPoints]; for (vtkIdType i = 0; iAllocate(1,1); for(int x=0; xInsertNextCell(2, numPoints, id); //old function used for inserting a scan per cell dataSet->InsertNextCell(2, 1, &id[x]); } -- View this message in context: http://vtk.1045678.n5.nabble.com/converting-32bit-application-to-64bit-causes-VTK-problems-tp5741487.html Sent from the VTK - Users mailing list archive at Nabble.com. From Aude.CHENET-ext at galderma.com Fri Dec 9 11:30:36 2016 From: Aude.CHENET-ext at galderma.com (CHENET Aude (External)) Date: Fri, 9 Dec 2016 16:30:36 +0000 Subject: [vtkusers] [VTKImage] Blend a resized picture Message-ID: <512AA6AA7E7E224A874888677C6CB2FB5DA80C@WWEURMBX03.galderma.com> Hello team, I'm working on the blender module between 2 objects: - A VTKImageData - A VTKImageCanvasSource2D Then I blend the objets : blend = vtk.vtkImageBlend() blend.AddInputConnection(canvasOutputPort) blend.AddInputConnection(imageOutputPort) Every things works well except rendering speed (about 1 sec because the main picture is a 8000x8000 tiff) Then, I'm working on a resizer (VTKImageResize). If I use the resizer on the VTKImageData, its AlgorithmOutput decrease the Reference Count value (2 to 1) ie: canvasOutputPort: vtkAlgorithmOutput: vtkAlgorithmOutput (000000000B0390C0) Debug: Off Modified Time: 6905 Reference Count: 2 imageOutputPort: vtkAlgorithmOutput: vtkAlgorithmOutput (000000000B039EC0) Debug: Off Modified Time: 6782 Reference Count: 1 Then, I've got a Python crash at the line : blend.AddInputConnection(imageOutputPort). ? It's look like VTK can't blend 2 OutputPort with a Reference Count value different. Is it true ?? Have you got an idea to understand the problem and solve it ?? Thanks a lot Aude -------------- next part -------------- An HTML attachment was scrubbed... URL: From mlwzsy at gmail.com Sat Dec 10 08:19:47 2016 From: mlwzsy at gmail.com (Levi Max) Date: Sat, 10 Dec 2016 21:19:47 +0800 Subject: [vtkusers] volume rendering transfer function adjustment Message-ID: hello,everyone i have some doubts about transfer function adjustment in volume rendering. i employ 1D piece-wise linearly TF. i can get some kidney result similar to GE's. however, when trying to get heart rendering results, i cannot get a result like GE or SIMENS dose, either losing ventricle part or misty result with no surface feeling. what can i do to enhance my result? need your help. Thank U -------------- next part -------------- An HTML attachment was scrubbed... URL: From spir.robert at gmail.com Sat Dec 10 10:01:57 2016 From: spir.robert at gmail.com (=?iso-8859-2?B?UvNiZXJ0IKlwaXI=?=) Date: Sat, 10 Dec 2016 16:01:57 +0100 Subject: [vtkusers] interactor with one renwin and multiple renderers In-Reply-To: References: , <000901d251d7$9532d240$bf9876c0$@gmail.com> Message-ID: <004201d252f6$5ac8fec0$105afc40$@gmail.com> I have two main renderers and two overlay renderers. The main renderers contain multiple actors with 100+ k polygons and volume rendering and everything is fast and without delay (on nvidia gtx770). I'm also using point picking that calls FindPokedRenderer on every mouse move without any problems. Which os and qt version are you using? There is some problem with qt 5.5 in latest ubuntu that is causing delays with mouse interection. I'm using qt5.7 from https://launchpad.net/~beineri/+archive/ubuntu/opt-qt57-xenial Robert From: Miroslav Drahos [mailto:mdrahos at aurisrobotics.com] Sent: Friday, December 9, 2016 10:27 PM To: R?bert ?pir ; vtkusers at vtk.org Subject: Re: [vtkusers] interactor with one renwin and multiple renderers Hi Robert, thanks for the reply, it makes sense. From your experience, would you say it is worth the effort for ~6 views? Would you say the performance improvement is noticeable and worth the extra effort? I did some experiments, and I get a bit of a delay on interaction; between the mouse down and the scene starting to rotate (using stock vtkInteractorStyleTrackballCamera for now). I am guessing it may be the FindPokedRenderer() taking time to figure out which renderer the interaction falls into... Some of my viewports also have a vtkOrientationMarkerWidget, which creates its own renderer, and a couple views have overlay (non-interactive) renderer as well, so the total number of renderers is even higher, maybe 12 altogether. Thank you! Miro _____ From: R?bert ?pir > Sent: Thursday, December 8, 2016 8:49:10 PM To: Miroslav Drahos; vtkusers at vtk.org Subject: RE: [vtkusers] interactor with one renwin and multiple renderers Hi Miro, I'm doing similar task. You can derive your own interactorstyle class from one of the vtkInteractorStyle classes. There you can override mouse and key event functions and using this->Interactor->FindPokedRenderer(mouseX, mouseY); you can detect to which of the multiple renderers the user clicked and handle the interaction according to your needs. Robert From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Miroslav Drahos Sent: Thursday, December 8, 2016 10:44 PM To: vtkusers at vtk.org Subject: [vtkusers] interactor with one renwin and multiple renderers Hi VTK folks, I am trying to optimize my application, and am thinking to replace multiple QVTKWidget2 instances with only one widget + multiple viewports/renderers. Then I could issue only one expensive call to vtkRenderWindow::Render() and re-draw everything. I saw the example for multiple viewports (http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/MultipleViewports) and it all looks very straightforward, but... How do I handle interaction? Let's say in a typical quad view setup of a medical application, with 3 orthogonal slices and one 3D view there are different interactor styles needed. But it is the renderwindow that provides interactor, so in the tiled version I would end up with only one common interactor/interactor style. Any advice is greatly appreciated! Miro -------------- next part -------------- An HTML attachment was scrubbed... URL: From f_magician at mac.com Sat Dec 10 10:35:57 2016 From: f_magician at mac.com (Magician) Date: Sun, 11 Dec 2016 00:35:57 +0900 Subject: [vtkusers] vtk.vtkDistributedDataFilter() not works In-Reply-To: References: <1C21FF27-6B83-4CD1-9577-D72E1B2A0092@mac.com> Message-ID: Hi Cory, Sorry for my late reply. I modified my code for splitting the points, but the filter doesn?t work. import vtk src = vtk.vtkPointSource() src.SetCenter((0.0, 0.0, 0.0)) src.SetNumberOfPoints(1000) src.SetRadius(1.0) src.Update() dst = vtk.vtkPolyData() pts = vtk.vtkPoints() pts.SetData(src.GetOutput().GetPoints().GetData()) dst.SetPoints(pts) cells = vtk.vtkCellArray() for i in range(src.GetOutput().GetNumberOfPoints()): ptIds = vtk.vtkIdList() ptIds.InsertNextId(i) cells.InsertNextCell(ptIds) dst.SetVerts(cells) d3 = vtk.vtkDistributedDataFilter() d3.UseMinimalMemoryOff() d3.SetInputData(dst) d3.SetBoundaryMode(0) d3.SetBoundaryModeToSplitBoundaryCells() d3.Update() writer = vtk.vtkXMLPUnstructuredGridWriter() writer.SetInputData(d3.GetOutput()) writer.SetFileName(?test.pvtu?) writer.SetNumberOfPieces(2) writer.WriteSummaryFileOn() writer.SetStartPiece(0) writer.SetEndPiece(1) writer.Write() Magician > On Dec 6, 2016, at 01:33, Cory Quammen wrote: > > I'm not 100% sure of this, but the vtkPointSource produces an output > with only 1 cell. That may not be partitionable by the > vtkDistributeDataFilter. You shouldn't get duplicate output in each > piece, but let's not worry about that for now. > > Try swapping out the vtkPointSource with a vtkSphereSource and see if > the data is partitioned. > > HTH, > Cory > > On Sat, Dec 3, 2016 at 8:57 PM, Magician wrote: >> Hi Cory, >> >> >> Thanks for your advice. >> >> Hmmm...I already run the script with MPI. >> The attached script is a minimal sample. >> >> >> If I execute it, pvtu file is exported. >> But the all piece sources are exactly same, and not partitioned. >> >> >> >> Magician >> >> >>> On Nov 28, 2016, at 06:19, Cory Quammen wrote: >>> >>> I think you need to run your script in parallel with MPI for the >>> partitioning to work. See [1] for an example of how to use this >>> filter. >>> >>> Hope that helps, >>> Cory >>> >>> [1] http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=Filters/Parallel/Testing/Cxx/DistributedData.cxx >>> >>> On Sun, Nov 27, 2016 at 10:39 AM, Magician wrote: >>>> Does anyone use the vtkDistributedDataFilter? >>>> >>>> >>>> On Nov 19, 2016, at 18:16, Magician wrote: >>>> >>>> Hi all, >>>> >>>> >>>> I posted the message about partitioning datasets. >>>> >>>> >>>> I still trying vtk.vtkDistributedDataFilter(), but the exported data aren?t >>>> partitioned. >>>> My VTK version is 7.1.0 (pvpython with ParaView 5.2.0 RC3) and executing on >>>> 2 CPUs. >>>> >>>> Here is the sample code: >>>> >>>> import vtk >>>> >>>> source = vtk.vtkPointSource() >>>> source.SetCenter((0.0, 0.0, 0.0)) >>>> source.SetNumberOfPoints(1000000) >>>> source.SetRadius(1.0) >>>> source.Update() >>>> >>>> d3 = vtk.vtkDistributedDataFilter() >>>> d3.SetInputData(source.GetOutput()) >>>> d3.SetBoundaryMode(0) >>>> d3.Update() >>>> >>>> writer = vtk.vtkXMLPUnstructuredGridWriter() >>>> writer.SetInputData(d3.GetOutput()) >>>> writer.SetFileName(?test.pvtu?) >>>> writer.SetNumberOfPieces(2) >>>> writer.WriteSummaryFileOn() >>>> writer.SetStartPiece(0) >>>> writer.SetEndPiece(1) >>>> writer.Write() >>>> >>>> How to partition data? >>>> >>>> >>>> Magician From lasso at queensu.ca Sat Dec 10 14:43:00 2016 From: lasso at queensu.ca (Andras Lasso) Date: Sat, 10 Dec 2016 19:43:00 +0000 Subject: [vtkusers] Compute Concave Hull in VTK In-Reply-To: References: Message-ID: We've tried alpha shapes option of vtkDelanay3D several times but it always failed on our data. If you need flat brain surface without furrows, one option is to convert your mesh to image and apply morphological opening with 10mm kernel size. If you want to play with this without coding then you can use 3D Slicer's Segmentation module (import your mesh in Segmentations module, select Smoothing effect in Segment editor module, choose Closing (fill holes) effect and set 10mm for kernel size). Andras From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of M. Jordan Sent: December 9, 2016 7:20 To: vtkusers at vtk.org Subject: [vtkusers] Compute Concave Hull in VTK Hi, i would like to compute the concave (not convex!) hull of a vtk polydata surface. I have a brain model and would like to get a flat surface without furrows. I tried vtkDelaunay3D with some values for alpha and subsequently a geometry filter to get the surface, but the result is not that good. (the surface isn't closed and i think that there are some triangles inside the surface). Is there another method to compute the concave hull? Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From hjchen.work at gmail.com Sat Dec 10 22:06:39 2016 From: hjchen.work at gmail.com (hchen) Date: Sat, 10 Dec 2016 20:06:39 -0700 (MST) Subject: [vtkusers] switching from PyQt4 to PySide question Message-ID: <1481425599902-5741493.post@n5.nabble.com> Hello, I'm trying to figure out how to switch from PyQt4 to PySide for my VTK program. From what I heard, it should be straight forward. But, when I took the example: http://www.vtk.org/Wiki/VTK/Examples/Python/Widgets/EmbedPyQt and replaced: from PyQt4 import QtCore, QtGui by: from PySide import QtCore, QtGui I got this error: self.vtkWidget = QVTKRenderWindowInteractor(self.frame) File "/usr/local/lib/python3.5/site-packages/vtk/qt/QVTKRenderWindowInteractor.py", line 204, in __init__ QWidget.__init__(self, parent, wflags|Qt.MSWindowsOwnDC) TypeError: QWidget(QWidget parent=None, Qt.WindowFlags flags=0): argument 1 has unexpected type 'PySide.QtGui.QFrame' Can anyone please points out why is the error and what's involved in making the switch? Do I need to remove PyQt and recompile VTK? And, I am on Ubuntu 16.04, with VTK 7.0, Python 3.5, QT4.8, PyQt 4.11.4, PySide 1.2.2, but in the error, there is Qt.MSWindowsOwnDC, looks like it's for Windows? Thanks a lot in advance! Chen -- View this message in context: http://vtk.1045678.n5.nabble.com/switching-from-PyQt4-to-PySide-question-tp5741493.html Sent from the VTK - Users mailing list archive at Nabble.com. From david.gobbi at gmail.com Sat Dec 10 22:48:34 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Sat, 10 Dec 2016 20:48:34 -0700 Subject: [vtkusers] switching from PyQt4 to PySide question In-Reply-To: <1481425599902-5741493.post@n5.nabble.com> References: <1481425599902-5741493.post@n5.nabble.com> Message-ID: Hi Chen, There should be no need to recompile VTK in order to use PySide. The only important file for using VTK with PySide (or with PyQt4 or PyQt5) is QVTKRenderWindowInteractor.py. Also, it's best to import it from vtk.qt, not from vtk.qt4 (which is obsolete). My recommendation is to grab the latest version of this file from the VTK master branch: https://gitlab.kitware.com/vtk/vtk/raw/master/Wrapping/Python/vtk/qt/QVTKRenderWindowInteractor.py - David On Sat, Dec 10, 2016 at 8:06 PM, hchen wrote: > Hello, > > I'm trying to figure out how to switch from PyQt4 to PySide for my VTK > program. From what I heard, it should be straight forward. But, when I > took > the example: > http://www.vtk.org/Wiki/VTK/Examples/Python/Widgets/EmbedPyQt > and replaced: > from PyQt4 import QtCore, QtGui > by: > from PySide import QtCore, QtGui > I got this error: > self.vtkWidget = QVTKRenderWindowInteractor(self.frame) > File > "/usr/local/lib/python3.5/site-packages/vtk/qt/ > QVTKRenderWindowInteractor.py", > line 204, in __init__ > QWidget.__init__(self, parent, wflags|Qt.MSWindowsOwnDC) > TypeError: QWidget(QWidget parent=None, Qt.WindowFlags flags=0): > argument 1 has unexpected type 'PySide.QtGui.QFrame' > > Can anyone please points out why is the error and what's involved in making > the switch? Do I need to remove PyQt and recompile VTK? And, I am on > Ubuntu > 16.04, with VTK 7.0, Python 3.5, QT4.8, PyQt 4.11.4, PySide 1.2.2, but in > the error, there is Qt.MSWindowsOwnDC, looks like it's for Windows? > > Thanks a lot in advance! > > Chen > -------------- next part -------------- An HTML attachment was scrubbed... URL: From onlyjus at gmail.com Sat Dec 10 22:54:16 2016 From: onlyjus at gmail.com (Justin Weber) Date: Sat, 10 Dec 2016 22:54:16 -0500 Subject: [vtkusers] switching from PyQt4 to PySide question In-Reply-To: References: <1481425599902-5741493.post@n5.nabble.com> Message-ID: FYI, you can use QtPy to support PyQt4/PyQt5/Pyside https://github.com/spyder-ide/qtpy On Dec 10, 2016 10:49 PM, "David Gobbi" wrote: > Hi Chen, > > There should be no need to recompile VTK in order to use PySide. The only > important file for using VTK with PySide (or with PyQt4 or PyQt5) > is QVTKRenderWindowInteractor.py. Also, it's best to import it from > vtk.qt, not from vtk.qt4 (which is obsolete). > > My recommendation is to grab the latest version of this file from the VTK > master branch: > https://gitlab.kitware.com/vtk/vtk/raw/master/Wrapping/Python/vtk/qt/ > QVTKRenderWindowInteractor.py > > - David > > On Sat, Dec 10, 2016 at 8:06 PM, hchen wrote: > >> Hello, >> >> I'm trying to figure out how to switch from PyQt4 to PySide for my VTK >> program. From what I heard, it should be straight forward. But, when I >> took >> the example: >> http://www.vtk.org/Wiki/VTK/Examples/Python/Widgets/EmbedPyQt >> and replaced: >> from PyQt4 import QtCore, QtGui >> by: >> from PySide import QtCore, QtGui >> I got this error: >> self.vtkWidget = QVTKRenderWindowInteractor(self.frame) >> File >> "/usr/local/lib/python3.5/site-packages/vtk/qt/QVTKRenderWin >> dowInteractor.py", >> line 204, in __init__ >> QWidget.__init__(self, parent, wflags|Qt.MSWindowsOwnDC) >> TypeError: QWidget(QWidget parent=None, Qt.WindowFlags flags=0): >> argument 1 has unexpected type 'PySide.QtGui.QFrame' >> >> Can anyone please points out why is the error and what's involved in >> making >> the switch? Do I need to remove PyQt and recompile VTK? And, I am on >> Ubuntu >> 16.04, with VTK 7.0, Python 3.5, QT4.8, PyQt 4.11.4, PySide 1.2.2, but in >> the error, there is Qt.MSWindowsOwnDC, looks like it's for Windows? >> >> Thanks a lot in advance! >> >> Chen >> > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From spamsammeler at gmail.com Sun Dec 11 07:53:00 2016 From: spamsammeler at gmail.com (Adam Mueller) Date: Sun, 11 Dec 2016 05:53:00 -0700 (MST) Subject: [vtkusers] Read Vector Field from Structured Point VTK file Message-ID: <1481460780124-5741497.post@n5.nabble.com> Hi, I'm completely new to VTK and I have to implement some calculations on 3D-Vecotr Fields. I was given such a file: I want to get the Coordinates of those vertices in hands what I got so far is the following: Thank you for your help. I'm really stuck here for more than 2 days. Additional question: Is there any book-like documentation for VTK and C++ I only found TCL documentation which doesnt help much here. -- View this message in context: http://vtk.1045678.n5.nabble.com/Read-Vector-Field-from-Structured-Point-VTK-file-tp5741497.html Sent from the VTK - Users mailing list archive at Nabble.com. From lasso at queensu.ca Sun Dec 11 13:44:23 2016 From: lasso at queensu.ca (Andras Lasso) Date: Sun, 11 Dec 2016 18:44:23 +0000 Subject: [vtkusers] Read Vector Field from Structured Point VTK file In-Reply-To: <1481460780124-5741497.post@n5.nabble.com> References: <1481460780124-5741497.post@n5.nabble.com> Message-ID: > I have to implement some calculations There are several ways to represent and use displacement fields in VTK. You need to give a bit more details about your input data and what you would like to achieve. > Is there any book-like documentation Yes, there is: http://www.vtk.org/vtk-textbook/ Andras From: Adam Mueller Sent: Sunday, December 11, 2016 7:53 To: vtkusers at vtk.org Subject: [vtkusers] Read Vector Field from Structured Point VTK file Hi, I'm completely new to VTK and I have to implement some calculations on 3D-Vecotr Fields. I was given such a file: I want to get the Coordinates of those vertices in hands what I got so far is the following: Thank you for your help. I'm really stuck here for more than 2 days. Additional question: Is there any book-like documentation for VTK and C++ I only found TCL documentation which doesnt help much here. -- View this message in context: http://vtk.1045678.n5.nabble.com/Read-Vector-Field-from-Structured-Point-VTK-file-tp5741497.html Sent from the VTK - Users mailing list archive at Nabble.com. _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From jose.de.paula at live.com Mon Dec 12 06:30:08 2016 From: jose.de.paula at live.com (Jose Barreto) Date: Mon, 12 Dec 2016 04:30:08 -0700 (MST) Subject: [vtkusers] splinewidget with projection Message-ID: <1481542208154-5741501.post@n5.nabble.com> How can I make a splinewidget look like this? I'm going to use it with one of Jerome Velut's classes for panoramica. The values of this projection along the vector (top-bottom) are parameters for the size of parasagittal cuts. -- View this message in context: http://vtk.1045678.n5.nabble.com/splinewidget-with-projection-tp5741501.html Sent from the VTK - Users mailing list archive at Nabble.com. From girish.lande at agiliad.com Mon Dec 12 08:13:47 2016 From: girish.lande at agiliad.com (Girish Lande) Date: Mon, 12 Dec 2016 18:43:47 +0530 Subject: [vtkusers] Error displaying text in vtk 7.0 Message-ID: Hi, I am new to VTK libraries and trying to learn using examples. I build vtk 7.0 on my windows 7 using visual studio 2013. I am testing various example programs available on vtk.org Most of the examples are running fine. I tried running following program and encounter error/ crash http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/DisplayText could you please help me fix this ? [image: Inline images 1] -- thanks & regards, Girish -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 78446 bytes Desc: not available URL: From bill.lorensen at gmail.com Mon Dec 12 10:12:02 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Mon, 12 Dec 2016 10:12:02 -0500 Subject: [vtkusers] Error displaying text in vtk 7.0 In-Reply-To: References: Message-ID: How are you building the example? Are you using CMake to configure? On Mon, Dec 12, 2016 at 8:13 AM, Girish Lande wrote: > Hi, > > I am new to VTK libraries and trying to learn using examples. > I build vtk 7.0 on my windows 7 using visual studio 2013. > I am testing various example programs available on vtk.org > Most of the examples are running fine. > > I tried running following program and encounter error/ crash > > http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/DisplayText > > could you please help me fix this ? > > > [image: Inline images 1] > > -- > thanks & regards, > Girish > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -- Unpaid intern in BillsBasement at noware dot com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 78446 bytes Desc: not available URL: From david.lonie at kitware.com Mon Dec 12 12:22:23 2016 From: david.lonie at kitware.com (David Lonie) Date: Mon, 12 Dec 2016 12:22:23 -0500 Subject: [vtkusers] Error displaying text in vtk 7.0 In-Reply-To: References: Message-ID: You'll need to link to both vtkInteractorStyle (for some rendering components) and vtkRenderingFreeType (for text rendering backend). On Mon, Dec 12, 2016 at 10:12 AM, Bill Lorensen wrote: > How are you building the example? Are you using CMake to configure? > > > On Mon, Dec 12, 2016 at 8:13 AM, Girish Lande > wrote: > >> Hi, >> >> I am new to VTK libraries and trying to learn using examples. >> I build vtk 7.0 on my windows 7 using visual studio 2013. >> I am testing various example programs available on vtk.org >> Most of the examples are running fine. >> >> I tried running following program and encounter error/ crash >> >> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/DisplayText >> >> could you please help me fix this ? >> >> >> [image: Inline images 1] >> >> -- >> thanks & regards, >> Girish >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> > > > -- > Unpaid intern in BillsBasement at noware dot com > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 78446 bytes Desc: not available URL: From bill.lorensen at gmail.com Mon Dec 12 16:08:24 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Mon, 12 Dec 2016 16:08:24 -0500 Subject: [vtkusers] Error displaying text in vtk 7.0 In-Reply-To: References: Message-ID: And what version of VTK are you using? On Mon, Dec 12, 2016 at 12:22 PM, David Lonie wrote: > You'll need to link to both vtkInteractorStyle (for some rendering > components) and vtkRenderingFreeType (for text rendering backend). > > On Mon, Dec 12, 2016 at 10:12 AM, Bill Lorensen > wrote: > >> How are you building the example? Are you using CMake to configure? >> >> >> On Mon, Dec 12, 2016 at 8:13 AM, Girish Lande >> wrote: >> >>> Hi, >>> >>> I am new to VTK libraries and trying to learn using examples. >>> I build vtk 7.0 on my windows 7 using visual studio 2013. >>> I am testing various example programs available on vtk.org >>> Most of the examples are running fine. >>> >>> I tried running following program and encounter error/ crash >>> >>> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/DisplayText >>> >>> could you please help me fix this ? >>> >>> >>> [image: Inline images 1] >>> >>> -- >>> thanks & regards, >>> Girish >>> >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/vtkusers >>> >>> >> >> >> -- >> Unpaid intern in BillsBasement at noware dot com >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> > -- Unpaid intern in BillsBasement at noware dot com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 78446 bytes Desc: not available URL: From cory.quammen at kitware.com Mon Dec 12 22:03:19 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Mon, 12 Dec 2016 22:03:19 -0500 Subject: [vtkusers] vtk.vtkDistributedDataFilter() not works In-Reply-To: References: <1C21FF27-6B83-4CD1-9577-D72E1B2A0092@mac.com> Message-ID: Hmm, I'm not sure. Could you try setting the input to d3 to the output of a vtkSphereSource and see if you get the expected results there? You should get half the sphere in one piece and the other half sphere in the other piece. Thanks, Cory On Sat, Dec 10, 2016 at 10:35 AM, Magician wrote: > Hi Cory, > > > Sorry for my late reply. > I modified my code for splitting the points, but the filter doesn?t work. > > > import vtk > > src = vtk.vtkPointSource() > src.SetCenter((0.0, 0.0, 0.0)) > src.SetNumberOfPoints(1000) > src.SetRadius(1.0) > src.Update() > > dst = vtk.vtkPolyData() > pts = vtk.vtkPoints() > pts.SetData(src.GetOutput().GetPoints().GetData()) > dst.SetPoints(pts) > cells = vtk.vtkCellArray() > for i in range(src.GetOutput().GetNumberOfPoints()): > ptIds = vtk.vtkIdList() > ptIds.InsertNextId(i) > cells.InsertNextCell(ptIds) > dst.SetVerts(cells) > > d3 = vtk.vtkDistributedDataFilter() > d3.UseMinimalMemoryOff() > d3.SetInputData(dst) > d3.SetBoundaryMode(0) > d3.SetBoundaryModeToSplitBoundaryCells() > d3.Update() > > writer = vtk.vtkXMLPUnstructuredGridWriter() > writer.SetInputData(d3.GetOutput()) > writer.SetFileName(?test.pvtu?) > writer.SetNumberOfPieces(2) > writer.WriteSummaryFileOn() > writer.SetStartPiece(0) > writer.SetEndPiece(1) > writer.Write() > > > Magician > > >> On Dec 6, 2016, at 01:33, Cory Quammen wrote: >> >> I'm not 100% sure of this, but the vtkPointSource produces an output >> with only 1 cell. That may not be partitionable by the >> vtkDistributeDataFilter. You shouldn't get duplicate output in each >> piece, but let's not worry about that for now. >> >> Try swapping out the vtkPointSource with a vtkSphereSource and see if >> the data is partitioned. >> >> HTH, >> Cory >> >> On Sat, Dec 3, 2016 at 8:57 PM, Magician wrote: >>> Hi Cory, >>> >>> >>> Thanks for your advice. >>> >>> Hmmm...I already run the script with MPI. >>> The attached script is a minimal sample. >>> >>> >>> If I execute it, pvtu file is exported. >>> But the all piece sources are exactly same, and not partitioned. >>> >>> >>> >>> Magician >>> >>> >>>> On Nov 28, 2016, at 06:19, Cory Quammen wrote: >>>> >>>> I think you need to run your script in parallel with MPI for the >>>> partitioning to work. See [1] for an example of how to use this >>>> filter. >>>> >>>> Hope that helps, >>>> Cory >>>> >>>> [1] http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=Filters/Parallel/Testing/Cxx/DistributedData.cxx >>>> >>>> On Sun, Nov 27, 2016 at 10:39 AM, Magician wrote: >>>>> Does anyone use the vtkDistributedDataFilter? >>>>> >>>>> >>>>> On Nov 19, 2016, at 18:16, Magician wrote: >>>>> >>>>> Hi all, >>>>> >>>>> >>>>> I posted the message about partitioning datasets. >>>>> >>>>> >>>>> I still trying vtk.vtkDistributedDataFilter(), but the exported data aren?t >>>>> partitioned. >>>>> My VTK version is 7.1.0 (pvpython with ParaView 5.2.0 RC3) and executing on >>>>> 2 CPUs. >>>>> >>>>> Here is the sample code: >>>>> >>>>> import vtk >>>>> >>>>> source = vtk.vtkPointSource() >>>>> source.SetCenter((0.0, 0.0, 0.0)) >>>>> source.SetNumberOfPoints(1000000) >>>>> source.SetRadius(1.0) >>>>> source.Update() >>>>> >>>>> d3 = vtk.vtkDistributedDataFilter() >>>>> d3.SetInputData(source.GetOutput()) >>>>> d3.SetBoundaryMode(0) >>>>> d3.Update() >>>>> >>>>> writer = vtk.vtkXMLPUnstructuredGridWriter() >>>>> writer.SetInputData(d3.GetOutput()) >>>>> writer.SetFileName(?test.pvtu?) >>>>> writer.SetNumberOfPieces(2) >>>>> writer.WriteSummaryFileOn() >>>>> writer.SetStartPiece(0) >>>>> writer.SetEndPiece(1) >>>>> writer.Write() >>>>> >>>>> How to partition data? >>>>> >>>>> >>>>> Magician -- Cory Quammen Staff R&D Engineer Kitware, Inc. From girish.lande at agiliad.com Mon Dec 12 22:28:36 2016 From: girish.lande at agiliad.com (Girish Lande) Date: Tue, 13 Dec 2016 08:58:36 +0530 Subject: [vtkusers] Error displaying text in vtk 7.0 In-Reply-To: References: Message-ID: I am using vtk 7.0 Including following lines fixed it. #include VTK_MODULE_INIT(vtkRenderingOpenGL); VTK_MODULE_INIT(vtkRenderingFreeType); On 13 December 2016 at 02:38, Bill Lorensen wrote: > And what version of VTK are you using? > > > On Mon, Dec 12, 2016 at 12:22 PM, David Lonie > wrote: > >> You'll need to link to both vtkInteractorStyle (for some rendering >> components) and vtkRenderingFreeType (for text rendering backend). >> >> On Mon, Dec 12, 2016 at 10:12 AM, Bill Lorensen >> wrote: >> >>> How are you building the example? Are you using CMake to configure? >>> >>> >>> On Mon, Dec 12, 2016 at 8:13 AM, Girish Lande >>> wrote: >>> >>>> Hi, >>>> >>>> I am new to VTK libraries and trying to learn using examples. >>>> I build vtk 7.0 on my windows 7 using visual studio 2013. >>>> I am testing various example programs available on vtk.org >>>> Most of the examples are running fine. >>>> >>>> I tried running following program and encounter error/ crash >>>> >>>> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/DisplayText >>>> >>>> could you please help me fix this ? >>>> >>>> >>>> [image: Inline images 1] >>>> >>>> -- >>>> thanks & regards, >>>> Girish >>>> >>>> >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ at: >>>> http://www.vtk.org/Wiki/VTK_FAQ >>>> >>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://public.kitware.com/mailman/listinfo/vtkusers >>>> >>>> >>> >>> >>> -- >>> Unpaid intern in BillsBasement at noware dot com >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/vtkusers >>> >>> >> > > > -- > Unpaid intern in BillsBasement at noware dot com > -- thanks & regards, Girish -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 78446 bytes Desc: not available URL: From mjordan at live.at Tue Dec 13 06:33:03 2016 From: mjordan at live.at (M. Jordan) Date: Tue, 13 Dec 2016 11:33:03 +0000 Subject: [vtkusers] Align vtk cylinder source to a given vector Message-ID: Hi, i have a cylinder and a given direction vector. Now I want to align the cylinder along that vector. How can I do this? Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Tue Dec 13 09:13:17 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Tue, 13 Dec 2016 09:13:17 -0500 Subject: [vtkusers] Align vtk cylinder source to a given vector In-Reply-To: References: Message-ID: Here's a sketch of how to do this in VTK: * Find the cross product h between the normalized default cylinder axis c and your normalized direction vector v. * Now compute theta = acos(d) where d is the dot product of c and v. theta is the rotation angle about h you need to rotate the cylinder to the direction vector. * Use vtkTransformFilter with the transform set to a vtkTransform where you have called vtkTransform::RotateWXYZ (double angle, double x, double y, double z). theta is in radians, but angle is expected to be in degrees, so you'll need to convert. Hope that helps, Cory On Tue, Dec 13, 2016 at 6:33 AM, M. Jordan wrote: > Hi, > > i have a cylinder and a given direction vector. Now I want to align the > cylinder along that vector. > How can I do this? > > Thank you! > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Cory Quammen Staff R&D Engineer Kitware, Inc. From bill.lorensen at gmail.com Tue Dec 13 09:23:10 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Tue, 13 Dec 2016 09:23:10 -0500 Subject: [vtkusers] Align vtk cylinder source to a given vector In-Reply-To: References: Message-ID: This example may help http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/OrientedArrow On Dec 13, 2016 9:13 AM, "Cory Quammen" wrote: > Here's a sketch of how to do this in VTK: > > * Find the cross product h between the normalized default cylinder > axis c and your normalized direction vector v. > * Now compute theta = acos(d) where d is the dot product of c and v. > theta is the rotation angle about h you need to rotate the cylinder to > the direction vector. > * Use vtkTransformFilter with the transform set to a vtkTransform > where you have called vtkTransform::RotateWXYZ (double angle, double > x, double y, double z). theta is in radians, but angle is expected to > be in degrees, so you'll need to convert. > > Hope that helps, > Cory > > On Tue, Dec 13, 2016 at 6:33 AM, M. Jordan wrote: > > Hi, > > > > i have a cylinder and a given direction vector. Now I want to align the > > cylinder along that vector. > > How can I do this? > > > > Thank you! > > > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Please keep messages on-topic and check the VTK FAQ at: > > http://www.vtk.org/Wiki/VTK_FAQ > > > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/vtkusers > > > > > > -- > Cory Quammen > Staff R&D Engineer > Kitware, Inc. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From psakievich at gmail.com Tue Dec 13 10:21:27 2016 From: psakievich at gmail.com (Philip Sakievich) Date: Tue, 13 Dec 2016 08:21:27 -0700 Subject: [vtkusers] PVTS, Multiblock or Both Message-ID: Greetings, I am reasonably new to vtk and I am mainly using it to manage datasets on structured grids. I am trying to write data for a structured grid in parallel python via MPI. Each process has a separate portion of the grid, and I'm trying to figure out how to set up the write process. I was following this example: http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=IO/ParallelXML/Testing/Python/testParallelXMLWriters.py But then I realized that in this case each process has the entire grid, and each processor is just writing a portion of the data it contains. So do I need to use a multiblock data set? Can someone please provide a simple example of how to write a structured grid in parallel provided each process has the local extent correctly specified? Thanks -- Phil Sakievich PhD Candidate - Mechanical Engineering Arizona State University - Ira A. Fulton School for Engineering of Matter Transport and Energy Tempe, Arizona -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy.bauer at kitware.com Tue Dec 13 10:31:39 2016 From: andy.bauer at kitware.com (Andy Bauer) Date: Tue, 13 Dec 2016 10:31:39 -0500 Subject: [vtkusers] PVTS, Multiblock or Both In-Reply-To: References: Message-ID: Hi, I would recommend using the pvts format since that is the best format for storing structured grids. If you read it back in it will know how to properly partition the data set for different amounts of processes as well as do things like ghost cells, extract surfaces, etc. For topologically structured grids like vtkStructuredGrid there are two types of extents, "whole extent" describes the beginning and ending node (inclusive) in each direction for the entire grid while "extent" refers to each process's (or pieces if you're serial but doing streaming) partition of the grid. I believe this should be explained in the VTK User's Guide which is now available for free as a pdf download. Cheers, Andy On Tue, Dec 13, 2016 at 10:21 AM, Philip Sakievich wrote: > Greetings, > > I am reasonably new to vtk and I am mainly using it to manage datasets on > structured grids. > > I am trying to write data for a structured grid in parallel python via > MPI. Each process has a separate portion of the grid, and I'm trying to > figure out how to set up the write process. I was following this example: > > http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=IO/ > ParallelXML/Testing/Python/testParallelXMLWriters.py > > But then I realized that in this case each process has the entire grid, > and each processor is just writing a portion of the data it contains. So > do I need to use a multiblock data set? Can someone please provide a > simple example of how to write a structured grid in parallel provided each > process has the local extent correctly specified? > > Thanks > > -- > Phil Sakievich > > PhD Candidate - Mechanical Engineering > Arizona State University - Ira A. Fulton School for Engineering of Matter > Transport and Energy > Tempe, Arizona > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Tue Dec 13 10:48:11 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Tue, 13 Dec 2016 10:48:11 -0500 Subject: [vtkusers] Align vtk cylinder source to a given vector In-Reply-To: References: Message-ID: The arrow source is originally aligned with the x-axis, The cylinder source is aligned with the y-axis. Also the cylinder origin is different. Replace the transform with vtkSmartPointer transform = vtkSmartPointer::New(); transform->Translate(startPoint); transform->Concatenate(matrix); transform->Scale(length, length, length); transform->RotateZ(-90.0); // orient along x axis transform->Translate(0, .5, 0); // translate to end of cylinder On Tue, Dec 13, 2016 at 10:15 AM, M. Jordan wrote: > Thank you very much! > The example works fine, but when I change the source from arrow to > cylinder the result is strange (not aligned). > I don't know why > > ------------------------------ > *Von:* Bill Lorensen > *Gesendet:* Dienstag, 13. Dezember 2016 15:23 > *An:* Cory Quammen > *Cc:* VTK Users; M. Jordan > *Betreff:* Re: [vtkusers] Align vtk cylinder source to a given vector > > This example may help > http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/OrientedArrow > VTK/Examples/Cxx/GeometricObjects/OrientedArrow ... > > www.vtk.org > Download and Build OrientedArrow. Click here to download OrientedArrow. > and its CMakeLists.txt file. Once the tarball OrientedArrow.tar has been > downloaded and extracted, > > > On Dec 13, 2016 9:13 AM, "Cory Quammen" wrote: > >> Here's a sketch of how to do this in VTK: >> >> * Find the cross product h between the normalized default cylinder >> axis c and your normalized direction vector v. >> * Now compute theta = acos(d) where d is the dot product of c and v. >> theta is the rotation angle about h you need to rotate the cylinder to >> the direction vector. >> * Use vtkTransformFilter with the transform set to a vtkTransform >> where you have called vtkTransform::RotateWXYZ (double angle, double >> x, double y, double z). theta is in radians, but angle is expected to >> be in degrees, so you'll need to convert. >> >> Hope that helps, >> Cory >> >> On Tue, Dec 13, 2016 at 6:33 AM, M. Jordan wrote: >> > Hi, >> > >> > i have a cylinder and a given direction vector. Now I want to align the >> > cylinder along that vector. >> > How can I do this? >> > >> > Thank you! >> > >> > >> > _______________________________________________ >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at >> > http://www.kitware.com/opensource/opensource.html >> > >> > Please keep messages on-topic and check the VTK FAQ at: >> > http://www.vtk.org/Wiki/VTK_FAQ >> > >> > Search the list archives at: http://markmail.org/search/?q=vtkusers >> > >> > Follow this link to subscribe/unsubscribe: >> > http://public.kitware.com/mailman/listinfo/vtkusers >> > >> >> >> >> -- >> Cory Quammen >> Staff R&D Engineer >> Kitware, Inc. >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> > -- Unpaid intern in BillsBasement at noware dot com -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Tue Dec 13 10:54:37 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Tue, 13 Dec 2016 10:54:37 -0500 Subject: [vtkusers] Align vtk cylinder source to a given vector In-Reply-To: References: Message-ID: The scale should be: transform->Scale(length, 1.0, 1.0); On Tue, Dec 13, 2016 at 10:48 AM, Bill Lorensen wrote: > The arrow source is originally aligned with the x-axis, The cylinder > source is aligned with the y-axis. Also the cylinder origin is different. > Replace the transform with > > vtkSmartPointer transform = > vtkSmartPointer::New(); > transform->Translate(startPoint); > transform->Concatenate(matrix); > transform->Scale(length, length, length); > transform->RotateZ(-90.0); // orient along x axis > transform->Translate(0, .5, 0); // translate to end of cylinder > > > On Tue, Dec 13, 2016 at 10:15 AM, M. Jordan wrote: > >> Thank you very much! >> The example works fine, but when I change the source from arrow to >> cylinder the result is strange (not aligned). >> I don't know why >> >> ------------------------------ >> *Von:* Bill Lorensen >> *Gesendet:* Dienstag, 13. Dezember 2016 15:23 >> *An:* Cory Quammen >> *Cc:* VTK Users; M. Jordan >> *Betreff:* Re: [vtkusers] Align vtk cylinder source to a given vector >> >> This example may help >> http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/OrientedArrow >> VTK/Examples/Cxx/GeometricObjects/OrientedArrow ... >> >> www.vtk.org >> Download and Build OrientedArrow. Click here to download OrientedArrow. >> and its CMakeLists.txt file. Once the tarball OrientedArrow.tar has been >> downloaded and extracted, >> >> >> On Dec 13, 2016 9:13 AM, "Cory Quammen" wrote: >> >>> Here's a sketch of how to do this in VTK: >>> >>> * Find the cross product h between the normalized default cylinder >>> axis c and your normalized direction vector v. >>> * Now compute theta = acos(d) where d is the dot product of c and v. >>> theta is the rotation angle about h you need to rotate the cylinder to >>> the direction vector. >>> * Use vtkTransformFilter with the transform set to a vtkTransform >>> where you have called vtkTransform::RotateWXYZ (double angle, double >>> x, double y, double z). theta is in radians, but angle is expected to >>> be in degrees, so you'll need to convert. >>> >>> Hope that helps, >>> Cory >>> >>> On Tue, Dec 13, 2016 at 6:33 AM, M. Jordan wrote: >>> > Hi, >>> > >>> > i have a cylinder and a given direction vector. Now I want to align the >>> > cylinder along that vector. >>> > How can I do this? >>> > >>> > Thank you! >>> > >>> > >>> > _______________________________________________ >>> > Powered by www.kitware.com >>> > >>> > Visit other Kitware open-source projects at >>> > http://www.kitware.com/opensource/opensource.html >>> > >>> > Please keep messages on-topic and check the VTK FAQ at: >>> > http://www.vtk.org/Wiki/VTK_FAQ >>> > >>> > Search the list archives at: http://markmail.org/search/?q=vtkusers >>> > >>> > Follow this link to subscribe/unsubscribe: >>> > http://public.kitware.com/mailman/listinfo/vtkusers >>> > >>> >>> >>> >>> -- >>> Cory Quammen >>> Staff R&D Engineer >>> Kitware, Inc. >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/vtkusers >>> >> > > > -- > Unpaid intern in BillsBasement at noware dot com > -- Unpaid intern in BillsBasement at noware dot com -------------- next part -------------- An HTML attachment was scrubbed... URL: From rakesh.p at tataelxsi.co.in Tue Dec 13 11:28:01 2016 From: rakesh.p at tataelxsi.co.in (Rakesh Patil) Date: Tue, 13 Dec 2016 16:28:01 +0000 Subject: [vtkusers] Extracting triangulated polygon from a triangulated rectangle Message-ID: Hi, I have a rectangular region which is triangulated. I need to extract the triangulated polygonal shapre from that rectangular shape, maintaining the same triangulation. I have attached a sample example. In this example, I have a rectangle which is triangulated. I have a set of points forming a hexagon (these points lie on the same plane as that of the rectangle). Using these points, I would like to extract the triangulated geometry(including points and cells) as a hexagonal shape. Is there any built-in functionality to achieve this? Thanks & Regards Rakesh Patil -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: regions.png Type: image/png Size: 8221 bytes Desc: regions.png URL: From rakesh.p at tataelxsi.co.in Tue Dec 13 11:28:01 2016 From: rakesh.p at tataelxsi.co.in (Rakesh Patil) Date: Tue, 13 Dec 2016 16:28:01 +0000 Subject: [vtkusers] Extracting triangulated polygon from a triangulated rectangle Message-ID: Hi, I have a rectangular region which is triangulated. I need to extract the triangulated polygonal shapre from that rectangular shape, maintaining the same triangulation. I have attached a sample example. In this example, I have a rectangle which is triangulated. I have a set of points forming a hexagon (these points lie on the same plane as that of the rectangle). Using these points, I would like to extract the triangulated geometry(including points and cells) as a hexagonal shape. Is there any built-in functionality to achieve this? Thanks & Regards Rakesh Patil -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: regions.png Type: image/png Size: 8221 bytes Desc: regions.png URL: From inglis.dl at gmail.com Tue Dec 13 12:00:20 2016 From: inglis.dl at gmail.com (Dean Inglis) Date: Tue, 13 Dec 2016 12:00:20 -0500 Subject: [vtkusers] splinewidget with projection In-Reply-To: <1481542208154-5741501.post@n5.nabble.com> References: <1481542208154-5741501.post@n5.nabble.com> Message-ID: Hi Jose, it looks like you are trying to replicate functionality provided by annesolutions or bluesky bio in their surgical planning software. I wrote custom code for panoramic dental imaging and examples to demonstrate their use for them a while ago. Maybe they still have the code? The example I wrote that can produce a very similar set of contours made use of vtkContourWidget, vtkOrientedGlyphContourRepresentation and then setting the contour representation's cursor shape and active cursor shape with the output of a pipeline made of: vtkCylinderSource (make a capped cylinder with small height to straddle the image) vtkTransformPolyDataFilter (align the cylinder perpendicular to the image) you could use vtkCubeSource for the square glyphs. The outer two coutours were generated by one custom widget that had two handles at each end for controlling the thickness of the panoramic image slab. - Dean On Mon, Dec 12, 2016 at 6:30 AM, Jose Barreto wrote: > How can I make a splinewidget look like this? > > > > I'm going to use it with one of Jerome Velut's classes for panoramica. The > values of this projection along the vector (top-bottom) are parameters for > the size of parasagittal cuts. > > > > -- > View this message in context: http://vtk.1045678.n5.nabble. > com/splinewidget-with-projection-tp5741501.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mikewithascarf at yahoo.com Tue Dec 13 12:20:36 2016 From: mikewithascarf at yahoo.com (Mike Withascarf) Date: Tue, 13 Dec 2016 17:20:36 +0000 (UTC) Subject: [vtkusers] streaming images References: <577214083.1993766.1481649636835.ref@mail.yahoo.com> Message-ID: <577214083.1993766.1481649636835@mail.yahoo.com> I have a pipeline that takes 3D image data (slices of 2D images) and displays it with a vtkImageViewer2 (with a slider to move through the slices). My datasets can get huge, so I am looking for a way to only load part of the image into memory at a time as needed. I tried using vtkImageDataStreamer without success, though I have a feeling that's not for image viewing, but rather processing. How can I accomplish what I'm trying to do? Any help is appreciated! Here is my basic code for loading and displaying the data: // load image datavtkSmartPointer reader = vtkSmartPointer::New();reader->SetReleaseDataFlag(1);reader->SetFileName("test.mhd"); // colormapvtkSmartPointer lut = vtkSmartPointer::New();lut->SetNumberOfColors(256);lut->SetRange(0, 400);lut->Build();for (size_t i = 0; i < 256; i++) lut->SetTableValue(i, (double)i/256, (double)i/256, (double)i/256); vtkSmartPointer maptoc = vtkSmartPointer::New();maptoc->SetLookupTable(lut);maptoc->SetInputConnection(reader->GetOutputPort());maptoc->Update(); // renderingviewer = vtkSmartPointer::New();viewer->SetInputConnection(maptoc->GetOutputPort());viewer->SetRenderWindow(window->GetRenderWindow());viewer->GetRenderer()->ResetCamera();viewer->Render(); // note that window is of type QVTKWidget// when the user changes slices, I call viewer->SetSlice -------------- next part -------------- An HTML attachment was scrubbed... URL: From jose.de.paula at live.com Tue Dec 13 12:27:02 2016 From: jose.de.paula at live.com (Jose Barreto) Date: Tue, 13 Dec 2016 10:27:02 -0700 (MST) Subject: [vtkusers] splinewidget with projection In-Reply-To: References: <1481542208154-5741501.post@n5.nabble.com> Message-ID: <1481650022134-5741523.post@n5.nabble.com> Thank you. With the objects that you mentioned above I already have a better idea. I was using splinewidget-> getpolydata () to get my input polygon. I was picking up the thickness with a separate box. Are you Brazilian? About the code you said you created an example, Do you have access to it? Or can you give me some contact with who has his rights today? -- View this message in context: http://vtk.1045678.n5.nabble.com/splinewidget-with-projection-tp5741501p5741523.html Sent from the VTK - Users mailing list archive at Nabble.com. From inglis.dl at gmail.com Tue Dec 13 12:32:17 2016 From: inglis.dl at gmail.com (Dean Inglis) Date: Tue, 13 Dec 2016 12:32:17 -0500 Subject: [vtkusers] streaming images In-Reply-To: <577214083.1993766.1481649636835@mail.yahoo.com> References: <577214083.1993766.1481649636835.ref@mail.yahoo.com> <577214083.1993766.1481649636835@mail.yahoo.com> Message-ID: Hi Mike, not sure if this would work, but what about inserting vtkImageClip between your reader and the windowlevel filter in your pipeline with ClipDataOn? - Dean On Tue, Dec 13, 2016 at 12:20 PM, Mike Withascarf via vtkusers < vtkusers at vtk.org> wrote: > I have a pipeline that takes 3D image data (slices of 2D images) and > displays it with a vtkImageViewer2 (with a slider to move through the > slices). My datasets can get huge, so I am looking for a way to only load > part of the image into memory at a time as needed. I tried using > vtkImageDataStreamer without success, though I have a feeling that's not > for image viewing, but rather processing. How can I accomplish what I'm > trying to do? Any help is appreciated! Here is my basic code for loading > and displaying the data: > > // load image data > vtkSmartPointer reader = vtkSmartPointer< > vtkMetaImageReader>::New(); > reader->SetReleaseDataFlag(1); > reader->SetFileName("test.mhd"); > > // colormap > vtkSmartPointer lut = vtkSmartPointer< > vtkLookupTable>::New(); > lut->SetNumberOfColors(256); > lut->SetRange(0, 400); > lut->Build(); > for (size_t i = 0; i < 256; i++) > lut->SetTableValue(i, (double)i/256, (double)i/256, (double)i/256); > > vtkSmartPointer maptoc = > vtkSmartPointer::New(); > maptoc->SetLookupTable(lut); > maptoc->SetInputConnection(reader->GetOutputPort()); > maptoc->Update(); > > // rendering > viewer = vtkSmartPointer::New(); > viewer->SetInputConnection(maptoc->GetOutputPort()); > viewer->SetRenderWindow(window->GetRenderWindow()); > viewer->GetRenderer()->ResetCamera(); > viewer->Render(); > > // note that window is of type QVTKWidget > // when the user changes slices, I call viewer->SetSlice > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Tue Dec 13 12:44:12 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Tue, 13 Dec 2016 12:44:12 -0500 Subject: [vtkusers] Align vtk cylinder source to a given vector In-Reply-To: References: Message-ID: I added a new example: http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/OrientedCylinder On Tue, Dec 13, 2016 at 9:23 AM, Bill Lorensen wrote: > This example may help > http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/OrientedArrow > > On Dec 13, 2016 9:13 AM, "Cory Quammen" wrote: >> >> Here's a sketch of how to do this in VTK: >> >> * Find the cross product h between the normalized default cylinder >> axis c and your normalized direction vector v. >> * Now compute theta = acos(d) where d is the dot product of c and v. >> theta is the rotation angle about h you need to rotate the cylinder to >> the direction vector. >> * Use vtkTransformFilter with the transform set to a vtkTransform >> where you have called vtkTransform::RotateWXYZ (double angle, double >> x, double y, double z). theta is in radians, but angle is expected to >> be in degrees, so you'll need to convert. >> >> Hope that helps, >> Cory >> >> On Tue, Dec 13, 2016 at 6:33 AM, M. Jordan wrote: >> > Hi, >> > >> > i have a cylinder and a given direction vector. Now I want to align the >> > cylinder along that vector. >> > How can I do this? >> > >> > Thank you! >> > >> > >> > _______________________________________________ >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at >> > http://www.kitware.com/opensource/opensource.html >> > >> > Please keep messages on-topic and check the VTK FAQ at: >> > http://www.vtk.org/Wiki/VTK_FAQ >> > >> > Search the list archives at: http://markmail.org/search/?q=vtkusers >> > >> > Follow this link to subscribe/unsubscribe: >> > http://public.kitware.com/mailman/listinfo/vtkusers >> > >> >> >> >> -- >> Cory Quammen >> Staff R&D Engineer >> Kitware, Inc. >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers -- Unpaid intern in BillsBasement at noware dot com From mikewithascarf at yahoo.com Tue Dec 13 14:42:47 2016 From: mikewithascarf at yahoo.com (Mike Withascarf) Date: Tue, 13 Dec 2016 19:42:47 +0000 (UTC) Subject: [vtkusers] streaming images In-Reply-To: References: <577214083.1993766.1481649636835.ref@mail.yahoo.com> <577214083.1993766.1481649636835@mail.yahoo.com> Message-ID: <1180210450.2118434.1481658167156@mail.yahoo.com> Thanks, I've just tried that. It works in the sense that it only loads the block specified by the vtkImageClip, but then if I try to change blocks (when the slider goes out of range of the first block), it fails I believe because the vtkMetaImageReader has released its data. If I remove the line "reader->SetReleaseDataFlag(1);", then it is able to load different blocks, but doesn't save any memory, since now the vtkMetaImageReader?is just keeping all the data in memory rather than releasing it. How can I allow the vtkMetaImageReader to release all data, but be able to load new data when needed? Here's the updated code: // load image datavtkSmartPointer< vtkMetaImageReader> reader = vtkSmartPointer< vtkMetaImageReader>::New();reader->SetReleaseDataFlag(1);reader->SetFileName("test.mhd");reader->Update();int *ext = reader->GetOutput()->GetExtent(); // clipint block_current = 0;int block_size = 100;clip = vtkSmartPointer::New();clip->SetInputConnection(reader->GetOutputPort());clip->SetOutputWholeExtent(ext[0], ext[1], ext[2], ext[3], block_current, block_current + block_size - 1);clip->ClipDataOn(); // colormapvtkSmartPointer< vtkLookupTable> lut = vtkSmartPointer< vtkLookupTable>::New();lut->SetNumberOfColors(256);lut->SetRange(0, 400);lut->Build();for (size_t i = 0; i < 256; i++) lut->SetTableValue(i, (double)i/256, (double)i/256, (double)i/256); vtkSmartPointer< vtkImageMapToColors> maptoc = vtkSmartPointer< vtkImageMapToColors>::New();maptoc->SetLookupTable(lut);maptoc->SetInputConnection(clip->GetOutputPort());maptoc->Update(); // renderingviewer = vtkSmartPointer< vtkImageViewer2>::New();viewer->SetInputConnection( maptoc->GetOutputPort());viewer->SetRenderWindow( window->GetRenderWindow());viewer->GetRenderer()-> ResetCamera();viewer->Render(); From: Dean Inglis To: Mike Withascarf Cc: "vtkusers at vtk.org" Sent: Tuesday, December 13, 2016 12:32 PM Subject: Re: [vtkusers] streaming images Hi Mike, not sure if this would work, but what about inserting vtkImageClip between your reader and the windowlevel filter in your pipeline with ClipDataOn? - Dean On Tue, Dec 13, 2016 at 12:20 PM, Mike Withascarf via vtkusers wrote: I have a pipeline that takes 3D image data (slices of 2D images) and displays it with a vtkImageViewer2 (with a slider to move through the slices). My datasets can get huge, so I am looking for a way to only load part of the image into memory at a time as needed. I tried using vtkImageDataStreamer without success, though I have a feeling that's not for image viewing, but rather processing. How can I accomplish what I'm trying to do? Any help is appreciated! Here is my basic code for loading and displaying the data: // load image datavtkSmartPointer< vtkMetaImageReader> reader = vtkSmartPointer< vtkMetaImageReader>::New();reader->SetReleaseDataFlag(1);reader->SetFileName("test.mhd" ); // colormapvtkSmartPointer< vtkLookupTable> lut = vtkSmartPointer< vtkLookupTable>::New();lut->SetNumberOfColors(256);lut->SetRange(0, 400);lut->Build();for (size_t i = 0; i < 256; i++) lut->SetTableValue(i, (double)i/256, (double)i/256, (double)i/256); vtkSmartPointer< vtkImageMapToColors> maptoc = vtkSmartPointer< vtkImageMapToColors>::New();maptoc->SetLookupTable(lut);maptoc->SetInputConnection( reader->GetOutputPort());maptoc->Update(); // renderingviewer = vtkSmartPointer< vtkImageViewer2>::New();viewer->SetInputConnection( maptoc->GetOutputPort());viewer->SetRenderWindow( window->GetRenderWindow());viewer->GetRenderer()-> ResetCamera();viewer->Render(); // note that window is of type QVTKWidget// when the user changes slices, I call viewer->SetSlice ______________________________ _________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/ opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_ FAQ Search the list archives at: http://markmail.org/search/?q= vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/ mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From tehsunnliu at yahoo.com Wed Dec 14 03:56:32 2016 From: tehsunnliu at yahoo.com (Alex Liu) Date: Wed, 14 Dec 2016 01:56:32 -0700 (MST) Subject: [vtkusers] Point Cloud to Mesh Message-ID: <1481705792558-5741531.post@n5.nabble.com> Hi all. I'm trying to construct face from DICOM images. Till now I've successfully extracted Points and normals, you can get the ply file from here FaceReconstruct.ply this is the point cloud result Now I'm trying to convert Points to mesh, for that I'm using vtkSmartPointer delaunay = vtkSmartPointer::New(); delaunay->SetAlpha(4.0); delaunay->SetTolerance(0.0001); delaunay->SetOffset(1.25); delaunay->BoundingTriangulationOff(); delaunay->SetInputData(polyData); delaunay->SetSourceData(polyData); delaunay->Update(); But this function is not able to construct the mesh properly. I tried changing all the parameters for Delaunay2D but, got no success. I also tried using vtkSurfaceReconstruct and I get some strange result. In meshlab I can construct a smooth surface by using Poisson Surface Reconstruct, and wanted to get the same result using vtk. Delaunay2D result MeshLab result Please help me to figure out what's wrong I'm doing and also any solution to construct a smooth surface from this point cloud will be really appreciated. Thank you. ----- Alex Liu +15574855474 -- View this message in context: http://vtk.1045678.n5.nabble.com/Point-Cloud-to-Mesh-tp5741531.html Sent from the VTK - Users mailing list archive at Nabble.com. From Gerald.Lodron at joanneum.at Wed Dec 14 04:02:32 2016 From: Gerald.Lodron at joanneum.at (Lodron, Gerald) Date: Wed, 14 Dec 2016 09:02:32 +0000 Subject: [vtkusers] Error: no override found for 'vtkContextDevice2D' In-Reply-To: <75f02afbd20f42d48cee95edca0956fa@RZJMBX2.jr1.local> References: <75f02afbd20f42d48cee95edca0956fa@RZJMBX2.jr1.local> Message-ID: Hi I updated my vtk from Paraview's vtk of paraview 4.4 to 5.2 where now the opengl2 backend is enabled by default. I programmed an own app which uses qvtkwidget2 to visualize a histogram of an image which worked on my old paraview4.4's vtk. Now I get the error message "Error: no override found for 'vtkContextDevice2D'". I found some threads which say that you have to link vtkRenderingContextOpenGL, but on opengl this file is called vtkRenderingContextOpenGL2 and I am already linking it... Any suggestions? ------------------------------------------------------------------------------------ Gerald Lodron Researcher of Machine Vision Applications Group DIGITAL - Institute for Information and Communication Technologies JOANNEUM RESEARCH Forschungsgesellschaft mbH Steyrergasse 17, 8010 Graz, AUSTRIA phone: +43-316-876-1751 general fax: +43-316-876-1751 web: http://www.joanneum.at/digital e-mail: gerald.lodron at joanneum.at -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ATT00001.txt URL: From Gerald.Lodron at joanneum.at Wed Dec 14 05:44:05 2016 From: Gerald.Lodron at joanneum.at (Lodron, Gerald) Date: Wed, 14 Dec 2016 10:44:05 +0000 Subject: [vtkusers] Error: no override found for 'vtkContextDevice2D' In-Reply-To: <75f02afbd20f42d48cee95edca0956fa@RZJMBX2.jr1.local> References: <75f02afbd20f42d48cee95edca0956fa@RZJMBX2.jr1.local> Message-ID: <58428f63f3544709a6c13b0571e2c9e1@RZJMBX2.jr1.local> Solved, over #include VTK_MODULE_INIT(vtkRenderingContextOpenGL2); VTK_MODULE_INIT(vtkRenderingOpenGL2) VTK_MODULE_INIT(vtkInteractionStyle) And QVTKWidget instead of QVTKWidget2, I dont know why but works now... Thanks, Von: vtk-developers [mailto:vtk-developers-bounces at vtk.org] Im Auftrag von Lodron, Gerald Gesendet: Mittwoch, 14. Dezember 2016 09:57 An: VTK Developer (vtk-developers at vtk.org) Betreff: [vtk-developers] Error: no override found for 'vtkContextDevice2D' Hi I updated my vtk from Paraview's vtk of paraview 4.4 to 5.2 where now the opengl2 backend is enabled by default. I programmed an own app which uses qvtkwidget2 to visualize a histogram of an image which worked on my old paraview4.4's vtk. Now I get the error message "Error: no override found for 'vtkContextDevice2D'". I found some threads which say that you have to link vtkRenderingContextOpenGL, but on opengl this file is called vtkRenderingContextOpenGL2 and I am already linking it... Any suggestions? ------------------------------------------------------------------------------------ Gerald Lodron Researcher of Machine Vision Applications Group DIGITAL - Institute for Information and Communication Technologies JOANNEUM RESEARCH Forschungsgesellschaft mbH Steyrergasse 17, 8010 Graz, AUSTRIA phone: +43-316-876-1751 general fax: +43-316-876-1751 web: http://www.joanneum.at/digital e-mail: gerald.lodron at joanneum.at -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjordan at live.at Wed Dec 14 07:56:20 2016 From: mjordan at live.at (M. Jordan) Date: Wed, 14 Dec 2016 12:56:20 +0000 Subject: [vtkusers] clip spheres (depending on a direction vector) Message-ID: Hi, i would like to clip some spheres into two equal parts and color them. There are many of these spheres placed onto a surface. I tried but the problem is that I want to achieve an equal look from all directions. Therefore I tried to cut the spheres with a plane resulting from the direction vector (e). plane->SetNormal(ex, ey ez); Now the "backside" of the spheres is cutted when looking at them onto the surface (normal vector of the plane = direction vector of the spheres center). But I would like to rotate the plane about 90 degree to cut the spheres in the middle. When you look onto the surface, every sphere on it should look the same. Some ideas of how to do that? Is there a simplier solution to color half of a sphere and show both halfes equally independent from the point of view. Kind Regards -------------- next part -------------- An HTML attachment was scrubbed... URL: From lasso at queensu.ca Wed Dec 14 11:58:55 2016 From: lasso at queensu.ca (Andras Lasso) Date: Wed, 14 Dec 2016 16:58:55 +0000 Subject: [vtkusers] Point Cloud to Mesh In-Reply-To: <1481705792558-5741531.post@n5.nabble.com> References: <1481705792558-5741531.post@n5.nabble.com> Message-ID: Why don't you simply use vtkContourFilter to directly generate surface from the input image? http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=Examples/Medical/Cxx/Medical1.cxx Andras -----Original Message----- From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Alex Liu via vtkusers Sent: December 14, 2016 3:57 To: vtkusers at vtk.org Subject: [vtkusers] Point Cloud to Mesh Hi all. I'm trying to construct face from DICOM images. Till now I've successfully extracted Points and normals, you can get the ply file from here FaceReconstruct.ply this is the point cloud result Now I'm trying to convert Points to mesh, for that I'm using vtkSmartPointer delaunay = vtkSmartPointer::New(); delaunay->SetAlpha(4.0); delaunay->SetTolerance(0.0001); delaunay->SetOffset(1.25); delaunay->BoundingTriangulationOff(); delaunay->SetInputData(polyData); delaunay->SetSourceData(polyData); delaunay->Update(); But this function is not able to construct the mesh properly. I tried changing all the parameters for Delaunay2D but, got no success. I also tried using vtkSurfaceReconstruct and I get some strange result. In meshlab I can construct a smooth surface by using Poisson Surface Reconstruct, and wanted to get the same result using vtk. Delaunay2D result MeshLab result Please help me to figure out what's wrong I'm doing and also any solution to construct a smooth surface from this point cloud will be really appreciated. Thank you. ----- Alex Liu +15574855474 -- View this message in context: http://vtk.1045678.n5.nabble.com/Point-Cloud-to-Mesh-tp5741531.html Sent from the VTK - Users mailing list archive at Nabble.com. _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers From josp.jorge at gmail.com Wed Dec 14 13:33:10 2016 From: josp.jorge at gmail.com (Jorge Perez) Date: Wed, 14 Dec 2016 19:33:10 +0100 Subject: [vtkusers] Point Cloud to Mesh In-Reply-To: <1481705792558-5741531.post@n5.nabble.com> References: <1481705792558-5741531.post@n5.nabble.com> Message-ID: Hello, you can use http://www.vtk.org/doc/nightly/html/classvtkSurfaceReconstructionFilter.html you can also use PoissonReconstruction module, it is a remote module and can be include in the VTK BUILD defining -DModule_PoissonReconstruction:BOOL=ON HTH Jorge 2016-12-14 9:56 GMT+01:00 Alex Liu via vtkusers : > Hi all. > I'm trying to construct face from DICOM images. Till now I've successfully > extracted Points and normals, you can get the ply file from here > FaceReconstruct.ply > > > this is the point cloud result > > > Now I'm trying to convert Points to mesh, for that I'm using > > vtkSmartPointer delaunay = > vtkSmartPointer::New(); > delaunay->SetAlpha(4.0); > delaunay->SetTolerance(0.0001); > delaunay->SetOffset(1.25); > delaunay->BoundingTriangulationOff(); > delaunay->SetInputData(polyData); > delaunay->SetSourceData(polyData); > delaunay->Update(); > > But this function is not able to construct the mesh properly. I tried > changing all the parameters for Delaunay2D but, got no success. I also > tried > using vtkSurfaceReconstruct and I get some strange result. > In meshlab I can construct a smooth surface by using Poisson Surface > Reconstruct, and wanted to get the same result using vtk. > > Delaunay2D result > > > MeshLab result > > > Please help me to figure out what's wrong I'm doing and also any solution > to > construct a smooth surface from this point cloud will be really > appreciated. > Thank you. > > > > ----- > Alex Liu > +15574855474 > -- > View this message in context: http://vtk.1045678.n5.nabble. > com/Point-Cloud-to-Mesh-tp5741531.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdrahos at aurisrobotics.com Wed Dec 14 17:24:43 2016 From: mdrahos at aurisrobotics.com (Miroslav Drahos) Date: Wed, 14 Dec 2016 22:24:43 +0000 Subject: [vtkusers] interactor with one renwin and multiple renderers In-Reply-To: <004201d252f6$5ac8fec0$105afc40$@gmail.com> References: , <000901d251d7$9532d240$bf9876c0$@gmail.com> , <004201d252f6$5ac8fec0$105afc40$@gmail.com> Message-ID: Hi Robert, thanks for your response. I am using Ubuntu 16.04, with nvidia GTX 960, driver 370.28, Qt 5.3.1 and VTK 6.2. Haven't pursued this further, because we are going to try to combine QML and implement transitions between the views, sliding and resizing them, and each view having a separate widget might make this simpler to start with. Among the views we want to be able to shuffle is also a Qt/QML-based non-VTK view (camera data; rendered using directly OpenGL). Good to know, and thanks for the info! Best, Miro ________________________________ From: R?bert ?pir Sent: Saturday, December 10, 2016 7:01:57 AM To: Miroslav Drahos; vtkusers at vtk.org Subject: RE: [vtkusers] interactor with one renwin and multiple renderers I have two main renderers and two overlay renderers. The main renderers contain multiple actors with 100+ k polygons and volume rendering and everything is fast and without delay (on nvidia gtx770). I'm also using point picking that calls FindPokedRenderer on every mouse move without any problems. Which os and qt version are you using? There is some problem with qt 5.5 in latest ubuntu that is causing delays with mouse interection. I'm using qt5.7 from https://launchpad.net/~beineri/+archive/ubuntu/opt-qt57-xenial Robert From: Miroslav Drahos [mailto:mdrahos at aurisrobotics.com] Sent: Friday, December 9, 2016 10:27 PM To: R?bert ?pir ; vtkusers at vtk.org Subject: Re: [vtkusers] interactor with one renwin and multiple renderers Hi Robert, thanks for the reply, it makes sense. From your experience, would you say it is worth the effort for ~6 views? Would you say the performance improvement is noticeable and worth the extra effort? I did some experiments, and I get a bit of a delay on interaction; between the mouse down and the scene starting to rotate (using stock vtkInteractorStyleTrackballCamera for now). I am guessing it may be the FindPokedRenderer() taking time to figure out which renderer the interaction falls into... Some of my viewports also have a vtkOrientationMarkerWidget, which creates its own renderer, and a couple views have overlay (non-interactive) renderer as well, so the total number of renderers is even higher, maybe 12 altogether. Thank you! Miro ________________________________ From: R?bert ?pir > Sent: Thursday, December 8, 2016 8:49:10 PM To: Miroslav Drahos; vtkusers at vtk.org Subject: RE: [vtkusers] interactor with one renwin and multiple renderers Hi Miro, I'm doing similar task. You can derive your own interactorstyle class from one of the vtkInteractorStyle classes. There you can override mouse and key event functions and using this->Interactor->FindPokedRenderer(mouseX, mouseY); you can detect to which of the multiple renderers the user clicked and handle the interaction according to your needs. Robert From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Miroslav Drahos Sent: Thursday, December 8, 2016 10:44 PM To: vtkusers at vtk.org Subject: [vtkusers] interactor with one renwin and multiple renderers Hi VTK folks, I am trying to optimize my application, and am thinking to replace multiple QVTKWidget2 instances with only one widget + multiple viewports/renderers. Then I could issue only one expensive call to vtkRenderWindow::Render() and re-draw everything. I saw the example for multiple viewports (http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/MultipleViewports) and it all looks very straightforward, but... How do I handle interaction? Let's say in a typical quad view setup of a medical application, with 3 orthogonal slices and one 3D view there are different interactor styles needed. But it is the renderwindow that provides interactor, so in the tiled version I would end up with only one common interactor/interactor style. Any advice is greatly appreciated! Miro -------------- next part -------------- An HTML attachment was scrubbed... URL: From tehsunnliu at yahoo.com Wed Dec 14 20:06:55 2016 From: tehsunnliu at yahoo.com (Alex Liu) Date: Wed, 14 Dec 2016 18:06:55 -0700 (MST) Subject: [vtkusers] Point Cloud to Mesh In-Reply-To: References: <1481705792558-5741531.post@n5.nabble.com> Message-ID: <1481764015398-5741540.post@n5.nabble.com> Actually there are some unwanted things in the image which I've to filter it and if I do generate surface directly from the image the surface is not very smooth. ----- Alex Liu +15574855474 -- View this message in context: http://vtk.1045678.n5.nabble.com/Point-Cloud-to-Mesh-tp5741531p5741540.html Sent from the VTK - Users mailing list archive at Nabble.com. From tehsunnliu at yahoo.com Wed Dec 14 20:10:38 2016 From: tehsunnliu at yahoo.com (Alex Liu) Date: Wed, 14 Dec 2016 18:10:38 -0700 (MST) Subject: [vtkusers] Point Cloud to Mesh In-Reply-To: References: <1481705792558-5741531.post@n5.nabble.com> Message-ID: <1481764238239-5741541.post@n5.nabble.com> Yes I was trying to configure PoissonReconstruction module, but I'm getting some error while compiling this module with Mingw. I'll try to setup this module Thanks for your reply Andras and Jorge ----- Alex Liu +15574855474 -- View this message in context: http://vtk.1045678.n5.nabble.com/Point-Cloud-to-Mesh-tp5741531p5741541.html Sent from the VTK - Users mailing list archive at Nabble.com. From patriciop at gmail.com Thu Dec 15 02:09:46 2016 From: patriciop at gmail.com (Patricio Palma C.) Date: Thu, 15 Dec 2016 04:09:46 -0300 Subject: [vtkusers] Can I use XDMF as a container for a set of vtkDataSets? Message-ID: Hi experts ?I would like to export a set of vtkUnstructuredGrids and vtkPolyDatas to a file in XDMF format by using vtkXdmfWriter. For the moment I've managed to generate a XDMF output for each vtkUnstructuredGrids and vtkPolydata object, which is a a bit cumbersome (a lot of files :) ). My expectation is to get only one XDMF file with the description of the each dataset and one .H5 file with the data (points, cells, data attributes) of the datasets. Is it possible to do that with vtkXdfmWriter? ? Thanks? -- Patricio Palma Contreras -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Thu Dec 15 06:25:05 2016 From: dave.demarle at kitware.com (David E DeMarle) Date: Thu, 15 Dec 2016 06:25:05 -0500 Subject: [vtkusers] Can I use XDMF as a container for a set of vtkDataSets? In-Reply-To: References: Message-ID: Yes. Gather them together into a multblock first and then write that. On Dec 15, 2016 2:11 AM, "Patricio Palma C." wrote: > Hi experts > > ?I would like to export a set of vtkUnstructuredGrids and vtkPolyDatas to > a file in XDMF format by using vtkXdmfWriter. For the moment I've managed > to generate a XDMF output for each vtkUnstructuredGrids and vtkPolydata > object, which is a a bit cumbersome (a lot of files :) ). > > My expectation is to get only one XDMF file with the description of the > each dataset and one .H5 file with the data (points, cells, data > attributes) of the datasets. > > Is it possible to do that with vtkXdfmWriter? > > ? > Thanks? > -- > Patricio Palma Contreras > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From utkarsh.ayachit at kitware.com Thu Dec 15 08:16:59 2016 From: utkarsh.ayachit at kitware.com (Utkarsh Ayachit) Date: Thu, 15 Dec 2016 08:16:59 -0500 Subject: [vtkusers] Internal data source memory leak In-Reply-To: <4F991BB8-2D9B-4FBF-A2D2-35EF574E5338@googlemail.com> References: <4F991BB8-2D9B-4FBF-A2D2-35EF574E5338@googlemail.com> Message-ID: Kit, vtkAlgorithm already supports API such as SetInputDataObject(...). Isn't that sufficient in your case? Utkarsh On Thu, Dec 8, 2016 at 9:50 AM, Kit Chambers wrote: > Hi, > > For a variety of reasons I want to write a VTK filter which can take it input from a connection or an internal data source. I have come up with a method that works, but it is showing up a memory leak when i run with VTK_DEBUG_LEAKS=ON. > > > Essentially I have a data source which looks something like this: > > class vtkDataSource : public vtkImageAlgorithm > { > public: > ?. blah blah ? > > //! Set the internal data source > virtual int SetInputData(vtkImageData* data) > { > this->InternalData=data; > this->Modified(); > return 1; > } > protected: > vtkDataSource(){ > this->SetNumberOfInputPorts(0); > this->SetNumberOfOutputPorts(1); > this->InternalData=nullptr; > } > > ~vtkDataSource(){} > > int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *){ > > if(this->InternalData==nullptr){ > vtkErrorMacro("no input data"); > return 0; > } > vtkSmartPointer outData = vtkImageData::GetData(outputVector); > outData->ShallowCopy(this->InternalData); > return 1; > } > private: > vtkSmartPointer InternalData; > }; > > And then I have a filter which looks like this: > > class vtkInternalDataSourceFilter : public vtkImageAlgorithm > { > public: > ? blah blah ... > > //! Set the internal data source > virtual int SetInputData(vtkImageData* data) > { > this->InternalData = vtkSmartPointer::New(); > this->InternalData->SetInputData(data); > > // This line triggers the memory leak > this->SetInputConnection(0,this->InternalData->GetOutputPort(0)); > this->Modified(); > return 1; > } > protected: > vtkInternalDataSourceFilter(){ > this->SetNumberOfInputPorts(1); > this->SetNumberOfOutputPorts(1); > } > ~vtkInternalDataSourceFilter(){} > > int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *){ > vtkSmartPointer input = vtkImageData::GetData(inputVector[0],0); > ? do something ? > return 1; > } > private: > vtkSmartPointer InternalData; > }; > > > You then run the filter using > > vtkSmartPointer flt = vtkSmartPointer::New(); > flt->SetInputData(Img); > flt->Update(); > > Specifically I get > > vtkDebugLeaks has detected LEAKS! > Class "vtkDataSource" has 1 instance still around. > Class "vtkCellData" has 2 instances still around. > Class "vtkInformationIntegerVectorValue" has 3 instances still around. > Class "vtkInformationVector" has 4 instances still around. > Class "vtkPointData" has 2 instances still around. > Class "vtkCompositeDataPipeline" has 1 instance still around. > Class "vtkPoints" has 2 instances still around. > Class "vtkInformation" has 16 instances still around. > Class "vtkInformationIntegerPointerValue" has 2 instances still around. > Class "vtkIdList" has 2 instances still around. > Class "vtkDoubleArray" has 2 instances still around. > Class "vtkAlgorithmOutput" has 1 instance still around. > Class "vtkInformationIntegerValue" has 32 instances still around. > Class "vtkImageData" has 2 instances still around. > Class "vtkFloatArray" has 1 instance still around. > Class "vtkInformationStringValue" has 1 instance still around. > Class "vtkInformationExecutivePortVectorValue" has 1 instance still around. > Class "vtkVoxel" has 2 instances still around. > Class "vtkFieldData" has 2 instances still around. > Class "vtkCommand or subclass" has 2 instances still around. > Class "vtkInformationExecutivePortValue" has 1 instance still around. > > however if I run everything normally it works fine. > > // Create a data source > vtkSmartPointer src = vtkSmartPointer::New(); > src->SetInputData(Img); > src->Update(); > > vtkSmartPointer flt = vtkSmartPointer::New(); > lt->SetInputConnection(0,src->GetOutputPort(0)); > flt->Update(); > > > Any help would be appreciated and apologies for the large amount of code in this message. > > > Kit > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers From chbrossotaf at gmail.com Thu Dec 15 11:24:18 2016 From: chbrossotaf at gmail.com (CharlesB) Date: Thu, 15 Dec 2016 17:24:18 +0100 Subject: [vtkusers] Allowing empty data arrays as field attributes? Message-ID: Hello, If I have a DataSet with one of its DataArray being empty (those things happen), I get a crash when going through CopyData during a pipeline execution, precisely in the loop of vtkDataSetAttributes::CopyData, called in UnstructuredGridGeometryFilter. Is it a bug, or is it required that the user doesn't create empty arrays? I use VTK 7.0.0. Best regards Charles -------------- next part -------------- An HTML attachment was scrubbed... URL: From kit.chambers.kc at gmail.com Thu Dec 15 11:57:01 2016 From: kit.chambers.kc at gmail.com (Kit Chambers) Date: Thu, 15 Dec 2016 16:57:01 +0000 Subject: [vtkusers] Internal data source memory leak In-Reply-To: References: <4F991BB8-2D9B-4FBF-A2D2-35EF574E5338@googlemail.com> Message-ID: <788E8213-7BD6-426F-95F3-1BF6B91F8BEC@googlemail.com> Thanks Utkarsh, I had originally discounted things like SetInputData() and SetInputDataObject() because I was getting errors related to WHOLE_EXTENT. However, I now think those errors are symptomatic of other issues I need to fix, as opposed to reinventing the wheel. Kit > On 15 Dec 2016, at 13:16, Utkarsh Ayachit wrote: > > Kit, > > vtkAlgorithm already supports API such as SetInputDataObject(...). > Isn't that sufficient in your case? > > Utkarsh > > On Thu, Dec 8, 2016 at 9:50 AM, Kit Chambers wrote: >> Hi, >> >> For a variety of reasons I want to write a VTK filter which can take it input from a connection or an internal data source. I have come up with a method that works, but it is showing up a memory leak when i run with VTK_DEBUG_LEAKS=ON. >> >> >> Essentially I have a data source which looks something like this: >> >> class vtkDataSource : public vtkImageAlgorithm >> { >> public: >> ?. blah blah ? >> >> //! Set the internal data source >> virtual int SetInputData(vtkImageData* data) >> { >> this->InternalData=data; >> this->Modified(); >> return 1; >> } >> protected: >> vtkDataSource(){ >> this->SetNumberOfInputPorts(0); >> this->SetNumberOfOutputPorts(1); >> this->InternalData=nullptr; >> } >> >> ~vtkDataSource(){} >> >> int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *){ >> >> if(this->InternalData==nullptr){ >> vtkErrorMacro("no input data"); >> return 0; >> } >> vtkSmartPointer outData = vtkImageData::GetData(outputVector); >> outData->ShallowCopy(this->InternalData); >> return 1; >> } >> private: >> vtkSmartPointer InternalData; >> }; >> >> And then I have a filter which looks like this: >> >> class vtkInternalDataSourceFilter : public vtkImageAlgorithm >> { >> public: >> ? blah blah ... >> >> //! Set the internal data source >> virtual int SetInputData(vtkImageData* data) >> { >> this->InternalData = vtkSmartPointer::New(); >> this->InternalData->SetInputData(data); >> >> // This line triggers the memory leak >> this->SetInputConnection(0,this->InternalData->GetOutputPort(0)); >> this->Modified(); >> return 1; >> } >> protected: >> vtkInternalDataSourceFilter(){ >> this->SetNumberOfInputPorts(1); >> this->SetNumberOfOutputPorts(1); >> } >> ~vtkInternalDataSourceFilter(){} >> >> int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *){ >> vtkSmartPointer input = vtkImageData::GetData(inputVector[0],0); >> ? do something ? >> return 1; >> } >> private: >> vtkSmartPointer InternalData; >> }; >> >> >> You then run the filter using >> >> vtkSmartPointer flt = vtkSmartPointer::New(); >> flt->SetInputData(Img); >> flt->Update(); >> >> Specifically I get >> >> vtkDebugLeaks has detected LEAKS! >> Class "vtkDataSource" has 1 instance still around. >> Class "vtkCellData" has 2 instances still around. >> Class "vtkInformationIntegerVectorValue" has 3 instances still around. >> Class "vtkInformationVector" has 4 instances still around. >> Class "vtkPointData" has 2 instances still around. >> Class "vtkCompositeDataPipeline" has 1 instance still around. >> Class "vtkPoints" has 2 instances still around. >> Class "vtkInformation" has 16 instances still around. >> Class "vtkInformationIntegerPointerValue" has 2 instances still around. >> Class "vtkIdList" has 2 instances still around. >> Class "vtkDoubleArray" has 2 instances still around. >> Class "vtkAlgorithmOutput" has 1 instance still around. >> Class "vtkInformationIntegerValue" has 32 instances still around. >> Class "vtkImageData" has 2 instances still around. >> Class "vtkFloatArray" has 1 instance still around. >> Class "vtkInformationStringValue" has 1 instance still around. >> Class "vtkInformationExecutivePortVectorValue" has 1 instance still around. >> Class "vtkVoxel" has 2 instances still around. >> Class "vtkFieldData" has 2 instances still around. >> Class "vtkCommand or subclass" has 2 instances still around. >> Class "vtkInformationExecutivePortValue" has 1 instance still around. >> >> however if I run everything normally it works fine. >> >> // Create a data source >> vtkSmartPointer src = vtkSmartPointer::New(); >> src->SetInputData(Img); >> src->Update(); >> >> vtkSmartPointer flt = vtkSmartPointer::New(); >> lt->SetInputConnection(0,src->GetOutputPort(0)); >> flt->Update(); >> >> >> Any help would be appreciated and apologies for the large amount of code in this message. >> >> >> Kit >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers From dave.demarle at kitware.com Thu Dec 15 14:28:14 2016 From: dave.demarle at kitware.com (David E DeMarle) Date: Thu, 15 Dec 2016 14:28:14 -0500 Subject: [vtkusers] Version mismatch in Python bindings? In-Reply-To: References: Message-ID: I think you are getting a different VTK module. What does vtk.__file__ return? The standalone installer by default puts VTK at c:\Program Files\VTK 7.1.0, and you generally are expected to run it from there. Ie, the version Kitware supplies is generally incompatible with whatever system install of Python you might have. David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Wed, Dec 7, 2016 at 10:57 AM, Andrea Gavana wrote: > Dear VTK users, > > I have downloaded the official VTK 7.1 binaries with Python bindings > from the VTK website, at this address: > > http://www.vtk.org/files/release/7.1/vtkpython-7.1.0-Windows-64bit.exe > > Notice the 7.1 in the name. This is the only installation of VTK I have on > my machine. Also, from the attached screenshot, please notice that the DLLs > on my system have a "7.1" label attached. > > However, when I import vtk in my system I get this: > > >>> import vtk > >>> vtk > > >>> version = vtk.vtkVersion() > >>> version.GetVTKVersion() > '7.0.0' > >>> version.GetVTKMajorVersion(), version.GetVTKMinorVersion() > (7, 0) > >>> version.GetVTKSourceVersion() > 'vtk version 7.0.0' > >>> > > > Am I doing something wrong or is it possible that there is a version > mismatch in the Python bindings? It's of course not an issue, I just wanted > to check if my setup was broken or not... > > Thank you. > > Andrea. > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrea.gavana at gmail.com Thu Dec 15 14:50:14 2016 From: andrea.gavana at gmail.com (Andrea Gavana) Date: Thu, 15 Dec 2016 19:50:14 +0000 Subject: [vtkusers] Version mismatch in Python bindings? In-Reply-To: References: Message-ID: Hi David, Thank you for your answer. I will check what vtk.__file__ returns when I get back to the office, but I am positive it will return the same path as I mentioned in my email. Since I don't have admin privileges, I installed VTK in a temporary folder, copied all the dlls and python files into site-packages and added the site-packages VTK folder to the PATH environment variable. I'm quite positive there is no other vtk on my system nor in the PATH, but I will run some more check tomorrow. I simply had the feeling that the python bindings were still built with vtk 7.0 and not 7.1. Andrea. On Thu, 15 Dec 2016 at 20:28, David E DeMarle wrote: > I think you are getting a different VTK module. What does vtk.__file__ > return? > > The standalone installer by default puts VTK at c:\Program Files\VTK > 7.1.0, and you generally are expected to run it from there. Ie, the version > Kitware supplies is generally incompatible with whatever system install of > Python you might have. > > > > > > David E DeMarle > Kitware, Inc. > R&D Engineer > 21 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-881-4909 > > > > On Wed, Dec 7, 2016 at 10:57 AM, Andrea Gavana > wrote: > > Dear VTK users, > > I have downloaded the official VTK 7.1 binaries with Python bindings > from the VTK website, at this address: > > http://www.vtk.org/files/release/7.1/vtkpython-7.1.0-Windows-64bit.exe > > Notice the 7.1 in the name. This is the only installation of VTK I have on > my machine. Also, from the attached screenshot, please notice that the DLLs > on my system have a "7.1" label attached. > > However, when I import vtk in my system I get this: > > >>> import vtk > >>> vtk > > >>> version = vtk.vtkVersion() > >>> version.GetVTKVersion() > '7.0.0' > >>> version.GetVTKMajorVersion(), version.GetVTKMinorVersion() > (7, 0) > >>> version.GetVTKSourceVersion() > 'vtk version 7.0.0' > >>> > > > Am I doing something wrong or is it possible that there is a version > mismatch in the Python bindings? It's of course not an issue, I just wanted > to check if my setup was broken or not... > > Thank you. > > Andrea. > > > > > > _______________________________________________ > > > Powered by www.kitware.com > > > > > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > > > > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > > > > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > > > > > Follow this link to subscribe/unsubscribe: > > > http://public.kitware.com/mailman/listinfo/vtkusers > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Thu Dec 15 14:56:04 2016 From: dave.demarle at kitware.com (David E DeMarle) Date: Thu, 15 Dec 2016 14:56:04 -0500 Subject: [vtkusers] Version mismatch in Python bindings? In-Reply-To: References: Message-ID: Seems to check out OK on a test system here. vtk version 7.1.0 Python 2.7.3 (default, Apr 9 2015, 15:02:17) [MSC v.1500 64 bit (AMD64)] on win 32 Type "help", "copyright", "credits" or "license" for more information. >>> import vtk >>> vtk.__file__ 'C:\\Program Files\\VTK 7.1.0\\bin\\lib\\site-packages\\vtk\\__init__.pyc' >>> version = vtk.vtkVersion() >>> version.GetVTKMajorVersion() 7 >>> version.GetVTKMinorVersion() 1 >>> version.GetVTKSourceVersion() 'vtk version 7.1.0' >>> let us know what turns up please. David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Thu, Dec 15, 2016 at 2:50 PM, Andrea Gavana wrote: > Hi David, > > Thank you for your answer. > > I will check what vtk.__file__ returns when I get back to the office, but > I am positive it will return the same path as I mentioned in my email. > > Since I don't have admin privileges, I installed VTK in a temporary > folder, copied all the dlls and python files into site-packages and added > the site-packages VTK folder to the PATH environment variable. I'm quite > positive there is no other vtk on my system nor in the PATH, but I will run > some more check tomorrow. > > I simply had the feeling that the python bindings were still built with > vtk 7.0 and not 7.1. > > Andrea. > > > On Thu, 15 Dec 2016 at 20:28, David E DeMarle > wrote: > >> I think you are getting a different VTK module. What does vtk.__file__ >> return? >> >> The standalone installer by default puts VTK at c:\Program Files\VTK >> 7.1.0, and you generally are expected to run it from there. Ie, the version >> Kitware supplies is generally incompatible with whatever system install of >> Python you might have. >> >> >> >> >> >> David E DeMarle >> Kitware, Inc. >> R&D Engineer >> 21 Corporate Drive >> Clifton Park, NY 12065-8662 >> Phone: 518-881-4909 <(518)%20881-4909> >> >> >> >> On Wed, Dec 7, 2016 at 10:57 AM, Andrea Gavana >> wrote: >> >> Dear VTK users, >> >> I have downloaded the official VTK 7.1 binaries with Python bindings >> from the VTK website, at this address: >> >> http://www.vtk.org/files/release/7.1/vtkpython-7.1.0-Windows-64bit.exe >> >> Notice the 7.1 in the name. This is the only installation of VTK I have >> on my machine. Also, from the attached screenshot, please notice that the >> DLLs on my system have a "7.1" label attached. >> >> However, when I import vtk in my system I get this: >> >> >>> import vtk >> >>> vtk >> >> >>> version = vtk.vtkVersion() >> >>> version.GetVTKVersion() >> '7.0.0' >> >>> version.GetVTKMajorVersion(), version.GetVTKMinorVersion() >> (7, 0) >> >>> version.GetVTKSourceVersion() >> 'vtk version 7.0.0' >> >>> >> >> >> Am I doing something wrong or is it possible that there is a version >> mismatch in the Python bindings? It's of course not an issue, I just wanted >> to check if my setup was broken or not... >> >> Thank you. >> >> Andrea. >> >> >> >> >> >> _______________________________________________ >> >> >> Powered by www.kitware.com >> >> >> >> >> >> Visit other Kitware open-source projects at http://www.kitware.com/ >> opensource/opensource.html >> >> >> >> >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> >> >> >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> >> >> >> >> Follow this link to subscribe/unsubscribe: >> >> >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> >> >> >> >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From patriciop at gmail.com Thu Dec 15 15:10:06 2016 From: patriciop at gmail.com (Patricio Palma C.) Date: Thu, 15 Dec 2016 17:10:06 -0300 Subject: [vtkusers] Can I use XDMF as a container for a set of vtkDataSets? In-Reply-To: References: Message-ID: Hi Dave I've modified the classes to use a multiblock dataset, however it' seems there is something wrong with the writer since it crashes when Write() method is called. This is a part of the code: class X { // this are the member definition vtkSmartPointer m_writer; vtkSmartPointer m_mds; int m_index; . X::X() : m_writer(vtkSmartPointer::New()), M_mds(vtkSmartPointer::New()), m_index(0) { } void X::addData(vtkDataSet* data) { m_mds->SetBlock(m_index++, data); } void X::finishAndWrite() { m_writer->SetFileName("outputfile.xfm"); m_writer->SetInputData(m_mds); m_writer->Write(); // the application crashes here } }; I pass each dataset with addData() and at the end I call finishAndWrite(). I'm not sure what I am doing wrong. Thanks On Thu, Dec 15, 2016 at 8:25 AM, David E DeMarle wrote: > Yes. Gather them together into a multblock first and then write that. > > On Dec 15, 2016 2:11 AM, "Patricio Palma C." wrote: > >> Hi experts >> >> ?I would like to export a set of vtkUnstructuredGrids and vtkPolyDatas to >> a file in XDMF format by using vtkXdmfWriter. For the moment I've managed >> to generate a XDMF output for each vtkUnstructuredGrids and vtkPolydata >> object, which is a a bit cumbersome (a lot of files :) ). >> >> My expectation is to get only one XDMF file with the description of the >> each dataset and one .H5 file with the data (points, cells, data >> attributes) of the datasets. >> >> Is it possible to do that with vtkXdfmWriter? >> >> ? >> Thanks? >> -- >> Patricio Palma Contreras >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> 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 >> >> -- Patricio Palma Contreras -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Thu Dec 15 15:24:10 2016 From: dave.demarle at kitware.com (David E DeMarle) Date: Thu, 15 Dec 2016 15:24:10 -0500 Subject: [vtkusers] Can I use XDMF as a container for a set of vtkDataSets? In-Reply-To: References: Message-ID: not clear yet why that would go wrong. What does stack trace say? Also, before calling Write(), call m_mds->PrintSelf() to verify that the multiblock has what you expect in it. Could also debug by trying one of VTK's other writers (perhaps vtkXMLMultiBlockDataWriter for example) and see if that also fails. David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Thu, Dec 15, 2016 at 3:10 PM, Patricio Palma C. wrote: > Hi Dave > > I've modified the classes to use a multiblock dataset, however it' seems > there is something wrong with the writer since it crashes when Write() > method is called. > > This is a part of the code: > > class X { > > // this are the member definition > vtkSmartPointer m_writer; > vtkSmartPointer m_mds; > int m_index; > . > > X::X() : m_writer(vtkSmartPointer::New()), > M_mds(vtkSmartPointer::New()), > m_index(0) { } > > > void X::addData(vtkDataSet* data) > { > m_mds->SetBlock(m_index++, data); > } > > void X::finishAndWrite() > { > m_writer->SetFileName("outputfile.xfm"); > m_writer->SetInputData(m_mds); > m_writer->Write(); // the application crashes here > } > > }; > > I pass each dataset with addData() and at the end I call > finishAndWrite(). I'm not sure what I am doing wrong. > > > Thanks > > On Thu, Dec 15, 2016 at 8:25 AM, David E DeMarle > wrote: > >> Yes. Gather them together into a multblock first and then write that. >> >> On Dec 15, 2016 2:11 AM, "Patricio Palma C." wrote: >> >>> Hi experts >>> >>> ?I would like to export a set of vtkUnstructuredGrids and vtkPolyDatas >>> to a file in XDMF format by using vtkXdmfWriter. For the moment I've >>> managed to generate a XDMF output for each vtkUnstructuredGrids and >>> vtkPolydata object, which is a a bit cumbersome (a lot of files :) ). >>> >>> My expectation is to get only one XDMF file with the description of the >>> each dataset and one .H5 file with the data (points, cells, data >>> attributes) of the datasets. >>> >>> Is it possible to do that with vtkXdfmWriter? >>> >>> ? >>> Thanks? >>> -- >>> Patricio Palma Contreras >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> 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 >>> >>> > > > -- > Patricio Palma Contreras > -------------- next part -------------- An HTML attachment was scrubbed... URL: From patriciop at gmail.com Thu Dec 15 17:42:11 2016 From: patriciop at gmail.com (Patricio Palma C.) Date: Thu, 15 Dec 2016 19:42:11 -0300 Subject: [vtkusers] Can I use XDMF as a container for a set of vtkDataSets? In-Reply-To: References: Message-ID: Hi David Thanks for the suggestions, the Print() call showed that writer FileName was empty. Moving the SetFileName() call after SetInputData() solved the problem. Regards Patricio On Thu, Dec 15, 2016 at 5:24 PM, David E DeMarle wrote: > not clear yet why that would go wrong. What does stack trace say? > > Also, before calling Write(), call m_mds->PrintSelf() to verify that the > multiblock has what you expect in it. > > Could also debug by trying one of VTK's other writers (perhaps > vtkXMLMultiBlockDataWriter for example) and see if that also fails. > > > David E DeMarle > Kitware, Inc. > R&D Engineer > 21 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-881-4909 <(518)%20881-4909> > > On Thu, Dec 15, 2016 at 3:10 PM, Patricio Palma C. > wrote: > >> Hi Dave >> >> I've modified the classes to use a multiblock dataset, however it' seems >> there is something wrong with the writer since it crashes when Write() >> method is called. >> >> This is a part of the code: >> >> class X { >> >> // this are the member definition >> vtkSmartPointer m_writer; >> vtkSmartPointer m_mds; >> int m_index; >> . >> >> X::X() : m_writer(vtkSmartPointer::New()), >> M_mds(vtkSmartPointer::New()), >> m_index(0) { } >> >> >> void X::addData(vtkDataSet* data) >> { >> m_mds->SetBlock(m_index++, data); >> } >> >> void X::finishAndWrite() >> { >> m_writer->SetFileName("outputfile.xfm"); >> m_writer->SetInputData(m_mds); >> m_writer->Write(); // the application crashes here >> } >> >> }; >> >> I pass each dataset with addData() and at the end I call >> finishAndWrite(). I'm not sure what I am doing wrong. >> >> >> Thanks >> >> On Thu, Dec 15, 2016 at 8:25 AM, David E DeMarle < >> dave.demarle at kitware.com> wrote: >> >>> Yes. Gather them together into a multblock first and then write that. >>> >>> On Dec 15, 2016 2:11 AM, "Patricio Palma C." >>> wrote: >>> >>>> Hi experts >>>> >>>> ?I would like to export a set of vtkUnstructuredGrids and vtkPolyDatas >>>> to a file in XDMF format by using vtkXdmfWriter. For the moment I've >>>> managed to generate a XDMF output for each vtkUnstructuredGrids and >>>> vtkPolydata object, which is a a bit cumbersome (a lot of files :) ). >>>> >>>> My expectation is to get only one XDMF file with the description of the >>>> each dataset and one .H5 file with the data (points, cells, data >>>> attributes) of the datasets. >>>> >>>> Is it possible to do that with vtkXdfmWriter? >>>> >>>> ? >>>> Thanks? >>>> -- >>>> Patricio Palma Contreras >>>> >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ at: >>>> 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 >>>> >>>> >> >> >> -- >> Patricio Palma Contreras >> > > -- Patricio Palma Contreras -------------- next part -------------- An HTML attachment was scrubbed... URL: From tehsunnliu at yahoo.com Fri Dec 16 02:34:53 2016 From: tehsunnliu at yahoo.com (Alex Liu) Date: Fri, 16 Dec 2016 00:34:53 -0700 (MST) Subject: [vtkusers] Error: Compiling PoissonReconstruct with Mingw Message-ID: <1481873693140-5741571.post@n5.nabble.com> Hi all. I was trying to compile PoissonReconstruct module of vtk with mingw and I'm getting error. Im using windows 7 64bit and wanted to use PoissonReconstruct in my project. IDE - QtCreator This is the error I'm getting.. This is the error file - PoissonReconstruct-Error.txt Please let me know how can I solve this problem. Thank you. Alex ----- Alex Liu +15574855474 -- View this message in context: http://vtk.1045678.n5.nabble.com/Error-Compiling-PoissonReconstruct-with-Mingw-tp5741571.html Sent from the VTK - Users mailing list archive at Nabble.com. From josp.jorge at gmail.com Fri Dec 16 03:35:29 2016 From: josp.jorge at gmail.com (Jorge Perez) Date: Fri, 16 Dec 2016 09:35:29 +0100 Subject: [vtkusers] Error: Compiling PoissonReconstruct with Mingw In-Reply-To: <1481873693140-5741571.post@n5.nabble.com> References: <1481873693140-5741571.post@n5.nabble.com> Message-ID: Hello Alex, I haven't compiled VTK on MINGW32 but looking at the error log you have posted it seems that there is an error en Remote/PoissonReconstruction/source/Hash.h for this compiler environment. As a quick fix you can change the line #ifdef WIN32 for this one #if defined(WIN32) && !defined(__MINGW32__) I haven't tried this solution but it should work. HTH Jorge 2016-12-16 8:34 GMT+01:00 Alex Liu via vtkusers : > Hi all. > I was trying to compile PoissonReconstruct module of vtk with mingw and I'm > getting error. > Im using windows 7 64bit and wanted to use PoissonReconstruct in my > project. > IDE - QtCreator > > This is the error I'm getting.. > > > This is the error file - PoissonReconstruct-Error.txt > txt?dl=0> > > Please let me know how can I solve this problem. > Thank you. > Alex > > > > ----- > Alex Liu > +15574855474 > -- > View this message in context: http://vtk.1045678.n5.nabble. > com/Error-Compiling-PoissonReconstruct-with-Mingw-tp5741571.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rustem.khabetdinov at gmail.com Fri Dec 16 12:09:34 2016 From: rustem.khabetdinov at gmail.com (Rustem Khabetdinov) Date: Fri, 16 Dec 2016 20:09:34 +0300 Subject: [vtkusers] vtkTensorGlyph and eigenvalues, eigenvectors Message-ID: Hello, I have eigenvectors and eigenvalues and when I use them to create tensor it never shows up as an ellipsoid. Here's my code: vectors = [-0.99912958, 0.04171436, 0, 0, 0, 1, -0.04171436, -0.99912958, -0] values = [ -5.05684034e+14, 5.09855264e+14, 6.13882990e+14] points = vtk.vtkPoints() points.InsertNextPoint(values) poly_data = vtk.vtkPolyData() poly_data.SetPoints(points) tensor_data = vtk.vtkDoubleArray() tensor_data.SetNumberOfTuples(1) tensor_data.SetNumberOfComponents(9) tensor_data.InsertTuple(0, vectors) poly_data.GetPointData().SetTensors(tensor_data) sphere = vtk.vtkSphereSource() sphere.SetThetaResolution(8) sphere.SetPhiResolution(8) sphere.Update() tensor = vtk.vtkTensorGlyph() tensor.SetInputData(poly_data) tensor.SetSourceData(sphere.GetOutput()) tensor.SetScaleFactor(10) tensor.ClampScalingOn() tensor.ThreeGlyphsOff() tensor.ExtractEigenvaluesOff() tensor.Update() Am I doing something wrong? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Fri Dec 16 15:38:49 2016 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Fri, 16 Dec 2016 21:38:49 +0100 Subject: [vtkusers] Notification after interaction with vtkComposite(TransferFunction|ControlPoints)Item In-Reply-To: References: Message-ID: 2016-08-30 8:14 GMT+02:00 Elvis Stansvik : > 2016-06-27 15:55 GMT+02:00 Elvis Stansvik : >> >> 2016-06-22 12:23 GMT+02:00 Elvis Stansvik : >>> >>> 2016-06-22 11:07 GMT+02:00 Elvis Stansvik : >>>> >>>> 2016-06-22 10:36 GMT+02:00 Elvis Stansvik >>>> : >>>>> >>>>> 2016-06-21 16:02 GMT+02:00 Elvis Stansvik >>>>> : >>>>>> >>>>>> Hi all, >>>>>> >>>>>> I'm using a vtkCompositeTransferFunctionItem + >>>>>> vtkCompositeControlPointsItem in a vtkChartXY to modify the transfer >>>>>> functions used for some volume rendering. >>>>>> >>>>>> Is there some event from one of these items I can observe that will >>>>>> fire once interaction has occurred? I know I can observe the ModifiedEvent >>>>>> of the vtkCompositeTransferFunctionItem, but when dragging points around, it >>>>>> will fire on each mouse move. I need to be notified only once the >>>>>> interaction has stopped. >>>>> >>>>> >>>>> Looking at the code, I noticed that vtkControlPointsItem seem to emit >>>>> vtkCommand::StartInteractionEvent and vtkCommand::EndInteractionEvent >>>>> (though I'm not sure...), and since vtkCompositeControlPointsItem indirectly >>>>> inherits vtkControlPointsItem, I tried to observe >>>>> vtkCommand::EndInteractionEvent with >>>>> >>>>> self._pointsItem.AddObserver(vtkCommand.EndInteractionEvent, >>>>> lambda *_: print('interaction >>>>> ended')) >>>>> >>>>> where self._pointsItem is my vtkCompositeControlPointsItem. >>>>> >>>>> But it seems the event is not emitted when I interact with the points. >>>>> >>>>> Any ideas here? Surely there must be some way of being notified when >>>>> interaction with the color transfer functions has ended? My use case is that >>>>> I don't want to issue a re-render of my volume each time the mouse moves >>>>> when dragging a point around. Only when dragging finally stops do I want to >>>>> re-render. >>>>> >>>>> Any advice is much appriciated. >>>> >>>> >>>> After some more experimentation, trying to observe various events on the >>>> items, the chart, the context view and the context scene, I've realized I >>>> can observe >>>> >>>> vtkCommand.LeftButtonReleaseEvent >>>> vtkCommand.RightButtonReleaseEvent >>>> vtkCommand.MiddleButtonReleaseEvent >>>> >>>> on the context scene. This will work as a workaround, but seems overly >>>> liberal and complicated. Is there no single event on the composite control >>>> points item or the composite transfer function item I could observe? >>> >>> >>> Although I realized now that this approach won't work, since for some >>> reason, by the time I get the vtkCommand.MiddleButtonReleaseEvent, the point >>> has not yet been deleted. So still looking for a proper solution. >> >> >> Noone knows how this can be done? I noticed that ParaView also has this >> behavior (that the rendering is updated on each mouse move when dragging a >> point in the transfer function). For me, this will be too heavy :/ Only once >> mouse movement stops do I want to re-render. But I can't seem to find a way >> to do this when using these VTK-bundled transfer function editing widgets. > > > Sorry to bump my own thread, but I'm still searching for a solution here. I > find it incredible that this wouldn't be possible. Anyone know how I can be > notified once editing of a transfer function stops when using these editor > widgets? > > Thanks in advance, > Elvis Has really noone faced this problem before? I must be a unicorn! :) At the moment, I'm doing void ColorEditor::mouseReleaseEvent(QMouseEvent *event) { // Hack: We don't want to emit functionModified each time a control point moves // during dragging, as it leads to too many Render() calls and a sluggish // experience, but there seems to be no way in VTK to be notified when the // interaction with a point in a vtkControlPointsItem ends (user releases // a point). See my thread at [1]. As a workaround, we emit functionModified // each time the mouse is released over the editor widget, since more often // than not, this marks the end of a point move. // // [1] http://public.kitware.com/pipermail/vtkusers/2016-June/095609.html emit functionModified(); VTKWidget::mouseReleaseEvent(event); } in the QVTKWidget subclass I have for the chart, as a sort of compromise, but it's too liberal obviously. Thanks, Elvis > >> >> Elvis >> >>> >>> >>> Elvis >>> >>>> >>>> >>>> >>>> Elvis >>>> >>>>> >>>>> Elvis >>>>> >>>>>> >>>>>> Thanks in advance, >>>>>> Elvis >>>>> >>>>> >>>> >>> >> > From spamsammeler at gmail.com Sat Dec 17 12:00:02 2016 From: spamsammeler at gmail.com (Adam Mueller) Date: Sat, 17 Dec 2016 10:00:02 -0700 (MST) Subject: [vtkusers] Read Vector Field from Structured Point VTK file In-Reply-To: References: Message-ID: <1481994002851-5741576.post@n5.nabble.com> Hi Andras Lasso,I got a 3D Vector Field represented by a vtk ascii file this: # vtk DataFile Version 3.0Data converted from AVS by write_vtk moduleASCIIDATASET STRUCTURED_POINTSDIMENSIONS 30 30 10ORIGIN 0.000000 0.000000 0.000000SPACING 1.000000 1.000000 1.000000POINT_DATA 90000VECTORS data float-7 -9 20 -6.5 -9.2 20... Such that the first line of the vectors (-7 -9 20) is the Vector at position 0 0 0 and the very last line is the vector at position 30 30 10.I want to read in these Vektors and visualize the vectorfield on the one hand. But on the other hand i want to be able to have a function givemevector(x,y,z), which returns the vector at given position (x,y,z)I didn't get to work any of those things. -- View this message in context: http://vtk.1045678.n5.nabble.com/Re-Read-Vector-Field-from-Structured-Point-VTK-file-tp5741498p5741576.html Sent from the VTK - Users mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rustem.khabetdinov at gmail.com Sat Dec 17 14:58:58 2016 From: rustem.khabetdinov at gmail.com (Rustem Khabetdinov) Date: Sat, 17 Dec 2016 22:58:58 +0300 Subject: [vtkusers] vtkTensorGlyph and eigenvalues, eigenvectors In-Reply-To: References: Message-ID: Hello again, everyone. I've found my mistake. I didn't use my eigenvalues to make normals instead I used them as centre point. Best Regards, Rustem Khabetdinov 2016-12-16 20:09 GMT+03:00 Rustem Khabetdinov : > Hello, > I have eigenvectors and eigenvalues and when I use them to create tensor > it never shows up as an ellipsoid. Here's my code: > > vectors = [-0.99912958, 0.04171436, 0, 0, 0, 1, -0.04171436, > -0.99912958, -0] > values = [ -5.05684034e+14, 5.09855264e+14, 6.13882990e+14] > points = vtk.vtkPoints() > points.InsertNextPoint(values) > poly_data = vtk.vtkPolyData() > poly_data.SetPoints(points) > tensor_data = vtk.vtkDoubleArray() > tensor_data.SetNumberOfTuples(1) > tensor_data.SetNumberOfComponents(9) > tensor_data.InsertTuple(0, vectors) > poly_data.GetPointData().SetTensors(tensor_data) > > sphere = vtk.vtkSphereSource() > sphere.SetThetaResolution(8) > sphere.SetPhiResolution(8) > sphere.Update() > > tensor = vtk.vtkTensorGlyph() > tensor.SetInputData(poly_data) > tensor.SetSourceData(sphere.GetOutput()) > tensor.SetScaleFactor(10) > tensor.ClampScalingOn() > tensor.ThreeGlyphsOff() > tensor.ExtractEigenvaluesOff() > tensor.Update() > > Am I doing something wrong? > > Thanks > -------------- next part -------------- An HTML attachment was scrubbed... URL: From psakievich at gmail.com Sun Dec 18 01:16:16 2016 From: psakievich at gmail.com (Philip Sakievich) Date: Sat, 17 Dec 2016 22:16:16 -0800 Subject: [vtkusers] PVTS, Multiblock or Both In-Reply-To: References: Message-ID: Andy and community, I have read about the concept of whole extent vs extent, but the one thing I don't seem to be able to determine is how to set the whole extent to be different. I tried using vtkStructuredGrid.Crop() but nothing is happening. In the code snippet below, I have previously declared points local to each processor. I now want to populate a structured grid and write a *pvts that ties them all together. When I run this code the pvts writes itself and the files, but they all have the same whole extent and extent. Nothing is cropped to the desired local extent. What am I doing wrong? How do I specify a whole extent that is uniform across all processors, and a local extent that is specific to each one? #create grid and filter for processing to writer pf=vtk.vtkProgrammableFilter() sg=vtk.vtkStructuredGrid() #set extent global sg.SetExtent(0,15,0,32,0,15) #set extent local if rank==0: lE=np.array([0,8,0,32,0,8],dtype=int) sg.Crop(lE) if rank==1: lE=np.array([0,8,0,32,7,15],dtype=int) sg.Crop(lE) if rank==2: lE=np.array([7,15,0,32,0,8],dtype=int) sg.Crop(lE) if rank==3: lE=np.array([7,15,0,32,7,15],dtype=int) sg.Crop(lE) sg.SetPoints(pnts) pf.SetInputData(sg) writer=vtk.vtkXMLPStructuredGridWriter() writer.SetInputConnection(pf.GetOutputPort()) writer.SetController(contr) writer.SetDataModeToAscii() writer.SetFileName('testgrid.pvts') writer.SetNumberOfPieces(nranks) writer.SetStartPiece(rank) writer.SetEndPiece(rank) writer.Write() Thanks, Phil On Tue, Dec 13, 2016 at 7:31 AM, Andy Bauer wrote: > Hi, > > I would recommend using the pvts format since that is the best format for > storing structured grids. If you read it back in it will know how to > properly partition the data set for different amounts of processes as well > as do things like ghost cells, extract surfaces, etc. > > For topologically structured grids like vtkStructuredGrid there are two > types of extents, "whole extent" describes the beginning and ending node > (inclusive) in each direction for the entire grid while "extent" refers to > each process's (or pieces if you're serial but doing streaming) partition > of the grid. I believe this should be explained in the VTK User's Guide > which is now available for free as a pdf download. > > Cheers, > Andy > > On Tue, Dec 13, 2016 at 10:21 AM, Philip Sakievich > wrote: > >> Greetings, >> >> I am reasonably new to vtk and I am mainly using it to manage datasets on >> structured grids. >> >> I am trying to write data for a structured grid in parallel python via >> MPI. Each process has a separate portion of the grid, and I'm trying to >> figure out how to set up the write process. I was following this example: >> >> http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=IO/ParallelXML/ >> Testing/Python/testParallelXMLWriters.py >> >> But then I realized that in this case each process has the entire grid, >> and each processor is just writing a portion of the data it contains. So >> do I need to use a multiblock data set? Can someone please provide a >> simple example of how to write a structured grid in parallel provided each >> process has the local extent correctly specified? >> >> Thanks >> >> -- >> Phil Sakievich >> >> PhD Candidate - Mechanical Engineering >> Arizona State University - Ira A. Fulton School for Engineering of Matter >> Transport and Energy >> Tempe, Arizona >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> 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 >> >> > -- Phil Sakievich PhD Candidate - Mechanical Engineering Arizona State University - Ira A. Fulton School for Engineering of Matter Transport and Energy Tempe, Arizona -------------- next part -------------- An HTML attachment was scrubbed... URL: From mlwzsy at gmail.com Sun Dec 18 06:25:19 2016 From: mlwzsy at gmail.com (Levi Max) Date: Sun, 18 Dec 2016 19:25:19 +0800 Subject: [vtkusers] How to make one transfer function satisfied to different data? Message-ID: hello, in my practice, i find that for each similar but different data, the shapes of alpha-TF are different. so, i am wondering how to make it that using one TF with no changes to render different but similar data, such as two persons' heart ct dicom? Best, Levi -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjordan at live.at Sun Dec 18 08:50:52 2016 From: mjordan at live.at (M. Jordan) Date: Sun, 18 Dec 2016 13:50:52 +0000 Subject: [vtkusers] Get only surface of vtkDelaunay3D output Message-ID: Hello guys, i computed the alpha shape of a polydata object with vtkDelaunay3D. Without an alpha value i got a well looking convex hull. But when I am computing the alpha shape there are also some elements inside of the needed hull. How can I get the surface/hull of the Delaunay3D output? Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From lasso at queensu.ca Sun Dec 18 10:05:41 2016 From: lasso at queensu.ca (Andras Lasso) Date: Sun, 18 Dec 2016 15:05:41 +0000 Subject: [vtkusers] Read Vector Field from Structured Point VTK file In-Reply-To: <1481994002851-5741576.post@n5.nabble.com> References: <1481994002851-5741576.post@n5.nabble.com> Message-ID: Your file contains a vector volume. You can read it into a vtkImageData and then set as DisplacementGridData in vtkGridTransform. The grid transform can very efficiently apply displacements to meshes or images (vtkTransformPolyDataFilter, vtkImageReslice) and can be used for generating data for visualization. You can have a look at how visualization of displacement fields (VTK transforms) are implemented 3D in Slicer or in Paraview. Example visualizations in 3D Slicer: https://www.slicer.org/wiki/Documentation/Nightly/Modules/Transforms#Transform_display_options Source code: https://github.com/Slicer/Slicer/blob/master/Modules/Loadable/Transforms/Logic/vtkSlicerTransformLogic.cxx Andras From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Adam Mueller Sent: December 17, 2016 12:00 To: vtkusers at vtk.org Subject: Re: [vtkusers] Read Vector Field from Structured Point VTK file Hi Andras Lasso, I got a 3D Vector Field represented by a vtk ascii file this: # vtk DataFile Version 3.0 Data converted from AVS by write_vtk module ASCII DATASET STRUCTURED_POINTS DIMENSIONS 30 30 10 ORIGIN 0.000000 0.000000 0.000000 SPACING 1.000000 1.000000 1.000000 POINT_DATA 90000 VECTORS data float -7 -9 20 -6.5 -9.2 20 ... Such that the first line of the vectors (-7 -9 20) is the Vector at position 0 0 0 and the very last line is the vector at position 30 30 10. I want to read in these Vektors and visualize the vectorfield on the one hand. But on the other hand i want to be able to have a function givemevector(x,y,z), which returns the vector at given position (x,y,z) I didn't get to work any of those things. ________________________________ View this message in context: Re: Read Vector Field from Structured Point VTK file Sent from the VTK - Users mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tehsunnliu at yahoo.com Sun Dec 18 20:24:19 2016 From: tehsunnliu at yahoo.com (Alex Liu) Date: Sun, 18 Dec 2016 18:24:19 -0700 (MST) Subject: [vtkusers] Error: Compiling PoissonReconstruct with Mingw In-Reply-To: References: <1481873693140-5741571.post@n5.nabble.com> Message-ID: <1482110659371-5741588.post@n5.nabble.com> Thank you so much for your reply Jorge.. The solution you gave solved the error. But how I'm getting another error. Error at GUISupport/Qt/PluginInstall.cmake:13 (FILE): file INSTALL cannot find "D:/VTK-7.0.0/Build/lib/libQVTKWidgetPlugin.dll". Call Stack (most recent call first): GUISupport/Qt/cmake_install.cmake:71 (include) cmake_install.cmake:159 (include) ----- Alex Liu +15574855474 -- View this message in context: http://vtk.1045678.n5.nabble.com/Error-Compiling-PoissonReconstruct-with-Mingw-tp5741571p5741588.html Sent from the VTK - Users mailing list archive at Nabble.com. From tehsunnliu at yahoo.com Sun Dec 18 21:13:33 2016 From: tehsunnliu at yahoo.com (Alex Liu) Date: Sun, 18 Dec 2016 19:13:33 -0700 (MST) Subject: [vtkusers] Error: Compiling PoissonReconstruct with Mingw In-Reply-To: <1481873693140-5741571.post@n5.nabble.com> References: <1481873693140-5741571.post@n5.nabble.com> Message-ID: <1482113613311-5741589.post@n5.nabble.com> Ok I followed the instruction given here and Copied libQVTKWidgetPlugin.dll from Build/bin/libQVTKWidgetPlugin.dll to Build/lib and it compiled successfully with no error. But, now I cannot find vtkPoissonReconstruct.h in the include folder. ----- Alex Liu +15574855474 -- View this message in context: http://vtk.1045678.n5.nabble.com/Error-Compiling-PoissonReconstruct-with-Mingw-tp5741571p5741589.html Sent from the VTK - Users mailing list archive at Nabble.com. From tehsunnliu at yahoo.com Sun Dec 18 21:47:57 2016 From: tehsunnliu at yahoo.com (Alex Liu) Date: Sun, 18 Dec 2016 19:47:57 -0700 (MST) Subject: [vtkusers] Error: Compiling PoissonReconstruct with Mingw In-Reply-To: <1482113613311-5741589.post@n5.nabble.com> References: <1481873693140-5741571.post@n5.nabble.com> <1482113613311-5741589.post@n5.nabble.com> Message-ID: <1482115677594-5741590.post@n5.nabble.com> I think the error is with CMakeLists.txt when I Click on Generate in CMake I get those warning CMake Warning (dev) in Remote/PoissonReconstruction/source/CMakeLists.txt: Policy CMP0020 is not set: Automatically link Qt executables to qtmain target on Windows. Run "cmake --help-policy CMP0020" for policy details. Use the cmake_policy command to set the policy and suppress this warning. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) in Remote/PoissonReconstruction/example/CMakeLists.txt: Policy CMP0020 is not set: Automatically link Qt executables to qtmain target on Windows. Run "cmake --help-policy CMP0020" for policy details. Use the cmake_policy command to set the policy and suppress this warning. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) in Remote/PoissonReconstruction/source/CMakeLists.txt: Policy CMP0020 is not set: Automatically link Qt executables to qtmain target on Windows. Run "cmake --help-policy CMP0020" for policy details. Use the cmake_policy command to set the policy and suppress this warning. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) in Remote/PoissonReconstruction/example/CMakeLists.txt: Policy CMP0020 is not set: Automatically link Qt executables to qtmain target on Windows. Run "cmake --help-policy CMP0020" for policy details. Use the cmake_policy command to set the policy and suppress this warning. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) in Remote/PoissonReconstruction/source/CMakeLists.txt: Policy CMP0020 is not set: Automatically link Qt executables to qtmain target on Windows. Run "cmake --help-policy CMP0020" for policy details. Use the cmake_policy command to set the policy and suppress this warning. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) in Remote/PoissonReconstruction/example/CMakeLists.txt: Policy CMP0020 is not set: Automatically link Qt executables to qtmain target on Windows. Run "cmake --help-policy CMP0020" for policy details. Use the cmake_policy command to set the policy and suppress this warning. This warning is for project developers. Use -Wno-dev to suppress it. Please Help. Thank you. ----- Alex Liu +15574855474 -- View this message in context: http://vtk.1045678.n5.nabble.com/Error-Compiling-PoissonReconstruct-with-Mingw-tp5741571p5741590.html Sent from the VTK - Users mailing list archive at Nabble.com. From cory.quammen at kitware.com Mon Dec 19 10:16:17 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Mon, 19 Dec 2016 10:16:17 -0500 Subject: [vtkusers] Get only surface of vtkDelaunay3D output In-Reply-To: References: Message-ID: To get the surface, add a vtkDataSetSurfaceFilter after vtkDelaunay3D: http://www.vtk.org/doc/nightly/html/classvtkDataSetSurfaceFilter.html HTH, Cory On Sun, Dec 18, 2016 at 8:50 AM, M. Jordan wrote: > Hello guys, > > i computed the alpha shape of a polydata object with vtkDelaunay3D. > Without an alpha value i got a well looking convex hull. > But when I am computing the alpha shape there are also some elements > inside of the needed hull. > > How can I get the surface/hull of the Delaunay3D output? > > Thank you! > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -- Cory Quammen Staff R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy.bauer at kitware.com Mon Dec 19 10:18:36 2016 From: andy.bauer at kitware.com (Andy Bauer) Date: Mon, 19 Dec 2016 10:18:36 -0500 Subject: [vtkusers] PVTS, Multiblock or Both In-Reply-To: References: Message-ID: You need to specify the WholeExtent in the RequestInformation request.You actually don't specify the local extent, the pipeline will give you that for a source. I'd recommend looking at the Imaging/Core/vtkRTAnalyticSource.cxx class in VTK to see how it's done as a source. On Sun, Dec 18, 2016 at 1:16 AM, Philip Sakievich wrote: > Andy and community, > > I have read about the concept of whole extent vs extent, but the one thing > I don't seem to be able to determine is how to set the whole extent to be > different. I tried using vtkStructuredGrid.Crop() but nothing is happening. > > In the code snippet below, I have previously declared points local to each > processor. I now want to populate a structured grid and write a *pvts that > ties them all together. When I run this code the pvts writes itself and > the files, but they all have the same whole extent and extent. Nothing is > cropped to the desired local extent. What am I doing wrong? How do I > specify a whole extent that is uniform across all processors, and a local > extent that is specific to each one? > > #create grid and filter for processing to writer > pf=vtk.vtkProgrammableFilter() > sg=vtk.vtkStructuredGrid() > > #set extent global > sg.SetExtent(0,15,0,32,0,15) > > #set extent local > if rank==0: > lE=np.array([0,8,0,32,0,8],dtype=int) > sg.Crop(lE) > if rank==1: > lE=np.array([0,8,0,32,7,15],dtype=int) > sg.Crop(lE) > if rank==2: > lE=np.array([7,15,0,32,0,8],dtype=int) > sg.Crop(lE) > if rank==3: > lE=np.array([7,15,0,32,7,15],dtype=int) > sg.Crop(lE) > > sg.SetPoints(pnts) > pf.SetInputData(sg) > > writer=vtk.vtkXMLPStructuredGridWriter() > writer.SetInputConnection(pf.GetOutputPort()) > writer.SetController(contr) > writer.SetDataModeToAscii() > writer.SetFileName('testgrid.pvts') > writer.SetNumberOfPieces(nranks) > writer.SetStartPiece(rank) > writer.SetEndPiece(rank) > writer.Write() > > Thanks, > > Phil > > On Tue, Dec 13, 2016 at 7:31 AM, Andy Bauer > wrote: > >> Hi, >> >> I would recommend using the pvts format since that is the best format for >> storing structured grids. If you read it back in it will know how to >> properly partition the data set for different amounts of processes as well >> as do things like ghost cells, extract surfaces, etc. >> >> For topologically structured grids like vtkStructuredGrid there are two >> types of extents, "whole extent" describes the beginning and ending node >> (inclusive) in each direction for the entire grid while "extent" refers to >> each process's (or pieces if you're serial but doing streaming) partition >> of the grid. I believe this should be explained in the VTK User's Guide >> which is now available for free as a pdf download. >> >> Cheers, >> Andy >> >> On Tue, Dec 13, 2016 at 10:21 AM, Philip Sakievich >> wrote: >> >>> Greetings, >>> >>> I am reasonably new to vtk and I am mainly using it to manage datasets >>> on structured grids. >>> >>> I am trying to write data for a structured grid in parallel python via >>> MPI. Each process has a separate portion of the grid, and I'm trying to >>> figure out how to set up the write process. I was following this example: >>> >>> http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=IO/ParallelXML/ >>> Testing/Python/testParallelXMLWriters.py >>> >>> But then I realized that in this case each process has the entire grid, >>> and each processor is just writing a portion of the data it contains. So >>> do I need to use a multiblock data set? Can someone please provide a >>> simple example of how to write a structured grid in parallel provided each >>> process has the local extent correctly specified? >>> >>> Thanks >>> >>> -- >>> Phil Sakievich >>> >>> PhD Candidate - Mechanical Engineering >>> Arizona State University - Ira A. Fulton School for Engineering of >>> Matter Transport and Energy >>> Tempe, Arizona >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> 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 >>> >>> >> > > > -- > Phil Sakievich > > PhD Candidate - Mechanical Engineering > Arizona State University - Ira A. Fulton School for Engineering of Matter > Transport and Energy > Tempe, Arizona > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Joan.Hensen at outlook.de Mon Dec 19 10:44:07 2016 From: Joan.Hensen at outlook.de (Joan Hensen) Date: Mon, 19 Dec 2016 15:44:07 +0000 Subject: [vtkusers] How to get an older version of VTK Message-ID: Dear all, is there a way to get an older Version of VTK, say, 5 or even 4? On the official website I only find 6.3.0. Best, J -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy.bauer at kitware.com Mon Dec 19 10:53:08 2016 From: andy.bauer at kitware.com (Andy Bauer) Date: Mon, 19 Dec 2016 10:53:08 -0500 Subject: [vtkusers] How to get an older version of VTK In-Reply-To: References: Message-ID: Using git and the repo at https://gitlab.kitware.com/vtk/vtk you can check out tags for revisions all the way back to 1.1.x. On Mon, Dec 19, 2016 at 10:44 AM, Joan Hensen wrote: > Dear all, > > > is there a way to get an older Version of VTK, say, 5 or even 4? > > > On the official website I only find 6.3.0. > > > Best, > > > J > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan.lipsa at kitware.com Mon Dec 19 11:16:08 2016 From: dan.lipsa at kitware.com (Dan Lipsa) Date: Mon, 19 Dec 2016 11:16:08 -0500 Subject: [vtkusers] How to make one transfer function satisfied to different data? In-Reply-To: References: Message-ID: Hi Levi, Not sure you can. One thing you can do is analyze your data and set transfer function parameters such as the range of data before you render. Maybe other domain specific parameters are appropriate. Dan On Sun, Dec 18, 2016 at 6:25 AM, Levi Max wrote: > hello, > in my practice, i find that for each similar but different data, the > shapes of alpha-TF are different. > so, i am wondering how to make it that using one TF with no changes to > render different but similar data, such as two persons' heart ct dicom? > > > Best, > Levi > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From f_magician at mac.com Mon Dec 19 16:54:04 2016 From: f_magician at mac.com (Magician) Date: Tue, 20 Dec 2016 06:54:04 +0900 Subject: [vtkusers] vtk.vtkDistributedDataFilter() not works In-Reply-To: References: <1C21FF27-6B83-4CD1-9577-D72E1B2A0092@mac.com> Message-ID: Hi Cory, Sorry again. (My mailer has some trouble...) I tried Sphere Source too, but the results are same. > src = vtk.vtkSphereSource() > src.SetCenter(0.0, 0.0, 0.0) > src.SetRadius(1.0) > src.SetThetaResolution(8) > src.SetPhiResolution(5) > src.Update() If the code runs on native VTK environments, maybe my ParaView?s VTK has some trouble. Magician > On Dec 13, 2016, at 12:03, Cory Quammen wrote: > > Hmm, I'm not sure. Could you try setting the input to d3 to the output > of a vtkSphereSource and see if you get the expected results there? > You should get half the sphere in one piece and the other half sphere > in the other piece. > > Thanks, > Cory > > On Sat, Dec 10, 2016 at 10:35 AM, Magician wrote: >> Hi Cory, >> >> >> Sorry for my late reply. >> I modified my code for splitting the points, but the filter doesn?t work. >> >> >> import vtk >> >> src = vtk.vtkPointSource() >> src.SetCenter((0.0, 0.0, 0.0)) >> src.SetNumberOfPoints(1000) >> src.SetRadius(1.0) >> src.Update() >> >> dst = vtk.vtkPolyData() >> pts = vtk.vtkPoints() >> pts.SetData(src.GetOutput().GetPoints().GetData()) >> dst.SetPoints(pts) >> cells = vtk.vtkCellArray() >> for i in range(src.GetOutput().GetNumberOfPoints()): >> ptIds = vtk.vtkIdList() >> ptIds.InsertNextId(i) >> cells.InsertNextCell(ptIds) >> dst.SetVerts(cells) >> >> d3 = vtk.vtkDistributedDataFilter() >> d3.UseMinimalMemoryOff() >> d3.SetInputData(dst) >> d3.SetBoundaryMode(0) >> d3.SetBoundaryModeToSplitBoundaryCells() >> d3.Update() >> >> writer = vtk.vtkXMLPUnstructuredGridWriter() >> writer.SetInputData(d3.GetOutput()) >> writer.SetFileName(?test.pvtu?) >> writer.SetNumberOfPieces(2) >> writer.WriteSummaryFileOn() >> writer.SetStartPiece(0) >> writer.SetEndPiece(1) >> writer.Write() >> >> >> Magician >> >> >>> On Dec 6, 2016, at 01:33, Cory Quammen wrote: >>> >>> I'm not 100% sure of this, but the vtkPointSource produces an output >>> with only 1 cell. That may not be partitionable by the >>> vtkDistributeDataFilter. You shouldn't get duplicate output in each >>> piece, but let's not worry about that for now. >>> >>> Try swapping out the vtkPointSource with a vtkSphereSource and see if >>> the data is partitioned. >>> >>> HTH, >>> Cory >>> >>> On Sat, Dec 3, 2016 at 8:57 PM, Magician wrote: >>>> Hi Cory, >>>> >>>> >>>> Thanks for your advice. >>>> >>>> Hmmm...I already run the script with MPI. >>>> The attached script is a minimal sample. >>>> >>>> >>>> If I execute it, pvtu file is exported. >>>> But the all piece sources are exactly same, and not partitioned. >>>> >>>> >>>> >>>> Magician >>>> >>>> >>>>> On Nov 28, 2016, at 06:19, Cory Quammen wrote: >>>>> >>>>> I think you need to run your script in parallel with MPI for the >>>>> partitioning to work. See [1] for an example of how to use this >>>>> filter. >>>>> >>>>> Hope that helps, >>>>> Cory >>>>> >>>>> [1] http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=Filters/Parallel/Testing/Cxx/DistributedData.cxx >>>>> >>>>> On Sun, Nov 27, 2016 at 10:39 AM, Magician wrote: >>>>>> Does anyone use the vtkDistributedDataFilter? >>>>>> >>>>>> >>>>>> On Nov 19, 2016, at 18:16, Magician wrote: >>>>>> >>>>>> Hi all, >>>>>> >>>>>> >>>>>> I posted the message about partitioning datasets. >>>>>> >>>>>> >>>>>> I still trying vtk.vtkDistributedDataFilter(), but the exported data aren?t >>>>>> partitioned. >>>>>> My VTK version is 7.1.0 (pvpython with ParaView 5.2.0 RC3) and executing on >>>>>> 2 CPUs. >>>>>> >>>>>> Here is the sample code: >>>>>> >>>>>> import vtk >>>>>> >>>>>> source = vtk.vtkPointSource() >>>>>> source.SetCenter((0.0, 0.0, 0.0)) >>>>>> source.SetNumberOfPoints(1000000) >>>>>> source.SetRadius(1.0) >>>>>> source.Update() >>>>>> >>>>>> d3 = vtk.vtkDistributedDataFilter() >>>>>> d3.SetInputData(source.GetOutput()) >>>>>> d3.SetBoundaryMode(0) >>>>>> d3.Update() >>>>>> >>>>>> writer = vtk.vtkXMLPUnstructuredGridWriter() >>>>>> writer.SetInputData(d3.GetOutput()) >>>>>> writer.SetFileName(?test.pvtu?) >>>>>> writer.SetNumberOfPieces(2) >>>>>> writer.WriteSummaryFileOn() >>>>>> writer.SetStartPiece(0) >>>>>> writer.SetEndPiece(1) >>>>>> writer.Write() >>>>>> >>>>>> How to partition data? >>>>>> >>>>>> >>>>>> Magician From afboucher at gmail.com Tue Dec 20 00:47:48 2016 From: afboucher at gmail.com (Alexandre Boucher) Date: Mon, 19 Dec 2016 22:47:48 -0700 Subject: [vtkusers] opengl2 vtk rendering back end and Qt Message-ID: Hi All, I am having a problem using the opengl2 backend with QVTKWidget (I tried Qt 5.4 to 5.7 and vtk 7.0 and 7.1). When looking at a simple vtkImageData for instance some of the faces of the grid are not properly displayed, see image below. Everything works fine with the opengl1 backend. I also try using QVTKWidget2, but I am getting a crash when the widget call OpenGLInitState(). Is there a trick to use Qt and opengl2? Thanks [image: Inline image 1] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 29648 bytes Desc: not available URL: From spir.robert at gmail.com Tue Dec 20 01:50:56 2016 From: spir.robert at gmail.com (=?utf-8?B?UsOzYmVydCDFoHBpcg==?=) Date: Tue, 20 Dec 2016 07:50:56 +0100 Subject: [vtkusers] opengl2 vtk rendering back end and Qt In-Reply-To: References: Message-ID: <008f01d25a8d$6ac37a50$404a6ef0$@gmail.com> I think you need to set stencil buffer size using these calls QSurfaceFormat surfaceFormat = ui->qvtkWidget->windowHandle()->format(); surfaceFormat.setStencilBufferSize(8); ui->qvtkWidget->windowHandle()->setFormat(surfaceFormat); Robert From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Alexandre Boucher Sent: Tuesday, December 20, 2016 6:48 AM To: vtkusers at vtk.org Subject: [vtkusers] opengl2 vtk rendering back end and Qt Hi All, I am having a problem using the opengl2 backend with QVTKWidget (I tried Qt 5.4 to 5.7 and vtk 7.0 and 7.1). When looking at a simple vtkImageData for instance some of the faces of the grid are not properly displayed, see image below. Everything works fine with the opengl1 backend. I also try using QVTKWidget2, but I am getting a crash when the widget call OpenGLInitState(). Is there a trick to use Qt and opengl2? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 29648 bytes Desc: not available URL: From tehsunnliu at yahoo.com Tue Dec 20 04:29:59 2016 From: tehsunnliu at yahoo.com (Alex Liu) Date: Tue, 20 Dec 2016 02:29:59 -0700 (MST) Subject: [vtkusers] Program crashes at return EXIT_SUCCESS in QT Creator Message-ID: <1482226199285-5741607.post@n5.nabble.com> Hi all. I build vtk using mingw32 in windows 7-64bit. When I run any VTK program it runs fine till it hits the line return EXIT_SUCCESS or return 0, even the simplest example VTK Hello World Example I tried adding #include VTK_MODULE_INIT(vtkInteractionStyle) VTK_MODULE_INIT(vtkRenderingFreeType) VTK_MODULE_INIT(vtkRenderingOpenGL2) //VTK_MODULE_INIT(vtkDomainsChemistryOpenGL2) //VTK_MODULE_INIT(vtkRenderingContextOpenGL2) //VTK_MODULE_INIT(vtkRenderingVolumeOpenGL2) but nothing helps. I don't get any error message from vtk. All i get is Error - RtlWerpReportException failed with status code :-1073741823. Will try to launch the process directly from QT error window. I noticed one thing, that is, the program only crashes if i render window and display it. Please help me with this problem. Thank you all. Alex. ----- Alex Liu +15574855474 -- View this message in context: http://vtk.1045678.n5.nabble.com/Program-crashes-at-return-EXIT-SUCCESS-in-QT-Creator-tp5741607.html Sent from the VTK - Users mailing list archive at Nabble.com. From david.lonie at kitware.com Tue Dec 20 10:41:13 2016 From: david.lonie at kitware.com (David Lonie) Date: Tue, 20 Dec 2016 10:41:13 -0500 Subject: [vtkusers] Program crashes at return EXIT_SUCCESS in QT Creator In-Reply-To: <1482226199285-5741607.post@n5.nabble.com> References: <1482226199285-5741607.post@n5.nabble.com> Message-ID: AIUI, mingw isn't well supported by VTK. You're in somewhat uncharted waters, things will be smoother with MSVC. Best, Dave On Tue, Dec 20, 2016 at 4:29 AM, Alex Liu via vtkusers wrote: > Hi all. > I build vtk using mingw32 in windows 7-64bit. When I run any VTK program it > runs fine till it hits the line return EXIT_SUCCESS or return 0, even the > simplest example VTK Hello World Example > > > I tried adding > #include > VTK_MODULE_INIT(vtkInteractionStyle) > VTK_MODULE_INIT(vtkRenderingFreeType) > VTK_MODULE_INIT(vtkRenderingOpenGL2) > //VTK_MODULE_INIT(vtkDomainsChemistryOpenGL2) > //VTK_MODULE_INIT(vtkRenderingContextOpenGL2) > //VTK_MODULE_INIT(vtkRenderingVolumeOpenGL2) > > but nothing helps. > I don't get any error message from vtk. All i get is > Error - RtlWerpReportException failed with status code :-1073741823. Will > try to launch the process directly > from QT error window. > > I noticed one thing, that is, the program only crashes if i render window > and display it. > Please help me with this problem. > Thank you all. > Alex. > > > > ----- > Alex Liu > +15574855474 > -- > View this message in context: http://vtk.1045678.n5.nabble. > com/Program-crashes-at-return-EXIT-SUCCESS-in-QT-Creator-tp5741607.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.lonie at kitware.com Tue Dec 20 10:42:40 2016 From: david.lonie at kitware.com (David Lonie) Date: Tue, 20 Dec 2016 10:42:40 -0500 Subject: [vtkusers] opengl2 vtk rendering back end and Qt In-Reply-To: <008f01d25a8d$6ac37a50$404a6ef0$@gmail.com> References: <008f01d25a8d$6ac37a50$404a6ef0$@gmail.com> Message-ID: Looks like depth testing isn't working. Does your context have a depth buffer? On Tue, Dec 20, 2016 at 1:50 AM, R?bert ?pir wrote: > I think you need to set stencil buffer size using these calls > > > > QSurfaceFormat surfaceFormat = ui->qvtkWidget->windowHandle()->format(); > > surfaceFormat.setStencilBufferSize(8); > > ui->qvtkWidget->windowHandle()->setFormat(surfaceFormat); > > > > Robert > > > > *From:* vtkusers [mailto:vtkusers-bounces at vtk.org] *On Behalf Of *Alexandre > Boucher > *Sent:* Tuesday, December 20, 2016 6:48 AM > *To:* vtkusers at vtk.org > *Subject:* [vtkusers] opengl2 vtk rendering back end and Qt > > > > Hi All, > > > > I am having a problem using the opengl2 backend with QVTKWidget (I tried > Qt 5.4 to 5.7 and vtk 7.0 and 7.1). When looking at a simple vtkImageData > for instance some of the faces of the grid are not properly displayed, see > image below. Everything works fine with the opengl1 backend. > > > > I also try using QVTKWidget2, but I am getting a crash when the widget > call OpenGLInitState(). > > > > Is there a trick to use Qt and opengl2? > > > > Thanks > > > > > > > > [image: Inline image 1] > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 29648 bytes Desc: not available URL: From cory.quammen at kitware.com Tue Dec 20 10:45:26 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Tue, 20 Dec 2016 10:45:26 -0500 Subject: [vtkusers] Get only surface of vtkDelaunay3D output In-Reply-To: References: Message-ID: Please include the mailing list in your replies so that everyone may benefit from the discussion. I'm not sure I understand what you are seeing. Could you attach a small screen shot that shows the inside cells? By the way, you should be able to use either vtkGeometryFilter or vtkDataSetSurfaceFilter, you don't need to use both (they do basically the same thing). Thanks, Cory On Tue, Dec 20, 2016 at 10:33 AM, M. Jordan wrote: > Thank you very much, I tried it but i think there are still some cells > inside.. > > vtkSmartPointer delaunay3D = > vtkSmartPointer::New(); > delaunay3D->SetInputConnection(INPUT->GetOutputPort()); > delaunay3D->Update(); > > vtkSmartPointer geometryFilter = > vtkSmartPointer::New(); > geometryFilter->SetInputConnection(delaunay3D->GetOutputPort()); > geometryFilter->Update(); > > vtkSmartPointer surfaceFilter2 = > vtkSmartPointer::New(); > surfaceFilter2->SetInputData(geometryFilter>GetOutput()); > surfaceFilter2->Update(); > > What I am doing wrong? > > ------------------------------ > *Von:* Cory Quammen > *Gesendet:* Montag, 19. Dezember 2016 16:16 > *An:* M. Jordan > *Cc:* vtkusers at vtk.org > *Betreff:* Re: [vtkusers] Get only surface of vtkDelaunay3D output > > To get the surface, add a vtkDataSetSurfaceFilter after vtkDelaunay3D: > > http://www.vtk.org/doc/nightly/html/classvtkDataSetSurfaceFilter.html > VTK: vtkDataSetSurfaceFilter Class Reference > > www.vtk.org > virtual void SetPieceInvariant If PieceInvariant is true, > vtkDataSetSurfaceFilter requests 1 ghost level from input in order to > remove internal surface that are ... > > HTH, > Cory > > On Sun, Dec 18, 2016 at 8:50 AM, M. Jordan wrote: > >> Hello guys, >> >> i computed the alpha shape of a polydata object with vtkDelaunay3D. >> Without an alpha value i got a well looking convex hull. >> But when I am computing the alpha shape there are also some elements >> inside of the needed hull. >> >> How can I get the surface/hull of the Delaunay3D output? >> >> Thank you! >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> > > > -- > 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 andrew.slaughter at inl.gov Tue Dec 20 13:32:34 2016 From: andrew.slaughter at inl.gov (Slaughter, Andrew E) Date: Tue, 20 Dec 2016 11:32:34 -0700 Subject: [vtkusers] How to re-load time information in ExodusIIReader Message-ID: I am reading a file that contains 2 timesteps, but is then updated and has an additional timestep. How can a reload the vtkExodusIIReader to get the new time information. I attached a python script demonstrating what I am doing, but I will summarize here. My test script has two files (diffusion_1.e and diffusion_2.e that have 2 and 3 timestep respectively). If I create a vtkExodusIIReader and change the filename then I get the correct number. But, if I copy the files to a common filename I always get 2, even when the file has changed to have 3 timesteps. Any help would be appreciated, Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: diffusion_1.e Type: application/octet-stream Size: 29504 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: diffusion_2.e Type: application/octet-stream Size: 30480 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Reload.py Type: text/x-python-script Size: 1054 bytes Desc: not available URL: From marcus.hanwell at kitware.com Tue Dec 20 19:42:21 2016 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Tue, 20 Dec 2016 19:42:21 -0500 Subject: [vtkusers] opengl2 vtk rendering back end and Qt In-Reply-To: References: Message-ID: On Tue, Dec 20, 2016 at 12:47 AM, Alexandre Boucher wrote: > > I am having a problem using the opengl2 backend with QVTKWidget (I tried Qt 5.4 to 5.7 and vtk 7.0 and 7.1). When looking at a simple vtkImageData for instance some of the faces of the grid are not properly displayed, see image below. Everything works fine with the opengl1 backend. > > I also try using QVTKWidget2, but I am getting a crash when the widget call OpenGLInitState(). > > Is there a trick to use Qt and opengl2? > You don't mention what OS/graphics card you are using. I have been tracking a problem with OpenGL2 and Mesa/Intel DRI driver (based on Mesa) with Qt 5. It looks just like this, no working depth buffer. I proposed a patch that made it work, but it made the NVIDIA-based Linux systems segfault. I am hoping that we can come up with something that will work on both, but I haven't had time to revisit it since I looked at it in November. I can dig up the merge request if this sounds like your set up. Marcus From afboucher at gmail.com Tue Dec 20 20:17:41 2016 From: afboucher at gmail.com (Alexandre Boucher) Date: Tue, 20 Dec 2016 18:17:41 -0700 Subject: [vtkusers] opengl2 vtk rendering back end and Qt In-Reply-To: References: Message-ID: Sorry, This is on Windows 10, NVIDIA GTX 1080 (but tried with a few older NVIDIA card). I have been looking at it in more details today without success. The QSurfaceFormat approach mentioned above did not work. I tried to isolate the issue in a stand alone code but could not reproduce the depth issue. The closest I have been in isolating the problem is by not setting the look up table to the mapper, in that case the imageData is displayed correctly (no depth issue). without these two lines, I do not have depth issue. mapper->SetScalarRange(cmap_->lower_bound(), cmap_->upper_bound()); mapper->SetLookupTable(cmap_->color_table()); I'll further dig into that and let you know if I get closer to any solution. That same code is working fine on opengl1 backend. Thank you all for the help On Tue, Dec 20, 2016 at 5:42 PM, Marcus D. Hanwell < marcus.hanwell at kitware.com> wrote: > On Tue, Dec 20, 2016 at 12:47 AM, Alexandre Boucher > wrote: > > > > I am having a problem using the opengl2 backend with QVTKWidget (I tried > Qt 5.4 to 5.7 and vtk 7.0 and 7.1). When looking at a simple vtkImageData > for instance some of the faces of the grid are not properly displayed, see > image below. Everything works fine with the opengl1 backend. > > > > I also try using QVTKWidget2, but I am getting a crash when the widget > call OpenGLInitState(). > > > > Is there a trick to use Qt and opengl2? > > > You don't mention what OS/graphics card you are using. I have been > tracking a problem with OpenGL2 and Mesa/Intel DRI driver (based on > Mesa) with Qt 5. It looks just like this, no working depth buffer. I > proposed a patch that made it work, but it made the NVIDIA-based Linux > systems segfault. > > I am hoping that we can come up with something that will work on both, > but I haven't had time to revisit it since I looked at it in November. > I can dig up the merge request if this sounds like your set up. > > Marcus > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tehsunnliu at yahoo.com Tue Dec 20 20:19:48 2016 From: tehsunnliu at yahoo.com (Alex Liu) Date: Tue, 20 Dec 2016 18:19:48 -0700 (MST) Subject: [vtkusers] Program crashes at return EXIT_SUCCESS in QT Creator In-Reply-To: References: <1482226199285-5741607.post@n5.nabble.com> Message-ID: <1482283188102-5741618.post@n5.nabble.com> Okay Thank you for your replay Dave ----- Alex Liu +15574855474 -- View this message in context: http://vtk.1045678.n5.nabble.com/Program-crashes-at-return-EXIT-SUCCESS-in-QT-Creator-tp5741607p5741618.html Sent from the VTK - Users mailing list archive at Nabble.com. From afboucher at gmail.com Tue Dec 20 21:21:36 2016 From: afboucher at gmail.com (Alexandre Boucher) Date: Tue, 20 Dec 2016 19:21:36 -0700 Subject: [vtkusers] opengl2 vtk rendering back end and Qt In-Reply-To: References: Message-ID: Quick update. The depth issue manifests itself when I set a alpha value to the NaN. lut->SetNanColor(0.803, 0.788, 0.788, 0.8); // depth issue lut->SetNanColor(0.803, 0.788, 0.788,1.0); // NO depth issue Not sure the reason, but the problem is right there. see the code below: #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include int main(int argc, char *argv[]) { QApplication app(argc, argv); vtkSmartPointer im_data = vtkSmartPointer::New(); im_data->SetDimensions(21, 21, 21); im_data->SetSpacing(1.0, 1.0, 1.0); im_data->SetOrigin(0.0, 0.0, 0.0); vtkSmartPointer data = vtkSmartPointer::New(); data->SetNumberOfValues(20 * 20 * 20); for (int i = 0; i < data->GetNumberOfValues(); ++i) { data->SetValue(i, (float)i/20.0/20./20.0); } im_data->GetCellData()->SetScalars(data); vtkSmartPointer renderer = vtkSmartPointer::New(); vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputData(im_data); vtkSmartPointer vtk_property = vtkSmartPointer::New(); vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); renderer->AddActor(actor); vtkSmartPointer lut = vtkSmartPointer::New(); int n_colors = 8; lut->SetNumberOfTableValues(n_colors); lut->Build(); for (int i = 0; i < n_colors; i++) { lut->SetTableValue(i, 1.0-(0.125*i), 0.125*i, 0.125*i, 1.0); } lut->SetRampToLinear(); // lut->SetNanColor(0.803, 0.788, 0.788, 1.0); lut->SetNanColor(0.803, 0.788, 0.788, 0.8); mapper->SetScalarRange(0, 2); mapper->SetLookupTable(lut); mapper->Modified(); QFrame* frame = new QFrame(); frame->setLayout(new QVBoxLayout(frame)); frame->layout()->addWidget(new QLabel("TEST TEST TEST TEST ... ... TEST")); QVTKWidget* vtk_widget = new QVTKWidget(frame); frame->layout()->addWidget(vtk_widget); vtk_widget->GetRenderWindow()->AddRenderer(renderer); frame->show(); return app.exec(); } On Tue, Dec 20, 2016 at 6:17 PM, Alexandre Boucher wrote: > Sorry, This is on Windows 10, NVIDIA GTX 1080 (but tried with a few > older NVIDIA card). > > I have been looking at it in more details today without success. The > QSurfaceFormat approach mentioned above did not work. > > I tried to isolate the issue in a stand alone code but could not > reproduce the depth issue. The closest I have been in isolating the > problem is by not setting the look up table to the mapper, in that case the > imageData is displayed correctly (no depth issue). > > without these two lines, I do not have depth issue. > mapper->SetScalarRange(cmap_->lower_bound(), cmap_->upper_bound()); > mapper->SetLookupTable(cmap_->color_table()); > > I'll further dig into that and let you know if I get closer to any > solution. That same code is working fine on opengl1 backend. > > Thank you all for the help > > > On Tue, Dec 20, 2016 at 5:42 PM, Marcus D. Hanwell < > marcus.hanwell at kitware.com> wrote: > >> On Tue, Dec 20, 2016 at 12:47 AM, Alexandre Boucher >> wrote: >> > >> > I am having a problem using the opengl2 backend with QVTKWidget (I >> tried Qt 5.4 to 5.7 and vtk 7.0 and 7.1). When looking at a simple >> vtkImageData for instance some of the faces of the grid are not properly >> displayed, see image below. Everything works fine with the opengl1 backend. >> > >> > I also try using QVTKWidget2, but I am getting a crash when the widget >> call OpenGLInitState(). >> > >> > Is there a trick to use Qt and opengl2? >> > >> You don't mention what OS/graphics card you are using. I have been >> tracking a problem with OpenGL2 and Mesa/Intel DRI driver (based on >> Mesa) with Qt 5. It looks just like this, no working depth buffer. I >> proposed a patch that made it work, but it made the NVIDIA-based Linux >> systems segfault. >> >> I am hoping that we can come up with something that will work on both, >> but I haven't had time to revisit it since I looked at it in November. >> I can dig up the merge request if this sounds like your set up. >> >> Marcus >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From girish.lande at agiliad.com Wed Dec 21 01:42:43 2016 From: girish.lande at agiliad.com (Girish Lande) Date: Wed, 21 Dec 2016 12:12:43 +0530 Subject: [vtkusers] snapping point to rendered polydata Message-ID: Hi vtkusers, Greetings! I am trying to find 'normal' vector in polydata under cursor. For this I plan to first find snap cursor point on given polydata and then try to figure out normal. I am using picker to pick point on polydata but it gives me offsettted point from polydata surface. Point returned by picker is not exactly on surface. // ---------------------------------------------- this->Interactor->GetPicker()->Pick(this->Interactor->GetEventPosition()[0], this->Interactor->GetEventPosition()[1], 0, // always zero. this->Interactor->GetRenderWindow()->GetRenderers()->GetFirstRenderer()); double picked[3]; this->Interactor->GetPicker()->GetPickPosition(picked); Basically I want to know how to get snap point on polydata and find normal at that position . -- thanks & regards, Girish -------------- next part -------------- An HTML attachment was scrubbed... URL: From tehsunnliu at yahoo.com Wed Dec 21 03:15:07 2016 From: tehsunnliu at yahoo.com (Alex Liu) Date: Wed, 21 Dec 2016 01:15:07 -0700 (MST) Subject: [vtkusers] Point Cloud to Mesh In-Reply-To: References: <1481705792558-5741531.post@n5.nabble.com> Message-ID: <1482308107376-5741621.post@n5.nabble.com> Hi. I tried using PoissonReconstruction and got the result but it takes like 20 minutes with values set to poissonReconstruction->SetSamplesPerNode(1.0); poissonReconstruction->SetDepth(10); poissonReconstruction->SetKernelDepth(6); poissonReconstruction->SetSolverDivide(10); poissonReconstruction->SetIsoDivide(10); I'm still looking for a way to generate a proper mesh for point cloud. Please Help. Thank you. ----- Alex Liu +15574855474 -- View this message in context: http://vtk.1045678.n5.nabble.com/Point-Cloud-to-Mesh-tp5741531p5741621.html Sent from the VTK - Users mailing list archive at Nabble.com. From ken.martin at kitware.com Wed Dec 21 08:03:33 2016 From: ken.martin at kitware.com (Ken Martin) Date: Wed, 21 Dec 2016 08:03:33 -0500 Subject: [vtkusers] opengl2 vtk rendering back end and Qt In-Reply-To: References: Message-ID: If your LUT has transparent values then VTK will assume your object is transparent and turn of depth testing so that alpha blending can be used. If you want your object to be treated as Opaque even though it may have translucent values then set SetForceOpaque(true) ala actor->SetForceOpaque(true); On Tue, Dec 20, 2016 at 9:21 PM, Alexandre Boucher wrote: > Quick update. > > The depth issue manifests itself when I set a alpha value to the NaN. > > lut->SetNanColor(0.803, 0.788, 0.788, 0.8); // depth issue > lut->SetNanColor(0.803, 0.788, 0.788,1.0); // NO depth issue > > Not sure the reason, but the problem is right there. > > see the code below: > > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > > > > int main(int argc, char *argv[]) > { > QApplication app(argc, argv); > > vtkSmartPointer im_data = vtkSmartPointer: > :New(); > im_data->SetDimensions(21, 21, 21); > im_data->SetSpacing(1.0, 1.0, 1.0); > im_data->SetOrigin(0.0, 0.0, 0.0); > > > vtkSmartPointer data = vtkSmartPointer > ::New(); > data->SetNumberOfValues(20 * 20 * 20); > for (int i = 0; i < data->GetNumberOfValues(); ++i) { > data->SetValue(i, (float)i/20.0/20./20.0); > } > im_data->GetCellData()->SetScalars(data); > > vtkSmartPointer renderer = vtkSmartPointer:: > New(); > > vtkSmartPointer mapper = vtkSmartPointer< > vtkDataSetMapper>::New(); > mapper->SetInputData(im_data); > > vtkSmartPointer vtk_property = > vtkSmartPointer::New(); > > vtkSmartPointer actor = vtkSmartPointer::New(); > actor->SetMapper(mapper); > renderer->AddActor(actor); > > vtkSmartPointer lut = vtkSmartPointer< > vtkLookupTable>::New(); > int n_colors = 8; > lut->SetNumberOfTableValues(n_colors); > lut->Build(); > > for (int i = 0; i < n_colors; i++) { > lut->SetTableValue(i, 1.0-(0.125*i), 0.125*i, 0.125*i, 1.0); > } > lut->SetRampToLinear(); > // lut->SetNanColor(0.803, 0.788, 0.788, 1.0); > lut->SetNanColor(0.803, 0.788, 0.788, 0.8); > mapper->SetScalarRange(0, 2); > mapper->SetLookupTable(lut); > mapper->Modified(); > QFrame* frame = new QFrame(); > frame->setLayout(new QVBoxLayout(frame)); > frame->layout()->addWidget(new QLabel("TEST TEST TEST TEST ... ... > TEST")); > QVTKWidget* vtk_widget = new QVTKWidget(frame); > frame->layout()->addWidget(vtk_widget); > vtk_widget->GetRenderWindow()->AddRenderer(renderer); > > frame->show(); > return app.exec(); > > } > > > > > On Tue, Dec 20, 2016 at 6:17 PM, Alexandre Boucher > wrote: > >> Sorry, This is on Windows 10, NVIDIA GTX 1080 (but tried with a few >> older NVIDIA card). >> >> I have been looking at it in more details today without success. The >> QSurfaceFormat approach mentioned above did not work. >> >> I tried to isolate the issue in a stand alone code but could not >> reproduce the depth issue. The closest I have been in isolating the >> problem is by not setting the look up table to the mapper, in that case the >> imageData is displayed correctly (no depth issue). >> >> without these two lines, I do not have depth issue. >> mapper->SetScalarRange(cmap_->lower_bound(), cmap_->upper_bound()); >> mapper->SetLookupTable(cmap_->color_table()); >> >> I'll further dig into that and let you know if I get closer to any >> solution. That same code is working fine on opengl1 backend. >> >> Thank you all for the help >> >> >> On Tue, Dec 20, 2016 at 5:42 PM, Marcus D. Hanwell < >> marcus.hanwell at kitware.com> wrote: >> >>> On Tue, Dec 20, 2016 at 12:47 AM, Alexandre Boucher >>> wrote: >>> > >>> > I am having a problem using the opengl2 backend with QVTKWidget (I >>> tried Qt 5.4 to 5.7 and vtk 7.0 and 7.1). When looking at a simple >>> vtkImageData for instance some of the faces of the grid are not properly >>> displayed, see image below. Everything works fine with the opengl1 backend. >>> > >>> > I also try using QVTKWidget2, but I am getting a crash when the widget >>> call OpenGLInitState(). >>> > >>> > Is there a trick to use Qt and opengl2? >>> > >>> You don't mention what OS/graphics card you are using. I have been >>> tracking a problem with OpenGL2 and Mesa/Intel DRI driver (based on >>> Mesa) with Qt 5. It looks just like this, no working depth buffer. I >>> proposed a patch that made it work, but it made the NVIDIA-based Linux >>> systems segfault. >>> >>> I am hoping that we can come up with something that will work on both, >>> but I haven't had time to revisit it since I looked at it in November. >>> I can dig up the merge request if this sounds like your set up. >>> >>> Marcus >>> >> >> > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -- Ken Martin PhD Chairman & CFO Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 518 371 3971 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 romain.cendre at optopartner.com Wed Dec 21 10:13:01 2016 From: romain.cendre at optopartner.com (Romain CENDRE) Date: Wed, 21 Dec 2016 16:13:01 +0100 (CET) Subject: [vtkusers] Getting LUT with nuances In-Reply-To: <1637796372.905385.1482332031781.JavaMail.zimbra@optopartner.com> References: <111581613.478658.1482229858767.JavaMail.zimbra@optopartner.com> <1637796372.905385.1482332031781.JavaMail.zimbra@optopartner.com> Message-ID: <1496314893.943200.1482333181526.JavaMail.zimbra@optopartner.com> Hi again, Yesterday I learn that you have defined LUT in VTK ( thanks for this tutorial : http://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/LUTUtilities) In my simple test app, I give the choice of the lut in a Combobox. I would like to apply these lut next to my mapper, so I proceed like this: ///Previous operations made m_lut->SetNumberOfTableValues(width*height); m_mapper->SetScalarRange(minZ, maxZ); m_lut->Build(); //When i set a new LUT m_colorSeries->SetColorScheme(choiceLutIndex); m_colorSeries->BuildLookupTable(m_lut); m_lut->IndexedLookupOff(); m_mapper->SetLookupTable(m_lut); m_scalarBar->SetLookupTable(m_lut); When I do this operation I will get a new LUT, but compare to my previous LUT with 1280 colors I get a LUT of 6 colors. I don't know if exist a way to interpolate a value and not taking the nearest index? Best regards Romain -------------- next part -------------- An HTML attachment was scrubbed... URL: From romain.cendre at optopartner.com Wed Dec 21 10:13:36 2016 From: romain.cendre at optopartner.com (Romain CENDRE) Date: Wed, 21 Dec 2016 16:13:36 +0100 (CET) Subject: [vtkusers] A little question on pipe In-Reply-To: <1688474455.904174.1482331994289.JavaMail.zimbra@optopartner.com> References: <633866404.1256656.1482253305448.JavaMail.zimbra@optopartner.com> <1688474455.904174.1482331994289.JavaMail.zimbra@optopartner.com> Message-ID: <954542980.944318.1482333216083.JavaMail.zimbra@optopartner.com> Hi, I've juste an small question on pipe data. As you know, I would like to configure my pipe one time and let it manage modifications. I got a problem with vtkImageImport, my input data. At the begin, I can have no data, but vtk don't seem to support data. There is a way to say: "OK I'm empty, that's normal"? Thanks Best regards Romain -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Wed Dec 21 15:19:45 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Wed, 21 Dec 2016 15:19:45 -0500 Subject: [vtkusers] vtk.vtkDistributedDataFilter() not works In-Reply-To: References: <1C21FF27-6B83-4CD1-9577-D72E1B2A0092@mac.com> Message-ID: Magician, I am transitioning this thread over to the ParaView users mailing list as you are using pvpython, and this is actually simpler to do using the paraview.simple module rather than with VTK directly. What you are trying to do is not going to work with pvpython. pvpython is a client that you can use with either the built-in server or by connecting to a remote server, much like the ParaView application. You won't be able to run it in parallel and run parallel VTK code with it. Instead, you will need to invoke pvpython with a script that connects to a running pvserver with 2 processors. Here's something that worked for me for partitioning a point source: * Launch pvserver with two processes (mpirun -np 2 pvserver) * Launch pvpython script.py * The contents of script.py should be: from paraview.simple import * Connect("localhost") pointSource = PointSource() pointSource.NumberOfPoints = 10000 pointSource.Radius = 1.0 glyph = Glyph(Input=pointSource, GlyphType='Arrow') glyph.GlyphType = '2D Glyph' glyph.GlyphType.GlyphType = 'Vertex' glyph.GlyphMode = 'All Points' d3 = D3(Input=glyph) SaveData('tmp.pvtu', proxy=d3) The Glyph filter is needed to add vertex cells at each point. D3 needs these cells to do the partitioning properly. Can you get this script to work? Thanks, Cory On Mon, Dec 19, 2016 at 4:54 PM, Magician wrote: > Hi Cory, > > > Sorry again. (My mailer has some trouble...) > > I tried Sphere Source too, but the results are same. > >> src = vtk.vtkSphereSource() >> src.SetCenter(0.0, 0.0, 0.0) >> src.SetRadius(1.0) >> src.SetThetaResolution(8) >> src.SetPhiResolution(5) >> src.Update() > > If the code runs on native VTK environments, maybe my ParaView?s VTK has some trouble. > > > Magician > > >> On Dec 13, 2016, at 12:03, Cory Quammen wrote: >> >> Hmm, I'm not sure. Could you try setting the input to d3 to the output >> of a vtkSphereSource and see if you get the expected results there? >> You should get half the sphere in one piece and the other half sphere >> in the other piece. >> >> Thanks, >> Cory >> >> On Sat, Dec 10, 2016 at 10:35 AM, Magician wrote: >>> Hi Cory, >>> >>> >>> Sorry for my late reply. >>> I modified my code for splitting the points, but the filter doesn?t work. >>> >>> >>> import vtk >>> >>> src = vtk.vtkPointSource() >>> src.SetCenter((0.0, 0.0, 0.0)) >>> src.SetNumberOfPoints(1000) >>> src.SetRadius(1.0) >>> src.Update() >>> >>> dst = vtk.vtkPolyData() >>> pts = vtk.vtkPoints() >>> pts.SetData(src.GetOutput().GetPoints().GetData()) >>> dst.SetPoints(pts) >>> cells = vtk.vtkCellArray() >>> for i in range(src.GetOutput().GetNumberOfPoints()): >>> ptIds = vtk.vtkIdList() >>> ptIds.InsertNextId(i) >>> cells.InsertNextCell(ptIds) >>> dst.SetVerts(cells) >>> >>> d3 = vtk.vtkDistributedDataFilter() >>> d3.UseMinimalMemoryOff() >>> d3.SetInputData(dst) >>> d3.SetBoundaryMode(0) >>> d3.SetBoundaryModeToSplitBoundaryCells() >>> d3.Update() >>> >>> writer = vtk.vtkXMLPUnstructuredGridWriter() >>> writer.SetInputData(d3.GetOutput()) >>> writer.SetFileName(?test.pvtu?) >>> writer.SetNumberOfPieces(2) >>> writer.WriteSummaryFileOn() >>> writer.SetStartPiece(0) >>> writer.SetEndPiece(1) >>> writer.Write() >>> >>> >>> Magician >>> >>> >>>> On Dec 6, 2016, at 01:33, Cory Quammen wrote: >>>> >>>> I'm not 100% sure of this, but the vtkPointSource produces an output >>>> with only 1 cell. That may not be partitionable by the >>>> vtkDistributeDataFilter. You shouldn't get duplicate output in each >>>> piece, but let's not worry about that for now. >>>> >>>> Try swapping out the vtkPointSource with a vtkSphereSource and see if >>>> the data is partitioned. >>>> >>>> HTH, >>>> Cory >>>> >>>> On Sat, Dec 3, 2016 at 8:57 PM, Magician wrote: >>>>> Hi Cory, >>>>> >>>>> >>>>> Thanks for your advice. >>>>> >>>>> Hmmm...I already run the script with MPI. >>>>> The attached script is a minimal sample. >>>>> >>>>> >>>>> If I execute it, pvtu file is exported. >>>>> But the all piece sources are exactly same, and not partitioned. >>>>> >>>>> >>>>> >>>>> Magician >>>>> >>>>> >>>>>> On Nov 28, 2016, at 06:19, Cory Quammen wrote: >>>>>> >>>>>> I think you need to run your script in parallel with MPI for the >>>>>> partitioning to work. See [1] for an example of how to use this >>>>>> filter. >>>>>> >>>>>> Hope that helps, >>>>>> Cory >>>>>> >>>>>> [1] http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=Filters/Parallel/Testing/Cxx/DistributedData.cxx >>>>>> >>>>>> On Sun, Nov 27, 2016 at 10:39 AM, Magician wrote: >>>>>>> Does anyone use the vtkDistributedDataFilter? >>>>>>> >>>>>>> >>>>>>> On Nov 19, 2016, at 18:16, Magician wrote: >>>>>>> >>>>>>> Hi all, >>>>>>> >>>>>>> >>>>>>> I posted the message about partitioning datasets. >>>>>>> >>>>>>> >>>>>>> I still trying vtk.vtkDistributedDataFilter(), but the exported data aren?t >>>>>>> partitioned. >>>>>>> My VTK version is 7.1.0 (pvpython with ParaView 5.2.0 RC3) and executing on >>>>>>> 2 CPUs. >>>>>>> >>>>>>> Here is the sample code: >>>>>>> >>>>>>> import vtk >>>>>>> >>>>>>> source = vtk.vtkPointSource() >>>>>>> source.SetCenter((0.0, 0.0, 0.0)) >>>>>>> source.SetNumberOfPoints(1000000) >>>>>>> source.SetRadius(1.0) >>>>>>> source.Update() >>>>>>> >>>>>>> d3 = vtk.vtkDistributedDataFilter() >>>>>>> d3.SetInputData(source.GetOutput()) >>>>>>> d3.SetBoundaryMode(0) >>>>>>> d3.Update() >>>>>>> >>>>>>> writer = vtk.vtkXMLPUnstructuredGridWriter() >>>>>>> writer.SetInputData(d3.GetOutput()) >>>>>>> writer.SetFileName(?test.pvtu?) >>>>>>> writer.SetNumberOfPieces(2) >>>>>>> writer.WriteSummaryFileOn() >>>>>>> writer.SetStartPiece(0) >>>>>>> writer.SetEndPiece(1) >>>>>>> writer.Write() >>>>>>> >>>>>>> How to partition data? >>>>>>> >>>>>>> >>>>>>> Magician > -- Cory Quammen Staff R&D Engineer Kitware, Inc. From psakievich at gmail.com Thu Dec 22 00:07:07 2016 From: psakievich at gmail.com (Philip Sakievich) Date: Wed, 21 Dec 2016 21:07:07 -0800 Subject: [vtkusers] PVTS, Multiblock or Both In-Reply-To: References: Message-ID: I'm unclear on how to work with this if I don't specify the local extent. In my code I am subdividing my computational domain so the data is unique on each processor, doing work and then dumping the results. It is completely distributed and the processors don't share any data except on the boundaries. I already know the global and local extents and now I need the local extent in the pvts to line up with the other portions of my code. I don't want the pipeline to give me the local extent unless I can get it to match the extent I've already specified. At this point, it is almost seeming easier to write a script that writes the *pvts for me instead of using the pipeline, but it frustrates me that I can't get the pipeline to do what I want. I'm trying to learn VTK in a broad sense in my spare time. However, for this specific problem the only thing I need is for the PVTS file to have the LocalExtents match my datasets on each of the processors. If I can just solve this all of my problems will be over. I am still wrapping my head around the pipeline concept, but it has been a struggle since there aren't many examples for the problem I'm trying to work with. I'm actually not doing any rendering. I'm just managing IO. I looked at the source you mentioned, but I'm not sure where I am supposed to interact with the RequestInformation request. I'm assuming it will be in the filter that is the input to vtkXMLPStructuredGridWriter, but I haven't really worked with any filters since I've only been doing IO. With the programmable filter example , I can get it to write local extents that differ from the WholeExtent but they do not match my datasets. (In this case I just copied the execute function). Also, I don't really see why it is necessary to specify the WholeExtent in RequestInformation. I can specify the WholeExtent via vtkStructuredGrid.SetDimensions(), or SetExtent and it works fine. It's just that the LocalExtents aren't correct. I think I'm really hitting a roadblock because I don't understand how the parallel writer and the partitioning works with the pipeline. Can you provide some specifics on how the partitioning is supposed to work and/or help me modify the code in my previous example to do what I'm looking for? Either that or specify an open source code that has implemented vtkXMLPStructuredGridWriter that I can review. My application is a CFD solver and it's post processing routines. On Mon, Dec 19, 2016 at 7:18 AM, Andy Bauer wrote: > You need to specify the WholeExtent in the RequestInformation request.You > actually don't specify the local extent, the pipeline will give you that > for a source. I'd recommend looking at the Imaging/Core/vtkRTAnalyticSource.cxx > class in VTK to see how it's done as a source. > > > On Sun, Dec 18, 2016 at 1:16 AM, Philip Sakievich > wrote: > >> Andy and community, >> >> I have read about the concept of whole extent vs extent, but the one >> thing I don't seem to be able to determine is how to set the whole extent >> to be different. I tried using vtkStructuredGrid.Crop() but nothing is >> happening. >> >> In the code snippet below, I have previously declared points local to >> each processor. I now want to populate a structured grid and write a *pvts >> that ties them all together. When I run this code the pvts writes itself >> and the files, but they all have the same whole extent and extent. Nothing >> is cropped to the desired local extent. What am I doing wrong? How do I >> specify a whole extent that is uniform across all processors, and a local >> extent that is specific to each one? >> >> #create grid and filter for processing to writer >> pf=vtk.vtkProgrammableFilter() >> sg=vtk.vtkStructuredGrid() >> >> #set extent global >> sg.SetExtent(0,15,0,32,0,15) >> >> #set extent local >> if rank==0: >> lE=np.array([0,8,0,32,0,8],dtype=int) >> sg.Crop(lE) >> if rank==1: >> lE=np.array([0,8,0,32,7,15],dtype=int) >> sg.Crop(lE) >> if rank==2: >> lE=np.array([7,15,0,32,0,8],dtype=int) >> sg.Crop(lE) >> if rank==3: >> lE=np.array([7,15,0,32,7,15],dtype=int) >> sg.Crop(lE) >> >> sg.SetPoints(pnts) >> pf.SetInputData(sg) >> >> writer=vtk.vtkXMLPStructuredGridWriter() >> writer.SetInputConnection(pf.GetOutputPort()) >> writer.SetController(contr) >> writer.SetDataModeToAscii() >> writer.SetFileName('testgrid.pvts') >> writer.SetNumberOfPieces(nranks) >> writer.SetStartPiece(rank) >> writer.SetEndPiece(rank) >> writer.Write() >> >> Thanks, >> >> Phil >> >> On Tue, Dec 13, 2016 at 7:31 AM, Andy Bauer >> wrote: >> >>> Hi, >>> >>> I would recommend using the pvts format since that is the best format >>> for storing structured grids. If you read it back in it will know how to >>> properly partition the data set for different amounts of processes as well >>> as do things like ghost cells, extract surfaces, etc. >>> >>> For topologically structured grids like vtkStructuredGrid there are two >>> types of extents, "whole extent" describes the beginning and ending node >>> (inclusive) in each direction for the entire grid while "extent" refers to >>> each process's (or pieces if you're serial but doing streaming) partition >>> of the grid. I believe this should be explained in the VTK User's Guide >>> which is now available for free as a pdf download. >>> >>> Cheers, >>> Andy >>> >>> On Tue, Dec 13, 2016 at 10:21 AM, Philip Sakievich >> > wrote: >>> >>>> Greetings, >>>> >>>> I am reasonably new to vtk and I am mainly using it to manage datasets >>>> on structured grids. >>>> >>>> I am trying to write data for a structured grid in parallel python via >>>> MPI. Each process has a separate portion of the grid, and I'm trying to >>>> figure out how to set up the write process. I was following this example: >>>> >>>> http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=IO/ParallelXML/ >>>> Testing/Python/testParallelXMLWriters.py >>>> >>>> But then I realized that in this case each process has the entire grid, >>>> and each processor is just writing a portion of the data it contains. So >>>> do I need to use a multiblock data set? Can someone please provide a >>>> simple example of how to write a structured grid in parallel provided each >>>> process has the local extent correctly specified? >>>> >>>> Thanks >>>> >>>> -- >>>> Phil Sakievich >>>> >>>> PhD Candidate - Mechanical Engineering >>>> Arizona State University - Ira A. Fulton School for Engineering of >>>> Matter Transport and Energy >>>> Tempe, Arizona >>>> >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ at: >>>> 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 >>>> >>>> >>> >> >> >> -- >> Phil Sakievich >> >> PhD Candidate - Mechanical Engineering >> Arizona State University - Ira A. Fulton School for Engineering of Matter >> Transport and Energy >> Tempe, Arizona >> > > -- Phil Sakievich PhD Candidate - Mechanical Engineering Arizona State University - Ira A. Fulton School for Engineering of Matter Transport and Energy Tempe, Arizona -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Thu Dec 22 14:58:02 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Thu, 22 Dec 2016 14:58:02 -0500 Subject: [vtkusers] Point Cloud to Mesh In-Reply-To: <1482308107376-5741621.post@n5.nabble.com> References: <1481705792558-5741531.post@n5.nabble.com> <1482308107376-5741621.post@n5.nabble.com> Message-ID: Is your vtk built Release or Debug? On Wed, Dec 21, 2016 at 3:15 AM, Alex Liu via vtkusers wrote: > Hi. I tried using PoissonReconstruction and got the result but it takes like > 20 minutes with values set to > > poissonReconstruction->SetSamplesPerNode(1.0); > poissonReconstruction->SetDepth(10); > poissonReconstruction->SetKernelDepth(6); > poissonReconstruction->SetSolverDivide(10); > poissonReconstruction->SetIsoDivide(10); > > > > I'm still looking for a way to generate a proper mesh for point cloud. > Please Help. > Thank you. > > > > ----- > Alex Liu > +15574855474 > -- > View this message in context: http://vtk.1045678.n5.nabble.com/Point-Cloud-to-Mesh-tp5741531p5741621.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -- Unpaid intern in BillsBasement at noware dot com From weifeng0715 at gmail.com Thu Dec 22 17:17:57 2016 From: weifeng0715 at gmail.com (weifeng0715) Date: Thu, 22 Dec 2016 15:17:57 -0700 (MST) Subject: [vtkusers] Simple VTK, QT, and QVTKWidget Problem In-Reply-To: <678127.71996.qm@web31910.mail.mud.yahoo.com> References: <226821.48747.qm@web31901.mail.mud.yahoo.com> <678127.71996.qm@web31910.mail.mud.yahoo.com> Message-ID: <1482445077795-5741634.post@n5.nabble.com> Could you send me your code? -- View this message in context: http://vtk.1045678.n5.nabble.com/Simple-VTK-QT-and-QVTKWidget-Problem-tp1241088p5741634.html Sent from the VTK - Users mailing list archive at Nabble.com. From andy.bauer at kitware.com Thu Dec 22 17:35:45 2016 From: andy.bauer at kitware.com (Andy Bauer) Date: Thu, 22 Dec 2016 17:35:45 -0500 Subject: [vtkusers] PVTS, Multiblock or Both In-Reply-To: References: Message-ID: If you want to use VTK as an in situ library instead of reading data in from disk I strongly recommended looking at ParaView Catalyst ( http://www.paraview.org/in-situ/). You can use a vtkTrivialProducer to have the data layout you want but if I understand what you're trying to do you'll probably want to use a VTK composite data set with each process having its own data set. On Thu, Dec 22, 2016 at 12:07 AM, Philip Sakievich wrote: > I'm unclear on how to work with this if I don't specify the local extent. > In my code I am subdividing my computational domain so the data is unique > on each processor, doing work and then dumping the results. It is > completely distributed and the processors don't share any data except on > the boundaries. I already know the global and local extents and now I need > the local extent in the pvts to line up with the other portions of my > code. I don't want the pipeline to give me the local extent unless I can > get it to match the extent I've already specified. > > At this point, it is almost seeming easier to write a script that writes > the *pvts for me instead of using the pipeline, but it frustrates me that I > can't get the pipeline to do what I want. I'm trying to learn VTK in a > broad sense in my spare time. However, for this specific problem the only > thing I need is for the PVTS file to have the LocalExtents match my > datasets on each of the processors. If I can just solve this all of my > problems will be over. I am still wrapping my head around the pipeline > concept, but it has been a struggle since there aren't many examples for > the problem I'm trying to work with. I'm actually not doing any rendering. > I'm just managing IO. > > I looked at the source you mentioned, but I'm not sure where I am supposed > to interact with the RequestInformation request. I'm assuming it will be in > the filter that is the input to vtkXMLPStructuredGridWriter, but I haven't > really worked with any filters since I've only been doing IO. With the > programmable filter example > , > I can get it to write local extents that differ from the WholeExtent but > they do not match my datasets. (In this case I just copied the execute > function). > > Also, I don't really see why it is necessary to specify the WholeExtent in > RequestInformation. I can specify the WholeExtent via vtkStructuredGrid.SetDimensions(), > or SetExtent and it works fine. It's just that the LocalExtents aren't > correct. I think I'm really hitting a roadblock because I don't understand > how the parallel writer and the partitioning works with the pipeline. > > Can you provide some specifics on how the partitioning is supposed to work > and/or help me modify the code in my previous example to do what I'm > looking for? Either that or specify an open source code that has > implemented vtkXMLPStructuredGridWriter that I can review. My > application is a CFD solver and it's post processing routines. > > > > On Mon, Dec 19, 2016 at 7:18 AM, Andy Bauer > wrote: > >> You need to specify the WholeExtent in the RequestInformation request.You >> actually don't specify the local extent, the pipeline will give you that >> for a source. I'd recommend looking at the Imaging/Core/vtkRTAnalyticSource.cxx >> class in VTK to see how it's done as a source. >> >> >> On Sun, Dec 18, 2016 at 1:16 AM, Philip Sakievich >> wrote: >> >>> Andy and community, >>> >>> I have read about the concept of whole extent vs extent, but the one >>> thing I don't seem to be able to determine is how to set the whole extent >>> to be different. I tried using vtkStructuredGrid.Crop() but nothing is >>> happening. >>> >>> In the code snippet below, I have previously declared points local to >>> each processor. I now want to populate a structured grid and write a *pvts >>> that ties them all together. When I run this code the pvts writes itself >>> and the files, but they all have the same whole extent and extent. Nothing >>> is cropped to the desired local extent. What am I doing wrong? How do I >>> specify a whole extent that is uniform across all processors, and a local >>> extent that is specific to each one? >>> >>> #create grid and filter for processing to writer >>> pf=vtk.vtkProgrammableFilter() >>> sg=vtk.vtkStructuredGrid() >>> >>> #set extent global >>> sg.SetExtent(0,15,0,32,0,15) >>> >>> #set extent local >>> if rank==0: >>> lE=np.array([0,8,0,32,0,8],dtype=int) >>> sg.Crop(lE) >>> if rank==1: >>> lE=np.array([0,8,0,32,7,15],dtype=int) >>> sg.Crop(lE) >>> if rank==2: >>> lE=np.array([7,15,0,32,0,8],dtype=int) >>> sg.Crop(lE) >>> if rank==3: >>> lE=np.array([7,15,0,32,7,15],dtype=int) >>> sg.Crop(lE) >>> >>> sg.SetPoints(pnts) >>> pf.SetInputData(sg) >>> >>> writer=vtk.vtkXMLPStructuredGridWriter() >>> writer.SetInputConnection(pf.GetOutputPort()) >>> writer.SetController(contr) >>> writer.SetDataModeToAscii() >>> writer.SetFileName('testgrid.pvts') >>> writer.SetNumberOfPieces(nranks) >>> writer.SetStartPiece(rank) >>> writer.SetEndPiece(rank) >>> writer.Write() >>> >>> Thanks, >>> >>> Phil >>> >>> On Tue, Dec 13, 2016 at 7:31 AM, Andy Bauer >>> wrote: >>> >>>> Hi, >>>> >>>> I would recommend using the pvts format since that is the best format >>>> for storing structured grids. If you read it back in it will know how to >>>> properly partition the data set for different amounts of processes as well >>>> as do things like ghost cells, extract surfaces, etc. >>>> >>>> For topologically structured grids like vtkStructuredGrid there are two >>>> types of extents, "whole extent" describes the beginning and ending node >>>> (inclusive) in each direction for the entire grid while "extent" refers to >>>> each process's (or pieces if you're serial but doing streaming) partition >>>> of the grid. I believe this should be explained in the VTK User's Guide >>>> which is now available for free as a pdf download. >>>> >>>> Cheers, >>>> Andy >>>> >>>> On Tue, Dec 13, 2016 at 10:21 AM, Philip Sakievich < >>>> psakievich at gmail.com> wrote: >>>> >>>>> Greetings, >>>>> >>>>> I am reasonably new to vtk and I am mainly using it to manage datasets >>>>> on structured grids. >>>>> >>>>> I am trying to write data for a structured grid in parallel python via >>>>> MPI. Each process has a separate portion of the grid, and I'm trying to >>>>> figure out how to set up the write process. I was following this example: >>>>> >>>>> http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=IO/ParallelXML/ >>>>> Testing/Python/testParallelXMLWriters.py >>>>> >>>>> But then I realized that in this case each process has the entire >>>>> grid, and each processor is just writing a portion of the data it >>>>> contains. So do I need to use a multiblock data set? Can someone please >>>>> provide a simple example of how to write a structured grid in parallel >>>>> provided each process has the local extent correctly specified? >>>>> >>>>> Thanks >>>>> >>>>> -- >>>>> Phil Sakievich >>>>> >>>>> PhD Candidate - Mechanical Engineering >>>>> Arizona State University - Ira A. Fulton School for Engineering of >>>>> Matter Transport and Energy >>>>> Tempe, Arizona >>>>> >>>>> _______________________________________________ >>>>> Powered by www.kitware.com >>>>> >>>>> Visit other Kitware open-source projects at >>>>> http://www.kitware.com/opensource/opensource.html >>>>> >>>>> Please keep messages on-topic and check the VTK FAQ at: >>>>> 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 >>>>> >>>>> >>>> >>> >>> >>> -- >>> Phil Sakievich >>> >>> PhD Candidate - Mechanical Engineering >>> Arizona State University - Ira A. Fulton School for Engineering of >>> Matter Transport and Energy >>> Tempe, Arizona >>> >> >> > > > -- > Phil Sakievich > > PhD Candidate - Mechanical Engineering > Arizona State University - Ira A. Fulton School for Engineering of Matter > Transport and Energy > Tempe, Arizona > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tehsunnliu at yahoo.com Fri Dec 23 01:44:27 2016 From: tehsunnliu at yahoo.com (Alex Liu) Date: Thu, 22 Dec 2016 23:44:27 -0700 (MST) Subject: [vtkusers] Point Cloud to Mesh In-Reply-To: References: <1481705792558-5741531.post@n5.nabble.com> <1482308107376-5741621.post@n5.nabble.com> Message-ID: <1482475467515-5741636.post@n5.nabble.com> Hello Bill. It was on debug. I tried changing the settings for PoissonReconstruction to vtkSmartPointer pR = vtkSmartPointer::New(); pR->SetInputConnection(polyDataNormals->GetOutputPort()); pR->SetSamplesPerNode(1.0); pR->SetDepth(10); pR->SetKernelDepth(10); pR->SetSolverDivide(10); pR->SetIsoDivide(10); pR->Update(); now I get a very good result and I tried both in debug and release. In Release mode it takes 4 minutes to reconstruct 443466 vertices. ----- Alex Liu +15574855474 -- View this message in context: http://vtk.1045678.n5.nabble.com/Point-Cloud-to-Mesh-tp5741531p5741636.html Sent from the VTK - Users mailing list archive at Nabble.com. From gocarlos at ethz.ch Fri Dec 23 05:02:40 2016 From: gocarlos at ethz.ch (gocarlos) Date: Fri, 23 Dec 2016 03:02:40 -0700 (MST) Subject: [vtkusers] Create a correct mesh from set of triangles and wrong vertices index numbers Message-ID: <1482487360199-5741637.post@n5.nabble.com> Dear VTK Users I have some data sets which have several triangles (set of 3 points with x, y, z) and vertices. (like the OBJ file). The problem is that the vertices are just in increasing order and not ordered. Using PCL I've seen that when I save my PCL mesh (with unordered vertices) into STL, the PCL library converts the PCL mesh in VTK polydata and then a STL file is written to the file system (using VTK). I tried to look in the source code after the method which vtk used to clean the mesh to reorder the vertices, but I haven't found anything. I'm only interested on how VTK orders the vertices in such a way, that they are in the right order and the points of the mesh are not duplicate. Is there a method to clean the mesh/connect the duplicate points/reorder the vertices index? Thanks in advance. -- View this message in context: http://vtk.1045678.n5.nabble.com/Create-a-correct-mesh-from-set-of-triangles-and-wrong-vertices-index-numbers-tp5741637.html Sent from the VTK - Users mailing list archive at Nabble.com. From marcin.krotkiewski at gmail.com Fri Dec 23 06:36:37 2016 From: marcin.krotkiewski at gmail.com (marcin.krotkiewski) Date: Fri, 23 Dec 2016 12:36:37 +0100 Subject: [vtkusers] VTK7.1: Wrong placement of labels in vtkCubeAxesActor Message-ID: Hello everyone, I ran into an issue with the placement of axis tick labels. I've been using OpenGL2 renderer since it's initial release, and I've never had such problems before. As a start, a unit cube axis is displayed correctly (vtk7.1_unit.png). Screenshots using vtk7.0(.png) and vtk7.1(.png) show a surface rendered in the two last versions of VTK. The model is centered around [0,0] in X/Y, but the axis bounds are changed using SetX/Y/ZAxisRange. In vtk7.0 all labels are shown correctly. In 7.1 the Z labels are shown correctly, while X labels are placed very far from the axis, and Y labels are altogether gone. Figure vtk7.1_autobounds.png shows the result with automatic bounds. This time some labels on the Y axis are visible, but also in this case all are drawn in a wrong place. Since my code did not change, this behavior results from a difference between the two VTK versions. Does anyone have any idea why that is? Have I done sth. wrong, or is this a result of the new text/annotation code in vtk7.1? Thanks a lot ! Marcin -------------- next part -------------- A non-text attachment was scrubbed... Name: vtk7.1.png Type: image/png Size: 27683 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: vtk7.0.png Type: image/png Size: 91937 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: vtk7.1_unit.png Type: image/png Size: 24373 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: vtk7.1_autobounds.png Type: image/png Size: 22702 bytes Desc: not available URL: From satwik.k8 at gmail.com Fri Dec 23 06:39:40 2016 From: satwik.k8 at gmail.com (satwik k) Date: Fri, 23 Dec 2016 17:09:40 +0530 Subject: [vtkusers] Image Rotation Message-ID: Dear VtkUsers, I'm working on double oblique MPR view. The output image that i'm getting is rotated. How can i stop the rotation. Negative transformation wont produce exact double oblique output. thanq -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin.krotkiewski at gmail.com Fri Dec 23 06:48:09 2016 From: marcin.krotkiewski at gmail.com (marcin.krotkiewski) Date: Fri, 23 Dec 2016 12:48:09 +0100 Subject: [vtkusers] Linux: problems with make install Message-ID: I have an issue with running make install on linux with Java bindings enabled. The code compiles fine. During the installation process I see the following files and directories inside the target directory: bin include lib natives-Linux-x86_64 pom.xml README.txt share vtk-7.0.jar vtk-7.0-natives-Linux-x86_64.jar However, after the installation is completed, the only files left are natives-Linux-x86_64 pom.xml README.txt vtk-7.1.jar vtk-7.1-natives-Linux-x86_64.jar In particular, the header files (which I happen to be after :) are deleted somewhere on the way. As far as I remember, this was not the case on Windows. The problem is not there if I build without Java bindings. How do I keep all the installed files? Another small issue is that the following two symbolic links are broken in natives-Linux-x86_64: libvtkhdf5.so libvtkhdf5_hl.so Thanks for any help! Marcin From mathieu.westphal at kitware.com Fri Dec 23 07:07:22 2016 From: mathieu.westphal at kitware.com (Mathieu Westphal) Date: Fri, 23 Dec 2016 13:07:22 +0100 Subject: [vtkusers] VTK7.1: Wrong placement of labels in vtkCubeAxesActor In-Reply-To: References: Message-ID: Hi We are aware, and the fix is almost merged. https://gitlab.kitware.com/vtk/vtk/merge_requests/2283 Regards, Mathieu Westphal On Fri, Dec 23, 2016 at 12:36 PM, marcin.krotkiewski < marcin.krotkiewski at gmail.com> wrote: > Hello everyone, > > I ran into an issue with the placement of axis tick labels. I've been > using OpenGL2 renderer since it's initial release, and I've never had such > problems before. > > As a start, a unit cube axis is displayed correctly (vtk7.1_unit.png). > > Screenshots using vtk7.0(.png) and vtk7.1(.png) show a surface rendered in > the two last versions of VTK. The model is centered around [0,0] in X/Y, > but the axis bounds are changed using SetX/Y/ZAxisRange. In vtk7.0 all > labels are shown correctly. In 7.1 the Z labels are shown correctly, while > X labels are placed very far from the axis, and Y labels are altogether > gone. > > Figure vtk7.1_autobounds.png shows the result with automatic bounds. This > time some labels on the Y axis are visible, but also in this case all are > drawn in a wrong place. > > Since my code did not change, this behavior results from a difference > between the two VTK versions. Does anyone have any idea why that is? Have I > done sth. wrong, or is this a result of the new text/annotation code in > vtk7.1? > > Thanks a lot ! > > Marcin > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From seun at rogue-research.com Fri Dec 23 12:49:51 2016 From: seun at rogue-research.com (Seun Odutola) Date: Fri, 23 Dec 2016 12:49:51 -0500 Subject: [vtkusers] vtkBooleanOperationPolyDataFilter for clipping (issue) in VTK 7.1 Message-ID: Hello everyone, I have a reproducible case where I am trying to clip two meshes, when the function vtkBooleanOperationPolyDataFilter::RequestData is executed its call to SortPolyData fails triggering a crash trying to access the first index of polydata?s cell (see vtkBooleanOperationPolyDataFilter::SortPolyData line 62). On tracing the cause of the crash, I noticed that the polydata?s cell data array is null and there seems to be no guard against trying to probe its value, secondly prior to calling SortPolyData, two vtkPolyData?s pd0 & pd1 of which the latter possess no poly and both have their cells and links generated but the latter still lacks poly. I decided to introduce a condition just before building the cells and links for both pd0 and pd1 to check if either have no poly and if so exit the function (return 0), doing so completely prevents my program from crashing. I am not sure if this is the right approach nor if adding the check is necessary. From patriciop at gmail.com Fri Dec 23 20:00:55 2016 From: patriciop at gmail.com (Patricio Palma C.) Date: Sat, 24 Dec 2016 01:00:55 +0000 Subject: [vtkusers] Problems building support for Xdmf2 on VTK 7.1 Message-ID: Dear all I am using VTK 7.1 for saving visualization data using XDMF2 format. Current files produced are big, so I enabled XDMF_USE GZIP option hoping that it activates the compression on the .h5 file. However, during compilation I get error messages due to undefined references (it seems that XDMF2 is not depending on ZLIB). The compiler output is: CMakeFiles/vtkxdmf2.dir/gzstream.cxx.o: In function `gzstreambuf::open(char const*, int)': vtk/VTK-7.1.0/ThirdParty/xdmf2/vtkxdmf2/libsrc/gzstream.cxx:61: undefined reference to `gzopen' CMakeFiles/vtkxdmf2.dir/gzstream.cxx.o: In function `gzstreambuf::close()': vtk/VTK-7.1.0/ThirdParty/xdmf2/vtkxdmf2/libsrc/gzstream.cxx:72: undefined reference to `gzclose' CMakeFiles/vtkxdmf2.dir/gzstream.cxx.o: In function `gzstreambuf::underflow()': vtk/VTK-7.1.0/ThirdParty/xdmf2/vtkxdmf2/libsrc/gzstream.cxx:90: undefined reference to `gzread' CMakeFiles/vtkxdmf2.dir/gzstream.cxx.o: In function `gzstreambuf::flush_buffer()': vtk/VTK-7.1.0/ThirdParty/xdmf2/vtkxdmf2/libsrc/gzstream.cxx:107: undefined reference to `gzwrite' collect2: error: ld returned 1 exit status gmake[2]: *** [lib/libvtkxdmf2-7.1.so.1] Error 1 gmake[1]: *** [ThirdParty/xdmf2/vtkxdmf2/libsrc/CMakeFiles/vtkxdmf2.dir/all] Error 2 How can I solve that issue? What do I have to do so vtkXdmfWriter creates a compressed .h5 file ? Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From luis.vieira at vektore.com Tue Dec 27 17:48:31 2016 From: luis.vieira at vektore.com (Luis Vieira) Date: Tue, 27 Dec 2016 17:48:31 -0500 Subject: [vtkusers] QVTKWidget Camera vs vtkOrientationMarkerWidget Message-ID: <1f1b501d26093$595be7a0$0c13b6e0$@vektore.com> Hello vtkusers, Anybody knows how to use vtkOrientationMarkerWidget with QVTKWidget interactor? I have been trying to implement the VTK example (http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/DisplayCoordinateAxe s) and it worked smoothly. However, within my QVTKWidget Camera, and I caught the following exception: ERROR: In C:\VTK\VTK-7.0.0\GUISupport\Qt\QVTKInteractor.cxx, line 147 QVTKInteractor (000000F46583D670): QVTKInteractor cannot control the event loop. Following my vtkOrientationMarkerWidget snapshot: vtkRenderWindow* renwin = vtkRenderWindow::New(); myQVTKWidgetCAmera->SetRenderWindow(renwin); Ren1 = vtkRenderer::New(); myQVTKWidgetCAmera->GetRenderWindow()->AddRenderer(Ren1); vtkAxesActor* myAxActor = vtkAxesActor::New(); vtkSmartPointer myWidget = vtkSmartPointer::New(); myWidget ->SetOrientationMarker(myAxActor); myWidget ->SetInteractor(myQVTKWidgetCAmera->GetRenderWindow()->GetInteractor()); myWidget ->SetViewport(0.7, 0.0, 1.00, 0.3); myWidget ->SetEnabled(1); myWidget ->InteractiveOn(); Ren1->ResetCamera(); Ren1->Render(); myQVTKWidgetCAmera->GetRenderWindow()->GetInteractor()->Start(); Thank you very much for any help, Luis Vieira, Consultant, Software Engineer Vektore Exploration Consulting Corporation ca.linkedin.com/in/joaoluisvieira luis.vieira at vektore.com www.vektore.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From sankhesh.jhaveri at kitware.com Wed Dec 28 08:15:53 2016 From: sankhesh.jhaveri at kitware.com (Sankhesh Jhaveri) Date: Wed, 28 Dec 2016 13:15:53 +0000 Subject: [vtkusers] QVTKWidget Camera vs vtkOrientationMarkerWidget In-Reply-To: <1f1b501d26093$595be7a0$0c13b6e0$@vektore.com> References: <1f1b501d26093$595be7a0$0c13b6e0$@vektore.com> Message-ID: Hi Luis, Try setting the interactor from the widget: myWidget ->SetInteractor(myQVTKWidgetCAmera->GetInteractor()); On Tue, Dec 27, 2016, 5:56 PM Luis Vieira wrote: > Hello vtkusers, > > > > Anybody knows how to use vtkOrientationMarkerWidget with QVTKWidget > interactor? I have been trying to implement the VTK example ( > http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/DisplayCoordinateAxes) > and it worked smoothly. However, within my QVTKWidget Camera, and I caught > the following exception: > > > > ERROR: In C:\VTK\VTK-7.0.0\GUISupport\Qt\QVTKInteractor.cxx, line 147 > > QVTKInteractor (000000F46583D670): QVTKInteractor cannot control the event > loop. > > > > Following my vtkOrientationMarkerWidget snapshot: > > vtkRenderWindow* renwin = vtkRenderWindow::New(); > > myQVTKWidgetCAmera->SetRenderWindow(renwin); > > Ren1 = vtkRenderer::New(); > > myQVTKWidgetCAmera->GetRenderWindow()->AddRenderer(Ren1); > > > > vtkAxesActor* myAxActor = vtkAxesActor::New(); > > vtkSmartPointer myWidget = vtkSmartPointer< > vtkOrientationMarkerWidget>::New(); > > myWidget ->SetOrientationMarker(myAxActor); > > myWidget ->SetInteractor(myQVTKWidgetCAmera->GetRenderWindow > ()->GetInteractor()); > > myWidget ->SetViewport(0.7, 0.0, 1.00, 0.3); > > myWidget ->SetEnabled(1); > > myWidget ->InteractiveOn(); > > > > Ren1->ResetCamera(); > > Ren1->Render(); > > > > myQVTKWidgetCAmera->GetRenderWindow()->GetInteractor()->Start(); > > > > Thank you very much for any help, > > > > > > *Luis Vieira*, > > Consultant, Software Engineer > > Vektore Exploration Consulting Corporation > > ca.linkedin.com/in/joaoluisvieira > > luis.vieira at vektore.com > > www.vektore.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 > -- Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware | (518) 881-4417 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From inglis.dl at gmail.com Wed Dec 28 08:35:27 2016 From: inglis.dl at gmail.com (Dean Inglis) Date: Wed, 28 Dec 2016 08:35:27 -0500 Subject: [vtkusers] QVTKWidget Camera vs vtkOrientationMarkerWidget In-Reply-To: <1f1b501d26093$595be7a0$0c13b6e0$@vektore.com> References: <1f1b501d26093$595be7a0$0c13b6e0$@vektore.com> Message-ID: Hi Luis, do not call Start() on the interactor within your Qt programs as Qt manages its own event loop. Dean On Tue, Dec 27, 2016 at 5:48 PM, Luis Vieira wrote: > Hello vtkusers, > > > > Anybody knows how to use vtkOrientationMarkerWidget with QVTKWidget > interactor? I have been trying to implement the VTK example ( > http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/ > DisplayCoordinateAxes) and it worked smoothly. However, within my > QVTKWidget Camera, and I caught the following exception: > > > > ERROR: In C:\VTK\VTK-7.0.0\GUISupport\Qt\QVTKInteractor.cxx, line 147 > > QVTKInteractor (000000F46583D670): QVTKInteractor cannot control the event > loop. > > > > Following my vtkOrientationMarkerWidget snapshot: > > vtkRenderWindow* renwin = vtkRenderWindow::New(); > > myQVTKWidgetCAmera->SetRenderWindow(renwin); > > Ren1 = vtkRenderer::New(); > > myQVTKWidgetCAmera->GetRenderWindow()->AddRenderer(Ren1); > > > > vtkAxesActor* myAxActor = vtkAxesActor::New(); > > vtkSmartPointer myWidget = vtkSmartPointer< > vtkOrientationMarkerWidget>::New(); > > myWidget ->SetOrientationMarker(myAxActor); > > myWidget ->SetInteractor(myQVTKWidgetCAmera->GetRenderWindow > ()->GetInteractor()); > > myWidget ->SetViewport(0.7, 0.0, 1.00, 0.3); > > myWidget ->SetEnabled(1); > > myWidget ->InteractiveOn(); > > > > Ren1->ResetCamera(); > > Ren1->Render(); > > > > myQVTKWidgetCAmera->GetRenderWindow()->GetInteractor()->Start(); > > > > Thank you very much for any help, > > > > > > *Luis Vieira*, > > Consultant, Software Engineer > > Vektore Exploration Consulting Corporation > > ca.linkedin.com/in/joaoluisvieira > > luis.vieira at vektore.com > > www.vektore.com > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luis.vieira at vektore.com Wed Dec 28 10:32:23 2016 From: luis.vieira at vektore.com (Luis Vieira) Date: Wed, 28 Dec 2016 10:32:23 -0500 Subject: [vtkusers] QVTKWidget Camera vs vtkOrientationMarkerWidget In-Reply-To: References: <1f1b501d26093$595be7a0$0c13b6e0$@vektore.com> Message-ID: <2635801d2611f$9670eff0$c352cfd0$@vektore.com> Tks Dean, But still same, didn?t work: Following Exceptions and snapshot ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLRenderer.cxx, line 126 vtkOpenGLRenderer (0000004A68B268A0): failed ater ClearLights 16 OpenGL errors detected 0 : (1282) Invalid operation 1 : (1282) Invalid operation 2 : (1282) Invalid operation 3 : (1282) Invalid operation 4 : (1282) Invalid operation 5 : (1282) Invalid operation 6 : (1282) Invalid operation 7 : (1282) Invalid operation 8 : (1282) Invalid operation 9 : (1282) Invalid operation 10 : (1282) Invalid operation 11 : (1282) Invalid operation 12 : (1282) Invalid operation 13 : (1282) Invalid operation 14 : (1282) Invalid operation 15 : (1282) Invalid operation ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLRenderer.cxx, line 1202 vtkOpenGLRenderer (0000004A68B268A0): failed after Clear 16 OpenGL errors detected 0 : (1282) Invalid operation 1 : (1282) Invalid operation 2 : (1282) Invalid operation 3 : (1282) Invalid operation 4 : (1282) Invalid operation 5 : (1282) Invalid operation 6 : (1282) Invalid operation 7 : (1282) Invalid operation 8 : (1282) Invalid operation 9 : (1282) Invalid operation 10 : (1282) Invalid operation 11 : (1282) Invalid operation 12 : (1282) Invalid operation 13 : (1282) Invalid operation 14 : (1282) Invalid operation 15 : (1282) Invalid operation ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLCamera.cxx, line 176 vtkOpenGLCamera (0000004A67EA1870): failed after Render 16 OpenGL errors detected 0 : (1282) Invalid operation 1 : (1282) Invalid operation 2 : (1282) Invalid operation 3 : (1282) Invalid operation 4 : (1282) Invalid operation 5 : (1282) Invalid operation 6 : (1282) Invalid operation 7 : (1282) Invalid operation 8 : (1282) Invalid operation 9 : (1282) Invalid operation 10 : (1282) Invalid operation 11 : (1282) Invalid operation 12 : (1282) Invalid operation 13 : (1282) Invalid operation 14 : (1282) Invalid operation 15 : (1282) Invalid operation ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLLight.cxx, line 118 vtkOpenGLLight (0000004A68A31190): failed after Render 16 OpenGL errors detected 0 : (1282) Invalid operation 1 : (1282) Invalid operation 2 : (1282) Invalid operation 3 : (1282) Invalid operation 4 : (1282) Invalid operation 5 : (1282) Invalid operation 6 : (1282) Invalid operation 7 : (1282) Invalid operation 8 : (1282) Invalid operation 9 : (1282) Invalid operation 10 : (1282) Invalid operation 11 : (1282) Invalid operation 12 : (1282) Invalid operation 13 : (1282) Invalid operation 14 : (1282) Invalid operation 15 : (1282) Invalid operation ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLRenderer.cxx, line 192 vtkOpenGLRenderer (0000004A68B268A0): failed after UpdateLights 16 OpenGL errors detected 0 : (1282) Invalid operation 1 : (1282) Invalid operation 2 : (1282) Invalid operation 3 : (1282) Invalid operation 4 : (1282) Invalid operation 5 : (1282) Invalid operation 6 : (1282) Invalid operation 7 : (1282) Invalid operation 8 : (1282) Invalid operation 9 : (1282) Invalid operation 10 : (1282) Invalid operation 11 : (1282) Invalid operation 12 : (1282) Invalid operation 13 : (1282) Invalid operation 14 : (1282) Invalid operation 15 : (1282) Invalid operation ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLRenderer.cxx, line 282 vtkOpenGLRenderer (0000004A68B268A0): failed after DeviceRender 16 OpenGL errors detected 0 : (1282) Invalid operation 1 : (1282) Invalid operation 2 : (1282) Invalid operation 3 : (1282) Invalid operation 4 : (1282) Invalid operation 5 : (1282) Invalid operation 6 : (1282) Invalid operation 7 : (1282) Invalid operation 8 : (1282) Invalid operation 9 : (1282) Invalid operation 10 : (1282) Invalid operation 11 : (1282) Invalid operation 12 : (1282) Invalid operation 13 : (1282) Invalid operation 14 : (1282) Invalid operation 15 : (1282) Invalid operation // create a window to make it stereo capable and give it to QVTKWidget // create a window to make it stereo capable and give it to QVTKWidget vtkRenderWindow* renwin = vtkRenderWindow::New(); renwin->StereoCapableWindowOn(); // Activate 3DConnexion device only on the left render window. mainViewPort->SetUseTDx(true); mainViewPort->SetRenderWindow(renwin); //renwin->Delete(); const double angleSensitivity = 0.02; const double translationSensitivity = 0.001; QVTKInteractor *iren = mainViewPort->GetInteractor(); vtkInteractorStyle *s = static_cast(iren->GetInteractorStyle()); vtkTDxInteractorStyleCamera *t = static_cast(s->GetTDxStyle()); t->GetSettings()->SetAngleSensitivity(angleSensitivity); t->GetSettings()->SetTranslationXSensitivity(translationSensitivity); t->GetSettings()->SetTranslationYSensitivity(translationSensitivity); t->GetSettings()->SetTranslationZSensitivity(translationSensitivity); // add a renderer Ren1 = vtkRenderer::New(); mainViewPort->GetRenderWindow()->AddRenderer(Ren1); vtkAxesActor* viewPortAxActor = vtkAxesActor::New(); // The axes are positioned with a user transform //viewPortAxActor->SetUserTransform(transform); viewPortAxActor->GetXAxisCaptionActor2D()->GetCaptionTextProperty()->SetColor(1, 1, 1); viewPortAxActor->SetXAxisLabelText("E"); viewPortAxActor->GetXAxisCaptionActor2D()->SetWidth(0.05); viewPortAxActor->GetXAxisCaptionActor2D()->SetHeight(0.05); viewPortAxActor->GetYAxisCaptionActor2D()->GetCaptionTextProperty()->SetColor(1, 1, 1); viewPortAxActor->SetYAxisLabelText("N"); viewPortAxActor->GetYAxisCaptionActor2D()->SetWidth(0.05); viewPortAxActor->GetYAxisCaptionActor2D()->SetHeight(0.05); viewPortAxActor->GetZAxisCaptionActor2D()->GetCaptionTextProperty()->SetColor(1, 1, 1); viewPortAxActor->SetZAxisLabelText("Up"); viewPortAxActor->GetZAxisCaptionActor2D()->SetWidth(0.05); viewPortAxActor->GetZAxisCaptionActor2D()->SetHeight(0.05); vtkSmartPointer viewPortOMWidget = vtkSmartPointer::New(); viewPortOMWidget->SetOrientationMarker(viewPortAxActor); viewPortOMWidget->SetInteractor(mainViewPort->GetInteractor()); viewPortOMWidget->SetViewport(0.7, 0.0, 1.00, 0.3); viewPortOMWidget->SetEnabled(1); viewPortOMWidget->InteractiveOn(); Ren1->ResetCamera(); Ren1->Render(); //mainViewPort->GetRenderWindow()->GetInteractor()->Start(); Luis Vieira, Consultant, Software Engineer Vektore Exploration Consulting Corporation ca.linkedin.com/in/joaoluisvieira luis.vieira at vektore.com www.vektore.com From: Dean Inglis [mailto:inglis.dl at gmail.com] Sent: December 28, 2016 8:35 AM To: Luis Vieira Cc: VTK Users Subject: Re: [vtkusers] QVTKWidget Camera vs vtkOrientationMarkerWidget Hi Luis, do not call Start() on the interactor within your Qt programs as Qt manages its own event loop. Dean On Tue, Dec 27, 2016 at 5:48 PM, Luis Vieira > wrote: Hello vtkusers, Anybody knows how to use vtkOrientationMarkerWidget with QVTKWidget interactor? I have been trying to implement the VTK example (http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/DisplayCoordinateAxes) and it worked smoothly. However, within my QVTKWidget Camera, and I caught the following exception: ERROR: In C:\VTK\VTK-7.0.0\GUISupport\Qt\QVTKInteractor.cxx, line 147 QVTKInteractor (000000F46583D670): QVTKInteractor cannot control the event loop. Following my vtkOrientationMarkerWidget snapshot: vtkRenderWindow* renwin = vtkRenderWindow::New(); myQVTKWidgetCAmera->SetRenderWindow(renwin); Ren1 = vtkRenderer::New(); myQVTKWidgetCAmera->GetRenderWindow()->AddRenderer(Ren1); vtkAxesActor* myAxActor = vtkAxesActor::New(); vtkSmartPointer myWidget = vtkSmartPointer::New(); myWidget ->SetOrientationMarker(myAxActor); myWidget ->SetInteractor(myQVTKWidgetCAmera->GetRenderWindow()->GetInteractor()); myWidget ->SetViewport(0.7, 0.0, 1.00, 0.3); myWidget ->SetEnabled(1); myWidget ->InteractiveOn(); Ren1->ResetCamera(); Ren1->Render(); myQVTKWidgetCAmera->GetRenderWindow()->GetInteractor()->Start(); Thank you very much for any help, Luis Vieira, Consultant, Software Engineer Vektore Exploration Consulting Corporation ca.linkedin.com/in/joaoluisvieira luis.vieira at vektore.com www.vektore.com _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From luis.vieira at vektore.com Wed Dec 28 10:27:51 2016 From: luis.vieira at vektore.com (Luis Vieira) Date: Wed, 28 Dec 2016 10:27:51 -0500 Subject: [vtkusers] QVTKWidget Camera vs vtkOrientationMarkerWidget In-Reply-To: References: <1f1b501d26093$595be7a0$0c13b6e0$@vektore.com> Message-ID: <252db01d2611e$f44966d0$dcdc3470$@vektore.com> Tks Sankhesh, But didn?t work: Following Exceptions and snapshot ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLRenderer.cxx, line 126 vtkOpenGLRenderer (0000004A68B268A0): failed ater ClearLights 16 OpenGL errors detected 0 : (1282) Invalid operation 1 : (1282) Invalid operation 2 : (1282) Invalid operation 3 : (1282) Invalid operation 4 : (1282) Invalid operation 5 : (1282) Invalid operation 6 : (1282) Invalid operation 7 : (1282) Invalid operation 8 : (1282) Invalid operation 9 : (1282) Invalid operation 10 : (1282) Invalid operation 11 : (1282) Invalid operation 12 : (1282) Invalid operation 13 : (1282) Invalid operation 14 : (1282) Invalid operation 15 : (1282) Invalid operation ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLRenderer.cxx, line 1202 vtkOpenGLRenderer (0000004A68B268A0): failed after Clear 16 OpenGL errors detected 0 : (1282) Invalid operation 1 : (1282) Invalid operation 2 : (1282) Invalid operation 3 : (1282) Invalid operation 4 : (1282) Invalid operation 5 : (1282) Invalid operation 6 : (1282) Invalid operation 7 : (1282) Invalid operation 8 : (1282) Invalid operation 9 : (1282) Invalid operation 10 : (1282) Invalid operation 11 : (1282) Invalid operation 12 : (1282) Invalid operation 13 : (1282) Invalid operation 14 : (1282) Invalid operation 15 : (1282) Invalid operation ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLCamera.cxx, line 176 vtkOpenGLCamera (0000004A67EA1870): failed after Render 16 OpenGL errors detected 0 : (1282) Invalid operation 1 : (1282) Invalid operation 2 : (1282) Invalid operation 3 : (1282) Invalid operation 4 : (1282) Invalid operation 5 : (1282) Invalid operation 6 : (1282) Invalid operation 7 : (1282) Invalid operation 8 : (1282) Invalid operation 9 : (1282) Invalid operation 10 : (1282) Invalid operation 11 : (1282) Invalid operation 12 : (1282) Invalid operation 13 : (1282) Invalid operation 14 : (1282) Invalid operation 15 : (1282) Invalid operation ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLLight.cxx, line 118 vtkOpenGLLight (0000004A68A31190): failed after Render 16 OpenGL errors detected 0 : (1282) Invalid operation 1 : (1282) Invalid operation 2 : (1282) Invalid operation 3 : (1282) Invalid operation 4 : (1282) Invalid operation 5 : (1282) Invalid operation 6 : (1282) Invalid operation 7 : (1282) Invalid operation 8 : (1282) Invalid operation 9 : (1282) Invalid operation 10 : (1282) Invalid operation 11 : (1282) Invalid operation 12 : (1282) Invalid operation 13 : (1282) Invalid operation 14 : (1282) Invalid operation 15 : (1282) Invalid operation ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLRenderer.cxx, line 192 vtkOpenGLRenderer (0000004A68B268A0): failed after UpdateLights 16 OpenGL errors detected 0 : (1282) Invalid operation 1 : (1282) Invalid operation 2 : (1282) Invalid operation 3 : (1282) Invalid operation 4 : (1282) Invalid operation 5 : (1282) Invalid operation 6 : (1282) Invalid operation 7 : (1282) Invalid operation 8 : (1282) Invalid operation 9 : (1282) Invalid operation 10 : (1282) Invalid operation 11 : (1282) Invalid operation 12 : (1282) Invalid operation 13 : (1282) Invalid operation 14 : (1282) Invalid operation 15 : (1282) Invalid operation ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLRenderer.cxx, line 282 vtkOpenGLRenderer (0000004A68B268A0): failed after DeviceRender 16 OpenGL errors detected 0 : (1282) Invalid operation 1 : (1282) Invalid operation 2 : (1282) Invalid operation 3 : (1282) Invalid operation 4 : (1282) Invalid operation 5 : (1282) Invalid operation 6 : (1282) Invalid operation 7 : (1282) Invalid operation 8 : (1282) Invalid operation 9 : (1282) Invalid operation 10 : (1282) Invalid operation 11 : (1282) Invalid operation 12 : (1282) Invalid operation 13 : (1282) Invalid operation 14 : (1282) Invalid operation 15 : (1282) Invalid operation // create a window to make it stereo capable and give it to QVTKWidget // create a window to make it stereo capable and give it to QVTKWidget vtkRenderWindow* renwin = vtkRenderWindow::New(); renwin->StereoCapableWindowOn(); // Activate 3DConnexion device only on the left render window. mainViewPort->SetUseTDx(true); mainViewPort->SetRenderWindow(renwin); //renwin->Delete(); const double angleSensitivity = 0.02; const double translationSensitivity = 0.001; QVTKInteractor *iren = mainViewPort->GetInteractor(); vtkInteractorStyle *s = static_cast(iren->GetInteractorStyle()); vtkTDxInteractorStyleCamera *t = static_cast(s->GetTDxStyle()); t->GetSettings()->SetAngleSensitivity(angleSensitivity); t->GetSettings()->SetTranslationXSensitivity(translationSensitivity); t->GetSettings()->SetTranslationYSensitivity(translationSensitivity); t->GetSettings()->SetTranslationZSensitivity(translationSensitivity); // add a renderer Ren1 = vtkRenderer::New(); mainViewPort->GetRenderWindow()->AddRenderer(Ren1); vtkAxesActor* viewPortAxActor = vtkAxesActor::New(); // The axes are positioned with a user transform //viewPortAxActor->SetUserTransform(transform); viewPortAxActor->GetXAxisCaptionActor2D()->GetCaptionTextProperty()->SetColor(1, 1, 1); viewPortAxActor->SetXAxisLabelText("E"); viewPortAxActor->GetXAxisCaptionActor2D()->SetWidth(0.05); viewPortAxActor->GetXAxisCaptionActor2D()->SetHeight(0.05); viewPortAxActor->GetYAxisCaptionActor2D()->GetCaptionTextProperty()->SetColor(1, 1, 1); viewPortAxActor->SetYAxisLabelText("N"); viewPortAxActor->GetYAxisCaptionActor2D()->SetWidth(0.05); viewPortAxActor->GetYAxisCaptionActor2D()->SetHeight(0.05); viewPortAxActor->GetZAxisCaptionActor2D()->GetCaptionTextProperty()->SetColor(1, 1, 1); viewPortAxActor->SetZAxisLabelText("Up"); viewPortAxActor->GetZAxisCaptionActor2D()->SetWidth(0.05); viewPortAxActor->GetZAxisCaptionActor2D()->SetHeight(0.05); vtkSmartPointer viewPortOMWidget = vtkSmartPointer::New(); viewPortOMWidget->SetOrientationMarker(viewPortAxActor); viewPortOMWidget->SetInteractor(mainViewPort->GetInteractor()); viewPortOMWidget->SetViewport(0.7, 0.0, 1.00, 0.3); viewPortOMWidget->SetEnabled(1); viewPortOMWidget->InteractiveOn(); Ren1->ResetCamera(); Ren1->Render(); //mainViewPort->GetRenderWindow()->GetInteractor()->Start(); Luis Vieira, Consultant, Software Engineer Vektore Exploration Consulting Corporation ca.linkedin.com/in/joaoluisvieira luis.vieira at vektore.com www.vektore.com From: Sankhesh Jhaveri [mailto:sankhesh.jhaveri at kitware.com] Sent: December 28, 2016 8:16 AM To: Luis Vieira ; VTK Users Subject: Re: [vtkusers] QVTKWidget Camera vs vtkOrientationMarkerWidget Hi Luis, Try setting the interactor from the widget: myWidget ->SetInteractor(myQVTKWidgetCAmera->GetInteractor()); On Tue, Dec 27, 2016, 5:56 PM Luis Vieira > wrote: Hello vtkusers, Anybody knows how to use vtkOrientationMarkerWidget with QVTKWidget interactor? I have been trying to implement the VTK example (http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/DisplayCoordinateAxes) and it worked smoothly. However, within my QVTKWidget Camera, and I caught the following exception: ERROR: In C:\VTK\VTK-7.0.0\GUISupport\Qt\QVTKInteractor.cxx, line 147 QVTKInteractor (000000F46583D670): QVTKInteractor cannot control the event loop. Following my vtkOrientationMarkerWidget snapshot: vtkRenderWindow* renwin = vtkRenderWindow::New(); myQVTKWidgetCAmera->SetRenderWindow(renwin); Ren1 = vtkRenderer::New(); myQVTKWidgetCAmera->GetRenderWindow()->AddRenderer(Ren1); vtkAxesActor* myAxActor = vtkAxesActor::New(); vtkSmartPointer myWidget = vtkSmartPointer::New(); myWidget ->SetOrientationMarker(myAxActor); myWidget ->SetInteractor(myQVTKWidgetCAmera->GetRenderWindow()->GetInteractor()); myWidget ->SetViewport(0.7, 0.0, 1.00, 0.3); myWidget ->SetEnabled(1); myWidget ->InteractiveOn(); Ren1->ResetCamera(); Ren1->Render(); myQVTKWidgetCAmera->GetRenderWindow()->GetInteractor()->Start(); Thank you very much for any help, Luis Vieira, Consultant, Software Engineer Vektore Exploration Consulting Corporation ca.linkedin.com/in/joaoluisvieira luis.vieira at vektore.com www.vektore.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 -- Sankhesh Jhaveri Sr. Research & Development Engineer | Kitware | (518) 881-4417 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From luis.vieira at vektore.com Wed Dec 28 10:29:41 2016 From: luis.vieira at vektore.com (Luis Vieira) Date: Wed, 28 Dec 2016 10:29:41 -0500 Subject: [vtkusers] QVTKWidget Camera vs vtkOrientationMarkerWidget In-Reply-To: References: <1f1b501d26093$595be7a0$0c13b6e0$@vektore.com> Message-ID: <25af701d2611f$35d297c0$a177c740$@vektore.com> Now I did other test, just taking of the of the code Ren1.ResetCamera() and Ren1.Render() and the exception is the following: First-chance exception at 0x00007FFF82201433 (vtkRenderingCore-7.0.dll) in vKoreStructuralVectoringD.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF. Unhandled exception at 0x00007FFF82201433 (vtkRenderingCore-7.0.dll) in vKoreStructuralVectoringD.exe: 0xC000041D: An unhandled exception was encountered during a user callback. viewPortAxActor->GetXAxisCaptionActor2D()->GetCaptionTextProperty()->SetColor(1, 1, 1); viewPortAxActor->SetXAxisLabelText("E"); viewPortAxActor->GetXAxisCaptionActor2D()->SetWidth(0.05); viewPortAxActor->GetXAxisCaptionActor2D()->SetHeight(0.05); viewPortAxActor->GetYAxisCaptionActor2D()->GetCaptionTextProperty()->SetColor(1, 1, 1); viewPortAxActor->SetYAxisLabelText("N"); viewPortAxActor->GetYAxisCaptionActor2D()->SetWidth(0.05); viewPortAxActor->GetYAxisCaptionActor2D()->SetHeight(0.05); viewPortAxActor->GetZAxisCaptionActor2D()->GetCaptionTextProperty()->SetColor(1, 1, 1); viewPortAxActor->SetZAxisLabelText("Up"); viewPortAxActor->GetZAxisCaptionActor2D()->SetWidth(0.05); viewPortAxActor->GetZAxisCaptionActor2D()->SetHeight(0.05); vtkSmartPointer viewPortOMWidget = vtkSmartPointer::New(); viewPortOMWidget->SetOrientationMarker(viewPortAxActor); viewPortOMWidget->SetInteractor(mainViewPort->GetInteractor()); viewPortOMWidget->SetViewport(0.7, 0.0, 1.00, 0.3); viewPortOMWidget->SetEnabled(1); viewPortOMWidget->InteractiveOn(); //Ren1->ResetCamera(); //Ren1->Render(); //mainViewPort->GetRenderWindow()->GetInteractor()->Start(); Luis Vieira, Consultant, Software Engineer Vektore Exploration Consulting Corporation ca.linkedin.com/in/joaoluisvieira luis.vieira at vektore.com www.vektore.com From: Sankhesh Jhaveri [mailto:sankhesh.jhaveri at kitware.com] Sent: December 28, 2016 8:16 AM To: Luis Vieira ; VTK Users Subject: Re: [vtkusers] QVTKWidget Camera vs vtkOrientationMarkerWidget Hi Luis, Try setting the interactor from the widget: myWidget ->SetInteractor(myQVTKWidgetCAmera->GetInteractor()); On Tue, Dec 27, 2016, 5:56 PM Luis Vieira > wrote: Hello vtkusers, Anybody knows how to use vtkOrientationMarkerWidget with QVTKWidget interactor? I have been trying to implement the VTK example (http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/DisplayCoordinateAxes) and it worked smoothly. However, within my QVTKWidget Camera, and I caught the following exception: ERROR: In C:\VTK\VTK-7.0.0\GUISupport\Qt\QVTKInteractor.cxx, line 147 QVTKInteractor (000000F46583D670): QVTKInteractor cannot control the event loop. Following my vtkOrientationMarkerWidget snapshot: vtkRenderWindow* renwin = vtkRenderWindow::New(); myQVTKWidgetCAmera->SetRenderWindow(renwin); Ren1 = vtkRenderer::New(); myQVTKWidgetCAmera->GetRenderWindow()->AddRenderer(Ren1); vtkAxesActor* myAxActor = vtkAxesActor::New(); vtkSmartPointer myWidget = vtkSmartPointer::New(); myWidget ->SetOrientationMarker(myAxActor); myWidget ->SetInteractor(myQVTKWidgetCAmera->GetRenderWindow()->GetInteractor()); myWidget ->SetViewport(0.7, 0.0, 1.00, 0.3); myWidget ->SetEnabled(1); myWidget ->InteractiveOn(); Ren1->ResetCamera(); Ren1->Render(); myQVTKWidgetCAmera->GetRenderWindow()->GetInteractor()->Start(); Thank you very much for any help, Luis Vieira, Consultant, Software Engineer Vektore Exploration Consulting Corporation ca.linkedin.com/in/ joaoluisvieira luis.vieira at vektore.com www.vektore.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 -- Sankhesh Jhaveri Sr. Research & Development Engineer | Kitware | (518) 881-4417 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From sankhesh.jhaveri at kitware.com Wed Dec 28 10:57:50 2016 From: sankhesh.jhaveri at kitware.com (Sankhesh Jhaveri) Date: Wed, 28 Dec 2016 15:57:50 +0000 Subject: [vtkusers] QVTKWidget Camera vs vtkOrientationMarkerWidget In-Reply-To: <2635801d2611f$9670eff0$c352cfd0$@vektore.com> References: <1f1b501d26093$595be7a0$0c13b6e0$@vektore.com> <2635801d2611f$9670eff0$c352cfd0$@vektore.com> Message-ID: Luis, It seems like you were able to get past the error about interactor not being able to control the event loop using Dean?s suggestion. I am not sure why you?re getting OpenGL errors but one thing I noticed is that you are using the OpenGL backend. Would you be able to try the OpenGL2 backend? Moreover, which version of Qt are you testing against? ? On Wed, Dec 28, 2016 at 10:35 AM Luis Vieira wrote: > Tks Dean, > > > > But still same, didn?t work: Following Exceptions and snapshot > > > > ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLRenderer.cxx, line 126 > > vtkOpenGLRenderer (0000004A68B268A0): failed ater ClearLights 16 OpenGL > errors detected > > 0 : (1282) Invalid operation > > 1 : (1282) Invalid operation > > 2 : (1282) Invalid operation > > 3 : (1282) Invalid operation > > 4 : (1282) Invalid operation > > 5 : (1282) Invalid operation > > 6 : (1282) Invalid operation > > 7 : (1282) Invalid operation > > 8 : (1282) Invalid operation > > 9 : (1282) Invalid operation > > 10 : (1282) Invalid operation > > 11 : (1282) Invalid operation > > 12 : (1282) Invalid operation > > 13 : (1282) Invalid operation > > 14 : (1282) Invalid operation > > 15 : (1282) Invalid operation > > > > > > ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLRenderer.cxx, line > 1202 > > vtkOpenGLRenderer (0000004A68B268A0): failed after Clear 16 OpenGL errors > detected > > 0 : (1282) Invalid operation > > 1 : (1282) Invalid operation > > 2 : (1282) Invalid operation > > 3 : (1282) Invalid operation > > 4 : (1282) Invalid operation > > 5 : (1282) Invalid operation > > 6 : (1282) Invalid operation > > 7 : (1282) Invalid operation > > 8 : (1282) Invalid operation > > 9 : (1282) Invalid operation > > 10 : (1282) Invalid operation > > 11 : (1282) Invalid operation > > 12 : (1282) Invalid operation > > 13 : (1282) Invalid operation > > 14 : (1282) Invalid operation > > 15 : (1282) Invalid operation > > > > > > ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLCamera.cxx, line 176 > > vtkOpenGLCamera (0000004A67EA1870): failed after Render 16 OpenGL errors > detected > > 0 : (1282) Invalid operation > > 1 : (1282) Invalid operation > > 2 : (1282) Invalid operation > > 3 : (1282) Invalid operation > > 4 : (1282) Invalid operation > > 5 : (1282) Invalid operation > > 6 : (1282) Invalid operation > > 7 : (1282) Invalid operation > > 8 : (1282) Invalid operation > > 9 : (1282) Invalid operation > > 10 : (1282) Invalid operation > > 11 : (1282) Invalid operation > > 12 : (1282) Invalid operation > > 13 : (1282) Invalid operation > > 14 : (1282) Invalid operation > > 15 : (1282) Invalid operation > > > > > > ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLLight.cxx, line 118 > > vtkOpenGLLight (0000004A68A31190): failed after Render 16 OpenGL errors > detected > > 0 : (1282) Invalid operation > > 1 : (1282) Invalid operation > > 2 : (1282) Invalid operation > > 3 : (1282) Invalid operation > > 4 : (1282) Invalid operation > > 5 : (1282) Invalid operation > > 6 : (1282) Invalid operation > > 7 : (1282) Invalid operation > > 8 : (1282) Invalid operation > > 9 : (1282) Invalid operation > > 10 : (1282) Invalid operation > > 11 : (1282) Invalid operation > > 12 : (1282) Invalid operation > > 13 : (1282) Invalid operation > > 14 : (1282) Invalid operation > > 15 : (1282) Invalid operation > > > > > > ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLRenderer.cxx, line 192 > > vtkOpenGLRenderer (0000004A68B268A0): failed after UpdateLights 16 OpenGL > errors detected > > 0 : (1282) Invalid operation > > 1 : (1282) Invalid operation > > 2 : (1282) Invalid operation > > 3 : (1282) Invalid operation > > 4 : (1282) Invalid operation > > 5 : (1282) Invalid operation > > 6 : (1282) Invalid operation > > 7 : (1282) Invalid operation > > 8 : (1282) Invalid operation > > 9 : (1282) Invalid operation > > 10 : (1282) Invalid operation > > 11 : (1282) Invalid operation > > 12 : (1282) Invalid operation > > 13 : (1282) Invalid operation > > 14 : (1282) Invalid operation > > 15 : (1282) Invalid operation > > > > > > ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLRenderer.cxx, line 282 > > vtkOpenGLRenderer (0000004A68B268A0): failed after DeviceRender 16 OpenGL > errors detected > > 0 : (1282) Invalid operation > > 1 : (1282) Invalid operation > > 2 : (1282) Invalid operation > > 3 : (1282) Invalid operation > > 4 : (1282) Invalid operation > > 5 : (1282) Invalid operation > > 6 : (1282) Invalid operation > > 7 : (1282) Invalid operation > > 8 : (1282) Invalid operation > > 9 : (1282) Invalid operation > > 10 : (1282) Invalid operation > > 11 : (1282) Invalid operation > > 12 : (1282) Invalid operation > > 13 : (1282) Invalid operation > > 14 : (1282) Invalid operation > > 15 : (1282) Invalid operation > > > > > > // create a window to make it stereo capable and give it to QVTKWidget > > // create a window to make it stereo capable and give it to > QVTKWidget > > vtkRenderWindow* renwin = vtkRenderWindow::New(); > > renwin->StereoCapableWindowOn(); > > > > // Activate 3DConnexion device only on the left render > window. > > > > mainViewPort->SetUseTDx(true); > > > > mainViewPort->SetRenderWindow(renwin); > > //renwin->Delete(); > > > > const double angleSensitivity = 0.02; > > const double translationSensitivity = 0.001; > > > > QVTKInteractor *iren = mainViewPort->GetInteractor(); > > vtkInteractorStyle *s = > > static_cast(iren-> > GetInteractorStyle()); > > vtkTDxInteractorStyleCamera *t = > > static_cast(s-> > GetTDxStyle()); > > > > t->GetSettings()->SetAngleSensitivity(angleSensitivity); > > t->GetSettings()->SetTranslationXSensitivity( > translationSensitivity); > > t->GetSettings()->SetTranslationYSensitivity( > translationSensitivity); > > t->GetSettings()->SetTranslationZSensitivity( > translationSensitivity); > > > > // add a renderer > > Ren1 = vtkRenderer::New(); > > mainViewPort->GetRenderWindow()->AddRenderer(Ren1); > > > > > > > > vtkAxesActor* viewPortAxActor = vtkAxesActor::New(); > > // The axes are positioned with a user transform > > //viewPortAxActor->SetUserTransform(transform); > > > > viewPortAxActor->GetXAxisCaptionActor2D()-> > GetCaptionTextProperty()->SetColor(1, 1, 1); > > viewPortAxActor->SetXAxisLabelText("E"); > > viewPortAxActor->GetXAxisCaptionActor2D()->SetWidth(0.05); > > viewPortAxActor->GetXAxisCaptionActor2D()->SetHeight(0.05); > > viewPortAxActor->GetYAxisCaptionActor2D()-> > GetCaptionTextProperty()->SetColor(1, 1, 1); > > viewPortAxActor->SetYAxisLabelText("N"); > > viewPortAxActor->GetYAxisCaptionActor2D()->SetWidth(0.05); > > viewPortAxActor->GetYAxisCaptionActor2D()->SetHeight(0.05); > > viewPortAxActor->GetZAxisCaptionActor2D()-> > GetCaptionTextProperty()->SetColor(1, 1, 1); > > viewPortAxActor->SetZAxisLabelText("Up"); > > viewPortAxActor->GetZAxisCaptionActor2D()->SetWidth(0.05); > > viewPortAxActor->GetZAxisCaptionActor2D()->SetHeight(0.05); > > > > vtkSmartPointer viewPortOMWidget > = vtkSmartPointer::New(); > > viewPortOMWidget->SetOrientationMarker(viewPortAxActor); > > viewPortOMWidget->SetInteractor(mainViewPort->GetInteractor > ()); > > viewPortOMWidget->SetViewport(0.7, 0.0, 1.00, 0.3); > > viewPortOMWidget->SetEnabled(1); > > viewPortOMWidget->InteractiveOn(); > > > > Ren1->ResetCamera(); > > Ren1->Render(); > > > > //mainViewPort->GetRenderWindow()->GetInteractor()->Start(); > > > > > > *Luis Vieira*, > > Consultant, Software Engineer > > Vektore Exploration Consulting Corporation > > ca.linkedin.com/in/joaoluisvieira > > luis.vieira at vektore.com > > www.vektore.com > > > > *From:* Dean Inglis [mailto:inglis.dl at gmail.com] > *Sent:* December 28, 2016 8:35 AM > *To:* Luis Vieira > *Cc:* VTK Users > > > *Subject:* Re: [vtkusers] QVTKWidget Camera vs vtkOrientationMarkerWidget > > > > Hi Luis, > > > > do not call Start() on the interactor within your Qt programs as Qt > > manages its own event loop. > > Dean > > > > On Tue, Dec 27, 2016 at 5:48 PM, Luis Vieira > wrote: > > Hello vtkusers, > > > > Anybody knows how to use vtkOrientationMarkerWidget with QVTKWidget > interactor? I have been trying to implement the VTK example ( > http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/DisplayCoordinateAxes) > and it worked smoothly. However, within my QVTKWidget Camera, and I caught > the following exception: > > > > ERROR: In C:\VTK\VTK-7.0.0\GUISupport\Qt\QVTKInteractor.cxx, line 147 > > QVTKInteractor (000000F46583D670): QVTKInteractor cannot control the event > loop. > > > > Following my vtkOrientationMarkerWidget snapshot: > > vtkRenderWindow* renwin = vtkRenderWindow::New(); > > myQVTKWidgetCAmera->SetRenderWindow(renwin); > > Ren1 = vtkRenderer::New(); > > myQVTKWidgetCAmera->GetRenderWindow()->AddRenderer(Ren1); > > > > vtkAxesActor* myAxActor = vtkAxesActor::New(); > > vtkSmartPointer myWidget = vtkSmartPointer< > vtkOrientationMarkerWidget>::New(); > > myWidget ->SetOrientationMarker(myAxActor); > > myWidget ->SetInteractor(myQVTKWidgetCAmera->GetRenderWindow > ()->GetInteractor()); > > myWidget ->SetViewport(0.7, 0.0, 1.00, 0.3); > > myWidget ->SetEnabled(1); > > myWidget ->InteractiveOn(); > > > > Ren1->ResetCamera(); > > Ren1->Render(); > > > > myQVTKWidgetCAmera->GetRenderWindow()->GetInteractor()->Start(); > > > > Thank you very much for any help, > > > > > > *Luis Vieira*, > > Consultant, Software Engineer > > Vektore Exploration Consulting Corporation > > ca.linkedin.com/in/joaoluisvieira > > luis.vieira at vektore.com > > www.vektore.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 > -- Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware | (518) 881-4417 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bakkari.abdelkhalek at hotmail.fr Wed Dec 28 10:59:44 2016 From: bakkari.abdelkhalek at hotmail.fr (Abdelkhalek Bakkari) Date: Wed, 28 Dec 2016 15:59:44 +0000 Subject: [vtkusers] VTK Widget Contour example applied to a binary image In-Reply-To: References: Message-ID: Hi !, I'm working on vtkContourWidget example with a .mha 2D binary image and I have one question : How can I apply that example (attached file ) to my contour-1.mha image (attached file) ? Thank you in advance. Kind regards, Abdelkhalek Bakkari -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ContourWidget.cxx URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: contour-1.mha Type: application/octet-stream Size: 262317 bytes Desc: contour-1.mha URL: From mdomenighini at gmail.com Wed Dec 28 11:30:41 2016 From: mdomenighini at gmail.com (mdomenighini at gmail.com) Date: Wed, 28 Dec 2016 17:30:41 +0100 Subject: [vtkusers] Color Velocity StreamTracer Message-ID: <5863e8b1.212dc20a.22a2c.0352@mx.google.com> Hello, I have just started using vtk with python and I am encountering some problems. I?ve been trying to color the streamlines from vtkStreamTracer using the velocity data without much success. I am acquiring the velocity data from a .vti file and generating the streamlines. I was using SpeedScalarsOn() earlier, but there doesn?t seem to be an analogous function for vtkStreamTracer. I tried using vtkAssignAttribute without much success. My code (from the streamTracer onwards) is below. output = reader.GetOutput() # Get vectors velocity_field = output.GetPointData().GetArray(0) output.GetPointData().SetVectors(velocity_field); #streamtracer streamtracer = vtk.vtkStreamTracer() streamtracer.SetInput(output) streamtracer.SetSource(seeds.GetOutput()) streamtracer.SetMaximumPropagation(200) streamtracer.SetIntegrationDirectionToForward() streamtracer.SetComputeVorticity(True) ##streamTube from streamlines streamTube = vtk.vtkTubeFilter() streamTube.SetInputConnection(streamtracer.GetOutputPort()) streamTube.SetInputArrayToProcess(1, 0, 0, vtk.vtkDataObject.FIELD_ASSOCIATION_POINTS, "vectors") streamTube.SetRadius(0.2) streamTube.SetNumberOfSides(12) streamTube.SetVaryRadiusToVaryRadiusByVector() streamTube.Update() ##streamtube mapper mapStreamTube = vtk.vtkPolyDataMapper() mapStreamTube.SetInputConnection(streamTube.GetOutputPort()) ##black and White lookup table lut = vtk.vtkLookupTable() lut.SetHueRange(0.0, 0.0); lut.SetSaturationRange(0.0, 0.0); lut.SetValueRange(0.0, 1.0); lut.SetVectorModeToMagnitude() mapStreamTube.SetLookupTable(lut) ##streamtube actor streamTubeActor = vtk.vtkActor() streamTubeActor.SetMapper(mapStreamTube) streamTubeActor.GetProperty().BackfaceCullingOn() ##rendering renderer = vtk.vtkRenderer() renderer.AddActor(streamTubeActor) renderer.ResetCamera() renderer.SetBackground(0.5,.5,.5); renderWindow = vtk.vtkRenderWindow() renderWindow.AddRenderer(renderer) renderWindowInteractor = vtk.vtkRenderWindowInteractor() renderWindowInteractor.SetRenderWindow(renderWindow) renderWindowInteractor.Initialize() renderWindowInteractor.Start() Can anyone help? Thank you, Matteo -------------- next part -------------- An HTML attachment was scrubbed... URL: From luis.vieira at vektore.com Wed Dec 28 11:48:02 2016 From: luis.vieira at vektore.com (Luis Vieira) Date: Wed, 28 Dec 2016 11:48:02 -0500 Subject: [vtkusers] QVTKWidget Camera vs vtkOrientationMarkerWidget In-Reply-To: References: <1f1b501d26093$595be7a0$0c13b6e0$@vektore.com> <2635801d2611f$9670eff0$c352cfd0$@vektore.com> Message-ID: <2842e01d2612a$27af8260$770e8720$@vektore.com> Sankhesh, I believe that the problem doesn?t regard OpenGL backend ,because I succeeded trying this example (http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/DisplayCoordinateAxes). Actually, I don?t have problems with anything else using VTK 7.0 as well as was backed my OpenGL. I have been setting up the Modules within my application, as following, and worked very well. Also, I am used to with QVTKWidget. #include VTK_MODULE_INIT(vtkRenderingOpenGL); VTK_MODULE_INIT(vtkInteractionStyle); I don?t have problems using for example the following examples. Works smoothly. vtkSmartPointer sliderRep = vtkSmartPointer::New(); sliderRep->SetMinimumValue(0.1); sliderRep->SetMaximumValue(100.0); sliderRep->SetValue(10.0); sliderRep->SetTitleText("Size"); sliderRep->GetPoint1Coordinate()->SetCoordinateSystemToDisplay(); sliderRep->GetPoint1Coordinate()->SetValue(100, 100); sliderRep->GetPoint2Coordinate()->SetCoordinateSystemToDisplay(); sliderRep->GetPoint2Coordinate()->SetValue(300, 100); vtkSliderWidget *sliderWidget = vtkSliderWidget::New(); sliderWidget->SetInteractor(myQVTKWidgetCamera->GetInteractor()); sliderWidget->SetRepresentation(sliderRep); sliderWidget->SetAnimationModeToAnimate(); sliderWidget->EnabledOn(); /*****************************************************************************/ vtkTransform* transform = vtkTransform::New(); transform->Translate(1.0, 0.0, 0.0); vtkAxesActor* viewPortAxActor = vtkAxesActor::New(); // The axes are positioned with a user transform viewPortAxActor->SetUserTransform(transform); Ren1->AddViewProp(viewPortAxActor); Ren1->ResetCamera(); Luis Vieira, Consultant, Software Engineer Vektore Exploration Consulting Corporation ca.linkedin.com/in/joaoluisvieira luis.vieira at vektore.com www.vektore.com From: Sankhesh Jhaveri [mailto:sankhesh.jhaveri at kitware.com] Sent: December 28, 2016 10:58 AM To: Luis Vieira ; Dean Inglis Cc: VTK Users Subject: Re: [vtkusers] QVTKWidget Camera vs vtkOrientationMarkerWidget Luis, It seems like you were able to get past the error about interactor not being able to control the event loop using Dean?s suggestion. I am not sure why you?re getting OpenGL errors but one thing I noticed is that you are using the OpenGL backend. Would you be able to try the OpenGL2 backend? Moreover, which version of Qt are you testing against? ? On Wed, Dec 28, 2016 at 10:35 AM Luis Vieira > wrote: Tks Dean, But still same, didn?t work: Following Exceptions and snapshot ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLRenderer.cxx, line 126 vtkOpenGLRenderer (0000004A68B268A0): failed ater ClearLights 16 OpenGL errors detected 0 : (1282) Invalid operation 1 : (1282) Invalid operation 2 : (1282) Invalid operation 3 : (1282) Invalid operation 4 : (1282) Invalid operation 5 : (1282) Invalid operation 6 : (1282) Invalid operation 7 : (1282) Invalid operation 8 : (1282) Invalid operation 9 : (1282) Invalid operation 10 : (1282) Invalid operation 11 : (1282) Invalid operation 12 : (1282) Invalid operation 13 : (1282) Invalid operation 14 : (1282) Invalid operation 15 : (1282) Invalid operation ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLRenderer.cxx, line 1202 vtkOpenGLRenderer (0000004A68B268A0): failed after Clear 16 OpenGL errors detected 0 : (1282) Invalid operation 1 : (1282) Invalid operation 2 : (1282) Invalid operation 3 : (1282) Invalid operation 4 : (1282) Invalid operation 5 : (1282) Invalid operation 6 : (1282) Invalid operation 7 : (1282) Invalid operation 8 : (1282) Invalid operation 9 : (1282) Invalid operation 10 : (1282) Invalid operation 11 : (1282) Invalid operation 12 : (1282) Invalid operation 13 : (1282) Invalid operation 14 : (1282) Invalid operation 15 : (1282) Invalid operation ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLCamera.cxx, line 176 vtkOpenGLCamera (0000004A67EA1870): failed after Render 16 OpenGL errors detected 0 : (1282) Invalid operation 1 : (1282) Invalid operation 2 : (1282) Invalid operation 3 : (1282) Invalid operation 4 : (1282) Invalid operation 5 : (1282) Invalid operation 6 : (1282) Invalid operation 7 : (1282) Invalid operation 8 : (1282) Invalid operation 9 : (1282) Invalid operation 10 : (1282) Invalid operation 11 : (1282) Invalid operation 12 : (1282) Invalid operation 13 : (1282) Invalid operation 14 : (1282) Invalid operation 15 : (1282) Invalid operation ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLLight.cxx, line 118 vtkOpenGLLight (0000004A68A31190): failed after Render 16 OpenGL errors detected 0 : (1282) Invalid operation 1 : (1282) Invalid operation 2 : (1282) Invalid operation 3 : (1282) Invalid operation 4 : (1282) Invalid operation 5 : (1282) Invalid operation 6 : (1282) Invalid operation 7 : (1282) Invalid operation 8 : (1282) Invalid operation 9 : (1282) Invalid operation 10 : (1282) Invalid operation 11 : (1282) Invalid operation 12 : (1282) Invalid operation 13 : (1282) Invalid operation 14 : (1282) Invalid operation 15 : (1282) Invalid operation ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLRenderer.cxx, line 192 vtkOpenGLRenderer (0000004A68B268A0): failed after UpdateLights 16 OpenGL errors detected 0 : (1282) Invalid operation 1 : (1282) Invalid operation 2 : (1282) Invalid operation 3 : (1282) Invalid operation 4 : (1282) Invalid operation 5 : (1282) Invalid operation 6 : (1282) Invalid operation 7 : (1282) Invalid operation 8 : (1282) Invalid operation 9 : (1282) Invalid operation 10 : (1282) Invalid operation 11 : (1282) Invalid operation 12 : (1282) Invalid operation 13 : (1282) Invalid operation 14 : (1282) Invalid operation 15 : (1282) Invalid operation ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLRenderer.cxx, line 282 vtkOpenGLRenderer (0000004A68B268A0): failed after DeviceRender 16 OpenGL errors detected 0 : (1282) Invalid operation 1 : (1282) Invalid operation 2 : (1282) Invalid operation 3 : (1282) Invalid operation 4 : (1282) Invalid operation 5 : (1282) Invalid operation 6 : (1282) Invalid operation 7 : (1282) Invalid operation 8 : (1282) Invalid operation 9 : (1282) Invalid operation 10 : (1282) Invalid operation 11 : (1282) Invalid operation 12 : (1282) Invalid operation 13 : (1282) Invalid operation 14 : (1282) Invalid operation 15 : (1282) Invalid operation // create a window to make it stereo capable and give it to QVTKWidget // create a window to make it stereo capable and give it to QVTKWidget vtkRenderWindow* renwin = vtkRenderWindow::New(); renwin->StereoCapableWindowOn(); // Activate 3DConnexion device only on the left render window. mainViewPort->SetUseTDx(true); mainViewPort->SetRenderWindow(renwin); //renwin->Delete(); const double angleSensitivity = 0.02; const double translationSensitivity = 0.001; QVTKInteractor *iren = mainViewPort->GetInteractor(); vtkInteractorStyle *s = static_cast(iren->GetInteractorStyle()); vtkTDxInteractorStyleCamera *t = static_cast(s->GetTDxStyle()); t->GetSettings()->SetAngleSensitivity(angleSensitivity); t->GetSettings()->SetTranslationXSensitivity(translationSensitivity); t->GetSettings()->SetTranslationYSensitivity(translationSensitivity); t->GetSettings()->SetTranslationZSensitivity(translationSensitivity); // add a renderer Ren1 = vtkRenderer::New(); mainViewPort->GetRenderWindow()->AddRenderer(Ren1); vtkAxesActor* viewPortAxActor = vtkAxesActor::New(); // The axes are positioned with a user transform //viewPortAxActor->SetUserTransform(transform); viewPortAxActor->GetXAxisCaptionActor2D()->GetCaptionTextProperty()->SetColor(1, 1, 1); viewPortAxActor->SetXAxisLabelText("E"); viewPortAxActor->GetXAxisCaptionActor2D()->SetWidth(0.05); viewPortAxActor->GetXAxisCaptionActor2D()->SetHeight(0.05); viewPortAxActor->GetYAxisCaptionActor2D()->GetCaptionTextProperty()->SetColor(1, 1, 1); viewPortAxActor->SetYAxisLabelText("N"); viewPortAxActor->GetYAxisCaptionActor2D()->SetWidth(0.05); viewPortAxActor->GetYAxisCaptionActor2D()->SetHeight(0.05); viewPortAxActor->GetZAxisCaptionActor2D()->GetCaptionTextProperty()->SetColor(1, 1, 1); viewPortAxActor->SetZAxisLabelText("Up"); viewPortAxActor->GetZAxisCaptionActor2D()->SetWidth(0.05); viewPortAxActor->GetZAxisCaptionActor2D()->SetHeight(0.05); vtkSmartPointer viewPortOMWidget = vtkSmartPointer::New(); viewPortOMWidget->SetOrientationMarker(viewPortAxActor); viewPortOMWidget->SetInteractor(mainViewPort->GetInteractor()); viewPortOMWidget->SetViewport(0.7, 0.0, 1.00, 0.3); viewPortOMWidget->SetEnabled(1); viewPortOMWidget->InteractiveOn(); Ren1->ResetCamera(); Ren1->Render(); //mainViewPort->GetRenderWindow()->GetInteractor()->Start(); Luis Vieira, Consultant, Software Engineer Vektore Exploration Consulting Corporation ca.linkedin.com/in/ joaoluisvieira luis.vieira at vektore.com www.vektore.com From: Dean Inglis [mailto:inglis.dl at gmail.com ] Sent: December 28, 2016 8:35 AM To: Luis Vieira > Cc: VTK Users > Subject: Re: [vtkusers] QVTKWidget Camera vs vtkOrientationMarkerWidget Hi Luis, do not call Start() on the interactor within your Qt programs as Qt manages its own event loop. Dean On Tue, Dec 27, 2016 at 5:48 PM, Luis Vieira > wrote: Hello vtkusers, Anybody knows how to use vtkOrientationMarkerWidget with QVTKWidget interactor? I have been trying to implement the VTK example (http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/DisplayCoordinateAxes) and it worked smoothly. However, within my QVTKWidget Camera, and I caught the following exception: ERROR: In C:\VTK\VTK-7.0.0\GUISupport\Qt\QVTKInteractor.cxx, line 147 QVTKInteractor (000000F46583D670): QVTKInteractor cannot control the event loop. Following my vtkOrientationMarkerWidget snapshot: vtkRenderWindow* renwin = vtkRenderWindow::New(); myQVTKWidgetCAmera->SetRenderWindow(renwin); Ren1 = vtkRenderer::New(); myQVTKWidgetCAmera->GetRenderWindow()->AddRenderer(Ren1); vtkAxesActor* myAxActor = vtkAxesActor::New(); vtkSmartPointer myWidget = vtkSmartPointer::New(); myWidget ->SetOrientationMarker(myAxActor); myWidget ->SetInteractor(myQVTKWidgetCAmera->GetRenderWindow()->GetInteractor()); myWidget ->SetViewport(0.7, 0.0, 1.00, 0.3); myWidget ->SetEnabled(1); myWidget ->InteractiveOn(); Ren1->ResetCamera(); Ren1->Render(); myQVTKWidgetCAmera->GetRenderWindow()->GetInteractor()->Start(); Thank you very much for any help, Luis Vieira, Consultant, Software Engineer Vektore Exploration Consulting Corporation ca.linkedin.com/in/joaoluisvieira luis.vieira at vektore.com www.vektore.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 -- Sankhesh Jhaveri Sr. Research & Development Engineer | Kitware | (518) 881-4417 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From luis.vieira at vektore.com Wed Dec 28 11:58:12 2016 From: luis.vieira at vektore.com (Luis Vieira) Date: Wed, 28 Dec 2016 11:58:12 -0500 Subject: [vtkusers] QVTKWidget Camera vs vtkOrientationMarkerWidget In-Reply-To: References: <1f1b501d26093$595be7a0$0c13b6e0$@vektore.com> <2635801d2611f$9670eff0$c352cfd0$@vektore.com> Message-ID: <28c6201d2612b$93980ff0$bac82fd0$@vektore.com> Tks Sankhesh, Dean Just got the problem. I was initializing the with vtkSmartPointer and my AxesActor as vtkAxesActor* . Now, both are as following: Worked smoothly vtkAxesActor* viewPortAxActor = vtkAxesActor::New(); viewPortAxActor->GetXAxisCaptionActor2D()->GetCaptionTextProperty()->SetColor(1, 1, 1); viewPortAxActor->SetXAxisLabelText("E"); viewPortAxActor->GetXAxisCaptionActor2D()->SetWidth(0.05); viewPortAxActor->GetXAxisCaptionActor2D()->SetHeight(0.05); viewPortAxActor->GetYAxisCaptionActor2D()->GetCaptionTextProperty()->SetColor(1, 1, 1); viewPortAxActor->SetYAxisLabelText("N"); viewPortAxActor->GetYAxisCaptionActor2D()->SetWidth(0.05); viewPortAxActor->GetYAxisCaptionActor2D()->SetHeight(0.05); viewPortAxActor->GetZAxisCaptionActor2D()->GetCaptionTextProperty()->SetColor(1, 1, 1); viewPortAxActor->SetZAxisLabelText("Up"); viewPortAxActor->GetZAxisCaptionActor2D()->SetWidth(0.05); viewPortAxActor->GetZAxisCaptionActor2D()->SetHeight(0.05); vtkOrientationMarkerWidget* viewPortOMWidget = vtkOrientationMarkerWidget::New(); viewPortOMWidget->SetOrientationMarker(viewPortAxActor); viewPortOMWidget->SetInteractor(mainViewPort->GetInteractor()); viewPortOMWidget->SetViewport(0.7, 0.0, 1.00, 0.3); viewPortOMWidget->SetEnabled(1); viewPortOMWidget->InteractiveOn(); Luis Vieira, Consultant, Software Engineer Vektore Exploration Consulting Corporation ca.linkedin.com/in/joaoluisvieira luis.vieira at vektore.com www.vektore.com From: Sankhesh Jhaveri [mailto:sankhesh.jhaveri at kitware.com] Sent: December 28, 2016 10:58 AM To: Luis Vieira ; Dean Inglis Cc: VTK Users Subject: Re: [vtkusers] QVTKWidget Camera vs vtkOrientationMarkerWidget Luis, It seems like you were able to get past the error about interactor not being able to control the event loop using Dean?s suggestion. I am not sure why you?re getting OpenGL errors but one thing I noticed is that you are using the OpenGL backend. Would you be able to try the OpenGL2 backend? Moreover, which version of Qt are you testing against? ? On Wed, Dec 28, 2016 at 10:35 AM Luis Vieira > wrote: Tks Dean, But still same, didn?t work: Following Exceptions and snapshot ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLRenderer.cxx, line 126 vtkOpenGLRenderer (0000004A68B268A0): failed ater ClearLights 16 OpenGL errors detected 0 : (1282) Invalid operation 1 : (1282) Invalid operation 2 : (1282) Invalid operation 3 : (1282) Invalid operation 4 : (1282) Invalid operation 5 : (1282) Invalid operation 6 : (1282) Invalid operation 7 : (1282) Invalid operation 8 : (1282) Invalid operation 9 : (1282) Invalid operation 10 : (1282) Invalid operation 11 : (1282) Invalid operation 12 : (1282) Invalid operation 13 : (1282) Invalid operation 14 : (1282) Invalid operation 15 : (1282) Invalid operation ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLRenderer.cxx, line 1202 vtkOpenGLRenderer (0000004A68B268A0): failed after Clear 16 OpenGL errors detected 0 : (1282) Invalid operation 1 : (1282) Invalid operation 2 : (1282) Invalid operation 3 : (1282) Invalid operation 4 : (1282) Invalid operation 5 : (1282) Invalid operation 6 : (1282) Invalid operation 7 : (1282) Invalid operation 8 : (1282) Invalid operation 9 : (1282) Invalid operation 10 : (1282) Invalid operation 11 : (1282) Invalid operation 12 : (1282) Invalid operation 13 : (1282) Invalid operation 14 : (1282) Invalid operation 15 : (1282) Invalid operation ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLCamera.cxx, line 176 vtkOpenGLCamera (0000004A67EA1870): failed after Render 16 OpenGL errors detected 0 : (1282) Invalid operation 1 : (1282) Invalid operation 2 : (1282) Invalid operation 3 : (1282) Invalid operation 4 : (1282) Invalid operation 5 : (1282) Invalid operation 6 : (1282) Invalid operation 7 : (1282) Invalid operation 8 : (1282) Invalid operation 9 : (1282) Invalid operation 10 : (1282) Invalid operation 11 : (1282) Invalid operation 12 : (1282) Invalid operation 13 : (1282) Invalid operation 14 : (1282) Invalid operation 15 : (1282) Invalid operation ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLLight.cxx, line 118 vtkOpenGLLight (0000004A68A31190): failed after Render 16 OpenGL errors detected 0 : (1282) Invalid operation 1 : (1282) Invalid operation 2 : (1282) Invalid operation 3 : (1282) Invalid operation 4 : (1282) Invalid operation 5 : (1282) Invalid operation 6 : (1282) Invalid operation 7 : (1282) Invalid operation 8 : (1282) Invalid operation 9 : (1282) Invalid operation 10 : (1282) Invalid operation 11 : (1282) Invalid operation 12 : (1282) Invalid operation 13 : (1282) Invalid operation 14 : (1282) Invalid operation 15 : (1282) Invalid operation ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLRenderer.cxx, line 192 vtkOpenGLRenderer (0000004A68B268A0): failed after UpdateLights 16 OpenGL errors detected 0 : (1282) Invalid operation 1 : (1282) Invalid operation 2 : (1282) Invalid operation 3 : (1282) Invalid operation 4 : (1282) Invalid operation 5 : (1282) Invalid operation 6 : (1282) Invalid operation 7 : (1282) Invalid operation 8 : (1282) Invalid operation 9 : (1282) Invalid operation 10 : (1282) Invalid operation 11 : (1282) Invalid operation 12 : (1282) Invalid operation 13 : (1282) Invalid operation 14 : (1282) Invalid operation 15 : (1282) Invalid operation ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLRenderer.cxx, line 282 vtkOpenGLRenderer (0000004A68B268A0): failed after DeviceRender 16 OpenGL errors detected 0 : (1282) Invalid operation 1 : (1282) Invalid operation 2 : (1282) Invalid operation 3 : (1282) Invalid operation 4 : (1282) Invalid operation 5 : (1282) Invalid operation 6 : (1282) Invalid operation 7 : (1282) Invalid operation 8 : (1282) Invalid operation 9 : (1282) Invalid operation 10 : (1282) Invalid operation 11 : (1282) Invalid operation 12 : (1282) Invalid operation 13 : (1282) Invalid operation 14 : (1282) Invalid operation 15 : (1282) Invalid operation // create a window to make it stereo capable and give it to QVTKWidget // create a window to make it stereo capable and give it to QVTKWidget vtkRenderWindow* renwin = vtkRenderWindow::New(); renwin->StereoCapableWindowOn(); // Activate 3DConnexion device only on the left render window. mainViewPort->SetUseTDx(true); mainViewPort->SetRenderWindow(renwin); //renwin->Delete(); const double angleSensitivity = 0.02; const double translationSensitivity = 0.001; QVTKInteractor *iren = mainViewPort->GetInteractor(); vtkInteractorStyle *s = static_cast(iren->GetInteractorStyle()); vtkTDxInteractorStyleCamera *t = static_cast(s->GetTDxStyle()); t->GetSettings()->SetAngleSensitivity(angleSensitivity); t->GetSettings()->SetTranslationXSensitivity(translationSensitivity); t->GetSettings()->SetTranslationYSensitivity(translationSensitivity); t->GetSettings()->SetTranslationZSensitivity(translationSensitivity); // add a renderer Ren1 = vtkRenderer::New(); mainViewPort->GetRenderWindow()->AddRenderer(Ren1); vtkAxesActor* viewPortAxActor = vtkAxesActor::New(); // The axes are positioned with a user transform //viewPortAxActor->SetUserTransform(transform); viewPortAxActor->GetXAxisCaptionActor2D()->GetCaptionTextProperty()->SetColor(1, 1, 1); viewPortAxActor->SetXAxisLabelText("E"); viewPortAxActor->GetXAxisCaptionActor2D()->SetWidth(0.05); viewPortAxActor->GetXAxisCaptionActor2D()->SetHeight(0.05); viewPortAxActor->GetYAxisCaptionActor2D()->GetCaptionTextProperty()->SetColor(1, 1, 1); viewPortAxActor->SetYAxisLabelText("N"); viewPortAxActor->GetYAxisCaptionActor2D()->SetWidth(0.05); viewPortAxActor->GetYAxisCaptionActor2D()->SetHeight(0.05); viewPortAxActor->GetZAxisCaptionActor2D()->GetCaptionTextProperty()->SetColor(1, 1, 1); viewPortAxActor->SetZAxisLabelText("Up"); viewPortAxActor->GetZAxisCaptionActor2D()->SetWidth(0.05); viewPortAxActor->GetZAxisCaptionActor2D()->SetHeight(0.05); vtkSmartPointer viewPortOMWidget = vtkSmartPointer::New(); viewPortOMWidget->SetOrientationMarker(viewPortAxActor); viewPortOMWidget->SetInteractor(mainViewPort->GetInteractor()); viewPortOMWidget->SetViewport(0.7, 0.0, 1.00, 0.3); viewPortOMWidget->SetEnabled(1); viewPortOMWidget->InteractiveOn(); Ren1->ResetCamera(); Ren1->Render(); //mainViewPort->GetRenderWindow()->GetInteractor()->Start(); Luis Vieira, Consultant, Software Engineer Vektore Exploration Consulting Corporation ca.linkedin.com/in/ joaoluisvieira luis.vieira at vektore.com www.vektore.com From: Dean Inglis [mailto:inglis.dl at gmail.com ] Sent: December 28, 2016 8:35 AM To: Luis Vieira > Cc: VTK Users > Subject: Re: [vtkusers] QVTKWidget Camera vs vtkOrientationMarkerWidget Hi Luis, do not call Start() on the interactor within your Qt programs as Qt manages its own event loop. Dean On Tue, Dec 27, 2016 at 5:48 PM, Luis Vieira > wrote: Hello vtkusers, Anybody knows how to use vtkOrientationMarkerWidget with QVTKWidget interactor? I have been trying to implement the VTK example (http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/DisplayCoordinateAxes) and it worked smoothly. However, within my QVTKWidget Camera, and I caught the following exception: ERROR: In C:\VTK\VTK-7.0.0\GUISupport\Qt\QVTKInteractor.cxx, line 147 QVTKInteractor (000000F46583D670): QVTKInteractor cannot control the event loop. Following my vtkOrientationMarkerWidget snapshot: vtkRenderWindow* renwin = vtkRenderWindow::New(); myQVTKWidgetCAmera->SetRenderWindow(renwin); Ren1 = vtkRenderer::New(); myQVTKWidgetCAmera->GetRenderWindow()->AddRenderer(Ren1); vtkAxesActor* myAxActor = vtkAxesActor::New(); vtkSmartPointer myWidget = vtkSmartPointer::New(); myWidget ->SetOrientationMarker(myAxActor); myWidget ->SetInteractor(myQVTKWidgetCAmera->GetRenderWindow()->GetInteractor()); myWidget ->SetViewport(0.7, 0.0, 1.00, 0.3); myWidget ->SetEnabled(1); myWidget ->InteractiveOn(); Ren1->ResetCamera(); Ren1->Render(); myQVTKWidgetCAmera->GetRenderWindow()->GetInteractor()->Start(); Thank you very much for any help, Luis Vieira, Consultant, Software Engineer Vektore Exploration Consulting Corporation ca.linkedin.com/in/joaoluisvieira luis.vieira at vektore.com www.vektore.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 -- Sankhesh Jhaveri Sr. Research & Development Engineer | Kitware | (518) 881-4417 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From thoniorf at gmail.com Wed Dec 28 11:59:13 2016 From: thoniorf at gmail.com (Antonio Fortino) Date: Wed, 28 Dec 2016 17:59:13 +0100 Subject: [vtkusers] update,interact and render in different threads Message-ID: Hello to everyone, I'm trying to develop a simple example that update the celldata of a polydata in a thread while rendering in the main thread. My final goal is to interact with the scene, and pause the updates. To archive this i'm using a simple mutex and a boolean. However it seams that i'm trying to access the render for two different threads, and the mutex isn't enough, because when interacting with the scene errors like the one below appears, and at random the program stops with a segmentation. vtkOpenGLPolyDataMapper (0x1b62980): failed after UpdateShader 1 OpenGL errors detected 0 : (1282) Invalid operation I attach the code, any help is very appreciated. Best regards Antonio Fortino -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ThreadedColorCellsWithRGB.cxx Type: text/x-c++src Size: 4871 bytes Desc: not available URL: From luis.vieira at vektore.com Wed Dec 28 12:06:17 2016 From: luis.vieira at vektore.com (Luis Vieira) Date: Wed, 28 Dec 2016 12:06:17 -0500 Subject: [vtkusers] QVTKWidget Camera vs vtkOrientationMarkerWidget References: <1f1b501d26093$595be7a0$0c13b6e0$@vektore.com> <2635801d2611f$9670eff0$c352cfd0$@vektore.com> Message-ID: <2a53301d2612c$b4683830$1d38a890$@vektore.com> I was mixing vtkSmartPointer< with (*) initialization. Thank you. Luis Vieira, Consultant, Software Engineer Vektore Exploration Consulting Corporation ca.linkedin.com/in/joaoluisvieira luis.vieira at vektore.com www.vektore.com From: Luis Vieira [mailto:luis.vieira at vektore.com] Sent: December 28, 2016 11:58 AM To: 'Sankhesh Jhaveri' ; 'Dean Inglis' Cc: 'VTK Users' Subject: RE: [vtkusers] QVTKWidget Camera vs vtkOrientationMarkerWidget Tks Sankhesh, Dean Just got the problem. I was initializing the with vtkSmartPointer and my AxesActor as vtkAxesActor* . Now, both are as following: Worked smoothly vtkAxesActor* viewPortAxActor = vtkAxesActor::New(); viewPortAxActor->GetXAxisCaptionActor2D()->GetCaptionTextProperty()->SetColor(1, 1, 1); viewPortAxActor->SetXAxisLabelText("E"); viewPortAxActor->GetXAxisCaptionActor2D()->SetWidth(0.05); viewPortAxActor->GetXAxisCaptionActor2D()->SetHeight(0.05); viewPortAxActor->GetYAxisCaptionActor2D()->GetCaptionTextProperty()->SetColor(1, 1, 1); viewPortAxActor->SetYAxisLabelText("N"); viewPortAxActor->GetYAxisCaptionActor2D()->SetWidth(0.05); viewPortAxActor->GetYAxisCaptionActor2D()->SetHeight(0.05); viewPortAxActor->GetZAxisCaptionActor2D()->GetCaptionTextProperty()->SetColor(1, 1, 1); viewPortAxActor->SetZAxisLabelText("Up"); viewPortAxActor->GetZAxisCaptionActor2D()->SetWidth(0.05); viewPortAxActor->GetZAxisCaptionActor2D()->SetHeight(0.05); vtkOrientationMarkerWidget* viewPortOMWidget = vtkOrientationMarkerWidget::New(); viewPortOMWidget->SetOrientationMarker(viewPortAxActor); viewPortOMWidget->SetInteractor(mainViewPort->GetInteractor()); viewPortOMWidget->SetViewport(0.7, 0.0, 1.00, 0.3); viewPortOMWidget->SetEnabled(1); viewPortOMWidget->InteractiveOn(); Luis Vieira, Consultant, Software Engineer Vektore Exploration Consulting Corporation ca.linkedin.com/in/joaoluisvieira luis.vieira at vektore.com www.vektore.com From: Sankhesh Jhaveri [mailto:sankhesh.jhaveri at kitware.com] Sent: December 28, 2016 10:58 AM To: Luis Vieira >; Dean Inglis > Cc: VTK Users > Subject: Re: [vtkusers] QVTKWidget Camera vs vtkOrientationMarkerWidget Luis, It seems like you were able to get past the error about interactor not being able to control the event loop using Dean?s suggestion. I am not sure why you?re getting OpenGL errors but one thing I noticed is that you are using the OpenGL backend. Would you be able to try the OpenGL2 backend? Moreover, which version of Qt are you testing against? ? On Wed, Dec 28, 2016 at 10:35 AM Luis Vieira > wrote: Tks Dean, But still same, didn?t work: Following Exceptions and snapshot ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLRenderer.cxx, line 126 vtkOpenGLRenderer (0000004A68B268A0): failed ater ClearLights 16 OpenGL errors detected 0 : (1282) Invalid operation 1 : (1282) Invalid operation 2 : (1282) Invalid operation 3 : (1282) Invalid operation 4 : (1282) Invalid operation 5 : (1282) Invalid operation 6 : (1282) Invalid operation 7 : (1282) Invalid operation 8 : (1282) Invalid operation 9 : (1282) Invalid operation 10 : (1282) Invalid operation 11 : (1282) Invalid operation 12 : (1282) Invalid operation 13 : (1282) Invalid operation 14 : (1282) Invalid operation 15 : (1282) Invalid operation ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLRenderer.cxx, line 1202 vtkOpenGLRenderer (0000004A68B268A0): failed after Clear 16 OpenGL errors detected 0 : (1282) Invalid operation 1 : (1282) Invalid operation 2 : (1282) Invalid operation 3 : (1282) Invalid operation 4 : (1282) Invalid operation 5 : (1282) Invalid operation 6 : (1282) Invalid operation 7 : (1282) Invalid operation 8 : (1282) Invalid operation 9 : (1282) Invalid operation 10 : (1282) Invalid operation 11 : (1282) Invalid operation 12 : (1282) Invalid operation 13 : (1282) Invalid operation 14 : (1282) Invalid operation 15 : (1282) Invalid operation ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLCamera.cxx, line 176 vtkOpenGLCamera (0000004A67EA1870): failed after Render 16 OpenGL errors detected 0 : (1282) Invalid operation 1 : (1282) Invalid operation 2 : (1282) Invalid operation 3 : (1282) Invalid operation 4 : (1282) Invalid operation 5 : (1282) Invalid operation 6 : (1282) Invalid operation 7 : (1282) Invalid operation 8 : (1282) Invalid operation 9 : (1282) Invalid operation 10 : (1282) Invalid operation 11 : (1282) Invalid operation 12 : (1282) Invalid operation 13 : (1282) Invalid operation 14 : (1282) Invalid operation 15 : (1282) Invalid operation ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLLight.cxx, line 118 vtkOpenGLLight (0000004A68A31190): failed after Render 16 OpenGL errors detected 0 : (1282) Invalid operation 1 : (1282) Invalid operation 2 : (1282) Invalid operation 3 : (1282) Invalid operation 4 : (1282) Invalid operation 5 : (1282) Invalid operation 6 : (1282) Invalid operation 7 : (1282) Invalid operation 8 : (1282) Invalid operation 9 : (1282) Invalid operation 10 : (1282) Invalid operation 11 : (1282) Invalid operation 12 : (1282) Invalid operation 13 : (1282) Invalid operation 14 : (1282) Invalid operation 15 : (1282) Invalid operation ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLRenderer.cxx, line 192 vtkOpenGLRenderer (0000004A68B268A0): failed after UpdateLights 16 OpenGL errors detected 0 : (1282) Invalid operation 1 : (1282) Invalid operation 2 : (1282) Invalid operation 3 : (1282) Invalid operation 4 : (1282) Invalid operation 5 : (1282) Invalid operation 6 : (1282) Invalid operation 7 : (1282) Invalid operation 8 : (1282) Invalid operation 9 : (1282) Invalid operation 10 : (1282) Invalid operation 11 : (1282) Invalid operation 12 : (1282) Invalid operation 13 : (1282) Invalid operation 14 : (1282) Invalid operation 15 : (1282) Invalid operation ERROR: In C:\VTK\VTK-7.0.0\Rendering\OpenGL\vtkOpenGLRenderer.cxx, line 282 vtkOpenGLRenderer (0000004A68B268A0): failed after DeviceRender 16 OpenGL errors detected 0 : (1282) Invalid operation 1 : (1282) Invalid operation 2 : (1282) Invalid operation 3 : (1282) Invalid operation 4 : (1282) Invalid operation 5 : (1282) Invalid operation 6 : (1282) Invalid operation 7 : (1282) Invalid operation 8 : (1282) Invalid operation 9 : (1282) Invalid operation 10 : (1282) Invalid operation 11 : (1282) Invalid operation 12 : (1282) Invalid operation 13 : (1282) Invalid operation 14 : (1282) Invalid operation 15 : (1282) Invalid operation // create a window to make it stereo capable and give it to QVTKWidget // create a window to make it stereo capable and give it to QVTKWidget vtkRenderWindow* renwin = vtkRenderWindow::New(); renwin->StereoCapableWindowOn(); // Activate 3DConnexion device only on the left render window. mainViewPort->SetUseTDx(true); mainViewPort->SetRenderWindow(renwin); //renwin->Delete(); const double angleSensitivity = 0.02; const double translationSensitivity = 0.001; QVTKInteractor *iren = mainViewPort->GetInteractor(); vtkInteractorStyle *s = static_cast(iren->GetInteractorStyle()); vtkTDxInteractorStyleCamera *t = static_cast(s->GetTDxStyle()); t->GetSettings()->SetAngleSensitivity(angleSensitivity); t->GetSettings()->SetTranslationXSensitivity(translationSensitivity); t->GetSettings()->SetTranslationYSensitivity(translationSensitivity); t->GetSettings()->SetTranslationZSensitivity(translationSensitivity); // add a renderer Ren1 = vtkRenderer::New(); mainViewPort->GetRenderWindow()->AddRenderer(Ren1); vtkAxesActor* viewPortAxActor = vtkAxesActor::New(); // The axes are positioned with a user transform //viewPortAxActor->SetUserTransform(transform); viewPortAxActor->GetXAxisCaptionActor2D()->GetCaptionTextProperty()->SetColor(1, 1, 1); viewPortAxActor->SetXAxisLabelText("E"); viewPortAxActor->GetXAxisCaptionActor2D()->SetWidth(0.05); viewPortAxActor->GetXAxisCaptionActor2D()->SetHeight(0.05); viewPortAxActor->GetYAxisCaptionActor2D()->GetCaptionTextProperty()->SetColor(1, 1, 1); viewPortAxActor->SetYAxisLabelText("N"); viewPortAxActor->GetYAxisCaptionActor2D()->SetWidth(0.05); viewPortAxActor->GetYAxisCaptionActor2D()->SetHeight(0.05); viewPortAxActor->GetZAxisCaptionActor2D()->GetCaptionTextProperty()->SetColor(1, 1, 1); viewPortAxActor->SetZAxisLabelText("Up"); viewPortAxActor->GetZAxisCaptionActor2D()->SetWidth(0.05); viewPortAxActor->GetZAxisCaptionActor2D()->SetHeight(0.05); vtkSmartPointer viewPortOMWidget = vtkSmartPointer::New(); viewPortOMWidget->SetOrientationMarker(viewPortAxActor); viewPortOMWidget->SetInteractor(mainViewPort->GetInteractor()); viewPortOMWidget->SetViewport(0.7, 0.0, 1.00, 0.3); viewPortOMWidget->SetEnabled(1); viewPortOMWidget->InteractiveOn(); Ren1->ResetCamera(); Ren1->Render(); //mainViewPort->GetRenderWindow()->GetInteractor()->Start(); Luis Vieira, Consultant, Software Engineer Vektore Exploration Consulting Corporation ca.linkedin.com/in/ joaoluisvieira luis.vieira at vektore.com www.vektore.com From: Dean Inglis [mailto:inglis.dl at gmail.com ] Sent: December 28, 2016 8:35 AM To: Luis Vieira > Cc: VTK Users > Subject: Re: [vtkusers] QVTKWidget Camera vs vtkOrientationMarkerWidget Hi Luis, do not call Start() on the interactor within your Qt programs as Qt manages its own event loop. Dean On Tue, Dec 27, 2016 at 5:48 PM, Luis Vieira > wrote: Hello vtkusers, Anybody knows how to use vtkOrientationMarkerWidget with QVTKWidget interactor? I have been trying to implement the VTK example (http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/DisplayCoordinateAxes) and it worked smoothly. However, within my QVTKWidget Camera, and I caught the following exception: ERROR: In C:\VTK\VTK-7.0.0\GUISupport\Qt\QVTKInteractor.cxx, line 147 QVTKInteractor (000000F46583D670): QVTKInteractor cannot control the event loop. Following my vtkOrientationMarkerWidget snapshot: vtkRenderWindow* renwin = vtkRenderWindow::New(); myQVTKWidgetCAmera->SetRenderWindow(renwin); Ren1 = vtkRenderer::New(); myQVTKWidgetCAmera->GetRenderWindow()->AddRenderer(Ren1); vtkAxesActor* myAxActor = vtkAxesActor::New(); vtkSmartPointer myWidget = vtkSmartPointer::New(); myWidget ->SetOrientationMarker(myAxActor); myWidget ->SetInteractor(myQVTKWidgetCAmera->GetRenderWindow()->GetInteractor()); myWidget ->SetViewport(0.7, 0.0, 1.00, 0.3); myWidget ->SetEnabled(1); myWidget ->InteractiveOn(); Ren1->ResetCamera(); Ren1->Render(); myQVTKWidgetCAmera->GetRenderWindow()->GetInteractor()->Start(); Thank you very much for any help, Luis Vieira, Consultant, Software Engineer Vektore Exploration Consulting Corporation ca.linkedin.com/in/joaoluisvieira luis.vieira at vektore.com www.vektore.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 -- Sankhesh Jhaveri Sr. Research & Development Engineer | Kitware | (518) 881-4417 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From psakievich at gmail.com Wed Dec 28 18:44:48 2016 From: psakievich at gmail.com (Philip Sakievich) Date: Wed, 28 Dec 2016 16:44:48 -0700 Subject: [vtkusers] PVTS, Multiblock or Both In-Reply-To: References: Message-ID: I'm not really looking to do in-situ at this point. I'm probably not making sense. I've put together a test problem in python that illustrates what I'm trying to do (it should be run with <=4 processors). I've attached the code and I'll copy it at the bottom for anyone on the mailing list. Basically, each rank declares a portion of the grid in memory, and then calls the writer. They all have access to the WholeExtent, but I don't know how to get it working in the pipeline. All I need to do to get it working in paraview and visit is manually change the WholeExtent in the *pvts file to "0, 15, 0, 33, 0, 15". -----------CODE-------------------- ''' This is intended to write data peices that are unique to each processor and have it be combined in the pvts file. ''' import vtk import numpy as np from vtk.numpy_interface import dataset_adapter as dsa from vtk.util import numpy_support debug=True contr=vtk.vtkMultiProcessController.GetGlobalController() if not contr: nranks=1 rank=0 else: nranks=contr.GetNumberOfProcesses() rank =contr.GetLocalProcessId() if debug: print 'Hello from rank {}'.format(rank) pnts=vtk.vtkPoints() #Global size/extent sizeGlobal=np.array([16,33,16],dtype=int) extentGlobal=np.array([0,15,0,33,0,15],dtype=int) #cylindrical coordinates r=np.linspace(0,1,sizeGlobal[0]) theta=np.linspace(0,2*np.pi,sizeGlobal[1]) z=np.linspace(-0.5,0.5,sizeGlobal[2]) #rank specific extents if rank==0: extentLocal=np.array([0,7,0,32,0,7],dtype=int) if rank==1: extentLocal=np.array([7,15,0,32,0,7],dtype=int) if rank==2: extentLocal=np.array([0,7,0,32,7,15],dtype=int) if rank==3: extentLocal=np.array([7,15,0,32,7,15],dtype=int) #define points specific to each rank for i in range(extentLocal[4],extentLocal[5]+1): for j in range(extentLocal[2],extentLocal[3]+1): for k in range(extentLocal[0],extentLocal[1]+1): xl=r[k]*np.cos(theta[j]) yl=r[k]*np.sin(theta[j]) zl=z[i] pnts.InsertNextPoint(xl,yl,zl) #dump data sg=vtk.vtkStructuredGrid() sg.SetExtent(extentLocal) sg.SetPoints(pnts) writer=vtk.vtkXMLPStructuredGridWriter() writer.SetInputData(sg) writer.SetController(contr) writer.SetFileName('testgrid.pvts') writer.SetNumberOfPieces(nranks) writer.SetStartPiece(rank) writer.SetEndPiece(rank) ''' This is what I wish I had. I need some way to set the WholeExtent that only affects the *pvts file. Everything else works. | | \|/ V writer.SetWholeExtent(extentGlobal) ''' writer.Update() writer.Write() On Thu, Dec 22, 2016 at 3:35 PM, Andy Bauer wrote: > If you want to use VTK as an in situ library instead of reading data in > from disk I strongly recommended looking at ParaView Catalyst ( > http://www.paraview.org/in-situ/). You can use a vtkTrivialProducer to > have the data layout you want but if I understand what you're trying to do > you'll probably want to use a VTK composite data set with each process > having its own data set. > > On Thu, Dec 22, 2016 at 12:07 AM, Philip Sakievich > wrote: > >> I'm unclear on how to work with this if I don't specify the local >> extent. In my code I am subdividing my computational domain so the data is >> unique on each processor, doing work and then dumping the results. It is >> completely distributed and the processors don't share any data except on >> the boundaries. I already know the global and local extents and now I need >> the local extent in the pvts to line up with the other portions of my >> code. I don't want the pipeline to give me the local extent unless I can >> get it to match the extent I've already specified. >> >> At this point, it is almost seeming easier to write a script that writes >> the *pvts for me instead of using the pipeline, but it frustrates me that I >> can't get the pipeline to do what I want. I'm trying to learn VTK in a >> broad sense in my spare time. However, for this specific problem the only >> thing I need is for the PVTS file to have the LocalExtents match my >> datasets on each of the processors. If I can just solve this all of my >> problems will be over. I am still wrapping my head around the pipeline >> concept, but it has been a struggle since there aren't many examples for >> the problem I'm trying to work with. I'm actually not doing any rendering. >> I'm just managing IO. >> >> I looked at the source you mentioned, but I'm not sure where I am >> supposed to interact with the RequestInformation request. I'm assuming it >> will be in the filter that is the input to vtkXMLPStructuredGridWriter, but >> I haven't really worked with any filters since I've only been doing IO. >> With the programmable filter example >> , >> I can get it to write local extents that differ from the WholeExtent but >> they do not match my datasets. (In this case I just copied the execute >> function). >> >> Also, I don't really see why it is necessary to specify the WholeExtent >> in RequestInformation. I can specify the WholeExtent via >> vtkStructuredGrid.SetDimensions(), or SetExtent and it works fine. It's >> just that the LocalExtents aren't correct. I think I'm really hitting a >> roadblock because I don't understand how the parallel writer and the >> partitioning works with the pipeline. >> >> Can you provide some specifics on how the partitioning is supposed to >> work and/or help me modify the code in my previous example to do what I'm >> looking for? Either that or specify an open source code that has >> implemented vtkXMLPStructuredGridWriter that I can review. My >> application is a CFD solver and it's post processing routines. >> >> >> >> On Mon, Dec 19, 2016 at 7:18 AM, Andy Bauer >> wrote: >> >>> You need to specify the WholeExtent in the RequestInformation >>> request.You actually don't specify the local extent, the pipeline will give >>> you that for a source. I'd recommend looking at the >>> Imaging/Core/vtkRTAnalyticSource.cxx class in VTK to see how it's done >>> as a source. >>> >>> >>> On Sun, Dec 18, 2016 at 1:16 AM, Philip Sakievich >>> wrote: >>> >>>> Andy and community, >>>> >>>> I have read about the concept of whole extent vs extent, but the one >>>> thing I don't seem to be able to determine is how to set the whole extent >>>> to be different. I tried using vtkStructuredGrid.Crop() but nothing is >>>> happening. >>>> >>>> In the code snippet below, I have previously declared points local to >>>> each processor. I now want to populate a structured grid and write a *pvts >>>> that ties them all together. When I run this code the pvts writes itself >>>> and the files, but they all have the same whole extent and extent. Nothing >>>> is cropped to the desired local extent. What am I doing wrong? How do I >>>> specify a whole extent that is uniform across all processors, and a local >>>> extent that is specific to each one? >>>> >>>> #create grid and filter for processing to writer >>>> pf=vtk.vtkProgrammableFilter() >>>> sg=vtk.vtkStructuredGrid() >>>> >>>> #set extent global >>>> sg.SetExtent(0,15,0,32,0,15) >>>> >>>> #set extent local >>>> if rank==0: >>>> lE=np.array([0,8,0,32,0,8],dtype=int) >>>> sg.Crop(lE) >>>> if rank==1: >>>> lE=np.array([0,8,0,32,7,15],dtype=int) >>>> sg.Crop(lE) >>>> if rank==2: >>>> lE=np.array([7,15,0,32,0,8],dtype=int) >>>> sg.Crop(lE) >>>> if rank==3: >>>> lE=np.array([7,15,0,32,7,15],dtype=int) >>>> sg.Crop(lE) >>>> >>>> sg.SetPoints(pnts) >>>> pf.SetInputData(sg) >>>> >>>> writer=vtk.vtkXMLPStructuredGridWriter() >>>> writer.SetInputConnection(pf.GetOutputPort()) >>>> writer.SetController(contr) >>>> writer.SetDataModeToAscii() >>>> writer.SetFileName('testgrid.pvts') >>>> writer.SetNumberOfPieces(nranks) >>>> writer.SetStartPiece(rank) >>>> writer.SetEndPiece(rank) >>>> writer.Write() >>>> >>>> Thanks, >>>> >>>> Phil >>>> >>>> On Tue, Dec 13, 2016 at 7:31 AM, Andy Bauer >>>> wrote: >>>> >>>>> Hi, >>>>> >>>>> I would recommend using the pvts format since that is the best format >>>>> for storing structured grids. If you read it back in it will know how to >>>>> properly partition the data set for different amounts of processes as well >>>>> as do things like ghost cells, extract surfaces, etc. >>>>> >>>>> For topologically structured grids like vtkStructuredGrid there are >>>>> two types of extents, "whole extent" describes the beginning and ending >>>>> node (inclusive) in each direction for the entire grid while "extent" >>>>> refers to each process's (or pieces if you're serial but doing streaming) >>>>> partition of the grid. I believe this should be explained in the VTK User's >>>>> Guide which is now available for free as a pdf download. >>>>> >>>>> Cheers, >>>>> Andy >>>>> >>>>> On Tue, Dec 13, 2016 at 10:21 AM, Philip Sakievich < >>>>> psakievich at gmail.com> wrote: >>>>> >>>>>> Greetings, >>>>>> >>>>>> I am reasonably new to vtk and I am mainly using it to manage >>>>>> datasets on structured grids. >>>>>> >>>>>> I am trying to write data for a structured grid in parallel python >>>>>> via MPI. Each process has a separate portion of the grid, and I'm trying >>>>>> to figure out how to set up the write process. I was following this example: >>>>>> >>>>>> http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=IO/ParallelXML/ >>>>>> Testing/Python/testParallelXMLWriters.py >>>>>> >>>>>> But then I realized that in this case each process has the entire >>>>>> grid, and each processor is just writing a portion of the data it >>>>>> contains. So do I need to use a multiblock data set? Can someone please >>>>>> provide a simple example of how to write a structured grid in parallel >>>>>> provided each process has the local extent correctly specified? >>>>>> >>>>>> Thanks >>>>>> >>>>>> -- >>>>>> Phil Sakievich >>>>>> >>>>>> PhD Candidate - Mechanical Engineering >>>>>> Arizona State University - Ira A. Fulton School for Engineering of >>>>>> Matter Transport and Energy >>>>>> Tempe, Arizona >>>>>> >>>>>> _______________________________________________ >>>>>> Powered by www.kitware.com >>>>>> >>>>>> Visit other Kitware open-source projects at >>>>>> http://www.kitware.com/opensource/opensource.html >>>>>> >>>>>> Please keep messages on-topic and check the VTK FAQ at: >>>>>> 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 >>>>>> >>>>>> >>>>> >>>> >>>> >>>> -- >>>> Phil Sakievich >>>> >>>> PhD Candidate - Mechanical Engineering >>>> Arizona State University - Ira A. Fulton School for Engineering of >>>> Matter Transport and Energy >>>> Tempe, Arizona >>>> >>> >>> >> >> >> -- >> Phil Sakievich >> >> PhD Candidate - Mechanical Engineering >> Arizona State University - Ira A. Fulton School for Engineering of Matter >> Transport and Energy >> Tempe, Arizona >> > > -- Phil Sakievich PhD Candidate - Mechanical Engineering Arizona State University - Ira A. Fulton School for Engineering of Matter Transport and Energy Tempe, Arizona -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: CreatePVTS.py Type: text/x-python Size: 1874 bytes Desc: not available URL: From andrew.amaclean at gmail.com Thu Dec 29 00:23:41 2016 From: andrew.amaclean at gmail.com (Andrew Maclean) Date: Thu, 29 Dec 2016 16:23:41 +1100 Subject: [vtkusers] ] update,interact and render in different threads Message-ID: Your problem is in the modified callback. There is no need for this callback since while the rendering takes place this callback is invoked many times hence the OpenGL errors. So remove: "cellData->AddObserver(vtkCommand::ModifiedEvent,ModifiedCallback);" By adding this observer to CellData you are forcing a reload of cell data whenever any event happens during rendering. Now, you only need the InteractionEndCallBack observer since you are only interested in updating the end result. If you leave in InteractionStartCallBack then the object is updated twice. Once at the start of interaction and then at the end of interaction. After all you are only interested in the result after the interaction has ended. Also remove "ComputerRGB();" on line 75 as this is not needed since this is called in the thread. Addidionally "#include " and "XInitThreads();" are not needed at all. ---------- Forwarded message ---------- > From: Antonio Fortino > To: vtkusers at vtk.org > Cc: > Date: Wed, 28 Dec 2016 17:59:13 +0100 > Subject: [vtkusers] update,interact and render in different threads > Hello to everyone, > > I'm trying to develop a simple example that update the celldata of a > polydata in a thread while rendering in the main thread. > My final goal is to interact with the scene, and pause the updates. > > To archive this i'm using a simple mutex and a boolean. > However it seams that i'm trying to access the render for two different > threads, and the mutex isn't enough, because when interacting with the > scene errors like the one below appears, and at random the program stops > with a segmentation. > > vtkOpenGLPolyDataMapper (0x1b62980): failed after UpdateShader 1 OpenGL > errors detected > > 0 : (1282) Invalid operation > > > I attach the code, any help is very appreciated. > > Best regards > Antonio Fortino > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- ___________________________________________ Andrew J. P. Maclean ___________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From psakievich at gmail.com Thu Dec 29 00:59:35 2016 From: psakievich at gmail.com (Philip Sakievich) Date: Wed, 28 Dec 2016 22:59:35 -0700 Subject: [vtkusers] PVTS, Multiblock or Both In-Reply-To: References: Message-ID: Okay, I found what I was looking for. Thanks for your help Andy! Your comments and suggestions helped me along in the process. I've pasted the code for anyone else who is interested. I hope it will be useful to have this documented since similar questions have been asked in the past. ( http://vtk.1045678.n5.nabble.com/quot-manually-quot-specify-extents-for-vtkXMLPRectilinearGridWriter-td5714844.html) The key was to specify the WholeExtent when defining the grid, but then have a filter that gets called during the write process which changes the extent to the local extent for each processor. I still have a lot more to learn about all of this. It would be nice if you guys at kitware would put some more specific examples and documentation for working in a parallel environment. I have been working on this problem off an on for several months, gave up on it for a while and then came back to it when I started this email chain. The code below is as bare bones as I could get it for specifying local and whole extents. I also got it to work with the vtkExtentTranslator, which might prove useful in the future. However, I have my own partitioning schemes for this current problem. --------------------------CODE------------------------------- ''' This is intended to write data peices that are unique to each processor and have it be combined in the pvts file. ''' import vtk import numpy as np from vtk.numpy_interface import dataset_adapter as dsa from vtk.util import numpy_support debug=True contr=vtk.vtkMultiProcessController.GetGlobalController() if not contr: nranks=1 rank=0 else: nranks=contr.GetNumberOfProcesses() rank =contr.GetLocalProcessId() if debug: print 'Hello from rank {}'.format(rank) pnts=vtk.vtkPoints() #Global size/extent sizeGlobal=np.array([16,33,32],dtype=int) extentGlobal=np.array([0,15,0,32,0,31],dtype=int) #cylindrical coordinates r=np.linspace(0,1,sizeGlobal[0]) theta=np.linspace(0,2*np.pi,sizeGlobal[1]) z=np.linspace(-0.5,0.5,sizeGlobal[2]) #rank specific extents if rank==0: extentLocal=np.array([0,7,0,32,0,15],dtype=int) if rank==1: extentLocal=np.array([7,15,0,32,0,15],dtype=int) if rank==2: extentLocal=np.array([0,7,0,32,15,31],dtype=int) if rank==3: extentLocal=np.array([7,15,0,32,15,31],dtype=int) #define points specific to each rank for i in range(extentLocal[4],extentLocal[5]+1): for j in range(extentLocal[2],extentLocal[3]+1): for k in range(extentLocal[0],extentLocal[1]+1): xl=r[k]*np.cos(theta[j]) yl=r[k]*np.sin(theta[j]) zl=z[i] pnts.InsertNextPoint(xl,yl,zl) #dump data pf=vtk.vtkProgrammableFilter() def execute(): info = pf.GetOutputInformation(0) output = pf.GetOutput() input = pf.GetInput() output.ShallowCopy(input) output.SetExtent(extentLocal) pf.SetExecuteMethod(execute) sg=vtk.vtkStructuredGrid() sg.SetExtent(extentGlobal) pf.SetInputData(sg) sg.SetPoints(pnts) writer=vtk.vtkXMLPStructuredGridWriter() writer.SetInputConnection(pf.GetOutputPort()) writer.SetController(contr) writer.SetFileName('testgrid.pvts') writer.SetNumberOfPieces(nranks) writer.SetStartPiece(rank) writer.SetEndPiece(rank) writer.Update() writer.Write() On Wed, Dec 28, 2016 at 4:44 PM, Philip Sakievich wrote: > I'm not really looking to do in-situ at this point. I'm probably not > making sense. I've put together a test problem in python that illustrates > what I'm trying to do (it should be run with <=4 processors). I've > attached the code and I'll copy it at the bottom for anyone on the mailing > list. > > Basically, each rank declares a portion of the grid in memory, and then > calls the writer. They all have access to the WholeExtent, but I don't > know how to get it working in the pipeline. All I need to do to get it > working in paraview and visit is manually change the WholeExtent in the > *pvts file to "0, 15, 0, 33, 0, 15". > > -----------CODE-------------------- > ''' > This is intended to write data peices that are unique to each > processor and have it be combined in the pvts file. > ''' > import vtk > import numpy as np > from vtk.numpy_interface import dataset_adapter as dsa > from vtk.util import numpy_support > debug=True > > contr=vtk.vtkMultiProcessController.GetGlobalController() > if not contr: > nranks=1 > rank=0 > else: > nranks=contr.GetNumberOfProcesses() > rank =contr.GetLocalProcessId() > > if debug: > print 'Hello from rank {}'.format(rank) > > pnts=vtk.vtkPoints() > #Global size/extent > sizeGlobal=np.array([16,33,16],dtype=int) > extentGlobal=np.array([0,15,0,33,0,15],dtype=int) > #cylindrical coordinates > r=np.linspace(0,1,sizeGlobal[0]) > theta=np.linspace(0,2*np.pi,sizeGlobal[1]) > z=np.linspace(-0.5,0.5,sizeGlobal[2]) > #rank specific extents > if rank==0: > extentLocal=np.array([0,7,0,32,0,7],dtype=int) > if rank==1: > extentLocal=np.array([7,15,0,32,0,7],dtype=int) > if rank==2: > extentLocal=np.array([0,7,0,32,7,15],dtype=int) > if rank==3: > extentLocal=np.array([7,15,0,32,7,15],dtype=int) > #define points specific to each rank > for i in range(extentLocal[4],extentLocal[5]+1): > for j in range(extentLocal[2],extentLocal[3]+1): > for k in range(extentLocal[0],extentLocal[1]+1): > xl=r[k]*np.cos(theta[j]) > yl=r[k]*np.sin(theta[j]) > zl=z[i] > pnts.InsertNextPoint(xl,yl,zl) > #dump data > sg=vtk.vtkStructuredGrid() > sg.SetExtent(extentLocal) > sg.SetPoints(pnts) > writer=vtk.vtkXMLPStructuredGridWriter() > writer.SetInputData(sg) > writer.SetController(contr) > writer.SetFileName('testgrid.pvts') > writer.SetNumberOfPieces(nranks) > writer.SetStartPiece(rank) > writer.SetEndPiece(rank) > ''' > This is what I wish I had. I need some way to set the WholeExtent > that only affects the *pvts file. Everything else works. > | > | > \|/ > V > writer.SetWholeExtent(extentGlobal) > ''' > writer.Update() > writer.Write() > > > On Thu, Dec 22, 2016 at 3:35 PM, Andy Bauer > wrote: > >> If you want to use VTK as an in situ library instead of reading data in >> from disk I strongly recommended looking at ParaView Catalyst ( >> http://www.paraview.org/in-situ/). You can use a vtkTrivialProducer to >> have the data layout you want but if I understand what you're trying to do >> you'll probably want to use a VTK composite data set with each process >> having its own data set. >> >> On Thu, Dec 22, 2016 at 12:07 AM, Philip Sakievich >> wrote: >> >>> I'm unclear on how to work with this if I don't specify the local >>> extent. In my code I am subdividing my computational domain so the data is >>> unique on each processor, doing work and then dumping the results. It is >>> completely distributed and the processors don't share any data except on >>> the boundaries. I already know the global and local extents and now I need >>> the local extent in the pvts to line up with the other portions of my >>> code. I don't want the pipeline to give me the local extent unless I can >>> get it to match the extent I've already specified. >>> >>> At this point, it is almost seeming easier to write a script that >>> writes the *pvts for me instead of using the pipeline, but it frustrates me >>> that I can't get the pipeline to do what I want. I'm trying to learn VTK in >>> a broad sense in my spare time. However, for this specific problem the only >>> thing I need is for the PVTS file to have the LocalExtents match my >>> datasets on each of the processors. If I can just solve this all of my >>> problems will be over. I am still wrapping my head around the pipeline >>> concept, but it has been a struggle since there aren't many examples for >>> the problem I'm trying to work with. I'm actually not doing any rendering. >>> I'm just managing IO. >>> >>> I looked at the source you mentioned, but I'm not sure where I am >>> supposed to interact with the RequestInformation request. I'm assuming it >>> will be in the filter that is the input to vtkXMLPStructuredGridWriter, but >>> I haven't really worked with any filters since I've only been doing IO. >>> With the programmable filter example >>> , >>> I can get it to write local extents that differ from the WholeExtent but >>> they do not match my datasets. (In this case I just copied the execute >>> function). >>> >>> Also, I don't really see why it is necessary to specify the WholeExtent >>> in RequestInformation. I can specify the WholeExtent via >>> vtkStructuredGrid.SetDimensions(), or SetExtent and it works fine. >>> It's just that the LocalExtents aren't correct. I think I'm really hitting >>> a roadblock because I don't understand how the parallel writer and the >>> partitioning works with the pipeline. >>> >>> Can you provide some specifics on how the partitioning is supposed to >>> work and/or help me modify the code in my previous example to do what I'm >>> looking for? Either that or specify an open source code that has >>> implemented vtkXMLPStructuredGridWriter that I can review. My >>> application is a CFD solver and it's post processing routines. >>> >>> >>> >>> On Mon, Dec 19, 2016 at 7:18 AM, Andy Bauer >>> wrote: >>> >>>> You need to specify the WholeExtent in the RequestInformation >>>> request.You actually don't specify the local extent, the pipeline will give >>>> you that for a source. I'd recommend looking at the >>>> Imaging/Core/vtkRTAnalyticSource.cxx class in VTK to see how it's done >>>> as a source. >>>> >>>> >>>> On Sun, Dec 18, 2016 at 1:16 AM, Philip Sakievich >>> > wrote: >>>> >>>>> Andy and community, >>>>> >>>>> I have read about the concept of whole extent vs extent, but the one >>>>> thing I don't seem to be able to determine is how to set the whole extent >>>>> to be different. I tried using vtkStructuredGrid.Crop() but nothing is >>>>> happening. >>>>> >>>>> In the code snippet below, I have previously declared points local to >>>>> each processor. I now want to populate a structured grid and write a *pvts >>>>> that ties them all together. When I run this code the pvts writes itself >>>>> and the files, but they all have the same whole extent and extent. Nothing >>>>> is cropped to the desired local extent. What am I doing wrong? How do I >>>>> specify a whole extent that is uniform across all processors, and a local >>>>> extent that is specific to each one? >>>>> >>>>> #create grid and filter for processing to writer >>>>> pf=vtk.vtkProgrammableFilter() >>>>> sg=vtk.vtkStructuredGrid() >>>>> >>>>> #set extent global >>>>> sg.SetExtent(0,15,0,32,0,15) >>>>> >>>>> #set extent local >>>>> if rank==0: >>>>> lE=np.array([0,8,0,32,0,8],dtype=int) >>>>> sg.Crop(lE) >>>>> if rank==1: >>>>> lE=np.array([0,8,0,32,7,15],dtype=int) >>>>> sg.Crop(lE) >>>>> if rank==2: >>>>> lE=np.array([7,15,0,32,0,8],dtype=int) >>>>> sg.Crop(lE) >>>>> if rank==3: >>>>> lE=np.array([7,15,0,32,7,15],dtype=int) >>>>> sg.Crop(lE) >>>>> >>>>> sg.SetPoints(pnts) >>>>> pf.SetInputData(sg) >>>>> >>>>> writer=vtk.vtkXMLPStructuredGridWriter() >>>>> writer.SetInputConnection(pf.GetOutputPort()) >>>>> writer.SetController(contr) >>>>> writer.SetDataModeToAscii() >>>>> writer.SetFileName('testgrid.pvts') >>>>> writer.SetNumberOfPieces(nranks) >>>>> writer.SetStartPiece(rank) >>>>> writer.SetEndPiece(rank) >>>>> writer.Write() >>>>> >>>>> Thanks, >>>>> >>>>> Phil >>>>> >>>>> On Tue, Dec 13, 2016 at 7:31 AM, Andy Bauer >>>>> wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> I would recommend using the pvts format since that is the best format >>>>>> for storing structured grids. If you read it back in it will know how to >>>>>> properly partition the data set for different amounts of processes as well >>>>>> as do things like ghost cells, extract surfaces, etc. >>>>>> >>>>>> For topologically structured grids like vtkStructuredGrid there are >>>>>> two types of extents, "whole extent" describes the beginning and ending >>>>>> node (inclusive) in each direction for the entire grid while "extent" >>>>>> refers to each process's (or pieces if you're serial but doing streaming) >>>>>> partition of the grid. I believe this should be explained in the VTK User's >>>>>> Guide which is now available for free as a pdf download. >>>>>> >>>>>> Cheers, >>>>>> Andy >>>>>> >>>>>> On Tue, Dec 13, 2016 at 10:21 AM, Philip Sakievich < >>>>>> psakievich at gmail.com> wrote: >>>>>> >>>>>>> Greetings, >>>>>>> >>>>>>> I am reasonably new to vtk and I am mainly using it to manage >>>>>>> datasets on structured grids. >>>>>>> >>>>>>> I am trying to write data for a structured grid in parallel python >>>>>>> via MPI. Each process has a separate portion of the grid, and I'm trying >>>>>>> to figure out how to set up the write process. I was following this example: >>>>>>> >>>>>>> http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=IO/ParallelXML/ >>>>>>> Testing/Python/testParallelXMLWriters.py >>>>>>> >>>>>>> But then I realized that in this case each process has the entire >>>>>>> grid, and each processor is just writing a portion of the data it >>>>>>> contains. So do I need to use a multiblock data set? Can someone please >>>>>>> provide a simple example of how to write a structured grid in parallel >>>>>>> provided each process has the local extent correctly specified? >>>>>>> >>>>>>> Thanks >>>>>>> >>>>>>> -- >>>>>>> Phil Sakievich >>>>>>> >>>>>>> PhD Candidate - Mechanical Engineering >>>>>>> Arizona State University - Ira A. Fulton School for Engineering of >>>>>>> Matter Transport and Energy >>>>>>> Tempe, Arizona >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Powered by www.kitware.com >>>>>>> >>>>>>> Visit other Kitware open-source projects at >>>>>>> http://www.kitware.com/opensource/opensource.html >>>>>>> >>>>>>> Please keep messages on-topic and check the VTK FAQ at: >>>>>>> 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 >>>>>>> >>>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> Phil Sakievich >>>>> >>>>> PhD Candidate - Mechanical Engineering >>>>> Arizona State University - Ira A. Fulton School for Engineering of >>>>> Matter Transport and Energy >>>>> Tempe, Arizona >>>>> >>>> >>>> >>> >>> >>> -- >>> Phil Sakievich >>> >>> PhD Candidate - Mechanical Engineering >>> Arizona State University - Ira A. Fulton School for Engineering of >>> Matter Transport and Energy >>> Tempe, Arizona >>> >> >> > > > -- > Phil Sakievich > > PhD Candidate - Mechanical Engineering > Arizona State University - Ira A. Fulton School for Engineering of Matter > Transport and Energy > Tempe, Arizona > -- Phil Sakievich PhD Candidate - Mechanical Engineering Arizona State University - Ira A. Fulton School for Engineering of Matter Transport and Energy Tempe, Arizona -------------- next part -------------- An HTML attachment was scrubbed... URL: From thoniorf at gmail.com Thu Dec 29 05:30:50 2016 From: thoniorf at gmail.com (Antonio Fortino) Date: Thu, 29 Dec 2016 11:30:50 +0100 Subject: [vtkusers] Fwd: ] update,interact and render in different threads In-Reply-To: References: Message-ID: Thank you Andrew i had forgotten that isolated ComputerRGB(). Forgive me i wasn't clear, but i added the observer to the celldata to render every time the cells are updated, and the interactions callbacks handle just the mutex to prevent the cells updates while i'm interaction. Is there another way to do ? Thank you again for your help. Antonio Fortino 2016-12-29 6:23 GMT+01:00 Andrew Maclean : > > Your problem is in the modified callback. There is no need for this > callback since > while the rendering takes place this callback is invoked many times hence > the OpenGL errors. > So remove: "cellData->AddObserver(vtkCommand::ModifiedEvent,ModifiedCal > lback);" > By adding this observer to CellData you are forcing a reload of cell data > whenever any event happens during rendering. > > Now, you only need the InteractionEndCallBack observer since you are only > interested in updating the end result. > If you leave in InteractionStartCallBack then the object is updated > twice. Once at the start of interaction and then at the end of interaction. > After all you are only interested in the result after the interaction has > ended. > Also remove "ComputerRGB();" on line 75 as this is not needed since this > is called in the thread. > > Addidionally > "#include " > and > "XInitThreads();" > > are not needed at all. > > > ---------- Forwarded message ---------- >> From: Antonio Fortino >> To: vtkusers at vtk.org >> Cc: >> Date: Wed, 28 Dec 2016 17:59:13 +0100 >> Subject: [vtkusers] update,interact and render in different threads >> Hello to everyone, >> >> I'm trying to develop a simple example that update the celldata of a >> polydata in a thread while rendering in the main thread. >> My final goal is to interact with the scene, and pause the updates. >> >> To archive this i'm using a simple mutex and a boolean. >> However it seams that i'm trying to access the render for two different >> threads, and the mutex isn't enough, because when interacting with the >> scene errors like the one below appears, and at random the program stops >> with a segmentation. >> >> vtkOpenGLPolyDataMapper (0x1b62980): failed after UpdateShader 1 OpenGL >> errors detected >> >> 0 : (1282) Invalid operation >> >> >> I attach the code, any help is very appreciated. >> >> Best regards >> Antonio Fortino-- >> > ___________________________________________ > Andrew J. P. Maclean > > ___________________________________________ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.rabotnikov at philips.com Thu Dec 29 00:49:23 2016 From: mark.rabotnikov at philips.com (Rabotnikov, Mark) Date: Thu, 29 Dec 2016 05:49:23 +0000 Subject: [vtkusers] DeepCopy() of vtkPolyData crashes (VTK 7.1, VS 2010 64bit) Message-ID: <18c1edaa545b4419ac05568722f427b7@DBXPR90MB0142.MGDPHG.emi.philips.com> Dear VTK users/developers, I've encountered a crash in vtkPolyData::DeepCopy() with the following code using VTK 7.1 (VS 2010 64 bit compiler on Windows 7): vtkPolyData* mm = vtkPolyData::New(); vtkPolyData* temp = vtkPolyData::New(); temp->DeepCopy(mm); The call stack is attached, the problem is related to copying Verts in vtkPolyData::DeepCopy(): vtkCellArray *ca; ca = vtkCellArray::New(); ca->DeepCopy(polyData->GetVerts()); Thanks a lot, Mark ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: DeepCopyStack.txt URL: From seanharre at gmail.com Thu Dec 29 16:59:49 2016 From: seanharre at gmail.com (sean Harre) Date: Thu, 29 Dec 2016 13:59:49 -0800 Subject: [vtkusers] STLWriter output multiple splines (via vtkTriangleFilter) Message-ID: Hi, I have a simple example to show a problem I need help resolving. I'm very new to VTK and have copied the TubesFromSplines example C++ code to almost what I need, but one issue remains to be solved. The intent is to have a program where I can add multiple splines/tubes and then output the combined form to an STL file. The example program I have attached generates the correct model in the render window, and I get one spline in the output STL. But I would like all programmed splines to be merged and output to the STL file. I need to merge them before calling the STLWriter. This is where I am unclear. The example code shows a working example, and what I thought would work but is failing and marked 'BROKEN', {code} //--------------------------------------- // stlWriter->SetInputConnection(appendFilter->GetOutputPort()); // BROKEN // // ERROR: In /Users/ali/code/VTK-7.1.0/Common/ExecutionModel/vtkDemandDrivenPipeline.cxx, line 810 // vtkCompositeDataPipeline (0x7f987670c630): Input for connection index 0 on input port index 0 for // algorithm vtkSTLWriter(0x7f9876709f40) is of type vtkUnstructuredGrid, but a vtkPolyData is required. stlWriter->SetInputConnection(triangleFilter->GetOutputPort()); // WORKS //--------------------------------------- {/code} I suspect there is something easy I'm missing, and would appreciate any help. I've also attached some screenshots showing how the render window and STL output look. And yes the code is ugly and repeats itself, but I'm just trying to understand the basic concept first then can add a function for adding each spline, etc... Thanks! Sean -- Sean Harre seanharre at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TubesFromSplines.cxx Type: application/octet-stream Size: 8230 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: render_correctly_shows_2_splines.png Type: image/png Size: 81248 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: stl_output_only_one_spline.png Type: image/png Size: 114082 bytes Desc: not available URL: From rccm.kyoshimi at gmail.com Thu Dec 29 20:33:46 2016 From: rccm.kyoshimi at gmail.com (kenichiro yoshimi) Date: Fri, 30 Dec 2016 10:33:46 +0900 Subject: [vtkusers] STLWriter output multiple splines (via vtkTriangleFilter) In-Reply-To: References: Message-ID: Hi Sean, You need to convert an unstructured grid to a polydata which is required by vtkSTLWriter. http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/GeometryFilter Or you can use the vtkAppendPolyData instead of the vtkAppendData. http://www.vtk.org/Wiki/VTK/Examples/Cxx/Filtering/CombinePolyData Thanks, Yoshimi 2016-12-30 6:59 GMT+09:00 sean Harre : > Hi, > > I have a simple example to show a problem I need help resolving. I'm very > new to VTK and have copied the TubesFromSplines example C++ code to almost > what I need, but one issue remains to be solved. > > The intent is to have a program where I can add multiple splines/tubes and > then output the combined form to an STL file. > > The example program I have attached generates the correct model in the > render window, and I get one spline in the output STL. > > But I would like all programmed splines to be merged and output to the STL > file. I need to merge them before calling the STLWriter. This is where I am > unclear. > > The example code shows a working example, and what I thought would work but > is failing and marked 'BROKEN', > > {code} > //--------------------------------------- > // stlWriter->SetInputConnection(appendFilter->GetOutputPort()); // > BROKEN > // > // ERROR: In > /Users/ali/code/VTK-7.1.0/Common/ExecutionModel/vtkDemandDrivenPipeline.cxx, > line 810 > // vtkCompositeDataPipeline (0x7f987670c630): Input for connection index > 0 on input port index 0 for > // algorithm vtkSTLWriter(0x7f9876709f40) is of type > vtkUnstructuredGrid, but a vtkPolyData is required. > > stlWriter->SetInputConnection(triangleFilter->GetOutputPort()); // WORKS > //--------------------------------------- > {/code} > > > I suspect there is something easy I'm missing, and would appreciate any > help. > > I've also attached some screenshots showing how the render window and STL > output look. > > And yes the code is ugly and repeats itself, but I'm just trying to > understand the basic concept first then can add a function for adding each > spline, etc... > > Thanks! > > Sean > > > > -- > Sean Harre > seanharre at gmail.com > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > From seanharre at gmail.com Thu Dec 29 20:47:10 2016 From: seanharre at gmail.com (sean Harre) Date: Thu, 29 Dec 2016 17:47:10 -0800 Subject: [vtkusers] STLWriter output multiple splines (via vtkTriangleFilter) In-Reply-To: References: Message-ID: Hi Yoshimi, That was it! Switching to vtkAppendPolyData and now both are in STL! Thanks for your help, Sean On Thu, Dec 29, 2016 at 5:33 PM, kenichiro yoshimi wrote: > Hi Sean, > > You need to convert an unstructured grid to a polydata which is > required by vtkSTLWriter. > http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/GeometryFilter > Or you can use the vtkAppendPolyData instead of the vtkAppendData. > http://www.vtk.org/Wiki/VTK/Examples/Cxx/Filtering/CombinePolyData > > Thanks, > Yoshimi > > 2016-12-30 6:59 GMT+09:00 sean Harre : > > Hi, > > > > I have a simple example to show a problem I need help resolving. I'm very > > new to VTK and have copied the TubesFromSplines example C++ code to > almost > > what I need, but one issue remains to be solved. > > > > The intent is to have a program where I can add multiple splines/tubes > and > > then output the combined form to an STL file. > > > > The example program I have attached generates the correct model in the > > render window, and I get one spline in the output STL. > > > > But I would like all programmed splines to be merged and output to the > STL > > file. I need to merge them before calling the STLWriter. This is where I > am > > unclear. > > > > The example code shows a working example, and what I thought would work > but > > is failing and marked 'BROKEN', > > > > {code} > > //--------------------------------------- > > // stlWriter->SetInputConnection(appendFilter->GetOutputPort()); // > > BROKEN > > // > > // ERROR: In > > /Users/ali/code/VTK-7.1.0/Common/ExecutionModel/ > vtkDemandDrivenPipeline.cxx, > > line 810 > > // vtkCompositeDataPipeline (0x7f987670c630): Input for connection > index > > 0 on input port index 0 for > > // algorithm vtkSTLWriter(0x7f9876709f40) is of type > > vtkUnstructuredGrid, but a vtkPolyData is required. > > > > stlWriter->SetInputConnection(triangleFilter->GetOutputPort()); // > WORKS > > //--------------------------------------- > > {/code} > > > > > > I suspect there is something easy I'm missing, and would appreciate any > > help. > > > > I've also attached some screenshots showing how the render window and STL > > output look. > > > > And yes the code is ugly and repeats itself, but I'm just trying to > > understand the basic concept first then can add a function for adding > each > > spline, etc... > > > > Thanks! > > > > Sean > > > > > > > > -- > > Sean Harre > > seanharre at gmail.com > > > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Please keep messages on-topic and check the VTK FAQ at: > > http://www.vtk.org/Wiki/VTK_FAQ > > > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/vtkusers > > > -- Sean Harre seanharre at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: