From aborsic at ne-scientific.com Tue Mar 1 02:43:51 2016 From: aborsic at ne-scientific.com (Andrea Borsic) Date: Tue, 1 Mar 2016 08:43:51 +0100 Subject: [vtkusers] VTK + Microsoft HoloLens Message-ID: <56D54837.5010004@ne-scientific.com> Dear All, Does anybody have information about ways of displaying VTK generated graphics on the HoloLens? Best Regards, thanks, Andrea ++++++++++++++++++++++++++++++++++++ Andrea Borsic Ph.D. Founder NE Scientific LLC Tel: +1 603 676 7450 Web:www.ne-scientific.com Twitter:https://twitter.com/ne_scientific From f.nellmeldin at open-engineering.com Tue Mar 1 04:08:59 2016 From: f.nellmeldin at open-engineering.com (Fernando Nellmeldin) Date: Tue, 1 Mar 2016 10:08:59 +0100 Subject: [vtkusers] Show a text for a limited period of time Message-ID: Hello all. I would like to show a text in screen and this text should disappear after a few seconds (3~4). For example, the text should say: "Screenshot saved" and then disappear. For me, doesn't matter if the vtkTextActor gets deleted or its visibility gets turned off. How can this be achieved with VTK? Please note that my VTK window is embedded in a Qt application window. I've done this before with pure OpenGL, but in that case I had access to the "while (true)" loop of the application and I could ask each frame how many seconds have passed. I am completely lost on this subject when using VTK. Thank you! Fernando. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kostadus at yahoo.com Tue Mar 1 05:39:42 2016 From: kostadus at yahoo.com (KMountris) Date: Tue, 1 Mar 2016 03:39:42 -0700 (MST) Subject: [vtkusers] Connecting picked points In-Reply-To: References: Message-ID: <1456828782004-5736948.post@n5.nabble.com> Dear Sahithya, I am trying to pick some points similar to what you have done inside a 2d slice of a 3d image using the image reslice viewer. So far I wasn't successfull. Even though your post is old maybe you are able to provide me some insight. Thank you in advance and I hope I will hear from you soon. Best regards, Konstantinos. -- View this message in context: http://vtk.1045678.n5.nabble.com/Connecting-picked-points-tp5717130p5736948.html Sent from the VTK - Users mailing list archive at Nabble.com. From hgbk2008 at gmail.com Tue Mar 1 09:33:27 2016 From: hgbk2008 at gmail.com (Hoang Giang Bui) Date: Tue, 1 Mar 2016 15:33:27 +0100 Subject: [vtkusers] error loading libvtkRenderingPythonTkWidgets.so In-Reply-To: References: Message-ID: Thanks, that helps a lot. Giang On Mon, Feb 29, 2016 at 2:15 PM, David Gobbi wrote: > Hi Giang, > > The option VTK_Group_Tk:BOOL=ON must be set for Tkinter support. > > - David > > > On Mon, Feb 29, 2016 at 3:12 AM, Hoang Giang Bui > wrote: > >> Hello >> >> I got an error when I tried to run a VTK python example with Tkinter >> enabled >> >> I built VTK6.2.0 with Tcl/Tk 8.6.4 and Python 2.7.6. Executing the example >> python {VTK_DIR}/Examples/Modelling/Python/SpherePuzzle.py >> >> gives the error >> >> Traceback (most recent call last): >> File "SpherePuzzle.py", line 57, in >> rw = vtkTkRenderWindowInteractor(f1, width=400, height=400, rw=renWin) >> File >> "/home/hbui/opt/vtk-6.2.0/lib/python2.7/site-packages/vtk/tk/vtkTkRenderWindowInteractor.py", >> line 48, in __init__ >> vtkLoadPythonTkWidgets(master.tk) >> File >> "/home/hbui/opt/vtk-6.2.0/lib/python2.7/site-packages/vtk/tk/vtkLoadPythonTkWidgets.py", >> line 81, in vtkLoadPythonTkWidgets >> interp.call('load', filename, pkgname) >> _tkinter.TclError: couldn't load file " >> libvtkRenderingPythonTkWidgets-6.2.so": >> libvtkRenderingPythonTkWidgets-6.2.so: cannot open shared object file: >> No such file or directory >> >> The library libvtkRenderingPythonTkWidgets-6.2.so is not installed to >> the target folder. I have checked that this library exist in VTK-5.10.1 but >> somehow it is removed in VTK-6.2.0 >> >> I looked into the vtkLoadPythonTkWidgets.py and I found out that the >> module name is required to load still has the same name >> modname = 'vtkRenderingPythonTkWidgets' >> >> Which means it is not updated or some configure flags need to be set to >> enable libvtkRenderingPythonTkWidgets >> >> Any comments? >> >> Giang >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Tue Mar 1 10:00:42 2016 From: dave.demarle at kitware.com (David E DeMarle) Date: Tue, 1 Mar 2016 10:00:42 -0500 Subject: [vtkusers] [FORGED] Re: Why there is no FindVTK.cmake in CMAKE_MODULE_PATH In-Reply-To: References: <1680170787.275345.1456605872549.JavaMail.yahoo@mail.yahoo.com> Message-ID: Andrew, If you haven't gotten it configured yet, it is probably best if I just walk you through it in a v-con. Send me a google hangout, Skype or FaceTime invitation off off list please. You will need to be able to share your desktop with me. cheers David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Sat, Feb 27, 2016 at 4:30 PM, Gib Bogle wrote: > Hi Andrew, > > I use VTK and cmake on Windows. I have VTK installed thus: > C:\VTK-VS10 > C:\VTK-VS10\bin > C:\VTK-VS10\include > C:\VTK-VS10\lib > and I have set VTK_DIR as an environment variable: > C:\VTK-VS10 > i.e. as the directory under which the bin, include and lib subdirectories > are to be found. > Setting VTK_DIR in CMakeLists.txt in my case would be > SET(VTK_DIR C:/VTK-VS10) > For my money, cmake is the best way to set up the VS project files. > > Cheers, Gib > > ------------------------------ > *From:* vtkusers [vtkusers-bounces at vtk.org] on behalf of cfd new via > vtkusers [vtkusers at vtk.org] > *Sent:* Sunday, 28 February 2016 9:44 a.m. > *To:* Nie, Andrew (MU-Student); David Gobbi > *Cc:* vtkusers at vtk.org > *Subject:* [FORGED] Re: [vtkusers] Why there is no FindVTK.cmake in > CMAKE_MODULE_PATH > > This is what I said. In your vtk build, these files are not there on > Windows. On Linux they are available. > On Windows, you do not need cmake for build the examples. I do not use > cmake in my VS applications either. > > Joe > > > On Saturday, February 27, 2016 12:20 PM, "Nie, Andrew (MU-Student)" < > znhc5 at mail.missouri.edu> wrote: > > > Dear David, > > I set VTK_DIR as you said. But it still cannot work. Please the screenshot > below: > > > > > *Nie, Zhengwei Andrew* > *Ph.D Candidate* > *Mechanical & Aerospace Engineering* > *University of Missouri* > *573-239-6981 <573-239-6981>* > znhc5 at mail.missouri.edu > > > > ------------------------------ > *From:* David Gobbi > *Sent:* Friday, February 26, 2016 21:20 > *To:* Nie, Andrew (MU-Student) > *Cc:* vtkusers at vtk.org > *Subject:* Re: [vtkusers] Why there is no FindVTK.cmake in > CMAKE_MODULE_PATH > > CMake needs VTK_DIR to be set (either as an environment variable, or in > the CMakeCache.txt file). This will allow CMake to find VTKConfig.cmake. > There is no FindVTK.cmake file. > > VTK_DIR=C:/MyVTKProject/VTK-7.0.0/VTK-bin > > Packages that have a XYZConfig.cmake file do not have a FindXYZ.cmake > file. The CMake error message doesn't explain this very well, > unfortunately. > > - David > > On Fri, Feb 26, 2016 at 7:35 PM, Nie, Andrew (MU-Student) < > znhc5 at mail.missouri.edu> wrote: > > Hi there, > > I used CMake 3.5.0 and VS 2013 to build VTK 7.0.0. Why there is no > FindVTK.cmake > in C:\MyVTKProjects\VTK-7.0.0\VTK-bin\lib\cmake\vtk-7.0\Modules. All of > examples of VTK cannot work because no FindVTK.cmake. > > CMake Error at CMakeLists.txt:6 (find_package): > By not providing "FindVTK.cmake" in CMAKE_MODULE_PATH this project has > asked CMake to find a package configuration file provided by "VTK", but > CMake did not find one. > Could not find a package configuration file provided by "VTK" with any of > the following names: > VTKConfig.cmake > vtk-config.cmake > Add the installation prefix of "VTK" to CMAKE_PREFIX_PATH or set > "VTK_DIR" > to a directory containing one of the above files. If "VTK" provides a > separate development package or SDK, be sure it has been installed. > How can I deal with this problem? Really appreciated. > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: pastedImage.png Type: image/png Size: 116204 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: pastedImage.png Type: image/png Size: 87724 bytes Desc: not available URL: From pedrommcs at hotmail.com Tue Mar 1 10:16:12 2016 From: pedrommcs at hotmail.com (pedrommcs) Date: Tue, 1 Mar 2016 08:16:12 -0700 (MST) Subject: [vtkusers] Getting region inside contour Message-ID: <1456845372566-5736952.post@n5.nabble.com> Hi everyone, I'm generating a contour in 2D through vtkContourFilter. (see image attached below) Now I would like to get the region that is inside the contour and save it as vtkImageData or something similar that would result in an image just with the data inside the contour. Everything else would be black, just to have the same dimensions as the slice. (see contour_region.png) I don't know how to get the region inside the contour, is there anyway to do it? This is what I did so far: import vtk reader = vtk.vtkXMLImageDataReader() reader.SetFileName("sample.vti") reader.GetOutput().SetUpdateExtentToWholeExtent() reader.Update() flipYFilter = vtk.vtkImageFlip() flipYFilter.SetFilteredAxis(1) flipYFilter.SetInput(reader.GetOutput()) flipYFilter.Update() image = flipYFilter.GetOutput() extractSlice = vtk.vtkExtractVOI() extractSlice.SetInput(image) extractSlice.SetVOI(image.GetExtent()[0], image.GetExtent()[1], \ image.GetExtent()[2], image.GetExtent()[3], \ 5, 5) extractSlice.SetSampleRate(1, 1, 1) extractSlice.Update() contour = vtk.vtkContourFilter() contour.SetInputConnection(extractSlice.GetOutputPort()) contour.SetValue(1,90) #How to get the region inside the contour? Thanks in advance. -- View this message in context: http://vtk.1045678.n5.nabble.com/Getting-region-inside-contour-tp5736952.html Sent from the VTK - Users mailing list archive at Nabble.com. From guanw at rhpcs.mcmaster.ca Tue Mar 1 09:58:26 2016 From: guanw at rhpcs.mcmaster.ca (Weiguang guan) Date: Tue, 01 Mar 2016 09:58:26 -0500 Subject: [vtkusers] create and delete vtkActor and vtk3DWidget In-Reply-To: References: <1456095130621-5736691.post@n5.nabble.com> <56CF694A.4010101@rhpcs.mcmaster.ca> Message-ID: <56D5AE12.9070506@rhpcs.mcmaster.ca> I actually don't know how to remove widgets (for example vtkBoxWidget) properly. After vtkBoxWidget *boxWidget = vtkBoxWidget::New(); boxWidget->SetInteractor(iren); Shall I do boxWidget->SetInteractor(NULL); boxWidget->UnRegister(iren); boxWidget->Delete(); to remove it? I see boxWidget is still alive because its ReferenceCount is 1 not 0. I don't mind moving up to use vtkSmartPointer if that can solve my problem. Weiguang On 26/02/2016 11:00 AM, Thales Luis Rodrigues Sabino wrote: > The way I'm doing things is just to remove the actors from the renderer. > Since I'm sure my program doesn't hold any other reference, I do trust > that the vtkSmartPointer is doing its job. > > On Thu, Feb 25, 2016 at 5:51 PM, Weiguang guan > > wrote: > > Hello, > > In my program (C++), a user can create/remove an object (cone, > cylinder, ...) or a widget (vtkBoxWidget, ...). What's the right > way of doing so without causing memory leaking or trashing? > > In "Examples/Tutorial/Step6/Cxx/Cone6.cxx", I see the last section > of code doing clean-up at the end as follows: > 170 cone->Delete(); > 171 coneMapper->Delete(); > 172 coneActor->Delete(); > 173 callback->Delete(); > 174 boxWidget->Delete(); > 175 ren1->Delete(); > 176 renWin->Delete(); > 177 iren->Delete(); > 178 style->Delete(); > when it exits. > > Lines 170-172 won't delete coneActor because ren1 still use it 99 > ren1->AddActor( coneActor ). This example works fine as it delete > ren1, renWin, and iren as well at exit point. Shall I do > ren1-RemoveActor(coneActor) in addtion to coneActor->Delete()? I > just want to "undo" the creation as if cone had never been created. > > How about the widget boxWidget? It may be trickier. In addition to > boxWidget->Delete(), do I need to do something like > boxWidget->SetInteractor(NULL); > boxWidget->UnRegister(iren); > ? > > Weiguang > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 > > > > > -- > Thales Luis Rodrigues Sabino > > PhD Student at PGMC-UFJF > Lattes | LinkedIn > | ResearchGate > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjlp at netease.com Tue Mar 1 10:32:57 2016 From: tjlp at netease.com (Liu_tj) Date: Tue, 1 Mar 2016 23:32:57 +0800 (CST) Subject: [vtkusers] vtkRenderWindowInteractor.start() crashes in C# application using Activiz Message-ID: <26af67c6.12.15332cf91e1.Coremail.tjlp@netease.com> Hi, VTK guys, I use Activiz 5.8 Open Source edition to display Axial, Sagittal and Coronal view for DICOM series in WPF application. In the XAML, I add a button and a vtkRenderWindowControl component. And a method ShowImagePlaneWidget() is defined. I just want to click the button then ShowImagePlaneWidget() is called, the DICOM series is loaded and displayed. But it does not work and the application crashes at vtkRenderWindowInteractor.start(). However, the DICOM can be displayed if ShowImagePlaneWidget() is called in the Window_Load event handler. What happens? How to fix it? I am working this issue for some time. Below is my code: private void Window_Loaded(object sender, RoutedEventArgs e) { ShowImagePlaneWidget(); } private void btnLoad_Click(object sender, RoutedEventArgs e) { ShowImagePlaneWidget(); } private void ShowImagePlaneWidget() { vtkImagePlaneWidget m_imagePlaneWidgetX = vtkImagePlaneWidget.New(); vtkImagePlaneWidget m_imagePlaneWidgetY = vtkImagePlaneWidget.New(); vtkImagePlaneWidget m_imagePlaneWidgetZ = vtkImagePlaneWidget.New(); vtkRenderWindowInteractor m_interactor = vtkRenderWindowInteractor.New(); vtkRenderWindow aRenderWindow = renderctrl.RenderWindow; vtkDICOMImageReader reader = vtkDICOMImageReader.New(); reader.SetDirectoryName(@"C:\Personal\code\ReadDICOMSeries\build\Debug\IMG\Dental_Lossy_Compressed"); reader.Update(); int[] dims = new int[3]; dims = reader.GetOutput().GetDimensions(); vtkImageCast readerImageCast = vtkImageCast.New(); readerImageCast.SetInput((vtkDataObject)reader.GetOutput()); //readerImageCast.SetOutputScalarTypeToUnsignedChar(); readerImageCast.ClampOverflowOn(); readerImageCast.Update(); m_interactor.SetRenderWindow(aRenderWindow); vtkRenderer renderer = aRenderWindow.GetRenderers().GetFirstRenderer(); vtkCellPicker picker = vtkCellPicker.New(); picker.SetTolerance(0.005); //m_imagePlaneWidgetX.DebugOn(); m_imagePlaneWidgetX.SetDefaultRenderer(renderer); PrepareImagePlaneWidget(m_imagePlaneWidgetX, readerImageCast.GetOutput(), m_interactor, picker, dims, Direction.CORONAL); vtkRenderWindowInteractor tmpint = m_imagePlaneWidgetX.GetInteractor(); PrepareImagePlaneWidget(m_imagePlaneWidgetY, readerImageCast.GetOutput(), m_interactor, picker, dims, Direction.SAGITTAL); PrepareImagePlaneWidget(m_imagePlaneWidgetZ, readerImageCast.GetOutput(), m_interactor, picker, dims, Direction.AXIAL); m_interactor.Initialize(); m_interactor.Start(); aRenderWindow.Render(); return; } private void PrepareImagePlaneWidget(vtkImagePlaneWidget planeWidget, vtkImageData data, vtkRenderWindowInteractor interactor, vtkCellPicker picker, int[] dimensions, Direction direction) { planeWidget.SetInteractor(interactor); planeWidget.SetPicker(picker); planeWidget.RestrictPlaneToVolumeOn(); planeWidget.DisplayTextOn(); planeWidget.TextureInterpolateOff(); planeWidget.SetResliceInterpolateToLinear(); planeWidget.SetInput(data); switch (direction) { case Direction.AXIAL: planeWidget.SetKeyPressActivationValue((sbyte)'z'); planeWidget.SetPlaneOrientationToZAxes(); planeWidget.GetPlaneProperty().SetColor(0.0, 0.0, 1.0); break; case Direction.CORONAL: planeWidget.SetKeyPressActivationValue((sbyte)'x'); planeWidget.SetPlaneOrientationToXAxes(); planeWidget.GetPlaneProperty().SetColor(1.0, 0.0, 0.0); break; case Direction.SAGITTAL: planeWidget.SetKeyPressActivationValue((sbyte)'y'); planeWidget.SetPlaneOrientationToYAxes(); planeWidget.GetPlaneProperty().SetColor(0.0, 1.0, 0.0); break; } planeWidget.SetSliceIndex(dimensions[(int)direction] / 2); planeWidget.GetTexturePlaneProperty().SetOpacity(1); planeWidget.On(); planeWidget.InteractionOn(); } Thanks Liu Peng -------------- next part -------------- An HTML attachment was scrubbed... URL: From DLRdave at aol.com Tue Mar 1 10:59:41 2016 From: DLRdave at aol.com (David Cole) Date: Tue, 1 Mar 2016 10:59:41 -0500 Subject: [vtkusers] vtkRenderWindowInteractor.start() crashes in C# application using Activiz In-Reply-To: <26af67c6.12.15332cf91e1.Coremail.tjlp@netease.com> References: <26af67c6.12.15332cf91e1.Coremail.tjlp@netease.com> Message-ID: When using ActiViz .NET, you typically don't need to create your own interactor object. The render window control contains a RenderWindow, an Interactor and an InteractorStyle that are all connected to each other by default. Interactor.Start starts a windows event loop, and is used by standalone programs not using a UI framework. When you're using a UI framework, you don't need to call it. Just remove your instantiation of the interactor, and do not call Start. If you are using a Windows Forms application to display your render window control, just show the form, and let the Windows Forms framework handle your event loop. HTH, David C. On Tue, Mar 1, 2016 at 10:32 AM, Liu_tj wrote: > Hi, VTK guys, > > I use Activiz 5.8 Open Source edition to display Axial, Sagittal and Coronal > view for DICOM series in WPF application. In the XAML, I add a button and a > vtkRenderWindowControl component. And a method ShowImagePlaneWidget() is > defined. I just want to click the button then ShowImagePlaneWidget() is > called, the DICOM series is loaded and displayed. But it does not work and > the application crashes at vtkRenderWindowInteractor.start(). > > However, the DICOM can be displayed if ShowImagePlaneWidget() is called in > the Window_Load event handler. > > What happens? How to fix it? I am working this issue for some time. > > Below is my code: > > private void Window_Loaded(object sender, RoutedEventArgs e) > { > ShowImagePlaneWidget(); > } > > private void btnLoad_Click(object sender, RoutedEventArgs e) > { > ShowImagePlaneWidget(); > } > private void ShowImagePlaneWidget() > { > vtkImagePlaneWidget m_imagePlaneWidgetX = > vtkImagePlaneWidget.New(); > vtkImagePlaneWidget m_imagePlaneWidgetY = > vtkImagePlaneWidget.New(); > vtkImagePlaneWidget m_imagePlaneWidgetZ = > vtkImagePlaneWidget.New(); > vtkRenderWindowInteractor m_interactor = > vtkRenderWindowInteractor.New(); > > vtkRenderWindow aRenderWindow = renderctrl.RenderWindow; > > vtkDICOMImageReader reader = vtkDICOMImageReader.New(); > > reader.SetDirectoryName(@"C:\Personal\code\ReadDICOMSeries\build\Debug\IMG\Dental_Lossy_Compressed"); > reader.Update(); > > int[] dims = new int[3]; > dims = reader.GetOutput().GetDimensions(); > > vtkImageCast readerImageCast = vtkImageCast.New(); > readerImageCast.SetInput((vtkDataObject)reader.GetOutput()); > //readerImageCast.SetOutputScalarTypeToUnsignedChar(); > readerImageCast.ClampOverflowOn(); > readerImageCast.Update(); > > m_interactor.SetRenderWindow(aRenderWindow); > vtkRenderer renderer = > aRenderWindow.GetRenderers().GetFirstRenderer(); > > vtkCellPicker picker = vtkCellPicker.New(); > picker.SetTolerance(0.005); > //m_imagePlaneWidgetX.DebugOn(); > m_imagePlaneWidgetX.SetDefaultRenderer(renderer); > PrepareImagePlaneWidget(m_imagePlaneWidgetX, > readerImageCast.GetOutput(), m_interactor, picker, dims, Direction.CORONAL); > vtkRenderWindowInteractor tmpint = > m_imagePlaneWidgetX.GetInteractor(); > PrepareImagePlaneWidget(m_imagePlaneWidgetY, > readerImageCast.GetOutput(), m_interactor, picker, dims, > Direction.SAGITTAL); > PrepareImagePlaneWidget(m_imagePlaneWidgetZ, > readerImageCast.GetOutput(), m_interactor, picker, dims, Direction.AXIAL); > > m_interactor.Initialize(); > m_interactor.Start(); > aRenderWindow.Render(); > return; > } > > private void PrepareImagePlaneWidget(vtkImagePlaneWidget > planeWidget, vtkImageData data, vtkRenderWindowInteractor interactor, > vtkCellPicker picker, int[] dimensions, Direction direction) > { > planeWidget.SetInteractor(interactor); > > planeWidget.SetPicker(picker); > planeWidget.RestrictPlaneToVolumeOn(); > > planeWidget.DisplayTextOn(); > planeWidget.TextureInterpolateOff(); > planeWidget.SetResliceInterpolateToLinear(); > > planeWidget.SetInput(data); > > switch (direction) > { > case Direction.AXIAL: > planeWidget.SetKeyPressActivationValue((sbyte)'z'); > planeWidget.SetPlaneOrientationToZAxes(); > planeWidget.GetPlaneProperty().SetColor(0.0, 0.0, 1.0); > break; > case Direction.CORONAL: > planeWidget.SetKeyPressActivationValue((sbyte)'x'); > planeWidget.SetPlaneOrientationToXAxes(); > planeWidget.GetPlaneProperty().SetColor(1.0, 0.0, 0.0); > break; > case Direction.SAGITTAL: > planeWidget.SetKeyPressActivationValue((sbyte)'y'); > planeWidget.SetPlaneOrientationToYAxes(); > planeWidget.GetPlaneProperty().SetColor(0.0, 1.0, 0.0); > break; > } > planeWidget.SetSliceIndex(dimensions[(int)direction] / 2); > planeWidget.GetTexturePlaneProperty().SetOpacity(1); > > > planeWidget.On(); > planeWidget.InteractionOn(); > } > > Thanks > Liu Peng > > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 tjlp at netease.com Tue Mar 1 20:52:52 2016 From: tjlp at netease.com (Liu_tj) Date: Wed, 2 Mar 2016 09:52:52 +0800 (CST) Subject: [vtkusers] vtkRenderWindowInteractor.start() crashes in C# application using Activiz In-Reply-To: References: <26af67c6.12.15332cf91e1.Coremail.tjlp@netease.com> Message-ID: <4aac7f70.3.15335071ed5.Coremail.tjlp@netease.com> Hi, David, Thanks. You are right. After I remove the instantiation of the interactor, the code works. So, if the render window control contains Interactor and InteractorStyle, what kind of Interactor and interactorStyle it uses? Can we specify them by ourself if the default Interactor and InteractorStyle can't meet our requirement? Thanks Liu Peng ?2016-03-01?"David Cole" ??? -----????----- ???:"David Cole" ????:2016?03?1? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: [vtkusers] vtkRenderWindowInteractor.start() crashes in C# application using Activiz When using ActiViz .NET, you typically don't need to create your own interactor object. The render window control contains a RenderWindow, an Interactor and an InteractorStyle that are all connected to each other by default. Interactor.Start starts a windows event loop, and is used by standalone programs not using a UI framework. When you're using a UI framework, you don't need to call it. Just remove your instantiation of the interactor, and do not call Start. If you are using a Windows Forms application to display your render window control, just show the form, and let the Windows Forms framework handle your event loop. HTH, David C. On Tue, Mar 1, 2016 at 10:32 AM, Liu_tj wrote: > Hi, VTK guys, > > I use Activiz 5.8 Open Source edition to display Axial, Sagittal and Coronal > view for DICOM series in WPF application. In the XAML, I add a button and a > vtkRenderWindowControl component. And a method ShowImagePlaneWidget() is > defined. I just want to click the button then ShowImagePlaneWidget() is > called, the DICOM series is loaded and displayed. But it does not work and > the application crashes at vtkRenderWindowInteractor.start(). > > However, the DICOM can be displayed if ShowImagePlaneWidget() is called in > the Window_Load event handler. > > What happens? How to fix it? I am working this issue for some time. > > Below is my code: > > private void Window_Loaded(object sender, RoutedEventArgs e) > { > ShowImagePlaneWidget(); > } > > private void btnLoad_Click(object sender, RoutedEventArgs e) > { > ShowImagePlaneWidget(); > } > private void ShowImagePlaneWidget() > { > vtkImagePlaneWidget m_imagePlaneWidgetX = > vtkImagePlaneWidget.New(); > vtkImagePlaneWidget m_imagePlaneWidgetY = > vtkImagePlaneWidget.New(); > vtkImagePlaneWidget m_imagePlaneWidgetZ = > vtkImagePlaneWidget.New(); > vtkRenderWindowInteractor m_interactor = > vtkRenderWindowInteractor.New(); > > vtkRenderWindow aRenderWindow = renderctrl.RenderWindow; > > vtkDICOMImageReader reader = vtkDICOMImageReader.New(); > > reader.SetDirectoryName(@"C:\Personal\code\ReadDICOMSeries\build\Debug\IMG\Dental_Lossy_Compressed"); > reader.Update(); > > int[] dims = new int[3]; > dims = reader.GetOutput().GetDimensions(); > > vtkImageCast readerImageCast = vtkImageCast.New(); > readerImageCast.SetInput((vtkDataObject)reader.GetOutput()); > //readerImageCast.SetOutputScalarTypeToUnsignedChar(); > readerImageCast.ClampOverflowOn(); > readerImageCast.Update(); > > m_interactor.SetRenderWindow(aRenderWindow); > vtkRenderer renderer = > aRenderWindow.GetRenderers().GetFirstRenderer(); > > vtkCellPicker picker = vtkCellPicker.New(); > picker.SetTolerance(0.005); > //m_imagePlaneWidgetX.DebugOn(); > m_imagePlaneWidgetX.SetDefaultRenderer(renderer); > PrepareImagePlaneWidget(m_imagePlaneWidgetX, > readerImageCast.GetOutput(), m_interactor, picker, dims, Direction.CORONAL); > vtkRenderWindowInteractor tmpint = > m_imagePlaneWidgetX.GetInteractor(); > PrepareImagePlaneWidget(m_imagePlaneWidgetY, > readerImageCast.GetOutput(), m_interactor, picker, dims, > Direction.SAGITTAL); > PrepareImagePlaneWidget(m_imagePlaneWidgetZ, > readerImageCast.GetOutput(), m_interactor, picker, dims, Direction.AXIAL); > > m_interactor.Initialize(); > m_interactor.Start(); > aRenderWindow.Render(); > return; > } > > private void PrepareImagePlaneWidget(vtkImagePlaneWidget > planeWidget, vtkImageData data, vtkRenderWindowInteractor interactor, > vtkCellPicker picker, int[] dimensions, Direction direction) > { > planeWidget.SetInteractor(interactor); > > planeWidget.SetPicker(picker); > planeWidget.RestrictPlaneToVolumeOn(); > > planeWidget.DisplayTextOn(); > planeWidget.TextureInterpolateOff(); > planeWidget.SetResliceInterpolateToLinear(); > > planeWidget.SetInput(data); > > switch (direction) > { > case Direction.AXIAL: > planeWidget.SetKeyPressActivationValue((sbyte)'z'); > planeWidget.SetPlaneOrientationToZAxes(); > planeWidget.GetPlaneProperty().SetColor(0.0, 0.0, 1.0); > break; > case Direction.CORONAL: > planeWidget.SetKeyPressActivationValue((sbyte)'x'); > planeWidget.SetPlaneOrientationToXAxes(); > planeWidget.GetPlaneProperty().SetColor(1.0, 0.0, 0.0); > break; > case Direction.SAGITTAL: > planeWidget.SetKeyPressActivationValue((sbyte)'y'); > planeWidget.SetPlaneOrientationToYAxes(); > planeWidget.GetPlaneProperty().SetColor(0.0, 1.0, 0.0); > break; > } > planeWidget.SetSliceIndex(dimensions[(int)direction] / 2); > planeWidget.GetTexturePlaneProperty().SetOpacity(1); > > > planeWidget.On(); > planeWidget.InteractionOn(); > } > > Thanks > Liu Peng > > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 yihui.cao at qq.com Wed Mar 2 02:07:46 2016 From: yihui.cao at qq.com (=?ISO-8859-1?B?WWlodWkgQ2Fv?=) Date: Wed, 2 Mar 2016 15:07:46 +0800 Subject: [vtkusers] SetResliceMode of vtkResliceImageViewer, the brightness or somewhat changed automatically Message-ID: Dear all, When I change the reslice mode by setting the "SetResliceMode of vtkResliceImageViewer" to 0 and 1, the brightness (or somewhat) of the image changed automatically. At first, I guess it may be for the change of Color Window or Color Level. But I checked, it not this reason. Does anyone know what the reason for this appearance different? Thanks Yihui Cao -------------- next part -------------- An HTML attachment was scrubbed... URL: From dhoppes at mbfbioscience.com Wed Mar 2 10:29:14 2016 From: dhoppes at mbfbioscience.com (Doug Hoppes) Date: Wed, 2 Mar 2016 15:29:14 +0000 Subject: [vtkusers] SetScalar() removes my color scalars Message-ID: <46CB11F12B9DC24D860D4082451B318A36B375CF@exchange3.microbrightfield.com> Hey all, I have a glyph3D where I'm trying to control the size of the points and the colors of the points. To do this, I have: vtkSmartPointer colors = vtkSmartPointer::New(); colors->SetName("colors"); vtkSmartPointer colors = vtkSmartPointer::New(); colors->SetName("diameters"); I find that, SetScalars(), will remove one array. So, I can either have a specified color set of glyphs OR specified size of the glyphs. Is there a way that I can have both of them at the same time? Doug -------------- next part -------------- An HTML attachment was scrubbed... URL: From o.hardenberggern at web.de Wed Mar 2 11:29:15 2016 From: o.hardenberggern at web.de (o.hardenberggern at web.de) Date: Wed, 2 Mar 2016 17:29:15 +0100 Subject: [vtkusers] Visualize a vector field Message-ID: An HTML attachment was scrubbed... URL: From newcfd at yahoo.com Wed Mar 2 12:19:50 2016 From: newcfd at yahoo.com (newcfd) Date: Wed, 2 Mar 2016 10:19:50 -0700 (MST) Subject: [vtkusers] Color becomes dark when an object is rotated Message-ID: <1456939190389-5736973.post@n5.nabble.com> The color becomes dark when an object is rotated. I would like to keep the same color when an object is rotated. I tried renderer->TwoSidedLightingOn () and renderer->LightFollowCameraOn() both did not work. How can I make changes for this. Thanks for your help -- View this message in context: http://vtk.1045678.n5.nabble.com/Color-becomes-dark-when-an-object-is-rotated-tp5736973.html Sent from the VTK - Users mailing list archive at Nabble.com. From jcplatt at dsl.pipex.com Wed Mar 2 13:17:30 2016 From: jcplatt at dsl.pipex.com (John Platt) Date: Wed, 2 Mar 2016 18:17:30 +0000 Subject: [vtkusers] Color becomes dark when an object is rotated In-Reply-To: <1456939190389-5736973.post@n5.nabble.com> References: <1456939190389-5736973.post@n5.nabble.com> Message-ID: <56D72E3A.9050304@dsl.pipex.com> Hi, Have you tried setting the diffuse & specular coefficients of the actor property to zero? vtkProperty* actorPrpty(myActor->GetProperty()); actorPrpty->SetAmbient( 1.0 ); actorPrpty->SetDiffuse( 0.0 ); actorPrpty->SetSpecular( 0.0 ); John. On 02/03/2016 17:19, newcfd via vtkusers wrote: > The color becomes dark when an object is rotated. I would like to keep the > same color when an object is rotated. > I tried > renderer->TwoSidedLightingOn () > and > renderer->LightFollowCameraOn() > > both did not work. How can I make changes for this. Thanks for your help > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/Color-becomes-dark-when-an-object-is-rotated-tp5736973.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 newcfd at yahoo.com Wed Mar 2 15:09:56 2016 From: newcfd at yahoo.com (newcfd) Date: Wed, 2 Mar 2016 13:09:56 -0700 (MST) Subject: [vtkusers] Color becomes dark when an object is rotated In-Reply-To: <56D72E3A.9050304@dsl.pipex.com> References: <1456939190389-5736973.post@n5.nabble.com> <56D72E3A.9050304@dsl.pipex.com> Message-ID: <1456949396284-5736977.post@n5.nabble.com> Hi, John, thanks a lot. I tried your settings and did not see any change. vtkPolyDataAlgorithm * pOutlineFilter( NULL ); pOutlineFilter = vtkOutlineFilter::New(); pOutlineFilter->SetInputData( m_DataObject ); // map it to graphics primitives vtkCompositePolyDataMapper * pOutlineMapper = vtkCompositePolyDataMapper::New(); pOutlineMapper->SetInputConnection(pOutlineFilter->GetOutputPort()); pOutlineMapper->ImmediateModeRenderingOn(); pOutlineMapper->ReleaseDataFlagOn(); pOutlineMapper->Update(); // create an actor for it m_pOutlineActor = vtkActor::New(); m_pOutlineActor->GetProperty()->SetColor(1,1,1); m_pOutlineActor->GetProperty()->SetRepresentationToWireframe(); m_pOutlineActor->SetMapper(pOutlineMapper); m_pOutlineActor->GetProperty()->SetAmbient( 1.0 ); m_pOutlineActor->GetProperty()->SetDiffuse( 0.0 ); m_pOutlineActor->GetProperty()->SetSpecular( 0.0 ); m_pRenderer->AddActor(m_pOutlineActor); m_pRenderer->Render(); Joe -- View this message in context: http://vtk.1045678.n5.nabble.com/Color-becomes-dark-when-an-object-is-rotated-90-degree-along-y-axis-tp5736973p5736977.html Sent from the VTK - Users mailing list archive at Nabble.com. From aashish.chaudhary at kitware.com Wed Mar 2 15:16:45 2016 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Wed, 2 Mar 2016 15:16:45 -0500 Subject: [vtkusers] Requirements for multiple volumes in one render window In-Reply-To: References: Message-ID: Elvis, thanks for the detailed information. I thought about a way of doing this. Basically, I think the mapper has to take multiple inputs and if multiple inputs are present, then we will construct a BBox around it and used that for traversing. Now, internally, we would have to transform the data position to each volume so that we can perform the lookup and set some rules on how to perform compositing (replace, modulate etc.). I will talk to the team here and will add in our todo but we would have check on the priority of it. If you want to help us with this then I am more happy to guide you with the process. It won't be very difficult but will require some careful changes to the existing mapper. Thanks, On Mon, Feb 29, 2016 at 11:46 AM, Elvis Stansvik wrote: > 2016-02-29 16:32 GMT+01:00 Aashish Chaudhary > : >> >> Hi Elvis, >> >> On Sat, Feb 27, 2016 at 12:06 PM, Elvis Stansvik >> wrote: >> > 2016-02-25 17:10 GMT+01:00 Elvis Stansvik >> > : >> >> >> >> Hi, >> >> >> >> From searching around, I think I've gathered that to render multiple >> >> volumes in a single window, each volume must have its own mapper and >> >> volume >> >> property. They can't share mapper or property. >> >> >> >> My question is whether I must use separate renderers for each volume as >> >> well, or if I can use the same renderer for them all? >> >> >> >> Also, I did read something in an old post about problems with rendering >> >> multiple volumes that intersect (share a voxel). Is this still a >> >> problem? >> >> I'm using VTK 6.2 and the vtkVolumeRayCastMapper. >> >> >> >> Thanks in advance! >> > >> > >> > Including Donny's answer here, to keep the thread intact: >> > >> >> See this thread: >> >> >> >> >> >> >> >> http://vtk.1045678.n5.nabble.com/Rendering-multiple-volumes-td5734685.html#a5734971 >> > >> > Thanks, that clears some things up, and brings up some workarounds. That >> > thread was from oct/nov last year, so I guess it is still the case that >> > proper rendering of multiple volumes that share voxels in 3D space is >> > not >> > possible? (even with 7.0?). >> >> It depends what you define proper. If you have two volumes and they >> share the exact same space, you can combine them into one volume. When >> they share the same space but do not overlap that's when things get >> tricky since then the outcome depends on how do you want to handle >> this disparity. There could be some other ways such as you combine the >> volume into one. At the rendering level it could get tricky. >> >> What exactly you are trying to do. > > > I see, what I would expect I think is composite rendering of the voxels > using some composite rendering function / blending mode (perhaps > configurable?). > > Sorry if my use case wasn't clear, I'm attaching a rough sketch I did just > now which should explain it better. > > Each of our volumes is a piece of a drill core (see my photo previously in > this thread). The pieces were scanned stacked on top of each other in a > plastic tube inside our machine. During scanning, they are not necessarily > aligned properly (as shown in the sketch, and also in the photo). > > We will do some algorithmic alignment of the volumes, but we must also allow > the user to override / supplement the automatic alignment when it fails. > This means the user should be able to rotate and move (along Z axis) the > pieces until they align. It's like a pussle with pieces of a drill core :) > > While the user is doing this, the volumes may intersect (noone is perfect on > the first try). This is why I'm asking about rendering multiple volumes that > partially intersect in 3D space. > > It's very desirable that the user can see inside the volumes while doing > this manual alignment, since the features (cracks, density variations, ...) > inside the rocks may be what guides the user in aligning the pieces > properly. That's why I don't like the idea of letting the user work with > extracted isosurfaces or similar instead. > > Hope this clears things up a little! > > Elvis > >> >> - Aashish >> >> > >> > Elvis >> > >> >> >> >> Elvis >> > >> > >> > >> > _______________________________________________ >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at >> > http://www.kitware.com/opensource/opensource.html >> > >> > Please keep messages on-topic and check the VTK FAQ at: >> > http://www.vtk.org/Wiki/VTK_FAQ >> > >> > Search the list archives at: http://markmail.org/search/?q=vtkusers >> > >> > Follow this link to subscribe/unsubscribe: >> > http://public.kitware.com/mailman/listinfo/vtkusers >> > >> >> >> >> -- >> | Aashish Chaudhary >> | Technical Leader >> | Kitware Inc. >> | http://www.kitware.com/company/team/chaudhary.html > > -- | Aashish Chaudhary | Technical Leader | Kitware Inc. | http://www.kitware.com/company/team/chaudhary.html From tjlp at netease.com Wed Mar 2 20:02:39 2016 From: tjlp at netease.com (Liu_tj) Date: Thu, 3 Mar 2016 09:02:39 +0800 (CST) Subject: [vtkusers] Does VTK support editing image? Message-ID: <542cbbb5.1.15339ff8255.Coremail.tjlp@netease.com> Hi, I load DICOM series and display it on vtkRenderWindow. Now I want to do some minor editing on the image, just like using paintbrush to draw some points or line on it. Does VTK provide such function? Thanks Liu Peng -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Wed Mar 2 21:09:16 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 2 Mar 2016 19:09:16 -0700 Subject: [vtkusers] Does VTK support editing image? In-Reply-To: <542cbbb5.1.15339ff8255.Coremail.tjlp@netease.com> References: <542cbbb5.1.15339ff8255.Coremail.tjlp@netease.com> Message-ID: No, VTK does not provide any image editing tools. (Not that I'm aware of, at least). - David On Wed, Mar 2, 2016 at 6:02 PM, Liu_tj wrote: > Hi, > > I load DICOM series and display it on vtkRenderWindow. Now I want to do > some minor editing on the image, just like using paintbrush to draw some > points or line on it. Does VTK provide such function? > > Thanks > Liu Peng > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjlp at netease.com Wed Mar 2 22:00:54 2016 From: tjlp at netease.com (Liu_tj) Date: Thu, 3 Mar 2016 11:00:54 +0800 (CST) Subject: [vtkusers] vtkRenderWindowInteractor.start() crashes in C# application using Activiz In-Reply-To: References: <26af67c6.12.15332cf91e1.Coremail.tjlp@netease.com> <4aac7f70.3.15335071ed5.Coremail.tjlp@netease.com> Message-ID: <6c47c227.b.1533a6bc473.Coremail.tjlp@netease.com> Hi,David, Before I call SetInteractor() or SetInteractorStyle(), do I need to explicitly call some specific functions to release the current interactor or interactorStyle? Or just let .NET framework to GC it automatically. Thanks Liu Peng ?2016-03-02?"David Cole" ??? -----????----- ???:"David Cole" ????:2016?03?2? ??? ???:"Liu_tj" ??:Re: Re: [vtkusers] vtkRenderWindowInteractor.start() crashes in C# application using Activiz Sure. If you want to use your own interactor, just instantiate it and call SetInteractor on the render window. And if you want your own style, instantiate it and call SetInteractorStyle. ActiViz is really just a thin C# wrapper around VTK, so all the usual VTK stuff applies. HTH, David C. On Tue, Mar 1, 2016 at 8:52 PM, Liu_tj wrote: > Hi, David, > > Thanks. You are right. After I remove the instantiation of the interactor, > the code works. > > So, if the render window control contains Interactor and InteractorStyle, > what kind of Interactor and interactorStyle it uses? Can we specify them by > ourself if the default Interactor and InteractorStyle can't meet our > requirement? > > Thanks > Liu Peng > > ?2016-03-01?"David Cole" ??? > > -----????----- > ???:"David Cole" > ????:2016?03?1? ??? > ???:"Liu_tj" > ??:"vtkusers" > ??:Re: [vtkusers] vtkRenderWindowInteractor.start() crashes in C# > application using Activiz > > When using ActiViz .NET, you typically don't need to create your own > interactor object. The render window control contains a RenderWindow, > an Interactor and an InteractorStyle that are all connected to each > other by default. Interactor.Start starts a windows event loop, and is > used by standalone programs not using a UI framework. When you're > using a UI framework, you don't need to call it. > > Just remove your instantiation of the interactor, and do not call > Start. If you are using a Windows Forms application to display your > render window control, just show the form, and let the Windows Forms > framework handle your event loop. > > > HTH, > David C. > > > On Tue, Mar 1, 2016 at 10:32 AM, Liu_tj wrote: >> Hi, VTK guys, >> >> I use Activiz 5.8 Open Source edition to display Axial, Sagittal and >> Coronal >> view for DICOM series in WPF application. In the XAML, I add a button and >> a >> vtkRenderWindowControl component. And a method ShowImagePlaneWidget() is >> defined. I just want to click the button then ShowImagePlaneWidget() is >> called, the DICOM series is loaded and displayed. But it does not work and >> the application crashes at vtkRenderWindowInteractor.start(). >> >> However, the DICOM can be displayed if ShowImagePlaneWidget() is called in >> the Window_Load event handler. >> >> What happens? How to fix it? I am working this issue for some time. >> >> Below is my code: >> >> private void Window_Loaded(object sender, RoutedEventArgs e) >> { >> ShowImagePlaneWidget(); >> } >> >> private void btnLoad_Click(object sender, RoutedEventArgs e) >> { >> ShowImagePlaneWidget(); >> } >> private void ShowImagePlaneWidget() >> { >> vtkImagePlaneWidget m_imagePlaneWidgetX = >> vtkImagePlaneWidget.New(); >> vtkImagePlaneWidget m_imagePlaneWidgetY = >> vtkImagePlaneWidget.New(); >> vtkImagePlaneWidget m_imagePlaneWidgetZ = >> vtkImagePlaneWidget.New(); >> vtkRenderWindowInteractor m_interactor = >> vtkRenderWindowInteractor.New(); >> >> vtkRenderWindow aRenderWindow = renderctrl.RenderWindow; >> >> vtkDICOMImageReader reader = vtkDICOMImageReader.New(); >> >> >> reader.SetDirectoryName(@"C:\Personal\code\ReadDICOMSeries\build\Debug\IMG\Dental_Lossy_Compressed"); >> reader.Update(); >> >> int[] dims = new int[3]; >> dims = reader.GetOutput().GetDimensions(); >> >> vtkImageCast readerImageCast = vtkImageCast.New(); >> readerImageCast.SetInput((vtkDataObject)reader.GetOutput()); >> //readerImageCast.SetOutputScalarTypeToUnsignedChar(); >> readerImageCast.ClampOverflowOn(); >> readerImageCast.Update(); >> >> m_interactor.SetRenderWindow(aRenderWindow); >> vtkRenderer renderer = >> aRenderWindow.GetRenderers().GetFirstRenderer(); >> >> vtkCellPicker picker = vtkCellPicker.New(); >> picker.SetTolerance(0.005); >> //m_imagePlaneWidgetX.DebugOn(); >> m_imagePlaneWidgetX.SetDefaultRenderer(renderer); >> PrepareImagePlaneWidget(m_imagePlaneWidgetX, >> readerImageCast.GetOutput(), m_interactor, picker, dims, >> Direction.CORONAL); >> vtkRenderWindowInteractor tmpint = >> m_imagePlaneWidgetX.GetInteractor(); >> PrepareImagePlaneWidget(m_imagePlaneWidgetY, >> readerImageCast.GetOutput(), m_interactor, picker, dims, >> Direction.SAGITTAL); >> PrepareImagePlaneWidget(m_imagePlaneWidgetZ, >> readerImageCast.GetOutput(), m_interactor, picker, dims, Direction.AXIAL); >> >> m_interactor.Initialize(); >> m_interactor.Start(); >> aRenderWindow.Render(); >> return; >> } >> >> private void PrepareImagePlaneWidget(vtkImagePlaneWidget >> planeWidget, vtkImageData data, vtkRenderWindowInteractor interactor, >> vtkCellPicker picker, int[] dimensions, Direction direction) >> { >> planeWidget.SetInteractor(interactor); >> >> planeWidget.SetPicker(picker); >> planeWidget.RestrictPlaneToVolumeOn(); >> >> planeWidget.DisplayTextOn(); >> planeWidget.TextureInterpolateOff(); >> planeWidget.SetResliceInterpolateToLinear(); >> >> planeWidget.SetInput(data); >> >> switch (direction) >> { >> case Direction.AXIAL: >> planeWidget.SetKeyPressActivationValue((sbyte)'z'); >> planeWidget.SetPlaneOrientationToZAxes(); >> planeWidget.GetPlaneProperty().SetColor(0.0, 0.0, >> 1.0); >> break; >> case Direction.CORONAL: >> planeWidget.SetKeyPressActivationValue((sbyte)'x'); >> planeWidget.SetPlaneOrientationToXAxes(); >> planeWidget.GetPlaneProperty().SetColor(1.0, 0.0, >> 0.0); >> break; >> case Direction.SAGITTAL: >> planeWidget.SetKeyPressActivationValue((sbyte)'y'); >> planeWidget.SetPlaneOrientationToYAxes(); >> planeWidget.GetPlaneProperty().SetColor(0.0, 1.0, >> 0.0); >> break; >> } >> planeWidget.SetSliceIndex(dimensions[(int)direction] / 2); >> planeWidget.GetTexturePlaneProperty().SetOpacity(1); >> >> >> planeWidget.On(); >> planeWidget.InteractionOn(); >> } >> >> Thanks >> Liu Peng >> >> >> >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> 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 emredeniz18 at hotmail.com Thu Mar 3 05:42:20 2016 From: emredeniz18 at hotmail.com (emredeniz) Date: Thu, 3 Mar 2016 03:42:20 -0700 (MST) Subject: [vtkusers] vmtk-vtk first tutorial Message-ID: <1457001740368-5736990.post@n5.nabble.com> Hi all, ? downloaded vmtk and python2.7 and installed them, also I use vtk 6.0 How can I combine vtk and vmtk and display dicom images with vmtk and vtk Any ideas? Thanks. -- View this message in context: http://vtk.1045678.n5.nabble.com/vmtk-vtk-first-tutorial-tp5736990.html Sent from the VTK - Users mailing list archive at Nabble.com. From bruno.manata.oliveira at gmail.com Thu Mar 3 07:08:59 2016 From: bruno.manata.oliveira at gmail.com (Bruno Oliveira) Date: Thu, 3 Mar 2016 12:08:59 +0000 Subject: [vtkusers] Read ply point cloud? Message-ID: Hello, is it not possible to import a PLY point cloud file into VTK? -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Thu Mar 3 07:51:15 2016 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Thu, 3 Mar 2016 13:51:15 +0100 Subject: [vtkusers] Reader plugin API in VolView? Message-ID: Hi all, Sorry if this is off-topic, and I know VolView is probably not really actively developed nowadays, but does anyone know if VolView has a plugin API for file format readers, like ParaView has? I know there's a plugin API for filters, but I couldn't find any info on writing custom readers. Is there anywhere I can browse the VolVIew code without having to download the tarball? Thanks, Elvis -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Thu Mar 3 08:28:56 2016 From: daviddoria at gmail.com (David Doria) Date: Thu, 3 Mar 2016 07:28:56 -0600 Subject: [vtkusers] Read ply point cloud? In-Reply-To: References: Message-ID: On Thu, Mar 3, 2016 at 6:08 AM, Bruno Oliveira < bruno.manata.oliveira at gmail.com> wrote: > Hello, > > is it not possible to import a PLY point cloud file into VTK? > Did you search the examples? http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/ReadPLY David -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Thu Mar 3 08:39:37 2016 From: daviddoria at gmail.com (David Doria) Date: Thu, 3 Mar 2016 07:39:37 -0600 Subject: [vtkusers] Read ply point cloud? In-Reply-To: References: Message-ID: On Thu, Mar 3, 2016 at 7:37 AM, Bruno Oliveira < bruno.manata.oliveira at gmail.com> wrote: > I did and tried it but the PLYReader won't import point cloud only PLY > files. > Please keep the conversation on the mailing list. What is the difference between a "point cloud" and a "PLY file"? Can you post an example somewhere? David -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.hirsch at st.ovgu.de Thu Mar 3 09:09:25 2016 From: jan.hirsch at st.ovgu.de (jhirsch) Date: Thu, 3 Mar 2016 07:09:25 -0700 (MST) Subject: [vtkusers] SetScalar() removes my color scalars In-Reply-To: <46CB11F12B9DC24D860D4082451B318A36B375CF@exchange3.microbrightfield.com> References: <46CB11F12B9DC24D860D4082451B318A36B375CF@exchange3.microbrightfield.com> Message-ID: <1457014165763-5736995.post@n5.nabble.com> Hello Doug, your source example just creates two arrays and set their names and therefore has little to do with your problem, I guess. Can you copy more lines of code that show the problem with the scalar replacement? In general I would recommend to create a scalar array with 3 components and use that for colours. Like this: (that's from the example here ) -- View this message in context: http://vtk.1045678.n5.nabble.com/SetScalar-removes-my-color-scalars-tp5736971p5736995.html Sent from the VTK - Users mailing list archive at Nabble.com. From vladi88 at gmx.de Thu Mar 3 09:50:20 2016 From: vladi88 at gmx.de (Vladi Mitover) Date: Thu, 3 Mar 2016 15:50:20 +0100 Subject: [vtkusers] How can I read a "legacy" ASCII VTK file Message-ID: An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: grid3D.vtk Type: application/octet-stream Size: 1013 bytes Desc: not available URL: From cory.quammen at kitware.com Thu Mar 3 09:55:50 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Thu, 3 Mar 2016 08:55:50 -0600 Subject: [vtkusers] SetScalar() removes my color scalars In-Reply-To: <1457014165763-5736995.post@n5.nabble.com> References: <46CB11F12B9DC24D860D4082451B318A36B375CF@exchange3.microbrightfield.com> <1457014165763-5736995.post@n5.nabble.com> Message-ID: Doug, This is a long-standing oddness in VTK. If you call SetScalars() on point data, for example, a side effect is that the current active scalars is removed from the point data! I have been bitten by this in the past. We should probably change this behavior to avoid surprising effects like this despite the backwards compatibility issues (which are hopefully few). I recommend calling SetActiveScalars(const char* name) instead, which shouldn't remove your array. HTH, Cory On Thu, Mar 3, 2016 at 8:09 AM, jhirsch wrote: > Hello Doug, > your source example just creates two arrays and set their names and > therefore has little to do with your problem, I guess. Can you copy more > lines of code that show the problem with the scalar replacement? > > In general I would recommend to create a scalar array with 3 components and > use that for colours. Like this: > > (that's from the example here > ) > > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/SetScalar-removes-my-color-scalars-tp5736971p5736995.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 R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjlp at netease.com Thu Mar 3 10:09:17 2016 From: tjlp at netease.com (Liu_tj) Date: Thu, 3 Mar 2016 23:09:17 +0800 (CST) Subject: [vtkusers] Does VTK support editing image? In-Reply-To: References: <542cbbb5.1.15339ff8255.Coremail.tjlp@netease.com> Message-ID: <15616cb.2a.1533d06a119.Coremail.tjlp@netease.com> Hi, David, Do you have any idea for editing the image in vtkRenderWindow? BR, Liu Peng ?2016-03-03?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?3? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: [vtkusers] Does VTK support editing image? No, VTK does not provide any image editing tools. (Not that I'm aware of, at least). - David On Wed, Mar 2, 2016 at 6:02 PM, Liu_tj wrote: Hi, I load DICOM series and display it on vtkRenderWindow. Now I want to do some minor editing on the image, just like using paintbrush to draw some points or line on it. Does VTK provide such function? Thanks Liu Peng -------------- next part -------------- An HTML attachment was scrubbed... URL: From bruno.manata.oliveira at gmail.com Thu Mar 3 10:23:43 2016 From: bruno.manata.oliveira at gmail.com (Bruno Oliveira) Date: Thu, 3 Mar 2016 15:23:43 +0000 Subject: [vtkusers] Read ply point cloud? In-Reply-To: References: Message-ID: I meant a point cloud PLY file, i.e., a PLY file which only contains "element vertex" entries 2016-03-03 13:39 GMT+00:00 David Doria : > On Thu, Mar 3, 2016 at 7:37 AM, Bruno Oliveira < > bruno.manata.oliveira at gmail.com> wrote: > >> I did and tried it but the PLYReader won't import point cloud only PLY >> files. >> > > Please keep the conversation on the mailing list. > > What is the difference between a "point cloud" and a "PLY file"? Can you > post an example somewhere? > > David > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bruno.manata.oliveira at gmail.com Thu Mar 3 10:27:11 2016 From: bruno.manata.oliveira at gmail.com (Bruno Oliveira) Date: Thu, 3 Mar 2016 15:27:11 +0000 Subject: [vtkusers] Set view matrix explicitly Message-ID: Hello, is there a way of setting the "View" matrix (equivalent to OpenGL fixed pipeline nomenclature), instead of just setting the camer'as viewUp and focalPoint? If not, is there a way of setting the camera's euler angles relative to an origin point? Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Thu Mar 3 10:32:47 2016 From: daviddoria at gmail.com (David Doria) Date: Thu, 3 Mar 2016 09:32:47 -0600 Subject: [vtkusers] Read ply point cloud? In-Reply-To: References: Message-ID: On Thu, Mar 3, 2016 at 9:23 AM, Bruno Oliveira < bruno.manata.oliveira at gmail.com> wrote: > I meant a point cloud PLY file, i.e., a PLY file which only contains > "element vertex" entries > I'm not sure without trying it, but my guess is that you end up with a vtkPolyData that has no topology. Running vtkVertexGlyphFilter on it should get you the visualizable point cloud you're expecting: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Filtering/VertexGlyphFilter David -------------- next part -------------- An HTML attachment was scrubbed... URL: From bruno.manata.oliveira at gmail.com Thu Mar 3 10:40:32 2016 From: bruno.manata.oliveira at gmail.com (Bruno Oliveira) Date: Thu, 3 Mar 2016 15:40:32 +0000 Subject: [vtkusers] Set view matrix explicitly In-Reply-To: References: Message-ID: I tried setting view matrix manually and this warning shows up: Warning: In /home/bmmo/playground/VTK-7.0.0/Common/Transforms/vtkTransform.cxx, line 194 vtkTransform (0xaa4460): InternalUpdate: doing hack to support legacy code. This is deprecated in VTK 4.2. May be removed in a future version. 2016-03-03 15:27 GMT+00:00 Bruno Oliveira : > Hello, > > is there a way of setting the "View" matrix (equivalent to OpenGL fixed > pipeline nomenclature), instead of just setting the camer'as viewUp and > focalPoint? > > > If not, is there a way of setting the camera's euler angles relative to an > origin point? > > Thank you! > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Thu Mar 3 10:46:11 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 3 Mar 2016 08:46:11 -0700 Subject: [vtkusers] Does VTK support editing image? In-Reply-To: <15616cb.2a.1533d06a119.Coremail.tjlp@netease.com> References: <542cbbb5.1.15339ff8255.Coremail.tjlp@netease.com> <15616cb.2a.1533d06a119.Coremail.tjlp@netease.com> Message-ID: None that I can share right now, unfortunately, because I'm already involved in an image editing project at work. - David On Thu, Mar 3, 2016 at 8:09 AM, Liu_tj wrote: > Hi, David, > > Do you have any idea for editing the image in vtkRenderWindow? > > BR, > Liu Peng > -------------- next part -------------- An HTML attachment was scrubbed... URL: From DLRdave at aol.com Thu Mar 3 10:47:06 2016 From: DLRdave at aol.com (David Cole) Date: Thu, 3 Mar 2016 10:47:06 -0500 Subject: [vtkusers] vtkRenderWindowInteractor.start() crashes in C# application using Activiz In-Reply-To: <6c47c227.b.1533a6bc473.Coremail.tjlp@netease.com> References: <26af67c6.12.15332cf91e1.Coremail.tjlp@netease.com> <4aac7f70.3.15335071ed5.Coremail.tjlp@netease.com> <6c47c227.b.1533a6bc473.Coremail.tjlp@netease.com> Message-ID: Nope. Just call the Set functions, that's all that's necessary... David > On Mar 2, 2016, at 10:00 PM, Liu_tj wrote: > > Hi,David, > > Before I call SetInteractor() or SetInteractorStyle(), do I need to explicitly call some specific functions to release the current interactor or interactorStyle? Or just let .NET framework to GC it automatically. > > Thanks > Liu Peng > > > ?2016-03-02?"David Cole" ??? > -----????----- > ???:"David Cole" > ????:2016?03?2? ??? > ???:"Liu_tj" > ??:Re: Re: [vtkusers] vtkRenderWindowInteractor.start() crashes in C# application using Activiz > > Sure. If you want to use your own interactor, just instantiate it and > call SetInteractor on the render window. And if you want your own > style, instantiate it and call SetInteractorStyle. > > ActiViz is really just a thin C# wrapper around VTK, so all the usual > VTK stuff applies. > > > HTH, > David C. > > > On Tue, Mar 1, 2016 at 8:52 PM, Liu_tj wrote: > > Hi, David, > > > > Thanks. You are right. After I remove the instantiation of the interactor, > > the code works. > > > > So, if the render window control contains Interactor and InteractorStyle, > > what kind of Interactor and interactorStyle it uses? Can we specify them by > > ourself if the default Interactor and InteractorStyle can't meet our > > requirement? > > > > Thanks > > Liu Peng > > > > ?2016-03-01?"David Cole" ??? > > > > -----????----- > > ???:"David Cole" > > ????:2016?03?1? ??? > > ???:"Liu_tj" > > ??:"vtkusers" > > ??:Re: [vtkusers] vtkRenderWindowInteractor.start() crashes in C# > > application using Activiz > > > > When using ActiViz .NET, you typically don't need to create your own > > interactor object. The render window control contains a RenderWindow, > > an Interactor and an InteractorStyle that are all connected to each > > other by default. Interactor.Start starts a windows event loop, and is > > used by standalone programs not using a UI framework. When you're > > using a UI framework, you don't need to call it. > > > > Just remove your instantiation of the interactor, and do not call > > Start. If you are using a Windows Forms application to display your > > render window control, just show the form, and let the Windows Forms > > framework handle your event loop. > > > > > > HTH, > > David C. > > > > > > On Tue, Mar 1, 2016 at 10:32 AM, Liu_tj wrote: > >> Hi, VTK guys, > >> > >> I use Activiz 5.8 Open Source edition to display Axial, Sagittal and > >> Coronal > >> view for DICOM series in WPF application. In the XAML, I add a button and > >> a > >> vtkRenderWindowControl component. And a method ShowImagePlaneWidget() is > >> defined. I just want to click the button then ShowImagePlaneWidget() is > >> called, the DICOM series is loaded and displayed. But it does not work and > >> the application crashes at vtkRenderWindowInteractor.start(). > >> > >> However, the DICOM can be displayed if ShowImagePlaneWidget() is called in > >> the Window_Load event handler. > >> > >> What happens? How to fix it? I am working this issue for some time. > >> > >> Below is my code: > >> > >> private void Window_Loaded(object sender, RoutedEventArgs e) > >> { > >> ShowImagePlaneWidget(); > >> } > >> > >> private void btnLoad_Click(object sender, RoutedEventArgs e) > >> { > >> ShowImagePlaneWidget(); > >> } > >> private void ShowImagePlaneWidget() > >> { > >> vtkImagePlaneWidget m_imagePlaneWidgetX = > >> vtkImagePlaneWidget.New(); > >> vtkImagePlaneWidget m_imagePlaneWidgetY = > >> vtkImagePlaneWidget.New(); > >> vtkImagePlaneWidget m_imagePlaneWidgetZ = > >> vtkImagePlaneWidget.New(); > >> vtkRenderWindowInteractor m_interactor = > >> vtkRenderWindowInteractor.New(); > >> > >> vtkRenderWindow aRenderWindow = renderctrl.RenderWindow; > >> > >> vtkDICOMImageReader reader = vtkDICOMImageReader.New(); > >> > >> > >> reader.SetDirectoryName(@"C:\Personal\code\ReadDICOMSeries\build\Debug\IMG\Dental_Lossy_Compressed"); > >> reader.Update(); > >> > >> int[] dims = new int[3]; > >> dims = reader.GetOutput().GetDimensions(); > >> > >> vtkImageCast readerImageCast = vtkImageCast.New(); > >> readerImageCast.SetInput((vtkDataObject)reader.GetOutput()); > >> //readerImageCast.SetOutputScalarTypeToUnsignedChar(); > >> readerImageCast.ClampOverflowOn(); > >> readerImageCast.Update(); > >> > >> m_interactor.SetRenderWindow(aRenderWindow); > >> vtkRenderer renderer = > >> aRenderWindow.GetRenderers().GetFirstRenderer(); > >> > >> vtkCellPicker picker = vtkCellPicker.New(); > >> picker.SetTolerance(0.005); > >> //m_imagePlaneWidgetX.DebugOn(); > >> m_imagePlaneWidgetX.SetDefaultRenderer(renderer); > >> PrepareImagePlaneWidget(m_imagePlaneWidgetX, > >> readerImageCast.GetOutput(), m_interactor, picker, dims, > >> Direction.CORONAL); > >> vtkRenderWindowInteractor tmpint = > >> m_imagePlaneWidgetX.GetInteractor(); > >> PrepareImagePlaneWidget(m_imagePlaneWidgetY, > >> readerImageCast.GetOutput(), m_interactor, picker, dims, > >> Direction.SAGITTAL); > >> PrepareImagePlaneWidget(m_imagePlaneWidgetZ, > >> readerImageCast.GetOutput(), m_interactor, picker, dims, Direction.AXIAL); > >> > >> m_interactor.Initialize(); > >> m_interactor.Start(); > >> aRenderWindow.Render(); > >> return; > >> } > >> > >> private void PrepareImagePlaneWidget(vtkImagePlaneWidget > >> planeWidget, vtkImageData data, vtkRenderWindowInteractor interactor, > >> vtkCellPicker picker, int[] dimensions, Direction direction) > >> { > >> planeWidget.SetInteractor(interactor); > >> > >> planeWidget.SetPicker(picker); > >> planeWidget.RestrictPlaneToVolumeOn(); > >> > >> planeWidget.DisplayTextOn(); > >> planeWidget.TextureInterpolateOff(); > >> planeWidget.SetResliceInterpolateToLinear(); > >> > >> planeWidget.SetInput(data); > >> > >> switch (direction) > >> { > >> case Direction.AXIAL: > >> planeWidget.SetKeyPressActivationValue((sbyte)'z'); > >> planeWidget.SetPlaneOrientationToZAxes(); > >> planeWidget.GetPlaneProperty().SetColor(0.0, 0.0, > >> 1.0); > >> break; > >> case Direction.CORONAL: > >> planeWidget.SetKeyPressActivationValue((sbyte)'x'); > >> planeWidget.SetPlaneOrientationToXAxes(); > >> planeWidget.GetPlaneProperty().SetColor(1.0, 0.0, > >> 0.0); > >> break; > >> case Direction.SAGITTAL: > >> planeWidget.SetKeyPressActivationValue((sbyte)'y'); > >> planeWidget.SetPlaneOrientationToYAxes(); > >> planeWidget.GetPlaneProperty().SetColor(0.0, 1.0, > >> 0.0); > >> break; > >> } > >> planeWidget.SetSliceIndex(dimensions[(int)direction] / 2); > >> planeWidget.GetTexturePlaneProperty().SetOpacity(1); > >> > >> > >> planeWidget.On(); > >> planeWidget.InteractionOn(); > >> } > >> > >> Thanks > >> Liu Peng > >> > >> > >> > >> > >> > >> _______________________________________________ > >> Powered by www.kitware.com > >> > >> Visit other Kitware open-source projects at > >> http://www.kitware.com/opensource/opensource.html > >> > >> Please keep messages on-topic and check the VTK FAQ at: > >> 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 billyaraujo at gmail.com Thu Mar 3 10:57:37 2016 From: billyaraujo at gmail.com (Billy Araujo) Date: Thu, 3 Mar 2016 15:57:37 +0000 Subject: [vtkusers] How to reverse vtkScalarsToColors? Message-ID: How can I reverse vtkScalarsToColors? Because high values are blue and not red. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Thu Mar 3 11:34:04 2016 From: dave.demarle at kitware.com (David E DeMarle) Date: Thu, 3 Mar 2016 11:34:04 -0500 Subject: [vtkusers] How can I read a "legacy" ASCII VTK file In-Reply-To: References: Message-ID: Try changing from polydatamapper to datasetmapper, or pretty much equivalently put a datasetsurfacefilter (named "geometryfilter" in on of the example) in between the reader and the polydatamapper. In either case what happens is that the unstructured grid (potentially containing volumetric elements eg tetrahedra) gets converted to a polydata (containing only locally 2D elements eg triangles) which can be drawn by GL. David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Thu, Mar 3, 2016 at 9:50 AM, Vladi Mitover wrote: > Hello everyone, > > I use the VTK version 6.3.0-55.5. > > I am trying to do the following: read a "legacy" ASCII VTK file and that > file represents an example of an unstructured grid in 3D, as done in the > following VTK/Cxx-examples: > 1)To read "legacy" ASCII VTK file: > http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/GenericDataObjectReader > I have included vtkGenericDataObjectReader.h, vtkPolyData.h, string > 2)To make a 3DPlot: > http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/ReadPLOT3D > Here I change the vtkStructuredGridGeometryFilter.h to > vtkUnstructuredGridReader.h > 3)To read unstructured Grid: > http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/ReadUnstructuredGrid > > When I build it, it looks as if everything was okay but when I play it, in > the opening window nothing is to see. > Below is my code: > > #include > #include > #if VTK_MAJOR_VERSION <= 5 > #include > #else > #include > #include > #endif > #include > #include > #include > #include > #include > #include > //=============================================== > //Header from example GenericDataObjectReader.cxx > //=============================================== > #include > #include > #include > //============================================= > //Header from example ReadUnstructuredGrid.cxx > //============================================= > #include > #include > > using namespace std; > int main (int argc, char *argv[]) > { > > //Ensure a filename was specified > if(argc != 2) > { > std::cerr << "Usage: " << argv[0] << " InputFilename(.vtk)" << > endl; > return EXIT_FAILURE; > } > > //Get the filename from the command line > std::string inputFilename = argv[1]; > > //Read all the data from the file > vtkSmartPointer reader = > vtkSmartPointer::New(); > reader->SetFileName(inputFilename.c_str()); > reader->Update(); > > //Visualize > vtkSmartPointer mapper = > vtkSmartPointer::New(); > // mapper->SetInputConnection(geometryFilter->GetOutputPort()); > mapper->SetInputConnection(reader->GetOutputPort()); > mapper->ScalarVisibilityOff(); > > vtkSmartPointer actor = > vtkSmartPointer::New(); > actor->SetMapper(mapper); > > //Create a renderer, render window, and interactor > vtkSmartPointer renderer = > vtkSmartPointer::New(); > vtkSmartPointer renderWindow = > vtkSmartPointer::New(); > renderWindow->AddRenderer(renderer); > vtkSmartPointer renderWindowInteractor = > vtkSmartPointer::New(); > renderWindowInteractor->SetRenderWindow(renderWindow); > > renderer->AddActor(actor); > renderer->SetBackground(.3, .6, .3); // Background color green > > renderWindow->Render(); > renderWindowInteractor->Start(); > > return EXIT_SUCCESS; > } > > > > What is wrong? Can anyone help? > > Thank you very much in advance. > > And here the file > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 andy.bauer at kitware.com Thu Mar 3 14:43:12 2016 From: andy.bauer at kitware.com (Andy Bauer) Date: Thu, 3 Mar 2016 14:43:12 -0500 Subject: [vtkusers] Paraview bug found in pvtu files containing polyhedrons In-Reply-To: <45EAF588-0B4F-45B9-B4AB-F1EC8EC656FF@googlemail.com> References: <45EAF588-0B4F-45B9-B4AB-F1EC8EC656FF@googlemail.com> Message-ID: Hi, Thanks for the bug report. I have a fix for this that's going through testing right now. It's at https://gitlab.kitware.com/vtk/vtk/merge_requests/1300 if you want to take a look and test it out as well. I only tested it with your input so it could certainly use a bit more testing with other data sets. If you do that, please let us know how it works. Best, Andy On Mon, Feb 29, 2016 at 11:03 AM, Andrew Parker via vtkusers < vtkusers at vtk.org> wrote: > Dear All, > > I have recently been having problems reading pvtu files in paraview when > those files contain arbitrary polyhedrons: this is from the output of a > large scale code that runs in parallel via mpi. To show the problem, I > have written a very small sample code, attached, that runs in serial but > reproduces the salient issues experienced by my larger code when run in > parallel. It is clear, via the toggling a boolean, that the problem > happens when vtk_polyhedrons types are used. There is a short description > at the top of the bug.cxx file, followed by instructions. I use stock > versions of paraview here, although self compiled ones show no difference. > > In short compile the code, run it, and open the pvtu file in paraview. > You should see 4 cells. > Switch the ?bug? bool to true, recompile, re-run it, and reopen the pvtu > file. The screen will be blank. > > The only difference is that cells are added to the unstructured grid > explicitly as vtk_polyhedrons using a face-stream, rather than as hexs. I > cannot do this in the real code! The rest of the code is just there to > produce the ?serial? mesh, and threshold this mesh to produce two > ?parallel-partition? meshes. I use the new ghost type framework as this is > consistent with the real code, and this runs and compiles on OS X and gcc. > Likewise it has been build against vtk 6.3 and the bug manifests itself in > paraview 4.4 and 5.0. Visit 2.10 does not have this bug and can correctly > open the pvtu containing polyhedrons: this is my current workaround. > > Can any of the developers shed light on this? Is a fix known, if so when > will it be released? Do others have this problem [1, 2, 3] outside of > those long reported? Does anyone else have workarounds? > > Any help really appreciated, > Andy > > [1] http://public.kitware.com/pipermail/vtkusers/2015-May/090835.html > [2] https://cmake.org/pipermail/paraview/2012-October/026456.html > [3] https://cmake.org/pipermail/paraview/2015-January/032950.html > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From inglis.dl at gmail.com Thu Mar 3 14:48:45 2016 From: inglis.dl at gmail.com (DL I) Date: Thu, 3 Mar 2016 14:48:45 -0500 Subject: [vtkusers] Does VTK support editing image? In-Reply-To: <542cbbb5.1.15339ff8255.Coremail.tjlp@netease.com> References: <542cbbb5.1.15339ff8255.Coremail.tjlp@netease.com> Message-ID: Hi, Kitware used to have vtkEdge, which had paintbrush widgets: http://www.vtkedge.org/. Apparently it is no longer supported, but perhaps others on the list will know where those classes ended up (maybe in VolView ?) Painting on an image could be done in VTK with its existing classes: - create an image using your source image on a vtkImageCanvasSource2D - pass the canvas source to a vtkImageActor to view in a renderer - capture the vtkRenderWindowiIteractor mouse events and update the canvas accordingly using your own custom vtkCommand callbacks - Dean - Dean On Wed, Mar 2, 2016 at 8:02 PM, Liu_tj wrote: > Hi, > > I load DICOM series and display it on vtkRenderWindow. Now I want to do > some minor editing on the image, just like using paintbrush to draw some > points or line on it. Does VTK provide such function? > > Thanks > Liu Peng > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 dhoppes at mbfbioscience.com Thu Mar 3 15:59:07 2016 From: dhoppes at mbfbioscience.com (Doug Hoppes) Date: Thu, 3 Mar 2016 20:59:07 +0000 Subject: [vtkusers] SetScalar() removes my color scalars In-Reply-To: References: <46CB11F12B9DC24D860D4082451B318A36B375CF@exchange3.microbrightfield.com> <1457014165763-5736995.post@n5.nabble.com> Message-ID: <46CB11F12B9DC24D860D4082451B318A36B39892@exchange3.microbrightfield.com> Ah?. Okay! Thanks! That?s extremely helpful. From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Cory Quammen Sent: Thursday, March 03, 2016 9:56 AM To: jhirsch Cc: vtkusers at vtk.org Subject: Re: [vtkusers] SetScalar() removes my color scalars Doug, This is a long-standing oddness in VTK. If you call SetScalars() on point data, for example, a side effect is that the current active scalars is removed from the point data! I have been bitten by this in the past. We should probably change this behavior to avoid surprising effects like this despite the backwards compatibility issues (which are hopefully few). I recommend calling SetActiveScalars(const char* name) instead, which shouldn't remove your array. HTH, Cory On Thu, Mar 3, 2016 at 8:09 AM, jhirsch > wrote: Hello Doug, your source example just creates two arrays and set their names and therefore has little to do with your problem, I guess. Can you copy more lines of code that show the problem with the scalar replacement? In general I would recommend to create a scalar array with 3 components and use that for colours. Like this: (that's from the example here ) -- View this message in context: http://vtk.1045678.n5.nabble.com/SetScalar-removes-my-color-scalars-tp5736971p5736995.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 R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjlp at netease.com Thu Mar 3 19:59:33 2016 From: tjlp at netease.com (Liu_tj) Date: Fri, 4 Mar 2016 08:59:33 +0800 (CST) Subject: [vtkusers] Does VTK support editing image? In-Reply-To: References: <542cbbb5.1.15339ff8255.Coremail.tjlp@netease.com> Message-ID: <11824c28.3.1533f230607.Coremail.tjlp@netease.com> Hi, Dean, Thanks for your instruction.I will try it. BR, Liu Peng ?2016-03-04?"DL I" ??? -----????----- ???:"DL I" ????:2016?03?4? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: [vtkusers] Does VTK support editing image? Hi, Kitware used to have vtkEdge, which had paintbrush widgets: http://www.vtkedge.org/. Apparently it is no longer supported, but perhaps others on the list will know where those classes ended up (maybe in VolView ?) Painting on an image could be done in VTK with its existing classes: - create an image using your source image on a vtkImageCanvasSource2D - pass the canvas source to a vtkImageActor to view in a renderer - capture the vtkRenderWindowiIteractor mouse events and update the canvas accordingly using your own custom vtkCommand callbacks - Dean - Dean On Wed, Mar 2, 2016 at 8:02 PM, Liu_tj wrote: Hi, I load DICOM series and display it on vtkRenderWindow. Now I want to do some minor editing on the image, just like using paintbrush to draw some points or line on it. Does VTK provide such function? Thanks Liu Peng _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: 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 ranveeraggarwal at gmail.com Fri Mar 4 02:25:50 2016 From: ranveeraggarwal at gmail.com (Ranveer Aggarwal) Date: Fri, 04 Mar 2016 07:25:50 +0000 Subject: [vtkusers] Problems Installing VTK-Python on OSX Message-ID: Hello all, I have been struggling with this problem for quite some time now. Here's what I did. 1. Downloaded source tar.gz and untarred it. 2. Went to the downloaded folder and made a build folder and ran ccmake .. in it. 3. Set Python Wrapping to on and set Python version as 3.5. Went to advanced options and appropriately set all the Python 3.5 libraries. 4. Generated the cmake and ran it. 5. Ran make and then make install 6. Added "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/vtk/" to PYTHONPATH. Now, when I run python3 and do an `import vtk`, I get Fatal Python error: PyThreadState_Get: no current thread Segmentation fault: 11 and Python crashes. Any idea why this could be happening? Any help would be highly appreciated. -- Sincerely, Ranveer Aggarwal Indian Institute of Technology, Bombay http://ranveeraggarwal.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From yihui.cao at qq.com Fri Mar 4 02:56:00 2016 From: yihui.cao at qq.com (=?ISO-8859-1?B?WWlodWkgQ2Fv?=) Date: Fri, 4 Mar 2016 15:56:00 +0800 Subject: [vtkusers] How to set a border and its color for a renderWindow or for a renderer? Message-ID: Dear All, How to set a border and its color for a renderWindow or for a renderer? I want to add a border for vtkResliceImageViewer to distinguish all orientations. Thanks Yihui Cao -------------- next part -------------- An HTML attachment was scrubbed... URL: From emredeniz18 at hotmail.com Fri Mar 4 04:32:27 2016 From: emredeniz18 at hotmail.com (emredeniz) Date: Fri, 4 Mar 2016 02:32:27 -0700 (MST) Subject: [vtkusers] =?utf-8?q?How_can_=C4=B1_get_the_pixel_value_without_c?= =?utf-8?q?licking_with_the_mouse?= Message-ID: <1457083947124-5737018.post@n5.nabble.com> Hi all, I need to get the DICOM pixel value in the render window without clicking mouse. In addition, this interactor style shoul work just on the image, not above the all of render window. Which classes and methods can ? use for this? Thanks. -- View this message in context: http://vtk.1045678.n5.nabble.com/How-can-get-the-pixel-value-without-clicking-with-the-mouse-tp5737018.html Sent from the VTK - Users mailing list archive at Nabble.com. From luca.penasa at gmail.com Fri Mar 4 05:47:17 2016 From: luca.penasa at gmail.com (luca) Date: Fri, 4 Mar 2016 11:47:17 +0100 Subject: [vtkusers] vtkCellLocator tolerance Message-ID: <56D967B5.2010706@gmail.com> I am trying to compute ray to polydata intersections using the cell locator. I noticed there is a systematic discrepancy between the returned intersection and the actual one. I tried reducing the "tol" parameter without success. Is there something I am missing? Here is a snapshot of the found intersections (red spheres) and the rays entering the (white) surface of the polydata. Any hint on this? Luca -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: bdecjccd. Type: image/png Size: 26816 bytes Desc: not available URL: From elvis.stansvik at orexplore.com Fri Mar 4 06:00:48 2016 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Fri, 4 Mar 2016 12:00:48 +0100 Subject: [vtkusers] Requirements for multiple volumes in one render window In-Reply-To: References: Message-ID: 2016-03-02 21:16 GMT+01:00 Aashish Chaudhary : > Elvis, > > thanks for the detailed information. I thought about a way of doing > this. Basically, I think the mapper has to take multiple inputs and if > multiple inputs are present, then we will construct a BBox around it > and used that for traversing. Now, internally, we would have to > transform the data position to each volume so that we can perform the > lookup and set some rules on how to perform compositing (replace, > modulate etc.). I will talk to the team here and will add in our todo > but we would have check on the priority of it. > Thanks a lot for looking into this and bringing it up with the team. It would be a very welcome addition for us, and surely to some others as well. The approach you outline seems sound to me, but I am a layman in visualization :) > > If you want to help us with this then I am more happy to guide you > with the process. It won't be very difficult but will require some > careful changes to the existing mapper. > I'm afraid we're in the middle of a product launch here at work, so I'm quite swamped. This is only a small part of the application I'm building. I'm also completely new to VTK and visualization in general, so I'm also afraid it would be more difficult and time consuming for me than you might think (as opposed to a seasoned VTK dev). I'm of course prepared to try out any changes you do on our data sets, should you decide to work on this. Thanks again, Elvis > Thanks, > > > On Mon, Feb 29, 2016 at 11:46 AM, Elvis Stansvik > wrote: > > 2016-02-29 16:32 GMT+01:00 Aashish Chaudhary > > : > >> > >> Hi Elvis, > >> > >> On Sat, Feb 27, 2016 at 12:06 PM, Elvis Stansvik > >> wrote: > >> > 2016-02-25 17:10 GMT+01:00 Elvis Stansvik > >> > : > >> >> > >> >> Hi, > >> >> > >> >> From searching around, I think I've gathered that to render multiple > >> >> volumes in a single window, each volume must have its own mapper and > >> >> volume > >> >> property. They can't share mapper or property. > >> >> > >> >> My question is whether I must use separate renderers for each volume > as > >> >> well, or if I can use the same renderer for them all? > >> >> > >> >> Also, I did read something in an old post about problems with > rendering > >> >> multiple volumes that intersect (share a voxel). Is this still a > >> >> problem? > >> >> I'm using VTK 6.2 and the vtkVolumeRayCastMapper. > >> >> > >> >> Thanks in advance! > >> > > >> > > >> > Including Donny's answer here, to keep the thread intact: > >> > > >> >> See this thread: > >> >> > >> >> > >> >> > >> >> > http://vtk.1045678.n5.nabble.com/Rendering-multiple-volumes-td5734685.html#a5734971 > >> > > >> > Thanks, that clears some things up, and brings up some workarounds. > That > >> > thread was from oct/nov last year, so I guess it is still the case > that > >> > proper rendering of multiple volumes that share voxels in 3D space is > >> > not > >> > possible? (even with 7.0?). > >> > >> It depends what you define proper. If you have two volumes and they > >> share the exact same space, you can combine them into one volume. When > >> they share the same space but do not overlap that's when things get > >> tricky since then the outcome depends on how do you want to handle > >> this disparity. There could be some other ways such as you combine the > >> volume into one. At the rendering level it could get tricky. > >> > >> What exactly you are trying to do. > > > > > > I see, what I would expect I think is composite rendering of the voxels > > using some composite rendering function / blending mode (perhaps > > configurable?). > > > > Sorry if my use case wasn't clear, I'm attaching a rough sketch I did > just > > now which should explain it better. > > > > Each of our volumes is a piece of a drill core (see my photo previously > in > > this thread). The pieces were scanned stacked on top of each other in a > > plastic tube inside our machine. During scanning, they are not > necessarily > > aligned properly (as shown in the sketch, and also in the photo). > > > > We will do some algorithmic alignment of the volumes, but we must also > allow > > the user to override / supplement the automatic alignment when it fails. > > This means the user should be able to rotate and move (along Z axis) the > > pieces until they align. It's like a pussle with pieces of a drill core > :) > > > > While the user is doing this, the volumes may intersect (noone is > perfect on > > the first try). This is why I'm asking about rendering multiple volumes > that > > partially intersect in 3D space. > > > > It's very desirable that the user can see inside the volumes while doing > > this manual alignment, since the features (cracks, density variations, > ...) > > inside the rocks may be what guides the user in aligning the pieces > > properly. That's why I don't like the idea of letting the user work with > > extracted isosurfaces or similar instead. > > > > Hope this clears things up a little! > > > > Elvis > > > >> > >> - Aashish > >> > >> > > >> > Elvis > >> > > >> >> > >> >> Elvis > >> > > >> > > >> > > >> > _______________________________________________ > >> > Powered by www.kitware.com > >> > > >> > Visit other Kitware open-source projects at > >> > http://www.kitware.com/opensource/opensource.html > >> > > >> > Please keep messages on-topic and check the VTK FAQ at: > >> > http://www.vtk.org/Wiki/VTK_FAQ > >> > > >> > Search the list archives at: http://markmail.org/search/?q=vtkusers > >> > > >> > Follow this link to subscribe/unsubscribe: > >> > http://public.kitware.com/mailman/listinfo/vtkusers > >> > > >> > >> > >> > >> -- > >> | Aashish Chaudhary > >> | Technical Leader > >> | Kitware Inc. > >> | http://www.kitware.com/company/team/chaudhary.html > > > > > > > > -- > | Aashish Chaudhary > | Technical Leader > | Kitware Inc. > | http://www.kitware.com/company/team/chaudhary.html > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luca.penasa at gmail.com Fri Mar 4 06:01:25 2016 From: luca.penasa at gmail.com (luca) Date: Fri, 4 Mar 2016 12:01:25 +0100 Subject: [vtkusers] vtkCellLocator tolerance In-Reply-To: <56D967B5.2010706@gmail.com> References: <56D967B5.2010706@gmail.com> Message-ID: <56D96B05.7080004@gmail.com> Well, it looks like it was my fault... I was computing the segment from ray and center wrongly :-) Sorry On 04/03/16 11:47, luca wrote: > I am trying to compute ray to polydata intersections using the cell > locator. > > I noticed there is a systematic discrepancy between the returned > intersection and the actual one. I tried reducing the "tol" parameter > without success. Is there something I am missing? > Here is a snapshot of the found intersections (red spheres) and the > rays entering the (white) surface of the polydata. > > Any hint on this? > > Luca > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/png Size: 26816 bytes Desc: not available URL: From mallikarjun49 at gmail.com Fri Mar 4 07:23:03 2016 From: mallikarjun49 at gmail.com (Mallikarjun K) Date: Fri, 4 Mar 2016 17:53:03 +0530 Subject: [vtkusers] vtkShaderProgram error :extension 'GL_EXT_gpu_Shader4' not supported VTK 7.0.0 Message-ID: Hello all, I am trying to migrate my volume rendering application from vtk 6.1 to vtk 7.0, but I am getting an error like this.. [image: Inline image 1] I am using vtkGPUVolumeRaycastMapper. My GPU details are: Renderer: Intel(R) HD Graphics 2000 Memory: 2108 MB Version: 3.1.0 - Build 9.17.10.4229 Any suggestions on this? Thanks in advance. -- *With Kind Regards:* Mallikarjun -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 3708 bytes Desc: not available URL: From vladi88 at gmx.de Fri Mar 4 08:02:09 2016 From: vladi88 at gmx.de (Vladi Mitover) Date: Fri, 4 Mar 2016 14:02:09 +0100 Subject: [vtkusers] How can I read a "legacy" ASCII VTK file In-Reply-To: References: , Message-ID: An HTML attachment was scrubbed... URL: From jaimefbc at gmail.com Fri Mar 4 08:27:35 2016 From: jaimefbc at gmail.com (Jaime Campos) Date: Fri, 4 Mar 2016 13:27:35 +0000 Subject: [vtkusers] Requirements for multiple volumes in one render window In-Reply-To: References: Message-ID: Hello everyone, I'm a new subscriber to this mailing list and I was reading this thread, and I'm also interested in this functionality. Currently I am using vtkOpenGLVolumeTextureMapper3D for two different volumes that intersect in 3D space, and it happens to render the volumes correctly by blending opacities and doing the correct compositioning (because of the slicing it does internally, I believe, though not being perfect). This also allows me to pick and interact with the vtkVolume props independently, which is a must have for the functionality I am developing. The problem, as far as I know, is that with VTK 7.0 new rendering backend (OpenGL 2), this mapper is no longer supported and the new GPU mappers available, unfortunately, are not solving this issue yet. This feature could also be applied to the iOS GPU volume mapper example. I wish I could help you adding this functionality, but unfortunately I'm not familiar with the internals of VTK in these modules, but I'm eager to learn. I hope I can bump up the priority of this request ! Thank you, Best Regards, Jaime Campos 2016-03-04 11:00 GMT+00:00 Elvis Stansvik : > 2016-03-02 21:16 GMT+01:00 Aashish Chaudhary < > aashish.chaudhary at kitware.com>: > >> Elvis, >> >> thanks for the detailed information. I thought about a way of doing >> this. Basically, I think the mapper has to take multiple inputs and if >> multiple inputs are present, then we will construct a BBox around it >> and used that for traversing. Now, internally, we would have to >> transform the data position to each volume so that we can perform the >> lookup and set some rules on how to perform compositing (replace, >> modulate etc.). I will talk to the team here and will add in our todo >> but we would have check on the priority of it. >> > > Thanks a lot for looking into this and bringing it up with the team. It > would be a very welcome addition for us, and surely to some others as well. > > The approach you outline seems sound to me, but I am a layman in > visualization :) > > >> >> If you want to help us with this then I am more happy to guide you >> with the process. It won't be very difficult but will require some >> careful changes to the existing mapper. >> > > I'm afraid we're in the middle of a product launch here at work, so I'm > quite swamped. This is only a small part of the application I'm building. > I'm also completely new to VTK and visualization in general, so I'm also > afraid it would be more difficult and time consuming for me than you might > think (as opposed to a seasoned VTK dev). > > I'm of course prepared to try out any changes you do on our data sets, > should you decide to work on this. > > Thanks again, > Elvis > > >> Thanks, >> >> >> On Mon, Feb 29, 2016 at 11:46 AM, Elvis Stansvik >> wrote: >> > 2016-02-29 16:32 GMT+01:00 Aashish Chaudhary >> > : >> >> >> >> Hi Elvis, >> >> >> >> On Sat, Feb 27, 2016 at 12:06 PM, Elvis Stansvik >> >> wrote: >> >> > 2016-02-25 17:10 GMT+01:00 Elvis Stansvik >> >> > : >> >> >> >> >> >> Hi, >> >> >> >> >> >> From searching around, I think I've gathered that to render multiple >> >> >> volumes in a single window, each volume must have its own mapper and >> >> >> volume >> >> >> property. They can't share mapper or property. >> >> >> >> >> >> My question is whether I must use separate renderers for each >> volume as >> >> >> well, or if I can use the same renderer for them all? >> >> >> >> >> >> Also, I did read something in an old post about problems with >> rendering >> >> >> multiple volumes that intersect (share a voxel). Is this still a >> >> >> problem? >> >> >> I'm using VTK 6.2 and the vtkVolumeRayCastMapper. >> >> >> >> >> >> Thanks in advance! >> >> > >> >> > >> >> > Including Donny's answer here, to keep the thread intact: >> >> > >> >> >> See this thread: >> >> >> >> >> >> >> >> >> >> >> >> >> http://vtk.1045678.n5.nabble.com/Rendering-multiple-volumes-td5734685.html#a5734971 >> >> > >> >> > Thanks, that clears some things up, and brings up some workarounds. >> That >> >> > thread was from oct/nov last year, so I guess it is still the case >> that >> >> > proper rendering of multiple volumes that share voxels in 3D space is >> >> > not >> >> > possible? (even with 7.0?). >> >> >> >> It depends what you define proper. If you have two volumes and they >> >> share the exact same space, you can combine them into one volume. When >> >> they share the same space but do not overlap that's when things get >> >> tricky since then the outcome depends on how do you want to handle >> >> this disparity. There could be some other ways such as you combine the >> >> volume into one. At the rendering level it could get tricky. >> >> >> >> What exactly you are trying to do. >> > >> > >> > I see, what I would expect I think is composite rendering of the voxels >> > using some composite rendering function / blending mode (perhaps >> > configurable?). >> > >> > Sorry if my use case wasn't clear, I'm attaching a rough sketch I did >> just >> > now which should explain it better. >> > >> > Each of our volumes is a piece of a drill core (see my photo previously >> in >> > this thread). The pieces were scanned stacked on top of each other in a >> > plastic tube inside our machine. During scanning, they are not >> necessarily >> > aligned properly (as shown in the sketch, and also in the photo). >> > >> > We will do some algorithmic alignment of the volumes, but we must also >> allow >> > the user to override / supplement the automatic alignment when it fails. >> > This means the user should be able to rotate and move (along Z axis) the >> > pieces until they align. It's like a pussle with pieces of a drill core >> :) >> > >> > While the user is doing this, the volumes may intersect (noone is >> perfect on >> > the first try). This is why I'm asking about rendering multiple volumes >> that >> > partially intersect in 3D space. >> > >> > It's very desirable that the user can see inside the volumes while doing >> > this manual alignment, since the features (cracks, density variations, >> ...) >> > inside the rocks may be what guides the user in aligning the pieces >> > properly. That's why I don't like the idea of letting the user work with >> > extracted isosurfaces or similar instead. >> > >> > Hope this clears things up a little! >> > >> > Elvis >> > >> >> >> >> - Aashish >> >> >> >> > >> >> > Elvis >> >> > >> >> >> >> >> >> Elvis >> >> > >> >> > >> >> > >> >> > _______________________________________________ >> >> > Powered by www.kitware.com >> >> > >> >> > Visit other Kitware open-source projects at >> >> > http://www.kitware.com/opensource/opensource.html >> >> > >> >> > Please keep messages on-topic and check the VTK FAQ at: >> >> > http://www.vtk.org/Wiki/VTK_FAQ >> >> > >> >> > Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> > >> >> > Follow this link to subscribe/unsubscribe: >> >> > http://public.kitware.com/mailman/listinfo/vtkusers >> >> > >> >> >> >> >> >> >> >> -- >> >> | Aashish Chaudhary >> >> | Technical Leader >> >> | Kitware Inc. >> >> | http://www.kitware.com/company/team/chaudhary.html >> > >> > >> >> >> >> -- >> | Aashish Chaudhary >> | Technical Leader >> | Kitware Inc. >> | http://www.kitware.com/company/team/chaudhary.html >> > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Fri Mar 4 08:35:31 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 4 Mar 2016 06:35:31 -0700 Subject: [vtkusers] Problems Installing VTK-Python on OSX In-Reply-To: References: Message-ID: Hi Ranveer, The error "PyThreadState_Get: no current thread" almost always means that VTK was linked to the wrong version of Python. I know you said that you checked this, but I recommend that you load CMakeCache.txt into a text editor and do a thorough search to make sure that "python2" does not appear anywhere. My own OS X system builds VTK against Python 3.5. - David On Fri, Mar 4, 2016 at 12:25 AM, Ranveer Aggarwal wrote: > Hello all, > > I have been struggling with this problem for quite some time now. Here's > what I did. > > 1. Downloaded source tar.gz and untarred it. > 2. Went to the downloaded folder and made a build folder and ran ccmake .. > in it. > 3. Set Python Wrapping to on and set Python version as 3.5. Went to > advanced options and appropriately set all the Python 3.5 libraries. > 4. Generated the cmake and ran it. > 5. Ran make and then make install > 6. Added > "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/vtk/" > to PYTHONPATH. > > Now, when I run python3 and do an `import vtk`, I get > > Fatal Python error: PyThreadState_Get: no current thread > Segmentation fault: 11 > > and Python crashes. Any idea why this could be happening? Any help would > be highly appreciated. > -- > > Sincerely, > Ranveer Aggarwal > Indian Institute of Technology, Bombay > http://ranveeraggarwal.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Fri Mar 4 08:41:05 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 4 Mar 2016 06:41:05 -0700 Subject: [vtkusers] Requirements for multiple volumes in one render window In-Reply-To: References: Message-ID: There is a VTK journal publication that claims to render multiple volumes: http://www.vtkjournal.org/browse/publication/856 Is there anything of significance there? - David On Fri, Mar 4, 2016 at 6:27 AM, Jaime Campos wrote: > Hello everyone, > > I'm a new subscriber to this mailing list and I was reading this thread, > and I'm also interested in this functionality. > Currently I am using vtkOpenGLVolumeTextureMapper3D for two different > volumes that intersect in 3D space, and it happens to render the volumes > correctly by blending opacities and doing the correct compositioning > (because of the slicing it does internally, I believe, though not being > perfect). This also allows me to pick and interact with the vtkVolume props > independently, which is a must have for the functionality I am developing. > > The problem, as far as I know, is that with VTK 7.0 new rendering backend > (OpenGL 2), this mapper is no longer supported and the new GPU mappers > available, unfortunately, are not solving this issue yet. This feature > could also be applied to the iOS GPU volume mapper example. I wish I could > help you adding this functionality, but unfortunately I'm not familiar with > the internals of VTK in these modules, but I'm eager to learn. I hope I can > bump up the priority of this request ! > > Thank you, > > Best Regards, > > Jaime Campos > > 2016-03-04 11:00 GMT+00:00 Elvis Stansvik : > >> 2016-03-02 21:16 GMT+01:00 Aashish Chaudhary < >> aashish.chaudhary at kitware.com>: >> >>> Elvis, >>> >>> thanks for the detailed information. I thought about a way of doing >>> this. Basically, I think the mapper has to take multiple inputs and if >>> multiple inputs are present, then we will construct a BBox around it >>> and used that for traversing. Now, internally, we would have to >>> transform the data position to each volume so that we can perform the >>> lookup and set some rules on how to perform compositing (replace, >>> modulate etc.). I will talk to the team here and will add in our todo >>> but we would have check on the priority of it. >>> >> >> Thanks a lot for looking into this and bringing it up with the team. It >> would be a very welcome addition for us, and surely to some others as well. >> >> The approach you outline seems sound to me, but I am a layman in >> visualization :) >> >> >>> >>> If you want to help us with this then I am more happy to guide you >>> with the process. It won't be very difficult but will require some >>> careful changes to the existing mapper. >>> >> >> I'm afraid we're in the middle of a product launch here at work, so I'm >> quite swamped. This is only a small part of the application I'm building. >> I'm also completely new to VTK and visualization in general, so I'm also >> afraid it would be more difficult and time consuming for me than you might >> think (as opposed to a seasoned VTK dev). >> >> I'm of course prepared to try out any changes you do on our data sets, >> should you decide to work on this. >> >> Thanks again, >> Elvis >> >> >>> Thanks, >>> >>> >>> On Mon, Feb 29, 2016 at 11:46 AM, Elvis Stansvik >>> wrote: >>> > 2016-02-29 16:32 GMT+01:00 Aashish Chaudhary >>> > : >>> >> >>> >> Hi Elvis, >>> >> >>> >> On Sat, Feb 27, 2016 at 12:06 PM, Elvis Stansvik >>> >> wrote: >>> >> > 2016-02-25 17:10 GMT+01:00 Elvis Stansvik >>> >> > : >>> >> >> >>> >> >> Hi, >>> >> >> >>> >> >> From searching around, I think I've gathered that to render >>> multiple >>> >> >> volumes in a single window, each volume must have its own mapper >>> and >>> >> >> volume >>> >> >> property. They can't share mapper or property. >>> >> >> >>> >> >> My question is whether I must use separate renderers for each >>> volume as >>> >> >> well, or if I can use the same renderer for them all? >>> >> >> >>> >> >> Also, I did read something in an old post about problems with >>> rendering >>> >> >> multiple volumes that intersect (share a voxel). Is this still a >>> >> >> problem? >>> >> >> I'm using VTK 6.2 and the vtkVolumeRayCastMapper. >>> >> >> >>> >> >> Thanks in advance! >>> >> > >>> >> > >>> >> > Including Donny's answer here, to keep the thread intact: >>> >> > >>> >> >> See this thread: >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> http://vtk.1045678.n5.nabble.com/Rendering-multiple-volumes-td5734685.html#a5734971 >>> >> > >>> >> > Thanks, that clears some things up, and brings up some workarounds. >>> That >>> >> > thread was from oct/nov last year, so I guess it is still the case >>> that >>> >> > proper rendering of multiple volumes that share voxels in 3D space >>> is >>> >> > not >>> >> > possible? (even with 7.0?). >>> >> >>> >> It depends what you define proper. If you have two volumes and they >>> >> share the exact same space, you can combine them into one volume. When >>> >> they share the same space but do not overlap that's when things get >>> >> tricky since then the outcome depends on how do you want to handle >>> >> this disparity. There could be some other ways such as you combine the >>> >> volume into one. At the rendering level it could get tricky. >>> >> >>> >> What exactly you are trying to do. >>> > >>> > >>> > I see, what I would expect I think is composite rendering of the voxels >>> > using some composite rendering function / blending mode (perhaps >>> > configurable?). >>> > >>> > Sorry if my use case wasn't clear, I'm attaching a rough sketch I did >>> just >>> > now which should explain it better. >>> > >>> > Each of our volumes is a piece of a drill core (see my photo >>> previously in >>> > this thread). The pieces were scanned stacked on top of each other in a >>> > plastic tube inside our machine. During scanning, they are not >>> necessarily >>> > aligned properly (as shown in the sketch, and also in the photo). >>> > >>> > We will do some algorithmic alignment of the volumes, but we must also >>> allow >>> > the user to override / supplement the automatic alignment when it >>> fails. >>> > This means the user should be able to rotate and move (along Z axis) >>> the >>> > pieces until they align. It's like a pussle with pieces of a drill >>> core :) >>> > >>> > While the user is doing this, the volumes may intersect (noone is >>> perfect on >>> > the first try). This is why I'm asking about rendering multiple >>> volumes that >>> > partially intersect in 3D space. >>> > >>> > It's very desirable that the user can see inside the volumes while >>> doing >>> > this manual alignment, since the features (cracks, density variations, >>> ...) >>> > inside the rocks may be what guides the user in aligning the pieces >>> > properly. That's why I don't like the idea of letting the user work >>> with >>> > extracted isosurfaces or similar instead. >>> > >>> > Hope this clears things up a little! >>> > >>> > Elvis >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From mei.cai at yahoo.com Fri Mar 4 08:57:35 2016 From: mei.cai at yahoo.com (mei cai) Date: Fri, 4 Mar 2016 13:57:35 +0000 (UTC) Subject: [vtkusers] VTK MSB6006 cmd.exe code1 References: <210755958.2767242.1457099855361.JavaMail.yahoo.ref@mail.yahoo.com> Message-ID: <210755958.2767242.1457099855361.JavaMail.yahoo@mail.yahoo.com> Hi vtkusers: I got a MSB6006 cmd.exe code 1 error when I turn Build_Testing on, but it is off, the error is gone. I am using vtk7.0, cmake3.3.2. Is there anyone know how to fix this problem? Thanks so much! -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Fri Mar 4 09:04:14 2016 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Fri, 4 Mar 2016 15:04:14 +0100 Subject: [vtkusers] Convert vtkPiecewiseFunction to Hermite splines? Message-ID: Hi all, I'm interested in converting to/from Beziers to the Hermite form used by vtkPiecewiseFunction. The form used by vtkPiecewiseFunction is slightly special (never seen it before), in that it's based on the sharpness and midpoint parameters of the points. I'm struggling a little with converting these back to "normal" Hermite form (endpoints + endpoint derivatives) as described at e.g. Wikipedia [1], which would be a first step towards converting to/from Beziers (of course there's some closed formula for direct conversion to Beziers, but I'd like to do it in steps to understand it better). Has anyone been in the same situation, and could help out a slightly maths challenged person like myself? My use case is making an opacity transfer function editor that works with Beziers + straight line segments (so not like the editor in e.g. Paraview). Cheers, Elvis [1] https://en.wikipedia.org/wiki/Cubic_Hermite_spline -------------- next part -------------- An HTML attachment was scrubbed... URL: From mallikarjun49 at gmail.com Fri Mar 4 12:04:29 2016 From: mallikarjun49 at gmail.com (Mallikarjun K) Date: Fri, 4 Mar 2016 22:34:29 +0530 Subject: [vtkusers] vtkShaderProgram error :extension 'GL_EXT_gpu_Shader4' not supported VTK 7.0.0 In-Reply-To: References: Message-ID: Hi Chiang, Thanks for the response. With the same integrated gpu, vtk 6.1 gpuMapper doesn't complain like this.As vtk 7 is by default using opengl2 backend,I think I have missed something here.I updated my graphics drivers too.Still no luck.. With Kind Regards, Mallikarjun On Mar 4, 2016 9:48 PM, "WangQ" wrote: > Hello Mallikarjun, > > Not sure if it has any connection with vtk version, but I encountered the > same issue when an integrated gpu was used. The issue has gone now using a > dedicated gpu. > > cheers, > > Chiang > > ------------------------------ > Date: Fri, 4 Mar 2016 17:53:03 +0530 > From: mallikarjun49 at gmail.com > To: vtkusers at vtk.org > Subject: [vtkusers] vtkShaderProgram error :extension 'GL_EXT_gpu_Shader4' > not supported VTK 7.0.0 > > Hello all, > I am trying to migrate my volume rendering application from vtk 6.1 to vtk > 7.0, but I am getting an error like this.. > > [image: Inline image 1] > I am using vtkGPUVolumeRaycastMapper. > > My GPU details are: > > Renderer: Intel(R) HD Graphics 2000 > Memory: 2108 MB > Version: 3.1.0 - Build 9.17.10.4229 > > Any suggestions on this? > Thanks in advance. > > -- > *With Kind Regards:* > Mallikarjun > > > > _______________________________________________ Powered by www.kitware.com > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html Please keep messages > on-topic and check the VTK FAQ at: 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: 3708 bytes Desc: not available URL: From aashish.chaudhary at kitware.com Fri Mar 4 12:06:49 2016 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Fri, 4 Mar 2016 12:06:49 -0500 Subject: [vtkusers] vtkShaderProgram error :extension 'GL_EXT_gpu_Shader4' not supported VTK 7.0.0 In-Reply-To: References: Message-ID: The error is not related to volume rendering rathe the polygon rendering which uses this extension. It looks like you using a much older version of Intel graphics chip? Is that correct? Thanks, On Fri, Mar 4, 2016 at 12:04 PM, Mallikarjun K wrote: > Hi Chiang, > Thanks for the response. > With the same integrated gpu, vtk 6.1 gpuMapper doesn't complain like > this.As vtk 7 is by default using opengl2 backend,I think I have missed > something here.I updated my graphics drivers too.Still no luck.. > > With Kind Regards, > Mallikarjun > On Mar 4, 2016 9:48 PM, "WangQ" wrote: > >> Hello Mallikarjun, >> >> Not sure if it has any connection with vtk version, but I encountered the >> same issue when an integrated gpu was used. The issue has gone now using a >> dedicated gpu. >> >> cheers, >> >> Chiang >> >> ------------------------------ >> Date: Fri, 4 Mar 2016 17:53:03 +0530 >> From: mallikarjun49 at gmail.com >> To: vtkusers at vtk.org >> Subject: [vtkusers] vtkShaderProgram error :extension >> 'GL_EXT_gpu_Shader4' not supported VTK 7.0.0 >> >> >> Hello all, >> I am trying to migrate my volume rendering application from vtk 6.1 to >> vtk 7.0, but I am getting an error like this.. >> >> [image: Inline image 1] >> I am using vtkGPUVolumeRaycastMapper. >> >> My GPU details are: >> >> Renderer: Intel(R) HD Graphics 2000 >> Memory: 2108 MB >> Version: 3.1.0 - Build 9.17.10.4229 >> >> Any suggestions on this? >> Thanks in advance. >> >> -- >> *With Kind Regards:* >> Mallikarjun >> >> >> >> _______________________________________________ Powered by >> www.kitware.com Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html Please keep messages >> on-topic and check the VTK FAQ at: 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 > > -- *| Aashish Chaudhary | Technical Leader | Kitware Inc. * *| http://www.kitware.com/company/team/chaudhary.html * -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 3708 bytes Desc: not available URL: From mallikarjun49 at gmail.com Fri Mar 4 12:24:51 2016 From: mallikarjun49 at gmail.com (Mallikarjun K) Date: Fri, 4 Mar 2016 22:54:51 +0530 Subject: [vtkusers] vtkShaderProgram error :extension 'GL_EXT_gpu_Shader4' not supported VTK 7.0.0 In-Reply-To: References: Message-ID: Hi Aashish, Its Intel HD Graphics 2000, yes its bit older version but it does support opengl2 .when I see graphics properties of my machine with some third party opengl extension viewer it says that current opengl version is 3.1and it supports gl_ext_gpu_shader4. Thanks. With Kind Regards, Mallikarjun On Mar 4, 2016 10:36 PM, "Aashish Chaudhary" wrote: > The error is not related to volume rendering rathe the polygon rendering > which uses this extension. It looks like you using a much older version of > Intel graphics chip? Is that correct? > > Thanks, > > On Fri, Mar 4, 2016 at 12:04 PM, Mallikarjun K > wrote: > >> Hi Chiang, >> Thanks for the response. >> With the same integrated gpu, vtk 6.1 gpuMapper doesn't complain like >> this.As vtk 7 is by default using opengl2 backend,I think I have missed >> something here.I updated my graphics drivers too.Still no luck.. >> >> With Kind Regards, >> Mallikarjun >> On Mar 4, 2016 9:48 PM, "WangQ" wrote: >> >>> Hello Mallikarjun, >>> >>> Not sure if it has any connection with vtk version, but I encountered >>> the same issue when an integrated gpu was used. The issue has gone now >>> using a dedicated gpu. >>> >>> cheers, >>> >>> Chiang >>> >>> ------------------------------ >>> Date: Fri, 4 Mar 2016 17:53:03 +0530 >>> From: mallikarjun49 at gmail.com >>> To: vtkusers at vtk.org >>> Subject: [vtkusers] vtkShaderProgram error :extension >>> 'GL_EXT_gpu_Shader4' not supported VTK 7.0.0 >>> >>> >>> Hello all, >>> I am trying to migrate my volume rendering application from vtk 6.1 to >>> vtk 7.0, but I am getting an error like this.. >>> >>> [image: Inline image 1] >>> I am using vtkGPUVolumeRaycastMapper. >>> >>> My GPU details are: >>> >>> Renderer: Intel(R) HD Graphics 2000 >>> Memory: 2108 MB >>> Version: 3.1.0 - Build 9.17.10.4229 >>> >>> Any suggestions on this? >>> Thanks in advance. >>> >>> -- >>> *With Kind Regards:* >>> Mallikarjun >>> >>> >>> >>> _______________________________________________ Powered by >>> www.kitware.com Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html Please keep messages >>> on-topic and check the VTK FAQ at: 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 >> >> > > > -- > > > > *| Aashish Chaudhary | Technical Leader | Kitware Inc. * > *| http://www.kitware.com/company/team/chaudhary.html > * > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 3708 bytes Desc: not available URL: From ranveeraggarwal at gmail.com Fri Mar 4 12:31:13 2016 From: ranveeraggarwal at gmail.com (Ranveer Aggarwal) Date: Fri, 04 Mar 2016 17:31:13 +0000 Subject: [vtkusers] Problems Installing VTK-Python on OSX In-Reply-To: References: Message-ID: Hi David, I looked all over CMakeCache.txt and didn't find any instance of "python2". Any other possible fix? If not, I'll try Bernard's solution. Thanks for your suggestions :) On Fri, 4 Mar 2016 at 19:05 David Gobbi wrote: > Hi Ranveer, > > The error "PyThreadState_Get: no current thread" almost always means that > VTK was linked to the wrong version of Python. I know you said that you > checked this, but I recommend that you load CMakeCache.txt into a text > editor and do a thorough search to make sure that "python2" does not appear > anywhere. My own OS X system builds VTK against Python 3.5. > > - David > > > On Fri, Mar 4, 2016 at 12:25 AM, Ranveer Aggarwal < > ranveeraggarwal at gmail.com> wrote: > >> Hello all, >> >> I have been struggling with this problem for quite some time now. Here's >> what I did. >> >> 1. Downloaded source tar.gz and untarred it. >> 2. Went to the downloaded folder and made a build folder and ran ccmake >> .. in it. >> 3. Set Python Wrapping to on and set Python version as 3.5. Went to >> advanced options and appropriately set all the Python 3.5 libraries. >> 4. Generated the cmake and ran it. >> 5. Ran make and then make install >> 6. Added >> "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/vtk/" >> to PYTHONPATH. >> >> Now, when I run python3 and do an `import vtk`, I get >> >> Fatal Python error: PyThreadState_Get: no current thread >> Segmentation fault: 11 >> >> and Python crashes. Any idea why this could be happening? Any help would >> be highly appreciated. >> -- >> >> Sincerely, >> Ranveer Aggarwal >> Indian Institute of Technology, Bombay >> http://ranveeraggarwal.com >> > -- Sincerely, Ranveer Aggarwal Indian Institute of Technology, Bombay http://ranveeraggarwal.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Fri Mar 4 12:35:05 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 4 Mar 2016 10:35:05 -0700 Subject: [vtkusers] Problems Installing VTK-Python on OSX In-Reply-To: References: Message-ID: You should also try the executable that VTK built (bin/vtkpython) to see if it gives a different result from running python3 directly. On Fri, Mar 4, 2016 at 10:31 AM, Ranveer Aggarwal wrote: > Hi David, > > I looked all over CMakeCache.txt and didn't find any instance of > "python2". > Any other possible fix? > > If not, I'll try Bernard's solution. > > Thanks for your suggestions :) > > On Fri, 4 Mar 2016 at 19:05 David Gobbi wrote: > >> Hi Ranveer, >> >> The error "PyThreadState_Get: no current thread" almost always means that >> VTK was linked to the wrong version of Python. I know you said that you >> checked this, but I recommend that you load CMakeCache.txt into a text >> editor and do a thorough search to make sure that "python2" does not appear >> anywhere. My own OS X system builds VTK against Python 3.5. >> >> - David >> >> >> On Fri, Mar 4, 2016 at 12:25 AM, Ranveer Aggarwal < >> ranveeraggarwal at gmail.com> wrote: >> >>> Hello all, >>> >>> I have been struggling with this problem for quite some time now. Here's >>> what I did. >>> >>> 1. Downloaded source tar.gz and untarred it. >>> 2. Went to the downloaded folder and made a build folder and ran ccmake >>> .. in it. >>> 3. Set Python Wrapping to on and set Python version as 3.5. Went to >>> advanced options and appropriately set all the Python 3.5 libraries. >>> 4. Generated the cmake and ran it. >>> 5. Ran make and then make install >>> 6. Added >>> "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/vtk/" >>> to PYTHONPATH. >>> >>> Now, when I run python3 and do an `import vtk`, I get >>> >>> Fatal Python error: PyThreadState_Get: no current thread >>> Segmentation fault: 11 >>> >>> and Python crashes. Any idea why this could be happening? Any help would >>> be highly appreciated. >>> -- >>> >>> Sincerely, >>> Ranveer Aggarwal >>> Indian Institute of Technology, Bombay >>> http://ranveeraggarwal.com >>> >> -- > > Sincerely, > Ranveer Aggarwal > Indian Institute of Technology, Bombay > http://ranveeraggarwal.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.martin at kitware.com Fri Mar 4 12:32:49 2016 From: ken.martin at kitware.com (Ken Martin) Date: Fri, 4 Mar 2016 12:32:49 -0500 Subject: [vtkusers] vtkShaderProgram error :extension 'GL_EXT_gpu_Shader4' not supported VTK 7.0.0 In-Reply-To: References: Message-ID: <6CF42D21-B7D1-4732-999D-ED1A013C7954@kitware.com> There is a topic on this in gitlab for the hd 3000. It can be modified trivially to test on the 2000. I'm away from work but feel free to give it a shot Sent from my iPhone > On Mar 4, 2016, at 12:24 PM, Mallikarjun K wrote: > > Hi Aashish, > Its Intel HD Graphics 2000, yes its bit older version but it does support opengl2 .when I see graphics properties of my machine with some third party opengl extension viewer it says that current opengl version is 3.1and it supports gl_ext_gpu_shader4. > > Thanks. > > With Kind Regards, > Mallikarjun > >> On Mar 4, 2016 10:36 PM, "Aashish Chaudhary" wrote: >> The error is not related to volume rendering rathe the polygon rendering which uses this extension. It looks like you using a much older version of Intel graphics chip? Is that correct? >> >> Thanks, >> >>> On Fri, Mar 4, 2016 at 12:04 PM, Mallikarjun K wrote: >>> Hi Chiang, >>> Thanks for the response. >>> With the same integrated gpu, vtk 6.1 gpuMapper doesn't complain like this.As vtk 7 is by default using opengl2 backend,I think I have missed something here.I updated my graphics drivers too.Still no luck.. >>> >>> With Kind Regards, >>> Mallikarjun >>> >>>> On Mar 4, 2016 9:48 PM, "WangQ" wrote: >>>> Hello Mallikarjun, >>>> >>>> Not sure if it has any connection with vtk version, but I encountered the same issue when an integrated gpu was used. The issue has gone now using a dedicated gpu. >>>> >>>> cheers, >>>> >>>> Chiang >>>> >>>> Date: Fri, 4 Mar 2016 17:53:03 +0530 >>>> From: mallikarjun49 at gmail.com >>>> To: vtkusers at vtk.org >>>> Subject: [vtkusers] vtkShaderProgram error :extension 'GL_EXT_gpu_Shader4' not supported VTK 7.0.0 >>>> >>>> >>>> Hello all, >>>> I am trying to migrate my volume rendering application from vtk 6.1 to vtk 7.0, but I am getting an error like this.. >>>> >>>> >>>> I am using vtkGPUVolumeRaycastMapper. >>>> >>>> My GPU details are: >>>> >>>> Renderer: Intel(R) HD Graphics 2000 >>>> Memory: 2108 MB >>>> Version: 3.1.0 - Build 9.17.10.4229 >>>> >>>> Any suggestions on this? >>>> Thanks in advance. >>>> >>>> -- >>>> With Kind Regards: >>>> Mallikarjun >>>> >>>> >>>> >>>> _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: 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 >>> >> >> >> >> -- >> | Aashish Chaudhary >> | Technical Leader >> | Kitware Inc. >> | http://www.kitware.com/company/team/chaudhary.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From ranveeraggarwal at gmail.com Fri Mar 4 12:41:24 2016 From: ranveeraggarwal at gmail.com (Ranveer Aggarwal) Date: Fri, 04 Mar 2016 17:41:24 +0000 Subject: [vtkusers] Problems Installing VTK-Python on OSX In-Reply-To: References: Message-ID: When I use the vtkpython executable and do an `import vtk`, it works. On Fri, 4 Mar 2016 at 23:05 David Gobbi wrote: > You should also try the executable that VTK built (bin/vtkpython) to see > if it gives a different result from running python3 directly. > > On Fri, Mar 4, 2016 at 10:31 AM, Ranveer Aggarwal < > ranveeraggarwal at gmail.com> wrote: > >> Hi David, >> >> I looked all over CMakeCache.txt and didn't find any instance of >> "python2". >> Any other possible fix? >> >> If not, I'll try Bernard's solution. >> >> Thanks for your suggestions :) >> >> On Fri, 4 Mar 2016 at 19:05 David Gobbi wrote: >> >>> Hi Ranveer, >>> >>> The error "PyThreadState_Get: no current thread" almost always means >>> that VTK was linked to the wrong version of Python. I know you said that >>> you checked this, but I recommend that you load CMakeCache.txt into a text >>> editor and do a thorough search to make sure that "python2" does not appear >>> anywhere. My own OS X system builds VTK against Python 3.5. >>> >>> - David >>> >>> >>> On Fri, Mar 4, 2016 at 12:25 AM, Ranveer Aggarwal < >>> ranveeraggarwal at gmail.com> wrote: >>> >>>> Hello all, >>>> >>>> I have been struggling with this problem for quite some time now. >>>> Here's what I did. >>>> >>>> 1. Downloaded source tar.gz and untarred it. >>>> 2. Went to the downloaded folder and made a build folder and ran ccmake >>>> .. in it. >>>> 3. Set Python Wrapping to on and set Python version as 3.5. Went to >>>> advanced options and appropriately set all the Python 3.5 libraries. >>>> 4. Generated the cmake and ran it. >>>> 5. Ran make and then make install >>>> 6. Added >>>> "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/vtk/" >>>> to PYTHONPATH. >>>> >>>> Now, when I run python3 and do an `import vtk`, I get >>>> >>>> Fatal Python error: PyThreadState_Get: no current thread >>>> Segmentation fault: 11 >>>> >>>> and Python crashes. Any idea why this could be happening? Any help >>>> would be highly appreciated. >>>> -- >>>> >>>> Sincerely, >>>> Ranveer Aggarwal >>>> Indian Institute of Technology, Bombay >>>> http://ranveeraggarwal.com >>>> >>> -- >> >> Sincerely, >> Ranveer Aggarwal >> Indian Institute of Technology, Bombay >> http://ranveeraggarwal.com >> > > -- Sincerely, Ranveer Aggarwal Indian Institute of Technology, Bombay http://ranveeraggarwal.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From ranveeraggarwal at gmail.com Fri Mar 4 12:42:48 2016 From: ranveeraggarwal at gmail.com (Ranveer Aggarwal) Date: Fri, 04 Mar 2016 17:42:48 +0000 Subject: [vtkusers] Problems Installing VTK-Python on OSX In-Reply-To: References: Message-ID: I guess the `make install` didn't work as expected. Is there anything else I'm supposed to do after make install? On Fri, 4 Mar 2016 at 23:12 Ranveer Aggarwal wrote: > When I use the vtkpython executable and do an `import vtk`, it works. > > On Fri, 4 Mar 2016 at 23:05 David Gobbi wrote: > >> You should also try the executable that VTK built (bin/vtkpython) to see >> if it gives a different result from running python3 directly. >> >> On Fri, Mar 4, 2016 at 10:31 AM, Ranveer Aggarwal < >> ranveeraggarwal at gmail.com> wrote: >> >>> Hi David, >>> >>> I looked all over CMakeCache.txt and didn't find any instance of >>> "python2". >>> Any other possible fix? >>> >>> If not, I'll try Bernard's solution. >>> >>> Thanks for your suggestions :) >>> >>> On Fri, 4 Mar 2016 at 19:05 David Gobbi wrote: >>> >>>> Hi Ranveer, >>>> >>>> The error "PyThreadState_Get: no current thread" almost always means >>>> that VTK was linked to the wrong version of Python. I know you said that >>>> you checked this, but I recommend that you load CMakeCache.txt into a text >>>> editor and do a thorough search to make sure that "python2" does not appear >>>> anywhere. My own OS X system builds VTK against Python 3.5. >>>> >>>> - David >>>> >>>> >>>> On Fri, Mar 4, 2016 at 12:25 AM, Ranveer Aggarwal < >>>> ranveeraggarwal at gmail.com> wrote: >>>> >>>>> Hello all, >>>>> >>>>> I have been struggling with this problem for quite some time now. >>>>> Here's what I did. >>>>> >>>>> 1. Downloaded source tar.gz and untarred it. >>>>> 2. Went to the downloaded folder and made a build folder and ran >>>>> ccmake .. in it. >>>>> 3. Set Python Wrapping to on and set Python version as 3.5. Went to >>>>> advanced options and appropriately set all the Python 3.5 libraries. >>>>> 4. Generated the cmake and ran it. >>>>> 5. Ran make and then make install >>>>> 6. Added >>>>> "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/vtk/" >>>>> to PYTHONPATH. >>>>> >>>>> Now, when I run python3 and do an `import vtk`, I get >>>>> >>>>> Fatal Python error: PyThreadState_Get: no current thread >>>>> Segmentation fault: 11 >>>>> >>>>> and Python crashes. Any idea why this could be happening? Any help >>>>> would be highly appreciated. >>>>> -- >>>>> >>>>> Sincerely, >>>>> Ranveer Aggarwal >>>>> Indian Institute of Technology, Bombay >>>>> http://ranveeraggarwal.com >>>>> >>>> -- >>> >>> Sincerely, >>> Ranveer Aggarwal >>> Indian Institute of Technology, Bombay >>> http://ranveeraggarwal.com >>> >> >> -- > > Sincerely, > Ranveer Aggarwal > Indian Institute of Technology, Bombay > http://ranveeraggarwal.com > -- Sincerely, Ranveer Aggarwal Indian Institute of Technology, Bombay http://ranveeraggarwal.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mallikarjun49 at gmail.com Fri Mar 4 12:46:28 2016 From: mallikarjun49 at gmail.com (Mallikarjun K) Date: Fri, 4 Mar 2016 23:16:28 +0530 Subject: [vtkusers] vtkShaderProgram error :extension 'GL_EXT_gpu_Shader4' not supported VTK 7.0.0 In-Reply-To: <6CF42D21-B7D1-4732-999D-ED1A013C7954@kitware.com> References: <6CF42D21-B7D1-4732-999D-ED1A013C7954@kitware.com> Message-ID: Thanks Martin, I will look into it. With Kind Regards, Mallikarjun On Mar 4, 2016 11:02 PM, "Ken Martin" wrote: > There is a topic on this in gitlab for the hd 3000. It can be modified > trivially to test on the 2000. I'm away from work but feel free to give it > a shot > > > > Sent from my iPhone > > On Mar 4, 2016, at 12:24 PM, Mallikarjun K > wrote: > > Hi Aashish, > Its Intel HD Graphics 2000, yes its bit older version but it does support > opengl2 .when I see graphics properties of my machine with some third party > opengl extension viewer it says that current opengl version is 3.1and it > supports gl_ext_gpu_shader4. > > Thanks. > > With Kind Regards, > Mallikarjun > On Mar 4, 2016 10:36 PM, "Aashish Chaudhary" < > aashish.chaudhary at kitware.com> wrote: > >> The error is not related to volume rendering rathe the polygon rendering >> which uses this extension. It looks like you using a much older version of >> Intel graphics chip? Is that correct? >> >> Thanks, >> >> On Fri, Mar 4, 2016 at 12:04 PM, Mallikarjun K >> wrote: >> >>> Hi Chiang, >>> Thanks for the response. >>> With the same integrated gpu, vtk 6.1 gpuMapper doesn't complain like >>> this.As vtk 7 is by default using opengl2 backend,I think I have missed >>> something here.I updated my graphics drivers too.Still no luck.. >>> >>> With Kind Regards, >>> Mallikarjun >>> On Mar 4, 2016 9:48 PM, "WangQ" wrote: >>> >>>> Hello Mallikarjun, >>>> >>>> Not sure if it has any connection with vtk version, but I encountered >>>> the same issue when an integrated gpu was used. The issue has gone now >>>> using a dedicated gpu. >>>> >>>> cheers, >>>> >>>> Chiang >>>> >>>> ------------------------------ >>>> Date: Fri, 4 Mar 2016 17:53:03 +0530 >>>> From: mallikarjun49 at gmail.com >>>> To: vtkusers at vtk.org >>>> Subject: [vtkusers] vtkShaderProgram error :extension >>>> 'GL_EXT_gpu_Shader4' not supported VTK 7.0.0 >>>> >>>> >>>> Hello all, >>>> I am trying to migrate my volume rendering application from vtk 6.1 to >>>> vtk 7.0, but I am getting an error like this.. >>>> >>>> >>>> I am using vtkGPUVolumeRaycastMapper. >>>> >>>> My GPU details are: >>>> >>>> Renderer: Intel(R) HD Graphics 2000 >>>> Memory: 2108 MB >>>> Version: 3.1.0 - Build 9.17.10.4229 >>>> >>>> Any suggestions on this? >>>> Thanks in advance. >>>> >>>> -- >>>> *With Kind Regards:* >>>> Mallikarjun >>>> >>>> >>>> >>>> _______________________________________________ Powered by >>>> www.kitware.com Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html Please keep messages >>>> on-topic and check the VTK FAQ at: 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 >>> >>> >> >> >> -- >> >> >> >> *| Aashish Chaudhary | Technical Leader | Kitware Inc. >> * >> *| http://www.kitware.com/company/team/chaudhary.html >> * >> > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jaimefbc at gmail.com Fri Mar 4 13:37:51 2016 From: jaimefbc at gmail.com (Jaime Campos) Date: Fri, 4 Mar 2016 18:37:51 +0000 Subject: [vtkusers] Requirements for multiple volumes in one render window In-Reply-To: References: Message-ID: Hi David, Thanks for the answer. I read the publication you proposed but it seems the solution does not entirely fulfill our needs. As far as I understood, the authors claim to have created a concrete volume mapper class that handles multiple dataset inputs instead of one - which they called vtkOpenGLGPUMultiVolumeMapper. However, they are limited to only two datasets, meaning it is not a generalized approach to have 2 or more volumes in the scene. " (...) the generalization to any number of input datasets would require sending several arrays of 3D and 2D textures to the graphic card for the input datasets and their associated transfer functions (...)" Moreover, since each mapper only maps to one vtkVolume, we also lose the possiblity to have several vtkVolume props in the scene (corresponding to the different datasets), thus rendering impossible the individual interaction for each prop (pick, move, etc...). Best Regards, Jaime Campos 2016-03-04 13:41 GMT+00:00 David Gobbi : > There is a VTK journal publication that claims to render multiple volumes: > http://www.vtkjournal.org/browse/publication/856 > Is there anything of significance there? > > - David > > > On Fri, Mar 4, 2016 at 6:27 AM, Jaime Campos wrote: > >> Hello everyone, >> >> I'm a new subscriber to this mailing list and I was reading this thread, >> and I'm also interested in this functionality. >> Currently I am using vtkOpenGLVolumeTextureMapper3D for two different >> volumes that intersect in 3D space, and it happens to render the volumes >> correctly by blending opacities and doing the correct compositioning >> (because of the slicing it does internally, I believe, though not being >> perfect). This also allows me to pick and interact with the vtkVolume props >> independently, which is a must have for the functionality I am developing. >> >> The problem, as far as I know, is that with VTK 7.0 new rendering backend >> (OpenGL 2), this mapper is no longer supported and the new GPU mappers >> available, unfortunately, are not solving this issue yet. This feature >> could also be applied to the iOS GPU volume mapper example. I wish I could >> help you adding this functionality, but unfortunately I'm not familiar with >> the internals of VTK in these modules, but I'm eager to learn. I hope I can >> bump up the priority of this request ! >> >> Thank you, >> >> Best Regards, >> >> Jaime Campos >> >> 2016-03-04 11:00 GMT+00:00 Elvis Stansvik : >> >>> 2016-03-02 21:16 GMT+01:00 Aashish Chaudhary < >>> aashish.chaudhary at kitware.com>: >>> >>>> Elvis, >>>> >>>> thanks for the detailed information. I thought about a way of doing >>>> this. Basically, I think the mapper has to take multiple inputs and if >>>> multiple inputs are present, then we will construct a BBox around it >>>> and used that for traversing. Now, internally, we would have to >>>> transform the data position to each volume so that we can perform the >>>> lookup and set some rules on how to perform compositing (replace, >>>> modulate etc.). I will talk to the team here and will add in our todo >>>> but we would have check on the priority of it. >>>> >>> >>> Thanks a lot for looking into this and bringing it up with the team. It >>> would be a very welcome addition for us, and surely to some others as well. >>> >>> The approach you outline seems sound to me, but I am a layman in >>> visualization :) >>> >>> >>>> >>>> If you want to help us with this then I am more happy to guide you >>>> with the process. It won't be very difficult but will require some >>>> careful changes to the existing mapper. >>>> >>> >>> I'm afraid we're in the middle of a product launch here at work, so I'm >>> quite swamped. This is only a small part of the application I'm building. >>> I'm also completely new to VTK and visualization in general, so I'm also >>> afraid it would be more difficult and time consuming for me than you might >>> think (as opposed to a seasoned VTK dev). >>> >>> I'm of course prepared to try out any changes you do on our data sets, >>> should you decide to work on this. >>> >>> Thanks again, >>> Elvis >>> >>> >>>> Thanks, >>>> >>>> >>>> On Mon, Feb 29, 2016 at 11:46 AM, Elvis Stansvik >>>> wrote: >>>> > 2016-02-29 16:32 GMT+01:00 Aashish Chaudhary >>>> > : >>>> >> >>>> >> Hi Elvis, >>>> >> >>>> >> On Sat, Feb 27, 2016 at 12:06 PM, Elvis Stansvik >>>> >> wrote: >>>> >> > 2016-02-25 17:10 GMT+01:00 Elvis Stansvik >>>> >> > : >>>> >> >> >>>> >> >> Hi, >>>> >> >> >>>> >> >> From searching around, I think I've gathered that to render >>>> multiple >>>> >> >> volumes in a single window, each volume must have its own mapper >>>> and >>>> >> >> volume >>>> >> >> property. They can't share mapper or property. >>>> >> >> >>>> >> >> My question is whether I must use separate renderers for each >>>> volume as >>>> >> >> well, or if I can use the same renderer for them all? >>>> >> >> >>>> >> >> Also, I did read something in an old post about problems with >>>> rendering >>>> >> >> multiple volumes that intersect (share a voxel). Is this still a >>>> >> >> problem? >>>> >> >> I'm using VTK 6.2 and the vtkVolumeRayCastMapper. >>>> >> >> >>>> >> >> Thanks in advance! >>>> >> > >>>> >> > >>>> >> > Including Donny's answer here, to keep the thread intact: >>>> >> > >>>> >> >> See this thread: >>>> >> >> >>>> >> >> >>>> >> >> >>>> >> >> >>>> http://vtk.1045678.n5.nabble.com/Rendering-multiple-volumes-td5734685.html#a5734971 >>>> >> > >>>> >> > Thanks, that clears some things up, and brings up some >>>> workarounds. That >>>> >> > thread was from oct/nov last year, so I guess it is still the case >>>> that >>>> >> > proper rendering of multiple volumes that share voxels in 3D space >>>> is >>>> >> > not >>>> >> > possible? (even with 7.0?). >>>> >> >>>> >> It depends what you define proper. If you have two volumes and they >>>> >> share the exact same space, you can combine them into one volume. >>>> When >>>> >> they share the same space but do not overlap that's when things get >>>> >> tricky since then the outcome depends on how do you want to handle >>>> >> this disparity. There could be some other ways such as you combine >>>> the >>>> >> volume into one. At the rendering level it could get tricky. >>>> >> >>>> >> What exactly you are trying to do. >>>> > >>>> > >>>> > I see, what I would expect I think is composite rendering of the >>>> voxels >>>> > using some composite rendering function / blending mode (perhaps >>>> > configurable?). >>>> > >>>> > Sorry if my use case wasn't clear, I'm attaching a rough sketch I did >>>> just >>>> > now which should explain it better. >>>> > >>>> > Each of our volumes is a piece of a drill core (see my photo >>>> previously in >>>> > this thread). The pieces were scanned stacked on top of each other in >>>> a >>>> > plastic tube inside our machine. During scanning, they are not >>>> necessarily >>>> > aligned properly (as shown in the sketch, and also in the photo). >>>> > >>>> > We will do some algorithmic alignment of the volumes, but we must >>>> also allow >>>> > the user to override / supplement the automatic alignment when it >>>> fails. >>>> > This means the user should be able to rotate and move (along Z axis) >>>> the >>>> > pieces until they align. It's like a pussle with pieces of a drill >>>> core :) >>>> > >>>> > While the user is doing this, the volumes may intersect (noone is >>>> perfect on >>>> > the first try). This is why I'm asking about rendering multiple >>>> volumes that >>>> > partially intersect in 3D space. >>>> > >>>> > It's very desirable that the user can see inside the volumes while >>>> doing >>>> > this manual alignment, since the features (cracks, density >>>> variations, ...) >>>> > inside the rocks may be what guides the user in aligning the pieces >>>> > properly. That's why I don't like the idea of letting the user work >>>> with >>>> > extracted isosurfaces or similar instead. >>>> > >>>> > Hope this clears things up a little! >>>> > >>>> > Elvis >>>> >>> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Fri Mar 4 13:53:04 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 4 Mar 2016 11:53:04 -0700 Subject: [vtkusers] Problems Installing VTK-Python on OSX In-Reply-To: References: Message-ID: If vtkpython works for you, then check to see where it is finding its files: import vtk print(vtk.__file__) import vtkCommonCorePython print(vtkCommonCorePython.__file__) The "make install" might not copy the python modules into site-packages, so you might have to copy them yourself. My own experience with VTK's "make install" is limited, I always use VTK from the build directory. Cheers, - David On Fri, Mar 4, 2016 at 10:42 AM, Ranveer Aggarwal wrote: > I guess the `make install` didn't work as expected. Is there anything else > I'm supposed to do after make install? > > On Fri, 4 Mar 2016 at 23:12 Ranveer Aggarwal > wrote: > >> When I use the vtkpython executable and do an `import vtk`, it works. >> >> On Fri, 4 Mar 2016 at 23:05 David Gobbi wrote: >> >>> You should also try the executable that VTK built (bin/vtkpython) to see >>> if it gives a different result from running python3 directly. >>> >>> On Fri, Mar 4, 2016 at 10:31 AM, Ranveer Aggarwal < >>> ranveeraggarwal at gmail.com> wrote: >>> >>>> Hi David, >>>> >>>> I looked all over CMakeCache.txt and didn't find any instance of >>>> "python2". >>>> Any other possible fix? >>>> >>>> If not, I'll try Bernard's solution. >>>> >>>> Thanks for your suggestions :) >>>> >>>> On Fri, 4 Mar 2016 at 19:05 David Gobbi wrote: >>>> >>>>> Hi Ranveer, >>>>> >>>>> The error "PyThreadState_Get: no current thread" almost always means >>>>> that VTK was linked to the wrong version of Python. I know you said that >>>>> you checked this, but I recommend that you load CMakeCache.txt into a text >>>>> editor and do a thorough search to make sure that "python2" does not appear >>>>> anywhere. My own OS X system builds VTK against Python 3.5. >>>>> >>>>> - David >>>>> >>>>> >>>>> On Fri, Mar 4, 2016 at 12:25 AM, Ranveer Aggarwal < >>>>> ranveeraggarwal at gmail.com> wrote: >>>>> >>>>>> Hello all, >>>>>> >>>>>> I have been struggling with this problem for quite some time now. >>>>>> Here's what I did. >>>>>> >>>>>> 1. Downloaded source tar.gz and untarred it. >>>>>> 2. Went to the downloaded folder and made a build folder and ran >>>>>> ccmake .. in it. >>>>>> 3. Set Python Wrapping to on and set Python version as 3.5. Went to >>>>>> advanced options and appropriately set all the Python 3.5 libraries. >>>>>> 4. Generated the cmake and ran it. >>>>>> 5. Ran make and then make install >>>>>> 6. Added >>>>>> "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/vtk/" >>>>>> to PYTHONPATH. >>>>>> >>>>>> Now, when I run python3 and do an `import vtk`, I get >>>>>> >>>>>> Fatal Python error: PyThreadState_Get: no current thread >>>>>> Segmentation fault: 11 >>>>>> >>>>>> and Python crashes. Any idea why this could be happening? Any help >>>>>> would be highly appreciated. >>>>>> -- >>>>>> >>>>>> Sincerely, >>>>>> Ranveer Aggarwal >>>>>> Indian Institute of Technology, Bombay >>>>>> http://ranveeraggarwal.com >>>>>> >>>>> -- >>>> >>>> Sincerely, >>>> Ranveer Aggarwal >>>> Indian Institute of Technology, Bombay >>>> http://ranveeraggarwal.com >>>> >>> >>> -- >> >> Sincerely, >> Ranveer Aggarwal >> Indian Institute of Technology, Bombay >> http://ranveeraggarwal.com >> > -- > > Sincerely, > Ranveer Aggarwal > Indian Institute of Technology, Bombay > http://ranveeraggarwal.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kostadus at yahoo.com Sat Mar 5 07:01:37 2016 From: kostadus at yahoo.com (KMountris) Date: Sat, 5 Mar 2016 05:01:37 -0700 (MST) Subject: [vtkusers] Flipped vtkResliceImageViewer?? Why??? Message-ID: <1457179297954-5737041.post@n5.nabble.com> Dear vtk community, I would like to pose a question regarding the reslice image viewer which I use in my code for slice visualization of medical images. I import an mhd image using the vtkMetaImageReader and when i instantiate the viewer the image is flipped in the x, y axis. I tried to write the image using vktMetaImageWriter to check if there is a problem with the imported images but the result has the same orientation with my initial image. Does anyone now how to ensure the correct visualisation of the imported image? Thank you in advance for any kind replies. Best regards, Konstantinos. -- View this message in context: http://vtk.1045678.n5.nabble.com/Flipped-vtkResliceImageViewer-Why-tp5737041.html Sent from the VTK - Users mailing list archive at Nabble.com. From jose.de.paula at live.com Sat Mar 5 12:20:52 2016 From: jose.de.paula at live.com (Jose Barreto) Date: Sat, 5 Mar 2016 10:20:52 -0700 (MST) Subject: [vtkusers] Error with visibility vtkResliceCursorActor Message-ID: <1457198452584-5737044.post@n5.nabble.com> Hello, I am using vtkResliceImageViewer with vtkResliceCursor Line Representation. At one point I had to turn off the visibility of the lines representing the views Sagittal, Coronal and Axial. I used the following code. for (int i = 0; i < 3; ++i) { vtkSmartPointer rep = vtkResliceCursorLineRepresentation::SafeDownCast(obj_VTKCriarPanoramica->GetReslicerImageViewer(i)->GetResliceCursorWidget()->GetRepresentation()); rep->GetResliceCursorActor()->GetCenterlineProperty(0)->SetEdgeVisibility(0); rep->GetResliceCursorActor()->GetCenterlineProperty(1)->SetEdgeVisibility(0); rep->GetResliceCursorActor()->GetCenterlineProperty(2)->SetEdgeVisibility(0); } I did not succeed, the lines did not accept SetEdgeVisibility. I looked at vtkResliceCursorActor of code and saw that the void vtkResliceCursorActor :: UpdateViewProps (vtkViewport * v) It was ignored property visibildiade. The code always passes visibility to true. void vtkResliceCursorActor::UpdateViewProps(vtkViewport *v) { ... this->CursorThickSlabActor[axis1]->GetProperty()->SetEdgeVisibility(thickMode); this->CursorThickSlabActor[axis2]->GetProperty()->SetEdgeVisibility(thickMode); this->CursorThickSlabActor[axisNormal]->GetProperty()->SetEdgeVisibility(0); this->CursorCenterlineActor[axis1]->GetProperty()->SetEdgeVisibility(1); this->CursorCenterlineActor[axis2]->GetProperty()->SetEdgeVisibility(1); this->CursorCenterlineActor[axisNormal]->GetProperty()->SetEdgeVisibility(0); } *Is there any reason for this?* I changed the code to use the active exposure for the User. void vtkResliceCursorActor::UpdateViewProps(vtkViewport *v) { ... const bool visibleAxis1 = this->CursorCenterlineActor[axis1]->GetProperty()->GetEdgeVisibility() ? true : false; const bool visibleAxis2 = this->CursorCenterlineActor[axis2]->GetProperty()->GetEdgeVisibility() ? true : false; const bool visibleAxisNormal = this->CursorCenterlineActor[axisNormal]->GetProperty()->GetEdgeVisibility() ? true : false; this->CursorThickSlabActor[axis1]->GetProperty()->SetEdgeVisibility(thickMode); this->CursorThickSlabActor[axis2]->GetProperty()->SetEdgeVisibility(thickMode); this->CursorThickSlabActor[axisNormal]->GetProperty()->SetEdgeVisibility(thickMode); this->CursorCenterlineActor[axis1]->GetProperty()->SetEdgeVisibility(visibleAxis1); this->CursorCenterlineActor[axis2]->GetProperty()->SetEdgeVisibility(visibleAxis2); this->CursorCenterlineActor[axisNormal]->GetProperty()->SetEdgeVisibility(visibleAxisNormal); } -- View this message in context: http://vtk.1045678.n5.nabble.com/Error-with-visibility-vtkResliceCursorActor-tp5737044.html Sent from the VTK - Users mailing list archive at Nabble.com. From ich_daniel at habmalnefrage.de Sun Mar 6 07:45:26 2016 From: ich_daniel at habmalnefrage.de (-Daniel-) Date: Sun, 6 Mar 2016 05:45:26 -0700 (MST) Subject: [vtkusers] Issue with ProcrustesAlignmentFilter Message-ID: <1457268326478-5737046.post@n5.nabble.com> Hi there, I try the example from here . But instead of the Spheres used there, I would like to work with a number of points. In my testing, however no points are visible. Probably vtkAppendPoints is not the class for it. What could I use instead? Or how can I also use POLYDATA Objects? Code snippet of my attempt:/ public void testWithPoints(){ ... vtkAppendPoints append1 = new vtkAppendPoints(); append1.AddInputConnection(getPointOutput(4.6, 20.6, 18.6)); append1.AddInputConnection(getPointOutput(4.7, 21.8, 16.9)); append1.AddInputConnection(getPointOutput(6.6, 22.4, 17.7)); append1.AddInputConnection(getPointOutput(8.2, 20.0, 18.9)); vtkAppendPoints append2 = new vtkAppendPoints(); append2.AddInputConnection(getPointOutput(5.7, 21.0, 19.0)); append2.AddInputConnection(getPointOutput(5.0, 22.0, 17.2)); append2.AddInputConnection(getPointOutput(7.0, 23.5, 18.3)); append2.AddInputConnection(getPointOutput(9.2, 21.2, 19.5)); ArrayList list = new ArrayList<>(); list.add(append1.GetOutputPort()); list.add(append2.GetOutputPort()); vtkMultiBlockDataGroupFilter group = new vtkMultiBlockDataGroupFilter(); for (vtkAlgorithmOutput output : list) { group.AddInputConnection(output); } // further as in the example ... } //test with vtkPointSource private vtkAlgorithmOutput getPointOutput(double x, double y, double z) { vtkPointSource ps = new vtkPointSource(); ps.SetNumberOfPoints(1); ps.SetCenter(x, y, z); return ps.GetOutputPort(); }/ Does anybody advice? -- View this message in context: http://vtk.1045678.n5.nabble.com/Issue-with-ProcrustesAlignmentFilter-tp5737046.html Sent from the VTK - Users mailing list archive at Nabble.com. From rickfrank at me.com Sun Mar 6 21:56:51 2016 From: rickfrank at me.com (Richard Frank) Date: Sun, 06 Mar 2016 21:56:51 -0500 Subject: [vtkusers] Moving an actor, after about 1.5 hours. Message-ID: <65445CB4-B314-4465-B445-7C1F58B439DB@me.com> We are moving an actor(s) ( assemblies ) in multiple QtViews that represent a set of surgical tools. In one of our unit tests, the tools are moved for approximately 1 - 1.5 hours and after that time period the tools no longer " move" during rendering, even though different position data is being set to them via SetUserTranform. There are, as far as we can tell; no reported memory leaks; no memory overwrites, and no reported OpenGL errors. When I trace into vtkOpenGLActor nothing appears to be amiss. This is on two different machines one with a quadro 5000m and the other with a high end geoforce card. If we use a keystroke to remove and add the actors back into the renderer, this will usually fix the problem, but we want to get to the root cause. I'd appreciate any tips on how to debug this. Thanks Rick Sent from my iPad From david.gobbi at gmail.com Sun Mar 6 22:18:44 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Sun, 6 Mar 2016 20:18:44 -0700 Subject: [vtkusers] Moving an actor, after about 1.5 hours. In-Reply-To: <65445CB4-B314-4465-B445-7C1F58B439DB@me.com> References: <65445CB4-B314-4465-B445-7C1F58B439DB@me.com> Message-ID: Is this on Windows? VTK uses a 32-bit global MTime on Windows. Call GetMTime() on your actor to see if the MTime is approaching the limit. If you find that the MTime overflow is indeed the problem, then complain. Complain loudly. The MTime issue has been in the bugtracker for years. - David On Sun, Mar 6, 2016 at 7:56 PM, Richard Frank wrote: > We are moving an actor(s) ( assemblies ) in multiple QtViews that > represent a set of surgical tools. > > In one of our unit tests, the tools are moved for approximately 1 - 1.5 > hours and after that time period the tools no longer " move" during > rendering, even though different position data is being set to them via > SetUserTranform. > > There are, as far as we can tell; no reported memory leaks; no memory > overwrites, and no reported OpenGL errors. When I trace into vtkOpenGLActor > nothing appears to be amiss. This is on two different machines one with a > quadro 5000m and the other with a high end geoforce card. > > If we use a keystroke to remove and add the actors back into the renderer, > this will usually fix the problem, but we want to get to the root cause. > > I'd appreciate any tips on how to debug this. > > > Thanks > Rick > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronaldvanduren at hotmail.com Mon Mar 7 04:24:59 2016 From: ronaldvanduren at hotmail.com (Ronald van Duren) Date: Mon, 7 Mar 2016 09:24:59 +0000 Subject: [vtkusers] Weird data and SEGFAULT when using vtkIterativeClosestPointTransform Message-ID: Hi, I want to create a point cloud by moving and rotating my depth sensor(Structure Sensor). I figured out ICP is probably the way to go since I can get a tranformation matrix which I can use to shift the sensors frame left, right up or down. Otherwise the points would be drawn on top of each other in static frame of 640x480. After some time I got the vtkIterativeClosestPointTransform to work, I used the example provided by VTK. But the transformation matrix has weird data in it, sometimes it has several NaN values in it and the overal data in the matrix just doesn't seem right. My linear algebra skills are intermediate so I could be wrong. Also, when I move the sensor with a speed that is anything more than extremely slow a segfault is thrown. Because the source code is compiled I cannot trace down the segfault. Any chance somebody knows what's wrong? Thanks in advance! Ronald van Duren. Technical information: * ?I use Android and specifically the NDK so everything is in C++. * I use the compiled dynamic library for Android, Armeabi-v7a. * I use the Structure Sensor. * VTK version is 2.4.9. -------------- next part -------------- An HTML attachment was scrubbed... URL: From emredeniz18 at hotmail.com Mon Mar 7 05:00:41 2016 From: emredeniz18 at hotmail.com (emredeniz) Date: Mon, 7 Mar 2016 03:00:41 -0700 (MST) Subject: [vtkusers] I've need your helps about vtk mouse position any time without clicking Message-ID: <1457344841687-5737052.post@n5.nabble.com> Hi all , 1. I need mouse position anytime without clicking 2. How to update renderwindow interactor's window size only for image. I mean, when my mouse moved, if the cursor on the image, it should give the position. Thanks . Have a nice day . -- View this message in context: http://vtk.1045678.n5.nabble.com/I-ve-need-your-helps-about-vtk-mouse-position-any-time-without-clicking-tp5737052.html Sent from the VTK - Users mailing list archive at Nabble.com. From f.nellmeldin at open-engineering.com Mon Mar 7 05:54:10 2016 From: f.nellmeldin at open-engineering.com (Fernando Nellmeldin) Date: Mon, 7 Mar 2016 11:54:10 +0100 Subject: [vtkusers] Show a text for a limited period of time In-Reply-To: References: Message-ID: Hello, does anyone know if this is possible with VTK? Thank you. Fernando. 2016-03-01 10:08 GMT+01:00 Fernando Nellmeldin < f.nellmeldin at open-engineering.com>: > Hello all. > > I would like to show a text in screen and this text should disappear after > a few seconds (3~4). For example, the text should say: "Screenshot saved" > and then disappear. For me, doesn't matter if the vtkTextActor gets deleted > or its visibility gets turned off. > > How can this be achieved with VTK? Please note that my VTK window is > embedded in a Qt application window. > > I've done this before with pure OpenGL, but in that case I had access to > the "while (true)" loop of the application and I could ask each frame how > many seconds have passed. I am completely lost on this subject when using > VTK. > > Thank you! > > Fernando. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From softplanner at gmail.com Mon Mar 7 06:05:13 2016 From: softplanner at gmail.com (Muhammad Jawad) Date: Mon, 7 Mar 2016 12:05:13 +0100 Subject: [vtkusers] how to change vtkImageBlend opacity Message-ID: Dear Vtk users, I am using vtkimageblend class for multiple volumes and want to change opacity of volumes. Here I put the small code for single volume for simplicity. ImageViewer is working fine but opacity is not working. Any body have an idea that what I'm doing wrong here ? vtkSmartPointer blend = vtkSmartPointer::New(); blend->SetInputData(0, reader->GetOutput()); blend->SetOpacity(0, 0.3); vtkSmartPointer imgViewer = vtkSmartPointer::New(); imgViewer->SetInputData(blend->GetOutput()); imgViewer->UpdateDisplayExtent(); -- Regards, Muhammad Jawad -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickfrank at me.com Mon Mar 7 06:38:21 2016 From: rickfrank at me.com (Richard Frank) Date: Mon, 07 Mar 2016 06:38:21 -0500 Subject: [vtkusers] Moving an actor, after about 1.5 hours. In-Reply-To: References: <65445CB4-B314-4465-B445-7C1F58B439DB@me.com> Message-ID: Yes, Windows. That may X plain things. Is there a work around? Can we reset this somewhere to - 0, current time, or something else? Thanks Rick Sent from my iPad > On Mar 6, 2016, at 10:18 PM, David Gobbi wrote: > > Is this on Windows? VTK uses a 32-bit global MTime on Windows. Call GetMTime() on your actor to see if the MTime is approaching the limit. If you find that the MTime overflow is indeed the problem, then complain. Complain loudly. The MTime issue has been in the bugtracker for years. > > - David > >> On Sun, Mar 6, 2016 at 7:56 PM, Richard Frank wrote: >> We are moving an actor(s) ( assemblies ) in multiple QtViews that represent a set of surgical tools. >> >> In one of our unit tests, the tools are moved for approximately 1 - 1.5 hours and after that time period the tools no longer " move" during rendering, even though different position data is being set to them via SetUserTranform. >> >> There are, as far as we can tell; no reported memory leaks; no memory overwrites, and no reported OpenGL errors. When I trace into vtkOpenGLActor nothing appears to be amiss. This is on two different machines one with a quadro 5000m and the other with a high end geoforce card. >> >> If we use a keystroke to remove and add the actors back into the renderer, this will usually fix the problem, but we want to get to the root cause. >> >> I'd appreciate any tips on how to debug this. >> >> >> Thanks >> Rick -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickfrank at me.com Mon Mar 7 07:20:41 2016 From: rickfrank at me.com (Richard Frank) Date: Mon, 07 Mar 2016 07:20:41 -0500 Subject: [vtkusers] Moving an actor, after about 1.5 hours. In-Reply-To: References: <65445CB4-B314-4465-B445-7C1F58B439DB@me.com> Message-ID: <82BD95A8-EA8A-4F73-A2F2-E08E74EB755B@me.com> Hi David, A bit of looking at the documentation shows vtkTimeStamp having an unsigned long monotonically increasing, which on Windows 64 bit is 32 bits. A seemingly "simple" work around for us would seem to be to redefine the mvar to be a uint64_t and rebuild VTK. That would seem to double the time length. But I wonder then why this wasn't done before? There must be some unwanted side effects? Possible memory issues ( points having their own vtkTimeStamp)? Thanks Rick Sent from my iPad > On Mar 6, 2016, at 10:18 PM, David Gobbi wrote: > > Is this on Windows? VTK uses a 32-bit global MTime on Windows. Call GetMTime() on your actor to see if the MTime is approaching the limit. If you find that the MTime overflow is indeed the problem, then complain. Complain loudly. The MTime issue has been in the bugtracker for years. > > - David > >> On Sun, Mar 6, 2016 at 7:56 PM, Richard Frank wrote: >> We are moving an actor(s) ( assemblies ) in multiple QtViews that represent a set of surgical tools. >> >> In one of our unit tests, the tools are moved for approximately 1 - 1.5 hours and after that time period the tools no longer " move" during rendering, even though different position data is being set to them via SetUserTranform. >> >> There are, as far as we can tell; no reported memory leaks; no memory overwrites, and no reported OpenGL errors. When I trace into vtkOpenGLActor nothing appears to be amiss. This is on two different machines one with a quadro 5000m and the other with a high end geoforce card. >> >> If we use a keystroke to remove and add the actors back into the renderer, this will usually fix the problem, but we want to get to the root cause. >> >> I'd appreciate any tips on how to debug this. >> >> >> Thanks >> Rick -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.martin at kitware.com Mon Mar 7 08:20:19 2016 From: ken.martin at kitware.com (Ken Martin) Date: Mon, 7 Mar 2016 08:20:19 -0500 Subject: [vtkusers] Moving an actor, after about 1.5 hours. In-Reply-To: <82BD95A8-EA8A-4F73-A2F2-E08E74EB755B@me.com> References: <65445CB4-B314-4465-B445-7C1F58B439DB@me.com> <82BD95A8-EA8A-4F73-A2F2-E08E74EB755B@me.com> Message-ID: Doubling the size would increase the run time by a factor of 4.3 billion o.O On Mon, Mar 7, 2016 at 7:20 AM, Richard Frank wrote: > Hi David, > > A bit of looking at the documentation shows vtkTimeStamp having an > unsigned long monotonically increasing, which on Windows 64 bit is 32 bits. > > A seemingly "simple" work around for us would seem to be to redefine the > mvar to be a uint64_t and rebuild VTK. That would seem to double the time > length. > > But I wonder then why this wasn't done before? There must be some unwanted > side effects? Possible memory issues ( points having their own > vtkTimeStamp)? > > Thanks > > Rick > > > Sent from my iPad > > On Mar 6, 2016, at 10:18 PM, David Gobbi wrote: > > Is this on Windows? VTK uses a 32-bit global MTime on Windows. Call > GetMTime() on your actor to see if the MTime is approaching the limit. If > you find that the MTime overflow is indeed the problem, then complain. > Complain loudly. The MTime issue has been in the bugtracker for years. > > - David > > On Sun, Mar 6, 2016 at 7:56 PM, Richard Frank wrote: > >> We are moving an actor(s) ( assemblies ) in multiple QtViews that >> represent a set of surgical tools. >> >> In one of our unit tests, the tools are moved for approximately 1 - 1.5 >> hours and after that time period the tools no longer " move" during >> rendering, even though different position data is being set to them via >> SetUserTranform. >> >> There are, as far as we can tell; no reported memory leaks; no memory >> overwrites, and no reported OpenGL errors. When I trace into vtkOpenGLActor >> nothing appears to be amiss. This is on two different machines one with a >> quadro 5000m and the other with a high end geoforce card. >> >> If we use a keystroke to remove and add the actors back into the >> renderer, this will usually fix the problem, but we want to get to the root >> cause. >> >> I'd appreciate any tips on how to debug this. >> >> >> Thanks >> Rick >> > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 david.gobbi at gmail.com Mon Mar 7 08:22:32 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 7 Mar 2016 06:22:32 -0700 Subject: [vtkusers] Moving an actor, after about 1.5 hours. In-Reply-To: <82BD95A8-EA8A-4F73-A2F2-E08E74EB755B@me.com> References: <65445CB4-B314-4465-B445-7C1F58B439DB@me.com> <82BD95A8-EA8A-4F73-A2F2-E08E74EB755B@me.com> Message-ID: Hi Richard, Did you confirm that the MTime overflow is what is causing your software to fail? Also, what Ken said. - David On Mon, Mar 7, 2016 at 5:20 AM, Richard Frank wrote: > Hi David, > > A bit of looking at the documentation shows vtkTimeStamp having an > unsigned long monotonically increasing, which on Windows 64 bit is 32 bits. > > A seemingly "simple" work around for us would seem to be to redefine the > mvar to be a uint64_t and rebuild VTK. That would seem to double the time > length. > > But I wonder then why this wasn't done before? There must be some unwanted > side effects? Possible memory issues ( points having their own > vtkTimeStamp)? > > Thanks > > Rick > > > Sent from my iPad > > On Mar 6, 2016, at 10:18 PM, David Gobbi wrote: > > Is this on Windows? VTK uses a 32-bit global MTime on Windows. Call > GetMTime() on your actor to see if the MTime is approaching the limit. If > you find that the MTime overflow is indeed the problem, then complain. > Complain loudly. The MTime issue has been in the bugtracker for years. > > - David > > On Sun, Mar 6, 2016 at 7:56 PM, Richard Frank wrote: > >> We are moving an actor(s) ( assemblies ) in multiple QtViews that >> represent a set of surgical tools. >> >> In one of our unit tests, the tools are moved for approximately 1 - 1.5 >> hours and after that time period the tools no longer " move" during >> rendering, even though different position data is being set to them via >> SetUserTranform. >> >> There are, as far as we can tell; no reported memory leaks; no memory >> overwrites, and no reported OpenGL errors. When I trace into vtkOpenGLActor >> nothing appears to be amiss. This is on two different machines one with a >> quadro 5000m and the other with a high end geoforce card. >> >> If we use a keystroke to remove and add the actors back into the >> renderer, this will usually fix the problem, but we want to get to the root >> cause. >> >> I'd appreciate any tips on how to debug this. >> >> >> Thanks >> Rick >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickfrank at me.com Mon Mar 7 08:43:31 2016 From: rickfrank at me.com (Richard Frank) Date: Mon, 07 Mar 2016 08:43:31 -0500 Subject: [vtkusers] Moving an actor, after about 1.5 hours. In-Reply-To: References: <65445CB4-B314-4465-B445-7C1F58B439DB@me.com> <82BD95A8-EA8A-4F73-A2F2-E08E74EB755B@me.com> Message-ID: <8BF034EC-7C7C-44A1-867C-22FB4382C0D8@me.com> Not yet. That will be next step. Seems plausible since I can't find after quite a bit of testing any leaks, OpenGL errors reported, and testing on different systems with different Nvidia cards. etc, and tracing into VTK ( although trying to trace through all the calls to executive, algorithm, superclass, etc is quite cumbersome). Things just fail to move, silently. I found another post where someone had a slightly similar problem and said removing and re-adding actors fixed the problem, which we also seem to see..... How would removing and adding the actors back into the renderer " fix" this? Also, why the runtime hit on a 64 bit build?. Thanks Rick Sent from my iPad > On Mar 7, 2016, at 8:22 AM, David Gobbi wrote: > > Hi Richard, > > Did you confirm that the MTime overflow is what is causing your software to fail? > Also, what Ken said. > > - David > >> On Mon, Mar 7, 2016 at 5:20 AM, Richard Frank wrote: >> Hi David, >> >> A bit of looking at the documentation shows vtkTimeStamp having an unsigned long monotonically increasing, which on Windows 64 bit is 32 bits. >> >> A seemingly "simple" work around for us would seem to be to redefine the mvar to be a uint64_t and rebuild VTK. That would seem to double the time length. >> >> But I wonder then why this wasn't done before? There must be some unwanted side effects? Possible memory issues ( points having their own vtkTimeStamp)? >> >> Thanks >> >> Rick >> >> >> Sent from my iPad >> >>> On Mar 6, 2016, at 10:18 PM, David Gobbi wrote: >>> >> >>> Is this on Windows? VTK uses a 32-bit global MTime on Windows. Call GetMTime() on your actor to see if the MTime is approaching the limit. If you find that the MTime overflow is indeed the problem, then complain. Complain loudly. The MTime issue has been in the bugtracker for years. >>> >>> - David >>> >>>> On Sun, Mar 6, 2016 at 7:56 PM, Richard Frank wrote: >>>> We are moving an actor(s) ( assemblies ) in multiple QtViews that represent a set of surgical tools. >>>> >>>> In one of our unit tests, the tools are moved for approximately 1 - 1.5 hours and after that time period the tools no longer " move" during rendering, even though different position data is being set to them via SetUserTranform. >>>> >>>> There are, as far as we can tell; no reported memory leaks; no memory overwrites, and no reported OpenGL errors. When I trace into vtkOpenGLActor nothing appears to be amiss. This is on two different machines one with a quadro 5000m and the other with a high end geoforce card. >>>> >>>> If we use a keystroke to remove and add the actors back into the renderer, this will usually fix the problem, but we want to get to the root cause. >>>> >>>> I'd appreciate any tips on how to debug this. >>>> >>>> >>>> Thanks >>>> Rick > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Mon Mar 7 08:53:08 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 7 Mar 2016 06:53:08 -0700 Subject: [vtkusers] how to change vtkImageBlend opacity In-Reply-To: References: Message-ID: Hi Muhammad, The vtkImageBlend filter does not add an alpha component to the image. If the first input to vtkImageBlend is RGB, then the output is RGB. This filter will blend its inputs together, but given just one input, the output will just be a copy of the input. If your image is greyscale, you can use vtkImageMapToColors to add an alpha component, by using the SetOutputFormatToRGBA() option. - David On Mon, Mar 7, 2016 at 4:05 AM, Muhammad Jawad wrote: > > Dear Vtk users, > > I am using vtkimageblend class for multiple volumes and want to change > opacity of volumes. Here I put the small code for single volume for > simplicity. > > ImageViewer is working fine but opacity is not working. > > > Any body have an idea that what I'm doing wrong here ? > > > vtkSmartPointer blend = vtkSmartPointer::New(); > > > blend->SetInputData(0, reader->GetOutput()); > > > blend->SetOpacity(0, 0.3); > > > vtkSmartPointer imgViewer = vtkSmartPointer::New(); > > > imgViewer->SetInputData(blend->GetOutput()); > > > imgViewer->UpdateDisplayExtent(); > > > > > > -- > > Regards, > > Muhammad Jawad > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bruno.manata.oliveira at gmail.com Mon Mar 7 09:01:50 2016 From: bruno.manata.oliveira at gmail.com (Bruno Oliveira) Date: Mon, 7 Mar 2016 14:01:50 +0000 Subject: [vtkusers] Manually setting user view transform Message-ID: Hello, I'm trying to manually set the view matrix, and I'm doing so in the following way vtkSmartPointer trans_mat = vtkSmartPointer::New(); vtkSmartPointer trans = vtkSmartPointer::New(); trans_mat->Identity(); trans_mat->SetElement(2, 3, -40); trans->SetMatrix(trans_mat); camera->SetUserViewTransform(trans); This renders the expected results, but after that, if I try to move the scene with my mouse, everything disappears and I can't track my model anymore. What could be happening? -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Mon Mar 7 09:07:39 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 7 Mar 2016 07:07:39 -0700 Subject: [vtkusers] Moving an actor, after about 1.5 hours. In-Reply-To: <8BF034EC-7C7C-44A1-867C-22FB4382C0D8@me.com> References: <65445CB4-B314-4465-B445-7C1F58B439DB@me.com> <82BD95A8-EA8A-4F73-A2F2-E08E74EB755B@me.com> <8BF034EC-7C7C-44A1-867C-22FB4382C0D8@me.com> Message-ID: On Mon, Mar 7, 2016 at 6:43 AM, Richard Frank wrote: > > Not yet. That will be next step. Seems plausible since I can't find after > quite a bit of testing any leaks, OpenGL errors reported, and testing on > different systems with different Nvidia cards. etc, and tracing into VTK ( > although trying to trace through all the calls to executive, algorithm, > superclass, etc is quite cumbersome). Things just fail to move, silently. > As far as I'm aware, the only reason that VTK hasn't yet switched to a 64-bit MTime everywhere is that there would be backwards compatibility problems (GetMTime is a virtual method that is overridden in many subclasses). I found another post where someone had a slightly similar problem and said > removing and re-adding actors fixed the problem, which we also seem to > see..... > The VTK pipeline uses the difference between timestamps to as an indicator for when to undertake certain actions. So it is likely that problems only arise when this "difference" between two crucial timestamps exceeds the 32-bit limit. That's why re-adding actors might fix the problem. > Also, why the runtime hit on a 64 bit build?. > What are you referring to? (I rarely use Windows, and when I do, I use 32-bit builds). - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickfrank at me.com Mon Mar 7 09:11:22 2016 From: rickfrank at me.com (Richard Frank) Date: Mon, 07 Mar 2016 09:11:22 -0500 Subject: [vtkusers] Moving an actor, after about 1.5 hours. In-Reply-To: References: <65445CB4-B314-4465-B445-7C1F58B439DB@me.com> <82BD95A8-EA8A-4F73-A2F2-E08E74EB755B@me.com> <8BF034EC-7C7C-44A1-867C-22FB4382C0D8@me.com> Message-ID: <0D98110E-03D2-4042-97F8-28334E67EEA3@me.com> Ken Martin said previously "Doubling the size would increase the run time by a factor of 4.3 billion o.O" Sent from my iPad > On Mar 7, 2016, at 9:07 AM, David Gobbi wrote: > >> On Mon, Mar 7, 2016 at 6:43 AM, Richard Frank wrote: >> >> Not yet. That will be next step. Seems plausible since I can't find after quite a bit of testing any leaks, OpenGL errors reported, and testing on different systems with different Nvidia cards. etc, and tracing into VTK ( although trying to trace through all the calls to executive, algorithm, superclass, etc is quite cumbersome). Things just fail to move, silently. > > As far as I'm aware, the only reason that VTK hasn't yet switched to a 64-bit MTime everywhere is that there would be backwards compatibility problems (GetMTime is a virtual method that is overridden in many subclasses). > >> I found another post where someone had a slightly similar problem and said removing and re-adding actors fixed the problem, which we also seem to see..... > > The VTK pipeline uses the difference between timestamps to as an indicator for when to undertake certain actions. So it is likely that problems only arise when this "difference" between two crucial timestamps exceeds the 32-bit limit. That's why re-adding actors might fix the problem. > >> Also, why the runtime hit on a 64 bit build?. > > What are you referring to? (I rarely use Windows, and when I do, I use 32-bit builds). > > - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From emredeniz18 at hotmail.com Mon Mar 7 09:11:47 2016 From: emredeniz18 at hotmail.com (emredeniz) Date: Mon, 7 Mar 2016 07:11:47 -0700 (MST) Subject: [vtkusers] how to display dicom in 12 bit allocated Message-ID: <1457359907948-5737065.post@n5.nabble.com> Hi; I display dicom images but it's incorrect. bit=reader->GetBitsAllocated(); when ? do this, it returns 8 bit allocated How to display it in 12 bbit?Any method or function? Thanks. -- View this message in context: http://vtk.1045678.n5.nabble.com/how-to-display-dicom-in-12-bit-allocated-tp5737065.html Sent from the VTK - Users mailing list archive at Nabble.com. From rickfrank at me.com Mon Mar 7 09:25:26 2016 From: rickfrank at me.com (Richard Frank) Date: Mon, 07 Mar 2016 09:25:26 -0500 Subject: [vtkusers] Moving an actor, after about 1.5 hours. In-Reply-To: References: <65445CB4-B314-4465-B445-7C1F58B439DB@me.com> <82BD95A8-EA8A-4F73-A2F2-E08E74EB755B@me.com> <8BF034EC-7C7C-44A1-867C-22FB4382C0D8@me.com> Message-ID: Oh never mind - increase the runnable time not run time :>} Sent from my iPad > On Mar 7, 2016, at 9:07 AM, David Gobbi wrote: > >> On Mon, Mar 7, 2016 at 6:43 AM, Richard Frank wrote: >> >> Not yet. That will be next step. Seems plausible since I can't find after quite a bit of testing any leaks, OpenGL errors reported, and testing on different systems with different Nvidia cards. etc, and tracing into VTK ( although trying to trace through all the calls to executive, algorithm, superclass, etc is quite cumbersome). Things just fail to move, silently. > > As far as I'm aware, the only reason that VTK hasn't yet switched to a 64-bit MTime everywhere is that there would be backwards compatibility problems (GetMTime is a virtual method that is overridden in many subclasses). > >> I found another post where someone had a slightly similar problem and said removing and re-adding actors fixed the problem, which we also seem to see..... > > The VTK pipeline uses the difference between timestamps to as an indicator for when to undertake certain actions. So it is likely that problems only arise when this "difference" between two crucial timestamps exceeds the 32-bit limit. That's why re-adding actors might fix the problem. > >> Also, why the runtime hit on a 64 bit build?. > > What are you referring to? (I rarely use Windows, and when I do, I use 32-bit builds). > > - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From softplanner at gmail.com Mon Mar 7 09:33:04 2016 From: softplanner at gmail.com (Muhammad Jawad) Date: Mon, 7 Mar 2016 15:33:04 +0100 Subject: [vtkusers] how to change vtkImageBlend opacity In-Reply-To: References: Message-ID: Hi David, thanks for your suggestions. I did the same as you mentioned, It add lookup table still opacity is not working. Perhaps, I did some wrong in my code. connectorDicom = LoadDicomReader(dirPath.toStdString()); vtkSmartPointer imgFirstColorMap = vtkSmartPointer::New(); // hot color map imgFirstColorMap->SetRange( 0.0, 255.0 ); imgFirstColorMap->SetHueRange( 0.0, 0.1 ); imgFirstColorMap->SetValueRange( 0.4, 0.8 ); imgFirstColorMap->Build(); vtkSmartPointer firstColorMapper = vtkSmartPointer::New(); firstColorMapper->SetInputData(connectorDicom->GetOutput()); firstColorMapper->SetLookupTable( imgFirstColorMap ); firstColorMapper->SetOutputFormatToRGBA(); firstColorMapper->Update(); blend->SetOpacity(0,0); blend->AddInputConnection(firstColorMapper->GetOutputPort()); imgViewer->SetInputData(blend->GetOutput()); imgViewer->UpdateDisplayExtent(); Muhammad Jawad On 7 March 2016 at 14:53, David Gobbi wrote: > Hi Muhammad, > > The vtkImageBlend filter does not add an alpha component to the image. If > the first input to vtkImageBlend is RGB, then the output is RGB. This > filter will blend its inputs together, but given just one input, the output > will just be a copy of the input. > > If your image is greyscale, you can use vtkImageMapToColors to add an > alpha component, by using the SetOutputFormatToRGBA() option. > > - David > > On Mon, Mar 7, 2016 at 4:05 AM, Muhammad Jawad > wrote: > >> >> Dear Vtk users, >> >> I am using vtkimageblend class for multiple volumes and want to change >> opacity of volumes. Here I put the small code for single volume for >> simplicity. >> >> ImageViewer is working fine but opacity is not working. >> >> >> Any body have an idea that what I'm doing wrong here ? >> >> >> vtkSmartPointer blend = vtkSmartPointer::New(); >> >> >> blend->SetInputData(0, reader->GetOutput()); >> >> >> blend->SetOpacity(0, 0.3); >> >> >> vtkSmartPointer imgViewer = vtkSmartPointer::New(); >> >> >> imgViewer->SetInputData(blend->GetOutput()); >> >> >> imgViewer->UpdateDisplayExtent(); >> >> >> >> >> >> -- >> >> Regards, >> >> Muhammad Jawad >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.martin at kitware.com Mon Mar 7 09:33:57 2016 From: ken.martin at kitware.com (Ken Martin) Date: Mon, 7 Mar 2016 09:33:57 -0500 Subject: [vtkusers] Moving an actor, after about 1.5 hours. In-Reply-To: <0D98110E-03D2-4042-97F8-28334E67EEA3@me.com> References: <65445CB4-B314-4465-B445-7C1F58B439DB@me.com> <82BD95A8-EA8A-4F73-A2F2-E08E74EB755B@me.com> <8BF034EC-7C7C-44A1-867C-22FB4382C0D8@me.com> <0D98110E-03D2-4042-97F8-28334E67EEA3@me.com> Message-ID: To expand and guess a bit, there is code in vtkOpenGLActor ala void vtkOpenGLActor::GetKeyMatrices(vtkMatrix4x4 *&mcwc, vtkMatrix3x3 *&normMat) { // has the actor changed? if (this->GetMTime() > this->KeyMatrixTime) { this->ComputeMatrix(); This code only recomputes the matrices when something has changed. When you change the actor, its MTime goes up. That code then recomputes the matrix and KeyMatrixTime goes up. Everything is fine as long as those two numbers keep climbing up together. But if GetMTime were suddenly to roll over and go to a small number while KeyMatrixTime was at a really high number. Then the if statement fails and the matrix gets stuck with an old value. Each extra bit on the mtime doubles how high it can grow before rolling back over to zero. At 64bits it would take tens or hundreds of years of constant execution before it rolled over. Thanks Ken On Mon, Mar 7, 2016 at 9:11 AM, Richard Frank wrote: > Ken Martin said previously > > "Doubling the size would increase the run time by a factor of 4.3 billion > o.O" > > > > Sent from my iPad > > On Mar 7, 2016, at 9:07 AM, David Gobbi wrote: > > On Mon, Mar 7, 2016 at 6:43 AM, Richard Frank wrote: > >> >> Not yet. That will be next step. Seems plausible since I can't find >> after quite a bit of testing any leaks, OpenGL errors reported, and testing >> on different systems with different Nvidia cards. etc, and tracing into VTK >> ( although trying to trace through all the calls to executive, algorithm, >> superclass, etc is quite cumbersome). Things just fail to move, silently. >> > > As far as I'm aware, the only reason that VTK hasn't yet switched to a > 64-bit MTime everywhere is that there would be backwards compatibility > problems (GetMTime is a virtual method that is overridden in many > subclasses). > > I found another post where someone had a slightly similar problem and said >> removing and re-adding actors fixed the problem, which we also seem to >> see..... >> > > The VTK pipeline uses the difference between timestamps to as an indicator > for when to undertake certain actions. So it is likely that problems only > arise when this "difference" between two crucial timestamps exceeds the > 32-bit limit. That's why re-adding actors might fix the problem. > > >> Also, why the runtime hit on a 64 bit build?. >> > > What are you referring to? (I rarely use Windows, and when I do, I use > 32-bit builds). > > - David > > -- 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 Mon Mar 7 09:36:33 2016 From: ken.martin at kitware.com (Ken Martin) Date: Mon, 7 Mar 2016 09:36:33 -0500 Subject: [vtkusers] Moving an actor, after about 1.5 hours. In-Reply-To: References: <65445CB4-B314-4465-B445-7C1F58B439DB@me.com> <82BD95A8-EA8A-4F73-A2F2-E08E74EB755B@me.com> <8BF034EC-7C7C-44A1-867C-22FB4382C0D8@me.com> Message-ID: Oops, yes, I meant runnable time not run time :-) On Mon, Mar 7, 2016 at 9:25 AM, Richard Frank wrote: > Oh never mind - increase the runnable time not run time :>} > > Sent from my iPad > > On Mar 7, 2016, at 9:07 AM, David Gobbi wrote: > > On Mon, Mar 7, 2016 at 6:43 AM, Richard Frank wrote: > >> >> Not yet. That will be next step. Seems plausible since I can't find >> after quite a bit of testing any leaks, OpenGL errors reported, and testing >> on different systems with different Nvidia cards. etc, and tracing into VTK >> ( although trying to trace through all the calls to executive, algorithm, >> superclass, etc is quite cumbersome). Things just fail to move, silently. >> > > As far as I'm aware, the only reason that VTK hasn't yet switched to a > 64-bit MTime everywhere is that there would be backwards compatibility > problems (GetMTime is a virtual method that is overridden in many > subclasses). > > I found another post where someone had a slightly similar problem and said >> removing and re-adding actors fixed the problem, which we also seem to >> see..... >> > > The VTK pipeline uses the difference between timestamps to as an indicator > for when to undertake certain actions. So it is likely that problems only > arise when this "difference" between two crucial timestamps exceeds the > 32-bit limit. That's why re-adding actors might fix the problem. > > >> Also, why the runtime hit on a 64 bit build?. >> > > What are you referring to? (I rarely use Windows, and when I do, I use > 32-bit builds). > > - David > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > 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 david.gobbi at gmail.com Mon Mar 7 09:49:19 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 7 Mar 2016 07:49:19 -0700 Subject: [vtkusers] how to change vtkImageBlend opacity In-Reply-To: References: Message-ID: Hi Muhammad, Remove vtkImageBlend from your pipeline. Use the SetOpacity() method on vtkLookupTable. - David On Mon, Mar 7, 2016 at 7:33 AM, Muhammad Jawad wrote: > Hi David, > > thanks for your suggestions. I did the same as you mentioned, It add > lookup table still opacity is not working. Perhaps, I did some wrong in my > code. > > connectorDicom = LoadDicomReader(dirPath.toStdString()); > > > vtkSmartPointer imgFirstColorMap = vtkSmartPointer::New(); // hot color map > > imgFirstColorMap->SetRange( 0.0, 255.0 ); > > imgFirstColorMap->SetHueRange( 0.0, 0.1 ); > > imgFirstColorMap->SetValueRange( 0.4, 0.8 ); > > imgFirstColorMap->Build(); > > > vtkSmartPointer firstColorMapper = vtkSmartPointer::New(); > > firstColorMapper->SetInputData(connectorDicom->GetOutput()); > > firstColorMapper->SetLookupTable( imgFirstColorMap ); > > firstColorMapper->SetOutputFormatToRGBA(); > > firstColorMapper->Update(); > > > blend->SetOpacity(0,0); > > blend->AddInputConnection(firstColorMapper->GetOutputPort()); > > imgViewer->SetInputData(blend->GetOutput()); > > imgViewer->UpdateDisplayExtent(); > > > > Muhammad Jawad > > > On 7 March 2016 at 14:53, David Gobbi wrote: > >> Hi Muhammad, >> >> The vtkImageBlend filter does not add an alpha component to the image. >> If the first input to vtkImageBlend is RGB, then the output is RGB. This >> filter will blend its inputs together, but given just one input, the output >> will just be a copy of the input. >> >> If your image is greyscale, you can use vtkImageMapToColors to add an >> alpha component, by using the SetOutputFormatToRGBA() option. >> >> - David >> >> On Mon, Mar 7, 2016 at 4:05 AM, Muhammad Jawad >> wrote: >> >>> >>> Dear Vtk users, >>> >>> I am using vtkimageblend class for multiple volumes and want to change >>> opacity of volumes. Here I put the small code for single volume for >>> simplicity. >>> >>> ImageViewer is working fine but opacity is not working. >>> >>> >>> Any body have an idea that what I'm doing wrong here ? >>> >>> >>> vtkSmartPointer blend = vtkSmartPointer::New(); >>> >>> >>> blend->SetInputData(0, reader->GetOutput()); >>> >>> >>> blend->SetOpacity(0, 0.3); >>> >>> >>> vtkSmartPointer imgViewer = vtkSmartPointer::New(); >>> >>> >>> imgViewer->SetInputData(blend->GetOutput()); >>> >>> >>> imgViewer->UpdateDisplayExtent(); >>> >>> >>> >>> >>> >>> -- >>> >>> Regards, >>> >>> Muhammad Jawad >>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Mon Mar 7 09:54:23 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Mon, 7 Mar 2016 08:54:23 -0600 Subject: [vtkusers] Show a text for a limited period of time In-Reply-To: References: Message-ID: While there is some timer support in VTK, since you are using Qt, you are likely better of firing off a one-shot timer event in Qt after you save your screen shot. See http://doc.qt.io/qt-4.8/qtimer.html for details. In the slot you connect the timer to, you'll take care of hiding/removing the vtkTextActor. HTH, Cory On Mon, Mar 7, 2016 at 4:54 AM, Fernando Nellmeldin wrote: > Hello, > does anyone know if this is possible with VTK? > > Thank you. > Fernando. > > 2016-03-01 10:08 GMT+01:00 Fernando Nellmeldin > : >> >> Hello all. >> >> I would like to show a text in screen and this text should disappear after >> a few seconds (3~4). For example, the text should say: "Screenshot saved" >> and then disappear. For me, doesn't matter if the vtkTextActor gets deleted >> or its visibility gets turned off. >> >> How can this be achieved with VTK? Please note that my VTK window is >> embedded in a Qt application window. >> >> I've done this before with pure OpenGL, but in that case I had access to >> the "while (true)" loop of the application and I could ask each frame how >> many seconds have passed. I am completely lost on this subject when using >> VTK. >> >> Thank you! >> >> Fernando. > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 R&D Engineer Kitware, Inc. From softplanner at gmail.com Mon Mar 7 09:57:39 2016 From: softplanner at gmail.com (Muhammad Jawad) Date: Mon, 7 Mar 2016 15:57:39 +0100 Subject: [vtkusers] how to change vtkImageBlend opacity In-Reply-To: References: Message-ID: Hi David, But there is no SetOpacity() method is defined in vtkLookupTable. On 7 March 2016 at 15:49, David Gobbi wrote: > Hi Muhammad, > > Remove vtkImageBlend from your pipeline. Use the SetOpacity() method on > vtkLookupTable. > > - David > > On Mon, Mar 7, 2016 at 7:33 AM, Muhammad Jawad > wrote: > >> Hi David, >> >> thanks for your suggestions. I did the same as you mentioned, It add >> lookup table still opacity is not working. Perhaps, I did some wrong in my >> code. >> >> connectorDicom = LoadDicomReader(dirPath.toStdString()); >> >> >> vtkSmartPointer imgFirstColorMap = vtkSmartPointer::New(); // hot color map >> >> imgFirstColorMap->SetRange( 0.0, 255.0 ); >> >> imgFirstColorMap->SetHueRange( 0.0, 0.1 ); >> >> imgFirstColorMap->SetValueRange( 0.4, 0.8 ); >> >> imgFirstColorMap->Build(); >> >> >> vtkSmartPointer firstColorMapper = vtkSmartPointer::New(); >> >> firstColorMapper->SetInputData(connectorDicom->GetOutput()); >> >> firstColorMapper->SetLookupTable( imgFirstColorMap ); >> >> firstColorMapper->SetOutputFormatToRGBA(); >> >> firstColorMapper->Update(); >> >> >> blend->SetOpacity(0,0); >> >> blend->AddInputConnection(firstColorMapper->GetOutputPort()); >> >> imgViewer->SetInputData(blend->GetOutput()); >> >> imgViewer->UpdateDisplayExtent(); >> >> >> >> Muhammad Jawad >> >> >> On 7 March 2016 at 14:53, David Gobbi wrote: >> >>> Hi Muhammad, >>> >>> The vtkImageBlend filter does not add an alpha component to the image. >>> If the first input to vtkImageBlend is RGB, then the output is RGB. This >>> filter will blend its inputs together, but given just one input, the output >>> will just be a copy of the input. >>> >>> If your image is greyscale, you can use vtkImageMapToColors to add an >>> alpha component, by using the SetOutputFormatToRGBA() option. >>> >>> - David >>> >>> On Mon, Mar 7, 2016 at 4:05 AM, Muhammad Jawad >>> wrote: >>> >>>> >>>> Dear Vtk users, >>>> >>>> I am using vtkimageblend class for multiple volumes and want to change >>>> opacity of volumes. Here I put the small code for single volume for >>>> simplicity. >>>> >>>> ImageViewer is working fine but opacity is not working. >>>> >>>> >>>> Any body have an idea that what I'm doing wrong here ? >>>> >>>> >>>> vtkSmartPointer blend = vtkSmartPointer::New(); >>>> >>>> >>>> blend->SetInputData(0, reader->GetOutput()); >>>> >>>> >>>> blend->SetOpacity(0, 0.3); >>>> >>>> >>>> vtkSmartPointer imgViewer = vtkSmartPointer::New(); >>>> >>>> >>>> imgViewer->SetInputData(blend->GetOutput()); >>>> >>>> >>>> imgViewer->UpdateDisplayExtent(); >>>> >>>> >>>> >>>> >>>> >>>> -- >>>> >>>> Regards, >>>> >>>> Muhammad Jawad >>>> >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjlp at netease.com Mon Mar 7 09:28:49 2016 From: tjlp at netease.com (Liu_tj) Date: Mon, 7 Mar 2016 22:28:49 +0800 (CST) Subject: [vtkusers] Display issue of vtkImageViewer2 for Sagittal and Coronal view Message-ID: <31932b4c.23.153517b028c.Coremail.tjlp@netease.com> Hi, VTK expert guys, At present I use vtkImageViewer2 to display 3 views of DICOM series. Now I have display issue for Sagittal and Coronal view. When display the first (number 0) slice, all 3 views are fine. However, when I use the mousewheel to change the slice number by vtkImageViewer2::SetSlice(), Sagittal and Coronal view won't display anything. Axial view is ok. For the plane orientation, I call vtkImageViewer2::SetSliceOrientationToYZ() for Coronal view, and vtkImageViewer2::SetSliceOrientationToXZ() for Sagittal view. Thanks Liu Peng -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Mon Mar 7 10:01:14 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 7 Mar 2016 08:01:14 -0700 Subject: [vtkusers] how to change vtkImageBlend opacity In-Reply-To: References: Message-ID: You're right. For some reason I thought it had that method. You can use table->SetAlphaRange(0.3, 0.3) instead, which does the same thing as setting the opacity. On Mon, Mar 7, 2016 at 7:57 AM, Muhammad Jawad wrote: > Hi David, > > But there is no SetOpacity() method is defined in vtkLookupTable. > > On 7 March 2016 at 15:49, David Gobbi wrote: > >> Hi Muhammad, >> >> Remove vtkImageBlend from your pipeline. Use the SetOpacity() method on >> vtkLookupTable. >> >> - David >> >> On Mon, Mar 7, 2016 at 7:33 AM, Muhammad Jawad >> wrote: >> >>> Hi David, >>> >>> thanks for your suggestions. I did the same as you mentioned, It add >>> lookup table still opacity is not working. Perhaps, I did some wrong in my >>> code. >>> >>> connectorDicom = LoadDicomReader(dirPath.toStdString()); >>> >>> >>> vtkSmartPointer imgFirstColorMap = vtkSmartPointer::New(); // hot color map >>> >>> imgFirstColorMap->SetRange( 0.0, 255.0 ); >>> >>> imgFirstColorMap->SetHueRange( 0.0, 0.1 ); >>> >>> imgFirstColorMap->SetValueRange( 0.4, 0.8 ); >>> >>> imgFirstColorMap->Build(); >>> >>> >>> vtkSmartPointer firstColorMapper = vtkSmartPointer::New(); >>> >>> firstColorMapper->SetInputData(connectorDicom->GetOutput()); >>> >>> firstColorMapper->SetLookupTable( imgFirstColorMap ); >>> >>> firstColorMapper->SetOutputFormatToRGBA(); >>> >>> firstColorMapper->Update(); >>> >>> >>> blend->SetOpacity(0,0); >>> >>> blend->AddInputConnection(firstColorMapper->GetOutputPort()); >>> >>> imgViewer->SetInputData(blend->GetOutput()); >>> >>> imgViewer->UpdateDisplayExtent(); >>> >>> >>> >>> Muhammad Jawad >>> >>> >>> On 7 March 2016 at 14:53, David Gobbi wrote: >>> >>>> Hi Muhammad, >>>> >>>> The vtkImageBlend filter does not add an alpha component to the image. >>>> If the first input to vtkImageBlend is RGB, then the output is RGB. This >>>> filter will blend its inputs together, but given just one input, the output >>>> will just be a copy of the input. >>>> >>>> If your image is greyscale, you can use vtkImageMapToColors to add an >>>> alpha component, by using the SetOutputFormatToRGBA() option. >>>> >>>> - David >>>> >>>> On Mon, Mar 7, 2016 at 4:05 AM, Muhammad Jawad >>>> wrote: >>>> >>>>> >>>>> Dear Vtk users, >>>>> >>>>> I am using vtkimageblend class for multiple volumes and want to change >>>>> opacity of volumes. Here I put the small code for single volume for >>>>> simplicity. >>>>> >>>>> ImageViewer is working fine but opacity is not working. >>>>> >>>>> >>>>> Any body have an idea that what I'm doing wrong here ? >>>>> >>>>> >>>>> vtkSmartPointer blend = vtkSmartPointer::New(); >>>>> >>>>> >>>>> blend->SetInputData(0, reader->GetOutput()); >>>>> >>>>> >>>>> blend->SetOpacity(0, 0.3); >>>>> >>>>> >>>>> vtkSmartPointer imgViewer = vtkSmartPointer::New(); >>>>> >>>>> >>>>> imgViewer->SetInputData(blend->GetOutput()); >>>>> >>>>> >>>>> imgViewer->UpdateDisplayExtent(); >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> >>>>> Regards, >>>>> >>>>> Muhammad Jawad >>>>> >>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From softplanner at gmail.com Mon Mar 7 10:27:56 2016 From: softplanner at gmail.com (Muhammad Jawad) Date: Mon, 7 Mar 2016 16:27:56 +0100 Subject: [vtkusers] how to change vtkImageBlend opacity In-Reply-To: References: Message-ID: thanks David it's working. On 7 March 2016 at 16:01, David Gobbi wrote: > You're right. For some reason I thought it had that method. You can use > table->SetAlphaRange(0.3, 0.3) instead, which does the same thing as > setting the opacity. > > On Mon, Mar 7, 2016 at 7:57 AM, Muhammad Jawad > wrote: > >> Hi David, >> >> But there is no SetOpacity() method is defined in vtkLookupTable. >> >> On 7 March 2016 at 15:49, David Gobbi wrote: >> >>> Hi Muhammad, >>> >>> Remove vtkImageBlend from your pipeline. Use the SetOpacity() method on >>> vtkLookupTable. >>> >>> - David >>> >>> On Mon, Mar 7, 2016 at 7:33 AM, Muhammad Jawad >>> wrote: >>> >>>> Hi David, >>>> >>>> thanks for your suggestions. I did the same as you mentioned, It add >>>> lookup table still opacity is not working. Perhaps, I did some wrong in my >>>> code. >>>> >>>> connectorDicom = LoadDicomReader(dirPath.toStdString()); >>>> >>>> >>>> vtkSmartPointer imgFirstColorMap = vtkSmartPointer::New(); // hot color map >>>> >>>> imgFirstColorMap->SetRange( 0.0, 255.0 ); >>>> >>>> imgFirstColorMap->SetHueRange( 0.0, 0.1 ); >>>> >>>> imgFirstColorMap->SetValueRange( 0.4, 0.8 ); >>>> >>>> imgFirstColorMap->Build(); >>>> >>>> >>>> vtkSmartPointer firstColorMapper = vtkSmartPointer::New(); >>>> >>>> firstColorMapper->SetInputData(connectorDicom->GetOutput()); >>>> >>>> firstColorMapper->SetLookupTable( imgFirstColorMap ); >>>> >>>> firstColorMapper->SetOutputFormatToRGBA(); >>>> >>>> firstColorMapper->Update(); >>>> >>>> >>>> blend->SetOpacity(0,0); >>>> >>>> blend->AddInputConnection(firstColorMapper->GetOutputPort()); >>>> >>>> imgViewer->SetInputData(blend->GetOutput()); >>>> >>>> imgViewer->UpdateDisplayExtent(); >>>> >>>> >>>> >>>> Muhammad Jawad >>>> >>>> >>>> On 7 March 2016 at 14:53, David Gobbi wrote: >>>> >>>>> Hi Muhammad, >>>>> >>>>> The vtkImageBlend filter does not add an alpha component to the >>>>> image. If the first input to vtkImageBlend is RGB, then the output is >>>>> RGB. This filter will blend its inputs together, but given just one input, >>>>> the output will just be a copy of the input. >>>>> >>>>> If your image is greyscale, you can use vtkImageMapToColors to add an >>>>> alpha component, by using the SetOutputFormatToRGBA() option. >>>>> >>>>> - David >>>>> >>>>> On Mon, Mar 7, 2016 at 4:05 AM, Muhammad Jawad >>>>> wrote: >>>>> >>>>>> >>>>>> Dear Vtk users, >>>>>> >>>>>> I am using vtkimageblend class for multiple volumes and want to >>>>>> change opacity of volumes. Here I put the small code for single volume for >>>>>> simplicity. >>>>>> >>>>>> ImageViewer is working fine but opacity is not working. >>>>>> >>>>>> >>>>>> Any body have an idea that what I'm doing wrong here ? >>>>>> >>>>>> >>>>>> vtkSmartPointer blend = vtkSmartPointer::New(); >>>>>> >>>>>> >>>>>> blend->SetInputData(0, reader->GetOutput()); >>>>>> >>>>>> >>>>>> blend->SetOpacity(0, 0.3); >>>>>> >>>>>> >>>>>> vtkSmartPointer imgViewer = vtkSmartPointer::New(); >>>>>> >>>>>> >>>>>> imgViewer->SetInputData(blend->GetOutput()); >>>>>> >>>>>> >>>>>> imgViewer->UpdateDisplayExtent(); >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> >>>>>> Regards, >>>>>> >>>>>> Muhammad Jawad >>>>>> >>>>>> >>>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Mon Mar 7 11:02:51 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 7 Mar 2016 09:02:51 -0700 Subject: [vtkusers] Weird data and SEGFAULT when using vtkIterativeClosestPointTransform In-Reply-To: References: Message-ID: Hi Ronald, How many points are in your data sets? When the crash occurs, are the points in one of the datasets colinear? coplanar? - David On Mon, Mar 7, 2016 at 2:24 AM, Ronald van Duren wrote: > Hi, > > > I want to create a point cloud by moving and rotating my depth > sensor(Structure Sensor). I figured out ICP is probably the way to go since > I can get a tranformation matrix which I can use to shift the sensors frame > left, right up or down. Otherwise the points would be drawn on top of > each other in static frame of 640x480. > > > After some time I got the vtkIterativeClosestPointTransform to work, I > used the example provided by VTK. But the transformation matrix has weird > data in it, sometimes it has several NaN values in it and the overal data > in the matrix just doesn't seem right. My linear algebra skills are > intermediate so I could be wrong. Also, when I move the sensor with a speed > that is anything more than extremely slow a segfault is thrown. Because the > source code is compiled I cannot trace down the segfault. > > > Any chance somebody knows what's wrong? > > > Thanks in advance! > > > Ronald van Duren. > > > Technical information: > > > - ?I use Android and specifically the NDK so everything is in C++. > - I use the compiled dynamic library for Android, Armeabi-v7a. > - I use the Structure Sensor. > - VTK version is 2.4.9. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From DLRdave at aol.com Mon Mar 7 11:13:32 2016 From: DLRdave at aol.com (David Cole) Date: Mon, 7 Mar 2016 11:13:32 -0500 Subject: [vtkusers] Moving an actor, after about 1.5 hours. In-Reply-To: References: <65445CB4-B314-4465-B445-7C1F58B439DB@me.com> <82BD95A8-EA8A-4F73-A2F2-E08E74EB755B@me.com> <8BF034EC-7C7C-44A1-867C-22FB4382C0D8@me.com> Message-ID: This is a well known issue, reported here: http://www.vtk.org/Bug/view.php?id=14310 There are some patch files against older versions of VTK which are attached to the bug. You could try a similar patch (although it's quite a few lines to change) against whatever version of VTK you are using. I would be VERY interested in seeing a modification to fix this problem make its way into VTK master. David C. On Mon, Mar 7, 2016 at 9:36 AM, Ken Martin wrote: > Oops, yes, I meant runnable time not run time :-) > > > > On Mon, Mar 7, 2016 at 9:25 AM, Richard Frank wrote: >> >> Oh never mind - increase the runnable time not run time :>} >> >> Sent from my iPad >> >> On Mar 7, 2016, at 9:07 AM, David Gobbi wrote: >> >> On Mon, Mar 7, 2016 at 6:43 AM, Richard Frank wrote: >>> >>> >>> Not yet. That will be next step. Seems plausible since I can't find >>> after quite a bit of testing any leaks, OpenGL errors reported, and testing >>> on different systems with different Nvidia cards. etc, and tracing into VTK >>> ( although trying to trace through all the calls to executive, algorithm, >>> superclass, etc is quite cumbersome). Things just fail to move, silently. >> >> >> As far as I'm aware, the only reason that VTK hasn't yet switched to a >> 64-bit MTime everywhere is that there would be backwards compatibility >> problems (GetMTime is a virtual method that is overridden in many >> subclasses). >> >>> I found another post where someone had a slightly similar problem and >>> said removing and re-adding actors fixed the problem, which we also seem to >>> see..... >> >> >> The VTK pipeline uses the difference between timestamps to as an indicator >> for when to undertake certain actions. So it is likely that problems only >> arise when this "difference" between two crucial timestamps exceeds the >> 32-bit limit. That's why re-adding actors might fix the problem. >> >>> >>> Also, why the runtime hit on a 64 bit build?. >> >> >> What are you referring to? (I rarely use Windows, and when I do, I use >> 32-bit builds). >> >> - David >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> 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. > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 rickfrank at me.com Mon Mar 7 11:31:01 2016 From: rickfrank at me.com (Richard Frank) Date: Mon, 07 Mar 2016 11:31:01 -0500 Subject: [vtkusers] Moving an actor, after about 1.5 hours. In-Reply-To: References: <65445CB4-B314-4465-B445-7C1F58B439DB@me.com> <82BD95A8-EA8A-4F73-A2F2-E08E74EB755B@me.com> <8BF034EC-7C7C-44A1-867C-22FB4382C0D8@me.com> Message-ID: <3CCBE554-556D-46C7-9B7F-BB9F625345DF@me.com> Agreed. Ours is a medical application as well. The priority should be raised in the bug tracker in my opinion Rick Frank > On Mar 7, 2016, at 11:13 AM, David Cole wrote: > > This is a well known issue, reported here: > > http://www.vtk.org/Bug/view.php?id=14310 > > There are some patch files against older versions of VTK which are > attached to the bug. You could try a similar patch (although it's > quite a few lines to change) against whatever version of VTK you are > using. > > I would be VERY interested in seeing a modification to fix this > problem make its way into VTK master. > > > David C. > > >> On Mon, Mar 7, 2016 at 9:36 AM, Ken Martin wrote: >> Oops, yes, I meant runnable time not run time :-) >> >> >> >>> On Mon, Mar 7, 2016 at 9:25 AM, Richard Frank wrote: >>> >>> Oh never mind - increase the runnable time not run time :>} >>> >>> Sent from my iPad >>> >>> On Mar 7, 2016, at 9:07 AM, David Gobbi wrote: >>> >>> On Mon, Mar 7, 2016 at 6:43 AM, Richard Frank wrote: >>>> >>>> >>>> Not yet. That will be next step. Seems plausible since I can't find >>>> after quite a bit of testing any leaks, OpenGL errors reported, and testing >>>> on different systems with different Nvidia cards. etc, and tracing into VTK >>>> ( although trying to trace through all the calls to executive, algorithm, >>>> superclass, etc is quite cumbersome). Things just fail to move, silently. >>> >>> >>> As far as I'm aware, the only reason that VTK hasn't yet switched to a >>> 64-bit MTime everywhere is that there would be backwards compatibility >>> problems (GetMTime is a virtual method that is overridden in many >>> subclasses). >>> >>>> I found another post where someone had a slightly similar problem and >>>> said removing and re-adding actors fixed the problem, which we also seem to >>>> see..... >>> >>> >>> The VTK pipeline uses the difference between timestamps to as an indicator >>> for when to undertake certain actions. So it is likely that problems only >>> arise when this "difference" between two crucial timestamps exceeds the >>> 32-bit limit. That's why re-adding actors might fix the problem. >>> >>>> >>>> Also, why the runtime hit on a 64 bit build?. >>> >>> >>> What are you referring to? (I rarely use Windows, and when I do, I use >>> 32-bit builds). >>> >>> - David >>> >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> 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. >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> 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 tjlp at netease.com Mon Mar 7 11:31:40 2016 From: tjlp at netease.com (Liu_tj) Date: Tue, 8 Mar 2016 00:31:40 +0800 (CST) Subject: [vtkusers] How to map negative grayscale to color? Message-ID: <59c5b9d3.2.15351eb7dc2.Coremail.tjlp@netease.com> Hi, I try to use the vtkLookupTable to convert the grayscale to rgb color. The image scalar range is [-1024,3071] returned by vtkImageData::GetScalarRange(). Now I want to convert specific grayscale range, for example, [-10,200] to one color, such as green (RGB is 0,1,0). How to do that by vtkLookupTable? I have no idea what method should call: SetNumberOfTableValues(), SetRange(), SetHueRange(), SetValueRange(). What do "Hue" and "Value" stand for? BR, Liu Peng -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Mon Mar 7 13:27:04 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 7 Mar 2016 11:27:04 -0700 Subject: [vtkusers] How to map negative grayscale to color? In-Reply-To: <59c5b9d3.2.15351eb7dc2.Coremail.tjlp@netease.com> References: <59c5b9d3.2.15351eb7dc2.Coremail.tjlp@netease.com> Message-ID: Hi Liu Peng, You can set individual values in the lookup table, in order to precisely map certain scalar values to specific colors: table->SetRange(-1024, 4095); table->SetNumberOfTableValues(4095 + 1024 + 1); for (int i = -1024; i < -10; i++) { table->SetTableValue(0.0, 0.0, 0.0, 1.0); } for (int i = -10; i <= 200; i++) { table->SetTableValue(0.0, 1.0, 0.0, 1.0); } etcetera. - David On Mon, Mar 7, 2016 at 9:31 AM, Liu_tj wrote: > Hi, > > I try to use the vtkLookupTable to convert the grayscale to rgb color. The > image scalar range is [-1024,3071] returned by > vtkImageData::GetScalarRange(). Now I want to convert specific grayscale > range, for example, [-10,200] to one color, such as green (RGB is 0,1,0). > How to do that by vtkLookupTable? I have no idea what method should call: > SetNumberOfTableValues(), SetRange(), SetHueRange(), SetValueRange(). What > do "Hue" and "Value" stand for? > > BR, > Liu Peng > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Mon Mar 7 17:30:35 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Mon, 7 Mar 2016 16:30:35 -0600 Subject: [vtkusers] slice structured grid with polydata In-Reply-To: References: Message-ID: That's great, Justin. Thanks for reporting back. Cory On Mon, Mar 7, 2016 at 4:04 PM, Justin Weber wrote: > Cory, > > Thanks for your help. I got it working! I might put the code up as an > example. > > > Justin > > On Thu, Feb 18, 2016 at 10:58 PM, Cory Quammen > wrote: > >> Justin, >> >> There is nothing canned in VTK to do this, but with some work you should >> be able to get there using an implicit function created from your STL file. >> At a high level, what you would do is create an instance of >> vtkImplicitPolyDataDistance. Set its input to the poly data from the STL >> file. Then, create a new point data array in your structured grid that >> stores the value from the implicit poly data distance filter. Negative >> values will be inside the poly data, positive values outside, and 0 at the >> surface. Finally, use vtkClipDataSet to clip the structured grid a function >> value 0. This should give you back an unstructured grid in approximately >> the shape of your input STL. It won't be exact because of the interpolation >> used by vtkClipDataSet, but it should be close. >> >> Hope that helps. >> >> Cory >> >> On Thu, Feb 18, 2016 at 10:08 PM, Justin Weber wrote: >> >>> I would like to generate a "cutcell" mesh using vtk by slicing a >>> structured grid with polydata loaded from a STL file. The resulting mesh >>> would be an unstructured grid. >>> >>> Are there any tools in vtk to accomplish this? >>> >>> I can create the structured grid and polydata successfully. Now I just >>> need an algorithm to slice the structured mesh with the polydata surface. >>> >>> In my searching I could not find anything. However, I could accomplish >>> this by ray casting to find the intersections between the structured grid >>> and the polydata. Then using those points to create the unstructured grid. >>> >>> See attached 2d sketch. >>> >>> Thanks! >>> Justin >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> 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 >> R&D Engineer >> Kitware, Inc. >> > > -- Cory Quammen R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.hoffman at kitware.com Mon Mar 7 18:27:44 2016 From: bill.hoffman at kitware.com (Bill Hoffman) Date: Mon, 7 Mar 2016 18:27:44 -0500 Subject: [vtkusers] Building VTK 5.10 with VS 2015 In-Reply-To: References: <20151110155432.GA11263@megas.khq.kitware.com> <20151110194012.GA9611@megas.khq.kitware.com> Message-ID: <56DE0E70.8050109@kitware.com> The attached patch works for me in case someone really needs VTK 5.10. -Bill -------------- next part -------------- Only in vtk: .ExternalData Only in vtk: .git Only in vtk: .gitattributes Only in vtk: .hooks-config.bash diff -aur vtk/Charts/vtkControlPointsItem.cxx VTK5.10.1/Charts/vtkControlPointsItem.cxx --- vtk/Charts/vtkControlPointsItem.cxx 2016-03-07 17:38:13.321549400 -0500 +++ VTK5.10.1/Charts/vtkControlPointsItem.cxx 2016-03-07 17:56:40.283648300 -0500 @@ -29,7 +29,7 @@ #include "vtkSmartPointer.h" #include "vtkTransform2D.h" #include "vtkVectorOperators.h" - +#include #include #include diff -aur vtk/Charts/vtkPiecewisePointHandleItem.cxx VTK5.10.1/Charts/vtkPiecewisePointHandleItem.cxx --- vtk/Charts/vtkPiecewisePointHandleItem.cxx 2016-03-07 17:38:13.382549400 -0500 +++ VTK5.10.1/Charts/vtkPiecewisePointHandleItem.cxx 2016-03-07 17:56:23.513412900 -0500 @@ -28,6 +28,7 @@ #include "vtkControlPointsItem.h" #include "vtkTransform2D.h" #include "vtkNew.h" +#include enum enumPointHandleType { diff -aur vtk/Common/vtkOStreamWrapper.cxx VTK5.10.1/Common/vtkOStreamWrapper.cxx --- vtk/Common/vtkOStreamWrapper.cxx 2016-03-07 17:38:14.768110200 -0500 +++ VTK5.10.1/Common/vtkOStreamWrapper.cxx 2016-03-07 17:35:46.955614900 -0500 @@ -57,7 +57,6 @@ VTKOSTREAM_OPERATOR(const vtkLargeInteger&); VTKOSTREAM_OPERATOR(const vtkSmartPointerBase&); VTKOSTREAM_OPERATOR(const vtkStdString&); -VTKOSTREAM_OPERATOR(ostream&); VTKOSTREAM_OPERATOR(const char*); VTKOSTREAM_OPERATOR(void*); VTKOSTREAM_OPERATOR(char); diff -aur vtk/Infovis/vtkAdjacencyMatrixToEdgeTable.cxx VTK5.10.1/Infovis/vtkAdjacencyMatrixToEdgeTable.cxx --- vtk/Infovis/vtkAdjacencyMatrixToEdgeTable.cxx 2016-03-07 17:38:25.545107400 -0500 +++ VTK5.10.1/Infovis/vtkAdjacencyMatrixToEdgeTable.cxx 2016-03-07 17:49:09.778254300 -0500 @@ -33,6 +33,7 @@ #include #include +#include // ---------------------------------------------------------------------- diff -aur vtk/Infovis/vtkConvexHull2D.cxx VTK5.10.1/Infovis/vtkConvexHull2D.cxx --- vtk/Infovis/vtkConvexHull2D.cxx 2016-03-07 17:38:25.685501100 -0500 +++ VTK5.10.1/Infovis/vtkConvexHull2D.cxx 2016-03-07 17:49:52.592471400 -0500 @@ -28,6 +28,7 @@ #include "vtkSmartPointer.h" #include "vtkTransform.h" #include "vtkTransformPolyDataFilter.h" +#include vtkStandardNewMacro(vtkConvexHull2D); diff -aur vtk/Infovis/vtkNormalizeMatrixVectors.cxx VTK5.10.1/Infovis/vtkNormalizeMatrixVectors.cxx --- vtk/Infovis/vtkNormalizeMatrixVectors.cxx 2016-03-07 17:38:25.825894800 -0500 +++ VTK5.10.1/Infovis/vtkNormalizeMatrixVectors.cxx 2016-03-07 17:49:59.105122600 -0500 @@ -27,7 +27,7 @@ #include "vtkObjectFactory.h" #include "vtkSmartPointer.h" #include "vtkTypedArray.h" - +#include /////////////////////////////////////////////////////////////////////////////// // vtkNormalizeMatrixVectors diff -aur vtk/Infovis/vtkPairwiseExtractHistogram2D.cxx VTK5.10.1/Infovis/vtkPairwiseExtractHistogram2D.cxx --- vtk/Infovis/vtkPairwiseExtractHistogram2D.cxx 2016-03-07 17:38:25.872692700 -0500 +++ VTK5.10.1/Infovis/vtkPairwiseExtractHistogram2D.cxx 2016-03-07 17:50:11.938639400 -0500 @@ -36,6 +36,7 @@ #include "vtkTable.h" #include "vtkTimerLog.h" #include "vtkUnsignedIntArray.h" +#include #define VTK_CREATE(type, name) \ vtkSmartPointer name = vtkSmartPointer::New() diff -aur vtk/IO/vtkEnSightGoldBinaryReader.cxx VTK5.10.1/IO/vtkEnSightGoldBinaryReader.cxx --- vtk/IO/vtkEnSightGoldBinaryReader.cxx 2016-03-07 17:38:23.950975300 -0500 +++ VTK5.10.1/IO/vtkEnSightGoldBinaryReader.cxx 2016-03-07 17:42:32.215079100 -0500 @@ -3922,7 +3922,7 @@ // Returns zero if there was an error. int vtkEnSightGoldBinaryReader::ReadLine(char result[80]) { - if ( this->IFile->read(result, 80) == 0) + if ( !this->IFile->read(result, 80)) { // The read fails when reading the last part/array when there are no points. // I took out the error macro as a tempory fix. @@ -3941,7 +3941,7 @@ result[76] = 0; // better read an extra 8 bytes to prevent error next time char dummy[8]; - if (this->IFile->read(dummy, 8) == 0) + if (!this->IFile->read(dummy, 8)) { vtkDebugMacro("Read (fortran) failed"); return 0; @@ -3998,14 +3998,14 @@ char dummy[4]; if (this->Fortran) { - if (this->IFile->read(dummy, 4) == 0) + if (!this->IFile->read(dummy, 4)) { vtkErrorMacro("Read (fortran) failed."); return 0; } } - if ( this->IFile->read((char*)result, sizeof(int)) == 0) + if ( !this->IFile->read((char*)result, sizeof(int))) { vtkErrorMacro("Read failed"); return 0; @@ -4022,7 +4022,7 @@ if (this->Fortran) { - if (this->IFile->read(dummy, 4) == 0) + if (!this->IFile->read(dummy, 4)) { vtkErrorMacro("Read (fortran) failed."); return 0; @@ -4045,14 +4045,14 @@ char dummy[4]; if (this->Fortran) { - if (this->IFile->read(dummy, 4) == 0) + if (!this->IFile->read(dummy, 4)) { vtkErrorMacro("Read (fortran) failed."); return 0; } } - if (this->IFile->read((char*)result, sizeof(int)*numInts) == 0) + if (!this->IFile->read((char*)result, sizeof(int)*numInts)) { vtkErrorMacro("Read failed."); return 0; @@ -4069,7 +4069,7 @@ if (this->Fortran) { - if (this->IFile->read(dummy, 4) == 0) + if (!this->IFile->read(dummy, 4)) { vtkErrorMacro("Read (fortran) failed."); return 0; @@ -4092,14 +4092,14 @@ char dummy[4]; if (this->Fortran) { - if (this->IFile->read(dummy, 4) == 0) + if (!this->IFile->read(dummy, 4)) { vtkErrorMacro("Read (fortran) failed."); return 0; } } - if (this->IFile->read((char*)result, sizeof(float)*numFloats) == 0) + if (!this->IFile->read((char*)result, sizeof(float)*numFloats)) { vtkErrorMacro("Read failed"); return 0; @@ -4116,7 +4116,7 @@ if (this->Fortran) { - if (this->IFile->read(dummy, 4) == 0) + if (!this->IFile->read(dummy, 4)) { vtkErrorMacro("Read (fortran) failed."); return 0; Only in vtk/Utilities: .gitattributes diff -aur vtk/Utilities/vtkhdf5/ConfigureChecks.cmake VTK5.10.1/Utilities/vtkhdf5/ConfigureChecks.cmake --- vtk/Utilities/vtkhdf5/ConfigureChecks.cmake 2016-03-07 17:38:31.095064500 -0500 +++ VTK5.10.1/Utilities/vtkhdf5/ConfigureChecks.cmake 2016-03-07 16:24:59.793320300 -0500 @@ -484,7 +484,7 @@ # Check a bunch of other functions #----------------------------------------------------------------------------- IF (WINDOWS) - SET (H5_HAVE_TIMEZONE 1) + SET (H5_HAVE_TIMEZONE 0) SET (H5_HAVE_FUNCTION 1) ELSE (WINDOWS) FOREACH (test diff -aur vtk/Utilities/vtklibxml2/config_cmake.h.in VTK5.10.1/Utilities/vtklibxml2/config_cmake.h.in --- vtk/Utilities/vtklibxml2/config_cmake.h.in 2016-03-07 17:38:32.265012000 -0500 +++ VTK5.10.1/Utilities/vtklibxml2/config_cmake.h.in 2016-03-07 16:38:00.419138400 -0500 @@ -250,7 +250,7 @@ #cmakedefine _WINSOCKAPI_ /* Win32 Std C name mangling work-around */ -#if defined(_MSC_VER) +#if defined(_MSC_VER) && (_MSC_VER < 1900) # define snprintf _snprintf #endif Only in vtk/Utilities/vtknetcdf: .gitattributes diff -aur vtk/Utilities/vtktiff/CMakeLists.txt VTK5.10.1/Utilities/vtktiff/CMakeLists.txt --- vtk/Utilities/vtktiff/CMakeLists.txt 2016-03-07 17:38:33.003980500 -0500 +++ VTK5.10.1/Utilities/vtktiff/CMakeLists.txt 2016-03-07 16:38:44.433278900 -0500 @@ -69,6 +69,7 @@ CHECK_INCLUDE_FILES("malloc.h" HAVE_MALLOC_H) CHECK_INCLUDE_FILES("memory.h" HAVE_MEMORY_H) CHECK_INCLUDE_FILES("stdint.h" HAVE_STDINT_H) +CHECK_INCLUDE_FILES("search.h" HAVE_SEARCH_H) CHECK_INCLUDE_FILES("stdlib.h" HAVE_STDLIB_H) CHECK_INCLUDE_FILES("string.h" HAVE_STRING_H) CHECK_INCLUDE_FILES("strings.h" HAVE_STRINGS_H) diff -aur vtk/Utilities/vtktiff/tif_config.h.in VTK5.10.1/Utilities/vtktiff/tif_config.h.in --- vtk/Utilities/vtktiff/tif_config.h.in 2016-03-07 17:38:33.035179100 -0500 +++ VTK5.10.1/Utilities/vtktiff/tif_config.h.in 2016-03-07 16:39:25.525380800 -0500 @@ -70,6 +70,10 @@ /* Define if you have POSIX threads libraries and header files. */ #cmakedefine HAVE_PTHREAD +/* Define to 1 if you have the header file. */ + +#cmakedefine HAVE_SEARCH_H @HAVE_SEARCH_H@ + /* Define to 1 if you have the `sqrt' function. */ #cmakedefine HAVE_SQRT @HAVE_SQRT@ diff -aur vtk/Views/vtkParallelCoordinatesRepresentation.cxx VTK5.10.1/Views/vtkParallelCoordinatesRepresentation.cxx --- vtk/Views/vtkParallelCoordinatesRepresentation.cxx 2016-03-07 17:38:33.269168600 -0500 +++ VTK5.10.1/Views/vtkParallelCoordinatesRepresentation.cxx 2016-03-07 17:50:44.259370200 -0500 @@ -80,6 +80,7 @@ #include #include +#include vtkStandardNewMacro(vtkParallelCoordinatesRepresentation); From tjlp at netease.com Mon Mar 7 19:57:28 2016 From: tjlp at netease.com (Liu_tj) Date: Tue, 8 Mar 2016 08:57:28 +0800 (CST) Subject: [vtkusers] How to map negative grayscale to color? In-Reply-To: References: <59c5b9d3.2.15351eb7dc2.Coremail.tjlp@netease.com> Message-ID: <6cc76b17.4.15353ba903c.Coremail.tjlp@netease.com> Thanks David for your great help. I will try it. ?2016-03-08?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?8? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: [vtkusers] How to map negative grayscale to color? Hi Liu Peng, You can set individual values in the lookup table, in order to precisely map certain scalar values to specific colors: table->SetRange(-1024, 4095); table->SetNumberOfTableValues(4095 + 1024 + 1); for (int i = -1024; i < -10; i++) { table->SetTableValue(0.0, 0.0, 0.0, 1.0); } for (int i = -10; i <= 200; i++) { table->SetTableValue(0.0, 1.0, 0.0, 1.0); } etcetera. - David On Mon, Mar 7, 2016 at 9:31 AM, Liu_tj wrote: Hi, I try to use the vtkLookupTable to convert the grayscale to rgb color. The image scalar range is [-1024,3071] returned by vtkImageData::GetScalarRange(). Now I want to convert specific grayscale range, for example, [-10,200] to one color, such as green (RGB is 0,1,0). How to do that by vtkLookupTable? I have no idea what method should call: SetNumberOfTableValues(), SetRange(), SetHueRange(), SetValueRange(). What do "Hue" and "Value" stand for? BR, Liu Peng -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjlp at netease.com Mon Mar 7 19:56:07 2016 From: tjlp at netease.com (Liu_tj) Date: Tue, 8 Mar 2016 08:56:07 +0800 (CST) Subject: [vtkusers] Display issue of vtkImageViewer2 for Sagittal and Coronal view In-Reply-To: <31932b4c.23.153517b028c.Coremail.tjlp@netease.com> References: <31932b4c.23.153517b028c.Coremail.tjlp@netease.com> Message-ID: <339a532d.3.15353b950c3.Coremail.tjlp@netease.com> I solve it. When I display the DICOM image first time, I should set the orientation first then set the slice number. ?2016-03-07?"Liu_tj" ??? -----????----- ???:"Liu_tj" ????:2016?03?7? ??? ???:"vtkusers" ??:[vtkusers] Display issue of vtkImageViewer2 for Sagittal and Coronal view Hi, VTK expert guys, At present I use vtkImageViewer2 to display 3 views of DICOM series. Now I have display issue for Sagittal and Coronal view. When display the first (number 0) slice, all 3 views are fine. However, when I use the mousewheel to change the slice number by vtkImageViewer2::SetSlice(), Sagittal and Coronal view won't display anything. Axial view is ok. For the plane orientation, I call vtkImageViewer2::SetSliceOrientationToYZ() for Coronal view, and vtkImageViewer2::SetSliceOrientationToXZ() for Sagittal view. Thanks Liu Peng -------------- next part -------------- An HTML attachment was scrubbed... URL: From emredeniz18 at hotmail.com Tue Mar 8 04:10:14 2016 From: emredeniz18 at hotmail.com (emredeniz) Date: Tue, 8 Mar 2016 02:10:14 -0700 (MST) Subject: [vtkusers] dicom window\level control Message-ID: <1457428214818-5737090.post@n5.nabble.com> Greetings; I display dicom image on renderwindow, ? would like to ask that how ? will control the dicom window in vtk? Thank you for your helps. -- View this message in context: http://vtk.1045678.n5.nabble.com/dicom-window-level-control-tp5737090.html Sent from the VTK - Users mailing list archive at Nabble.com. From oskar.mansur at gmx.de Tue Mar 8 05:15:05 2016 From: oskar.mansur at gmx.de (Oskar Mansur) Date: Tue, 8 Mar 2016 11:15:05 +0100 Subject: [vtkusers] How can I make a interpolation between vector in a grid Message-ID: An HTML attachment was scrubbed... URL: From manfred.habermann at gmx.net Tue Mar 8 07:40:43 2016 From: manfred.habermann at gmx.net (Manfred Habermann) Date: Tue, 8 Mar 2016 13:40:43 +0100 Subject: [vtkusers] To set CoordinateAxes Message-ID: An HTML attachment was scrubbed... URL: From goretzki.imre at gmail.com Tue Mar 8 08:05:15 2016 From: goretzki.imre at gmail.com (Imre Goretzki) Date: Tue, 8 Mar 2016 14:05:15 +0100 Subject: [vtkusers] QVTKWidget, vtkResliceImageViewer question Message-ID: <56DECE0B.4080700@gmail.com> Hey guys, I have a question about the attributes when holding down the left mouse button while moving the cursor up and down in the render window. Set up is a combination of QVTKWidget and vtkResliceImageViewer: view = vtkSmartPointer ... view->SetInputData(vtkImageData); ui->display->SetRenderWindow(view->GetRenderWindow()) view->SetupInteractor(ui->display->GetRenderWindow()->GetInteractor()); view->Render(); ui->display->update(); ui->display: QVTKWidget view: vtkSmartPointer Whenever I hold the left mouse button and move the cursor, the displayed image becomes darker (while moving up) and brighter (while moving down) respectively. I want to set the attribute to a certain level. I guess I have to override some events, but I need to know the attribute that will be set / changed during the described processes. Thanks in advance Imre From rickfrank at me.com Tue Mar 8 08:27:56 2016 From: rickfrank at me.com (Richard Frank) Date: Tue, 08 Mar 2016 08:27:56 -0500 Subject: [vtkusers] Moving an actor, after about 1.5 hours. In-Reply-To: References: <65445CB4-B314-4465-B445-7C1F58B439DB@me.com> <82BD95A8-EA8A-4F73-A2F2-E08E74EB755B@me.com> <8BF034EC-7C7C-44A1-867C-22FB4382C0D8@me.com> Message-ID: Actually, it's a bit stranger than I thought. The global time stamp on Windows 64 bit is a 64 bit int cast to an Unsigned long, as size of void ptr is 8 void vtkTimeStamp::Modified() { #if VTK_SIZEOF_VOID_P == 8 static vtkAtomicInt64 GlobalTimeStamp(0); #else static vtkAtomicInt32 GlobalTimeStamp(0); #endif this->ModifiedTime = (unsigned long)++GlobalTimeStamp; } I'm not certain off the top of my head what the wrap around pattern would be - probably 2 times around before wrapping to zero.... Sent from my iPad > On Mar 7, 2016, at 11:13 AM, David Cole wrote: > > This is a well known issue, reported here: > > http://www.vtk.org/Bug/view.php?id=14310 > > There are some patch files against older versions of VTK which are > attached to the bug. You could try a similar patch (although it's > quite a few lines to change) against whatever version of VTK you are > using. > > I would be VERY interested in seeing a modification to fix this > problem make its way into VTK master. > > > David C. > > >> On Mon, Mar 7, 2016 at 9:36 AM, Ken Martin wrote: >> Oops, yes, I meant runnable time not run time :-) >> >> >> >>> On Mon, Mar 7, 2016 at 9:25 AM, Richard Frank wrote: >>> >>> Oh never mind - increase the runnable time not run time :>} >>> >>> Sent from my iPad >>> >>> On Mar 7, 2016, at 9:07 AM, David Gobbi wrote: >>> >>> On Mon, Mar 7, 2016 at 6:43 AM, Richard Frank wrote: >>>> >>>> >>>> Not yet. That will be next step. Seems plausible since I can't find >>>> after quite a bit of testing any leaks, OpenGL errors reported, and testing >>>> on different systems with different Nvidia cards. etc, and tracing into VTK >>>> ( although trying to trace through all the calls to executive, algorithm, >>>> superclass, etc is quite cumbersome). Things just fail to move, silently. >>> >>> >>> As far as I'm aware, the only reason that VTK hasn't yet switched to a >>> 64-bit MTime everywhere is that there would be backwards compatibility >>> problems (GetMTime is a virtual method that is overridden in many >>> subclasses). >>> >>>> I found another post where someone had a slightly similar problem and >>>> said removing and re-adding actors fixed the problem, which we also seem to >>>> see..... >>> >>> >>> The VTK pipeline uses the difference between timestamps to as an indicator >>> for when to undertake certain actions. So it is likely that problems only >>> arise when this "difference" between two crucial timestamps exceeds the >>> 32-bit limit. That's why re-adding actors might fix the problem. >>> >>>> >>>> Also, why the runtime hit on a 64 bit build?. >>> >>> >>> What are you referring to? (I rarely use Windows, and when I do, I use >>> 32-bit builds). >>> >>> - David >>> >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> 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. >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> 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.gobbi at gmail.com Tue Mar 8 08:47:16 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 8 Mar 2016 06:47:16 -0700 Subject: [vtkusers] Moving an actor, after about 1.5 hours. In-Reply-To: References: <65445CB4-B314-4465-B445-7C1F58B439DB@me.com> <82BD95A8-EA8A-4F73-A2F2-E08E74EB755B@me.com> <8BF034EC-7C7C-44A1-867C-22FB4382C0D8@me.com> Message-ID: Hi Richard, Since only the low 32 bits are kept (the high bits are simply discarded), the wrap-around of the ModifiedTime is exactly the same as if a 32-bit unsigned integer was being incremented. - David On Tue, Mar 8, 2016 at 6:27 AM, Richard Frank wrote: > Actually, it's a bit stranger than I thought. The global time stamp on > Windows 64 bit is a 64 bit int cast to an > Unsigned long, as size of void ptr is 8 > void vtkTimeStamp::Modified() > { > #if VTK_SIZEOF_VOID_P == 8 > static vtkAtomicInt64 GlobalTimeStamp(0); > #else > static vtkAtomicInt32 GlobalTimeStamp(0); > #endif > this->ModifiedTime = (unsigned long)++GlobalTimeStamp; > } > > I'm not certain off the top of my head what the wrap around pattern would > be - probably 2 times around before wrapping to zero.... > > > Sent from my iPad > > On Mar 7, 2016, at 11:13 AM, David Cole wrote: > > This is a well known issue, reported here: > > http://www.vtk.org/Bug/view.php?id=14310 > > There are some patch files against older versions of VTK which are > attached to the bug. You could try a similar patch (although it's > quite a few lines to change) against whatever version of VTK you are > using. > > I would be VERY interested in seeing a modification to fix this > problem make its way into VTK master. > > > David C. > > > On Mon, Mar 7, 2016 at 9:36 AM, Ken Martin wrote: > > Oops, yes, I meant runnable time not run time :-) > > > > > On Mon, Mar 7, 2016 at 9:25 AM, Richard Frank wrote: > > > Oh never mind - increase the runnable time not run time :>} > > > Sent from my iPad > > > On Mar 7, 2016, at 9:07 AM, David Gobbi wrote: > > > On Mon, Mar 7, 2016 at 6:43 AM, Richard Frank wrote: > > > > Not yet. That will be next step. Seems plausible since I can't find > > after quite a bit of testing any leaks, OpenGL errors reported, and testing > > on different systems with different Nvidia cards. etc, and tracing into VTK > > ( although trying to trace through all the calls to executive, algorithm, > > superclass, etc is quite cumbersome). Things just fail to move, silently. > > > > As far as I'm aware, the only reason that VTK hasn't yet switched to a > > 64-bit MTime everywhere is that there would be backwards compatibility > > problems (GetMTime is a virtual method that is overridden in many > > subclasses). > > > I found another post where someone had a slightly similar problem and > > said removing and re-adding actors fixed the problem, which we also seem to > > see..... > > > > The VTK pipeline uses the difference between timestamps to as an indicator > > for when to undertake certain actions. So it is likely that problems only > > arise when this "difference" between two crucial timestamps exceeds the > > 32-bit limit. That's why re-adding actors might fix the problem. > > > > Also, why the runtime hit on a 64 bit build?. > > > > What are you referring to? (I rarely use Windows, and when I do, I use > > 32-bit builds). > > > - David > > > > _______________________________________________ > > Powered by www.kitware.com > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > Please keep messages on-topic and check the VTK FAQ at: > > http://www.vtk.org/Wiki/VTK_FAQ > > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > > Follow this link to subscribe/unsubscribe: > > 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. > > > _______________________________________________ > > Powered by www.kitware.com > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > Please keep messages on-topic and check the VTK FAQ at: > > 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 Tue Mar 8 09:27:58 2016 From: tjlp at netease.com (Liu_tj) Date: Tue, 8 Mar 2016 22:27:58 +0800 (CST) Subject: [vtkusers] How to map negative grayscale to color? In-Reply-To: References: <59c5b9d3.2.15351eb7dc2.Coremail.tjlp@netease.com> Message-ID: <4aa21faa.14.15356a0967e.Coremail.tjlp@netease.com> Hi, David, When I try, a lot of errors are popup: "Can't set the table value for negative index". Seems the negative grayscale needs some transformation. Thanks Liu Peng ?2016-03-08?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?8? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: [vtkusers] How to map negative grayscale to color? Hi Liu Peng, You can set individual values in the lookup table, in order to precisely map certain scalar values to specific colors: table->SetRange(-1024, 4095); table->SetNumberOfTableValues(4095 + 1024 + 1); for (int i = -1024; i < -10; i++) { table->SetTableValue(0.0, 0.0, 0.0, 1.0); } for (int i = -10; i <= 200; i++) { table->SetTableValue(0.0, 1.0, 0.0, 1.0); } etcetera. - David On Mon, Mar 7, 2016 at 9:31 AM, Liu_tj wrote: Hi, I try to use the vtkLookupTable to convert the grayscale to rgb color. The image scalar range is [-1024,3071] returned by vtkImageData::GetScalarRange(). Now I want to convert specific grayscale range, for example, [-10,200] to one color, such as green (RGB is 0,1,0). How to do that by vtkLookupTable? I have no idea what method should call: SetNumberOfTableValues(), SetRange(), SetHueRange(), SetValueRange(). What do "Hue" and "Value" stand for? BR, Liu Peng -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Tue Mar 8 09:37:20 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 8 Mar 2016 07:37:20 -0700 Subject: [vtkusers] How to map negative grayscale to color? In-Reply-To: <4aa21faa.14.15356a0967e.Coremail.tjlp@netease.com> References: <59c5b9d3.2.15351eb7dc2.Coremail.tjlp@netease.com> <4aa21faa.14.15356a0967e.Coremail.tjlp@netease.com> Message-ID: Hi Liu Pen, That's because I forgot to include the index argument in the call to SetTableValue: table->SetRange(-1024, 4095); table->SetNumberOfTableValues(4095 + 1024 + 1); for (int i = -1024; i < -10; i++) { table->SetTableValue(i + 1024, 0.0, 0.0, 0.0, 1.0); } The table index must start at zero. The call to SetRange(-1024, 4095) causes the scalar value -1024 to map to table index 0. In the "for" loop, i is the scalar value. - David On Tue, Mar 8, 2016 at 7:27 AM, Liu_tj wrote: > Hi, David, > > When I try, a lot of errors are popup: "Can't set the table value for > negative index". > > Seems the negative grayscale needs some transformation. > > Thanks > Liu Peng > > > ?2016-03-08?"David Gobbi" ??? > > -----????----- > *???:*"David Gobbi" > *????:*2016?03?8? ??? > *???:*"Liu_tj" > *??:*"vtkusers" > *??:*Re: [vtkusers] How to map negative grayscale to color? > > Hi Liu Peng, > > You can set individual values in the lookup table, > in order to precisely map certain scalar values to > specific colors: > > table->SetRange(-1024, 4095); > table->SetNumberOfTableValues(4095 + 1024 + 1); > for (int i = -1024; i < -10; i++) { > table->SetTableValue(0.0, 0.0, 0.0, 1.0); > } > for (int i = -10; i <= 200; i++) { > table->SetTableValue(0.0, 1.0, 0.0, 1.0); > } > etcetera. > > - David > > > On Mon, Mar 7, 2016 at 9:31 AM, Liu_tj wrote: > >> Hi, >> >> I try to use the vtkLookupTable to convert the grayscale to rgb color. >> The image scalar range is [-1024,3071] returned by >> vtkImageData::GetScalarRange(). Now I want to convert specific grayscale >> range, for example, [-10,200] to one color, such as green (RGB is 0,1,0). >> How to do that by vtkLookupTable? I have no idea what method should call: >> SetNumberOfTableValues(), SetRange(), SetHueRange(), SetValueRange(). What >> do "Hue" and "Value" stand for? >> >> BR, >> Liu Peng >> > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From inglis.dl at gmail.com Tue Mar 8 09:43:07 2016 From: inglis.dl at gmail.com (DL I) Date: Tue, 8 Mar 2016 09:43:07 -0500 Subject: [vtkusers] QVTKWidget, vtkResliceImageViewer question In-Reply-To: <56DECE0B.4080700@gmail.com> References: <56DECE0B.4080700@gmail.com> Message-ID: Hi Imre, it sounds like you want to set a specific pair of window/level values instead of interactively setting them by mouse movement. vtkResliceImageViewer is a subclass of vtkImageViewer2 which has methods to set window and level values: void SetColorWindow(double w) void SetColorLevel(double l) If you dont want the viewer's vtkInteractorStyleImage to do window/levelling you can handle those events and process them yourself by subclassing your own interactor style from vtkInteractorStyleImage. - Dean On Tue, Mar 8, 2016 at 8:05 AM, Imre Goretzki wrote: > Hey guys, > > I have a question about the attributes when holding down the left mouse > button while moving the cursor up and down > in the render window. > > Set up is a combination of QVTKWidget and vtkResliceImageViewer: > > view = vtkSmartPointer > > ... > > view->SetInputData(vtkImageData); > ui->display->SetRenderWindow(view->GetRenderWindow()) > view->SetupInteractor(ui->display->GetRenderWindow()->GetInteractor()); > view->Render(); > ui->display->update(); > > ui->display: QVTKWidget > view: vtkSmartPointer > > Whenever I hold the left mouse button and move the cursor, the displayed > image becomes darker (while moving up) > and brighter (while moving down) respectively. > > I want to set the attribute to a certain level. I guess I have to override > some events, but I need to know the attribute that will be set / changed > during the described processes. > > Thanks in advance > > Imre > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 goretzki.imre at gmail.com Tue Mar 8 09:58:10 2016 From: goretzki.imre at gmail.com (Imre Goretzki) Date: Tue, 8 Mar 2016 15:58:10 +0100 Subject: [vtkusers] QVTKWidget, vtkResliceImageViewer question In-Reply-To: References: <56DECE0B.4080700@gmail.com> Message-ID: <56DEE882.5070802@gmail.com> Ok thank you Dean. Am 08.03.2016 um 15:43 schrieb DL I: > Hi Imre, > > it sounds like you want to set a specific pair of window/level values > instead of > interactively setting them by mouse movement. vtkResliceImageViewer is > a subclass of vtkImageViewer2 which has methods to set window and > level values: > void SetColorWindow(double w) > void SetColorLevel(double l) > > If you dont want the viewer's vtkInteractorStyleImage to do > window/levelling you > can handle those events and process them yourself by subclassing your own > interactor style from vtkInteractorStyleImage. > > - Dean > > > On Tue, Mar 8, 2016 at 8:05 AM, Imre Goretzki > wrote: > > Hey guys, > > I have a question about the attributes when holding down the left > mouse button while moving the cursor up and down > in the render window. > > Set up is a combination of QVTKWidget and vtkResliceImageViewer: > > view = vtkSmartPointer > > ... > > view->SetInputData(vtkImageData); > ui->display->SetRenderWindow(view->GetRenderWindow()) > view->SetupInteractor(ui->display->GetRenderWindow()->GetInteractor()); > view->Render(); > ui->display->update(); > > ui->display: QVTKWidget > view: vtkSmartPointer > > Whenever I hold the left mouse button and move the cursor, the > displayed image becomes darker (while moving up) > and brighter (while moving down) respectively. > > I want to set the attribute to a certain level. I guess I have to > override some events, but I need to know the attribute that will > be set / changed during the described processes. > > Thanks in advance > > Imre > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 sotoglzz at gmail.com Tue Mar 8 13:41:26 2016 From: sotoglzz at gmail.com (Jose Soto) Date: Tue, 8 Mar 2016 12:41:26 -0600 Subject: [vtkusers] Convert VRML to VTK ASCII format Message-ID: Dears vtk users: I'm trying to convert a VRML file to a vtk ASCII format using this code from this vtk topic: http://vtk.1045678.n5.nabble.com/Conversion-from-VRML-into-VTK-format-td1243521.html#a1243526 , here's the code: #include #include #include #include #include #include #include int main (int argc, char *argv[]) { std::string Fichier = argv[1]; std::string vrmlFileName = argv[2]; vtkVRMLImporter *imp = vtkVRMLImporter::New(); imp->SetFileName(Fichier.c_str()); imp->Read(); imp->Update(); vtkDataSet *pDataset; vtkActorCollection *actors = imp->GetRenderer()->GetActors(); actors->InitTraversal(); pDataset = actors->GetNextActor()->GetMapper()->GetInput(); vtkPolyData *polyData = vtkPolyData::SafeDownCast(pDataset); polyData->Update(); vtkPolyDataWriter *writer = vtkPolyDataWriter::New(); strcat(vrmlFileName, ".vtk"); writer->SetFileName(vrmlFileName); writer->SetFileTypeToASCII(); ostream *vtkFile = writer->OpenVTKFile(); writer->SetHeader("vtkFile"); writer->WriteHeader(vtkFile); *vtkFile << "DATASET POLYDATA\n"; writer->WritePoints(vtkFile, polyData->GetPoints()); writer->WriteCells(vtkFile, polyData->GetPolys(), "POLYGONS"); writer->CloseVTKFile(vtkFile); return EXIT_SUCCESS; } When I'm trying to compile it I get the following errror [100%] Building CXX object CMakeFiles/VRML.dir/VRML.cxx.o /home/trinidad/VRMLConv/VRML.cxx: In function ?int main(int, const char**)?: /home/trinidad/VRMLConv/VRML.cxx:28:28: error: cannot convert ?std::string {aka std::basic_string}? to ?char*? for argument ?1? to ?char* strcat(char*, const char*)? strcat(vrmlFileName, ".vtk"); Can someone give me a little help please?? Thanks, in advance Jos? Soto -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Tue Mar 8 15:20:24 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Tue, 8 Mar 2016 14:20:24 -0600 Subject: [vtkusers] Convert VRML to VTK ASCII format In-Reply-To: References: Message-ID: You can't do this: strcat(vrmlFileName, ".vtk"); You can do this: vrmlFileName.append(".vtk"); HTH, Cory On Tue, Mar 8, 2016 at 12:41 PM, Jose Soto wrote: > > Dears vtk users: > > I'm trying to convert a VRML file to a vtk ASCII format using this code from > this vtk topic: > http://vtk.1045678.n5.nabble.com/Conversion-from-VRML-into-VTK-format-td1243521.html#a1243526 > , here's the code: > > #include > #include > #include > #include > #include > #include > #include > > int main (int argc, char *argv[]) { > > std::string Fichier = argv[1]; > std::string vrmlFileName = argv[2]; > > vtkVRMLImporter *imp = vtkVRMLImporter::New(); > imp->SetFileName(Fichier.c_str()); > imp->Read(); > imp->Update(); > vtkDataSet *pDataset; > vtkActorCollection *actors = imp->GetRenderer()->GetActors(); > actors->InitTraversal(); > pDataset = actors->GetNextActor()->GetMapper()->GetInput(); > > vtkPolyData *polyData = vtkPolyData::SafeDownCast(pDataset); > polyData->Update(); > > vtkPolyDataWriter *writer = vtkPolyDataWriter::New(); > strcat(vrmlFileName, ".vtk"); > writer->SetFileName(vrmlFileName); > writer->SetFileTypeToASCII(); > > ostream *vtkFile = writer->OpenVTKFile(); > writer->SetHeader("vtkFile"); > writer->WriteHeader(vtkFile); > *vtkFile << "DATASET POLYDATA\n"; > writer->WritePoints(vtkFile, polyData->GetPoints()); > writer->WriteCells(vtkFile, polyData->GetPolys(), "POLYGONS"); > writer->CloseVTKFile(vtkFile); > > return EXIT_SUCCESS; > > } > > When I'm trying to compile it I get the following errror > > [100%] Building CXX object CMakeFiles/VRML.dir/VRML.cxx.o > /home/trinidad/VRMLConv/VRML.cxx: In function ?int main(int, const char**)?: > /home/trinidad/VRMLConv/VRML.cxx:28:28: error: cannot convert ?std::string > {aka std::basic_string}? to ?char*? for argument ?1? to ?char* > strcat(char*, const char*)? > strcat(vrmlFileName, ".vtk"); > > Can someone give me a little help please?? > Thanks, in advance > Jos? Soto > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 R&D Engineer Kitware, Inc. From dave.demarle at kitware.com Tue Mar 8 16:08:46 2016 From: dave.demarle at kitware.com (David E DeMarle) Date: Tue, 8 Mar 2016 16:08:46 -0500 Subject: [vtkusers] Convert VRML to VTK ASCII format In-Reply-To: References: Message-ID: This also looks fishy. > ostream *vtkFile = writer->OpenVTKFile(); > writer->SetHeader("vtkFile"); > writer->WriteHeader(vtkFile); > *vtkFile << "DATASET POLYDATA\n"; > writer->WritePoints(vtkFile, polyData->GetPoints()); > writer->WriteCells(vtkFile, polyData->GetPolys(), "POLYGONS"); > writer->CloseVTKFile(vtkFile); You shouldn't have to do the low level bits, instead just let the class to the work like so: writer->SetInputData(polyData); writer->Write(); hah David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Tue, Mar 8, 2016 at 3:20 PM, Cory Quammen wrote: > You can't do this: > > strcat(vrmlFileName, ".vtk"); > > You can do this: > > vrmlFileName.append(".vtk"); > > HTH, > Cory > > On Tue, Mar 8, 2016 at 12:41 PM, Jose Soto wrote: > > > > Dears vtk users: > > > > I'm trying to convert a VRML file to a vtk ASCII format using this code > from > > this vtk topic: > > > http://vtk.1045678.n5.nabble.com/Conversion-from-VRML-into-VTK-format-td1243521.html#a1243526 > > , here's the code: > > > > #include > > #include > > #include > > #include > > #include > > #include > > #include > > > > int main (int argc, char *argv[]) { > > > > std::string Fichier = argv[1]; > > std::string vrmlFileName = argv[2]; > > > > vtkVRMLImporter *imp = vtkVRMLImporter::New(); > > imp->SetFileName(Fichier.c_str()); > > imp->Read(); > > imp->Update(); > > vtkDataSet *pDataset; > > vtkActorCollection *actors = imp->GetRenderer()->GetActors(); > > actors->InitTraversal(); > > pDataset = actors->GetNextActor()->GetMapper()->GetInput(); > > > > vtkPolyData *polyData = vtkPolyData::SafeDownCast(pDataset); > > polyData->Update(); > > > > vtkPolyDataWriter *writer = vtkPolyDataWriter::New(); > > strcat(vrmlFileName, ".vtk"); > > writer->SetFileName(vrmlFileName); > > writer->SetFileTypeToASCII(); > > > > ostream *vtkFile = writer->OpenVTKFile(); > > writer->SetHeader("vtkFile"); > > writer->WriteHeader(vtkFile); > > *vtkFile << "DATASET POLYDATA\n"; > > writer->WritePoints(vtkFile, polyData->GetPoints()); > > writer->WriteCells(vtkFile, polyData->GetPolys(), "POLYGONS"); > > writer->CloseVTKFile(vtkFile); > > > > return EXIT_SUCCESS; > > > > } > > > > When I'm trying to compile it I get the following errror > > > > [100%] Building CXX object CMakeFiles/VRML.dir/VRML.cxx.o > > /home/trinidad/VRMLConv/VRML.cxx: In function ?int main(int, const > char**)?: > > /home/trinidad/VRMLConv/VRML.cxx:28:28: error: cannot convert > ?std::string > > {aka std::basic_string}? to ?char*? for argument ?1? to ?char* > > strcat(char*, const char*)? > > strcat(vrmlFileName, ".vtk"); > > > > Can someone give me a little help please?? > > Thanks, in advance > > Jos? Soto > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Please keep messages on-topic and check the VTK FAQ at: > > 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 > 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 tharun160190 at gmail.com Tue Mar 8 21:45:47 2016 From: tharun160190 at gmail.com (Tharun) Date: Tue, 8 Mar 2016 19:45:47 -0700 (MST) Subject: [vtkusers] Font size in vtkScalarBarActor In-Reply-To: <1398111905499-5726868.post@n5.nabble.com> References: <1398111905499-5726868.post@n5.nabble.com> Message-ID: <1457491547206-5737107.post@n5.nabble.com> My I know if anybody has a solution for the question above? -- View this message in context: http://vtk.1045678.n5.nabble.com/Font-size-in-vtkScalarBarActor-tp5726868p5737107.html Sent from the VTK - Users mailing list archive at Nabble.com. From tjlp at netease.com Tue Mar 8 23:29:45 2016 From: tjlp at netease.com (Liu_tj) Date: Wed, 9 Mar 2016 12:29:45 +0800 (CST) Subject: [vtkusers] How to map negative grayscale to color? In-Reply-To: References: <59c5b9d3.2.15351eb7dc2.Coremail.tjlp@netease.com> <4aa21faa.14.15356a0967e.Coremail.tjlp@netease.com> <28c8b01.16.1535719e3be.Coremail.tjlp@netease.com> Message-ID: <42e78ce8.c.15359a3434c.Coremail.tjlp@netease.com> Hi,David, Do I need to set the LookupTable to vtkImageMapToWindowLevelColors which is returned by vtkImageViewer2::GetWindowLevels() instead of create a new vtkImageMapToColors? BR, Thanks ?2016-03-09?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?9? ??? ???:"Liu_tj" ??:Re: Re: Re: [vtkusers] How to map negative grayscale to color? Hi Liu Peng, Do you want to show a gray image underneath, and the color image on top? I'm not sure if vtkImageViewer works property if you add more than one image. You should add a "print" statement of some kind to your code to print the values of scalarrange, to be sure they are correct. Don't call colormap.Build() after setting your own values for the table, or it might overwrite the values that you have set. If you call it at all, call it immediately after SetNumberOfTableValues(), before you set any of your own values. The range on the final for() loop should be the following: for (int i = (int)(threshhold[1]) + 1; i <= (int)(scalarrange[1]); i++) Also, if you want the beyond-threshold values to be transparent instead of black, then set the alpha component to zero: for (int i = (int)(scalarrange[0]); i < (int)(threshhold[0]); i++) { colormap.SetTableValue(i - (int)scalarrange[0], 0.0, 0.0, 0.0, 0.0); } - David On Tue, Mar 8, 2016 at 9:40 AM, Liu_tj wrote: Hi, David, I follow your post and it doesn't work. The DICOM image shows no color, just gray image. Could you have a look at my code below? I use a vtkImageView2 to display the DICOM image. The code is c# by Activiz .NET. The scalar range of test image is [-1024,3071]. I want to show the gray scale at [1000,3000] to green. The function GrayToColors() maps gray scale to color, it is called by Display(). private void Display(vtkRenderWindow aRenderWindow, vtkAlgorithmOutput aData) { if (aData == null) return; m_imageViewer = vtkImageViewer2.New(); m_imageViewer.SetInputConnection(aData); switch (m_sliceDirection) { case Direction.AXIAL: m_imageViewer.SetSliceOrientationToXY(); break; case Direction.CORONAL: m_imageViewer.SetSliceOrientationToYZ(); break; case Direction.SAGITTAL: m_imageViewer.SetSliceOrientationToXZ(); break; default: break; } m_imageViewer.GetSliceRange(ref m_minSliceNumber, ref m_maxSliceNumber); m_interactorStyle = vtkInteractorStyleImage.New(); m_interactorStyle.MouseWheelForwardEvt += new vtkObject.vtkObjectEventHandler(interactor_MouseWheelForwardEvt); m_interactorStyle.MouseWheelBackwardEvt += new vtkObject.vtkObjectEventHandler(interactor_MouseWheelBackwardEvt); aRenderWindow.GetInteractor().SetInteractorStyle(m_interactorStyle); aRenderWindow.GetRenderers().InitTraversal(); m_renderer = aRenderWindow.GetRenderers().GetFirstRenderer(); m_renderer.SetBackground(0.0, 0.0, 0.0); m_imageViewer.SetRenderWindow(aRenderWindow); m_currentSlice = m_minSliceNumber + (m_maxSliceNumber - m_minSliceNumber) / 2; m_imageViewer.SetSlice(m_currentSlice); double[] scalarrange = new double[2]; scalarrange = m_imageViewer.GetInput().GetScalarRange(); double[] threshhold = new double[2]; threshhold[0] = 1000; threshhold[1] = 3000; m_imageViewer.Render(); GrayToColors(m_renderer, aData, scalarrange, threshhold); m_imageViewer.Render(); } private void GrayToColors(vtkRenderer renderer, vtkAlgorithmOutput data, double[] scalarrange, double[] threshhold) { vtkLookupTable colormap = vtkLookupTable.New(); int number = (int)(scalarrange[1] - scalarrange[0] + 1); colormap.SetRange(scalarrange[0], scalarrange[1]); colormap.SetNumberOfTableValues(number); for (int i = (int)(scalarrange[0]); i < (int)(threshhold[0]); i++) { colormap.SetTableValue(i - (int)scalarrange[0], 0.0, 0.0, 0.0, 1.0); } for (int i = (int)(threshhold[0]); i <= (int)(threshhold[1]); i++) { colormap.SetTableValue(i - (int)scalarrange[0], 0.0, 1.0, 0.0, 1.0); } for (int i = (int)(threshhold[1]); i < (int)(scalarrange[1]); i++) { colormap.SetTableValue(i - (int)scalarrange[0], 0.0, 0.0, 0.0, 1.0); } colormap.Build(); vtkImageMapToColors colormapper = vtkImageMapToColors.New(); colormapper.SetInputConnection(data); colormapper.SetLookupTable(colormap); colormapper.Update(); vtkImageActor colormapActor = vtkImageActor.New(); colormapActor.SetInput(colormapper.GetOutput()); renderer.AddActor(colormapActor); renderer.ResetCamera(); renderer.Modified(); } Thanks ?2016-03-08?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?8? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: Re: [vtkusers] How to map negative grayscale to color? Hi Liu Pen, That's because I forgot to include the index argument in the call to SetTableValue: table->SetRange(-1024, 4095); table->SetNumberOfTableValues(4095 + 1024 + 1); for (int i = -1024; i < -10; i++) { table->SetTableValue(i + 1024, 0.0, 0.0, 0.0, 1.0); } The table index must start at zero. The call to SetRange(-1024, 4095) causes the scalar value -1024 to map to table index 0. In the "for" loop, i is the scalar value. - David On Tue, Mar 8, 2016 at 7:27 AM, Liu_tj wrote: Hi, David, When I try, a lot of errors are popup: "Can't set the table value for negative index". Seems the negative grayscale needs some transformation. Thanks Liu Peng ?2016-03-08?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?8? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: [vtkusers] How to map negative grayscale to color? Hi Liu Peng, You can set individual values in the lookup table, in order to precisely map certain scalar values to specific colors: table->SetRange(-1024, 4095); table->SetNumberOfTableValues(4095 + 1024 + 1); for (int i = -1024; i < -10; i++) { table->SetTableValue(0.0, 0.0, 0.0, 1.0); } for (int i = -10; i <= 200; i++) { table->SetTableValue(0.0, 1.0, 0.0, 1.0); } etcetera. - David On Mon, Mar 7, 2016 at 9:31 AM, Liu_tj wrote: Hi, I try to use the vtkLookupTable to convert the grayscale to rgb color. The image scalar range is [-1024,3071] returned by vtkImageData::GetScalarRange(). Now I want to convert specific grayscale range, for example, [-10,200] to one color, such as green (RGB is 0,1,0). How to do that by vtkLookupTable? I have no idea what method should call: SetNumberOfTableValues(), SetRange(), SetHueRange(), SetValueRange(). What do "Hue" and "Value" stand for? BR, Liu Peng -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Tue Mar 8 23:35:08 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 8 Mar 2016 21:35:08 -0700 Subject: [vtkusers] How to map negative grayscale to color? In-Reply-To: <42e78ce8.c.15359a3434c.Coremail.tjlp@netease.com> References: <59c5b9d3.2.15351eb7dc2.Coremail.tjlp@netease.com> <4aa21faa.14.15356a0967e.Coremail.tjlp@netease.com> <28c8b01.16.1535719e3be.Coremail.tjlp@netease.com> <42e78ce8.c.15359a3434c.Coremail.tjlp@netease.com> Message-ID: No, that isn't necessary. On Tue, Mar 8, 2016 at 9:29 PM, Liu_tj wrote: > Hi,David, > > Do I need to set the LookupTable to vtkImageMapToWindowLevelColors which > is returned by vtkImageViewer2::GetWindowLevels() instead of create a new > vtkImageMapToColors? > > BR, > Thanks > > > ?2016-03-09?"David Gobbi" ??? > > -----????----- > *???:*"David Gobbi" > *????:*2016?03?9? ??? > *???:*"Liu_tj" > *??:*Re: Re: Re: [vtkusers] How to map negative grayscale to color? > > > Hi Liu Peng, > > Do you want to show a gray image underneath, and the color image > on top? I'm not sure if vtkImageViewer works property if you add > more than one image. > > You should add a "print" statement of some kind to your code to > print the values of scalarrange, to be sure they are correct. > > Don't call colormap.Build() after setting your own values for the table, > or it might overwrite the values that you have set. If you call it at all, > call it immediately after SetNumberOfTableValues(), before you set > any of your own values. > > The range on the final for() loop should be the following: > for (int i = (int)(threshhold[1]) + 1; i <= (int)(scalarrange[1]); i++) > > Also, if you want the beyond-threshold values to be transparent > instead of black, then set the alpha component to zero: > > for (int i = (int)(scalarrange[0]); i < (int)(threshhold[0]); i++) > { > colormap.SetTableValue(i - (int)scalarrange[0], 0.0, 0.0, 0.0, 0.0); > } > > - David > > > On Tue, Mar 8, 2016 at 9:40 AM, Liu_tj wrote: > >> Hi, David, >> >> I follow your post and it doesn't work. The DICOM image shows no color, >> just gray image. Could you have a look at my code below? I use a >> vtkImageView2 to display the DICOM image. The code is c# by Activiz .NET. >> The scalar range of test image is [-1024,3071]. I want to show the gray >> scale at [1000,3000] to green. The function GrayToColors() maps gray scale >> to color, it is called by Display(). >> >> private void Display(vtkRenderWindow aRenderWindow, vtkAlgorithmOutput >> aData) >> { >> if (aData == null) >> return; >> >> m_imageViewer = vtkImageViewer2.New(); >> m_imageViewer.SetInputConnection(aData); >> switch (m_sliceDirection) >> { >> case Direction.AXIAL: >> m_imageViewer.SetSliceOrientationToXY(); >> break; >> case Direction.CORONAL: >> m_imageViewer.SetSliceOrientationToYZ(); >> break; >> case Direction.SAGITTAL: >> m_imageViewer.SetSliceOrientationToXZ(); >> break; >> default: >> break; >> } >> >> m_imageViewer.GetSliceRange(ref m_minSliceNumber, ref >> m_maxSliceNumber); >> m_interactorStyle = vtkInteractorStyleImage.New(); >> m_interactorStyle.MouseWheelForwardEvt += new >> vtkObject.vtkObjectEventHandler(interactor_MouseWheelForwardEvt); >> m_interactorStyle.MouseWheelBackwardEvt += new >> vtkObject.vtkObjectEventHandler(interactor_MouseWheelBackwardEvt); >> >> >> aRenderWindow.GetInteractor().SetInteractorStyle(m_interactorStyle); >> aRenderWindow.GetRenderers().InitTraversal(); >> >> m_renderer = aRenderWindow.GetRenderers().GetFirstRenderer(); >> m_renderer.SetBackground(0.0, 0.0, 0.0); >> >> m_imageViewer.SetRenderWindow(aRenderWindow); >> m_currentSlice = m_minSliceNumber + (m_maxSliceNumber - >> m_minSliceNumber) / 2; >> m_imageViewer.SetSlice(m_currentSlice); >> >> double[] scalarrange = new double[2]; >> scalarrange = m_imageViewer.GetInput().GetScalarRange(); >> double[] threshhold = new double[2]; >> threshhold[0] = 1000; >> threshhold[1] = 3000; >> m_imageViewer.Render(); >> GrayToColors(m_renderer, aData, scalarrange, threshhold); >> >> m_imageViewer.Render(); >> } >> >> private void GrayToColors(vtkRenderer renderer, >> vtkAlgorithmOutput data, double[] scalarrange, double[] threshhold) >> { >> vtkLookupTable colormap = vtkLookupTable.New(); >> int number = (int)(scalarrange[1] - scalarrange[0] + 1); >> colormap.SetRange(scalarrange[0], scalarrange[1]); >> colormap.SetNumberOfTableValues(number); >> >> for (int i = (int)(scalarrange[0]); i < (int)(threshhold[0]); >> i++) >> { >> colormap.SetTableValue(i - (int)scalarrange[0], 0.0, 0.0, >> 0.0, 1.0); >> } >> for (int i = (int)(threshhold[0]); i <= (int)(threshhold[1]); >> i++) >> { >> colormap.SetTableValue(i - (int)scalarrange[0], 0.0, 1.0, >> 0.0, 1.0); >> } >> for (int i = (int)(threshhold[1]); i < (int)(scalarrange[1]); >> i++) >> { >> colormap.SetTableValue(i - (int)scalarrange[0], 0.0, 0.0, >> 0.0, 1.0); >> } >> colormap.Build(); >> >> vtkImageMapToColors colormapper = vtkImageMapToColors.New(); >> colormapper.SetInputConnection(data); >> colormapper.SetLookupTable(colormap); >> colormapper.Update(); >> >> vtkImageActor colormapActor = vtkImageActor.New(); >> colormapActor.SetInput(colormapper.GetOutput()); >> renderer.AddActor(colormapActor); >> renderer.ResetCamera(); >> renderer.Modified(); >> } >> >> Thanks >> >> ?2016-03-08?"David Gobbi" ??? >> >> -----????----- >> *???:*"David Gobbi" >> *????:*2016?03?8? ??? >> *???:*"Liu_tj" >> *??:*"vtkusers" >> *??:*Re: Re: [vtkusers] How to map negative grayscale to color? >> >> >> Hi Liu Pen, >> >> That's because I forgot to include the index argument in the call to >> SetTableValue: >> >> table->SetRange(-1024, 4095); >> table->SetNumberOfTableValues(4095 + 1024 + 1); >> for (int i = -1024; i < -10; i++) { >> table->SetTableValue(i + 1024, 0.0, 0.0, 0.0, 1.0); >> } >> >> The table index must start at zero. The call to SetRange(-1024, 4095) >> causes the scalar value -1024 to map to table index 0. In the "for" loop, >> i is the scalar value. >> >> - David >> >> >> On Tue, Mar 8, 2016 at 7:27 AM, Liu_tj wrote: >> >>> Hi, David, >>> >>> When I try, a lot of errors are popup: "Can't set the table value for >>> negative index". >>> >>> Seems the negative grayscale needs some transformation. >>> >>> Thanks >>> Liu Peng >>> >>> >>> ?2016-03-08?"David Gobbi" ??? >>> >>> -----????----- >>> *???:*"David Gobbi" >>> *????:*2016?03?8? ??? >>> *???:*"Liu_tj" >>> *??:*"vtkusers" >>> *??:*Re: [vtkusers] How to map negative grayscale to color? >>> >>> Hi Liu Peng, >>> >>> You can set individual values in the lookup table, >>> in order to precisely map certain scalar values to >>> specific colors: >>> >>> table->SetRange(-1024, 4095); >>> table->SetNumberOfTableValues(4095 + 1024 + 1); >>> for (int i = -1024; i < -10; i++) { >>> table->SetTableValue(0.0, 0.0, 0.0, 1.0); >>> } >>> for (int i = -10; i <= 200; i++) { >>> table->SetTableValue(0.0, 1.0, 0.0, 1.0); >>> } >>> etcetera. >>> >>> - David >>> >>> >>> On Mon, Mar 7, 2016 at 9:31 AM, Liu_tj wrote: >>> >>>> Hi, >>>> >>>> I try to use the vtkLookupTable to convert the grayscale to rgb color. >>>> The image scalar range is [-1024,3071] returned by >>>> vtkImageData::GetScalarRange(). Now I want to convert specific grayscale >>>> range, for example, [-10,200] to one color, such as green (RGB is 0,1,0). >>>> How to do that by vtkLookupTable? I have no idea what method should call: >>>> SetNumberOfTableValues(), SetRange(), SetHueRange(), SetValueRange(). What >>>> do "Hue" and "Value" stand for? >>>> >>>> BR, >>>> Liu Peng >>>> >>> >>> >>> >>> >>> >> >> >> >> >> > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yangmin_hust at 126.com Wed Mar 9 03:03:40 2016 From: yangmin_hust at 126.com (minyang) Date: Wed, 9 Mar 2016 01:03:40 -0700 (MST) Subject: [vtkusers] How to implement "over cut" display? Message-ID: <1457510620432-5737110.post@n5.nabble.com> Hi, I'm trying to display "over cut" area on mesh(polydata) like this snapshot. The mesh is vtkPolyData. The orientated parallel lights project to mesh, and some area would be blocked(like red area in snapshot). I want to find this area and display it. The scalar bar would be useful for display it. Any one know how to find the area with VTK? thanks in advance. -- View this message in context: http://vtk.1045678.n5.nabble.com/How-to-implement-over-cut-display-tp5737110.html Sent from the VTK - Users mailing list archive at Nabble.com. From luukdegram at gmail.com Wed Mar 9 04:07:08 2016 From: luukdegram at gmail.com (Luuk de Gram) Date: Wed, 9 Mar 2016 10:07:08 +0100 Subject: [vtkusers] VTK Android example problem Message-ID: Dear VTK community, I've been struggling getting the Android example to work. I've successfully compiled VTK 6.3 with Android api 19. I also succeeded in linking the VTK binaries + headers within Android and the project builds fine. However, when running the app I get a segfault when I add a renderer to the render window. I've tried using vtkSmartPointer and a raw pointer aswell but both without success. I'm used to using VES, which unfortunately is no longer maintained. I've also tried using VTK 7.0, which I could not make work together with api 19 but for that I'll create a new thread. The example in question can be found at: https://github.com/Kitware/VTK/blob/master/Examples/Android/NativeVTK/jni/main.cxx#L68 The segfault happends at line 68. Regards, Luuk -------------- next part -------------- An HTML attachment was scrubbed... URL: From luukdegram at gmail.com Wed Mar 9 04:13:49 2016 From: luukdegram at gmail.com (Luuk de Gram) Date: Wed, 9 Mar 2016 10:13:49 +0100 Subject: [vtkusers] Building VTK 7.0 for Android (api 19) Message-ID: Dear VTK community, I've been trying to build VTK 7.0 for Android using api level 19. Although I did succeed in building it using api 21, I would prefer it to work with api 19. I could not find any information if 21 and higher is a requirement to building 7.0. Anyway whenever I run make, I get the following errors: /home/luuk/Documents/VTK/Utilities/KWSys/vtksys/SystemInformation.cxx: In member function 'vtksys::SystemInformation::LongLong vtksys::SystemInformationImplementation::GetProcMemoryAvailable(const char*, const char*)': /home/luuk/Documents/VTK/Utilities/KWSys/vtksys/SystemInformation.cxx:3523:21: error: aggregate 'ResourceLimitType rlim' has incomplete type and cannot be defined ResourceLimitType rlim; ^ /home/luuk/Documents/VTK/Utilities/KWSys/vtksys/SystemInformation.cxx:3524:42: error: 'getrlimit64' was not declared in this scope ierr=GetResourceLimit(RLIMIT_DATA,&rlim); ^ Utilities/KWSys/vtksys/CMakeFiles/vtksys.dir/build.make:353: recipe for target 'Utilities/KWSys/vtksys/CMakeFiles/vtksys.dir/SystemInformation.cxx.o' failed make[5]: *** [Utilities/KWSys/vtksys/CMakeFiles/vtksys.dir/SystemInformation.cxx.o] Error 1 CMakeFiles/Makefile2:171: recipe for target 'Utilities/KWSys/vtksys/CMakeFiles/vtksys.dir/all' failed make[4]: *** [Utilities/KWSys/vtksys/CMakeFiles/vtksys.dir/all] Error 2 Makefile:116: recipe for target 'all' failed make[3]: *** [all] Error 2 CMakeFiles/vtk-android.dir/build.make:109: recipe for target 'CMakeExternals/Prefix/vtk-android/src/vtk-android-stamp/vtk-android-build' failed make[2]: *** [CMakeExternals/Prefix/vtk-android/src/vtk-android-stamp/vtk-android-build] Error 2 CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/vtk-android.dir/all' failed make[1]: *** [CMakeFiles/vtk-android.dir/all] Error 2 Makefile:75: recipe for target 'all' failed make: *** [all] Error 2 Regards, Luuk -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcplatt at dsl.pipex.com Wed Mar 9 04:28:38 2016 From: jcplatt at dsl.pipex.com (John Platt) Date: Wed, 9 Mar 2016 09:28:38 +0000 Subject: [vtkusers] Font size in vtkScalarBarActor In-Reply-To: <1457491547206-5737107.post@n5.nabble.com> References: <1398111905499-5726868.post@n5.nabble.com> <1457491547206-5737107.post@n5.nabble.com> Message-ID: <56DFECC6.4090006@dsl.pipex.com> Hi, AFAIK (at VTK 5.10 at least) vtkScalarBarActor always chooses the font size to fit the actor size. Attached is vtkScalarBarActor2 which allows a ceiling to be set on the title and label font size. This is based on the 5.10 version of vtkScalarBarActor. HTH John. On 09/03/2016 02:45, Tharun wrote: > My I know if anybody has a solution for the question above? > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/Font-size-in-vtkScalarBarActor-tp5726868p5737107.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 -------------- /*========================================================================= =========================================================================*/ #include "vtkScalarBarActor2.h" #include "vtkObjectFactory.h" #include "vtkTextMapper.h" #include "vtkTextProperty.h" #include "vtkScalarsToColors.h" vtkStandardNewMacro(vtkScalarBarActor2); //---------------------------------------------------------------------------- // Instantiate object with 64 maximum colors; 5 labels; %%-#6.3g label // format, no title, and vertical orientation. The initial scalar bar // size is (0.05 x 0.8) of the viewport size. vtkScalarBarActor2::vtkScalarBarActor2() { // Optional title when scalar bar is oriented horizontally. this->HorizontalTitle = NULL; // No ceiling on the label text font size in effect on construction. this->LabelFontSizeCeiling = 0; this->TitleFontSizeCeiling = 0; } //---------------------------------------------------------------------------- vtkScalarBarActor2::~vtkScalarBarActor2() { if (this->HorizontalTitle) { delete [] this->HorizontalTitle; this->HorizontalTitle = NULL; } } //---------------------------------------------------------------------------- void vtkScalarBarActor2::AllocateAndSizeLabels( int* labelSize, int* size, vtkViewport* viewport, double* range ) { labelSize[0] = labelSize[1] = 0; this->TextMappers = new vtkTextMapper * [this->NumberOfLabels]; this->TextActors = new vtkActor2D * [this->NumberOfLabels]; char string[512]; double val; int i; // TODO: this should be optimized, maybe by keeping a list of // allocated mappers, in order to avoid creation/destruction of // their underlying text properties (i.e. each time a mapper is // created, text properties are created and shallow-assigned a font size // which value might be "far" from the target font size). // is this a vtkLookupTable or a subclass of vtkLookupTable // with its scale set to log int isLogTable = this->LookupTable->UsingLogScale(); for (i=0; i < this->NumberOfLabels; i++) { this->TextMappers[i] = vtkTextMapper::New(); if ( isLogTable ) { double lval; if (this->NumberOfLabels > 1) { lval = log10(range[0]) + static_cast(i)/(this->NumberOfLabels-1) * (log10(range[1])-log10(range[0])); } else { lval = log10(range[0]) + 0.5*(log10(range[1])-log10(range[0])); } val = pow(10.0,lval); } else { if (this->NumberOfLabels > 1) { val = range[0] + static_cast(i)/(this->NumberOfLabels-1) * (range[1]-range[0]); } else { val = range[0] + 0.5*(range[1]-range[0]); } } sprintf(string, this->LabelFormat, val); this->TextMappers[i]->SetInput(string); // Shallow copy here so that the size of the label prop is not affected // by the automatic adjustment of its text mapper's size (i.e. its // mapper's text property is identical except for the font size // which will be modified later). This allows text actors to // share the same text property, and in that case specifically allows // the title and label text prop to be the same. this->TextMappers[i]->GetTextProperty()->ShallowCopy( this->LabelTextProperty); this->TextActors[i] = vtkActor2D::New(); this->TextActors[i]->SetMapper(this->TextMappers[i]); this->TextActors[i]->SetProperty(this->GetProperty()); this->TextActors[i]->GetPositionCoordinate()-> SetReferenceCoordinate(this->PositionCoordinate); } if (this->NumberOfLabels) { int targetWidth, targetHeight; if ( this->Orientation == VTK_ORIENT_VERTICAL ) { targetWidth = static_cast(0.6*size[0]); targetHeight = static_cast(0.86*size[1]/this->NumberOfLabels); } else { targetWidth = static_cast(size[0]*0.8/this->NumberOfLabels); targetHeight = static_cast(0.25*size[1]); } int labelFontSize = vtkTextMapper::SetMultipleConstrainedFontSize( viewport, targetWidth, targetHeight, this->TextMappers, this->NumberOfLabels, labelSize); // The combination of a vertically orientated bar and single digit scalar // values can lead to an oversized text label font. The font size can safely // be REDUCED while still honoring the Position and Position2 coordinates // (i.e. bar + labels will still fit inside the box described by these 2 // points). if ( this->LabelFontSizeCeiling ) { if ( labelFontSize > LabelFontSizeCeiling ) { for ( i = 0; i < NumberOfLabels; i++ ) { if ( this->TextMappers[i] ) { this->TextMappers[i]->GetTextProperty()->SetFontSize( this->LabelFontSizeCeiling ); } } } } } } //---------------------------------------------------------------------------- // The title input is set in RenderOpaqueGeometry(). This is used as a convenience // for changing the input. void vtkScalarBarActor2::SizeTitle( int* titleSize, int* size, vtkViewport* viewport ) { titleSize[0] = titleSize[1] = 0; // Set the horizontal title. if ( this->Orientation == VTK_ORIENT_HORIZONTAL && this->HorizontalTitle ) this->TitleMapper->SetInput(this->HorizontalTitle); if (this->Title == NULL || !strlen(this->Title)) { return; } int targetWidth, targetHeight; if ( this->Orientation == VTK_ORIENT_VERTICAL ) { targetWidth = static_cast(0.9*size[0]); // targetHeight = static_cast(0.1*size[1]); targetHeight = static_cast(0.12*size[1]); } else { targetWidth = size[0]; targetHeight = static_cast(0.25*size[1]); } // Set and return the font size required to make this mapper fit in a given // target rectangle (width x height, in pixels). int titleFontSize = this->TitleMapper->SetConstrainedFontSize( viewport, targetWidth, targetHeight ); if ( this->TitleFontSizeCeiling ) { if ( titleFontSize > TitleFontSizeCeiling ) { this->TitleMapper->GetTextProperty()->SetFontSize( this->TitleFontSizeCeiling ); } } this->TitleMapper->GetSize(viewport, titleSize); } //---------------------------------------------------------------------------- void vtkScalarBarActor2::ShallowCopy(vtkProp *prop) { vtkScalarBarActor2 *a = vtkScalarBarActor2::SafeDownCast(prop); if ( a != NULL ) { this->SetHorizontalTitle(a->GetHorizontalTitle()); this->SetTitleFontSizeCeiling(a->GetTitleFontSizeCeiling()); this->SetLabelFontSizeCeiling(a->GetLabelFontSizeCeiling()); } // Now do superclass this->vtkScalarBarActor::ShallowCopy(prop); } //---------------------------------------------------------------------------- void vtkScalarBarActor2::PrintSelf(ostream& os, vtkIndent indent) { this->Superclass::PrintSelf(os,indent); os << indent << "Horizontal Title: " << (this->HorizontalTitle ? this->HorizontalTitle : "(none)") << "\n"; os << indent << "Title Font Size Ceiling: " << this->TitleFontSizeCeiling << "\n"; os << indent << "Label Font Size Ceiling: " << this->LabelFontSizeCeiling << "\n"; } -------------- next part -------------- /*========================================================================= Program: Visualization Toolkit Module: vtkScalarBarActor.h Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ // .NAME vtkScalarBarActor2 - Create a scalar bar with labels // .SECTION Description #ifndef __vtkScalarBarActor2_h #define __vtkScalarBarActor2_h #include "vtkScalarBarActor.h" class VTK_RENDERING_EXPORT vtkScalarBarActor2 : public vtkScalarBarActor { public: vtkTypeMacro(vtkScalarBarActor2,vtkScalarBarActor); void PrintSelf(ostream& os, vtkIndent indent); // Description: // Instantiate object with 64 maximum colors; 5 labels; %%-#6.3g label // format, no title, and vertical orientation. The initial scalar bar // size is (0.05 x 0.8) of the viewport size. static vtkScalarBarActor2* New(); // Description: // Set/Get the horizontal title of the scalar bar actor, vtkSetStringMacro(HorizontalTitle); vtkGetStringMacro(HorizontalTitle); // Description: // Set/Get a ceiling on the title text font size. This is used to REDUCE the // title font size determined by SetConstrainedFontSize(). vtkSetClampMacro(TitleFontSizeCeiling, int, 0, VTK_LARGE_INTEGER); vtkGetMacro(TitleFontSizeCeiling, int); // Description: // Set/Get a ceiling on the label text font size. This is used to REDUCE the // text label font size determined by SetMultipleConstrainedFontSize(). vtkSetClampMacro(LabelFontSizeCeiling, int, 0, VTK_LARGE_INTEGER); vtkGetMacro(LabelFontSizeCeiling, int); // Description: // Shallow copy of a scalar bar actor. Overloads the virtual vtkProp method. void ShallowCopy(vtkProp *prop); protected: vtkScalarBarActor2(); ~vtkScalarBarActor2(); char* HorizontalTitle; virtual void SizeTitle( int* titleSize, int* size, vtkViewport* viewport ); int TitleFontSizeCeiling; int LabelFontSizeCeiling; virtual void AllocateAndSizeLabels( int* labelSize, int* size, vtkViewport* viewport, double* range ); private: vtkScalarBarActor2(const vtkScalarBarActor2&); // Not implemented. void operator=(const vtkScalarBarActor2&); // Not implemented. }; #endif From mguttman at yahoo.com Wed Mar 9 04:54:45 2016 From: mguttman at yahoo.com (Mike Guttman) Date: Wed, 9 Mar 2016 09:54:45 +0000 (UTC) Subject: [vtkusers] translucent trouble with external OpenGL render window In-Reply-To: References: Message-ID: <46409682.5144464.1457517285488.JavaMail.yahoo@mail.yahoo.com> Greetings, Having trouble with a simple set of polygon data, read from an STL file, rendering in an ExternalVTKWidget.? I am migrating from VTK 6.2 with OpenGL1 back-end, and having trouble with 6.3 (OpenGL1 or 2) and 7.0. I've tried a few configurations using ExternalVTKWidget and deriving a class from QOpenGLWidget: With 6.2/OpenGL1, the polydata looks how I expect, with some normals, lighting depth sorting and transparency (see 1st picture).? In 6.3/OpenGL1, the surface was not visible.? With 6.3/OpenGL2, surface quality is bad, as if some normals or translucency info is gone or ignored (see 2nd picture).? Same result with 7.0. I then tried QVTKWidget2 and the surface looked fine.? But I need more control over the rendering process which I can't get with this class.? For example, rendering other things before or after the render() call, and having my own control over mouse behavior.? I also want to display the same rendering in multiple windows.? Deriving a class from QOpenGLWidget seems to offer the control I need, and seems more amenable to context sharing. So I'm wondering what is going wrong with the vtkExternalOpenGLRenderWindow that it's not rendering the surface as in QVTKWidget2.? Is there some initialization step missing?? Hopefully it is something silly I missed. Here are relevant code snippets: In initializeGL(): ? externalVTKWidget = vtkSmartPointer::New(); ? mRenWin = externalVTKWidget->GetRenderWindow(); ? mRenWin->Start(); ? vtkSmartPointer callback = vtkSmartPointer::New(); ? callback->SetClientData(this); ? callback->SetCallback(makeCurrentCallback); ? mRenWin->AddObserver(vtkCommand::WindowMakeCurrentEvent, callback); In resizeGL(): ? mRenWin->SetSize(w, h);? // not needed anymore, I think ? renderer = externalVTKWidget->AddRenderer(); This is how the polydata is read, nothing unusual here, I think: ??? vtkSmartPointer reader = vtkSmartPointer::New(); ??? reader->SetFileName(fileName.c_str()); ??? reader->Update(); ??? polydata = reader->GetOutput(); ??? vtkSmartPointer normalGenerator = vtkSmartPointer::New(); ??? normalGenerator->SetInputData(polydata); ??? vtkSmartPointer depthSort = vtkSmartPointer::New(); ??? depthSort->SetInputConnection(normalGenerator->GetOutputPort()); ??? depthSort->SetDirectionToBackToFront(); ??? depthSort->SetVector(1, 1, 1); ??? vtkSmartPointer mapper = vtkSmartPointer::New(); ??? mapper->SetInputConnection(depthSort->GetOutputPort()); ??? mapper->ScalarVisibilityOff(); ??? vtkSmartPointer actor = vtkSmartPointer::New(); ??? actor->SetMapper(mapper); ??? actor->GetProperty()->SetOpacity(0.7); ? ? mRenWin->renderer->AddActor(actor); I'm using depth sorter b/c I was having trouble getting depth peeling working.? This is what got me started trying to migrate. BTW, the VTK folks seem to say that QVTKWidget2 is the way to go for the future of VTK within Qt.? However, it is derived from QGLWidget, which the Qt folks say is deprecated.? I wonder what is going to happen here. Thank you in advance for any help you can offer, Mike PS: 1st picture is the way it's supposed to look (as I get in 6.2/OpenGL1).? 2nd picture is the way it's looking in 6.3/OpenGL2 and 7.0. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: vtk6.3-opengl2-externwidget.jpg Type: image/jpeg Size: 4851 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: vtk6.2-opengl1.jpg Type: image/jpeg Size: 6794 bytes Desc: not available URL: From f.nellmeldin at open-engineering.com Wed Mar 9 05:08:29 2016 From: f.nellmeldin at open-engineering.com (Fernando Nellmeldin) Date: Wed, 9 Mar 2016 11:08:29 +0100 Subject: [vtkusers] Show a text for a limited period of time In-Reply-To: References: Message-ID: Hello. Sorry for the delayed answer. In fact, I hadn't thought about that. I could use Qt as you suggested and that's all! Everything works as expected, thank you! Fernando. 2016-03-07 15:54 GMT+01:00 Cory Quammen : > While there is some timer support in VTK, since you are using Qt, you > are likely better of firing off a one-shot timer event in Qt after you > save your screen shot. See http://doc.qt.io/qt-4.8/qtimer.html for > details. In the slot you connect the timer to, you'll take care of > hiding/removing the vtkTextActor. > > HTH, > Cory > > On Mon, Mar 7, 2016 at 4:54 AM, Fernando Nellmeldin > wrote: > > Hello, > > does anyone know if this is possible with VTK? > > > > Thank you. > > Fernando. > > > > 2016-03-01 10:08 GMT+01:00 Fernando Nellmeldin > > : > >> > >> Hello all. > >> > >> I would like to show a text in screen and this text should disappear > after > >> a few seconds (3~4). For example, the text should say: "Screenshot > saved" > >> and then disappear. For me, doesn't matter if the vtkTextActor gets > deleted > >> or its visibility gets turned off. > >> > >> How can this be achieved with VTK? Please note that my VTK window is > >> embedded in a Qt application window. > >> > >> I've done this before with pure OpenGL, but in that case I had access to > >> the "while (true)" loop of the application and I could ask each frame > how > >> many seconds have passed. I am completely lost on this subject when > using > >> VTK. > >> > >> Thank you! > >> > >> Fernando. > > > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Please keep messages on-topic and check the VTK FAQ at: > > 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 > R&D Engineer > Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From corentin.desfarges.dev at gmail.com Wed Mar 9 06:22:21 2016 From: corentin.desfarges.dev at gmail.com (corentin.desfarges) Date: Wed, 9 Mar 2016 04:22:21 -0700 (MST) Subject: [vtkusers] How to get pixel color from 3D coordinates ? Message-ID: <1457522541544-5737117.post@n5.nabble.com> Hi I'm trying to get the color of a pixel picked from a vtkPolyData. I tried to combine this two tutorials : PickPixel and (Point)Picking I can get the coordinates of the picked point, but unfortunatly, I'm can't get the vtkCell... Here is the code I use : std::string inputFilename = "/home/cde/data/mesh.vtk"; vtkSmartPointer reader = vtkSmartPointer::New(); reader->SetFileName(inputFilename.c_str()); reader->Update(); polydata = reader->GetPolyDataOutput(); [...] double* pos = picker->GetPickPosition(); vtkPointData* pd = polydata->GetPointData(); if( !pd ) { return; } // Use tolerance as a function of size of source data double tol2 = polydata->GetLength(); tol2 = tol2 ? tol2*tol2 / 1000.0 : 0.001; // Find the cell that contains pos int subId; double pcoords[3], weights[8]; vtkCell* cell = polydata->FindAndGetCell( pos, NULL, -1, tol2, subId, pcoords, weights ); if( cell ) { // Interpolate the point data this->PointData->InterpolatePoint( pd, 0, cell->PointIds, weights ); double* tuple = this->PointData->GetScalars()->GetTuple( 0 ); double r = std::stod(vtkVariant(tuple[0]).ToString())/255; double g = std::stod(vtkVariant(tuple[1]).ToString())/255; double b = std::stod(vtkVariant(tuple[2]).ToString())/255; std::cout << r*255 << " " << g*255 << " " << b*255 << std::endl; renderer->SetBackground(r,g,b); } else { std::cout << "no cell found " << std::endl; } Thanks for your help, Corentin -- View this message in context: http://vtk.1045678.n5.nabble.com/How-to-get-pixel-color-from-3D-coordinates-tp5737117.html Sent from the VTK - Users mailing list archive at Nabble.com. From rakesh.p at tataelxsi.co.in Wed Mar 9 07:22:32 2016 From: rakesh.p at tataelxsi.co.in (Rakesh Patil) Date: Wed, 9 Mar 2016 12:22:32 +0000 Subject: [vtkusers] Need information about "Invalid pixel format, no opengl support" message. Message-ID: Hi VTK users, I am facing a strange issue. I am using QVTKWidget in my application and it works very well on my desktop computer. The same code when I try to compile on my laptop it throws me this error message: "Invalid pixel format, no opengl support" I would like to know what are the scenarios in which VTK throws this message. Whether there is any dependency on various versions of Windows OS? I believe it should not be. Below is the system information where I get this error: OS Name: Microsoft Windows 8.1 Pro Version: 6.3.9600 Build 9600 OS Manufacturer: Microsoft Corporation System Manufacturer: Dell Inc. System Model: Precision T1700 System Type: x64-based PC Processor Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz, 3592 Mhz, 4 Core(s), 8 Logical Processor(s) Installed Physical Memory (RAM): 32.0 GB Total Virtual Memory: 36.7 GB Display adapter: NVIDIA Quadro K620 Note: I am not using QVTKWidget2. Kindly give some feedback as early as possible. Thank You Warm Regards Rakesh Patil -------------- next part -------------- An HTML attachment was scrubbed... URL: From bruno.manata.oliveira at gmail.com Wed Mar 9 07:35:22 2016 From: bruno.manata.oliveira at gmail.com (Bruno Oliveira) Date: Wed, 9 Mar 2016 12:35:22 +0000 Subject: [vtkusers] big sphere radius not working Message-ID: Hello, I am tryint to create a sphere with a huge raidius (3e6). I use this code: // Create a sphere with texture coordinates vtkSmartPointer source = vtkSmartPointer< vtkTexturedSphereSource>::New(); source->SetRadius(radius); source->SetThetaResolution(1000); source->SetPhiResolution(100); this code works if I use a small raiuds (like 2), but if i set a big radius value (like 3e6), it won't work: the rendered image is all black. Why could this be happening? -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.martin at kitware.com Wed Mar 9 08:47:20 2016 From: ken.martin at kitware.com (Ken Martin) Date: Wed, 9 Mar 2016 08:47:20 -0500 Subject: [vtkusers] Building VTK 7.0 for Android (api 19) In-Reply-To: References: Message-ID: One idea, wipe your build directory and try again if you haven't already. Make sure to set the API level early on. Cmake checks for some values when it configures and changing API level does not cause cmake to recheck them. So if it configured with a setting of 21 then from that point forward it will have system introspection values for 21. Put another way, if you change the API level you have to wipe your binary tree. That may not be the problem but it has bitten me before. You can also look at https://open.cdash.org/viewNotes.php?buildid=4270266 which is the API 18 build script that I run to build and run that example every night. It is based on VTK master but it may help. Thanks Ken On Wed, Mar 9, 2016 at 4:13 AM, Luuk de Gram wrote: > Dear VTK community, > > I've been trying to build VTK 7.0 for Android using api level 19. Although > I did succeed in building it using api 21, I would prefer it to work with > api 19. I could not find any information if 21 and higher is a requirement > to building 7.0. > > Anyway whenever I run make, I get the following errors: > > /home/luuk/Documents/VTK/Utilities/KWSys/vtksys/SystemInformation.cxx: In > member function 'vtksys::SystemInformation::LongLong > vtksys::SystemInformationImplementation::GetProcMemoryAvailable(const > char*, const char*)': > /home/luuk/Documents/VTK/Utilities/KWSys/vtksys/SystemInformation.cxx:3523:21: > error: aggregate 'ResourceLimitType rlim' has incomplete type and cannot be > defined > ResourceLimitType rlim; > ^ > /home/luuk/Documents/VTK/Utilities/KWSys/vtksys/SystemInformation.cxx:3524:42: > error: 'getrlimit64' was not declared in this scope > ierr=GetResourceLimit(RLIMIT_DATA,&rlim); > ^ > Utilities/KWSys/vtksys/CMakeFiles/vtksys.dir/build.make:353: recipe for > target > 'Utilities/KWSys/vtksys/CMakeFiles/vtksys.dir/SystemInformation.cxx.o' > failed > make[5]: *** > [Utilities/KWSys/vtksys/CMakeFiles/vtksys.dir/SystemInformation.cxx.o] > Error 1 > CMakeFiles/Makefile2:171: recipe for target > 'Utilities/KWSys/vtksys/CMakeFiles/vtksys.dir/all' failed > make[4]: *** [Utilities/KWSys/vtksys/CMakeFiles/vtksys.dir/all] Error 2 > Makefile:116: recipe for target 'all' failed > make[3]: *** [all] Error 2 > CMakeFiles/vtk-android.dir/build.make:109: recipe for target > 'CMakeExternals/Prefix/vtk-android/src/vtk-android-stamp/vtk-android-build' > failed > make[2]: *** > [CMakeExternals/Prefix/vtk-android/src/vtk-android-stamp/vtk-android-build] > Error 2 > CMakeFiles/Makefile2:60: recipe for target > 'CMakeFiles/vtk-android.dir/all' failed > make[1]: *** [CMakeFiles/vtk-android.dir/all] Error 2 > Makefile:75: recipe for target 'all' failed > make: *** [all] Error 2 > > Regards, > Luuk > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 david.lonie at kitware.com Wed Mar 9 09:29:55 2016 From: david.lonie at kitware.com (David Lonie) Date: Wed, 9 Mar 2016 09:29:55 -0500 Subject: [vtkusers] Font size in vtkScalarBarActor In-Reply-To: <1457491547206-5737107.post@n5.nabble.com> References: <1398111905499-5726868.post@n5.nabble.com> <1457491547206-5737107.post@n5.nabble.com> Message-ID: See vtkTextProperty::SetFontSize vtkScalarBarActor::GetTitleTextProperty vtkScalarBarActor::GetLabelTextProperty vtkScalarBarActor::GetAnnotationTextProperty vtkScalarBarActor::SetUnconstrainedFontSize Best, Dave On Tue, Mar 8, 2016 at 9:45 PM, Tharun wrote: > My I know if anybody has a solution for the question above? > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Font-size-in-vtkScalarBarActor-tp5726868p5737107.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 tjlp at netease.com Wed Mar 9 10:21:01 2016 From: tjlp at netease.com (Liu_tj) Date: Wed, 9 Mar 2016 23:21:01 +0800 (CST) Subject: [vtkusers] How to map negative grayscale to color? In-Reply-To: References: <59c5b9d3.2.15351eb7dc2.Coremail.tjlp@netease.com> <4aa21faa.14.15356a0967e.Coremail.tjlp@netease.com> <28c8b01.16.1535719e3be.Coremail.tjlp@netease.com> <42e78ce8.c.15359a3434c.Coremail.tjlp@netease.com> Message-ID: <38137f07.28.1535bf786d8.Coremail.tjlp@netease.com> Hi, David, I try it again. The conversion from gray scale to RGB works after I set the LookupTable to vtkImageMapToWindowLevelColors returned by vtkImageViewer2::GetWindowLevels(). ?2016-03-09?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?9? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: Re: Re: Re: [vtkusers] How to map negative grayscale to color? No, that isn't necessary. On Tue, Mar 8, 2016 at 9:29 PM, Liu_tj wrote: Hi,David, Do I need to set the LookupTable to vtkImageMapToWindowLevelColors which is returned by vtkImageViewer2::GetWindowLevels() instead of create a new vtkImageMapToColors? BR, Thanks ?2016-03-09?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?9? ??? ???:"Liu_tj" ??:Re: Re: Re: [vtkusers] How to map negative grayscale to color? Hi Liu Peng, Do you want to show a gray image underneath, and the color image on top? I'm not sure if vtkImageViewer works property if you add more than one image. You should add a "print" statement of some kind to your code to print the values of scalarrange, to be sure they are correct. Don't call colormap.Build() after setting your own values for the table, or it might overwrite the values that you have set. If you call it at all, call it immediately after SetNumberOfTableValues(), before you set any of your own values. The range on the final for() loop should be the following: for (int i = (int)(threshhold[1]) + 1; i <= (int)(scalarrange[1]); i++) Also, if you want the beyond-threshold values to be transparent instead of black, then set the alpha component to zero: for (int i = (int)(scalarrange[0]); i < (int)(threshhold[0]); i++) { colormap.SetTableValue(i - (int)scalarrange[0], 0.0, 0.0, 0.0, 0.0); } - David On Tue, Mar 8, 2016 at 9:40 AM, Liu_tj wrote: Hi, David, I follow your post and it doesn't work. The DICOM image shows no color, just gray image. Could you have a look at my code below? I use a vtkImageView2 to display the DICOM image. The code is c# by Activiz .NET. The scalar range of test image is [-1024,3071]. I want to show the gray scale at [1000,3000] to green. The function GrayToColors() maps gray scale to color, it is called by Display(). private void Display(vtkRenderWindow aRenderWindow, vtkAlgorithmOutput aData) { if (aData == null) return; m_imageViewer = vtkImageViewer2.New(); m_imageViewer.SetInputConnection(aData); switch (m_sliceDirection) { case Direction.AXIAL: m_imageViewer.SetSliceOrientationToXY(); break; case Direction.CORONAL: m_imageViewer.SetSliceOrientationToYZ(); break; case Direction.SAGITTAL: m_imageViewer.SetSliceOrientationToXZ(); break; default: break; } m_imageViewer.GetSliceRange(ref m_minSliceNumber, ref m_maxSliceNumber); m_interactorStyle = vtkInteractorStyleImage.New(); m_interactorStyle.MouseWheelForwardEvt += new vtkObject.vtkObjectEventHandler(interactor_MouseWheelForwardEvt); m_interactorStyle.MouseWheelBackwardEvt += new vtkObject.vtkObjectEventHandler(interactor_MouseWheelBackwardEvt); aRenderWindow.GetInteractor().SetInteractorStyle(m_interactorStyle); aRenderWindow.GetRenderers().InitTraversal(); m_renderer = aRenderWindow.GetRenderers().GetFirstRenderer(); m_renderer.SetBackground(0.0, 0.0, 0.0); m_imageViewer.SetRenderWindow(aRenderWindow); m_currentSlice = m_minSliceNumber + (m_maxSliceNumber - m_minSliceNumber) / 2; m_imageViewer.SetSlice(m_currentSlice); double[] scalarrange = new double[2]; scalarrange = m_imageViewer.GetInput().GetScalarRange(); double[] threshhold = new double[2]; threshhold[0] = 1000; threshhold[1] = 3000; m_imageViewer.Render(); GrayToColors(m_renderer, aData, scalarrange, threshhold); m_imageViewer.Render(); } private void GrayToColors(vtkRenderer renderer, vtkAlgorithmOutput data, double[] scalarrange, double[] threshhold) { vtkLookupTable colormap = vtkLookupTable.New(); int number = (int)(scalarrange[1] - scalarrange[0] + 1); colormap.SetRange(scalarrange[0], scalarrange[1]); colormap.SetNumberOfTableValues(number); for (int i = (int)(scalarrange[0]); i < (int)(threshhold[0]); i++) { colormap.SetTableValue(i - (int)scalarrange[0], 0.0, 0.0, 0.0, 1.0); } for (int i = (int)(threshhold[0]); i <= (int)(threshhold[1]); i++) { colormap.SetTableValue(i - (int)scalarrange[0], 0.0, 1.0, 0.0, 1.0); } for (int i = (int)(threshhold[1]); i < (int)(scalarrange[1]); i++) { colormap.SetTableValue(i - (int)scalarrange[0], 0.0, 0.0, 0.0, 1.0); } colormap.Build(); vtkImageMapToColors colormapper = vtkImageMapToColors.New(); colormapper.SetInputConnection(data); colormapper.SetLookupTable(colormap); colormapper.Update(); vtkImageActor colormapActor = vtkImageActor.New(); colormapActor.SetInput(colormapper.GetOutput()); renderer.AddActor(colormapActor); renderer.ResetCamera(); renderer.Modified(); } Thanks ?2016-03-08?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?8? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: Re: [vtkusers] How to map negative grayscale to color? Hi Liu Pen, That's because I forgot to include the index argument in the call to SetTableValue: table->SetRange(-1024, 4095); table->SetNumberOfTableValues(4095 + 1024 + 1); for (int i = -1024; i < -10; i++) { table->SetTableValue(i + 1024, 0.0, 0.0, 0.0, 1.0); } The table index must start at zero. The call to SetRange(-1024, 4095) causes the scalar value -1024 to map to table index 0. In the "for" loop, i is the scalar value. - David On Tue, Mar 8, 2016 at 7:27 AM, Liu_tj wrote: Hi, David, When I try, a lot of errors are popup: "Can't set the table value for negative index". Seems the negative grayscale needs some transformation. Thanks Liu Peng ?2016-03-08?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?8? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: [vtkusers] How to map negative grayscale to color? Hi Liu Peng, You can set individual values in the lookup table, in order to precisely map certain scalar values to specific colors: table->SetRange(-1024, 4095); table->SetNumberOfTableValues(4095 + 1024 + 1); for (int i = -1024; i < -10; i++) { table->SetTableValue(0.0, 0.0, 0.0, 1.0); } for (int i = -10; i <= 200; i++) { table->SetTableValue(0.0, 1.0, 0.0, 1.0); } etcetera. - David On Mon, Mar 7, 2016 at 9:31 AM, Liu_tj wrote: Hi, I try to use the vtkLookupTable to convert the grayscale to rgb color. The image scalar range is [-1024,3071] returned by vtkImageData::GetScalarRange(). Now I want to convert specific grayscale range, for example, [-10,200] to one color, such as green (RGB is 0,1,0). How to do that by vtkLookupTable? I have no idea what method should call: SetNumberOfTableValues(), SetRange(), SetHueRange(), SetValueRange(). What do "Hue" and "Value" stand for? BR, Liu Peng -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Wed Mar 9 11:11:02 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 9 Mar 2016 09:11:02 -0700 Subject: [vtkusers] How to map negative grayscale to color? In-Reply-To: <38137f07.28.1535bf786d8.Coremail.tjlp@netease.com> References: <59c5b9d3.2.15351eb7dc2.Coremail.tjlp@netease.com> <4aa21faa.14.15356a0967e.Coremail.tjlp@netease.com> <28c8b01.16.1535719e3be.Coremail.tjlp@netease.com> <42e78ce8.c.15359a3434c.Coremail.tjlp@netease.com> <38137f07.28.1535bf786d8.Coremail.tjlp@netease.com> Message-ID: Hi Liu Peng, I'm glad to hear it worked for you. I didn't think it would be necessary, because I thought that if you passed an RGB (or RGBA) image to vtkImageViewer2 it would simply display it as-is, without needing any tweaks to internal parts of the Viewer (note: I hardly ever use vtkImageViewer or vtkimageViewer2 myself, I prefer to use the image mappers directly instead). - David On Wed, Mar 9, 2016 at 8:21 AM, Liu_tj wrote: > Hi, David, > > I try it again. The conversion from gray scale to RGB works after I set > the LookupTable to vtkImageMapToWindowLevelColors returned by > vtkImageViewer2::GetWindowLevels(). > > > > ?2016-03-09?"David Gobbi" ??? > > -----????----- > *???:*"David Gobbi" > *????:*2016?03?9? ??? > *???:*"Liu_tj" > *??:*"vtkusers" > *??:*Re: Re: Re: Re: [vtkusers] How to map negative grayscale to color? > > > No, that isn't necessary. > > On Tue, Mar 8, 2016 at 9:29 PM, Liu_tj wrote: > >> Hi,David, >> >> Do I need to set the LookupTable to vtkImageMapToWindowLevelColors which >> is returned by vtkImageViewer2::GetWindowLevels() instead of create a new >> vtkImageMapToColors? >> >> BR, >> Thanks >> >> >> ?2016-03-09?"David Gobbi" ??? >> >> -----????----- >> *???:*"David Gobbi" >> *????:*2016?03?9? ??? >> *???:*"Liu_tj" >> *??:*Re: Re: Re: [vtkusers] How to map negative grayscale to color? >> >> >> Hi Liu Peng, >> >> Do you want to show a gray image underneath, and the color image >> on top? I'm not sure if vtkImageViewer works property if you add >> more than one image. >> >> You should add a "print" statement of some kind to your code to >> print the values of scalarrange, to be sure they are correct. >> >> Don't call colormap.Build() after setting your own values for the table, >> or it might overwrite the values that you have set. If you call it at >> all, >> call it immediately after SetNumberOfTableValues(), before you set >> any of your own values. >> >> The range on the final for() loop should be the following: >> for (int i = (int)(threshhold[1]) + 1; i <= (int)(scalarrange[1]); i++) >> >> Also, if you want the beyond-threshold values to be transparent >> instead of black, then set the alpha component to zero: >> >> for (int i = (int)(scalarrange[0]); i < (int)(threshhold[0]); i++) >> { >> colormap.SetTableValue(i - (int)scalarrange[0], 0.0, 0.0, 0.0, 0.0); >> } >> >> - David >> >> >> On Tue, Mar 8, 2016 at 9:40 AM, Liu_tj wrote: >> >>> Hi, David, >>> >>> I follow your post and it doesn't work. The DICOM image shows no color, >>> just gray image. Could you have a look at my code below? I use a >>> vtkImageView2 to display the DICOM image. The code is c# by Activiz .NET. >>> The scalar range of test image is [-1024,3071]. I want to show the gray >>> scale at [1000,3000] to green. The function GrayToColors() maps gray scale >>> to color, it is called by Display(). >>> >>> private void Display(vtkRenderWindow aRenderWindow, vtkAlgorithmOutput >>> aData) >>> { >>> if (aData == null) >>> return; >>> >>> m_imageViewer = vtkImageViewer2.New(); >>> m_imageViewer.SetInputConnection(aData); >>> switch (m_sliceDirection) >>> { >>> case Direction.AXIAL: >>> m_imageViewer.SetSliceOrientationToXY(); >>> break; >>> case Direction.CORONAL: >>> m_imageViewer.SetSliceOrientationToYZ(); >>> break; >>> case Direction.SAGITTAL: >>> m_imageViewer.SetSliceOrientationToXZ(); >>> break; >>> default: >>> break; >>> } >>> >>> m_imageViewer.GetSliceRange(ref m_minSliceNumber, ref >>> m_maxSliceNumber); >>> m_interactorStyle = vtkInteractorStyleImage.New(); >>> m_interactorStyle.MouseWheelForwardEvt += new >>> vtkObject.vtkObjectEventHandler(interactor_MouseWheelForwardEvt); >>> m_interactorStyle.MouseWheelBackwardEvt += new >>> vtkObject.vtkObjectEventHandler(interactor_MouseWheelBackwardEvt); >>> >>> >>> aRenderWindow.GetInteractor().SetInteractorStyle(m_interactorStyle); >>> aRenderWindow.GetRenderers().InitTraversal(); >>> >>> m_renderer = aRenderWindow.GetRenderers().GetFirstRenderer(); >>> m_renderer.SetBackground(0.0, 0.0, 0.0); >>> >>> m_imageViewer.SetRenderWindow(aRenderWindow); >>> m_currentSlice = m_minSliceNumber + (m_maxSliceNumber - >>> m_minSliceNumber) / 2; >>> m_imageViewer.SetSlice(m_currentSlice); >>> >>> double[] scalarrange = new double[2]; >>> scalarrange = m_imageViewer.GetInput().GetScalarRange(); >>> double[] threshhold = new double[2]; >>> threshhold[0] = 1000; >>> threshhold[1] = 3000; >>> m_imageViewer.Render(); >>> GrayToColors(m_renderer, aData, scalarrange, threshhold); >>> >>> m_imageViewer.Render(); >>> } >>> >>> private void GrayToColors(vtkRenderer renderer, >>> vtkAlgorithmOutput data, double[] scalarrange, double[] threshhold) >>> { >>> vtkLookupTable colormap = vtkLookupTable.New(); >>> int number = (int)(scalarrange[1] - scalarrange[0] + 1); >>> colormap.SetRange(scalarrange[0], scalarrange[1]); >>> colormap.SetNumberOfTableValues(number); >>> >>> for (int i = (int)(scalarrange[0]); i < >>> (int)(threshhold[0]); i++) >>> { >>> colormap.SetTableValue(i - (int)scalarrange[0], 0.0, >>> 0.0, 0.0, 1.0); >>> } >>> for (int i = (int)(threshhold[0]); i <= >>> (int)(threshhold[1]); i++) >>> { >>> colormap.SetTableValue(i - (int)scalarrange[0], 0.0, >>> 1.0, 0.0, 1.0); >>> } >>> for (int i = (int)(threshhold[1]); i < >>> (int)(scalarrange[1]); i++) >>> { >>> colormap.SetTableValue(i - (int)scalarrange[0], 0.0, >>> 0.0, 0.0, 1.0); >>> } >>> colormap.Build(); >>> >>> vtkImageMapToColors colormapper = vtkImageMapToColors.New(); >>> colormapper.SetInputConnection(data); >>> colormapper.SetLookupTable(colormap); >>> colormapper.Update(); >>> >>> vtkImageActor colormapActor = vtkImageActor.New(); >>> colormapActor.SetInput(colormapper.GetOutput()); >>> renderer.AddActor(colormapActor); >>> renderer.ResetCamera(); >>> renderer.Modified(); >>> } >>> >>> Thanks >>> >>> ?2016-03-08?"David Gobbi" ??? >>> >>> -----????----- >>> *???:*"David Gobbi" >>> *????:*2016?03?8? ??? >>> *???:*"Liu_tj" >>> *??:*"vtkusers" >>> *??:*Re: Re: [vtkusers] How to map negative grayscale to color? >>> >>> >>> Hi Liu Pen, >>> >>> That's because I forgot to include the index argument in the call to >>> SetTableValue: >>> >>> table->SetRange(-1024, 4095); >>> table->SetNumberOfTableValues(4095 + 1024 + 1); >>> for (int i = -1024; i < -10; i++) { >>> table->SetTableValue(i + 1024, 0.0, 0.0, 0.0, 1.0); >>> } >>> >>> The table index must start at zero. The call to SetRange(-1024, 4095) >>> causes the scalar value -1024 to map to table index 0. In the "for" loop, >>> i is the scalar value. >>> >>> - David >>> >>> >>> On Tue, Mar 8, 2016 at 7:27 AM, Liu_tj wrote: >>> >>>> Hi, David, >>>> >>>> When I try, a lot of errors are popup: "Can't set the table value for >>>> negative index". >>>> >>>> Seems the negative grayscale needs some transformation. >>>> >>>> Thanks >>>> Liu Peng >>>> >>>> >>>> ?2016-03-08?"David Gobbi" ??? >>>> >>>> -----????----- >>>> *???:*"David Gobbi" >>>> *????:*2016?03?8? ??? >>>> *???:*"Liu_tj" >>>> *??:*"vtkusers" >>>> *??:*Re: [vtkusers] How to map negative grayscale to color? >>>> >>>> Hi Liu Peng, >>>> >>>> You can set individual values in the lookup table, >>>> in order to precisely map certain scalar values to >>>> specific colors: >>>> >>>> table->SetRange(-1024, 4095); >>>> table->SetNumberOfTableValues(4095 + 1024 + 1); >>>> for (int i = -1024; i < -10; i++) { >>>> table->SetTableValue(0.0, 0.0, 0.0, 1.0); >>>> } >>>> for (int i = -10; i <= 200; i++) { >>>> table->SetTableValue(0.0, 1.0, 0.0, 1.0); >>>> } >>>> etcetera. >>>> >>>> - David >>>> >>>> >>>> On Mon, Mar 7, 2016 at 9:31 AM, Liu_tj wrote: >>>> >>>>> Hi, >>>>> >>>>> I try to use the vtkLookupTable to convert the grayscale to rgb color. >>>>> The image scalar range is [-1024,3071] returned by >>>>> vtkImageData::GetScalarRange(). Now I want to convert specific grayscale >>>>> range, for example, [-10,200] to one color, such as green (RGB is 0,1,0). >>>>> How to do that by vtkLookupTable? I have no idea what method should call: >>>>> SetNumberOfTableValues(), SetRange(), SetHueRange(), SetValueRange(). What >>>>> do "Hue" and "Value" stand for? >>>>> >>>>> BR, >>>>> Liu Peng >>>>> >>>> -------------- next part -------------- An HTML attachment was scrubbed... URL: From oneiros.valente at gmail.com Wed Mar 9 11:18:57 2016 From: oneiros.valente at gmail.com (Lorenzo) Date: Wed, 9 Mar 2016 16:18:57 +0000 (UTC) Subject: [vtkusers] Can't transform a vtkVolume Message-ID: Hello everyone I'm having a strange problem related to VTK volume rendering: I can't apply a simple transform (a translation) to volumes. I'm using the "SetUserTransform()" function that vtkVolume inherit from vtkProp3D, a method that works like a charm on vtkActors. I also tried "SetUserMatrix()" and simple "SetPosition()" but nothing. Here's my code: http://pastebin.com/7MnTCHHN And here's the output: http://i.imgur.com/feCyaIL.png As you can see, I generated two cube volumes (one red and one blue) and two cone actors (one red and one blue). I then apply the same transform on both blue props but only the cone actually translates (that's why you see a purple volume, the two cubes are in the same position). How is this possible? From aashish.chaudhary at kitware.com Wed Mar 9 11:27:43 2016 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Wed, 9 Mar 2016 11:27:43 -0500 Subject: [vtkusers] Can't transform a vtkVolume In-Reply-To: References: Message-ID: Hi Lorenzo, what backend you are using OpenGL1 or OPenGL2? Also what version of VTK it is? Thanks, On Wed, Mar 9, 2016 at 11:18 AM, Lorenzo wrote: > Hello everyone > > I'm having a strange problem related to VTK volume rendering: I can't apply > a simple transform (a translation) to volumes. I'm using the > "SetUserTransform()" function that vtkVolume inherit from vtkProp3D, a > method that works like a charm on vtkActors. I also tried "SetUserMatrix()" > and simple "SetPosition()" but nothing. > > Here's my code: http://pastebin.com/7MnTCHHN > And here's the output: http://i.imgur.com/feCyaIL.png > > As you can see, I generated two cube volumes (one red and one blue) and two > cone actors (one red and one blue). I then apply the same transform on both > blue props but only the cone actually translates (that's why you see a > purple volume, the two cubes are in the same position). > > How is this possible? > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: 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 -- | Aashish Chaudhary | Technical Leader | Kitware Inc. | http://www.kitware.com/company/team/chaudhary.html From oneiros.valente at gmail.com Wed Mar 9 11:33:30 2016 From: oneiros.valente at gmail.com (Lorenzo) Date: Wed, 9 Mar 2016 16:33:30 +0000 (UTC) Subject: [vtkusers] Can't transform a vtkVolume References: Message-ID: Aashish Chaudhary kitware.com> writes: Hi Aashish, I'm using VTK 6.3 and OpenGL2 (i'm not 100% sure about OpenGL version... how can I test it?) From aashish.chaudhary at kitware.com Wed Mar 9 11:35:50 2016 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Wed, 9 Mar 2016 11:35:50 -0500 Subject: [vtkusers] Can't transform a vtkVolume In-Reply-To: References: Message-ID: If you are using 6.3 mostly likely you are using OpenGL1 backend. CHeck for VTK_RENDERING_BACKEND in CMakeCache.txt or in ccmake when you build VTK. Is there a possiblity for you to switch to OpenGL2 if not already? thanks, On Wed, Mar 9, 2016 at 11:31 AM, Lorenzo Valente wrote: > Hi Aashish, > > I'm using VTK 6.3 and OpenGL2 (i'm not 100% sure about OpenGL version... > how can I test it?) > > > > *L O R E N Z O V A L E N T E* > COMPUTER SCIENTIST > FRONT-END / BACK-END DEVELOPER > oneiros.valente at gmail.com > > > > > > > 2016-03-09 17:27 GMT+01:00 Aashish Chaudhary < > aashish.chaudhary at kitware.com>: > >> Hi Lorenzo, >> >> what backend you are using OpenGL1 or OPenGL2? Also what version of VTK >> it is? >> >> Thanks, >> >> >> On Wed, Mar 9, 2016 at 11:18 AM, Lorenzo >> wrote: >> > Hello everyone >> > >> > I'm having a strange problem related to VTK volume rendering: I can't >> apply >> > a simple transform (a translation) to volumes. I'm using the >> > "SetUserTransform()" function that vtkVolume inherit from vtkProp3D, a >> > method that works like a charm on vtkActors. I also tried >> "SetUserMatrix()" >> > and simple "SetPosition()" but nothing. >> > >> > Here's my code: http://pastebin.com/7MnTCHHN >> > And here's the output: http://i.imgur.com/feCyaIL.png >> > >> > As you can see, I generated two cube volumes (one red and one blue) and >> two >> > cone actors (one red and one blue). I then apply the same transform on >> both >> > blue props but only the cone actually translates (that's why you see a >> > purple volume, the two cubes are in the same position). >> > >> > How is this possible? >> > >> > _______________________________________________ >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> > >> > Please keep messages on-topic and check the VTK FAQ at: >> 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 >> >> >> >> -- >> | Aashish Chaudhary >> | Technical Leader >> | Kitware Inc. >> | http://www.kitware.com/company/team/chaudhary.html >> > > -- *| Aashish Chaudhary | Technical Leader | Kitware Inc. * *| http://www.kitware.com/company/team/chaudhary.html * -------------- next part -------------- An HTML attachment was scrubbed... URL: From munniz at yahoo.com Wed Mar 9 11:47:03 2016 From: munniz at yahoo.com (Wilmondes Manzi) Date: Wed, 9 Mar 2016 16:47:03 +0000 (UTC) Subject: [vtkusers] Problem with vtkLegendBoxActor ? In-Reply-To: <502341889.7349904.1453474667790.JavaMail.yahoo@mail.yahoo.com> References: <502341889.7349904.1453474667790.JavaMail.yahoo.ref@mail.yahoo.com> <502341889.7349904.1453474667790.JavaMail.yahoo@mail.yahoo.com> Message-ID: <1557479339.5248640.1457542023542.JavaMail.yahoo@mail.yahoo.com> I apologize for bringing this subject up again, but I've been struggling for a while (intermittently) to patch VTK sources by myself with no success. I have a home-made renderer that inherits from vtkWin32OpenGLRenderWindow and provides methods to draw and handle robotic elements and polygon meshes. Sometimes, such polygons are colored and the final user needs a legend in order to understand what's going on. The problem I have is that the legend does not show up. Even a copy-paste of your example does not work (as you can see in the file attached to the original message). After much debugging, I found out that the following line of vtkLegendBoxActor::RenderOpaqueGeometry returns [0,0] into tempi array. this->TextMapper[maxTextMapper]->GetSize(viewport,tempi);? // declaration: int tempi[2] Even if I simulate valid values in tempi, it does not work : the size of the legend box as well as the positions of the lines of text (variables posX and posY) seem correct but no text is drawn. So, I'm wondering if the problem can come from vtkActor2D when it renders its text at the very end of the same method : ??? for (i=0; iNumberOfEntries; i++) ????? {????? //... ????? renderedSomething += this->TextActor[i]->RenderOpaqueGeometry(viewport);? // <= this line ????? } ??? } Thank you. Le Vendredi 22 janvier 2016 15h57, Wilmondes Manzi a ?crit : Hello, I'm wondering if anyone has experienced any issues with vtkLegendBoxActor ? After upgrading from VTK 5.10 to 6.3 and from 32 to 64 bits (under Win7 SP1 and GCC), the legend does not show up anymore. To test it, I used a simple copy-paste of the following example : http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/Legend The result (the sphere is shown but the legend is empty) is attached to this message. Any clues ? Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjlp at netease.com Wed Mar 9 12:06:46 2016 From: tjlp at netease.com (Liu_tj) Date: Thu, 10 Mar 2016 01:06:46 +0800 (CST) Subject: [vtkusers] how to get the gray value of all the pixel for a DICOM image Message-ID: <5defcb55.2.1535c585580.Coremail.tjlp@netease.com> Hi, VTK expert guys, I want to make a statistic of gray value, so I need to get the gray value of all the pixels for a DICOM image. My code below can't get the gray value correctly. I use C# with Activiz. The scalar component should be 1 for the DICOM image. int[] dims = new int[3]; dims = m_imageViewer.GetInput().GetDimensions(); int numComponents = m_imageViewer.GetInput().GetNumberOfScalarComponents(); //The scalar component is 1. int numPoints = m_imageViewer.GetInput().GetNumberOfPoints(); string typestring = m_imageViewer.GetInput().GetScalarTypeAsString(); for (int z = 0; z < dims[2]; z++) { for (int y = 0; y < dims[1]; y++) { for (int x = 0; x < dims[0]; x++) { System.IntPtr pixel = (m_imageViewer.GetInput().GetScalarPointer(x, y, z)); int[] pixelvalue = new int[numComponents]; Marshal.Copy(pixel, pixelvalue, 0, numComponents ); ... } } } After Marshal.Copy(), the pixelvalue array store wrong value which is less greatly then the lower bound of GetScalarRange(). Any wrong code? Thanks Liu Peng -------------- next part -------------- An HTML attachment was scrubbed... URL: From Beck.Olson at ucsf.edu Wed Mar 9 13:59:51 2016 From: Beck.Olson at ucsf.edu (Beck Olson) Date: Wed, 9 Mar 2016 10:59:51 -0800 Subject: [vtkusers] vtk-6.3 with static tcl/tk wrapping leaves unresolved __imp__ symbols Message-ID: <56E072A7.70105@ucsf.edu> Greetings! I'm a long-time vtk user and am trying to build vtk 6.3 with static Tcl/Tk wrapping using Visual Studio 2010. In the past all that I have needed to do was set VTK_USE_TK, VTK_WRAP_TCL, and VTK_TCL_TK_STATIC as well as change the compiler flags from /MD to /MT. With vtk 6.3 this now produces a vtkCommonCoreTCL library that appears to have __imp__Tcl_... symbols and when trying to link an application with static TCL/TK libraries I am seeing unresolved symbol errors (see below). I?m using the same static TCL/TK libraries that work fine with vtk 5.6. Here's an example of the error: vtkCommonCoreTCL-6.3.lib(vtkDataArrayTcl.obj) : error LNK2001: unresolved external symbol __imp__Tcl_GetDouble Here is the command line compiling of the vtkCommonCoreTCL from visual studio: /I"C:/Users/bolson.CAMPUS/Libraries/VTK/VTK-6.3.0/ThirdParty/utf8/source" /I"C:/Users/bolson.CAMPUS/Libraries/VTK/VTK-6.3.0-build-release/Common/DataModel" /I"C:/Users/bolson.CAMPUS/Libraries/VTK/VTK-6.3.0-build-release/Utilities/KWSys" /I"C:/Users/bolson.CAMPUS/Libraries/VTK/VTK-6.3.0/Utilities/KWSys" /I"C:/Users/bolson.CAMPUS/Libraries/VTK/VTK-6.3.0-build-release/Common/Core" /I"C:/Users/bolson.CAMPUS/Libraries/VTK/VTK-6.3.0/Common/Core" /I"C:/Users/bolson.CAMPUS/Libraries/VTK/VTK-6.3.0/Wrapping/Tcl" /I"C:/Users/bolson.CAMPUS/Libraries/VTK/VTK-6.3.0-build-release/Wrapping/Tcl" /I"C:/Users/Public/Tcl/tcl8.5.12/Install/include" /W4 /WX- /O2 /Ob2 /Oy- /D "WIN32" /D "_WINDOWS" /D "NDEBUG" /D "_CRT_SECURE_NO_DEPRECATE" /D "_CRT_NONSTDC_NO_DEPRECATE" /D "_CRT_SECURE_NO_WARNINGS" /D "_SCL_SECURE_NO_DEPRECATE" /D "_SCL_SECURE_NO_WARNINGS" /D "VTK_IN_VTK" /D "CMAKE_INTDIR=\"Release\"" /D "_MBCS" /Gm- /EHsc /MT /GS /fp:precise /Zc:wchar_t /Zc:forScope /GR /Fp"vtkCommonCoreTCL.dir\Release\vtkCommonCoreTCL-6.3.pch" /Fa"Release" /Fo"vtkCommonCoreTCL.dir\Release\" /Fd"C:/Users/bolson.CAMPUS/Libraries/VTK/VTK-6.3.0-build-release/lib/Release/vtkCommonCoreTCL-6.3.pdb" /Gd /TP /analyze- /errorReport:queue Additional Options: /Zm1000 Any help would be greatly appreciated! --Beck From mvanmoer at illinois.edu Wed Mar 9 14:52:23 2016 From: mvanmoer at illinois.edu (Vanmoer, Mark W) Date: Wed, 9 Mar 2016 19:52:23 +0000 Subject: [vtkusers] symmetric adjacency matrices with vtkAdjacencyMatrixToEdgeTable Message-ID: <7F781841FF1E044388AFA42B70703A7ABFC4450A@CHIMBX6.ad.uillinois.edu> Hi VTK, I have a 100x100 symmetric adjacency matrix in a csv. I'm following along with the example at http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=Examples/Infovis/Python/adjacency_matrix_to_graph.py I'm getting twice the edges I want, though. Is there a way to tell VTK to ignore the lower triangle (and diagonal)? Or do I need to set the lower triangle to all zeros? Thanks, Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean at rogue-research.com Wed Mar 9 16:40:42 2016 From: sean at rogue-research.com (Sean McBride) Date: Wed, 9 Mar 2016 16:40:42 -0500 Subject: [vtkusers] Moving an actor, after about 1.5 hours. In-Reply-To: References: <65445CB4-B314-4465-B445-7C1F58B439DB@me.com> <82BD95A8-EA8A-4F73-A2F2-E08E74EB755B@me.com> <8BF034EC-7C7C-44A1-867C-22FB4382C0D8@me.com> Message-ID: <20160309214042.1660037271@mail.rogue-research.com> Not necessarily. vtkAtomicInt32 is signed, and signed overflow is undefined in C++. So once the ++ operator overflows GlobalTimeStamp, all bets are off. clang's UBSan could catch this at runtime: but I'm not sure if it works on Windows. Sean On Tue, 8 Mar 2016 06:47:16 -0700, David Gobbi said: >Since only the low 32 bits are kept (the high bits are simply discarded), >the wrap-around of the ModifiedTime is exactly the same as if a 32-bit >unsigned integer was being incremented. > > - David > >On Tue, Mar 8, 2016 at 6:27 AM, Richard Frank wrote: > >> Actually, it's a bit stranger than I thought. The global time stamp on >> Windows 64 bit is a 64 bit int cast to an >> Unsigned long, as size of void ptr is 8 >> void vtkTimeStamp::Modified() >> { >> #if VTK_SIZEOF_VOID_P == 8 >> static vtkAtomicInt64 GlobalTimeStamp(0); >> #else >> static vtkAtomicInt32 GlobalTimeStamp(0); >> #endif >> this->ModifiedTime = (unsigned long)++GlobalTimeStamp; >> } From david.gobbi at gmail.com Wed Mar 9 16:58:53 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 9 Mar 2016 14:58:53 -0700 Subject: [vtkusers] Moving an actor, after about 1.5 hours. In-Reply-To: <20160309214042.1660037271@mail.rogue-research.com> References: <65445CB4-B314-4465-B445-7C1F58B439DB@me.com> <82BD95A8-EA8A-4F73-A2F2-E08E74EB755B@me.com> <8BF034EC-7C7C-44A1-867C-22FB4382C0D8@me.com> <20160309214042.1660037271@mail.rogue-research.com> Message-ID: To say "all bets are off" is ludicrous. Compilers everywhere use two's complement arithmetic where there is no difference (at the bit level) between signed and unsigned addition. So it's a darn good bet, if you're trying to predict how the system is going to behave. On Wed, Mar 9, 2016 at 2:40 PM, Sean McBride wrote: > Not necessarily. vtkAtomicInt32 is signed, and signed overflow is > undefined in C++. So once the ++ operator overflows GlobalTimeStamp, all > bets are off. > > clang's UBSan could catch this at runtime: > > > > but I'm not sure if it works on Windows. > > Sean > > > > On Tue, 8 Mar 2016 06:47:16 -0700, David Gobbi said: > > >Since only the low 32 bits are kept (the high bits are simply discarded), > >the wrap-around of the ModifiedTime is exactly the same as if a 32-bit > >unsigned integer was being incremented. > > > > - David > > > >On Tue, Mar 8, 2016 at 6:27 AM, Richard Frank wrote: > > > >> Actually, it's a bit stranger than I thought. The global time stamp on > >> Windows 64 bit is a 64 bit int cast to an > >> Unsigned long, as size of void ptr is 8 > >> void vtkTimeStamp::Modified() > >> { > >> #if VTK_SIZEOF_VOID_P == 8 > >> static vtkAtomicInt64 GlobalTimeStamp(0); > >> #else > >> static vtkAtomicInt32 GlobalTimeStamp(0); > >> #endif > >> this->ModifiedTime = (unsigned long)++GlobalTimeStamp; > >> } > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean at rogue-research.com Wed Mar 9 17:16:02 2016 From: sean at rogue-research.com (Sean McBride) Date: Wed, 9 Mar 2016 17:16:02 -0500 Subject: [vtkusers] Moving an actor, after about 1.5 hours. In-Reply-To: References: <65445CB4-B314-4465-B445-7C1F58B439DB@me.com> <82BD95A8-EA8A-4F73-A2F2-E08E74EB755B@me.com> <8BF034EC-7C7C-44A1-867C-22FB4382C0D8@me.com> <20160309214042.1660037271@mail.rogue-research.com> Message-ID: <20160309221602.1650756971@mail.rogue-research.com> On Wed, 9 Mar 2016 14:58:53 -0700, David Gobbi said: >To say "all bets are off" is ludicrous. Alas, not really. >Compilers everywhere use two's >complement arithmetic where there is no difference (at the bit level) >between signed and unsigned addition. *CPUs* use 2's complement, true, but irrelevent. Compilers these days do evil/surprising optimizations, ex: But this is getting off-topic... VTK obviously needs to up that thing to 64 bit for all platforms. Cheers, -- ____________________________________________________________ Sean McBride, B. Eng sean at rogue-research.com Rogue Research www.rogue-research.com Mac Software Developer Montr?al, Qu?bec, Canada From tharun160190 at gmail.com Wed Mar 9 20:20:23 2016 From: tharun160190 at gmail.com (Tharun) Date: Wed, 9 Mar 2016 18:20:23 -0700 (MST) Subject: [vtkusers] Font size in vtkScalarBarActor In-Reply-To: References: <1398111905499-5726868.post@n5.nabble.com> <1457491547206-5737107.post@n5.nabble.com> Message-ID: <1457572823229-5737135.post@n5.nabble.com> Thank you Dave for the response. I can change the font size if I am using vtkScalarBarActor directly but I would like to change the default label font size independent of the scalar bar when I am using vtkScalarBarActor through vtkScalarBarWidget. The solution I am using now is below which changes the default size of widget which effects title, label and scalar bar. vtkScalarBarRepresentation->SetPosition(d1, d2); vtkScalarBarRepresentation->SetPosition2(d3, d4); -- View this message in context: http://vtk.1045678.n5.nabble.com/Font-size-in-vtkScalarBarActor-tp5726868p5737135.html Sent from the VTK - Users mailing list archive at Nabble.com. From tharun160190 at gmail.com Wed Mar 9 20:25:06 2016 From: tharun160190 at gmail.com (Tharun) Date: Wed, 9 Mar 2016 18:25:06 -0700 (MST) Subject: [vtkusers] Font size in vtkScalarBarActor In-Reply-To: <56DFECC6.4090006@dsl.pipex.com> References: <1398111905499-5726868.post@n5.nabble.com> <1457491547206-5737107.post@n5.nabble.com> <56DFECC6.4090006@dsl.pipex.com> Message-ID: <1457573106168-5737136.post@n5.nabble.com> Thank you John for the heads up. I also felt the same with vtkScalarBarActor. I do now want a ceiling to be set. I just want a specific value to be set as default. Thank you for vtkScalarBarActor2. -- View this message in context: http://vtk.1045678.n5.nabble.com/Font-size-in-vtkScalarBarActor-tp5726868p5737136.html Sent from the VTK - Users mailing list archive at Nabble.com. From yangmin_hust at 126.com Wed Mar 9 20:37:24 2016 From: yangmin_hust at 126.com (minyang) Date: Wed, 9 Mar 2016 18:37:24 -0700 (MST) Subject: [vtkusers] How to implement "over cut" display? In-Reply-To: <1457510620432-5737110.post@n5.nabble.com> References: <1457510620432-5737110.post@n5.nabble.com> Message-ID: <1457573844233-5737137.post@n5.nabble.com> Additional information, it similar to "shadow mapping". Any people have any ideal on implementing with vtk? Thanks in advance. Min -- View this message in context: http://vtk.1045678.n5.nabble.com/How-to-implement-over-cut-display-tp5737110p5737137.html Sent from the VTK - Users mailing list archive at Nabble.com. From jothybasu at gmail.com Thu Mar 10 00:44:28 2016 From: jothybasu at gmail.com (Jothybasu Selvaraj) Date: Thu, 10 Mar 2016 16:44:28 +1100 Subject: [vtkusers] vtkContourWidget output Message-ID: Dear All I want to make a filled contour from the output of vtkContourWidget. I am using vtkOrientedGlyphContourRepresentation in the contour widget. How can I access the data points on the drawn contour. Any hints? Thanks for your help! Jothy -------------- next part -------------- An HTML attachment was scrubbed... URL: From luukdegram at gmail.com Thu Mar 10 04:28:45 2016 From: luukdegram at gmail.com (Luuk de Gram) Date: Thu, 10 Mar 2016 10:28:45 +0100 Subject: [vtkusers] Building VTK 7.0 for Android (api 19) In-Reply-To: References: Message-ID: Wiping my build folder did the job, thank you! Regards, Luuk 2016-03-09 14:47 GMT+01:00 Ken Martin : > One idea, wipe your build directory and try again if you haven't already. > Make sure to set the API level early on. Cmake checks for some values when > it configures and changing API level does not cause cmake to recheck them. > So if it configured with a setting of 21 then from that point forward it > will have system introspection values for 21. Put another way, if you > change the API level you have to wipe your binary tree. > > That may not be the problem but it has bitten me before. You can also > look at > > https://open.cdash.org/viewNotes.php?buildid=4270266 > > which is the API 18 build script that I run to build and run that example > every night. It is based on VTK master but it may help. > > Thanks > Ken > > > > > On Wed, Mar 9, 2016 at 4:13 AM, Luuk de Gram wrote: > >> Dear VTK community, >> >> I've been trying to build VTK 7.0 for Android using api level 19. >> Although I did succeed in building it using api 21, I would prefer it to >> work with api 19. I could not find any information if 21 and higher is a >> requirement to building 7.0. >> >> Anyway whenever I run make, I get the following errors: >> >> /home/luuk/Documents/VTK/Utilities/KWSys/vtksys/SystemInformation.cxx: In >> member function 'vtksys::SystemInformation::LongLong >> vtksys::SystemInformationImplementation::GetProcMemoryAvailable(const >> char*, const char*)': >> /home/luuk/Documents/VTK/Utilities/KWSys/vtksys/SystemInformation.cxx:3523:21: >> error: aggregate 'ResourceLimitType rlim' has incomplete type and cannot be >> defined >> ResourceLimitType rlim; >> ^ >> /home/luuk/Documents/VTK/Utilities/KWSys/vtksys/SystemInformation.cxx:3524:42: >> error: 'getrlimit64' was not declared in this scope >> ierr=GetResourceLimit(RLIMIT_DATA,&rlim); >> ^ >> Utilities/KWSys/vtksys/CMakeFiles/vtksys.dir/build.make:353: recipe for >> target >> 'Utilities/KWSys/vtksys/CMakeFiles/vtksys.dir/SystemInformation.cxx.o' >> failed >> make[5]: *** >> [Utilities/KWSys/vtksys/CMakeFiles/vtksys.dir/SystemInformation.cxx.o] >> Error 1 >> CMakeFiles/Makefile2:171: recipe for target >> 'Utilities/KWSys/vtksys/CMakeFiles/vtksys.dir/all' failed >> make[4]: *** [Utilities/KWSys/vtksys/CMakeFiles/vtksys.dir/all] Error 2 >> Makefile:116: recipe for target 'all' failed >> make[3]: *** [all] Error 2 >> CMakeFiles/vtk-android.dir/build.make:109: recipe for target >> 'CMakeExternals/Prefix/vtk-android/src/vtk-android-stamp/vtk-android-build' >> failed >> make[2]: *** >> [CMakeExternals/Prefix/vtk-android/src/vtk-android-stamp/vtk-android-build] >> Error 2 >> CMakeFiles/Makefile2:60: recipe for target >> 'CMakeFiles/vtk-android.dir/all' failed >> make[1]: *** [CMakeFiles/vtk-android.dir/all] Error 2 >> Makefile:75: recipe for target 'all' failed >> make: *** [all] Error 2 >> >> Regards, >> Luuk >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> 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 oneiros.valente at gmail.com Thu Mar 10 06:01:57 2016 From: oneiros.valente at gmail.com (Lorenzo) Date: Thu, 10 Mar 2016 11:01:57 +0000 (UTC) Subject: [vtkusers] Can't transform a vtkVolume References: Message-ID: Aashish Chaudhary kitware.com> writes: Ok, so I upgraded to OpenGL2 (still VTK 6.3). I had to add: #include VTK_MODULE_INIT(vtkRenderingOpenGL2); VTK_MODULE_INIT(vtkRenderingContextOpenGL2); VTK_MODULE_INIT(vtkRenderingVolumeOpenGL2) VTK_MODULE_INIT(vtkRenderingFreeType); VTK_MODULE_INIT(vtkInteractionStyle); Before any other includes (the rest of the code is the same as before). Now my output is... this: http://i.imgur.com/ccGVjoM.png As you can see, the cube is not purple anymore, the blue cube is visible in the bottom left corner of it... even more weird. Do you have any explanation? From aashish.chaudhary at kitware.com Thu Mar 10 07:18:45 2016 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Thu, 10 Mar 2016 07:18:45 -0500 Subject: [vtkusers] Can't transform a vtkVolume In-Reply-To: References: Message-ID: It is weird, your code is useful. Let me know have a look at it. Thanks, On Thu, Mar 10, 2016 at 6:01 AM, Lorenzo wrote: > Aashish Chaudhary kitware.com> writes: > > Ok, so I upgraded to OpenGL2 (still VTK 6.3). I had to add: > > #include > VTK_MODULE_INIT(vtkRenderingOpenGL2); > VTK_MODULE_INIT(vtkRenderingContextOpenGL2); > VTK_MODULE_INIT(vtkRenderingVolumeOpenGL2) > VTK_MODULE_INIT(vtkRenderingFreeType); > VTK_MODULE_INIT(vtkInteractionStyle); > > Before any other includes (the rest of the code is the same as before). > > Now my output is... this: http://i.imgur.com/ccGVjoM.png > > As you can see, the cube is not purple anymore, the blue cube is visible in > the bottom left corner of it... even more weird. > Do you have any explanation? > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 > -- *| Aashish Chaudhary | Technical Leader | Kitware Inc. * *| http://www.kitware.com/company/team/chaudhary.html * -------------- next part -------------- An HTML attachment was scrubbed... URL: From rubengysemans at hotmail.com Thu Mar 10 09:03:42 2016 From: rubengysemans at hotmail.com (Xentro) Date: Thu, 10 Mar 2016 07:03:42 -0700 (MST) Subject: [vtkusers] Getting corresponding points from ICP Transform. Message-ID: <1457618622196-5737144.post@n5.nabble.com> Hey there, I need to fit two smaller datasets to a larger one by first using ICP to match them onto the larger data set and then use a least squares landmark transform to align them with the larger piece. Now for the landmark transform i need two datasets of corresponding points. ICP should calculate this for me but how do I get the data from the ICP transform to input into LandmarkTransform? I know I can get a celllocator from the ICP class but I have no idea what this locator contains or how to use it. Regards, Xentro -- View this message in context: http://vtk.1045678.n5.nabble.com/Getting-corresponding-points-from-ICP-Transform-tp5737144.html Sent from the VTK - Users mailing list archive at Nabble.com. From rickfrank at me.com Thu Mar 10 09:25:11 2016 From: rickfrank at me.com (Richard Frank) Date: Thu, 10 Mar 2016 09:25:11 -0500 Subject: [vtkusers] Moving an actor, after about 1.5 hours. In-Reply-To: References: <65445CB4-B314-4465-B445-7C1F58B439DB@me.com> <82BD95A8-EA8A-4F73-A2F2-E08E74EB755B@me.com> <8BF034EC-7C7C-44A1-867C-22FB4382C0D8@me.com> Message-ID: I was able to reproduce it ( fortunately we have a playback mechanism) and it seems to be reproducible on demand as the actors look to be in the same resting position each time. The MTime for the actor and its matrix were well below max int32. But we do notice the the screen " flashes " just as it happens. Not sure if it's the whole screen, as our Qt main window is maximized and it happens very fast, or just the render areas. Our actors are updated by our code ( not the MTime) somewhere greater than 83000 times at that point. I'm hoping to narrow down the time to be debuggable- let me know if anyone has any thought about the "flash". The flash happens on two different machines with 2 different Nvidia cards. Somewhere around 1-2 hours in ( but seems to be repeatable at exactly some time in that range, just hard to catch it without staring at a stop watch for an hour) Thanks Rick Sent from my iPadm > On Mar 8, 2016, at 8:47 AM, David Gobbi wrote: > > Hi Richard, > > Since only the low 32 bits are kept (the high bits are simply discarded), the wrap-around of the ModifiedTime is exactly the same as if a 32-bit unsigned integer was being incremented. > > - David > >> On Tue, Mar 8, 2016 at 6:27 AM, Richard Frank wrote: >> Actually, it's a bit stranger than I thought. The global time stamp on Windows 64 bit is a 64 bit int cast to an >> Unsigned long, as size of void ptr is 8 >> void vtkTimeStamp::Modified() >> { >> #if VTK_SIZEOF_VOID_P == 8 >> static vtkAtomicInt64 GlobalTimeStamp(0); >> #else >> static vtkAtomicInt32 GlobalTimeStamp(0); >> #endif >> this->ModifiedTime = (unsigned long)++GlobalTimeStamp; >> } >> >> I'm not certain off the top of my head what the wrap around pattern would be - probably 2 times around before wrapping to zero.... >> >> >> Sent from my iPad >> >>> On Mar 7, 2016, at 11:13 AM, David Cole wrote: >>> >> >>> This is a well known issue, reported here: >>> >>> http://www.vtk.org/Bug/view.php?id=14310 >>> >>> There are some patch files against older versions of VTK which are >>> attached to the bug. You could try a similar patch (although it's >>> quite a few lines to change) against whatever version of VTK you are >>> using. >>> >>> I would be VERY interested in seeing a modification to fix this >>> problem make its way into VTK master. >>> >>> >>> David C. >>> >>> >>>> On Mon, Mar 7, 2016 at 9:36 AM, Ken Martin wrote: >>>> Oops, yes, I meant runnable time not run time :-) >>>> >>>> >>>> >>>>> On Mon, Mar 7, 2016 at 9:25 AM, Richard Frank wrote: >>>>> >>>>> Oh never mind - increase the runnable time not run time :>} >>>>> >>>>> Sent from my iPad >>>>> >>>>> On Mar 7, 2016, at 9:07 AM, David Gobbi wrote: >>>>> >>>>> On Mon, Mar 7, 2016 at 6:43 AM, Richard Frank wrote: >>>>>> >>>>>> >>>>>> Not yet. That will be next step. Seems plausible since I can't find >>>>>> after quite a bit of testing any leaks, OpenGL errors reported, and testing >>>>>> on different systems with different Nvidia cards. etc, and tracing into VTK >>>>>> ( although trying to trace through all the calls to executive, algorithm, >>>>>> superclass, etc is quite cumbersome). Things just fail to move, silently. >>>>> >>>>> >>>>> As far as I'm aware, the only reason that VTK hasn't yet switched to a >>>>> 64-bit MTime everywhere is that there would be backwards compatibility >>>>> problems (GetMTime is a virtual method that is overridden in many >>>>> subclasses). >>>>> >>>>>> I found another post where someone had a slightly similar problem and >>>>>> said removing and re-adding actors fixed the problem, which we also seem to >>>>>> see..... >>>>> >>>>> >>>>> The VTK pipeline uses the difference between timestamps to as an indicator >>>>> for when to undertake certain actions. So it is likely that problems only >>>>> arise when this "difference" between two crucial timestamps exceeds the >>>>> 32-bit limit. That's why re-adding actors might fix the problem. >>>>> >>>>>> >>>>>> Also, why the runtime hit on a 64 bit build?. >>>>> >>>>> >>>>> What are you referring to? (I rarely use Windows, and when I do, I use >>>>> 32-bit builds). >>>>> >>>>> - David >>>>> >>>>> >>>>> _______________________________________________ >>>>> Powered by www.kitware.com >>>>> >>>>> Visit other Kitware open-source projects at >>>>> http://www.kitware.com/opensource/opensource.html >>>>> >>>>> Please keep messages on-topic and check the VTK FAQ at: >>>>> http://www.vtk.org/Wiki/VTK_FAQ >>>>> >>>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>>> >>>>> Follow this link to subscribe/unsubscribe: >>>>> 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. >>>> >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ at: >>>> 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 daviddoria at gmail.com Thu Mar 10 09:58:34 2016 From: daviddoria at gmail.com (David Doria) Date: Thu, 10 Mar 2016 08:58:34 -0600 Subject: [vtkusers] Getting corresponding points from ICP Transform. In-Reply-To: <1457618622196-5737144.post@n5.nabble.com> References: <1457618622196-5737144.post@n5.nabble.com> Message-ID: On Thu, Mar 10, 2016 at 8:03 AM, Xentro wrote: > Hey there, > > I need to fit two smaller datasets to a larger one by first using ICP to > match them onto the larger data set and then use a least squares landmark > transform to align them with the larger piece. Now for the landmark > transform i need two datasets of corresponding points. ICP should calculate > this for me but how do I get the data from the ICP transform to input into > LandmarkTransform? I know I can get a celllocator from the ICP class but I > have no idea what this locator contains or how to use it. > > Regards, Xentro > Are you just looking for the transform matrix that the ICP filter computes? If so: vtkSmartPointer transformMatrix = iterativeClosestPointTransform->GetMatrix(); See this example for how to then transform one of your point sets using vtkTransformPolyDataFilter: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Filters/IterativeClosestPointsTransform David -------------- next part -------------- An HTML attachment was scrubbed... URL: From rubengysemans at hotmail.com Thu Mar 10 10:05:38 2016 From: rubengysemans at hotmail.com (Xentro) Date: Thu, 10 Mar 2016 08:05:38 -0700 (MST) Subject: [vtkusers] Getting corresponding points from ICP Transform. In-Reply-To: References: <1457618622196-5737144.post@n5.nabble.com> Message-ID: <1457622338885-5737149.post@n5.nabble.com> This is what not I'm looking for, I'll try to be more specific. So ICP calculates the closest points for a given dataset on another dataset, right? It does this by matching points from one dataset onto points in the other one. So what I need as "output" for my ICP is basically two datasets with corresponding points that I can then use as target and source for a vtkLandmarkTransform. -- View this message in context: http://vtk.1045678.n5.nabble.com/Getting-corresponding-points-from-ICP-Transform-tp5737144p5737149.html Sent from the VTK - Users mailing list archive at Nabble.com. From tluisrs at gmail.com Thu Mar 10 11:41:05 2016 From: tluisrs at gmail.com (Thales Luis Rodrigues Sabino) Date: Thu, 10 Mar 2016 13:41:05 -0300 Subject: [vtkusers] The real difference between QVTKWidget and QVTKWidget2 Message-ID: I'm building an application that uses VTK for visualization. My initial intent was to process large volumes of data. My application is being built with Qt + VTK. When I started coding the visualization toolkit with VTK I found the *QVTKWidget*. So far so good, I found another one, called *QVTKWidget2*. In the *QVTKWidget2*.h header there is the following statement: *// .NAME QVTKWidget2 - Display a vtkRenderWindow in a Qt's QGLWidget.* *// .SECTION Description* *// QVTKWidget2 provides a way to display VTK data in a Qt OpenGL widget.* Well, since this class uses the *QGLWidget* (which BTW is now deprecated, replaced by *QOpenGLWidget*), I decided to use this one. I also based my decision in some discussion I read about *QVTKWidget2* being a future replacement for the *QVTKWidget* class. Everything was fine until I decided to run my application on MacOS and the QVTKWidget2 object was crashing in initialization. I then replaced my widget to one of *QVTKWidget* and everything is now working fine (at least in the initial tests). So, with this context, my question is, do I get any advantage by using *QVTKWidget2*? My first thought was *'yes'*, since the *QVTKWidget* is a subclass of *QWidget*. Hope someone could clarify this for me. -- Thales Luis Rodrigues Sabino PhD Student at PGMC-UFJF Lattes | LinkedIn | ResearchGate -------------- next part -------------- An HTML attachment was scrubbed... URL: From ich_daniel at habmalnefrage.de Thu Mar 10 11:46:26 2016 From: ich_daniel at habmalnefrage.de (-Daniel-) Date: Thu, 10 Mar 2016 09:46:26 -0700 (MST) Subject: [vtkusers] issue with surfaceFromUnorganizedPoints Message-ID: <1457628386559-5737155.post@n5.nabble.com> Hello community, look at my screenshots and you can see the issue. I import points from this example and I get the result in picture 1. When I use the example of SurfaceFromUnorganizedPoints then I get the result in picture 2. What's going wrong? Is missing information the problem, such as the normals or others? Is that even feasible with simple means? Can someone help me? I use vtk7.0 64bit with OpenGL2 backend. Thanks. -- View this message in context: http://vtk.1045678.n5.nabble.com/issue-with-surfaceFromUnorganizedPoints-tp5737155.html Sent from the VTK - Users mailing list archive at Nabble.com. From DLRdave at aol.com Thu Mar 10 12:06:51 2016 From: DLRdave at aol.com (David Cole) Date: Thu, 10 Mar 2016 12:06:51 -0500 Subject: [vtkusers] Moving an actor, after about 1.5 hours. In-Reply-To: References: <65445CB4-B314-4465-B445-7C1F58B439DB@me.com> <82BD95A8-EA8A-4F73-A2F2-E08E74EB755B@me.com> <8BF034EC-7C7C-44A1-867C-22FB4382C0D8@me.com> Message-ID: As noted in one of the comments I made in the bug I referenced earlier ( http://www.vtk.org/Bug/view.php?id=14310) ... you can force it to happen quickly if it is related to VTK MTime overflow with a modification like this to the VTK source code: //------------------------------------------------------------------------- #define CALLS_UNTIL_OVERFLOW 200 //------------------------------------------------------------------------- void vtkTimeStamp::Modified() { #if VTK_SIZEOF_VOID_P == 8 static vtkAtomicInt GlobalTimeStamp(0xffffffffffffffffULL - CALLS_UNTIL_OVERFLOW); #else static vtkAtomicInt GlobalTimeStamp(0xffffffff - CALLS_UNTIL_OVERFLOW); #endif Adjust CALLS_UNTIL_OVERFLOW to some smallish number that represents a few seconds or minutes of running your app, and then you should see the effects of overflow within seconds or minutes instead of waiting more than an hour. In our app, we've seen VTK MTimes go up by as much as 1.7 million per second in the Release build. (Which, in and of itself, is fairly impressive... ;-) HTH, David C. On Thu, Mar 10, 2016 at 9:25 AM, Richard Frank wrote: > I was able to reproduce it ( fortunately we have a playback mechanism) and > it seems to be reproducible on demand as the actors look to be in the same > resting position each time. > > The MTime for the actor and its matrix were well below max int32. > > But we do notice the the screen " flashes " just as it happens. Not sure > if it's the whole screen, as our Qt main window is maximized and it happens > very fast, or just the render areas. > > Our actors are updated by our code ( not the MTime) somewhere greater > than 83000 times at that point. I'm hoping to narrow down the time to be > debuggable- let me know if anyone has any thought about the "flash". The > flash happens on two different machines with 2 different Nvidia cards. > Somewhere around 1-2 hours in ( but seems to be repeatable at exactly some > time in that range, just hard to catch it without staring at a stop watch > for an hour) > > Thanks > > Rick > > Sent from my iPadm > > On Mar 8, 2016, at 8:47 AM, David Gobbi wrote: > > Hi Richard, > > Since only the low 32 bits are kept (the high bits are simply discarded), > the wrap-around of the ModifiedTime is exactly the same as if a 32-bit > unsigned integer was being incremented. > > - David > > On Tue, Mar 8, 2016 at 6:27 AM, Richard Frank wrote: > >> Actually, it's a bit stranger than I thought. The global time stamp on >> Windows 64 bit is a 64 bit int cast to an >> Unsigned long, as size of void ptr is 8 >> void vtkTimeStamp::Modified() >> { >> #if VTK_SIZEOF_VOID_P == 8 >> static vtkAtomicInt64 GlobalTimeStamp(0); >> #else >> static vtkAtomicInt32 GlobalTimeStamp(0); >> #endif >> this->ModifiedTime = (unsigned long)++GlobalTimeStamp; >> } >> >> I'm not certain off the top of my head what the wrap around pattern would >> be - probably 2 times around before wrapping to zero.... >> >> >> Sent from my iPad >> >> On Mar 7, 2016, at 11:13 AM, David Cole wrote: >> >> This is a well known issue, reported here: >> >> http://www.vtk.org/Bug/view.php?id=14310 >> >> There are some patch files against older versions of VTK which are >> attached to the bug. You could try a similar patch (although it's >> quite a few lines to change) against whatever version of VTK you are >> using. >> >> I would be VERY interested in seeing a modification to fix this >> problem make its way into VTK master. >> >> >> David C. >> >> >> On Mon, Mar 7, 2016 at 9:36 AM, Ken Martin >> wrote: >> >> Oops, yes, I meant runnable time not run time :-) >> >> >> >> >> On Mon, Mar 7, 2016 at 9:25 AM, Richard Frank wrote: >> >> >> Oh never mind - increase the runnable time not run time :>} >> >> >> Sent from my iPad >> >> >> On Mar 7, 2016, at 9:07 AM, David Gobbi wrote: >> >> >> On Mon, Mar 7, 2016 at 6:43 AM, Richard Frank wrote: >> >> >> >> Not yet. That will be next step. Seems plausible since I can't find >> >> after quite a bit of testing any leaks, OpenGL errors reported, and >> testing >> >> on different systems with different Nvidia cards. etc, and tracing into >> VTK >> >> ( although trying to trace through all the calls to executive, algorithm, >> >> superclass, etc is quite cumbersome). Things just fail to move, silently. >> >> >> >> As far as I'm aware, the only reason that VTK hasn't yet switched to a >> >> 64-bit MTime everywhere is that there would be backwards compatibility >> >> problems (GetMTime is a virtual method that is overridden in many >> >> subclasses). >> >> >> I found another post where someone had a slightly similar problem and >> >> said removing and re-adding actors fixed the problem, which we also seem >> to >> >> see..... >> >> >> >> The VTK pipeline uses the difference between timestamps to as an indicator >> >> for when to undertake certain actions. So it is likely that problems only >> >> arise when this "difference" between two crucial timestamps exceeds the >> >> 32-bit limit. That's why re-adding actors might fix the problem. >> >> >> >> Also, why the runtime hit on a 64 bit build?. >> >> >> >> What are you referring to? (I rarely use Windows, and when I do, I use >> >> 32-bit builds). >> >> >> - David >> >> >> >> _______________________________________________ >> >> Powered by www.kitware.com >> >> >> Visit other Kitware open-source projects at >> >> http://www.kitware.com/opensource/opensource.html >> >> >> Please keep messages on-topic and check the VTK FAQ at: >> >> http://www.vtk.org/Wiki/VTK_FAQ >> >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> >> Follow this link to subscribe/unsubscribe: >> >> 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. >> >> >> _______________________________________________ >> >> Powered by www.kitware.com >> >> >> Visit other Kitware open-source projects at >> >> http://www.kitware.com/opensource/opensource.html >> >> >> Please keep messages on-topic and check the VTK FAQ at: >> >> 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 mguttman at yahoo.com Thu Mar 10 13:17:25 2016 From: mguttman at yahoo.com (mguttman) Date: Thu, 10 Mar 2016 11:17:25 -0700 (MST) Subject: [vtkusers] translucent trouble with external OpenGL render window In-Reply-To: <46409682.5144464.1457517285488.JavaMail.yahoo@mail.yahoo.com> References: <46409682.5144464.1457517285488.JavaMail.yahoo@mail.yahoo.com> Message-ID: <1457633845888-5737157.post@n5.nabble.com> Hi,Just wanted to attach my nabble presence to this post, since it seemed anonymous on nabble and not visible on markmail.I really hope there is a migration path for me from 6.2/OpenGL1. A simple surface rendering of polygon data in an vtkExternalOpenGLRenderWindow became much worse going from 6.2/OpenGL1 to 6.3/OpenGL2 (see the two pictures).I've spent an embarrassing amount of time on this, when I should be writing, and I'm not sure what to try next.Many thanks in advance,Mikehttp://vtk.1045678.n5.nabble.com/attachment/5737114/1/vtk6.2-opengl1.jpghttp://vtk.1045678.n5.nabble.com/attachment/5737114/0/vtk6.3-opengl2-externwidget.jpg -- View this message in context: http://vtk.1045678.n5.nabble.com/translucent-trouble-with-external-OpenGL-render-window-tp5737114p5737157.html Sent from the VTK - Users mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.martin at kitware.com Thu Mar 10 13:31:22 2016 From: ken.martin at kitware.com (Ken Martin) Date: Thu, 10 Mar 2016 13:31:22 -0500 Subject: [vtkusers] translucent trouble with external OpenGL render window In-Reply-To: <1457633845888-5737157.post@n5.nabble.com> References: <46409682.5144464.1457517285488.JavaMail.yahoo@mail.yahoo.com> <1457633845888-5737157.post@n5.nabble.com> Message-ID: What does it look like in 7.0 when you set your opacity to 1.0 instead of 0.7? On Thu, Mar 10, 2016 at 1:17 PM, mguttman via vtkusers wrote: > Hi, Just wanted to attach my nabble presence to this post, since it seemed > anonymous on nabble and not visible on markmail. I really hope there is a > migration path for me from 6.2/OpenGL1. A simple surface rendering of > polygon data in an vtkExternalOpenGLRenderWindow became much worse going > from 6.2/OpenGL1 to 6.3/OpenGL2 (see the two pictures). I've spent an > embarrassing amount of time on this, when I should be writing, and I'm not > sure what to try next. Many thanks in advance, Mike > http://vtk.1045678.n5.nabble.com/attachment/5737114/1/vtk6.2-opengl1.jpg > http://vtk.1045678.n5.nabble.com/attachment/5737114/0/vtk6.3-opengl2-externwidget.jpg > ------------------------------ > View this message in context: Re: translucent trouble with external > OpenGL render window > > 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 > > -- 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 aashish.chaudhary at kitware.com Thu Mar 10 13:36:34 2016 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Thu, 10 Mar 2016 13:36:34 -0500 Subject: [vtkusers] translucent trouble with external OpenGL render window In-Reply-To: References: <46409682.5144464.1457517285488.JavaMail.yahoo@mail.yahoo.com> <1457633845888-5737157.post@n5.nabble.com> Message-ID: Hi Mike, One of the thing we do in external framework is get rid of default lights. So you would have to add lights to VTK yourself. Sankhesh might have more information on it (cc'd) - aashish On Thu, Mar 10, 2016 at 1:31 PM, Ken Martin wrote: > What does it look like in 7.0 when you set your opacity to 1.0 instead of > 0.7? > > On Thu, Mar 10, 2016 at 1:17 PM, mguttman via vtkusers > wrote: > >> Hi, Just wanted to attach my nabble presence to this post, since it >> seemed anonymous on nabble and not visible on markmail. I really hope there >> is a migration path for me from 6.2/OpenGL1. A simple surface rendering of >> polygon data in an vtkExternalOpenGLRenderWindow became much worse going >> from 6.2/OpenGL1 to 6.3/OpenGL2 (see the two pictures). I've spent an >> embarrassing amount of time on this, when I should be writing, and I'm not >> sure what to try next. Many thanks in advance, Mike >> http://vtk.1045678.n5.nabble.com/attachment/5737114/1/vtk6.2-opengl1.jpg >> http://vtk.1045678.n5.nabble.com/attachment/5737114/0/vtk6.3-opengl2-externwidget.jpg >> ------------------------------ >> View this message in context: Re: translucent trouble with external >> OpenGL render window >> >> 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 >> >> > > > -- > 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. > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 > > -- *| Aashish Chaudhary | Technical Leader | Kitware Inc. * *| http://www.kitware.com/company/team/chaudhary.html * -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Thu Mar 10 13:45:01 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 10 Mar 2016 11:45:01 -0700 Subject: [vtkusers] how to get the gray value of all the pixel for a DICOM image In-Reply-To: <5defcb55.2.1535c585580.Coremail.tjlp@netease.com> References: <5defcb55.2.1535c585580.Coremail.tjlp@netease.com> Message-ID: Hi Liu Peng, The best way (most efficient) is to get the pixels as a vtkDataArray: dataArray = image.GetPointData().GetScalars(); Then you can use the data array methods to get the values, e.g. dataArray.GetNumberOfComponents(); dataArray.GetNumberOfTuples(); dataArray.GetTuple(i); Or, if you know the data type, you can downcast the data array and get the data in its native type. - David On Wed, Mar 9, 2016 at 10:06 AM, Liu_tj wrote: > Hi, VTK expert guys, > > I want to make a statistic of gray value, so I need to get the gray value > of all the pixels for a DICOM image. My code below can't get the gray value > correctly. I use C# with Activiz. The scalar component should be 1 for the > DICOM image. > > int[] dims = new int[3]; > dims = m_imageViewer.GetInput().GetDimensions(); > int numComponents = > m_imageViewer.GetInput().GetNumberOfScalarComponents(); //The scalar > component is 1. > int numPoints = m_imageViewer.GetInput().GetNumberOfPoints(); > string typestring = m_imageViewer.GetInput().GetScalarTypeAsString(); > for (int z = 0; z < dims[2]; z++) > { > for (int y = 0; y < dims[1]; y++) > { > for (int x = 0; x < dims[0]; x++) > { > System.IntPtr pixel = (m_imageViewer.GetInput().GetScalarPointer(x, > y, z)); > int[] pixelvalue = new int[numComponents]; > Marshal.Copy(pixel, pixelvalue, 0, numComponents ); > ... > } > } > } > > After Marshal.Copy(), the pixelvalue array store wrong value which is less > greatly then the lower bound of GetScalarRange(). > > Any wrong code? > > Thanks > Liu Peng > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ich_daniel at habmalnefrage.de Thu Mar 10 13:59:56 2016 From: ich_daniel at habmalnefrage.de (-Daniel-) Date: Thu, 10 Mar 2016 11:59:56 -0700 (MST) Subject: [vtkusers] other parameters in vtkCellLocator.IntersectWithLine(..) by using Java Message-ID: <1457636396403-5737161.post@n5.nabble.com> Hello VTK-community, I use vtkCellLocator and found that the method "cellLocator.IntersectWithLine(..)" in Java has other different parameters than in C++. Java : cellLocator.IntersectWithLine (double [], double [], vtkPoints, vtkIdList) C++ : cellLocator.IntersectWithLine (double [3], double [3], double, double, double [3], double [3], int, vtkIdType, vtkGenericCell) How do I use this variant? Which parameters must be passed to the java function? Can anybody help me? Thanks! -- View this message in context: http://vtk.1045678.n5.nabble.com/other-parameters-in-vtkCellLocator-IntersectWithLine-by-using-Java-tp5737161.html Sent from the VTK - Users mailing list archive at Nabble.com. From mguttman at yahoo.com Thu Mar 10 18:15:13 2016 From: mguttman at yahoo.com (Mike Guttman) Date: Thu, 10 Mar 2016 23:15:13 +0000 (UTC) Subject: [vtkusers] translucent trouble with external OpenGL render window References: <2086561005.4230.1457651713025.JavaMail.yahoo.ref@mail.yahoo.com> Message-ID: <2086561005.4230.1457651713025.JavaMail.yahoo@mail.yahoo.com> BAM! ?That was it. I added a default vtkExternalLight and turned on lights in the GL world and it works fine now. Perhaps in 6.2 it created a default light. In initializeGL(), set up default light:? vtkNew light; ? renderer->AddExternalLight(light.GetPointer()); Then, to turn on the lighting:? glEnable(GL_LIGHTING); ? glEnable(GL_LIGHT0); And turn it off: ? glDisable(GL_LIGHTING); Thank you!! -Mike On Mar 10, 2016, at 1:36 PM, Aashish Chaudhary wrote: Hi Mike,? One of the thing we do in external framework is get rid of default lights. So you would have to add lights to VTK yourself. Sankhesh might have more information on it (cc'd) - aashish On Thu, Mar 10, 2016 at 1:31 PM, Ken Martin wrote: What does it look like in 7.0 when you set your opacity to 1.0 instead of 0.7? On Thu, Mar 10, 2016 at 1:17 PM, mguttman via vtkusers wrote: Hi,Just wanted to attach my nabble presence to this post, since it seemed anonymous on nabble and not visible on markmail.I really hope there is a migration path for me from 6.2/OpenGL1. A simple surface rendering of polygon data in an vtkExternalOpenGLRenderWindow became much worse going from 6.2/OpenGL1 to 6.3/OpenGL2 (see the two pictures).I've spent an embarrassing amount of time on this, when I should be writing, and I'm not sure what to try next.Many thanks in advance,Mikehttp://vtk.1045678.n5.nabble.com/attachment/5737114/1/vtk6.2-opengl1.jpghttp://vtk.1045678.n5.nabble.com/attachment/5737114/0/vtk6.3-opengl2-externwidget.jpg View this message in context: Re: translucent trouble with external OpenGL render window 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 -- Ken Martin PhDChairman & CFO Kitware Inc. 28 Corporate Drive Clifton Park NY 12065 518 371 3971 This communication,including all attachments, contains confidential and legally privilegedinformation, and it is intended only for the use of the addressee.? Access to this email by anyone else isunauthorized. If you are not the intended recipient, any disclosure, copying,distribution or any action taken in reliance on it is prohibited and may beunlawful. If you received this communication in error please notify usimmediately 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 -- | Aashish Chaudhary | Technical Leader ? ? ? ?? | Kitware Inc.? ? ? ? ? ? |?http://www.kitware.com/company/team/chaudhary.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.martin at kitware.com Thu Mar 10 19:10:16 2016 From: ken.martin at kitware.com (Ken Martin) Date: Thu, 10 Mar 2016 19:10:16 -0500 Subject: [vtkusers] translucent trouble with external OpenGL render window In-Reply-To: <2086561005.4230.1457651713025.JavaMail.yahoo@mail.yahoo.com> References: <2086561005.4230.1457651713025.JavaMail.yahoo.ref@mail.yahoo.com> <2086561005.4230.1457651713025.JavaMail.yahoo@mail.yahoo.com> Message-ID: In 6.2 VTK used old style fixed pipeline OpenGL where glEnable(GL_LIGHTING) did something. In the new backend those commands have no impact on the rendering (aside from the external light code that acts as a translator). A fair amount has changed so you may bump into other oddities. Also be aware if you are creating the opengl Context that the new backend really wants OpenGL 3.2 or later. On some systems you can get away with asking for an old generic context and it will give you something that supports OpenGL 3.2 (nvidia I suspect), on other platforms it will not (OSX I would bet). Thanks Ken On Thu, Mar 10, 2016 at 6:15 PM, Mike Guttman wrote: > BAM! That was it. > > I added a default vtkExternalLight and turned on lights in the GL world > and it works fine now. > > Perhaps in 6.2 it created a default light. > > In initializeGL(), set up default light: > vtkNew light; > renderer->AddExternalLight(light.GetPointer()); > > Then, to turn on the lighting: > glEnable(GL_LIGHTING); > glEnable(GL_LIGHT0); > > And turn it off: > glDisable(GL_LIGHTING); > > Thank you!! > > -Mike > > > > > On Mar 10, 2016, at 1:36 PM, Aashish Chaudhary < > aashish.chaudhary at kitware.com> wrote: > > Hi Mike, > > One of the thing we do in external framework is get rid of default lights. > So you would have to add lights to VTK yourself. Sankhesh might have more > information on it (cc'd) > > - aashish > > On Thu, Mar 10, 2016 at 1:31 PM, Ken Martin > wrote: > > What does it look like in 7.0 when you set your opacity to 1.0 instead of > 0.7? > > On Thu, Mar 10, 2016 at 1:17 PM, mguttman via vtkusers > wrote: > > Hi, Just wanted to attach my nabble presence to this post, since it seemed > anonymous on nabble and not visible on markmail. I really hope there is a > migration path for me from 6.2/OpenGL1. A simple surface rendering of > polygon data in an vtkExternalOpenGLRenderWindow became much worse going > from 6.2/OpenGL1 to 6.3/OpenGL2 (see the two pictures). I've spent an > embarrassing amount of time on this, when I should be writing, and I'm not > sure what to try next. Many thanks in advance, Mike > http://vtk.1045678.n5.nabble.com/attachment/5737114/1/vtk6.2-opengl1.jpg > http://vtk.1045678.n5.nabble.com/attachment/5737114/0/vtk6.3-opengl2-externwidget.jpg > ------------------------------ > View this message in context: Re: translucent trouble with external > OpenGL render window > > 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 > > > > > -- > 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. > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 > > > > > -- > > > > *| Aashish Chaudhary | Technical Leader | Kitware Inc. * > *| http://www.kitware.com/company/team/chaudhary.html > * > > > -- 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 aashish.chaudhary at kitware.com Thu Mar 10 21:54:57 2016 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Thu, 10 Mar 2016 21:54:57 -0500 Subject: [vtkusers] translucent trouble with external OpenGL render window In-Reply-To: <2086561005.4230.1457651713025.JavaMail.yahoo@mail.yahoo.com> References: <2086561005.4230.1457651713025.JavaMail.yahoo.ref@mail.yahoo.com> <2086561005.4230.1457651713025.JavaMail.yahoo@mail.yahoo.com> Message-ID: On Thu, Mar 10, 2016 at 6:15 PM, Mike Guttman wrote: > BAM! That was it. > > I added a default vtkExternalLight and turned on lights in the GL world > and it works fine now. > > Perhaps in 6.2 it created a default light. > > In initializeGL(), set up default light: > vtkNew light; > renderer->AddExternalLight(light.GetPointer()); > > Then, to turn on the lighting: > glEnable(GL_LIGHTING); > glEnable(GL_LIGHT0); > > And turn it off: > glDisable(GL_LIGHTING); > > Yup, you will need that since in the ExternalRender we do this: if (light) { if (!status) { // This is the case when we have a VTK light in the scene but no // external light corresponding to that index in the context. // In this case, we remove the VTK light as well. light->SwitchOff(); this->RemoveLight(light); // No need to go forward continue; } } Thanks, Aashish > Thank you!! > > -Mike > > > > > On Mar 10, 2016, at 1:36 PM, Aashish Chaudhary < > aashish.chaudhary at kitware.com> wrote: > > Hi Mike, > > One of the thing we do in external framework is get rid of default lights. > So you would have to add lights to VTK yourself. Sankhesh might have more > information on it (cc'd) > > - aashish > > On Thu, Mar 10, 2016 at 1:31 PM, Ken Martin > wrote: > > What does it look like in 7.0 when you set your opacity to 1.0 instead of > 0.7? > > On Thu, Mar 10, 2016 at 1:17 PM, mguttman via vtkusers > wrote: > > Hi, Just wanted to attach my nabble presence to this post, since it seemed > anonymous on nabble and not visible on markmail. I really hope there is a > migration path for me from 6.2/OpenGL1. A simple surface rendering of > polygon data in an vtkExternalOpenGLRenderWindow became much worse going > from 6.2/OpenGL1 to 6.3/OpenGL2 (see the two pictures). I've spent an > embarrassing amount of time on this, when I should be writing, and I'm not > sure what to try next. Many thanks in advance, Mike > http://vtk.1045678.n5.nabble.com/attachment/5737114/1/vtk6.2-opengl1.jpg > http://vtk.1045678.n5.nabble.com/attachment/5737114/0/vtk6.3-opengl2-externwidget.jpg > ------------------------------ > View this message in context: Re: translucent trouble with external > OpenGL render window > > 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 > > > > > -- > 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. > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 > > > > > -- > > > > *| Aashish Chaudhary | Technical Leader | Kitware Inc. * > *| http://www.kitware.com/company/team/chaudhary.html > * > > > -- *| Aashish Chaudhary | Technical Leader | Kitware Inc. * *| http://www.kitware.com/company/team/chaudhary.html * -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Thu Mar 10 22:27:46 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Thu, 10 Mar 2016 22:27:46 -0500 Subject: [vtkusers] vtkContourWidget output In-Reply-To: References: Message-ID: vtkContourWidget::GetContourRepresentation() returns a vtkContourRepresentation. vtkContourRepresentation::GetContourRepresentationAsPolyData() should get you the polyline that represents the contour, from which you can get the points. HTH, Cory On Thu, Mar 10, 2016 at 12:44 AM, Jothybasu Selvaraj wrote: > Dear All > > I want to make a filled contour from the output of vtkContourWidget. I am > using vtkOrientedGlyphContourRepresentation in the contour widget. How can I > access the data points on the drawn contour. > > Any hints? > > > Thanks for your help! > > Jothy > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 R&D Engineer Kitware, Inc. From aklos at outlook.de Fri Mar 11 05:53:33 2016 From: aklos at outlook.de (Andreas Klos) Date: Fri, 11 Mar 2016 11:53:33 +0100 Subject: [vtkusers] Extend Imagestack dynamically Message-ID: Dear great VTK-Comunity, I am actually trying to use vtkImageStack to create a imagestack of .png-Images. This seems to be very easy through VTK but it seem to be a bit harder when the Imagestack becomes extended dynamically. I'm working with Qt-plugin for visualstudio and VTK Version 7.0. When an Image is in the folder for visualisation purposes my Qt- GUI emits a Signal and transmit the full filename(path+filename) to a SLOT of my QVTK widget. If the SIGNAL is emitted the first time, my QVTK widget becomes created. The QVTK widget contains a Object of my visualisation pipeline and executes the visualisation pipeline through the call of the construtor. Till there, everything seems to work fine. The First Image is represented well. In Addition i should mention that the object of my visualisation pipeline has a method which should extend my imagestack. So if the SIGNAL is emitted again the SLOT of my QVTK widget should call this method. this is also well done. But it seems that the vtkStringArray of my visualisation pipline is not Extended with the new filename. so i can still just visualize the first Image. The Code of my visualisation Pipeline is shown below. It would be greatful if somebody can help me or give me a hint if i had coded something wrong or if there is a better Approach of how to extend the imagestack dynamically. HEADER.H-FILE: #ifndef VTKDATAPROVIDER_H #define VTKDATAPROVIDER_H #include "vtkStringArray.h" #include "vtkSmartPointer.h" #include "vtkPNGReader.h" #include "vtkImageSliceMapper.h" #include "vtkImageSlice.h" #include "vtkImageStack.h" #include "vtkRenderer.h" #include "vtkRenderWindow.h" #include "vtkRenderWindowInteractor.h" #include "vtkInteractorStyleImage.h" class VTKDataProvider { public: VTKDataProvider(std::string _firstFilename); vtkRenderWindow* getRenderWindow(){ return renderWindow; } void setDisplayedSliceNumber(int _sliceNumber); void extendImageStackWithFile(std::string _filename); private: vtkSmartPointer filenameArray; vtkSmartPointer pngReader; vtkSmartPointer sliceMapper; vtkSmartPointer imageSlice; vtkSmartPointer imageStack; vtkSmartPointer renderer; vtkSmartPointer renderWindow; vtkSmartPointer renderWindowInteractor; vtkSmartPointer interactorStyleImage; void readPNGFiles(); void provideImageStackWithData(); void addViewPorpToRenderer(); void prepareRenderWindow(); void startRender(); int counter = 0; }; SOURCEFILE.CPP-FILE #include "VTKDataProvider.h" VTKDataProvider::VTKDataProvider(std::string _firstFilename){ filenameArray = vtkSmartPointer::New(); filenameArray->SetNumberOfValues(1); filenameArray->InsertValue(counter, _firstFilename.c_str()); pngReader = vtkSmartPointer::New(); sliceMapper = vtkSmartPointer::New(); imageSlice = vtkSmartPointer::New(); imageStack = vtkSmartPointer::New(); renderer = vtkSmartPointer::New(); renderWindow = vtkSmartPointer::New(); renderWindowInteractor = vtkSmartPointer::New(); interactorStyleImage = vtkSmartPointer::New(); readPNGFiles(); } //the reading Operation is performed here void VTKDataProvider::readPNGFiles(){ pngReader->SetFileNames(filenameArray); pngReader->Update(); provideImageStackWithData(); } void VTKDataProvider::provideImageStackWithData(){ //sliceMapper->SetInputData(pngReader->GetOutput()); sliceMapper->SetInputConnection(pngReader->GetOutputPort()); imageSlice->SetMapper(sliceMapper); imageStack->AddImage(imageSlice); addViewPorpToRenderer(); } void VTKDataProvider::addViewPorpToRenderer(){ renderer->AddViewProp(imageStack); prepareRenderWindow(); } void VTKDataProvider::prepareRenderWindow(){ renderWindow->AddRenderer(renderer); renderWindow->SetInteractor(renderWindowInteractor); renderWindowInteractor->SetInteractorStyle(interactorStyleImage); renderWindowInteractor->Initialize(); } void VTKDataProvider::startRender(){ renderWindow->Render(); renderer->ResetCamera(); renderWindow->Render(); } //this method is needed to scroll through my QTGUI across the Images in the stack void VTKDataProvider::setDisplayedSliceNumber(int _sliceNumber){ sliceMapper->SetSliceNumber(_sliceNumber); renderWindow->Render(); } ? //This method is called from the SLOT of my QVTK widget and should extend my imagestack void VTKDataProvider::extendImageStackWithFile(std::string _filename){ filenameArray->InsertValue(counter, _filename.c_str()); pngReader->SetFileNames(filenameArray); pngReader->Update(); startRender(); } -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Fri Mar 11 09:15:17 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 11 Mar 2016 07:15:17 -0700 Subject: [vtkusers] Extend Imagestack dynamically In-Reply-To: References: Message-ID: Hi Andreas, You are correct that vtkStringArray is causing problems. Do not use InsertValue(). Use InsertNextValue() instead: filenameArray->InsertNextValue(_firstFilename.c_str()); Do not call filenameArray->SetNumberOfValues(1) in your constructor. And do not use a "counter" variable: if you want to know how many files are in the array, use filenameArray->GetNumberOfValues(); I do not think your program needs vtkImageStack. If you remove it from your program, and add vtkImageSlice directly to your renderer, you will probably get what you need. The following wiki page describes the purpose of vtkImageStack: http://www.vtk.org/Wiki/VTK/Image_Rendering_Classes - David On Fri, Mar 11, 2016 at 3:53 AM, Andreas Klos wrote: > Dear great VTK-Comunity, > I am actually trying to use vtkImageStack to create a imagestack of > .png-Images. This seems to be very easy through VTK but it seem to be a bit > harder when the Imagestack becomes extended dynamically. I'm working with > Qt-plugin for visualstudio and VTK Version 7.0. When an Image is in the > folder for visualisation purposes my Qt- GUI emits a Signal and transmit > the full filename(path+filename) to a SLOT of my QVTK widget. If the SIGNAL > is emitted the first time, my QVTK widget becomes created. The QVTK widget > contains a Object of my visualisation pipeline and executes the > visualisation pipeline through the call of the construtor. Till there, > everything seems to work fine. The First Image is represented well. In > Addition i should mention that the object of my visualisation pipeline has > a method which should extend my imagestack. So if the SIGNAL is emitted > again the SLOT of my QVTK widget should call this method. this is also well > done. But it seems that the vtkStringArray of my visualisation pipline is > not Extended with the new filename. so i can still just visualize the first > Image. The Code of my visualisation Pipeline is shown below. > > It would be greatful if somebody can help me or give me a hint if i had > coded something wrong or if there is a better Approach of how to extend the > imagestack dynamically. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bruno.manata.oliveira at gmail.com Fri Mar 11 09:27:56 2016 From: bruno.manata.oliveira at gmail.com (Bruno Oliveira) Date: Fri, 11 Mar 2016 14:27:56 +0000 Subject: [vtkusers] Ray tracing on global scene Message-ID: Hello, I have a complex scene (various actors/objects, from various sources and importers) and I want to perform ray tracing on the global scene, i.e. on the various objects simultaneously. Is this possible? How? -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Fri Mar 11 09:45:19 2016 From: dave.demarle at kitware.com (David E DeMarle) Date: Fri, 11 Mar 2016 09:45:19 -0500 Subject: [vtkusers] Ray tracing on global scene In-Reply-To: References: Message-ID: You can use one of the exporters to export the visible geometry into an input format for some other tool (like RIB exporter to RenderMan). You can use the VTK directory from ParaView's Manta or Ospray plugins to export directly to the SCI Instititues Manta or Intel's OSPRay interactive ray tracing engine. David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Fri, Mar 11, 2016 at 9:27 AM, Bruno Oliveira < bruno.manata.oliveira at gmail.com> wrote: > Hello, > > I have a complex scene (various actors/objects, from various sources and > importers) and I want to perform ray tracing on the global scene, i.e. on > the various objects simultaneously. > > Is this possible? How? > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 bruno.manata.oliveira at gmail.com Fri Mar 11 10:23:20 2016 From: bruno.manata.oliveira at gmail.com (Bruno Oliveira) Date: Fri, 11 Mar 2016 15:23:20 +0000 Subject: [vtkusers] Ray tracing on global scene In-Reply-To: References: Message-ID: Thank you for your answer. But do I really need to export to an external tool? Can't it be done internally with VTK (for the global scene)? 2016-03-11 14:45 GMT+00:00 David E DeMarle : > You can use one of the exporters to export the visible geometry into an > input format for some other tool (like RIB exporter to RenderMan). > > You can use the VTK directory from ParaView's Manta or Ospray plugins to > export directly to the SCI Instititues Manta or Intel's OSPRay interactive > ray tracing engine. > > > > David E DeMarle > Kitware, Inc. > R&D Engineer > 21 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-881-4909 > > On Fri, Mar 11, 2016 at 9:27 AM, Bruno Oliveira < > bruno.manata.oliveira at gmail.com> wrote: > >> Hello, >> >> I have a complex scene (various actors/objects, from various sources and >> importers) and I want to perform ray tracing on the global scene, i.e. on >> the various objects simultaneously. >> >> Is this possible? How? >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> 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 Fri Mar 11 11:04:39 2016 From: dave.demarle at kitware.com (David E DeMarle) Date: Fri, 11 Mar 2016 11:04:39 -0500 Subject: [vtkusers] Ray tracing on global scene In-Reply-To: References: Message-ID: Both exporters and pvmanta and pvospray work on the global scene (draw everything within a renderer). The manta and ospray options are just barely external. You compile them into VTK and then they take the geometry created by VTK and hand it over to the ray tracer before updating the renderwindow in the nearly the same way that we normally hand over the geometry to OpenGL for rasterization before updating the window. In a few days time I'll be merging the successor to those earlier works directly into VTK master. You can follow along until then here: https://gitlab.kitware.com/demarle/vtk/tree/ospray-rendering Besides those, you should also be aware of this paper ( https://blog.kitware.com/ray-casting-ray-tracing-with-vtk/) by Adamos Kyriakou which shows how you might go about writing a ray traced surface renderer starting from relevant parts of VTK. David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Fri, Mar 11, 2016 at 10:23 AM, Bruno Oliveira < bruno.manata.oliveira at gmail.com> wrote: > Thank you for your answer. But do I really need to export to an external > tool? Can't it be done internally with VTK (for the global scene)? > > 2016-03-11 14:45 GMT+00:00 David E DeMarle : > >> You can use one of the exporters to export the visible geometry into an >> input format for some other tool (like RIB exporter to RenderMan). >> >> You can use the VTK directory from ParaView's Manta or Ospray plugins to >> export directly to the SCI Instititues Manta or Intel's OSPRay interactive >> ray tracing engine. >> >> >> >> David E DeMarle >> Kitware, Inc. >> R&D Engineer >> 21 Corporate Drive >> Clifton Park, NY 12065-8662 >> Phone: 518-881-4909 >> >> On Fri, Mar 11, 2016 at 9:27 AM, Bruno Oliveira < >> bruno.manata.oliveira at gmail.com> wrote: >> >>> Hello, >>> >>> I have a complex scene (various actors/objects, from various sources and >>> importers) and I want to perform ray tracing on the global scene, i.e. on >>> the various objects simultaneously. >>> >>> Is this possible? How? >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> 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 bill.lorensen at gmail.com Fri Mar 11 13:26:27 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Fri, 11 Mar 2016 13:26:27 -0500 Subject: [vtkusers] Ubuntu Unity settings can affect saved screen shots Message-ID: Folks, I am running Ubuntu 14.04. I recently encountered some issues with saving VTK render window images using vtrkWindowToImageFilter. I was getting intermittent images that just contained an image of the desktop and not the VTK image I expected. It turns out I had "Window Animations" turned on. I set Unity Tweak Tool->General->Animations->Off, and my WindowToImageFilter screen shots are consistently as I expected. Bill -- Unpaid intern in BillsBasement at noware dot com From ken.martin at kitware.com Fri Mar 11 14:33:50 2016 From: ken.martin at kitware.com (Ken Martin) Date: Fri, 11 Mar 2016 14:33:50 -0500 Subject: [vtkusers] Need information about "Invalid pixel format, no opengl support" message. In-Reply-To: References: Message-ID: I believe you gave the specs for your desktop as opposed to the laptop. That message occurs on windows on the old OpenGL backend (and the OpenGL2 backend for VTK 6.3) It indicates that VTK tried to setup a device context for rendering but the device did not support opengl, either because VTK failed to find a suitable device or because on was provided to VTK that did not include opengl support. Thanks Ken On Wed, Mar 9, 2016 at 7:22 AM, Rakesh Patil wrote: > Hi VTK users, > > > I am facing a strange issue. I am using QVTKWidget in my application and > it works very well on my desktop computer. The same code when I try to > compile on my laptop it throws me this error message: > > > "Invalid pixel format, no opengl support" > > > I would like to know what are the scenarios in which VTK throws > this message. Whether there is any dependency on various versions of > Windows OS? I believe it should not be. Below is the system information > where I get this error: > > > OS Name: Microsoft Windows 8.1 Pro > Version: 6.3.9600 Build 9600 > OS Manufacturer: Microsoft Corporation > System Manufacturer: Dell Inc. > System Model: Precision T1700 > System Type: x64-based PC > Processor Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz, 3592 Mhz, 4 Core(s), 8 > Logical Processor(s) > Installed Physical Memory (RAM): 32.0 GB > Total Virtual Memory: 36.7 GB > Display adapter: NVIDIA Quadro K620 > > Note: I am not using QVTKWidget2. Kindly give some feedback as early as > possible. > > Thank You > > Warm Regards > > Rakesh Patil > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 tjlp at netease.com Sat Mar 12 05:20:22 2016 From: tjlp at netease.com (Liu_tj) Date: Sat, 12 Mar 2016 18:20:22 +0800 (CST) Subject: [vtkusers] vtkFileOutputWindow doesn't out the debug information to file Message-ID: <2398ea3e.a.1536a57574d.Coremail.tjlp@netease.com> Hi, VTK expert guys, I am using Activiz .NET. As I want to check some VTk debug information, I use the vtkFileOutputWindow as follow: vtkFileOutputWindow output = vtkFileOutputWindow.New(); output.SetFileName(@"C:\vtkoutput.txt"); vtkOutputWindow.SetInstance(output); Then I call renderWindow.DebugOn(), renderWindowInteractor.DebugOn(). But After I run the application, the file does not exist. Any problem in my code? BR, Liu Peng -------------- next part -------------- An HTML attachment was scrubbed... URL: From ultam93 at yahoo.com Sat Mar 12 07:02:37 2016 From: ultam93 at yahoo.com (Constantinescu Mihai) Date: Sat, 12 Mar 2016 12:02:37 +0000 (UTC) Subject: [vtkusers] Updating vtkPolyData from vtkActor - passing/saving existing data References: <1414087410.161196.1457784157266.JavaMail.yahoo.ref@mail.yahoo.com> Message-ID: <1414087410.161196.1457784157266.JavaMail.yahoo@mail.yahoo.com> ?I'm trying to use VTK in python to edit a `.stl` file using the `vtkBoxWidget`. I'm reading the `.stl` file, editing it with the `vtkBoxWidget` by using the mouse/drag in the window interactor and in the end I want to write the new data to a new `.stl` when hitting a certain key. Here's the code I've been working on: ? ? #!/usr/bin/env python? ??? ? import vtk? ? import sys? ? import os? ??? ? filename = "file.stl"? ? # render the data? ? reader = vtk.vtkSTLReader()? ? reader.SetFileName(filename)? ? ??? ? stlMapper = vtk.vtkPolyDataMapper()? ? stlMapper.SetInputConnection(reader.GetOutputPort())? ??? ? # create an actor for our scene? ? ? ? ? ? ? ? ? ??? ? stlActor = vtk.vtkActor()? ? stlActor.SetMapper(stlMapper)? ??? ??? ??? ? ren = vtk.vtkRenderer()? ? renWin = vtk.vtkRenderWindow()? ? renWin.AddRenderer(ren)? ? iren = vtk.vtkRenderWindowInteractor()? ? iren.SetRenderWindow(renWin)? ??? ? # The box widget observes the events invoked by the render window? ? # interactor. ?These events come from user interaction in the render? ? # window.? ? boxWidget = vtk.vtkBoxWidget()? ? boxWidget.SetInteractor(iren)? ? boxWidget.SetPlaceFactor(1.25)? ??? ? # Add the actors to the renderer, set the background and window size.? ? ren.AddActor(stlActor)? ? ren.SetBackground(0.1, 0.2, 0.4)? ? renWin.SetSize(300, 300)? ??? ? # As the box widget is interacted with, it produces a transformation? ? # matrix that is set on the actor.? ? t = vtk.vtkTransform()? ? def TransformActor(obj, event):? ? ? ? global t, stlActor? ? ? ? obj.GetTransform(t)? ? ? ? stlActor.SetUserTransform(t)? ??? ? def onKeyPressEvent(self, renderer):? ? ? ? key = self.GetKeyCode()? ? ? ? if(key=='l'):? ? ? ? ? ? print stlActor.GetBounds()? ? ? ? ? ? if(os.path.isfile("done.stl")==1):? ? ? ? ? ? ? ? ? ? ? ? os.remove("done.stl")? ? ? ? ? ? print stlActor.GetMapper().GetInput().GetBounds()? ? ? ? ? ? stlPolyData = stlActor.GetMapper().GetInput()? ? ? ? ? ? writer = vtk.vtkSTLWriter()? ? ? ? ? ? writer.SetFileName("done.stl")? ? ? ? ? ? writer.AddInputDataObject(stlPolyData)? ? ? ? ? ? writer.Write()? ? # Place the interactor initially. The actor is used to place and scale? ? # the interactor. An observer is added to the box widget to watch for? ? # interaction events. This event is captured and used to set the? ? # transformation matrix of the actor.? ? boxWidget.SetProp3D(stlActor)? ? boxWidget.PlaceWidget()? ? boxWidget.AddObserver("InteractionEvent", TransformActor)? ? iren.AddObserver('KeyPressEvent', onKeyPressEvent)? ??? ? iren.Initialize()? ? renWin.Render()? ? iren.Start() The problem is that I have no idea how to update the `vtkPolyData` or pass the transformations I applied to `vtkActor` to the `vtkPolyData`. In the code above, I tested this with the .GetBounds() in the two print functions. Originally the object had Bounds: ? ? (-2.0, 2.0, 0.0, 1.625, -1.5, 1.8125) After updating, the actor Bounds changed, but I can't pass all those properties to the vtkPolyData. ? ? (-2.1331110248939638, 2.246371570191821, -1.5743578447908013, 2.5817210301577385, -2.1311284932847796, 2.0695034726591715)? ? (-2.0, 2.0, 0.0, 1.625, -1.5, 1.8125) Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From aashish.chaudhary at kitware.com Sat Mar 12 09:13:14 2016 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Sat, 12 Mar 2016 09:13:14 -0500 Subject: [vtkusers] Can't transform a vtkVolume In-Reply-To: References: Message-ID: Lorenzo, I am able to reproduce the bug and looking into fixing it. Thanks, On Thu, Mar 10, 2016 at 7:18 AM, Aashish Chaudhary < aashish.chaudhary at kitware.com> wrote: > It is weird, your code is useful. Let me know have a look at it. > > Thanks, > > > On Thu, Mar 10, 2016 at 6:01 AM, Lorenzo > wrote: > >> Aashish Chaudhary kitware.com> writes: >> >> Ok, so I upgraded to OpenGL2 (still VTK 6.3). I had to add: >> >> #include >> VTK_MODULE_INIT(vtkRenderingOpenGL2); >> VTK_MODULE_INIT(vtkRenderingContextOpenGL2); >> VTK_MODULE_INIT(vtkRenderingVolumeOpenGL2) >> VTK_MODULE_INIT(vtkRenderingFreeType); >> VTK_MODULE_INIT(vtkInteractionStyle); >> >> Before any other includes (the rest of the code is the same as before). >> >> Now my output is... this: http://i.imgur.com/ccGVjoM.png >> >> As you can see, the cube is not purple anymore, the blue cube is visible >> in >> the bottom left corner of it... even more weird. >> Do you have any explanation? >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> 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 >> > > > > -- > > > > *| Aashish Chaudhary | Technical Leader | Kitware Inc. * > *| http://www.kitware.com/company/team/chaudhary.html > * > -- *| Aashish Chaudhary | Technical Leader | Kitware Inc. * *| http://www.kitware.com/company/team/chaudhary.html * -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjlp at netease.com Sat Mar 12 12:17:50 2016 From: tjlp at netease.com (Liu_tj) Date: Sun, 13 Mar 2016 01:17:50 +0800 (CST) Subject: [vtkusers] System throw exceptions while interactoring window with mouse by vtkInteractorStyleImage using ActiViz.NET In-Reply-To: <1BA4F4AB-9561-4638-AA18-206DB4D99785@aol.com> References: <16a0b896.2b.15326f46a1d.Coremail.tjlp@netease.com> <1BA4F4AB-9561-4638-AA18-206DB4D99785@aol.com> Message-ID: <29412a97.2.1536bd58a97.Coremail.tjlp@netease.com> Hi, David, Continue this thread. Now I upgrade from Activiz for VTK 5.8 to 7.0. And I define the vtkInteractorStyleImage::MouseWheelForwardEvt and MouseWheelBackwardEvt for slice switch. With VTK 5.8, it works but now it doesn't work for 7.0. With VTK 7.0, these 2 event handlers keep the old behavior which zooms in or out. It does not call the function I define to switch the slice number. My code is as follow: private void Display(vtkRenderWindow aRenderWindow, vtkAlgorithmOutput aData) { if (aData == null) return; m_imageViewer = vtkImageViewer2.New(); m_imageViewer.SetInputConnection(aData); switch (m_sliceDirection) { case Direction.AXIAL: m_imageViewer.SetSliceOrientationToXY(); break; case Direction.CORONAL: m_imageViewer.SetSliceOrientationToYZ(); break; case Direction.SAGITTAL: m_imageViewer.SetSliceOrientationToXZ(); break; default: break; } m_imageViewer.GetSliceRange(ref m_minSliceNumber, ref m_maxSliceNumber); m_interactorStyle = vtkInteractorStyleImage.New(); m_moveforward = new vtkObject.vtkObjectEventHandler(interactor_MouseWheelForwardEvt); m_movebackward = new vtkObject.vtkObjectEventHandler(interactor_MouseWheelBackwardEvt); m_interactorStyle.MouseWheelForwardEvt += m_moveforward; m_interactorStyle.MouseWheelBackwardEvt += m_movebackward; vtkObject.vtkObjectEventHandler(interactor_MouseWheelBackwardEvt); aRenderWindow.GetRenderers().InitTraversal(); m_renderer = aRenderWindow.GetRenderers().GetFirstRenderer(); m_renderer.SetBackground(0.0, 0.0, 0.0); m_imageViewer.SetRenderWindow(aRenderWindow); vtkRenderWindowInteractor interactor = aRenderWindow.GetInteractor(); interactor.SetInteractorStyle(m_interactorStyle); m_imageViewer.SetupInteractor(interactor); m_currentSlice = m_minSliceNumber + (m_maxSliceNumber - m_minSliceNumber) / 2; m_imageViewer.SetSlice(m_currentSlice); m_imageViewer.Render(); } Thanks Liu Peng ?2016-02-28?"David Cole" ??? -----????----- ???:"David Cole" ????:2016?02?28? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: [vtkusers] System throw exceptions while interactoring window with mouse by vtkInteractorStyleImage using ActiViz.NET Rather than doing += new and directly adding an event handler, save a pointer to the return value of new in each case as a C# member variable (which has scope at least as long as you want to be receiving the events...), and then do += with that variable. That will keep a C# reference to it so it won't be garbage collected. That will help, although I didn't analyze your whole code snippet thoroughly, so there may be more to do after that. But that should be your first step. HTH, David C. > On Feb 28, 2016, at 3:17 AM, Liu_tj wrote: > > Hi, VTK guys, > > At present I am ActiViz.NET 5.8.0 OpenSource Edition (x86) and Visual Studio 2015 C# to define a WPF user control for display DICOM series. I created event handlers for vtkInteractorStyleImage to handle mouse wheel forwared and mouse backward to switch the DICOM image. The application can display the image, when I forward or backward the mouse wheel, I get the system exception: > > Unhandled Exception: System.Exception: error: could not get registered type - mteIndex='4294967295' classNameKey='' > > I read the thread http://vtk.1045678.n5.nabble.com/ActiViz-NET-reports-unhandled-Exception-while-interacting-window-with-Mouse-td5720046.html, but I have no idea how to fix it. > > Any glue for this issue? > > Below is my user control class: > > public partial class Dicom2DViewer : UserControl > { > public Dicom2DViewer() > { > InitializeComponent(); > m_renderwinctrl = this.FindName("renderCtrl") as RenderWindowControl; > if (m_renderwinctrl != null) > m_renderWindow = m_renderwinctrl.RenderWindow; > > //m_imagePlaneWidget = vtkImagePlaneWidget.New(); > //m_imagePlaneWidgetFor3D = vtkImagePlaneWidget.New(); > } > > public static readonly DependencyProperty DICOMDataProperty = > DependencyProperty.Register("DICOMData", typeof(vtkAlgorithmOutput), > typeof(Dicom2DViewer), new FrameworkPropertyMetadata(null, OnDICOMDataPropertyChanged)); > > public vtkAlgorithmOutput DICOMData > { > get { return (vtkAlgorithmOutput)GetValue(DICOMDataProperty); } > set { SetValue(DICOMDataProperty, value); } > } > > private static void OnDICOMDataPropertyChanged(DependencyObject source, DependencyPropertyChangedEventArgs e) > { > Dicom2DViewer dicomViewer = source as Dicom2DViewer; > RenderWindowControl renderWindowCtrl = dicomViewer.renderCtrl; > vtkAlgorithmOutput vtkDICOMOutput = (vtkAlgorithmOutput)e.NewValue; > > dicomViewer.Display(renderWindowCtrl.RenderWindow, vtkDICOMOutput); > } > > private void Display(vtkRenderWindow aRenderWindow, vtkAlgorithmOutput aData) > { > if (aData == null) > return; > > m_imageViewer = vtkImageViewer2.New(); > m_imageViewer.SetInputConnection(aData); > m_imageViewer.GetSliceRange(ref m_minSliceNumber, ref m_maxSliceNumber); > > //vtkInteractorStyleImage interactorStyle = vtkInteractorStyleImage.New(); > //interactorStyle.MouseWheelForwardEvt += new vtkObject.vtkObjectEventHandler(interactor_MouseWheelForwardEvt); > //interactorStyle.MouseWheelBackwardEvt += new vtkObject.vtkObjectEventHandler(interactor_MouseWheelBackwardEvt); > > //aRenderWindow.GetInteractor().SetInteractorStyle(interactorStyle); > vtkInteractorStyleImage m_interactorStyle = vtkInteractorStyleImage.New(); > m_interactorStyle.MouseWheelForwardEvt += new vtkObject.vtkObjectEventHandler(interactor_MouseWheelForwardEvt); > m_interactorStyle.MouseWheelBackwardEvt += new vtkObject.vtkObjectEventHandler(interactor_MouseWheelBackwardEvt); > > aRenderWindow.GetInteractor().SetInteractorStyle(m_interactorStyle); > aRenderWindow.GetRenderers().InitTraversal(); > > vtkRenderer ren; > while ((ren = aRenderWindow.GetRenderers().GetNextItem()) != null) > ren.SetBackground(0.0, 0.0, 0.0); > > m_imageViewer.SetRenderWindow(aRenderWindow); > m_imageViewer.SetSlice(m_minSliceNumber); > > switch (m_sliceDirection) > { > case Direction.AXIAL: > m_imageViewer.SetSliceOrientationToXY(); > break; > case Direction.CORONAL: > m_imageViewer.SetSliceOrientationToYZ(); > break; > case Direction.SAGITTAL: > m_imageViewer.SetSliceOrientationToXZ(); > break; > default: > break; > } > > m_imageViewer.Render(); > } > > private void interactor_MouseWheelForwardEvt(vtkObject sender, vtkObjectEventArgs e) > { > MoveSlice(1); > } > > void interactor_MouseWheelBackwardEvt(vtkObject sender, vtkObjectEventArgs e) > { > MoveSlice(0); > } > > private void MoveSlice(int direction) //0: move backward; 1: move forward > { > if (direction == 0) > { > if (m_currentSlice > m_minSliceNumber) > { > m_currentSlice -= 1; > m_imageViewer.SetSlice(m_currentSlice); > m_imageViewer.Render(); > } > } > else > { > if (m_currentSlice < m_maxSliceNumber) > { > m_currentSlice += 1; > m_imageViewer.SetSlice(m_currentSlice); > m_imageViewer.Render(); > } > } > } > > public vtkRenderWindow GetRenderWindow() > { > return m_renderWindow; > } > > public void AddRenderer(vtkRenderer renderer) > { > m_renderWindow.AddRenderer(renderer); > } > > public void SetViewDirection(Direction direction) > { > m_sliceDirection = direction; > } > > private RenderWindowControl m_renderwinctrl = null; > private vtkRenderWindow m_renderWindow = null; > private vtkImageViewer2 m_imageViewer = null; > vtkInteractorStyleImage m_interactorStyle = null; > private Direction m_sliceDirection; > > int m_currentSlice = 0; > int m_minSliceNumber = 0; > int m_maxSliceNumber = 0; > } > > Thanks > Liu Peng > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: 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 aklos at outlook.de Mon Mar 14 03:58:23 2016 From: aklos at outlook.de (Andreas Klos) Date: Mon, 14 Mar 2016 08:58:23 +0100 Subject: [vtkusers] Extend Imagestack dynamically In-Reply-To: References: Message-ID: Hello David, Thank you for your fast reply. I have tried your recommendations. You were right, i do not need vtkImageStack for my purposes and the hint with InsertNextValue() was also really helpful. But this recommended changes of my code does not solve my problem. I think the issue lies in the combined usage of Qt and VTK. Because i try to extend my ?imagestack? out of a SLOT. Could that cause my issue? Or is there something else which i am doing wrong? Nonetheless i solved the problem through the usage of ITK. At the moment i am loading my imagestack through itk::ImageSeriesReader and export my imagedata to VTK. Best regards, Andreas Von: David Gobbi [mailto:david.gobbi at gmail.com] Gesendet: Freitag, 11. M?rz 2016 15:15 An: Andreas Klos Cc: vtkusers at vtk.org Betreff: Re: [vtkusers] Extend Imagestack dynamically Hi Andreas, You are correct that vtkStringArray is causing problems. Do not use InsertValue(). Use InsertNextValue() instead: filenameArray->InsertNextValue(_firstFilename.c_str()); Do not call filenameArray->SetNumberOfValues(1) in your constructor. And do not use a "counter" variable: if you want to know how many files are in the array, use filenameArray->GetNumberOfValues(); I do not think your program needs vtkImageStack. If you remove it from your program, and add vtkImageSlice directly to your renderer, you will probably get what you need. The following wiki page describes the purpose of vtkImageStack: http://www.vtk.org/Wiki/VTK/Image_Rendering_Classes - David On Fri, Mar 11, 2016 at 3:53 AM, Andreas Klos > wrote: Dear great VTK-Comunity, I am actually trying to use vtkImageStack to create a imagestack of .png-Images. This seems to be very easy through VTK but it seem to be a bit harder when the Imagestack becomes extended dynamically. I'm working with Qt-plugin for visualstudio and VTK Version 7.0. When an Image is in the folder for visualisation purposes my Qt- GUI emits a Signal and transmit the full filename(path+filename) to a SLOT of my QVTK widget. If the SIGNAL is emitted the first time, my QVTK widget becomes created. The QVTK widget contains a Object of my visualisation pipeline and executes the visualisation pipeline through the call of the construtor. Till there, everything seems to work fine. The First Image is represented well. In Addition i should mention that the object of my visualisation pipeline has a method which should extend my imagestack. So if the SIGNAL is emitted again the SLOT of my QVTK widget should call this method. this is also well done. But it seems that the vtkStringArray of my visualisation pipline is not Extended with the new filename. so i can still just visualize the first Image. The Code of my visualisation Pipeline is shown below. It would be greatful if somebody can help me or give me a hint if i had coded something wrong or if there is a better Approach of how to extend the imagestack dynamically. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rakesh.p at tataelxsi.co.in Mon Mar 14 04:16:44 2016 From: rakesh.p at tataelxsi.co.in (Rakesh Patil) Date: Mon, 14 Mar 2016 08:16:44 +0000 Subject: [vtkusers] Need information about "Invalid pixel format, no opengl support" message. In-Reply-To: References: , Message-ID: Hi Ken Martin, I believe I understood the core reason as why this message is displayed. I need some more details. 1) In what way OpenGL backend is different from the OpenGL2 backend for VTK 6.3. Knowing that QVTKWidget will be deprecated, what pre-requisite conditions needs to be considered to stick myself working with QVTKWidget on various system? 2) What exactly do you mean, when you say "one was provided to VTK that did not include opengl support". I guess all the latest Windows OS do come with OpenGL version greater than 1.1. So I think all the drivers must have OpenGL support right? Correct me if I am wrong. 3) Does this functionality really vary from one graphics card to another? I mean does it depend on the graphics card also? If so, how will I know whether my graphics card supports OpenGL backend or OpenGL2 backend? Thank You Warm Regards Rakesh Patil ________________________________ From: Ken Martin Sent: Saturday, March 12, 2016 1:03 AM To: Rakesh Patil Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Need information about "Invalid pixel format, no opengl support" message. I believe you gave the specs for your desktop as opposed to the laptop. That message occurs on windows on the old OpenGL backend (and the OpenGL2 backend for VTK 6.3) It indicates that VTK tried to setup a device context for rendering but the device did not support opengl, either because VTK failed to find a suitable device or because on was provided to VTK that did not include opengl support. Thanks Ken On Wed, Mar 9, 2016 at 7:22 AM, Rakesh Patil > wrote: Hi VTK users, I am facing a strange issue. I am using QVTKWidget in my application and it works very well on my desktop computer. The same code when I try to compile on my laptop it throws me this error message: "Invalid pixel format, no opengl support" I would like to know what are the scenarios in which VTK throws this message. Whether there is any dependency on various versions of Windows OS? I believe it should not be. Below is the system information where I get this error: OS Name: Microsoft Windows 8.1 Pro Version: 6.3.9600 Build 9600 OS Manufacturer: Microsoft Corporation System Manufacturer: Dell Inc. System Model: Precision T1700 System Type: x64-based PC Processor Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz, 3592 Mhz, 4 Core(s), 8 Logical Processor(s) Installed Physical Memory (RAM): 32.0 GB Total Virtual Memory: 36.7 GB Display adapter: NVIDIA Quadro K620 Note: I am not using QVTKWidget2. Kindly give some feedback as early as possible. Thank You Warm Regards Rakesh Patil _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: 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 richard.j.brown at live.co.uk Mon Mar 14 06:26:17 2016 From: richard.j.brown at live.co.uk (Richard Brown) Date: Mon, 14 Mar 2016 11:26:17 +0100 Subject: [vtkusers] Get IDs within vtkImageStencilData In-Reply-To: References: <1453240740090-5736032.post@n5.nabble.com> Message-ID: David, Sorry for the belated reply; it took me a while to get round to testing the new classes. I can confirm that they respond perfectly to my needs, thanks a million! Regards, Richard > On 25 Jan 2016, at 14:40, David Gobbi wrote: > > Hi Richard, > > I've put my code up on gitlab, three classes in total: > https://gitlab.kitware.com/vtk/vtk/merge_requests/1118 > > Two of these classes are iterators, meaning that they allow you to > write your own loop. The third class is a filter that extracts all of > the point data that lies within the stencil. Here are some examples > (the examples are python, C++ code would be similar): > > # Example for iterating over all point Ids in an image > iter = vtkImagePointDataIterator(image, image.GetExtent(), stencil) > scalars = image.GetPointData().GetScalars() > while (not iter.IsAtEnd()): > # loop over a contiguous span of Ids > for i in range(iter.GetId(), iter.GetId() + iter.GetSpanSize()): > value = scalars.GetTuple(i) > # advance to the next span > iter.NextSpan() > > # Example for iterating over all points in an image > iter = vtkImagePointIterator(image, image.GetExtent(), stencil) > scalars = image.GetPointData().GetScalars() > while (not iter.IsAtEnd()): > point = iter.GetPosition() > idx = iter.GetIndex() > value = scalars.GetTuple(iter.GetId()) > iter.Next() > > # Example for using the vtkImageToPoints filter > filter = vtkImageToPoints() > filter.SetInputConnection(reader.GetOutputPort()) > filter.SetStencilConnection(polyToStencil.GetOutputPort()) > filter.Update() > # Get a polydata object with points and attributes > polyData = filter.GetOutput() > points = polyData.GetPoints() > scalars = polyData.GetPointData().GetScalars() > > I'm not sure if these were quite what you were looking for, I was > aiming to create general-purpose classes. > > Cheers, > - David > > > > > On Wed, Jan 20, 2016 at 9:31 AM, David Gobbi > wrote: > Proposed patches for VTK are at this page: > https://gitlab.kitware.com/vtk/vtk/merge_requests > And a log of accepted patches is at this page: > https://gitlab.kitware.com/groups/vtk > > When my patch is ready, I'll send you a link. > > - David > > > On Wed, Jan 20, 2016 at 9:10 AM, Richard Brown > wrote: > Great thanks David. > > Silly question, but where is gitlab? > > Regards, > Richard > >> On 19 Jan 2016, at 23:09, David Gobbi > wrote: >> >> Hi Rich, >> >> The quick answer is no, there are no classes in VTK to do this. >> >> However, I have a class of my own called vtkImageExtractVoxels that >> almost does what you need: it creates a vtkDataArray that contains the >> the values of all of the voxels in the stencil. It would be trivial to modify >> this class so it so that it gives all the IDs. >> >> Coincidentally, just 5 minutes before I saw your email, I started editing >> this class because I need it to give the (x,y,z) of all in-stencil voxels. >> So I'll get it to produce the IDs as well, and then put it on gitlab if you >> want to try it out. >> >> - David >> >> On Tue, Jan 19, 2016 at 2:59 PM, mbcx9rb9 > wrote: >> Hi all, >> >> Is there any way to get a list containing the IDs of all voxels within a >> vtkImageStencilData? >> >> My method at the moment for getting all the voxels in the stencil is to >> create a vtkOBBTree and check if the centre of each voxel is inside the >> vtkPolyData related to the stencil, but this is very slow. >> >> Thanks in advance for any pointers, >> Rich > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.MOUSSAUD at cea.fr Mon Mar 14 05:50:06 2016 From: David.MOUSSAUD at cea.fr (MOUSSAUD David 244079) Date: Mon, 14 Mar 2016 09:50:06 +0000 Subject: [vtkusers] vtkPolyData Modified() and rendering Message-ID: <7A18A422C44BE34E947C1F96625E60BD089AA438@EXDAG0-A1.intra.cea.fr> Hello, Could someone explain me how to use smartly the Modified() method for vtkPolyData. In attachment, I give a simple example. I'm with VTK 6.3 and I use Qt bindings. I have a timer (200ms) that fill dynamically a vtkPolyData instance. points->Initialize(); vertices->Initialize(); colors->Initialize(); for(quint8 i=0;iInsertNextPoint(i*0.01, 0.0, 0.0); vertex->GetPointIds()->SetId(0,i); vertices->InsertNextCell(vertex); /* the first point is red, others are blue */ if(i==0) colors->InsertNextTuple3(255,0,0); else colors->InsertNextTuple3(0,0,255); } And just after I call : polydata->Modified(); This call produces no effects unless if I click inside my renderWindow or resize it. If a add an other timer (100ms) that just call renderWindow->Render(); , then my points are well updated in my renderWindow but the Modified() call seems useless. Thanks in advance for your support, Regards, David -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: qvtkwidgetrendu3d.cpp URL: From vladi88 at gmx.de Mon Mar 14 07:54:19 2016 From: vladi88 at gmx.de (Vladi Mitover) Date: Mon, 14 Mar 2016 12:54:19 +0100 Subject: [vtkusers] structuredPoints->GetPointData()->SetVectors(to commit the vectors) What is the right way to commit the data in ->SetVector(.......); ? Message-ID: An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Mon Mar 14 09:31:45 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Mon, 14 Mar 2016 09:31:45 -0400 Subject: [vtkusers] vtkPolyData Modified() and rendering In-Reply-To: <7A18A422C44BE34E947C1F96625E60BD089AA438@EXDAG0-A1.intra.cea.fr> References: <7A18A422C44BE34E947C1F96625E60BD089AA438@EXDAG0-A1.intra.cea.fr> Message-ID: David, Have you tried removing the polydata->Modified() call when you explicitly call renderWindow->Render()? If so, I suspect you won't see any changes in the render window. The polydata->Modified() call will tell the mapper that the content of the poly data has changed. Direct changes to the point and cell data structures do not trigger the Modified() call on the poly data automatically. vtkPolyData could be made to do that by observing its point and cell data objects, but it does not, so you must do it manually. I hope that clears things up for you, Cory On Mon, Mar 14, 2016 at 5:50 AM, MOUSSAUD David 244079 wrote: > Hello, > > > > Could someone explain me how to use smartly the Modified() method for > vtkPolyData. > > In attachment, I give a simple example. I?m with VTK 6.3 and I use Qt > bindings. > > > > I have a timer (200ms) that fill dynamically a vtkPolyData instance. > > > > points->Initialize(); > > vertices->Initialize(); > > colors->Initialize(); > > > > for(quint8 i=0;i > { > > points->InsertNextPoint(i*0.01, 0.0, 0.0); > > vertex->GetPointIds()->SetId(0,i); > > vertices->InsertNextCell(vertex); > > /* the first point is red, others are blue */ > > if(i==0) > > colors->InsertNextTuple3(255,0,0); > > else > > colors->InsertNextTuple3(0,0,255); > > } > > > > And just after I call : polydata->Modified(); > > > > This call produces no effects unless if I click inside my renderWindow or > resize it. > > > > If a add an other timer (100ms) that just call renderWindow->Render(); , > then my points are well updated in my renderWindow but the Modified() call > seems useless. > > > > Thanks in advance for your support, > > Regards, > > > > David > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Cory Quammen R&D Engineer Kitware, Inc. From ken.martin at kitware.com Mon Mar 14 10:00:34 2016 From: ken.martin at kitware.com (Ken Martin) Date: Mon, 14 Mar 2016 10:00:34 -0400 Subject: [vtkusers] Need information about "Invalid pixel format, no opengl support" message. In-Reply-To: References: Message-ID: The old OpenGL backend will work with OpenGL version 1.1, while the new OpenGL backend requires something closer to OpenGL version 2.1 to 3.2 (or later). Windows only comes with OpenGL version 1.4 (a software renderer). It is up to the hardware providers to supply hardware drivers. Pretty much anything released by Nvidia/AMD/Intel in the past 5 years will support OpenGL 3.2 or later. Earlier than that and it becomes a bit more hit or miss. Yes it depends on the graphics card. But since Intel started building in OpenGL support into their CPUs you can generally count on all recent (IvyBridge maybe SandyBridge or later) systems having sufficient OpenGL support for the new backend. There is a method renderWindow->SupportsOpenGL() that will test if a system meets the minimum requirements for the new backend, I mentioned "one provided to VTK" because sometimes developers create their own opengl context (the context determines what level of OpenGL is provided) and then tell VTK to use it. That will only work if they give VTK a context that includes support for 3.2. Normally VTK creates its own context so it makes sure to create the right one. I do not know much about Qt. Thanks Ken On Mon, Mar 14, 2016 at 4:16 AM, Rakesh Patil wrote: > Hi Ken Martin, > > > I believe I understood the core reason as why this message is displayed. I > need some more details. > > > 1) In what way OpenGL backend is different from the OpenGL2 backend for > VTK 6.3. Knowing that QVTKWidget will be deprecated, what pre-requisite > conditions needs to be considered to stick myself working with QVTKWidget > on various system? > > 2) What exactly do you mean, when you say *"**one was provided to VTK > that did not include opengl support"*. I guess all the latest Windows OS > do come with OpenGL version greater than 1.1. So I think all the drivers > must have OpenGL support right? Correct me if I am wrong. > > 3) Does this functionality really vary from one graphics card to another? > I mean does it depend on the graphics card also? If so, how will I know > whether my graphics card supports OpenGL backend or OpenGL2 backend? > > > Thank You > > > Warm Regards > > Rakesh Patil > ------------------------------ > *From:* Ken Martin > *Sent:* Saturday, March 12, 2016 1:03 AM > *To:* Rakesh Patil > *Cc:* vtkusers at vtk.org > *Subject:* Re: [vtkusers] Need information about "Invalid pixel format, > no opengl support" message. > > I believe you gave the specs for your desktop as opposed to the laptop. > > That message occurs on windows on the old OpenGL backend (and the OpenGL2 > backend for VTK 6.3) It indicates that VTK tried to setup a device context > for rendering but the device did not support opengl, either because VTK > failed to find a suitable device or because on was provided to VTK that did > not include opengl support. > > Thanks > Ken > > > > On Wed, Mar 9, 2016 at 7:22 AM, Rakesh Patil > wrote: > >> Hi VTK users, >> >> >> I am facing a strange issue. I am using QVTKWidget in my application and >> it works very well on my desktop computer. The same code when I try to >> compile on my laptop it throws me this error message: >> >> >> "Invalid pixel format, no opengl support" >> >> >> I would like to know what are the scenarios in which VTK throws >> this message. Whether there is any dependency on various versions of >> Windows OS? I believe it should not be. Below is the system information >> where I get this error: >> >> >> OS Name: Microsoft Windows 8.1 Pro >> Version: 6.3.9600 Build 9600 >> OS Manufacturer: Microsoft Corporation >> System Manufacturer: Dell Inc. >> System Model: Precision T1700 >> System Type: x64-based PC >> Processor Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz, 3592 Mhz, 4 Core(s), >> 8 Logical Processor(s) >> Installed Physical Memory (RAM): 32.0 GB >> Total Virtual Memory: 36.7 GB >> Display adapter: NVIDIA Quadro K620 >> >> Note: I am not using QVTKWidget2. Kindly give some feedback as early as >> possible. >> >> Thank You >> >> Warm Regards >> >> Rakesh Patil >> >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> 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 ronald.de.leeuw.van.weenen at sioux.eu Mon Mar 14 11:24:59 2016 From: ronald.de.leeuw.van.weenen at sioux.eu (Raeceron) Date: Mon, 14 Mar 2016 08:24:59 -0700 (MST) Subject: [vtkusers] Curve smoothing along edges of 3D surface mesh Message-ID: <1457969099789-5737189.post@n5.nabble.com> Dear all, In a segmentation application, a user selects a certain path across the edges of a surface mesh to select a mesh region. Due to the relatively rough nature of the mesh, the curve is rather rough and triangular in shape. For a better look and smoother segmentation, I want to smoothen the selected path. I tried: 1) subdivide and calculate Dijkstra path along a number of curve points (vtk functions) 2) modify mesh to create a new path in mesh which is smoothened out (own implementation) 1 leaves me with a huge mesh due to the subdivision, while I only want to subdivide the part of the mesh where the curve is located (small percentage of mesh). 2 leaves me with complicated algorithmics and a mesh that is modified each time the user changes the path (can happen frequently). This leads to non-manifoldness and very small faces in the mesh. I have been looking around for a vtk algorithm (or own implementation using vtk functions) to accomplish my goal without success so far. Any suggestions would be kindly appreciated. Thanks a lot in advance for your help! -- View this message in context: http://vtk.1045678.n5.nabble.com/Curve-smoothing-along-edges-of-3D-surface-mesh-tp5737189.html Sent from the VTK - Users mailing list archive at Nabble.com. From tjlp at netease.com Mon Mar 14 11:45:38 2016 From: tjlp at netease.com (Liu_tj) Date: Mon, 14 Mar 2016 23:45:38 +0800 (CST) Subject: [vtkusers] OpenGL driver issue with VTK 7.0 Message-ID: <35d826a4.16.15375cddc12.Coremail.tjlp@netease.com> Hi, After I upgrade VTK to 7.0, my application gets this issue: GL version 2.1 with the gpu_shader4 extension is not supported by your graphics driver but is required for the new OpenGL rendering backend. Please update your OpenGL driver. If you are using Mesa please make sure you have version 10.6.5 or later and make sure your driver in Mesa supports OpenGL 3.2. What should I do? My computer is Windows 7. Display adapter is Intel HD graphics. Thanks Liu Peng -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.martin at kitware.com Mon Mar 14 14:30:18 2016 From: ken.martin at kitware.com (Ken Martin) Date: Mon, 14 Mar 2016 14:30:18 -0400 Subject: [vtkusers] OpenGL driver issue with VTK 7.0 In-Reply-To: <35d826a4.16.15375cddc12.Coremail.tjlp@netease.com> References: <35d826a4.16.15375cddc12.Coremail.tjlp@netease.com> Message-ID: Intel HD graphics should work for Ivy Bridge based systems or later. I recently merged a topic that tries to add support for Sandybridge (Intel HD 2000/3000) based systems as well. It is in VTK master if you want to give that a shot. Thanks Ken On Mon, Mar 14, 2016 at 11:45 AM, Liu_tj wrote: > Hi, > > After I upgrade VTK to 7.0, my application gets this issue: GL version 2.1 > with the gpu_shader4 extension is not supported by your graphics driver but > is required for the new OpenGL rendering backend. Please update your OpenGL > driver. If you are using Mesa please make sure you have version 10.6.5 or > later and make sure your driver in Mesa supports OpenGL 3.2. > > What should I do? My computer is Windows 7. Display adapter is Intel HD > graphics. > > Thanks > Liu Peng > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 tjlp at netease.com Mon Mar 14 21:05:55 2016 From: tjlp at netease.com (Liu_tj) Date: Tue, 15 Mar 2016 09:05:55 +0800 (CST) Subject: [vtkusers] OpenGL driver issue with VTK 7.0 In-Reply-To: References: <35d826a4.16.15375cddc12.Coremail.tjlp@netease.com> Message-ID: <7f3c22d7.4.15377ced08a.Coremail.tjlp@netease.com> Hi, Ken, If I keeps the VTK binary I currently use, what can I do? Upgrade the graphic device? Or graphic driver (I try but fail)? Thanks ?2016-03-15?"Ken Martin" ??? -----????----- ???:"Ken Martin" ????:2016?03?15? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: [vtkusers] OpenGL driver issue with VTK 7.0 Intel HD graphics should work for Ivy Bridge based systems or later. I recently merged a topic that tries to add support for Sandybridge (Intel HD 2000/3000) based systems as well. It is in VTK master if you want to give that a shot. Thanks Ken On Mon, Mar 14, 2016 at 11:45 AM, Liu_tj wrote: Hi, After I upgrade VTK to 7.0, my application gets this issue: GL version 2.1 with the gpu_shader4 extension is not supported by your graphics driver but is required for the new OpenGL rendering backend. Please update your OpenGL driver. If you are using Mesa please make sure you have version 10.6.5 or later and make sure your driver in Mesa supports OpenGL 3.2. What should I do? My computer is Windows 7. Display adapter is Intel HD graphics. Thanks Liu Peng _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: 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 aashish.chaudhary at kitware.com Tue Mar 15 00:16:38 2016 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Tue, 15 Mar 2016 00:16:38 -0400 Subject: [vtkusers] Can't transform a vtkVolume In-Reply-To: References: Message-ID: Hi Lorenzo, Could you checkout this branch here: https://gitlab.kitware.com/vtk/vtk/merge_requests/1335? Or else I can send you a patch as well. Thanks, Aashish On Sat, Mar 12, 2016 at 9:13 AM, Aashish Chaudhary < aashish.chaudhary at kitware.com> wrote: > Lorenzo, > > I am able to reproduce the bug and looking into fixing it. > > Thanks, > > > On Thu, Mar 10, 2016 at 7:18 AM, Aashish Chaudhary < > aashish.chaudhary at kitware.com> wrote: > >> It is weird, your code is useful. Let me know have a look at it. >> >> Thanks, >> >> >> On Thu, Mar 10, 2016 at 6:01 AM, Lorenzo >> wrote: >> >>> Aashish Chaudhary kitware.com> writes: >>> >>> Ok, so I upgraded to OpenGL2 (still VTK 6.3). I had to add: >>> >>> #include >>> VTK_MODULE_INIT(vtkRenderingOpenGL2); >>> VTK_MODULE_INIT(vtkRenderingContextOpenGL2); >>> VTK_MODULE_INIT(vtkRenderingVolumeOpenGL2) >>> VTK_MODULE_INIT(vtkRenderingFreeType); >>> VTK_MODULE_INIT(vtkInteractionStyle); >>> >>> Before any other includes (the rest of the code is the same as before). >>> >>> Now my output is... this: http://i.imgur.com/ccGVjoM.png >>> >>> As you can see, the cube is not purple anymore, the blue cube is visible >>> in >>> the bottom left corner of it... even more weird. >>> Do you have any explanation? >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> 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 >>> >> >> >> >> -- >> >> >> >> *| Aashish Chaudhary | Technical Leader | Kitware Inc. >> * >> *| http://www.kitware.com/company/team/chaudhary.html >> * >> > > > > -- > > > > *| Aashish Chaudhary | Technical Leader | Kitware Inc. * > *| http://www.kitware.com/company/team/chaudhary.html > * > -- *| Aashish Chaudhary | Technical Leader | Kitware Inc. * *| http://www.kitware.com/company/team/chaudhary.html * -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.MOUSSAUD at cea.fr Tue Mar 15 04:26:39 2016 From: David.MOUSSAUD at cea.fr (MOUSSAUD David 244079) Date: Tue, 15 Mar 2016 08:26:39 +0000 Subject: [vtkusers] vtkPolyData Modified() and rendering In-Reply-To: References: <7A18A422C44BE34E947C1F96625E60BD089AA438@EXDAG0-A1.intra.cea.fr> Message-ID: <7A18A422C44BE34E947C1F96625E60BD089AA6F1@EXDAG0-A1.intra.cea.fr> Hi, I've tried but my render window is updated even if I do not call the modified() method. My question was in fact : is there a kind of thread started by VTK that monitors the timestamps of the modified data and take the responsibility to update the view without the need to call the render() method(). (the goal is to separate the model and the view, classic :)) David. -----Message d'origine----- De?: Cory Quammen [mailto:cory.quammen at kitware.com] Envoy??: lundi 14 mars 2016 14:32 ??: MOUSSAUD David 244079 Cc?: vtkusers at vtk.org Objet?: Re: [vtkusers] vtkPolyData Modified() and rendering David, Have you tried removing the polydata->Modified() call when you explicitly call renderWindow->Render()? If so, I suspect you won't see any changes in the render window. The polydata->Modified() call will tell the mapper that the content of the poly data has changed. Direct changes to the point and cell data structures do not trigger the Modified() call on the poly data automatically. vtkPolyData could be made to do that by observing its point and cell data objects, but it does not, so you must do it manually. I hope that clears things up for you, Cory On Mon, Mar 14, 2016 at 5:50 AM, MOUSSAUD David 244079 wrote: > Hello, > > > > Could someone explain me how to use smartly the Modified() method for > vtkPolyData. > > In attachment, I give a simple example. I?m with VTK 6.3 and I use Qt > bindings. > > > > I have a timer (200ms) that fill dynamically a vtkPolyData instance. > > > > points->Initialize(); > > vertices->Initialize(); > > colors->Initialize(); > > > > for(quint8 i=0;i > { > > points->InsertNextPoint(i*0.01, 0.0, 0.0); > > vertex->GetPointIds()->SetId(0,i); > > vertices->InsertNextCell(vertex); > > /* the first point is red, others are blue */ > > if(i==0) > > colors->InsertNextTuple3(255,0,0); > > else > > colors->InsertNextTuple3(0,0,255); > > } > > > > And just after I call : polydata->Modified(); > > > > This call produces no effects unless if I click inside my renderWindow > or resize it. > > > > If a add an other timer (100ms) that just call renderWindow->Render(); > , then my points are well updated in my renderWindow but the > Modified() call seems useless. > > > > Thanks in advance for your support, > > Regards, > > > > David > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Cory Quammen R&D Engineer Kitware, Inc. From ken.martin at kitware.com Tue Mar 15 08:06:31 2016 From: ken.martin at kitware.com (Ken Martin) Date: Tue, 15 Mar 2016 08:06:31 -0400 Subject: [vtkusers] OpenGL driver issue with VTK 7.0 In-Reply-To: <7f3c22d7.4.15377ced08a.Coremail.tjlp@netease.com> References: <35d826a4.16.15375cddc12.Coremail.tjlp@netease.com> <7f3c22d7.4.15377ced08a.Coremail.tjlp@netease.com> Message-ID: Keeping the binary you can try upgrading your driver. If that doesn't work then you would need a different device. On Mon, Mar 14, 2016 at 9:05 PM, Liu_tj wrote: > Hi, Ken, > > If I keeps the VTK binary I currently use, what can I do? Upgrade the > graphic device? Or graphic driver (I try but fail)? > > Thanks > > ?2016-03-15?"Ken Martin" ??? > > -----????----- > *???:*"Ken Martin" > *????:*2016?03?15? ??? > *???:*"Liu_tj" > *??:*"vtkusers" > *??:*Re: [vtkusers] OpenGL driver issue with VTK 7.0 > > Intel HD graphics should work for Ivy Bridge based systems or later. I > recently merged a topic that tries to add support for Sandybridge (Intel > HD 2000/3000) based systems as well. It is in VTK master if you want to > give that a shot. > > Thanks > Ken > > > On Mon, Mar 14, 2016 at 11:45 AM, Liu_tj wrote: > >> Hi, >> >> After I upgrade VTK to 7.0, my application gets this issue: GL version >> 2.1 with the gpu_shader4 extension is not supported by your graphics driver >> but is required for the new OpenGL rendering backend. Please update your >> OpenGL driver. If you are using Mesa please make sure you have version >> 10.6.5 or later and make sure your driver in Mesa supports OpenGL 3.2. >> >> What should I do? My computer is Windows 7. Display adapter is Intel HD >> graphics. >> >> Thanks >> Liu Peng >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> 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 tjlp at netease.com Tue Mar 15 08:56:37 2016 From: tjlp at netease.com (Liu_tj) Date: Tue, 15 Mar 2016 20:56:37 +0800 (CST) Subject: [vtkusers] self defined Mousewheel event handler does not work with Activiz VTK 7.0 Message-ID: <24b41cbb.1a.1537a597905.Coremail.tjlp@netease.com> Hi, VTK guys, Now I upgrade from Activiz for VTK 5.8 to 7.0. And I define the vtkInteractorStyleImage::MouseWheelForwardEvt and MouseWheelBackwardEvt for slice switch. With VTK 5.8, it works but now it doesn't work for 7.0. With VTK 7.0, these 2 event handlers keep the old behavior which zooms in or out. It does not call the function I define to switch the slice number. My code is as follow: private void Display(vtkRenderWindow aRenderWindow, vtkAlgorithmOutput aData) { if (aData == null) return; m_imageViewer = vtkImageViewer2.New(); m_imageViewer.SetInputConnection(aData); switch (m_sliceDirection) { case Direction.AXIAL: m_imageViewer.SetSliceOrientationToXY(); break; case Direction.CORONAL: m_imageViewer.SetSliceOrientationToYZ(); break; case Direction.SAGITTAL: m_imageViewer.SetSliceOrientationToXZ(); break; default: break; } m_imageViewer.GetSliceRange(ref m_minSliceNumber, ref m_maxSliceNumber); m_interactorStyle = vtkInteractorStyleImage.New(); m_moveforward = new vtkObject.vtkObjectEventHandler(interactor_MouseWheelForwardEvt); m_movebackward = new vtkObject.vtkObjectEventHandler(interactor_MouseWheelBackwardEvt); m_interactorStyle.MouseWheelForwardEvt += m_moveforward; m_interactorStyle.MouseWheelBackwardEvt += m_movebackward; vtkObject.vtkObjectEventHandler(interactor_MouseWheelBackwardEvt); aRenderWindow.GetRenderers().InitTraversal(); m_renderer = aRenderWindow.GetRenderers().GetFirstRenderer(); m_renderer.SetBackground(0.0, 0.0, 0.0); m_imageViewer.SetRenderWindow(aRenderWindow); vtkRenderWindowInteractor interactor = aRenderWindow.GetInteractor(); interactor.SetInteractorStyle(m_interactorStyle); m_imageViewer.SetupInteractor(interactor); m_currentSlice = m_minSliceNumber + (m_maxSliceNumber - m_minSliceNumber) / 2; m_imageViewer.SetSlice(m_currentSlice); m_imageViewer.Render(); } What's wrong with the code? Thanks Liu Peng -------------- next part -------------- An HTML attachment was scrubbed... URL: From cris.ardito at gmail.com Tue Mar 15 09:33:37 2016 From: cris.ardito at gmail.com (ING. CRISTIAN ARDITO) Date: Tue, 15 Mar 2016 14:33:37 +0100 Subject: [vtkusers] ON vtkSurfaceReconstructionFilter Message-ID: Hi of all. I'm testing a surface reconstruction from a set of points basing on example: "SurfaceFromUnorganizedPoints.cxx". In particular my point cloud it is formed by n slice of points (each slice is a circle) which represent total a cylinder. A single point is in the form: X,Y,Z. So the first slice will have a form: xi,yi,0 ; the second Xi,Yi,1 etc....(with 0 points =vtkSmartPointer::New(); points->InsertNextPoint(point); // possibily other code to load points in different order... } vtkSmartPointer polyData =vtkSmartPointer::New(); polyData->SetPoints(points); // Construct the surface and create isosurface. vtkSmartPointersurf=vtkSmartPointer::New(); surf->SetInputData(polyData); // other code I realized that if i load my vtkPoints structure with a differente order of points, when i run a code i have different result (surface reconstruction is different)!; so I would like to know why the different type of a points order involve a different result. Infact, reading the paper on which is based the surface reconstruction filter (Hoppe Huges) , it seems that the algorithm not depend of the order of data structure provide on input. -- Cris -------------- next part -------------- An HTML attachment was scrubbed... URL: From DLRdave at aol.com Tue Mar 15 09:45:04 2016 From: DLRdave at aol.com (David Cole) Date: Tue, 15 Mar 2016 09:45:04 -0400 Subject: [vtkusers] ActViz5.8 unhandled-Exception In-Reply-To: <398819699.104028.1458030077594.JavaMail.administrator@msam.nabble.com> References: <398819699.104028.1458030077594.JavaMail.administrator@msam.nabble.com> Message-ID: You should send email to the mailing list, so others can also try to help if they know the answer. What more detail do you want? Are you holding C# references to all the objects involved while the events are being fired? It's best if you can share some of the source code for what is not working, so people can look at it, and make suggestions about how to improve the code. HTH, David C. On Tue, Mar 15, 2016 at 5:13 AM, wrote: > http://vtk.1045678.n5.nabble.com/ActiViz-NET-reports-unhandled-Exception-while-interacting-window-with-Mouse-td5720046.html > > Excuse me , I get the same problem ,but I don't know how to fix . > Can you explain more detail ...Thanks > > _____________________________________ > Sent from http://vtk.1045678.n5.nabble.com > From cory.quammen at kitware.com Tue Mar 15 10:04:32 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Tue, 15 Mar 2016 10:04:32 -0400 Subject: [vtkusers] vtkPolyData Modified() and rendering In-Reply-To: <7A18A422C44BE34E947C1F96625E60BD089AA6F1@EXDAG0-A1.intra.cea.fr> References: <7A18A422C44BE34E947C1F96625E60BD089AA438@EXDAG0-A1.intra.cea.fr> <7A18A422C44BE34E947C1F96625E60BD089AA6F1@EXDAG0-A1.intra.cea.fr> Message-ID: > My question was in fact : is there a kind of thread started by VTK that monitors the timestamps of the modified data and take the responsibility to update the view without the need to call the render() method(). (the goal is to separate the model and the view, classic :)) No. > > David. > > > -----Message d'origine----- > De : Cory Quammen [mailto:cory.quammen at kitware.com] > Envoy? : lundi 14 mars 2016 14:32 > ? : MOUSSAUD David 244079 > Cc : vtkusers at vtk.org > Objet : Re: [vtkusers] vtkPolyData Modified() and rendering > > David, > > Have you tried removing the polydata->Modified() call when you explicitly call renderWindow->Render()? If so, I suspect you won't see any changes in the render window. > > The polydata->Modified() call will tell the mapper that the content of the poly data has changed. Direct changes to the point and cell data structures do not trigger the Modified() call on the poly data automatically. vtkPolyData could be made to do that by observing its point and cell data objects, but it does not, so you must do it manually. > > I hope that clears things up for you, > Cory > > On Mon, Mar 14, 2016 at 5:50 AM, MOUSSAUD David 244079 wrote: >> Hello, >> >> >> >> Could someone explain me how to use smartly the Modified() method for >> vtkPolyData. >> >> In attachment, I give a simple example. I?m with VTK 6.3 and I use Qt >> bindings. >> >> >> >> I have a timer (200ms) that fill dynamically a vtkPolyData instance. >> >> >> >> points->Initialize(); >> >> vertices->Initialize(); >> >> colors->Initialize(); >> >> >> >> for(quint8 i=0;i> >> { >> >> points->InsertNextPoint(i*0.01, 0.0, 0.0); >> >> vertex->GetPointIds()->SetId(0,i); >> >> vertices->InsertNextCell(vertex); >> >> /* the first point is red, others are blue */ >> >> if(i==0) >> >> colors->InsertNextTuple3(255,0,0); >> >> else >> >> colors->InsertNextTuple3(0,0,255); >> >> } >> >> >> >> And just after I call : polydata->Modified(); >> >> >> >> This call produces no effects unless if I click inside my renderWindow >> or resize it. >> >> >> >> If a add an other timer (100ms) that just call renderWindow->Render(); >> , then my points are well updated in my renderWindow but the >> Modified() call seems useless. >> >> >> >> Thanks in advance for your support, >> >> Regards, >> >> >> >> David >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> > > > > -- > Cory Quammen > R&D Engineer > Kitware, Inc. -- Cory Quammen R&D Engineer Kitware, Inc. From xiaoyu_543 at sina.com Tue Mar 15 10:57:27 2016 From: xiaoyu_543 at sina.com (xiaoyu_543 at sina.com) Date: Tue, 15 Mar 2016 22:57:27 +0800 Subject: [vtkusers] How to build VTK for Android correctly? Message-ID: <20160315145727.D487BB000AE@webmail.sinamail.sina.com.cn> Hi everybody: I want to build vtk 7.0.0 for android developing,below is my procedure and problems i met.Please help to check,thanks . Step 1. Download source file "VTK-7.0.0.zip" from "http://www.vtk.org/". Step 2. Config VTK in CMake like below and generate vtk.sln project: Step 3. Build VTK.sln. I choose build all in debug mode and suffered 2 errors:first error : 2> -- Build files have been written to: D:/code/VTK-7.0.0-android-bin_3/CMakeExternals/Build/vtk-compile-tools2> Performing build step for 'vtk-compile-tools' 2> make: *** No rule to make target `vtkCompileTools'. Stop. 2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: ?cmd.exe? exited with code 2. second error:3> CMake Error at CMakeLists.txt:29 (project): 3> CMAKE_SYSTEM_NAME is 'Android' but 'NVIDIA Nsight Tegra Visual Studio 3> Edition' is not installed. 3> 3> 3> -- Configuring incomplete, errors occurred! 3> See also "D:/code/VTK-7.0.0-android-bin_3/CMakeExternals/Build/vtk-android/CMakeFiles/CMakeOutput.log". 3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: ?cmd.exe? exited with code 1. I find some response from url "https://blog.kitware.com/building-vtk-for-mobile-architectures/".But I still don't understand how i can do to build VTK for Android correctly.Thanks for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: From xiaoyu_543 at sina.com Tue Mar 15 10:55:44 2016 From: xiaoyu_543 at sina.com (xiaoyu_543 at sina.com) Date: Tue, 15 Mar 2016 22:55:44 +0800 Subject: [vtkusers] How to build VTK 7.0.0 for android? Message-ID: <20160315145544.92A76B000AE@webmail.sinamail.sina.com.cn> Hi everybody: I want to build vtk 7.0.0 for android developing,below is my procedure and problems i met.Please help to check,thanks . Step 1. Download source file "VTK-7.0.0.zip" from "http://www.vtk.org/". Step 2. Config VTK in CMake like below and generate vtk.sln project: Step 3. Build VTK.sln. I choose build all in debug mode and suffered 2 errors:first error : 2> -- Build files have been written to: D:/code/VTK-7.0.0-android-bin_3/CMakeExternals/Build/vtk-compile-tools2> Performing build step for 'vtk-compile-tools' 2> make: *** No rule to make target `vtkCompileTools'. Stop. 2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: ?cmd.exe? exited with code 2. second error:3> CMake Error at CMakeLists.txt:29 (project): 3> CMAKE_SYSTEM_NAME is 'Android' but 'NVIDIA Nsight Tegra Visual Studio 3> Edition' is not installed. 3> 3> 3> -- Configuring incomplete, errors occurred! 3> See also "D:/code/VTK-7.0.0-android-bin_3/CMakeExternals/Build/vtk-android/CMakeFiles/CMakeOutput.log". 3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: ?cmd.exe? exited with code 1. I find some response from url "https://blog.kitware.com/building-vtk-for-mobile-architectures/".But I still don't understand how i can do to build VTK for Android correctly. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jothybasu at gmail.com Tue Mar 15 19:45:12 2016 From: jothybasu at gmail.com (Jothybasu Selvaraj) Date: Wed, 16 Mar 2016 10:45:12 +1100 Subject: [vtkusers] Fill contour Message-ID: Hi All I am trying to fill a 2D contour generated by vtkContourWidget. I pass the polydata from the contour widget to vtkContourTriangulator and the output is as shown in the attached image. But, I want a filled contour. How do I do that? Thanks Jothy -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Untitled.png Type: image/png Size: 209923 bytes Desc: not available URL: From david.gobbi at gmail.com Tue Mar 15 21:24:56 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 15 Mar 2016 19:24:56 -0600 Subject: [vtkusers] Fill contour In-Reply-To: References: Message-ID: Hi Jothy, The vtkContourTriangulator always produces a filled contour, so there must be something wrong with the way it is being rendered. Are you sure that you aren't calling SetRepresentationToWireframe() on the actor's property? - David On Tue, Mar 15, 2016 at 5:45 PM, Jothybasu Selvaraj wrote: > Hi All > > I am trying to fill a 2D contour generated by vtkContourWidget. I pass the > polydata from the contour widget to vtkContourTriangulator and the output > is as shown in the attached image. But, I want a filled contour. How do I > do that? > > > Thanks > > Jothy > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jothybasu at gmail.com Tue Mar 15 21:40:53 2016 From: jothybasu at gmail.com (Jothybasu Selvaraj) Date: Wed, 16 Mar 2016 12:40:53 +1100 Subject: [vtkusers] Fill contour In-Reply-To: References: Message-ID: Hi David If I set the representation to surface only the outline is shown. I even tried it with a vtkPolyDataMapper and the results are same. Here is the rough pipeline vtkSmartPointercontour= vtkSmartPointer::New(); contour=this->ContourWidget->GetContourRepresentation()->GetContourRepresentationAsPolyData(); vtkSmartPointertc= vtkSmartPointer::New(); tc->SetInputData(contour); tc->Update(); vtkSmartPointer polyMapper = vtkSmartPointer::New(); polyMapper->SetInputData(tc->GetOutput()); polyMapper->ScalarVisibilityOn(); polyMapper->Update(); this->polyActor = vtkSmartPointer::New(); polyActor->SetMapper(polyMapper); polyActor->GetProperty()->SetColor(0,1,0); polyActor->GetProperty()->SetRepresentationToWireframe(); this->ViewRenderer->AddActor(this->polyActor); this->ViewRenderer->GetRenderWindow()->Render(); this->ViewRenderer->ResetCamera(); Thanks Jothy On Wed, Mar 16, 2016 at 12:24 PM, David Gobbi wrote: > Hi Jothy, > > The vtkContourTriangulator always produces a filled contour, so there must > be something wrong with the way it is being rendered. Are you sure that > you aren't calling SetRepresentationToWireframe() on the actor's property? > > - David > > > On Tue, Mar 15, 2016 at 5:45 PM, Jothybasu Selvaraj > wrote: > >> Hi All >> >> I am trying to fill a 2D contour generated by vtkContourWidget. I pass >> the polydata from the contour widget to vtkContourTriangulator and the >> output is as shown in the attached image. But, I want a filled contour. How >> do I do that? >> >> >> Thanks >> >> Jothy >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jothybasu at gmail.com Tue Mar 15 21:41:57 2016 From: jothybasu at gmail.com (Jothybasu Selvaraj) Date: Wed, 16 Mar 2016 12:41:57 +1100 Subject: [vtkusers] Fill contour In-Reply-To: References: Message-ID: I commented this line in the original code. polyActor->GetProperty()->SetRepresentationToWireframe(); On Wed, Mar 16, 2016 at 12:40 PM, Jothybasu Selvaraj wrote: > Hi David > > If I set the representation to surface only the outline is shown. I even > tried it with a vtkPolyDataMapper and the results are same. > > Here is the rough pipeline > > vtkSmartPointercontour= > > vtkSmartPointer::New(); > > contour=this->ContourWidget->GetContourRepresentation()->GetContourRepresentationAsPolyData(); > > > > vtkSmartPointertc= > > vtkSmartPointer::New(); > > tc->SetInputData(contour); > > tc->Update(); > > > > > vtkSmartPointer polyMapper = > > vtkSmartPointer::New(); > > polyMapper->SetInputData(tc->GetOutput()); > > polyMapper->ScalarVisibilityOn(); > > polyMapper->Update(); > > > > this->polyActor = > > vtkSmartPointer::New(); > > polyActor->SetMapper(polyMapper); > > polyActor->GetProperty()->SetColor(0,1,0); > > polyActor->GetProperty()->SetRepresentationToWireframe(); > > > this->ViewRenderer->AddActor(this->polyActor); > > this->ViewRenderer->GetRenderWindow()->Render(); > > this->ViewRenderer->ResetCamera(); > > > Thanks > > > Jothy > > > On Wed, Mar 16, 2016 at 12:24 PM, David Gobbi > wrote: > >> Hi Jothy, >> >> The vtkContourTriangulator always produces a filled contour, so there >> must be something wrong with the way it is being rendered. Are you sure >> that you aren't calling SetRepresentationToWireframe() on the actor's >> property? >> >> - David >> >> >> On Tue, Mar 15, 2016 at 5:45 PM, Jothybasu Selvaraj >> wrote: >> >>> Hi All >>> >>> I am trying to fill a 2D contour generated by vtkContourWidget. I pass >>> the polydata from the contour widget to vtkContourTriangulator and the >>> output is as shown in the attached image. But, I want a filled contour. How >>> do I do that? >>> >>> >>> Thanks >>> >>> Jothy >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jothybasu at gmail.com Tue Mar 15 21:53:21 2016 From: jothybasu at gmail.com (Jothybasu Selvaraj) Date: Wed, 16 Mar 2016 12:53:21 +1100 Subject: [vtkusers] Fill contour In-Reply-To: References: Message-ID: Looks like it has something to do with the resolveCoincidentTopology. The filled contour is at the same depth as the image slice -that's why it is not shown. Jothy On Wed, Mar 16, 2016 at 12:41 PM, Jothybasu Selvaraj wrote: > I commented this line in the original code. > > polyActor->GetProperty()->SetRepresentationToWireframe(); > > > On Wed, Mar 16, 2016 at 12:40 PM, Jothybasu Selvaraj > wrote: > >> Hi David >> >> If I set the representation to surface only the outline is shown. I even >> tried it with a vtkPolyDataMapper and the results are same. >> >> Here is the rough pipeline >> >> vtkSmartPointercontour= >> >> vtkSmartPointer::New(); >> >> contour=this->ContourWidget->GetContourRepresentation()->GetContourRepresentationAsPolyData(); >> >> >> >> vtkSmartPointertc= >> >> vtkSmartPointer::New(); >> >> tc->SetInputData(contour); >> >> tc->Update(); >> >> >> >> >> vtkSmartPointer polyMapper = >> >> vtkSmartPointer::New(); >> >> polyMapper->SetInputData(tc->GetOutput()); >> >> polyMapper->ScalarVisibilityOn(); >> >> polyMapper->Update(); >> >> >> >> this->polyActor = >> >> vtkSmartPointer::New(); >> >> polyActor->SetMapper(polyMapper); >> >> polyActor->GetProperty()->SetColor(0,1,0); >> >> polyActor->GetProperty()->SetRepresentationToWireframe(); >> >> >> this->ViewRenderer->AddActor(this->polyActor); >> >> this->ViewRenderer->GetRenderWindow()->Render(); >> >> this->ViewRenderer->ResetCamera(); >> >> >> Thanks >> >> >> Jothy >> >> >> On Wed, Mar 16, 2016 at 12:24 PM, David Gobbi >> wrote: >> >>> Hi Jothy, >>> >>> The vtkContourTriangulator always produces a filled contour, so there >>> must be something wrong with the way it is being rendered. Are you sure >>> that you aren't calling SetRepresentationToWireframe() on the actor's >>> property? >>> >>> - David >>> >>> >>> On Tue, Mar 15, 2016 at 5:45 PM, Jothybasu Selvaraj >> > wrote: >>> >>>> Hi All >>>> >>>> I am trying to fill a 2D contour generated by vtkContourWidget. I pass >>>> the polydata from the contour widget to vtkContourTriangulator and the >>>> output is as shown in the attached image. But, I want a filled contour. How >>>> do I do that? >>>> >>>> >>>> Thanks >>>> >>>> Jothy >>>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Tue Mar 15 22:10:33 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 15 Mar 2016 20:10:33 -0600 Subject: [vtkusers] Fill contour In-Reply-To: References: Message-ID: You can try vtkLinearExtrusionFilter, to extrude the filled contour towards the camera (use CappingOn()). On Tue, Mar 15, 2016 at 7:53 PM, Jothybasu Selvaraj wrote: > Looks like it has something to do with the resolveCoincidentTopology. The > filled contour is at the same depth as the image slice -that's why it is > not shown. > > > Jothy > > On Wed, Mar 16, 2016 at 12:41 PM, Jothybasu Selvaraj > wrote: > >> I commented this line in the original code. >> >> polyActor->GetProperty()->SetRepresentationToWireframe(); >> >> >> On Wed, Mar 16, 2016 at 12:40 PM, Jothybasu Selvaraj > > wrote: >> >>> Hi David >>> >>> If I set the representation to surface only the outline is shown. I even >>> tried it with a vtkPolyDataMapper and the results are same. >>> >>> Here is the rough pipeline >>> >>> vtkSmartPointercontour= >>> >>> vtkSmartPointer::New(); >>> >>> contour=this->ContourWidget->GetContourRepresentation()->GetContourRepresentationAsPolyData(); >>> >>> >>> >>> vtkSmartPointertc= >>> >>> vtkSmartPointer::New(); >>> >>> tc->SetInputData(contour); >>> >>> tc->Update(); >>> >>> >>> >>> >>> vtkSmartPointer polyMapper = >>> >>> vtkSmartPointer::New(); >>> >>> polyMapper->SetInputData(tc->GetOutput()); >>> >>> polyMapper->ScalarVisibilityOn(); >>> >>> polyMapper->Update(); >>> >>> >>> >>> this->polyActor = >>> >>> vtkSmartPointer::New(); >>> >>> polyActor->SetMapper(polyMapper); >>> >>> polyActor->GetProperty()->SetColor(0,1,0); >>> >>> polyActor->GetProperty()->SetRepresentationToWireframe(); >>> >>> >>> this->ViewRenderer->AddActor(this->polyActor); >>> >>> this->ViewRenderer->GetRenderWindow()->Render(); >>> >>> this->ViewRenderer->ResetCamera(); >>> >>> >>> Thanks >>> >>> >>> Jothy >>> >>> >>> On Wed, Mar 16, 2016 at 12:24 PM, David Gobbi >>> wrote: >>> >>>> Hi Jothy, >>>> >>>> The vtkContourTriangulator always produces a filled contour, so there >>>> must be something wrong with the way it is being rendered. Are you sure >>>> that you aren't calling SetRepresentationToWireframe() on the actor's >>>> property? >>>> >>>> - David >>>> >>>> >>>> On Tue, Mar 15, 2016 at 5:45 PM, Jothybasu Selvaraj < >>>> jothybasu at gmail.com> wrote: >>>> >>>>> Hi All >>>>> >>>>> I am trying to fill a 2D contour generated by vtkContourWidget. I pass >>>>> the polydata from the contour widget to vtkContourTriangulator and the >>>>> output is as shown in the attached image. But, I want a filled contour. How >>>>> do I do that? >>>>> >>>>> >>>>> Thanks >>>>> >>>>> Jothy >>>>> >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jothybasu at gmail.com Tue Mar 15 22:35:17 2016 From: jothybasu at gmail.com (Jothybasu Selvaraj) Date: Wed, 16 Mar 2016 13:35:17 +1100 Subject: [vtkusers] Fill contour In-Reply-To: References: Message-ID: Yup, it works! Thanks David! Cheers Jothy On Wed, Mar 16, 2016 at 1:10 PM, David Gobbi wrote: > You can try vtkLinearExtrusionFilter, to extrude the filled contour > towards the camera (use CappingOn()). > > > On Tue, Mar 15, 2016 at 7:53 PM, Jothybasu Selvaraj > wrote: > >> Looks like it has something to do with the resolveCoincidentTopology. The >> filled contour is at the same depth as the image slice -that's why it is >> not shown. >> >> >> Jothy >> >> On Wed, Mar 16, 2016 at 12:41 PM, Jothybasu Selvaraj > > wrote: >> >>> I commented this line in the original code. >>> >>> polyActor->GetProperty()->SetRepresentationToWireframe(); >>> >>> >>> On Wed, Mar 16, 2016 at 12:40 PM, Jothybasu Selvaraj < >>> jothybasu at gmail.com> wrote: >>> >>>> Hi David >>>> >>>> If I set the representation to surface only the outline is shown. I >>>> even tried it with a vtkPolyDataMapper and the results are same. >>>> >>>> Here is the rough pipeline >>>> >>>> vtkSmartPointercontour= >>>> >>>> vtkSmartPointer::New(); >>>> >>>> contour=this->ContourWidget->GetContourRepresentation()->GetContourRepresentationAsPolyData(); >>>> >>>> >>>> >>>> vtkSmartPointertc= >>>> >>>> vtkSmartPointer::New(); >>>> >>>> tc->SetInputData(contour); >>>> >>>> tc->Update(); >>>> >>>> >>>> >>>> >>>> vtkSmartPointer polyMapper = >>>> >>>> vtkSmartPointer::New(); >>>> >>>> polyMapper->SetInputData(tc->GetOutput()); >>>> >>>> polyMapper->ScalarVisibilityOn(); >>>> >>>> polyMapper->Update(); >>>> >>>> >>>> >>>> this->polyActor = >>>> >>>> vtkSmartPointer::New(); >>>> >>>> polyActor->SetMapper(polyMapper); >>>> >>>> polyActor->GetProperty()->SetColor(0,1,0); >>>> >>>> polyActor->GetProperty()->SetRepresentationToWireframe(); >>>> >>>> >>>> this->ViewRenderer->AddActor(this->polyActor); >>>> >>>> this->ViewRenderer->GetRenderWindow()->Render(); >>>> >>>> this->ViewRenderer->ResetCamera(); >>>> >>>> >>>> Thanks >>>> >>>> >>>> Jothy >>>> >>>> >>>> On Wed, Mar 16, 2016 at 12:24 PM, David Gobbi >>>> wrote: >>>> >>>>> Hi Jothy, >>>>> >>>>> The vtkContourTriangulator always produces a filled contour, so there >>>>> must be something wrong with the way it is being rendered. Are you sure >>>>> that you aren't calling SetRepresentationToWireframe() on the actor's >>>>> property? >>>>> >>>>> - David >>>>> >>>>> >>>>> On Tue, Mar 15, 2016 at 5:45 PM, Jothybasu Selvaraj < >>>>> jothybasu at gmail.com> wrote: >>>>> >>>>>> Hi All >>>>>> >>>>>> I am trying to fill a 2D contour generated by vtkContourWidget. I >>>>>> pass the polydata from the contour widget to vtkContourTriangulator and the >>>>>> output is as shown in the attached image. But, I want a filled contour. How >>>>>> do I do that? >>>>>> >>>>>> >>>>>> Thanks >>>>>> >>>>>> Jothy >>>>>> >>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yihui.cao at qq.com Wed Mar 16 04:53:11 2016 From: yihui.cao at qq.com (=?ISO-8859-1?B?WWlodWkgQ2Fv?=) Date: Wed, 16 Mar 2016 16:53:11 +0800 Subject: [vtkusers] How to turn off the dragable function of vtkDistanceWidget ? Message-ID: Dear all, After set a vtkDistanceWidget on an image, the widget set can be changed by dragging a handle. I want to turn off the drag function that makes the DistanceWidget is fixed. So, how to turn off the vtkDistanceWidget dragable function? I tried to set the corresponding vtkDistanceRepresentation2D PickableOff() and DragableOff(). But it did not work. Thanks! Yihui Cao -------------- next part -------------- An HTML attachment was scrubbed... URL: From longbowzhangchina at gmail.com Wed Mar 16 10:34:42 2016 From: longbowzhangchina at gmail.com (longbowzhang) Date: Wed, 16 Mar 2016 07:34:42 -0700 (MST) Subject: [vtkusers] Box plot in VTK 5.10 Message-ID: <1458138882314-5737215.post@n5.nabble.com> Dear VTK-users, I do notice that vtkChartBox has already been included in vtk6.x version. But due to some reason, the application I am using now is still based on VTK 5.10. So my question is does anyone know how to generate a *boxplot* within *vtk5.10*? Thanks a lot in advance! Best regards -- View this message in context: http://vtk.1045678.n5.nabble.com/Box-plot-in-VTK-5-10-tp5737215.html Sent from the VTK - Users mailing list archive at Nabble.com. From oneiros.valente at gmail.com Wed Mar 16 11:25:47 2016 From: oneiros.valente at gmail.com (Lorenzo) Date: Wed, 16 Mar 2016 15:25:47 +0000 (UTC) Subject: [vtkusers] Can't transform a vtkVolume References: Message-ID: Thank you so much Aashish, your fix works perfectly. I also tested it after updating VTK to 7.0 version, I had no problems. Thank you again, I will thank you also in the acknowledgements section in my thesis! I'm glad I could help you to find this problem in VTK Best reguards From aashish.chaudhary at kitware.com Wed Mar 16 11:35:34 2016 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Wed, 16 Mar 2016 11:35:34 -0400 Subject: [vtkusers] Can't transform a vtkVolume In-Reply-To: References: Message-ID: Great. Thanks Lorenzo. - aashish On Wed, Mar 16, 2016 at 11:25 AM, Lorenzo wrote: > Thank you so much Aashish, your fix works perfectly. I also tested it after > updating VTK to 7.0 version, I had no problems. > > Thank you again, I will thank you also in the acknowledgements section in > my > thesis! > > I'm glad I could help you to find this problem in VTK > > > Best reguards > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 > -- *| Aashish Chaudhary | Technical Leader | Kitware Inc. * *| http://www.kitware.com/company/team/chaudhary.html * -------------- next part -------------- An HTML attachment was scrubbed... URL: From oneiros.valente at gmail.com Wed Mar 16 12:24:11 2016 From: oneiros.valente at gmail.com (Lorenzo) Date: Wed, 16 Mar 2016 16:24:11 +0000 (UTC) Subject: [vtkusers] Can't transform a vtkVolume References: Message-ID: I am sorry Aashish but I found a problem: if I try to interact with the scene, the blue volume doesn't behave as it should. It changes positions just by changing the point of view on the scene. Here's a screenshot: http://i.imgur.com/3wlw43D.png Do you have any idea why? From ken.martin at kitware.com Wed Mar 16 13:27:54 2016 From: ken.martin at kitware.com (Ken Martin) Date: Wed, 16 Mar 2016 13:27:54 -0400 Subject: [vtkusers] How to build VTK 7.0.0 for android? In-Reply-To: <20160315145544.92A76B000AE@webmail.sinamail.sina.com.cn> References: <20160315145544.92A76B000AE@webmail.sinamail.sina.com.cn> Message-ID: For VTK we currently use OSX or Linux for building Android. Windows has some complexities that make it difficult to do the mixed build process we use for Android. Thanks Ken On Tue, Mar 15, 2016 at 10:55 AM, wrote: > Hi everybody: > > > I want to build vtk 7.0.0 for android developing,below is my procedure and > problems i met. > > Please help to check,thanks . > > > Step 1. Download source file "VTK-7.0.0.zip > " from " > http://www.vtk.org/". > > Step 2. Config VTK in CMake like below and generate vtk.sln project: > > > Step 3. Build VTK.sln. I choose build all in debug mode and suffered 2 > errors: > > first error : > > 2> -- Build files have been written to: > D:/code/VTK-7.0.0-android-bin_3/CMakeExternals/Build/vtk-compile-tools > > 2> Performing build step for 'vtk-compile-tools' > 2> make: *** No rule to make target `vtkCompileTools'. Stop. > > 2>C:\Program Files > (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): > error MSB6006: ?cmd.exe? exited with code 2. > > > second error: > > 3> CMake Error at CMakeLists.txt:29 (project): > 3> CMAKE_SYSTEM_NAME is 'Android' but 'NVIDIA Nsight Tegra Visual Studio > 3> Edition' is not installed. > 3> > 3> > 3> -- Configuring incomplete, errors occurred! > 3> See also > "D:/code/VTK-7.0.0-android-bin_3/CMakeExternals/Build/vtk-android/CMakeFiles/CMakeOutput.log". > 3>C:\Program Files > (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): > error MSB6006: ?cmd.exe? exited with code 1. > > > I find some response from url " > https://blog.kitware.com/building-vtk-for-mobile-architectures/". > > But I still don't understand how i can do to build VTK for Android > correctly. > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 tluisrs at gmail.com Wed Mar 16 16:06:00 2016 From: tluisrs at gmail.com (Thales Luis Rodrigues Sabino) Date: Wed, 16 Mar 2016 17:06:00 -0300 Subject: [vtkusers] How to use a vtkLODActor to draw a point cloud? Message-ID: I'm trying to use a vtkLODActor to draw a point cloud that has too many points. In order to so, after loading the data into the vtkPolyData and creating a vtkPolyDataMapper, I use the following piece of code m_CloudMapper->ImmediateModeRenderingOff(); m_CloudActor->SetNumberOfCloudPoints(numberOfPoints / 10); m_CloudActor->GetProperty()->SetInterpolationToFlat(); Even with a couple million points and settings the desired update rate with the line m_QVTKWidget->GetInteractor()->SetDesiredUpdateRate(30.0); I can't get the effect that Paraview offers. Even when the camera moves, the vtkLODActor is not acting by random selecting points to draw and keep the desired rate. Am I missing something? -- Thales Luis Rodrigues Sabino PhD Student at PGMC-UFJF Lattes | LinkedIn | ResearchGate -------------- next part -------------- An HTML attachment was scrubbed... URL: From lindeval.ufrr at gmail.com Wed Mar 16 17:25:47 2016 From: lindeval.ufrr at gmail.com (Lindeval Lima) Date: Wed, 16 Mar 2016 17:25:47 -0400 Subject: [vtkusers] Compiling VTK-7.0.0 for Android. Message-ID: When I compile, I get the following messages: BUILD FAILED /home/lindeval/Softwares/Android/android-sdk-linux/tools/ant/build.xml:911: Execute failed: java.io.IOException: Can not run program "/ home / lindeval / Software / Android / android-sdk -linux / build-tools / 21.1.2 / aapt ": error = 2, File or directory not found. The file exists! Examples are not built. cmake-gui configuration: attached file. System: Linux Ubuntu 10.15 Thank you for any help. -- *Prof. Lindeval Fernandes de Lima* *Telefones para contato*: Celular: (095) 81215424 Coordena??o EaD: (095) 3624 - 6426 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: snapshot1.png Type: image/png Size: 156454 bytes Desc: not available URL: From philip.fackler at gmail.com Wed Mar 16 18:24:37 2016 From: philip.fackler at gmail.com (Philip Fackler) Date: Wed, 16 Mar 2016 22:24:37 +0000 Subject: [vtkusers] Triangulate surface points? Message-ID: Is there a way to triangulate a set of surface points using vtk? I've looked around and everything I've found (vtk, cgal, pcl) only do a surface reconstruction which ends up generating its own points to triangulate. I want to actually use the points I have as the vertices of the triangulation. Along with the point locations, I have a lot of information available in my code that I could provide: Normal vector at each point Bounding segmented curve(s) (i.e., lists of edge cells indexing the list of surface points) A polydata representation of the surface (Note that the points I want to triangulate are distinct from the points involved in this) The only vtk utility that seems to come close to this is vtkDelaunay2D, but it's only useful if all the points can be mapped to a 2D plane. This isn't possible in general without a parametric surface, which is one bit of information I don't have. Thanks in advance for the help. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjlp at netease.com Wed Mar 16 21:42:07 2016 From: tjlp at netease.com (Liu_tj) Date: Thu, 17 Mar 2016 09:42:07 +0800 (CST) Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series Message-ID: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> Hi, VTK guys, I use VTK 7.0 to generate 3D model from DICOM series. I just follow the code example from http://www.vtk.org/pipermail/vtkusers/2013-November/082109.html. When I try to reduce the number of triangles by vtkDecimatePro, the Visual Studio 2015 monitor shows that the memory jump to over 10G and my computer has no response, I have to restart my computer rudely. See my code below, with my DICOM series, the marched->GetNumberOfPoints() return more than 20 millions: vtkSmartPointer surface = vtkSmartPointer::New(); surface->SetInputData(volume); surface->ComputeNormalsOn(); surface->ComputeScalarsOn(); surface->SetValue(0, 1); // Create polydata from iso-surface vtkSmartPointer marched = vtkSmartPointer::New(); surface->Update(); marched->DeepCopy(surface->GetOutput()); std::cout<<"Number of points: " << marched->GetNumberOfPoints() << std::endl; // Decimation to reduce the number of triangles vtkSmartPointer decimator = vtkDecimatePro::New(); decimator->SetInputData(marched); decimator->SetTargetReduction(0.5); decimator->SetPreserveTopology(1); decimator->Update(); <------------------memory cost jumps to more than 10G. Any suggestions to decrease the memory cost? I only know that using vtkImageThreshold. Thanks, Liu Peng -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Wed Mar 16 22:26:49 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 16 Mar 2016 20:26:49 -0600 Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series In-Reply-To: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> References: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> Message-ID: Hi Liu Peng, The vtkMarchingCubes algorithm is for greyscale images. Using vtkImageThreshold before vtkMarchingCubes will give a poor result, because the algorithm won't be able to properly interpolate the voxels to find the best surface if it is given a binary image. When you call SetValue(0, isovalue), make sure that "isovalue" is set to the value that corresponds to the desired isosurface. If you don't know what value to use, you can start at 1000, then try 250, then 125, etc. until you get a reasonable result. But the best way to choose a value is to use Otsu's method or something similar. - David On Wed, Mar 16, 2016 at 7:42 PM, Liu_tj wrote: > Hi, VTK guys, > > I use VTK 7.0 to generate 3D model from DICOM series. I just follow the > code example from > > http://www.vtk.org/pipermail/vtkusers/2013-November/082109.html . When I try to reduce the number of triangles by vtkDecimatePro, the Visual Studio 2015 monitor shows that the memory jump to over 10G and my computer has no response, I have to restart my computer rudely. See my code below, with my DICOM series, the marched->GetNumberOfPoints() return more than 20 millions: > > vtkSmartPointer surface = vtkSmartPointer::New(); > surface->SetInputData(volume); > surface->ComputeNormalsOn(); > surface->ComputeScalarsOn(); > surface->SetValue(0, 1); > > // Create polydata from iso-surface > vtkSmartPointer marched = vtkSmartPointer::New(); > surface->Update(); > marched->DeepCopy(surface->GetOutput()); > std::cout<<"Number of points: " << marched->GetNumberOfPoints() << std::endl; > > // Decimation to reduce the number of triangles > vtkSmartPointer decimator = vtkDecimatePro::New(); > decimator->SetInputData(marched); > decimator->SetTargetReduction(0.5); > decimator->SetPreserveTopology(1); > decimator->Update(); <------------------memory cost jumps to more than 10G. > > Any suggestions to decrease the memory cost? I only know that using vtkImageThreshold. > Thanks, > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.chen.dk at gmail.com Wed Mar 16 22:56:33 2016 From: r.chen.dk at gmail.com (=?UTF-8?B?6Zmz6byO5YWD?=) Date: Thu, 17 Mar 2016 10:56:33 +0800 Subject: [vtkusers] Compiling Problem in VTK-7.0 DICOMReader Example Message-ID: Hello Everyone: I've been trying to use VTK-7.0 to do the DICOM 3D Reconstruction for 2 weeks, but it finally ended up to a bug that I couldn't understand and don't know how to fix it... as the following pictures: 1. Codes 2. Error Information 1 3. Error Information 2 4. The DICOM files in the folder The system is: Win7, Visual Studio 2013, and VTK 7-0. I will be thankful if someone knows how where the possible problem is, thank you very much. Sincerely, Ralf. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: snap_shot_1.JPG Type: image/jpeg Size: 85786 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: snap_shot_2.JPG Type: image/jpeg Size: 30904 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: snap_shot_3.JPG Type: image/jpeg Size: 42285 bytes Desc: not available URL: From david.gobbi at gmail.com Wed Mar 16 23:13:42 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 16 Mar 2016 21:13:42 -0600 Subject: [vtkusers] Compiling Problem in VTK-7.0 DICOMReader Example In-Reply-To: References: Message-ID: Hi Ralf, To fix this problem, you need to 1) link to vtkRenderingOpenGL.lib, vtkRenderingFreeType.lib, and vtkInteractionStyle.lib 2) add the following to the top of your source, after including the VTK header files: #include VTK_MODULE_INIT(vtkRenderingOpenGL); VTK_MODULE_INIT(vtkRenderingFreeType); VTK_MODULE_INIT(vtkInteractionStyle); There is some additional information on this wiki page: http://www.vtk.org/Wiki/VTK/Build_System_Migration - David On Wed, Mar 16, 2016 at 8:56 PM, ??? wrote: > Hello Everyone: > > I've been trying to use VTK-7.0 to do the DICOM 3D Reconstruction > for 2 weeks, but it finally ended up to a bug that I couldn't understand > and don't know how to fix it... as the following pictures: > 1. Codes > 2. Error Information 1 > 3. Error Information 2 > 4. The DICOM files in the folder > > The system is: Win7, Visual Studio 2013, and VTK 7-0. > > I will be thankful if someone knows how where the possible problem is, > thank you very much. > > > Sincerely, Ralf. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjlp at netease.com Thu Mar 17 00:35:48 2016 From: tjlp at netease.com (Liu_tj) Date: Thu, 17 Mar 2016 12:35:48 +0800 (CST) Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series In-Reply-To: References: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> Message-ID: <694f11c8.9.15382dbad62.Coremail.tjlp@netease.com> Hi,David, If using vtkImageThreshold before vtkMarchingCubes is not a good option, what other better way do you have? Beside, for the isovalue, I try 2,3,4 and marched->GetNumberOfPoints() return 0, only isovalue is 1 and marched->GetNumberOfPoints() return a number greater than 0. I have no idea this is relating to the DICOM series or other problem. Thanks. Liu Peng ?2016-03-17?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?17? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series Hi Liu Peng, The vtkMarchingCubes algorithm is for greyscale images. Using vtkImageThreshold before vtkMarchingCubes will give a poor result, because the algorithm won't be able to properly interpolate the voxels to find the best surface if it is given a binary image. When you call SetValue(0, isovalue), make sure that "isovalue" is set to the value that corresponds to the desired isosurface. If you don't know what value to use, you can start at 1000, then try 250, then 125, etc. until you get a reasonable result. But the best way to choose a value is to use Otsu's method or something similar. - David On Wed, Mar 16, 2016 at 7:42 PM, Liu_tj wrote: Hi, VTK guys, I use VTK 7.0 to generate 3D model from DICOM series. I just follow the code example from http://www.vtk.org/pipermail/vtkusers/2013-November/082109.html. When I try to reduce the number of triangles by vtkDecimatePro, the Visual Studio 2015 monitor shows that the memory jump to over 10G and my computer has no response, I have to restart my computer rudely. See my code below, with my DICOM series, the marched->GetNumberOfPoints() return more than 20 millions: vtkSmartPointer surface = vtkSmartPointer::New(); surface->SetInputData(volume); surface->ComputeNormalsOn(); surface->ComputeScalarsOn(); surface->SetValue(0, 1); // Create polydata from iso-surface vtkSmartPointer marched = vtkSmartPointer::New(); surface->Update(); marched->DeepCopy(surface->GetOutput()); std::cout<<"Number of points: " << marched->GetNumberOfPoints() << std::endl; // Decimation to reduce the number of triangles vtkSmartPointer decimator = vtkDecimatePro::New(); decimator->SetInputData(marched); decimator->SetTargetReduction(0.5); decimator->SetPreserveTopology(1); decimator->Update(); <------------------memory cost jumps to more than 10G. Any suggestions to decrease the memory cost? I only know that using vtkImageThreshold. Thanks, -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Thu Mar 17 00:52:56 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 16 Mar 2016 22:52:56 -0600 Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series In-Reply-To: <694f11c8.9.15382dbad62.Coremail.tjlp@netease.com> References: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> <694f11c8.9.15382dbad62.Coremail.tjlp@netease.com> Message-ID: On Wed, Mar 16, 2016 at 10:35 PM, Liu_tj wrote: > Hi,David, > > If using vtkImageThreshold before vtkMarchingCubes is not a good option, > what other better way do you have? > The output of the reader should go directly into vtkMarchingCubes. > Beside, for the isovalue, I try 2,3,4 and marched->GetNumberOfPoints() > return 0, only isovalue is 1 and marched->GetNumberOfPoints() return a > number greater than 0. I have no idea this is relating to the DICOM series > or other problem. > If you remove vtkImageThreshold, and put the output of the reader directly into vtkMarchingCubes, then you should be able to use an isovalue somewhere between 100 and 2000 and get a good result. Also, after vtkMarchingCubes, you can use vtkConnectivityFilter to clean up the polydata before you decimate it. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjlp at netease.com Thu Mar 17 01:27:10 2016 From: tjlp at netease.com (Liu_tj) Date: Thu, 17 Mar 2016 13:27:10 +0800 (CST) Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series In-Reply-To: References: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> <694f11c8.9.15382dbad62.Coremail.tjlp@netease.com> Message-ID: <7303b5c3.b.153830ab688.Coremail.tjlp@netease.com> Hi, David, If I don't use vtkImageThreshol, how to generate 3D model from the points whose grayscale is in some specific range? This range can be changed by the user. Thanks Liu Peng ?2016-03-17?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?17? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series On Wed, Mar 16, 2016 at 10:35 PM, Liu_tj wrote: Hi,David, If using vtkImageThreshold before vtkMarchingCubes is not a good option, what other better way do you have? The output of the reader should go directly into vtkMarchingCubes. Beside, for the isovalue, I try 2,3,4 and marched->GetNumberOfPoints() return 0, only isovalue is 1 and marched->GetNumberOfPoints() return a number greater than 0. I have no idea this is relating to the DICOM series or other problem. If you remove vtkImageThreshold, and put the output of the reader directly into vtkMarchingCubes, then you should be able to use an isovalue somewhere between 100 and 2000 and get a good result. Also, after vtkMarchingCubes, you can use vtkConnectivityFilter to clean up the polydata before you decimate it. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From pip010 at gmail.com Thu Mar 17 05:31:05 2016 From: pip010 at gmail.com (Petar Petrov) Date: Thu, 17 Mar 2016 10:31:05 +0100 Subject: [vtkusers] vtkActor2D and layer ordering ? Message-ID: I found at least 3 ways that might influence z-order of 2D actors: 1) vtkActor2D->SetLayerNumber(int) 2) vtkImageMapper->SetZSlice() 3) vtkProperty2D->SetDsiplayToBackground/Foreground() None of which seems to do the job. also previous similar question: http://public.kitware.com/pipermail/vtkusers/2010-February/057204.html Before vtk7.0, at least point 3 was working, now in vtk7.0 it also stopped working. So my question is how can I influence z-ordering of 2Dactors as per latest vtk? Cheers, Petar -------------- next part -------------- An HTML attachment was scrubbed... URL: From tluisrs at gmail.com Thu Mar 17 07:37:58 2016 From: tluisrs at gmail.com (Thales Luis Rodrigues Sabino) Date: Thu, 17 Mar 2016 08:37:58 -0300 Subject: [vtkusers] Compiling VTK7 with VS2015 and Qt5.6 Message-ID: Today I was able to successfully compile VTK7.0 with VS2015 and Qt5.6. Since Qt5.6 has binaries available for VS2015 I decided to give it a try. The first error that appears was the error that 'unistd.h' was not defined (it is also a unix file). Looking at the source code for the file '\IO\LSDyna\private\LSDynaFamily.h (45)' one can note that the macro WIN32 is not being defined. The reason is that in VS2015, as can been seen in this page https://msdn.microsoft.com/en-us/library/b0084kay.aspx, the correct macro to detect Windows is _WIN32. To fix this, I simply change my cmake command line with the following cmake -DCMAKE_CXX_FLAGS="/DWIN32=1 /EHsc" The EHsc is to solve some warning about the exception handling system. Hope this can help. -- Thales Luis Rodrigues Sabino PhD Student at PGMC-UFJF Lattes | LinkedIn | ResearchGate -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Thu Mar 17 08:06:33 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 17 Mar 2016 06:06:33 -0600 Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series In-Reply-To: <7303b5c3.b.153830ab688.Coremail.tjlp@netease.com> References: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> <694f11c8.9.15382dbad62.Coremail.tjlp@netease.com> <7303b5c3.b.153830ab688.Coremail.tjlp@netease.com> Message-ID: Hi Liu Peng, For creating a model, it is common to allow the user to set just a lower threshold (rather than a range), and to use the lower threshold as the isovalue. If you send the code for the whole pipeline, that might help. - David On Wed, Mar 16, 2016 at 11:27 PM, Liu_tj wrote: > Hi, David, > > If I don't use vtkImageThreshol, how to generate 3D model from the points > whose grayscale is in some specific range? This range can be changed by the > user. > > Thanks > Liu Peng > > ?2016-03-17?"David Gobbi" ??? > > -----????----- > *???:*"David Gobbi" > *????:*2016?03?17? ??? > *???:*"Liu_tj" > *??:*"vtkusers" > *??:*Re: Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model > generation from DICOM series > > > On Wed, Mar 16, 2016 at 10:35 PM, Liu_tj wrote: > >> Hi,David, >> >> If using vtkImageThreshold before vtkMarchingCubes is not a good option, >> what other better way do you have? >> > > The output of the reader should go directly into vtkMarchingCubes. > > >> Beside, for the isovalue, I try 2,3,4 and marched->GetNumberOfPoints() >> return 0, only isovalue is 1 and marched->GetNumberOfPoints() return a >> number greater than 0. I have no idea this is relating to the DICOM series >> or other problem. >> > > If you remove vtkImageThreshold, and put the output of the reader directly > into vtkMarchingCubes, then you should be able to use an isovalue somewhere > between 100 and 2000 and get a good result. > > Also, after vtkMarchingCubes, you can use vtkConnectivityFilter to clean > up the polydata before you decimate it. > > - David > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Thu Mar 17 08:27:03 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 17 Mar 2016 06:27:03 -0600 Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series In-Reply-To: References: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> <694f11c8.9.15382dbad62.Coremail.tjlp@netease.com> <7303b5c3.b.153830ab688.Coremail.tjlp@netease.com> Message-ID: And I should add: if it is necessary to use a range (instead of just a lower threshold), then the pipeline can use vtkMarchingCubes twice: vtkSmartPointer cubes1 = vtkSmartPointer::New(); cubes1->SetInputData(imagedata); cubes1->SetValue(0, lowerThreshold); vtkSmartPointer cubes2 = vtkSmartPointer::New(); cubes2->SetInputData(imagedata); cubes2->SetValue(0, upperThreshold); vtkSmartPointer reverse = vtkSmartPointer::New(); reverse->SetInputConnection(cubes2->GetOutputPort()); vtkSmartPointer surface = vtkSmartPointer::New(); surface->SetInputConnection(cubes1->GetOutputPort()); surface->AddInputConnection(cubes2->GetOutputPort()); surface->Update(); On Thu, Mar 17, 2016 at 6:06 AM, David Gobbi wrote: > Hi Liu Peng, > > For creating a model, it is common to allow the user to set just a lower > threshold (rather than a range), and to use the lower threshold as the > isovalue. If you send the code for the whole pipeline, that might help. > > - David > > On Wed, Mar 16, 2016 at 11:27 PM, Liu_tj wrote: > >> Hi, David, >> >> If I don't use vtkImageThreshol, how to generate 3D model from the points >> whose grayscale is in some specific range? This range can be changed by the >> user. >> >> Thanks >> Liu Peng >> >> ?2016-03-17?"David Gobbi" ??? >> >> -----????----- >> *???:*"David Gobbi" >> *????:*2016?03?17? ??? >> *???:*"Liu_tj" >> *??:*"vtkusers" >> *??:*Re: Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model >> generation from DICOM series >> >> >> On Wed, Mar 16, 2016 at 10:35 PM, Liu_tj wrote: >> >>> Hi,David, >>> >>> If using vtkImageThreshold before vtkMarchingCubes is not a good option, >>> what other better way do you have? >>> >> >> The output of the reader should go directly into vtkMarchingCubes. >> >> >>> Beside, for the isovalue, I try 2,3,4 and marched->GetNumberOfPoints() >>> return 0, only isovalue is 1 and marched->GetNumberOfPoints() return a >>> number greater than 0. I have no idea this is relating to the DICOM series >>> or other problem. >>> >> >> If you remove vtkImageThreshold, and put the output of the reader >> directly into vtkMarchingCubes, then you should be able to use an isovalue >> somewhere between 100 and 2000 and get a good result. >> >> Also, after vtkMarchingCubes, you can use vtkConnectivityFilter to clean >> up the polydata before you decimate it. >> >> - David >> >> >> >> >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.martin at kitware.com Thu Mar 17 09:12:42 2016 From: ken.martin at kitware.com (Ken Martin) Date: Thu, 17 Mar 2016 09:12:42 -0400 Subject: [vtkusers] [vtk-developers] vtkActor2D and layer ordering ? In-Reply-To: References: Message-ID: I believe Bill Lorensen has/had a patch related to 2d actor depth in the new OpenGL backend that has been merged into master https://gitlab.kitware.com/vtk/vtk/merge_requests/1284 does that fix the issue? Thanks Ken On Thu, Mar 17, 2016 at 8:04 AM, Andras Lasso wrote: > I would be interested in this, too. > > > > When building 3D Slicer with OpenGL backend then everything works well. > Switching to OpenGL2 bckend improves performance, fixes transparent > polydata rendering, and volume rendering (great!), but there are 2D actor > ordering issues all over the place. > > > > How 2D actor ordering is changed in OpenGL2 and what should we change in > our applications to have the same behavior as with OpenGL? > > > > Andras > > > > *From:* vtk-developers [mailto:vtk-developers-bounces at vtk.org] *On Behalf > Of *Petar Petrov > *Sent:* March 17, 2016 5:31 AM > *To:* vtk-developers at vtk.org; vtkusers at vtk.org > *Subject:* [vtk-developers] vtkActor2D and layer ordering ? > > > > > > I found at least 3 ways that might influence z-order of 2D actors: > > > > 1) vtkActor2D->SetLayerNumber(int) > > 2) vtkImageMapper->SetZSlice() > > 3) vtkProperty2D->SetDsiplayToBackground/Foreground() > > > > None of which seems to do the job. also previous similar question: > > http://public.kitware.com/pipermail/vtkusers/2010-February/057204.html > > > > Before vtk7.0, at least point 3 was working, now in vtk7.0 it also stopped > working. > > > > So my question is how can I influence z-ordering of 2Dactors as per latest > vtk? > > > > Cheers, > > Petar > > > > > > > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Search the list archives at: http://markmail.org/search/?q=vtk-developers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtk-developers > > > -- 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 py09tad at leeds.ac.uk Thu Mar 17 11:19:00 2016 From: py09tad at leeds.ac.uk (Thomas Drake [py09tad]) Date: Thu, 17 Mar 2016 15:19:00 +0000 Subject: [vtkusers] vtkProbeFilter performance. Message-ID: Hi All, I have some data structures I need to interpolate between. What I have is one vtkRectilinearGrid which has no values stored but has a structure defined. This is the grid I want to interpolate onto. I then have another vtkRectilinearGrid which is almost the same as the previous as in its Y and Z structure is exactly the same but the X coordinate system is offset slightly. It also has scalar values associated with each point. The aim was to shift the grid slightly but by interpolating the values too. I do three times for Y and Z offsets too. I'm currently using vtkProbeFilter and it works really well as the output grid and values are accurate. It completes its task on my small grid fairly quickly (>1 second for size 41x41x31) however, when I move to my main data (400x400x80) it takes around 2 minutes to interpolate each grid. For interpolation I only care about interpolating along lines in the grid. For example the grid with the offset X coordinate system, the array [i][0][0] (0 <= i <= 41) doesn't care about the array [i][0][1] or [i][1][0] etc only those values along X. So my question is, is there a way to either increase the speed of the probe filter by reducing its accuracy or a different tool to use instead? Thanks, Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: From lindeval.ufrr at gmail.com Thu Mar 17 14:07:02 2016 From: lindeval.ufrr at gmail.com (Lindeval Lima) Date: Thu, 17 Mar 2016 14:07:02 -0400 Subject: [vtkusers] Compiling VTK-7.0.0 for Android. In-Reply-To: References: Message-ID: 2016-03-16 17:25 GMT-04:00 Lindeval Lima : > > > When I compile, I get the following messages: > > BUILD FAILED > /home/lindeval/Softwares/Android/android-sdk-linux/tools/ant/build.xml:911 > : Execute failed: java.io.IOException: Can not run program "/ home / > lindeval / Software / Android / android-sdk -linux / build-tools / 21.1.2 > / aapt ": error = 2, File or directory not found. > > The file exists! > > Examples are not built. > > cmake-gui configuration: attached file. > > System: Linux Ubuntu 10.15 > > Thank you for any help. > > > -- > > *Prof. Lindeval Fernandes de Lima* > > *Telefones para contato*: > Celular: (095) 81215424 > Coordena??o EaD: (095) 3624 - 6426 > > -- *Prof. Lindeval Fernandes de Lima* *Telefones para contato*: Celular: (095) 81215424 Coordena??o EaD: (095) 3624 - 6426 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tonio.guillen at gmail.com Thu Mar 17 14:07:09 2016 From: tonio.guillen at gmail.com (galera) Date: Thu, 17 Mar 2016 11:07:09 -0700 (MST) Subject: [vtkusers] Bug with the java wrapper Message-ID: <1458238029874-5737254.post@n5.nabble.com> Hi all, I found a bug with the java wrapper for example: double thresholdValue = Math.pow(10, 10); vtkRectilinearGrid input = (vtkRectilinearGrid) this.getInput().getValue(); vtkDataArray values = input.GetCellData().GetScalars(); int k; for(int i = 0; i < input.GetNumberOfCells(); i++) { double x = 0, y = 0, z = 0; for(k = 0; k < input.GetCell(i).GetPoints().GetNumberOfPoints(); k++) { double[] pcoords = input.GetCell(i).GetPoints().GetPoint(k); x += pcoords[0]; y += pcoords[1]; z += pcoords[2]; } Point3D p = new Point3D(x/k, y/k, z/k); int rank = model.rank(p, true); if (!this.getEntities().contains(model.getFormationWithRank(rank ))) { values.SetTuple1(i, thresholdValue); } } input.GetCellData().SetScalars(values); vtkThreshold threshold = new vtkThreshold(); threshold.SetInputData(input); threshold.ThresholdByLower(thresholdValue-1.); threshold.Update(); vtkUnstructuredGrid output = threshold.GetOutput(); Pipe pipe = FilterFactory.eINSTANCE.createPipe(); pipe.setValue(output); this.getOutput().add(pipe); This code work fine if you set: double thresholdValue = Math.pow(10, 10); if you set: double thresholdValue = Double.MAX_VALUE; you have a bug. Galera -- View this message in context: http://vtk.1045678.n5.nabble.com/Bug-with-the-java-wrapper-tp5737254.html Sent from the VTK - Users mailing list archive at Nabble.com. From david.gobbi at gmail.com Thu Mar 17 14:32:07 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 17 Mar 2016 12:32:07 -0600 Subject: [vtkusers] Bug with the java wrapper In-Reply-To: <1458238029874-5737254.post@n5.nabble.com> References: <1458238029874-5737254.post@n5.nabble.com> Message-ID: Hi Galera, This doesn't look like a bug. This is related to numerical precision. 10000000000.0 - 1.0 -> 9999999999.0 1.7976931348623157e+308 - 1.0 -> 1.7976931348623157e+308 If you subtract 1 from Double.MAX_VALUE, the result is Double.MAX_VALUE. Floating point math is not exact, a double only has around 16 significant digits. In other words, instead of subtracting 1, you should do this: threshold.ThresholdByLower(thresholdValue - thresholdValue*eps); where eps=2.220446049250313e-16 is the double epsilon. - David On Thu, Mar 17, 2016 at 12:07 PM, galera wrote: > Hi all, > > I found a bug with the java wrapper for example: > > double thresholdValue = Math.pow(10, 10); > vtkRectilinearGrid input = (vtkRectilinearGrid) > this.getInput().getValue(); > vtkDataArray values = > input.GetCellData().GetScalars(); > > int k; > for(int i = 0; i < input.GetNumberOfCells(); i++) { > double x = 0, y = 0, z = 0; > for(k = 0; k < > input.GetCell(i).GetPoints().GetNumberOfPoints(); k++) { > double[] pcoords = > input.GetCell(i).GetPoints().GetPoint(k); > x += pcoords[0]; > y += pcoords[1]; > z += pcoords[2]; > } > Point3D p = new Point3D(x/k, y/k, z/k); > int rank = model.rank(p, true); > if > (!this.getEntities().contains(model.getFormationWithRank(rank ))) { > values.SetTuple1(i, > thresholdValue); > } > } > input.GetCellData().SetScalars(values); > vtkThreshold threshold = new vtkThreshold(); > threshold.SetInputData(input); > threshold.ThresholdByLower(thresholdValue-1.); > > threshold.Update(); > > vtkUnstructuredGrid output = threshold.GetOutput(); > Pipe pipe = > FilterFactory.eINSTANCE.createPipe(); > pipe.setValue(output); > this.getOutput().add(pipe); > > > This code work fine if you set: > double thresholdValue = Math.pow(10, 10); > > if you set: > double thresholdValue = Double.MAX_VALUE; > > you have a bug. > > Galera > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lasso at queensu.ca Thu Mar 17 15:01:29 2016 From: lasso at queensu.ca (Andras Lasso) Date: Thu, 17 Mar 2016 19:01:29 +0000 Subject: [vtkusers] [vtk-developers] vtkActor2D and layer ordering ? In-Reply-To: References: Message-ID: Unfortunately, that doesn?t fix the ordering issues for me. I?ll try to create a simple example to demonstrate the problem. Andras From: Ken Martin [mailto:ken.martin at kitware.com] Sent: Thursday, March 17, 2016 9:13 AM To: Andras Lasso Cc: Petar Petrov ; vtk-developers at vtk.org; vtkusers at vtk.org Subject: Re: [vtk-developers] vtkActor2D and layer ordering ? I believe Bill Lorensen has/had a patch related to 2d actor depth in the new OpenGL backend that has been merged into master https://gitlab.kitware.com/vtk/vtk/merge_requests/1284 does that fix the issue? Thanks Ken On Thu, Mar 17, 2016 at 8:04 AM, Andras Lasso > wrote: I would be interested in this, too. When building 3D Slicer with OpenGL backend then everything works well. Switching to OpenGL2 bckend improves performance, fixes transparent polydata rendering, and volume rendering (great!), but there are 2D actor ordering issues all over the place. How 2D actor ordering is changed in OpenGL2 and what should we change in our applications to have the same behavior as with OpenGL? Andras From: vtk-developers [mailto:vtk-developers-bounces at vtk.org] On Behalf Of Petar Petrov Sent: March 17, 2016 5:31 AM To: vtk-developers at vtk.org; vtkusers at vtk.org Subject: [vtk-developers] vtkActor2D and layer ordering ? I found at least 3 ways that might influence z-order of 2D actors: 1) vtkActor2D->SetLayerNumber(int) 2) vtkImageMapper->SetZSlice() 3) vtkProperty2D->SetDsiplayToBackground/Foreground() None of which seems to do the job. also previous similar question: http://public.kitware.com/pipermail/vtkusers/2010-February/057204.html Before vtk7.0, at least point 3 was working, now in vtk7.0 it also stopped working. So my question is how can I influence z-ordering of 2Dactors as per latest vtk? Cheers, Petar _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Search the list archives at: http://markmail.org/search/?q=vtk-developers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtk-developers -- 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 tjlp at netease.com Thu Mar 17 21:07:36 2016 From: tjlp at netease.com (Liu_tj) Date: Fri, 18 Mar 2016 09:07:36 +0800 (CST) Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series In-Reply-To: References: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> <694f11c8.9.15382dbad62.Coremail.tjlp@netease.com> <7303b5c3.b.153830ab688.Coremail.tjlp@netease.com> Message-ID: <35ec6f75.2.15387436d8c.Coremail.tjlp@netease.com> Hi, David, Below is my present C# code.You can see that I reset the camera position, otherwise after rendering, the 3D model is not at the window center, I have to pan it, any recommendation for the position issue also? private void Display(vtkRenderWindow aRenderWindow, vtkImageData aData) { vtkImageData volume = vtkImageData.New(); double isoValue = 1; volume.DeepCopy(aData); vtkImageThreshold image_threshold = vtkImageThreshold.New(); image_threshold.SetInputData(volume); image_threshold.ThresholdBetween(1000,20000); image_threshold.ReplaceInOn(); image_threshold.SetInValue(1); image_threshold.ReplaceOutOn(); image_threshold.SetOutValue(0); image_threshold.Update(); vtkMarchingCubes surface = vtkMarchingCubes.New(); surface.SetInputData(image_threshold.GetOutput()); surface.ComputeNormalsOn(); surface.ComputeScalarsOn(); surface.SetValue(0, isoValue); surface.Update(); vtkPolyData marched = vtkPolyData.New(); marched.DeepCopy(surface.GetOutput()); long pointcnt = marched.GetNumberOfPoints(); // Decimation to reduce the number of triangles vtkDecimatePro decimator = vtkDecimatePro.New(); decimator.SetInputData(marched); decimator.SetTargetReduction(0.5); decimator.SetPreserveTopology(1); decimator.Update(); //Smoothing vtkSmoothPolyDataFilter smoother = vtkSmoothPolyDataFilter.New(); smoother.SetInputData(decimator.GetOutput()); smoother.SetNumberOfIterations(5); smoother.SetFeatureAngle(60); smoother.SetRelaxationFactor(0.05); smoother.FeatureEdgeSmoothingOff(); //Select the largest region vtkPolyDataConnectivityFilter connectivityFilter = vtkPolyDataConnectivityFilter.New(); connectivityFilter.SetInputConnection(decimator.GetOutputPort()); connectivityFilter.ScalarConnectivityOff(); connectivityFilter.SetExtractionModeToLargestRegion(); connectivityFilter.Update(); // Create final polygon mesh vtkPolyData mesh = vtkPolyData.New(); mesh.ShallowCopy(connectivityFilter.GetOutput()); // Visualization vtkRenderer renderer = aRenderWindow.GetRenderers().GetFirstRenderer(); renderer.SetBackground(0.0, 0.0, 0.0); vtkPolyDataMapper mapper = vtkPolyDataMapper.New(); mapper.SetInputData(mesh); mapper.ScalarVisibilityOff(); vtkActor actor = vtkActor.New(); actor.SetMapper(mapper); renderer.AddActor(actor); vtkCamera camera = renderer.MakeCamera(); camera.SetPosition(-500.0, 245.5, 122.0); camera.SetFocalPoint(301.0, 245.5, 122.0); camera.SetViewAngle(30.0); camera.SetRoll(-90.0); renderer.SetActiveCamera(camera); aRenderWindow.Render(); vtkRenderWindowInteractor interactor = aRenderWindow.GetInteractor(); interactor.Start(); } ?2016-03-17?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?17? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: Re: Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series And I should add: if it is necessary to use a range (instead of just a lower threshold), then the pipeline can use vtkMarchingCubes twice: vtkSmartPointer cubes1 = vtkSmartPointer::New(); cubes1->SetInputData(imagedata); cubes1->SetValue(0, lowerThreshold); vtkSmartPointer cubes2 = vtkSmartPointer::New(); cubes2->SetInputData(imagedata); cubes2->SetValue(0, upperThreshold); vtkSmartPointer reverse = vtkSmartPointer::New(); reverse->SetInputConnection(cubes2->GetOutputPort()); vtkSmartPointer surface = vtkSmartPointer::New(); surface->SetInputConnection(cubes1->GetOutputPort()); surface->AddInputConnection(cubes2->GetOutputPort()); surface->Update(); On Thu, Mar 17, 2016 at 6:06 AM, David Gobbi wrote: Hi Liu Peng, For creating a model, it is common to allow the user to set just a lower threshold (rather than a range), and to use the lower threshold as the isovalue. If you send the code for the whole pipeline, that might help. - David On Wed, Mar 16, 2016 at 11:27 PM, Liu_tj wrote: Hi, David, If I don't use vtkImageThreshol, how to generate 3D model from the points whose grayscale is in some specific range? This range can be changed by the user. Thanks Liu Peng ?2016-03-17?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?17? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series On Wed, Mar 16, 2016 at 10:35 PM, Liu_tj wrote: Hi,David, If using vtkImageThreshold before vtkMarchingCubes is not a good option, what other better way do you have? The output of the reader should go directly into vtkMarchingCubes. Beside, for the isovalue, I try 2,3,4 and marched->GetNumberOfPoints() return 0, only isovalue is 1 and marched->GetNumberOfPoints() return a number greater than 0. I have no idea this is relating to the DICOM series or other problem. If you remove vtkImageThreshold, and put the output of the reader directly into vtkMarchingCubes, then you should be able to use an isovalue somewhere between 100 and 2000 and get a good result. Also, after vtkMarchingCubes, you can use vtkConnectivityFilter to clean up the polydata before you decimate it. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjlp at netease.com Thu Mar 17 21:32:13 2016 From: tjlp at netease.com (Liu_tj) Date: Fri, 18 Mar 2016 09:32:13 +0800 (CST) Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series In-Reply-To: References: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> <694f11c8.9.15382dbad62.Coremail.tjlp@netease.com> <7303b5c3.b.153830ab688.Coremail.tjlp@netease.com> Message-ID: <7ec8f17.3.1538759f610.Coremail.tjlp@netease.com> Hi, David, What usage of vtkReverseSense in your sample code? Thanks ?2016-03-17?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?17? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: Re: Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series And I should add: if it is necessary to use a range (instead of just a lower threshold), then the pipeline can use vtkMarchingCubes twice: vtkSmartPointer cubes1 = vtkSmartPointer::New(); cubes1->SetInputData(imagedata); cubes1->SetValue(0, lowerThreshold); vtkSmartPointer cubes2 = vtkSmartPointer::New(); cubes2->SetInputData(imagedata); cubes2->SetValue(0, upperThreshold); vtkSmartPointer reverse = vtkSmartPointer::New(); reverse->SetInputConnection(cubes2->GetOutputPort()); vtkSmartPointer surface = vtkSmartPointer::New(); surface->SetInputConnection(cubes1->GetOutputPort()); surface->AddInputConnection(cubes2->GetOutputPort()); surface->Update(); On Thu, Mar 17, 2016 at 6:06 AM, David Gobbi wrote: Hi Liu Peng, For creating a model, it is common to allow the user to set just a lower threshold (rather than a range), and to use the lower threshold as the isovalue. If you send the code for the whole pipeline, that might help. - David On Wed, Mar 16, 2016 at 11:27 PM, Liu_tj wrote: Hi, David, If I don't use vtkImageThreshol, how to generate 3D model from the points whose grayscale is in some specific range? This range can be changed by the user. Thanks Liu Peng ?2016-03-17?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?17? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series On Wed, Mar 16, 2016 at 10:35 PM, Liu_tj wrote: Hi,David, If using vtkImageThreshold before vtkMarchingCubes is not a good option, what other better way do you have? The output of the reader should go directly into vtkMarchingCubes. Beside, for the isovalue, I try 2,3,4 and marched->GetNumberOfPoints() return 0, only isovalue is 1 and marched->GetNumberOfPoints() return a number greater than 0. I have no idea this is relating to the DICOM series or other problem. If you remove vtkImageThreshold, and put the output of the reader directly into vtkMarchingCubes, then you should be able to use an isovalue somewhere between 100 and 2000 and get a good result. Also, after vtkMarchingCubes, you can use vtkConnectivityFilter to clean up the polydata before you decimate it. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Thu Mar 17 21:38:00 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 17 Mar 2016 19:38:00 -0600 Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series In-Reply-To: <35ec6f75.2.15387436d8c.Coremail.tjlp@netease.com> References: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> <694f11c8.9.15382dbad62.Coremail.tjlp@netease.com> <7303b5c3.b.153830ab688.Coremail.tjlp@netease.com> <35ec6f75.2.15387436d8c.Coremail.tjlp@netease.com> Message-ID: Hi Liu Peng, Now that I have seen your code, you should definitely remove vtkImageThreshold and set the vtkMarchingCubes isovalue to around 1000. I'm certain that vtkImageThreshold does nothing useful in this pipeline. For vtkReverseSense, see the documentation page for the class for an explanation of what it does. I wrote that example code because I thought you might need an upper and a lower threshold, but now that I have seen your code, I think you only need one threshold (just the lower threshold). So you can ignore the code that I sent. As for the camera, it is usually a good idea to point it at the center of the volume. I do not always like VTK's default camera position, so I when I write VTK code, I almost always set the camera position myself. - David On Thu, Mar 17, 2016 at 7:07 PM, Liu_tj wrote: > Hi, David, > > Below is my present C# code.You can see that I reset the camera position, > otherwise after rendering, the 3D model is not at the window center, I have > to pan it, any recommendation for the position issue also? > > private void Display(vtkRenderWindow aRenderWindow, vtkImageData > aData) > { > vtkImageData volume = vtkImageData.New(); > double isoValue = 1; > volume.DeepCopy(aData); > vtkImageThreshold image_threshold = vtkImageThreshold.New(); > image_threshold.SetInputData(volume); > image_threshold.ThresholdBetween(1000,20000); > image_threshold.ReplaceInOn(); > image_threshold.SetInValue(1); > image_threshold.ReplaceOutOn(); > image_threshold.SetOutValue(0); > image_threshold.Update(); > > vtkMarchingCubes surface = vtkMarchingCubes.New(); > surface.SetInputData(image_threshold.GetOutput()); > surface.ComputeNormalsOn(); > surface.ComputeScalarsOn(); > surface.SetValue(0, isoValue); > surface.Update(); > > vtkPolyData marched = vtkPolyData.New(); > marched.DeepCopy(surface.GetOutput()); > > long pointcnt = marched.GetNumberOfPoints(); > > // Decimation to reduce the number of triangles > vtkDecimatePro decimator = vtkDecimatePro.New(); > decimator.SetInputData(marched); > decimator.SetTargetReduction(0.5); > decimator.SetPreserveTopology(1); > decimator.Update(); > //Smoothing > vtkSmoothPolyDataFilter smoother = > vtkSmoothPolyDataFilter.New(); > smoother.SetInputData(decimator.GetOutput()); > smoother.SetNumberOfIterations(5); > smoother.SetFeatureAngle(60); > smoother.SetRelaxationFactor(0.05); > smoother.FeatureEdgeSmoothingOff(); > > //Select the largest region > vtkPolyDataConnectivityFilter connectivityFilter = > vtkPolyDataConnectivityFilter.New(); > > connectivityFilter.SetInputConnection(decimator.GetOutputPort()); > connectivityFilter.ScalarConnectivityOff(); > connectivityFilter.SetExtractionModeToLargestRegion(); > connectivityFilter.Update(); > > // Create final polygon mesh > vtkPolyData mesh = vtkPolyData.New(); > mesh.ShallowCopy(connectivityFilter.GetOutput()); > > // Visualization > vtkRenderer renderer = > aRenderWindow.GetRenderers().GetFirstRenderer(); > renderer.SetBackground(0.0, 0.0, 0.0); > > vtkPolyDataMapper mapper = vtkPolyDataMapper.New(); > mapper.SetInputData(mesh); > mapper.ScalarVisibilityOff(); > > vtkActor actor = vtkActor.New(); > actor.SetMapper(mapper); > renderer.AddActor(actor); > > vtkCamera camera = renderer.MakeCamera(); > camera.SetPosition(-500.0, 245.5, 122.0); > camera.SetFocalPoint(301.0, 245.5, 122.0); > camera.SetViewAngle(30.0); > camera.SetRoll(-90.0); > renderer.SetActiveCamera(camera); > > aRenderWindow.Render(); > > vtkRenderWindowInteractor interactor = > aRenderWindow.GetInteractor(); > interactor.Start(); > } > > > > ?2016-03-17?"David Gobbi" ??? > > -----????----- > *???:*"David Gobbi" > *????:*2016?03?17? ??? > *???:*"Liu_tj" > *??:*"vtkusers" > *??:*Re: Re: Re: [vtkusers] High memory cost of vtkDecimatePro for 3D > model generation from DICOM series > > > And I should add: if it is necessary to use a range (instead of just a > lower threshold), then the pipeline can use vtkMarchingCubes twice: > > vtkSmartPointer cubes1 = > vtkSmartPointer::New(); > cubes1->SetInputData(imagedata); > cubes1->SetValue(0, lowerThreshold); > > vtkSmartPointer cubes2 = > vtkSmartPointer::New(); > cubes2->SetInputData(imagedata); > cubes2->SetValue(0, upperThreshold); > > vtkSmartPointer reverse = > vtkSmartPointer::New(); > reverse->SetInputConnection(cubes2->GetOutputPort()); > > vtkSmartPointer surface = > vtkSmartPointer::New(); > surface->SetInputConnection(cubes1->GetOutputPort()); > surface->AddInputConnection(cubes2->GetOutputPort()); > surface->Update(); > > > On Thu, Mar 17, 2016 at 6:06 AM, David Gobbi > wrote: > >> Hi Liu Peng, >> >> For creating a model, it is common to allow the user to set just a lower >> threshold (rather than a range), and to use the lower threshold as the >> isovalue. If you send the code for the whole pipeline, that might help. >> >> - David >> >> On Wed, Mar 16, 2016 at 11:27 PM, Liu_tj wrote: >> >>> Hi, David, >>> >>> If I don't use vtkImageThreshol, how to generate 3D model from the >>> points whose grayscale is in some specific range? This range can be changed >>> by the user. >>> >>> Thanks >>> Liu Peng >>> >>> ?2016-03-17?"David Gobbi" ??? >>> >>> -----????----- >>> *???:*"David Gobbi" >>> *????:*2016?03?17? ??? >>> *???:*"Liu_tj" >>> *??:*"vtkusers" >>> *??:*Re: Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model >>> generation from DICOM series >>> >>> >>> On Wed, Mar 16, 2016 at 10:35 PM, Liu_tj wrote: >>> >>>> Hi,David, >>>> >>>> If using vtkImageThreshold before vtkMarchingCubes is not a good >>>> option, what other better way do you have? >>>> >>> >>> The output of the reader should go directly into vtkMarchingCubes. >>> >>> >>>> Beside, for the isovalue, I try 2,3,4 and marched->GetNumberOfPoints() >>>> return 0, only isovalue is 1 and marched->GetNumberOfPoints() return a >>>> number greater than 0. I have no idea this is relating to the DICOM series >>>> or other problem. >>>> >>> >>> If you remove vtkImageThreshold, and put the output of the reader >>> directly into vtkMarchingCubes, then you should be able to use an isovalue >>> somewhere between 100 and 2000 and get a good result. >>> >>> Also, after vtkMarchingCubes, you can use vtkConnectivityFilter to clean >>> up the polydata before you decimate it. >>> >>> - David >>> >>> >>> >>> >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjlp at netease.com Thu Mar 17 21:54:25 2016 From: tjlp at netease.com (Liu_tj) Date: Fri, 18 Mar 2016 09:54:25 +0800 (CST) Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series In-Reply-To: References: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> <694f11c8.9.15382dbad62.Coremail.tjlp@netease.com> <7303b5c3.b.153830ab688.Coremail.tjlp@netease.com> <35ec6f75.2.15387436d8c.Coremail.tjlp@netease.com> Message-ID: <2c3b748d.7.153876e48b6.Coremail.tjlp@netease.com> Hi, David, If the user sets a upper value, what should we do? Thanks Liu Peng ?2016-03-18?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?18? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: Re: Re: Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series Hi Liu Peng, Now that I have seen your code, you should definitely remove vtkImageThreshold and set the vtkMarchingCubes isovalue to around 1000. I'm certain that vtkImageThreshold does nothing useful in this pipeline. For vtkReverseSense, see the documentation page for the class for an explanation of what it does. I wrote that example code because I thought you might need an upper and a lower threshold, but now that I have seen your code, I think you only need one threshold (just the lower threshold). So you can ignore the code that I sent. As for the camera, it is usually a good idea to point it at the center of the volume. I do not always like VTK's default camera position, so I when I write VTK code, I almost always set the camera position myself. - David On Thu, Mar 17, 2016 at 7:07 PM, Liu_tj wrote: Hi, David, Below is my present C# code.You can see that I reset the camera position, otherwise after rendering, the 3D model is not at the window center, I have to pan it, any recommendation for the position issue also? private void Display(vtkRenderWindow aRenderWindow, vtkImageData aData) { vtkImageData volume = vtkImageData.New(); double isoValue = 1; volume.DeepCopy(aData); vtkImageThreshold image_threshold = vtkImageThreshold.New(); image_threshold.SetInputData(volume); image_threshold.ThresholdBetween(1000,20000); image_threshold.ReplaceInOn(); image_threshold.SetInValue(1); image_threshold.ReplaceOutOn(); image_threshold.SetOutValue(0); image_threshold.Update(); vtkMarchingCubes surface = vtkMarchingCubes.New(); surface.SetInputData(image_threshold.GetOutput()); surface.ComputeNormalsOn(); surface.ComputeScalarsOn(); surface.SetValue(0, isoValue); surface.Update(); vtkPolyData marched = vtkPolyData.New(); marched.DeepCopy(surface.GetOutput()); long pointcnt = marched.GetNumberOfPoints(); // Decimation to reduce the number of triangles vtkDecimatePro decimator = vtkDecimatePro.New(); decimator.SetInputData(marched); decimator.SetTargetReduction(0.5); decimator.SetPreserveTopology(1); decimator.Update(); //Smoothing vtkSmoothPolyDataFilter smoother = vtkSmoothPolyDataFilter.New(); smoother.SetInputData(decimator.GetOutput()); smoother.SetNumberOfIterations(5); smoother.SetFeatureAngle(60); smoother.SetRelaxationFactor(0.05); smoother.FeatureEdgeSmoothingOff(); //Select the largest region vtkPolyDataConnectivityFilter connectivityFilter = vtkPolyDataConnectivityFilter.New(); connectivityFilter.SetInputConnection(decimator.GetOutputPort()); connectivityFilter.ScalarConnectivityOff(); connectivityFilter.SetExtractionModeToLargestRegion(); connectivityFilter.Update(); // Create final polygon mesh vtkPolyData mesh = vtkPolyData.New(); mesh.ShallowCopy(connectivityFilter.GetOutput()); // Visualization vtkRenderer renderer = aRenderWindow.GetRenderers().GetFirstRenderer(); renderer.SetBackground(0.0, 0.0, 0.0); vtkPolyDataMapper mapper = vtkPolyDataMapper.New(); mapper.SetInputData(mesh); mapper.ScalarVisibilityOff(); vtkActor actor = vtkActor.New(); actor.SetMapper(mapper); renderer.AddActor(actor); vtkCamera camera = renderer.MakeCamera(); camera.SetPosition(-500.0, 245.5, 122.0); camera.SetFocalPoint(301.0, 245.5, 122.0); camera.SetViewAngle(30.0); camera.SetRoll(-90.0); renderer.SetActiveCamera(camera); aRenderWindow.Render(); vtkRenderWindowInteractor interactor = aRenderWindow.GetInteractor(); interactor.Start(); } ?2016-03-17?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?17? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: Re: Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series And I should add: if it is necessary to use a range (instead of just a lower threshold), then the pipeline can use vtkMarchingCubes twice: vtkSmartPointer cubes1 = vtkSmartPointer::New(); cubes1->SetInputData(imagedata); cubes1->SetValue(0, lowerThreshold); vtkSmartPointer cubes2 = vtkSmartPointer::New(); cubes2->SetInputData(imagedata); cubes2->SetValue(0, upperThreshold); vtkSmartPointer reverse = vtkSmartPointer::New(); reverse->SetInputConnection(cubes2->GetOutputPort()); vtkSmartPointer surface = vtkSmartPointer::New(); surface->SetInputConnection(cubes1->GetOutputPort()); surface->AddInputConnection(cubes2->GetOutputPort()); surface->Update(); On Thu, Mar 17, 2016 at 6:06 AM, David Gobbi wrote: Hi Liu Peng, For creating a model, it is common to allow the user to set just a lower threshold (rather than a range), and to use the lower threshold as the isovalue. If you send the code for the whole pipeline, that might help. - David On Wed, Mar 16, 2016 at 11:27 PM, Liu_tj wrote: Hi, David, If I don't use vtkImageThreshol, how to generate 3D model from the points whose grayscale is in some specific range? This range can be changed by the user. Thanks Liu Peng ?2016-03-17?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?17? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series On Wed, Mar 16, 2016 at 10:35 PM, Liu_tj wrote: Hi,David, If using vtkImageThreshold before vtkMarchingCubes is not a good option, what other better way do you have? The output of the reader should go directly into vtkMarchingCubes. Beside, for the isovalue, I try 2,3,4 and marched->GetNumberOfPoints() return 0, only isovalue is 1 and marched->GetNumberOfPoints() return a number greater than 0. I have no idea this is relating to the DICOM series or other problem. If you remove vtkImageThreshold, and put the output of the reader directly into vtkMarchingCubes, then you should be able to use an isovalue somewhere between 100 and 2000 and get a good result. Also, after vtkMarchingCubes, you can use vtkConnectivityFilter to clean up the polydata before you decimate it. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Thu Mar 17 22:01:52 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 17 Mar 2016 20:01:52 -0600 Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series In-Reply-To: <2c3b748d.7.153876e48b6.Coremail.tjlp@netease.com> References: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> <694f11c8.9.15382dbad62.Coremail.tjlp@netease.com> <7303b5c3.b.153830ab688.Coremail.tjlp@netease.com> <35ec6f75.2.15387436d8c.Coremail.tjlp@netease.com> <2c3b748d.7.153876e48b6.Coremail.tjlp@netease.com> Message-ID: You only need one threshold to create a model from an image. Why do you let the user set two thresholds? On Thu, Mar 17, 2016 at 7:54 PM, Liu_tj wrote: > Hi, David, > > If the user sets a upper value, what should we do? > > Thanks > Liu Peng > > > > ?2016-03-18?"David Gobbi" ??? > > -----????----- > *???:*"David Gobbi" > *????:*2016?03?18? ??? > *???:*"Liu_tj" > *??:*"vtkusers" > *??:*Re: Re: Re: Re: [vtkusers] High memory cost of vtkDecimatePro for 3D > model generation from DICOM series > > > Hi Liu Peng, > > Now that I have seen your code, you should definitely remove > vtkImageThreshold and set the vtkMarchingCubes isovalue to around 1000. > I'm certain that vtkImageThreshold does nothing useful in this pipeline. > > For vtkReverseSense, see the documentation page for the class for an > explanation of what it does. I wrote that example code because I thought > you might need an upper and a lower threshold, but now that I have seen > your code, I think you only need one threshold (just the lower threshold). > So you can ignore the code that I sent. > > As for the camera, it is usually a good idea to point it at the center of > the volume. I do not always like VTK's default camera position, so I when > I write VTK code, I almost always set the camera position myself. > > - David > > > > On Thu, Mar 17, 2016 at 7:07 PM, Liu_tj wrote: > >> Hi, David, >> >> Below is my present C# code.You can see that I reset the camera position, >> otherwise after rendering, the 3D model is not at the window center, I have >> to pan it, any recommendation for the position issue also? >> >> private void Display(vtkRenderWindow aRenderWindow, vtkImageData >> aData) >> { >> vtkImageData volume = vtkImageData.New(); >> double isoValue = 1; >> volume.DeepCopy(aData); >> vtkImageThreshold image_threshold = vtkImageThreshold.New(); >> image_threshold.SetInputData(volume); >> image_threshold.ThresholdBetween(1000,20000); >> image_threshold.ReplaceInOn(); >> image_threshold.SetInValue(1); >> image_threshold.ReplaceOutOn(); >> image_threshold.SetOutValue(0); >> image_threshold.Update(); >> >> vtkMarchingCubes surface = vtkMarchingCubes.New(); >> surface.SetInputData(image_threshold.GetOutput()); >> surface.ComputeNormalsOn(); >> surface.ComputeScalarsOn(); >> surface.SetValue(0, isoValue); >> surface.Update(); >> >> vtkPolyData marched = vtkPolyData.New(); >> marched.DeepCopy(surface.GetOutput()); >> >> long pointcnt = marched.GetNumberOfPoints(); >> >> // Decimation to reduce the number of triangles >> vtkDecimatePro decimator = vtkDecimatePro.New(); >> decimator.SetInputData(marched); >> decimator.SetTargetReduction(0.5); >> decimator.SetPreserveTopology(1); >> decimator.Update(); >> //Smoothing >> vtkSmoothPolyDataFilter smoother = >> vtkSmoothPolyDataFilter.New(); >> smoother.SetInputData(decimator.GetOutput()); >> smoother.SetNumberOfIterations(5); >> smoother.SetFeatureAngle(60); >> smoother.SetRelaxationFactor(0.05); >> smoother.FeatureEdgeSmoothingOff(); >> >> //Select the largest region >> vtkPolyDataConnectivityFilter connectivityFilter = >> vtkPolyDataConnectivityFilter.New(); >> >> connectivityFilter.SetInputConnection(decimator.GetOutputPort()); >> connectivityFilter.ScalarConnectivityOff(); >> connectivityFilter.SetExtractionModeToLargestRegion(); >> connectivityFilter.Update(); >> >> // Create final polygon mesh >> vtkPolyData mesh = vtkPolyData.New(); >> mesh.ShallowCopy(connectivityFilter.GetOutput()); >> >> // Visualization >> vtkRenderer renderer = >> aRenderWindow.GetRenderers().GetFirstRenderer(); >> renderer.SetBackground(0.0, 0.0, 0.0); >> >> vtkPolyDataMapper mapper = vtkPolyDataMapper.New(); >> mapper.SetInputData(mesh); >> mapper.ScalarVisibilityOff(); >> >> vtkActor actor = vtkActor.New(); >> actor.SetMapper(mapper); >> renderer.AddActor(actor); >> >> vtkCamera camera = renderer.MakeCamera(); >> camera.SetPosition(-500.0, 245.5, 122.0); >> camera.SetFocalPoint(301.0, 245.5, 122.0); >> camera.SetViewAngle(30.0); >> camera.SetRoll(-90.0); >> renderer.SetActiveCamera(camera); >> >> aRenderWindow.Render(); >> >> vtkRenderWindowInteractor interactor = >> aRenderWindow.GetInteractor(); >> interactor.Start(); >> } >> >> >> >> ?2016-03-17?"David Gobbi" ??? >> >> -----????----- >> *???:*"David Gobbi" >> *????:*2016?03?17? ??? >> *???:*"Liu_tj" >> *??:*"vtkusers" >> *??:*Re: Re: Re: [vtkusers] High memory cost of vtkDecimatePro for 3D >> model generation from DICOM series >> >> >> And I should add: if it is necessary to use a range (instead of just a >> lower threshold), then the pipeline can use vtkMarchingCubes twice: >> >> vtkSmartPointer cubes1 = >> vtkSmartPointer::New(); >> cubes1->SetInputData(imagedata); >> cubes1->SetValue(0, lowerThreshold); >> >> vtkSmartPointer cubes2 = >> vtkSmartPointer::New(); >> cubes2->SetInputData(imagedata); >> cubes2->SetValue(0, upperThreshold); >> >> vtkSmartPointer reverse = >> vtkSmartPointer::New(); >> reverse->SetInputConnection(cubes2->GetOutputPort()); >> >> vtkSmartPointer surface = >> vtkSmartPointer::New(); >> surface->SetInputConnection(cubes1->GetOutputPort()); >> surface->AddInputConnection(cubes2->GetOutputPort()); >> surface->Update(); >> >> >> On Thu, Mar 17, 2016 at 6:06 AM, David Gobbi >> wrote: >> >>> Hi Liu Peng, >>> >>> For creating a model, it is common to allow the user to set just a lower >>> threshold (rather than a range), and to use the lower threshold as the >>> isovalue. If you send the code for the whole pipeline, that might help. >>> >>> - David >>> >>> On Wed, Mar 16, 2016 at 11:27 PM, Liu_tj wrote: >>> >>>> Hi, David, >>>> >>>> If I don't use vtkImageThreshol, how to generate 3D model from the >>>> points whose grayscale is in some specific range? This range can be changed >>>> by the user. >>>> >>>> Thanks >>>> Liu Peng >>>> >>>> ?2016-03-17?"David Gobbi" ??? >>>> >>>> -----????----- >>>> *???:*"David Gobbi" >>>> *????:*2016?03?17? ??? >>>> *???:*"Liu_tj" >>>> *??:*"vtkusers" >>>> *??:*Re: Re: [vtkusers] High memory cost of vtkDecimatePro for 3D >>>> model generation from DICOM series >>>> >>>> >>>> On Wed, Mar 16, 2016 at 10:35 PM, Liu_tj wrote: >>>> >>>>> Hi,David, >>>>> >>>>> If using vtkImageThreshold before vtkMarchingCubes is not a good >>>>> option, what other better way do you have? >>>>> >>>> >>>> The output of the reader should go directly into vtkMarchingCubes. >>>> >>>> >>>>> Beside, for the isovalue, I try 2,3,4 and marched->GetNumberOfPoints() >>>>> return 0, only isovalue is 1 and marched->GetNumberOfPoints() return a >>>>> number greater than 0. I have no idea this is relating to the DICOM series >>>>> or other problem. >>>>> >>>> >>>> If you remove vtkImageThreshold, and put the output of the reader >>>> directly into vtkMarchingCubes, then you should be able to use an isovalue >>>> somewhere between 100 and 2000 and get a good result. >>>> >>>> Also, after vtkMarchingCubes, you can use vtkConnectivityFilter to >>>> clean up the polydata before you decimate it. >>>> >>>> - David >>>> >>>> >>>> >>>> >>>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjlp at netease.com Thu Mar 17 22:09:29 2016 From: tjlp at netease.com (Liu_tj) Date: Fri, 18 Mar 2016 10:09:29 +0800 (CST) Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series In-Reply-To: References: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> <694f11c8.9.15382dbad62.Coremail.tjlp@netease.com> <7303b5c3.b.153830ab688.Coremail.tjlp@netease.com> <35ec6f75.2.15387436d8c.Coremail.tjlp@netease.com> <2c3b748d.7.153876e48b6.Coremail.tjlp@netease.com> Message-ID: Hi, David, The user scenario is that we allow the user to set segment threshold which is a grayscale range. So at the 2D DICOM view, the pixels which fall in this range will be shown by special color (I implement it with vtkLookupTableand vtkImageMapToColors); then the user can preview the 3D model generated by the points in this grayscale range. Thanks ?2016-03-18?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?18? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: Re: Re: Re: Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series You only need one threshold to create a model from an image. Why do you let the user set two thresholds? On Thu, Mar 17, 2016 at 7:54 PM, Liu_tj wrote: Hi, David, If the user sets a upper value, what should we do? Thanks Liu Peng ?2016-03-18?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?18? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: Re: Re: Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series Hi Liu Peng, Now that I have seen your code, you should definitely remove vtkImageThreshold and set the vtkMarchingCubes isovalue to around 1000. I'm certain that vtkImageThreshold does nothing useful in this pipeline. For vtkReverseSense, see the documentation page for the class for an explanation of what it does. I wrote that example code because I thought you might need an upper and a lower threshold, but now that I have seen your code, I think you only need one threshold (just the lower threshold). So you can ignore the code that I sent. As for the camera, it is usually a good idea to point it at the center of the volume. I do not always like VTK's default camera position, so I when I write VTK code, I almost always set the camera position myself. - David On Thu, Mar 17, 2016 at 7:07 PM, Liu_tj wrote: Hi, David, Below is my present C# code.You can see that I reset the camera position, otherwise after rendering, the 3D model is not at the window center, I have to pan it, any recommendation for the position issue also? private void Display(vtkRenderWindow aRenderWindow, vtkImageData aData) { vtkImageData volume = vtkImageData.New(); double isoValue = 1; volume.DeepCopy(aData); vtkImageThreshold image_threshold = vtkImageThreshold.New(); image_threshold.SetInputData(volume); image_threshold.ThresholdBetween(1000,20000); image_threshold.ReplaceInOn(); image_threshold.SetInValue(1); image_threshold.ReplaceOutOn(); image_threshold.SetOutValue(0); image_threshold.Update(); vtkMarchingCubes surface = vtkMarchingCubes.New(); surface.SetInputData(image_threshold.GetOutput()); surface.ComputeNormalsOn(); surface.ComputeScalarsOn(); surface.SetValue(0, isoValue); surface.Update(); vtkPolyData marched = vtkPolyData.New(); marched.DeepCopy(surface.GetOutput()); long pointcnt = marched.GetNumberOfPoints(); // Decimation to reduce the number of triangles vtkDecimatePro decimator = vtkDecimatePro.New(); decimator.SetInputData(marched); decimator.SetTargetReduction(0.5); decimator.SetPreserveTopology(1); decimator.Update(); //Smoothing vtkSmoothPolyDataFilter smoother = vtkSmoothPolyDataFilter.New(); smoother.SetInputData(decimator.GetOutput()); smoother.SetNumberOfIterations(5); smoother.SetFeatureAngle(60); smoother.SetRelaxationFactor(0.05); smoother.FeatureEdgeSmoothingOff(); //Select the largest region vtkPolyDataConnectivityFilter connectivityFilter = vtkPolyDataConnectivityFilter.New(); connectivityFilter.SetInputConnection(decimator.GetOutputPort()); connectivityFilter.ScalarConnectivityOff(); connectivityFilter.SetExtractionModeToLargestRegion(); connectivityFilter.Update(); // Create final polygon mesh vtkPolyData mesh = vtkPolyData.New(); mesh.ShallowCopy(connectivityFilter.GetOutput()); // Visualization vtkRenderer renderer = aRenderWindow.GetRenderers().GetFirstRenderer(); renderer.SetBackground(0.0, 0.0, 0.0); vtkPolyDataMapper mapper = vtkPolyDataMapper.New(); mapper.SetInputData(mesh); mapper.ScalarVisibilityOff(); vtkActor actor = vtkActor.New(); actor.SetMapper(mapper); renderer.AddActor(actor); vtkCamera camera = renderer.MakeCamera(); camera.SetPosition(-500.0, 245.5, 122.0); camera.SetFocalPoint(301.0, 245.5, 122.0); camera.SetViewAngle(30.0); camera.SetRoll(-90.0); renderer.SetActiveCamera(camera); aRenderWindow.Render(); vtkRenderWindowInteractor interactor = aRenderWindow.GetInteractor(); interactor.Start(); } ?2016-03-17?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?17? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: Re: Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series And I should add: if it is necessary to use a range (instead of just a lower threshold), then the pipeline can use vtkMarchingCubes twice: vtkSmartPointer cubes1 = vtkSmartPointer::New(); cubes1->SetInputData(imagedata); cubes1->SetValue(0, lowerThreshold); vtkSmartPointer cubes2 = vtkSmartPointer::New(); cubes2->SetInputData(imagedata); cubes2->SetValue(0, upperThreshold); vtkSmartPointer reverse = vtkSmartPointer::New(); reverse->SetInputConnection(cubes2->GetOutputPort()); vtkSmartPointer surface = vtkSmartPointer::New(); surface->SetInputConnection(cubes1->GetOutputPort()); surface->AddInputConnection(cubes2->GetOutputPort()); surface->Update(); On Thu, Mar 17, 2016 at 6:06 AM, David Gobbi wrote: Hi Liu Peng, For creating a model, it is common to allow the user to set just a lower threshold (rather than a range), and to use the lower threshold as the isovalue. If you send the code for the whole pipeline, that might help. - David On Wed, Mar 16, 2016 at 11:27 PM, Liu_tj wrote: Hi, David, If I don't use vtkImageThreshol, how to generate 3D model from the points whose grayscale is in some specific range? This range can be changed by the user. Thanks Liu Peng ?2016-03-17?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?17? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series On Wed, Mar 16, 2016 at 10:35 PM, Liu_tj wrote: Hi,David, If using vtkImageThreshold before vtkMarchingCubes is not a good option, what other better way do you have? The output of the reader should go directly into vtkMarchingCubes. Beside, for the isovalue, I try 2,3,4 and marched->GetNumberOfPoints() return 0, only isovalue is 1 and marched->GetNumberOfPoints() return a number greater than 0. I have no idea this is relating to the DICOM series or other problem. If you remove vtkImageThreshold, and put the output of the reader directly into vtkMarchingCubes, then you should be able to use an isovalue somewhere between 100 and 2000 and get a good result. Also, after vtkMarchingCubes, you can use vtkConnectivityFilter to clean up the polydata before you decimate it. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Thu Mar 17 22:19:11 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 17 Mar 2016 20:19:11 -0600 Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series In-Reply-To: References: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> <694f11c8.9.15382dbad62.Coremail.tjlp@netease.com> <7303b5c3.b.153830ab688.Coremail.tjlp@netease.com> <35ec6f75.2.15387436d8c.Coremail.tjlp@netease.com> <2c3b748d.7.153876e48b6.Coremail.tjlp@netease.com> Message-ID: You can segment an image with just one threshold (i.e. just the lower threshold). It is not necessary to set a range. But, regardless, vtkMarchingCubes is designed to take a greyscale image as input, not a binary image. - David On Thu, Mar 17, 2016 at 8:09 PM, Liu_tj wrote: > Hi, David, > > The user scenario is that we allow the user to set segment threshold which > is a grayscale range. So at the 2D DICOM view, the pixels which fall in > this range will be shown by special color (I implement it with > vtkLookupTableand vtkImageMapToColors); then the user can preview the 3D > model generated by the points in this grayscale range. > > Thanks > > > ?2016-03-18?"David Gobbi" ??? > > -----????----- > *???:*"David Gobbi" > *????:*2016?03?18? ??? > *???:*"Liu_tj" > *??:*"vtkusers" > *??:*Re: Re: Re: Re: Re: [vtkusers] High memory cost of vtkDecimatePro > for 3D model generation from DICOM series > > > You only need one threshold to create a model from an image. > Why do you let the user set two thresholds? > > > On Thu, Mar 17, 2016 at 7:54 PM, Liu_tj wrote: > >> Hi, David, >> >> If the user sets a upper value, what should we do? >> >> Thanks >> Liu Peng >> >> >> >> ?2016-03-18?"David Gobbi" ??? >> >> -----????----- >> *???:*"David Gobbi" >> *????:*2016?03?18? ??? >> *???:*"Liu_tj" >> *??:*"vtkusers" >> *??:*Re: Re: Re: Re: [vtkusers] High memory cost of vtkDecimatePro for >> 3D model generation from DICOM series >> >> >> Hi Liu Peng, >> >> Now that I have seen your code, you should definitely remove >> vtkImageThreshold and set the vtkMarchingCubes isovalue to around 1000. >> I'm certain that vtkImageThreshold does nothing useful in this pipeline. >> >> For vtkReverseSense, see the documentation page for the class for an >> explanation of what it does. I wrote that example code because I thought >> you might need an upper and a lower threshold, but now that I have seen >> your code, I think you only need one threshold (just the lower threshold). >> So you can ignore the code that I sent. >> >> As for the camera, it is usually a good idea to point it at the center of >> the volume. I do not always like VTK's default camera position, so I when >> I write VTK code, I almost always set the camera position myself. >> >> - David >> >> >> >> On Thu, Mar 17, 2016 at 7:07 PM, Liu_tj wrote: >> >>> Hi, David, >>> >>> Below is my present C# code.You can see that I reset the camera >>> position, otherwise after rendering, the 3D model is not at the window >>> center, I have to pan it, any recommendation for the position issue also? >>> >>> private void Display(vtkRenderWindow aRenderWindow, vtkImageData >>> aData) >>> { >>> vtkImageData volume = vtkImageData.New(); >>> double isoValue = 1; >>> volume.DeepCopy(aData); >>> vtkImageThreshold image_threshold = vtkImageThreshold.New(); >>> image_threshold.SetInputData(volume); >>> image_threshold.ThresholdBetween(1000,20000); >>> image_threshold.ReplaceInOn(); >>> image_threshold.SetInValue(1); >>> image_threshold.ReplaceOutOn(); >>> image_threshold.SetOutValue(0); >>> image_threshold.Update(); >>> >>> vtkMarchingCubes surface = vtkMarchingCubes.New(); >>> surface.SetInputData(image_threshold.GetOutput()); >>> surface.ComputeNormalsOn(); >>> surface.ComputeScalarsOn(); >>> surface.SetValue(0, isoValue); >>> surface.Update(); >>> >>> vtkPolyData marched = vtkPolyData.New(); >>> marched.DeepCopy(surface.GetOutput()); >>> >>> long pointcnt = marched.GetNumberOfPoints(); >>> >>> // Decimation to reduce the number of triangles >>> vtkDecimatePro decimator = vtkDecimatePro.New(); >>> decimator.SetInputData(marched); >>> decimator.SetTargetReduction(0.5); >>> decimator.SetPreserveTopology(1); >>> decimator.Update(); >>> //Smoothing >>> vtkSmoothPolyDataFilter smoother = >>> vtkSmoothPolyDataFilter.New(); >>> smoother.SetInputData(decimator.GetOutput()); >>> smoother.SetNumberOfIterations(5); >>> smoother.SetFeatureAngle(60); >>> smoother.SetRelaxationFactor(0.05); >>> smoother.FeatureEdgeSmoothingOff(); >>> >>> //Select the largest region >>> vtkPolyDataConnectivityFilter connectivityFilter = >>> vtkPolyDataConnectivityFilter.New(); >>> >>> connectivityFilter.SetInputConnection(decimator.GetOutputPort()); >>> connectivityFilter.ScalarConnectivityOff(); >>> connectivityFilter.SetExtractionModeToLargestRegion(); >>> connectivityFilter.Update(); >>> >>> // Create final polygon mesh >>> vtkPolyData mesh = vtkPolyData.New(); >>> mesh.ShallowCopy(connectivityFilter.GetOutput()); >>> >>> // Visualization >>> vtkRenderer renderer = >>> aRenderWindow.GetRenderers().GetFirstRenderer(); >>> renderer.SetBackground(0.0, 0.0, 0.0); >>> >>> vtkPolyDataMapper mapper = vtkPolyDataMapper.New(); >>> mapper.SetInputData(mesh); >>> mapper.ScalarVisibilityOff(); >>> >>> vtkActor actor = vtkActor.New(); >>> actor.SetMapper(mapper); >>> renderer.AddActor(actor); >>> >>> vtkCamera camera = renderer.MakeCamera(); >>> camera.SetPosition(-500.0, 245.5, 122.0); >>> camera.SetFocalPoint(301.0, 245.5, 122.0); >>> camera.SetViewAngle(30.0); >>> camera.SetRoll(-90.0); >>> renderer.SetActiveCamera(camera); >>> >>> aRenderWindow.Render(); >>> >>> vtkRenderWindowInteractor interactor = >>> aRenderWindow.GetInteractor(); >>> interactor.Start(); >>> } >>> >>> >>> >>> ?2016-03-17?"David Gobbi" ??? >>> >>> -----????----- >>> *???:*"David Gobbi" >>> *????:*2016?03?17? ??? >>> *???:*"Liu_tj" >>> *??:*"vtkusers" >>> *??:*Re: Re: Re: [vtkusers] High memory cost of vtkDecimatePro for 3D >>> model generation from DICOM series >>> >>> >>> And I should add: if it is necessary to use a range (instead of just a >>> lower threshold), then the pipeline can use vtkMarchingCubes twice: >>> >>> vtkSmartPointer cubes1 = >>> vtkSmartPointer::New(); >>> cubes1->SetInputData(imagedata); >>> cubes1->SetValue(0, lowerThreshold); >>> >>> vtkSmartPointer cubes2 = >>> vtkSmartPointer::New(); >>> cubes2->SetInputData(imagedata); >>> cubes2->SetValue(0, upperThreshold); >>> >>> vtkSmartPointer reverse = >>> vtkSmartPointer::New(); >>> reverse->SetInputConnection(cubes2->GetOutputPort()); >>> >>> vtkSmartPointer surface = >>> vtkSmartPointer::New(); >>> surface->SetInputConnection(cubes1->GetOutputPort()); >>> surface->AddInputConnection(cubes2->GetOutputPort()); >>> surface->Update(); >>> >>> >>> On Thu, Mar 17, 2016 at 6:06 AM, David Gobbi >>> wrote: >>> >>>> Hi Liu Peng, >>>> >>>> For creating a model, it is common to allow the user to set just a >>>> lower threshold (rather than a range), and to use the lower threshold as >>>> the isovalue. If you send the code for the whole pipeline, that might help. >>>> >>>> - David >>>> >>>> On Wed, Mar 16, 2016 at 11:27 PM, Liu_tj wrote: >>>> >>>>> Hi, David, >>>>> >>>>> If I don't use vtkImageThreshol, how to generate 3D model from the >>>>> points whose grayscale is in some specific range? This range can be changed >>>>> by the user. >>>>> >>>>> Thanks >>>>> Liu Peng >>>>> >>>>> ?2016-03-17?"David Gobbi" ??? >>>>> >>>>> -----????----- >>>>> *???:*"David Gobbi" >>>>> *????:*2016?03?17? ??? >>>>> *???:*"Liu_tj" >>>>> *??:*"vtkusers" >>>>> *??:*Re: Re: [vtkusers] High memory cost of vtkDecimatePro for 3D >>>>> model generation from DICOM series >>>>> >>>>> >>>>> On Wed, Mar 16, 2016 at 10:35 PM, Liu_tj wrote: >>>>> >>>>>> Hi,David, >>>>>> >>>>>> If using vtkImageThreshold before vtkMarchingCubes is not a good >>>>>> option, what other better way do you have? >>>>>> >>>>> >>>>> The output of the reader should go directly into vtkMarchingCubes. >>>>> >>>>> >>>>>> Beside, for the isovalue, I try 2,3,4 and >>>>>> marched->GetNumberOfPoints() return 0, only isovalue is 1 and >>>>>> marched->GetNumberOfPoints() return a number greater than 0. I have no idea >>>>>> this is relating to the DICOM series or other problem. >>>>>> >>>>> >>>>> If you remove vtkImageThreshold, and put the output of the reader >>>>> directly into vtkMarchingCubes, then you should be able to use an isovalue >>>>> somewhere between 100 and 2000 and get a good result. >>>>> >>>>> Also, after vtkMarchingCubes, you can use vtkConnectivityFilter to >>>>> clean up the polydata before you decimate it. >>>>> >>>>> - David >>>>> >>>>> >>>>> >>>>> >>>>> >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjlp at netease.com Thu Mar 17 22:57:40 2016 From: tjlp at netease.com (Liu_tj) Date: Fri, 18 Mar 2016 10:57:40 +0800 (CST) Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series In-Reply-To: References: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> <694f11c8.9.15382dbad62.Coremail.tjlp@netease.com> <7303b5c3.b.153830ab688.Coremail.tjlp@netease.com> <35ec6f75.2.15387436d8c.Coremail.tjlp@netease.com> <2c3b748d.7.153876e48b6.Coremail.tjlp@netease.com> Message-ID: <2357ad85.b.15387a8316a.Coremail.tjlp@netease.com> I try it. And the generated Volumes are almost the same comparing only set isovalue to 1000 and set isovalue twice with 1000 and 2000. ?2016-03-18?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?18? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: Re: Re: Re: Re: Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series You can segment an image with just one threshold (i.e. just the lower threshold). It is not necessary to set a range. But, regardless, vtkMarchingCubes is designed to take a greyscale image as input, not a binary image. - David On Thu, Mar 17, 2016 at 8:09 PM, Liu_tj wrote: Hi, David, The user scenario is that we allow the user to set segment threshold which is a grayscale range. So at the 2D DICOM view, the pixels which fall in this range will be shown by special color (I implement it with vtkLookupTableand vtkImageMapToColors); then the user can preview the 3D model generated by the points in this grayscale range. Thanks ?2016-03-18?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?18? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: Re: Re: Re: Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series You only need one threshold to create a model from an image. Why do you let the user set two thresholds? On Thu, Mar 17, 2016 at 7:54 PM, Liu_tj wrote: Hi, David, If the user sets a upper value, what should we do? Thanks Liu Peng ?2016-03-18?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?18? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: Re: Re: Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series Hi Liu Peng, Now that I have seen your code, you should definitely remove vtkImageThreshold and set the vtkMarchingCubes isovalue to around 1000. I'm certain that vtkImageThreshold does nothing useful in this pipeline. For vtkReverseSense, see the documentation page for the class for an explanation of what it does. I wrote that example code because I thought you might need an upper and a lower threshold, but now that I have seen your code, I think you only need one threshold (just the lower threshold). So you can ignore the code that I sent. As for the camera, it is usually a good idea to point it at the center of the volume. I do not always like VTK's default camera position, so I when I write VTK code, I almost always set the camera position myself. - David On Thu, Mar 17, 2016 at 7:07 PM, Liu_tj wrote: Hi, David, Below is my present C# code.You can see that I reset the camera position, otherwise after rendering, the 3D model is not at the window center, I have to pan it, any recommendation for the position issue also? private void Display(vtkRenderWindow aRenderWindow, vtkImageData aData) { vtkImageData volume = vtkImageData.New(); double isoValue = 1; volume.DeepCopy(aData); vtkImageThreshold image_threshold = vtkImageThreshold.New(); image_threshold.SetInputData(volume); image_threshold.ThresholdBetween(1000,20000); image_threshold.ReplaceInOn(); image_threshold.SetInValue(1); image_threshold.ReplaceOutOn(); image_threshold.SetOutValue(0); image_threshold.Update(); vtkMarchingCubes surface = vtkMarchingCubes.New(); surface.SetInputData(image_threshold.GetOutput()); surface.ComputeNormalsOn(); surface.ComputeScalarsOn(); surface.SetValue(0, isoValue); surface.Update(); vtkPolyData marched = vtkPolyData.New(); marched.DeepCopy(surface.GetOutput()); long pointcnt = marched.GetNumberOfPoints(); // Decimation to reduce the number of triangles vtkDecimatePro decimator = vtkDecimatePro.New(); decimator.SetInputData(marched); decimator.SetTargetReduction(0.5); decimator.SetPreserveTopology(1); decimator.Update(); //Smoothing vtkSmoothPolyDataFilter smoother = vtkSmoothPolyDataFilter.New(); smoother.SetInputData(decimator.GetOutput()); smoother.SetNumberOfIterations(5); smoother.SetFeatureAngle(60); smoother.SetRelaxationFactor(0.05); smoother.FeatureEdgeSmoothingOff(); //Select the largest region vtkPolyDataConnectivityFilter connectivityFilter = vtkPolyDataConnectivityFilter.New(); connectivityFilter.SetInputConnection(decimator.GetOutputPort()); connectivityFilter.ScalarConnectivityOff(); connectivityFilter.SetExtractionModeToLargestRegion(); connectivityFilter.Update(); // Create final polygon mesh vtkPolyData mesh = vtkPolyData.New(); mesh.ShallowCopy(connectivityFilter.GetOutput()); // Visualization vtkRenderer renderer = aRenderWindow.GetRenderers().GetFirstRenderer(); renderer.SetBackground(0.0, 0.0, 0.0); vtkPolyDataMapper mapper = vtkPolyDataMapper.New(); mapper.SetInputData(mesh); mapper.ScalarVisibilityOff(); vtkActor actor = vtkActor.New(); actor.SetMapper(mapper); renderer.AddActor(actor); vtkCamera camera = renderer.MakeCamera(); camera.SetPosition(-500.0, 245.5, 122.0); camera.SetFocalPoint(301.0, 245.5, 122.0); camera.SetViewAngle(30.0); camera.SetRoll(-90.0); renderer.SetActiveCamera(camera); aRenderWindow.Render(); vtkRenderWindowInteractor interactor = aRenderWindow.GetInteractor(); interactor.Start(); } ?2016-03-17?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?17? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: Re: Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series And I should add: if it is necessary to use a range (instead of just a lower threshold), then the pipeline can use vtkMarchingCubes twice: vtkSmartPointer cubes1 = vtkSmartPointer::New(); cubes1->SetInputData(imagedata); cubes1->SetValue(0, lowerThreshold); vtkSmartPointer cubes2 = vtkSmartPointer::New(); cubes2->SetInputData(imagedata); cubes2->SetValue(0, upperThreshold); vtkSmartPointer reverse = vtkSmartPointer::New(); reverse->SetInputConnection(cubes2->GetOutputPort()); vtkSmartPointer surface = vtkSmartPointer::New(); surface->SetInputConnection(cubes1->GetOutputPort()); surface->AddInputConnection(cubes2->GetOutputPort()); surface->Update(); On Thu, Mar 17, 2016 at 6:06 AM, David Gobbi wrote: Hi Liu Peng, For creating a model, it is common to allow the user to set just a lower threshold (rather than a range), and to use the lower threshold as the isovalue. If you send the code for the whole pipeline, that might help. - David On Wed, Mar 16, 2016 at 11:27 PM, Liu_tj wrote: Hi, David, If I don't use vtkImageThreshol, how to generate 3D model from the points whose grayscale is in some specific range? This range can be changed by the user. Thanks Liu Peng ?2016-03-17?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?17? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series On Wed, Mar 16, 2016 at 10:35 PM, Liu_tj wrote: Hi,David, If using vtkImageThreshold before vtkMarchingCubes is not a good option, what other better way do you have? The output of the reader should go directly into vtkMarchingCubes. Beside, for the isovalue, I try 2,3,4 and marched->GetNumberOfPoints() return 0, only isovalue is 1 and marched->GetNumberOfPoints() return a number greater than 0. I have no idea this is relating to the DICOM series or other problem. If you remove vtkImageThreshold, and put the output of the reader directly into vtkMarchingCubes, then you should be able to use an isovalue somewhere between 100 and 2000 and get a good result. Also, after vtkMarchingCubes, you can use vtkConnectivityFilter to clean up the polydata before you decimate it. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.chen.dk at gmail.com Fri Mar 18 00:34:38 2016 From: r.chen.dk at gmail.com (=?UTF-8?B?6Zmz6byO5YWD?=) Date: Fri, 18 Mar 2016 12:34:38 +0800 Subject: [vtkusers] How to do 3D reconstruction by a series of DICOM Files? Message-ID: Hello Everyone: I am a Beginner using VTK for DICOM Image application, I successfully read the DICOM Image by vtkDICOMReader, I tried to find out the 3D rendering methods: MarchingCubes, I just copy the codes on the example and change the Directory Folder to in which my DICOM Files are saved, and it ended up to an error(as the snapshot_1), here is my code: I really want to realize where the error comes from, since it's similar as the least one, is there some knowledge I should take care before using VTK libraries? Also do you recommend the other 3D reconstruction methods? #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include VTK_MODULE_INIT(vtkRenderingOpenGL2); VTK_MODULE_INIT(vtkRenderingFreeType); VTK_MODULE_INIT(vtkInteractionStyle); int main(int argc, char *argv[]) { vtkSmartPointer volume = vtkSmartPointer::New(); double isoValue; vtkSmartPointer reader = vtkSmartPointer::New(); reader->SetDirectoryName("D:/Ralf/VTK/DICOM/case2009.04.15.12.07.26/MR"); reader->Update(); volume->DeepCopy(reader->GetOutput()); isoValue = atof(argv[2]); vtkSmartPointer surface = vtkSmartPointer::New(); #if VTK_MAJOR_VERSION <= 5 surface->SetInput(volume); #else surface->SetInputData(volume); #endif surface->ComputeNormalsOn(); surface->SetValue(0, isoValue); vtkSmartPointer renderer = vtkSmartPointer::New(); renderer->SetBackground(.1, .2, .3); vtkSmartPointer renderWindow = vtkSmartPointer::New(); renderWindow->AddRenderer(renderer); vtkSmartPointer interactor = vtkSmartPointer::New(); interactor->SetRenderWindow(renderWindow); vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(surface->GetOutputPort()); mapper->ScalarVisibilityOff(); vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); renderer->AddActor(actor); renderWindow->Render(); interactor->Start(); return EXIT_SUCCESS; } Sincerely, Ralf. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: snapshot_1.JPG Type: image/jpeg Size: 29726 bytes Desc: not available URL: From aashish.chaudhary at kitware.com Fri Mar 18 01:37:11 2016 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Fri, 18 Mar 2016 01:37:11 -0400 Subject: [vtkusers] Can't transform a vtkVolume In-Reply-To: References: Message-ID: Hi Lorenzo, Sorry for some reason I didn't see this email until now. I pushed a small fix here: https://gitlab.kitware.com/vtk/vtk/merge_requests/1344 Thanks On Wed, Mar 16, 2016 at 12:24 PM, Lorenzo wrote: > I am sorry Aashish but I found a problem: if I try to interact with the > scene, the blue volume doesn't behave as it should. It changes positions > just by changing the point of view on the scene. > > Here's a screenshot: http://i.imgur.com/3wlw43D.png > > Do you have any idea why? > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 > -- *| Aashish Chaudhary | Technical Leader | Kitware Inc. * *| http://www.kitware.com/company/team/chaudhary.html * -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Fri Mar 18 02:47:34 2016 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Fri, 18 Mar 2016 07:47:34 +0100 Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series In-Reply-To: References: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> <694f11c8.9.15382dbad62.Coremail.tjlp@netease.com> <7303b5c3.b.153830ab688.Coremail.tjlp@netease.com> <35ec6f75.2.15387436d8c.Coremail.tjlp@netease.com> <2c3b748d.7.153876e48b6.Coremail.tjlp@netease.com> Message-ID: 2016-03-18 3:19 GMT+01:00 David Gobbi : > You can segment an image with just one threshold (i.e. just the lower > threshold). It is not necessary to set a range. > Sorry for jumping in here, but I'm also pretty new to VTK, and what Liu describes sounds like something we will want to do soon: Allow the user to set a grayscale range, and only show the parts of the volume that falls within this range. When you say "you can segment an image with just one threshold", do you mean that it somehow doesn't make sense to use two thresholds? If so, why? What if the use really wants to "extract" the parts of the volume where the scalar values are within some range? Thanks in advance, Elvis > But, regardless, vtkMarchingCubes is designed to take a greyscale image as > input, not a binary image. > > - David > > > On Thu, Mar 17, 2016 at 8:09 PM, Liu_tj wrote: > >> Hi, David, >> >> The user scenario is that we allow the user to set segment threshold >> which is a grayscale range. So at the 2D DICOM view, the pixels which fall >> in this range will be shown by special color (I implement it with >> vtkLookupTableand vtkImageMapToColors); then the user can preview the 3D >> model generated by the points in this grayscale range. >> >> Thanks >> >> >> ?2016-03-18?"David Gobbi" ??? >> >> -----????----- >> *???:*"David Gobbi" >> *????:*2016?03?18? ??? >> *???:*"Liu_tj" >> *??:*"vtkusers" >> *??:*Re: Re: Re: Re: Re: [vtkusers] High memory cost of vtkDecimatePro >> for 3D model generation from DICOM series >> >> >> You only need one threshold to create a model from an image. >> Why do you let the user set two thresholds? >> >> >> On Thu, Mar 17, 2016 at 7:54 PM, Liu_tj wrote: >> >>> Hi, David, >>> >>> If the user sets a upper value, what should we do? >>> >>> Thanks >>> Liu Peng >>> >>> >>> >>> ?2016-03-18?"David Gobbi" ??? >>> >>> -----????----- >>> *???:*"David Gobbi" >>> *????:*2016?03?18? ??? >>> *???:*"Liu_tj" >>> *??:*"vtkusers" >>> *??:*Re: Re: Re: Re: [vtkusers] High memory cost of vtkDecimatePro for >>> 3D model generation from DICOM series >>> >>> >>> Hi Liu Peng, >>> >>> Now that I have seen your code, you should definitely remove >>> vtkImageThreshold and set the vtkMarchingCubes isovalue to around 1000. >>> I'm certain that vtkImageThreshold does nothing useful in this pipeline. >>> >>> For vtkReverseSense, see the documentation page for the class for an >>> explanation of what it does. I wrote that example code because I thought >>> you might need an upper and a lower threshold, but now that I have seen >>> your code, I think you only need one threshold (just the lower threshold). >>> So you can ignore the code that I sent. >>> >>> As for the camera, it is usually a good idea to point it at the center >>> of the volume. I do not always like VTK's default camera position, so I >>> when I write VTK code, I almost always set the camera position myself. >>> >>> - David >>> >>> >>> >>> On Thu, Mar 17, 2016 at 7:07 PM, Liu_tj wrote: >>> >>>> Hi, David, >>>> >>>> Below is my present C# code.You can see that I reset the camera >>>> position, otherwise after rendering, the 3D model is not at the window >>>> center, I have to pan it, any recommendation for the position issue also? >>>> >>>> private void Display(vtkRenderWindow aRenderWindow, vtkImageData >>>> aData) >>>> { >>>> vtkImageData volume = vtkImageData.New(); >>>> double isoValue = 1; >>>> volume.DeepCopy(aData); >>>> vtkImageThreshold image_threshold = vtkImageThreshold.New(); >>>> image_threshold.SetInputData(volume); >>>> image_threshold.ThresholdBetween(1000,20000); >>>> image_threshold.ReplaceInOn(); >>>> image_threshold.SetInValue(1); >>>> image_threshold.ReplaceOutOn(); >>>> image_threshold.SetOutValue(0); >>>> image_threshold.Update(); >>>> >>>> vtkMarchingCubes surface = vtkMarchingCubes.New(); >>>> surface.SetInputData(image_threshold.GetOutput()); >>>> surface.ComputeNormalsOn(); >>>> surface.ComputeScalarsOn(); >>>> surface.SetValue(0, isoValue); >>>> surface.Update(); >>>> >>>> vtkPolyData marched = vtkPolyData.New(); >>>> marched.DeepCopy(surface.GetOutput()); >>>> >>>> long pointcnt = marched.GetNumberOfPoints(); >>>> >>>> // Decimation to reduce the number of triangles >>>> vtkDecimatePro decimator = vtkDecimatePro.New(); >>>> decimator.SetInputData(marched); >>>> decimator.SetTargetReduction(0.5); >>>> decimator.SetPreserveTopology(1); >>>> decimator.Update(); >>>> //Smoothing >>>> vtkSmoothPolyDataFilter smoother = >>>> vtkSmoothPolyDataFilter.New(); >>>> smoother.SetInputData(decimator.GetOutput()); >>>> smoother.SetNumberOfIterations(5); >>>> smoother.SetFeatureAngle(60); >>>> smoother.SetRelaxationFactor(0.05); >>>> smoother.FeatureEdgeSmoothingOff(); >>>> >>>> //Select the largest region >>>> vtkPolyDataConnectivityFilter connectivityFilter = >>>> vtkPolyDataConnectivityFilter.New(); >>>> >>>> connectivityFilter.SetInputConnection(decimator.GetOutputPort()); >>>> connectivityFilter.ScalarConnectivityOff(); >>>> connectivityFilter.SetExtractionModeToLargestRegion(); >>>> connectivityFilter.Update(); >>>> >>>> // Create final polygon mesh >>>> vtkPolyData mesh = vtkPolyData.New(); >>>> mesh.ShallowCopy(connectivityFilter.GetOutput()); >>>> >>>> // Visualization >>>> vtkRenderer renderer = >>>> aRenderWindow.GetRenderers().GetFirstRenderer(); >>>> renderer.SetBackground(0.0, 0.0, 0.0); >>>> >>>> vtkPolyDataMapper mapper = vtkPolyDataMapper.New(); >>>> mapper.SetInputData(mesh); >>>> mapper.ScalarVisibilityOff(); >>>> >>>> vtkActor actor = vtkActor.New(); >>>> actor.SetMapper(mapper); >>>> renderer.AddActor(actor); >>>> >>>> vtkCamera camera = renderer.MakeCamera(); >>>> camera.SetPosition(-500.0, 245.5, 122.0); >>>> camera.SetFocalPoint(301.0, 245.5, 122.0); >>>> camera.SetViewAngle(30.0); >>>> camera.SetRoll(-90.0); >>>> renderer.SetActiveCamera(camera); >>>> >>>> aRenderWindow.Render(); >>>> >>>> vtkRenderWindowInteractor interactor = >>>> aRenderWindow.GetInteractor(); >>>> interactor.Start(); >>>> } >>>> >>>> >>>> >>>> ?2016-03-17?"David Gobbi" ??? >>>> >>>> -----????----- >>>> *???:*"David Gobbi" >>>> *????:*2016?03?17? ??? >>>> *???:*"Liu_tj" >>>> *??:*"vtkusers" >>>> *??:*Re: Re: Re: [vtkusers] High memory cost of vtkDecimatePro for 3D >>>> model generation from DICOM series >>>> >>>> >>>> And I should add: if it is necessary to use a range (instead of just a >>>> lower threshold), then the pipeline can use vtkMarchingCubes twice: >>>> >>>> vtkSmartPointer cubes1 = >>>> vtkSmartPointer::New(); >>>> cubes1->SetInputData(imagedata); >>>> cubes1->SetValue(0, lowerThreshold); >>>> >>>> vtkSmartPointer cubes2 = >>>> vtkSmartPointer::New(); >>>> cubes2->SetInputData(imagedata); >>>> cubes2->SetValue(0, upperThreshold); >>>> >>>> vtkSmartPointer reverse = >>>> vtkSmartPointer::New(); >>>> reverse->SetInputConnection(cubes2->GetOutputPort()); >>>> >>>> vtkSmartPointer surface = >>>> vtkSmartPointer::New(); >>>> surface->SetInputConnection(cubes1->GetOutputPort()); >>>> surface->AddInputConnection(cubes2->GetOutputPort()); >>>> surface->Update(); >>>> >>>> >>>> On Thu, Mar 17, 2016 at 6:06 AM, David Gobbi >>>> wrote: >>>> >>>>> Hi Liu Peng, >>>>> >>>>> For creating a model, it is common to allow the user to set just a >>>>> lower threshold (rather than a range), and to use the lower threshold as >>>>> the isovalue. If you send the code for the whole pipeline, that might help. >>>>> >>>>> - David >>>>> >>>>> On Wed, Mar 16, 2016 at 11:27 PM, Liu_tj wrote: >>>>> >>>>>> Hi, David, >>>>>> >>>>>> If I don't use vtkImageThreshol, how to generate 3D model from the >>>>>> points whose grayscale is in some specific range? This range can be changed >>>>>> by the user. >>>>>> >>>>>> Thanks >>>>>> Liu Peng >>>>>> >>>>>> ?2016-03-17?"David Gobbi" ??? >>>>>> >>>>>> -----????----- >>>>>> *???:*"David Gobbi" >>>>>> *????:*2016?03?17? ??? >>>>>> *???:*"Liu_tj" >>>>>> *??:*"vtkusers" >>>>>> *??:*Re: Re: [vtkusers] High memory cost of vtkDecimatePro for 3D >>>>>> model generation from DICOM series >>>>>> >>>>>> >>>>>> On Wed, Mar 16, 2016 at 10:35 PM, Liu_tj wrote: >>>>>> >>>>>>> Hi,David, >>>>>>> >>>>>>> If using vtkImageThreshold before vtkMarchingCubes is not a good >>>>>>> option, what other better way do you have? >>>>>>> >>>>>> >>>>>> The output of the reader should go directly into vtkMarchingCubes. >>>>>> >>>>>> >>>>>>> Beside, for the isovalue, I try 2,3,4 and >>>>>>> marched->GetNumberOfPoints() return 0, only isovalue is 1 and >>>>>>> marched->GetNumberOfPoints() return a number greater than 0. I have no idea >>>>>>> this is relating to the DICOM series or other problem. >>>>>>> >>>>>> >>>>>> If you remove vtkImageThreshold, and put the output of the reader >>>>>> directly into vtkMarchingCubes, then you should be able to use an isovalue >>>>>> somewhere between 100 and 2000 and get a good result. >>>>>> >>>>>> Also, after vtkMarchingCubes, you can use vtkConnectivityFilter to >>>>>> clean up the polydata before you decimate it. >>>>>> >>>>>> - David >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>> >>> >> > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjlp at netease.com Fri Mar 18 03:20:21 2016 From: tjlp at netease.com (Liu_tj) Date: Fri, 18 Mar 2016 15:20:21 +0800 (CST) Subject: [vtkusers] How to do 3D reconstruction by a series of DICOM Files? In-Reply-To: References: Message-ID: <5e9b6810.5.1538898b043.Coremail.tjlp@netease.com> Possibly the memory is not enough. I get similar errors before and I turn to 64bit vtk. ?2016-03-18?"???" ??? -----????----- ???:"???" ????:2016?03?18? ??? ???:"vtkusers" ??:[vtkusers] How to do 3D reconstruction by a series of DICOM Files? Hello Everyone: I am a Beginner using VTK for DICOM Image application, I successfully read the DICOM Image by vtkDICOMReader, I tried to find out the 3D rendering methods: MarchingCubes, I just copy the codes on the example and change the Directory Folder to in which my DICOM Files are saved, and it ended up to an error(as the snapshot_1), here is my code: I really want to realize where the error comes from, since it's similar as the least one, is there some knowledge I should take care before using VTK libraries? Also do you recommend the other 3D reconstruction methods? #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include VTK_MODULE_INIT(vtkRenderingOpenGL2); VTK_MODULE_INIT(vtkRenderingFreeType); VTK_MODULE_INIT(vtkInteractionStyle); int main(int argc, char *argv[]) { vtkSmartPointer volume = vtkSmartPointer::New(); double isoValue; vtkSmartPointer reader = vtkSmartPointer::New(); reader->SetDirectoryName("D:/Ralf/VTK/DICOM/case2009.04.15.12.07.26/MR"); reader->Update(); volume->DeepCopy(reader->GetOutput()); isoValue = atof(argv[2]); vtkSmartPointer surface = vtkSmartPointer::New(); #if VTK_MAJOR_VERSION <= 5 surface->SetInput(volume); #else surface->SetInputData(volume); #endif surface->ComputeNormalsOn(); surface->SetValue(0, isoValue); vtkSmartPointer renderer = vtkSmartPointer::New(); renderer->SetBackground(.1, .2, .3); vtkSmartPointer renderWindow = vtkSmartPointer::New(); renderWindow->AddRenderer(renderer); vtkSmartPointer interactor = vtkSmartPointer::New(); interactor->SetRenderWindow(renderWindow); vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(surface->GetOutputPort()); mapper->ScalarVisibilityOff(); vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); renderer->AddActor(actor); renderWindow->Render(); interactor->Start(); return EXIT_SUCCESS; } Sincerely, Ralf. -------------- next part -------------- An HTML attachment was scrubbed... URL: From oneiros.valente at gmail.com Fri Mar 18 05:31:58 2016 From: oneiros.valente at gmail.com (Lorenzo) Date: Fri, 18 Mar 2016 09:31:58 +0000 (UTC) Subject: [vtkusers] Can't transform a vtkVolume References: Message-ID: Hi Aashish. I tried your patch but nothing changed. Do you think that it is a vtkCamera related problem? From david.gobbi at gmail.com Fri Mar 18 08:51:31 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 18 Mar 2016 06:51:31 -0600 Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series In-Reply-To: References: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> <694f11c8.9.15382dbad62.Coremail.tjlp@netease.com> <7303b5c3.b.153830ab688.Coremail.tjlp@netease.com> <35ec6f75.2.15387436d8c.Coremail.tjlp@netease.com> <2c3b748d.7.153876e48b6.Coremail.tjlp@netease.com> Message-ID: On Fri, Mar 18, 2016 at 12:47 AM, Elvis Stansvik < elvis.stansvik at orexplore.com> wrote: > 2016-03-18 3:19 GMT+01:00 David Gobbi : > >> You can segment an image with just one threshold (i.e. just the lower >> threshold). It is not necessary to set a range. >> > > Sorry for jumping in here, but I'm also pretty new to VTK, and what Liu > describes sounds like something we will want to do soon: Allow the user to > set a grayscale range, and only show the parts of the volume that falls > within this range. > > When you say "you can segment an image with just one threshold", do you > mean that it somehow doesn't make sense to use two thresholds? If so, why? > What if the use really wants to "extract" the parts of the volume where the > scalar values are within some range? > It often makes sense to use a single threshold. Examples: 1) segmenting bone from a CT image 2) removing background/noise from an MR image 3) segmenting vessels from a contrast image Yes, there are also circumstances where two thresholds work better, but I've written more software that uses one threshold than that uses two. The main point that I have been trying to make is that, if you want to get a smooth result out of vtkMarchingCubes, you should should give it a greyscale input, not a binary input. In other words, you should not give marching cubes the output of vtkImageThreshold. Marching cubes gives surfaces corresponding to isovalues. If you have a range instead of a single threshold, then you should produce one surface for the lower end of the range, and another surface for the upper end of the range. VTK surfaces are oriented, so you must reverse the sense of the upper-range surface (i.e. reverse the polygon winding and the normal directions). Then you can combine the lower-range surface and the upper-range surface into a single polydata with vtkAppendPolyData. If this sounds too complicated, then you can instead take the output from vtkImageThreshold, apply a mild gaussian blur to it, and apply marching cubes to the blurred data. If you only have a binary mask (i.e. if you no longer have the original data) then this is a reasonable way to produce a greyscale input for marching cubes. But if you have the original data, then a more accurate result can be achieved by feeding the original data into marching cubes, so that it uses the original greyscale values when it analyzes the voxels and produces the surface. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.martin at kitware.com Fri Mar 18 14:26:40 2016 From: ken.martin at kitware.com (Ken Martin) Date: Fri, 18 Mar 2016 14:26:40 -0400 Subject: [vtkusers] Compiling VTK-7.0.0 for Android. In-Reply-To: References: Message-ID: I googled your error and found this http://stackoverflow.com/questions/22701405/aapt-ioexception-error-2-no-such-file-or-directory-why-cant-i-build-my-grad some other hits as well. I would suggest giving them a look if you have not already. Thanks Ken On Wed, Mar 16, 2016 at 5:25 PM, Lindeval Lima wrote: > > > When I compile, I get the following messages: > > BUILD FAILED > /home/lindeval/Softwares/Android/android-sdk-linux/tools/ant/build.xml:911 > : Execute failed: java.io.IOException: Can not run program "/ home / > lindeval / Software / Android / android-sdk -linux / build-tools / 21.1.2 > / aapt ": error = 2, File or directory not found. > > The file exists! > > Examples are not built. > > cmake-gui configuration: attached file. > > System: Linux Ubuntu 10.15 > > Thank you for any help. > > > -- > > *Prof. Lindeval Fernandes de Lima* > > *Telefones para contato*: > Celular: (095) 81215424 > Coordena??o EaD: (095) 3624 - 6426 > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 elvis.stansvik at orexplore.com Fri Mar 18 15:09:35 2016 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Fri, 18 Mar 2016 20:09:35 +0100 Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series In-Reply-To: References: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> <694f11c8.9.15382dbad62.Coremail.tjlp@netease.com> <7303b5c3.b.153830ab688.Coremail.tjlp@netease.com> <35ec6f75.2.15387436d8c.Coremail.tjlp@netease.com> <2c3b748d.7.153876e48b6.Coremail.tjlp@netease.com> Message-ID: 2016-03-18 13:51 GMT+01:00 David Gobbi : > On Fri, Mar 18, 2016 at 12:47 AM, Elvis Stansvik < > elvis.stansvik at orexplore.com> wrote: > >> 2016-03-18 3:19 GMT+01:00 David Gobbi : >> >>> You can segment an image with just one threshold (i.e. just the lower >>> threshold). It is not necessary to set a range. >>> >> >> Sorry for jumping in here, but I'm also pretty new to VTK, and what Liu >> describes sounds like something we will want to do soon: Allow the user to >> set a grayscale range, and only show the parts of the volume that falls >> within this range. >> >> When you say "you can segment an image with just one threshold", do you >> mean that it somehow doesn't make sense to use two thresholds? If so, why? >> What if the use really wants to "extract" the parts of the volume where the >> scalar values are within some range? >> > > It often makes sense to use a single threshold. Examples: > 1) segmenting bone from a CT image > 2) removing background/noise from an MR image > 3) segmenting vessels from a contrast image > Yes, there are also circumstances where two thresholds work better, but > I've written more software that uses one threshold than that uses two. > Ah, yes, then it makes perfect sense. For a while I thought you were talking about "not making sense" in a technical sense. In our case it's tomography of rock (drill core), so it makes sense to allow the user to select a range (in our case, from a histogram), and have the volume rendering show parts that are within that range (presumably corresponding to some structure/mineral/element with around that density). Thanks for clarifying! > > The main point that I have been trying to make is that, if you want to get > a smooth result out of vtkMarchingCubes, you should should give it a > greyscale input, not a binary input. In other words, you should not give > marching cubes the output of vtkImageThreshold. > > Marching cubes gives surfaces corresponding to isovalues. If you have a > range instead of a single threshold, then you should produce one surface > for the lower end of the range, and another surface for the upper end of > the range. VTK surfaces are oriented, so you must reverse the sense of the > upper-range surface (i.e. reverse the polygon winding and the normal > directions). Then you can combine the lower-range surface and the > upper-range surface into a single polydata with vtkAppendPolyData. > Excellent, thank for that tip. We're not there yet, but we may do something like that in the future (instead of just showing the volume rendering filtered by two endpoints). > > If this sounds too complicated, then you can instead take the output from > vtkImageThreshold, apply a mild gaussian blur to it, and apply marching > cubes to the blurred data. If you only have a binary mask (i.e. if you no > longer have the original data) then this is a reasonable way to produce a > greyscale input for marching cubes. But if you have the original data, > then a more accurate result can be achieved by feeding the original data > into marching cubes, so that it uses the original greyscale values when it > analyzes the voxels and produces the surface. > Yes, I imagine this is what we'll do (the latter approach). Again, thanks for your input and your nice support on this list. Elvis > > - David > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aashish.chaudhary at kitware.com Fri Mar 18 17:40:56 2016 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Fri, 18 Mar 2016 17:40:56 -0400 Subject: [vtkusers] Can't transform a vtkVolume In-Reply-To: References: Message-ID: Are you sure that you are on the right SHA? Could you fetch again and make sure that you do hard-reset. The reason I am saying that the test is passing on all machines (which has a different image now), so something should change. On Fri, Mar 18, 2016 at 5:31 AM, Lorenzo wrote: > Hi Aashish. > I tried your patch but nothing changed. > Do you think that it is a vtkCamera related problem? > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 > -- *| Aashish Chaudhary | Technical Leader | Kitware Inc. * *| http://www.kitware.com/company/team/chaudhary.html * -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjlp at netease.com Fri Mar 18 22:43:10 2016 From: tjlp at netease.com (Liu_tj) Date: Sat, 19 Mar 2016 10:43:10 +0800 (CST) Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series In-Reply-To: References: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> <694f11c8.9.15382dbad62.Coremail.tjlp@netease.com> <7303b5c3.b.153830ab688.Coremail.tjlp@netease.com> <35ec6f75.2.15387436d8c.Coremail.tjlp@netease.com> <2c3b748d.7.153876e48b6.Coremail.tjlp@netease.com> Message-ID: <235ba526.4.1538cc14967.Coremail.tjlp@netease.com> Hi, David, Thanks for your detail reply. I thought that vtkImageThreshold still provide a greyscale output instead of binary output. My understanding was that vtkImageThreshold just remove the points beyond the greyscale range. Thanks Liu Peng ?2016-03-18?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?18? ??? ???:"Elvis Stansvik" ??:"Liu_tj" ;"vtkusers" ??:Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series On Fri, Mar 18, 2016 at 12:47 AM, Elvis Stansvik wrote: 2016-03-18 3:19 GMT+01:00 David Gobbi : You can segment an image with just one threshold (i.e. just the lower threshold). It is not necessary to set a range. Sorry for jumping in here, but I'm also pretty new to VTK, and what Liu describes sounds like something we will want to do soon: Allow the user to set a grayscale range, and only show the parts of the volume that falls within this range. When you say "you can segment an image with just one threshold", do you mean that it somehow doesn't make sense to use two thresholds? If so, why? What if the use really wants to "extract" the parts of the volume where the scalar values are within some range? It often makes sense to use a single threshold. Examples: 1) segmenting bone from a CT image 2) removing background/noise from an MR image 3) segmenting vessels from a contrast image Yes, there are also circumstances where two thresholds work better, but I've written more software that uses one threshold than that uses two. The main point that I have been trying to make is that, if you want to get a smooth result out of vtkMarchingCubes, you should should give it a greyscale input, not a binary input. In other words, you should not give marching cubes the output of vtkImageThreshold. Marching cubes gives surfaces corresponding to isovalues. If you have a range instead of a single threshold, then you should produce one surface for the lower end of the range, and another surface for the upper end of the range. VTK surfaces are oriented, so you must reverse the sense of the upper-range surface (i.e. reverse the polygon winding and the normal directions). Then you can combine the lower-range surface and the upper-range surface into a single polydata with vtkAppendPolyData. If this sounds too complicated, then you can instead take the output from vtkImageThreshold, apply a mild gaussian blur to it, and apply marching cubes to the blurred data. If you only have a binary mask (i.e. if you no longer have the original data) then this is a reasonable way to produce a greyscale input for marching cubes. But if you have the original data, then a more accurate result can be achieved by feeding the original data into marching cubes, so that it uses the original greyscale values when it analyzes the voxels and produces the surface. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Fri Mar 18 23:32:02 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Fri, 18 Mar 2016 21:32:02 -0600 Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series In-Reply-To: <235ba526.4.1538cc14967.Coremail.tjlp@netease.com> References: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> <694f11c8.9.15382dbad62.Coremail.tjlp@netease.com> <7303b5c3.b.153830ab688.Coremail.tjlp@netease.com> <35ec6f75.2.15387436d8c.Coremail.tjlp@netease.com> <2c3b748d.7.153876e48b6.Coremail.tjlp@netease.com> <235ba526.4.1538cc14967.Coremail.tjlp@netease.com> Message-ID: On Fri, Mar 18, 2016 at 8:43 PM, Liu_tj wrote: > > I thought that vtkImageThreshold still provide a greyscale output instead > of binary output. My understanding was that vtkImageThreshold just remove > the points beyond the greyscale range. It can be used that way, but in your code, it is producing a binary output. Points in the range are set to 1, and points outside the range are set to 0: image_threshold.ReplaceInOn(); image_threshold.SetInValue(1); image_threshold.ReplaceOutOn(); image_threshold.SetOutValue(0); But even if you change vtkImageThreshold so that it just removes the points outside of the range, I still recommend that you do not use it before vtkMarchingCubes, because marching cubes expects to have valid grey values on both sides of the isosurface (on the inside and on the outside). If you set the outside voxels to black, then the resulting surface will be shifted inward slightly. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.chen.dk at gmail.com Fri Mar 18 23:41:40 2016 From: r.chen.dk at gmail.com (Ralf) Date: Fri, 18 Mar 2016 20:41:40 -0700 (MST) Subject: [vtkusers] How to do 3D reconstruction by a series of DICOM Files? In-Reply-To: <5e9b6810.5.1538898b043.Coremail.tjlp@netease.com> References: <5e9b6810.5.1538898b043.Coremail.tjlp@netease.com> Message-ID: <1458358900007-5737294.post@n5.nabble.com> Hello Liu: Thanks for your replying, could you tell me how to check if this problem happens? I don't know how to check this... Thank you very much. Sincerely, Ralf. -- View this message in context: http://vtk.1045678.n5.nabble.com/How-to-do-3D-reconstruction-by-a-series-of-DICOM-Files-tp5737278p5737294.html Sent from the VTK - Users mailing list archive at Nabble.com. From tjlp at netease.com Sat Mar 19 05:45:03 2016 From: tjlp at netease.com (Liu_tj) Date: Sat, 19 Mar 2016 17:45:03 +0800 (CST) Subject: [vtkusers] How to do 3D reconstruction by a series of DICOM Files? In-Reply-To: <1458358900007-5737294.post@n5.nabble.com> References: <5e9b6810.5.1538898b043.Coremail.tjlp@netease.com> <1458358900007-5737294.post@n5.nabble.com> Message-ID: <661be1a1.9.1538e4385e7.Coremail.tjlp@netease.com> Hi, Ralf, I am a newbie of VTK, even image processing. I just use Visual Studio 2015 to develop my C# application. So, I can watch the memory usage by VS 2015 monitor during debugging. Actually I got the answer from some VTK guys in the previous thread I post. He just suggest me to turn to 64bit. Thanks Liu Peng ?2016-03-19?"Ralf" ??? -----????----- ???:"Ralf" ????:2016?03?19? ??? ???:"vtkusers" ??:Re: [vtkusers] How to do 3D reconstruction by a series of DICOM Files? Hello Liu: Thanks for your replying, could you tell me how to check if this problem happens? I don't know how to check this... Thank you very much. Sincerely, Ralf. -- View this message in context: http://vtk.1045678.n5.nabble.com/How-to-do-3D-reconstruction-by-a-series-of-DICOM-Files-tp5737278p5737294.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 tjlp at netease.com Sat Mar 19 05:47:43 2016 From: tjlp at netease.com (Liu_tj) Date: Sat, 19 Mar 2016 17:47:43 +0800 (CST) Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series In-Reply-To: References: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> <694f11c8.9.15382dbad62.Coremail.tjlp@netease.com> <7303b5c3.b.153830ab688.Coremail.tjlp@netease.com> <35ec6f75.2.15387436d8c.Coremail.tjlp@netease.com> <2c3b748d.7.153876e48b6.Coremail.tjlp@netease.com> <235ba526.4.1538cc14967.Coremail.tjlp@netease.com> Message-ID: <66eac0da.b.1538e45f980.Coremail.tjlp@netease.com> Hi, David, I got it. What value should I set for image_threshold.SetInValue()? Does it depend on the greyscale scalarange of the vtkImageData? Thanks Liu Peng ?2016-03-19?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?19? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series On Fri, Mar 18, 2016 at 8:43 PM, Liu_tj wrote: I thought that vtkImageThreshold still provide a greyscale output instead of binary output. My understanding was that vtkImageThreshold just remove the points beyond the greyscale range. It can be used that way, but in your code, it is producing a binary output. Points in the range are set to 1, and points outside the range are set to 0: image_threshold.ReplaceInOn(); image_threshold.SetInValue(1); image_threshold.ReplaceOutOn(); image_threshold.SetOutValue(0); But even if you change vtkImageThreshold so that it just removes the points outside of the range, I still recommend that you do not use it before vtkMarchingCubes, because marching cubes expects to have valid grey values on both sides of the isosurface (on the inside and on the outside). If you set the outside voxels to black, then the resulting surface will be shifted inward slightly. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From ultam93 at yahoo.com Sat Mar 19 07:04:46 2016 From: ultam93 at yahoo.com (Constantinescu Mihai) Date: Sat, 19 Mar 2016 11:04:46 +0000 (UTC) Subject: [vtkusers] Migrating vtkbool standalone to vtk7 References: <1336610015.1150474.1458385486661.JavaMail.yahoo.ref@mail.yahoo.com> Message-ID: <1336610015.1150474.1458385486661.JavaMail.yahoo@mail.yahoo.com> I'm trying to compile the standalone lib:?zippy84/vtkbool?for vtk 7. My main issue is that after version 6, classes like vtkcommon got split into other modules.Having:? | set(vtk_libs | | | vtkCommon | | | vtkFiltering | | | vtkIO | | | vtkGraphics) | in the?CMakeLists.txt,?how to convert that into its equivalent for vtk 7? | | | | | | | | | | | zippy84/vtkbool vtkbool - A standalone boolean filter for VTK. | | | | -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Sat Mar 19 09:33:14 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Sat, 19 Mar 2016 07:33:14 -0600 Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series In-Reply-To: <66eac0da.b.1538e45f980.Coremail.tjlp@netease.com> References: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> <694f11c8.9.15382dbad62.Coremail.tjlp@netease.com> <7303b5c3.b.153830ab688.Coremail.tjlp@netease.com> <35ec6f75.2.15387436d8c.Coremail.tjlp@netease.com> <2c3b748d.7.153876e48b6.Coremail.tjlp@netease.com> <235ba526.4.1538cc14967.Coremail.tjlp@netease.com> <66eac0da.b.1538e45f980.Coremail.tjlp@netease.com> Message-ID: On Sat, Mar 19, 2016 at 3:47 AM, Liu_tj wrote: > > I got it. What value should I set for image_threshold.SetInValue()? Does > it depend on the greyscale scalarange of the vtkImageData? You need to set ReplaceInOff(). -------------- next part -------------- An HTML attachment was scrubbed... URL: From aashish.chaudhary at kitware.com Sat Mar 19 11:05:20 2016 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Sat, 19 Mar 2016 11:05:20 -0400 Subject: [vtkusers] Can't transform a vtkVolume In-Reply-To: References: Message-ID: Lorenzo, The ranch is merged into VTK master now as of this morning after the tests were passing on all expected machines (and me manually testing it on bigmac and linux boxes). Can you try master instead? Thanks, On Fri, Mar 18, 2016 at 5:40 PM, Aashish Chaudhary < aashish.chaudhary at kitware.com> wrote: > Are you sure that you are on the right SHA? Could you fetch again and make > sure that you do hard-reset. The reason I am saying that the test is > passing on all machines (which has a different image now), so something > should change. > > On Fri, Mar 18, 2016 at 5:31 AM, Lorenzo > wrote: > >> Hi Aashish. >> I tried your patch but nothing changed. >> Do you think that it is a vtkCamera related problem? >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> 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 >> > > > > -- > > > > *| Aashish Chaudhary | Technical Leader | Kitware Inc. * > *| http://www.kitware.com/company/team/chaudhary.html > * > -- *| Aashish Chaudhary | Technical Leader | Kitware Inc. * *| http://www.kitware.com/company/team/chaudhary.html * -------------- next part -------------- An HTML attachment was scrubbed... URL: From dimitar.pashov at kcl.ac.uk Sat Mar 19 13:15:10 2016 From: dimitar.pashov at kcl.ac.uk (Dimitar Pashov) Date: Sat, 19 Mar 2016 17:15:10 +0000 Subject: [vtkusers] fullscreen mode problem Message-ID: <8061010.UeCbfniuRT@azin> Dear folks, Could you please tell me if I am doing something wrong or if there is a bug in the fullscreen mode. The attached code adds a keypress event callback to the interactor in the fullscreen example online. Going to fs (by pressing 'space') makes the window ignore mouse input but still responds to keyboard (q closes it etc.. space toggles normal mode). Toggling normal mode however, opens another window, the same size as the original, which shows the scene and performs operations taken from the input (mouse and kbd) given to the original window. The original window on the other hand either shows a static frame or nothing. Repeating the activity does more open any more windows, just keeps these 2. I used v7.0 on current archlinux and got a report for the same behaviour with v6.3 on recent fedora. Thanks, Dimitar -------------- next part -------------- A non-text attachment was scrubbed... Name: CMakeLists.txt Type: text/x-cmake Size: 307 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: FullScreen.cxx Type: text/x-c++src Size: 1912 bytes Desc: not available URL: From r.chen.dk at gmail.com Sun Mar 20 10:21:33 2016 From: r.chen.dk at gmail.com (Ralf) Date: Sun, 20 Mar 2016 07:21:33 -0700 (MST) Subject: [vtkusers] How to do 3D reconstruction by a series of DICOM Files? In-Reply-To: <661be1a1.9.1538e4385e7.Coremail.tjlp@netease.com> References: <5e9b6810.5.1538898b043.Coremail.tjlp@netease.com> <1458358900007-5737294.post@n5.nabble.com> <661be1a1.9.1538e4385e7.Coremail.tjlp@netease.com> Message-ID: <1458483693671-5737301.post@n5.nabble.com> Hi Liu: Alright, though I still can't figure this out, I am thankful for your replying :) Ralf. -- View this message in context: http://vtk.1045678.n5.nabble.com/How-to-do-3D-reconstruction-by-a-series-of-DICOM-Files-tp5737278p5737301.html Sent from the VTK - Users mailing list archive at Nabble.com. From david.gobbi at gmail.com Sun Mar 20 10:32:09 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Sun, 20 Mar 2016 08:32:09 -0600 Subject: [vtkusers] How to do 3D reconstruction by a series of DICOM Files? In-Reply-To: References: Message-ID: On Thu, Mar 17, 2016 at 10:34 PM, ??? wrote: > > > I really want to realize where the error comes from, since it's > similar as the least one, is there some knowledge I should take care before > using VTK libraries? > Have you tried running your program in a debugger? - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjlp at netease.com Sun Mar 20 10:52:18 2016 From: tjlp at netease.com (Liu_tj) Date: Sun, 20 Mar 2016 22:52:18 +0800 (CST) Subject: [vtkusers] Error "The interactor must be set prior to enabling the widget" using vtkResliceImageViewer Message-ID: <438ed7a9.4.15394832da9.Coremail.tjlp@netease.com> Hi, VTK guys, I am using Activiz VTK 7.0 for my C# application. I try to use vtkResliceImageViewer to display DICOM axial, coronal or saggital view. The vtkRenderWindow is defined in a WPF user control. When I run my application, I get this error reported: ERROR: In ..\..\..\VTK-7.0\Interaction\Widgets\vtkAbstractWidget.cxx, line 118 vtkResliceCursorWidget (0000000025A638B0): The interactor must be set prior to enabling the widget ERROR: In ..\..\..\VTK-7.0\Interaction\Widgets\vtkAbstractWidget.cxx, line 118 vtkResliceCursorWidget (0000000025A638B0): The interactor must be set prior to enabling the widget Below is my code. Do I miss any step? private void Display2(vtkRenderWindow aRenderWindow, vtkImageData aData) { if (aData == null) return; m_imageViewer = vtkResliceImageViewer.New(); m_imageViewer.SetInputData(aData); m_imageViewer.SliceScrollOnMouseWheelOn(); m_imageViewer.SetResliceModeToOblique(); switch (m_sliceDirection) { case Direction.AXIAL: m_imageViewer.SetSliceOrientationToXY(); break; case Direction.CORONAL: m_imageViewer.SetSliceOrientationToYZ(); break; case Direction.SAGITTAL: m_imageViewer.SetSliceOrientationToXZ(); break; default: break; } m_imageViewer.GetSliceRange(ref m_minSliceNumber, ref m_maxSliceNumber); vtkRenderWindowInteractor interactor = aRenderWindow.GetInteractor(); m_renderer = aRenderWindow.GetRenderers().GetFirstRenderer(); m_renderer.SetBackground(0.0, 0.0, 0.0); m_imageViewer.SetRenderWindow(aRenderWindow); //m_imageViewer.SetupInteractor(interactor); aRenderWindow.GetRenderers().InitTraversal(); m_currentSlice = m_minSliceNumber + (m_maxSliceNumber - m_minSliceNumber) / 2; m_imageViewer.SetSlice(m_currentSlice); m_scalarrange = new double[2]; m_scalarrange = m_imageViewer.GetInput().GetScalarRange(); if (!m_initialized) { m_threshold = new Segament_Threshold(); m_threshold.Min_Threshold = 0; m_threshold.Max_Threshold = m_scalarrange[1]; } m_initialized = true; } Thanks Liu Peng -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Sun Mar 20 11:14:24 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Sun, 20 Mar 2016 09:14:24 -0600 Subject: [vtkusers] Error "The interactor must be set prior to enabling the widget" using vtkResliceImageViewer In-Reply-To: <438ed7a9.4.15394832da9.Coremail.tjlp@netease.com> References: <438ed7a9.4.15394832da9.Coremail.tjlp@netease.com> Message-ID: On Sun, Mar 20, 2016 at 8:52 AM, Liu_tj wrote: > Hi, VTK guys, > > I am using Activiz VTK 7.0 for my C# application. I try to > use vtkResliceImageViewer to display DICOM axial, coronal or saggital view. > The vtkRenderWindow is defined in a WPF user control. When I run my > application, I get this error reported: > > ERROR: In ..\..\..\VTK-7.0\Interaction\Widgets\vtkAbstractWidget.cxx, line > 118 > vtkResliceCursorWidget (0000000025A638B0): The interactor must be set > prior to enabling the widget > > ERROR: In ..\..\..\VTK-7.0\Interaction\Widgets\vtkAbstractWidget.cxx, line > 118 > vtkResliceCursorWidget (0000000025A638B0): The interactor must be set > prior to enabling the widget > > Below is my code. Do I miss any step? > I don't use vtkResliceImageViewer, but my guess is that since you call SetRenderWindow(), you should also call SetRenderer() and SetupInteractor(). You can get the renderer from the render window with GetRenderer(), but you will probably have to create your own interactor. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Sun Mar 20 16:47:07 2016 From: dave.demarle at kitware.com (David E DeMarle) Date: Sun, 20 Mar 2016 16:47:07 -0400 Subject: [vtkusers] Migrating vtkbool standalone to vtk7 In-Reply-To: <1336610015.1150474.1458385486661.JavaMail.yahoo@mail.yahoo.com> References: <1336610015.1150474.1458385486661.JavaMail.yahoo.ref@mail.yahoo.com> <1336610015.1150474.1458385486661.JavaMail.yahoo@mail.yahoo.com> Message-ID: See this: http://www.vtk.org/Wiki/VTK/Build_System_Migration and likely this: http://www.vtk.org/Wiki/VTK/VTK_6_Migration_Guide David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Sat, Mar 19, 2016 at 7:04 AM, Constantinescu Mihai via vtkusers < vtkusers at vtk.org> wrote: > I'm trying to compile the standalone lib: zippy84/vtkbool > for vtk 7. My main issue is that > after version 6, classes like vtkcommon got split into other modules. > Having: > set(vtk_libs > vtkCommon > vtkFiltering > vtkIO > > vtkGraphics) > > in the *CMakeLists.txt, *how to convert that into its equivalent for vtk > 7? > zippy84/vtkbool > vtkbool - A standalone boolean filter for VTK. > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dakota_63124 at yahoo.com Sun Mar 20 19:48:55 2016 From: dakota_63124 at yahoo.com (kent myers) Date: Sun, 20 Mar 2016 16:48:55 -0700 (MST) Subject: [vtkusers] Using vtkAreaPicker from Java Message-ID: <1458517735267-5737306.post@n5.nabble.com> I am trying to use vtkAreaPicker from Java. I based the code below on examples I found. If I type "r", this activates the rubberband selector, but my callback is not called after drawing the selection rectangle and releasing the mouse button. I have tried "CharEvent" and "InteractionEvent", but neither works. I would also like to know how to force the mouse selection to be immediately active without typing "r". Thanks for any help someone can provide. Kent public void selectWindowMenuItemActionPerformed(ActionEvent evt) { // select any objects (even if obstructed) display.setVisibleSelection(false); vtkRenderWindowInteractor renderWindowInteractor = renWin.getRenderWindowInteractor(); vtkAreaPicker areaPicker = new vtkAreaPicker(); renderWindowInteractor.SetPicker(areaPicker); vtkInteractorStyleRubberBandPick style = new vtkInteractorStyleRubberBandPick(); renderWindowInteractor.SetInteractorStyle(style); areaPicker.AddObserver("CharEvent",this,"areaPickCallback"); renderWindowInteractor.Start(); } public void areaPickCallback() { vtkAreaPicker areaPicker = (vtkAreaPicker) renWin.getRenderWindowInteractor().GetPicker(); vtkProp3DCollection props = areaPicker.GetProp3Ds(); for(int i = 0; i < props.GetNumberOfItems(); i++) { vtkProp3D prop = props.GetNextProp3D(); } } -- View this message in context: http://vtk.1045678.n5.nabble.com/Using-vtkAreaPicker-from-Java-tp5737306.html Sent from the VTK - Users mailing list archive at Nabble.com. From tjlp at netease.com Sun Mar 20 22:00:02 2016 From: tjlp at netease.com (Liu_tj) Date: Mon, 21 Mar 2016 10:00:02 +0800 (CST) Subject: [vtkusers] Error "The interactor must be set prior to enabling the widget" using vtkResliceImageViewer In-Reply-To: References: <438ed7a9.4.15394832da9.Coremail.tjlp@netease.com> Message-ID: <40c47db7.c.15396e68371.Coremail.tjlp@netease.com> Hi, David, I thought vtkResliceViewer provides the method SliceScrollOnMouseWheelOn() which support DICOM slice switching according to the mouse wheel forward or backward. If we don't use vtkResliceViewer, what class do you use for displaying the three 2D views of DICOM supporting reslice? Thanks Liu Peng ?2016-03-20?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?20? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: [vtkusers] Error "The interactor must be set prior to enabling the widget" using vtkResliceImageViewer On Sun, Mar 20, 2016 at 8:52 AM, Liu_tj wrote: Hi, VTK guys, I am using Activiz VTK 7.0 for my C# application. I try to use vtkResliceImageViewer to display DICOM axial, coronal or saggital view. The vtkRenderWindow is defined in a WPF user control. When I run my application, I get this error reported: ERROR: In ..\..\..\VTK-7.0\Interaction\Widgets\vtkAbstractWidget.cxx, line 118 vtkResliceCursorWidget (0000000025A638B0): The interactor must be set prior to enabling the widget ERROR: In ..\..\..\VTK-7.0\Interaction\Widgets\vtkAbstractWidget.cxx, line 118 vtkResliceCursorWidget (0000000025A638B0): The interactor must be set prior to enabling the widget Below is my code. Do I miss any step? I don't use vtkResliceImageViewer, but my guess is that since you call SetRenderWindow(), you should also call SetRenderer() and SetupInteractor(). You can get the renderer from the render window with GetRenderer(), but you will probably have to create your own interactor. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Sun Mar 20 23:18:32 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Sun, 20 Mar 2016 21:18:32 -0600 Subject: [vtkusers] Error "The interactor must be set prior to enabling the widget" using vtkResliceImageViewer In-Reply-To: <40c47db7.c.15396e68371.Coremail.tjlp@netease.com> References: <438ed7a9.4.15394832da9.Coremail.tjlp@netease.com> <40c47db7.c.15396e68371.Coremail.tjlp@netease.com> Message-ID: On Sun, Mar 20, 2016 at 8:00 PM, Liu_tj wrote: > Hi, David, > > I thought vtkResliceViewer provides the method SliceScrollOnMouseWheelOn() > which support DICOM slice switching according to the mouse wheel forward or > backward. If we don't use vtkResliceViewer, what class do you use for > displaying the three 2D views of DICOM supporting reslice? Hi Liu Peng, I'm the wrong person to ask for advice on this, because I hardly ever use the VTK interactors or widgets. I have my own interaction code that I use instead. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjlp at netease.com Mon Mar 21 10:20:31 2016 From: tjlp at netease.com (Liu_tj) Date: Mon, 21 Mar 2016 22:20:31 +0800 (CST) Subject: [vtkusers] How to show the cross hairs for vtkResliceImageViewer Message-ID: <490ce325.1e.153998c71c6.Coremail.tjlp@netease.com> Hi, VTK guys, I use vtkResliceImageViewer to display DICOM series. But the 2 cross hairs are not displayed. How to show it? The reslice mode to axis-aligned. The GreyToColors() function adds LookupTable for the image viewer. My code below: private void Display2(vtkRenderWindow aRenderWindow, vtkImageData aData) { if (aData == null) return; m_imageViewer = vtkResliceImageViewer.New(); vtkRenderWindowInteractor interactor = aRenderWindow.GetInteractor(); m_renderer = aRenderWindow.GetRenderers().GetFirstRenderer(); m_renderer.SetBackground(0.0, 0.0, 0.0); m_imageViewer.SetRenderWindow(aRenderWindow); m_imageViewer.SetupInteractor(interactor); m_imageViewer.SetRenderer(m_renderer); //aRenderWindow.GetRenderers().InitTraversal(); m_imageViewer.SetInputData(aData); m_imageViewer.SliceScrollOnMouseWheelOn(); m_imageViewer.SetResliceModeToAxisAligned(); //m_imageViewer.SetResliceModeToOblique(); vtkResliceCursorLineRepresentation rep = vtkResliceCursorLineRepresentation.SafeDownCast(m_imageViewer.GetResliceCursorWidget().GetRepresentation()); rep.GetResliceCursorActor().GetCursorAlgorithm().SetReslicePlaneNormal((int)m_sliceDirection); switch (m_sliceDirection) { case Direction.AXIAL: m_imageViewer.SetSliceOrientationToXY(); break; case Direction.CORONAL: m_imageViewer.SetSliceOrientationToYZ(); break; case Direction.SAGITTAL: m_imageViewer.SetSliceOrientationToXZ(); break; default: break; } m_imageViewer.SetThickMode(1); m_imageViewer.GetSliceRange(ref m_minSliceNumber, ref m_maxSliceNumber); m_currentSlice = m_minSliceNumber + (m_maxSliceNumber - m_minSliceNumber) / 2; m_imageViewer.SetSlice(m_currentSlice); m_scalarrange = new double[2]; m_scalarrange = m_imageViewer.GetInput().GetScalarRange(); if (!m_initialized) { m_threshold = new Segament_Threshold(); m_threshold.Min_Threshold = 0; m_threshold.Max_Threshold = m_scalarrange[1]; } GrayToColors(m_threshold); m_initialized = true; } private void GrayToColors( Segament_Threshold threshold) { vtkLookupTable colormap = vtkLookupTable.New(); double validmin = System.Math.Max(m_scalarrange[0], threshold.Min_Threshold); double validmax = System.Math.Min(m_scalarrange[1], threshold.Max_Threshold); int number = (int)(m_scalarrange[1] - m_scalarrange[0] + 1); colormap.SetRange(m_scalarrange[0], m_scalarrange[1]); colormap.SetNumberOfTableValues(number); colormap.Build(); //for (int i = (int)(scalarrange[0]); i < (int)(threshhold[0]); i++) //{ // colormap.SetTableValue(i - (int)scalarrange[0], 0.0, 0.0, 0.0, 0.0); //} for (int i = (int)(validmin); i <= (int)(validmax); i++) { colormap.SetTableValue(i - (int)m_scalarrange[0], RenderingColor.RENDERING_RED, RenderingColor.RENDERING_GREEN, RenderingColor.RENDERING_BLUE, 1.0); } for (int i = (int)(threshold.Max_Threshold) + 1; i < (int)(m_scalarrange[1]); i++) { colormap.SetTableValue(i - (int)m_scalarrange[0], 0.0, 0.0, 0.0, 0.0); } //vtkImageMapToColors colormapper = vtkImageMapToColors.New(); //colormapper.SetInputConnection(data); vtkImageMapToWindowLevelColors colormapper = m_imageViewer.GetWindowLevel(); colormapper.SetOutputFormatToRGB(); colormapper.SetLookupTable(colormap); colormapper.Update(); if (!m_initialized) m_colormapActor = vtkImageActor.New(); m_colormapActor.SetInputData(colormapper.GetOutput()); if (!m_initialized) m_renderer.AddActor(m_colormapActor); m_renderer.ResetCamera(); m_renderer.Modified(); m_imageViewer.Render(); } Thanks Liu Peng -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.martin at kitware.com Mon Mar 21 10:56:15 2016 From: ken.martin at kitware.com (Ken Martin) Date: Mon, 21 Mar 2016 10:56:15 -0400 Subject: [vtkusers] How to build VTK 7.0.0 for android? In-Reply-To: <20160321144257.AA83E4C0854@webmail.sinamail.sina.com.cn> References: <20160321144257.AA83E4C0854@webmail.sinamail.sina.com.cn> Message-ID: Currently we use the build process in VTK for applications, meaning that we take the examples in VTK/Examples/Android and edit them and then build VTK to get the examples built as well. The resulting executables are in CMakeExternals/Build/vtk-android/Examples/Android/... You can add VTK as a library into android studio but last I heard the process involves hand editing build files etc and it is not something I am familiar with. Ken On Mon, Mar 21, 2016 at 10:42 AM, wrote: > Hi Ken, > > > Thanks for your kindly reply. > > I have tried on OSX and build successfully. > > But I still don't know how to add vtk to my android studio project. > > Thanks a lot for your help again. > > > > ----- ???? ----- > ????Ken Martin > ????xiaoyu_543 at sina.com > ????vtkusers > ???Re: [vtkusers] How to build VTK 7.0.0 for android? > ???2016?03?17? 01?27? > > For VTK we currently use OSX or Linux for building Android. Windows has > some complexities that make it difficult to do the mixed build process we > use for Android. > > Thanks > Ken > > On Tue, Mar 15, 2016 at 10:55 AM, wrote: > > Hi everybody: > > > I want to build vtk 7.0.0 for android developing,below is my procedure and > problems i met. > > Please help to check,thanks . > > > Step 1. Download source file "VTK-7.0.0.zip > " from " > http://www.vtk.org/". > > Step 2. Config VTK in CMake like below and generate vtk.sln project: > > > Step 3. Build VTK.sln. I choose build all in debug mode and suffered 2 > errors: > > first error : > > 2> -- Build files have been written to: > D:/code/VTK-7.0.0-android-bin_3/CMakeExternals/Build/vtk-compile-tools > > 2> Performing build step for 'vtk-compile-tools' > 2> make: *** No rule to make target `vtkCompileTools'. Stop. > > 2>C:\Program Files > (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): > error MSB6006: ?cmd.exe? exited with code 2. > > > second error: > > 3> CMake Error at CMakeLists.txt:29 (project): > 3> CMAKE_SYSTEM_NAME is 'Android' but 'NVIDIA Nsight Tegra Visual Studio > 3> Edition' is not installed. > 3> > 3> > 3> -- Configuring incomplete, errors occurred! > 3> See also > "D:/code/VTK-7.0.0-android-bin_3/CMakeExternals/Build/vtk-android/CMakeFiles/CMakeOutput.log". > 3>C:\Program Files > (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): > error MSB6006: ?cmd.exe? exited with code 1. > > > I find some response from url " > https://blog.kitware.com/building-vtk-for-mobile-architectures/". > > But I still don't understand how i can do to build VTK for Android > correctly. > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 xiaoyu_543 at sina.com Mon Mar 21 10:42:57 2016 From: xiaoyu_543 at sina.com (xiaoyu_543 at sina.com) Date: Mon, 21 Mar 2016 22:42:57 +0800 Subject: [vtkusers] =?gbk?b?u9i4tKO6UmU6ICBIb3cgdG8gYnVpbGQgVlRLIDcuMC4w?= =?gbk?q?_for_android=3F?= Message-ID: <20160321144257.AA83E4C0854@webmail.sinamail.sina.com.cn> Hi Ken, Thanks for your kindly reply.I have tried on OSX and build successfully.But I still don't know how to add vtk to my android studio project.Thanks a lot for your help again. ----- ???? ----- ????Ken Martin ????xiaoyu_543 at sina.com ????vtkusers ???Re: [vtkusers] How to build VTK 7.0.0 for android? ???2016?03?17? 01?27? For VTK we currently use OSX or Linux for building Android. Windows has some complexities that make it difficult to do the mixed build process we use for Android. ThanksKen On Tue, Mar 15, 2016 at 10:55 AM, wrote: Hi everybody: I want to build vtk 7.0.0 for android developing,below is my procedure and problems i met.Please help to check,thanks . Step 1. Download source file "VTK-7.0.0.zip" from "http://www.vtk.org/". Step 2. Config VTK in CMake like below and generate vtk.sln project: Step 3. Build VTK.sln. I choose build all in debug mode and suffered 2 errors:first error : 2> -- Build files have been written to: D:/code/VTK-7.0.0-android-bin_3/CMakeExternals/Build/vtk-compile-tools2> Performing build step for 'vtk-compile-tools' 2> make: *** No rule to make target `vtkCompileTools'. Stop. 2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: ?cmd.exe? exited with code 2. second error:3> CMake Error at CMakeLists.txt:29 (project): 3> CMAKE_SYSTEM_NAME is 'Android' but 'NVIDIA Nsight Tegra Visual Studio 3> Edition' is not installed. 3> 3> 3> -- Configuring incomplete, errors occurred! 3> See also "D:/code/VTK-7.0.0-android-bin_3/CMakeExternals/Build/vtk-android/CMakeFiles/CMakeOutput.log". 3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: ?cmd.exe? exited with code 1. I find some response from url "https://blog.kitware.com/building-vtk-for-mobile-architectures/".But I still don't understand how i can do to build VTK for Android correctly. _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: 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 PhDChairman & 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 xiaoyu_543 at sina.com Mon Mar 21 11:18:00 2016 From: xiaoyu_543 at sina.com (xiaoyu_543 at sina.com) Date: Mon, 21 Mar 2016 23:18:00 +0800 Subject: [vtkusers] How to add VTK to android studio project? Message-ID: <20160321151800.AD8764C007C@webmail.sinamail.sina.com.cn> Hi , I have built VTK for android successfully.But I still don't know how to add VTK to my android studio project.I want to make a android app using VTK running on android mobile or pad.I think maybe I can add VTK such as lib ,but how?1.add some files built 2.need other process to get other files Does anyone can help?Thanks very much for your kindly help? -------------- next part -------------- An HTML attachment was scrubbed... URL: From berk.geveci at kitware.com Mon Mar 21 11:27:48 2016 From: berk.geveci at kitware.com (Berk Geveci) Date: Mon, 21 Mar 2016 11:27:48 -0400 Subject: [vtkusers] CFP: EGPGV 2016 Visualization Showcase extended deadline 1 Apr 2016 Message-ID: [We apologize if you receive multiple copies of this message.] ------------------------------------------------------------ ---------------------------------------------------------------------- >>>>CFP VISUALIZATION SHOWCASES -- EXTENDED DEADLINE ------------------------------------------------------------ ---------------------------------------------------------------------- Eurographics 2016 Symposium on Parallel Graphics and Visualization (EGPGV 2016) ========================================================================= June 6-7, 2016, Groningen, the Netherlands Co-located with EuroVis 2016 www.egpgv.org Second Call for Visualization Showcases -- Extended Deadline ================================================= This year EGPGV presents the second edition of the Visualization Showcase. This track provides a forum for the year's most instrumental movies in parallel graphics and visualization. Finalists will compete for the Best Visualization Award, and each finalist will present his or her movie during a dedicated session at EGPGV '16 in a 10-minute presentation. Movies are judged based on how they illuminate science, by the quality of the movie, and for innovations in the process used for creating the movie. Accepted submissions will appear as short papers in the symposium proceedings. Review and selection process for Visualization Showcases ================================================ Submissions need to include a movie (up to 150MB in size) and a short paper (up to 4 pages including references). The short paper should describe the scientific story conveyed by the movie, how the visualization helps scientific discovery, and the "state-of-the-practice" information behind making the movie. Each showcase submission will be peer-reviewed by the EGPGV International Program Committee. Criteria for revision include: * Compelling visualization * Visualizing data involving parallel graphics and/or parallel visualization in a significant way (e.g., data size, parallel processing, parallel rendering) * Meaningful and compelling science story * Description of visualization techniques necessary to accomplish the movie Important Dates ================= Showcase Submission: April 1, 2016 Author Notification: April 15, 2016 Camera-Ready Submission: April 25, 2016 Symposium: June 6-7, 2016 Submission Information ================== To submit a visualization showcase, upload the paper (formatted using the Latex templates provided on the symposium?s website) and the accompanying movie in the ?Visualization Showcase? track on the PCS system (precisionconference.com/~vgtc). More information is available on the symposium website (http://www.vis.uni-stuttgart.de/egpgv/egpgv2016). Symposium Chair ================= Alexandru Telea, University of Groningen, the Netherlands Program Chairs =============== Wes Bethel, Lawrence Berkeley National Laboratory, USA Enrico Gobbetti, CRS4, Italy Program Committee ================== Marco Ament, Karlsruhe Institute of Technology, Germany Ulf Assarsson, Chalmers University, Sweden Janine Bennett, SANDIA Labs, USA Hank Childs, Lawrence Berkeley National Laboratory, USA Kurt Debattista, University of Warwick, UK Stefan Eilemann, ?cole Polytechnique F?d?rale de Lausanne, Switzerland Elmar Eisemann, TU Delft, the Netherlands Kelly Gaither, University Texas/Austin, USA Christoph Garth, University of Kaiserslautern, Germany Berk Geveci, Kitware, USA Michael Guthe, University of Bayreuth, Germany Andrei Jalba, TU Eindhoven, the Netherlands Jens Kr?ger, University Duisburg-Essen, Germany Torsten Kuhlen, RWTH Aachen University, Germany Fabio Marton, CRS4, Italy Patrick McCormick, Los Alamos National Laboratory, USA Kenneth Moreland, Sandia National Laboratories, USA Renato Pajarola, University of Z?rich, Switzerland Bruno Raffin, INRIA Grenoble, France Filip Sadlo, University of Heidelberg, Germany Daniel Weiskopf, University of Stuttgart, Germany Michael Wimmer, Technische Universit?t Wien, Austria -------------- next part -------------- An HTML attachment was scrubbed... URL: From bruno.manata.oliveira at gmail.com Mon Mar 21 13:46:54 2016 From: bruno.manata.oliveira at gmail.com (Bruno Oliveira) Date: Mon, 21 Mar 2016 17:46:54 +0000 Subject: [vtkusers] Render sun Message-ID: Hello, I am trying to render 2 planets, e.g., earth and the Sun. I can render the earth properly (distance to camera is around 2e8 m). However, I can't make the sun appear (distance to camera around 1e12m) I am setting the camera depth limit properly, with correct values in camera->SetClippingRange(near, far); but the sun just isnt rendered: i am not sure if it is occluded by the planet or I am forgetting something? And another question, how can I create a light that mimics the sun? so that I can see it shining on the image behind the planet? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bruno.manata.oliveira at gmail.com Mon Mar 21 14:54:33 2016 From: bruno.manata.oliveira at gmail.com (Bruno Oliveira) Date: Mon, 21 Mar 2016 18:54:33 +0000 Subject: [vtkusers] Offscreen rendering with no window Message-ID: Hello, I am trying to perform offscreen rendering with the code below. But a system window still apperas (with nothing rendered on it, ofcourse). I dont want to create that window, how can I do that? renderer = vtkSmartPointer::New(); renderWindow = vtkSmartPointer::New(); if (offscreen) { renderWindow->SetOffScreenRendering(1); } renderWindow->AddRenderer(renderer); renderWindow->SetAlphaBitPlanes(0); //disable usage of alpha channel renderWindowInteractor = vtkSmartPointer::New(); renderWindowInteractor->SetRenderWindow(renderWindow); vtkSmartPointer style = vtkSmartPointer< vtkInteractorStyleTrackballCamera>::New(); renderWindowInteractor->SetInteractorStyle(style); renderer->ResetCamera(); renderWindow->Render(); -------------- next part -------------- An HTML attachment was scrubbed... URL: From jothybasu at gmail.com Tue Mar 22 02:29:25 2016 From: jothybasu at gmail.com (Jothybasu Selvaraj) Date: Tue, 22 Mar 2016 17:29:25 +1100 Subject: [vtkusers] Change position of text in vtkImagePlaneWidget Message-ID: Hi All I want to change the position of the vtkTextActor (which displays the image data value and window level/width). By default its on the lower left corner, I already have something displayed there. How can I do this? Any hints? Thanks Jothy -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Tue Mar 22 09:45:32 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Tue, 22 Mar 2016 08:45:32 -0500 Subject: [vtkusers] Change position of text in vtkImagePlaneWidget In-Reply-To: References: Message-ID: http://www.vtk.org/doc/nightly/html/classvtkActor2D.html#aaca4703dddf59c9bdcf5773f5025a508 or http://www.vtk.org/doc/nightly/html/classvtkActor2D.html#afb72d3b2dbb0a5860f6fc7d46943b637 On Tue, Mar 22, 2016 at 1:29 AM, Jothybasu Selvaraj wrote: > Hi All > > I want to change the position of the vtkTextActor (which displays the image > data value and window level/width). By default its on the lower left corner, > I already have something displayed there. How can I do this? > > Any hints? > > Thanks > > > Jothy > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 R&D Engineer Kitware, Inc. From onlyjus at gmail.com Tue Mar 22 11:53:15 2016 From: onlyjus at gmail.com (Justin Weber) Date: Tue, 22 Mar 2016 11:53:15 -0400 Subject: [vtkusers] Autodesk ViewCube in VTK? Message-ID: Has anyone already implemented a similar interface to Autodesk's ViewCube in vtk? [image: Inline image 1] https://knowledge.autodesk.com/support/inventor-products/learn-explore/caas/CloudHelp/cloudhelp/2014/ENU/Inventor/files/GUID-39793B52-120D-491B-B1A0-A93ECE9AF13E-htm.html if not, *vtkAnnotatedCubeActor* and the *vtkOrientationMarkerWidget* provide most of the functionality. How would I detect mouse clicks on the faces of the cube? Over-ride the OnLeftButtonDown() and OnLeftButtonUp() functions of *vtkOrientationMarkerWidget* and detect the face that was clicked? Thanks! Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 13373 bytes Desc: not available URL: From tluisrs at gmail.com Tue Mar 22 12:29:41 2016 From: tluisrs at gmail.com (Thales Luis Rodrigues Sabino) Date: Tue, 22 Mar 2016 13:29:41 -0300 Subject: [vtkusers] Autodesk ViewCube in VTK? In-Reply-To: References: Message-ID: I was thinking about some widget similar to this a while ago. If you know of anyone who has already implemented this please let us know. On Tue, Mar 22, 2016 at 12:53 PM, Justin Weber wrote: > Has anyone already implemented a similar interface to Autodesk's ViewCube > in vtk? > [image: Inline image 1] > > https://knowledge.autodesk.com/support/inventor-products/learn-explore/caas/CloudHelp/cloudhelp/2014/ENU/Inventor/files/GUID-39793B52-120D-491B-B1A0-A93ECE9AF13E-htm.html > > if not, *vtkAnnotatedCubeActor* and the *vtkOrientationMarkerWidget* provide > most of the functionality. How would I detect mouse clicks on the faces of > the cube? Over-ride the OnLeftButtonDown() and OnLeftButtonUp() functions > of *vtkOrientationMarkerWidget* and detect the face that was clicked? > > Thanks! > Justin > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 > > -- Thales Luis Rodrigues Sabino PhD Student at PGMC-UFJF Lattes | LinkedIn | ResearchGate -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 13373 bytes Desc: not available URL: From inglis.dl at gmail.com Tue Mar 22 12:52:27 2016 From: inglis.dl at gmail.com (DL I) Date: Tue, 22 Mar 2016 12:52:27 -0400 Subject: [vtkusers] Change position of text in vtkImagePlaneWidget In-Reply-To: References: Message-ID: Hi Jothy When the widget it first instantiate it calls GenerateText() and sets its default position to the lower left corner of the renderer: vtkCoordinate* coord = this->TextActor->GetPositionCoordinate(); coord->SetCoordinateSystemToNormalizedViewport(); coord->SetValue(.01, .01); so after instantiating the widget, you could do once: - search the renderer's props for a vtkTextActor, since there is no API to get it directly from the widget - then get the position coordinate and change its value as shown above or per Cory's comments in this thread Dean On Tue, Mar 22, 2016 at 9:45 AM, Cory Quammen wrote: > > http://www.vtk.org/doc/nightly/html/classvtkActor2D.html#aaca4703dddf59c9bdcf5773f5025a508 > > or > > > http://www.vtk.org/doc/nightly/html/classvtkActor2D.html#afb72d3b2dbb0a5860f6fc7d46943b637 > > > On Tue, Mar 22, 2016 at 1:29 AM, Jothybasu Selvaraj > wrote: > > Hi All > > > > I want to change the position of the vtkTextActor (which displays the > image > > data value and window level/width). By default its on the lower left > corner, > > I already have something displayed there. How can I do this? > > > > Any hints? > > > > Thanks > > > > > > Jothy > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Please keep messages on-topic and check the VTK FAQ at: > > 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 > 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 jan.hirsch at st.ovgu.de Tue Mar 22 13:45:44 2016 From: jan.hirsch at st.ovgu.de (jhirsch) Date: Tue, 22 Mar 2016 10:45:44 -0700 (MST) Subject: [vtkusers] Set ScalarOpacityUnitDistance correctly? Message-ID: <1458668744352-5737323.post@n5.nabble.com> Hello, maybe it seems like a naive question, but how can I set the 'right' value for ScalarOpacityUnitDistance from a vtkVolumeProperty object? I'm doing a volume rendering with a vtkProjectedTetrahedraMapper and depending on the ScalarOpacityUnitDistance value I either see something or not. My guess is, that it has something to do with the size of the volume... For example, when I leave this value untouched (default=1.0) there is nothing to see for my current data set. When I set it to something like 0.0003 the rendering looks OK but when I have only a part of the volume (like a thin surface) I have to set ScalarOpacityUnitDistance to something like 0.00015. Then the surface appears. I don't want to guess the right value for every set of data I got, so what are the properties and circumstances I have to consider? Thanks in advance! -- View this message in context: http://vtk.1045678.n5.nabble.com/Set-ScalarOpacityUnitDistance-correctly-tp5737323.html Sent from the VTK - Users mailing list archive at Nabble.com. From david.gobbi at gmail.com Tue Mar 22 14:45:16 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 22 Mar 2016 12:45:16 -0600 Subject: [vtkusers] Set ScalarOpacityUnitDistance correctly? In-Reply-To: <1458668744352-5737323.post@n5.nabble.com> References: <1458668744352-5737323.post@n5.nabble.com> Message-ID: Hi Jan, As a rough guide, get an estimate of the thickness of the volume (e.g. from the bounding box returned by mapper->GetBounds()) and multiply by 0.001 to get a useful ScalarOpacityUnitDistance. This should hopefully provide a qualitatively useful result, you can tweak the factor until you get something that works. If you want thin surface to be more opaque, then use a gradient opacity function to make the boundary itself more opaque. - David On Tue, Mar 22, 2016 at 11:45 AM, jhirsch wrote: > Hello, > maybe it seems like a naive question, but how can I set the 'right' value > for ScalarOpacityUnitDistance from a vtkVolumeProperty object? > I'm doing a volume rendering with a vtkProjectedTetrahedraMapper and > depending on the ScalarOpacityUnitDistance value I either see something or > not. My guess is, that it has something to do with the size of the > volume... > > For example, when I leave this value untouched (default=1.0) there is > nothing to see for my current data set. When I set it to something like > 0.0003 the rendering looks OK but when I have only a part of the volume > (like a thin surface) I have to set ScalarOpacityUnitDistance to something > like 0.00015. Then the surface appears. > > I don't want to guess the right value for every set of data I got, so what > are the properties and circumstances I have to consider? > > Thanks in advance! > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jothybasu at gmail.com Tue Mar 22 19:20:10 2016 From: jothybasu at gmail.com (Jothybasu Selvaraj) Date: Wed, 23 Mar 2016 10:20:10 +1100 Subject: [vtkusers] Change position of text in vtkImagePlaneWidget In-Reply-To: References: Message-ID: Thanks Inglis TextActor is protected so you can't use TextActor->getPositionCoordinate() Jothy On Wed, Mar 23, 2016 at 3:52 AM, DL I wrote: > Hi Jothy > > When the widget it first instantiate it calls GenerateText() and sets its > default position to the lower left corner of the renderer: > vtkCoordinate* coord = this->TextActor->GetPositionCoordinate(); > coord->SetCoordinateSystemToNormalizedViewport(); > coord->SetValue(.01, .01); > > so after instantiating the widget, you could do once: > - search the renderer's props for a vtkTextActor, since there is no API to > get it directly from the widget > - then get the position coordinate and change its value as shown above or > per Cory's comments in this thread > > Dean > > > > On Tue, Mar 22, 2016 at 9:45 AM, Cory Quammen > wrote: > >> >> http://www.vtk.org/doc/nightly/html/classvtkActor2D.html#aaca4703dddf59c9bdcf5773f5025a508 >> >> or >> >> >> http://www.vtk.org/doc/nightly/html/classvtkActor2D.html#afb72d3b2dbb0a5860f6fc7d46943b637 >> >> >> On Tue, Mar 22, 2016 at 1:29 AM, Jothybasu Selvaraj >> wrote: >> > Hi All >> > >> > I want to change the position of the vtkTextActor (which displays the >> image >> > data value and window level/width). By default its on the lower left >> corner, >> > I already have something displayed there. How can I do this? >> > >> > Any hints? >> > >> > Thanks >> > >> > >> > Jothy >> > >> > _______________________________________________ >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at >> > http://www.kitware.com/opensource/opensource.html >> > >> > Please keep messages on-topic and check the VTK FAQ at: >> > 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 >> 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 sermr at nus.edu.sg Wed Mar 23 04:02:12 2016 From: sermr at nus.edu.sg (Martin Reed) Date: Wed, 23 Mar 2016 08:02:12 +0000 Subject: [vtkusers] Python and VTK with multiprocessing or joblib libraries Message-ID: Hi All, I am trying to parallelize a ray tracing algorithm in VTK with the python wrapper. I have the core algo working but now need to port it onto a multicore machine. *) 2 vtkPoints objects that represent the points on a building and the points on a skydome. *) vtkOBBTree object that represents the surrounding objects that potentially block the rays *) evaluate so get a true/false value for whether the ray intersects with anything in between (IntersectWithLine method of obbTree) What is the best way to parallelize this? I have tried joblib and multiprocessing but have an issue with 'pickling', seems vtk objects cannot be pickled for use with these libraries(?) Any recommendations/examples on how best to do this? Thanks, martin ________________________________ Important: This email is confidential and may be privileged. If you are not the intended recipient, please delete it and notify us immediately; you should not copy or use it for any purpose, nor disclose its contents to any other person. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ysa0829 at gmail.com Wed Mar 23 05:45:23 2016 From: ysa0829 at gmail.com (Ang) Date: Wed, 23 Mar 2016 02:45:23 -0700 (MST) Subject: [vtkusers] VTKImageResliceMapper SetClippingPlanes problems Message-ID: <1458726323146-5737327.post@n5.nabble.com> Hi all, I face a problem in vtk 7.0.0 in rendering back end OpenGL2. in vtk 6.0.0, I use the function SetClippingPlanes,and I can see the clip range in display image data. but in vtk 7.0.0 I do the same thing what I do in vtk6.0.0, I cant see any change in display image data. is it a bug? -- View this message in context: http://vtk.1045678.n5.nabble.com/VTKImageResliceMapper-SetClippingPlanes-problems-tp5737327.html Sent from the VTK - Users mailing list archive at Nabble.com. From oneiros.valente at gmail.com Wed Mar 23 06:31:48 2016 From: oneiros.valente at gmail.com (Lorenzo) Date: Wed, 23 Mar 2016 10:31:48 +0000 (UTC) Subject: [vtkusers] Can't transform a vtkVolume References: Message-ID: Hi Aashish Sorry for the late reply I confirm that everything works fine now, also the rotations. I just downloaded the source from the master and recompiled VTK. THANK YOU! From aashish.chaudhary at kitware.com Wed Mar 23 09:29:09 2016 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Wed, 23 Mar 2016 09:29:09 -0400 Subject: [vtkusers] Can't transform a vtkVolume In-Reply-To: References: Message-ID: Great to hear this. While I was at it, I fixed some other issues as well for example FBO's were not complete. Thanks for your feedback, it's nice to close the loop. Thanks, On Wed, Mar 23, 2016 at 6:31 AM, Lorenzo wrote: > Hi Aashish > Sorry for the late reply > > I confirm that everything works fine now, also the rotations. I just > downloaded the source from the master and recompiled VTK. > 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 > -- *| Aashish Chaudhary | Technical Leader | Kitware Inc. * *| http://www.kitware.com/company/team/chaudhary.html * -------------- next part -------------- An HTML attachment was scrubbed... URL: From neel at aerosoftinc.com Wed Mar 23 10:06:54 2016 From: neel at aerosoftinc.com (Reece Neel) Date: Wed, 23 Mar 2016 10:06:54 -0400 Subject: [vtkusers] VTK_POLYHEDRON display and cutting issue Message-ID: <56F2A2FE.6060300@aerosoftinc.com> I'm using a vtkUnstructuredGrid to make polyhedrons of different shapes. For example, I have a test routine that creates four polyhedrons of the following shapes: a cube, a pyramid, a prism, and a tetrahedra. The polyhedrons are all connected. I then use a cutter to cut through the resulting object. Several issues that I've observed: (1) The cutter does not do a complete cut through all the polyhedrons. (2) One of the faces does not render shaded (when shading is on). (3) Changing the order of the prism faces changes the cutting (makes it cut correctly). I've commented this out in the included code, line 191. I've attached the routine in C and a picture of the results. I'm doing this in vtk 7.0. I'm applying this approach to more a more general case and I'm getting gaps in the cutting plane where it appears the cutting fails to cut select polyhedrons. I'm looking to see if I'm doing anything wrong or if there is a possible bug in the cutting and display of VTK_POLYHEDRON cells. Thanks, Reece -------------- next part -------------- #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // This function returns a vtkUnstructured grid corresponding to the object. vtkSmartPointer MakeFourPolyhedrons(); int TestCutterVTK(void) { std::string title; vtkSmartPointer textMapper; vtkSmartPointer textActor; vtkSmartPointer uGrid; vtkSmartPointer mapper1; vtkSmartPointer mapper2; vtkSmartPointer actor1; vtkSmartPointer actor2; vtkSmartPointer renderer; uGrid = MakeFourPolyhedrons(); title = "Polyhedrons"; vtkSmartPointer renWin = vtkSmartPointer::New(); renWin->SetSize(600, 600); renWin->SetWindowName("Polyhedron Demonstration"); vtkSmartPointer iRen = vtkSmartPointer::New(); iRen->SetRenderWindow(renWin); // Create one text property for all vtkSmartPointer textProperty = vtkSmartPointer::New(); textProperty->SetFontSize(10); textProperty->SetJustificationToCentered(); // Create and link the mapper, actor, and renderer together. textMapper = vtkSmartPointer::New(); textActor = vtkSmartPointer::New(); mapper1 = vtkSmartPointer::New(); mapper2 = vtkSmartPointer::New(); actor1 = vtkSmartPointer::New(); actor2 = vtkSmartPointer::New(); renderer = vtkSmartPointer::New(); // Geometric filter vtkGeometryFilter *filterGrid = vtkGeometryFilter::New(); filterGrid->SetInputData(uGrid); filterGrid->Update(); // Plane for cutting vtkSmartPointer p3d = vtkSmartPointer::New(); p3d->SetOrigin(0.5,0.5,0.2); p3d->SetNormal(0,0,1); // Cutter vtkSmartPointer cutter = vtkSmartPointer::New(); cutter->SetCutFunction(p3d); cutter->SetInputData(uGrid); cutter->Update(); vtkPolyData* output = vtkPolyData::SafeDownCast(cutter->GetOutputDataObject(0)); printf("Cutter: Number of cells = %d \n",(int)cutter->GetOutput()->GetNumberOfCells()); mapper1->SetInputData(uGrid); mapper2->SetInputData(output); // actor for cells/grid actor1->SetMapper(mapper1); //actor1->GetProperty()->SetRepresentationToWireframe(); actor1->GetProperty()->SetOpacity(1.0); // actor for the cutter actor2->SetMapper(mapper2); actor2->GetProperty()->SetRepresentationToWireframe(); actor2->GetProperty()->SetColor(255, 0, 0); renderer->AddViewProp(actor1); renderer->AddViewProp(actor2); textMapper->SetInput(title.c_str()); textActor->SetMapper(textMapper); textActor->SetPosition(50, 10); renderer->AddViewProp(textActor); renWin->AddRenderer(renderer); // trackball style vtkInteractorStyleTrackballCamera *style = vtkInteractorStyleTrackballCamera::New(); iRen->SetInteractorStyle(style); // Viewport/Renderer set up int rendererSize = 600; renWin->SetSize(rendererSize, rendererSize); // (xmin, ymin, xmax, ymax) double viewport[4] = {0.0, 0.0, (double)rendererSize, (double)rendererSize}; renderer->SetViewport(viewport); renderer->SetBackground(.2, .3, .4); renderer->ResetCamera(); renderer->GetActiveCamera()->Azimuth(30); renderer->GetActiveCamera()->Elevation(-30); renderer->GetActiveCamera()->Zoom(0.85); renderer->ResetCameraClippingRange(); iRen->Initialize(); renWin->Render(); iRen->Start(); return EXIT_SUCCESS; } vtkSmartPointer MakeFourPolyhedrons() { // Make four polyhedrons that consists of a cube, // a pyramid, a prism, and a tetrahedra vtkSmartPointer points = vtkSmartPointer::New(); points->InsertNextPoint( 0.0, 0.0, 0.0); points->InsertNextPoint( 1.0, 0.0, 0.0); points->InsertNextPoint( 1.0, 1.0, 0.0); points->InsertNextPoint( 0.0, 1.0, 0.0); points->InsertNextPoint( 0.0, 0.0, 1.0); points->InsertNextPoint( 1.0, 0.0, 1.0); points->InsertNextPoint( 1.0, 1.0, 1.0); points->InsertNextPoint( 0.0, 1.0, 1.0); points->InsertNextPoint( 0.5, 1.5, 0.5); points->InsertNextPoint( 1.5, 0.5, 0.9); points->InsertNextPoint( 1.5, 0.5, 0.5); points->InsertNextPoint( 1.25, 0.5, -0.1); // Cube vtkIdType nFaceCube = 8; vtkIdType cubeFaces[30] = {4, 0, 1, 2, 3, 4, 0, 1, 5, 4, 4, 0, 3, 7, 4, 4, 3, 2, 6, 7, 4, 1, 2, 6, 5, 4, 4, 5, 6, 7}; // Pyramid vtkIdType nFacePyramid = 5; vtkIdType pyramidFaces[21] = {4, 3, 2, 7, 6, 3, 3, 2, 8, 3, 2, 6, 8, 3, 3, 7, 8, 3, 6, 7, 8}; // Prism (Wedge) vtkIdType nFacePrism = 5; vtkIdType prismFaces[23] = {4, 2, 10, 9, 6, 4, 2, 6, 5, 1, 4, 1, 5, 9, 10, 3, 1, 2, 10, 3, 5, 6, 9}; /* Changing to this gives a different result vtkIdType prismFaces[23] = {3, 1, 2, 10, 3, 5, 6, 9, 4, 2, 10, 9, 6, 4, 2, 6, 5, 1, 4, 1, 5, 9, 10}; */ // Tetrahedra vtkIdType nFaceTet = 4; vtkIdType tetFaces[16] = {3, 1, 11, 2, 3, 11, 10, 2, 3, 10, 11, 1, 3, 1, 2, 10}; vtkSmartPointer uGrid = vtkSmartPointer::New(); uGrid->InsertNextCell(VTK_POLYHEDRON, nFaceCube, cubeFaces); uGrid->InsertNextCell(VTK_POLYHEDRON, nFacePyramid, pyramidFaces); uGrid->InsertNextCell(VTK_POLYHEDRON, nFacePrism, prismFaces); uGrid->InsertNextCell(VTK_POLYHEDRON, nFaceTet, tetFaces); uGrid->SetPoints(points); return uGrid; } -------------- next part -------------- A non-text attachment was scrubbed... Name: polyhedronCut.png Type: image/png Size: 12567 bytes Desc: not available URL: From jan.hirsch at st.ovgu.de Wed Mar 23 14:15:47 2016 From: jan.hirsch at st.ovgu.de (jhirsch) Date: Wed, 23 Mar 2016 11:15:47 -0700 (MST) Subject: [vtkusers] Set ScalarOpacityUnitDistance correctly? In-Reply-To: References: <1458668744352-5737323.post@n5.nabble.com> Message-ID: <1458756947429-5737331.post@n5.nabble.com> Hello David, thanks for the swift and sound answer! I took the diagonal length of the volume's bounding box. The renderings look good so far. Your consideration of a gradient opacity function may help to explore the volume in further detail. Thanks! -- View this message in context: http://vtk.1045678.n5.nabble.com/Set-ScalarOpacityUnitDistance-correctly-tp5737323p5737331.html Sent from the VTK - Users mailing list archive at Nabble.com. From bill.hoffman at kitware.com Wed Mar 23 14:18:07 2016 From: bill.hoffman at kitware.com (Bill Hoffman) Date: Wed, 23 Mar 2016 14:18:07 -0400 Subject: [vtkusers] CMake IDE integration survey Message-ID: <56F2DDDF.90302@kitware.com> Hi all, Microsoft is assembling a team to improve CMake support in Visual Studio. They are interested in gathering feedback from CMake users. They have created this survey, so if you are using VS and CMake, please fill this out: http://www.instant.ly/s/EwZKW Thanks. -Bill -- Bill Hoffman Kitware, Inc. 28 Corporate Drive Clifton Park, NY 12065 bill.hoffman at kitware.com http://www.kitware.com 518 881-4905 (Direct) 518 371-3971 x105 Fax (518) 371-4573 From julian.m.bouffard at erdc.dren.mil Wed Mar 23 14:38:08 2016 From: julian.m.bouffard at erdc.dren.mil (jbouffar) Date: Wed, 23 Mar 2016 11:38:08 -0700 (MST) Subject: [vtkusers] double free or corruption with vtkPLYWriter Message-ID: <1458758288909-5737333.post@n5.nabble.com> Hi All, I am a new VTK user and I have written some threaded code to run on some HPCs, but it seems to be crashing and I can't determine why. I was hoping someone here could shed some light for me. The code uses boost asio library to create threads and a work queue, and loops through some thousands of files. Sometimes it makes it through thousands without crashing, other times it crashes almost immediately. The error is usually 'double free or corruption (fasttop)' the full message is pasted below, along with a few lines of the backtrace which always implicate the Close method of a ply file. I have never used smart pointers before, so I even re-wrote all the code with normal pointers and ->Delete() and NULL, but got the same error. I even then removed all ->Delete and NULL statements, making them all memory leaks, and still got the same error. I have included what should be fully compilable code below the error message, I hope that is okay, alternatively I could attach a file or use pastebin, unfortunately I am not sure of the norm here. Thanks for any help! *** glibc detected *** ./myscript: double free or corruption (fasttop): 0x00002aab7ce40110 *** ======= Backtrace: ========= /lib64/libc.so.6(+0x79098)[0x2aaabe510098] /lib64/libc.so.6(cfree+0x6c)[0x2aaabe5150dc] /lustre/work1/jbouffar/vtk/vtk-install/lib/libvtkIOPLY-7.0.so.1(_ZN6vtkPLY9ply_closeEP7PlyFile+0x12d)[0x2aaaad02487d] /lustre/work1/jbouffar/vtk/vtk-install/lib/libvtkIOPLY-7.0.so.1(_ZN12vtkPLYWriter9WriteDataEv+0x4f2)[0x2aaaad02ad02] /lustre/work1/jbouffar/vtk/vtk-install/lib/libvtkIOCore-7.0.so.1(_ZN9vtkWriter11RequestDataEP14vtkInformationPP20vtkInformationVectorS3_+0x103)[0x2aaabb19f063] /lustre/work1/jbouffar/vtk/vtk-install/lib/libvtkCommonExecutionModel-7.0.so.1(_ZN12vtkExecutive13CallAlgorithmEP14vtkInformationiPP20vtkInformationVectorS3_+0x40)[0x2aaabb410310] /lustre/work1/jbouffar/vtk/vtk-install/lib/libvtkCommonExecutionModel-7.0.so.1(_ZN23vtkDemandDrivenPipeline11ExecuteDataEP14vtkInformationPP20vtkInformationVectorS3_+0x37)[0x2aaabb40a1a7] /lustre/work1/jbouffar/vtk/vtk-install/lib/libvtkCommonExecutionModel-7.0.so.1(_ZN24vtkCompositeDataPipeline11ExecuteDataEP14vtkInformationPP20vtkInformationVectorS3_+0x141)[0x2aaabb407e81] /lustre/work1/jbouffar/vtk/vtk-install/lib/libvtkCommonExecutionModel-7.0.so.1(_ZN23vtkDemandDrivenPipeline14ProcessRequestEP14vtkInformationPP20vtkInformationVectorS3_+0x45f)[0x2aaabb40cf7f] /lustre/work1/jbouffar/vtk/vtk-install/lib/libvtkCommonExecutionModel-7.0.so.1(_ZN32vtkStreamingDemandDrivenPipeline14ProcessRequestEP14vtkInformationPP20vtkInformationVectorS3_+0x1d9)[0x2aaabb4276f9] /lustre/work1/jbouffar/vtk/vtk-install/lib/libvtkCommonExecutionModel-7.0.so.1(_ZN23vtkDemandDrivenPipeline10UpdateDataEi+0x8c)[0x2aaabb40b93c] /lustre/work1/jbouffar/vtk/vtk-install/lib/libvtkCommonExecutionModel-7.0.so.1(_ZN32vtkStreamingDemandDrivenPipeline6UpdateEi+0x9f)[0x2aaabb42814f] ./myscript(_Z12searchDomainiPc+0x524)[0x423b25] #include "vtkStructuredPointsReader.h" #include "vtkSmartPointer.h" #include "vtkCellData.h" #include "vtkPointData.h" #include "vtkDataArray.h" #include "vtkFloatArray.h" #include "vtkStructuredPoints.h" #include "vtkCellDataToPointData.h" #include "vtkMarchingCubes.h" #include "vtkPLYWriter.h" #include "vtkInformation.h" #include #include #include #include #include #include #include #include #include #include #include using namespace std; void searchDomain(int d, char* t); vector x; vector times; boost::asio::io_service myService; boost::thread_group myPool; boost::asio::io_service::work work(myService); boost::asio::io_service::strand strand(myService); int main(int argc, char** argv){ struct timespec main_monotonic_start, main_monotonic_finish; double main_monotonic_elapsed; clock_gettime(CLOCK_MONOTONIC, &main_monotonic_start); int threads = 30; for(int i = 0; i < threads; i++){ myPool.create_thread(boost::bind(&boost::asio::io_service::run, &myService)); } int start = 14300; int chunks = 2000; for(int d = start; d < start + chunks; d++){ myService.post([d,argv] { searchDomain(d, argv[1]); }); } int stop = 0; while(stop == 0){ sleep(2.0); strand.post(strand.wrap([&]() { if(times.size() == chunks) stop = 1; } )); } clock_gettime(CLOCK_MONOTONIC,&main_monotonic_finish); main_monotonic_elapsed = (main_monotonic_finish.tv_sec - main_monotonic_start.tv_sec); main_monotonic_elapsed += (main_monotonic_finish.tv_nsec - main_monotonic_start.tv_nsec) / 1000000000.0; cout << "Total MONOTONIC run time for main function (" << threads << " threads) with " << chunks << " domain chunks: " << main_monotonic_elapsed << " s" << endl; double totaltime = 0; for(float t : times){ totaltime += t; } double avgtime = (double)totaltime / (double)times.size(); cout << "Total compute time for all domain chunks = " << totaltime << endl; cout << "Average compute time per domain chunk with " << threads << " threads = " << setprecision(10) << (double)avgtime << endl; myService.stop(); myPool.join_all(); return 0; } void searchDomain(int d, char* t){ struct timespec start, finish; double elapsed; clock_gettime(CLOCK_THREAD_CPUTIME_ID, &start); stringstream ss; ss << "/lustre/work1/apol/H.g6.K2048dns.v4.n16.L256/id" << d << "/H.g6.K2048dns.v4.n16.L256-id" << d << "." << t << ".vtk"; string filename = ss.str(); vtkSmartPointer reader = vtkSmartPointer::New(); reader->SetFileName(filename.c_str()); reader->ReadAllScalarsOn(); reader->Update(); vtkSmartPointer structuredPointData = reader->GetOutput(); vtkSmartPointer cellData = structuredPointData->GetCellData(); vtkSmartPointer scalar0 = cellData->GetScalars("Scalar0"); vtkSmartPointer density = cellData->GetScalars("Density"); int result = -1; vtkSmartPointer flameArray = vtkSmartPointer::New(); flameArray->SetName("flame"); int nTuples = scalar0->GetNumberOfTuples(); for(int i = 0; i < nTuples; i++){ flameArray->InsertNextValue(scalar0->GetComponent(i,1) / density->GetComponent(i,1)); } structuredPointData->GetCellData()->SetScalars(flameArray); structuredPointData->GetCellData()->RemoveArray("Scalar0"); structuredPointData->GetCellData()->RemoveArray("Density"); vtkSmartPointer cpd = vtkSmartPointer::New(); cpd->SetInputData(structuredPointData); cpd->Update(); vtkSmartPointer iso = vtkSmartPointer::New(); vtkSmartPointer DataArray = cpd->GetOutput(); iso->SetInputData(DataArray); iso->SetValue(0, 0.1574); iso->ComputeNormalsOn(); iso->SetInputArrayToProcess(0, flameArray->GetInformation()); iso->Update(); if((iso->GetOutput())->GetNumberOfPolys() > 0){ vtkSmartPointer marchingOutput = iso->GetOutput(); vtkSmartPointer plyWriter = vtkSmartPointer::New(); stringstream outfile; outfile << "/lustre/work1/jbouffar/myscript/plyout/" << d << ".ply"; string outfile_string = outfile.str(); plyWriter->SetFileName(outfile_string.c_str()); plyWriter->SetInputData(marchingOutput); //strand.post(strand.wrap([&plyWriter]() { plyWriter->Write(); } )); plyWriter->Update(); plyWriter->Write(); } clock_gettime(CLOCK_THREAD_CPUTIME_ID,&finish); elapsed = (finish.tv_sec - start.tv_sec); elapsed += (finish.tv_nsec - start.tv_nsec) / 1000000000.0; cout << "Thread running time for domain chunk " << d << ": " << elapsed << " (flame found) ----" << endl; strand.post(strand.wrap([&]() { times.push_back(elapsed); } )); return; } -- View this message in context: http://vtk.1045678.n5.nabble.com/double-free-or-corruption-with-vtkPLYWriter-tp5737333.html Sent from the VTK - Users mailing list archive at Nabble.com. From sean at rogue-research.com Wed Mar 23 14:42:17 2016 From: sean at rogue-research.com (Sean McBride) Date: Wed, 23 Mar 2016 14:42:17 -0400 Subject: [vtkusers] double free or corruption with vtkPLYWriter In-Reply-To: <1458758288909-5737333.post@n5.nabble.com> References: <1458758288909-5737333.post@n5.nabble.com> Message-ID: <20160323184217.1459623349@mail.rogue-research.com> On Wed, 23 Mar 2016 11:38:08 -0700, jbouffar said: >The code uses boost asio library to create threads and a work queue, and >loops through some thousands of files. Sometimes it makes it through >thousands without crashing, other times it crashes almost immediately. Always fun to debug those. :( I suggest trying clang thread sanitizer and/or helgrind. Cheers, -- ____________________________________________________________ Sean McBride, B. Eng sean at rogue-research.com Rogue Research www.rogue-research.com Mac Software Developer Montr?al, Qu?bec, Canada From dchen at mail.nih.gov Wed Mar 23 14:49:22 2016 From: dchen at mail.nih.gov (Chen, David (NIH/NLM/LHC) [C]) Date: Wed, 23 Mar 2016 18:49:22 +0000 Subject: [vtkusers] vtkImageImport crash on Windows via Python Message-ID: I wrote a Python function to convert a SimpleITK volume to VTK, and it has been working fine for me on OS X and Linux. A user reported to me that my code was crashing on Windows, and I have been able to re-create the crash. I am using a vtkImageImport object to put a data string into vtkImageData which the function returns. However when I try and access a scalar in the image, it crashes on Windows. It seems that the scalar data is being deleted once the function is out of scope. You can see my original code here: https://github.com/dave3d/dicom2stl/blob/master/sitk2vtk.py Here is a simplified version of that code that crashes in the same way. The crash happens at the last line in the code, where I try and access the first voxel of the image. The same access that occurs inside the doImport function runs fine. #! /usr/bin/env vtkpython import vtk xmax = ymax = zmax = 102 # simplified version of the function at https://github.com/dave3d/dicom2stl/blob/master/sitk2vtk.py # which was adapted from http://www.vtk.org/Wiki/VTK/Examples/Python/vtkWithNumpy # def doImport(test_string): dataImporter = vtk.vtkImageImport() dataImporter.CopyImportVoidPointer( test_string, len(test_string) ) dataImporter.SetDataScalarType(vtk.VTK_CHAR) dataImporter.SetNumberOfScalarComponents(1) dataImporter.SetDataExtent (0, xmax-1, 0, ymax-1, 0, zmax-1) dataImporter.SetWholeExtent (0, xmax-1, 0, ymax-1, 0, zmax-1) dataImporter.Update() vtkvol = dataImporter.GetOutput() print "access inside function" print "vol[0,0,0] =", vtkvol.GetScalarComponentAsFloat(0,0,0,0) print "GetScalarPointer() =", vtkvol.GetScalarPointer() return vtkvol # fill a string with '0's test_string = "0" * (xmax*ymax*zmax) vol = doImport(test_string) print vol print "access outside function" print "volume object pointer", hex(id(vol)) print "GetScalarPointer() =", vol.GetScalarPointer() print vol.GetScalarComponentAsFloat(0,0,0,0) And suggestions are greatly appreciated. Thanks, Dave Chen David T. Chen, PhD [MSC contractor] mailto:dchen at mail.nih.gov http://lhncbc.nlm.nih.gov/personnel/david-chen phone:301.435.3264 iphone:301.524.3174 Office of High Performance Computing and Communications National Library of Medicine -------------- next part -------------- An HTML attachment was scrubbed... URL: From tluisrs at gmail.com Wed Mar 23 16:20:15 2016 From: tluisrs at gmail.com (Thales Luis Rodrigues Sabino) Date: Wed, 23 Mar 2016 17:20:15 -0300 Subject: [vtkusers] CMake IDE integration survey In-Reply-To: <56F2DDDF.90302@kitware.com> References: <56F2DDDF.90302@kitware.com> Message-ID: Nice, Always wanted better CMake support in Visual Studio. On Wed, Mar 23, 2016 at 3:18 PM, Bill Hoffman wrote: > Hi all, > > Microsoft is assembling a team to improve CMake support in Visual Studio. > They are interested in gathering feedback from CMake users. They have > created this survey, so if you are using VS and CMake, please fill this out: > > http://www.instant.ly/s/EwZKW > > Thanks. > > -Bill > > -- > Bill Hoffman > Kitware, Inc. > 28 Corporate Drive > Clifton Park, NY 12065 > bill.hoffman at kitware.com > http://www.kitware.com > 518 881-4905 (Direct) > 518 371-3971 x105 > Fax (518) 371-4573 > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 > -- Thales Luis Rodrigues Sabino PhD Student at PGMC-UFJF Lattes | LinkedIn | ResearchGate -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Wed Mar 23 18:59:09 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 23 Mar 2016 16:59:09 -0600 Subject: [vtkusers] VTKImageResliceMapper SetClippingPlanes problems In-Reply-To: <1458726323146-5737327.post@n5.nabble.com> References: <1458726323146-5737327.post@n5.nabble.com> Message-ID: On Wed, Mar 23, 2016 at 3:45 AM, Ang wrote: > Hi all, > > I face a problem in vtk 7.0.0 in rendering back end OpenGL2. > > in vtk 6.0.0, I use the function SetClippingPlanes,and I can see the clip > range in display image data. > > but in vtk 7.0.0 I do the same thing what I do in vtk6.0.0, I cant see any > change in display image data. > > is it a bug? > This functionality wasn't implemented for the OpenGL2 back end. So, yes, this is something that has to be fixed. This is something that I'll need, too, and I can probably push a fix early next month. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From ysa0829 at gmail.com Thu Mar 24 06:35:43 2016 From: ysa0829 at gmail.com (Ang) Date: Thu, 24 Mar 2016 03:35:43 -0700 (MST) Subject: [vtkusers] VTKImageResliceMapper SetClippingPlanes problems In-Reply-To: References: <1458726323146-5737327.post@n5.nabble.com> Message-ID: <1458815743100-5737343.post@n5.nabble.com> Hi David, thanks for your assistance. I have another question about use vtkImageThreshold and then do vtkMarchingCubes. I separate image to binary data using vtkImageThreshold ,then do vtkMarchingCubes to generate PolyData. I will see the polydata is serrated . If I would like to get the polydata non-serrated,what can I do? do you know that? -- View this message in context: http://vtk.1045678.n5.nabble.com/VTKImageResliceMapper-SetClippingPlanes-problems-tp5737327p5737343.html Sent from the VTK - Users mailing list archive at Nabble.com. From david.gobbi at gmail.com Thu Mar 24 08:40:28 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 24 Mar 2016 06:40:28 -0600 Subject: [vtkusers] VTKImageResliceMapper SetClippingPlanes problems In-Reply-To: <1458815743100-5737343.post@n5.nabble.com> References: <1458726323146-5737327.post@n5.nabble.com> <1458815743100-5737343.post@n5.nabble.com> Message-ID: On Thu, Mar 24, 2016 at 4:35 AM, Ang wrote: > > > I have another question about use vtkImageThreshold and then do > vtkMarchingCubes. > > I separate image to binary data using vtkImageThreshold ,then do > vtkMarchingCubes to generate PolyData. I will see the polydata is serrated > . I will answer your question with my own questions. To answer, you will have to understand how the marching cubes algorithm works. If you don't yet know how it works, please read the wikipedia page on "Marching Cubes or (even better) the original paper. Most importantly, consider this part of the marching cubes algorithm: "Finally each vertex of the generated polygons is placed on the appropriate position along the cube's edge by linearly interpolating the two scalar values that are connected by that edge." My questions for you are as follows: if marching cubes is applied to a binary image, what is the result? What is the best isovalue to use? Can you suggest a way to process the image that will produce a smoother result? - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From rogertrullo at hotmail.com Thu Mar 24 11:18:54 2016 From: rogertrullo at hotmail.com (rogertrullo) Date: Thu, 24 Mar 2016 08:18:54 -0700 (MST) Subject: [vtkusers] How to get a fixed number of vertices after decimation in VTK Message-ID: <1458832734304-5737349.post@n5.nabble.com> I am working with vtk for 3D mesh processing. I have a mesh, and I am using the function vtkDecimatePro() to get the reduction done. The function accepts a TargetReduction, that is related to the reduction in the number of triangles (percentage). The problem is that I need to have a fixed number of vertices, say for example I want all my meshes to have 2000 vertices. Currently I am doing this in a software called openflipper which allows to constrain the decimation to a fixed number of vertices. However, in VTK I am not sure how to accomplish this task. Thanks for any suggestion. -- View this message in context: http://vtk.1045678.n5.nabble.com/How-to-get-a-fixed-number-of-vertices-after-decimation-in-VTK-tp5737349.html Sent from the VTK - Users mailing list archive at Nabble.com. From ultam93 at yahoo.com Thu Mar 24 11:24:20 2016 From: ultam93 at yahoo.com (Constantinescu Mihai) Date: Thu, 24 Mar 2016 15:24:20 +0000 (UTC) Subject: [vtkusers] Fill the inside of a 3D object References: <1471506620.278560.1458833060153.JavaMail.yahoo.ref@mail.yahoo.com> Message-ID: <1471506620.278560.1458833060153.JavaMail.yahoo@mail.yahoo.com> Hi all, I wish to fill the inside of a 3D object before substracting space from it, to ensure the hole after the substraction looks the way I want it to.How can I fill the inside of a 3D object in vtk? I've seen a suggestion of using vtkFillHolesFilter after substration, but that's not what I want as I'm trying to use a substration to carve something on an object. -------------- next part -------------- An HTML attachment was scrubbed... URL: From onlyjus at gmail.com Thu Mar 24 11:53:17 2016 From: onlyjus at gmail.com (Justin Weber) Date: Thu, 24 Mar 2016 11:53:17 -0400 Subject: [vtkusers] slice structured grid with polydata In-Reply-To: References: Message-ID: I didn't realize this earlier but the vtkClipDataSet tetrahedralizes the mesh before slicing? It seems that this is required for the algorithm. Do you know of any ways to prevent this? BTW, here is the link to the example: http://www.vtk.org/Wiki/VTK/Examples/Python/Meshes/vtkClipDataSetWithPolydata Justin On Mon, Mar 7, 2016 at 5:30 PM, Cory Quammen wrote: > That's great, Justin. Thanks for reporting back. > > Cory > > On Mon, Mar 7, 2016 at 4:04 PM, Justin Weber wrote: > >> Cory, >> >> Thanks for your help. I got it working! I might put the code up as an >> example. >> >> >> Justin >> >> On Thu, Feb 18, 2016 at 10:58 PM, Cory Quammen >> wrote: >> >>> Justin, >>> >>> There is nothing canned in VTK to do this, but with some work you should >>> be able to get there using an implicit function created from your STL file. >>> At a high level, what you would do is create an instance of >>> vtkImplicitPolyDataDistance. Set its input to the poly data from the STL >>> file. Then, create a new point data array in your structured grid that >>> stores the value from the implicit poly data distance filter. Negative >>> values will be inside the poly data, positive values outside, and 0 at the >>> surface. Finally, use vtkClipDataSet to clip the structured grid a function >>> value 0. This should give you back an unstructured grid in approximately >>> the shape of your input STL. It won't be exact because of the interpolation >>> used by vtkClipDataSet, but it should be close. >>> >>> Hope that helps. >>> >>> Cory >>> >>> On Thu, Feb 18, 2016 at 10:08 PM, Justin Weber >>> wrote: >>> >>>> I would like to generate a "cutcell" mesh using vtk by slicing a >>>> structured grid with polydata loaded from a STL file. The resulting mesh >>>> would be an unstructured grid. >>>> >>>> Are there any tools in vtk to accomplish this? >>>> >>>> I can create the structured grid and polydata successfully. Now I just >>>> need an algorithm to slice the structured mesh with the polydata surface. >>>> >>>> In my searching I could not find anything. However, I could accomplish >>>> this by ray casting to find the intersections between the structured grid >>>> and the polydata. Then using those points to create the unstructured grid. >>>> >>>> See attached 2d sketch. >>>> >>>> Thanks! >>>> Justin >>>> >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ at: >>>> 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 >>> R&D Engineer >>> Kitware, Inc. >>> >> >> > > > -- > Cory Quammen > R&D Engineer > Kitware, Inc. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Thu Mar 24 11:59:45 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Thu, 24 Mar 2016 10:59:45 -0500 Subject: [vtkusers] slice structured grid with polydata In-Reply-To: References: Message-ID: What do you want as output instead? On Thu, Mar 24, 2016 at 10:53 AM, Justin Weber wrote: > I didn't realize this earlier but the vtkClipDataSet tetrahedralizes the > mesh before slicing? It seems that this is required for the algorithm. Do > you know of any ways to prevent this? > > BTW, here is the link to the example: > http://www.vtk.org/Wiki/VTK/Examples/Python/Meshes/vtkClipDataSetWithPolydata > > Justin > > On Mon, Mar 7, 2016 at 5:30 PM, Cory Quammen > wrote: >> >> That's great, Justin. Thanks for reporting back. >> >> Cory >> >> On Mon, Mar 7, 2016 at 4:04 PM, Justin Weber wrote: >>> >>> Cory, >>> >>> Thanks for your help. I got it working! I might put the code up as an >>> example. >>> >>> >>> Justin >>> >>> On Thu, Feb 18, 2016 at 10:58 PM, Cory Quammen >>> wrote: >>>> >>>> Justin, >>>> >>>> There is nothing canned in VTK to do this, but with some work you should >>>> be able to get there using an implicit function created from your STL file. >>>> At a high level, what you would do is create an instance of >>>> vtkImplicitPolyDataDistance. Set its input to the poly data from the STL >>>> file. Then, create a new point data array in your structured grid that >>>> stores the value from the implicit poly data distance filter. Negative >>>> values will be inside the poly data, positive values outside, and 0 at the >>>> surface. Finally, use vtkClipDataSet to clip the structured grid a function >>>> value 0. This should give you back an unstructured grid in approximately the >>>> shape of your input STL. It won't be exact because of the interpolation used >>>> by vtkClipDataSet, but it should be close. >>>> >>>> Hope that helps. >>>> >>>> Cory >>>> >>>> On Thu, Feb 18, 2016 at 10:08 PM, Justin Weber >>>> wrote: >>>>> >>>>> I would like to generate a "cutcell" mesh using vtk by slicing a >>>>> structured grid with polydata loaded from a STL file. The resulting mesh >>>>> would be an unstructured grid. >>>>> >>>>> Are there any tools in vtk to accomplish this? >>>>> >>>>> I can create the structured grid and polydata successfully. Now I just >>>>> need an algorithm to slice the structured mesh with the polydata surface. >>>>> >>>>> In my searching I could not find anything. However, I could accomplish >>>>> this by ray casting to find the intersections between the structured grid >>>>> and the polydata. Then using those points to create the unstructured grid. >>>>> >>>>> See attached 2d sketch. >>>>> >>>>> Thanks! >>>>> Justin >>>>> >>>>> >>>>> _______________________________________________ >>>>> Powered by www.kitware.com >>>>> >>>>> Visit other Kitware open-source projects at >>>>> http://www.kitware.com/opensource/opensource.html >>>>> >>>>> Please keep messages on-topic and check the VTK FAQ at: >>>>> 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 >>>> R&D Engineer >>>> Kitware, Inc. >>> >>> >> >> >> >> -- >> Cory Quammen >> R&D Engineer >> Kitware, Inc. > > -- Cory Quammen R&D Engineer Kitware, Inc. From sid.murthy at gmail.com Thu Mar 24 12:45:51 2016 From: sid.murthy at gmail.com (Sid Murthy) Date: Thu, 24 Mar 2016 10:45:51 -0600 Subject: [vtkusers] Displaying vtkPlotXYActor broken out into 4 quadrants Message-ID: Hi all - I have two curves where one is always negative and the other is always positive. Having the measurement labels such that it's broken down into 4 quadrants would make it more user friendly (rather than having it always on the left and bottom). I was wondering if this is possible with vtkPlotXYActor. I might be missing something but am not able to do this right now. If not - is there another option that can do this? thanks, Sid -------------- next part -------------- An HTML attachment was scrubbed... URL: From davideugenewarren+vtk at gmail.com Thu Mar 24 13:46:34 2016 From: davideugenewarren+vtk at gmail.com (David Warren) Date: Thu, 24 Mar 2016 12:46:34 -0500 Subject: [vtkusers] Error using vtkOpenGLGPUVolumeRayCastMapper on OS X Message-ID: Hi all, I'm writing a set of scripts that render neuroimaing data using VTK. On Windows and Linux everything is working well, but a friend who is using OS X reports the following error: ERROR: In /Users/ilan/minonda/conda-bld/work/VTK-6.3.0/Rendering/VolumeOpenGL/vtkOpenGLGPUVolumeRayCastMapper.cxx, line 4040 vtkOpenGLGPUVolumeRayCastMapper (0x103b90000): Rendering failed because the following OpenGL extensions are required but not supported: Disabled on Apple OS X Snow Leopard with nVidia. He reports that his hardware is AMD (Radeon HD 6970M 1024 MB) and that he is running OS X 10.10.5 Yosemite. We're all using the Anaconda Python distribution (v2.5.0) and the VTK module that they supply (which is v6.3.0). Any thoughts? Many thanks, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From aashish.chaudhary at kitware.com Thu Mar 24 14:16:05 2016 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Thu, 24 Mar 2016 14:16:05 -0400 Subject: [vtkusers] Error using vtkOpenGLGPUVolumeRayCastMapper on OS X In-Reply-To: References: Message-ID: Hi David, It sounds like you are using OpenGL1 backed. I would suggest using OpenGL2 backend which works on most of the Mac systems. Thanks, On Thu, Mar 24, 2016 at 1:46 PM, David Warren < davideugenewarren+vtk at gmail.com> wrote: > Hi all, > > I'm writing a set of scripts that render neuroimaing data using VTK. > On Windows and Linux everything is working well, but a friend who is using > OS X reports the following error: > > ERROR: In > /Users/ilan/minonda/conda-bld/work/VTK-6.3.0/Rendering/VolumeOpenGL/vtkOpenGLGPUVolumeRayCastMapper.cxx, > line 4040 > vtkOpenGLGPUVolumeRayCastMapper (0x103b90000): Rendering failed because > the following OpenGL extensions are required but not supported: Disabled > on Apple OS X Snow Leopard with nVidia. > > He reports that his hardware is AMD (Radeon HD 6970M 1024 MB) and > that he is running OS X 10.10.5 Yosemite. We're all using the Anaconda > Python distribution (v2.5.0) and the VTK module that they supply (which is > v6.3.0). > > Any thoughts? Many thanks, > > Dave > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 > > -- *| Aashish Chaudhary | Technical Leader | Kitware Inc. * *| http://www.kitware.com/company/team/chaudhary.html * -------------- next part -------------- An HTML attachment was scrubbed... URL: From onlyjus at gmail.com Thu Mar 24 14:21:07 2016 From: onlyjus at gmail.com (Justin Weber) Date: Thu, 24 Mar 2016 14:21:07 -0400 Subject: [vtkusers] slice structured grid with polydata In-Reply-To: References: Message-ID: It would be nice if the grid was not tetrahedralized first. I would like the original hexahedrons that are not sliced to be preserved. On Thu, Mar 24, 2016 at 11:59 AM, Cory Quammen wrote: > What do you want as output instead? > > On Thu, Mar 24, 2016 at 10:53 AM, Justin Weber wrote: > > I didn't realize this earlier but the vtkClipDataSet tetrahedralizes the > > mesh before slicing? It seems that this is required for the algorithm. Do > > you know of any ways to prevent this? > > > > BTW, here is the link to the example: > > > http://www.vtk.org/Wiki/VTK/Examples/Python/Meshes/vtkClipDataSetWithPolydata > > > > Justin > > > > On Mon, Mar 7, 2016 at 5:30 PM, Cory Quammen > > wrote: > >> > >> That's great, Justin. Thanks for reporting back. > >> > >> Cory > >> > >> On Mon, Mar 7, 2016 at 4:04 PM, Justin Weber wrote: > >>> > >>> Cory, > >>> > >>> Thanks for your help. I got it working! I might put the code up as an > >>> example. > >>> > >>> > >>> Justin > >>> > >>> On Thu, Feb 18, 2016 at 10:58 PM, Cory Quammen < > cory.quammen at kitware.com> > >>> wrote: > >>>> > >>>> Justin, > >>>> > >>>> There is nothing canned in VTK to do this, but with some work you > should > >>>> be able to get there using an implicit function created from your STL > file. > >>>> At a high level, what you would do is create an instance of > >>>> vtkImplicitPolyDataDistance. Set its input to the poly data from the > STL > >>>> file. Then, create a new point data array in your structured grid that > >>>> stores the value from the implicit poly data distance filter. Negative > >>>> values will be inside the poly data, positive values outside, and 0 > at the > >>>> surface. Finally, use vtkClipDataSet to clip the structured grid a > function > >>>> value 0. This should give you back an unstructured grid in > approximately the > >>>> shape of your input STL. It won't be exact because of the > interpolation used > >>>> by vtkClipDataSet, but it should be close. > >>>> > >>>> Hope that helps. > >>>> > >>>> Cory > >>>> > >>>> On Thu, Feb 18, 2016 at 10:08 PM, Justin Weber > >>>> wrote: > >>>>> > >>>>> I would like to generate a "cutcell" mesh using vtk by slicing a > >>>>> structured grid with polydata loaded from a STL file. The resulting > mesh > >>>>> would be an unstructured grid. > >>>>> > >>>>> Are there any tools in vtk to accomplish this? > >>>>> > >>>>> I can create the structured grid and polydata successfully. Now I > just > >>>>> need an algorithm to slice the structured mesh with the polydata > surface. > >>>>> > >>>>> In my searching I could not find anything. However, I could > accomplish > >>>>> this by ray casting to find the intersections between the structured > grid > >>>>> and the polydata. Then using those points to create the unstructured > grid. > >>>>> > >>>>> See attached 2d sketch. > >>>>> > >>>>> Thanks! > >>>>> Justin > >>>>> > >>>>> > >>>>> _______________________________________________ > >>>>> Powered by www.kitware.com > >>>>> > >>>>> Visit other Kitware open-source projects at > >>>>> http://www.kitware.com/opensource/opensource.html > >>>>> > >>>>> Please keep messages on-topic and check the VTK FAQ at: > >>>>> 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 > >>>> R&D Engineer > >>>> Kitware, Inc. > >>> > >>> > >> > >> > >> > >> -- > >> Cory Quammen > >> R&D Engineer > >> Kitware, Inc. > > > > > > > > -- > Cory Quammen > R&D Engineer > Kitware, Inc. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From philip.fackler at gmail.com Thu Mar 24 14:24:32 2016 From: philip.fackler at gmail.com (Philip Fackler) Date: Thu, 24 Mar 2016 18:24:32 +0000 Subject: [vtkusers] Triangulate surface points? In-Reply-To: References: Message-ID: If someone could even definitively tell me "no, you can't do this" that would be helpful. Thanks, Philip Fackler On Wed, Mar 16, 2016 at 6:24 PM Philip Fackler wrote: > Is there a way to triangulate a set of surface points using vtk? I've > looked around and everything I've found (vtk, cgal, pcl) only do a surface > reconstruction which ends up generating its own points to triangulate. I > want to actually use the points I have as the vertices of the > triangulation. Along with the point locations, I have a lot of information > available in my code that I could provide: > > Normal vector at each point > Bounding segmented curve(s) (i.e., lists of edge cells indexing the list > of surface points) > A polydata representation of the surface (Note that the points I want to > triangulate are distinct from the points involved in this) > > The only vtk utility that seems to come close to this is vtkDelaunay2D, > but it's only useful if all the points can be mapped to a 2D plane. This > isn't possible in general without a parametric surface, which is one bit of > information I don't have. > > Thanks in advance for the help. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Thu Mar 24 14:29:23 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Thu, 24 Mar 2016 14:29:23 -0400 Subject: [vtkusers] Triangulate surface points? In-Reply-To: References: Message-ID: Philip, Please take a look at http://www.vtk.org/doc/nightly/html/classvtkSurfaceReconstructionFilter.html and http://www.vtkjournal.org/browse/publication/718 I don't have direct experience with these classes, but they may have what you need. HTH, Cory On Thu, Mar 24, 2016 at 2:24 PM, Philip Fackler wrote: > If someone could even definitively tell me "no, you can't do this" that > would be helpful. > > Thanks, > Philip Fackler > > On Wed, Mar 16, 2016 at 6:24 PM Philip Fackler > wrote: > >> Is there a way to triangulate a set of surface points using vtk? I've >> looked around and everything I've found (vtk, cgal, pcl) only do a surface >> reconstruction which ends up generating its own points to triangulate. I >> want to actually use the points I have as the vertices of the >> triangulation. Along with the point locations, I have a lot of information >> available in my code that I could provide: >> >> Normal vector at each point >> Bounding segmented curve(s) (i.e., lists of edge cells indexing the list >> of surface points) >> A polydata representation of the surface (Note that the points I want to >> triangulate are distinct from the points involved in this) >> >> The only vtk utility that seems to come close to this is vtkDelaunay2D, >> but it's only useful if all the points can be mapped to a 2D plane. This >> isn't possible in general without a parametric surface, which is one bit of >> information I don't have. >> >> Thanks in advance for the 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 > > -- Cory Quammen R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Thu Mar 24 14:32:04 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Thu, 24 Mar 2016 14:32:04 -0400 Subject: [vtkusers] slice structured grid with polydata In-Reply-To: References: Message-ID: I don't think there are options in VTK that will do what you want, unfortunately. You would need to manually identify which hexahedra are not cut and then create a new vtkUnstructuredGrid with those hexahedra as well as the cut tetrahedra. On Thu, Mar 24, 2016 at 2:21 PM, Justin Weber wrote: > It would be nice if the grid was not tetrahedralized first. I would like > the original hexahedrons that are not sliced to be preserved. > > On Thu, Mar 24, 2016 at 11:59 AM, Cory Quammen > wrote: > >> What do you want as output instead? >> >> On Thu, Mar 24, 2016 at 10:53 AM, Justin Weber wrote: >> > I didn't realize this earlier but the vtkClipDataSet tetrahedralizes the >> > mesh before slicing? It seems that this is required for the algorithm. >> Do >> > you know of any ways to prevent this? >> > >> > BTW, here is the link to the example: >> > >> http://www.vtk.org/Wiki/VTK/Examples/Python/Meshes/vtkClipDataSetWithPolydata >> > >> > Justin >> > >> > On Mon, Mar 7, 2016 at 5:30 PM, Cory Quammen >> > wrote: >> >> >> >> That's great, Justin. Thanks for reporting back. >> >> >> >> Cory >> >> >> >> On Mon, Mar 7, 2016 at 4:04 PM, Justin Weber >> wrote: >> >>> >> >>> Cory, >> >>> >> >>> Thanks for your help. I got it working! I might put the code up as an >> >>> example. >> >>> >> >>> >> >>> Justin >> >>> >> >>> On Thu, Feb 18, 2016 at 10:58 PM, Cory Quammen < >> cory.quammen at kitware.com> >> >>> wrote: >> >>>> >> >>>> Justin, >> >>>> >> >>>> There is nothing canned in VTK to do this, but with some work you >> should >> >>>> be able to get there using an implicit function created from your >> STL file. >> >>>> At a high level, what you would do is create an instance of >> >>>> vtkImplicitPolyDataDistance. Set its input to the poly data from the >> STL >> >>>> file. Then, create a new point data array in your structured grid >> that >> >>>> stores the value from the implicit poly data distance filter. >> Negative >> >>>> values will be inside the poly data, positive values outside, and 0 >> at the >> >>>> surface. Finally, use vtkClipDataSet to clip the structured grid a >> function >> >>>> value 0. This should give you back an unstructured grid in >> approximately the >> >>>> shape of your input STL. It won't be exact because of the >> interpolation used >> >>>> by vtkClipDataSet, but it should be close. >> >>>> >> >>>> Hope that helps. >> >>>> >> >>>> Cory >> >>>> >> >>>> On Thu, Feb 18, 2016 at 10:08 PM, Justin Weber >> >>>> wrote: >> >>>>> >> >>>>> I would like to generate a "cutcell" mesh using vtk by slicing a >> >>>>> structured grid with polydata loaded from a STL file. The resulting >> mesh >> >>>>> would be an unstructured grid. >> >>>>> >> >>>>> Are there any tools in vtk to accomplish this? >> >>>>> >> >>>>> I can create the structured grid and polydata successfully. Now I >> just >> >>>>> need an algorithm to slice the structured mesh with the polydata >> surface. >> >>>>> >> >>>>> In my searching I could not find anything. However, I could >> accomplish >> >>>>> this by ray casting to find the intersections between the >> structured grid >> >>>>> and the polydata. Then using those points to create the >> unstructured grid. >> >>>>> >> >>>>> See attached 2d sketch. >> >>>>> >> >>>>> Thanks! >> >>>>> Justin >> >>>>> >> >>>>> >> >>>>> _______________________________________________ >> >>>>> Powered by www.kitware.com >> >>>>> >> >>>>> Visit other Kitware open-source projects at >> >>>>> http://www.kitware.com/opensource/opensource.html >> >>>>> >> >>>>> Please keep messages on-topic and check the VTK FAQ at: >> >>>>> 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 >> >>>> R&D Engineer >> >>>> Kitware, Inc. >> >>> >> >>> >> >> >> >> >> >> >> >> -- >> >> Cory Quammen >> >> R&D Engineer >> >> Kitware, Inc. >> > >> > >> >> >> >> -- >> Cory Quammen >> R&D Engineer >> Kitware, Inc. >> > > -- Cory Quammen R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aashish.chaudhary at kitware.com Thu Mar 24 14:45:21 2016 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Thu, 24 Mar 2016 14:45:21 -0400 Subject: [vtkusers] Error using vtkOpenGLGPUVolumeRayCastMapper on OS X In-Reply-To: References: Message-ID: Not that I am aware of. You would have to compile VTK master with OpenGL2 backend. On Thu, Mar 24, 2016 at 2:39 PM, David Warren < davideugenewarren+vtk at gmail.com> wrote: > Hi Aashish, > > Thanks for the quick reply! Is there a way to check whether the VTK > python module that we've got access to uses the OpenGL1 backend by default, > and if so, is there a way to switch over to the OpenGL2 backend? Best, > > Dave > > On Thu, Mar 24, 2016 at 1:16 PM, Aashish Chaudhary < > aashish.chaudhary at kitware.com> wrote: > >> Hi David, >> >> It sounds like you are using OpenGL1 backed. I would suggest using >> OpenGL2 backend which works on most of the Mac systems. >> >> Thanks, >> >> >> On Thu, Mar 24, 2016 at 1:46 PM, David Warren < >> davideugenewarren+vtk at gmail.com> wrote: >> >>> Hi all, >>> >>> I'm writing a set of scripts that render neuroimaing data using >>> VTK. On Windows and Linux everything is working well, but a friend who is >>> using OS X reports the following error: >>> >>> ERROR: In >>> /Users/ilan/minonda/conda-bld/work/VTK-6.3.0/Rendering/VolumeOpenGL/vtkOpenGLGPUVolumeRayCastMapper.cxx, >>> line 4040 >>> vtkOpenGLGPUVolumeRayCastMapper (0x103b90000): Rendering failed because >>> the following OpenGL extensions are required but not supported: Disabled >>> on Apple OS X Snow Leopard with nVidia. >>> >>> He reports that his hardware is AMD (Radeon HD 6970M 1024 MB) and >>> that he is running OS X 10.10.5 Yosemite. We're all using the Anaconda >>> Python distribution (v2.5.0) and the VTK module that they supply (which is >>> v6.3.0). >>> >>> Any thoughts? Many thanks, >>> >>> Dave >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> 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 >>> >>> >> >> >> -- >> >> >> >> *| Aashish Chaudhary | Technical Leader | Kitware Inc. >> * >> *| http://www.kitware.com/company/team/chaudhary.html >> * >> > > -- *| Aashish Chaudhary | Technical Leader | Kitware Inc. * *| http://www.kitware.com/company/team/chaudhary.html * -------------- next part -------------- An HTML attachment was scrubbed... URL: From davideugenewarren+vtk at gmail.com Thu Mar 24 14:47:22 2016 From: davideugenewarren+vtk at gmail.com (David Warren) Date: Thu, 24 Mar 2016 13:47:22 -0500 Subject: [vtkusers] Error using vtkOpenGLGPUVolumeRayCastMapper on OS X In-Reply-To: References: Message-ID: OK ? I will contact the Anaconda folks about this. Best, Dave On Thu, Mar 24, 2016 at 1:45 PM, Aashish Chaudhary < aashish.chaudhary at kitware.com> wrote: > Not that I am aware of. You would have to compile VTK master with OpenGL2 > backend. > > On Thu, Mar 24, 2016 at 2:39 PM, David Warren < > davideugenewarren+vtk at gmail.com> wrote: > >> Hi Aashish, >> >> Thanks for the quick reply! Is there a way to check whether the VTK >> python module that we've got access to uses the OpenGL1 backend by default, >> and if so, is there a way to switch over to the OpenGL2 backend? Best, >> >> Dave >> >> On Thu, Mar 24, 2016 at 1:16 PM, Aashish Chaudhary < >> aashish.chaudhary at kitware.com> wrote: >> >>> Hi David, >>> >>> It sounds like you are using OpenGL1 backed. I would suggest using >>> OpenGL2 backend which works on most of the Mac systems. >>> >>> Thanks, >>> >>> >>> On Thu, Mar 24, 2016 at 1:46 PM, David Warren < >>> davideugenewarren+vtk at gmail.com> wrote: >>> >>>> Hi all, >>>> >>>> I'm writing a set of scripts that render neuroimaing data using >>>> VTK. On Windows and Linux everything is working well, but a friend who is >>>> using OS X reports the following error: >>>> >>>> ERROR: In >>>> /Users/ilan/minonda/conda-bld/work/VTK-6.3.0/Rendering/VolumeOpenGL/vtkOpenGLGPUVolumeRayCastMapper.cxx, >>>> line 4040 >>>> vtkOpenGLGPUVolumeRayCastMapper (0x103b90000): Rendering failed because >>>> the following OpenGL extensions are required but not supported: Disabled >>>> on Apple OS X Snow Leopard with nVidia. >>>> >>>> He reports that his hardware is AMD (Radeon HD 6970M 1024 MB) and >>>> that he is running OS X 10.10.5 Yosemite. We're all using the Anaconda >>>> Python distribution (v2.5.0) and the VTK module that they supply (which is >>>> v6.3.0). >>>> >>>> Any thoughts? Many thanks, >>>> >>>> Dave >>>> >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ at: >>>> 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 >>>> >>>> >>> >>> >>> -- >>> >>> >>> >>> *| Aashish Chaudhary | Technical Leader | Kitware Inc. >>> * >>> *| http://www.kitware.com/company/team/chaudhary.html >>> * >>> >> >> > > > -- > > > > *| Aashish Chaudhary | Technical Leader | Kitware Inc. * > *| http://www.kitware.com/company/team/chaudhary.html > * > -------------- next part -------------- An HTML attachment was scrubbed... URL: From onlyjus at gmail.com Thu Mar 24 16:40:32 2016 From: onlyjus at gmail.com (Justin Weber) Date: Thu, 24 Mar 2016 16:40:32 -0400 Subject: [vtkusers] slice structured grid with polydata In-Reply-To: References: Message-ID: Thanks for your help Cory. Justin On Thu, Mar 24, 2016 at 2:32 PM, Cory Quammen wrote: > I don't think there are options in VTK that will do what you want, > unfortunately. You would need to manually identify which hexahedra are not > cut and then create a new vtkUnstructuredGrid with those hexahedra as well > as the cut tetrahedra. > > On Thu, Mar 24, 2016 at 2:21 PM, Justin Weber wrote: > >> It would be nice if the grid was not tetrahedralized first. I would like >> the original hexahedrons that are not sliced to be preserved. >> >> On Thu, Mar 24, 2016 at 11:59 AM, Cory Quammen >> wrote: >> >>> What do you want as output instead? >>> >>> On Thu, Mar 24, 2016 at 10:53 AM, Justin Weber >>> wrote: >>> > I didn't realize this earlier but the vtkClipDataSet tetrahedralizes >>> the >>> > mesh before slicing? It seems that this is required for the algorithm. >>> Do >>> > you know of any ways to prevent this? >>> > >>> > BTW, here is the link to the example: >>> > >>> http://www.vtk.org/Wiki/VTK/Examples/Python/Meshes/vtkClipDataSetWithPolydata >>> > >>> > Justin >>> > >>> > On Mon, Mar 7, 2016 at 5:30 PM, Cory Quammen >> > >>> > wrote: >>> >> >>> >> That's great, Justin. Thanks for reporting back. >>> >> >>> >> Cory >>> >> >>> >> On Mon, Mar 7, 2016 at 4:04 PM, Justin Weber >>> wrote: >>> >>> >>> >>> Cory, >>> >>> >>> >>> Thanks for your help. I got it working! I might put the code up as an >>> >>> example. >>> >>> >>> >>> >>> >>> Justin >>> >>> >>> >>> On Thu, Feb 18, 2016 at 10:58 PM, Cory Quammen < >>> cory.quammen at kitware.com> >>> >>> wrote: >>> >>>> >>> >>>> Justin, >>> >>>> >>> >>>> There is nothing canned in VTK to do this, but with some work you >>> should >>> >>>> be able to get there using an implicit function created from your >>> STL file. >>> >>>> At a high level, what you would do is create an instance of >>> >>>> vtkImplicitPolyDataDistance. Set its input to the poly data from >>> the STL >>> >>>> file. Then, create a new point data array in your structured grid >>> that >>> >>>> stores the value from the implicit poly data distance filter. >>> Negative >>> >>>> values will be inside the poly data, positive values outside, and 0 >>> at the >>> >>>> surface. Finally, use vtkClipDataSet to clip the structured grid a >>> function >>> >>>> value 0. This should give you back an unstructured grid in >>> approximately the >>> >>>> shape of your input STL. It won't be exact because of the >>> interpolation used >>> >>>> by vtkClipDataSet, but it should be close. >>> >>>> >>> >>>> Hope that helps. >>> >>>> >>> >>>> Cory >>> >>>> >>> >>>> On Thu, Feb 18, 2016 at 10:08 PM, Justin Weber >>> >>>> wrote: >>> >>>>> >>> >>>>> I would like to generate a "cutcell" mesh using vtk by slicing a >>> >>>>> structured grid with polydata loaded from a STL file. The >>> resulting mesh >>> >>>>> would be an unstructured grid. >>> >>>>> >>> >>>>> Are there any tools in vtk to accomplish this? >>> >>>>> >>> >>>>> I can create the structured grid and polydata successfully. Now I >>> just >>> >>>>> need an algorithm to slice the structured mesh with the polydata >>> surface. >>> >>>>> >>> >>>>> In my searching I could not find anything. However, I could >>> accomplish >>> >>>>> this by ray casting to find the intersections between the >>> structured grid >>> >>>>> and the polydata. Then using those points to create the >>> unstructured grid. >>> >>>>> >>> >>>>> See attached 2d sketch. >>> >>>>> >>> >>>>> Thanks! >>> >>>>> Justin >>> >>>>> >>> >>>>> >>> >>>>> _______________________________________________ >>> >>>>> Powered by www.kitware.com >>> >>>>> >>> >>>>> Visit other Kitware open-source projects at >>> >>>>> http://www.kitware.com/opensource/opensource.html >>> >>>>> >>> >>>>> Please keep messages on-topic and check the VTK FAQ at: >>> >>>>> 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 >>> >>>> R&D Engineer >>> >>>> Kitware, Inc. >>> >>> >>> >>> >>> >> >>> >> >>> >> >>> >> -- >>> >> Cory Quammen >>> >> R&D Engineer >>> >> Kitware, Inc. >>> > >>> > >>> >>> >>> >>> -- >>> Cory Quammen >>> R&D Engineer >>> Kitware, Inc. >>> >> >> > > > -- > Cory Quammen > R&D Engineer > Kitware, Inc. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From onlyjus at gmail.com Thu Mar 24 16:48:48 2016 From: onlyjus at gmail.com (Justin Weber) Date: Thu, 24 Mar 2016 16:48:48 -0400 Subject: [vtkusers] Autodesk ViewCube in VTK? In-Reply-To: References: Message-ID: I tried to access the mouse events of vtkOrientationMarkerWidget by adding observers, however this does not seem to work. class CustomOrientationMarkerWidget(vtk.vtkOrientationMarkerWidget): def __init__(self, parent=None): self.AddObserver("LeftButtonPressEvent", self.left_button_press_event) def left_button_press_event(self, obj, event): print('pressed') any ideas? On Tue, Mar 22, 2016 at 12:29 PM, Thales Luis Rodrigues Sabino < tluisrs at gmail.com> wrote: > I was thinking about some widget similar to this a while ago. > If you know of anyone who has already implemented this please let us know. > > On Tue, Mar 22, 2016 at 12:53 PM, Justin Weber wrote: > >> Has anyone already implemented a similar interface to Autodesk's ViewCube >> in vtk? >> [image: Inline image 1] >> >> https://knowledge.autodesk.com/support/inventor-products/learn-explore/caas/CloudHelp/cloudhelp/2014/ENU/Inventor/files/GUID-39793B52-120D-491B-B1A0-A93ECE9AF13E-htm.html >> >> if not, *vtkAnnotatedCubeActor* and the *vtkOrientationMarkerWidget* provide >> most of the functionality. How would I detect mouse clicks on the faces of >> the cube? Over-ride the OnLeftButtonDown() and OnLeftButtonUp() functions >> of *vtkOrientationMarkerWidget* and detect the face that was clicked? >> >> Thanks! >> Justin >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> 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 >> >> > > > -- > Thales Luis Rodrigues Sabino > > PhD Student at PGMC-UFJF > Lattes | LinkedIn > | ResearchGate > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 13373 bytes Desc: not available URL: From cory.quammen at kitware.com Thu Mar 24 17:02:45 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Thu, 24 Mar 2016 17:02:45 -0400 Subject: [vtkusers] slice structured grid with polydata In-Reply-To: References: Message-ID: Justin, I just did some more digging. You might want to try http://www.vtk.org/doc/nightly/html/classvtkTableBasedClipDataSet.html The docs say it preserves the input cells whenever possible, which is what you are looking for. I think you should be able to just swap out your vtkClipDataSet variable declaration with a vtkTableBasedClipDataSet variable declaration. Cory On Thu, Mar 24, 2016 at 4:40 PM, Justin Weber wrote: > Thanks for your help Cory. > > Justin > > On Thu, Mar 24, 2016 at 2:32 PM, Cory Quammen > wrote: > >> I don't think there are options in VTK that will do what you want, >> unfortunately. You would need to manually identify which hexahedra are not >> cut and then create a new vtkUnstructuredGrid with those hexahedra as well >> as the cut tetrahedra. >> >> On Thu, Mar 24, 2016 at 2:21 PM, Justin Weber wrote: >> >>> It would be nice if the grid was not tetrahedralized first. I would >>> like the original hexahedrons that are not sliced to be preserved. >>> >>> On Thu, Mar 24, 2016 at 11:59 AM, Cory Quammen >> > wrote: >>> >>>> What do you want as output instead? >>>> >>>> On Thu, Mar 24, 2016 at 10:53 AM, Justin Weber >>>> wrote: >>>> > I didn't realize this earlier but the vtkClipDataSet tetrahedralizes >>>> the >>>> > mesh before slicing? It seems that this is required for the >>>> algorithm. Do >>>> > you know of any ways to prevent this? >>>> > >>>> > BTW, here is the link to the example: >>>> > >>>> http://www.vtk.org/Wiki/VTK/Examples/Python/Meshes/vtkClipDataSetWithPolydata >>>> > >>>> > Justin >>>> > >>>> > On Mon, Mar 7, 2016 at 5:30 PM, Cory Quammen < >>>> cory.quammen at kitware.com> >>>> > wrote: >>>> >> >>>> >> That's great, Justin. Thanks for reporting back. >>>> >> >>>> >> Cory >>>> >> >>>> >> On Mon, Mar 7, 2016 at 4:04 PM, Justin Weber >>>> wrote: >>>> >>> >>>> >>> Cory, >>>> >>> >>>> >>> Thanks for your help. I got it working! I might put the code up as >>>> an >>>> >>> example. >>>> >>> >>>> >>> >>>> >>> Justin >>>> >>> >>>> >>> On Thu, Feb 18, 2016 at 10:58 PM, Cory Quammen < >>>> cory.quammen at kitware.com> >>>> >>> wrote: >>>> >>>> >>>> >>>> Justin, >>>> >>>> >>>> >>>> There is nothing canned in VTK to do this, but with some work you >>>> should >>>> >>>> be able to get there using an implicit function created from your >>>> STL file. >>>> >>>> At a high level, what you would do is create an instance of >>>> >>>> vtkImplicitPolyDataDistance. Set its input to the poly data from >>>> the STL >>>> >>>> file. Then, create a new point data array in your structured grid >>>> that >>>> >>>> stores the value from the implicit poly data distance filter. >>>> Negative >>>> >>>> values will be inside the poly data, positive values outside, and >>>> 0 at the >>>> >>>> surface. Finally, use vtkClipDataSet to clip the structured grid a >>>> function >>>> >>>> value 0. This should give you back an unstructured grid in >>>> approximately the >>>> >>>> shape of your input STL. It won't be exact because of the >>>> interpolation used >>>> >>>> by vtkClipDataSet, but it should be close. >>>> >>>> >>>> >>>> Hope that helps. >>>> >>>> >>>> >>>> Cory >>>> >>>> >>>> >>>> On Thu, Feb 18, 2016 at 10:08 PM, Justin Weber >>>> >>>> wrote: >>>> >>>>> >>>> >>>>> I would like to generate a "cutcell" mesh using vtk by slicing a >>>> >>>>> structured grid with polydata loaded from a STL file. The >>>> resulting mesh >>>> >>>>> would be an unstructured grid. >>>> >>>>> >>>> >>>>> Are there any tools in vtk to accomplish this? >>>> >>>>> >>>> >>>>> I can create the structured grid and polydata successfully. Now I >>>> just >>>> >>>>> need an algorithm to slice the structured mesh with the polydata >>>> surface. >>>> >>>>> >>>> >>>>> In my searching I could not find anything. However, I could >>>> accomplish >>>> >>>>> this by ray casting to find the intersections between the >>>> structured grid >>>> >>>>> and the polydata. Then using those points to create the >>>> unstructured grid. >>>> >>>>> >>>> >>>>> See attached 2d sketch. >>>> >>>>> >>>> >>>>> Thanks! >>>> >>>>> Justin >>>> >>>>> >>>> >>>>> >>>> >>>>> _______________________________________________ >>>> >>>>> Powered by www.kitware.com >>>> >>>>> >>>> >>>>> Visit other Kitware open-source projects at >>>> >>>>> http://www.kitware.com/opensource/opensource.html >>>> >>>>> >>>> >>>>> Please keep messages on-topic and check the VTK FAQ at: >>>> >>>>> 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 >>>> >>>> R&D Engineer >>>> >>>> Kitware, Inc. >>>> >>> >>>> >>> >>>> >> >>>> >> >>>> >> >>>> >> -- >>>> >> Cory Quammen >>>> >> R&D Engineer >>>> >> Kitware, Inc. >>>> > >>>> > >>>> >>>> >>>> >>>> -- >>>> Cory Quammen >>>> R&D Engineer >>>> Kitware, Inc. >>>> >>> >>> >> >> >> -- >> Cory Quammen >> R&D Engineer >> Kitware, Inc. >> > > -- Cory Quammen R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean at rogue-research.com Thu Mar 24 17:03:52 2016 From: sean at rogue-research.com (Sean McBride) Date: Thu, 24 Mar 2016 17:03:52 -0400 Subject: [vtkusers] Error using vtkOpenGLGPUVolumeRayCastMapper on OS X In-Reply-To: References: Message-ID: <20160324210352.8568525@mail.rogue-research.com> On Thu, 24 Mar 2016 12:46:34 -0500, David Warren said: >ERROR: In >/Users/ilan/minonda/conda-bld/work/VTK-6.3.0/Rendering/VolumeOpenGL/ >vtkOpenGLGPUVolumeRayCastMapper.cxx, >line 4040 >vtkOpenGLGPUVolumeRayCastMapper (0x103b90000): Rendering failed because the >following OpenGL extensions are required but not supported: Disabled on >Apple OS X Snow Leopard with nVidia. If you search the VTK codebase for "Snow Leopard with nVidia" and dig through git history, we find commit 08abcf15a5a333096f406dfe5b34d2b7bc47bdf8. See: Seems it's a workaround for an OS X 10.6 (Snow Leopard) bug that was apparently fixed in 10.7 (Lion). The code does a fragile check that's probably failing for you. Actually, I think the check was recently broken in 56a17fafa4e389058c89401bdffd524ba873e622 by Max (cc'ed). Do you have an nVidia, AMD/ATI, or Intel GPU? I'll make a patch to clean it all up... Cheers, -- ____________________________________________________________ Sean McBride, B. Eng sean at rogue-research.com Rogue Research www.rogue-research.com Mac Software Developer Montr?al, Qu?bec, Canada From davideugenewarren+vtk at gmail.com Thu Mar 24 17:11:40 2016 From: davideugenewarren+vtk at gmail.com (David Warren) Date: Thu, 24 Mar 2016 16:11:40 -0500 Subject: [vtkusers] Error using vtkOpenGLGPUVolumeRayCastMapper on OS X In-Reply-To: <20160324210352.8568525@mail.rogue-research.com> References: <20160324210352.8568525@mail.rogue-research.com> Message-ID: Hi Sean, Wow, nice find! My colleague who is having trouble has AMD graphics and is running OS X. We haven't observed the same problems on Linux and Windows machines with Intel and NVIDIA graphics. Many thanks, Dave On Thu, Mar 24, 2016 at 4:03 PM, Sean McBride wrote: > On Thu, 24 Mar 2016 12:46:34 -0500, David Warren said: > > >ERROR: In > >/Users/ilan/minonda/conda-bld/work/VTK-6.3.0/Rendering/VolumeOpenGL/ > >vtkOpenGLGPUVolumeRayCastMapper.cxx, > >line 4040 > >vtkOpenGLGPUVolumeRayCastMapper (0x103b90000): Rendering failed because > the > >following OpenGL extensions are required but not supported: Disabled on > >Apple OS X Snow Leopard with nVidia. > > If you search the VTK codebase for "Snow Leopard with nVidia" and dig > through git history, we find commit > 08abcf15a5a333096f406dfe5b34d2b7bc47bdf8. See: > > > > Seems it's a workaround for an OS X 10.6 (Snow Leopard) bug that was > apparently fixed in 10.7 (Lion). The code does a fragile check that's > probably failing for you. > > Actually, I think the check was recently broken in > 56a17fafa4e389058c89401bdffd524ba873e622 by Max (cc'ed). > > Do you have an nVidia, AMD/ATI, or Intel GPU? > > I'll make a patch to clean it all up... > > Cheers, > > -- > ____________________________________________________________ > Sean McBride, B. Eng sean at rogue-research.com > Rogue Research www.rogue-research.com > Mac Software Developer Montr?al, Qu?bec, Canada > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Thu Mar 24 17:52:45 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Thu, 24 Mar 2016 14:52:45 -0700 Subject: [vtkusers] slice structured grid with polydata In-Reply-To: References: Message-ID: The interior cells should be untouched I think. At least that's the way the original clippers worked. On Thu, Mar 24, 2016 at 11:21 AM, Justin Weber wrote: > It would be nice if the grid was not tetrahedralized first. I would like the > original hexahedrons that are not sliced to be preserved. > > On Thu, Mar 24, 2016 at 11:59 AM, Cory Quammen > wrote: >> >> What do you want as output instead? >> >> On Thu, Mar 24, 2016 at 10:53 AM, Justin Weber wrote: >> > I didn't realize this earlier but the vtkClipDataSet tetrahedralizes the >> > mesh before slicing? It seems that this is required for the algorithm. >> > Do >> > you know of any ways to prevent this? >> > >> > BTW, here is the link to the example: >> > >> > http://www.vtk.org/Wiki/VTK/Examples/Python/Meshes/vtkClipDataSetWithPolydata >> > >> > Justin >> > >> > On Mon, Mar 7, 2016 at 5:30 PM, Cory Quammen >> > wrote: >> >> >> >> That's great, Justin. Thanks for reporting back. >> >> >> >> Cory >> >> >> >> On Mon, Mar 7, 2016 at 4:04 PM, Justin Weber wrote: >> >>> >> >>> Cory, >> >>> >> >>> Thanks for your help. I got it working! I might put the code up as an >> >>> example. >> >>> >> >>> >> >>> Justin >> >>> >> >>> On Thu, Feb 18, 2016 at 10:58 PM, Cory Quammen >> >>> >> >>> wrote: >> >>>> >> >>>> Justin, >> >>>> >> >>>> There is nothing canned in VTK to do this, but with some work you >> >>>> should >> >>>> be able to get there using an implicit function created from your STL >> >>>> file. >> >>>> At a high level, what you would do is create an instance of >> >>>> vtkImplicitPolyDataDistance. Set its input to the poly data from the >> >>>> STL >> >>>> file. Then, create a new point data array in your structured grid >> >>>> that >> >>>> stores the value from the implicit poly data distance filter. >> >>>> Negative >> >>>> values will be inside the poly data, positive values outside, and 0 >> >>>> at the >> >>>> surface. Finally, use vtkClipDataSet to clip the structured grid a >> >>>> function >> >>>> value 0. This should give you back an unstructured grid in >> >>>> approximately the >> >>>> shape of your input STL. It won't be exact because of the >> >>>> interpolation used >> >>>> by vtkClipDataSet, but it should be close. >> >>>> >> >>>> Hope that helps. >> >>>> >> >>>> Cory >> >>>> >> >>>> On Thu, Feb 18, 2016 at 10:08 PM, Justin Weber >> >>>> wrote: >> >>>>> >> >>>>> I would like to generate a "cutcell" mesh using vtk by slicing a >> >>>>> structured grid with polydata loaded from a STL file. The resulting >> >>>>> mesh >> >>>>> would be an unstructured grid. >> >>>>> >> >>>>> Are there any tools in vtk to accomplish this? >> >>>>> >> >>>>> I can create the structured grid and polydata successfully. Now I >> >>>>> just >> >>>>> need an algorithm to slice the structured mesh with the polydata >> >>>>> surface. >> >>>>> >> >>>>> In my searching I could not find anything. However, I could >> >>>>> accomplish >> >>>>> this by ray casting to find the intersections between the structured >> >>>>> grid >> >>>>> and the polydata. Then using those points to create the unstructured >> >>>>> grid. >> >>>>> >> >>>>> See attached 2d sketch. >> >>>>> >> >>>>> Thanks! >> >>>>> Justin >> >>>>> >> >>>>> >> >>>>> _______________________________________________ >> >>>>> Powered by www.kitware.com >> >>>>> >> >>>>> Visit other Kitware open-source projects at >> >>>>> http://www.kitware.com/opensource/opensource.html >> >>>>> >> >>>>> Please keep messages on-topic and check the VTK FAQ at: >> >>>>> 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 >> >>>> R&D Engineer >> >>>> Kitware, Inc. >> >>> >> >>> >> >> >> >> >> >> >> >> -- >> >> Cory Quammen >> >> R&D Engineer >> >> Kitware, Inc. >> > >> > >> >> >> >> -- >> Cory Quammen >> 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 bill.lorensen at gmail.com Thu Mar 24 18:27:31 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Thu, 24 Mar 2016 15:27:31 -0700 Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series In-Reply-To: References: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> <694f11c8.9.15382dbad62.Coremail.tjlp@netease.com> <7303b5c3.b.153830ab688.Coremail.tjlp@netease.com> <35ec6f75.2.15387436d8c.Coremail.tjlp@netease.com> <2c3b748d.7.153876e48b6.Coremail.tjlp@netease.com> <235ba526.4.1538cc14967.Coremail.tjlp@netease.com> <66eac0da.b.1538e45f980.Coremail.tjlp@netease.com> Message-ID: If you are trying to create surfaces from binary data or integral segments, you should use DiscreteMarchingCubes followed by smoothing. The pipeline in this example could be modified for your needs: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Medical/GenerateModelsFromLabels On Sat, Mar 19, 2016 at 6:33 AM, David Gobbi wrote: > On Sat, Mar 19, 2016 at 3:47 AM, Liu_tj wrote: >> >> >> I got it. What value should I set for image_threshold.SetInValue()? Does >> it depend on the greyscale scalarange of the vtkImageData? > > > You need to set ReplaceInOff(). > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 Thu Mar 24 18:29:23 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Thu, 24 Mar 2016 15:29:23 -0700 Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series In-Reply-To: References: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> <694f11c8.9.15382dbad62.Coremail.tjlp@netease.com> <7303b5c3.b.153830ab688.Coremail.tjlp@netease.com> <35ec6f75.2.15387436d8c.Coremail.tjlp@netease.com> <2c3b748d.7.153876e48b6.Coremail.tjlp@netease.com> <235ba526.4.1538cc14967.Coremail.tjlp@netease.com> <66eac0da.b.1538e45f980.Coremail.tjlp@netease.com> Message-ID: For example, the images on the left were generated with the pipeline in the example: https://raw.githubusercontent.com/lorensen/SPLBrainAtlas/master/Models/Screenshot/left_caudate_nucleus.png On Thu, Mar 24, 2016 at 3:27 PM, Bill Lorensen wrote: > If you are trying to create surfaces from binary data or integral > segments, you should use DiscreteMarchingCubes followed by smoothing. > The pipeline in this example could be modified for your needs: > http://www.vtk.org/Wiki/VTK/Examples/Cxx/Medical/GenerateModelsFromLabels > > > > On Sat, Mar 19, 2016 at 6:33 AM, David Gobbi wrote: >> On Sat, Mar 19, 2016 at 3:47 AM, Liu_tj wrote: >>> >>> >>> I got it. What value should I set for image_threshold.SetInValue()? Does >>> it depend on the greyscale scalarange of the vtkImageData? >> >> >> You need to set ReplaceInOff(). >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> 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 bill.lorensen at gmail.com Thu Mar 24 18:43:37 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Thu, 24 Mar 2016 15:43:37 -0700 Subject: [vtkusers] slice structured grid with polydata In-Reply-To: References: Message-ID: I translated Justin's python to c++. See here: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Meshes/ClipDataSetWithPolyData Interesting that the results are: The clipped dataset contains a vtkUnstructuredGrid that has 65317 cells Cell type vtkTetra occurs 54690 times. Cell type vtkWedge occurs 10627 times. This seems odd to me. On Thu, Mar 24, 2016 at 2:52 PM, Bill Lorensen wrote: > The interior cells should be untouched I think. At least that's the > way the original clippers worked. > > > On Thu, Mar 24, 2016 at 11:21 AM, Justin Weber wrote: >> It would be nice if the grid was not tetrahedralized first. I would like the >> original hexahedrons that are not sliced to be preserved. >> >> On Thu, Mar 24, 2016 at 11:59 AM, Cory Quammen >> wrote: >>> >>> What do you want as output instead? >>> >>> On Thu, Mar 24, 2016 at 10:53 AM, Justin Weber wrote: >>> > I didn't realize this earlier but the vtkClipDataSet tetrahedralizes the >>> > mesh before slicing? It seems that this is required for the algorithm. >>> > Do >>> > you know of any ways to prevent this? >>> > >>> > BTW, here is the link to the example: >>> > >>> > http://www.vtk.org/Wiki/VTK/Examples/Python/Meshes/vtkClipDataSetWithPolydata >>> > >>> > Justin >>> > >>> > On Mon, Mar 7, 2016 at 5:30 PM, Cory Quammen >>> > wrote: >>> >> >>> >> That's great, Justin. Thanks for reporting back. >>> >> >>> >> Cory >>> >> >>> >> On Mon, Mar 7, 2016 at 4:04 PM, Justin Weber wrote: >>> >>> >>> >>> Cory, >>> >>> >>> >>> Thanks for your help. I got it working! I might put the code up as an >>> >>> example. >>> >>> >>> >>> >>> >>> Justin >>> >>> >>> >>> On Thu, Feb 18, 2016 at 10:58 PM, Cory Quammen >>> >>> >>> >>> wrote: >>> >>>> >>> >>>> Justin, >>> >>>> >>> >>>> There is nothing canned in VTK to do this, but with some work you >>> >>>> should >>> >>>> be able to get there using an implicit function created from your STL >>> >>>> file. >>> >>>> At a high level, what you would do is create an instance of >>> >>>> vtkImplicitPolyDataDistance. Set its input to the poly data from the >>> >>>> STL >>> >>>> file. Then, create a new point data array in your structured grid >>> >>>> that >>> >>>> stores the value from the implicit poly data distance filter. >>> >>>> Negative >>> >>>> values will be inside the poly data, positive values outside, and 0 >>> >>>> at the >>> >>>> surface. Finally, use vtkClipDataSet to clip the structured grid a >>> >>>> function >>> >>>> value 0. This should give you back an unstructured grid in >>> >>>> approximately the >>> >>>> shape of your input STL. It won't be exact because of the >>> >>>> interpolation used >>> >>>> by vtkClipDataSet, but it should be close. >>> >>>> >>> >>>> Hope that helps. >>> >>>> >>> >>>> Cory >>> >>>> >>> >>>> On Thu, Feb 18, 2016 at 10:08 PM, Justin Weber >>> >>>> wrote: >>> >>>>> >>> >>>>> I would like to generate a "cutcell" mesh using vtk by slicing a >>> >>>>> structured grid with polydata loaded from a STL file. The resulting >>> >>>>> mesh >>> >>>>> would be an unstructured grid. >>> >>>>> >>> >>>>> Are there any tools in vtk to accomplish this? >>> >>>>> >>> >>>>> I can create the structured grid and polydata successfully. Now I >>> >>>>> just >>> >>>>> need an algorithm to slice the structured mesh with the polydata >>> >>>>> surface. >>> >>>>> >>> >>>>> In my searching I could not find anything. However, I could >>> >>>>> accomplish >>> >>>>> this by ray casting to find the intersections between the structured >>> >>>>> grid >>> >>>>> and the polydata. Then using those points to create the unstructured >>> >>>>> grid. >>> >>>>> >>> >>>>> See attached 2d sketch. >>> >>>>> >>> >>>>> Thanks! >>> >>>>> Justin >>> >>>>> >>> >>>>> >>> >>>>> _______________________________________________ >>> >>>>> Powered by www.kitware.com >>> >>>>> >>> >>>>> Visit other Kitware open-source projects at >>> >>>>> http://www.kitware.com/opensource/opensource.html >>> >>>>> >>> >>>>> Please keep messages on-topic and check the VTK FAQ at: >>> >>>>> 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 >>> >>>> R&D Engineer >>> >>>> Kitware, Inc. >>> >>> >>> >>> >>> >> >>> >> >>> >> >>> >> -- >>> >> Cory Quammen >>> >> R&D Engineer >>> >> Kitware, Inc. >>> > >>> > >>> >>> >>> >>> -- >>> Cory Quammen >>> 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 From david.gobbi at gmail.com Thu Mar 24 19:13:23 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 24 Mar 2016 17:13:23 -0600 Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series In-Reply-To: References: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> <694f11c8.9.15382dbad62.Coremail.tjlp@netease.com> <7303b5c3.b.153830ab688.Coremail.tjlp@netease.com> <35ec6f75.2.15387436d8c.Coremail.tjlp@netease.com> <2c3b748d.7.153876e48b6.Coremail.tjlp@netease.com> <235ba526.4.1538cc14967.Coremail.tjlp@netease.com> <66eac0da.b.1538e45f980.Coremail.tjlp@netease.com> Message-ID: On Thu, Mar 24, 2016 at 4:27 PM, Bill Lorensen wrote: > If you are trying to create surfaces from binary data or integral > segments, you should use DiscreteMarchingCubes followed by smoothing. Gotta be careful not to smooth too much, though, because smoothing the polydata causes it to shrink. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Thu Mar 24 19:23:51 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Thu, 24 Mar 2016 16:23:51 -0700 Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series In-Reply-To: References: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> <694f11c8.9.15382dbad62.Coremail.tjlp@netease.com> <7303b5c3.b.153830ab688.Coremail.tjlp@netease.com> <35ec6f75.2.15387436d8c.Coremail.tjlp@netease.com> <2c3b748d.7.153876e48b6.Coremail.tjlp@netease.com> <235ba526.4.1538cc14967.Coremail.tjlp@netease.com> <66eac0da.b.1538e45f980.Coremail.tjlp@netease.com> Message-ID: The WindowedSincPolyData filter is less likely to shrink. Been using it for years. Also, for volumes that have multiple segment labels, the smoothing as illustrated in the example will maintain contact between adjacent labels. The models in this example look pretty good: http://stity.github.io/spl-brain-atlas/utils/three/ On Thu, Mar 24, 2016 at 4:13 PM, David Gobbi wrote: > On Thu, Mar 24, 2016 at 4:27 PM, Bill Lorensen > wrote: >> >> If you are trying to create surfaces from binary data or integral >> segments, you should use DiscreteMarchingCubes followed by smoothing. > > > Gotta be careful not to smooth too much, though, because smoothing the > polydata causes it to shrink. -- Unpaid intern in BillsBasement at noware dot com From sancho at whu.edu.cn Thu Mar 24 20:28:21 2016 From: sancho at whu.edu.cn (=?UTF-8?B?5q615paw5qGl?=) Date: Fri, 25 Mar 2016 08:28:21 +0800 (GMT+08:00) Subject: [vtkusers] Fill the inside of a 3D object In-Reply-To: <1471506620.278560.1458833060153.JavaMail.yahoo@mail.yahoo.com> References: <1471506620.278560.1458833060153.JavaMail.yahoo.ref@mail.yahoo.com> <1471506620.278560.1458833060153.JavaMail.yahoo@mail.yahoo.com> Message-ID: <267775df.ce6c.153ab2c03be.Coremail.sancho@whu.edu.cn> You could do it using vtkImageStencil and vktPolydataToImageStencil oyster ?2016-03-24 23:24:20????sancho at whu.edu.cn??? Hi all, I wish to fill the inside of a 3D object before substracting space from it, to ensure the hole after the substraction looks the way I want it to. How can I fill the inside of a 3D object in vtk? I've seen a suggestion of using vtkFillHolesFilter after substration, but that's not what I want as I'm trying to use a substration to carve something on an object. -------------- next part -------------- An HTML attachment was scrubbed... URL: From onlyjus at gmail.com Thu Mar 24 21:04:12 2016 From: onlyjus at gmail.com (Justin Weber) Date: Thu, 24 Mar 2016 21:04:12 -0400 Subject: [vtkusers] slice structured grid with polydata In-Reply-To: References: Message-ID: Every hex is converted to 5 tets. So the "background mesh" starts with: 51x51x51x5 = 663,255 tets Volume cone / volume of mesh * tets = 1?3?3.14?.5^2?1?8?663255=21694 Does seem a little off... -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjlp at netease.com Thu Mar 24 23:05:56 2016 From: tjlp at netease.com (Liu_tj) Date: Fri, 25 Mar 2016 11:05:56 +0800 (CST) Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series In-Reply-To: References: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> Message-ID: <4dcc7abb.5.153abbc4a00.Coremail.tjlp@netease.com> Hi, David, Continue this thread. For the 3D model generation, we have a preview function. That means we need quick 3D model generation speed and don't need high model precision. Only when really generating, we need a good 3D model quality. So, for the preview, how to accelerate the generation speed? Thanks Liu Peng ?2016-03-17?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?17? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series Hi Liu Peng, The vtkMarchingCubes algorithm is for greyscale images. Using vtkImageThreshold before vtkMarchingCubes will give a poor result, because the algorithm won't be able to properly interpolate the voxels to find the best surface if it is given a binary image. When you call SetValue(0, isovalue), make sure that "isovalue" is set to the value that corresponds to the desired isosurface. If you don't know what value to use, you can start at 1000, then try 250, then 125, etc. until you get a reasonable result. But the best way to choose a value is to use Otsu's method or something similar. - David On Wed, Mar 16, 2016 at 7:42 PM, Liu_tj wrote: Hi, VTK guys, I use VTK 7.0 to generate 3D model from DICOM series. I just follow the code example from http://www.vtk.org/pipermail/vtkusers/2013-November/082109.html. When I try to reduce the number of triangles by vtkDecimatePro, the Visual Studio 2015 monitor shows that the memory jump to over 10G and my computer has no response, I have to restart my computer rudely. See my code below, with my DICOM series, the marched->GetNumberOfPoints() return more than 20 millions: vtkSmartPointer surface = vtkSmartPointer::New(); surface->SetInputData(volume); surface->ComputeNormalsOn(); surface->ComputeScalarsOn(); surface->SetValue(0, 1); // Create polydata from iso-surface vtkSmartPointer marched = vtkSmartPointer::New(); surface->Update(); marched->DeepCopy(surface->GetOutput()); std::cout<<"Number of points: " << marched->GetNumberOfPoints() << std::endl; // Decimation to reduce the number of triangles vtkSmartPointer decimator = vtkDecimatePro::New(); decimator->SetInputData(marched); decimator->SetTargetReduction(0.5); decimator->SetPreserveTopology(1); decimator->Update(); <------------------memory cost jumps to more than 10G. Any suggestions to decrease the memory cost? I only know that using vtkImageThreshold. Thanks, -------------- next part -------------- An HTML attachment was scrubbed... URL: From ysa0829 at gmail.com Thu Mar 24 23:18:11 2016 From: ysa0829 at gmail.com (Ang) Date: Thu, 24 Mar 2016 20:18:11 -0700 (MST) Subject: [vtkusers] VTKImageResliceMapper SetClippingPlanes problems In-Reply-To: References: <1458726323146-5737327.post@n5.nabble.com> <1458815743100-5737343.post@n5.nabble.com> Message-ID: <1458875891935-5737396.post@n5.nabble.com> Hi David, I understand the marching cubes algorithm and answer your question: the result is serrated Polydata. I have tried to keep the scalar values inside the iso contour , but the result is not good. I think best way is using the binary image as a mask and combine origin image's scalars value to generate polyData. How do you think about my idea? -- View this message in context: http://vtk.1045678.n5.nabble.com/VTKImageResliceMapper-SetClippingPlanes-problems-tp5737327p5737396.html Sent from the VTK - Users mailing list archive at Nabble.com. From david.gobbi at gmail.com Fri Mar 25 00:37:01 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 24 Mar 2016 22:37:01 -0600 Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series In-Reply-To: <4dcc7abb.5.153abbc4a00.Coremail.tjlp@netease.com> References: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> <4dcc7abb.5.153abbc4a00.Coremail.tjlp@netease.com> Message-ID: On Thu, Mar 24, 2016 at 9:05 PM, Liu_tj wrote: > Hi, David, > > Continue this thread. For the 3D model generation, we have a preview > function. That means we need quick 3D model generation speed and don't need > high model precision. Only when really generating, we need a good 3D model > quality. So, for the preview, how to accelerate the generation speed? > For high speed, you can generate the model from a low-resolution image. The vtkImageResize filter can generate a low resolution image very fast, for example resize.SetOutputDimensions(128,128,128) will cause it to generate a 128x128x128 downsampled image. It uses a windowed sinc filter to smooth the image while it reduces the resolution. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Fri Mar 25 01:23:11 2016 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 24 Mar 2016 23:23:11 -0600 Subject: [vtkusers] VTKImageResliceMapper SetClippingPlanes problems In-Reply-To: <1458875891935-5737396.post@n5.nabble.com> References: <1458726323146-5737327.post@n5.nabble.com> <1458815743100-5737343.post@n5.nabble.com> <1458875891935-5737396.post@n5.nabble.com> Message-ID: On Thu, Mar 24, 2016 at 9:18 PM, Ang wrote: > Hi David, > > I understand the marching cubes algorithm and answer your question: > > the result is serrated Polydata. > Hmm... that's not a very good answer. The result depends on how you set the isovalue. For example, I have attached images that show the result of marching cubes on a binary image. I used a different isovalue for each of the three results. As you can see, even though they all look "blocky", the one in the middle is smoother than the other two. I think best way is using the binary image as a mask and combine origin > image's scalars value to generate polyData. > > How do you think about my idea? > I already gave my opinion about this in an email to another user. If you do this, then the resulting model will be smaller than it should be. If you are not able use the original image (with no thresholding), then I recommend that you apply vtkImageGaussianSmooth to the binary image before using marching cubes (set the InValue and OutValue of the vtkImageThreshold to 0, 255 so that there is enough dynamic range to get a good smoothing result). - David -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: HeadBoneIsovalues.png Type: image/png Size: 175791 bytes Desc: not available URL: From philip.fackler at gmail.com Fri Mar 25 08:07:09 2016 From: philip.fackler at gmail.com (Philip Fackler) Date: Fri, 25 Mar 2016 12:07:09 +0000 Subject: [vtkusers] Triangulate surface points? In-Reply-To: References: Message-ID: Cory, Thanks for the response. As far as I can tell, surface reconstruction in general (including these two in particular) doesn't use the points given as vertices for the resulting surface mesh. I want something to simply triangulate the points I already have on the surface. --Philip On Thu, Mar 24, 2016 at 2:29 PM Cory Quammen wrote: > Philip, > > Please take a look at > > > http://www.vtk.org/doc/nightly/html/classvtkSurfaceReconstructionFilter.html > > and > > http://www.vtkjournal.org/browse/publication/718 > > I don't have direct experience with these classes, but they may have what > you need. > > HTH, > Cory > > On Thu, Mar 24, 2016 at 2:24 PM, Philip Fackler > wrote: > >> If someone could even definitively tell me "no, you can't do this" that >> would be helpful. >> >> Thanks, >> Philip Fackler >> >> On Wed, Mar 16, 2016 at 6:24 PM Philip Fackler >> wrote: >> >>> Is there a way to triangulate a set of surface points using vtk? I've >>> looked around and everything I've found (vtk, cgal, pcl) only do a surface >>> reconstruction which ends up generating its own points to triangulate. I >>> want to actually use the points I have as the vertices of the >>> triangulation. Along with the point locations, I have a lot of information >>> available in my code that I could provide: >>> >>> Normal vector at each point >>> Bounding segmented curve(s) (i.e., lists of edge cells indexing the list >>> of surface points) >>> A polydata representation of the surface (Note that the points I want to >>> triangulate are distinct from the points involved in this) >>> >>> The only vtk utility that seems to come close to this is vtkDelaunay2D, >>> but it's only useful if all the points can be mapped to a 2D plane. This >>> isn't possible in general without a parametric surface, which is one bit of >>> information I don't have. >>> >>> Thanks in advance for the 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 >> >> > > > -- > Cory Quammen > R&D Engineer > Kitware, Inc. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lasso at queensu.ca Fri Mar 25 08:34:46 2016 From: lasso at queensu.ca (Andras Lasso) Date: Fri, 25 Mar 2016 12:34:46 +0000 Subject: [vtkusers] Triangulate surface points? In-Reply-To: References: Message-ID: We get excellent results for sparse point sets using a combination of vtkDelaunay3D, vtkDataSetSurfaceFilter, and vtkButterflySubdivisionFilter. The generated surface includes the exact points that we specify. You can see what kind of surfaces you can generate from a small number of points: https://www.youtube.com/watch?v=1mYNwJbE7dQ You can play with it if you download 3D Slicer and install Volume Clip extension (https://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Extensions/VolumeClip). Source code is available here: https://subversion.assembla.com/svn/slicerrt/trunk/VolumeClip/src/VolumeClipWithModel/ (relevant part is in updateModelFromMarkup function) Andras From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Cory Quammen Sent: March 24, 2016 2:29 PM To: Philip Fackler Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Triangulate surface points? Philip, Please take a look at http://www.vtk.org/doc/nightly/html/classvtkSurfaceReconstructionFilter.html and http://www.vtkjournal.org/browse/publication/718 I don't have direct experience with these classes, but they may have what you need. HTH, Cory On Thu, Mar 24, 2016 at 2:24 PM, Philip Fackler > wrote: If someone could even definitively tell me "no, you can't do this" that would be helpful. Thanks, Philip Fackler On Wed, Mar 16, 2016 at 6:24 PM Philip Fackler > wrote: Is there a way to triangulate a set of surface points using vtk? I've looked around and everything I've found (vtk, cgal, pcl) only do a surface reconstruction which ends up generating its own points to triangulate. I want to actually use the points I have as the vertices of the triangulation. Along with the point locations, I have a lot of information available in my code that I could provide: Normal vector at each point Bounding segmented curve(s) (i.e., lists of edge cells indexing the list of surface points) A polydata representation of the surface (Note that the points I want to triangulate are distinct from the points involved in this) The only vtk utility that seems to come close to this is vtkDelaunay2D, but it's only useful if all the points can be mapped to a 2D plane. This isn't possible in general without a parametric surface, which is one bit of information I don't have. Thanks in advance for the 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 -- Cory Quammen R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From wulihouxiaoshuai at 163.com Fri Mar 25 09:08:16 2016 From: wulihouxiaoshuai at 163.com (Emptystack) Date: Fri, 25 Mar 2016 06:08:16 -0700 (MST) Subject: [vtkusers] question about VTKWeb in the WAN environment Message-ID: <1458911296969-5737401.post@n5.nabble.com> Hello everyone, Recent days I want to test my volume rendering application based on vtkWeb in the WAN environment, But something unexpected happened, as dicpicted in the following picture and It always popped up a window saying null. And the volume rendering application worked normaly in the LAN environment, I am eager to need some help? Any advice is appreciated! Thanks a lot! -- View this message in context: http://vtk.1045678.n5.nabble.com/question-about-VTKWeb-in-the-WAN-environment-tp5737401.html Sent from the VTK - Users mailing list archive at Nabble.com. From cory.quammen at kitware.com Fri Mar 25 09:36:54 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Fri, 25 Mar 2016 09:36:54 -0400 Subject: [vtkusers] Triangulate surface points? In-Reply-To: References: Message-ID: Andras, That's a good idea as well, but doesn't vtkDelaunay3D produce a convex hull of the input points? That's fine if your object is convex, of course, but may not give you the expected results if your object has a concave region. If there is a feature in vtkDelaunay3D that can produce concave surfaces, I would be interested to know about it. Thanks, Cory On Fri, Mar 25, 2016 at 8:34 AM, Andras Lasso wrote: > We get excellent results for sparse point sets using a combination of > vtkDelaunay3D, vtkDataSetSurfaceFilter, and vtkButterflySubdivisionFilter. > The generated surface includes the exact points that we specify. > > > > You can see what kind of surfaces you can generate from a small number of > points: > > https://www.youtube.com/watch?v=1mYNwJbE7dQ > > > > You can play with it if you download 3D Slicer and install Volume Clip > extension ( > https://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Extensions/VolumeClip). > Source code is available here: > > > https://subversion.assembla.com/svn/slicerrt/trunk/VolumeClip/src/VolumeClipWithModel/ > > (relevant part is in updateModelFromMarkup function) > > > > Andras > > > > *From:* vtkusers [mailto:vtkusers-bounces at vtk.org] *On Behalf Of *Cory > Quammen > *Sent:* March 24, 2016 2:29 PM > *To:* Philip Fackler > *Cc:* vtkusers at vtk.org > *Subject:* Re: [vtkusers] Triangulate surface points? > > > > Philip, > > > > Please take a look at > > > > > http://www.vtk.org/doc/nightly/html/classvtkSurfaceReconstructionFilter.html > > > > and > > > > http://www.vtkjournal.org/browse/publication/718 > > > > I don't have direct experience with these classes, but they may have what > you need. > > > > HTH, > > Cory > > > > On Thu, Mar 24, 2016 at 2:24 PM, Philip Fackler > wrote: > > If someone could even definitively tell me "no, you can't do this" that > would be helpful. > > > > Thanks, > > Philip Fackler > > > > On Wed, Mar 16, 2016 at 6:24 PM Philip Fackler > wrote: > > Is there a way to triangulate a set of surface points using vtk? I've > looked around and everything I've found (vtk, cgal, pcl) only do a surface > reconstruction which ends up generating its own points to triangulate. I > want to actually use the points I have as the vertices of the > triangulation. Along with the point locations, I have a lot of information > available in my code that I could provide: > > > Normal vector at each point > > Bounding segmented curve(s) (i.e., lists of edge cells indexing the list > of surface points) > > A polydata representation of the surface (Note that the points I want to > triangulate are distinct from the points involved in this) > > The only vtk utility that seems to come close to this is vtkDelaunay2D, > but it's only useful if all the points can be mapped to a 2D plane. This > isn't possible in general without a parametric surface, which is one bit of > information I don't have. > > Thanks in advance for the 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 > > > > > > -- > > Cory Quammen > R&D Engineer > Kitware, Inc. > -- Cory Quammen R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lasso at queensu.ca Fri Mar 25 09:48:56 2016 From: lasso at queensu.ca (Andras Lasso) Date: Fri, 25 Mar 2016 13:48:56 +0000 Subject: [vtkusers] Triangulate surface points? In-Reply-To: References: , Message-ID: It can generate non-convex surfaces up to some point - check out the video and/or try it yourself (you can install the Volume clip extension in Slicer by two clicks and you can mark points and drag them around to see how the surface is evolving). The alpha parameter in Delaunay 3D controls handling of concavities. Limitations include that a non-zero alpha may make the triangulation to fail and irregular point distances may confuse the smoothing algorithm. Andras From: Cory Quammen Sent: March 25, 2016 09:37 To: Andras Lasso Cc: Philip Fackler; vtkusers at vtk.org Subject: Re: [vtkusers] Triangulate surface points? Andras, That's a good idea as well, but doesn't vtkDelaunay3D produce a convex hull of the input points? That's fine if your object is convex, of course, but may not give you the expected results if your object has a concave region. If there is a feature in vtkDelaunay3D that can produce concave surfaces, I would be interested to know about it. Thanks, Cory On Fri, Mar 25, 2016 at 8:34 AM, Andras Lasso > wrote: We get excellent results for sparse point sets using a combination of vtkDelaunay3D, vtkDataSetSurfaceFilter, and vtkButterflySubdivisionFilter. The generated surface includes the exact points that we specify. You can see what kind of surfaces you can generate from a small number of points: https://www.youtube.com/watch?v=1mYNwJbE7dQ You can play with it if you download 3D Slicer and install Volume Clip extension (https://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Extensions/VolumeClip). Source code is available here: https://subversion.assembla.com/svn/slicerrt/trunk/VolumeClip/src/VolumeClipWithModel/ (relevant part is in updateModelFromMarkup function) Andras From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Cory Quammen Sent: March 24, 2016 2:29 PM To: Philip Fackler > Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Triangulate surface points? Philip, Please take a look at http://www.vtk.org/doc/nightly/html/classvtkSurfaceReconstructionFilter.html and http://www.vtkjournal.org/browse/publication/718 I don't have direct experience with these classes, but they may have what you need. HTH, Cory On Thu, Mar 24, 2016 at 2:24 PM, Philip Fackler > wrote: If someone could even definitively tell me "no, you can't do this" that would be helpful. Thanks, Philip Fackler On Wed, Mar 16, 2016 at 6:24 PM Philip Fackler > wrote: Is there a way to triangulate a set of surface points using vtk? I've looked around and everything I've found (vtk, cgal, pcl) only do a surface reconstruction which ends up generating its own points to triangulate. I want to actually use the points I have as the vertices of the triangulation. Along with the point locations, I have a lot of information available in my code that I could provide: Normal vector at each point Bounding segmented curve(s) (i.e., lists of edge cells indexing the list of surface points) A polydata representation of the surface (Note that the points I want to triangulate are distinct from the points involved in this) The only vtk utility that seems to come close to this is vtkDelaunay2D, but it's only useful if all the points can be mapped to a 2D plane. This isn't possible in general without a parametric surface, which is one bit of information I don't have. Thanks in advance for the 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 -- Cory Quammen R&D Engineer Kitware, Inc. -- Cory Quammen R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cory.quammen at kitware.com Fri Mar 25 09:59:08 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Fri, 25 Mar 2016 09:59:08 -0400 Subject: [vtkusers] Triangulate surface points? In-Reply-To: References: Message-ID: Cool, thanks!. On Fri, Mar 25, 2016 at 9:48 AM, Andras Lasso wrote: > It can generate non-convex surfaces up to some point - check out the > video and/or try it yourself (you can install the Volume clip extension in > Slicer by two clicks and you can mark points and drag them around to see > how the surface is evolving). The alpha parameter in Delaunay 3D controls > handling of concavities. Limitations include that a non-zero alpha may make > the triangulation to fail and irregular point distances may confuse the > smoothing algorithm. > > > > Andras > > > > *From: *Cory Quammen > *Sent: *March 25, 2016 09:37 > *To: *Andras Lasso > *Cc: *Philip Fackler ; vtkusers at vtk.org > > *Subject: *Re: [vtkusers] Triangulate surface points? > > > Andras, > > That's a good idea as well, but doesn't vtkDelaunay3D produce a convex > hull of the input points? That's fine if your object is convex, of course, > but may not give you the expected results if your object has a concave > region. > > If there is a feature in vtkDelaunay3D that can produce concave surfaces, > I would be interested to know about it. > > Thanks, > Cory > > On Fri, Mar 25, 2016 at 8:34 AM, Andras Lasso wrote: > >> We get excellent results for sparse point sets using a combination of >> vtkDelaunay3D, vtkDataSetSurfaceFilter, and vtkButterflySubdivisionFilter. >> The generated surface includes the exact points that we specify. >> >> >> >> You can see what kind of surfaces you can generate from a small number of >> points: >> >> https://www.youtube.com/watch?v=1mYNwJbE7dQ >> >> >> >> You can play with it if you download 3D Slicer and install Volume Clip >> extension ( >> https://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Extensions/VolumeClip). >> Source code is available here: >> >> >> https://subversion.assembla.com/svn/slicerrt/trunk/VolumeClip/src/VolumeClipWithModel/ >> >> (relevant part is in updateModelFromMarkup function) >> >> >> >> Andras >> >> >> >> *From:* vtkusers [mailto:vtkusers-bounces at vtk.org] *On Behalf Of *Cory >> Quammen >> *Sent:* March 24, 2016 2:29 PM >> *To:* Philip Fackler >> *Cc:* vtkusers at vtk.org >> *Subject:* Re: [vtkusers] Triangulate surface points? >> >> >> >> Philip, >> >> >> >> Please take a look at >> >> >> >> >> http://www.vtk.org/doc/nightly/html/classvtkSurfaceReconstructionFilter.html >> >> >> >> and >> >> >> >> http://www.vtkjournal.org/browse/publication/718 >> >> >> >> I don't have direct experience with these classes, but they may have what >> you need. >> >> >> >> HTH, >> >> Cory >> >> >> >> On Thu, Mar 24, 2016 at 2:24 PM, Philip Fackler >> wrote: >> >> If someone could even definitively tell me "no, you can't do this" that >> would be helpful. >> >> >> >> Thanks, >> >> Philip Fackler >> >> >> >> On Wed, Mar 16, 2016 at 6:24 PM Philip Fackler >> wrote: >> >> Is there a way to triangulate a set of surface points using vtk? I've >> looked around and everything I've found (vtk, cgal, pcl) only do a surface >> reconstruction which ends up generating its own points to triangulate. I >> want to actually use the points I have as the vertices of the >> triangulation. Along with the point locations, I have a lot of information >> available in my code that I could provide: >> >> >> Normal vector at each point >> >> Bounding segmented curve(s) (i.e., lists of edge cells indexing the list >> of surface points) >> >> A polydata representation of the surface (Note that the points I want to >> triangulate are distinct from the points involved in this) >> >> The only vtk utility that seems to come close to this is vtkDelaunay2D, >> but it's only useful if all the points can be mapped to a 2D plane. This >> isn't possible in general without a parametric surface, which is one bit of >> information I don't have. >> >> Thanks in advance for the 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 >> >> >> >> >> >> -- >> >> Cory Quammen >> R&D Engineer >> Kitware, Inc. >> > > > > -- > Cory Quammen > R&D Engineer > Kitware, Inc. > -- Cory Quammen R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From philip.fackler at gmail.com Fri Mar 25 10:04:45 2016 From: philip.fackler at gmail.com (Philip Fackler) Date: Fri, 25 Mar 2016 14:04:45 +0000 Subject: [vtkusers] Triangulate surface points? In-Reply-To: References: Message-ID: I've tried out vtkDelaunay3D some. But in cases where the surface is completely planar, it fails (it can't make any tets). Is there a way it can handle that. Sorry, I haven't had a chance to watch the video yet. On Fri, Mar 25, 2016 at 9:59 AM Cory Quammen wrote: > Cool, thanks!. > > On Fri, Mar 25, 2016 at 9:48 AM, Andras Lasso wrote: > >> It can generate non-convex surfaces up to some point - check out the >> video and/or try it yourself (you can install the Volume clip extension in >> Slicer by two clicks and you can mark points and drag them around to see >> how the surface is evolving). The alpha parameter in Delaunay 3D controls >> handling of concavities. Limitations include that a non-zero alpha may make >> the triangulation to fail and irregular point distances may confuse the >> smoothing algorithm. >> >> >> >> Andras >> >> >> >> *From: *Cory Quammen >> *Sent: *March 25, 2016 09:37 >> *To: *Andras Lasso >> *Cc: *Philip Fackler ; vtkusers at vtk.org >> >> *Subject: *Re: [vtkusers] Triangulate surface points? >> >> >> Andras, >> >> That's a good idea as well, but doesn't vtkDelaunay3D produce a convex >> hull of the input points? That's fine if your object is convex, of course, >> but may not give you the expected results if your object has a concave >> region. >> >> If there is a feature in vtkDelaunay3D that can produce concave surfaces, >> I would be interested to know about it. >> >> Thanks, >> Cory >> >> On Fri, Mar 25, 2016 at 8:34 AM, Andras Lasso wrote: >> >>> We get excellent results for sparse point sets using a combination of >>> vtkDelaunay3D, vtkDataSetSurfaceFilter, and vtkButterflySubdivisionFilter. >>> The generated surface includes the exact points that we specify. >>> >>> >>> >>> You can see what kind of surfaces you can generate from a small number >>> of points: >>> >>> https://www.youtube.com/watch?v=1mYNwJbE7dQ >>> >>> >>> >>> You can play with it if you download 3D Slicer and install Volume Clip >>> extension ( >>> https://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Extensions/VolumeClip). >>> Source code is available here: >>> >>> >>> https://subversion.assembla.com/svn/slicerrt/trunk/VolumeClip/src/VolumeClipWithModel/ >>> >>> (relevant part is in updateModelFromMarkup function) >>> >>> >>> >>> Andras >>> >>> >>> >>> *From:* vtkusers [mailto:vtkusers-bounces at vtk.org] *On Behalf Of *Cory >>> Quammen >>> *Sent:* March 24, 2016 2:29 PM >>> *To:* Philip Fackler >>> *Cc:* vtkusers at vtk.org >>> *Subject:* Re: [vtkusers] Triangulate surface points? >>> >>> >>> >>> Philip, >>> >>> >>> >>> Please take a look at >>> >>> >>> >>> >>> http://www.vtk.org/doc/nightly/html/classvtkSurfaceReconstructionFilter.html >>> >>> >>> >>> and >>> >>> >>> >>> http://www.vtkjournal.org/browse/publication/718 >>> >>> >>> >>> I don't have direct experience with these classes, but they may have >>> what you need. >>> >>> >>> >>> HTH, >>> >>> Cory >>> >>> >>> >>> On Thu, Mar 24, 2016 at 2:24 PM, Philip Fackler < >>> philip.fackler at gmail.com> wrote: >>> >>> If someone could even definitively tell me "no, you can't do this" that >>> would be helpful. >>> >>> >>> >>> Thanks, >>> >>> Philip Fackler >>> >>> >>> >>> On Wed, Mar 16, 2016 at 6:24 PM Philip Fackler >>> wrote: >>> >>> Is there a way to triangulate a set of surface points using vtk? I've >>> looked around and everything I've found (vtk, cgal, pcl) only do a surface >>> reconstruction which ends up generating its own points to triangulate. I >>> want to actually use the points I have as the vertices of the >>> triangulation. Along with the point locations, I have a lot of information >>> available in my code that I could provide: >>> >>> >>> Normal vector at each point >>> >>> Bounding segmented curve(s) (i.e., lists of edge cells indexing the list >>> of surface points) >>> >>> A polydata representation of the surface (Note that the points I want to >>> triangulate are distinct from the points involved in this) >>> >>> The only vtk utility that seems to come close to this is vtkDelaunay2D, >>> but it's only useful if all the points can be mapped to a 2D plane. This >>> isn't possible in general without a parametric surface, which is one bit of >>> information I don't have. >>> >>> Thanks in advance for the 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 >>> >>> >>> >>> >>> >>> -- >>> >>> Cory Quammen >>> R&D Engineer >>> Kitware, Inc. >>> >> >> >> >> -- >> Cory Quammen >> R&D Engineer >> Kitware, Inc. >> > > > > -- > Cory Quammen > R&D Engineer > Kitware, Inc. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lasso at queensu.ca Fri Mar 25 10:21:36 2016 From: lasso at queensu.ca (Andras Lasso) Date: Fri, 25 Mar 2016 14:21:36 +0000 Subject: [vtkusers] Triangulate surface points? In-Reply-To: References: , Message-ID: When all points are coplanar we insert a glyph filter in the pipeline to add small spheres at each point. Andras From: Philip Fackler Sent: March 25, 2016 10:05 To: Cory Quammen; Andras Lasso Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Triangulate surface points? I've tried out vtkDelaunay3D some. But in cases where the surface is completely planar, it fails (it can't make any tets). Is there a way it can handle that. Sorry, I haven't had a chance to watch the video yet. On Fri, Mar 25, 2016 at 9:59 AM Cory Quammen > wrote: Cool, thanks!. On Fri, Mar 25, 2016 at 9:48 AM, Andras Lasso > wrote: It can generate non-convex surfaces up to some point - check out the video and/or try it yourself (you can install the Volume clip extension in Slicer by two clicks and you can mark points and drag them around to see how the surface is evolving). The alpha parameter in Delaunay 3D controls handling of concavities. Limitations include that a non-zero alpha may make the triangulation to fail and irregular point distances may confuse the smoothing algorithm. Andras From: Cory Quammen Sent: March 25, 2016 09:37 To: Andras Lasso Cc: Philip Fackler; vtkusers at vtk.org Subject: Re: [vtkusers] Triangulate surface points? Andras, That's a good idea as well, but doesn't vtkDelaunay3D produce a convex hull of the input points? That's fine if your object is convex, of course, but may not give you the expected results if your object has a concave region. If there is a feature in vtkDelaunay3D that can produce concave surfaces, I would be interested to know about it. Thanks, Cory On Fri, Mar 25, 2016 at 8:34 AM, Andras Lasso > wrote: We get excellent results for sparse point sets using a combination of vtkDelaunay3D, vtkDataSetSurfaceFilter, and vtkButterflySubdivisionFilter. The generated surface includes the exact points that we specify. You can see what kind of surfaces you can generate from a small number of points: https://www.youtube.com/watch?v=1mYNwJbE7dQ You can play with it if you download 3D Slicer and install Volume Clip extension (https://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Extensions/VolumeClip). Source code is available here: https://subversion.assembla.com/svn/slicerrt/trunk/VolumeClip/src/VolumeClipWithModel/ (relevant part is in updateModelFromMarkup function) Andras From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Cory Quammen Sent: March 24, 2016 2:29 PM To: Philip Fackler > Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Triangulate surface points? Philip, Please take a look at http://www.vtk.org/doc/nightly/html/classvtkSurfaceReconstructionFilter.html and http://www.vtkjournal.org/browse/publication/718 I don't have direct experience with these classes, but they may have what you need. HTH, Cory On Thu, Mar 24, 2016 at 2:24 PM, Philip Fackler > wrote: If someone could even definitively tell me "no, you can't do this" that would be helpful. Thanks, Philip Fackler On Wed, Mar 16, 2016 at 6:24 PM Philip Fackler > wrote: Is there a way to triangulate a set of surface points using vtk? I've looked around and everything I've found (vtk, cgal, pcl) only do a surface reconstruction which ends up generating its own points to triangulate. I want to actually use the points I have as the vertices of the triangulation. Along with the point locations, I have a lot of information available in my code that I could provide: Normal vector at each point Bounding segmented curve(s) (i.e., lists of edge cells indexing the list of surface points) A polydata representation of the surface (Note that the points I want to triangulate are distinct from the points involved in this) The only vtk utility that seems to come close to this is vtkDelaunay2D, but it's only useful if all the points can be mapped to a 2D plane. This isn't possible in general without a parametric surface, which is one bit of information I don't have. Thanks in advance for the 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 -- Cory Quammen R&D Engineer Kitware, Inc. -- Cory Quammen R&D Engineer Kitware, Inc. -- Cory Quammen R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From onlyjus at gmail.com Fri Mar 25 12:11:45 2016 From: onlyjus at gmail.com (Justin Weber) Date: Fri, 25 Mar 2016 12:11:45 -0400 Subject: [vtkusers] slice structured grid with polydata In-Reply-To: References: Message-ID: vtkTableBasedClipDataSet looks like what I want. I tried a cube. Background mesh is 9x9x9 = 729 cells cell breakdown: tetra: 8 wedge: 84 hexahedron: 637 total: 729 Thanks for all your help! I'll add another example using vtkTableBasedClipDataSet to the wiki. Justin [image: Inline image 2] On Thu, Mar 24, 2016 at 9:04 PM, Justin Weber wrote: > Every hex is converted to 5 tets. So the "background mesh" starts with: > 51x51x51x5 = 663,255 tets > > Volume cone / volume of mesh * tets = 1?3?3.14?.5^2?1?8?663255=21694 > > Does seem a little off... > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: vtkTableBasedClipDataSet.png Type: image/png Size: 94995 bytes Desc: not available URL: From cory.quammen at kitware.com Fri Mar 25 12:16:24 2016 From: cory.quammen at kitware.com (Cory Quammen) Date: Fri, 25 Mar 2016 12:16:24 -0400 Subject: [vtkusers] slice structured grid with polydata In-Reply-To: References: Message-ID: Awesome, thanks! Cory On Fri, Mar 25, 2016 at 12:11 PM, Justin Weber wrote: > vtkTableBasedClipDataSet looks like what I want. > > > I tried a cube. Background mesh is 9x9x9 = 729 cells > > > cell breakdown: > > tetra: 8 > > wedge: 84 > > hexahedron: 637 > > total: 729 > > > Thanks for all your help! I'll add another example using > vtkTableBasedClipDataSet to the wiki. > > Justin > > [image: Inline image 2] > > On Thu, Mar 24, 2016 at 9:04 PM, Justin Weber wrote: > >> Every hex is converted to 5 tets. So the "background mesh" starts with: >> 51x51x51x5 = 663,255 tets >> >> Volume cone / volume of mesh * tets = 1?3?3.14?.5^2?1?8?663255=21694 >> >> Does seem a little off... >> > > -- Cory Quammen R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: vtkTableBasedClipDataSet.png Type: image/png Size: 94995 bytes Desc: not available URL: From bill.lorensen at gmail.com Fri Mar 25 14:02:50 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Fri, 25 Mar 2016 11:02:50 -0700 Subject: [vtkusers] slice structured grid with polydata In-Reply-To: References: Message-ID: Agreed, the TableBased version just a much better job and retains the hexahedrons that are completely inside the clipped region. I'll also add a C++ example. On Fri, Mar 25, 2016 at 9:16 AM, Cory Quammen wrote: > Awesome, thanks! > > Cory > > On Fri, Mar 25, 2016 at 12:11 PM, Justin Weber wrote: > >> vtkTableBasedClipDataSet looks like what I want. >> >> >> I tried a cube. Background mesh is 9x9x9 = 729 cells >> >> >> cell breakdown: >> >> tetra: 8 >> >> wedge: 84 >> >> hexahedron: 637 >> >> total: 729 >> >> >> Thanks for all your help! I'll add another example using >> vtkTableBasedClipDataSet to the wiki. >> >> Justin >> >> [image: Inline image 2] >> >> On Thu, Mar 24, 2016 at 9:04 PM, Justin Weber wrote: >> >>> Every hex is converted to 5 tets. So the "background mesh" starts with: >>> 51x51x51x5 = 663,255 tets >>> >>> Volume cone / volume of mesh * tets = 1?3?3.14?.5^2?1?8?663255=21694 >>> >>> Does seem a little off... >>> >> >> > > > -- > Cory Quammen > R&D Engineer > Kitware, Inc. > -- 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: vtkTableBasedClipDataSet.png Type: image/png Size: 94995 bytes Desc: not available URL: From bill.lorensen at gmail.com Fri Mar 25 16:57:32 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Fri, 25 Mar 2016 13:57:32 -0700 Subject: [vtkusers] slice structured grid with polydata In-Reply-To: References: Message-ID: I updated and added two wiki examples: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Meshes/ClipDataSetWithPolyData http://www.vtk.org/Wiki/VTK/Examples/Cxx/Meshes/TableBasedClipDataSetWithPolyData The table based method seems superior. Justin, thanks for investigating the two approaches. Bill On Fri, Mar 25, 2016 at 11:02 AM, Bill Lorensen wrote: > Agreed, the TableBased version just a much better job and retains the > hexahedrons that are completely inside the clipped region. > > I'll also add a C++ example. > > > On Fri, Mar 25, 2016 at 9:16 AM, Cory Quammen > wrote: > >> Awesome, thanks! >> >> Cory >> >> On Fri, Mar 25, 2016 at 12:11 PM, Justin Weber wrote: >> >>> vtkTableBasedClipDataSet looks like what I want. >>> >>> >>> I tried a cube. Background mesh is 9x9x9 = 729 cells >>> >>> >>> cell breakdown: >>> >>> tetra: 8 >>> >>> wedge: 84 >>> >>> hexahedron: 637 >>> >>> total: 729 >>> >>> >>> Thanks for all your help! I'll add another example using >>> vtkTableBasedClipDataSet to the wiki. >>> >>> Justin >>> >>> [image: Inline image 2] >>> >>> On Thu, Mar 24, 2016 at 9:04 PM, Justin Weber wrote: >>> >>>> Every hex is converted to 5 tets. So the "background mesh" starts with: >>>> 51x51x51x5 = 663,255 tets >>>> >>>> Volume cone / volume of mesh * tets = 1?3?3.14?.5^2?1?8?663255=21694 >>>> >>>> Does seem a little off... >>>> >>> >>> >> >> >> -- >> Cory Quammen >> R&D Engineer >> Kitware, Inc. >> > > > > -- > Unpaid intern in BillsBasement at noware dot com > -- 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: vtkTableBasedClipDataSet.png Type: image/png Size: 94995 bytes Desc: not available URL: From rickfrank at me.com Fri Mar 25 19:40:41 2016 From: rickfrank at me.com (Richard Frank) Date: Fri, 25 Mar 2016 23:40:41 +0000 (GMT) Subject: [vtkusers] camera follower in 3D Message-ID: Hi, Has anyone successfully created a widget or other object that stays facing the camera in 3D? I've been trying to get the boxwidget to stay with one side facing the camera and I've come close - by computing a change of basis matrix after computing the camera position, direction of projection, etc. and creating a rotation matrix from the basis column vectors. When I have the PlusX face of the box widget facing the camera, and move the camera with the trackball interactor, the face of the widget stays facing (seems like it is standing still) but the size/scale of the box gets smaller as I rotate by sliding the mouse from right to left.? It seems that I need to compensate for some scaling of the rotation matrix but I'm not sure exactly what. I'm putting together a small example if someone wants to take a look at it. Thanks Rick -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdrahos at aurisrobotics.com Fri Mar 25 19:46:36 2016 From: mdrahos at aurisrobotics.com (Miroslav Drahos) Date: Fri, 25 Mar 2016 23:46:36 +0000 Subject: [vtkusers] camera follower in 3D In-Reply-To: References: Message-ID: Rick, Look at vtkOrientedPolygonalHandleRepresentation3D http://www.vtk.org/doc/nightly/html/classvtkOrientedPolygonalHandleRepresentation3D.html It does exactly that - keeps the widget rep (polydata) in a fixed orientation with respect to camera. HTH, Miro From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Richard Frank Sent: Friday, March 25, 2016 4:41 PM To: vtkusers at vtk.org Subject: [vtkusers] camera follower in 3D Hi, Has anyone successfully created a widget or other object that stays facing the camera in 3D? I've been trying to get the boxwidget to stay with one side facing the camera and I've come close - by computing a change of basis matrix after computing the camera position, direction of projection, etc. and creating a rotation matrix from the basis column vectors. When I have the PlusX face of the box widget facing the camera, and move the camera with the trackball interactor, the face of the widget stays facing (seems like it is standing still) but the size/scale of the box gets smaller as I rotate by sliding the mouse from right to left. It seems that I need to compensate for some scaling of the rotation matrix but I'm not sure exactly what. I'm putting together a small example if someone wants to take a look at it. Thanks Rick -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdrahos at aurisrobotics.com Fri Mar 25 19:49:24 2016 From: mdrahos at aurisrobotics.com (Miroslav Drahos) Date: Fri, 25 Mar 2016 23:49:24 +0000 Subject: [vtkusers] camera follower in 3D References: Message-ID: It uses vtkFollower (a subclass of vtkActor that always faces the camera). So make sure to check out vtkFollower as well. Miro From: Miroslav Drahos Sent: Friday, March 25, 2016 4:45 PM To: 'Richard Frank' ; vtkusers at vtk.org Subject: RE: [vtkusers] camera follower in 3D Rick, Look at vtkOrientedPolygonalHandleRepresentation3D http://www.vtk.org/doc/nightly/html/classvtkOrientedPolygonalHandleRepresentation3D.html It does exactly that - keeps the widget rep (polydata) in a fixed orientation with respect to camera. HTH, Miro From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Richard Frank Sent: Friday, March 25, 2016 4:41 PM To: vtkusers at vtk.org Subject: [vtkusers] camera follower in 3D Hi, Has anyone successfully created a widget or other object that stays facing the camera in 3D? I've been trying to get the boxwidget to stay with one side facing the camera and I've come close - by computing a change of basis matrix after computing the camera position, direction of projection, etc. and creating a rotation matrix from the basis column vectors. When I have the PlusX face of the box widget facing the camera, and move the camera with the trackball interactor, the face of the widget stays facing (seems like it is standing still) but the size/scale of the box gets smaller as I rotate by sliding the mouse from right to left. It seems that I need to compensate for some scaling of the rotation matrix but I'm not sure exactly what. I'm putting together a small example if someone wants to take a look at it. Thanks Rick -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickfrank at me.com Fri Mar 25 20:57:06 2016 From: rickfrank at me.com (Richard Frank) Date: Fri, 25 Mar 2016 20:57:06 -0400 Subject: [vtkusers] camera follower in 3D In-Reply-To: References: Message-ID: Thanks the problem I've had with VTK follower is that it seems dedicated to text- it puts text at the viewport z= 0 and doesn't seem to work for something at the camera focal point Rick Frank > On Mar 25, 2016, at 7:49 PM, Miroslav Drahos wrote: > > It uses vtkFollower (a subclass of vtkActor that always faces the camera). So make sure to check out vtkFollower as well. > > Miro > > > > From: Miroslav Drahos > Sent: Friday, March 25, 2016 4:45 PM > To: 'Richard Frank' ; vtkusers at vtk.org > Subject: RE: [vtkusers] camera follower in 3D > > Rick, > Look at vtkOrientedPolygonalHandleRepresentation3D > http://www.vtk.org/doc/nightly/html/classvtkOrientedPolygonalHandleRepresentation3D.html > It does exactly that ? keeps the widget rep (polydata) in a fixed orientation with respect to camera. > HTH, > Miro > > > From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Richard Frank > Sent: Friday, March 25, 2016 4:41 PM > To: vtkusers at vtk.org > Subject: [vtkusers] camera follower in 3D > > > Hi, > > Has anyone successfully created a widget or other object that stays facing the camera in 3D? > > I've been trying to get the boxwidget to stay with one side facing the camera and I've come close - by computing a change of basis matrix after computing the camera position, direction of projection, etc. and creating a rotation matrix from the basis column vectors. > > When I have the PlusX face of the box widget facing the camera, and move the camera with the trackball interactor, the face of the widget stays facing (seems like it is standing still) but the size/scale of the box gets smaller as I rotate by sliding the mouse from right to left. > > It seems that I need to compensate for some scaling of the rotation matrix but I'm not sure exactly what. I'm putting together a small example if someone wants to take a look at it. > > Thanks > > Rick > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdrahos at aurisrobotics.com Fri Mar 25 21:19:57 2016 From: mdrahos at aurisrobotics.com (Miroslav Drahos) Date: Sat, 26 Mar 2016 01:19:57 +0000 Subject: [vtkusers] camera follower in 3D In-Reply-To: References: Message-ID: Rick, There is no such restriction for vtkFollower. It is a vtkActor, so can be used with a variety of different data sources, such as polydata. That?s the case for example with the oriented polygonal handle representation. The transform that you are looking for is calculated in vtkFollower::ComputeMatrix(). Cheers, Miro From: Richard Frank [mailto:rickfrank at me.com] Sent: Friday, March 25, 2016 5:57 PM To: Miroslav Drahos Cc: vtkusers at vtk.org Subject: Re: [vtkusers] camera follower in 3D Thanks the problem I've had with VTK follower is that it seems dedicated to text- it puts text at the viewport z= 0 and doesn't seem to work for something at the camera focal point Rick Frank On Mar 25, 2016, at 7:49 PM, Miroslav Drahos > wrote: It uses vtkFollower (a subclass of vtkActor that always faces the camera). So make sure to check out vtkFollower as well. Miro From: Miroslav Drahos Sent: Friday, March 25, 2016 4:45 PM To: 'Richard Frank' >; vtkusers at vtk.org Subject: RE: [vtkusers] camera follower in 3D Rick, Look at vtkOrientedPolygonalHandleRepresentation3D http://www.vtk.org/doc/nightly/html/classvtkOrientedPolygonalHandleRepresentation3D.html It does exactly that ? keeps the widget rep (polydata) in a fixed orientation with respect to camera. HTH, Miro From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Richard Frank Sent: Friday, March 25, 2016 4:41 PM To: vtkusers at vtk.org Subject: [vtkusers] camera follower in 3D Hi, Has anyone successfully created a widget or other object that stays facing the camera in 3D? I've been trying to get the boxwidget to stay with one side facing the camera and I've come close - by computing a change of basis matrix after computing the camera position, direction of projection, etc. and creating a rotation matrix from the basis column vectors. When I have the PlusX face of the box widget facing the camera, and move the camera with the trackball interactor, the face of the widget stays facing (seems like it is standing still) but the size/scale of the box gets smaller as I rotate by sliding the mouse from right to left. It seems that I need to compensate for some scaling of the rotation matrix but I'm not sure exactly what. I'm putting together a small example if someone wants to take a look at it. Thanks Rick -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickfrank at me.com Fri Mar 25 21:30:27 2016 From: rickfrank at me.com (Richard Frank) Date: Fri, 25 Mar 2016 21:30:27 -0400 Subject: [vtkusers] camera follower in 3D In-Reply-To: References: Message-ID: Ok, I could never get it to work. But more specifically, I need the box/clip widget to stay perp to the camera. It is composed of many actors( which are private) Rick Frank > On Mar 25, 2016, at 9:19 PM, Miroslav Drahos wrote: > > Rick, > There is no such restriction for vtkFollower. It is a vtkActor, so can be used with a variety of different data sources, such as polydata. That?s the case for example with the oriented polygonal handle representation. > The transform that you are looking for is calculated in vtkFollower::ComputeMatrix(). > Cheers, > Miro > > > From: Richard Frank [mailto:rickfrank at me.com] > Sent: Friday, March 25, 2016 5:57 PM > To: Miroslav Drahos > Cc: vtkusers at vtk.org > Subject: Re: [vtkusers] camera follower in 3D > > Thanks the problem I've had with VTK follower is that it seems dedicated to text- it puts text at the viewport z= 0 and doesn't seem to work for something at the camera focal point > > Rick Frank > > On Mar 25, 2016, at 7:49 PM, Miroslav Drahos wrote: > > It uses vtkFollower (a subclass of vtkActor that always faces the camera). So make sure to check out vtkFollower as well. > > Miro > > > > From: Miroslav Drahos > Sent: Friday, March 25, 2016 4:45 PM > To: 'Richard Frank' ; vtkusers at vtk.org > Subject: RE: [vtkusers] camera follower in 3D > > Rick, > Look at vtkOrientedPolygonalHandleRepresentation3D > http://www.vtk.org/doc/nightly/html/classvtkOrientedPolygonalHandleRepresentation3D.html > It does exactly that ? keeps the widget rep (polydata) in a fixed orientation with respect to camera. > HTH, > Miro > > > From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Richard Frank > Sent: Friday, March 25, 2016 4:41 PM > To: vtkusers at vtk.org > Subject: [vtkusers] camera follower in 3D > > > Hi, > > Has anyone successfully created a widget or other object that stays facing the camera in 3D? > > I've been trying to get the boxwidget to stay with one side facing the camera and I've come close - by computing a change of basis matrix after computing the camera position, direction of projection, etc. and creating a rotation matrix from the basis column vectors. > > When I have the PlusX face of the box widget facing the camera, and move the camera with the trackball interactor, the face of the widget stays facing (seems like it is standing still) but the size/scale of the box gets smaller as I rotate by sliding the mouse from right to left. > > It seems that I need to compensate for some scaling of the rotation matrix but I'm not sure exactly what. I'm putting together a small example if someone wants to take a look at it. > > Thanks > > Rick > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickfrank at me.com Fri Mar 25 22:00:33 2016 From: rickfrank at me.com (Richard Frank) Date: Fri, 25 Mar 2016 22:00:33 -0400 Subject: [vtkusers] camera follower in 3D In-Reply-To: References: Message-ID: <31F9C087-0535-4001-8946-79B678AE9FE3@me.com> Ok I get that. But the clip planes and box widget? That's multiple actors embedded in the box widget / vtk box representation. It's much more complex. Anyways, let me put my small example together ( which uses ComputeMatrix() to get the basis vectors) and maybe you can assist me figuring out why the box scales.....ill try to post something to Drop Box tomorrow. What I'm trying to do is clip using the box widget always facing the camera ( cut planes ) while in addition allowing the use to resize the clip volume. Which means the center of rotation for the box has to be at the camera focal point.... Thanks for the quick help! Rick Sent from my iPad > On Mar 25, 2016, at 9:50 PM, Miroslav Drahos wrote: > > Here, I typed this quickly to demonstrate. Adding a cone and cylinder, cylinder will be fixed in 3D space, and cone will be always facing the camera. Attached some shots on what it looks like. > HTH, > Miro > > #include > #include > #include > #include > #include > #include > #include > #include > > #define VTK_CREATE(type, name) vtkSmartPointer name = vtkSmartPointer::New(); > > int main() > { > VTK_CREATE(vtkRenderWindow, rw); > VTK_CREATE(vtkRenderer, ren); > rw->AddRenderer(ren); > > VTK_CREATE(vtkConeSource, cone); > VTK_CREATE(vtkPolyDataMapper, coneMapper); > coneMapper->SetInputConnection(cone->GetOutputPort()); > VTK_CREATE(vtkFollower, coneFollower); > coneFollower->SetMapper(coneMapper); > // tilt the cone a bit so that we can see its orientation better > coneFollower->RotateY(40); > coneFollower->SetPosition(0, 3, 0); > coneFollower->SetCamera(ren->GetActiveCamera()); > ren->AddViewProp(coneFollower); > > VTK_CREATE(vtkCylinderSource, cylinder); > VTK_CREATE(vtkPolyDataMapper, cylinderMapper); > cylinderMapper->SetInputConnection(cylinder->GetOutputPort()); > VTK_CREATE(vtkActor, cylinderActor); > cylinderActor->SetMapper(cylinderMapper); > ren->AddViewProp(cylinderActor); > > VTK_CREATE(vtkRenderWindowInteractor, iren); > rw->SetInteractor(iren); > > ren->ResetCamera(); > rw->Render(); > iren->Start(); > > return 0; > } > > > > From: Richard Frank [mailto:rickfrank at me.com] > Sent: Friday, March 25, 2016 6:30 PM > To: Miroslav Drahos > Cc: vtkusers at vtk.org > Subject: Re: [vtkusers] camera follower in 3D > > Ok, I could never get it to work. But more specifically, I need the box/clip widget to stay perp to the camera. It is composed of many actors( which are private) > > Rick Frank > > On Mar 25, 2016, at 9:19 PM, Miroslav Drahos wrote: > > Rick, > There is no such restriction for vtkFollower. It is a vtkActor, so can be used with a variety of different data sources, such as polydata. That?s the case for example with the oriented polygonal handle representation. > The transform that you are looking for is calculated in vtkFollower::ComputeMatrix(). > Cheers, > Miro > > > From: Richard Frank [mailto:rickfrank at me.com] > Sent: Friday, March 25, 2016 5:57 PM > To: Miroslav Drahos > Cc: vtkusers at vtk.org > Subject: Re: [vtkusers] camera follower in 3D > > Thanks the problem I've had with VTK follower is that it seems dedicated to text- it puts text at the viewport z= 0 and doesn't seem to work for something at the camera focal point > > Rick Frank > > On Mar 25, 2016, at 7:49 PM, Miroslav Drahos wrote: > > It uses vtkFollower (a subclass of vtkActor that always faces the camera). So make sure to check out vtkFollower as well. > > Miro > > > > From: Miroslav Drahos > Sent: Friday, March 25, 2016 4:45 PM > To: 'Richard Frank' ; vtkusers at vtk.org > Subject: RE: [vtkusers] camera follower in 3D > > Rick, > Look at vtkOrientedPolygonalHandleRepresentation3D > http://www.vtk.org/doc/nightly/html/classvtkOrientedPolygonalHandleRepresentation3D.html > It does exactly that ? keeps the widget rep (polydata) in a fixed orientation with respect to camera. > HTH, > Miro > > > From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Richard Frank > Sent: Friday, March 25, 2016 4:41 PM > To: vtkusers at vtk.org > Subject: [vtkusers] camera follower in 3D > > > Hi, > > Has anyone successfully created a widget or other object that stays facing the camera in 3D? > > I've been trying to get the boxwidget to stay with one side facing the camera and I've come close - by computing a change of basis matrix after computing the camera position, direction of projection, etc. and creating a rotation matrix from the basis column vectors. > > When I have the PlusX face of the box widget facing the camera, and move the camera with the trackball interactor, the face of the widget stays facing (seems like it is standing still) but the size/scale of the box gets smaller as I rotate by sliding the mouse from right to left. > > It seems that I need to compensate for some scaling of the rotation matrix but I'm not sure exactly what. I'm putting together a small example if someone wants to take a look at it. > > Thanks > > Rick > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdrahos at aurisrobotics.com Fri Mar 25 21:50:14 2016 From: mdrahos at aurisrobotics.com (Miroslav Drahos) Date: Sat, 26 Mar 2016 01:50:14 +0000 Subject: [vtkusers] camera follower in 3D In-Reply-To: References: Message-ID: Here, I typed this quickly to demonstrate. Adding a cone and cylinder, cylinder will be fixed in 3D space, and cone will be always facing the camera. Attached some shots on what it looks like. HTH, Miro #include #include #include #include #include #include #include #include #define VTK_CREATE(type, name) vtkSmartPointer name = vtkSmartPointer::New(); int main() { VTK_CREATE(vtkRenderWindow, rw); VTK_CREATE(vtkRenderer, ren); rw->AddRenderer(ren); VTK_CREATE(vtkConeSource, cone); VTK_CREATE(vtkPolyDataMapper, coneMapper); coneMapper->SetInputConnection(cone->GetOutputPort()); VTK_CREATE(vtkFollower, coneFollower); coneFollower->SetMapper(coneMapper); // tilt the cone a bit so that we can see its orientation better coneFollower->RotateY(40); coneFollower->SetPosition(0, 3, 0); coneFollower->SetCamera(ren->GetActiveCamera()); ren->AddViewProp(coneFollower); VTK_CREATE(vtkCylinderSource, cylinder); VTK_CREATE(vtkPolyDataMapper, cylinderMapper); cylinderMapper->SetInputConnection(cylinder->GetOutputPort()); VTK_CREATE(vtkActor, cylinderActor); cylinderActor->SetMapper(cylinderMapper); ren->AddViewProp(cylinderActor); VTK_CREATE(vtkRenderWindowInteractor, iren); rw->SetInteractor(iren); ren->ResetCamera(); rw->Render(); iren->Start(); return 0; } From: Richard Frank [mailto:rickfrank at me.com] Sent: Friday, March 25, 2016 6:30 PM To: Miroslav Drahos Cc: vtkusers at vtk.org Subject: Re: [vtkusers] camera follower in 3D Ok, I could never get it to work. But more specifically, I need the box/clip widget to stay perp to the camera. It is composed of many actors( which are private) Rick Frank On Mar 25, 2016, at 9:19 PM, Miroslav Drahos > wrote: Rick, There is no such restriction for vtkFollower. It is a vtkActor, so can be used with a variety of different data sources, such as polydata. That?s the case for example with the oriented polygonal handle representation. The transform that you are looking for is calculated in vtkFollower::ComputeMatrix(). Cheers, Miro From: Richard Frank [mailto:rickfrank at me.com] Sent: Friday, March 25, 2016 5:57 PM To: Miroslav Drahos > Cc: vtkusers at vtk.org Subject: Re: [vtkusers] camera follower in 3D Thanks the problem I've had with VTK follower is that it seems dedicated to text- it puts text at the viewport z= 0 and doesn't seem to work for something at the camera focal point Rick Frank On Mar 25, 2016, at 7:49 PM, Miroslav Drahos > wrote: It uses vtkFollower (a subclass of vtkActor that always faces the camera). So make sure to check out vtkFollower as well. Miro From: Miroslav Drahos Sent: Friday, March 25, 2016 4:45 PM To: 'Richard Frank' >; vtkusers at vtk.org Subject: RE: [vtkusers] camera follower in 3D Rick, Look at vtkOrientedPolygonalHandleRepresentation3D http://www.vtk.org/doc/nightly/html/classvtkOrientedPolygonalHandleRepresentation3D.html It does exactly that ? keeps the widget rep (polydata) in a fixed orientation with respect to camera. HTH, Miro From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Richard Frank Sent: Friday, March 25, 2016 4:41 PM To: vtkusers at vtk.org Subject: [vtkusers] camera follower in 3D Hi, Has anyone successfully created a widget or other object that stays facing the camera in 3D? I've been trying to get the boxwidget to stay with one side facing the camera and I've come close - by computing a change of basis matrix after computing the camera position, direction of projection, etc. and creating a rotation matrix from the basis column vectors. When I have the PlusX face of the box widget facing the camera, and move the camera with the trackball interactor, the face of the widget stays facing (seems like it is standing still) but the size/scale of the box gets smaller as I rotate by sliding the mouse from right to left. It seems that I need to compensate for some scaling of the rotation matrix but I'm not sure exactly what. I'm putting together a small example if someone wants to take a look at it. Thanks Rick -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: follow1.png Type: image/png Size: 7559 bytes Desc: follow1.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: follow2.png Type: image/png Size: 9139 bytes Desc: follow2.png URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: follow3.png Type: image/png Size: 8807 bytes Desc: follow3.png URL: From mdrahos at aurisrobotics.com Fri Mar 25 22:58:46 2016 From: mdrahos at aurisrobotics.com (Miroslav Drahos) Date: Sat, 26 Mar 2016 02:58:46 +0000 Subject: [vtkusers] camera follower in 3D In-Reply-To: <31F9C087-0535-4001-8946-79B678AE9FE3@me.com> References: <31F9C087-0535-4001-8946-79B678AE9FE3@me.com> Message-ID: Rick, I am not trying to trivialize your problem, and understand that things are much more complicated. I was just showing that vtkFollower works, and you may be able to use it to your advantage. For example you could check the matrix that vtkFollower calculates against your matrix. Or you could derive from vtkBoxRepresentation and replace all actors with followers. You will probably have to modify the interaction as well (i.e. override methods in vtkBoxWidget2). Best, Miro From: Richard Frank [mailto:rickfrank at me.com] Sent: Friday, March 25, 2016 7:01 PM To: Miroslav Drahos Cc: vtkusers at vtk.org Subject: Re: [vtkusers] camera follower in 3D Ok I get that. But the clip planes and box widget? That's multiple actors embedded in the box widget / vtk box representation. It's much more complex. Anyways, let me put my small example together ( which uses ComputeMatrix() to get the basis vectors) and maybe you can assist me figuring out why the box scales.....ill try to post something to Drop Box tomorrow. What I'm trying to do is clip using the box widget always facing the camera ( cut planes ) while in addition allowing the use to resize the clip volume. Which means the center of rotation for the box has to be at the camera focal point.... Thanks for the quick help! Rick Sent from my iPad On Mar 25, 2016, at 9:50 PM, Miroslav Drahos > wrote: Here, I typed this quickly to demonstrate. Adding a cone and cylinder, cylinder will be fixed in 3D space, and cone will be always facing the camera. Attached some shots on what it looks like. HTH, Miro #include #include #include #include #include #include #include #include #define VTK_CREATE(type, name) vtkSmartPointer name = vtkSmartPointer::New(); int main() { VTK_CREATE(vtkRenderWindow, rw); VTK_CREATE(vtkRenderer, ren); rw->AddRenderer(ren); VTK_CREATE(vtkConeSource, cone); VTK_CREATE(vtkPolyDataMapper, coneMapper); coneMapper->SetInputConnection(cone->GetOutputPort()); VTK_CREATE(vtkFollower, coneFollower); coneFollower->SetMapper(coneMapper); // tilt the cone a bit so that we can see its orientation better coneFollower->RotateY(40); coneFollower->SetPosition(0, 3, 0); coneFollower->SetCamera(ren->GetActiveCamera()); ren->AddViewProp(coneFollower); VTK_CREATE(vtkCylinderSource, cylinder); VTK_CREATE(vtkPolyDataMapper, cylinderMapper); cylinderMapper->SetInputConnection(cylinder->GetOutputPort()); VTK_CREATE(vtkActor, cylinderActor); cylinderActor->SetMapper(cylinderMapper); ren->AddViewProp(cylinderActor); VTK_CREATE(vtkRenderWindowInteractor, iren); rw->SetInteractor(iren); ren->ResetCamera(); rw->Render(); iren->Start(); return 0; } From: Richard Frank [mailto:rickfrank at me.com] Sent: Friday, March 25, 2016 6:30 PM To: Miroslav Drahos > Cc: vtkusers at vtk.org Subject: Re: [vtkusers] camera follower in 3D Ok, I could never get it to work. But more specifically, I need the box/clip widget to stay perp to the camera. It is composed of many actors( which are private) Rick Frank On Mar 25, 2016, at 9:19 PM, Miroslav Drahos > wrote: Rick, There is no such restriction for vtkFollower. It is a vtkActor, so can be used with a variety of different data sources, such as polydata. That?s the case for example with the oriented polygonal handle representation. The transform that you are looking for is calculated in vtkFollower::ComputeMatrix(). Cheers, Miro From: Richard Frank [mailto:rickfrank at me.com] Sent: Friday, March 25, 2016 5:57 PM To: Miroslav Drahos > Cc: vtkusers at vtk.org Subject: Re: [vtkusers] camera follower in 3D Thanks the problem I've had with VTK follower is that it seems dedicated to text- it puts text at the viewport z= 0 and doesn't seem to work for something at the camera focal point Rick Frank On Mar 25, 2016, at 7:49 PM, Miroslav Drahos > wrote: It uses vtkFollower (a subclass of vtkActor that always faces the camera). So make sure to check out vtkFollower as well. Miro From: Miroslav Drahos Sent: Friday, March 25, 2016 4:45 PM To: 'Richard Frank' >; vtkusers at vtk.org Subject: RE: [vtkusers] camera follower in 3D Rick, Look at vtkOrientedPolygonalHandleRepresentation3D http://www.vtk.org/doc/nightly/html/classvtkOrientedPolygonalHandleRepresentation3D.html It does exactly that ? keeps the widget rep (polydata) in a fixed orientation with respect to camera. HTH, Miro From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Richard Frank Sent: Friday, March 25, 2016 4:41 PM To: vtkusers at vtk.org Subject: [vtkusers] camera follower in 3D Hi, Has anyone successfully created a widget or other object that stays facing the camera in 3D? I've been trying to get the boxwidget to stay with one side facing the camera and I've come close - by computing a change of basis matrix after computing the camera position, direction of projection, etc. and creating a rotation matrix from the basis column vectors. When I have the PlusX face of the box widget facing the camera, and move the camera with the trackball interactor, the face of the widget stays facing (seems like it is standing still) but the size/scale of the box gets smaller as I rotate by sliding the mouse from right to left. It seems that I need to compensate for some scaling of the rotation matrix but I'm not sure exactly what. I'm putting together a small example if someone wants to take a look at it. Thanks Rick -------------- next part -------------- An HTML attachment was scrubbed... URL: From zmanvortex at gmail.com Sat Mar 26 12:57:12 2016 From: zmanvortex at gmail.com (Donny Zimmerman) Date: Sat, 26 Mar 2016 11:57:12 -0500 Subject: [vtkusers] vtkPropCollection Delete Behavior Message-ID: Will calling Delete() on vtkPropCollection automatically call Delete() on all of the actors in the collection? I have the same question with vtkPlaneCollection. Will calling Delete() on vtkPlaneCollection automatically call Delete() on all of the planes in the collection? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickfrank at me.com Sat Mar 26 17:23:06 2016 From: rickfrank at me.com (Richard Frank) Date: Sat, 26 Mar 2016 17:23:06 -0400 Subject: [vtkusers] camera follower in 3D In-Reply-To: References: <31F9C087-0535-4001-8946-79B678AE9FE3@me.com> Message-ID: <65094FAC-5077-40CB-8D37-8F9780203073@me.com> Thanks, I have subclassed vtkBoxRepresentation etc. I did find my problem - I have to re- orthogonalize my matrix as it was creeping away - which caused the scaling of the box when facing the camera . Now I just have rendering issues-the way I implemented this was to create a camera observer for vtkEvent::modified event- and the box is moving to follow a surgical tool, as well as a user interacting with the mouse - so the box flashes with some extra renders when I move it back to the camera focal point and then it moves back to the surgical tool position. But I think the math for the follower functionality is worked out....I may have to subclass trackball inter actor to reduce the render calls... Thanks Rick Frank > On Mar 25, 2016, at 10:58 PM, Miroslav Drahos wrote: > > Rick, > I am not trying to trivialize your problem, and understand that things are much more complicated. I was just showing that vtkFollower works, and you may be able to use it to your advantage. > For example you could check the matrix that vtkFollower calculates against your matrix. > Or you could derive from vtkBoxRepresentation and replace all actors with followers. You will probably have to modify the interaction as well (i.e. override methods in vtkBoxWidget2). > Best, > Miro > > > From: Richard Frank [mailto:rickfrank at me.com] > Sent: Friday, March 25, 2016 7:01 PM > To: Miroslav Drahos > Cc: vtkusers at vtk.org > Subject: Re: [vtkusers] camera follower in 3D > > Ok I get that. But the clip planes and box widget? That's multiple actors embedded in the box widget / vtk box representation. It's much more complex. Anyways, let me put my small example together ( which uses ComputeMatrix() to get the basis vectors) and maybe you can assist me figuring out why the box scales.....ill try to post something to Drop Box tomorrow. > What I'm trying to do is clip using the box widget always facing the camera ( cut planes ) while in addition allowing the use to resize the clip volume. Which means the center of rotation for the box has to be at the camera focal point.... > > Thanks for the quick help! > > Rick > > > Sent from my iPad > > On Mar 25, 2016, at 9:50 PM, Miroslav Drahos wrote: > > Here, I typed this quickly to demonstrate. Adding a cone and cylinder, cylinder will be fixed in 3D space, and cone will be always facing the camera. Attached some shots on what it looks like. > HTH, > Miro > > #include > #include > #include > #include > #include > #include > #include > #include > > #define VTK_CREATE(type, name) vtkSmartPointer name = vtkSmartPointer::New(); > > int main() > { > VTK_CREATE(vtkRenderWindow, rw); > VTK_CREATE(vtkRenderer, ren); > rw->AddRenderer(ren); > > VTK_CREATE(vtkConeSource, cone); > VTK_CREATE(vtkPolyDataMapper, coneMapper); > coneMapper->SetInputConnection(cone->GetOutputPort()); > VTK_CREATE(vtkFollower, coneFollower); > coneFollower->SetMapper(coneMapper); > // tilt the cone a bit so that we can see its orientation better > coneFollower->RotateY(40); > coneFollower->SetPosition(0, 3, 0); > coneFollower->SetCamera(ren->GetActiveCamera()); > ren->AddViewProp(coneFollower); > > VTK_CREATE(vtkCylinderSource, cylinder); > VTK_CREATE(vtkPolyDataMapper, cylinderMapper); > cylinderMapper->SetInputConnection(cylinder->GetOutputPort()); > VTK_CREATE(vtkActor, cylinderActor); > cylinderActor->SetMapper(cylinderMapper); > ren->AddViewProp(cylinderActor); > > VTK_CREATE(vtkRenderWindowInteractor, iren); > rw->SetInteractor(iren); > > ren->ResetCamera(); > rw->Render(); > iren->Start(); > > return 0; > } > > > > From: Richard Frank [mailto:rickfrank at me.com] > Sent: Friday, March 25, 2016 6:30 PM > To: Miroslav Drahos > Cc: vtkusers at vtk.org > Subject: Re: [vtkusers] camera follower in 3D > > Ok, I could never get it to work. But more specifically, I need the box/clip widget to stay perp to the camera. It is composed of many actors( which are private) > > Rick Frank > > On Mar 25, 2016, at 9:19 PM, Miroslav Drahos wrote: > > Rick, > There is no such restriction for vtkFollower. It is a vtkActor, so can be used with a variety of different data sources, such as polydata. That?s the case for example with the oriented polygonal handle representation. > The transform that you are looking for is calculated in vtkFollower::ComputeMatrix(). > Cheers, > Miro > > > From: Richard Frank [mailto:rickfrank at me.com] > Sent: Friday, March 25, 2016 5:57 PM > To: Miroslav Drahos > Cc: vtkusers at vtk.org > Subject: Re: [vtkusers] camera follower in 3D > > Thanks the problem I've had with VTK follower is that it seems dedicated to text- it puts text at the viewport z= 0 and doesn't seem to work for something at the camera focal point > > Rick Frank > > On Mar 25, 2016, at 7:49 PM, Miroslav Drahos wrote: > > It uses vtkFollower (a subclass of vtkActor that always faces the camera). So make sure to check out vtkFollower as well. > > Miro > > > > From: Miroslav Drahos > Sent: Friday, March 25, 2016 4:45 PM > To: 'Richard Frank' ; vtkusers at vtk.org > Subject: RE: [vtkusers] camera follower in 3D > > Rick, > Look at vtkOrientedPolygonalHandleRepresentation3D > http://www.vtk.org/doc/nightly/html/classvtkOrientedPolygonalHandleRepresentation3D.html > It does exactly that ? keeps the widget rep (polydata) in a fixed orientation with respect to camera. > HTH, > Miro > > > From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Richard Frank > Sent: Friday, March 25, 2016 4:41 PM > To: vtkusers at vtk.org > Subject: [vtkusers] camera follower in 3D > > > Hi, > > Has anyone successfully created a widget or other object that stays facing the camera in 3D? > > I've been trying to get the boxwidget to stay with one side facing the camera and I've come close - by computing a change of basis matrix after computing the camera position, direction of projection, etc. and creating a rotation matrix from the basis column vectors. > > When I have the PlusX face of the box widget facing the camera, and move the camera with the trackball interactor, the face of the widget stays facing (seems like it is standing still) but the size/scale of the box gets smaller as I rotate by sliding the mouse from right to left. > > It seems that I need to compensate for some scaling of the rotation matrix but I'm not sure exactly what. I'm putting together a small example if someone wants to take a look at it. > > Thanks > > Rick > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From philip.fackler at gmail.com Sat Mar 26 20:28:27 2016 From: philip.fackler at gmail.com (Philip Fackler) Date: Sun, 27 Mar 2016 00:28:27 +0000 Subject: [vtkusers] Triangulate surface points? In-Reply-To: References: Message-ID: This method seems to give the bounding polydata to the unstructured volume grid. What if the surface I'm trying to define isn't closed? Each surface can be arbitrarily shaped. On Fri, Mar 25, 2016 at 10:21 AM Andras Lasso wrote: > When all points are coplanar we insert a glyph filter in the pipeline to > add small spheres at each point. > > > > Andras > > > > *From: *Philip Fackler > *Sent: *March 25, 2016 10:05 > *To: *Cory Quammen ; Andras Lasso > > > > *Cc: *vtkusers at vtk.org > *Subject: *Re: [vtkusers] Triangulate surface points? > I've tried out vtkDelaunay3D some. But in cases where the surface is > completely planar, it fails (it can't make any tets). Is there a way it can > handle that. Sorry, I haven't had a chance to watch the video yet. > > On Fri, Mar 25, 2016 at 9:59 AM Cory Quammen > wrote: > >> Cool, thanks!. >> >> On Fri, Mar 25, 2016 at 9:48 AM, Andras Lasso wrote: >> >>> It can generate non-convex surfaces up to some point - check out the >>> video and/or try it yourself (you can install the Volume clip extension in >>> Slicer by two clicks and you can mark points and drag them around to see >>> how the surface is evolving). The alpha parameter in Delaunay 3D controls >>> handling of concavities. Limitations include that a non-zero alpha may make >>> the triangulation to fail and irregular point distances may confuse the >>> smoothing algorithm. >>> >>> >>> >>> Andras >>> >>> >>> >>> *From: *Cory Quammen >>> *Sent: *March 25, 2016 09:37 >>> *To: *Andras Lasso >>> *Cc: *Philip Fackler ; vtkusers at vtk.org >>> >>> *Subject: *Re: [vtkusers] Triangulate surface points? >>> >>> >>> Andras, >>> >>> That's a good idea as well, but doesn't vtkDelaunay3D produce a convex >>> hull of the input points? That's fine if your object is convex, of course, >>> but may not give you the expected results if your object has a concave >>> region. >>> >>> If there is a feature in vtkDelaunay3D that can produce concave >>> surfaces, I would be interested to know about it. >>> >>> Thanks, >>> Cory >>> >>> On Fri, Mar 25, 2016 at 8:34 AM, Andras Lasso wrote: >>> >>>> We get excellent results for sparse point sets using a combination of >>>> vtkDelaunay3D, vtkDataSetSurfaceFilter, and vtkButterflySubdivisionFilter. >>>> The generated surface includes the exact points that we specify. >>>> >>>> >>>> >>>> You can see what kind of surfaces you can generate from a small number >>>> of points: >>>> >>>> https://www.youtube.com/watch?v=1mYNwJbE7dQ >>>> >>>> >>>> >>>> You can play with it if you download 3D Slicer and install Volume Clip >>>> extension ( >>>> https://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Extensions/VolumeClip). >>>> Source code is available here: >>>> >>>> >>>> https://subversion.assembla.com/svn/slicerrt/trunk/VolumeClip/src/VolumeClipWithModel/ >>>> >>>> (relevant part is in updateModelFromMarkup function) >>>> >>>> >>>> >>>> Andras >>>> >>>> >>>> >>>> *From:* vtkusers [mailto:vtkusers-bounces at vtk.org] *On Behalf Of *Cory >>>> Quammen >>>> *Sent:* March 24, 2016 2:29 PM >>>> *To:* Philip Fackler >>>> *Cc:* vtkusers at vtk.org >>>> *Subject:* Re: [vtkusers] Triangulate surface points? >>>> >>>> >>>> >>>> Philip, >>>> >>>> >>>> >>>> Please take a look at >>>> >>>> >>>> >>>> >>>> http://www.vtk.org/doc/nightly/html/classvtkSurfaceReconstructionFilter.html >>>> >>>> >>>> >>>> and >>>> >>>> >>>> >>>> http://www.vtkjournal.org/browse/publication/718 >>>> >>>> >>>> >>>> I don't have direct experience with these classes, but they may have >>>> what you need. >>>> >>>> >>>> >>>> HTH, >>>> >>>> Cory >>>> >>>> >>>> >>>> On Thu, Mar 24, 2016 at 2:24 PM, Philip Fackler < >>>> philip.fackler at gmail.com> wrote: >>>> >>>> If someone could even definitively tell me "no, you can't do this" that >>>> would be helpful. >>>> >>>> >>>> >>>> Thanks, >>>> >>>> Philip Fackler >>>> >>>> >>>> >>>> On Wed, Mar 16, 2016 at 6:24 PM Philip Fackler < >>>> philip.fackler at gmail.com> wrote: >>>> >>>> Is there a way to triangulate a set of surface points using vtk? I've >>>> looked around and everything I've found (vtk, cgal, pcl) only do a surface >>>> reconstruction which ends up generating its own points to triangulate. I >>>> want to actually use the points I have as the vertices of the >>>> triangulation. Along with the point locations, I have a lot of information >>>> available in my code that I could provide: >>>> >>>> >>>> Normal vector at each point >>>> >>>> Bounding segmented curve(s) (i.e., lists of edge cells indexing the >>>> list of surface points) >>>> >>>> A polydata representation of the surface (Note that the points I want >>>> to triangulate are distinct from the points involved in this) >>>> >>>> The only vtk utility that seems to come close to this is vtkDelaunay2D, >>>> but it's only useful if all the points can be mapped to a 2D plane. This >>>> isn't possible in general without a parametric surface, which is one bit of >>>> information I don't have. >>>> >>>> Thanks in advance for the 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 >>>> >>>> >>>> >>>> >>>> >>>> -- >>>> >>>> Cory Quammen >>>> R&D Engineer >>>> Kitware, Inc. >>>> >>> >>> >>> >>> -- >>> Cory Quammen >>> R&D Engineer >>> Kitware, Inc. >>> >> >> >> >> -- >> Cory Quammen >> R&D Engineer >> Kitware, Inc. >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lasso at queensu.ca Sat Mar 26 21:47:00 2016 From: lasso at queensu.ca (Andras Lasso) Date: Sun, 27 Mar 2016 01:47:00 +0000 Subject: [vtkusers] Triangulate surface points? In-Reply-To: References: , Message-ID: Yes, these filters generate one closed surface. Andras From: Philip Fackler Sent: March 26, 2016 20:28 To: Andras Lasso; Cory Quammen Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Triangulate surface points? This method seems to give the bounding polydata to the unstructured volume grid. What if the surface I'm trying to define isn't closed? Each surface can be arbitrarily shaped. On Fri, Mar 25, 2016 at 10:21 AM Andras Lasso > wrote: When all points are coplanar we insert a glyph filter in the pipeline to add small spheres at each point. Andras From: Philip Fackler Sent: March 25, 2016 10:05 To: Cory Quammen; Andras Lasso Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Triangulate surface points? I've tried out vtkDelaunay3D some. But in cases where the surface is completely planar, it fails (it can't make any tets). Is there a way it can handle that. Sorry, I haven't had a chance to watch the video yet. On Fri, Mar 25, 2016 at 9:59 AM Cory Quammen > wrote: Cool, thanks!. On Fri, Mar 25, 2016 at 9:48 AM, Andras Lasso > wrote: It can generate non-convex surfaces up to some point - check out the video and/or try it yourself (you can install the Volume clip extension in Slicer by two clicks and you can mark points and drag them around to see how the surface is evolving). The alpha parameter in Delaunay 3D controls handling of concavities. Limitations include that a non-zero alpha may make the triangulation to fail and irregular point distances may confuse the smoothing algorithm. Andras From: Cory Quammen Sent: March 25, 2016 09:37 To: Andras Lasso Cc: Philip Fackler; vtkusers at vtk.org Subject: Re: [vtkusers] Triangulate surface points? Andras, That's a good idea as well, but doesn't vtkDelaunay3D produce a convex hull of the input points? That's fine if your object is convex, of course, but may not give you the expected results if your object has a concave region. If there is a feature in vtkDelaunay3D that can produce concave surfaces, I would be interested to know about it. Thanks, Cory On Fri, Mar 25, 2016 at 8:34 AM, Andras Lasso > wrote: We get excellent results for sparse point sets using a combination of vtkDelaunay3D, vtkDataSetSurfaceFilter, and vtkButterflySubdivisionFilter. The generated surface includes the exact points that we specify. You can see what kind of surfaces you can generate from a small number of points: https://www.youtube.com/watch?v=1mYNwJbE7dQ You can play with it if you download 3D Slicer and install Volume Clip extension (https://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Extensions/VolumeClip). Source code is available here: https://subversion.assembla.com/svn/slicerrt/trunk/VolumeClip/src/VolumeClipWithModel/ (relevant part is in updateModelFromMarkup function) Andras From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Cory Quammen Sent: March 24, 2016 2:29 PM To: Philip Fackler > Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Triangulate surface points? Philip, Please take a look at http://www.vtk.org/doc/nightly/html/classvtkSurfaceReconstructionFilter.html and http://www.vtkjournal.org/browse/publication/718 I don't have direct experience with these classes, but they may have what you need. HTH, Cory On Thu, Mar 24, 2016 at 2:24 PM, Philip Fackler > wrote: If someone could even definitively tell me "no, you can't do this" that would be helpful. Thanks, Philip Fackler On Wed, Mar 16, 2016 at 6:24 PM Philip Fackler > wrote: Is there a way to triangulate a set of surface points using vtk? I've looked around and everything I've found (vtk, cgal, pcl) only do a surface reconstruction which ends up generating its own points to triangulate. I want to actually use the points I have as the vertices of the triangulation. Along with the point locations, I have a lot of information available in my code that I could provide: Normal vector at each point Bounding segmented curve(s) (i.e., lists of edge cells indexing the list of surface points) A polydata representation of the surface (Note that the points I want to triangulate are distinct from the points involved in this) The only vtk utility that seems to come close to this is vtkDelaunay2D, but it's only useful if all the points can be mapped to a 2D plane. This isn't possible in general without a parametric surface, which is one bit of information I don't have. Thanks in advance for the 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 -- Cory Quammen R&D Engineer Kitware, Inc. -- Cory Quammen R&D Engineer Kitware, Inc. -- Cory Quammen R&D Engineer Kitware, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjlp at netease.com Sun Mar 27 10:00:13 2016 From: tjlp at netease.com (Liu_tj) Date: Sun, 27 Mar 2016 22:00:13 +0800 (CST) Subject: [vtkusers] How to enlarge the size of render window to show the whole image? Message-ID: <178d2db2.6.153b86004f9.Coremail.tjlp@netease.com> Hi, VTK guys, Here I have a question about how to enlarge the size of render window to show the whole image. I use vtkImageViewer2 to display DICOM image. But it seems that the render window doesn't display the whole image. How can I adjust the window size? Thanks Liu Peng -------------- next part -------------- An HTML attachment was scrubbed... URL: From xiaoyu_543 at sina.com Sun Mar 27 20:52:22 2016 From: xiaoyu_543 at sina.com (xiaoyu_543) Date: Mon, 28 Mar 2016 08:52:22 +0800 Subject: [vtkusers] How to add VTK to android studio project? In-Reply-To: <20160321151800.B44F74C007D@webmail.sinamail.sina.com.cn> References: <20160321151800.B44F74C007D@webmail.sinamail.sina.com.cn> Message-ID: <1459126340542.223dmcisrhpe50z4nprgiiyk@android.mail.163.com> Hi, Why i got no response about my issue? Is there any problem? ???????? On 2016-03-21 23:18 , xiaoyu_543 at sina.com Wrote: Hi , I have built VTK for android successfully. But I still don't know how to add VTK to my android studio project. I want to make a android app using VTK running on android mobile or pad. I think maybe I can add VTK such as lib ,but how? 1.add some files built? 2.need other process to get other files Does anyone can help? Thanks very much for your kindly help? -------------- next part -------------- An HTML attachment was scrubbed... URL: From mallikarjun49 at gmail.com Mon Mar 28 05:43:41 2016 From: mallikarjun49 at gmail.com (Mallikarjun K) Date: Mon, 28 Mar 2016 15:13:41 +0530 Subject: [vtkusers] Clip Volume using freehand 2D Curve ROI Message-ID: Hello All, I want to clip the volume using the freehand 2D curve drawn on the volume. Can anyone give me some pointers to start with. Thanks in advance -- *With Kind Regards:* Mallikarjuna K -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastian.hilbert at gmx.net Mon Mar 28 07:18:48 2016 From: sebastian.hilbert at gmx.net (Sebastian Hilbert) Date: Mon, 28 Mar 2016 13:18:48 +0200 Subject: [vtkusers] Clip Volume using freehand 2D Curve ROI In-Reply-To: References: Message-ID: <1538665.lhW8vbmo7d@basti-thinkpad-t410> Am Monday 28 March 2016, 15:13:41 schrieb Mallikarjun K: > Hello All, > I want to clip the volume using the freehand 2D curve drawn on the volume. > Can anyone give me some pointers to start with. > I would be interested as well :-) I am not aware of any software (except CT viewer from Philips Intellispace Portal) that allows clipping directly on a volume rendering. Sebastian From sebastien.jourdain at kitware.com Mon Mar 28 10:33:53 2016 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Mon, 28 Mar 2016 08:33:53 -0600 Subject: [vtkusers] question about VTKWeb in the WAN environment In-Reply-To: <1458911296969-5737401.post@n5.nabble.com> References: <1458911296969-5737401.post@n5.nabble.com> Message-ID: How do you serve your Web app on the WAN? Do you start the server manually or use the launcher? Is the machine you are serving is accessible from the outside? Are you using Apache as a proxy? When you connect to that machine from the outside, are you using the same network interface as from the LAN? (2 network card on your computer? => If so you need to specify the --host property in your command line to pick the one that is used on the WAN) Is there a proxy between you and the server? (Proxy can screw up the WS connection) Sorry there is not an easy answer, unless I know more about your setup. Seb On Fri, Mar 25, 2016 at 7:08 AM, Emptystack wrote: > Hello everyone, > Recent days I want to test my volume rendering application based on > vtkWeb in the WAN environment, But something unexpected happened, as > dicpicted in the following picture and It always popped up a window saying > null. > > > > > And the volume rendering application worked normaly in the LAN environment, > I am eager to need some help? Any advice is appreciated! > > Thanks a lot! > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/question-about-VTKWeb-in-the-WAN-environment-tp5737401.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 dave.demarle at kitware.com Mon Mar 28 14:00:41 2016 From: dave.demarle at kitware.com (David E DeMarle) Date: Mon, 28 Mar 2016 14:00:41 -0400 Subject: [vtkusers] vtkPropCollection Delete Behavior In-Reply-To: References: Message-ID: Yes. See the destructor in vtkCollection. David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Sat, Mar 26, 2016 at 12:57 PM, Donny Zimmerman wrote: > Will calling Delete() on vtkPropCollection automatically call Delete() on > all of the actors in the collection? > > I have the same question with vtkPlaneCollection. Will calling Delete() > on vtkPlaneCollection automatically call Delete() on all of the planes in > the collection? > > Thanks. > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pedrommcs at hotmail.com Tue Mar 29 06:23:17 2016 From: pedrommcs at hotmail.com (pedrommcs) Date: Tue, 29 Mar 2016 03:23:17 -0700 (MST) Subject: [vtkusers] Get access to specific bar in VTK bar chart Message-ID: <1459246997278-5737437.post@n5.nabble.com> I have a VTK bar chart and I'm trying to change the color of a specific bar. For example, in this image, I can select multiple bars through a rectangular selection with the mouse, and they change color if they are selected (normal is green, selected is orange). My questions are: How can I change the color of the selected bars? For example, instead of orange I would like them to be blue. How can I get access to a particular bar without using the mouse? For example, I click a button and a certain bar gets highlighted. Any suggestions? Thanks in advance. -- View this message in context: http://vtk.1045678.n5.nabble.com/Get-access-to-specific-bar-in-VTK-bar-chart-tp5737437.html Sent from the VTK - Users mailing list archive at Nabble.com. From philip.fackler at gmail.com Tue Mar 29 09:18:42 2016 From: philip.fackler at gmail.com (Philip Fackler) Date: Tue, 29 Mar 2016 13:18:42 +0000 Subject: [vtkusers] Triangulate surface points? In-Reply-To: References: Message-ID: Let me ask this then. Recalling my initial email, I have several distinct surfaces defined by triangular facets (wound consistently) and the bounding segmented curves for each surface. And these surfaces are generally not closed. One way I can imagine to triangulate a set of points on a surface is to use vtkDelaunay2D with each point's corresponding (u, v) coordinates on a parametric surface, followed by a translation back to 3D. So, is there a tool in vtk to generate such a parametric surface based on a polydata with the information indicated above? On Sat, Mar 26, 2016 at 9:47 PM Andras Lasso wrote: > Yes, these filters generate one closed surface. > > > > Andras > > > > *From: *Philip Fackler > *Sent: *March 26, 2016 20:28 > *To: *Andras Lasso ; Cory Quammen > > > > *Cc: *vtkusers at vtk.org > *Subject: *Re: [vtkusers] Triangulate surface points? > This method seems to give the bounding polydata to the unstructured volume > grid. What if the surface I'm trying to define isn't closed? Each surface > can be arbitrarily shaped. > > On Fri, Mar 25, 2016 at 10:21 AM Andras Lasso wrote: > >> When all points are coplanar we insert a glyph filter in the pipeline to >> add small spheres at each point. >> >> >> >> Andras >> >> >> >> *From: *Philip Fackler >> *Sent: *March 25, 2016 10:05 >> *To: *Cory Quammen ; Andras Lasso >> >> >> >> *Cc: *vtkusers at vtk.org >> *Subject: *Re: [vtkusers] Triangulate surface points? >> I've tried out vtkDelaunay3D some. But in cases where the surface is >> completely planar, it fails (it can't make any tets). Is there a way it can >> handle that. Sorry, I haven't had a chance to watch the video yet. >> >> On Fri, Mar 25, 2016 at 9:59 AM Cory Quammen >> wrote: >> >>> Cool, thanks!. >>> >>> On Fri, Mar 25, 2016 at 9:48 AM, Andras Lasso wrote: >>> >>>> It can generate non-convex surfaces up to some point - check out the >>>> video and/or try it yourself (you can install the Volume clip extension in >>>> Slicer by two clicks and you can mark points and drag them around to see >>>> how the surface is evolving). The alpha parameter in Delaunay 3D controls >>>> handling of concavities. Limitations include that a non-zero alpha may make >>>> the triangulation to fail and irregular point distances may confuse the >>>> smoothing algorithm. >>>> >>>> >>>> >>>> Andras >>>> >>>> >>>> >>>> *From: *Cory Quammen >>>> *Sent: *March 25, 2016 09:37 >>>> *To: *Andras Lasso >>>> *Cc: *Philip Fackler ; vtkusers at vtk.org >>>> >>>> *Subject: *Re: [vtkusers] Triangulate surface points? >>>> >>>> >>>> Andras, >>>> >>>> That's a good idea as well, but doesn't vtkDelaunay3D produce a convex >>>> hull of the input points? That's fine if your object is convex, of course, >>>> but may not give you the expected results if your object has a concave >>>> region. >>>> >>>> If there is a feature in vtkDelaunay3D that can produce concave >>>> surfaces, I would be interested to know about it. >>>> >>>> Thanks, >>>> Cory >>>> >>>> On Fri, Mar 25, 2016 at 8:34 AM, Andras Lasso wrote: >>>> >>>>> We get excellent results for sparse point sets using a combination of >>>>> vtkDelaunay3D, vtkDataSetSurfaceFilter, and vtkButterflySubdivisionFilter. >>>>> The generated surface includes the exact points that we specify. >>>>> >>>>> >>>>> >>>>> You can see what kind of surfaces you can generate from a small number >>>>> of points: >>>>> >>>>> https://www.youtube.com/watch?v=1mYNwJbE7dQ >>>>> >>>>> >>>>> >>>>> You can play with it if you download 3D Slicer and install Volume Clip >>>>> extension ( >>>>> https://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Extensions/VolumeClip). >>>>> Source code is available here: >>>>> >>>>> >>>>> https://subversion.assembla.com/svn/slicerrt/trunk/VolumeClip/src/VolumeClipWithModel/ >>>>> >>>>> (relevant part is in updateModelFromMarkup function) >>>>> >>>>> >>>>> >>>>> Andras >>>>> >>>>> >>>>> >>>>> *From:* vtkusers [mailto:vtkusers-bounces at vtk.org] *On Behalf Of *Cory >>>>> Quammen >>>>> *Sent:* March 24, 2016 2:29 PM >>>>> *To:* Philip Fackler >>>>> *Cc:* vtkusers at vtk.org >>>>> *Subject:* Re: [vtkusers] Triangulate surface points? >>>>> >>>>> >>>>> >>>>> Philip, >>>>> >>>>> >>>>> >>>>> Please take a look at >>>>> >>>>> >>>>> >>>>> >>>>> http://www.vtk.org/doc/nightly/html/classvtkSurfaceReconstructionFilter.html >>>>> >>>>> >>>>> >>>>> and >>>>> >>>>> >>>>> >>>>> http://www.vtkjournal.org/browse/publication/718 >>>>> >>>>> >>>>> >>>>> I don't have direct experience with these classes, but they may have >>>>> what you need. >>>>> >>>>> >>>>> >>>>> HTH, >>>>> >>>>> Cory >>>>> >>>>> >>>>> >>>>> On Thu, Mar 24, 2016 at 2:24 PM, Philip Fackler < >>>>> philip.fackler at gmail.com> wrote: >>>>> >>>>> If someone could even definitively tell me "no, you can't do this" >>>>> that would be helpful. >>>>> >>>>> >>>>> >>>>> Thanks, >>>>> >>>>> Philip Fackler >>>>> >>>>> >>>>> >>>>> On Wed, Mar 16, 2016 at 6:24 PM Philip Fackler < >>>>> philip.fackler at gmail.com> wrote: >>>>> >>>>> Is there a way to triangulate a set of surface points using vtk? I've >>>>> looked around and everything I've found (vtk, cgal, pcl) only do a surface >>>>> reconstruction which ends up generating its own points to triangulate. I >>>>> want to actually use the points I have as the vertices of the >>>>> triangulation. Along with the point locations, I have a lot of information >>>>> available in my code that I could provide: >>>>> >>>>> >>>>> Normal vector at each point >>>>> >>>>> Bounding segmented curve(s) (i.e., lists of edge cells indexing the >>>>> list of surface points) >>>>> >>>>> A polydata representation of the surface (Note that the points I want >>>>> to triangulate are distinct from the points involved in this) >>>>> >>>>> The only vtk utility that seems to come close to this is >>>>> vtkDelaunay2D, but it's only useful if all the points can be mapped to a 2D >>>>> plane. This isn't possible in general without a parametric surface, which >>>>> is one bit of information I don't have. >>>>> >>>>> Thanks in advance for the 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 >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> >>>>> Cory Quammen >>>>> R&D Engineer >>>>> Kitware, Inc. >>>>> >>>> >>>> >>>> >>>> -- >>>> Cory Quammen >>>> R&D Engineer >>>> Kitware, Inc. >>>> >>> >>> >>> >>> -- >>> Cory Quammen >>> R&D Engineer >>> Kitware, Inc. >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjlp at netease.com Tue Mar 29 10:34:23 2016 From: tjlp at netease.com (Liu_tj) Date: Tue, 29 Mar 2016 22:34:23 +0800 (CST) Subject: [vtkusers] vtkResliceCursorWidget cause access violation exception Message-ID: Hi, VTK guys, I use Activiz VTK 7.0 C# wrapper to develop an application to view DICOM series. However, when vtkResliceCursorWidget is enabled, the application throws access violation exception when the application is closed. What's wrong with my C# code? private void Display(vtkRenderWindow aRenderWindow, vtkImageData aData) { if (aData == null) return; m_imageViewer = vtkImageViewer2.New(); m_imageViewer.SetInputData(aData); m_imageViewer.SetSliceOrientation((int)m_sliceDirection); m_imageViewer.GetSliceRange(ref m_minSliceNumber, ref m_maxSliceNumber); vtkRenderWindowInteractor interactor = aRenderWindow.GetInteractor(); m_imageViewer.SetupInteractor(interactor); aRenderWindow.GetRenderers().InitTraversal(); m_renderer = aRenderWindow.GetRenderers().GetFirstRenderer(); m_renderer.SetBackground(0.0, 0.0, 0.0); m_imageViewer.SetRenderWindow(aRenderWindow); m_imageViewer.SetRenderer(m_renderer); m_interactorStyle = m_imageViewer.GetInteractorStyle(); m_moveforward = new vtkObject.vtkObjectEventHandler(interactor_MouseWheelForwardEvt); m_movebackward = new vtkObject.vtkObjectEventHandler(interactor_MouseWheelBackwardEvt); m_interactorStyle.MouseWheelForwardEvt += m_moveforward; m_interactorStyle.MouseWheelBackwardEvt += m_movebackward; interactor.SetInteractorStyle(m_interactorStyle); m_currentSlice = m_minSliceNumber + (m_maxSliceNumber - m_minSliceNumber) / 2; m_imageViewer.SetSlice(m_currentSlice); m_scalarrange = new double[2]; m_scalarrange = m_imageViewer.GetInput().GetScalarRange(); if (!m_initialized) { m_threshold = new Segament_Threshold(); m_threshold.Min_Threshold = 0; m_threshold.Max_Threshold = m_scalarrange[1]; } if (!m_initialized) { m_reslicecursor = vtkResliceCursor.New(); m_reslicecursorrep = vtkResliceCursorThickLineRepresentation.New(); m_reslicecursorwidget = vtkResliceCursorWidget.New(); m_reslicecursorwidget.SetInteractor(interactor); m_reslicecursorwidget.SetDefaultRenderer(m_renderer); m_reslicecursorwidget.SetRepresentation(m_reslicecursorrep); } double[] image_cent = aData.GetCenter(); m_reslicecursor.SetCenter(image_cent[0], image_cent[1], image_cent[2]); m_reslicecursor.SetImage(aData); m_reslicecursor.SetThickMode(0); m_reslicecursorrep.GetResliceCursorActor().GetCursorAlgorithm().SetResliceCursor(m_reslicecursor); m_reslicecursorrep.GetResliceCursorActor().GetCursorAlgorithm().SetReslicePlaneNormal((int)m_sliceDirection); m_reslicecursorwidget.SetEnabled(1); m_imageViewer.GetRenderer().ResetCamera(); m_imageViewer.Render(); m_initialized = true; } Thanks Liu Peng -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjlp at netease.com Tue Mar 29 11:14:35 2016 From: tjlp at netease.com (Liu_tj) Date: Tue, 29 Mar 2016 23:14:35 +0800 (CST) Subject: [vtkusers] cross hairs display issue with vtkImageViewer2 and vtkResliceCursorWidget Message-ID: <5c0fe030.17.153c2f0d268.Coremail.tjlp@netease.com> Hi, VTK guys, I uses vtkImageViewer2 to display DICOM series. the vtkResliceCursorWidget is enabled. Mousewheel forward and backward is for slice switching. However, when slice is switched, the two cross hairs is overlaied by the new slice. What should I do to avoid it? Refer to the attachement for the cross hair display issue. Thanks, Liu Peng -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: reslicecursor.jpg Type: image/jpeg Size: 25650 bytes Desc: not available URL: From jothybasu at gmail.com Tue Mar 29 19:20:24 2016 From: jothybasu at gmail.com (Jothybasu Selvaraj) Date: Wed, 30 Mar 2016 10:20:24 +1100 Subject: [vtkusers] cross hairs display issue with vtkImageViewer2 and vtkResliceCursorWidget In-Reply-To: <5c0fe030.17.153c2f0d268.Coremail.tjlp@netease.com> References: <5c0fe030.17.153c2f0d268.Coremail.tjlp@netease.com> Message-ID: Hi Try setting SetResolveCoincidentTopologyToPolygonOffset() o te cursor mapper. Jothy On Wed, Mar 30, 2016 at 2:14 AM, Liu_tj wrote: > Hi, VTK guys, > > I uses vtkImageViewer2 to display DICOM series. the vtkResliceCursorWidget > is enabled. Mousewheel forward and backward is for slice switching. > However, when slice is switched, the two cross hairs is overlaied by the > new slice. What should I do to avoid it? > Refer to the attachement for the cross hair display issue. > > Thanks, > Liu Peng > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 ysa0829 at gmail.com Tue Mar 29 21:53:07 2016 From: ysa0829 at gmail.com (Ang) Date: Tue, 29 Mar 2016 18:53:07 -0700 (MST) Subject: [vtkusers] VTKImageResliceMapper SetClippingPlanes problems In-Reply-To: References: <1458726323146-5737327.post@n5.nabble.com> <1458815743100-5737343.post@n5.nabble.com> <1458875891935-5737396.post@n5.nabble.com> Message-ID: <1459302787141-5737445.post@n5.nabble.com> Hi David, Sorry for late response and thanks for your suggestion I got a good smoothing result. About marching cubes on a binary image, I am confused that why different iso value will affect the marching cubes result(I think binary image only one iso value). -- View this message in context: http://vtk.1045678.n5.nabble.com/VTKImageResliceMapper-SetClippingPlanes-problems-tp5737327p5737445.html Sent from the VTK - Users mailing list archive at Nabble.com. From tjlp at netease.com Wed Mar 30 09:45:03 2016 From: tjlp at netease.com (Liu_tj) Date: Wed, 30 Mar 2016 21:45:03 +0800 (CST) Subject: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series In-Reply-To: <4dcc7abb.5.153abbc4a00.Coremail.tjlp@netease.com> References: <54d888d1.3.153823cad17.Coremail.tjlp@netease.com> <4dcc7abb.5.153abbc4a00.Coremail.tjlp@netease.com> Message-ID: <5dbf1bff.19.153c7c5347a.Coremail.tjlp@netease.com> Hi, David, I follow your advice and use the original vtkImageData for vtkMarchingCubes, and the isovalue is 1000. Then I try to save the generated 3D volume to stl file. For a 512*512*190 chest CT DICOM series, the STL file is about 520M. Do you think the file size is rather bigger? Thanks. Liu Peng ?2016-03-25?"Liu_tj" ??? -----????----- ???:"Liu_tj" ????:2016?03?25? ??? ???:"David Gobbi" ??:"vtkusers" ??:Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series Hi, David, Continue this thread. For the 3D model generation, we have a preview function. That means we need quick 3D model generation speed and don't need high model precision. Only when really generating, we need a good 3D model quality. So, for the preview, how to accelerate the generation speed? Thanks Liu Peng ?2016-03-17?"David Gobbi" ??? -----????----- ???:"David Gobbi" ????:2016?03?17? ??? ???:"Liu_tj" ??:"vtkusers" ??:Re: [vtkusers] High memory cost of vtkDecimatePro for 3D model generation from DICOM series Hi Liu Peng, The vtkMarchingCubes algorithm is for greyscale images. Using vtkImageThreshold before vtkMarchingCubes will give a poor result, because the algorithm won't be able to properly interpolate the voxels to find the best surface if it is given a binary image. When you call SetValue(0, isovalue), make sure that "isovalue" is set to the value that corresponds to the desired isosurface. If you don't know what value to use, you can start at 1000, then try 250, then 125, etc. until you get a reasonable result. But the best way to choose a value is to use Otsu's method or something similar. - David On Wed, Mar 16, 2016 at 7:42 PM, Liu_tj wrote: Hi, VTK guys, I use VTK 7.0 to generate 3D model from DICOM series. I just follow the code example from http://www.vtk.org/pipermail/vtkusers/2013-November/082109.html. When I try to reduce the number of triangles by vtkDecimatePro, the Visual Studio 2015 monitor shows that the memory jump to over 10G and my computer has no response, I have to restart my computer rudely. See my code below, with my DICOM series, the marched->GetNumberOfPoints() return more than 20 millions: vtkSmartPointer surface = vtkSmartPointer::New(); surface->SetInputData(volume); surface->ComputeNormalsOn(); surface->ComputeScalarsOn(); surface->SetValue(0, 1); // Create polydata from iso-surface vtkSmartPointer marched = vtkSmartPointer::New(); surface->Update(); marched->DeepCopy(surface->GetOutput()); std::cout<<"Number of points: " << marched->GetNumberOfPoints() << std::endl; // Decimation to reduce the number of triangles vtkSmartPointer decimator = vtkDecimatePro::New(); decimator->SetInputData(marched); decimator->SetTargetReduction(0.5); decimator->SetPreserveTopology(1); decimator->Update(); <------------------memory cost jumps to more than 10G. Any suggestions to decrease the memory cost? I only know that using vtkImageThreshold. Thanks, -------------- next part -------------- An HTML attachment was scrubbed... URL: From longbowzhangchina at gmail.com Wed Mar 30 09:54:48 2016 From: longbowzhangchina at gmail.com (longbowzhang) Date: Wed, 30 Mar 2016 06:54:48 -0700 (MST) Subject: [vtkusers] Clip Volume using freehand 2D Curve ROI In-Reply-To: References: Message-ID: <1459346087999-5737447.post@n5.nabble.com> "freehand 2D curve": I think vtkImageTracerWidget will do the job. Together with vtkPolyDataToImageStencil, it is likely that you will get a stencil, which could be employed to clip the 3D volume. I am not sure whether this will finally work or not. But give it a try. -- View this message in context: http://vtk.1045678.n5.nabble.com/Clip-Volume-using-freehand-2D-Curve-ROI-tp5737430p5737447.html Sent from the VTK - Users mailing list archive at Nabble.com. From simon.esneault at gmail.com Wed Mar 30 10:48:49 2016 From: simon.esneault at gmail.com (Simon ESNEAULT) Date: Wed, 30 Mar 2016 16:48:49 +0200 Subject: [vtkusers] Clip Volume using freehand 2D Curve ROI In-Reply-To: <1459346087999-5737447.post@n5.nabble.com> References: <1459346087999-5737447.post@n5.nabble.com> Message-ID: Hello, I don't think vtkImageTracerWidget will work on a Volume Rendering. The doc says "3D widget for tracing on planar props". I did exactly this, but the ugly way, using Qt to draw on top of the volume rendering. The pipeline is as follow : - Capture a screenshot of the current volume rendering ( using GetRenderWindow()->GetRGBACharPixelData( ... ) ) - Load a QPixmap of the screenshot on top the volume rendering's QVTKWidget - Enable the user to draw using Qt's Scribble example : http://doc.qt.io/qt-5/qtwidgets-widgets-scribble-example.html - When the user has finished to draw, convert all points from Qt coordinate system to VTK coordinate system. - Generate a 3D conic-like mesh using the list of coordinate, the camera position and direction in order to respect the perspective view (not that easy ;) ) - Cap-Clip the mesh with the volume bounding box ( http://www.vtk.org/Wiki/VTK/Examples/Cxx/Meshes/CapClip ) - Generate a mask using vtkPolyDataToImageStencil - Mask out the part that is below the free hand curve in the volume ( vtkImageMask or an equivalent ) - Remove the QPixmap to restore the volume rendering interaction ... That is really ugly, and there might be a lot of better way to do this. But the thing is : it just works ;-) HTH Simon 2016-03-30 15:54 GMT+02:00 longbowzhang : > "freehand 2D curve": I think vtkImageTracerWidget will do the job. > Together with vtkPolyDataToImageStencil, it is likely that you will get a > stencil, which could be employed to clip the 3D volume. > > I am not sure whether this will finally work or not. But give it a try. > > > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Clip-Volume-using-freehand-2D-Curve-ROI-tp5737430p5737447.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 > -- ------------------------------------------------------------------ Simon Esneault Rennes, France ------------------------------------------------------------------ -------------- next part -------------- An HTML attachment was scrubbed... URL: From longbowzhangchina at gmail.com Wed Mar 30 17:07:53 2016 From: longbowzhangchina at gmail.com (longbowzhang) Date: Wed, 30 Mar 2016 14:07:53 -0700 (MST) Subject: [vtkusers] Clip Volume using freehand 2D Curve ROI In-Reply-To: References: <1459346087999-5737447.post@n5.nabble.com> Message-ID: <1459372073124-5737450.post@n5.nabble.com> Hello Simon, Because the author asked "how to clip a volume w/ 2D hand drawn curve" rather than "on a Volume Rendering" context, I proposed to use vtkImageTracerWidget on selected slices. This is probably the easiest way. Like you said, if to clip a volume in the context of "volume rendering", besides the way you propose, I would propose another alternative. 1 Draw the bounding box (NOT outline) of the volume, but represent this 6-face-bounding-box in terms of Wireframe (via vtkActor->GetProperty()->SetRepresentationToWireframe()); 2 Place the vtkImagePlaneWidget on the bounding box (as shown in the attached image); 3 Derive the stencil, which will be used as a mask for clipping in the context of volume rendering. I think this would work. What's your opinion? -- View this message in context: http://vtk.1045678.n5.nabble.com/Clip-Volume-using-freehand-2D-Curve-ROI-tp5737430p5737450.html Sent from the VTK - Users mailing list archive at Nabble.com. From orion at cora.nwra.com Wed Mar 30 18:15:37 2016 From: orion at cora.nwra.com (Orion Poplawski) Date: Wed, 30 Mar 2016 16:15:37 -0600 Subject: [vtkusers] VTK 7 next release Message-ID: <56FC5009.2020104@cora.nwra.com> I'm holding off building VTK 7 for Fedora until this: https://gitlab.kitware.com/vtk/vtk/commit/0c4cbd3f0393dadfe3a3df149414fe6e8ba4870a makes it into a release. Any idea when this might happen? Thanks. -- Orion Poplawski Technical Manager 303-415-9701 x222 NWRA, Boulder/CoRA Office FAX: 303-415-9702 3380 Mitchell Lane orion at nwra.com Boulder, CO 80301 http://www.nwra.com From AlexUtrobin at yandex.ru Thu Mar 31 02:15:38 2016 From: AlexUtrobin at yandex.ru (AlexUtrobin) Date: Wed, 30 Mar 2016 23:15:38 -0700 (MST) Subject: [vtkusers] Trouble with vtkTable Message-ID: <1459404938324-5737452.post@n5.nabble.com> I use the Java version of VTK 6.1. I need to add value to VtkTable, but this class does not contain a function setValue and insertNextValue. I tried to add value using vtkVariantArray, also did not find methods for inserting. Please help me to understand how it works. -- View this message in context: http://vtk.1045678.n5.nabble.com/Trouble-with-vtkTable-tp5737452.html Sent from the VTK - Users mailing list archive at Nabble.com. From mallikarjun49 at gmail.com Thu Mar 31 02:19:18 2016 From: mallikarjun49 at gmail.com (Mallikarjun K) Date: Thu, 31 Mar 2016 11:49:18 +0530 Subject: [vtkusers] Clip Volume using freehand 2D Curve ROI In-Reply-To: <1459372073124-5737450.post@n5.nabble.com> References: <1459346087999-5737447.post@n5.nabble.com> <1459372073124-5737450.post@n5.nabble.com> Message-ID: Hello Sebastian,longbowzhang and Simon, I am sorry I couldn't participate in the discussion as I was away for couple of days. Thank you all for your valuable time and pointers. @Sebastian: Osirix viewer (on Mac) is also having this feature (Scissors) to clip on volume rendering. @longbowzhang: My mistake, may be I couldn't put the context properly. What I mean is Clip on volume in the context of Volume Rendering only. Based on your pointers 1.Can I use vtkboxwidget to draw a bounding box on the volume? I didn't get the pipeline exactly..if you have an example code that would be helpful.. @Simon: I am not using Qt here. I used vtkcontourWidget to draw a curve on the volume as shown below and got the vtkpoints along the curve. Using these points I have created a vtkimpliciteselectionloop and tried to feed this to setclipfunction of VtkClipDataset which gives unstructured grid output and thought of converting it to structured grid using vtkprobefilter but with no luck..:) [image: Inline image 1] On Thu, Mar 31, 2016 at 2:37 AM, longbowzhang wrote: > Hello Simon, > > Because the author asked "how to clip a volume w/ 2D hand drawn curve" > rather than "on a Volume Rendering" context, I proposed to use > vtkImageTracerWidget on selected slices. This is probably the easiest way. > > Like you said, if to clip a volume in the context of "volume rendering", > besides the way you propose, I would propose another alternative. > > 1 Draw the bounding box (NOT outline) of the volume, but represent this > 6-face-bounding-box in terms of Wireframe (via > vtkActor->GetProperty()->SetRepresentationToWireframe()); > 2 Place the vtkImagePlaneWidget on the bounding box (as shown in the > attached image); > > > 3 Derive the stencil, which will be used as a mask for clipping in the > context of volume rendering. > > I think this would work. What's your opinion? > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Clip-Volume-using-freehand-2D-Curve-ROI-tp5737430p5737450.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 > -- *With Kind Regards:* Mallikarjuna K, 07795531103/09908238861. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 189588 bytes Desc: not available URL: From longbowzhangchina at gmail.com Thu Mar 31 03:02:55 2016 From: longbowzhangchina at gmail.com (longbowzhang) Date: Thu, 31 Mar 2016 00:02:55 -0700 (MST) Subject: [vtkusers] Clip Volume using freehand 2D Curve ROI In-Reply-To: References: <1459346087999-5737447.post@n5.nabble.com> <1459372073124-5737450.post@n5.nabble.com> Message-ID: <1459407775412-5737454.post@n5.nabble.com> Mallikarjun K wrote > 1.Can I use vtkboxwidget to draw a bounding box on the volume? I didn't > get the pipeline exactly..if you have an example code that would be > helpful.. http://www.vtk.org/Wiki/VTK/Examples/Cxx/Widgets/BoxWidget Is this what you want? I still a vtkCubeSource is enough (the following code for setting up the ITW). vtkSmartPointer cubeSource = vtkSmartPointer::New(); cubeSource->SetBounds(imageData->GetBounds()); // skip some codes... cubeActor->GetProperty()->SetRepresentationToWireframe(); vtkSmartPointer tracer = vtkSmartPointer::New(); tracer->SetInput(imageData); tracer->SetInteractor(renderWindowInteractor); tracer->SetViewProp(cubeActor); tracer->SnapToImageOff(); tracer->ProjectToPlaneOn(); tracer->SetProjectionNormalToZAxes(); -- View this message in context: http://vtk.1045678.n5.nabble.com/Clip-Volume-using-freehand-2D-Curve-ROI-tp5737430p5737454.html Sent from the VTK - Users mailing list archive at Nabble.com. From martin.buerger at plassertheurer.com Thu Mar 31 05:47:09 2016 From: martin.buerger at plassertheurer.com (PTMartin) Date: Thu, 31 Mar 2016 02:47:09 -0700 (MST) Subject: [vtkusers] Projecting a texture to vtkpolydata without using an actor Message-ID: <1459417629170-5737455.post@n5.nabble.com> I am working under .net with activiz an currently trying to project images to point data. I ran into several problems with this. - How can I place an image only on a part of the vtkpolydata. TextureMapToPlane always places and sizes the texture to cover all the points. I did not find a way how to restrict Position and Size, where the texture has to be placed. - How can I convert a .net Bitmap to vtkImage directly without going through the file system and vtkJpegReader and without copying image data into an array of bytes for the vtkImageImporter to work. - When above problems would be solved. Is there a function to pick a color from a texture by texture coordinate? I could do that manually but do not want to implement kind of bilinear pixel interpolation on my own... Would be great to get some hints. Thanks in advance. -- View this message in context: http://vtk.1045678.n5.nabble.com/Projecting-a-texture-to-vtkpolydata-without-using-an-actor-tp5737455.html Sent from the VTK - Users mailing list archive at Nabble.com. From minaninina1 at gmail.com Thu Mar 31 07:35:48 2016 From: minaninina1 at gmail.com (aria dob) Date: Thu, 31 Mar 2016 04:35:48 -0700 (MST) Subject: [vtkusers] connecting vtk to kinect Message-ID: <1459424148064-5737456.post@n5.nabble.com> hello, please can someone help me i want to connect kinect on my code vtk i need help please -- View this message in context: http://vtk.1045678.n5.nabble.com/connecting-vtk-to-kinect-tp5737456.html Sent from the VTK - Users mailing list archive at Nabble.com. From luukdegram at gmail.com Thu Mar 31 08:32:41 2016 From: luukdegram at gmail.com (Luuk de Gram) Date: Thu, 31 Mar 2016 14:32:41 +0200 Subject: [vtkusers] connecting vtk to kinect In-Reply-To: <1459424148064-5737456.post@n5.nabble.com> References: <1459424148064-5737456.post@n5.nabble.com> Message-ID: Hello Aria, What you could do is use OpenNI2 to read the raw data from the Kinect sensor and then use this data within VTK. The original OpenNI development got discontinued. However, the guys at Occipital who built the Structure Sensor kept it somewhat alive at https://github.com/occipital/OpenNI2 You can find a specific Kinect branch with build instructures there. I don't know the purpose of your project, but maybe what you're looking for is the Point Cloud Library: http://pointclouds.org/ The library also has an OpenNI grabber, which makes the process even easier. In our current project we're also using a depth sensor in combination with OpenNI and VTK and so far it's been working great. (Sorry, resending as I forgot to include the mailing list in my first reply). 2016-03-31 13:35 GMT+02:00 aria dob : > hello, > please can someone help me i want to connect kinect on my code vtk i need > help please > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/connecting-vtk-to-kinect-tp5737456.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 minaninina1 at gmail.com Thu Mar 31 08:42:03 2016 From: minaninina1 at gmail.com (aria dob) Date: Thu, 31 Mar 2016 05:42:03 -0700 (MST) Subject: [vtkusers] connecting vtk to kinect In-Reply-To: References: <1459424148064-5737456.post@n5.nabble.com> Message-ID: <1459428123819-5737458.post@n5.nabble.com> hello , thanks for your answer but i want to do that without open ni, juste with coding by c++ vtk -- View this message in context: http://vtk.1045678.n5.nabble.com/connecting-vtk-to-kinect-tp5737456p5737458.html Sent from the VTK - Users mailing list archive at Nabble.com. From luukdegram at gmail.com Thu Mar 31 09:04:47 2016 From: luukdegram at gmail.com (Luuk de Gram) Date: Thu, 31 Mar 2016 15:04:47 +0200 Subject: [vtkusers] connecting vtk to kinect In-Reply-To: <1459428123819-5737458.post@n5.nabble.com> References: <1459424148064-5737456.post@n5.nabble.com> <1459428123819-5737458.post@n5.nabble.com> Message-ID: Hi, As far as I know does VTK has no way to obtain the data from the Kinect, neither is it within the scope of the library. For this reason I don't think you have an other option than using an external library to obtain the raw data and then use the data in combination with VTK. Is there any particular reason why you are not interested into including another library? OpenNI2 for instance has a fairly simple API and the data can easily be converted to vtkPolyData. - Luuk 2016-03-31 14:42 GMT+02:00 aria dob : > hello , > thanks for your answer but i want to do that without open ni, juste with > coding by c++ vtk > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/connecting-vtk-to-kinect-tp5737456p5737458.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 dave.demarle at kitware.com Thu Mar 31 10:08:03 2016 From: dave.demarle at kitware.com (David E DeMarle) Date: Thu, 31 Mar 2016 10:08:03 -0400 Subject: [vtkusers] VTK 7 next release In-Reply-To: <56FC5009.2020104@cora.nwra.com> References: <56FC5009.2020104@cora.nwra.com> Message-ID: This is in master so it will be in 7.1, but that won't be for a few months still. I can merge this onto the release branch now. The release branch is already a handful of commits (GL2 volume rendering updates mostly) beyond 7.0.0. I suppose this particular change makes a good case for 7.0.1 since it lets external applications determine what back end they've got and that seems, you know, kind of important eh? Show of hands, shall we do a patch release? Thanks as always Orion (and the other packagers) for packaging. It is a great thing. David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Wed, Mar 30, 2016 at 6:15 PM, Orion Poplawski wrote: > I'm holding off building VTK 7 for Fedora until this: > > > https://gitlab.kitware.com/vtk/vtk/commit/0c4cbd3f0393dadfe3a3df149414fe6e8ba4870a > > makes it into a release. Any idea when this might happen? > > Thanks. > > -- > Orion Poplawski > Technical Manager 303-415-9701 x222 > NWRA, Boulder/CoRA Office FAX: 303-415-9702 > 3380 Mitchell Lane orion at nwra.com > Boulder, CO 80301 http://www.nwra.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 sebastien.jourdain at kitware.com Thu Mar 31 10:40:09 2016 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Thu, 31 Mar 2016 08:40:09 -0600 Subject: [vtkusers] Trouble with vtkTable In-Reply-To: <1459404938324-5737452.post@n5.nabble.com> References: <1459404938324-5737452.post@n5.nabble.com> Message-ID: I think the way vtkTable works (from memory), you need to create any http://www.vtk.org/doc/nightly/html/classvtkDataArray.html and add them as column to the table. They obviously need to be the same length, but other than that, that's it... On Thu, Mar 31, 2016 at 12:15 AM, AlexUtrobin wrote: > I use the Java version of VTK 6.1. > I need to add value to VtkTable, but this class does not contain a function > setValue and insertNextValue. > I tried to add value using vtkVariantArray, also did not find methods for > inserting. > > Please help me to understand how it works. > > > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Trouble-with-vtkTable-tp5737452.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 orion at cora.nwra.com Thu Mar 31 11:07:05 2016 From: orion at cora.nwra.com (Orion Poplawski) Date: Thu, 31 Mar 2016 09:07:05 -0600 Subject: [vtkusers] VTK 7 next release In-Reply-To: References: <56FC5009.2020104@cora.nwra.com> Message-ID: <56FD3D19.7090505@cora.nwra.com> I would appreciate a patch release. I really don't think I can update the package until there is a mechanism for the vtk using packages to automatically determine the back-end. Thanks! On 03/31/2016 08:08 AM, David E DeMarle wrote: > This is in master so it will be in 7.1, but that won't be for a few months still. > I can merge this onto the release branch now. The release branch is already a > handful of commits (GL2 volume rendering updates mostly) beyond 7.0.0. > > I suppose this particular change makes a good case for 7.0.1 since it lets > external applications determine what back end they've got and that seems, you > know, kind of important eh? > > Show of hands, shall we do a patch release? > > Thanks as always Orion (and the other packagers) for packaging. It is a great > thing. > > > David E DeMarle > Kitware, Inc. > R&D Engineer > 21 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-881-4909 > > On Wed, Mar 30, 2016 at 6:15 PM, Orion Poplawski > wrote: > > I'm holding off building VTK 7 for Fedora until this: > > https://gitlab.kitware.com/vtk/vtk/commit/0c4cbd3f0393dadfe3a3df149414fe6e8ba4870a > > makes it into a release. Any idea when this might happen? > > Thanks. > > -- > Orion Poplawski > Technical Manager 303-415-9701 x222 > > NWRA, Boulder/CoRA Office FAX: 303-415-9702 > 3380 Mitchell Lane orion at nwra.com > > Boulder, CO 80301 http://www.nwra.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 > > -- Orion Poplawski Technical Manager 303-415-9701 x222 NWRA, Boulder/CoRA Office FAX: 303-415-9702 3380 Mitchell Lane orion at nwra.com Boulder, CO 80301 http://www.nwra.com From jan.hirsch at st.ovgu.de Thu Mar 31 11:25:13 2016 From: jan.hirsch at st.ovgu.de (jhirsch) Date: Thu, 31 Mar 2016 08:25:13 -0700 (MST) Subject: [vtkusers] How to get a fixed number of vertices after decimation in VTK In-Reply-To: <1458832734304-5737349.post@n5.nabble.com> References: <1458832734304-5737349.post@n5.nabble.com> Message-ID: <1459437913322-5737463.post@n5.nabble.com> Hello, 1. You have to give the reduction algorithm the freedom to reduce radical enough. Set Preseve Topology off and set Boundary Vertex deletion on. 2. Since you can only set the target reduction as a factor of the existing elements, I would calculated it as desiredNumberOfPoints/numberOfPoints. Another way would be to use vtkMaskPoints. Set this to random sampling and the maximum number of points. Maybe you need to set GenerateVertices in order to see something... -- View this message in context: http://vtk.1045678.n5.nabble.com/How-to-get-a-fixed-number-of-vertices-after-decimation-in-VTK-tp5737349p5737463.html Sent from the VTK - Users mailing list archive at Nabble.com. From lasso at queensu.ca Thu Mar 31 11:42:00 2016 From: lasso at queensu.ca (Andras Lasso) Date: Thu, 31 Mar 2016 15:42:00 +0000 Subject: [vtkusers] Trouble with vtkTable In-Reply-To: References: <1459404938324-5737452.post@n5.nabble.com> Message-ID: You can have a look how VTK tables are used in Slicer. In this class there are a set of convenience functions for adding/removing lines/columns to existing table: https://github.com/Slicer/Slicer/blob/master/Libs/MRML/Core/vtkMRMLTableNode.cxx Adding rows is easy (just call InsertNextBlankRow). Adding columns is tricky, as number of rows in all columns should match. Andras From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Sebastien Jourdain Sent: March 31, 2016 10:40 AM To: AlexUtrobin Cc: vtkusers Subject: Re: [vtkusers] Trouble with vtkTable I think the way vtkTable works (from memory), you need to create any http://www.vtk.org/doc/nightly/html/classvtkDataArray.html and add them as column to the table. They obviously need to be the same length, but other than that, that's it... On Thu, Mar 31, 2016 at 12:15 AM, AlexUtrobin > wrote: I use the Java version of VTK 6.1. I need to add value to VtkTable, but this class does not contain a function setValue and insertNextValue. I tried to add value using vtkVariantArray, also did not find methods for inserting. Please help me to understand how it works. -- View this message in context: http://vtk.1045678.n5.nabble.com/Trouble-with-vtkTable-tp5737452.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 minaninina1 at gmail.com Thu Mar 31 15:10:51 2016 From: minaninina1 at gmail.com (aria dob) Date: Thu, 31 Mar 2016 12:10:51 -0700 (MST) Subject: [vtkusers] connecting vtk to kinect In-Reply-To: References: <1459424148064-5737456.post@n5.nabble.com> <1459428123819-5737458.post@n5.nabble.com> Message-ID: <1459451451533-5737465.post@n5.nabble.com> yes i have reason , i have to use kinect with vtk without open ni that's for my project and my teacher obligate that,thank's again -- View this message in context: http://vtk.1045678.n5.nabble.com/connecting-vtk-to-kinect-tp5737456p5737465.html Sent from the VTK - Users mailing list archive at Nabble.com. From matt.sutton at padtinc.com Thu Mar 31 16:14:52 2016 From: matt.sutton at padtinc.com (Matt Sutton) Date: Thu, 31 Mar 2016 20:14:52 +0000 Subject: [vtkusers] QVTKWidget and Depth Peeling Revisited Message-ID: <646d192c340c4a8fbf4b52c8de833f9e@ex0.padtinc.com> Hello, I'm trying to use depth peeling within a QVTKWidget based application. Currently, my renderer always returns 0 for GetLastRenderingUsedDepthPeeling(). I'm using VTK 6.3 with a NVIDIA K6000 GPU and the latest NVIDIA driver. I've configured VTK to use the OpenGL2 rendering backend during the CMAKE configure step. I've searched online and found a few messages from 2013 regarding a similar issue, but I can't seem to find the solution? Any help or insight would be appreciated. Regards, Matt Matt Sutton Senior Engineer PADT, Inc. www.PADTINC.com 480.813.4884 x106 matt.sutton at padtinc.com Simulation - Product Development - Rapid Prototyping CONFIDENTIALITY NOTICE: This e-mail message and any attachments are for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. Unless you are the intended recipient, you are hereby notified that copying, forwarding, printing or otherwise disseminating the information contained in or attached to this e-mail is strictly prohibited. If you are not the intended recipient, please notify the sender by telephone, and immediately and permanently delete and destroy all copies and printouts of this e-mail message and/or attachments. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdrahos at aurisrobotics.com Thu Mar 31 18:03:46 2016 From: mdrahos at aurisrobotics.com (Miroslav Drahos) Date: Thu, 31 Mar 2016 22:03:46 +0000 Subject: [vtkusers] QVTKWidget and Depth Peeling Revisited In-Reply-To: <646d192c340c4a8fbf4b52c8de833f9e@ex0.padtinc.com> References: <646d192c340c4a8fbf4b52c8de833f9e@ex0.padtinc.com> Message-ID: Matt, have you seen this example? http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/CorrectlyRenderTranslucentGeometry HTH, Miro ________________________________ From: vtkusers on behalf of Matt Sutton Sent: Thursday, March 31, 2016 1:14 PM To: vtkusers at vtk.org Subject: [vtkusers] QVTKWidget and Depth Peeling Revisited Hello, I'm trying to use depth peeling within a QVTKWidget based application. Currently, my renderer always returns 0 for GetLastRenderingUsedDepthPeeling(). I'm using VTK 6.3 with a NVIDIA K6000 GPU and the latest NVIDIA driver. I've configured VTK to use the OpenGL2 rendering backend during the CMAKE configure step. I've searched online and found a few messages from 2013 regarding a similar issue, but I can't seem to find the solution? Any help or insight would be appreciated. Regards, Matt Matt Sutton Senior Engineer PADT, Inc. www.PADTINC.com 480.813.4884 x106 matt.sutton at padtinc.com Simulation - Product Development - Rapid Prototyping CONFIDENTIALITY NOTICE: This e-mail message and any attachments are for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. Unless you are the intended recipient, you are hereby notified that copying, forwarding, printing or otherwise disseminating the information contained in or attached to this e-mail is strictly prohibited. If you are not the intended recipient, please notify the sender by telephone, and immediately and permanently delete and destroy all copies and printouts of this e-mail message and/or attachments. -------------- next part -------------- An HTML attachment was scrubbed... URL: From minaninina1 at gmail.com Thu Mar 31 18:17:16 2016 From: minaninina1 at gmail.com (aria dob) Date: Thu, 31 Mar 2016 15:17:16 -0700 (MST) Subject: [vtkusers] collision detection Message-ID: <1459462636193-5737468.post@n5.nabble.com> Hi; How can we detect collision between two actors in the scene using VTK? that's with vtk obbtree i guess but i didn't khnow how we can extract the Points from the modele to do the test of collision can someone help me to do that please Thanks -- View this message in context: http://vtk.1045678.n5.nabble.com/collision-detection-tp5737468.html Sent from the VTK - Users mailing list archive at Nabble.com. From garrett.d.morrison at gmail.com Thu Mar 31 18:31:50 2016 From: garrett.d.morrison at gmail.com (Garrett Morrison) Date: Thu, 31 Mar 2016 15:31:50 -0700 Subject: [vtkusers] Empty polydata being generated by vtkContourFilter Message-ID: I am currently passing an ImageData containing a scalar float array to a contour filter which I then plan to extract the verts and polys from for something I am working on. I have confirmed that the ImageData actually contains all the proper scalar values and that the isovalue being used for the contouring is within a reasonable range such that it should be generating a surface. The issue I am running into is that when I look at the GetOutput polydata of the contour filter, GetNumberOfPolys is returning a reasonable number while GetNumberOfVerts returns 0. So somehow it's generating the vertex indices but not the actual coordinates for said vertices. I did notice that enabling ClosedSurfaceOn for the contour causes it to not generate the polys either so I was wondering if possibly there's a setting I'm missing or something else I need to do to force it to generate both vertices as well as polygonal indices. -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.sutton at padtinc.com Thu Mar 31 19:03:35 2016 From: matt.sutton at padtinc.com (Matt Sutton) Date: Thu, 31 Mar 2016 23:03:35 +0000 Subject: [vtkusers] QVTKWidget and Depth Peeling Revisited In-Reply-To: References: <646d192c340c4a8fbf4b52c8de833f9e@ex0.padtinc.com> Message-ID: Miro, Yes, I have seen that example. It is what I've used as a reference implementation. The only thing different, that I can tell, with my implementation and this is that I am using the QVTKWidget inside a Qt application. I found this post: http://www.vtk.org/pipermail/vtk-developers/2013-July/029487.html Which is virtually identical to my situation, but I don't see a resolution anywhere. Thanks for the suggestion, though! Matt Matt Sutton Senior Engineer PADT, Inc. www.PADTINC.com 480.813.4884 x106 matt.sutton at padtinc.com Simulation - Product Development - Rapid Prototyping CONFIDENTIALITY NOTICE: This e-mail message and any attachments are for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. Unless you are the intended recipient, you are hereby notified that copying, forwarding, printing or otherwise disseminating the information contained in or attached to this e-mail is strictly prohibited. If you are not the intended recipient, please notify the sender by telephone, and immediately and permanently delete and destroy all copies and printouts of this e-mail message and/or attachments. From: Miroslav Drahos [mailto:mdrahos at aurisrobotics.com] Sent: Thursday, March 31, 2016 3:04 PM To: Matt Sutton ; vtkusers at vtk.org Subject: Re: QVTKWidget and Depth Peeling Revisited Matt, have you seen this example? http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/CorrectlyRenderTranslucentGeometry HTH, Miro ________________________________ From: vtkusers > on behalf of Matt Sutton > Sent: Thursday, March 31, 2016 1:14 PM To: vtkusers at vtk.org Subject: [vtkusers] QVTKWidget and Depth Peeling Revisited Hello, I'm trying to use depth peeling within a QVTKWidget based application. Currently, my renderer always returns 0 for GetLastRenderingUsedDepthPeeling(). I'm using VTK 6.3 with a NVIDIA K6000 GPU and the latest NVIDIA driver. I've configured VTK to use the OpenGL2 rendering backend during the CMAKE configure step. I've searched online and found a few messages from 2013 regarding a similar issue, but I can't seem to find the solution? Any help or insight would be appreciated. Regards, Matt Matt Sutton Senior Engineer PADT, Inc. www.PADTINC.com 480.813.4884 x106 matt.sutton at padtinc.com Simulation - Product Development - Rapid Prototyping CONFIDENTIALITY NOTICE: This e-mail message and any attachments are for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. Unless you are the intended recipient, you are hereby notified that copying, forwarding, printing or otherwise disseminating the information contained in or attached to this e-mail is strictly prohibited. If you are not the intended recipient, please notify the sender by telephone, and immediately and permanently delete and destroy all copies and printouts of this e-mail message and/or attachments. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Thu Mar 31 19:29:39 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Thu, 31 Mar 2016 16:29:39 -0700 Subject: [vtkusers] Empty polydata being generated by vtkContourFilter In-Reply-To: References: Message-ID: It does not produce verts, it produces points. On Mar 31, 2016 3:31 PM, "Garrett Morrison" wrote: > I am currently passing an ImageData containing a scalar float array to a > contour filter which I then plan to extract the verts and polys from for > something I am working on. I have confirmed that the ImageData actually > contains all the proper scalar values and that the isovalue being used for > the contouring is within a reasonable range such that it should be > generating a surface. > > The issue I am running into is that when I look at the GetOutput polydata > of the contour filter, GetNumberOfPolys is returning a reasonable number > while GetNumberOfVerts returns 0. So somehow it's generating the vertex > indices but not the actual coordinates for said vertices. I did notice that > enabling ClosedSurfaceOn for the contour causes it to not generate the > polys either so I was wondering if possibly there's a setting I'm missing > or something else I need to do to force it to generate both vertices as > well as polygonal indices. > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > 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 matt.sutton at padtinc.com Thu Mar 31 19:32:24 2016 From: matt.sutton at padtinc.com (Matt Sutton) Date: Thu, 31 Mar 2016 23:32:24 +0000 Subject: [vtkusers] QVTKWidget and Depth Peeling Revisited In-Reply-To: References: <646d192c340c4a8fbf4b52c8de833f9e@ex0.padtinc.com> Message-ID: <3564cca73bda4f41b5111e6bfab0af37@ex0.padtinc.com> Folks, Sorry for the noise. It looks like you actually have to have an actor that *is* transparent included in the renderer for depth peeling to be used, even if you've requested it to be activated. Looks like I was bumping up against an somewhat obvious optimization. Once I included an actor that was not fully opaque the rendering code reported that depth peeling was activated. Regards, Matt Sutton Senior Engineer PADT, Inc. www.PADTINC.com 480.813.4884 x106 matt.sutton at padtinc.com Simulation - Product Development - Rapid Prototyping CONFIDENTIALITY NOTICE: This e-mail message and any attachments are for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. Unless you are the intended recipient, you are hereby notified that copying, forwarding, printing or otherwise disseminating the information contained in or attached to this e-mail is strictly prohibited. If you are not the intended recipient, please notify the sender by telephone, and immediately and permanently delete and destroy all copies and printouts of this e-mail message and/or attachments. From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Matt Sutton Sent: Thursday, March 31, 2016 4:04 PM To: Miroslav Drahos ; vtkusers at vtk.org Subject: Re: [vtkusers] QVTKWidget and Depth Peeling Revisited Miro, Yes, I have seen that example. It is what I've used as a reference implementation. The only thing different, that I can tell, with my implementation and this is that I am using the QVTKWidget inside a Qt application. I found this post: http://www.vtk.org/pipermail/vtk-developers/2013-July/029487.html Which is virtually identical to my situation, but I don't see a resolution anywhere. Thanks for the suggestion, though! Matt Matt Sutton Senior Engineer PADT, Inc. www.PADTINC.com 480.813.4884 x106 matt.sutton at padtinc.com Simulation - Product Development - Rapid Prototyping CONFIDENTIALITY NOTICE: This e-mail message and any attachments are for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. Unless you are the intended recipient, you are hereby notified that copying, forwarding, printing or otherwise disseminating the information contained in or attached to this e-mail is strictly prohibited. If you are not the intended recipient, please notify the sender by telephone, and immediately and permanently delete and destroy all copies and printouts of this e-mail message and/or attachments. From: Miroslav Drahos [mailto:mdrahos at aurisrobotics.com] Sent: Thursday, March 31, 2016 3:04 PM To: Matt Sutton >; vtkusers at vtk.org Subject: Re: QVTKWidget and Depth Peeling Revisited Matt, have you seen this example? http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/CorrectlyRenderTranslucentGeometry HTH, Miro ________________________________ From: vtkusers > on behalf of Matt Sutton > Sent: Thursday, March 31, 2016 1:14 PM To: vtkusers at vtk.org Subject: [vtkusers] QVTKWidget and Depth Peeling Revisited Hello, I'm trying to use depth peeling within a QVTKWidget based application. Currently, my renderer always returns 0 for GetLastRenderingUsedDepthPeeling(). I'm using VTK 6.3 with a NVIDIA K6000 GPU and the latest NVIDIA driver. I've configured VTK to use the OpenGL2 rendering backend during the CMAKE configure step. I've searched online and found a few messages from 2013 regarding a similar issue, but I can't seem to find the solution? Any help or insight would be appreciated. Regards, Matt Matt Sutton Senior Engineer PADT, Inc. www.PADTINC.com 480.813.4884 x106 matt.sutton at padtinc.com Simulation - Product Development - Rapid Prototyping CONFIDENTIALITY NOTICE: This e-mail message and any attachments are for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. Unless you are the intended recipient, you are hereby notified that copying, forwarding, printing or otherwise disseminating the information contained in or attached to this e-mail is strictly prohibited. If you are not the intended recipient, please notify the sender by telephone, and immediately and permanently delete and destroy all copies and printouts of this e-mail message and/or attachments. -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.amaclean at gmail.com Thu Mar 31 20:25:01 2016 From: andrew.amaclean at gmail.com (Andrew Maclean) Date: Fri, 1 Apr 2016 11:25:01 +1100 Subject: [vtkusers] Removal of a deprecated function. Message-ID: Hi All, I intend to remove: vtkParametricRandomHills::GenerateTheHills (void) This was deprecated in version 6.2. AFAIK there is no VTK code using this function anymore. The removal of this will be consistent with the policy in: http://www.vtk.org/wp-content/uploads/2015/01/TheVTKSoftwareProcess.pdf Please let me know in the next few days if anyone really wants this left in the current master. Thankyou Andrew -- ___________________________________________ Andrew J. P. Maclean ___________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdrahos at aurisrobotics.com Thu Mar 31 21:06:52 2016 From: mdrahos at aurisrobotics.com (Miroslav Drahos) Date: Fri, 1 Apr 2016 01:06:52 +0000 Subject: [vtkusers] QVTKWidget and Depth Peeling Revisited In-Reply-To: <3564cca73bda4f41b5111e6bfab0af37@ex0.padtinc.com> References: <646d192c340c4a8fbf4b52c8de833f9e@ex0.padtinc.com> , <3564cca73bda4f41b5111e6bfab0af37@ex0.padtinc.com> Message-ID: Glad you figured it out and thanks for sharing your finding! Miro ________________________________ From: Matt Sutton Sent: Thursday, March 31, 2016 4:32 PM To: Matt Sutton; Miroslav Drahos; vtkusers at vtk.org Subject: RE: QVTKWidget and Depth Peeling Revisited Folks, Sorry for the noise. It looks like you actually have to have an actor that *is* transparent included in the renderer for depth peeling to be used, even if you?ve requested it to be activated. Looks like I was bumping up against an somewhat obvious optimization. Once I included an actor that was not fully opaque the rendering code reported that depth peeling was activated. Regards, Matt Sutton Senior Engineer PADT, Inc. www.PADTINC.com 480.813.4884 x106 matt.sutton at padtinc.com Simulation ? Product Development ? Rapid Prototyping CONFIDENTIALITY NOTICE: This e-mail message and any attachments are for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. Unless you are the intended recipient, you are hereby notified that copying, forwarding, printing or otherwise disseminating the information contained in or attached to this e-mail is strictly prohibited. If you are not the intended recipient, please notify the sender by telephone, and immediately and permanently delete and destroy all copies and printouts of this e-mail message and/or attachments. From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Matt Sutton Sent: Thursday, March 31, 2016 4:04 PM To: Miroslav Drahos ; vtkusers at vtk.org Subject: Re: [vtkusers] QVTKWidget and Depth Peeling Revisited Miro, Yes, I have seen that example. It is what I?ve used as a reference implementation. The only thing different, that I can tell, with my implementation and this is that I am using the QVTKWidget inside a Qt application. I found this post: http://www.vtk.org/pipermail/vtk-developers/2013-July/029487.html Which is virtually identical to my situation, but I don?t see a resolution anywhere. Thanks for the suggestion, though! Matt Matt Sutton Senior Engineer PADT, Inc. www.PADTINC.com 480.813.4884 x106 matt.sutton at padtinc.com Simulation ? Product Development ? Rapid Prototyping CONFIDENTIALITY NOTICE: This e-mail message and any attachments are for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. Unless you are the intended recipient, you are hereby notified that copying, forwarding, printing or otherwise disseminating the information contained in or attached to this e-mail is strictly prohibited. If you are not the intended recipient, please notify the sender by telephone, and immediately and permanently delete and destroy all copies and printouts of this e-mail message and/or attachments. From: Miroslav Drahos [mailto:mdrahos at aurisrobotics.com] Sent: Thursday, March 31, 2016 3:04 PM To: Matt Sutton >; vtkusers at vtk.org Subject: Re: QVTKWidget and Depth Peeling Revisited Matt, have you seen this example? http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/CorrectlyRenderTranslucentGeometry HTH, Miro ________________________________ From: vtkusers > on behalf of Matt Sutton > Sent: Thursday, March 31, 2016 1:14 PM To: vtkusers at vtk.org Subject: [vtkusers] QVTKWidget and Depth Peeling Revisited Hello, I?m trying to use depth peeling within a QVTKWidget based application. Currently, my renderer always returns 0 for GetLastRenderingUsedDepthPeeling(). I?m using VTK 6.3 with a NVIDIA K6000 GPU and the latest NVIDIA driver. I?ve configured VTK to use the OpenGL2 rendering backend during the CMAKE configure step. I?ve searched online and found a few messages from 2013 regarding a similar issue, but I can?t seem to find the solution? Any help or insight would be appreciated. Regards, Matt Matt Sutton Senior Engineer PADT, Inc. www.PADTINC.com 480.813.4884 x106 matt.sutton at padtinc.com Simulation ? Product Development ? Rapid Prototyping CONFIDENTIALITY NOTICE: This e-mail message and any attachments are for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. Unless you are the intended recipient, you are hereby notified that copying, forwarding, printing or otherwise disseminating the information contained in or attached to this e-mail is strictly prohibited. If you are not the intended recipient, please notify the sender by telephone, and immediately and permanently delete and destroy all copies and printouts of this e-mail message and/or attachments. -------------- next part -------------- An HTML attachment was scrubbed... URL: