From csaravanakumar2010 at gmail.com Wed Aug 1 00:27:42 2018 From: csaravanakumar2010 at gmail.com (saravanakumar) Date: Tue, 31 Jul 2018 21:27:42 -0700 (MST) Subject: [vtkusers] Color mapping Message-ID: <1533097662722-0.post@n5.nabble.com> Hi to all, I am trying to create color mapping(like heat image) in VTK like the above image. i have the data in csv file. according to the data, need to map the color. Help me to create a color mapping. Thanks in advance. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From joechenrh at gmail.com Wed Aug 1 02:39:16 2018 From: joechenrh at gmail.com (joechen) Date: Tue, 31 Jul 2018 23:39:16 -0700 (MST) Subject: [vtkusers] Question about vtkQuadricDecimation Message-ID: <1533105556986-0.post@n5.nabble.com> hi? I have two obj, they are exactly the same except the precision of vertexs. But when I run vtkQuadricDecimation, the first one only needs about one minute while the second one needs more than ten minute. Does anyone once met this problem? Thanks. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From yaoyansi at gmail.com Wed Aug 1 04:52:23 2018 From: yaoyansi at gmail.com (Yansi Yao) Date: Wed, 1 Aug 2018 16:52:23 +0800 Subject: [vtkusers] Can't install VTK from pip Message-ID: Hi all, I use the following command to install vtk: pip install vtk But it complains the following message: Collecting vtk Could not find a version that satisfies the requirement vtk (from versions: ) No matching distribution found for vtk My pip can find vtk: \>pip search *vtk* vtk (8.1.1) - VTK is an open-source toolkit for 3D computer graphics, image processing, and visualization ... My system is Win7, and my pip is the latest version: \>python -m pip install -U pip Requirement already up-to-date: pip in c:\python27\lib\site-packages (18.0) Could anyone tell me how to solve this problem? Cheers Yansi -------------- next part -------------- An HTML attachment was scrubbed... URL: From shayan.moradkhani at gmail.com Wed Aug 1 12:26:40 2018 From: shayan.moradkhani at gmail.com (shayan moradkhani) Date: Wed, 1 Aug 2018 09:26:40 -0700 (MST) Subject: [vtkusers] SetCenter for loaded obj models Message-ID: <1533140800719-0.post@n5.nabble.com> hi, I was trying to load my obj file and wanted to use the SetCenter convention provided for vtkCylinder/SphereSource. however, when making actors for loaded obj model, it does not have the option of SetCenter. I noticed there are methods of GetCenter/Position and SetPosition in vtkProp3D.h . therefore, i simply copy pasted the SetPosition method and replaced "Position" with "Center" and created apparently the following right above SetPosition in vtkProp3D.h : does this way of modification make sense? because i got the following error: i really look forward to hearing from anyone regards Shayan -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From tsilveira1993 at gmail.com Wed Aug 1 12:46:25 2018 From: tsilveira1993 at gmail.com (SilveiraPO .) Date: Wed, 1 Aug 2018 17:46:25 +0100 Subject: [vtkusers] Help in creating 2D mesh with correct scalars Message-ID: Hello, I'm making a 2D FEM program (using only quad elements), and after trying your examples to assign scalars to the elements of my mesh, i got no good results. Basically, i have 3 arrays: 1. The first one is the nodes array following this format: [x,y,z]*n in which x,y and z correspond to the respective coordinate and "n" the number of nodes 2. The second one, is the cells array -> [1node, 2node, 3node, 4node]*e, where "e" is the number of elements. 3. And finally the last array is the stresses array -> [stresse]*e, where "e" is the number of elements. My question is, how can i assign the values of the stresses array to the cells array. Basically assigning the stresses array as my scalars, in order to render them on top of my cells. Thanks in advance! Cheers -------------- next part -------------- An HTML attachment was scrubbed... URL: From tsilveira1993 at gmail.com Wed Aug 1 12:49:35 2018 From: tsilveira1993 at gmail.com (SilveiraPO .) Date: Wed, 1 Aug 2018 17:49:35 +0100 Subject: [vtkusers] Help in creating 2D mesh with correct scalars In-Reply-To: References: Message-ID: P.S, i'm using the python vtk wrapper 2018-08-01 17:46 GMT+01:00 SilveiraPO . : > Hello, > > I'm making a 2D FEM program (using only quad elements), and after trying > your examples to assign scalars to the elements of my mesh, i got no good > results. > Basically, i have 3 arrays: > > 1. The first one is the nodes array following this format: [x,y,z]*n in > which x,y and z correspond to the respective coordinate and "n" the number > of nodes > > 2. The second one, is the cells array -> [1node, 2node, 3node, 4node]*e, > where "e" is the number of elements. > > 3. And finally the last array is the stresses array -> [stresse]*e, where > "e" is the number of elements. > > My question is, how can i assign the values of the stresses array to the > cells array. Basically assigning the stresses array as my scalars, in order > to render them on top of my cells. > Thanks in advance! > > Cheers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From castellanoslizan at gmail.com Wed Aug 1 17:12:15 2018 From: castellanoslizan at gmail.com (Lizeth Castellanos) Date: Wed, 1 Aug 2018 18:12:15 -0300 Subject: [vtkusers] Copy image data into vtkImageData from a textfile In-Reply-To: References: Message-ID: Hi, I got VTK 7.1.1 in my computer, finally! So, I have tested the two solutions that you have suggested: 1) using vtkProbeFilter 2) using vtkResampleToImage *1) *I have adjusted the image dimensions according to my own data and I am using vtkSmartVolumeMapper, instead of vtkVolumeRaycastMapper. No errors are generated in the terminal. However, I have been waiting for several minutes and nothing happens. Do you have any idea what is wrong? csvfile="directory path to my csv file/sample.csv" reader = vtk.vtkDelimitedTextReader() reader.SetFieldDelimiterCharacters(" ") reader.DetectNumericColumnsOn() reader.SetFileName(csvfile) reader.MergeConsecutiveDelimitersOn() reader.Update() tableToPoints = vtk.vtkTableToPolyData() tableToPoints.SetInputConnection(reader.GetOutputPort()) tableToPoints.SetXColumn('Field 0') tableToPoints.SetYColumn('Field 1') tableToPoints.SetZColumn('Field 2') imageData = vtk.vtkImageData() imageData.SetDimensions(512, 512, 192) imageData.SetOrigin(0.0, 0.0, 0.0) imageData.SetSpacing(1.0, 1.0, 1.0) probeFilter = vtk.vtkProbeFilter() probeFilter.SetSourceConnection(tableToPoints.GetOutputPort()) probeFilter.SetInputData(imageData) probeFilter.Update() writer = vtk.vtkXMLImageDataWriter() writer.SetInputData(probeFilter.GetOutput()) writer.SetFileName('out.vti') writer.Write() probeFilter.GetOutput().GetPointData().SetActiveScalars('Field 3') range = probeFilter.GetOutput().GetPointData().GetScalars().GetRange() colors = vtk.vtkNamedColors() # Create the standard renderer, render window # and interactor. ren = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) # Create transfer mapping scalar value to opacity. opacityTransferFunction = vtk.vtkPiecewiseFunction() opacityTransferFunction.AddPoint(range[0], 0.0) opacityTransferFunction.AddPoint(range[1], 1.0) # Create transfer mapping scalar value to color. colorTransferFunction = vtk.vtkColorTransferFunction() colorTransferFunction.AddRGBPoint(range[0], 0.0, 0.0, 1.0) colorTransferFunction.AddRGBPoint((range[0]+range[1])*0.5, 0.0, 1.0, 0.0) colorTransferFunction.AddRGBPoint(range[1], 1.0, 0.0, 0.0) # The property describes how the data will look. volumeProperty = vtk.vtkVolumeProperty() volumeProperty.SetColor(colorTransferFunction) volumeProperty.SetScalarOpacity(opacityTransferFunction) volumeProperty.SetScalarOpacityUnitDistance(1.73205080757) volumeProperty.SetInterpolationTypeToLinear() # The mapper / ray cast function know how to render the data. volumeMapper = vtk.vtkSmartVolumeMapper() volumeMapper.SetInputConnection(probeFilter.GetOutputPort()) volumeMapper.SetBlendModeToComposite() # The volume holds the mapper and the property and # can be used to position/orient the volume. volume = vtk.vtkVolume() volume.SetMapper(volumeMapper) volume.SetProperty(volumeProperty) ren.AddVolume(volume) ren.SetBackground(colors.GetColor3d("White")) ren.GetActiveCamera().ParallelProjectionOn() ren.ResetCameraClippingRange() ren.ResetCamera() renWin.SetSize(600, 600) renWin.Render() iren.Start() *2)* I have tested the vtkResampleToImage class, (the solution that you suggest at the beginning of this thread). However, I get a solid a cube as output. Do you have any idea why that happens? csvfile="directory path to my csv file/sample.csv" reader = vtk.vtkDelimitedTextReader() reader.SetFieldDelimiterCharacters(" ") reader.DetectNumericColumnsOn() reader.SetFileName(csvfile) reader.MergeConsecutiveDelimitersOn() reader.Update() tableToPoints = vtk.vtkTableToPolyData() tableToPoints.SetInputConnection(reader.GetOutputPort()) tableToPoints.SetXColumn("Field 0") tableToPoints.SetYColumn("Field 1") tableToPoints.SetZColumn("Field 2") tableToPoints.Update() resample = vtk.vtkResampleToImage() resample.SetInputConnection(tableToPoints.GetOutputPort()) resample.SetSamplingDimensions(3, 3, 3) resample.Update() scalar = resample.GetOutput().GetPointData().GetArray("Field 3") resample.GetOutput().GetPointData().SetScalars(scalar) range = resample.GetOutput().GetPointData().GetScalars().GetRange() writer = vtk.vtkMetaImageWriter() writer.SetInputData(resample.GetOutput()) writer.SetFileName('out.mha') writer.SetCompression(True) writer.Write() colors = vtk.vtkNamedColors() # Create the standard renderer, render window # and interactor. ren = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) # Create transfer mapping scalar value to opacity. opacityTransferFunction = vtk.vtkPiecewiseFunction() opacityTransferFunction.AddPoint(range[0], 0.0) opacityTransferFunction.AddPoint(range[1], 1.0) # Create transfer mapping scalar value to color. colorTransferFunction = vtk.vtkColorTransferFunction() colorTransferFunction.AddRGBPoint(range[0], 0.0, 0.0, 1.0) colorTransferFunction.AddRGBPoint((range[0]+range[1])*0.5, 0.0, 1.0, 0.0) colorTransferFunction.AddRGBPoint(range[1], 1.0, 0.0, 0.0) # The property describes how the data will look. volumeProperty = vtk.vtkVolumeProperty() volumeProperty.SetColor(colorTransferFunction) volumeProperty.SetScalarOpacity(opacityTransferFunction) volumeProperty.SetScalarOpacityUnitDistance(1.73205080757) volumeProperty.SetInterpolationTypeToLinear() # The mapper / ray cast function know how to render the data. volumeMapper = vtk.vtkSmartVolumeMapper() volumeMapper.SetInputConnection(resample.GetOutputPort()) volumeMapper.SetBlendModeToComposite() # The volume holds the mapper and the property and # can be used to position/orient the volume. volume = vtk.vtkVolume() volume.SetMapper(volumeMapper) volume.SetProperty(volumeProperty) ren.AddVolume(volume) ren.SetBackground(colors.GetColor3d("White")) ren.GetActiveCamera().ParallelProjectionOn() ren.ResetCameraClippingRange() ren.ResetCamera() renWin.SetSize(600, 600) renWin.Render() iren.Start() Thanks Lizeth On Fri, Jul 27, 2018 at 5:37 PM, kenichiro yoshimi wrote: > Hi, > > Thank you for sharing your code. At first glance, the parameters of > imageData have to be set according to your own data. > --- > imageData.SetDimensions(512, 512, 192) > imageData.SetOrigin(0.0, 0.0, 0.0) > imageData.SetSpacing(1, 1, 1) > --- > And would you try to use vtkSmartVolumeMapper, instead of > vtkVolumeRaycastMapper? > > Thanks > 2018?7?28?(?) 4:03 Lizeth Castellanos : > > > > Hi! > > > > Thanks for your reply. > > My doubt was about how to pass the 'Field 3' to the probe filter. I made > some adjust based in your help. However, the output shows two solid cube > instead of the points from my segmented dataset. > > > > I am sending the code and the screenshot of the output. Thanks again :-) > > > > reader = vtk.vtkDelimitedTextReader() > > reader.SetFieldDelimiterCharacters(' ') > > reader.DetectNumericColumnsOn() > > reader.SetFileName('sample.csv') > > reader.MergeConsecutiveDelimitersOn() > > reader.Update() > > > > tableToPoints = vtk.vtkTableToPolyData() > > tableToPoints.SetInputConnection(reader.GetOutputPort()) > > tableToPoints.SetXColumn('Field 0') > > tableToPoints.SetYColumn('Field 1') > > tableToPoints.SetZColumn('Field 2') > > tableToPoints.Update() > > > > imageData = vtk.vtkImageData() > > imageData.SetDimensions(3, 3, 3) > > imageData.SetOrigin(0.0, 0.0, 0.0) > > imageData.SetSpacing(1.0, 1.0, 1.0) > > imageData.Update() > > > > probeFilter = vtk.vtkProbeFilter() > > probeFilter.SetSourceConnection(tableToPoints.GetOutputPort()) > > probeFilter.SetInput(imageData) > > probeFilter.Update() > > > > probeFilter.GetOutput().GetPointData().SetActiveScalars('Field 3') > > scalarRange = probeFilter.GetOutput().GetPointData().GetScalars(). > GetRange() > > > > writer = vtk.vtkXMLImageDataWriter() > > writer.SetInput(probeFilter.GetOutput()) > > writer.SetFileName('out.vti') > > writer.Write() > > > > # Create transfer mapping scalar value to opacity. > > opacityTransferFunction = vtk.vtkPiecewiseFunction() > > opacityTransferFunction.AddPoint(scalarRange[0], 0.0) > > opacityTransferFunction.AddPoint(scalarRange[1], 0.5) > > > > # Create transfer mapping scalar value to color. > > colorTransferFunction = vtk.vtkColorTransferFunction() > > colorTransferFunction.AddRGBPoint(scalarRange[0], 0.0, 0.0, 1.0) > > colorTransferFunction.AddRGBPoint((scalarRange[0]+scalarRange[1])*0.5, > 0.0, 1.0, 0.0) > > colorTransferFunction.AddRGBPoint(scalarRange[1], 1.0, 0.0, 0.0) > > > > # The property describes how the data will look. > > volumeProperty = vtk.vtkVolumeProperty() > > volumeProperty.SetColor(colorTransferFunction) > > volumeProperty.SetScalarOpacity(opacityTransferFunction) > > volumeProperty.SetScalarOpacityUnitDistance(1.73205080757) > > volumeProperty.SetInterpolationTypeToLinear() > > volumeProperty.ShadeOn() > > > > # vtkVolumeRayCastMapper need data of type unsigned char or unsigned > short > > cast = vtk.vtkImageCast() > > cast.SetInputConnection(probeFilter.GetOutputPort()) > > cast.SetOutputScalarTypeToUnsignedChar() > > cast.Update() > > > > ## The mapper / ray cast function know how to render the data > > compositeFunction = vtk.vtkVolumeRayCastCompositeFunction() > > volumeMapper = vtk.vtkVolumeRayCastMapper() > > volumeMapper.SetVolumeRayCastFunction(compositeFunction) > > volumeMapper.SetInputConnection(cast.GetOutputPort()) > > > > > > #The volume holds the mapper and the property. > > volume = vtk.vtkVolume() > > volume.SetMapper(volumeMapper) > > volume.SetProperty(volumeProperty) > > > > #Create the standard renderer, render window and interactor > > ren = vtk.vtkRenderer() > > > > renWin = vtk.vtkRenderWindow() > > renWin.AddRenderer(ren) > > > > iren = vtk.vtkRenderWindowInteractor() > > iren.SetRenderWindow(renWin) > > > > ren.AddVolume(volume) > > ren.SetBackground(1, 1, 1) > > renWin.SetSize(600, 600) > > renWin.Render() > > > > iren.Initialize() > > renWin.Render() > > iren.Start() > > > > > > > > > > On Thu, Jul 26, 2018 at 9:35 PM, kenichiro yoshimi < > rccm.kyoshimi at gmail.com> wrote: > >> > >> Hi, > >> > >> Your question is not clear enough. If you possible, can you post your > >> code? I don't have a problem with volume rendering in my code. > >> > >> ---- > >> import vtk > >> > >> > >> def main(): > >> > >> reader = vtk.vtkDelimitedTextReader() > >> reader.SetFileName('sample.csv') > >> reader.DetectNumericColumnsOn() > >> reader.SetFieldDelimiterCharacters(' ') > >> reader.MergeConsecutiveDelimitersOn() > >> > >> tableToPoints = vtk.vtkTableToPolyData() > >> tableToPoints.SetInputConnection(reader.GetOutputPort()) > >> tableToPoints.SetXColumn('Field 0') > >> tableToPoints.SetYColumn('Field 1') > >> tableToPoints.SetZColumn('Field 2') > >> > >> imageData = vtk.vtkImageData() > >> imageData.SetDimensions(3, 3, 3) > >> imageData.SetOrigin(0.0, 0.0, 0.0) > >> imageData.SetSpacing(1.0, 1.0, 1.0) > >> > >> probeFilter = vtk.vtkProbeFilter() > >> probeFilter.SetSourceConnection(tableToPoints.GetOutputPort()) > >> probeFilter.SetInputData(imageData) > >> probeFilter.Update() > >> > >> writer = vtk.vtkXMLImageDataWriter() > >> writer.SetInputData(probeFilter.GetOutput()) > >> writer.SetFileName('out.vti') > >> writer.Write() > >> > >> probeFilter.GetOutput().GetPointData().SetActiveScalars('Field 3') > >> range = probeFilter.GetOutput().GetPointData().GetScalars(). > GetRange() > >> > >> colors = vtk.vtkNamedColors() > >> > >> # Create the standard renderer, render window > >> # and interactor. > >> ren = vtk.vtkRenderer() > >> > >> renWin = vtk.vtkRenderWindow() > >> renWin.AddRenderer(ren) > >> > >> iren = vtk.vtkRenderWindowInteractor() > >> iren.SetRenderWindow(renWin) > >> > >> # Create transfer mapping scalar value to opacity. > >> opacityTransferFunction = vtk.vtkPiecewiseFunction() > >> opacityTransferFunction.AddPoint(range[0], 0.0) > >> opacityTransferFunction.AddPoint(range[1], 1.0) > >> > >> # Create transfer mapping scalar value to color. > >> colorTransferFunction = vtk.vtkColorTransferFunction() > >> colorTransferFunction.AddRGBPoint(range[0], 0.0, 0.0, 1.0) > >> colorTransferFunction.AddRGBPoint((range[0]+range[1])*0.5, 0.0, > 1.0, 0.0) > >> colorTransferFunction.AddRGBPoint(range[1], 1.0, 0.0, 0.0) > >> > >> # The property describes how the data will look. > >> volumeProperty = vtk.vtkVolumeProperty() > >> volumeProperty.SetColor(colorTransferFunction) > >> volumeProperty.SetScalarOpacity(opacityTransferFunction) > >> volumeProperty.SetScalarOpacityUnitDistance(1.73205080757) > >> volumeProperty.SetInterpolationTypeToLinear() > >> > >> # The mapper / ray cast function know how to render the data. > >> volumeMapper = vtk.vtkSmartVolumeMapper() > >> volumeMapper.SetInputConnection(probeFilter.GetOutputPort()) > >> volumeMapper.SetBlendModeToComposite() > >> > >> # The volume holds the mapper and the property and > >> # can be used to position/orient the volume. > >> volume = vtk.vtkVolume() > >> volume.SetMapper(volumeMapper) > >> volume.SetProperty(volumeProperty) > >> > >> ren.AddVolume(volume) > >> > >> ren.SetBackground(colors.GetColor3d("White")) > >> ren.GetActiveCamera().ParallelProjectionOn() > >> ren.ResetCameraClippingRange() > >> ren.ResetCamera() > >> > >> renWin.SetSize(600, 600) > >> renWin.Render() > >> > >> iren.Start() > >> > >> > >> if __name__ == '__main__': > >> main() > >> ---- > >> > >> Regards > >> 2018?7?26?(?) 0:15 Lizeth Castellanos : > >> > > >> > Thanks for your answers! > >> > > >> > For the case 2) I have one more question: How can I add the scalar > values from the intensity ('Field 3') to the data? > >> > > >> > I have added those two lines to your code: > >> > > >> > scalar = probeFilter.GetOutput().GetPointData().GetArray('Field 3') > >> > probeFilter.GetOutput().GetPointData().SetScalars(scalar) > >> > > >> > But when I render the volume, nothing is displayed in the render > window. > >> > > >> > Thanks > >> > > >> > Lizeth > >> > > >> > > >> > > >> > > >> > > >> > On Tue, Jul 24, 2018 at 11:29 PM, kenichiro yoshimi < > rccm.kyoshimi at gmail.com> wrote: > >> >> > >> >> Hi, > >> >> > >> >> 1) You need to specify PYTHON_INCLUDE_DIR and PYTHON_LIBRARY to suit > >> >> your own system in the 'advanced options' in cmake. > >> >> > >> >> PYTHON_INCLUDE_DIR will be the name of the directory containing the > Python.h: > >> >> e.g. /usr/include/python2.7 > >> >> PYTHON_LIBRARY will be the full path to libpython2.7.so (or.a): > >> >> e.g. /usr/lib64/libpython2.7.so > >> >> > >> >> 2) For example, if you apply vtkProbeFilter to sample.csv in the > >> >> previous my post, script is something like below. > >> >> > >> >> --- > >> >> import vtk > >> >> > >> >> > >> >> def main(): > >> >> > >> >> reader = vtk.vtkDelimitedTextReader() > >> >> reader.SetFileName('sample.csv') > >> >> reader.DetectNumericColumnsOn() > >> >> reader.SetFieldDelimiterCharacters(' ') > >> >> reader.MergeConsecutiveDelimitersOn() > >> >> > >> >> tableToPoints = vtk.vtkTableToPolyData() > >> >> tableToPoints.SetInputConnection(reader.GetOutputPort()) > >> >> tableToPoints.SetXColumn('Field 0') > >> >> tableToPoints.SetYColumn('Field 1') > >> >> tableToPoints.SetZColumn('Field 2') > >> >> > >> >> imageData = vtk.vtkImageData() > >> >> imageData.SetDimensions(3, 3, 3) > >> >> imageData.SetOrigin(0.0, 0.0, 0.0) > >> >> imageData.SetSpacing(1.0, 1.0, 1.0) > >> >> > >> >> probeFilter = vtk.vtkProbeFilter() > >> >> probeFilter.SetSourceConnection(tableToPoints.GetOutputPort()) > >> >> probeFilter.SetInputData(imageData) > >> >> probeFilter.Update() > >> >> > >> >> writer = vtk.vtkXMLImageDataWriter() > >> >> writer.SetInputData(probeFilter.GetOutput()) > >> >> writer.SetFileName('out.vti') > >> >> writer.Write() > >> >> > >> >> > >> >> if __name__ == '__main__': > >> >> main() > >> >> --- > >> >> > >> >> For your reference. > >> >> 2018?7?25?(?) 4:10 Lizeth Castellanos : > >> >> > > >> >> > Thanks for your help Kenichiro Yoshimi > >> >> > > >> >> > I was able to reproduce some part of your code. However, I > encountered new issues. > >> >> > > >> >> > 1)I have all my project under VTK 5.10.1 with python 2.7.12 in > linux. I got this error: 'module' object has no attribute > 'vtkResampleToImage'. > >> >> > So I guess that the vtkResampleToImage class is not avaliable for > my VTK version. > >> >> > I tried to build a newer VTK version but I didn't get success. I > tried with VTK 7.1.1 and I got errors related to the python libs Could NOT > find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS). > >> >> > > >> >> > 2) I read that vtkResampleToImage samples a dataset on a uniform > grid and it internally uses vtkProbeFilter to do the probing. So, Is there > any way to use vtkProbeFilter instead of vtkResampleToImage? > >> >> > I have tested some examples from vtkProbeFilter but I am confused > about how use it in my specific problem. > >> >> > > >> >> > Thanks, > >> >> > > >> >> > Lizeth > >> >> > > >> >> > On Thu, Jul 19, 2018 at 12:38 AM, kenichiro yoshimi < > rccm.kyoshimi at gmail.com> wrote: > >> >> >> > >> >> >> Hi Lizeth, > >> >> >> > >> >> >> Because vtkDelimitedTextReader outputs a vtkTable, you firstly > need to > >> >> >> convert it to a vtkPolyData using vtkTableToPolyData. And then > you can > >> >> >> use vtkResampleToImage to map the polyData to vtkImageData. > >> >> >> > >> >> >> ---sample.csv--- > >> >> >> 0 0 0 60.7635 > >> >> >> 1 0 0 107.555 > >> >> >> 2 0 0 80.5241 > >> >> >> 0 1 0 85.9694 > >> >> >> 1 1 0 156.706 > >> >> >> 2 1 0 105.73 > >> >> >> 0 2 0 37.3531 > >> >> >> 1 2 0 84.1445 > >> >> >> 2 2 0 57.1137 > >> >> >> 0 0 1 100.634 > >> >> >> 1 0 1 171.37 > >> >> >> 2 0 1 120.395 > >> >> >> 0 1 1 149.785 > >> >> >> 1 1 1 260 > >> >> >> 2 1 1 169.546 > >> >> >> 0 2 1 77.2238 > >> >> >> 1 2 1 147.96 > >> >> >> 2 2 1 96.9844 > >> >> >> 0 0 2 60.7635 > >> >> >> 1 0 2 107.555 > >> >> >> 2 0 2 80.5241 > >> >> >> 0 1 2 85.9694 > >> >> >> 1 1 2 156.706 > >> >> >> 2 1 2 105.73 > >> >> >> 0 2 2 37.3531 > >> >> >> 1 2 2 84.1445 > >> >> >> 2 2 2 57.1137 > >> >> >> > >> >> >> --- > >> >> >> import vtk > >> >> >> > >> >> >> > >> >> >> def main(): > >> >> >> colors = vtk.vtkNamedColors() > >> >> >> > >> >> >> reader = vtk.vtkDelimitedTextReader() > >> >> >> reader.SetFileName('sample.csv') > >> >> >> reader.DetectNumericColumnsOn() > >> >> >> reader.SetFieldDelimiterCharacters(' ') > >> >> >> reader.MergeConsecutiveDelimitersOn() > >> >> >> > >> >> >> tableToPoints = vtk.vtkTableToPolyData() > >> >> >> tableToPoints.SetInputConnection(reader.GetOutputPort()) > >> >> >> tableToPoints.SetXColumn('Field 0') > >> >> >> tableToPoints.SetYColumn('Field 1') > >> >> >> tableToPoints.SetZColumn('Field 2') > >> >> >> > >> >> >> resample = vtk.vtkResampleToImage() > >> >> >> resample.SetInputConnection(tableToPoints.GetOutputPort()) > >> >> >> resample.SetSamplingDimensions(3, 3, 3) > >> >> >> resample.Update() > >> >> >> > >> >> >> scalar = resample.GetOutput().GetPointData().GetArray('Field > 3') > >> >> >> resample.GetOutput().GetPointData().SetScalars(scalar) > >> >> >> > >> >> >> writer = vtk.vtkMetaImageWriter() > >> >> >> writer.SetInputData(resample.GetOutput()) > >> >> >> writer.SetFileName('out.mha') > >> >> >> writer.SetCompression(True) > >> >> >> writer.Write() > >> >> >> > >> >> >> > >> >> >> if __name__ == '__main__': > >> >> >> main() > >> >> >> --- > >> >> >> > >> >> >> Best > >> >> >> 2018?7?19?(?) 3:43 Lizeth Castellanos >: > >> >> >> > > >> >> >> > Hi! > >> >> >> > > >> >> >> > I'd like to copy image data from a textfile (csv) into > vtkImageData. > >> >> >> > The textfile have voxel values for x,y,z and image intensity. > I already have read the textfile into VTK with the vtkDelimitedTextReader > class: > >> >> >> > > >> >> >> > Table loaded from CSV file: > >> >> >> > +-----------+-----------+-----------+------------+ > >> >> >> > | Field 0 | Field 1 | Field 2 | Field 3 | > >> >> >> > +-----------+-----------+-----------+------------+ > >> >> >> > | 510 | 291 | 0 | 32 | > >> >> >> > | 511 | 291 | 0 | 128 | > >> >> >> > | 510 | 292 | 0 | 104 | > >> >> >> > | 511 | 292 | 0 | 104 | > >> >> >> > | 510 | 293 | 0 | 40 | > >> >> >> > | 511 | 293 | 0 | 240 | > >> >> >> > | 510 | 294 | 0 | 104 | > >> >> >> > | 511 | 294 | 0 | 96 | > >> >> >> > | 506 | 295 | 0 | 64 | > >> >> >> > | 507 | 295 | 0 | 16 | > >> >> >> > ..... > >> >> >> > ..... > >> >> >> > The file is an exported segmented dataset. > >> >> >> > > >> >> >> > I am following the tips from this similar question > http://vtk.1045678.n5.nabble.com/importing-image-data-into- > VTK-from-textfile-mimics-td1243332.html > >> >> >> > I have created an appropriate vtkimagedata (volume): > >> >> >> > > >> >> >> > imageData = vtk.vtkImageData() > >> >> >> > imageData.SetDimensions(512, 512, 192) > >> >> >> > imageData.SetOrigin(0.0, 0.0, 0.0) > >> >> >> > imageData.SetSpacing(1, 1, 1) > >> >> >> > imageData.SetNumberOfScalarComponents(1) > >> >> >> > imageData.Update() > >> >> >> > > >> >> >> > However I don't know how to copy the data loaded from > vtkDelimitedTextReader into vtkImageData. How do I copy the x,y,z voxel > values into vtkImageData? How do I copy the intensity valuesVtkImageData? > >> >> >> > > >> >> >> > Any help provided for this would be greatly appreciated! > >> >> >> > > >> >> >> > Lizeth > >> >> >> > > >> >> >> > > >> >> >> > _______________________________________________ > >> >> >> > Powered by www.kitware.com > >> >> >> > > >> >> >> > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > >> >> >> > > >> >> >> > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > >> >> >> > > >> >> >> > Search the list archives at: http://markmail.org/search/?q= > vtkusers > >> >> >> > > >> >> >> > Follow this link to subscribe/unsubscribe: > >> >> >> > https://public.kitware.com/mailman/listinfo/vtkusers > >> >> > > >> >> > > >> >> > > >> >> > > >> >> > -- > >> >> > > >> >> > > >> >> > > >> > > >> > > >> > > >> > > >> > -- > >> > > >> > > >> > > > > > > > > > > > -- > > Lizeth Castellanos. > > PhD Student > > Federal University of Rio Grande do Sul (UFRGS) > > > > > -- Lizeth Castellanos. PhD Student Federal University of Rio Grande do Sul (UFRGS) -------------- next part -------------- An HTML attachment was scrubbed... URL: From rccm.kyoshimi at gmail.com Wed Aug 1 20:26:56 2018 From: rccm.kyoshimi at gmail.com (kenichiro yoshimi) Date: Thu, 2 Aug 2018 09:26:56 +0900 Subject: [vtkusers] Can't install VTK from pip In-Reply-To: References: Message-ID: Hi, It seems that a wheel package for python 2.7 on Windows is not available. https://pypi.org/project/vtk/8.1.0/#files Regards 2018?8?1?(?) 17:52 Yansi Yao : > > Hi all, > I use the following command to install vtk: > > pip install vtk > > But it complains the following message: > > Collecting vtk > Could not find a version that satisfies the requirement vtk (from versions: ) > No matching distribution found for vtk > > My pip can find vtk: > > \>pip search *vtk* > vtk (8.1.1) - VTK is an open-source toolkit for 3D computer > graphics, image processing, and visualization > ... > > > My system is Win7, and my pip is the latest version: > > \>python -m pip install -U pip > Requirement already up-to-date: pip in c:\python27\lib\site-packages (18.0) > > > Could anyone tell me how to solve this problem? > > Cheers > Yansi > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers From rccm.kyoshimi at gmail.com Wed Aug 1 21:20:09 2018 From: rccm.kyoshimi at gmail.com (kenichiro yoshimi) Date: Thu, 2 Aug 2018 10:20:09 +0900 Subject: [vtkusers] Copy image data into vtkImageData from a textfile In-Reply-To: References: Message-ID: Hi, Thanks for trying. Could you confirm if out.vti is visualized properly using ParaView's volume rendering? Regards 2018?8?2?(?) 6:12 Lizeth Castellanos : > > Hi, > > I got VTK 7.1.1 in my computer, finally! So, I have tested the two solutions that you have suggested: > 1) using vtkProbeFilter > 2) using vtkResampleToImage > > 1) I have adjusted the image dimensions according to my own data and I am using vtkSmartVolumeMapper, instead of vtkVolumeRaycastMapper. > No errors are generated in the terminal. However, I have been waiting for several minutes and nothing happens. > Do you have any idea what is wrong? > > > csvfile="directory path to my csv file/sample.csv" > > reader = vtk.vtkDelimitedTextReader() > reader.SetFieldDelimiterCharacters(" ") > reader.DetectNumericColumnsOn() > reader.SetFileName(csvfile) > reader.MergeConsecutiveDelimitersOn() > reader.Update() > > tableToPoints = vtk.vtkTableToPolyData() > tableToPoints.SetInputConnection(reader.GetOutputPort()) > tableToPoints.SetXColumn('Field 0') > tableToPoints.SetYColumn('Field 1') > tableToPoints.SetZColumn('Field 2') > > imageData = vtk.vtkImageData() > imageData.SetDimensions(512, 512, 192) > imageData.SetOrigin(0.0, 0.0, 0.0) > imageData.SetSpacing(1.0, 1.0, 1.0) > > probeFilter = vtk.vtkProbeFilter() > probeFilter.SetSourceConnection(tableToPoints.GetOutputPort()) > probeFilter.SetInputData(imageData) > probeFilter.Update() > > writer = vtk.vtkXMLImageDataWriter() > writer.SetInputData(probeFilter.GetOutput()) > writer.SetFileName('out.vti') > writer.Write() > > probeFilter.GetOutput().GetPointData().SetActiveScalars('Field 3') > range = probeFilter.GetOutput().GetPointData().GetScalars().GetRange() > > colors = vtk.vtkNamedColors() > > # Create the standard renderer, render window > # and interactor. > ren = vtk.vtkRenderer() > > renWin = vtk.vtkRenderWindow() > renWin.AddRenderer(ren) > > iren = vtk.vtkRenderWindowInteractor() > iren.SetRenderWindow(renWin) > > # Create transfer mapping scalar value to opacity. > opacityTransferFunction = vtk.vtkPiecewiseFunction() > opacityTransferFunction.AddPoint(range[0], 0.0) > opacityTransferFunction.AddPoint(range[1], 1.0) > > # Create transfer mapping scalar value to color. > colorTransferFunction = vtk.vtkColorTransferFunction() > colorTransferFunction.AddRGBPoint(range[0], 0.0, 0.0, 1.0) > colorTransferFunction.AddRGBPoint((range[0]+range[1])*0.5, 0.0, 1.0, 0.0) > colorTransferFunction.AddRGBPoint(range[1], 1.0, 0.0, 0.0) > > # The property describes how the data will look. > volumeProperty = vtk.vtkVolumeProperty() > volumeProperty.SetColor(colorTransferFunction) > volumeProperty.SetScalarOpacity(opacityTransferFunction) > volumeProperty.SetScalarOpacityUnitDistance(1.73205080757) > volumeProperty.SetInterpolationTypeToLinear() > > # The mapper / ray cast function know how to render the data. > volumeMapper = vtk.vtkSmartVolumeMapper() > volumeMapper.SetInputConnection(probeFilter.GetOutputPort()) > volumeMapper.SetBlendModeToComposite() > > # The volume holds the mapper and the property and > # can be used to position/orient the volume. > volume = vtk.vtkVolume() > volume.SetMapper(volumeMapper) > volume.SetProperty(volumeProperty) > > ren.AddVolume(volume) > > ren.SetBackground(colors.GetColor3d("White")) > ren.GetActiveCamera().ParallelProjectionOn() > ren.ResetCameraClippingRange() > ren.ResetCamera() > > renWin.SetSize(600, 600) > renWin.Render() > iren.Start() > > > 2) I have tested the vtkResampleToImage class, (the solution that you suggest at the beginning of this thread). However, I get a solid a cube as output. > Do you have any idea why that happens? > > csvfile="directory path to my csv file/sample.csv" > > reader = vtk.vtkDelimitedTextReader() > reader.SetFieldDelimiterCharacters(" ") > reader.DetectNumericColumnsOn() > reader.SetFileName(csvfile) > reader.MergeConsecutiveDelimitersOn() > reader.Update() > > tableToPoints = vtk.vtkTableToPolyData() > tableToPoints.SetInputConnection(reader.GetOutputPort()) > tableToPoints.SetXColumn("Field 0") > tableToPoints.SetYColumn("Field 1") > tableToPoints.SetZColumn("Field 2") > tableToPoints.Update() > > resample = vtk.vtkResampleToImage() > resample.SetInputConnection(tableToPoints.GetOutputPort()) > resample.SetSamplingDimensions(3, 3, 3) > resample. From pbergeron at spiria.com Wed Aug 1 23:30:32 2018 From: pbergeron at spiria.com (Patrick Bergeron) Date: Thu, 2 Aug 2018 03:30:32 +0000 Subject: [vtkusers] point picking through vtkboxwidget In-Reply-To: References: , Message-ID: <87B8A392-4B3D-47AA-8B77-F9ECF7DA2D41@spiria.com> Hi I believe he means Disable before calling pick and enable after calling pick without re-rendering the view Sent from my iPhone On Jul 31, 2018, at 19:14, Shady Nawara > wrote: I still kinda wanted it to be visible as I am mainly using it to show the boundary of the actor. On Tue, Jul 31, 2018 at 5:58 PM Oleksandr Malyushytsky > wrote: have you tried to disable it before picking ? SetEnabled(1) On Tue, Jul 31, 2018 at 1:12 PM, Shady Nawara > wrote: Hi, I have been trying to pick a point from an actor while the vtkBoxWidget is visible but it appears that it doesnt allow any interaction to go through to the underlying actor. Does anybody have a way around this. Thanks, Shady Nawara _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: https://public.kitware.com/mailman/listinfo/vtkusers _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: https://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From shandoosheri at gmail.com Wed Aug 1 23:34:46 2018 From: shandoosheri at gmail.com (Shady Nawara) Date: Wed, 1 Aug 2018 22:34:46 -0500 Subject: [vtkusers] point picking through vtkboxwidget In-Reply-To: <87B8A392-4B3D-47AA-8B77-F9ECF7DA2D41@spiria.com> References: <87B8A392-4B3D-47AA-8B77-F9ECF7DA2D41@spiria.com> Message-ID: Oh i never thought about Not rerendering the view. I will give it a try and see but, I guess it would be tricky because I have to add an actor in the place that got picked. On Wed, Aug 1, 2018 at 10:30 PM Patrick Bergeron wrote: > Hi > > I believe he means Disable before calling pick and enable after calling > pick without re-rendering the view > > Sent from my iPhone > > On Jul 31, 2018, at 19:14, Shady Nawara wrote: > > I still kinda wanted it to be visible as I am mainly using it to show the > boundary of the actor. > > On Tue, Jul 31, 2018 at 5:58 PM Oleksandr Malyushytsky < > omalyushytskyvtkuser at gmail.com> wrote: > >> have you tried to disable it before picking ? >> SetEnabled(1) >> >> On Tue, Jul 31, 2018 at 1:12 PM, Shady Nawara >> wrote: >> >>> Hi, >>> I have been trying to pick a point from an actor while the vtkBoxWidget >>> is visible but it appears that it doesnt allow any interaction to go >>> through to the underlying actor. Does anybody have a way around this. >>> >>> Thanks, >>> Shady Nawara >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> https://public.kitware.com/mailman/listinfo/vtkusers >>> >>> >> _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shrikant at smiledevcorp.com Thu Aug 2 04:53:03 2018 From: shrikant at smiledevcorp.com (Shrikant Shete) Date: Thu, 2 Aug 2018 14:23:03 +0530 Subject: [vtkusers] VTK.js with Node Js Express server for server side work Message-ID: Dear Team, I am new to VTK.js and I am referring to ES6 example. I would like go further and process some data and finally save to cloud. So I am looking to add server like express for my server side code. Is this possible? Can you please provide some insight or redirect to some example? Sent from my iPhone From shayan.moradkhani at gmail.com Thu Aug 2 05:01:48 2018 From: shayan.moradkhani at gmail.com (shayan moradkhani) Date: Thu, 2 Aug 2018 02:01:48 -0700 (MST) Subject: [vtkusers] SetCenter for loaded obj models In-Reply-To: <1533140800719-0.post@n5.nabble.com> References: <1533140800719-0.post@n5.nabble.com> Message-ID: <1533200508142-0.post@n5.nabble.com> is there anyone who has used setCenter method for loaded obj models? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From sebastien.jourdain at kitware.com Thu Aug 2 11:22:36 2018 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Thu, 2 Aug 2018 09:22:36 -0600 Subject: [vtkusers] VTK.js with Node Js Express server for server side work In-Reply-To: References: Message-ID: The processing part of vtk,js remain limited as of today. Otherwise, vtk.js does not make any assumption regarding the server since it only involve a browser. Therefore, what ever server side technology you decide to use will be fine from the point of view of vtk.js. On Thu, Aug 2, 2018 at 3:01 AM Shrikant Shete wrote: > Dear Team, > > I am new to VTK.js and I am referring to ES6 example. I would like go > further and process some data and finally save to cloud. So I am looking to > add server like express for my server side code. Is this possible? Can you > please provide some insight or redirect to some example? > > Sent from my iPhone > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From omalyushytskyvtkuser at gmail.com Thu Aug 2 15:01:35 2018 From: omalyushytskyvtkuser at gmail.com (Oleksandr Malyushytsky) Date: Thu, 2 Aug 2018 12:01:35 -0700 Subject: [vtkusers] point picking through vtkboxwidget In-Reply-To: References: <87B8A392-4B3D-47AA-8B77-F9ECF7DA2D41@spiria.com> Message-ID: I am not sure about your workflow, but picking operation should not require re-rendering. Right before picking position disable, right after enable boxwidget, then add what you want, render, etc. On Wed, Aug 1, 2018 at 8:34 PM, Shady Nawara wrote: > Oh i never thought about Not rerendering the view. I will give it a try > and see but, I guess it would be tricky because I have to add an actor in > the place that got picked. > > On Wed, Aug 1, 2018 at 10:30 PM Patrick Bergeron > wrote: > >> Hi >> >> I believe he means Disable before calling pick and enable after calling >> pick without re-rendering the view >> >> Sent from my iPhone >> >> On Jul 31, 2018, at 19:14, Shady Nawara wrote: >> >> I still kinda wanted it to be visible as I am mainly using it to show the >> boundary of the actor. >> >> On Tue, Jul 31, 2018 at 5:58 PM Oleksandr Malyushytsky < >> omalyushytskyvtkuser at gmail.com> wrote: >> >>> have you tried to disable it before picking ? >>> SetEnabled(1) >>> >>> On Tue, Jul 31, 2018 at 1:12 PM, Shady Nawara >>> wrote: >>> >>>> Hi, >>>> I have been trying to pick a point from an actor while the vtkBoxWidget >>>> is visible but it appears that it doesnt allow any interaction to go >>>> through to the underlying actor. Does anybody have a way around this. >>>> >>>> Thanks, >>>> Shady Nawara >>>> >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at http://www.kitware.com/ >>>> opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ at: >>>> http://www.vtk.org/Wiki/VTK_FAQ >>>> >>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> https://public.kitware.com/mailman/listinfo/vtkusers >>>> >>>> >>> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at http://www.kitware.com/ >> opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> https://public.kitware.com/mailman/listinfo/vtkusers >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From castellanoslizan at gmail.com Thu Aug 2 15:50:17 2018 From: castellanoslizan at gmail.com (Lizeth Castellanos) Date: Thu, 2 Aug 2018 16:50:17 -0300 Subject: [vtkusers] Copy image data into vtkImageData from a textfile In-Reply-To: References: Message-ID: Hi, Thanks for help me. I have confirmed the out.vti using Paraview's volume rendering. I don't know what is wrong, I get a solid cube again :-( I am attaching a screenshot. Could you see, please? Thanks Lizeth On Wed, Aug 1, 2018 at 10:20 PM, kenichiro yoshimi wrote: > Hi, > > Thanks for trying. > Could you confirm if out.vti is visualized properly using ParaView's > volume rendering? > > Regards > 2018?8?2?(?) 6:12 Lizeth Castellanos : > > > > Hi, > > > > I got VTK 7.1.1 in my computer, finally! So, I have tested the two > solutions that you have suggested: > > 1) using vtkProbeFilter > > 2) using vtkResampleToImage > > > > 1) I have adjusted the image dimensions according to my own data and I > am using vtkSmartVolumeMapper, instead of vtkVolumeRaycastMapper. > > No errors are generated in the terminal. However, I have been waiting > for several minutes and nothing happens. > > Do you have any idea what is wrong? > > > > > > csvfile="directory path to my csv file/sample.csv" > > > > reader = vtk.vtkDelimitedTextReader() > > reader.SetFieldDelimiterCharacters(" ") > > reader.DetectNumericColumnsOn() > > reader.SetFileName(csvfile) > > reader.MergeConsecutiveDelimitersOn() > > reader.Update() > > > > tableToPoints = vtk.vtkTableToPolyData() > > tableToPoints.SetInputConnection(reader.GetOutputPort()) > > tableToPoints.SetXColumn('Field 0') > > tableToPoints.SetYColumn('Field 1') > > tableToPoints.SetZColumn('Field 2') > > > > imageData = vtk.vtkImageData() > > imageData.SetDimensions(512, 512, 192) > > imageData.SetOrigin(0.0, 0.0, 0.0) > > imageData.SetSpacing(1.0, 1.0, 1.0) > > > > probeFilter = vtk.vtkProbeFilter() > > probeFilter.SetSourceConnection(tableToPoints.GetOutputPort()) > > probeFilter.SetInputData(imageData) > > probeFilter.Update() > > > > writer = vtk.vtkXMLImageDataWriter() > > writer.SetInputData(probeFilter.GetOutput()) > > writer.SetFileName('out.vti') > > writer.Write() > > > > probeFilter.GetOutput().GetPointData().SetActiveScalars('Field 3') > > range = probeFilter.GetOutput().GetPointData().GetScalars().GetRange() > > > > colors = vtk.vtkNamedColors() > > > > # Create the standard renderer, render window > > # and interactor. > > ren = vtk.vtkRenderer() > > > > renWin = vtk.vtkRenderWindow() > > renWin.AddRenderer(ren) > > > > iren = vtk.vtkRenderWindowInteractor() > > iren.SetRenderWindow(renWin) > > > > # Create transfer mapping scalar value to opacity. > > opacityTransferFunction = vtk.vtkPiecewiseFunction() > > opacityTransferFunction.AddPoint(range[0], 0.0) > > opacityTransferFunction.AddPoint(range[1], 1.0) > > > > # Create transfer mapping scalar value to color. > > colorTransferFunction = vtk.vtkColorTransferFunction() > > colorTransferFunction.AddRGBPoint(range[0], 0.0, 0.0, 1.0) > > colorTransferFunction.AddRGBPoint((range[0]+range[1])*0.5, 0.0, 1.0, > 0.0) > > colorTransferFunction.AddRGBPoint(range[1], 1.0, 0.0, 0.0) > > > > # The property describes how the data will look. > > volumeProperty = vtk.vtkVolumeProperty() > > volumeProperty.SetColor(colorTransferFunction) > > volumeProperty.SetScalarOpacity(opacityTransferFunction) > > volumeProperty.SetScalarOpacityUnitDistance(1.73205080757) > > volumeProperty.SetInterpolationTypeToLinear() > > > > # The mapper / ray cast function know how to render the data. > > volumeMapper = vtk.vtkSmartVolumeMapper() > > volumeMapper.SetInputConnection(probeFilter.GetOutputPort()) > > volumeMapper.SetBlendModeToComposite() > > > > # The volume holds the mapper and the property and > > # can be used to position/orient the volume. > > volume = vtk.vtkVolume() > > volume.SetMapper(volumeMapper) > > volume.SetProperty(volumeProperty) > > > > ren.AddVolume(volume) > > > > ren.SetBackground(colors.GetColor3d("White")) > > ren.GetActiveCamera().ParallelProjectionOn() > > ren.ResetCameraClippingRange() > > ren.ResetCamera() > > > > renWin.SetSize(600, 600) > > renWin.Render() > > iren.Start() > > > > > > 2) I have tested the vtkResampleToImage class, (the solution that you > suggest at the beginning of this thread). However, I get a solid a cube as > output. > > Do you have any idea why that happens? > > > > csvfile="directory path to my csv file/sample.csv" > > > > reader = vtk.vtkDelimitedTextReader() > > reader.SetFieldDelimiterCharacters(" ") > > reader.DetectNumericColumnsOn() > > reader.SetFileName(csvfile) > > reader.MergeConsecutiveDelimitersOn() > > reader.Update() > > > > tableToPoints = vtk.vtkTableToPolyData() > > tableToPoints.SetInputConnection(reader.GetOutputPort()) > > tableToPoints.SetXColumn("Field 0") > > tableToPoints.SetYColumn("Field 1") > > tableToPoints.SetZColumn("Field 2") > > tableToPoints.Update() > > > > resample = vtk.vtkResampleToImage() > > resample.SetInputConnection(tableToPoints.GetOutputPort()) > > resample.SetSamplingDimensions(3, 3, 3) > > resample. > -- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: paraviewOut-vit.png Type: image/png Size: 321661 bytes Desc: not available URL: From rccm.kyoshimi at gmail.com Thu Aug 2 16:59:56 2018 From: rccm.kyoshimi at gmail.com (kenichiro yoshimi) Date: Fri, 3 Aug 2018 05:59:56 +0900 Subject: [vtkusers] Copy image data into vtkImageData from a textfile In-Reply-To: References: Message-ID: Hello, Did you set the dimensions based on your own data? It looks all dimensions indicate 3. Thanks 2018?8?3?(?) 4:50 Lizeth Castellanos : > Hi, > > Thanks for help me. > I have confirmed the out.vti using Paraview's volume rendering. I don't > know what is wrong, I get a solid cube again :-( > I am attaching a screenshot. Could you see, please? > > Thanks > Lizeth > > On Wed, Aug 1, 2018 at 10:20 PM, kenichiro yoshimi < > rccm.kyoshimi at gmail.com> wrote: > >> Hi, >> >> Thanks for trying. >> Could you confirm if out.vti is visualized properly using ParaView's >> volume rendering? >> >> Regards >> 2018?8?2?(?) 6:12 Lizeth Castellanos : >> > >> > Hi, >> > >> > I got VTK 7.1.1 in my computer, finally! So, I have tested the two >> solutions that you have suggested: >> > 1) using vtkProbeFilter >> > 2) using vtkResampleToImage >> > >> > 1) I have adjusted the image dimensions according to my own data and I >> am using vtkSmartVolumeMapper, instead of vtkVolumeRaycastMapper. >> > No errors are generated in the terminal. However, I have been waiting >> for several minutes and nothing happens. >> > Do you have any idea what is wrong? >> > >> > >> > csvfile="directory path to my csv file/sample.csv" >> > >> > reader = vtk.vtkDelimitedTextReader() >> > reader.SetFieldDelimiterCharacters(" ") >> > reader.DetectNumericColumnsOn() >> > reader.SetFileName(csvfile) >> > reader.MergeConsecutiveDelimitersOn() >> > reader.Update() >> > >> > tableToPoints = vtk.vtkTableToPolyData() >> > tableToPoints.SetInputConnection(reader.GetOutputPort()) >> > tableToPoints.SetXColumn('Field 0') >> > tableToPoints.SetYColumn('Field 1') >> > tableToPoints.SetZColumn('Field 2') >> > >> > imageData = vtk.vtkImageData() >> > imageData.SetDimensions(512, 512, 192) >> > imageData.SetOrigin(0.0, 0.0, 0.0) >> > imageData.SetSpacing(1.0, 1.0, 1.0) >> > >> > probeFilter = vtk.vtkProbeFilter() >> > probeFilter.SetSourceConnection(tableToPoints.GetOutputPort()) >> > probeFilter.SetInputData(imageData) >> > probeFilter.Update() >> > >> > writer = vtk.vtkXMLImageDataWriter() >> > writer.SetInputData(probeFilter.GetOutput()) >> > writer.SetFileName('out.vti') >> > writer.Write() >> > >> > probeFilter.GetOutput().GetPointData().SetActiveScalars('Field 3') >> > range = probeFilter.GetOutput().GetPointData().GetScalars().GetRange() >> > >> > colors = vtk.vtkNamedColors() >> > >> > # Create the standard renderer, render window >> > # and interactor. >> > ren = vtk.vtkRenderer() >> > >> > renWin = vtk.vtkRenderWindow() >> > renWin.AddRenderer(ren) >> > >> > iren = vtk.vtkRenderWindowInteractor() >> > iren.SetRenderWindow(renWin) >> > >> > # Create transfer mapping scalar value to opacity. >> > opacityTransferFunction = vtk.vtkPiecewiseFunction() >> > opacityTransferFunction.AddPoint(range[0], 0.0) >> > opacityTransferFunction.AddPoint(range[1], 1.0) >> > >> > # Create transfer mapping scalar value to color. >> > colorTransferFunction = vtk.vtkColorTransferFunction() >> > colorTransferFunction.AddRGBPoint(range[0], 0.0, 0.0, 1.0) >> > colorTransferFunction.AddRGBPoint((range[0]+range[1])*0.5, 0.0, 1.0, >> 0.0) >> > colorTransferFunction.AddRGBPoint(range[1], 1.0, 0.0, 0.0) >> > >> > # The property describes how the data will look. >> > volumeProperty = vtk.vtkVolumeProperty() >> > volumeProperty.SetColor(colorTransferFunction) >> > volumeProperty.SetScalarOpacity(opacityTransferFunction) >> > volumeProperty.SetScalarOpacityUnitDistance(1.73205080757) >> > volumeProperty.SetInterpolationTypeToLinear() >> > >> > # The mapper / ray cast function know how to render the data. >> > volumeMapper = vtk.vtkSmartVolumeMapper() >> > volumeMapper.SetInputConnection(probeFilter.GetOutputPort()) >> > volumeMapper.SetBlendModeToComposite() >> > >> > # The volume holds the mapper and the property and >> > # can be used to position/orient the volume. >> > volume = vtk.vtkVolume() >> > volume.SetMapper(volumeMapper) >> > volume.SetProperty(volumeProperty) >> > >> > ren.AddVolume(volume) >> > >> > ren.SetBackground(colors.GetColor3d("White")) >> > ren.GetActiveCamera().ParallelProjectionOn() >> > ren.ResetCameraClippingRange() >> > ren.ResetCamera() >> > >> > renWin.SetSize(600, 600) >> > renWin.Render() >> > iren.Start() >> > >> > >> > 2) I have tested the vtkResampleToImage class, (the solution that you >> suggest at the beginning of this thread). However, I get a solid a cube as >> output. >> > Do you have any idea why that happens? >> > >> > csvfile="directory path to my csv file/sample.csv" >> > >> > reader = vtk.vtkDelimitedTextReader() >> > reader.SetFieldDelimiterCharacters(" ") >> > reader.DetectNumericColumnsOn() >> > reader.SetFileName(csvfile) >> > reader.MergeConsecutiveDelimitersOn() >> > reader.Update() >> > >> > tableToPoints = vtk.vtkTableToPolyData() >> > tableToPoints.SetInputConnection(reader.GetOutputPort()) >> > tableToPoints.SetXColumn("Field 0") >> > tableToPoints.SetYColumn("Field 1") >> > tableToPoints.SetZColumn("Field 2") >> > tableToPoints.Update() >> > >> > resample = vtk.vtkResampleToImage() >> > resample.SetInputConnection(tableToPoints.GetOutputPort()) >> > resample.SetSamplingDimensions(3, 3, 3) >> > resample. >> > > > > -- > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.hedges at lickenbrocktech.com Thu Aug 2 18:01:02 2018 From: robert.hedges at lickenbrocktech.com (robert.hedges at lickenbrocktech.com) Date: Thu, 02 Aug 2018 15:01:02 -0700 Subject: [vtkusers] vtkFFMPEGWriter.cxx fails to build in CentOS 7 Message-ID: <20180802150102.e8a0b42edd196f3ea490d37867d907e3.a5787600e4.mailapi@email09.godaddy.com> When compiling VTK with cmake -DVTK_QT_VERSION:STRING=5 \ -DQT_QMAKE_EXECUTABLE:PATH=$QT_PATH/bin/qmake \ -DVTK_Group_Qt:BOOL=ON \ -DCMAKE_PREFIX_PATH:PATH=$QT_PATH/lib/cmake \ -DBUILD_SHARED_LIBS:BOOL=ON \ -DCMAKE_INSTALL_PREFIX=/opt/lbt/vtk-8.1 \ -DModule_vtkIOFFMPEG:BOOL=ON \ ../ I have tried various version of FFMPEG and vtk (8.1, 8.1.1 and git latest) but consistently get this error. I have also tried the old version of ffmpeg on the VTK web site. /mnt/ubuntu/home/rhedges/repos/VTK-8.1/IO/FFMPEG/vtkFFMPEGWriter.cxx: In member function 'int vtkFFMPEGWriterInternal::Start()': /mnt/ubuntu/home/rhedges/repos/VTK-8.1/IO/FFMPEG/vtkFFMPEGWriter.cxx:192:29: error: expected type-specifier before 'CodecID' c->codec_id = static_cast(this->avOutputFormat->video_codec); ^ /mnt/ubuntu/home/rhedges/repos/VTK-8.1/IO/FFMPEG/vtkFFMPEGWriter.cxx:192:29: error: expected '>' before 'CodecID' /mnt/ubuntu/home/rhedges/repos/VTK-8.1/IO/FFMPEG/vtkFFMPEGWriter.cxx:192:29: error: expected '(' before 'CodecID' /mnt/ubuntu/home/rhedges/repos/VTK-8.1/IO/FFMPEG/vtkFFMPEGWriter.cxx:192:29: error: 'CodecID' was not declared in this scope /mnt/ubuntu/home/rhedges/repos/VTK-8.1/IO/FFMPEG/vtkFFMPEGWriter.cxx:192:72: error: expected ')' before ';' token c->codec_id = static_cast(this->avOutputFormat->video_codec); ^ make[2]: *** [IO/FFMPEG/CMakeFiles/vtkIOFFMPEG.dir/vtkFFMPEGWriter.cxx.o] Error 1 make[1]: *** [IO/FFMPEG/CMakeFiles/vtkIOFFMPEG.dir/all] Error 2 make: *** [all] Error 2 -------------- next part -------------- An HTML attachment was scrubbed... URL: From marvin.huber at basf.com Fri Aug 3 07:26:19 2018 From: marvin.huber at basf.com (marf) Date: Fri, 3 Aug 2018 04:26:19 -0700 (MST) Subject: [vtkusers] Color mapping In-Reply-To: <1533097662722-0.post@n5.nabble.com> References: <1533097662722-0.post@n5.nabble.com> Message-ID: <1533295579067-0.post@n5.nabble.com> Hi, I did something like that recently in VTKjs, the main idea is, that you apply your data about what heat you have on which point as a scalar, then you pick this as an active scalar. >From this, you create a Lookuptable and apply it to your mapper. Sorry for the rather vague explanation, I'm fairly new to vtk myself. See below my javascript code to create a lookuptable, maybe it can help you. Also I figured this out by looking at these https://www.vtk.org/pipermail/vtkusers/2012-February/072230.html https://www.vtk.org/Wiki/VTK/Examples/Cxx/Meshes/Color_a_mesh_by_height const lookup = vtk.Common.Core.vtkLookupTable.newInstance(); lookup.setHueRange(0.667, 0.0); // this.reader.getOutputData() returns a Polydata object for me this.reader.getOutputData().getPointData().setActiveScalars(this.activeScalar + '_scalar'); let upper = this.reader.getOutputData().getPointData().getScalars().getRange()[1]; let lower = this.reader.getOutputData().getPointData().getScalars().getRange()[0]; lookup.setRange(lower, upper); lookup.build(); this.mapper.setLookupTable(lookup); this.mapper.setUseLookupTableScalarRange(lookup); this.renderWindow.render(); -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From pbergeron at spiria.com Fri Aug 3 09:52:22 2018 From: pbergeron at spiria.com (Patrick Bergeron) Date: Fri, 3 Aug 2018 13:52:22 +0000 Subject: [vtkusers] Any of you guys going to siggraph 2018 in vancouver? Message-ID: Just wondering. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.ostroot at lickenbrocktech.com Fri Aug 3 10:01:18 2018 From: mark.ostroot at lickenbrocktech.com (mark.ostroot at lickenbrocktech.com) Date: Fri, 03 Aug 2018 07:01:18 -0700 Subject: [vtkusers] Multi-Volume Rendering Message-ID: <20180803070118.c7db654a879d86b78cfcacc46040d57b.40da5acc1c.mailapi@email09.godaddy.com> Hello, I am interested in improving the multi volume rendering library. Specifically Adding in the hooks for set desired update rate to work with the multi volume rendering approach. I was hoping that someone at VTK could point me towards the right direction, or potentially supply some information on the multi-rendering scheme. Thanks in advance, -Mark O -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.maynard at kitware.com Fri Aug 3 14:39:03 2018 From: robert.maynard at kitware.com (Robert Maynard) Date: Fri, 3 Aug 2018 14:39:03 -0400 Subject: [vtkusers] vtkFFMPEGWriter.cxx fails to build in CentOS 7 In-Reply-To: <20180802150102.e8a0b42edd196f3ea490d37867d907e3.a5787600e4.mailapi@email09.godaddy.com> References: <20180802150102.e8a0b42edd196f3ea490d37867d907e3.a5787600e4.mailapi@email09.godaddy.com> Message-ID: The ParaView superbuild has an option for FFMPEG and it uses this version: https://www.paraview.org/files/dependencies/ffmpeg-2.3.3.tar.bz2 I would start with seeing if you can get that to build. You can find what options we build ffmpeg with at: https://gitlab.kitware.com/paraview/common-superbuild/blob/master/projects/apple-unix/ffmpeg.cmake On Thu, Aug 2, 2018 at 6:09 PM wrote: > > > When compiling VTK with > > cmake -DVTK_QT_VERSION:STRING=5 \ > -DQT_QMAKE_EXECUTABLE:PATH=$QT_PATH/bin/qmake \ > -DVTK_Group_Qt:BOOL=ON \ > -DCMAKE_PREFIX_PATH:PATH=$QT_PATH/lib/cmake \ > -DBUILD_SHARED_LIBS:BOOL=ON \ > -DCMAKE_INSTALL_PREFIX=/opt/lbt/vtk-8.1 \ > -DModule_vtkIOFFMPEG:BOOL=ON \ > ../ > > > I have tried various version of FFMPEG and vtk (8.1, 8.1.1 and git latest) but consistently get this error. I have also tried the old version of ffmpeg on the VTK web site. > > > > > /mnt/ubuntu/home/rhedges/repos/VTK-8.1/IO/FFMPEG/vtkFFMPEGWriter.cxx: In member function ?int vtkFFMPEGWriterInternal::Start()?: > /mnt/ubuntu/home/rhedges/repos/VTK-8.1/IO/FFMPEG/vtkFFMPEGWriter.cxx:192:29: error: expected type-specifier before ?CodecID? > c->codec_id = static_cast(this->avOutputFormat->video_codec); > ^ > /mnt/ubuntu/home/rhedges/repos/VTK-8.1/IO/FFMPEG/vtkFFMPEGWriter.cxx:192:29: error: expected ?>? before ?CodecID? > /mnt/ubuntu/home/rhedges/repos/VTK-8.1/IO/FFMPEG/vtkFFMPEGWriter.cxx:192:29: error: expected ?(? before ?CodecID? > /mnt/ubuntu/home/rhedges/repos/VTK-8.1/IO/FFMPEG/vtkFFMPEGWriter.cxx:192:29: error: ?CodecID? was not declared in this scope > /mnt/ubuntu/home/rhedges/repos/VTK-8.1/IO/FFMPEG/vtkFFMPEGWriter.cxx:192:72: error: expected ?)? before ?;? token > c->codec_id = static_cast(this->avOutputFormat->video_codec); > ^ > make[2]: *** [IO/FFMPEG/CMakeFiles/vtkIOFFMPEG.dir/vtkFFMPEGWriter.cxx.o] Error 1 > make[1]: *** [IO/FFMPEG/CMakeFiles/vtkIOFFMPEG.dir/all] Error 2 > make: *** [all] Error 2 > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers From rccm.kyoshimi at gmail.com Fri Aug 3 23:59:12 2018 From: rccm.kyoshimi at gmail.com (kenichiro yoshimi) Date: Sat, 4 Aug 2018 12:59:12 +0900 Subject: [vtkusers] Displaying ITK image via VTK viewer on Qt GUI In-Reply-To: References: Message-ID: Hi, You try to turn DebugOn to display some useful information. vtkImage->DebugOn(); Additionally you may want to use QVTKOpenGLWidget instead of QvtkWidget, because QVTKWidget is deprecated for VTK 8.1 and will be removed in a future version. Regards 2018?8?1?(?) 1:23 Arefin Shamsil : > > Hello there Awesome VTK community, > > I have been trying to make a Qt app work for a few days with no success. The screenshot of the app is attached in this email. In this app (please look at the screenshot), the user will first select a directory. Once the directory is loaded, the user will click the "Feed a Dataset" button. It will then trigger an ITK function to read a file and execute a simple VTK function to display a 2D ultrasound image on the designated window. When the button is clicked again, the window should clear off and display the next image. That's is for now. > > The ultimate purpose of this application is to visualize incremental volume reconstruction from an already recorded tracked series of ultrasound images by providing an image one at a time. This has been done in many ways before. Nothing really new. > > The app runs fine and I am able to select a directory. THE PROBLEM is when I click the "Feed a Dataset" button, nothing displays on the window, the app freezes and then closes. I tried many ways but cannot really figure out why this is happening. The Ultrasound window is an object of class QVTKWidget. And the VTK function I am calling from inside the button's slot function is as follows. > void USImageViewer::viewonUSwindow(ImageType2D::Pointer usImage){ > // setup and connect itk with vtk > vtkConnectorType::Pointer connector = vtkConnectorType::New(); > connector->SetInput(tacImage); > connector->Update(); // seems to be ok until here > > // Convert to vtk image > vtkImage = vtkSmartPointer::New(); > vtkImage->DeepCopy(connector->GetOutput()); // hangs during executing this line, indicating something is wrong with the connector > // Image actor > tacIMactor = vtkSmartPointer::New(); > tacIMactor->GetMapper()->SetInputData(vtkImage); > renderer = vtkSmartPointer::New(); > renderer->AddActor(tacIMactor); > renderer->ResetCamera(); > > ui->usImQVTKviewer->GetRenderWindow()->AddRenderer(renderer); > ui->usImQVTKviewer->update(); > } > > Can anyone please help me out in this? Your help is much appreciated. > > Sincerely > Shams > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers From f_u_7 at yahoo.com Sun Aug 5 09:07:57 2018 From: f_u_7 at yahoo.com (lucky) Date: Sun, 5 Aug 2018 06:07:57 -0700 (MST) Subject: [vtkusers] How to get progress from vtkImageReader2? Message-ID: <1533474477047-0.post@n5.nabble.com> I am using vtkImageReader2 to read the *.raw and *.vol volume data. I am trying to get the progress of reading data using this vtk example https://www.vtk.org/Wiki/VTK/Examples/Cxx/Developers/ProgressReport , but it's not working. Any suggestion? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From mathieu.westphal at kitware.com Mon Aug 6 05:02:48 2018 From: mathieu.westphal at kitware.com (Mathieu Westphal) Date: Mon, 6 Aug 2018 11:02:48 +0200 Subject: [vtkusers] Using QVTKOpenGLWidget in QGraphics view and replacement for deprecated QVTKGraphicsItem In-Reply-To: References: Message-ID: Hi Alex, There is no plan that I know of. Contribution are welcome though. Best, Mathieu Westphal On Wed, Aug 1, 2018 at 12:48 AM, Oleksandr Malyushytsky < omalyushytskyvtkuser at gmail.com> wrote: > QVTKWidget and QVTKWidget2 are deprecated due to QGLWidget be deprecated > in Qt. > There is a replacement - QVTKOpenGLWidget which is subclassing > QOpenGLWidget. > > But it seems there is no real support for using vtk in QGraphicsScene. > Using QVTKOpenGLWidget as a background for QGraphicsScene is relatively > simple. > > But QVTKGraphicsItem is still derived from QVTKWidget and is using > QGLContext (depricated). > > Are there plans or example of QVTKGraphicsItem equivalent > ("QVTKOpenGLGraphicsItem) ? > > Best regards, > Alex > > > > > > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From epd at ilight.com Mon Aug 6 09:50:59 2018 From: epd at ilight.com (Earl Duque) Date: Mon, 6 Aug 2018 06:50:59 -0700 Subject: [vtkusers] Reminder: Call for Papers/Participation: ISAV 2018: In Situ Infrastructures for Enabling Extreme-scale Analysis and Visualization Message-ID: <07d501d42d8c$82cbe960$8863bc20$@ilight.com> ISAV 2018: In Situ Infrastructures for Enabling Extreme-Scale Analysis and Visualization Held in conjunction with SC18: The International Conference on High Performance Computing, Networking, Storage and Analysis, Dallas, Texas, U.S.A. ISAV 2018 -- http://dav.lbl.gov/events/ISAV2018/ Full-day 9:00 AM - 5:30 PM Monday 12 Nov 2018 Workshop Theme The considerable interest in the HPC community regarding in situ analysis and visualization is due to several factors. First is an I/O cost savings, where data is analyzed/visualized while being generated, without first storing to a file system. Second is the potential for increased accuracy, where fine temporal sampling of transient analysis might expose some complex behavior missed in coarse temporal sampling. Third is the ability to use all available resources, CPUs and accelerators, in the computation of analysis products. The workshop brings together researchers, developers and practitioners from industry, academia, and government laboratories developing, applying, and deploying in situ methods in extreme-scale, high performance computing. The goal is to present research findings, lessons learned, and insights related to developing and applying in situ methods and infrastructure across a range of science and engineering applications in HPC environments; to discuss topics like opportunities presented by new architectures, existing infrastructure needs, requirements, and gaps, and experiences to foster and enable in situ analysis and visualization; to serve as a "center of gravity" for researchers, practitioners, and users/consumers of in situ methods and infrastructure in the HPC space. Participation/Call for Papers and Oral Presentations We invite two types of submissions to ISAV 2018: (1) short, 4-page papers that present research results, that identify opportunities or challenges, and that present case studies/best practices for in situ methods/infrastructure in the areas of data management, analysis and visualization; (2) lightning presentation submission, consisting of a 1- or 2-page submission, for a brief oral presentation at the workshop. Short papers will appear in the workshop proceedings and will be invited to give an oral presentation of 15 to 20 minutes; lightning round submissions that are invited to present at the workshop will have author names and titles included as part of the proceedings. Submissions of both types are welcome that fall within one or more areas of interest, as follows: Areas of interest for ISAV, include, but are not limited to: In situ infrastructures * Current Systems: production quality, research prototypes * Opportunities * Gaps System resources, hardware, and emerging architectures * Enabling Hardware * Hardware and architectures that provide opportunities for In situ processing, such as burst buffers, staging computations on I/O nodes, sharing cores within a node for both simulation and in situ processing Methods/algorithms/applications/Case studies * Best practices * Analysis: feature detection, statistical methods, temporal methods, geometric methods * Visualization: information visualization, scientific visualization, time-varying methods * Data reduction/compression * Examples/case studies of solving a specific science challenge with in situ methods/infrastructure. Simulation * Integration:data modeling, software-engineering * Resilience: error detection, fault recovery * Workflows for supporting complex in situ processing pipelines Requirements * Preserve important elements * Significantly reduce the data size * Flexibility for post-processing exploration Review Process All submissions will undergo a peer-review process consisting of three reviews by experts in the field, and evaluated according to relevance to the workshop theme, technical soundness, creativity, originality, and impactfulness of method/results. Lightning round submissions will be evaluated primarily for relevance to the workshop. Submission Process Authors are invited to submit papers of at most 4 pages in PDF format, excluding references, and lightning presentations of at most 2 pages in PDF format, excluding references. Papers must be submitted in PDF format (readable by Adobe Acrobat Reader 5.0 and higher) and formatted for 8.5" x 11" (U.S. Letter). A Latex template will be provided via the submission website, https://submissions.supercomputing.org, and via workshop website, http://dav.lbl.gov/events/ISAV2018/. We believe that reproducible science is essential, and that SC should be a leader in this effort. As a consequence ISAV 2018 participates in the SC reproducibility initiative and encourages submitters to include an appendix with reproducibility information. While we will not disqualify a paper based on information provided or not provided in this appendix, nor if the appendix is not available, the availability and quality of an appendix will be used in ranking a paper. For more information, see the ISAV 2018 reproducibility FAQ. Papers must be self-contained and provide the technical substance required for the program committee to evaluate their contributions. Submitted papers must be original work that has not appeared in and is not under consideration for another conference or a journal. See the ACM Prior Publication Policy for more details. Papers can be submitted at https://submissions.supercomputing.org. Publication in proceedings, presentation at the workshop All paper submissions that receive favorable reviews will be included as part of the workshop proceedings. Lightning round submission will not be included as part of the proceedings. Subject to the constraints of workshop length, some subset of the accepted publications will be invited to give a brief oral presentation at the workshop. The exact number of such presentations and their length will be determined after the review process has been completed. Timeline/Important Dates 10 August 2018 Abstract submission deadline 17 August 2018 Paper submission deadline 28 September 2018 Author notification 12 October 2018 Camera ready copy due 24 October 2018 Final program posted to ISAV web page 12 November 2018 ISAV 2018 workshop at SC18 Committees and Chairs * General chair: Matthew Wolf, Oak Ridge National Laboratory, USA * Program chair and co-chair: Kenneth Moreland, Sandia National Laboratory, USA; E. Wes Bethel, Lawrence Berkeley National Laboratory, USA * Publicity chair: Earl P.N. Duque, Intelligent Light, USA * Publications chair and co-chair: Nicola Ferrier, Argonne National Laboratory, USA; Silvio Rizzi, Argonne National Laboratory, USA * Early Career Program Committee Chair: E. Wes Bethel, Lawrence Berkeley National Laboratory, USA * At-large chair: Patrick O'Leary, Kitware, Inc., USA Organizing Committee * E. Wes Bethel, Lawrence Berkeley National Laboratory, USA * Earl P.N. Duque, Intelligent Light, USA * Nicola Ferrier, Argonne National Laboratory, USA * Patrick O'Leary, Kitware, Inc., USA * Gunther H. Weber, Lawrence Berkeley National Laboratory, USA * Matthew Wolf, Oak Ridge National Laboratory, USA Program Committee To be announced Early Career Program Committee To be announced /////////////////////////////////////////////////////////////////////////// Earl P.N. Duque, PhD Manager of Applied Research Intelligent Light 301 Route 17N - 7th Floor Rutherford, NJ 07070 PHN: (201) 460-4700 FAX: (201) 460-0221 EML: epd at ilight.com Advancing CFD, Advancing You Intelligent Light leads CFD with the most advanced products and services delivered by globally respected CFD and visualization practitioners. FieldView products and services give you better results sooner. We exist for the advancement of CFD - and you. Visit our website at http://www.ilight.com /////////////////////////////////////////////////////////////////////////// -------------- next part -------------- An HTML attachment was scrubbed... URL: From sergii.shynkaruk at atracsys.com Mon Aug 6 10:05:22 2018 From: sergii.shynkaruk at atracsys.com (sergii shynkaruk) Date: Mon, 6 Aug 2018 07:05:22 -0700 (MST) Subject: [vtkusers] how to avoid resize a sphere object when render window gets changed Message-ID: <1533564322393-0.post@n5.nabble.com> Hello everyone! I've just recently started using VTK and in my project I need to keep a sphere unchanged. I tried this example - https://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/Sphere. But when I resize a window, my sphere automatically resizes as well. Or if I set radius = SetRaduis(10) or SetRaduis(0.1), sphere appears with the same size, which I think is automatically adjusted with respect to main window size. Could you please suggest anything about it? Thanks in advance, Sergii -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From marvin.huber at basf.com Mon Aug 6 10:59:38 2018 From: marvin.huber at basf.com (marf) Date: Mon, 6 Aug 2018 07:59:38 -0700 (MST) Subject: [vtkusers] Overlapping triangles Message-ID: <1533567578009-0.post@n5.nabble.com> Hi together, some days back I was working on a custom loader and wanted to get rid of inner faces in a 3D model. To do so, I simply picked all duplicate faces and threw them away, but the result was not what I wanted. By now I fugured out why: I assumed, that equal faces have the same corners, but there is also the case, where triangles can overlap to take in the same space, but not be equal If these two squares overlap, but I only know the triangles (and they only party overlap), what would be an efficient way, to find them as being duplicates? Or am I orienting them wrong and this causes the problem? Greetings, marf -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From sankhesh.jhaveri at kitware.com Mon Aug 6 11:01:42 2018 From: sankhesh.jhaveri at kitware.com (Sankhesh Jhaveri) Date: Mon, 6 Aug 2018 11:01:42 -0400 Subject: [vtkusers] Multi-Volume Rendering In-Reply-To: <20180803070118.c7db654a879d86b78cfcacc46040d57b.40da5acc1c.mailapi@email09.godaddy.com> References: <20180803070118.c7db654a879d86b78cfcacc46040d57b.40da5acc1c.mailapi@email09.godaddy.com> Message-ID: Hi Mark, Could you please elaborate as to what you need? vtkMultiVolume still requires vtkVolume and associated vtkGPUVolumeRayCastMapper. Have you tried setting AutoAdjustSampleDistances on the mapper? Thanks, Sankhesh ? On Fri, Aug 3, 2018 at 10:01 AM wrote: > Hello, > > I am interested in improving the multi volume rendering library. > Specifically Adding in the hooks for set desired update rate to work with > the multi volume rendering approach. I was hoping that someone at VTK could > point me towards the right direction, or potentially supply some > information on the multi-rendering scheme. > > Thanks in advance, > -Mark O > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -- Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware | (518) 881-4417 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From marvin.huber at basf.com Mon Aug 6 11:07:32 2018 From: marvin.huber at basf.com (marf) Date: Mon, 6 Aug 2018 08:07:32 -0700 (MST) Subject: [vtkusers] Overlapping triangles In-Reply-To: <1533567578009-0.post@n5.nabble.com> References: <1533567578009-0.post@n5.nabble.com> Message-ID: <1533568052458-0.post@n5.nabble.com> Ok, I came up with a first idea, but am still open to suggestions since I really don't know if it works. The idea being: For each triangle, take the centerpoint of its hypotenuse as a hash, and put all triangles with the same hash together, then, check these triangles for overlap, in my example all four triangles should have this same hash and checking them against each other should not be to much work. Maybe I can even assume, that since there are more then 2 triangles sharing this hash, they are to be thrown out, but since it is 3D, this might only work for my given example. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From sebastien.jourdain at kitware.com Mon Aug 6 11:20:39 2018 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Mon, 6 Aug 2018 09:20:39 -0600 Subject: [vtkusers] Overlapping triangles In-Reply-To: <1533568052458-0.post@n5.nabble.com> References: <1533567578009-0.post@n5.nabble.com> <1533568052458-0.post@n5.nabble.com> Message-ID: Faces can be triangles/quad/poly... Since they are based on point index. The way you generate your hash should be based on a sorted list of those ids. On Mon, Aug 6, 2018 at 9:07 AM marf wrote: > Ok, I came up with a first idea, but am still open to suggestions since I > really don't know if it works. The idea being: > For each triangle, take the centerpoint of its hypotenuse as a hash, and > put > all triangles with the same hash together, then, check these triangles for > overlap, in my example all four triangles should have this same hash and > checking them against each other should not be to much work. Maybe I can > even assume, that since there are more then 2 triangles sharing this hash, > they are to be thrown out, but since it is 3D, this might only work for my > given example. > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kgh5 at raymak.com Mon Aug 6 13:42:04 2018 From: kgh5 at raymak.com (Kamyar) Date: Mon, 06 Aug 2018 20:42:04 +0300 Subject: [vtkusers] How should one build a Custom VTK module library Message-ID: I have a couple of custom VTK filters. They are hacked into the VTK sources by adding them to the CMakeList of the existing General Filters module and built along with the entire VTK library. I use the resulting filters both in Paraview (shared libs), and in a little executable (static libs). I assume I should be able to make VTK as is, then build my filters separately into a new library. But I can't figure out how to set up the CMakelist so the library can be built separately. Every example I can find for custom VTK filters builds them directly into an executable, not a library. Am I supposed to be doing this as a VTK Remote Module? But there is nothing published in a journal, and I am not trying to share it with anyone. Am I supposed to put them in as a Third-party submodule? But then they would still build along with the full VTK build. Here is the attempted CMakeList, which produces the error: "Unknown CMake command "vtk_module_library". > find_package(VTK REQUIRED) > include(${VTK_USE_FILE}) > > set(Module_SRCS > ModelReduce.cxx > ) > > configure_file( > ${CMAKE_CURRENT_SOURCE_DIR}/ModelReduceExport.h.in > ${CMAKE_CURRENT_BINARY_DIR}/ModelReduceExport.h > ) > > vtk_module_library(vtkModelReduce ${Module_SRCS}) -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.maynard at kitware.com Mon Aug 6 15:32:34 2018 From: robert.maynard at kitware.com (Robert Maynard) Date: Mon, 6 Aug 2018 15:32:34 -0400 Subject: [vtkusers] How should one build a Custom VTK module library In-Reply-To: References: Message-ID: You will need to include the vtkExternalModuleMacros.cmake file for this approach to work. Something like the following should allow vtk_module_library to be a valid command: set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${VTK_CMAKE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake ) include(vtkExternalModuleMacros) On Mon, Aug 6, 2018 at 1:42 PM Kamyar wrote: > > I have a couple of custom VTK filters. They are hacked into the VTK sources by adding them to the CMakeList of the existing General Filters module and built along with the entire VTK library. I use the resulting filters both in Paraview (shared libs), and in a little executable (static libs). > > I assume I should be able to make VTK as is, then build my filters separately into a new library. But I can't figure out how to set up the CMakelist so the library can be built separately. Every example I can find for custom VTK filters builds them directly into an executable, not a library. > > Am I supposed to be doing this as a VTK Remote Module? But there is nothing published in a journal, and I am not trying to share it with anyone. > > Am I supposed to put them in as a Third-party submodule? But then they would still build along with the full VTK build. > > Here is the attempted CMakeList, which produces the error: "Unknown CMake command "vtk_module_library". > > find_package(VTK REQUIRED) > include(${VTK_USE_FILE}) > > set(Module_SRCS > ModelReduce.cxx > ) > > configure_file( > ${CMAKE_CURRENT_SOURCE_DIR}/ModelReduceExport.h.in > ${CMAKE_CURRENT_BINARY_DIR}/ModelReduceExport.h > ) > > vtk_module_library(vtkModelReduce ${Module_SRCS}) > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers From jakob.jungfels at stud.hs-hannover.de Mon Aug 6 16:01:33 2018 From: jakob.jungfels at stud.hs-hannover.de (Jakob Jungfels) Date: Mon, 6 Aug 2018 22:01:33 +0200 Subject: [vtkusers] vtkPointCloudFilter GetPointMap Message-ID: <9aac7ac0-c3fb-0e88-5edf-751a0899cfe9@stud.hs-hannover.de> Hey folks, I hope this is the correct place for this question: I am using VTK 7.1.1 in Python to create 3D models from DICOM files and perform some operations on the models. Currently my goal is to use the vtkPointCloudFilter classes, mainly vtkRadiusOutlierRemoval and vtkStatisticalOutlierRemoval, to remove outlier points from my data. Now, the problem is, that I want to use the GetPointMap function. Unfortunately, while the algorithm works fine, the GetPointMap function does not. The result I am getting is a string, always looking similar to this "_000000004d6b5040_p_void". Some example code that I am using: outliersRemoval = vtk.vtkRadiusOutlierRemoval() outliersRemoval.SetInputData(self.tmpPolyData) outliersRemoval.SetRadius(1.0) outliersRemoval.SetNumberOfNeighbors(10) outliersRemoval.Update() print("Removed Points:") print(outliersRemoval.GetNumberOfPointsRemoved()) outliers = outliersRemoval.GetPointMap() Can anyone help me with this? Kind regards, Jakob Jungfels From rickfrank at me.com Mon Aug 6 16:29:43 2018 From: rickfrank at me.com (Richard Frank) Date: Mon, 06 Aug 2018 16:29:43 -0400 Subject: [vtkusers] Subclassing vtk.js objects Message-ID: <005001d42dc4$36627890$a32769b0$@me.com> I'm trying to subclass a vtk.js object in an script as here: https://kitware.github.io/vtk-js/docs/intro_vtk_as_external_script.html Here's a codepen example of what I'm trying to do: subclass vtkInteractorStyleImage with vtkMyInteractorStyleImage as a simple test. https://codepen.io/RickFrank/pen/jpvqJe I can't seem to do this outside of a npm style project. Is this a limitation of VTK.js? Thanks Rick Frank -------------- next part -------------- An HTML attachment was scrubbed... URL: From castellanoslizan at gmail.com Mon Aug 6 16:32:57 2018 From: castellanoslizan at gmail.com (Lizeth Castellanos) Date: Mon, 6 Aug 2018 17:32:57 -0300 Subject: [vtkusers] Copy image data into vtkImageData from a textfile In-Reply-To: References: Message-ID: Hi, When I set the dimensions of the data, nothing happens :-( Are these dimensions too big, maybe? csvfile="directory path to my csv file/sample.csv" reader = vtk.vtkDelimitedTextReader() reader.SetFieldDelimiterCharacters(" ") reader.DetectNumericColumnsOn() reader.SetFileName(csvfile) reader.MergeConsecutiveDelimitersOn() reader.Update() tableToPoints = vtk.vtkTableToPolyData() tableToPoints.SetInputConnection(reader.GetOutputPort()) tableToPoints.SetXColumn('Field 0') tableToPoints.SetYColumn('Field 1') tableToPoints.SetZColumn('Field 2') tableToPoints.Update() print tableToPoints.GetInput() resample = vtk.vtkResampleToImage() resample.SetInputConnection(tableToPoints.GetOutputPort()) resample.SetSamplingDimensions(512, 512, 192) resample.Update() scalar = resample.GetOutput().GetPointData().GetArray('Field 3') resample.GetOutput().GetPointData().SetScalars(scalar) range = resample.GetOutput().GetPointData().GetScalars().GetRange() writer = vtk.vtkMetaImageWriter() writer.SetInputData(resample.GetOutput()) writer.SetFileName('out.mha') writer.SetCompression(True) writer.Write() colors = vtk.vtkNamedColors() # Create the standard renderer, render window # and interactor. ren = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) # Create transfer mapping scalar value to opacity. opacityTransferFunction = vtk.vtkPiecewiseFunction() opacityTransferFunction.AddPoint(range[0], 0.0) opacityTransferFunction.AddPoint(range[1], 1.0) # Create transfer mapping scalar value to color. colorTransferFunction = vtk.vtkColorTransferFunction() colorTransferFunction.AddRGBPoint(range[0], 0.0, 0.0, 1.0) colorTransferFunction.AddRGBPoint((range[0]+range[1])*0.5, 0.0, 1.0, 0.0) colorTransferFunction.AddRGBPoint(range[1], 1.0, 0.0, 0.0) # The property describes how the data will look. volumeProperty = vtk.vtkVolumeProperty() volumeProperty.SetColor(colorTransferFunction) volumeProperty.SetScalarOpacity(opacityTransferFunction) volumeProperty.SetScalarOpacityUnitDistance(1.73205080757) volumeProperty.SetInterpolationTypeToLinear() # The mapper / ray cast function know how to render the data. volumeMapper = vtk.vtkSmartVolumeMapper() volumeMapper.SetInputConnection(resample.GetOutputPort()) volumeMapper.SetBlendModeToComposite() # The volume holds the mapper and the property and # can be used to position/orient the volume. volume = vtk.vtkVolume() volume.SetMapper(volumeMapper) volume.SetProperty(volumeProperty) ren.AddVolume(volume) ren.SetBackground(colors.GetColor3d("White")) ren.GetActiveCamera().ParallelProjectionOn() ren.ResetCameraClippingRange() ren.ResetCamera() renWin.SetSize(600, 600) renWin.Render() iren.Start() This is the output from print tableToPoints.GetInput() vtkTable (0x2e87f60) Debug: Off Modified Time: 439 Reference Count: 2 Registered Events: (none) Information: 0x2e87950 Data Released: False Global Release Data: Off UpdateTime: 459 Field Data: Debug: Off Modified Time: 162 Reference Count: 1 Registered Events: (none) Number Of Arrays: 0 Number Of Components: 0 Number Of Tuples: 0 RowData: Debug: Off Modified Time: 438 Reference Count: 1 Registered Events: (none) Number Of Arrays: 4 Array 0 name = Field 0 Array 1 name = Field 1 Array 2 name = Field 2 Array 3 name = Field 3 Number Of Components: 4 Number Of Tuples: 2756596 Copy Tuple Flags: ( 1 1 1 1 1 0 1 1 ) Interpolate Flags: ( 1 1 1 1 1 0 0 1 ) Pass Through Flags: ( 1 1 1 1 1 1 1 1 ) Scalars: (none) Vectors: (none) Normals: (none) TCoords: (none) Tensors: (none) GlobalIds: (none) PedigreeIds: (none) EdgeFlag: (none) Thanks Lizeth On Thu, Aug 2, 2018 at 5:59 PM, kenichiro yoshimi wrote: > Hello, > > Did you set the dimensions based on your own data? It looks all > dimensions indicate 3. > > Thanks > > 2018?8?3?(?) 4:50 Lizeth Castellanos : > >> Hi, >> >> Thanks for help me. >> I have confirmed the out.vti using Paraview's volume rendering. I don't >> know what is wrong, I get a solid cube again :-( >> I am attaching a screenshot. Could you see, please? >> >> Thanks >> Lizeth >> >> On Wed, Aug 1, 2018 at 10:20 PM, kenichiro yoshimi < >> rccm.kyoshimi at gmail.com> wrote: >> >>> Hi, >>> >>> Thanks for trying. >>> Could you confirm if out.vti is visualized properly using ParaView's >>> volume rendering? >>> >>> Regards >>> 2018?8?2?(?) 6:12 Lizeth Castellanos : >>> > >>> > Hi, >>> > >>> > I got VTK 7.1.1 in my computer, finally! So, I have tested the two >>> solutions that you have suggested: >>> > 1) using vtkProbeFilter >>> > 2) using vtkResampleToImage >>> > >>> > 1) I have adjusted the image dimensions according to my own data and >>> I am using vtkSmartVolumeMapper, instead of vtkVolumeRaycastMapper. >>> > No errors are generated in the terminal. However, I have been waiting >>> for several minutes and nothing happens. >>> > Do you have any idea what is wrong? >>> > >>> > >>> > csvfile="directory path to my csv file/sample.csv" >>> > >>> > reader = vtk.vtkDelimitedTextReader() >>> > reader.SetFieldDelimiterCharacters(" ") >>> > reader.DetectNumericColumnsOn() >>> > reader.SetFileName(csvfile) >>> > reader.MergeConsecutiveDelimitersOn() >>> > reader.Update() >>> > >>> > tableToPoints = vtk.vtkTableToPolyData() >>> > tableToPoints.SetInputConnection(reader.GetOutputPort()) >>> > tableToPoints.SetXColumn('Field 0') >>> > tableToPoints.SetYColumn('Field 1') >>> > tableToPoints.SetZColumn('Field 2') >>> > >>> > imageData = vtk.vtkImageData() >>> > imageData.SetDimensions(512, 512, 192) >>> > imageData.SetOrigin(0.0, 0.0, 0.0) >>> > imageData.SetSpacing(1.0, 1.0, 1.0) >>> > >>> > probeFilter = vtk.vtkProbeFilter() >>> > probeFilter.SetSourceConnection(tableToPoints.GetOutputPort()) >>> > probeFilter.SetInputData(imageData) >>> > probeFilter.Update() >>> > >>> > writer = vtk.vtkXMLImageDataWriter() >>> > writer.SetInputData(probeFilter.GetOutput()) >>> > writer.SetFileName('out.vti') >>> > writer.Write() >>> > >>> > probeFilter.GetOutput().GetPointData().SetActiveScalars('Field 3') >>> > range = probeFilter.GetOutput().GetPointData().GetScalars().GetRange() >>> > >>> > colors = vtk.vtkNamedColors() >>> > >>> > # Create the standard renderer, render window >>> > # and interactor. >>> > ren = vtk.vtkRenderer() >>> > >>> > renWin = vtk.vtkRenderWindow() >>> > renWin.AddRenderer(ren) >>> > >>> > iren = vtk.vtkRenderWindowInteractor() >>> > iren.SetRenderWindow(renWin) >>> > >>> > # Create transfer mapping scalar value to opacity. >>> > opacityTransferFunction = vtk.vtkPiecewiseFunction() >>> > opacityTransferFunction.AddPoint(range[0], 0.0) >>> > opacityTransferFunction.AddPoint(range[1], 1.0) >>> > >>> > # Create transfer mapping scalar value to color. >>> > colorTransferFunction = vtk.vtkColorTransferFunction() >>> > colorTransferFunction.AddRGBPoint(range[0], 0.0, 0.0, 1.0) >>> > colorTransferFunction.AddRGBPoint((range[0]+range[1])*0.5, 0.0, 1.0, >>> 0.0) >>> > colorTransferFunction.AddRGBPoint(range[1], 1.0, 0.0, 0.0) >>> > >>> > # The property describes how the data will look. >>> > volumeProperty = vtk.vtkVolumeProperty() >>> > volumeProperty.SetColor(colorTransferFunction) >>> > volumeProperty.SetScalarOpacity(opacityTransferFunction) >>> > volumeProperty.SetScalarOpacityUnitDistance(1.73205080757) >>> > volumeProperty.SetInterpolationTypeToLinear() >>> > >>> > # The mapper / ray cast function know how to render the data. >>> > volumeMapper = vtk.vtkSmartVolumeMapper() >>> > volumeMapper.SetInputConnection(probeFilter.GetOutputPort()) >>> > volumeMapper.SetBlendModeToComposite() >>> > >>> > # The volume holds the mapper and the property and >>> > # can be used to position/orient the volume. >>> > volume = vtk.vtkVolume() >>> > volume.SetMapper(volumeMapper) >>> > volume.SetProperty(volumeProperty) >>> > >>> > ren.AddVolume(volume) >>> > >>> > ren.SetBackground(colors.GetColor3d("White")) >>> > ren.GetActiveCamera().ParallelProjectionOn() >>> > ren.ResetCameraClippingRange() >>> > ren.ResetCamera() >>> > >>> > renWin.SetSize(600, 600) >>> > renWin.Render() >>> > iren.Start() >>> > >>> > >>> > 2) I have tested the vtkResampleToImage class, (the solution that you >>> suggest at the beginning of this thread). However, I get a solid a cube as >>> output. >>> > Do you have any idea why that happens? >>> > >>> > csvfile="directory path to my csv file/sample.csv" >>> > >>> > reader = vtk.vtkDelimitedTextReader() >>> > reader.SetFieldDelimiterCharacters(" ") >>> > reader.DetectNumericColumnsOn() >>> > reader.SetFileName(csvfile) >>> > reader.MergeConsecutiveDelimitersOn() >>> > reader.Update() >>> > >>> > tableToPoints = vtk.vtkTableToPolyData() >>> > tableToPoints.SetInputConnection(reader.GetOutputPort()) >>> > tableToPoints.SetXColumn("Field 0") >>> > tableToPoints.SetYColumn("Field 1") >>> > tableToPoints.SetZColumn("Field 2") >>> > tableToPoints.Update() >>> > >>> > resample = vtk.vtkResampleToImage() >>> > resample.SetInputConnection(tableToPoints.GetOutputPort()) >>> > resample.SetSamplingDimensions(3, 3, 3) >>> > resample. >>> >> >> >> >> -- >> >> >> -- -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.jourdain at kitware.com Mon Aug 6 16:42:21 2018 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Mon, 6 Aug 2018 14:42:21 -0600 Subject: [vtkusers] Subclassing vtk.js objects In-Reply-To: <005001d42dc4$36627890$a32769b0$@me.com> References: <005001d42dc4$36627890$a32769b0$@me.com> Message-ID: This is how I would do it. (BTW, the issue tracker of vtk.js would allow better formatting) (function(){ // <==== Change function vtkMyInteractorStyleImage(publicAPI, model) { // Set our className model.classHierarchy.push('vtkMyInteractorStyleImage'); } const DEFAULT_VALUES = { windowLevelStartPosition: [0, 0], windowLevelCurrentPosition: [0, 0], lastSlicePosition: 0, windowLevelInitial: [1.0, 0.5], currentImageProperty: 0, currentImageNumber: -1, interactionMode: 'IMAGE2D', xViewRightVector: [0, 1, 0], xViewUpVector: [0, 0, -1], yViewRightVector: [1, 0, 0], yViewUpVector: [0, 0, -1], zViewRightVector: [1, 0, 0], zViewUpVector: [0, 1, 0], }; // ---------------------------------------------------------------------------- function extend(publicAPI, model, initialValues = {}) { Object.assign(model, DEFAULT_VALUES, initialValues); // Inheritance vtk.Interaction.Style.vtkInteractorStyleImage.extend(publicAPI, model, initialValues); // <==== Change // Create get-set macros vtk.macro.setGet(publicAPI, model, ['interactionMode']); // <==== Change // For more macro methods, see "Sources/macro.js" // Object specific methods vtkMyInteractorStyleImage(publicAPI, model); } // ---------------------------------------------------------------------------- const newInstance = vtk.macro.newInstance(extend, 'vtkMyInteractorStyleImage'); // <==== Change // ---------------------------------------------------------------------------- const vtkMyInteractorStyleImage = Object.assign({ newInstance, extend }); // <==== Change // Expose your class to the outside... window.vtkMyInteractorStyleImage = vtkMyInteractorStyleImage; // <==== Change })(); // <==== Change On Mon, Aug 6, 2018 at 2:29 PM Richard Frank via vtkusers < vtkusers at public.kitware.com> wrote: > > > I?m trying to subclass a vtk.js object in an script as here: > > > > https://kitware.github.io/vtk-js/docs/intro_vtk_as_external_script.html > > > > > > > > Here?s a codepen example of what I?m trying to do: subclass > vtkInteractorStyleImage with vtkMyInteractorStyleImage > as a simple test. > > https://codepen.io/RickFrank/pen/jpvqJe > > > > I can?t seem to do this outside of a npm style project. > > > > Is this a limitation of VTK.js? > > > > > > Thanks > > > > Rick Frank > > > > > > > > > > > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From omalyushytskyvtkuser at gmail.com Mon Aug 6 18:23:57 2018 From: omalyushytskyvtkuser at gmail.com (Oleksandr Malyushytsky) Date: Mon, 6 Aug 2018 15:23:57 -0700 Subject: [vtkusers] how to avoid resize a sphere object when render window gets changed In-Reply-To: <1533564322393-0.post@n5.nabble.com> References: <1533564322393-0.post@n5.nabble.com> Message-ID: First thing to understand is that geometry is not changed. Sphere radius remains the same. Your camera does change according to viewport change . So visually you see it different on the screen. If you want object to appear always the same size on the screen you might check: https://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/DistanceToCamera It uses vtkDistanceToCamera to scaler the objects. On Mon, Aug 6, 2018 at 7:05 AM, sergii shynkaruk < sergii.shynkaruk at atracsys.com> wrote: > Hello everyone! > I've just recently started using VTK and in my project I need to keep a > sphere unchanged. I tried this example - > https://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/Sphere. But > when > I resize a window, my sphere automatically resizes as well. > > > Or if I set radius = SetRaduis(10) or SetRaduis(0.1), sphere appears with > the same size, which I think is automatically adjusted with respect to main > window size. > > Could you please suggest anything about it? > > > Thanks in advance, > Sergii > > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kgh5 at raymak.com Mon Aug 6 20:22:35 2018 From: kgh5 at raymak.com (Kamyar) Date: Tue, 07 Aug 2018 03:22:35 +0300 Subject: [vtkusers] How should one build a Custom VTK module library In-Reply-To: References: Message-ID: Thank you for your help Robert. The suggestion did get me further along and I was able to build a static library. But I still had trouble with ParaView and shared libraries. My main objective was to be able to have a Git repo of my code which was independent of the VTK Git repo. I learned from your suggestion that this would be called an External Module, which led me to https://www.vtk.org/Wiki/VTK/Module_Development, and the following note: EXTERNAL MODULES * If you include a copy of the VTK source inside your project, you can simply add new directories with module.cmake and CMakeLists.txt files in them. So I am now able to include my module in the VTK build without touching any of the VTK source code using the above approach. I also figured out that I need to enable my module in CMake under Advanced settings when Configuring ParaView build. So, now I can build static VTK libraries to use in my standalone exe, and shared VTK libs for use as ParaView plugin. I use the XML based plugin definition which I manually load with ParaView plugin manager. Thank you Kamyar On 2018-08-06 22:32, Robert Maynard wrote: > You will need to include the vtkExternalModuleMacros.cmake file for > this approach to work. Something like the following should allow > vtk_module_library to be a valid command: > > set(CMAKE_MODULE_PATH > ${CMAKE_MODULE_PATH} > ${VTK_CMAKE_DIR} > ${CMAKE_CURRENT_SOURCE_DIR}/cmake > ) > include(vtkExternalModuleMacros) > On Mon, Aug 6, 2018 at 1:42 PM Kamyar wrote: > >> I have a couple of custom VTK filters. They are hacked into the VTK sources by adding them to the CMakeList of the existing General Filters module and built along with the entire VTK library. I use the resulting filters both in Paraview (shared libs), and in a little executable (static libs). >> >> I assume I should be able to make VTK as is, then build my filters separately into a new library. But I can't figure out how to set up the CMakelist so the library can be built separately. Every example I can find for custom VTK filters builds them directly into an executable, not a library. >> >> Am I supposed to be doing this as a VTK Remote Module? But there is nothing published in a journal, and I am not trying to share it with anyone. >> >> Am I supposed to put them in as a Third-party submodule? But then they would still build along with the full VTK build. >> >> Here is the attempted CMakeList, which produces the error: "Unknown CMake command "vtk_module_library". >> >> find_package(VTK REQUIRED) >> include(${VTK_USE_FILE}) >> >> set(Module_SRCS >> ModelReduce.cxx >> ) >> >> configure_file( >> ${CMAKE_CURRENT_SOURCE_DIR}/ModelReduceExport.h.in >> ${CMAKE_CURRENT_BINARY_DIR}/ModelReduceExport.h >> ) >> >> vtk_module_library(vtkModelReduce ${Module_SRCS}) >> >> _______________________________________________ >> Powered by www.kitware.com [1] >> >> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> https://public.kitware.com/mailman/listinfo/vtkusers Links: ------ [1] http://www.kitware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From dsbabkov at gmail.com Tue Aug 7 01:45:42 2018 From: dsbabkov at gmail.com (dsbabkov) Date: Mon, 6 Aug 2018 22:45:42 -0700 (MST) Subject: [vtkusers] How to display vtkMappedUnstructuredGrid with my Implementation class Message-ID: <1533620742896-0.post@n5.nabble.com> Hello, everyone! I'm new to VTK and would like to use it in my project instead of my own OpenGL rendering system; I think, I need to keep data structures as it is and it seems I have to use vtkMappedUnstructuredGrid class. I found an example UGrid, which demonstrates, how to work with vtkUnstructuredGrid. To examine vtkMappedUnstructuredGrid I decided to modify this example. I have implemented required by manual Implementation class methods and replaced usage of vtkUnstructuredGrid to vtkMappedUnstructuredGrid with my Implementation. But nothing is displayed... I was trying to set breakpoints to vtkMappedUnstructuredGrid template methods to understand, what I have missed, but it seems no methods called to request data information. Only constructor, destructor and GetMTime, which seems not required to be implemented in Implementation class. Here is my c++ code: main.cpp And CMake project file: CMakeLists.txt Please, help me to understand this template class and find my fault. My OS is arch linux and VTK vtk-8.1.0 installed. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From minpu.code at gmail.com Tue Aug 7 02:22:08 2018 From: minpu.code at gmail.com (pnt1614) Date: Mon, 6 Aug 2018 23:22:08 -0700 (MST) Subject: [vtkusers] Why does a contour widget generate lines under a surface? Message-ID: <1533622928213-0.post@n5.nabble.com> I am using a vtkContourWidget with vtkPolygonalSurfacePointPlacer and vtkPolygonalSurfaceContourLineInterpolator to render lines on a surface. If I create a new vtkContourWidget and click many points on surface, everything is okay and lines are rendered on the surface. But If I use the same clicked points to initialize a new vtkContourWidget, lines and rendered under the surface. Is there anyone experienced this problem? Please, help me. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From sergii.shynkaruk at atracsys.com Tue Aug 7 03:21:17 2018 From: sergii.shynkaruk at atracsys.com (sergii shynkaruk) Date: Tue, 7 Aug 2018 00:21:17 -0700 (MST) Subject: [vtkusers] how to avoid resize a sphere object when render window gets changed In-Reply-To: References: <1533564322393-0.post@n5.nabble.com> Message-ID: <1533626477079-0.post@n5.nabble.com> Thank you, Oleksandr. I will try to apply that. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From sergii.shynkaruk at atracsys.com Tue Aug 7 05:19:28 2018 From: sergii.shynkaruk at atracsys.com (sergii shynkaruk) Date: Tue, 7 Aug 2018 02:19:28 -0700 (MST) Subject: [vtkusers] how to avoid resize a sphere object when render window gets changed In-Reply-To: <1533626477079-0.post@n5.nabble.com> References: <1533564322393-0.post@n5.nabble.com> <1533626477079-0.post@n5.nabble.com> Message-ID: <1533633568513-0.post@n5.nabble.com> Oleksandr, it works indeed. I understood Glyph3D and the distance to camera thing. Thank you, one more time -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From shayan.moradkhani at gmail.com Tue Aug 7 06:33:03 2018 From: shayan.moradkhani at gmail.com (shayan moradkhani) Date: Tue, 7 Aug 2018 03:33:03 -0700 (MST) Subject: [vtkusers] camera In-Reply-To: <1532950448864-0.post@n5.nabble.com> References: <1532950448864-0.post@n5.nabble.com> Message-ID: <1533637983473-0.post@n5.nabble.com> anyone has any opinion about this camera interaction? I appreciate your help -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From bebe0705 at colorado.edu Tue Aug 7 07:03:38 2018 From: bebe0705 at colorado.edu (BBerco) Date: Tue, 7 Aug 2018 04:03:38 -0700 (MST) Subject: [vtkusers] vtExtractEdges spurious behavior Message-ID: <1533639818116-0.post@n5.nabble.com> I have encountered a spurious behaviour of vtkExtractEdges, simply triggered by re-ordering the connectivity table of an input OBJ file. I am trying to extract the edges of a polyhedron in the form of : edge = (i0,i1,f0,f1) where (i0,i1) are the indices of the two points at both ends of the edge and (f0,f1) the indices of the two facets delimiting the edge. To my surprise, my approach (summarized in the code below) works fine for some OBJ files. But in some odd cases, vtkExtractEdges brings up combinations of (i0,i1) that do not form an edge I have attached a minimal functional example hereunder. In addition, here's an obj file revealing the issue. As is, everything works fine. But try flipping two rows at the beginning of the connectivity table f 1 2 3 f 1 3 4 f 1 4 5 f 1 5 6 f 1 6 7 f 1 7 2 f 2 8 9 into f 2 8 9 f 1 2 3 f 1 3 4 f 1 4 5 f 1 5 6 f 1 6 7 f 1 7 2 and notice how the exception is raised. Any advice? https://github.com/bbercovici/SBGAT/blob/master/Tests/input/KW4Alpha.obj #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include int main(int, char *[]){ std::string filename = "KW4Alpha.obj"; // Reading vtkSmartPointer reader = vtkSmartPointer::New(); reader -> SetFileName(filename.c_str()); reader -> Update(); vtkPolyData * input = reader -> GetOutput(); vtkSmartPointer extractEdges = vtkSmartPointer::New(); extractEdges->SetInputConnection(reader->GetOutputPort()); extractEdges->Update(); unsigned int edge_count = extractEdges->GetOutput()->GetNumberOfCells(); std::vector> edge_points_ids_facet_ids(edge_count); // Should get rid of this map and use a vector instead // This loop cannot be parallelized since GetPointCells is // not thread-safe for(vtkIdType i = 0; i < edge_count; i++){ vtkSmartPointer line = vtkLine::SafeDownCast(extractEdges->GetOutput()->GetCell(i)); edge_points_ids_facet_ids[i][0] = line->GetPointIds()->GetId(0); edge_points_ids_facet_ids[i][1] = line->GetPointIds()->GetId(1); // We need to find the facets forming this edge vtkSmartPointer facet_ids_point_1 = vtkSmartPointer::New(); vtkSmartPointer facet_ids_point_2 = vtkSmartPointer::New(); input -> GetPointCells ( edge_points_ids_facet_ids[i][0],facet_ids_point_1 ); input -> GetPointCells ( edge_points_ids_facet_ids[i][1],facet_ids_point_2 ); // Indices of points forming considered edge, 1-indexed so as to be consistent with the input obj file std::cout << line->GetPointIds()->GetId(0) + 1 << " / " << line->GetPointIds()->GetId(1) + 1 << std::endl; // Now, we find the two facet indices showing up in both facet_ids_point_1 and facet_ids_point_2 facet_ids_point_1 -> IntersectWith ( facet_ids_point_2 ) ; if (facet_ids_point_1 -> GetNumberOfIds() != 2){ throw(std::runtime_error("the intersection of the facet id lists should have exactly 2 items, not " + std::to_string(facet_ids_point_1 -> GetNumberOfIds()))); } edge_points_ids_facet_ids[i][2] = facet_ids_point_1->GetId(0); edge_points_ids_facet_ids[i][3] = facet_ids_point_1->GetId(1); } return EXIT_SUCCESS; } -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From ftpronk at engits.com Tue Aug 7 08:08:09 2018 From: ftpronk at engits.com (Fcs) Date: Tue, 7 Aug 2018 05:08:09 -0700 (MST) Subject: [vtkusers] Understanding vtkAppendFilter ; interesting results.. Message-ID: <1533643689669-0.post@n5.nabble.com> I'm trying to use vtkAppendFilter to merge different vtkStructuredGrid blocks together in one grid. I've tried two different approaches: - Create the vtkStructuredGrid blocks, copy them to a vtkUnstructuredGrid, and call the AddInputData() method of vtkAppendFilter with that copied object. - Create the vtkStructuredGrid blocks, store them in a vtkDataSet, and call the AddInputData() method with the vtkDataSet object. The first approach works (although, if possible, I would like to be able to aggregate the vtkStructuredGrid directly without the DeepCopy() trick..), and the second approach only partly works. The merged grids can be seen in my screenshots here below, which are from a plane slice at (-5, 0, 0) with normal (1, 0, 0). I'm using a 4 x 4 x 4 grid of blocks, with the centre blocks having twice the grid resolution of the outside blocks. Clearly something went wrong using vtkDataSet. Could somebody explain to me what went wrong, and why? Or perhaps how I can best achieve what I'm trying to do? The code I used can be found after the screenshots. Thank you for the help. #include #include #include #include #include #include #include #include #include vtkSmartPointer createGrid(int x1, int x2, int y1, int y2, int z1, int z2) { int nx, ny, nz; if (x1 > -20 && x2 < 20 && y1 > -20 && y2 < 20 && z1 > -20 && z2 < 20) { nx = ny = nz = 40; } else { nx = ny = nz = 20; } double dx, dy, dz; dx = double(x2-x1)/nx; dy = double(y2-y1)/ny; dz = double(z2-z1)/nz; vtkNew grid; grid->SetDimensions(nx+1, ny+1, nz+1); vtkNew pts; for (int i = 0; i <= nx; ++i) { for (int j = 0; j <= ny; ++j) { for (int k = 0; k <= nz; ++k) { pts->InsertNextPoint(x1+dx*i, y1+dy*j, z1+dz*k); } } } grid->SetPoints(pts.GetPointer()); return grid.GetPointer(); } void mergeBlocks() { vtkNew filter; for(int i = -20; i < 20; i += 10) { for(int j = -20; j < 20; j += 10) { for(int k = -20; k < 20; k += 10) { vtkSmartPointer sgrid = createGrid(i, i+10, j, j+10, k, k+10); vtkSmartPointer ugrid = vtkSmartPointer::New(); ugrid->DeepCopy(sgrid); filter->AddInputData(ugrid); //vtkSmartPointer data = createGrid(i, i+10, j, j+10, k, k+10); //filter->AddInputData(data); } } } filter->Update(); std::cout << "Total number of cells: " << filter->GetOutput()->GetNumberOfCells() << std::endl; vtkNew writer; writer->SetFileName("output.vtk"); writer->SetInputData(filter->GetOutput()); writer->Write(); } int main() { mergeBlocks(); return EXIT_SUCCESS; } *If needed, here is the CMakeLists.txt file I used: * cmake_minimum_required(VERSION 2.8) PROJECT(CuttingTest) find_package(VTK REQUIRED) include(${VTK_USE_FILE}) add_executable(cuttingTest cuttingtest.cxx ) target_link_libraries(cuttingTest ${VTK_LIBRARIES}) -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From stefan.neumann at tuhh.de Tue Aug 7 08:38:07 2018 From: stefan.neumann at tuhh.de (StevenNew) Date: Tue, 7 Aug 2018 05:38:07 -0700 (MST) Subject: [vtkusers] General question to usage of VTK In-Reply-To: References: <1532278659023-0.post@n5.nabble.com> Message-ID: <1533645487202-0.post@n5.nabble.com> When I try to recompile VTK with Module_vtkIOPDAL enabled, CMake can't find any PDALConfig.cmake or pdal-config.cmake file and I also can't find these files manually.. Do I need to install the PDAL library explicitly? Also on the website of the PDAL library it says that the PCD-reader (which I need) needs a linkage to the PCL library? Steven -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From m.nunes at fratoria.com Tue Aug 7 08:51:30 2018 From: m.nunes at fratoria.com (Miguel) Date: Tue, 7 Aug 2018 05:51:30 -0700 (MST) Subject: [vtkusers] Force show in low resolution In-Reply-To: <1334072097311-5630297.post@n5.nabble.com> References: <1334072097311-5630297.post@n5.nabble.com> Message-ID: <1533646290195-0.post@n5.nabble.com> Hello, I am resurrecting this thread as I need to impose a certain resolution on a renderer. Even though the window can be 800x600, I want it at 500px x 500px. Does the VTK rendering / openGLrenderwindow have the option such as SetResolution(x,y) ? I couln't find anything. Thanks! -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From bebe0705 at colorado.edu Tue Aug 7 12:48:54 2018 From: bebe0705 at colorado.edu (BBerco) Date: Tue, 7 Aug 2018 09:48:54 -0700 (MST) Subject: [vtkusers] vtExtractEdges spurious behavior In-Reply-To: <1533639818116-0.post@n5.nabble.com> References: <1533639818116-0.post@n5.nabble.com> Message-ID: <1533660534419-0.post@n5.nabble.com> I think I have a fix. Just run the output of the vtkOBJReader through a vtkCleanPolyData filter . -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From dave.demarle at kitware.com Tue Aug 7 12:57:47 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Tue, 7 Aug 2018 12:57:47 -0400 Subject: [vtkusers] SetCenter for loaded obj models In-Reply-To: <1533200508142-0.post@n5.nabble.com> References: <1533140800719-0.post@n5.nabble.com> <1533200508142-0.post@n5.nabble.com> Message-ID: Hi Shayan. There is a distinction between where an object is located and where the object is displayed. vtkSphereSource's SetCenter generates an all of the coordinates, taking into account the desired Center when it makes the triangles. vtkProp3D's SetPosition is a component of the transformation matrix and thus affects where the object is displayed. By default it is 0,0,0 meaning that the object is displayed exactly where it is located. Instead of altering the code recommend that you either: * apply the vtkTransformFilter to alter the location of your obj model (making a copy of it with different coordiantes) * use SetPosition on the vtkActor (a Prop3D subclass) to alter the displayed location of your obj model. David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Thu, Aug 2, 2018 at 5:01 AM shayan moradkhani wrote: > > is there anyone who has used setCenter method for loaded obj models? > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers From dave.demarle at kitware.com Tue Aug 7 13:02:09 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Tue, 7 Aug 2018 13:02:09 -0400 Subject: [vtkusers] Help in creating 2D mesh with correct scalars In-Reply-To: References: Message-ID: Something like thedataset.GetCellData().AddArray(thestressesarray). Should do it. David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Wed, Aug 1, 2018 at 12:49 PM SilveiraPO . wrote: > > P.S, i'm using the python vtk wrapper > > 2018-08-01 17:46 GMT+01:00 SilveiraPO . : >> >> Hello, >> >> I'm making a 2D FEM program (using only quad elements), and after trying your examples to assign scalars to the elements of my mesh, i got no good results. >> Basically, i have 3 arrays: >> >> 1. The first one is the nodes array following this format: [x,y,z]*n in which x,y and z correspond to the respective coordinate and "n" the number of nodes >> >> 2. The second one, is the cells array -> [1node, 2node, 3node, 4node]*e, where "e" is the number of elements. >> >> 3. And finally the last array is the stresses array -> [stresse]*e, where "e" is the number of elements. >> >> My question is, how can i assign the values of the stresses array to the cells array. Basically assigning the stresses array as my scalars, in order to render them on top of my cells. >> Thanks in advance! >> >> Cheers > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers From allison.vacanti at kitware.com Tue Aug 7 13:19:02 2018 From: allison.vacanti at kitware.com (Allie Vacanti) Date: Tue, 7 Aug 2018 13:19:02 -0400 Subject: [vtkusers] How to display vtkMappedUnstructuredGrid with my Implementation class In-Reply-To: <1533620742896-0.post@n5.nabble.com> References: <1533620742896-0.post@n5.nabble.com> Message-ID: The rendering engine is shortcircuiting because the dataset has no coordinate information (the `x` array is never used by the mapped grid implementation -- `mesh->GetPoints()` is returning nullptr). Adding `mesh->SetPoints(points);` to the test script will complete the dataset and let the renderer progress. Be warned, however, that the mapped unstructured grid stuff is not widely used and there may be some further issues lurking as you go farther with it. They may be a need to debug/patch VTK itself if you want to use it. I should also point out that the mapped unstructured grid is not used directly in the rendering -- it is first converted to a `vtkPolyData` by a `vtkDataSetSurfaceFilter` inside of the `vtkDataSetMapper`. If you encounter a lot of issues with the mapped grid, you may find it easier to just build a `vtkPolyData` directly from your application's data. The mapped grids were intended to be used on extremely large simulation datasets that could not be physically copied without running out of memory on an HPC node -- if that's not your usecase, directly building the `vtkPolyData` will likely save you a lot of hassle. HTH, Allie On Tue, Aug 7, 2018 at 1:45 AM, dsbabkov wrote: > Hello, everyone! > I'm new to VTK and would like to use it in my project instead of my own > OpenGL rendering system; > I think, I need to keep data structures as it is and it seems I have to use > vtkMappedUnstructuredGrid class. > I found an example UGrid, which demonstrates, how to work with > vtkUnstructuredGrid. > To examine vtkMappedUnstructuredGrid I decided to modify this example. I > have implemented required by manual Implementation class methods and > replaced usage of vtkUnstructuredGrid to vtkMappedUnstructuredGrid with my > Implementation. But nothing is displayed... I was trying to set breakpoints > to vtkMappedUnstructuredGrid template methods to understand, what I have > missed, but it seems no methods called to request data information. Only > constructor, destructor and GetMTime, which seems not required to be > implemented in Implementation class. > Here is my c++ code: main.cpp > > And CMake project file: CMakeLists.txt > > Please, help me to understand this template class and find my fault. > My OS is arch linux and VTK vtk-8.1.0 installed. > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Bel101103105 at gmail.com Tue Aug 7 18:15:42 2018 From: Bel101103105 at gmail.com (Bel) Date: Tue, 7 Aug 2018 15:15:42 -0700 (MST) Subject: [vtkusers] Hide vtkOutputWindow Message-ID: <1533680142199-0.post@n5.nabble.com> How can I hide vtkOutputWindow? No suppress by vtkObject::GlobalWarningDisplayOff() or redirect output to file, but only hide. (And show again after some time by something likevtkOutputWindow::GetInstance()->DisplayText(" ")). Thanks. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From dsbabkov at gmail.com Wed Aug 8 04:39:19 2018 From: dsbabkov at gmail.com (=?UTF-8?B?0JTQvNC40YLRgNC40Lkg0JHQsNCx0LrQvtCy?=) Date: Wed, 8 Aug 2018 11:39:19 +0300 Subject: [vtkusers] How to display vtkMappedUnstructuredGrid with my Implementation class In-Reply-To: References: <1533620742896-0.post@n5.nabble.com> Message-ID: Allie, thank you very much! I don't believe, that I missed points data. I was sure, that it was used in Implementation class. Now I am able to run UGrid example on mapped grid. There was one more issue: I had to call Allocate for vtkIdList *ptIds in GetCellPoints method. Otherwise I can see corrupted elements. I don't know is it normal to VTK preallocate list or it's just mapped grid class issue. I have no idea which classes VTK should I use for better performance and RAM consumption in my project, because I have no experience with VTK Let me tell you some features of project: - Goal of project is to display loaded from custom or known format FEM tetra mesh, modify it and save to custom format - There are element/face/node selectors, sections constructed with user planes, display feature angles (edges). - Each face of element has it color from global list of ~100 colors. - Elements grouped in collectors and visible of collectors can be toggled. - It will not be run on HPC node, I think Memory consumption of application now is about 2-3Gb if i load ~10M elements. The reason of taking mapped grid was usage of VTK rendering and, maybe, VTK algorithms without significant additional RAM consumption. Will it be reasonable to build my own vtkPolyData for each type of objects (mesh, sections, selected elements/faces/nodes)? It seems VTK algorithms can work better than mine and with less issues. Also it seems It will take less time. ??, 7 ???. 2018 ?. ? 20:19, Allie Vacanti : > The rendering engine is shortcircuiting because the dataset has no > coordinate information (the `x` array is never used by the mapped grid > implementation -- `mesh->GetPoints()` is returning nullptr). Adding > `mesh->SetPoints(points);` to the test script will complete the dataset and > let the renderer progress. > > Be warned, however, that the mapped unstructured grid stuff is not widely > used and there may be some further issues lurking as you go farther with > it. They may be a need to debug/patch VTK itself if you want to use it. > > I should also point out that the mapped unstructured grid is not used > directly in the rendering -- it is first converted to a `vtkPolyData` by a > `vtkDataSetSurfaceFilter` inside of the `vtkDataSetMapper`. If you > encounter a lot of issues with the mapped grid, you may find it easier to > just build a `vtkPolyData` directly from your application's data. The > mapped grids were intended to be used on extremely large simulation > datasets that could not be physically copied without running out of memory > on an HPC node -- if that's not your usecase, directly building the > `vtkPolyData` will likely save you a lot of hassle. > > HTH, > Allie > > On Tue, Aug 7, 2018 at 1:45 AM, dsbabkov wrote: > >> Hello, everyone! >> I'm new to VTK and would like to use it in my project instead of my own >> OpenGL rendering system; >> I think, I need to keep data structures as it is and it seems I have to >> use >> vtkMappedUnstructuredGrid class. >> I found an example UGrid, which demonstrates, how to work with >> vtkUnstructuredGrid. >> To examine vtkMappedUnstructuredGrid I decided to modify this example. I >> have implemented required by manual Implementation class methods and >> replaced usage of vtkUnstructuredGrid to vtkMappedUnstructuredGrid with my >> Implementation. But nothing is displayed... I was trying to set >> breakpoints >> to vtkMappedUnstructuredGrid template methods to understand, what I have >> missed, but it seems no methods called to request data information. Only >> constructor, destructor and GetMTime, which seems not required to be >> implemented in Implementation class. >> Here is my c++ code: main.cpp >> >> And CMake project file: CMakeLists.txt >> >> Please, help me to understand this template class and find my fault. >> My OS is arch linux and VTK vtk-8.1.0 installed. >> >> >> >> -- >> Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> https://public.kitware.com/mailman/listinfo/vtkusers >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sur.chiranjib at gmail.com Wed Aug 8 05:36:25 2018 From: sur.chiranjib at gmail.com (Chiranjib Sur) Date: Wed, 8 Aug 2018 15:06:25 +0530 Subject: [vtkusers] Understanding vtkAppendFilter ; interesting results.. In-Reply-To: <1533643689669-0.post@n5.nabble.com> References: <1533643689669-0.post@n5.nabble.com> Message-ID: Hi, VTk cell information is missing when you are trying to merge (append) two data sets vtkNew pts; for (int i = 0; i <= nx; ++i) { for (int j = 0; j <= ny; ++j) { for (int k = 0; k <= nz; ++k) { pts->InsertNextPoint(x1+dx*i, y1+dy*j, z1+dz*k); } } } Here, if you create vtkCells (using the function InsertNextCell), following the creation of vtk points, then vtkAppend operation will work perfectly. The definition of vtkAppendFilter has a description of the following : vtkAppendFilter is a filter that appends one of more datasets into a single unstructured grid. All geometry is extracted and appended, but point attributes (i.e., scalars, vectors, normals, field data, etc.) are extracted and appended only if all datasets have the point attributes available. (For example, if one dataset has scalars but another does not, scalars will not be appended.) You can have a look at the example file https://www.vtk.org/gitweb?p=VTK.git;a=blob;f=Filters/Core/Testing/Cxx/TestAppendFilter.cxx Hope this is helpful Thanks and regards, Chiranjib On Tue, Aug 7, 2018 at 5:38 PM Fcs wrote: > I'm trying to use vtkAppendFilter to merge different vtkStructuredGrid > blocks > together in one grid. > > I've tried two different approaches: > - Create the vtkStructuredGrid blocks, copy them to a vtkUnstructuredGrid, > and call the AddInputData() method of vtkAppendFilter with that copied > object. > - Create the vtkStructuredGrid blocks, store them in a vtkDataSet, and > call > the AddInputData() method with the vtkDataSet object. > > The first approach works (although, if possible, I would like to be able to > aggregate the vtkStructuredGrid directly without the DeepCopy() trick..), > and the second approach only partly works. > > The merged grids can be seen in my screenshots here below, which are from a > plane slice at (-5, 0, 0) with normal (1, 0, 0). I'm using a 4 x 4 x 4 grid > of blocks, with the centre blocks having twice the grid resolution of the > outside blocks. Clearly something went wrong using vtkDataSet. > > Could somebody explain to me what went wrong, and why? Or perhaps how I > can > best achieve what I'm trying to do? > > The code I used can be found after the screenshots. > > Thank you for the help. > > < > http://vtk.1045678.n5.nabble.com/file/t342433/with_vtkUnstructuredGrid.png> > > > > #include > #include > #include > #include > #include > #include > #include > #include > #include > > vtkSmartPointer createGrid(int x1, int x2, int y1, int > y2, int z1, int z2) > { > int nx, ny, nz; > if (x1 > -20 && x2 < 20 && > y1 > -20 && y2 < 20 && > z1 > -20 && z2 < 20) > { > nx = ny = nz = 40; > } else { > nx = ny = nz = 20; > } > double dx, dy, dz; > dx = double(x2-x1)/nx; > dy = double(y2-y1)/ny; > dz = double(z2-z1)/nz; > > vtkNew grid; > grid->SetDimensions(nx+1, ny+1, nz+1); > > vtkNew pts; > for (int i = 0; i <= nx; ++i) { > for (int j = 0; j <= ny; ++j) { > for (int k = 0; k <= nz; ++k) { > pts->InsertNextPoint(x1+dx*i, y1+dy*j, z1+dz*k); > } > } > } > grid->SetPoints(pts.GetPointer()); > > return grid.GetPointer(); > } > > void mergeBlocks() > { > vtkNew filter; > > for(int i = -20; i < 20; i += 10) { > for(int j = -20; j < 20; j += 10) { > for(int k = -20; k < 20; k += 10) { > vtkSmartPointer sgrid = createGrid(i, i+10, j, > j+10, k, k+10); > vtkSmartPointer ugrid = > vtkSmartPointer::New(); > ugrid->DeepCopy(sgrid); > filter->AddInputData(ugrid); > //vtkSmartPointer data = createGrid(i, i+10, j, j+10, > k, > k+10); > //filter->AddInputData(data); > } > } > } > filter->Update(); > std::cout << "Total number of cells: " << > filter->GetOutput()->GetNumberOfCells() << std::endl; > > vtkNew writer; > writer->SetFileName("output.vtk"); > writer->SetInputData(filter->GetOutput()); > writer->Write(); > } > > int main() > { > mergeBlocks(); > > return EXIT_SUCCESS; > } > > > *If needed, here is the CMakeLists.txt file I used: > * > > cmake_minimum_required(VERSION 2.8) > > PROJECT(CuttingTest) > > find_package(VTK REQUIRED) > include(${VTK_USE_FILE}) > > add_executable(cuttingTest cuttingtest.cxx ) > > target_link_libraries(cuttingTest ${VTK_LIBRARIES}) > > > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From allison.vacanti at kitware.com Wed Aug 8 10:10:22 2018 From: allison.vacanti at kitware.com (Allie Vacanti) Date: Wed, 8 Aug 2018 10:10:22 -0400 Subject: [vtkusers] How to display vtkMappedUnstructuredGrid with my Implementation class In-Reply-To: References: <1533620742896-0.post@n5.nabble.com> Message-ID: On Wed, Aug 8, 2018 at 4:39 AM, ??????? ?????? wrote: > Allie, thank you very much! > I don't believe, that I missed points data. I was sure, that it was used > in Implementation class. > Now I am able to run UGrid example on mapped grid. There was one more > issue: I had to call Allocate for vtkIdList *ptIds in GetCellPoints method. > Otherwise I can see corrupted elements. I don't know is it normal to VTK > preallocate list or it's just mapped grid class issue. > In the original implementation of GetCellPoints, you had: const Element &element = elements[cellId]; for (vtkIdType i = 0; i < element.pointsCount; ++i) { ptIds->InsertNextId(element.points[i]); } The issue here is that calling InsertNextId always appends to the ptIds, without clear old data first. So the list will always keep growing. Many algorithms reuse the same vtkIdList object in repeated calls to GetPointIds, since the memory can often be reused without reallocating. In this case, you'll definitely see incorrect results. As you mentioned, resizing the list and setting elements explicitly by index would fix this. Class methods in VTK are expected to manually set the size of these containers prior to filling them. I have no idea which classes VTK should I use for better performance and > RAM consumption in my project, because I have no experience with VTK > Let me tell you some features of project: > - Goal of project is to display loaded from custom or known format FEM > tetra mesh, modify it and save to custom format > - There are element/face/node selectors, sections constructed with user > planes, display feature angles (edges). > - Each face of element has it color from global list of ~100 colors. > - Elements grouped in collectors and visible of collectors can be toggled. > - It will not be run on HPC node, I think > > Memory consumption of application now is about 2-3Gb if i load ~10M > elements. > The reason of taking mapped grid was usage of VTK rendering and, maybe, > VTK algorithms without significant additional RAM consumption. > Will it be reasonable to build my own vtkPolyData for each type of objects > (mesh, sections, selected elements/faces/nodes)? It seems VTK algorithms > can work better than mine and with less issues. Also it seems It will take > less time. > The mapped unstructured grid was originally intended to be used in a workflow such as: 1) Generate large dataset in a native format 2) Create MappedUnstructuredGrid wrapper around native data 3) Use a VTK algorithm to massively reduce the data (extract faces, threshold, clip, etc) 4) Create a renderable vtkPolyData of the reduced dataset that will fit in memory as opposed to creating a large in-memory copy of the complete dataset in step two. If you plan to use a simple pipeline, or a filter that converts to a different dataset type early in the pipeline, you should be fine with the mapped unstructured grid. The only caution is that not all filters that work on vtkUnstructuredGrid will work with vtkMappedUnstructuredGrid, though many will. It makes sense that you want to let VTK handle the conversion of the dataset to a renderable form. In this case, I'd say try using the mapped grid and see if it works for you on the filters you wish to use. But if you run into to trouble, you may need to update a troublesome filter to work on a vtkUnstructuredGridBase instead of vtkUnstructuredGrid, or switch to using vtkUnstructuredGrid directly instead of a vtkMappedUnstructuredGrid. Allie ??, 7 ???. 2018 ?. ? 20:19, Allie Vacanti : > >> The rendering engine is shortcircuiting because the dataset has no >> coordinate information (the `x` array is never used by the mapped grid >> implementation -- `mesh->GetPoints()` is returning nullptr). Adding >> `mesh->SetPoints(points);` to the test script will complete the dataset and >> let the renderer progress. >> >> Be warned, however, that the mapped unstructured grid stuff is not widely >> used and there may be some further issues lurking as you go farther with >> it. They may be a need to debug/patch VTK itself if you want to use it. >> >> I should also point out that the mapped unstructured grid is not used >> directly in the rendering -- it is first converted to a `vtkPolyData` by a >> `vtkDataSetSurfaceFilter` inside of the `vtkDataSetMapper`. If you >> encounter a lot of issues with the mapped grid, you may find it easier to >> just build a `vtkPolyData` directly from your application's data. The >> mapped grids were intended to be used on extremely large simulation >> datasets that could not be physically copied without running out of memory >> on an HPC node -- if that's not your usecase, directly building the >> `vtkPolyData` will likely save you a lot of hassle. >> >> HTH, >> Allie >> >> On Tue, Aug 7, 2018 at 1:45 AM, dsbabkov wrote: >> >>> Hello, everyone! >>> I'm new to VTK and would like to use it in my project instead of my own >>> OpenGL rendering system; >>> I think, I need to keep data structures as it is and it seems I have to >>> use >>> vtkMappedUnstructuredGrid class. >>> I found an example UGrid, which demonstrates, how to work with >>> vtkUnstructuredGrid. >>> To examine vtkMappedUnstructuredGrid I decided to modify this example. I >>> have implemented required by manual Implementation class methods and >>> replaced usage of vtkUnstructuredGrid to vtkMappedUnstructuredGrid with >>> my >>> Implementation. But nothing is displayed... I was trying to set >>> breakpoints >>> to vtkMappedUnstructuredGrid template methods to understand, what I have >>> missed, but it seems no methods called to request data information. Only >>> constructor, destructor and GetMTime, which seems not required to be >>> implemented in Implementation class. >>> Here is my c++ code: main.cpp >>> >>> And CMake project file: CMakeLists.txt >>> >>> Please, help me to understand this template class and find my fault. >>> My OS is arch linux and VTK vtk-8.1.0 installed. >>> >>> >>> >>> -- >>> Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at http://www.kitware.com/ >>> opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> https://public.kitware.com/mailman/listinfo/vtkusers >>> >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From ilindsay at insigniamedical.co.uk Wed Aug 8 10:16:42 2018 From: ilindsay at insigniamedical.co.uk (ianl) Date: Wed, 8 Aug 2018 07:16:42 -0700 (MST) Subject: [vtkusers] Shadow support on volume rendering In-Reply-To: <1511859847474-0.post@n5.nabble.com> References: <1509465934854-0.post@n5.nabble.com> <1509469501231-0.post@n5.nabble.com> <1510135054887-0.post@n5.nabble.com> <1511859847474-0.post@n5.nabble.com> Message-ID: <1533737802709-0.post@n5.nabble.com> Hello again, apologies for (re)ressurecting my ancient thread again! I have managed to get a bit more time to get a little further with this and have a few more questions as a result. I have put a vtkImageCast to float into the pipeline as suggested by David and I am now getting results that look close to the original GPU volume mapper which is great. Additionally I am also now able to render shadows which is really good. It would be nice if I didn't need to do the cast as it (presumably) copies the data again to perform the conversion to float. Did you get anywhere with a fix for this? What I am now aiming towards is getting an improved quality fully ray traced volume render. Something along the lines of what is being achieved here (pics about half way down): https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5110476/ As far as I can ascertain, I will need to use the 'pathtracer' renderer type rather than 'scivis' to obtain more realistic ray traced results with soft shadows and indirect illumination/ambient lighting. The results I am getting at the moment look quite harsh and the shadows are fairly crude with scivis. The problem I am having is that the pathtracer renderer seems to need to have a material set for it to work, and there is no way to do this for volumetric data actors as far as I can see (it is not a member of vtkVolumeProperty). I guess it would probably not make sense if it was as a medical CT volume may contain many materials (bone, soft tissue, metal implants etc). Does the pathtracer renderer in ospray support volumetric data? I cannot seem to get it to render anything in paraview either, wheras the scivis renderer in paraview shows the same sort of results I see with my pipeline. Can you offer any guidance with how to proceed with this? Am I limited to using something like marching cubes to extract an isosurface for, say the skeleton, then doing a surface rendering of this to get the full ray traced quality? Would I need to extract an isosurface for each tissue type and give it an appropriate material? This seems a little long winded, wheras the current volume rendering effectively does this with colour and opacity lookup tables. All that said, the performance is very impressive for a software renderer and the results are a step up from the GPU renderer with regards to shadows and quality. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From lucas.frucht at medilabsistemas.com.br Wed Aug 8 11:04:32 2018 From: lucas.frucht at medilabsistemas.com.br (lucas.frucht at medilabsistemas.com.br) Date: Wed, 08 Aug 2018 12:04:32 -0300 Subject: [vtkusers] Hide vtkOutputWindow In-Reply-To: <1533680142199-0.post@n5.nabble.com> References: <1533680142199-0.post@n5.nabble.com> Message-ID: <6bf871557debf07669ea31c7e2812c04@medilabsistemas.com.br> Bel, There is one point that is not clear to me in your question. Do you want the messages that would have been shown when vtkOutputWindow is hidden to be discarded or to be shown when you unhide it? If you want it to be discarded, I suppose you could redirect it to /dev/null on Unix or to nul on Windows and delete the redirection when you want to unhide the window. If you just want to delay the output, maybe, you could redirect the messages to an vtkStringOutputWindow to store the messages on a string and when you want to show then, delete the redirection and call DisplayText passing the string where you stored the messages. I never tried this, but it seems reasonable to me. Best regards, --- LUCAS Frucht Desenvolvimento _lucas.frucht at medilabsistemas.com.br _www.medilabsistemas.com.br _+55 21 3294-3600 [7]__ [8]__ [9]__ [10]__ [11]__ Em 07/08/2018 19:15, Bel escreveu: > How can I hide vtkOutputWindow? No suppress by > vtkObject::GlobalWarningDisplayOff() or redirect output to file, but only > hide. (And show again after some time by something > likevtkOutputWindow::GetInstance()->DisplayText(" ")). Thanks. > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html [1] > _______________________________________________ > Powered by www.kitware.com [2] > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html [3] > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ [4] > > Search the list archives at: http://markmail.org/search/?q=vtkusers [5] > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers [6] Links: ------ [1] http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html [2] http://www.kitware.com [3] http://www.kitware.com/opensource/opensource.html [4] http://www.vtk.org/Wiki/VTK_FAQ [5] http://markmail.org/search/?q=vtkusers [6] https://public.kitware.com/mailman/listinfo/vtkusers [7] https://www.facebook.com/MedilabSistemas/?fref=ts [8] https://twitter.com/SistemasMedilab [9] https://www.linkedin.com/company/2242648?trk=tyah&trkInfo=clickedVertical%3Acompany%2CclickedEntityId%3A2242648%2Cidx%3A2-2-7%2CtarId%3A1478877733074%2Ctas%3Amedilab [10] https://www.youtube.com/channel/UCOp5wBk9ku_r7XZ32OAajVA [11] http://medilab.net.br/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Wed Aug 8 11:55:38 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Wed, 8 Aug 2018 11:55:38 -0400 Subject: [vtkusers] Shadow support on volume rendering In-Reply-To: <1533737802709-0.post@n5.nabble.com> References: <1509465934854-0.post@n5.nabble.com> <1509469501231-0.post@n5.nabble.com> <1510135054887-0.post@n5.nabble.com> <1511859847474-0.post@n5.nabble.com> <1533737802709-0.post@n5.nabble.com> Message-ID: On Wed, Aug 8, 2018 at 10:16 AM ianl wrote: > Hello again, apologies for (re)ressurecting my ancient thread again! > > No worries. > I have managed to get a bit more time to get a little further with this and > have a few more questions as a result. I have put a vtkImageCast to float > into the pipeline as suggested by David and I am now getting results that > look close to the original GPU volume mapper which is great. Additionally I > am also now able to render shadows which is really good. > > It would be nice if I didn't need to do the cast as it (presumably) copies > the data again to perform the conversion to float. Did you get anywhere > with > a fix for this? > > In 8.1.0 it will directly take uchars, unsigned shorts, floats and doubles. In master it also takes signed shorts. > What I am now aiming towards is getting an improved quality fully ray > traced > volume render. Something along the lines of what is being achieved here > (pics about half way down): > > https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5110476/ > > Thanks for the reference. I want to get to that quality too. As far as I can ascertain, I will need to use the 'pathtracer' renderer type > rather than 'scivis' to obtain more realistic ray traced results with soft > shadows and indirect illumination/ambient lighting. The results I am > getting > at the moment look quite harsh and the shadows are fairly crude with > scivis. > > > The problem I am having is that the pathtracer renderer seems to need to > have a material set for it to work, and there is no way to do this for > volumetric data actors as far as I can see (it is not a member of > vtkVolumeProperty). I guess it would probably not make sense if it was as a > medical CT volume may contain many materials (bone, soft tissue, metal > implants etc). > Does the pathtracer renderer in ospray support volumetric data? I cannot > seem to get it to render anything in paraview either, wheras the scivis > renderer in paraview shows the same sort of results I see with my pipeline. > Pathtracer does not yet support volume rendering, only surfaces. The OSPRay developers are working on it, I expect it will be sometime next year. Once it does, we will expose materials for volumes too. Can you offer any guidance with how to proceed with this? Am I limited to > using something like marching cubes to extract an isosurface for, say the > skeleton, then doing a surface rendering of this to get the full ray traced > quality? Would I need to extract an isosurface for each tissue type and > give > it an appropriate material? This seems a little long winded, wheras the > current volume rendering effectively does this with colour and opacity > lookup tables. > > That is how I would proceed at the moment too. > All that said, the performance is very impressive for a software renderer > and the results are a step up from the GPU renderer with regards to shadows > and quality. > > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ftpronk at engits.com Wed Aug 8 11:55:53 2018 From: ftpronk at engits.com (Fcs) Date: Wed, 8 Aug 2018 08:55:53 -0700 (MST) Subject: [vtkusers] Understanding vtkAppendFilter ; interesting results.. In-Reply-To: References: <1533643689669-0.post@n5.nabble.com> Message-ID: <1533743753139-0.post@n5.nabble.com> Hello Chiranjib, Unfortunately that's not of any help, no. The cell connectivity of the vtkStructuredGrid is known and calling SetPoints() is enough to create a grid with all the correct connectivity, so I shouldn't have to insert new cells. On top of it, the class doesn't have an InsertNextCell() method. So I'm still trying to understand why I have to copy my vtkStructuredGrid to a vtkUnstructuredGrid to have the vtkAppendFilter work correctly. The vtkAppendFilter documentation doesn't specify that a vtk*Un*structuredGrid is required for it to work properly. It just states that it will append datasets together into a vtkUnstructuredGrid.. Kind regards, Francois. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From nfrench at vextec.com Wed Aug 8 14:49:07 2018 From: nfrench at vextec.com (Nick French) Date: Wed, 8 Aug 2018 13:49:07 -0500 Subject: [vtkusers] Find polydata coordinates in renderer Message-ID: Hi all, I have a polydata output that I have created and am visualizing in the C# render window control. What I want to know is the location of the a given polydata point in terms of the render window. I know the points that are local to polydata (for example the one I'm interested is something like (0, 0.007, 0), but I don't know where this is in the render window screen. I assume that this will change with the size of my window as well. I've seen terms like world, view, and display coordinates, but I'm not exactly sure what those mean or if they are relevant to the problem at hand. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Wed Aug 8 16:31:57 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Wed, 8 Aug 2018 16:31:57 -0400 Subject: [vtkusers] Find polydata coordinates in renderer In-Reply-To: References: Message-ID: vtkRendererer::SetWorldCoordinates(0, 0.007, 0, 0) vtkRendererer::WorldToDisplay() vtkRendererer::GetDisplayCoordinate() Will convert from world space to display space (pixel, z) When you resize the render window, you will have to call WorldToDisplay() again to take into account the new size. See the vtk book for a discussion of the coordinate systems. David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Wed, Aug 8, 2018 at 2:49 PM Nick French wrote: > Hi all, > > I have a polydata output that I have created and am visualizing in the C# > render window control. What I want to know is the location of the a given > polydata point in terms of the render window. I know the points that are > local to polydata (for example the one I'm interested is something like (0, > 0.007, 0), but I don't know where this is in the render window screen. I > assume that this will change with the size of my window as well. I've seen > terms like world, view, and display coordinates, but I'm not exactly sure > what those mean or if they are relevant to the problem at hand. > > Thanks > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From srbn.ghosh99 at gmail.com Wed Aug 8 16:52:53 2018 From: srbn.ghosh99 at gmail.com (Shrabani Ghosh) Date: Wed, 8 Aug 2018 13:52:53 -0700 (MST) Subject: [vtkusers] Printing the values an vtkSmartPointer object Message-ID: <1533761573706-0.post@n5.nabble.com> HI, I have an object which is simplex mesh. It has vertex points and cells sharing points. I want to see Get the cells that surround a point i with this line using a loop. vtkSmartPointer vertex = vtkSmartPointer::New(); vertex->InsertNextId(i); After getting all the values how I can print or see the values of vertex inserted? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From rccm.kyoshimi at gmail.com Wed Aug 8 20:18:50 2018 From: rccm.kyoshimi at gmail.com (kenichiro yoshimi) Date: Thu, 9 Aug 2018 09:18:50 +0900 Subject: [vtkusers] Understanding vtkAppendFilter ; interesting results.. In-Reply-To: <1533743753139-0.post@n5.nabble.com> References: <1533643689669-0.post@n5.nabble.com> <1533743753139-0.post@n5.nabble.com> Message-ID: Hi, I can't replicate this problem with VTK 8.1. These outputs(output.vtk) have the same number of cells 960,000 and they are both shown properly in ParaView. Even though I directly appends a vtkStructuredGrid data into vtkAppendFilter, this works. >vtkSmartPointer sgrid = createGrid(i, i+10, j,j+10, k, k+10); > filter->AddInputData(sgrid); Is this problem caused by the incorrect rendering? Regards 2018?8?9?(?) 0:56 Fcs : > > Hello Chiranjib, > > Unfortunately that's not of any help, no. The cell connectivity of the > vtkStructuredGrid is known and calling SetPoints() is enough to create a > grid with all the correct connectivity, so I shouldn't have to insert new > cells. On top of it, the class doesn't have an InsertNextCell() method. > > So I'm still trying to understand why I have to copy my vtkStructuredGrid to > a vtkUnstructuredGrid to have the vtkAppendFilter work correctly. > The vtkAppendFilter documentation doesn't specify that a > vtk*Un*structuredGrid is required for it to work properly. It just states > that it will append datasets together into a vtkUnstructuredGrid.. > > Kind regards, > > Francois. > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers From rccm.kyoshimi at gmail.com Wed Aug 8 20:46:07 2018 From: rccm.kyoshimi at gmail.com (kenichiro yoshimi) Date: Thu, 9 Aug 2018 09:46:07 +0900 Subject: [vtkusers] Printing the values an vtkSmartPointer object In-Reply-To: <1533761573706-0.post@n5.nabble.com> References: <1533761573706-0.post@n5.nabble.com> Message-ID: Hi, I just find this example to provide you with help: https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/VertexConnectivity/ Best 2018?8?9?(?) 5:53 Shrabani Ghosh : > > HI, > > I have an object which is simplex mesh. It has vertex points and cells > sharing points. I want to see Get the cells that surround a point i with > this line using a loop. > > vtkSmartPointer vertex = > vtkSmartPointer::New(); > vertex->InsertNextId(i); > > After getting all the values how I can print or see the values of vertex > inserted? > > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers From newcfd at yahoo.com Wed Aug 8 22:51:30 2018 From: newcfd at yahoo.com (newcfd) Date: Wed, 8 Aug 2018 19:51:30 -0700 (MST) Subject: [vtkusers] qxcbintegration cannot create platform opengl context neither glx nor egl are enabled Message-ID: <1533783090404-0.post@n5.nabble.com> just switched to use QVTKOpenGLWidget from QVTKWidget. When the qt GUI is launched, I got the error message above. I am using vmWare on Ubuntu. The code I use is as follows: vtkNew widget; vtkNew renderer; vtkNew render_window; render_window->AddRenderer(renderer ); widget->SetRenderWindow( render_window ); What is the problem? Is QVTKOpenGLWidget stable? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From mathieu.westphal at kitware.com Thu Aug 9 02:19:22 2018 From: mathieu.westphal at kitware.com (Mathieu Westphal) Date: Thu, 9 Aug 2018 08:19:22 +0200 Subject: [vtkusers] qxcbintegration cannot create platform opengl context neither glx nor egl are enabled In-Reply-To: <1533783090404-0.post@n5.nabble.com> References: <1533783090404-0.post@n5.nabble.com> Message-ID: Hi, You can take a look into VTK/GUISupport/Qt/Testing/Cxx/QVTKOpenGLWidget* files for working example. Best regards, Mathieu Westphal On Thu, Aug 9, 2018 at 4:51 AM, newcfd via vtkusers < vtkusers at public.kitware.com> wrote: > just switched to use QVTKOpenGLWidget from QVTKWidget. When the qt GUI is > launched, I got the error message above. I am using vmWare on Ubuntu. > The code I use is as follows: > vtkNew widget; > vtkNew renderer; > vtkNew render_window; > render_window->AddRenderer(renderer ); > widget->SetRenderWindow( render_window ); > What is the problem? Is QVTKOpenGLWidget stable? > > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From polly_sukting at hotmail.com Thu Aug 9 03:51:24 2018 From: polly_sukting at hotmail.com (Polly Pui) Date: Thu, 9 Aug 2018 07:51:24 +0000 Subject: [vtkusers] How to extract a region using a box? Message-ID: Hi, Can anyone please tell me how can I do extract a region by providing a box (which we can set the size of it) on a polydata? I could do it manually in Paraview by selecting the Filter>Extract Cells By Region. However, I have more than 1000 dataset. It is time consuming if I apply it manually for each dataset. Thanks! Best, Polly -------------- next part -------------- An HTML attachment was scrubbed... URL: From ftpronk at engits.com Thu Aug 9 04:57:44 2018 From: ftpronk at engits.com (Fcs) Date: Thu, 9 Aug 2018 01:57:44 -0700 (MST) Subject: [vtkusers] Understanding vtkAppendFilter ; interesting results.. In-Reply-To: References: <1533643689669-0.post@n5.nabble.com> <1533743753139-0.post@n5.nabble.com> Message-ID: <1533805064550-0.post@n5.nabble.com> Dear Kenichiro, thank you for your reply. Yes, I forgot to specify that I'm using VTK 6.3. When I use the vtkStructured grid directly (or the vtkDataSet as in my example code) I get a cell count of 512,000 cells instead of 960,000. So it's definitely more than a rendering bug. I also have a copy of version 7.1.1 I compiled some time ago, I'll try that. Kind regards. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From ftpronk at engits.com Thu Aug 9 08:28:48 2018 From: ftpronk at engits.com (Fcs) Date: Thu, 9 Aug 2018 05:28:48 -0700 (MST) Subject: [vtkusers] Understanding vtkAppendFilter ; interesting results.. In-Reply-To: <1533805064550-0.post@n5.nabble.com> References: <1533643689669-0.post@n5.nabble.com> <1533743753139-0.post@n5.nabble.com> <1533805064550-0.post@n5.nabble.com> Message-ID: <1533817728081-0.post@n5.nabble.com> After testing: - VTK 7.1.1 segfaults when using: > vtkSmartPointer sgrid = createGrid(i, i+10, j,j+10, k, > k+10); > vtkSmartPointer ugrid = > vtkSmartPointer::New(); > ugrid->DeepCopy(sgrid); > filter->AddInputData(ugrid); - VTK 7.1.1 works with: > vtkSmartPointer sgrid = createGrid(i, i+10, j,j+10, k, > k+10); > filter->AddInputData(sgrid); - VTK 8.1.1 works with both, with the correct number of cells. So it looks more like a bug with VTK 6.3 and 7.1.1. Do the VTK developers release patches for old VTK versions? Is it worth filing a bug report...? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From Zoltan.Kovacs at esi-group.com Thu Aug 9 10:14:27 2018 From: Zoltan.Kovacs at esi-group.com (Zoltan Kovacs) Date: Thu, 9 Aug 2018 14:14:27 +0000 Subject: [vtkusers] Scale for QVTKOpenGLWidget. Message-ID: Dear all, I use the example https://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/ReadSTL to read STL files which works fine with proper auto scales for any STL object in the screen. However, when I read and render an STL file with the same code but in a QVTKOpenGLWidget then the loaded STL object is too small in the screen and I need to zoom it. Is there any way to make the auto scale properly for this widget as in the case of the example code? Thank you for your help! Kind regards, Zoltan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tj.corona at kitware.com Thu Aug 9 10:26:40 2018 From: tj.corona at kitware.com (T.J. Corona) Date: Thu, 9 Aug 2018 07:26:40 -0700 (MST) Subject: [vtkusers] What is the most current pattern/reference for using VTK for finite element post-processing? In-Reply-To: <1528817981603-0.post@n5.nabble.com> References: <1528817981603-0.post@n5.nabble.com> Message-ID: <1533824800604-0.post@n5.nabble.com> Hi Doug, For some time now VTK has had partial support for higher-order cells of fixed order (mostly quadratic), and more recently we have added generic support for cells up to sixth order using the Lagrange basis (see the vtkLagrange(Curve/Triangle/Quadrilateral/Tetra/Hexahedron/Wedge) classes). We are in the process of preparing an article describing these cells, and I?d be happy to let you know when the article is publicly available. In the meantime, I can answer any questions you have about how to use these new vtk cell types. Sincerely, T.J. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From sankhesh.jhaveri at kitware.com Thu Aug 9 10:55:50 2018 From: sankhesh.jhaveri at kitware.com (Sankhesh Jhaveri) Date: Thu, 9 Aug 2018 10:55:50 -0400 Subject: [vtkusers] Scale for QVTKOpenGLWidget. In-Reply-To: References: Message-ID: Hi Zoltan, You need to call vtkRenderer::ResetCamera() after adding the actor to the renderer. Best, Sankhesh ? On Thu, Aug 9, 2018 at 10:14 AM Zoltan Kovacs wrote: > Dear all, > > > > I use the example https://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/ReadSTL to > read STL files which works fine with proper auto scales for any STL object > in the screen. However, when I read and render an STL file with the same > code but in a QVTKOpenGLWidget then the loaded STL object is too small in > the screen and I need to zoom it. Is there any way to make the auto scale > properly for this widget as in the case of the example code? Thank you for > your help! > > > > Kind regards, > > Zoltan > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -- Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware | (518) 881-4417 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From Zoltan.Kovacs at esi-group.com Thu Aug 9 11:06:56 2018 From: Zoltan.Kovacs at esi-group.com (Zoltan Kovacs) Date: Thu, 9 Aug 2018 15:06:56 +0000 Subject: [vtkusers] Scale for QVTKOpenGLWidget. In-Reply-To: References: Message-ID: Hi Sankhesh, Oh yes, it works perfectly! Thank you very much! Kind regards, Zoltan From: Sankhesh Jhaveri Sent: Donnerstag, 9. August 2018 16:56 To: Zoltan Kovacs Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Scale for QVTKOpenGLWidget. Hi Zoltan, You need to call vtkRenderer::ResetCamera() after adding the actor to the renderer. Best, Sankhesh ? On Thu, Aug 9, 2018 at 10:14 AM Zoltan Kovacs > wrote: Dear all, I use the example https://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/ReadSTL to read STL files which works fine with proper auto scales for any STL object in the screen. However, when I read and render an STL file with the same code but in a QVTKOpenGLWidget then the loaded STL object is too small in the screen and I need to zoom it. Is there any way to make the auto scale properly for this widget as in the case of the example code? Thank you for your help! Kind regards, Zoltan _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: https://public.kitware.com/mailman/listinfo/vtkusers -- Sankhesh Jhaveri Sr. Research & Development Engineer | Kitware | (518) 881-4417 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From craig.branch at virginmedia.com Thu Aug 9 11:38:27 2018 From: craig.branch at virginmedia.com (cbranch171) Date: Thu, 9 Aug 2018 08:38:27 -0700 (MST) Subject: [vtkusers] MFC GUI SUPOORT Message-ID: <1533829107981-0.post@n5.nabble.com> I'm trying to use visual studio and SampleMFC with a x64 build. I get the following errors: 'ResumeScreenRendering': is not a member of 'vtkWin32OpenGLRenderWindow' 'GetMemoryData': is not a member of 'vtkWin32OpenGLRenderWindow' 'SetupMemoryRendering': is not a member of 'vtkWin32OpenGLRenderWindow' What is the equivalent OpenGLRenderWindow for x64 build. Or how do I access these member functions. Thanks -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From dave.demarle at kitware.com Thu Aug 9 11:45:14 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Thu, 9 Aug 2018 11:45:14 -0400 Subject: [vtkusers] MFC GUI SUPOORT In-Reply-To: <1533829107981-0.post@n5.nabble.com> References: <1533829107981-0.post@n5.nabble.com> Message-ID: MFC support has not been maintained since VTK 6.0 or so. The particular errors you are running into are an incompatibility with the VTK->MFC interface and the newer OpenGL2 rendering backend. If you switch back to the legacy backend (in your cmake configure of VTK set RENDERING_BACKEND to OpenGL) you will get further along. David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Thu, Aug 9, 2018 at 11:38 AM cbranch171 via vtkusers < vtkusers at public.kitware.com> wrote: > I'm trying to use visual studio and SampleMFC with a x64 build. > > I get the following errors: > > 'ResumeScreenRendering': is not a member of 'vtkWin32OpenGLRenderWindow' > 'GetMemoryData': is not a member of 'vtkWin32OpenGLRenderWindow' > 'SetupMemoryRendering': is not a member of 'vtkWin32OpenGLRenderWindow' > > What is the equivalent OpenGLRenderWindow for x64 build. Or how do I access > these member functions. > > Thanks > > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joechenrh at gmail.com Thu Aug 9 22:02:43 2018 From: joechenrh at gmail.com (joechen) Date: Thu, 9 Aug 2018 19:02:43 -0700 (MST) Subject: [vtkusers] Question about vtkQuadricDecimation Message-ID: <1533866563606-0.post@n5.nabble.com> Hi? I have two .obj files, they are exactly the same except the precision of vertices. But when I run vtkQuadricDecimation, the first one only needs about one minute while the second one needs more than fifteen minutes and I can't figure out the reason. I have uploaded two models. Can anyone help me? Thanks. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From joechenrh at gmail.com Thu Aug 9 22:18:19 2018 From: joechenrh at gmail.com (joechen) Date: Thu, 9 Aug 2018 19:18:19 -0700 (MST) Subject: [vtkusers] Question about vtkQuadricDecimation Message-ID: <1533867499234-0.post@n5.nabble.com> Hi? I have two .obj files, they are exactly the same except the precision of vertices. But when I run vtkQuadricDecimation, the first one only needs about one minute while the second one needs more than fifteen minutes and I can't figure out the reason. I have uploaded two models. Can anyone help me? Thanks. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From mey1k at naver.com Fri Aug 10 05:11:31 2018 From: mey1k at naver.com (minjun) Date: Fri, 10 Aug 2018 02:11:31 -0700 (MST) Subject: [vtkusers] is there any idea? create isosurface Message-ID: <1533892291732-0.post@n5.nabble.com> Hello, i want this... i use this code vtkSmartPointer implicitModeller = vtkImplicitModeller::New(); implicitModeller->SetSampleDimensions(30, 30, 30); implicitModeller->SetInputData(TmpPolydata); implicitModeller->AdjustBoundsOn(); implicitModeller->SetAdjustDistance(.1); // Adjust by 10% implicitModeller->SetMaximumDistance(.1); double bounds[6]; TmpPolydata->GetBounds(bounds); double xrange = bounds[1] - bounds[0]; // Create the 0 isosurface vtkSmartPointer contourFilter = vtkSmartPointer::New(); contourFilter->SetInputConnection(implicitModeller->GetOutputPort()); //contourFilter->SetValue(0, xrange / 10.0); // 30% of xrange contourFilter->SetValue(0, xrange/20.0); so i can get first image.. i want to get second image.. is there any idea? please help me -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From srbn.ghosh99 at gmail.com Fri Aug 10 08:40:30 2018 From: srbn.ghosh99 at gmail.com (Shrabani Ghosh) Date: Fri, 10 Aug 2018 05:40:30 -0700 (MST) Subject: [vtkusers] Printing the values an vtkSmartPointer object In-Reply-To: <1533761573706-0.post@n5.nabble.com> References: <1533761573706-0.post@n5.nabble.com> Message-ID: <1533904830508-0.post@n5.nabble.com> I want to print all the elements of the VTKSmartPointer List. Like we can print the elements of a list in C++. Like here : vtkSmartPointer organizedCellList = orderCellList(unorderedCellList, pdata); I want to see the size of the organizedCellList and print all the elements of it. Something like this, cout << "list " << (int) organizedCellList.size() << endl; -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From rccm.kyoshimi at gmail.com Fri Aug 10 23:08:37 2018 From: rccm.kyoshimi at gmail.com (kenichiro yoshimi) Date: Sat, 11 Aug 2018 12:08:37 +0900 Subject: [vtkusers] How to extract a region using a box? In-Reply-To: References: Message-ID: Hi, The Filter>Extract Cells By Region in ParaView uses vtkExtractGeometry class internally. So the following example may be helpful to automate polygon extractions with a specified box. --- ExtractGeometry.cxx --- #include #include #include #include #include #include #include #include #include #include #include int main (int, char *[]) { vtkSmartPointer sphere = vtkSmartPointer::New(); sphere->SetRadius(0.5); sphere->SetPhiResolution(50); sphere->SetThetaResolution(50); sphere->Update(); vtkSmartPointer transform = vtkSmartPointer::New(); transform->PreMultiply(); transform->RotateZ(30.0); transform->Translate(0.5, 0.0, 0.0); vtkSmartPointer box = vtkSmartPointer::New(); box->SetBounds(-0.5, 0.5, -0.5, 0.5, -0.5, 0.5); box->SetTransform(transform); vtkSmartPointer extractGeometry = vtkSmartPointer::New(); extractGeometry->SetInputData(sphere->GetOutput()); extractGeometry->SetImplicitFunction(box); extractGeometry->ExtractInsideOn(); extractGeometry->ExtractBoundaryCellsOn(); vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(extractGeometry->GetOutputPort()); vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); actor->GetProperty()->SetColor(0.8900, 0.8100, 0.3400); // Create graphics stuff // vtkSmartPointer ren = vtkSmartPointer::New(); ren->SetBackground(.3, .4, .6); vtkSmartPointer renWin = vtkSmartPointer::New(); renWin->AddRenderer(ren); renWin->SetSize(512,512); vtkSmartPointer iren = vtkSmartPointer::New(); iren->SetRenderWindow(renWin); // Add the actors to the renderer, set the background and size // ren->AddActor(actor); // Generate an interesting view // ren->ResetCamera(); ren->GetActiveCamera()->Azimuth(120); ren->GetActiveCamera()->Elevation(30); ren->GetActiveCamera()->Dolly(1.0); ren->ResetCameraClippingRange(); iren->Initialize(); iren->Start(); return EXIT_SUCCESS; } --- CMakeLists.txt --- cmake_minimum_required(VERSION 2.8) PROJECT(ExtractGeometry) find_package(VTK REQUIRED) include(${VTK_USE_FILE}) add_executable(ExtractGeometry MACOSX_BUNDLE ExtractGeometry.cxx ) target_link_libraries(ExtractGeometry ${VTK_LIBRARIES}) --- Regards 2018?8?9?(?) 16:51 Polly Pui : > > Hi, > > Can anyone please tell me how can I do extract a region by providing a box (which we can set the size of it) on a polydata? > > I could do it manually in Paraview by selecting the Filter>Extract Cells By Region. > > However, I have more than 1000 dataset. It is time consuming if I apply it manually for each dataset. > > > Thanks! > > > Best, > > Polly > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers From newcfd at yahoo.com Sat Aug 11 03:37:07 2018 From: newcfd at yahoo.com (newcfd) Date: Sat, 11 Aug 2018 00:37:07 -0700 (MST) Subject: [vtkusers] the actor display is very slow after vtkRenderer->Render() is called Message-ID: <1533973027651-0.post@n5.nabble.com> A grid is loaded and an actor is generated. After vtkRenderer->Render() call is finished, it takes long for the actor to be displayed. Any thoughts? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From newcfd at yahoo.com Sat Aug 11 04:00:53 2018 From: newcfd at yahoo.com (newcfd) Date: Sat, 11 Aug 2018 01:00:53 -0700 (MST) Subject: [vtkusers] qxcbintegration cannot create platform opengl context neither glx nor egl are enabled In-Reply-To: References: <1533783090404-0.post@n5.nabble.com> Message-ID: <1533974453506-0.post@n5.nabble.com> it looks like QVTKOpenGLWidget does not support Ubuntu on vmWare because the OpenGL version in it is only 3.3. Higher version of OpenGL is required. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From anton.coetzee at karasu.co.za Sun Aug 12 09:41:05 2018 From: anton.coetzee at karasu.co.za (Anton Coetzee) Date: Sun, 12 Aug 2018 15:41:05 +0200 Subject: [vtkusers] Weird problem with vtkAssembly and vtkBillboardTextActor3D Message-ID: Hi all I?m having a weird problem with these two. I?m using a bunch of vtkBillboardTextActor3D, and when I add them individually to the renderer (renderer.addActor), they work fine. However - when I add them to an assembly, which I then add to the renderer, two things happen: 1. When I list the parts in the assembly, they don?t show up (all the other parts added before them are there). 2. When I add the assembly to the renderer, they do in fact render, but their position is wrong - they?re all at the origin (0, 0, 0). Is it something stupid that I?m doing? Thanks! From minpu.code at gmail.com Sun Aug 12 21:42:06 2018 From: minpu.code at gmail.com (pnt1614) Date: Sun, 12 Aug 2018 18:42:06 -0700 (MST) Subject: [vtkusers] How to customize a vtkPolyLineWidget? Message-ID: <1534124526314-0.post@n5.nabble.com> I am trying to customize the vtkPolyLineWidget, so I a class (MyPolyLineWidget) derived from the vtkPolyLineWidget. However, there is a problem about accessing and casting. I cannot access the Interactor member and I cannot cast from vtkAbstractWidget the MyPolyLineWidget. Is there anyway to solve these two problems? Thank you. -----------In the header (.h) file----------- class MyPolyLineWidget : public vtkPolyLineWidget { public: static MyPolyLineWidget *New() { return new MyPolyLineWidget; }; MyPolyLineWidget(); ~MyPolyLineWidget(); protected: static void MySelectAction(vtkAbstractWidget*); static void MyEndSelectAction(vtkAbstractWidget*); static void MyTranslateAction(vtkAbstractWidget*); static void MyScaleAction(vtkAbstractWidget*); static void MyMoveAction(vtkAbstractWidget*); }; //---------In the implementation (.cpp) file-------- vtkStandardNewMacro(vtkPolyLineWidget); //---------------------------------------------------------------------------- vtkPolyLineWidget::vtkPolyLineWidget() { this->WidgetState = vtkPolyLineWidget::Start; this->ManagesCursor = 1; // Define widget events this->CallbackMapper->SetCallbackMethod(vtkCommand::LeftButtonPressEvent, vtkWidgetEvent::Select, this, vtkPolyLineWidget::SelectAction); this->CallbackMapper->SetCallbackMethod(vtkCommand::LeftButtonReleaseEvent, vtkWidgetEvent::EndSelect, this, vtkPolyLineWidget::EndSelectAction); this->CallbackMapper->SetCallbackMethod(vtkCommand::MiddleButtonPressEvent, vtkWidgetEvent::Translate, this, vtkPolyLineWidget::TranslateAction); this->CallbackMapper->SetCallbackMethod(vtkCommand::MiddleButtonReleaseEvent, vtkWidgetEvent::EndTranslate, this, vtkPolyLineWidget::EndSelectAction); this->CallbackMapper->SetCallbackMethod(vtkCommand::RightButtonPressEvent, vtkWidgetEvent::Scale, this, vtkPolyLineWidget::ScaleAction); this->CallbackMapper->SetCallbackMethod(vtkCommand::RightButtonReleaseEvent, vtkWidgetEvent::EndScale, this, vtkPolyLineWidget::EndSelectAction); this->CallbackMapper->SetCallbackMethod(vtkCommand::MouseMoveEvent, vtkWidgetEvent::Move, this, vtkPolyLineWidget::MoveAction); } //---------------------------------------------------------------------------- vtkPolyLineWidget::~vtkPolyLineWidget() { } //---------------------------------------------------------------------- void vtkPolyLineWidget::SelectAction(vtkAbstractWidget *w) { // I cannot cast from the vtkAbstractWidget to MyPolyLineWidget vtkPolyLineWidget *self = vtkPolyLineWidget::SafeDownCast(w); // There is an error in the two following statement // since Interactor is a protected member in the vtkPolyLineWidget int X = self->Interactor->GetEventPosition()[0]; int Y = self->Interactor->GetEventPosition()[1]; // Okay, make sure that the pick is in the current renderer if ( !self->CurrentRenderer || !self->CurrentRenderer->IsInViewport(X,Y) ) { self->WidgetState = vtkPolyLineWidget::Start; return; } //... } // Other empty static functions -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From minpu.code at gmail.com Sun Aug 12 22:51:09 2018 From: minpu.code at gmail.com (pnt1614) Date: Sun, 12 Aug 2018 19:51:09 -0700 (MST) Subject: [vtkusers] How to customize a vtkPolyLineWidget? In-Reply-To: <1534124526314-0.post@n5.nabble.com> References: <1534124526314-0.post@n5.nabble.com> Message-ID: <1534128669058-0.post@n5.nabble.com> I found a solution. Instead of deriving the vtkPolyLineWidget, I create a new class which is the same with the vtkPolyLineWidget and then modify this class directly. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From dsbabkov at gmail.com Mon Aug 13 02:33:16 2018 From: dsbabkov at gmail.com (Dmitriy Babkov) Date: Mon, 13 Aug 2018 09:33:16 +0300 Subject: [vtkusers] How to display vtkMappedUnstructuredGrid with my Implementation class In-Reply-To: References: <1533620742896-0.post@n5.nabble.com> Message-ID: Apologize for the timing. > Many algorithms reuse the same vtkIdList object in repeated calls to > GetPointIds, since the memory can often be reused without reallocating. > Thank you for this. Best for me was using Reset method in example. I think I'll try to use vtkMappedUnstructuredGrid for my project to get fast result. Then I'll try to measure RAM and algorithm time consumption of vtk classes and if it satisfy my project requirements, I'll replace my classes with vtkUnstructuredGrid. Thank's a lot for the help! Best regards, Dmitriy. 2018-08-08 17:10 GMT+03:00 Allie Vacanti : > On Wed, Aug 8, 2018 at 4:39 AM, ??????? ?????? wrote: > >> Allie, thank you very much! >> I don't believe, that I missed points data. I was sure, that it was used >> in Implementation class. >> Now I am able to run UGrid example on mapped grid. There was one more >> issue: I had to call Allocate for vtkIdList *ptIds in GetCellPoints method. >> Otherwise I can see corrupted elements. I don't know is it normal to VTK >> preallocate list or it's just mapped grid class issue. >> > > In the original implementation of GetCellPoints, you had: > > const Element &element = elements[cellId]; > for (vtkIdType i = 0; i < element.pointsCount; ++i) { > ptIds->InsertNextId(element.points[i]); > } > > The issue here is that calling InsertNextId always appends to the ptIds, > without clear old data first. So the list will always keep growing. Many > algorithms reuse the same vtkIdList object in repeated calls to > GetPointIds, since the memory can often be reused without reallocating. In > this case, you'll definitely see incorrect results. > > As you mentioned, resizing the list and setting elements explicitly by > index would fix this. Class methods in VTK are expected to manually set the > size of these containers prior to filling them. > > I have no idea which classes VTK should I use for better performance and >> RAM consumption in my project, because I have no experience with VTK >> Let me tell you some features of project: >> - Goal of project is to display loaded from custom or known format FEM >> tetra mesh, modify it and save to custom format >> - There are element/face/node selectors, sections constructed with user >> planes, display feature angles (edges). >> - Each face of element has it color from global list of ~100 colors. >> - Elements grouped in collectors and visible of collectors can be >> toggled. >> - It will not be run on HPC node, I think >> >> Memory consumption of application now is about 2-3Gb if i load ~10M >> elements. >> The reason of taking mapped grid was usage of VTK rendering and, maybe, >> VTK algorithms without significant additional RAM consumption. >> Will it be reasonable to build my own vtkPolyData for each type of >> objects (mesh, sections, selected elements/faces/nodes)? It seems VTK >> algorithms can work better than mine and with less issues. Also it seems It >> will take less time. >> > > The mapped unstructured grid was originally intended to be used in a > workflow such as: > > 1) Generate large dataset in a native format > 2) Create MappedUnstructuredGrid wrapper around native data > 3) Use a VTK algorithm to massively reduce the data (extract faces, > threshold, clip, etc) > 4) Create a renderable vtkPolyData of the reduced dataset that will fit in > memory > > as opposed to creating a large in-memory copy of the complete dataset in > step two. > > If you plan to use a simple pipeline, or a filter that converts to a > different dataset type early in the pipeline, you should be fine with the > mapped unstructured grid. The only caution is that not all filters that > work on vtkUnstructuredGrid will work with vtkMappedUnstructuredGrid, > though many will. > > It makes sense that you want to let VTK handle the conversion of the > dataset to a renderable form. In this case, I'd say try using the mapped > grid and see if it works for you on the filters you wish to use. But if you > run into to trouble, you may need to update a troublesome filter to work on > a vtkUnstructuredGridBase instead of vtkUnstructuredGrid, or switch to > using vtkUnstructuredGrid directly instead of a vtkMappedUnstructuredGrid. > > Allie > > ??, 7 ???. 2018 ?. ? 20:19, Allie Vacanti : >> >>> The rendering engine is shortcircuiting because the dataset has no >>> coordinate information (the `x` array is never used by the mapped grid >>> implementation -- `mesh->GetPoints()` is returning nullptr). Adding >>> `mesh->SetPoints(points);` to the test script will complete the dataset and >>> let the renderer progress. >>> >>> Be warned, however, that the mapped unstructured grid stuff is not >>> widely used and there may be some further issues lurking as you go farther >>> with it. They may be a need to debug/patch VTK itself if you want to use it. >>> >>> I should also point out that the mapped unstructured grid is not used >>> directly in the rendering -- it is first converted to a `vtkPolyData` by a >>> `vtkDataSetSurfaceFilter` inside of the `vtkDataSetMapper`. If you >>> encounter a lot of issues with the mapped grid, you may find it easier to >>> just build a `vtkPolyData` directly from your application's data. The >>> mapped grids were intended to be used on extremely large simulation >>> datasets that could not be physically copied without running out of memory >>> on an HPC node -- if that's not your usecase, directly building the >>> `vtkPolyData` will likely save you a lot of hassle. >>> >>> HTH, >>> Allie >>> >>> On Tue, Aug 7, 2018 at 1:45 AM, dsbabkov wrote: >>> >>>> Hello, everyone! >>>> I'm new to VTK and would like to use it in my project instead of my own >>>> OpenGL rendering system; >>>> I think, I need to keep data structures as it is and it seems I have to >>>> use >>>> vtkMappedUnstructuredGrid class. >>>> I found an example UGrid, which demonstrates, how to work with >>>> vtkUnstructuredGrid. >>>> To examine vtkMappedUnstructuredGrid I decided to modify this example. I >>>> have implemented required by manual Implementation class methods and >>>> replaced usage of vtkUnstructuredGrid to vtkMappedUnstructuredGrid with >>>> my >>>> Implementation. But nothing is displayed... I was trying to set >>>> breakpoints >>>> to vtkMappedUnstructuredGrid template methods to understand, what I have >>>> missed, but it seems no methods called to request data information. Only >>>> constructor, destructor and GetMTime, which seems not required to be >>>> implemented in Implementation class. >>>> Here is my c++ code: main.cpp >>>> >>>> And CMake project file: CMakeLists.txt >>>> >>>> Please, help me to understand this template class and find my fault. >>>> My OS is arch linux and VTK vtk-8.1.0 installed. >>>> >>>> >>>> >>>> -- >>>> Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ at: >>>> http://www.vtk.org/Wiki/VTK_FAQ >>>> >>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> https://public.kitware.com/mailman/listinfo/vtkusers >>>> >>> >>> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mathieu.westphal at kitware.com Mon Aug 13 05:16:02 2018 From: mathieu.westphal at kitware.com (Mathieu Westphal) Date: Mon, 13 Aug 2018 11:16:02 +0200 Subject: [vtkusers] qxcbintegration cannot create platform opengl context neither glx nor egl are enabled In-Reply-To: <1533974453506-0.post@n5.nabble.com> References: <1533783090404-0.post@n5.nabble.com> <1533974453506-0.post@n5.nabble.com> Message-ID: Hi, Absolutelly. virtual box should work though, if you set MESA_GL_OVERRIDE. Or switch to bare metal if possible. Best regards, Mathieu Westphal On Sat, Aug 11, 2018 at 10:00 AM, newcfd via vtkusers < vtkusers at public.kitware.com> wrote: > it looks like QVTKOpenGLWidget does not support Ubuntu on vmWare because > the > OpenGL version in it is only 3.3. Higher version of OpenGL is required. > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From polly_sukting at hotmail.com Mon Aug 13 11:54:47 2018 From: polly_sukting at hotmail.com (Polly Pui) Date: Mon, 13 Aug 2018 15:54:47 +0000 Subject: [vtkusers] How to extract a region using a box? In-Reply-To: References: , Message-ID: Thanks Kenichiro! This is what i am looking for. I could run your example smoothly. However, I tried to run with my data and adjusted the transform values that i applied in Paraview, there was nothing extracted. I tried with a larger scale but it happened to be the same. My dataset is frontal and centre with origin. Is there anything that i have to adjust to get the extracted area? Polly ________________________________ From: kenichiro yoshimi Sent: Saturday, August 11, 2018 11:08 AM To: polly_sukting at hotmail.com Cc: vtkusers Subject: Re: [vtkusers] How to extract a region using a box? Hi, The Filter>Extract Cells By Region in ParaView uses vtkExtractGeometry class internally. So the following example may be helpful to automate polygon extractions with a specified box. --- ExtractGeometry.cxx --- #include #include #include #include #include #include #include #include #include #include #include int main (int, char *[]) { vtkSmartPointer sphere = vtkSmartPointer::New(); sphere->SetRadius(0.5); sphere->SetPhiResolution(50); sphere->SetThetaResolution(50); sphere->Update(); vtkSmartPointer transform = vtkSmartPointer::New(); transform->PreMultiply(); transform->RotateZ(30.0); transform->Translate(0.5, 0.0, 0.0); vtkSmartPointer box = vtkSmartPointer::New(); box->SetBounds(-0.5, 0.5, -0.5, 0.5, -0.5, 0.5); box->SetTransform(transform); vtkSmartPointer extractGeometry = vtkSmartPointer::New(); extractGeometry->SetInputData(sphere->GetOutput()); extractGeometry->SetImplicitFunction(box); extractGeometry->ExtractInsideOn(); extractGeometry->ExtractBoundaryCellsOn(); vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(extractGeometry->GetOutputPort()); vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); actor->GetProperty()->SetColor(0.8900, 0.8100, 0.3400); // Create graphics stuff // vtkSmartPointer ren = vtkSmartPointer::New(); ren->SetBackground(.3, .4, .6); vtkSmartPointer renWin = vtkSmartPointer::New(); renWin->AddRenderer(ren); renWin->SetSize(512,512); vtkSmartPointer iren = vtkSmartPointer::New(); iren->SetRenderWindow(renWin); // Add the actors to the renderer, set the background and size // ren->AddActor(actor); // Generate an interesting view // ren->ResetCamera(); ren->GetActiveCamera()->Azimuth(120); ren->GetActiveCamera()->Elevation(30); ren->GetActiveCamera()->Dolly(1.0); ren->ResetCameraClippingRange(); iren->Initialize(); iren->Start(); return EXIT_SUCCESS; } --- CMakeLists.txt --- cmake_minimum_required(VERSION 2.8) PROJECT(ExtractGeometry) find_package(VTK REQUIRED) include(${VTK_USE_FILE}) add_executable(ExtractGeometry MACOSX_BUNDLE ExtractGeometry.cxx ) target_link_libraries(ExtractGeometry ${VTK_LIBRARIES}) --- Regards 2018?8?9?(?) 16:51 Polly Pui : > > Hi, > > Can anyone please tell me how can I do extract a region by providing a box (which we can set the size of it) on a polydata? > > I could do it manually in Paraview by selecting the Filter>Extract Cells By Region. > > However, I have more than 1000 dataset. It is time consuming if I apply it manually for each dataset. > > > Thanks! > > > Best, > > Polly > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From polly_sukting at hotmail.com Mon Aug 13 11:59:57 2018 From: polly_sukting at hotmail.com (Polly Pui) Date: Mon, 13 Aug 2018 15:59:57 +0000 Subject: [vtkusers] How to extract a region using a box? In-Reply-To: References: , Message-ID: Hi, I tested using the values below with fran_cut.vtk but I failed to get the area. Please advice. Thank you so much! vtkSmartPointer transform = vtkSmartPointer::New(); transform->PreMultiply(); transform->RotateZ(0.0); transform->RotateY(0.0); transform->RotateX(0.0); transform->Translate(0.5, -10.0, -590.0); transform->Scale(0.5, 0.2, 0.6); vtkSmartPointer box = vtkSmartPointer::New(); box->SetBounds(-1.0, 1.0, -1.0, 1.0, -0.6, 0.6); box->SetTransform(transform); ________________________________ From: kenichiro yoshimi Sent: Saturday, August 11, 2018 11:08 AM To: polly_sukting at hotmail.com Cc: vtkusers Subject: Re: [vtkusers] How to extract a region using a box? Hi, The Filter>Extract Cells By Region in ParaView uses vtkExtractGeometry class internally. So the following example may be helpful to automate polygon extractions with a specified box. --- ExtractGeometry.cxx --- #include #include #include #include #include #include #include #include #include #include #include int main (int, char *[]) { vtkSmartPointer sphere = vtkSmartPointer::New(); sphere->SetRadius(0.5); sphere->SetPhiResolution(50); sphere->SetThetaResolution(50); sphere->Update(); vtkSmartPointer transform = vtkSmartPointer::New(); transform->PreMultiply(); transform->RotateZ(30.0); transform->Translate(0.5, 0.0, 0.0); vtkSmartPointer box = vtkSmartPointer::New(); box->SetBounds(-0.5, 0.5, -0.5, 0.5, -0.5, 0.5); box->SetTransform(transform); vtkSmartPointer extractGeometry = vtkSmartPointer::New(); extractGeometry->SetInputData(sphere->GetOutput()); extractGeometry->SetImplicitFunction(box); extractGeometry->ExtractInsideOn(); extractGeometry->ExtractBoundaryCellsOn(); vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(extractGeometry->GetOutputPort()); vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); actor->GetProperty()->SetColor(0.8900, 0.8100, 0.3400); // Create graphics stuff // vtkSmartPointer ren = vtkSmartPointer::New(); ren->SetBackground(.3, .4, .6); vtkSmartPointer renWin = vtkSmartPointer::New(); renWin->AddRenderer(ren); renWin->SetSize(512,512); vtkSmartPointer iren = vtkSmartPointer::New(); iren->SetRenderWindow(renWin); // Add the actors to the renderer, set the background and size // ren->AddActor(actor); // Generate an interesting view // ren->ResetCamera(); ren->GetActiveCamera()->Azimuth(120); ren->GetActiveCamera()->Elevation(30); ren->GetActiveCamera()->Dolly(1.0); ren->ResetCameraClippingRange(); iren->Initialize(); iren->Start(); return EXIT_SUCCESS; } --- CMakeLists.txt --- cmake_minimum_required(VERSION 2.8) PROJECT(ExtractGeometry) find_package(VTK REQUIRED) include(${VTK_USE_FILE}) add_executable(ExtractGeometry MACOSX_BUNDLE ExtractGeometry.cxx ) target_link_libraries(ExtractGeometry ${VTK_LIBRARIES}) --- Regards 2018?8?9?(?) 16:51 Polly Pui : > > Hi, > > Can anyone please tell me how can I do extract a region by providing a box (which we can set the size of it) on a polydata? > > I could do it manually in Paraview by selecting the Filter>Extract Cells By Region. > > However, I have more than 1000 dataset. It is time consuming if I apply it manually for each dataset. > > > Thanks! > > > Best, > > Polly > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From hareem.nisar94 at gmail.com Mon Aug 13 14:04:48 2018 From: hareem.nisar94 at gmail.com (Hareem Nisar) Date: Mon, 13 Aug 2018 14:04:48 -0400 Subject: [vtkusers] Texture Mapping to a Cone source Message-ID: Hello, I have: - A cone source (3D object) - A square image with concentric circles drawn on it (texture) How can I texture map the image to the cone source? given that the center of the image (also the center of all concentric circles) should be mapped to the apex of the cone. Just as an example: image/texture looks like this and cone source object like this. P.S. I am new to VTK. I have tried TextureMapToPlane and TextureMapToSphere. Thank you -- Regards, Hareem -------------- next part -------------- An HTML attachment was scrubbed... URL: From purvesmh at ornl.gov Mon Aug 13 14:11:09 2018 From: purvesmh at ornl.gov (Purves, Murray) Date: Mon, 13 Aug 2018 18:11:09 +0000 Subject: [vtkusers] Add error bars to a 2D scatter plot Message-ID: <8bbb05f93d4742f5aee3394a5c600167@EXCHCS32.ornl.gov> Hi, Is there a way to add error bars to scatter plot data using VTK? I am currently plotting point data using the C++ API; there is uncertainty associated with the data I am trying to plot which I would like to visualise also. I can't find any obvious references in the documentation to error bars; the only mention I have found is in?a presentation at: https://na-mic.org/w/images/1/18/NA-MIC-VTK-Charts-2011.pdf, which doesn't seem to be a function that exists. Sample code snippet: // Chart source data is populated etc... vtkPlot* sampleScatter = chartXY->AddPlot(vtkChart::POINTS); sampleScatter->SetInputData(chartDataTable, 0, 1); // Here is where I would like to add the error bars - // below method is from the link, and does not work vtkPlotPoints::SafeDownCast(sampleScatter)->SetErrorArray(errorData.GetPointer()); // Chart is rendered... where?chartXY?is a?vtkChartXY?object and?chartDataTable?is a?vtkTable?containing the x and y data in columns 0 and 1. Is there a way to populate error data for visualisation in a similar fashion to the above, or will I have to roll my own chart type? Many thanks Murray From rccm.kyoshimi at gmail.com Mon Aug 13 21:11:31 2018 From: rccm.kyoshimi at gmail.com (kenichiro yoshimi) Date: Tue, 14 Aug 2018 10:11:31 +0900 Subject: [vtkusers] How to extract a region using a box? In-Reply-To: References: Message-ID: Hello Polly, It may be helpful to get the bounds of the polydata by GetBounds() method because vtkBox is defined with bounds. In the case that uses fran_cut.vtk, there is something like below. --- double bounds[6]; auto fran_cut = vtkPolyData::SafeDownCast(reader->GetOutput()); fran_cut->GetBounds(bounds); vtkSmartPointer transform = vtkSmartPointer::New(); transform->PreMultiply(); transform->RotateZ(0.0); transform->RotateY(0.0); transform->RotateX(0.0); transform->Scale(1, 0.4, 1); transform->Translate(0, 0, 0); vtkSmartPointer box = vtkSmartPointer::New(); box->SetBounds(bounds); box->SetTransform(transform); --- Besides, if it is difficult for you to adjust the transform values that you applied in ParaView, you might as well use Python scripting in ParaView. In that case, you are more likely to get a better answer if you post to the ParaView discussion forum: https://discourse.paraview.org/ Thanks 2018?8?14?(?) 1:00 Polly Pui : > > > Hi, > I tested using the values below with fran_cut.vtk but I failed to get the area. > Please advice. Thank you so much! > > vtkSmartPointer transform = > vtkSmartPointer::New(); > transform->PreMultiply(); > transform->RotateZ(0.0); > transform->RotateY(0.0); > transform->RotateX(0.0); > transform->Translate(0.5, -10.0, -590.0); > transform->Scale(0.5, 0.2, 0.6); > vtkSmartPointer box = > vtkSmartPointer::New(); > box->SetBounds(-1.0, 1.0, -1.0, 1.0, -0.6, 0.6); > box->SetTransform(transform); > > > > ________________________________ > From: kenichiro yoshimi > Sent: Saturday, August 11, 2018 11:08 AM > To: polly_sukting at hotmail.com > Cc: vtkusers > Subject: Re: [vtkusers] How to extract a region using a box? > > Hi, > > The Filter>Extract Cells By Region in ParaView uses vtkExtractGeometry > class internally. So the following example may be helpful to automate > polygon extractions with a specified box. > > --- ExtractGeometry.cxx --- > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > > int main (int, char *[]) > { > vtkSmartPointer sphere = > vtkSmartPointer::New(); > sphere->SetRadius(0.5); > sphere->SetPhiResolution(50); > sphere->SetThetaResolution(50); > sphere->Update(); > > vtkSmartPointer transform = > vtkSmartPointer::New(); > transform->PreMultiply(); > transform->RotateZ(30.0); > transform->Translate(0.5, 0.0, 0.0); > > vtkSmartPointer box = > vtkSmartPointer::New(); > box->SetBounds(-0.5, 0.5, -0.5, 0.5, -0.5, 0.5); > box->SetTransform(transform); > > vtkSmartPointer extractGeometry = > vtkSmartPointer::New(); > extractGeometry->SetInputData(sphere->GetOutput()); > extractGeometry->SetImplicitFunction(box); > extractGeometry->ExtractInsideOn(); > extractGeometry->ExtractBoundaryCellsOn(); > > vtkSmartPointer mapper = > vtkSmartPointer::New(); > mapper->SetInputConnection(extractGeometry->GetOutputPort()); > > vtkSmartPointer actor = > vtkSmartPointer::New(); > actor->SetMapper(mapper); > actor->GetProperty()->SetColor(0.8900, 0.8100, 0.3400); > > // Create graphics stuff > // > vtkSmartPointer ren = > vtkSmartPointer::New(); > ren->SetBackground(.3, .4, .6); > > vtkSmartPointer renWin = > vtkSmartPointer::New(); > renWin->AddRenderer(ren); > renWin->SetSize(512,512); > > vtkSmartPointer iren = > vtkSmartPointer::New(); > iren->SetRenderWindow(renWin); > > // Add the actors to the renderer, set the background and size > // > ren->AddActor(actor); > > // Generate an interesting view > // > ren->ResetCamera(); > ren->GetActiveCamera()->Azimuth(120); > ren->GetActiveCamera()->Elevation(30); > ren->GetActiveCamera()->Dolly(1.0); > ren->ResetCameraClippingRange(); > > iren->Initialize(); > iren->Start(); > > return EXIT_SUCCESS; > } > > --- CMakeLists.txt --- > cmake_minimum_required(VERSION 2.8) > > PROJECT(ExtractGeometry) > > find_package(VTK REQUIRED) > include(${VTK_USE_FILE}) > > add_executable(ExtractGeometry MACOSX_BUNDLE ExtractGeometry.cxx ) > > target_link_libraries(ExtractGeometry ${VTK_LIBRARIES}) > --- > > Regards > 2018?8?9?(?) 16:51 Polly Pui : > > > > Hi, > > > > Can anyone please tell me how can I do extract a region by providing a box (which we can set the size of it) on a polydata? > > > > I could do it manually in Paraview by selecting the Filter>Extract Cells By Region. > > > > However, I have more than 1000 dataset. It is time consuming if I apply it manually for each dataset. > > > > > > Thanks! > > > > > > Best, > > > > Polly > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > > > Follow this link to subscribe/unsubscribe: > > https://public.kitware.com/mailman/listinfo/vtkusers From scbiradar at gmail.com Tue Aug 14 07:54:33 2018 From: scbiradar at gmail.com (Santosh Biradar) Date: Tue, 14 Aug 2018 17:24:33 +0530 Subject: [vtkusers] vtkProbeFilter inconsistency Message-ID: Hi VTKers, I am trying to use the vtkProbeFilter on an unstructured data set. I am using a cell to point filter on my input dataset and trying to probe the output of the cell to point filter I have a snippet for what I am doing: #picker for getting the point picker = vtk.vtkCellPicker() picker.PickFromListOn() picker.AddPickList(c2pactor) picker.SetTolerance(0.000001*reader.GetOutput().GetLength()) picker.Pick(x, y, 0, renderer) points = picker.GetPickedPositions() numPoints = points.GetNumberOfPoints() print numPoints if numPoints < 1: return pnt = points.GetPoint(0) #probe filter pt = vtk.vtkPoints() pt.InsertPoint(0, x, y, z) polydata = vtk.vtkPolyData() polydata.SetPoints(pt) probe = vtk.vtkProbeFilter() probe.SetInputData(polydata) probe.SetSourceData(c2p.GetOutput()) probe.Update() val = probe.GetPolyDataOutput().GetPointData().GetScalars("T").GetRange(0)[0] Now, I am getting inconsistent behavior of the probe filter. Sometimes, I get the values of all the point data arrays as 0.0 for the probed location. I dont understand this behavior. It does work correctly but not always. Alternately, I tried using the picker.GetCellId() and picker.GetPointId() to directly fetch the value from the actor's input dataset (in this case, output of cell to point filter). Again here, the point id obtained always seems to be only a particular point in the cell irresepctive of whether probed location is near that point or any other point in that cell. So, I end up getting point data of a particular point in that cell no matter where I probe in that cell. Is using a vtkPointPicker the correct option here? Also, should I explore using vtkPointLocator/vtkCellLocator ? I hope the question is clear. I am using VTK-6.3 on Windows. Thanks, Santosh -------------- next part -------------- An HTML attachment was scrubbed... URL: From sujin.philip at kitware.com Tue Aug 14 10:09:24 2018 From: sujin.philip at kitware.com (Sujin Philip) Date: Tue, 14 Aug 2018 10:09:24 -0400 Subject: [vtkusers] vtkProbeFilter inconsistency In-Reply-To: References: Message-ID: Hi Santosh, I cannot say for sure what is going wrong in the probe filter without more information. Looking at your code it looks like all you want to do is to find a cell that contains a given point and get its cell attribute. An easier way to achieve that would be: tol2 = 1e-6; double pcoords[3]; double weights[8]; // size based on the max number of points in any of "input's" cells double pt[3] = { x, y, z }; auto cellId = input->FindCell(pt, NULL, -1, tol2, 0, pcoords, weights); auto attr = vtkDataArray::SafeDownCast(input->GetCellData().GetAbstractArray("T")); double val = 0.0; attr->GetTuple(cellId, &val); Hope this helps -Sujin On Tue, Aug 14, 2018 at 7:54 AM, Santosh Biradar wrote: > Hi VTKers, > > I am trying to use the vtkProbeFilter on an unstructured data set. I am > using a cell to point filter on my input dataset and trying to probe the > output of the cell to point filter > > I have a snippet for what I am doing: > > #picker for getting the point > picker = vtk.vtkCellPicker() > picker.PickFromListOn() > picker.AddPickList(c2pactor) > picker.SetTolerance(0.000001*reader.GetOutput().GetLength()) > picker.Pick(x, y, 0, renderer) > points = picker.GetPickedPositions() > numPoints = points.GetNumberOfPoints() > print numPoints > if numPoints < 1: > return > pnt = points.GetPoint(0) > > #probe filter > pt = vtk.vtkPoints() > pt.InsertPoint(0, x, y, z) > polydata = vtk.vtkPolyData() > polydata.SetPoints(pt) > probe = vtk.vtkProbeFilter() > probe.SetInputData(polydata) > probe.SetSourceData(c2p.GetOutput()) > > probe.Update() > > val = probe.GetPolyDataOutput().GetPointData().GetScalars("T") > .GetRange(0)[0] > > Now, I am getting inconsistent behavior of the probe filter. > Sometimes, I get the values of all the point data arrays as 0.0 for the > probed location. > I dont understand this behavior. It does work correctly but not always. > > > Alternately, I tried using the picker.GetCellId() and picker.GetPointId() > to directly fetch the value from the actor's input dataset (in this case, > output of cell to point filter). Again here, the point id obtained always > seems to be only a particular point in the cell irresepctive of whether > probed location is near that point or any other point in that cell. So, I > end up getting point data of a particular point in that cell no matter > where I probe in that cell. > Is using a vtkPointPicker the correct option here? > > Also, should I explore using vtkPointLocator/vtkCellLocator ? > > I hope the question is clear. I am using VTK-6.3 on Windows. > > Thanks, > Santosh > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From polly_sukting at hotmail.com Tue Aug 14 13:27:43 2018 From: polly_sukting at hotmail.com (Polly Pui) Date: Tue, 14 Aug 2018 17:27:43 +0000 Subject: [vtkusers] How to extract a region using a box? In-Reply-To: References: , Message-ID: Hi Kenichiro, Thank you so much for your example! I adjusted the values for the scale and translate and I could extract what I wanted. Thanks! Have a nice day! ________________________________ From: kenichiro yoshimi Sent: Tuesday, August 14, 2018 9:11 AM To: polly_sukting at hotmail.com Cc: vtkusers Subject: Re: [vtkusers] How to extract a region using a box? Hello Polly, It may be helpful to get the bounds of the polydata by GetBounds() method because vtkBox is defined with bounds. In the case that uses fran_cut.vtk, there is something like below. --- double bounds[6]; auto fran_cut = vtkPolyData::SafeDownCast(reader->GetOutput()); fran_cut->GetBounds(bounds); vtkSmartPointer transform = vtkSmartPointer::New(); transform->PreMultiply(); transform->RotateZ(0.0); transform->RotateY(0.0); transform->RotateX(0.0); transform->Scale(1, 0.4, 1); transform->Translate(0, 0, 0); vtkSmartPointer box = vtkSmartPointer::New(); box->SetBounds(bounds); box->SetTransform(transform); --- Besides, if it is difficult for you to adjust the transform values that you applied in ParaView, you might as well use Python scripting in ParaView. In that case, you are more likely to get a better answer if you post to the ParaView discussion forum: https://discourse.paraview.org/ [https://discourse.paraview.org/uploads/default/original/1X/be27a23ecc6207834f74337e6527d80bcc475188.png] ParaView discourse.paraview.org A place for questions about ParaView usage, building, and installation as well as general discussion about ParaView. Thanks 2018?8?14?(?) 1:00 Polly Pui : > > > Hi, > I tested using the values below with fran_cut.vtk but I failed to get the area. > Please advice. Thank you so much! > > vtkSmartPointer transform = > vtkSmartPointer::New(); > transform->PreMultiply(); > transform->RotateZ(0.0); > transform->RotateY(0.0); > transform->RotateX(0.0); > transform->Translate(0.5, -10.0, -590.0); > transform->Scale(0.5, 0.2, 0.6); > vtkSmartPointer box = > vtkSmartPointer::New(); > box->SetBounds(-1.0, 1.0, -1.0, 1.0, -0.6, 0.6); > box->SetTransform(transform); > > > > ________________________________ > From: kenichiro yoshimi > Sent: Saturday, August 11, 2018 11:08 AM > To: polly_sukting at hotmail.com > Cc: vtkusers > Subject: Re: [vtkusers] How to extract a region using a box? > > Hi, > > The Filter>Extract Cells By Region in ParaView uses vtkExtractGeometry > class internally. So the following example may be helpful to automate > polygon extractions with a specified box. > > --- ExtractGeometry.cxx --- > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > > int main (int, char *[]) > { > vtkSmartPointer sphere = > vtkSmartPointer::New(); > sphere->SetRadius(0.5); > sphere->SetPhiResolution(50); > sphere->SetThetaResolution(50); > sphere->Update(); > > vtkSmartPointer transform = > vtkSmartPointer::New(); > transform->PreMultiply(); > transform->RotateZ(30.0); > transform->Translate(0.5, 0.0, 0.0); > > vtkSmartPointer box = > vtkSmartPointer::New(); > box->SetBounds(-0.5, 0.5, -0.5, 0.5, -0.5, 0.5); > box->SetTransform(transform); > > vtkSmartPointer extractGeometry = > vtkSmartPointer::New(); > extractGeometry->SetInputData(sphere->GetOutput()); > extractGeometry->SetImplicitFunction(box); > extractGeometry->ExtractInsideOn(); > extractGeometry->ExtractBoundaryCellsOn(); > > vtkSmartPointer mapper = > vtkSmartPointer::New(); > mapper->SetInputConnection(extractGeometry->GetOutputPort()); > > vtkSmartPointer actor = > vtkSmartPointer::New(); > actor->SetMapper(mapper); > actor->GetProperty()->SetColor(0.8900, 0.8100, 0.3400); > > // Create graphics stuff > // > vtkSmartPointer ren = > vtkSmartPointer::New(); > ren->SetBackground(.3, .4, .6); > > vtkSmartPointer renWin = > vtkSmartPointer::New(); > renWin->AddRenderer(ren); > renWin->SetSize(512,512); > > vtkSmartPointer iren = > vtkSmartPointer::New(); > iren->SetRenderWindow(renWin); > > // Add the actors to the renderer, set the background and size > // > ren->AddActor(actor); > > // Generate an interesting view > // > ren->ResetCamera(); > ren->GetActiveCamera()->Azimuth(120); > ren->GetActiveCamera()->Elevation(30); > ren->GetActiveCamera()->Dolly(1.0); > ren->ResetCameraClippingRange(); > > iren->Initialize(); > iren->Start(); > > return EXIT_SUCCESS; > } > > --- CMakeLists.txt --- > cmake_minimum_required(VERSION 2.8) > > PROJECT(ExtractGeometry) > > find_package(VTK REQUIRED) > include(${VTK_USE_FILE}) > > add_executable(ExtractGeometry MACOSX_BUNDLE ExtractGeometry.cxx ) > > target_link_libraries(ExtractGeometry ${VTK_LIBRARIES}) > --- > > Regards > 2018?8?9?(?) 16:51 Polly Pui : > > > > Hi, > > > > Can anyone please tell me how can I do extract a region by providing a box (which we can set the size of it) on a polydata? > > > > I could do it manually in Paraview by selecting the Filter>Extract Cells By Region. > > > > However, I have more than 1000 dataset. It is time consuming if I apply it manually for each dataset. > > > > > > Thanks! > > > > > > Best, > > > > Polly > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > > > Follow this link to subscribe/unsubscribe: > > https://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From ellen.price at cfa.harvard.edu Wed Aug 15 14:39:02 2018 From: ellen.price at cfa.harvard.edu (Ellen M. Price) Date: Wed, 15 Aug 2018 14:39:02 -0400 Subject: [vtkusers] Problem coloring an unstructured grid by point array data Message-ID: Hi vtkUsers, This seems like a simple enough task, yet I can't find any examples that fit what I am trying to do. I have the following C++ code for a VTK pipeline. The problem is that the output I get from rendering this pipeline is different from that I would see in VisIt or ParaView, in that the mesh face facing the camera is shaded solid, when I know the data there should show a gradient; the face that initially faces away from the camera is correctly shaded (after rotating so that it can be seen). I can't think of any reason why this would happen. Please, if anyone can see what I'm doing wrong, help is greatly appreciated. Thanks, Ellen Price #include #include #include #include #include #include #include #include #include #include #include #include #define ARRAY "Vec_0xb5ea60_1rho.0" int main(int argc, char *argv[]) { if (argc < 2) { std::cout << "Usage: " << argv[0] << " grid.vtu" << std::endl; return EXIT_FAILURE; } vtkSmartPointer reader = vtkSmartPointer::New(); reader->SetFileName(argv[1]); reader->Update(); vtkSmartPointer lookup = vtkSmartPointer::New(); vtkSmartPointer colors = vtkSmartPointer::New(); colors->SetColorScheme(vtkColorSeries::WILD_FLOWER); colors->BuildLookupTable(lookup, vtkColorSeries::ORDINAL); vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(reader->GetOutputPort()); mapper->ScalarVisibilityOn(); mapper->SetColorModeToMapScalars(); mapper->SetLookupTable(lookup); mapper->SetScalarModeToUsePointFieldData(); mapper->SelectColorArray(ARRAY); vtkPointData *pd = reader->GetOutput()->GetPointData(); mapper->SetScalarRange(pd->GetArray(ARRAY)->GetRange()); vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); vtkSmartPointer renderer = vtkSmartPointer::New(); vtkSmartPointer window = vtkSmartPointer::New(); window->AddRenderer(renderer); vtkSmartPointer interactor = vtkSmartPointer::New(); interactor->SetRenderWindow(window); renderer->AddActor(actor); window->SetSize(1280, 720); window->Render(); interactor->Start(); return EXIT_SUCCESS; } From minpu.code at gmail.com Wed Aug 15 22:39:09 2018 From: minpu.code at gmail.com (pnt1614) Date: Wed, 15 Aug 2018 19:39:09 -0700 (MST) Subject: [vtkusers] A problem with rendering lines on a surface In-Reply-To: References: <1531791831318-0.post@n5.nabble.com> Message-ID: <1534387149543-0.post@n5.nabble.com> Using "mapper->SetResolveCoincidentTopologyToPolygonOffset();" only works when the VTK library is built with OpenGL. But I am using VTK 8.1.1 which is built with OpenGL2. Do you know how to solve this problem when using OpenGL2? Thank you. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From shayan.moradkhani at gmail.com Thu Aug 16 07:25:52 2018 From: shayan.moradkhani at gmail.com (shayan moradkhani) Date: Thu, 16 Aug 2018 04:25:52 -0700 (MST) Subject: [vtkusers] camera In-Reply-To: <1532950448864-0.post@n5.nabble.com> References: <1532950448864-0.post@n5.nabble.com> Message-ID: <1534418752567-0.post@n5.nabble.com> while the simulation is running, i cannot move the camera with mouse input. i need to see the movement of different elements of my model during simulation and with camera implementation, i cannot do that. anyone has any idea? regards Shayan -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From sebastien247 at gmail.com Thu Aug 16 07:32:08 2018 From: sebastien247 at gmail.com (=?UTF-8?Q?S=C3=A9bastien?=) Date: Thu, 16 Aug 2018 13:32:08 +0200 Subject: [vtkusers] A problem with rendering lines on a surface In-Reply-To: <1534387149543-0.post@n5.nabble.com> References: <1531791831318-0.post@n5.nabble.com> <1534387149543-0.post@n5.nabble.com> Message-ID: Maybe used a different vtkRenderer on a new layer, just for lines. *virtual void vtkRenderer::SetLayer( int layer )* Le jeu. 16 ao?t 2018 ? 04:39, pnt1614 a ?crit : > Using "mapper->SetResolveCoincidentTopologyToPolygonOffset();" only works > when the VTK library is built with OpenGL. But I am using VTK 8.1.1 which > is > built with OpenGL2. Do you know how to solve this problem when using > OpenGL2? > > Thank you. > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From scbiradar at gmail.com Thu Aug 16 08:53:02 2018 From: scbiradar at gmail.com (Santosh Biradar) Date: Thu, 16 Aug 2018 18:23:02 +0530 Subject: [vtkusers] vtkProbeFilter inconsistency In-Reply-To: References: Message-ID: Thanks a lot Sujin. If I understand correctly, the method you suggested will give the value of the scalar from the cell data. I am assuming I can use FindPoint to get the closest point and get the point data from that point id. However, I want to get the interpolated value at any arbitrary position, which is why I felt the probe filter is the correct choice(?). Of what I understand, the probe filter returns interpolated point data or it returns the cell data if the point data is not available. On my data set, the probe filter's output has all the arrays of the point data but the values are all zero. This happens on probing random positions on the surface of the dataset. Do let me know if you need any further information. Thanks again, Santosh On Tue, Aug 14, 2018 at 7:39 PM, Sujin Philip wrote: > Hi Santosh, > > I cannot say for sure what is going wrong in the probe filter without more > information. Looking at your code it looks like all you want to do is to > find a cell that contains a given point and get its cell attribute. An > easier way to achieve that would be: > > tol2 = 1e-6; > double pcoords[3]; > double weights[8]; // size based on the max number of points in any of > "input's" cells > double pt[3] = { x, y, z }; > auto cellId = input->FindCell(pt, NULL, -1, tol2, 0, pcoords, weights); > auto attr = vtkDataArray::SafeDownCast(input->GetCellData(). > GetAbstractArray("T")); > double val = 0.0; > attr->GetTuple(cellId, &val); > > Hope this helps > > -Sujin > > > On Tue, Aug 14, 2018 at 7:54 AM, Santosh Biradar > wrote: > >> Hi VTKers, >> >> I am trying to use the vtkProbeFilter on an unstructured data set. I am >> using a cell to point filter on my input dataset and trying to probe the >> output of the cell to point filter >> >> I have a snippet for what I am doing: >> >> #picker for getting the point >> picker = vtk.vtkCellPicker() >> picker.PickFromListOn() >> picker.AddPickList(c2pactor) >> picker.SetTolerance(0.000001*reader.GetOutput().GetLength()) >> picker.Pick(x, y, 0, renderer) >> points = picker.GetPickedPositions() >> numPoints = points.GetNumberOfPoints() >> print numPoints >> if numPoints < 1: >> return >> pnt = points.GetPoint(0) >> >> #probe filter >> pt = vtk.vtkPoints() >> pt.InsertPoint(0, x, y, z) >> polydata = vtk.vtkPolyData() >> polydata.SetPoints(pt) >> probe = vtk.vtkProbeFilter() >> probe.SetInputData(polydata) >> probe.SetSourceData(c2p.GetOutput()) >> >> probe.Update() >> >> val = probe.GetPolyDataOutput().GetPointData().GetScalars("T"). >> GetRange(0)[0] >> >> Now, I am getting inconsistent behavior of the probe filter. >> Sometimes, I get the values of all the point data arrays as 0.0 for the >> probed location. >> I dont understand this behavior. It does work correctly but not always. >> >> >> Alternately, I tried using the picker.GetCellId() and picker.GetPointId() >> to directly fetch the value from the actor's input dataset (in this case, >> output of cell to point filter). Again here, the point id obtained always >> seems to be only a particular point in the cell irresepctive of whether >> probed location is near that point or any other point in that cell. So, I >> end up getting point data of a particular point in that cell no matter >> where I probe in that cell. >> Is using a vtkPointPicker the correct option here? >> >> Also, should I explore using vtkPointLocator/vtkCellLocator ? >> >> I hope the question is clear. I am using VTK-6.3 on Windows. >> >> Thanks, >> Santosh >> >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> https://public.kitware.com/mailman/listinfo/vtkusers >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aron.helser at kitware.com Thu Aug 16 09:57:51 2018 From: aron.helser at kitware.com (Aron Helser) Date: Thu, 16 Aug 2018 09:57:51 -0400 Subject: [vtkusers] camera In-Reply-To: <1534418752567-0.post@n5.nabble.com> References: <1532950448864-0.post@n5.nabble.com> <1534418752567-0.post@n5.nabble.com> Message-ID: I feel like you haven't gotten an answer here because there is no simple answer to your question. I know that some work has been done in ParaView and Catalyst with steerable simulations, where the user interacts and changes the simulation while it's running, but that is not using just VTK, obviously. I believe you would have to do either a multi-threaded or multi-process implementation, with the simulation running independently of the VTK pipeline, and updating the data structures that VTK is visualizing. This won't be simple, but I'm not sure there is a better way. Hopefully someone else can suggest a better/simpler idea? -Aron On Thu, Aug 16, 2018 at 7:25 AM shayan moradkhani < shayan.moradkhani at gmail.com> wrote: > while the simulation is running, i cannot move the camera with mouse > input. i > need to see the movement of different elements of my model during > simulation > and with camera implementation, i cannot do that. anyone has any idea? > regards > Shayan > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sujin.philip at kitware.com Thu Aug 16 10:04:50 2018 From: sujin.philip at kitware.com (Sujin Philip) Date: Thu, 16 Aug 2018 10:04:50 -0400 Subject: [vtkusers] vtkProbeFilter inconsistency In-Reply-To: References: Message-ID: Hi Santosh, > If I understand correctly, the method you suggested will give the value of > the scalar from the cell data. > Correct. However, I want to get the interpolated value at any arbitrary position, > which is why I felt the probe filter is the correct choice(?). > Probe filter will do that for you. If it is just a few points you can also use the "weights" you get from the call to "FindCell" to do the interpolation yourself. There is an overloaded "FindCell" that will give you the "vtkCell". From there, you can get the ids of the cell's points. > Of what I understand, the probe filter returns interpolated point data or > it returns the cell data if the point data is not available. > Your understanding is correct. > On my data set, the probe filter's output has all the arrays of the point > data but the values are all zero. This happens on probing random positions > on the surface of the dataset. Do let me know if you need any further > information. > If the cells in your input dataset are 2D cells then the tolerance maybe the issue. Try setting ComputeTolerence to false and experiment with SetTolerance and see if that works. Thanks Sujin On Thu, Aug 16, 2018 at 8:53 AM, Santosh Biradar wrote: > Thanks a lot Sujin. > If I understand correctly, the method you suggested will give the value of > the scalar from the cell data. > I am assuming I can use FindPoint to get the closest point and get the > point data from that point id. > However, I want to get the interpolated value at any arbitrary position, > which is why I felt the probe filter is the correct choice(?). > Of what I understand, the probe filter returns interpolated point data or > it returns the cell data if the point data is not available. > On my data set, the probe filter's output has all the arrays of the point > data but the values are all zero. This happens on probing random positions > on the surface of the dataset. Do let me know if you need any further > information. > > Thanks again, > Santosh > > > > On Tue, Aug 14, 2018 at 7:39 PM, Sujin Philip > wrote: > >> Hi Santosh, >> >> I cannot say for sure what is going wrong in the probe filter without >> more information. Looking at your code it looks like all you want to do is >> to find a cell that contains a given point and get its cell attribute. An >> easier way to achieve that would be: >> >> tol2 = 1e-6; >> double pcoords[3]; >> double weights[8]; // size based on the max number of points in any of >> "input's" cells >> double pt[3] = { x, y, z }; >> auto cellId = input->FindCell(pt, NULL, -1, tol2, 0, pcoords, weights); >> auto attr = vtkDataArray::SafeDownCast(input->GetCellData().GetAbstractA >> rray("T")); >> double val = 0.0; >> attr->GetTuple(cellId, &val); >> >> Hope this helps >> >> -Sujin >> >> >> On Tue, Aug 14, 2018 at 7:54 AM, Santosh Biradar >> wrote: >> >>> Hi VTKers, >>> >>> I am trying to use the vtkProbeFilter on an unstructured data set. I am >>> using a cell to point filter on my input dataset and trying to probe the >>> output of the cell to point filter >>> >>> I have a snippet for what I am doing: >>> >>> #picker for getting the point >>> picker = vtk.vtkCellPicker() >>> picker.PickFromListOn() >>> picker.AddPickList(c2pactor) >>> picker.SetTolerance(0.000001*reader.GetOutput().GetLength()) >>> picker.Pick(x, y, 0, renderer) >>> points = picker.GetPickedPositions() >>> numPoints = points.GetNumberOfPoints() >>> print numPoints >>> if numPoints < 1: >>> return >>> pnt = points.GetPoint(0) >>> >>> #probe filter >>> pt = vtk.vtkPoints() >>> pt.InsertPoint(0, x, y, z) >>> polydata = vtk.vtkPolyData() >>> polydata.SetPoints(pt) >>> probe = vtk.vtkProbeFilter() >>> probe.SetInputData(polydata) >>> probe.SetSourceData(c2p.GetOutput()) >>> >>> probe.Update() >>> >>> val = probe.GetPolyDataOutput().GetPointData().GetScalars("T").Get >>> Range(0)[0] >>> >>> Now, I am getting inconsistent behavior of the probe filter. >>> Sometimes, I get the values of all the point data arrays as 0.0 for the >>> probed location. >>> I dont understand this behavior. It does work correctly but not always. >>> >>> >>> Alternately, I tried using the picker.GetCellId() and >>> picker.GetPointId() to directly fetch the value from the actor's input >>> dataset (in this case, output of cell to point filter). Again here, the >>> point id obtained always seems to be only a particular point in the cell >>> irresepctive of whether probed location is near that point or any other >>> point in that cell. So, I end up getting point data of a particular point >>> in that cell no matter where I probe in that cell. >>> Is using a vtkPointPicker the correct option here? >>> >>> Also, should I explore using vtkPointLocator/vtkCellLocator ? >>> >>> I hope the question is clear. I am using VTK-6.3 on Windows. >>> >>> Thanks, >>> Santosh >>> >>> >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> https://public.kitware.com/mailman/listinfo/vtkusers >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tiagobrizolara at gmail.com Thu Aug 16 12:14:11 2018 From: tiagobrizolara at gmail.com (Tiago Brizolara) Date: Thu, 16 Aug 2018 13:14:11 -0300 Subject: [vtkusers] Filled, interpolated, contour plots Message-ID: Hi all, Anyone knows if it is possible to generate filled contours with interpolation among them in VTK? (As in the image below, at the right - the image at the left would be a filled contour without interpolation) [image: enter image description here] I was thinking in triangulating a mesh departing from the points of a vtkContourFilter output. But maybe there is something more at hand? Best, Tiago Brizolara -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Thu Aug 16 12:16:21 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Thu, 16 Aug 2018 18:16:21 +0200 Subject: [vtkusers] qxcbintegration cannot create platform opengl context neither glx nor egl are enabled In-Reply-To: References: <1533783090404-0.post@n5.nabble.com> <1533974453506-0.post@n5.nabble.com> Message-ID: Den m?n 13 aug. 2018 11:16Mathieu Westphal skrev: > Hi, > > Absolutelly. virtual box should work though, if you set MESA_GL_OVERRIDE. > Sorry for jumping in, but this was interesting news to me. Do you know if volume rendering also will work in vbox + MESA_GL_OVERRIDE? (is the vbox GL driver capable enough?). It would make for a compelling way for me to do quick/convenient testing on Windows on my laptop. Elvis Or switch to bare metal if possible. > > Best regards, > > Mathieu Westphal > > On Sat, Aug 11, 2018 at 10:00 AM, newcfd via vtkusers < > vtkusers at public.kitware.com> wrote: > >> it looks like QVTKOpenGLWidget does not support Ubuntu on vmWare because >> the >> OpenGL version in it is only 3.3. Higher version of OpenGL is required. >> >> >> >> -- >> Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> https://public.kitware.com/mailman/listinfo/vtkusers >> > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Thu Aug 16 13:02:18 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Thu, 16 Aug 2018 13:02:18 -0400 Subject: [vtkusers] qxcbintegration cannot create platform opengl context neither glx nor egl are enabled In-Reply-To: References: <1533783090404-0.post@n5.nabble.com> <1533974453506-0.post@n5.nabble.com> Message-ID: fwiw: I have had good success with a prebuilt mesa for windows under VM before. See: https://github.com/pal1000/mesa-dist-win David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Thu, Aug 16, 2018 at 12:16 PM Elvis Stansvik < elvis.stansvik at orexplore.com> wrote: > Den m?n 13 aug. 2018 11:16Mathieu Westphal > skrev: > >> Hi, >> >> Absolutelly. virtual box should work though, if you set MESA_GL_OVERRIDE. >> > > Sorry for jumping in, but this was interesting news to me. Do you know if > volume rendering also will work in vbox + MESA_GL_OVERRIDE? (is the vbox > GL driver capable enough?). It would make for a compelling way for me to do > quick/convenient testing on Windows on my laptop. > > Elvis > > Or switch to bare metal if possible. >> >> Best regards, >> >> Mathieu Westphal >> >> On Sat, Aug 11, 2018 at 10:00 AM, newcfd via vtkusers < >> vtkusers at public.kitware.com> wrote: >> >>> it looks like QVTKOpenGLWidget does not support Ubuntu on vmWare because >>> the >>> OpenGL version in it is only 3.3. Higher version of OpenGL is required. >>> >>> >>> >>> -- >>> Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> https://public.kitware.com/mailman/listinfo/vtkusers >>> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> https://public.kitware.com/mailman/listinfo/vtkusers >> > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From badertalal at gmail.com Thu Aug 16 15:42:42 2018 From: badertalal at gmail.com (Talal Albader) Date: Thu, 16 Aug 2018 22:42:42 +0300 Subject: [vtkusers] build VTK in windows 10, msys2 mingw64 no success so far Message-ID: Hi, I am facing diffeculties in building VTK under msys2 ,as a beginner in using cmake, msys2 and VTK i hope someone can help me the case: - i have windows 10 machine, with msys2 with mingw64 and cmake as my building tools -i downloaded VTK-8.1.1 and followed every tutorial i found on the net to configure and build vtk but so far no sucess, every time it crashes with error for the case I have now this is the error message i am facing: ------------------------------------------------------------------------------------------------------------------------------------------------------------------ [ 46%] Built target VTKData C:/dev/msys/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.2.0/../../../../x86_64-w64-mingw32/bin/as.exe: CMakeFiles\vtkCommonCore.dir\vtkDataArray.cxx.obj: too many sections (106694) C:\dev\msys\tmp\ccTEaRyg.s: Assembler messages: C:\dev\msys\tmp\ccTEaRyg.s: Fatal error: can't write 75 bytes to section .text of CMakeFiles\vtkCommonCore.dir\vtkDataArray.cxx.obj: 'file too big' C:/dev/msys/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.2.0/../../../../x86_64-w64-mingw32/bin/as.exe: CMakeFiles\vtkCommonCore.dir\vtkDataArray.cxx.obj: too many sections (106694) C:\dev\msys\tmp\ccTEaRyg.s: Fatal error: can't close CMakeFiles\vtkCommonCore.dir\vtkDataArray.cxx.obj: file too big mingw32-make[2]: *** [Common\Core\CMakeFiles\vtkCommonCore.dir\build.make:432: Common/Core/CMakeFiles/vtkCommonCore.dir/vtkDataArray.cxx.obj] Error 1 mingw32-make[1]: *** [CMakeFiles\Makefile2:1239: Common/Core/CMakeFiles/vtkCommonCore.dir/all] Error 2 mingw32-make: *** [Makefile:140: all] Error 2 ------------------------------------------------------------------------------------------------------------------------------------------------------------------ most of tutorial in youtube using visual studio which i do not want to use , my plan to get VTK working with Qt support away from visual studio thanks in advance Talal -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.maynard at kitware.com Thu Aug 16 15:57:43 2018 From: robert.maynard at kitware.com (Robert Maynard) Date: Thu, 16 Aug 2018 15:57:43 -0400 Subject: [vtkusers] build VTK in windows 10, msys2 mingw64 no success so far In-Reply-To: References: Message-ID: You can try adding `-Wa,-mbig-obj` to your CMAKE_CXX_FLAGS to enable large object compilation ( https://stackoverflow.com/questions/16596876/object-file-has-too-many-sections ). In general mingw is not a tested platform for VTK. On Thu, Aug 16, 2018 at 3:42 PM Talal Albader wrote: > > Hi, > I am facing diffeculties in building VTK under msys2 ,as a beginner in using cmake, msys2 and VTK i hope someone can help me > the case: > - i have windows 10 machine, with msys2 with mingw64 and cmake as my building tools > -i downloaded VTK-8.1.1 and followed every tutorial i found on the net to configure and build vtk but so far no sucess, every time it crashes with error > > for the case I have now this is the error message i am facing: > > ------------------------------------------------------------------------------------------------------------------------------------------------------------------ > [ 46%] Built target VTKData > C:/dev/msys/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.2.0/../../../../x86_64-w64-mingw32/bin/as.exe: CMakeFiles\vtkCommonCore.dir\vtkDataArray.cxx.obj: too many sections (106694) > C:\dev\msys\tmp\ccTEaRyg.s: Assembler messages: > C:\dev\msys\tmp\ccTEaRyg.s: Fatal error: can't write 75 bytes to section .text of CMakeFiles\vtkCommonCore.dir\vtkDataArray.cxx.obj: 'file too big' > C:/dev/msys/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.2.0/../../../../x86_64-w64-mingw32/bin/as.exe: CMakeFiles\vtkCommonCore.dir\vtkDataArray.cxx.obj: too many sections (106694) > C:\dev\msys\tmp\ccTEaRyg.s: Fatal error: can't close CMakeFiles\vtkCommonCore.dir\vtkDataArray.cxx.obj: file too big > mingw32-make[2]: *** [Common\Core\CMakeFiles\vtkCommonCore.dir\build.make:432: Common/Core/CMakeFiles/vtkCommonCore.dir/vtkDataArray.cxx.obj] Error 1 > mingw32-make[1]: *** [CMakeFiles\Makefile2:1239: Common/Core/CMakeFiles/vtkCommonCore.dir/all] Error 2 > mingw32-make: *** [Makefile:140: all] Error 2 > ------------------------------------------------------------------------------------------------------------------------------------------------------------------ > > most of tutorial in youtube using visual studio which i do not want to use , my plan to get VTK working with Qt support away from visual studio > > > thanks in advance > > > Talal > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers From pbergeron at spiria.com Fri Aug 17 00:35:51 2018 From: pbergeron at spiria.com (Patrick Bergeron) Date: Fri, 17 Aug 2018 04:35:51 +0000 Subject: [vtkusers] Filled, interpolated, contour plots In-Reply-To: References: Message-ID: <53DB6F78-7814-426D-BB47-EC2E9A649CDB@spiria.com> Why don?t you do this in a fragment shader instead? I don?t know the nature of your data but it might be easier! Sent from my iPhone On Aug 16, 2018, at 12:14, Tiago Brizolara > wrote: Hi all, Anyone knows if it is possible to generate filled contours with interpolation among them in VTK? (As in the image below, at the right - the image at the left would be a filled contour without interpolation) [enter image description here] I was thinking in triangulating a mesh departing from the points of a vtkContourFilter output. But maybe there is something more at hand? Best, Tiago Brizolara _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: https://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From ftpronk at engits.com Fri Aug 17 04:57:58 2018 From: ftpronk at engits.com (Fcs) Date: Fri, 17 Aug 2018 01:57:58 -0700 (MST) Subject: [vtkusers] build VTK in windows 10, msys2 mingw64 no success so far In-Reply-To: References: Message-ID: <1534496278209-0.post@n5.nabble.com> I managed to compile VTK 6.3.0 with mingw64 on Windows 10 x64 some time back, without any issues. So it should be possible. I also found this for you: https://stackoverflow.com/questions/44705845/file-too-big-compiling-on-cygwin-g Don't forget that you'll have to compile everything you want to have working together with your mingw64 toolchain and mingw64 built programs, starting with Qt. If you want python support with your VTK build, you'll have to compile Python as well. Etc.... So the general question is why would you want to move away from the Visual Studio toolchain. It is what works best on that platform, and, from experience, using mingw64 for projects making use of multiple libraries is really opening a can of worms. Especially as a beginner.. If the code you are using has a CMake build system, you can avoid having to touch any of the Microsoft products by using a CMake generator for the version of Visual Studio you have (use the latest...), and just use CMake commands to build the code. That's what I would do if I had the choice. Good luck! -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From badertalal at gmail.com Fri Aug 17 07:21:13 2018 From: badertalal at gmail.com (Talal Albader) Date: Fri, 17 Aug 2018 14:21:13 +0300 Subject: [vtkusers] build VTK in windows 10, msys2 mingw64 no success so far In-Reply-To: <1534496278209-0.post@n5.nabble.com> References: <1534496278209-0.post@n5.nabble.com> Message-ID: many thanks for the support, in fact i was avoiding visual studio because I am using Qt creator which is compiled with mingw, but it looks as you say working with mingw to build things in windows is opening many issues , in fact every time i redo the process of cmake then mingw32-make i face different issues, yesterday i tried visual studio to build vtk in my other computer and it was very smooth without any issue, today i am right now running a build with visual studio for vtk where turned on Qt support hope it will complete without errors again thank you for the help you provide for me as beginner I can see now the problem with is just my lake of knowledge but also mingw has part of it :) although i wanted to stick with mingw to the end :( regards On Fri, Aug 17, 2018 at 11:58 AM Fcs wrote: > I managed to compile VTK 6.3.0 with mingw64 on Windows 10 x64 some time > back, > without any issues. So it should be possible. > > I also found this for you: > > https://stackoverflow.com/questions/44705845/file-too-big-compiling-on-cygwin-g > > Don't forget that you'll have to compile everything you want to have > working > together with your mingw64 toolchain and mingw64 built programs, starting > with Qt. If you want python support with your VTK build, you'll have to > compile Python as well. Etc.... > > So the general question is why would you want to move away from the Visual > Studio toolchain. It is what works best on that platform, and, from > experience, using mingw64 for projects making use of multiple libraries is > really opening a can of worms. Especially as a beginner.. If the code you > are using has a CMake build system, you can avoid having to touch any of > the > Microsoft products by using a CMake generator for the version of Visual > Studio you have (use the latest...), and just use CMake commands to build > the code. That's what I would do if I had the choice. > > Good luck! > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ftpronk at engits.com Fri Aug 17 08:35:57 2018 From: ftpronk at engits.com (Fcs) Date: Fri, 17 Aug 2018 05:35:57 -0700 (MST) Subject: [vtkusers] build VTK in windows 10, msys2 mingw64 no success so far In-Reply-To: References: <1534496278209-0.post@n5.nabble.com> Message-ID: <1534509357708-0.post@n5.nabble.com> Ok. This is clearly the wrong place for Qt/mingw support as it is not VTK related. However, it sounds like you are mixing up the mingw toolchain instructions. Make sure you only use MSYS2 and mingw-w64, and only follow the instructions related to those tools. If you are trying to compile with mingw32-make, you are doing something wrong, it's an obsolete tool. MSYS is unrelated to MSYS2, and mingw is not the same as mingw-w64. The instructions are a bit confusing on that one. Also, make sure you are using mingw-w64 with the correct thread and error model, and in 64 bits. (Unless you need 32 bit software..) Using QtCreator with native VS code shouldn't be an issue, you are not linking to QtCreator so it shouldn't matter what it is compiled with, as long as it runs. The Qt libraries from the Qt installer are compiled with Visual Studio, as is Python (if you need Python support with VTK), so you shouldn't have an issue compiling VTK with Qt support. Kind regards. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From scbiradar at gmail.com Fri Aug 17 09:39:08 2018 From: scbiradar at gmail.com (Santosh Biradar) Date: Fri, 17 Aug 2018 19:09:08 +0530 Subject: [vtkusers] vtkProbeFilter inconsistency In-Reply-To: References: Message-ID: As you pointed out, the issue is with the tolerance. By setting the tolerance I was able to get correct probed values. However, my input dataset can keep changing and I am not sure I can really set an optimum tolerance value each time. Basically what I observed in the implementation of the Probe Filter is that it picks a cell based on the tolerance set and then if it feels the cell is actually "far" from the probe location, it returns the zero values in the output point data. I dont understand why does the probe filter pick the wrong cell in the first place. I am doubting the FindCell call here. Why does it pick the right or wrong cell arbitrarily on only ever so slight variation in the input probe location is not clear to me. I am inclining towards using a cell picker to get the "correct" cell id and then doing interpolation myself to get the point data from the points of the cell as you suggested. Thanks Sujin for pointing me in the right direction. Thanks, Santosh On Thu, Aug 16, 2018 at 7:34 PM, Sujin Philip wrote: > Hi Santosh, > > >> If I understand correctly, the method you suggested will give the value >> of the scalar from the cell data. >> > Correct. > > However, I want to get the interpolated value at any arbitrary position, >> which is why I felt the probe filter is the correct choice(?). >> > Probe filter will do that for you. If it is just a few points you can also > use the "weights" you get from the call to "FindCell" to do the > interpolation yourself. There is an overloaded "FindCell" that will give > you the "vtkCell". From there, you can get the ids of the cell's points. > > >> Of what I understand, the probe filter returns interpolated point data or >> it returns the cell data if the point data is not available. >> > Your understanding is correct. > > >> On my data set, the probe filter's output has all the arrays of the point >> data but the values are all zero. This happens on probing random positions >> on the surface of the dataset. Do let me know if you need any further >> information. >> > If the cells in your input dataset are 2D cells then the tolerance maybe > the issue. Try setting ComputeTolerence to false and experiment with > SetTolerance and see if that works. > > Thanks > Sujin > > > On Thu, Aug 16, 2018 at 8:53 AM, Santosh Biradar > wrote: > >> Thanks a lot Sujin. >> If I understand correctly, the method you suggested will give the value >> of the scalar from the cell data. >> I am assuming I can use FindPoint to get the closest point and get the >> point data from that point id. >> However, I want to get the interpolated value at any arbitrary position, >> which is why I felt the probe filter is the correct choice(?). >> Of what I understand, the probe filter returns interpolated point data or >> it returns the cell data if the point data is not available. >> On my data set, the probe filter's output has all the arrays of the point >> data but the values are all zero. This happens on probing random positions >> on the surface of the dataset. Do let me know if you need any further >> information. >> >> Thanks again, >> Santosh >> >> >> >> On Tue, Aug 14, 2018 at 7:39 PM, Sujin Philip >> wrote: >> >>> Hi Santosh, >>> >>> I cannot say for sure what is going wrong in the probe filter without >>> more information. Looking at your code it looks like all you want to do is >>> to find a cell that contains a given point and get its cell attribute. An >>> easier way to achieve that would be: >>> >>> tol2 = 1e-6; >>> double pcoords[3]; >>> double weights[8]; // size based on the max number of points in any of >>> "input's" cells >>> double pt[3] = { x, y, z }; >>> auto cellId = input->FindCell(pt, NULL, -1, tol2, 0, pcoords, weights); >>> auto attr = vtkDataArray::SafeDownCast(input->GetCellData().GetAbstractA >>> rray("T")); >>> double val = 0.0; >>> attr->GetTuple(cellId, &val); >>> >>> Hope this helps >>> >>> -Sujin >>> >>> >>> On Tue, Aug 14, 2018 at 7:54 AM, Santosh Biradar >>> wrote: >>> >>>> Hi VTKers, >>>> >>>> I am trying to use the vtkProbeFilter on an unstructured data set. I am >>>> using a cell to point filter on my input dataset and trying to probe the >>>> output of the cell to point filter >>>> >>>> I have a snippet for what I am doing: >>>> >>>> #picker for getting the point >>>> picker = vtk.vtkCellPicker() >>>> picker.PickFromListOn() >>>> picker.AddPickList(c2pactor) >>>> picker.SetTolerance(0.000001*reader.GetOutput().GetLength()) >>>> picker.Pick(x, y, 0, renderer) >>>> points = picker.GetPickedPositions() >>>> numPoints = points.GetNumberOfPoints() >>>> print numPoints >>>> if numPoints < 1: >>>> return >>>> pnt = points.GetPoint(0) >>>> >>>> #probe filter >>>> pt = vtk.vtkPoints() >>>> pt.InsertPoint(0, x, y, z) >>>> polydata = vtk.vtkPolyData() >>>> polydata.SetPoints(pt) >>>> probe = vtk.vtkProbeFilter() >>>> probe.SetInputData(polydata) >>>> probe.SetSourceData(c2p.GetOutput()) >>>> >>>> probe.Update() >>>> >>>> val = probe.GetPolyDataOutput().GetPointData().GetScalars("T").Get >>>> Range(0)[0] >>>> >>>> Now, I am getting inconsistent behavior of the probe filter. >>>> Sometimes, I get the values of all the point data arrays as 0.0 for the >>>> probed location. >>>> I dont understand this behavior. It does work correctly but not always. >>>> >>>> >>>> Alternately, I tried using the picker.GetCellId() and >>>> picker.GetPointId() to directly fetch the value from the actor's input >>>> dataset (in this case, output of cell to point filter). Again here, the >>>> point id obtained always seems to be only a particular point in the cell >>>> irresepctive of whether probed location is near that point or any other >>>> point in that cell. So, I end up getting point data of a particular point >>>> in that cell no matter where I probe in that cell. >>>> Is using a vtkPointPicker the correct option here? >>>> >>>> Also, should I explore using vtkPointLocator/vtkCellLocator ? >>>> >>>> I hope the question is clear. I am using VTK-6.3 on Windows. >>>> >>>> Thanks, >>>> Santosh >>>> >>>> >>>> >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ at: >>>> http://www.vtk.org/Wiki/VTK_FAQ >>>> >>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> https://public.kitware.com/mailman/listinfo/vtkusers >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sujin.philip at kitware.com Fri Aug 17 09:55:48 2018 From: sujin.philip at kitware.com (Sujin Philip) Date: Fri, 17 Aug 2018 09:55:48 -0400 Subject: [vtkusers] vtkProbeFilter inconsistency In-Reply-To: References: Message-ID: Hi Santosh, For 2D cells its difficult to find a point that is exactly on the cell due to floating point precision issues. Some kind of tolerance will always be required. When "ComputeTolerance" is on, the filter tries to compute this tolerance value based on the input dataset. In your case it seems to be not good enough. I recall making some improvements to the tolerance code, but those are in newer versions of VTK. If possible, you should try the latest version. -Sujin On Fri, Aug 17, 2018 at 9:39 AM, Santosh Biradar wrote: > As you pointed out, the issue is with the tolerance. By setting the > tolerance I was able to get correct probed values. > However, my input dataset can keep changing and I am not sure I can really > set an optimum tolerance value each time. > > Basically what I observed in the implementation of the Probe Filter is > that it picks a cell based on the tolerance set and then if it feels the > cell is actually "far" from the probe location, it returns the zero values > in the output point data. > > I dont understand why does the probe filter pick the wrong cell in the > first place. I am doubting the FindCell call here. Why does it pick the > right or wrong cell arbitrarily on only ever so slight variation in the > input probe location is not clear to me. > I am inclining towards using a cell picker to get the "correct" cell id > and then doing interpolation myself to get the point data from the points > of the cell as you suggested. > Thanks Sujin for pointing me in the right direction. > > Thanks, > Santosh > > On Thu, Aug 16, 2018 at 7:34 PM, Sujin Philip > wrote: > >> Hi Santosh, >> >> >>> If I understand correctly, the method you suggested will give the value >>> of the scalar from the cell data. >>> >> Correct. >> >> However, I want to get the interpolated value at any arbitrary position, >>> which is why I felt the probe filter is the correct choice(?). >>> >> Probe filter will do that for you. If it is just a few points you can >> also use the "weights" you get from the call to "FindCell" to do the >> interpolation yourself. There is an overloaded "FindCell" that will give >> you the "vtkCell". From there, you can get the ids of the cell's points. >> >> >>> Of what I understand, the probe filter returns interpolated point data >>> or it returns the cell data if the point data is not available. >>> >> Your understanding is correct. >> >> >>> On my data set, the probe filter's output has all the arrays of the >>> point data but the values are all zero. This happens on probing random >>> positions on the surface of the dataset. Do let me know if you need any >>> further information. >>> >> If the cells in your input dataset are 2D cells then the tolerance maybe >> the issue. Try setting ComputeTolerence to false and experiment with >> SetTolerance and see if that works. >> >> Thanks >> Sujin >> >> >> On Thu, Aug 16, 2018 at 8:53 AM, Santosh Biradar >> wrote: >> >>> Thanks a lot Sujin. >>> If I understand correctly, the method you suggested will give the value >>> of the scalar from the cell data. >>> I am assuming I can use FindPoint to get the closest point and get the >>> point data from that point id. >>> However, I want to get the interpolated value at any arbitrary position, >>> which is why I felt the probe filter is the correct choice(?). >>> Of what I understand, the probe filter returns interpolated point data >>> or it returns the cell data if the point data is not available. >>> On my data set, the probe filter's output has all the arrays of the >>> point data but the values are all zero. This happens on probing random >>> positions on the surface of the dataset. Do let me know if you need any >>> further information. >>> >>> Thanks again, >>> Santosh >>> >>> >>> >>> On Tue, Aug 14, 2018 at 7:39 PM, Sujin Philip >>> wrote: >>> >>>> Hi Santosh, >>>> >>>> I cannot say for sure what is going wrong in the probe filter without >>>> more information. Looking at your code it looks like all you want to do is >>>> to find a cell that contains a given point and get its cell attribute. An >>>> easier way to achieve that would be: >>>> >>>> tol2 = 1e-6; >>>> double pcoords[3]; >>>> double weights[8]; // size based on the max number of points in any of >>>> "input's" cells >>>> double pt[3] = { x, y, z }; >>>> auto cellId = input->FindCell(pt, NULL, -1, tol2, 0, pcoords, weights); >>>> auto attr = vtkDataArray::SafeDownCast(inp >>>> ut->GetCellData().GetAbstractArray("T")); >>>> double val = 0.0; >>>> attr->GetTuple(cellId, &val); >>>> >>>> Hope this helps >>>> >>>> -Sujin >>>> >>>> >>>> On Tue, Aug 14, 2018 at 7:54 AM, Santosh Biradar >>>> wrote: >>>> >>>>> Hi VTKers, >>>>> >>>>> I am trying to use the vtkProbeFilter on an unstructured data set. I >>>>> am using a cell to point filter on my input dataset and trying to probe the >>>>> output of the cell to point filter >>>>> >>>>> I have a snippet for what I am doing: >>>>> >>>>> #picker for getting the point >>>>> picker = vtk.vtkCellPicker() >>>>> picker.PickFromListOn() >>>>> picker.AddPickList(c2pactor) >>>>> picker.SetTolerance(0.000001*reader.GetOutput().GetLength()) >>>>> picker.Pick(x, y, 0, renderer) >>>>> points = picker.GetPickedPositions() >>>>> numPoints = points.GetNumberOfPoints() >>>>> print numPoints >>>>> if numPoints < 1: >>>>> return >>>>> pnt = points.GetPoint(0) >>>>> >>>>> #probe filter >>>>> pt = vtk.vtkPoints() >>>>> pt.InsertPoint(0, x, y, z) >>>>> polydata = vtk.vtkPolyData() >>>>> polydata.SetPoints(pt) >>>>> probe = vtk.vtkProbeFilter() >>>>> probe.SetInputData(polydata) >>>>> probe.SetSourceData(c2p.GetOutput()) >>>>> >>>>> probe.Update() >>>>> >>>>> val = probe.GetPolyDataOutput().GetPointData().GetScalars("T").Get >>>>> Range(0)[0] >>>>> >>>>> Now, I am getting inconsistent behavior of the probe filter. >>>>> Sometimes, I get the values of all the point data arrays as 0.0 for >>>>> the probed location. >>>>> I dont understand this behavior. It does work correctly but not >>>>> always. >>>>> >>>>> >>>>> Alternately, I tried using the picker.GetCellId() and >>>>> picker.GetPointId() to directly fetch the value from the actor's input >>>>> dataset (in this case, output of cell to point filter). Again here, the >>>>> point id obtained always seems to be only a particular point in the cell >>>>> irresepctive of whether probed location is near that point or any other >>>>> point in that cell. So, I end up getting point data of a particular point >>>>> in that cell no matter where I probe in that cell. >>>>> Is using a vtkPointPicker the correct option here? >>>>> >>>>> Also, should I explore using vtkPointLocator/vtkCellLocator ? >>>>> >>>>> I hope the question is clear. I am using VTK-6.3 on Windows. >>>>> >>>>> Thanks, >>>>> Santosh >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> Powered by www.kitware.com >>>>> >>>>> Visit other Kitware open-source projects at >>>>> http://www.kitware.com/opensource/opensource.html >>>>> >>>>> Please keep messages on-topic and check the VTK FAQ at: >>>>> http://www.vtk.org/Wiki/VTK_FAQ >>>>> >>>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>>> >>>>> Follow this link to subscribe/unsubscribe: >>>>> https://public.kitware.com/mailman/listinfo/vtkusers >>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanjin.pajo at gmail.com Fri Aug 17 10:21:50 2018 From: sanjin.pajo at gmail.com (Sanjin P.) Date: Fri, 17 Aug 2018 16:21:50 +0200 Subject: [vtkusers] QVTKWidgetPlugin Message-ID: I am trying to run an executable of my C++ application that uses PCL (1.8.1) with VTK (8.0) and Qt (5.9.1) on another computer and it results in an error at line: this->mRenWin->GetInteractor()->SetSize(this->width(), this->height()); . The application builds and runs fine on my computer, and also without the VTK component, the executable runs fine on other computers. I have tried adding the VTK dlls including QVTKWidgetPlugin.dll in with the executable and I am still having the same issue. Please let me know if you have any suggestions. Best regards, S.P. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Fri Aug 17 10:53:21 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Fri, 17 Aug 2018 10:53:21 -0400 Subject: [vtkusers] Filled, interpolated, contour plots In-Reply-To: <53DB6F78-7814-426D-BB47-EC2E9A649CDB@spiria.com> References: <53DB6F78-7814-426D-BB47-EC2E9A649CDB@spiria.com> Message-ID: I would most likely show a colormapped plane and an isocontour at the same time, likely with the iscontour lines offset to stay on top of the plane. David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Fri, Aug 17, 2018 at 12:36 AM Patrick Bergeron wrote: > Why don?t you do this in a fragment shader instead? > > > I don?t know the nature of your data but it might be easier! > > Sent from my iPhone > > On Aug 16, 2018, at 12:14, Tiago Brizolara > wrote: > > Hi all, > > Anyone knows if it is possible to generate filled contours with > interpolation among them in VTK? > > (As in the image below, at the right - the image at the left would be a > filled contour without interpolation) > > [image: enter image description here] > > I was thinking in triangulating a mesh departing from the points of a > vtkContourFilter output. > > But maybe there is something more at hand? > > Best, > > Tiago Brizolara > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ghnguyen at wpi.edu Fri Aug 17 15:17:39 2018 From: ghnguyen at wpi.edu (Nguyen, Giang Hoang) Date: Fri, 17 Aug 2018 19:17:39 +0000 Subject: [vtkusers] vtkGeometryFilter for quadratic tetra grids Message-ID: Hi, I would like to confirm here if vtkGeometryFilter doesn't work for unstructured grids that are quadratic tetra (10 nodes per cell). I was using it to convert an unstructured grid to polydata, using vtkpython in conda environment. The exact code works fine for unstructured grids with triangle cells. I looked at the cxx source for vtkGeometryFilter at https://github.com/Kitware/VTK/blob/master/Filters/Geometry/vtkGeometryFilter.cxx and it seems like the quadratic cells are not supported? In that case, what other approaches should I look into? Thanks in advance. Best, Giang -------------- next part -------------- An HTML attachment was scrubbed... URL: From rccm.kyoshimi at gmail.com Fri Aug 17 23:04:27 2018 From: rccm.kyoshimi at gmail.com (kenichiro yoshimi) Date: Sat, 18 Aug 2018 12:04:27 +0900 Subject: [vtkusers] vtkGeometryFilter for quadratic tetra grids In-Reply-To: References: Message-ID: Hi, Could you provide some more information on what happens in applying vtkGeometryFilter to quadratic tetra grids. At least, the following simple code works without any problem using vtk 7.1.1. --- import vtk def main(): points = vtk.vtkPoints() points.InsertNextPoint(0, 0, 0) points.InsertNextPoint(1, 0, 0) points.InsertNextPoint(1, 1, 0) points.InsertNextPoint(0.5, 0.5, 0.5) points.InsertNextPoint(0.5, 0, 0) points.InsertNextPoint(1, 0.5, 0) points.InsertNextPoint(0.5, 0.5, 0) points.InsertNextPoint(0.25, 0.25, 0.25) points.InsertNextPoint(0.75, 0.25, 0.25) points.InsertNextPoint(0.75, 0.75, 0.25) unstructuredGrid = vtk.vtkUnstructuredGrid() unstructuredGrid.SetPoints(points) quadraticTetra = vtk.vtkQuadraticTetra() for i in range(10): quadraticTetra.GetPointIds().SetId(i, i) cellArray = vtk.vtkCellArray() cellArray.InsertNextCell(quadraticTetra) unstructuredGrid.SetCells(vtk.VTK_QUADRATIC_TETRA, cellArray) print('quadraticTetra: ') print(' cell number: {}'.format(unstructuredGrid.GetNumberOfCells())) print(' point number: {}\n'.format(unstructuredGrid.GetNumberOfPoints())) geometryFilter = vtk.vtkGeometryFilter() geometryFilter.SetInputData(unstructuredGrid) geometryFilter.Update() print('extracted surface: ') print(' cell number: {}'.format(geometryFilter.GetOutput().GetNumberOfCells())) print(' point number: {}'.format(geometryFilter.GetOutput().GetNumberOfPoints())) mapper = vtk.vtkPolyDataMapper() mapper.SetInputConnection(geometryFilter.GetOutputPort()) actor = vtk.vtkActor() actor.SetMapper(mapper) actor.GetProperty().EdgeVisibilityOn() renderer = vtk.vtkRenderer() renderer.AddActor(actor) renderer.ResetCamera() renderer.GetActiveCamera().Azimuth(210) renderer.GetActiveCamera().Elevation(30) renderWindow = vtk.vtkRenderWindow() renderWindow.SetSize(640, 480) renderWindow.AddRenderer(renderer) renderWindowInteractor = vtk.vtkRenderWindowInteractor() renderWindowInteractor.SetRenderWindow(renderWindow) renderWindowInteractor.Start() if __name__ == '__main__': main() --- Regards, 2018?8?18?(?) 4:17 Nguyen, Giang Hoang : > > Hi, > > > I would like to confirm here if vtkGeometryFilter doesn't work for unstructured grids that are quadratic tetra (10 nodes per cell). I was using it to convert an unstructured grid to polydata, using vtkpython in conda environment. The exact code works fine for unstructured grids with triangle cells. I looked at the cxx source for vtkGeometryFilter at https://github.com/Kitware/VTK/blob/master/Filters/Geometry/vtkGeometryFilter.cxx and it seems like the quadratic cells are not supported? In that case, what other approaches should I look into? Thanks in advance. > > > Best, > > Giang > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers From badertalal at gmail.com Sat Aug 18 05:16:50 2018 From: badertalal at gmail.com (Talal Albader) Date: Sat, 18 Aug 2018 12:16:50 +0300 Subject: [vtkusers] build VTK in windows 10, msys2 mingw64 no success so far In-Reply-To: <1534509357708-0.post@n5.nabble.com> References: <1534496278209-0.post@n5.nabble.com> <1534509357708-0.post@n5.nabble.com> Message-ID: Hi , thanks for the informations, actually i am using msys 2 and mingw-64, the workflow i followed is by installing msys2 ,then adding mingw-w64 toolchain followed by qt 64 installation (all inside msys2) then i downloaded vtk-8.1.1 the good news that i managed to compile it at the end , by trial and error work and iterations, just remove everything and try to do fresh build everytime. the latest error i face was comming from segy module which i disabled and the library compiled and built with only wornings that is for msys and mingw-w64 branch for visualstudio branch i found that qt creator is combiled to be 32 bit and it has only mingw 32 bit compiler so i droped the hole idea last but not least , i think this is a pure VTK issue not related to qt or mingw ,because other libraries are just going smooth and easy, why vtk build system not like other libraries (sorry to say that but really a greate library like this with too many use cases for visualization) it should be easy to install P.S. after successfuly compiling VTK i found in msys pacman -Ss vtk that there is vtk library there but no VTK with Qt , if it could be added to msys2 libraries will be great thanks for all and sorry for the too many words regards On Fri, Aug 17, 2018 at 3:36 PM Fcs wrote: > Ok. This is clearly the wrong place for Qt/mingw support as it is not VTK > related. > > However, it sounds like you are mixing up the mingw toolchain instructions. > Make sure you only use MSYS2 and mingw-w64, and only follow the > instructions > related to those tools. If you are trying to compile with mingw32-make, you > are doing something wrong, it's an obsolete tool. MSYS is unrelated to > MSYS2, and mingw is not the same as mingw-w64. The instructions are a bit > confusing on that one. Also, make sure you are using mingw-w64 with the > correct thread and error model, and in 64 bits. (Unless you need 32 bit > software..) > > Using QtCreator with native VS code shouldn't be an issue, you are not > linking to QtCreator so it shouldn't matter what it is compiled with, as > long as it runs. > > The Qt libraries from the Qt installer are compiled with Visual Studio, as > is Python (if you need Python support with VTK), so you shouldn't have an > issue compiling VTK with Qt support. > > Kind regards. > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Sun Aug 19 04:05:49 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Sun, 19 Aug 2018 10:05:49 +0200 Subject: [vtkusers] Problem depending on VTK >= 8.1 with CMake 3.12.1 and VTK 8.1.1 on Win 10/MSVC 2017 Message-ID: Hey all, In the past it was worked for us to depend on VTK 8.1 with find_package(VTK 8.1 ....) But now I'm having trouble with a setup like this: - Windows 10 - CMake 3.12.1 - VTK 8.1.1 The error I get when configuring our project is: -- Selecting Windows SDK version 10.0.17134.0 to target Windows 10.0.16299. CMake Error at CMakeLists.txt:29 (find_package): Could not find a configuration file for package "VTK" that is compatible with requested version "8.1". The following configuration files were considered but not accepted: C:/Users/Elvis/Dev/VTK-8.1.1-inst/lib/cmake/vtk-8.1/VTKConfig.cmake, version: 8.1.1 (64bit) This is nonsensical to me. Version 8.1.1 (which was found) should be able to satisfy 8.1. Just to test, I set the dependency in our CMakeLists.txt to exactly 8.1.1, and got: -- Selecting Windows SDK version 10.0.17134.0 to target Windows 10.0.16299. CMake Error at CMakeLists.txt:29 (find_package): Could not find a configuration file for package "VTK" that is compatible with requested version "8.1.1". The following configuration files were considered but not accepted: C:/Users/Elvis/Dev/VTK-8.1.1-inst/lib/cmake/vtk-8.1/VTKConfig.cmake, version: 8.1.1 (64bit) Which makes it obvious something is not right. For reference, cmake was invoked like cmake -DCMAKE_PREFIX_PATH=C:/Users/Elvis/Dev/qwt-6.1.2-inst;C:/Users/Elvis/Dev/VTK-8.1.1-inst;C:/Users/Elvis/Dev/HDF5/1.10.2;C:/Users/Elvis/Dev/karchive-5.36.0-inst .. where C:/Users/Elvis/Dev/VTK-8.1.1-inst is the installation prefix of VTK. Any ideas? Was there some change in CMake recently that could have caused this? Many thanks in advance, Elvis From newcfd at yahoo.com Sun Aug 19 04:06:32 2018 From: newcfd at yahoo.com (newcfd) Date: Sun, 19 Aug 2018 01:06:32 -0700 (MST) Subject: [vtkusers] vtk does not show my mesh actor on centOS. No problem on Ubuntu Message-ID: <1534665992359-0.post@n5.nabble.com> The exactly same code is compiled on CentOS with the latest VTK build. But nothing is displayed on CentOS while there is no problem on Ubuntu. Do I miss something -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From badertalal at gmail.com Sun Aug 19 04:14:41 2018 From: badertalal at gmail.com (Talal Albader) Date: Sun, 19 Aug 2018 11:14:41 +0300 Subject: [vtkusers] paraview and my qt vtk app not working in my second monitor Message-ID: Hi, after long two days i managed to install VTK in msys2 mingw-w64 with qt5 support and every thing works just fine however today i connected my 32 inch monitor to my laptop and my VTK enabled Qt app was not responding if i just move the app back to the laptop screen it works normal to confirm if this is Qt related or VTK related i started paraview and the same it is not working in my second monitor also i started QGIS as it is qt app but withut vtk controls and it works just fine any idea why this happens, is it related to the graphics card of my laptop, is there any workaround to overcome this,, after reaching the point of seeing nice 3d model inside my Qt app it is very sad to quit using VTK for this reason thanks and regards Talal -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Sun Aug 19 04:24:59 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Sun, 19 Aug 2018 10:24:59 +0200 Subject: [vtkusers] Problem depending on VTK >= 8.1 with CMake 3.12.1 and VTK 8.1.1 on Win 10/MSVC 2017 In-Reply-To: References: Message-ID: Forgot to mention, this is with MSVC 2017. Also for reference, it works on our regular Windows build worker, which has: - Windows 8.1 - MSVC 2015 - CMake 3.7.2 - VTK 8.1.1 Everything is built the same way there, this is why I suspect some behavioral change in CMake could be the cause. Our find_package invocation for VTK is: find_package(VTK 8.1 REQUIRED COMPONENTS vtkChartsCore vtkCommonCore vtkCommonDataModel vtkCommonExecutionModel vtkFiltersSources vtkGUISupportQt vtkImagingCore vtkImagingStatistics vtkInteractionStyle vtkRenderingAnnotation vtkRenderingContext2D vtkRenderingContextOpenGL2 vtkRenderingCore vtkRenderingFreeType vtkRenderingOpenGL2 vtkRenderingQt vtkRenderingVolume vtkRenderingVolumeOpenGL2 vtkViewsContext2D ) VTK was built with: cd \Users\Elvis\Dev\VTK-8.1.1 mkdir build cd build cmake ^ -DCMAKE_INSTALL_PREFIX=C:/Users/Elvis/Dev/VTK-8.1.1-inst ^ -DVTK_Group_Qt=ON ^ -DVTK_QT_VERSION=5 ^ -DQt5_DIR=C:/Users/Elvis/Dev/Qt/Qt5.11.1/5.11.1/msvc2017_64/lib/cmake/Qt5 ^ -DVTK_Group_Imaging=ON ^ -DVTK_Group_Views=ON ^ -DVTK_Group_MPI=OFF ^ -DVTK_Group_Tk=OFF ^ -DVTK_Group_Web=OFF ^ -DVTK_Group_StandAlone=OFF ^ -DBUILD_TESTING=OFF ^ -DVTK_USE_SYSTEM_LIBRARIES=OFF ^ -DCMAKE_BUILD_TYPE=Release ^ -DCMAKE_MAKE_PROGRAM=C:/Users/Elvis/Dev/ninja-win/ninja.exe ^ -GNinja ^ .. > cmake.out 2>&1 cmake --build . --config "Release" > build.out 2>&1 cmake --build . --target install > install.out 2>&1 Or could the error I'm getting in fact not be about a version mismatch, but some missing VTK module? (very cryptic if so). I'm attaching the output from the configuration of VTK on the problematic machine (see cmake.out). Elvis 2018-08-19 10:05 GMT+02:00 Elvis Stansvik : > Hey all, > > In the past it was worked for us to depend on VTK 8.1 with > > find_package(VTK 8.1 ....) > > But now I'm having trouble with a setup like this: > > - Windows 10 > - CMake 3.12.1 > - VTK 8.1.1 > > The error I get when configuring our project is: > > -- Selecting Windows SDK version 10.0.17134.0 to target Windows 10.0.16299. > CMake Error at CMakeLists.txt:29 (find_package): > Could not find a configuration file for package "VTK" that is compatible > with requested version "8.1". > > The following configuration files were considered but not accepted: > > C:/Users/Elvis/Dev/VTK-8.1.1-inst/lib/cmake/vtk-8.1/VTKConfig.cmake, > version: 8.1.1 (64bit) > > This is nonsensical to me. Version 8.1.1 (which was found) should be > able to satisfy 8.1. > > Just to test, I set the dependency in our CMakeLists.txt to exactly > 8.1.1, and got: > > -- Selecting Windows SDK version 10.0.17134.0 to target Windows 10.0.16299. > CMake Error at CMakeLists.txt:29 (find_package): > Could not find a configuration file for package "VTK" that is compatible > with requested version "8.1.1". > > The following configuration files were considered but not accepted: > > C:/Users/Elvis/Dev/VTK-8.1.1-inst/lib/cmake/vtk-8.1/VTKConfig.cmake, > version: 8.1.1 (64bit) > > Which makes it obvious something is not right. > > For reference, cmake was invoked like > > cmake -DCMAKE_PREFIX_PATH=C:/Users/Elvis/Dev/qwt-6.1.2-inst;C:/Users/Elvis/Dev/VTK-8.1.1-inst;C:/Users/Elvis/Dev/HDF5/1.10.2;C:/Users/Elvis/Dev/karchive-5.36.0-inst > .. > > where C:/Users/Elvis/Dev/VTK-8.1.1-inst is the installation prefix of VTK. > > Any ideas? Was there some change in CMake recently that could have caused this? > > Many thanks in advance, > Elvis -------------- next part -------------- A non-text attachment was scrubbed... Name: cmake.out Type: application/octet-stream Size: 14161 bytes Desc: not available URL: From elvis.stansvik at orexplore.com Sun Aug 19 04:33:50 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Sun, 19 Aug 2018 10:33:50 +0200 Subject: [vtkusers] Problem depending on VTK >= 8.1 with CMake 3.12.1 and VTK 8.1.1 on Win 10/MSVC 2017 In-Reply-To: References: Message-ID: 2018-08-19 10:24 GMT+02:00 Elvis Stansvik : > Forgot to mention, this is with MSVC 2017. > > Also for reference, it works on our regular Windows build worker, which has: > > - Windows 8.1 > - MSVC 2015 > - CMake 3.7.2 > - VTK 8.1.1 > > Everything is built the same way there, this is why I suspect some > behavioral change in CMake could be the cause. > > Our find_package invocation for VTK is: > > find_package(VTK 8.1 REQUIRED > COMPONENTS > vtkChartsCore > vtkCommonCore > vtkCommonDataModel > vtkCommonExecutionModel > vtkFiltersSources > vtkGUISupportQt > vtkImagingCore > vtkImagingStatistics > vtkInteractionStyle > vtkRenderingAnnotation > vtkRenderingContext2D > vtkRenderingContextOpenGL2 > vtkRenderingCore > vtkRenderingFreeType > vtkRenderingOpenGL2 > vtkRenderingQt > vtkRenderingVolume > vtkRenderingVolumeOpenGL2 > vtkViewsContext2D > ) > > VTK was built with: > > cd \Users\Elvis\Dev\VTK-8.1.1 > mkdir build > cd build > cmake ^ > -DCMAKE_INSTALL_PREFIX=C:/Users/Elvis/Dev/VTK-8.1.1-inst ^ > -DVTK_Group_Qt=ON ^ > -DVTK_QT_VERSION=5 ^ > -DQt5_DIR=C:/Users/Elvis/Dev/Qt/Qt5.11.1/5.11.1/msvc2017_64/lib/cmake/Qt5 ^ > -DVTK_Group_Imaging=ON ^ > -DVTK_Group_Views=ON ^ > -DVTK_Group_MPI=OFF ^ > -DVTK_Group_Tk=OFF ^ > -DVTK_Group_Web=OFF ^ > -DVTK_Group_StandAlone=OFF ^ > -DBUILD_TESTING=OFF ^ > -DVTK_USE_SYSTEM_LIBRARIES=OFF ^ > -DCMAKE_BUILD_TYPE=Release ^ > -DCMAKE_MAKE_PROGRAM=C:/Users/Elvis/Dev/ninja-win/ninja.exe ^ > -GNinja ^ > .. > cmake.out 2>&1 > cmake --build . --config "Release" > build.out 2>&1 > cmake --build . --target install > install.out 2>&1 > > Or could the error I'm getting in fact not be about a version > mismatch, but some missing VTK module? (very cryptic if so). I've now eliminated that possibility by testing with a reduced list of COMPONENTS containing just vtkCommonCore. So it must be something in the version matching that goes wrong :( Elvis > > I'm attaching the output from the configuration of VTK on the > problematic machine (see cmake.out). > > Elvis > > 2018-08-19 10:05 GMT+02:00 Elvis Stansvik : >> Hey all, >> >> In the past it was worked for us to depend on VTK 8.1 with >> >> find_package(VTK 8.1 ....) >> >> But now I'm having trouble with a setup like this: >> >> - Windows 10 >> - CMake 3.12.1 >> - VTK 8.1.1 >> >> The error I get when configuring our project is: >> >> -- Selecting Windows SDK version 10.0.17134.0 to target Windows 10.0.16299. >> CMake Error at CMakeLists.txt:29 (find_package): >> Could not find a configuration file for package "VTK" that is compatible >> with requested version "8.1". >> >> The following configuration files were considered but not accepted: >> >> C:/Users/Elvis/Dev/VTK-8.1.1-inst/lib/cmake/vtk-8.1/VTKConfig.cmake, >> version: 8.1.1 (64bit) >> >> This is nonsensical to me. Version 8.1.1 (which was found) should be >> able to satisfy 8.1. >> >> Just to test, I set the dependency in our CMakeLists.txt to exactly >> 8.1.1, and got: >> >> -- Selecting Windows SDK version 10.0.17134.0 to target Windows 10.0.16299. >> CMake Error at CMakeLists.txt:29 (find_package): >> Could not find a configuration file for package "VTK" that is compatible >> with requested version "8.1.1". >> >> The following configuration files were considered but not accepted: >> >> C:/Users/Elvis/Dev/VTK-8.1.1-inst/lib/cmake/vtk-8.1/VTKConfig.cmake, >> version: 8.1.1 (64bit) >> >> Which makes it obvious something is not right. >> >> For reference, cmake was invoked like >> >> cmake -DCMAKE_PREFIX_PATH=C:/Users/Elvis/Dev/qwt-6.1.2-inst;C:/Users/Elvis/Dev/VTK-8.1.1-inst;C:/Users/Elvis/Dev/HDF5/1.10.2;C:/Users/Elvis/Dev/karchive-5.36.0-inst >> .. >> >> where C:/Users/Elvis/Dev/VTK-8.1.1-inst is the installation prefix of VTK. >> >> Any ideas? Was there some change in CMake recently that could have caused this? >> >> Many thanks in advance, >> Elvis From elvis.stansvik at orexplore.com Sun Aug 19 04:45:23 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Sun, 19 Aug 2018 10:45:23 +0200 Subject: [vtkusers] Problem depending on VTK >= 8.1 with CMake 3.12.1 and VTK 8.1.1 on Win 10/MSVC 2017 In-Reply-To: References: Message-ID: 2018-08-19 10:05 GMT+02:00 Elvis Stansvik : > Hey all, > > In the past it was worked for us to depend on VTK 8.1 with > > find_package(VTK 8.1 ....) > > But now I'm having trouble with a setup like this: > > - Windows 10 > - CMake 3.12.1 > - VTK 8.1.1 > > The error I get when configuring our project is: > > -- Selecting Windows SDK version 10.0.17134.0 to target Windows 10.0.16299. > CMake Error at CMakeLists.txt:29 (find_package): > Could not find a configuration file for package "VTK" that is compatible > with requested version "8.1". > > The following configuration files were considered but not accepted: > > C:/Users/Elvis/Dev/VTK-8.1.1-inst/lib/cmake/vtk-8.1/VTKConfig.cmake, > version: 8.1.1 (64bit) > > This is nonsensical to me. Version 8.1.1 (which was found) should be > able to satisfy 8.1. By digging in VTKConfigVersion.cmake I've found out that this is due to some 32/64 bit mismatch (would be nice with a better error message). I.e. this check is failing: # check that the installed version has the same 32/64bit-ness as the one which is currently searching: if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8") math(EXPR installedBits "8 * 8") set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") set(PACKAGE_VERSION_UNSUITABLE TRUE) endif() I'll try to figure out where I went wrong, but I'm pretty sure everything has been done in a MSVC 64-bit native command prompt, and the machine is 64-bit. Elvis > > Just to test, I set the dependency in our CMakeLists.txt to exactly > 8.1.1, and got: > > -- Selecting Windows SDK version 10.0.17134.0 to target Windows 10.0.16299. > CMake Error at CMakeLists.txt:29 (find_package): > Could not find a configuration file for package "VTK" that is compatible > with requested version "8.1.1". > > The following configuration files were considered but not accepted: > > C:/Users/Elvis/Dev/VTK-8.1.1-inst/lib/cmake/vtk-8.1/VTKConfig.cmake, > version: 8.1.1 (64bit) > > Which makes it obvious something is not right. > > For reference, cmake was invoked like > > cmake -DCMAKE_PREFIX_PATH=C:/Users/Elvis/Dev/qwt-6.1.2-inst;C:/Users/Elvis/Dev/VTK-8.1.1-inst;C:/Users/Elvis/Dev/HDF5/1.10.2;C:/Users/Elvis/Dev/karchive-5.36.0-inst > .. > > where C:/Users/Elvis/Dev/VTK-8.1.1-inst is the installation prefix of VTK. > > Any ideas? Was there some change in CMake recently that could have caused this? > > Many thanks in advance, > Elvis From elvis.stansvik at orexplore.com Sun Aug 19 04:54:11 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Sun, 19 Aug 2018 10:54:11 +0200 Subject: [vtkusers] Problem depending on VTK >= 8.1 with CMake 3.12.1 and VTK 8.1.1 on Win 10/MSVC 2017 In-Reply-To: References: Message-ID: 2018-08-19 10:45 GMT+02:00 Elvis Stansvik : > 2018-08-19 10:05 GMT+02:00 Elvis Stansvik : >> Hey all, >> >> In the past it was worked for us to depend on VTK 8.1 with >> >> find_package(VTK 8.1 ....) >> >> But now I'm having trouble with a setup like this: >> >> - Windows 10 >> - CMake 3.12.1 >> - VTK 8.1.1 >> >> The error I get when configuring our project is: >> >> -- Selecting Windows SDK version 10.0.17134.0 to target Windows 10.0.16299. >> CMake Error at CMakeLists.txt:29 (find_package): >> Could not find a configuration file for package "VTK" that is compatible >> with requested version "8.1". >> >> The following configuration files were considered but not accepted: >> >> C:/Users/Elvis/Dev/VTK-8.1.1-inst/lib/cmake/vtk-8.1/VTKConfig.cmake, >> version: 8.1.1 (64bit) >> >> This is nonsensical to me. Version 8.1.1 (which was found) should be >> able to satisfy 8.1. > > By digging in VTKConfigVersion.cmake I've found out that this is due > to some 32/64 bit mismatch (would be nice with a better error > message). > > I.e. this check is failing: > > # check that the installed version has the same 32/64bit-ness as the > one which is currently searching: > if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8") > math(EXPR installedBits "8 * 8") > set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") > set(PACKAGE_VERSION_UNSUITABLE TRUE) > endif() So ${CMAKE_SIZEOF_VOID_P} is 4 on this computer (just printed it with message(..)), despite 1) CMake is installed from cmake-3.12.1-win64-x64.msi 2) The computer is 64 bit 3) The OS is 64 bit 4) It's run in a MSVC native x64 command prompt Is this a CMake bug? Or should the check above be rewritten somehow? Elvis > > I'll try to figure out where I went wrong, but I'm pretty sure > everything has been done in a MSVC 64-bit native command prompt, and > the machine is 64-bit. > > Elvis > >> >> Just to test, I set the dependency in our CMakeLists.txt to exactly >> 8.1.1, and got: >> >> -- Selecting Windows SDK version 10.0.17134.0 to target Windows 10.0.16299. >> CMake Error at CMakeLists.txt:29 (find_package): >> Could not find a configuration file for package "VTK" that is compatible >> with requested version "8.1.1". >> >> The following configuration files were considered but not accepted: >> >> C:/Users/Elvis/Dev/VTK-8.1.1-inst/lib/cmake/vtk-8.1/VTKConfig.cmake, >> version: 8.1.1 (64bit) >> >> Which makes it obvious something is not right. >> >> For reference, cmake was invoked like >> >> cmake -DCMAKE_PREFIX_PATH=C:/Users/Elvis/Dev/qwt-6.1.2-inst;C:/Users/Elvis/Dev/VTK-8.1.1-inst;C:/Users/Elvis/Dev/HDF5/1.10.2;C:/Users/Elvis/Dev/karchive-5.36.0-inst >> .. >> >> where C:/Users/Elvis/Dev/VTK-8.1.1-inst is the installation prefix of VTK. >> >> Any ideas? Was there some change in CMake recently that could have caused this? >> >> Many thanks in advance, >> Elvis From elvis.stansvik at orexplore.com Sun Aug 19 06:03:14 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Sun, 19 Aug 2018 12:03:14 +0200 Subject: [vtkusers] Problem depending on VTK >= 8.1 with CMake 3.12.1 and VTK 8.1.1 on Win 10/MSVC 2017 In-Reply-To: References: Message-ID: 2018-08-19 10:54 GMT+02:00 Elvis Stansvik : > 2018-08-19 10:45 GMT+02:00 Elvis Stansvik : >> 2018-08-19 10:05 GMT+02:00 Elvis Stansvik : >>> Hey all, >>> >>> In the past it was worked for us to depend on VTK 8.1 with >>> >>> find_package(VTK 8.1 ....) >>> >>> But now I'm having trouble with a setup like this: >>> >>> - Windows 10 >>> - CMake 3.12.1 >>> - VTK 8.1.1 >>> >>> The error I get when configuring our project is: >>> >>> -- Selecting Windows SDK version 10.0.17134.0 to target Windows 10.0.16299. >>> CMake Error at CMakeLists.txt:29 (find_package): >>> Could not find a configuration file for package "VTK" that is compatible >>> with requested version "8.1". >>> >>> The following configuration files were considered but not accepted: >>> >>> C:/Users/Elvis/Dev/VTK-8.1.1-inst/lib/cmake/vtk-8.1/VTKConfig.cmake, >>> version: 8.1.1 (64bit) >>> >>> This is nonsensical to me. Version 8.1.1 (which was found) should be >>> able to satisfy 8.1. >> >> By digging in VTKConfigVersion.cmake I've found out that this is due >> to some 32/64 bit mismatch (would be nice with a better error >> message). >> >> I.e. this check is failing: >> >> # check that the installed version has the same 32/64bit-ness as the >> one which is currently searching: >> if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8") >> math(EXPR installedBits "8 * 8") >> set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") >> set(PACKAGE_VERSION_UNSUITABLE TRUE) >> endif() > > So ${CMAKE_SIZEOF_VOID_P} is 4 on this computer (just printed it with > message(..)), despite > > 1) CMake is installed from cmake-3.12.1-win64-x64.msi > 2) The computer is 64 bit > 3) The OS is 64 bit > 4) It's run in a MSVC native x64 command prompt > > Is this a CMake bug? Or should the check above be rewritten somehow? My mistake was simply that I did not specify a generator, and the default (Visual Studio) generators default to the 32-bit compiler. In the end, I was intending to use the Ninja generator, and it uses the 64-bit compiler by default. So all is well now. Elvis > > Elvis > >> >> I'll try to figure out where I went wrong, but I'm pretty sure >> everything has been done in a MSVC 64-bit native command prompt, and >> the machine is 64-bit. >> >> Elvis >> >>> >>> Just to test, I set the dependency in our CMakeLists.txt to exactly >>> 8.1.1, and got: >>> >>> -- Selecting Windows SDK version 10.0.17134.0 to target Windows 10.0.16299. >>> CMake Error at CMakeLists.txt:29 (find_package): >>> Could not find a configuration file for package "VTK" that is compatible >>> with requested version "8.1.1". >>> >>> The following configuration files were considered but not accepted: >>> >>> C:/Users/Elvis/Dev/VTK-8.1.1-inst/lib/cmake/vtk-8.1/VTKConfig.cmake, >>> version: 8.1.1 (64bit) >>> >>> Which makes it obvious something is not right. >>> >>> For reference, cmake was invoked like >>> >>> cmake -DCMAKE_PREFIX_PATH=C:/Users/Elvis/Dev/qwt-6.1.2-inst;C:/Users/Elvis/Dev/VTK-8.1.1-inst;C:/Users/Elvis/Dev/HDF5/1.10.2;C:/Users/Elvis/Dev/karchive-5.36.0-inst >>> .. >>> >>> where C:/Users/Elvis/Dev/VTK-8.1.1-inst is the installation prefix of VTK. >>> >>> Any ideas? Was there some change in CMake recently that could have caused this? >>> >>> Many thanks in advance, >>> Elvis From lasso at queensu.ca Sun Aug 19 06:13:32 2018 From: lasso at queensu.ca (Andras Lasso) Date: Sun, 19 Aug 2018 10:13:32 +0000 Subject: [vtkusers] Problem depending on VTK >= 8.1 with CMake 3.12.1 and VTK 8.1.1 on Win 10/MSVC 2017 In-Reply-To: References: , Message-ID: <12bd52d3-7b7f-4c92-9c38-f9ca9ffa753f@queensu.ca> You need to specify a 64-bit generator in CMake if you want to build a 64-bit application. Andras ________________________________ From: Elvis Stansvik Sent: Sunday, August 19, 2018 10:54 AM To: VTK Users Subject: Re: [vtkusers] Problem depending on VTK >= 8.1 with CMake 3.12.1 and VTK 8.1.1 on Win 10/MSVC 2017 2018-08-19 10:45 GMT+02:00 Elvis Stansvik : > 2018-08-19 10:05 GMT+02:00 Elvis Stansvik : >> Hey all, >> >> In the past it was worked for us to depend on VTK 8.1 with >> >> find_package(VTK 8.1 ....) >> >> But now I'm having trouble with a setup like this: >> >> - Windows 10 >> - CMake 3.12.1 >> - VTK 8.1.1 >> >> The error I get when configuring our project is: >> >> -- Selecting Windows SDK version 10.0.17134.0 to target Windows 10.0.16299. >> CMake Error at CMakeLists.txt:29 (find_package): >> Could not find a configuration file for package "VTK" that is compatible >> with requested version "8.1". >> >> The following configuration files were considered but not accepted: >> >> C:/Users/Elvis/Dev/VTK-8.1.1-inst/lib/cmake/vtk-8.1/VTKConfig.cmake, >> version: 8.1.1 (64bit) >> >> This is nonsensical to me. Version 8.1.1 (which was found) should be >> able to satisfy 8.1. > > By digging in VTKConfigVersion.cmake I've found out that this is due > to some 32/64 bit mismatch (would be nice with a better error > message). > > I.e. this check is failing: > > # check that the installed version has the same 32/64bit-ness as the > one which is currently searching: > if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8") > math(EXPR installedBits "8 * 8") > set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") > set(PACKAGE_VERSION_UNSUITABLE TRUE) > endif() So ${CMAKE_SIZEOF_VOID_P} is 4 on this computer (just printed it with message(..)), despite 1) CMake is installed from cmake-3.12.1-win64-x64.msi 2) The computer is 64 bit 3) The OS is 64 bit 4) It's run in a MSVC native x64 command prompt Is this a CMake bug? Or should the check above be rewritten somehow? Elvis > > I'll try to figure out where I went wrong, but I'm pretty sure > everything has been done in a MSVC 64-bit native command prompt, and > the machine is 64-bit. > > Elvis > >> >> Just to test, I set the dependency in our CMakeLists.txt to exactly >> 8.1.1, and got: >> >> -- Selecting Windows SDK version 10.0.17134.0 to target Windows 10.0.16299. >> CMake Error at CMakeLists.txt:29 (find_package): >> Could not find a configuration file for package "VTK" that is compatible >> with requested version "8.1.1". >> >> The following configuration files were considered but not accepted: >> >> C:/Users/Elvis/Dev/VTK-8.1.1-inst/lib/cmake/vtk-8.1/VTKConfig.cmake, >> version: 8.1.1 (64bit) >> >> Which makes it obvious something is not right. >> >> For reference, cmake was invoked like >> >> cmake -DCMAKE_PREFIX_PATH=C:/Users/Elvis/Dev/qwt-6.1.2-inst;C:/Users/Elvis/Dev/VTK-8.1.1-inst;C:/Users/Elvis/Dev/HDF5/1.10.2;C:/Users/Elvis/Dev/karchive-5.36.0-inst >> .. >> >> where C:/Users/Elvis/Dev/VTK-8.1.1-inst is the installation prefix of VTK. >> >> Any ideas? Was there some change in CMake recently that could have caused this? >> >> Many thanks in advance, >> Elvis _______________________________________________ Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7C8aaaadfeff784d7d728008d605b157d4%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636702656585462737&sdata=83h1ptlXTNaPMoYKBlnIDdiI0GcQZ%2BTk7aoUOH6%2BcKE%3D&reserved=0 Visit other Kitware open-source projects at https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40queensu.ca%7C8aaaadfeff784d7d728008d605b157d4%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636702656585472747&sdata=snPd2d0Lz3yK8gx70%2BGP%2FrsysC259odxCi78gbth4Ro%3D&reserved=0 Please keep messages on-topic and check the VTK FAQ at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Classo%40queensu.ca%7C8aaaadfeff784d7d728008d605b157d4%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636702656585472747&sdata=VwPEkjGzeuHP8M8%2FPmUnUjJ2J9L6Ix71C%2FlVnxDeIFw%3D&reserved=0 Search the list archives at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Classo%40queensu.ca%7C8aaaadfeff784d7d728008d605b157d4%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636702656585472747&sdata=aLdQIAKjm8yNuOVYelhvKeenVmljp6aPSsgqv94q53c%3D&reserved=0 Follow this link to subscribe/unsubscribe: https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%7C8aaaadfeff784d7d728008d605b157d4%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636702656585472747&sdata=nwkOPmpamQWMns5cbibwKELToXugVVoEe7x810Va%2FRs%3D&reserved=0 -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Sun Aug 19 08:00:10 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Sun, 19 Aug 2018 14:00:10 +0200 Subject: [vtkusers] Problem depending on VTK >= 8.1 with CMake 3.12.1 and VTK 8.1.1 on Win 10/MSVC 2017 In-Reply-To: <12bd52d3-7b7f-4c92-9c38-f9ca9ffa753f@queensu.ca> References: <12bd52d3-7b7f-4c92-9c38-f9ca9ffa753f@queensu.ca> Message-ID: 2018-08-19 12:13 GMT+02:00 Andras Lasso : > You need to specify a 64-bit generator in CMake if you want to build a > 64-bit application. Yes, I finally figured out my mistake. Thanks! Elvis > > Andras > ________________________________ > From: Elvis Stansvik > Sent: Sunday, August 19, 2018 10:54 AM > To: VTK Users > Subject: Re: [vtkusers] Problem depending on VTK >= 8.1 with CMake 3.12.1 > and VTK 8.1.1 on Win 10/MSVC 2017 > > 2018-08-19 10:45 GMT+02:00 Elvis Stansvik : >> 2018-08-19 10:05 GMT+02:00 Elvis Stansvik : >>> Hey all, >>> >>> In the past it was worked for us to depend on VTK 8.1 with >>> >>> find_package(VTK 8.1 ....) >>> >>> But now I'm having trouble with a setup like this: >>> >>> - Windows 10 >>> - CMake 3.12.1 >>> - VTK 8.1.1 >>> >>> The error I get when configuring our project is: >>> >>> -- Selecting Windows SDK version 10.0.17134.0 to target Windows >>> 10.0.16299. >>> CMake Error at CMakeLists.txt:29 (find_package): >>> Could not find a configuration file for package "VTK" that is >>> compatible >>> with requested version "8.1". >>> >>> The following configuration files were considered but not accepted: >>> >>> C:/Users/Elvis/Dev/VTK-8.1.1-inst/lib/cmake/vtk-8.1/VTKConfig.cmake, >>> version: 8.1.1 (64bit) >>> >>> This is nonsensical to me. Version 8.1.1 (which was found) should be >>> able to satisfy 8.1. >> >> By digging in VTKConfigVersion.cmake I've found out that this is due >> to some 32/64 bit mismatch (would be nice with a better error >> message). >> >> I.e. this check is failing: >> >> # check that the installed version has the same 32/64bit-ness as the >> one which is currently searching: >> if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8") >> math(EXPR installedBits "8 * 8") >> set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") >> set(PACKAGE_VERSION_UNSUITABLE TRUE) >> endif() > > So ${CMAKE_SIZEOF_VOID_P} is 4 on this computer (just printed it with > message(..)), despite > > 1) CMake is installed from cmake-3.12.1-win64-x64.msi > 2) The computer is 64 bit > 3) The OS is 64 bit > 4) It's run in a MSVC native x64 command prompt > > Is this a CMake bug? Or should the check above be rewritten somehow? > > Elvis > >> >> I'll try to figure out where I went wrong, but I'm pretty sure >> everything has been done in a MSVC 64-bit native command prompt, and >> the machine is 64-bit. >> >> Elvis >> >>> >>> Just to test, I set the dependency in our CMakeLists.txt to exactly >>> 8.1.1, and got: >>> >>> -- Selecting Windows SDK version 10.0.17134.0 to target Windows >>> 10.0.16299. >>> CMake Error at CMakeLists.txt:29 (find_package): >>> Could not find a configuration file for package "VTK" that is >>> compatible >>> with requested version "8.1.1". >>> >>> The following configuration files were considered but not accepted: >>> >>> C:/Users/Elvis/Dev/VTK-8.1.1-inst/lib/cmake/vtk-8.1/VTKConfig.cmake, >>> version: 8.1.1 (64bit) >>> >>> Which makes it obvious something is not right. >>> >>> For reference, cmake was invoked like >>> >>> cmake >>> -DCMAKE_PREFIX_PATH=C:/Users/Elvis/Dev/qwt-6.1.2-inst;C:/Users/Elvis/Dev/VTK-8.1.1-inst;C:/Users/Elvis/Dev/HDF5/1.10.2;C:/Users/Elvis/Dev/karchive-5.36.0-inst >>> .. >>> >>> where C:/Users/Elvis/Dev/VTK-8.1.1-inst is the installation prefix of >>> VTK. >>> >>> Any ideas? Was there some change in CMake recently that could have caused >>> this? >>> >>> Many thanks in advance, >>> Elvis > _______________________________________________ > Powered by > https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7C8aaaadfeff784d7d728008d605b157d4%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636702656585462737&sdata=83h1ptlXTNaPMoYKBlnIDdiI0GcQZ%2BTk7aoUOH6%2BcKE%3D&reserved=0 > > Visit other Kitware open-source projects at > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40queensu.ca%7C8aaaadfeff784d7d728008d605b157d4%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636702656585472747&sdata=snPd2d0Lz3yK8gx70%2BGP%2FrsysC259odxCi78gbth4Ro%3D&reserved=0 > > Please keep messages on-topic and check the VTK FAQ at: > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Classo%40queensu.ca%7C8aaaadfeff784d7d728008d605b157d4%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636702656585472747&sdata=VwPEkjGzeuHP8M8%2FPmUnUjJ2J9L6Ix71C%2FlVnxDeIFw%3D&reserved=0 > > Search the list archives at: > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Classo%40queensu.ca%7C8aaaadfeff784d7d728008d605b157d4%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636702656585472747&sdata=aLdQIAKjm8yNuOVYelhvKeenVmljp6aPSsgqv94q53c%3D&reserved=0 > > Follow this link to subscribe/unsubscribe: > https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%7C8aaaadfeff784d7d728008d605b157d4%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636702656585472747&sdata=nwkOPmpamQWMns5cbibwKELToXugVVoEe7x810Va%2FRs%3D&reserved=0 From ruvva at yahoo.com Sun Aug 19 15:18:08 2018 From: ruvva at yahoo.com (Koteswara Rao Ruvva) Date: Sun, 19 Aug 2018 19:18:08 +0000 (UTC) Subject: [vtkusers] Orthogonal cross-sections from vtkImageData References: <1679125605.516869.1534706288593.ref@mail.yahoo.com> Message-ID: <1679125605.516869.1534706288593@mail.yahoo.com> Hello all, I need to compute three orthogonal cross-sections thru vtkImageData. I use the following code and it works fine. ? ? ? ? self.sagittal = vtk.vtkImageActor()? ? ? ? self.sagittal.GetMapper().SetInputConnection(self.imageData.GetOutputPort())? ? ? ? self.sagittal.SetDisplayExtent(int(self.nx/2), int(self.nx/2), 0, self.ny, 0, self.nz) How do I compute cross-sections that are not parallel to coordinate planes and have arbitrary orientation. I tried vtkProbeFilter with planes but I don't get any data back. Please advise. Thank youRao -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike.jackson at bluequartz.net Sun Aug 19 21:42:17 2018 From: mike.jackson at bluequartz.net (Michael Jackson) Date: Sun, 19 Aug 2018 21:42:17 -0400 Subject: [vtkusers] build VTK in windows 10, msys2 mingw64 no success so far In-Reply-To: References: <1534496278209-0.post@n5.nabble.com> <1534509357708-0.post@n5.nabble.com> Message-ID: If you _want_ to use QtCreator to write your programs that is no problem to use QtCreator and have it use the Visual Studio Tool Chain to compile your codes and dependent library. If you google ?QtCreator Visual Studio? there is a link to a QtCreator Wiki article that describes in detail how to setup QtCreator to use the Visual Studio toolchain (compilers, linkers?). It is probably easier to use the Visual Studio tool chain if you are trying to create a program that uses VTK and Qt. -- Mike Jackson On 8/18/18, 5:17 AM, "vtkusers on behalf of Talal Albader" wrote: Hi , thanks for the informations, actually i am using msys 2 and mingw-64, the workflow i followed is by installing msys2 ,then adding mingw-w64 toolchain followed by qt 64 installation (all inside msys2) then i downloaded vtk-8.1.1 the good news that i managed to compile it at the end , by trial and error work and iterations, just remove everything and try to do fresh build everytime. the latest error i face was comming from segy module which i disabled and the library compiled and built with only wornings that is for msys and mingw-w64 branch for visualstudio branch i found that qt creator is combiled to be 32 bit and it has only mingw 32 bit compiler so i droped the hole idea last but not least , i think this is a pure VTK issue not related to qt or mingw ,because other libraries are just going smooth and easy, why vtk build system not like other libraries (sorry to say that but really a greate library like this with too many use cases for visualization) it should be easy to install P.S. after successfuly compiling VTK i found in msys pacman -Ss vtk that there is vtk library there but no VTK with Qt , if it could be added to msys2 libraries will be great thanks for all and sorry for the too many words regards On Fri, Aug 17, 2018 at 3:36 PM Fcs wrote: Ok. This is clearly the wrong place for Qt/mingw support as it is not VTK related. However, it sounds like you are mixing up the mingw toolchain instructions. Make sure you only use MSYS2 and mingw-w64, and only follow the instructions related to those tools. If you are trying to compile with mingw32-make, you are doing something wrong, it's an obsolete tool. MSYS is unrelated to MSYS2, and mingw is not the same as mingw-w64. The instructions are a bit confusing on that one. Also, make sure you are using mingw-w64 with the correct thread and error model, and in 64 bits. (Unless you need 32 bit software..) Using QtCreator with native VS code shouldn't be an issue, you are not linking to QtCreator so it shouldn't matter what it is compiled with, as long as it runs. The Qt libraries from the Qt installer are compiled with Visual Studio, as is Python (if you need Python support with VTK), so you shouldn't have an issue compiling VTK with Qt support. Kind regards. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: https://public.kitware.com/mailman/listinfo/vtkusers _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: https://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From scbiradar at gmail.com Mon Aug 20 02:41:33 2018 From: scbiradar at gmail.com (Santosh Biradar) Date: Mon, 20 Aug 2018 12:11:33 +0530 Subject: [vtkusers] vtkProbeFilter inconsistency In-Reply-To: References: Message-ID: Thanks Sujin, I will look at the later versions. For VTK-6.3, I tried something like the below code to get the probe filter to probe the cell I want it to probe. Get the cell id from the vtkCellPicker. Set a minimum tolerance to probe filter and find the cell using cellId = input->FindCell(pt, NULL, -1, tol2, 0, pcoords, weights); If this cellId does not match the one provided by the cell picker, I increase tolerance by a factor and then do the above call to FindCell again. So, basically set the right tolerance value to the probe filter and then let it do the interpolation. Thanks for your suggestions, Santosh On Fri, Aug 17, 2018 at 7:25 PM, Sujin Philip wrote: > Hi Santosh, > > For 2D cells its difficult to find a point that is exactly on the cell due > to floating point precision issues. Some kind of tolerance will always be > required. When "ComputeTolerance" is on, the filter tries to compute this > tolerance value based on the input dataset. In your case it seems to be not > good enough. I recall making some improvements to the tolerance code, but > those are in newer versions of VTK. If possible, you should try the latest > version. > > -Sujin > > > On Fri, Aug 17, 2018 at 9:39 AM, Santosh Biradar > wrote: > >> As you pointed out, the issue is with the tolerance. By setting the >> tolerance I was able to get correct probed values. >> However, my input dataset can keep changing and I am not sure I can >> really set an optimum tolerance value each time. >> >> Basically what I observed in the implementation of the Probe Filter is >> that it picks a cell based on the tolerance set and then if it feels the >> cell is actually "far" from the probe location, it returns the zero values >> in the output point data. >> >> I dont understand why does the probe filter pick the wrong cell in the >> first place. I am doubting the FindCell call here. Why does it pick the >> right or wrong cell arbitrarily on only ever so slight variation in the >> input probe location is not clear to me. >> I am inclining towards using a cell picker to get the "correct" cell id >> and then doing interpolation myself to get the point data from the points >> of the cell as you suggested. >> Thanks Sujin for pointing me in the right direction. >> >> Thanks, >> Santosh >> >> On Thu, Aug 16, 2018 at 7:34 PM, Sujin Philip >> wrote: >> >>> Hi Santosh, >>> >>> >>>> If I understand correctly, the method you suggested will give the value >>>> of the scalar from the cell data. >>>> >>> Correct. >>> >>> However, I want to get the interpolated value at any arbitrary position, >>>> which is why I felt the probe filter is the correct choice(?). >>>> >>> Probe filter will do that for you. If it is just a few points you can >>> also use the "weights" you get from the call to "FindCell" to do the >>> interpolation yourself. There is an overloaded "FindCell" that will give >>> you the "vtkCell". From there, you can get the ids of the cell's points. >>> >>> >>>> Of what I understand, the probe filter returns interpolated point data >>>> or it returns the cell data if the point data is not available. >>>> >>> Your understanding is correct. >>> >>> >>>> On my data set, the probe filter's output has all the arrays of the >>>> point data but the values are all zero. This happens on probing random >>>> positions on the surface of the dataset. Do let me know if you need any >>>> further information. >>>> >>> If the cells in your input dataset are 2D cells then the tolerance maybe >>> the issue. Try setting ComputeTolerence to false and experiment with >>> SetTolerance and see if that works. >>> >>> Thanks >>> Sujin >>> >>> >>> On Thu, Aug 16, 2018 at 8:53 AM, Santosh Biradar >>> wrote: >>> >>>> Thanks a lot Sujin. >>>> If I understand correctly, the method you suggested will give the value >>>> of the scalar from the cell data. >>>> I am assuming I can use FindPoint to get the closest point and get the >>>> point data from that point id. >>>> However, I want to get the interpolated value at any arbitrary >>>> position, which is why I felt the probe filter is the correct choice(?). >>>> Of what I understand, the probe filter returns interpolated point data >>>> or it returns the cell data if the point data is not available. >>>> On my data set, the probe filter's output has all the arrays of the >>>> point data but the values are all zero. This happens on probing random >>>> positions on the surface of the dataset. Do let me know if you need any >>>> further information. >>>> >>>> Thanks again, >>>> Santosh >>>> >>>> >>>> >>>> On Tue, Aug 14, 2018 at 7:39 PM, Sujin Philip >>> > wrote: >>>> >>>>> Hi Santosh, >>>>> >>>>> I cannot say for sure what is going wrong in the probe filter without >>>>> more information. Looking at your code it looks like all you want to do is >>>>> to find a cell that contains a given point and get its cell attribute. An >>>>> easier way to achieve that would be: >>>>> >>>>> tol2 = 1e-6; >>>>> double pcoords[3]; >>>>> double weights[8]; // size based on the max number of points in any of >>>>> "input's" cells >>>>> double pt[3] = { x, y, z }; >>>>> auto cellId = input->FindCell(pt, NULL, -1, tol2, 0, pcoords, weights); >>>>> auto attr = vtkDataArray::SafeDownCast(inp >>>>> ut->GetCellData().GetAbstractArray("T")); >>>>> double val = 0.0; >>>>> attr->GetTuple(cellId, &val); >>>>> >>>>> Hope this helps >>>>> >>>>> -Sujin >>>>> >>>>> >>>>> On Tue, Aug 14, 2018 at 7:54 AM, Santosh Biradar >>>>> wrote: >>>>> >>>>>> Hi VTKers, >>>>>> >>>>>> I am trying to use the vtkProbeFilter on an unstructured data set. I >>>>>> am using a cell to point filter on my input dataset and trying to probe the >>>>>> output of the cell to point filter >>>>>> >>>>>> I have a snippet for what I am doing: >>>>>> >>>>>> #picker for getting the point >>>>>> picker = vtk.vtkCellPicker() >>>>>> picker.PickFromListOn() >>>>>> picker.AddPickList(c2pactor) >>>>>> picker.SetTolerance(0.000001*reader.GetOutput().GetLength()) >>>>>> picker.Pick(x, y, 0, renderer) >>>>>> points = picker.GetPickedPositions() >>>>>> numPoints = points.GetNumberOfPoints() >>>>>> print numPoints >>>>>> if numPoints < 1: >>>>>> return >>>>>> pnt = points.GetPoint(0) >>>>>> >>>>>> #probe filter >>>>>> pt = vtk.vtkPoints() >>>>>> pt.InsertPoint(0, x, y, z) >>>>>> polydata = vtk.vtkPolyData() >>>>>> polydata.SetPoints(pt) >>>>>> probe = vtk.vtkProbeFilter() >>>>>> probe.SetInputData(polydata) >>>>>> probe.SetSourceData(c2p.GetOutput()) >>>>>> >>>>>> probe.Update() >>>>>> >>>>>> val = probe.GetPolyDataOutput().GetPointData().GetScalars("T").Get >>>>>> Range(0)[0] >>>>>> >>>>>> Now, I am getting inconsistent behavior of the probe filter. >>>>>> Sometimes, I get the values of all the point data arrays as 0.0 for >>>>>> the probed location. >>>>>> I dont understand this behavior. It does work correctly but not >>>>>> always. >>>>>> >>>>>> >>>>>> Alternately, I tried using the picker.GetCellId() and >>>>>> picker.GetPointId() to directly fetch the value from the actor's input >>>>>> dataset (in this case, output of cell to point filter). Again here, the >>>>>> point id obtained always seems to be only a particular point in the cell >>>>>> irresepctive of whether probed location is near that point or any other >>>>>> point in that cell. So, I end up getting point data of a particular point >>>>>> in that cell no matter where I probe in that cell. >>>>>> Is using a vtkPointPicker the correct option here? >>>>>> >>>>>> Also, should I explore using vtkPointLocator/vtkCellLocator ? >>>>>> >>>>>> I hope the question is clear. I am using VTK-6.3 on Windows. >>>>>> >>>>>> Thanks, >>>>>> Santosh >>>>>> >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Powered by www.kitware.com >>>>>> >>>>>> Visit other Kitware open-source projects at >>>>>> http://www.kitware.com/opensource/opensource.html >>>>>> >>>>>> Please keep messages on-topic and check the VTK FAQ at: >>>>>> http://www.vtk.org/Wiki/VTK_FAQ >>>>>> >>>>>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>>>>> >>>>>> Follow this link to subscribe/unsubscribe: >>>>>> https://public.kitware.com/mailman/listinfo/vtkusers >>>>>> >>>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From niuton152 at gmail.com Mon Aug 20 05:58:58 2018 From: niuton152 at gmail.com (manhta152) Date: Mon, 20 Aug 2018 02:58:58 -0700 (MST) Subject: [vtkusers] Embed VTK in a GUI Message-ID: <1534759138799-0.post@n5.nabble.com> Hi everyone, I have a computational modeling program that has been written in Matlab. I developed a GUI in Matlab and used VTK to visualize and interact (transform, cut, deform, etc.,) CAD models. However, Matlab GUI does not support embedding VTK, resulting in a separate Matlab GUI and a VTK rendering window. I have looked for options to embed VTK in a GUI that works similar to 3D Slicer. I know that I can do it in Qt, Python and PyQt, Python and Tk, Jave, and C#. The problem is my program consists of many matrix-based calculations that may take a great deal of effort if I develop the program in Qt and C#. Python is quite close to Matlab that I think I can develop the program in a short period and save time. For those who have experience in developing an app using VTK and PyQt, please let me know I should use VTK and PyQt4 or PyQt5 and why? Also, if you think Qt or C# can work more efficiently than Python (I don't have much experience in Qt), please let me know your thoughts and share with me how I can work efficiently with matrices in Qt and C#. Thanks in advance. I do appreciate any input. Regards, Manh -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From andrew.slaughter at inl.gov Mon Aug 20 08:39:37 2018 From: andrew.slaughter at inl.gov (Andrew E. Slaughter) Date: Mon, 20 Aug 2018 12:39:37 +0000 Subject: [vtkusers] Embed VTK in a GUI In-Reply-To: <1534759138799-0.post@n5.nabble.com> References: <1534759138799-0.post@n5.nabble.com> Message-ID: My recommendation is to use PySide (https://wiki.qt.io/Qt_for_Python), the official Python bindings for Qt. I have used Python and PySide (the old one), PyQt4, and PyQt5 to maintain a VTK based GUI for many years, they work well together. Good luck. ________________________________________ From: vtkusers on behalf of manhta152 Sent: Monday, August 20, 2018 3:58:58 AM To: vtkusers at vtk.org Subject: [vtkusers] Embed VTK in a GUI Hi everyone, I have a computational modeling program that has been written in Matlab. I developed a GUI in Matlab and used VTK to visualize and interact (transform, cut, deform, etc.,) CAD models. However, Matlab GUI does not support embedding VTK, resulting in a separate Matlab GUI and a VTK rendering window. I have looked for options to embed VTK in a GUI that works similar to 3D Slicer. I know that I can do it in Qt, Python and PyQt, Python and Tk, Jave, and C#. The problem is my program consists of many matrix-based calculations that may take a great deal of effort if I develop the program in Qt and C#. Python is quite close to Matlab that I think I can develop the program in a short period and save time. For those who have experience in developing an app using VTK and PyQt, please let me know I should use VTK and PyQt4 or PyQt5 and why? Also, if you think Qt or C# can work more efficiently than Python (I don't have much experience in Qt), please let me know your thoughts and share with me how I can work efficiently with matrices in Qt and C#. Thanks in advance. I do appreciate any input. Regards, Manh -- Sent from: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fvtk.1045678.n5.nabble.com%2FVTK-Users-f1224199.html&data=02%7C01%7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874&sdata=907KYG62qUwb2Gm7bpb1u4Sk%2FXP0oasjU1Xp3XdIYlE%3D&reserved=0 _______________________________________________ Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874&sdata=WRwde%2BH2a6rWuYKFkI1DR3h4aZgyBGsJidMPgXBvLSE%3D&reserved=0 Visit other Kitware open-source projects at https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874&sdata=uoinIT40oISsji%2Fql4XN6QUXXLzomHVdZjm4uPVq574%3D&reserved=0 Please keep messages on-topic and check the VTK FAQ at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874&sdata=GgIeiz1t4yStgLAZPGN7eDeQVSHDE3pzyH6xCybqtlo%3D&reserved=0 Search the list archives at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874&sdata=29K7%2F6Z17oHJK1fjmLkJ6NzoNMPgOlsVmLmdKmeJnfc%3D&reserved=0 Follow this link to subscribe/unsubscribe: https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874&sdata=PlqeA5G62Q2dzs3RIUo%2BSmcvjLYo5ztJF2H3%2Foevy2E%3D&reserved=0 From niuton152 at gmail.com Mon Aug 20 09:27:07 2018 From: niuton152 at gmail.com (Ta, Duc-Manh) Date: Mon, 20 Aug 2018 20:27:07 +0700 Subject: [vtkusers] Embed VTK in a GUI In-Reply-To: References: <1534759138799-0.post@n5.nabble.com> Message-ID: Hi Andrew, Thanks for your great insight. I?m new to Python and totally get lost in its public libraries. I guess I can google it, but just want to ask your opinion. Is it possible to pack a standalone app with Python and PySide so that I can distribute it to other colleagues? Thanks, Manh On Mon, Aug 20, 2018 at 7:39 PM Andrew E. Slaughter < andrew.slaughter at inl.gov> wrote: > My recommendation is to use PySide (https://wiki.qt.io/Qt_for_Python), > the official Python bindings for Qt. I have used Python and PySide (the old > one), PyQt4, and PyQt5 to maintain a VTK based GUI for many years, they > work well together. Good luck. > > ________________________________________ > From: vtkusers on behalf of > manhta152 > Sent: Monday, August 20, 2018 3:58:58 AM > To: vtkusers at vtk.org > Subject: [vtkusers] Embed VTK in a GUI > > Hi everyone, > > I have a computational modeling program that has been written in Matlab. I > developed a GUI in Matlab and used VTK to visualize and interact > (transform, > cut, deform, etc.,) CAD models. However, Matlab GUI does not support > embedding VTK, resulting in a separate Matlab GUI and a VTK rendering > window. I have looked for options to embed VTK in a GUI that works similar > to 3D Slicer. I know that I can do it in Qt, Python and PyQt, Python and > Tk, > Jave, and C#. > > The problem is my program consists of many matrix-based calculations that > may take a great deal of effort if I develop the program in Qt and C#. > Python is quite close to Matlab that I think I can develop the program in a > short period and save time. > > For those who have experience in developing an app using VTK and PyQt, > please let me know I should use VTK and PyQt4 or PyQt5 and why? > > Also, if you think Qt or C# can work more efficiently than Python (I don't > have much experience in Qt), please let me know your thoughts and share > with > me how I can work efficiently with matrices in Qt and C#. > > Thanks in advance. I do appreciate any input. > > Regards, > Manh > > > > > -- > Sent from: > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fvtk.1045678.n5.nabble.com%2FVTK-Users-f1224199.html&data=02%7C01%7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874&sdata=907KYG62qUwb2Gm7bpb1u4Sk%2FXP0oasjU1Xp3XdIYlE%3D&reserved=0 > _______________________________________________ > Powered by > https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874&sdata=WRwde%2BH2a6rWuYKFkI1DR3h4aZgyBGsJidMPgXBvLSE%3D&reserved=0 > > Visit other Kitware open-source projects at > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874&sdata=uoinIT40oISsji%2Fql4XN6QUXXLzomHVdZjm4uPVq574%3D&reserved=0 > > Please keep messages on-topic and check the VTK FAQ at: > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874&sdata=GgIeiz1t4yStgLAZPGN7eDeQVSHDE3pzyH6xCybqtlo%3D&reserved=0 > > Search the list archives at: > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874&sdata=29K7%2F6Z17oHJK1fjmLkJ6NzoNMPgOlsVmLmdKmeJnfc%3D&reserved=0 > > Follow this link to subscribe/unsubscribe: > > https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874&sdata=PlqeA5G62Q2dzs3RIUo%2BSmcvjLYo5ztJF2H3%2Foevy2E%3D&reserved=0 > -- Manh Ta Graduate Research Assistant Center for Musculoskeletal Research The University of Tennessee Knoxville, TN 37996 Email: dta at vols.utk.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.martin at kitware.com Mon Aug 20 09:33:14 2018 From: ken.martin at kitware.com (Ken Martin) Date: Mon, 20 Aug 2018 09:33:14 -0400 Subject: [vtkusers] A problem with rendering lines on a surface In-Reply-To: <1534387149543-0.post@n5.nabble.com> References: <1531791831318-0.post@n5.nabble.com> <1534387149543-0.post@n5.nabble.com> Message-ID: FWIW mapper->SetResolveCoincidentTopologyToPolygonOffset(); is supported with OpenGL2. There is a test for it named TestCoincident.cxx I just checked and it worked fine on my system and is passing on the dashboards. Maybe something in how you are using it. On Wed, Aug 15, 2018 at 10:39 PM, pnt1614 wrote: > Using "mapper->SetResolveCoincidentTopologyToPolygonOffset();" only works > when the VTK library is built with OpenGL. But I am using VTK 8.1.1 which > is > built with OpenGL2. Do you know how to solve this problem when using > OpenGL2? > > Thank you. > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -- Ken Martin PhD Distinguished Engineer Kitware Inc. 101 East Weaver Street Carrboro, North Carolina 27510 USA This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Mon Aug 20 09:40:47 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Mon, 20 Aug 2018 09:40:47 -0400 Subject: [vtkusers] Embed VTK in a GUI In-Reply-To: References: <1534759138799-0.post@n5.nabble.com> Message-ID: Yes you can. The Python terminology for making a standalone app is "freezing". There are a variety of tools that automate the process. py2app, py2exe etc. They all bundle your code and its dependencies together and sometimes fixing up shared library paths so that you can hand it off to someone else and they can run it without any extra installs. David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Mon, Aug 20, 2018 at 9:29 AM Ta, Duc-Manh wrote: > Hi Andrew, > > Thanks for your great insight. I?m new to Python and totally get lost in > its public libraries. I guess I can google it, but just want to ask your > opinion. Is it possible to pack a standalone app with Python and PySide so > that I can distribute it to other colleagues? > > Thanks, > Manh > > On Mon, Aug 20, 2018 at 7:39 PM Andrew E. Slaughter < > andrew.slaughter at inl.gov> wrote: > >> My recommendation is to use PySide (https://wiki.qt.io/Qt_for_Python), >> the official Python bindings for Qt. I have used Python and PySide (the old >> one), PyQt4, and PyQt5 to maintain a VTK based GUI for many years, they >> work well together. Good luck. >> >> ________________________________________ >> From: vtkusers on behalf of >> manhta152 >> Sent: Monday, August 20, 2018 3:58:58 AM >> To: vtkusers at vtk.org >> Subject: [vtkusers] Embed VTK in a GUI >> >> Hi everyone, >> >> I have a computational modeling program that has been written in Matlab. I >> developed a GUI in Matlab and used VTK to visualize and interact >> (transform, >> cut, deform, etc.,) CAD models. However, Matlab GUI does not support >> embedding VTK, resulting in a separate Matlab GUI and a VTK rendering >> window. I have looked for options to embed VTK in a GUI that works similar >> to 3D Slicer. I know that I can do it in Qt, Python and PyQt, Python and >> Tk, >> Jave, and C#. >> >> The problem is my program consists of many matrix-based calculations that >> may take a great deal of effort if I develop the program in Qt and C#. >> Python is quite close to Matlab that I think I can develop the program in >> a >> short period and save time. >> >> For those who have experience in developing an app using VTK and PyQt, >> please let me know I should use VTK and PyQt4 or PyQt5 and why? >> >> Also, if you think Qt or C# can work more efficiently than Python (I don't >> have much experience in Qt), please let me know your thoughts and share >> with >> me how I can work efficiently with matrices in Qt and C#. >> >> Thanks in advance. I do appreciate any input. >> >> Regards, >> Manh >> >> >> >> >> -- >> Sent from: >> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fvtk.1045678.n5.nabble.com%2FVTK-Users-f1224199.html&data=02%7C01%7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874&sdata=907KYG62qUwb2Gm7bpb1u4Sk%2FXP0oasjU1Xp3XdIYlE%3D&reserved=0 >> _______________________________________________ >> Powered by >> https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874&sdata=WRwde%2BH2a6rWuYKFkI1DR3h4aZgyBGsJidMPgXBvLSE%3D&reserved=0 >> >> Visit other Kitware open-source projects at >> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874&sdata=uoinIT40oISsji%2Fql4XN6QUXXLzomHVdZjm4uPVq574%3D&reserved=0 >> >> Please keep messages on-topic and check the VTK FAQ at: >> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874&sdata=GgIeiz1t4yStgLAZPGN7eDeQVSHDE3pzyH6xCybqtlo%3D&reserved=0 >> >> Search the list archives at: >> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874&sdata=29K7%2F6Z17oHJK1fjmLkJ6NzoNMPgOlsVmLmdKmeJnfc%3D&reserved=0 >> >> Follow this link to subscribe/unsubscribe: >> >> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874&sdata=PlqeA5G62Q2dzs3RIUo%2BSmcvjLYo5ztJF2H3%2Foevy2E%3D&reserved=0 >> > -- > Manh Ta > Graduate Research Assistant > Center for Musculoskeletal Research > The University of Tennessee > Knoxville, TN 37996 > Email: dta at vols.utk.edu > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From niuton152 at gmail.com Mon Aug 20 09:48:32 2018 From: niuton152 at gmail.com (Ta, Duc-Manh) Date: Mon, 20 Aug 2018 20:48:32 +0700 Subject: [vtkusers] Embed VTK in a GUI In-Reply-To: References: <1534759138799-0.post@n5.nabble.com> Message-ID: Great! Thanks you all for insightful experience. Best, Manh On Mon, Aug 20, 2018 at 8:41 PM David E DeMarle wrote: > Yes you can. > > The Python terminology for making a standalone app is "freezing". There > are a variety of tools that automate the process. py2app, py2exe etc. They > all bundle your code and its dependencies together and sometimes fixing up > shared library paths so that you can hand it off to someone else and they > can run it without any extra installs. > > David E DeMarle > Kitware, Inc. > Principal Engineer > 21 Corporate Drive > > Clifton Park, NY 12065 > > -8662 > Phone: 518-881-4909 > > > On Mon, Aug 20, 2018 at 9:29 AM Ta, Duc-Manh wrote: > >> Hi Andrew, >> >> Thanks for your great insight. I?m new to Python and totally get lost in >> its public libraries. I guess I can google it, but just want to ask your >> opinion. Is it possible to pack a standalone app with Python and PySide so >> that I can distribute it to other colleagues? >> >> Thanks, >> Manh >> >> On Mon, Aug 20, 2018 at 7:39 PM Andrew E. Slaughter < >> andrew.slaughter at inl.gov> wrote: >> >>> My recommendation is to use PySide (https://wiki.qt.io/Qt_for_Python), >>> the official Python bindings for Qt. I have used Python and PySide (the old >>> one), PyQt4, and PyQt5 to maintain a VTK based GUI for many years, they >>> work well together. Good luck. >>> >>> ________________________________________ >>> From: vtkusers on behalf of >>> manhta152 >>> Sent: Monday, August 20, 2018 3:58:58 AM >>> To: vtkusers at vtk.org >>> Subject: [vtkusers] Embed VTK in a GUI >>> >>> Hi everyone, >>> >>> I have a computational modeling program that has been written in Matlab. >>> I >>> developed a GUI in Matlab and used VTK to visualize and interact >>> (transform, >>> cut, deform, etc.,) CAD models. However, Matlab GUI does not support >>> embedding VTK, resulting in a separate Matlab GUI and a VTK rendering >>> window. I have looked for options to embed VTK in a GUI that works >>> similar >>> to 3D Slicer. I know that I can do it in Qt, Python and PyQt, Python and >>> Tk, >>> Jave, and C#. >>> >>> The problem is my program consists of many matrix-based calculations that >>> may take a great deal of effort if I develop the program in Qt and C#. >>> Python is quite close to Matlab that I think I can develop the program >>> in a >>> short period and save time. >>> >>> For those who have experience in developing an app using VTK and PyQt, >>> please let me know I should use VTK and PyQt4 or PyQt5 and why? >>> >>> Also, if you think Qt or C# can work more efficiently than Python (I >>> don't >>> have much experience in Qt), please let me know your thoughts and share >>> with >>> me how I can work efficiently with matrices in Qt and C#. >>> >>> Thanks in advance. I do appreciate any input. >>> >>> Regards, >>> Manh >>> >>> >>> >>> >>> -- >>> Sent from: >>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fvtk.1045678.n5.nabble.com%2FVTK-Users-f1224199.html&data=02%7C01%7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874&sdata=907KYG62qUwb2Gm7bpb1u4Sk%2FXP0oasjU1Xp3XdIYlE%3D&reserved=0 >>> _______________________________________________ >>> Powered by >>> https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874&sdata=WRwde%2BH2a6rWuYKFkI1DR3h4aZgyBGsJidMPgXBvLSE%3D&reserved=0 >>> >>> Visit other Kitware open-source projects at >>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874&sdata=uoinIT40oISsji%2Fql4XN6QUXXLzomHVdZjm4uPVq574%3D&reserved=0 >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874&sdata=GgIeiz1t4yStgLAZPGN7eDeQVSHDE3pzyH6xCybqtlo%3D&reserved=0 >>> >>> Search the list archives at: >>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874&sdata=29K7%2F6Z17oHJK1fjmLkJ6NzoNMPgOlsVmLmdKmeJnfc%3D&reserved=0 >>> >>> Follow this link to subscribe/unsubscribe: >>> >>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874&sdata=PlqeA5G62Q2dzs3RIUo%2BSmcvjLYo5ztJF2H3%2Foevy2E%3D&reserved=0 >>> >> -- >> Manh Ta >> Graduate Research Assistant >> Center for Musculoskeletal Research >> The University of Tennessee >> Knoxville, TN 37996 >> Email: dta at vols.utk.edu >> > _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> https://public.kitware.com/mailman/listinfo/vtkusers >> > -- Manh Ta Graduate Research Assistant Center for Musculoskeletal Research The University of Tennessee Knoxville, TN 37996 Email: dta at vols.utk.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanjin.pajo at gmail.com Mon Aug 20 09:54:46 2018 From: sanjin.pajo at gmail.com (Sanjin) Date: Mon, 20 Aug 2018 06:54:46 -0700 (MST) Subject: [vtkusers] QVTKWidgetPlugin In-Reply-To: References: Message-ID: <1534773286464-0.post@n5.nabble.com> This issue has been solved, PCL dlls added with the application executable were an older version. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From ghnguyen at wpi.edu Mon Aug 20 09:56:54 2018 From: ghnguyen at wpi.edu (Nguyen, Giang Hoang) Date: Mon, 20 Aug 2018 13:56:54 +0000 Subject: [vtkusers] vtkGeometryFilter for quadratic tetra grids In-Reply-To: References: , Message-ID: Hi, Thanks for the quick reply Kenichiro. I could see that the GeometryFilter does support quadratic tetra grids now. Still I have the issue with my large mesh. I'm reading from a file and this is the snippet to read that file: ---- reader = vtkUnstructuredGridReader() reader.SetFileName(file_name) reader.Update() print reader.GetOutput() ---- which prints out this to terminal: vtkUnstructuredGrid (0000000006521F50) Debug: Off Modified Time: 184 Reference Count: 2 Registered Events: (none) Information: 00000000025B0F10 Data Released: False Global Release Data: Off UpdateTime: 189 Field Data: Debug: Off Modified Time: 161 Reference Count: 1 Registered Events: (none) Number Of Arrays: 0 Number Of Components: 0 Number Of Tuples: 0 Number Of Points: 343399 Number Of Cells: 250935 I suppose this means the reader was able to read the unstructured grid correctly and I have data integrity (which is also confirmed by Paraview, which was able to generate this UnstructuredGrid mesh). What I'm looking for is this snippet to work: ---- geoFilter = vtkGeometryFilter() geoFilter.SetInputConnection(reader.GetOutputPort()) geoFilter.Update() ---- Unfortunately, the line geoFilter.Update() always makes vtkpython quit without any warning/error even with try catch surrounding. I'm not sure what the problem now is. ________________________________ From: kenichiro yoshimi Sent: Friday, August 17, 2018 11:04:27 PM To: Nguyen, Giang Hoang Cc: vtkusers at public.kitware.com Subject: Re: [vtkusers] vtkGeometryFilter for quadratic tetra grids Hi, Could you provide some more information on what happens in applying vtkGeometryFilter to quadratic tetra grids. At least, the following simple code works without any problem using vtk 7.1.1. --- import vtk def main(): points = vtk.vtkPoints() points.InsertNextPoint(0, 0, 0) points.InsertNextPoint(1, 0, 0) points.InsertNextPoint(1, 1, 0) points.InsertNextPoint(0.5, 0.5, 0.5) points.InsertNextPoint(0.5, 0, 0) points.InsertNextPoint(1, 0.5, 0) points.InsertNextPoint(0.5, 0.5, 0) points.InsertNextPoint(0.25, 0.25, 0.25) points.InsertNextPoint(0.75, 0.25, 0.25) points.InsertNextPoint(0.75, 0.75, 0.25) unstructuredGrid = vtk.vtkUnstructuredGrid() unstructuredGrid.SetPoints(points) quadraticTetra = vtk.vtkQuadraticTetra() for i in range(10): quadraticTetra.GetPointIds().SetId(i, i) cellArray = vtk.vtkCellArray() cellArray.InsertNextCell(quadraticTetra) unstructuredGrid.SetCells(vtk.VTK_QUADRATIC_TETRA, cellArray) print('quadraticTetra: ') print(' cell number: {}'.format(unstructuredGrid.GetNumberOfCells())) print(' point number: {}\n'.format(unstructuredGrid.GetNumberOfPoints())) geometryFilter = vtk.vtkGeometryFilter() geometryFilter.SetInputData(unstructuredGrid) geometryFilter.Update() print('extracted surface: ') print(' cell number: {}'.format(geometryFilter.GetOutput().GetNumberOfCells())) print(' point number: {}'.format(geometryFilter.GetOutput().GetNumberOfPoints())) mapper = vtk.vtkPolyDataMapper() mapper.SetInputConnection(geometryFilter.GetOutputPort()) actor = vtk.vtkActor() actor.SetMapper(mapper) actor.GetProperty().EdgeVisibilityOn() renderer = vtk.vtkRenderer() renderer.AddActor(actor) renderer.ResetCamera() renderer.GetActiveCamera().Azimuth(210) renderer.GetActiveCamera().Elevation(30) renderWindow = vtk.vtkRenderWindow() renderWindow.SetSize(640, 480) renderWindow.AddRenderer(renderer) renderWindowInteractor = vtk.vtkRenderWindowInteractor() renderWindowInteractor.SetRenderWindow(renderWindow) renderWindowInteractor.Start() if __name__ == '__main__': main() --- Regards, 2018?8?18?(?) 4:17 Nguyen, Giang Hoang : > > Hi, > > > I would like to confirm here if vtkGeometryFilter doesn't work for unstructured grids that are quadratic tetra (10 nodes per cell). I was using it to convert an unstructured grid to polydata, using vtkpython in conda environment. The exact code works fine for unstructured grids with triangle cells. I looked at the cxx source for vtkGeometryFilter at https://github.com/Kitware/VTK/blob/master/Filters/Geometry/vtkGeometryFilter.cxx and it seems like the quadratic cells are not supported? In that case, what other approaches should I look into? Thanks in advance. > > > Best, > > Giang > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From lasso at queensu.ca Mon Aug 20 10:05:04 2018 From: lasso at queensu.ca (Andras Lasso) Date: Mon, 20 Aug 2018 14:05:04 +0000 Subject: [vtkusers] Embed VTK in a GUI In-Reply-To: References: <1534759138799-0.post@n5.nabble.com> Message-ID: If you need a full-featured application then you may also consider customizing/extending existing VTK-based open-source applications that embed Python. Using Python scripting, you can build up your application GUI from plain low-level Qt widgets and bring in any additional application-specific widgets as needed; and access to all the features that these application provide. You can build on Paraview for general technical visualization, 3D Slicer for medical image computing, etc. Andras -----Original Message----- From: vtkusers On Behalf Of Andrew E. Slaughter Sent: Monday, August 20, 2018 8:40 AM To: manhta152 ; vtkusers at vtk.org Subject: Re: [vtkusers] Embed VTK in a GUI My recommendation is to use PySide (https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.qt.io%2FQt_for_Python&data=02%7C01%7Classo%40queensu.ca%7C9040f7185e0842ecf59808d6069a0205%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636703655886230803&sdata=iIVPxJtVxy985WoXTk%2BRWVNghkfXufiuVuUcVjIL1Ic%3D&reserved=0), the official Python bindings for Qt. I have used Python and PySide (the old one), PyQt4, and PyQt5 to maintain a VTK based GUI for many years, they work well together. Good luck. ________________________________________ From: vtkusers on behalf of manhta152 Sent: Monday, August 20, 2018 3:58:58 AM To: vtkusers at vtk.org Subject: [vtkusers] Embed VTK in a GUI Hi everyone, I have a computational modeling program that has been written in Matlab. I developed a GUI in Matlab and used VTK to visualize and interact (transform, cut, deform, etc.,) CAD models. However, Matlab GUI does not support embedding VTK, resulting in a separate Matlab GUI and a VTK rendering window. I have looked for options to embed VTK in a GUI that works similar to 3D Slicer. I know that I can do it in Qt, Python and PyQt, Python and Tk, Jave, and C#. The problem is my program consists of many matrix-based calculations that may take a great deal of effort if I develop the program in Qt and C#. Python is quite close to Matlab that I think I can develop the program in a short period and save time. For those who have experience in developing an app using VTK and PyQt, please let me know I should use VTK and PyQt4 or PyQt5 and why? Also, if you think Qt or C# can work more efficiently than Python (I don't have much experience in Qt), please let me know your thoughts and share with me how I can work efficiently with matrices in Qt and C#. Thanks in advance. I do appreciate any input. Regards, Manh -- Sent from: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fvtk.1045678.n5.nabble.com%2FVTK-Users-f1224199.html&data=02%7C01%7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874&sdata=907KYG62qUwb2Gm7bpb1u4Sk%2FXP0oasjU1Xp3XdIYlE%3D&reserved=0 _______________________________________________ Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874&sdata=WRwde%2BH2a6rWuYKFkI1DR3h4aZgyBGsJidMPgXBvLSE%3D&reserved=0 Visit other Kitware open-source projects at https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874&sdata=uoinIT40oISsji%2Fql4XN6QUXXLzomHVdZjm4uPVq574%3D&reserved=0 Please keep messages on-topic and check the VTK FAQ at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874&sdata=GgIeiz1t4yStgLAZPGN7eDeQVSHDE3pzyH6xCybqtlo%3D&reserved=0 Search the list archives at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874&sdata=29K7%2F6Z17oHJK1fjmLkJ6NzoNMPgOlsVmLmdKmeJnfc%3D&reserved=0 Follow this link to subscribe/unsubscribe: https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874&sdata=PlqeA5G62Q2dzs3RIUo%2BSmcvjLYo5ztJF2H3%2Foevy2E%3D&reserved=0 _______________________________________________ Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7C9040f7185e0842ecf59808d6069a0205%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636703655886230803&sdata=7%2BYbID%2FxslBlzqKxEM8ghIA%2BlyBUCmzFYnvVcTFetgQ%3D&reserved=0 Visit other Kitware open-source projects at https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40queensu.ca%7C9040f7185e0842ecf59808d6069a0205%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636703655886230803&sdata=FD%2BOMciZcGR%2BPi1DBOqyL%2FY4amr2NEW4xxPAEZ8UwVc%3D&reserved=0 Please keep messages on-topic and check the VTK FAQ at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Classo%40queensu.ca%7C9040f7185e0842ecf59808d6069a0205%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636703655886230803&sdata=j4iX5BXlaECzt4KNp5sLksI6IBB9BxCDfK2uV6Ts%2FpY%3D&reserved=0 Search the list archives at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Classo%40queensu.ca%7C9040f7185e0842ecf59808d6069a0205%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636703655886240812&sdata=CdsYNqQAFMk%2BQJT0wFy2a26LgdStw3enUx0imvXxhYQ%3D&reserved=0 Follow this link to subscribe/unsubscribe: https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%7C9040f7185e0842ecf59808d6069a0205%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636703655886240812&sdata=WEZo64MvkTe%2Bn1JQsk6CezzJ3kqWxE6qTnvvE%2BXX2w8%3D&reserved=0 From juch at zhaw.ch Mon Aug 20 10:22:55 2018 From: juch at zhaw.ch (normanius) Date: Mon, 20 Aug 2018 07:22:55 -0700 (MST) Subject: [vtkusers] Inherit from vtkPolyDataAlgorithm within python only? Message-ID: <1534774975197-0.post@n5.nabble.com> Dear allIs it possible to somehow inherit vtkPolyDataAlgorithm from within the python wrapper only?Or in other words: is it possible to mimic a vtkPolyDataAlgorithm entirely within python?I have something like the following in mind:This is certainly against vtk's design objectives. But for my project, it would be the easiest if I can create an algorithm within my python module, without the need to re-build vtk and to re-distribute a forked version of vtk.BestNorman -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.slaughter at inl.gov Mon Aug 20 10:25:26 2018 From: andrew.slaughter at inl.gov (Andrew E. Slaughter) Date: Mon, 20 Aug 2018 14:25:26 +0000 Subject: [vtkusers] Inherit from vtkPolyDataAlgorithm within python only? In-Reply-To: <1534774975197-0.post@n5.nabble.com> References: <1534774975197-0.post@n5.nabble.com> Message-ID: This might help, if you haven't found it already: https://blog.kitware.com/vtkpythonalgorithm-is-great/ ________________________________________ From: vtkusers on behalf of normanius Sent: Monday, August 20, 2018 8:22:55 AM To: vtkusers at vtk.org Subject: [vtkusers] Inherit from vtkPolyDataAlgorithm within python only? Dear all Is it possible to somehow inherit vtkPolyDataAlgorithm from within the python wrapper only? Or in other words: is it possible to mimic a vtkPolyDataAlgorithm entirely within python? I have something like the following in mind: from my_algo import MyAlgoObj algo = MyAlgoObj() algo.SetInputConnection(input.GetOutputPort()) algo.Update() algo.GetOutput() ... # my_algo.py: import vtk class MyAlgoObj(vtk.vtkPolyDataAlgorithm): def __init__(self): # ... def RequestData(...): # ... This is certainly against vtk's design objectives. But for my project, it would be the easiest if I can create an algorithm within my python module, without the need to re-build vtk and to re-distribute a forked version of vtk. Best Norman ________________________________ Sent from the VTK - Users mailing list archive at Nabble.com. From bill.lorensen at gmail.com Mon Aug 20 10:27:05 2018 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Mon, 20 Aug 2018 07:27:05 -0700 Subject: [vtkusers] vtkGeometryFilter for quadratic tetra grids In-Reply-To: References: Message-ID: Can you share your data? Could be a bug in GeometryFilter. On Mon, Aug 20, 2018, 6:57 AM Nguyen, Giang Hoang wrote: > Hi, > > > Thanks for the quick reply Kenichiro. I could see that the GeometryFilter > does support quadratic tetra grids now. Still I have the issue with my > large mesh. I'm reading from a file and this is the snippet to read that > file: > > ---- > reader = vtkUnstructuredGridReader() > reader.SetFileName(file_name) > reader.Update() > print reader.GetOutput() > ---- > > which prints out this to terminal: > > vtkUnstructuredGrid (0000000006521F50) > Debug: Off > Modified Time: 184 > Reference Count: 2 > Registered Events: (none) > Information: 00000000025B0F10 > Data Released: False > Global Release Data: Off > UpdateTime: 189 > Field Data: > Debug: Off > Modified Time: 161 > Reference Count: 1 > Registered Events: (none) > Number Of Arrays: 0 > Number Of Components: 0 > Number Of Tuples: 0 > Number Of Points: 343399 > Number Of Cells: 250935 > > I suppose this means the reader was able to read the unstructured grid > correctly and I have data integrity (which is also confirmed by Paraview, > which was able to generate this UnstructuredGrid mesh). What I'm looking > for is this snippet to work: > > ---- > > geoFilter = vtkGeometryFilter() > geoFilter.SetInputConnection(reader.GetOutputPort()) > geoFilter.Update() > ---- > > Unfortunately, the line geoFilter.Update() always makes vtkpython quit > without any warning/error even with try catch surrounding. I'm not sure > what the problem now is. > ------------------------------ > *From:* kenichiro yoshimi > *Sent:* Friday, August 17, 2018 11:04:27 PM > *To:* Nguyen, Giang Hoang > *Cc:* vtkusers at public.kitware.com > *Subject:* Re: [vtkusers] vtkGeometryFilter for quadratic tetra grids > > Hi, > > Could you provide some more information on what happens in applying > vtkGeometryFilter to quadratic tetra grids. At least, the following > simple code works without any problem using vtk 7.1.1. > > --- > import vtk > > def main(): > > points = vtk.vtkPoints() > points.InsertNextPoint(0, 0, 0) > points.InsertNextPoint(1, 0, 0) > points.InsertNextPoint(1, 1, 0) > points.InsertNextPoint(0.5, 0.5, 0.5) > points.InsertNextPoint(0.5, 0, 0) > points.InsertNextPoint(1, 0.5, 0) > points.InsertNextPoint(0.5, 0.5, 0) > points.InsertNextPoint(0.25, 0.25, 0.25) > points.InsertNextPoint(0.75, 0.25, 0.25) > points.InsertNextPoint(0.75, 0.75, 0.25) > > unstructuredGrid = vtk.vtkUnstructuredGrid() > unstructuredGrid.SetPoints(points) > > quadraticTetra = vtk.vtkQuadraticTetra() > > for i in range(10): > quadraticTetra.GetPointIds().SetId(i, i) > > cellArray = vtk.vtkCellArray() > cellArray.InsertNextCell(quadraticTetra) > > unstructuredGrid.SetCells(vtk.VTK_QUADRATIC_TETRA, cellArray) > > print('quadraticTetra: ') > print(' cell number: {}'.format(unstructuredGrid.GetNumberOfCells())) > print(' point number: {}\n'.format(unstructuredGrid.GetNumberOfPoints())) > > geometryFilter = vtk.vtkGeometryFilter() > geometryFilter.SetInputData(unstructuredGrid) > geometryFilter.Update() > > print('extracted surface: ') > print(' cell number: > {}'.format(geometryFilter.GetOutput().GetNumberOfCells())) > print(' point number: > {}'.format(geometryFilter.GetOutput().GetNumberOfPoints())) > > mapper = vtk.vtkPolyDataMapper() > mapper.SetInputConnection(geometryFilter.GetOutputPort()) > > actor = vtk.vtkActor() > actor.SetMapper(mapper) > actor.GetProperty().EdgeVisibilityOn() > > renderer = vtk.vtkRenderer() > renderer.AddActor(actor) > > renderer.ResetCamera() > renderer.GetActiveCamera().Azimuth(210) > renderer.GetActiveCamera().Elevation(30) > > renderWindow = vtk.vtkRenderWindow() > renderWindow.SetSize(640, 480) > renderWindow.AddRenderer(renderer) > > renderWindowInteractor = vtk.vtkRenderWindowInteractor() > renderWindowInteractor.SetRenderWindow(renderWindow) > > renderWindowInteractor.Start() > > > if __name__ == '__main__': > main() > --- > > Regards, > 2018?8?18?(?) 4:17 Nguyen, Giang Hoang : > > > > Hi, > > > > > > I would like to confirm here if vtkGeometryFilter doesn't work for > unstructured grids that are quadratic tetra (10 nodes per cell). I was > using it to convert an unstructured grid to polydata, using vtkpython in > conda environment. The exact code works fine for unstructured grids with > triangle cells. I looked at the cxx source for vtkGeometryFilter at > https://github.com/Kitware/VTK/blob/master/Filters/Geometry/vtkGeometryFilter.cxx > and it seems like the quadratic cells are not supported? In that case, what > other approaches should I look into? Thanks in advance. > > > > > > Best, > > > > Giang > > > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > > > Follow this link to subscribe/unsubscribe: > > https://public.kitware.com/mailman/listinfo/vtkusers > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From niuton152 at gmail.com Mon Aug 20 10:31:13 2018 From: niuton152 at gmail.com (Manh Ta) Date: Mon, 20 Aug 2018 21:31:13 +0700 Subject: [vtkusers] Embed VTK in a GUI In-Reply-To: References: <1534759138799-0.post@n5.nabble.com> Message-ID: Thanks Andras, I think I need a full-featured application as my current GUI in Matlab uses fully features that Matlab provides. Your suggestion was a bit over my head right now, but it would be extremely useful when I reach that level. *Manh Ta* Graduate Research Assistant Center for Musculoskeletal Research The University of Tennessee, Knoxville Email: dta at vols.utk.edu On Mon, Aug 20, 2018 at 9:05 PM, Andras Lasso wrote: > If you need a full-featured application then you may also consider > customizing/extending existing VTK-based open-source applications that > embed Python. Using Python scripting, you can build up your application GUI > from plain low-level Qt widgets and bring in any additional > application-specific widgets as needed; and access to all the features that > these application provide. You can build on Paraview for general technical > visualization, 3D Slicer for medical image computing, etc. > > Andras > > -----Original Message----- > From: vtkusers On Behalf Of Andrew > E. Slaughter > Sent: Monday, August 20, 2018 8:40 AM > To: manhta152 ; vtkusers at vtk.org > Subject: Re: [vtkusers] Embed VTK in a GUI > > My recommendation is to use PySide (https://na01.safelinks. > protection.outlook.com/?url=https%3A%2F%2Fwiki.qt.io%2FQt_ > for_Python&data=02%7C01%7Classo%40queensu.ca% > 7C9040f7185e0842ecf59808d6069a0205%7Cd61ecb3b38b142d582c4efb2838b > 925c%7C1%7C0%7C636703655886230803&sdata=iIVPxJtVxy985WoXTk% > 2BRWVNghkfXufiuVuUcVjIL1Ic%3D&reserved=0), the official Python > bindings for Qt. I have used Python and PySide (the old one), PyQt4, and > PyQt5 to maintain a VTK based GUI for many years, they work well together. > Good luck. > > ________________________________________ > From: vtkusers on behalf of > manhta152 > Sent: Monday, August 20, 2018 3:58:58 AM > To: vtkusers at vtk.org > Subject: [vtkusers] Embed VTK in a GUI > > Hi everyone, > > I have a computational modeling program that has been written in Matlab. I > developed a GUI in Matlab and used VTK to visualize and interact > (transform, cut, deform, etc.,) CAD models. However, Matlab GUI does not > support embedding VTK, resulting in a separate Matlab GUI and a VTK > rendering window. I have looked for options to embed VTK in a GUI that > works similar to 3D Slicer. I know that I can do it in Qt, Python and PyQt, > Python and Tk, Jave, and C#. > > The problem is my program consists of many matrix-based calculations that > may take a great deal of effort if I develop the program in Qt and C#. > Python is quite close to Matlab that I think I can develop the program in > a short period and save time. > > For those who have experience in developing an app using VTK and PyQt, > please let me know I should use VTK and PyQt4 or PyQt5 and why? > > Also, if you think Qt or C# can work more efficiently than Python (I don't > have much experience in Qt), please let me know your thoughts and share > with me how I can work efficiently with matrices in Qt and C#. > > Thanks in advance. I do appreciate any input. > > Regards, > Manh > > > > > -- > Sent from: https://na01.safelinks.protection.outlook.com/?url= > http%3A%2F%2Fvtk.1045678.n5.nabble.com%2FVTK-Users- > f1224199.html&data=02%7C01%7Candrew.slaughter%40inl.gov% > 7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a9856648 > 5554%7C0%7C0%7C636703559665615874&sdata=907KYG62qUwb2Gm7bpb1u4Sk% > 2FXP0oasjU1Xp3XdIYlE%3D&reserved=0 > _______________________________________________ > Powered by https://na01.safelinks.protection.outlook.com/?url= > www.kitware.com&data=02%7C01%7Candrew.slaughter%40inl.gov% > 7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a9856648 > 5554%7C0%7C0%7C636703559665615874&sdata=WRwde% > 2BH2a6rWuYKFkI1DR3h4aZgyBGsJidMPgXBvLSE%3D&reserved=0 > > Visit other Kitware open-source projects at https://na01.safelinks. > protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com% > 2Fopensource%2Fopensource.html&data=02%7C01% > 7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09% > 7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874& > sdata=uoinIT40oISsji%2Fql4XN6QUXXLzomHVdZjm4uPVq574%3D&reserved=0 > > Please keep messages on-topic and check the VTK FAQ at: > https://na01.safelinks.protection.outlook.com/?url= > http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02% > 7C01%7Candrew.slaughter%40inl.gov%7C91199821da7e4864b14508d606839b09% > 7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C636703559665615874&sdata= > GgIeiz1t4yStgLAZPGN7eDeQVSHDE3pzyH6xCybqtlo%3D&reserved=0 > > Search the list archives at: https://na01.safelinks. > protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org% > 2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Candrew.slaughter%40inl.gov% > 7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a9856648 > 5554%7C0%7C0%7C636703559665615874&sdata=29K7% > 2F6Z17oHJK1fjmLkJ6NzoNMPgOlsVmLmdKmeJnfc%3D&reserved=0 > > Follow this link to subscribe/unsubscribe: > https://na01.safelinks.protection.outlook.com/?url= > https%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo% > 2Fvtkusers&data=02%7C01%7Candrew.slaughter%40inl.gov% > 7C91199821da7e4864b14508d606839b09%7C4cf464b7869a42368da2a9856648 > 5554%7C0%7C0%7C636703559665615874&sdata=PlqeA5G62Q2dzs3RIUo% > 2BSmcvjLYo5ztJF2H3%2Foevy2E%3D&reserved=0 > _______________________________________________ > Powered by https://na01.safelinks.protection.outlook.com/?url= > www.kitware.com&data=02%7C01%7Classo%40queensu.ca% > 7C9040f7185e0842ecf59808d6069a0205%7Cd61ecb3b38b142d582c4efb2838b > 925c%7C1%7C0%7C636703655886230803&sdata=7%2BYbID%2FxslBlzqKxEM8ghIA% > 2BlyBUCmzFYnvVcTFetgQ%3D&reserved=0 > > Visit other Kitware open-source projects at https://na01.safelinks. > protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com% > 2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40queensu.ca% > 7C9040f7185e0842ecf59808d6069a0205%7Cd61ecb3b38b142d582c4efb2838b > 925c%7C1%7C0%7C636703655886230803&sdata=FD%2BOMciZcGR%2BPi1DBOqyL% > 2FY4amr2NEW4xxPAEZ8UwVc%3D&reserved=0 > > Please keep messages on-topic and check the VTK FAQ at: > https://na01.safelinks.protection.outlook.com/?url= > http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02% > 7C01%7Classo%40queensu.ca%7C9040f7185e0842ecf59808d6069a0205% > 7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636703655886230803&sdata= > j4iX5BXlaECzt4KNp5sLksI6IBB9BxCDfK2uV6Ts%2FpY%3D&reserved=0 > > Search the list archives at: https://na01.safelinks. > protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org% > 2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Classo%40queensu.ca% > 7C9040f7185e0842ecf59808d6069a0205%7Cd61ecb3b38b142d582c4efb2838b > 925c%7C1%7C0%7C636703655886240812&sdata=CdsYNqQAFMk% > 2BQJT0wFy2a26LgdStw3enUx0imvXxhYQ%3D&reserved=0 > > Follow this link to subscribe/unsubscribe: > https://na01.safelinks.protection.outlook.com/?url= > https%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo% > 2Fvtkusers&data=02%7C01%7Classo%40queensu.ca% > 7C9040f7185e0842ecf59808d6069a0205%7Cd61ecb3b38b142d582c4efb2838b > 925c%7C1%7C0%7C636703655886240812&sdata=WEZo64MvkTe% > 2Bn1JQsk6CezzJ3kqWxE6qTnvvE%2BXX2w8%3D&reserved=0 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan.lipsa at kitware.com Mon Aug 20 10:54:24 2018 From: dan.lipsa at kitware.com (Dan Lipsa) Date: Mon, 20 Aug 2018 10:54:24 -0400 Subject: [vtkusers] Orthogonal cross-sections from vtkImageData In-Reply-To: <1679125605.516869.1534706288593@mail.yahoo.com> References: <1679125605.516869.1534706288593.ref@mail.yahoo.com> <1679125605.516869.1534706288593@mail.yahoo.com> Message-ID: Rao, Take a look at vtkCutter Dan On Sun, Aug 19, 2018 at 3:18 PM Koteswara Rao Ruvva via vtkusers < vtkusers at public.kitware.com> wrote: > Hello all, > > I need to compute three orthogonal cross-sections thru vtkImageData. I use > the following code and it works fine. > > self.sagittal = vtk.vtkImageActor() > > self.sagittal.GetMapper().SetInputConnection(self.imageData.GetOutputPort()) > self.sagittal.SetDisplayExtent(int(self.nx/2), int(self.nx/2), 0, > self.ny, 0, self.nz) > > How do I compute cross-sections that are not parallel to coordinate planes > and have arbitrary orientation. I tried vtkProbeFilter with planes but I > don't get any data back. Please advise. > > Thank you > Rao > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From juch at zhaw.ch Mon Aug 20 11:00:10 2018 From: juch at zhaw.ch (normanius) Date: Mon, 20 Aug 2018 08:00:10 -0700 (MST) Subject: [vtkusers] Inherit from vtkPolyDataAlgorithm within python only? In-Reply-To: References: <1534774975197-0.post@n5.nabble.com> Message-ID: <1534777210190-0.post@n5.nabble.com> Many thanks, Andrew. Completely missed that blog post. VTKPythonAlgorithmBase is exactly what I was looking for. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From marcus.hanwell at kitware.com Mon Aug 20 16:02:37 2018 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Mon, 20 Aug 2018 16:02:37 -0400 Subject: [vtkusers] Add error bars to a 2D scatter plot In-Reply-To: <8bbb05f93d4742f5aee3394a5c600167@EXCHCS32.ornl.gov> References: <8bbb05f93d4742f5aee3394a5c600167@EXCHCS32.ornl.gov> Message-ID: On Mon, Aug 13, 2018 at 2:20 PM Purves, Murray wrote: > Hi, > > Is there a way to add error bars to scatter plot data using VTK? I am > currently plotting point data using the C++ API; there is uncertainty > associated with the data I am trying to plot which I would like to > visualise also. > I can't find any obvious references in the documentation to error bars; > the only mention I have found is in a presentation at: > https://na-mic.org/w/images/1/18/NA-MIC-VTK-Charts-2011.pdf, which > doesn't seem to be a function that exists. > > Sample code snippet: > > // Chart source data is populated etc... > > vtkPlot* sampleScatter = chartXY->AddPlot(vtkChart::POINTS); > sampleScatter->SetInputData(chartDataTable, 0, 1); > // Here is where I would like to add the error bars - > // below method is from the link, and does not work > > vtkPlotPoints::SafeDownCast(sampleScatter)->SetErrorArray(errorData.GetPointer()); > > // Chart is rendered... > > where chartXY is a vtkChartXY object and chartDataTable is > a vtkTable containing the x and y data in columns 0 and 1. > Is there a way to populate error data for visualisation in a similar > fashion to the above, or will I have to roll my own chart type? > I wrote those slides, and the code that generated them... I don't remember how I did the error bars, I will see if I can dig it out, but I suspect it was a feature that was never quite finished up. There weren't a lot of people clamoring for error bars at the time, and we were busy adding lots of things to charts. It wouldn't be that much work to add as you suggest, I think my prototype had a similar form, but I am not aware of any follow up work to complete it. Recent VTK doesn't need Get/GetPointer either. -------------- next part -------------- An HTML attachment was scrubbed... URL: From newcowbow1104 at gmail.com Mon Aug 20 21:44:00 2018 From: newcowbow1104 at gmail.com (Feng Yang) Date: Tue, 21 Aug 2018 09:44:00 +0800 Subject: [vtkusers] The difference between vtk8.1 and vtk.s in volume rendering Message-ID: Hi Sir. I'm working on medical imaging volume rendering with vtk.js in my application. I tried to set the same color and scalarOpacity parameters both in vtk(C++) and vtk.js. And I thought the result was the same. But It seems I'm wrong. The output are totally different, Just like the attachments. Why is that? BTW: VTK is 8.1.1 vtk.js is 7.4.10. thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: vtk8.1.PNG Type: image/png Size: 617043 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: vtkjs.PNG Type: image/png Size: 271024 bytes Desc: not available URL: From ruvva at yahoo.com Tue Aug 21 01:17:26 2018 From: ruvva at yahoo.com (Koteswara Rao Ruvva) Date: Tue, 21 Aug 2018 05:17:26 +0000 (UTC) Subject: [vtkusers] Orthogonal cross-sections from vtkImageData In-Reply-To: References: <1679125605.516869.1534706288593.ref@mail.yahoo.com> <1679125605.516869.1534706288593@mail.yahoo.com> Message-ID: <34597065.1347214.1534828646930@mail.yahoo.com> Thank you, Dan. vtkCutter worked. Great. On Monday, August 20, 2018, 7:55:01 AM PDT, Dan Lipsa wrote: Rao,Take a look at vtkCutter Dan On Sun, Aug 19, 2018 at 3:18 PM Koteswara Rao Ruvva via vtkusers wrote: Hello all, I need to compute three orthogonal cross-sections thru vtkImageData. I use the following code and it works fine. ? ? ? ? self.sagittal = vtk.vtkImageActor()? ? ? ? self.sagittal.GetMapper().SetInputConnection(self.imageData.GetOutputPort())? ? ? ? self.sagittal.SetDisplayExtent(int(self.nx/2), int(self.nx/2), 0, self.ny, 0, self.nz) How do I compute cross-sections that are not parallel to coordinate planes and have arbitrary orientation. I tried vtkProbeFilter with planes but I don't get any data back. Please advise. Thank youRao_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: https://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.martin at kitware.com Tue Aug 21 08:39:43 2018 From: ken.martin at kitware.com (Ken Martin) Date: Tue, 21 Aug 2018 08:39:43 -0400 Subject: [vtkusers] The difference between vtk8.1 and vtk.s in volume rendering In-Reply-To: References: Message-ID: Might be that not everything is being set and the two have different defaults. Is shading turned on in vtk.js. ala volumeProperty.setShade(true) also maybe include snippits showing the setup of the volume/mapper/properties in C++ and JS On Mon, Aug 20, 2018 at 9:44 PM, Feng Yang wrote: > Hi Sir. > I'm working on medical imaging volume rendering with vtk.js in my > application. > I tried to set the same color and scalarOpacity parameters both in > vtk(C++) and vtk.js. And I thought the result was the same. But It seems > I'm wrong. The output are totally different, Just like the attachments. > Why is that? > BTW: > VTK is 8.1.1 > vtk.js is 7.4.10. > > thanks. > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > > -- Ken Martin PhD Distinguished Engineer Kitware Inc. 101 East Weaver Street Carrboro, North Carolina 27510 USA This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From purvesmh at ornl.gov Tue Aug 21 09:33:38 2018 From: purvesmh at ornl.gov (Purves, Murray) Date: Tue, 21 Aug 2018 13:33:38 +0000 Subject: [vtkusers] Add error bars to a 2D scatter plot In-Reply-To: References: <8bbb05f93d4742f5aee3394a5c600167@EXCHCS32.ornl.gov> Message-ID: <918335D8-CF31-46A3-BE22-84EB4E0E6ACC@ornl.gov> Thanks very much, anything you do find would be greatly appreciated ? and if you can?t, any pointers you might have re: putting together a class would be fantastic as well. Cheers Murray From: "Marcus D. Hanwell" Date: Monday, August 20, 2018 at 16:02 To: "Purves, Murray" Cc: "vtkusers at public.kitware.com" Subject: Re: [vtkusers] Add error bars to a 2D scatter plot On Mon, Aug 13, 2018 at 2:20 PM Purves, Murray > wrote: Hi, Is there a way to add error bars to scatter plot data using VTK? I am currently plotting point data using the C++ API; there is uncertainty associated with the data I am trying to plot which I would like to visualise also. I can't find any obvious references in the documentation to error bars; the only mention I have found is in a presentation at: https://na-mic.org/w/images/1/18/NA-MIC-VTK-Charts-2011.pdf, which doesn't seem to be a function that exists. Sample code snippet: // Chart source data is populated etc... vtkPlot* sampleScatter = chartXY->AddPlot(vtkChart::POINTS); sampleScatter->SetInputData(chartDataTable, 0, 1); // Here is where I would like to add the error bars - // below method is from the link, and does not work vtkPlotPoints::SafeDownCast(sampleScatter)->SetErrorArray(errorData.GetPointer()); // Chart is rendered... where chartXY is a vtkChartXY object and chartDataTable is a vtkTable containing the x and y data in columns 0 and 1. Is there a way to populate error data for visualisation in a similar fashion to the above, or will I have to roll my own chart type? I wrote those slides, and the code that generated them... I don't remember how I did the error bars, I will see if I can dig it out, but I suspect it was a feature that was never quite finished up. There weren't a lot of people clamoring for error bars at the time, and we were busy adding lots of things to charts. It wouldn't be that much work to add as you suggest, I think my prototype had a similar form, but I am not aware of any follow up work to complete it. Recent VTK doesn't need Get/GetPointer either. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Tue Aug 21 09:48:27 2018 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Tue, 21 Aug 2018 06:48:27 -0700 Subject: [vtkusers] Add error bars to a 2D scatter plot In-Reply-To: <918335D8-CF31-46A3-BE22-84EB4E0E6ACC@ornl.gov> References: <8bbb05f93d4742f5aee3394a5c600167@EXCHCS32.ornl.gov> <918335D8-CF31-46A3-BE22-84EB4E0E6ACC@ornl.gov> Message-ID: This example might be useful. https://lorensen.github.io/VTKExamples/site/Cxx/Plotting/BoxChart/ On Tue, Aug 21, 2018, 6:33 AM Purves, Murray wrote: > Thanks very much, anything you do find would be greatly appreciated ? and > if you can?t, any pointers you might have re: putting together a class > would be fantastic as well. > > > > Cheers > > > > Murray > > > > > > > > *From: *"Marcus D. Hanwell" > *Date: *Monday, August 20, 2018 at 16:02 > *To: *"Purves, Murray" > *Cc: *"vtkusers at public.kitware.com" > *Subject: *Re: [vtkusers] Add error bars to a 2D scatter plot > > > > On Mon, Aug 13, 2018 at 2:20 PM Purves, Murray wrote: > > Hi, > > Is there a way to add error bars to scatter plot data using VTK? I am > currently plotting point data using the C++ API; there is uncertainty > associated with the data I am trying to plot which I would like to > visualise also. > I can't find any obvious references in the documentation to error bars; > the only mention I have found is in a presentation at: > https://na-mic.org/w/images/1/18/NA-MIC-VTK-Charts-2011.pdf, which > doesn't seem to be a function that exists. > > Sample code snippet: > > // Chart source data is populated etc... > > vtkPlot* sampleScatter = chartXY->AddPlot(vtkChart::POINTS); > sampleScatter->SetInputData(chartDataTable, 0, 1); > // Here is where I would like to add the error bars - > // below method is from the link, and does not work > > vtkPlotPoints::SafeDownCast(sampleScatter)->SetErrorArray(errorData.GetPointer()); > > // Chart is rendered... > > where chartXY is a vtkChartXY object and chartDataTable is > a vtkTable containing the x and y data in columns 0 and 1. > Is there a way to populate error data for visualisation in a similar > fashion to the above, or will I have to roll my own chart type? > > > > I wrote those slides, and the code that generated them... I don't remember > how I did the error bars, I will see if I can dig it out, but I suspect it > was a feature that was never quite finished up. There weren't a lot of > people clamoring for error bars at the time, and we were busy adding lots > of things to charts. > > > > It wouldn't be that much work to add as you suggest, I think my prototype > had a similar form, but I am not aware of any follow up work to complete > it. Recent VTK doesn't need Get/GetPointer either. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From skemobob at gmail.com Tue Aug 21 13:11:40 2018 From: skemobob at gmail.com (=?UTF-8?B?0KHQu9Cw0LLQsCDQoNC10YjQtdGC0L3QuNC60L7Qsg==?=) Date: Tue, 21 Aug 2018 20:11:40 +0300 Subject: [vtkusers] ODBC connection Message-ID: Does anyone know how to read data from odbc connection to paraview? Please contact me if you know. Best Regards, Vyacheslav -------------- next part -------------- An HTML attachment was scrubbed... URL: From newcowbow1104 at gmail.com Tue Aug 21 22:16:45 2018 From: newcowbow1104 at gmail.com (Feng Yang) Date: Wed, 22 Aug 2018 10:16:45 +0800 Subject: [vtkusers] The difference between vtk8.1 and vtk.s in volume rendering In-Reply-To: References: Message-ID: Yes, I turned the shading on in vtk.js. Still. The wired thing I got is that when I call the function such as setShade(true), setParallelProjection(true) in vtk.js. The output result is very different from I did in VTK(C++).. especially After I call setParallelProjection(true), the result is very wired just like attachement. I don't know what's going on. Ken Martin ?2018?8?21??? ??8:39??? > Might be that not everything is being set and the two have different > defaults. Is shading turned on in vtk.js. ala volumeProperty.setShade(true) > also maybe include snippits showing the setup of the > volume/mapper/properties in C++ and JS > > On Mon, Aug 20, 2018 at 9:44 PM, Feng Yang > wrote: > >> Hi Sir. >> I'm working on medical imaging volume rendering with vtk.js in my >> application. >> I tried to set the same color and scalarOpacity parameters both in >> vtk(C++) and vtk.js. And I thought the result was the same. But It seems >> I'm wrong. The output are totally different, Just like the attachments. >> Why is that? >> BTW: >> VTK is 8.1.1 >> vtk.js is 7.4.10. >> >> thanks. >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> https://public.kitware.com/mailman/listinfo/vtkusers >> >> > > > -- > Ken Martin PhD > Distinguished Engineer > Kitware Inc. > 101 East Weaver Street > Carrboro, North Carolina > 27510 USA > > This communication, including all attachments, contains confidential and > legally privileged information, and it is intended only for the use of the > addressee. Access to this email by anyone else is unauthorized. If you are > not the intended recipient, any disclosure, copying, distribution or any > action taken in reliance on it is prohibited and may be unlawful. If you > received this communication in error please notify us immediately and > destroy the original message. Thank you. > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ParallelProjection.PNG Type: image/png Size: 102065 bytes Desc: not available URL: From minpu.code at gmail.com Wed Aug 22 03:22:07 2018 From: minpu.code at gmail.com (pnt1614) Date: Wed, 22 Aug 2018 00:22:07 -0700 (MST) Subject: [vtkusers] How to run a MFC program using VTK widgets? Message-ID: <1534922527853-0.post@n5.nabble.com> I make a MFC program using visual studio 2015 on windows 10 (64 bits) and VTK 8.1.1. In order to use VTK widgets, I need to start the VTK event loop, e.g. Interactor->Start(). When I run/debug the program from the visual studio by pressing F5 and everything works fine. But when I close the main window, the program is still run and I must manually stop it. Maybe there is a conflict between the VTK event loop and another event loop in MFC. I also have tried to invoke the following statements when closing the main window but it does not work. 1. Interactor->ExitEvent(); 2. Interactor->ExitCallBack(); 3. Interactor->TerminateApp(); // This function does nothing Similarly, when I run the program by pressing Ctrl + F5 and after closing the main window, the execution file is still run. Is there anybody experienced this problem? Please, help me. Thank you. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From marvin.huber at basf.com Wed Aug 22 10:14:06 2018 From: marvin.huber at basf.com (marf) Date: Wed, 22 Aug 2018 07:14:06 -0700 (MST) Subject: [vtkusers] Oriented arrows in vtk.js Message-ID: <1534947246704-0.post@n5.nabble.com> Hello there, I'm trying to get oriented arrows (meaning an arrow that spans from point a to point b) in vtk.js. I tried following this example but did not get to far https://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/OrientedArrow So what I do right now is trying to pass transformation matrices to my actor, it kind of looks like this: *const arrow = vtkArrowSource.newInstance(); const arrowMapper = vtk.Rendering.Core.vtkMapper.newInstance({ scalarVisibility: false }); arrowMapper.setInputData(arrow.getOutputData()); const arrowActor = vtk.Rendering.Core.vtkActor.newInstance(); arrowActor.setUserMatrix(matrix); arrowActor.setMapper(arrowMapper); this.renderer.addActor(arrowActor);* When I define a rotation matrix and pass it, everything works fine. But when I try to translate the arrows, all I get is some weird stretched arrow, with a huge base passing into a tiny head or other stuff. My transformation matrix would look like this 1, 0, 0, a, 0, 1, 0, b, 0, 0, 1, c, 0, 0, 0, 1 where a, b, c are the values I want to move the arrow by. Can someone help me please? Maybe even in getting the C-Example translated? (There's quite some stuff being used that is not part of vtk.js yet) -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From sebastien.jourdain at kitware.com Wed Aug 22 10:40:50 2018 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Wed, 22 Aug 2018 10:40:50 -0400 Subject: [vtkusers] Oriented arrows in vtk.js In-Reply-To: <1534947246704-0.post@n5.nabble.com> References: <1534947246704-0.post@n5.nabble.com> Message-ID: I guess we should implement the transform filter, unless you want to edit the generated polydata in place. polydata = source.getOutputData(); vtkMatrixBuilder .buildFromRadian() .translate(1, 2, 4) .rotateFromDirections([1, 0, 0], [0.5, 0.25, 0.1]) .apply(polydata.getPoints().getData()); mapper.setInputData(polydata); ... On Wed, Aug 22, 2018 at 10:14 AM marf wrote: > Hello there, I'm trying to get oriented arrows (meaning an arrow that spans > from point a to point b) in vtk.js. > > I tried following this example but did not get to far > https://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/OrientedArrow > > So what I do right now is trying to pass transformation matrices to my > actor, it kind of looks like this: > > *const arrow = vtkArrowSource.newInstance(); > const arrowMapper = vtk.Rendering.Core.vtkMapper.newInstance({ > scalarVisibility: false }); > arrowMapper.setInputData(arrow.getOutputData()); > const arrowActor = vtk.Rendering.Core.vtkActor.newInstance(); > > arrowActor.setUserMatrix(matrix); > arrowActor.setMapper(arrowMapper); > this.renderer.addActor(arrowActor);* > > When I define a rotation matrix and pass it, everything works fine. But > when > I try to translate the arrows, all I get is some weird stretched arrow, > with > a huge base passing into a tiny head or other stuff. > My transformation matrix would look like this > 1, 0, 0, a, > 0, 1, 0, b, > 0, 0, 1, c, > 0, 0, 0, 1 > > where a, b, c are the values I want to move the arrow by. > > Can someone help me please? Maybe even in getting the C-Example translated? > (There's quite some stuff being used that is not part of vtk.js yet) > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marvin.huber at basf.com Wed Aug 22 11:01:35 2018 From: marvin.huber at basf.com (marf) Date: Wed, 22 Aug 2018 08:01:35 -0700 (MST) Subject: [vtkusers] Oriented arrows in vtk.js In-Reply-To: References: <1534947246704-0.post@n5.nabble.com> Message-ID: <1534950095300-0.post@n5.nabble.com> Thank you so much, since there is no transform filter yet, I will probably apply your suggestion to my problem and go with it :-) -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From sebastien.jourdain at kitware.com Wed Aug 22 11:40:31 2018 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Wed, 22 Aug 2018 11:40:31 -0400 Subject: [vtkusers] Oriented arrows in vtk.js In-Reply-To: <1534950095300-0.post@n5.nabble.com> References: <1534947246704-0.post@n5.nabble.com> <1534950095300-0.post@n5.nabble.com> Message-ID: Making a transform filter is almost the same code as above except that you will need to do a shallowCopy of the polydata and replace the points with a cloned+edited version of the typed array. On Wed, Aug 22, 2018 at 11:01 AM marf wrote: > Thank you so much, since there is no transform filter yet, I will probably > apply your suggestion to my problem and go with it :-) > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mey1k at naver.com Wed Aug 22 21:21:28 2018 From: mey1k at naver.com (minjun) Date: Wed, 22 Aug 2018 18:21:28 -0700 (MST) Subject: [vtkusers] mesh morphing? offset?? i want advice Message-ID: <1534987288091-0.post@n5.nabble.com> hello, I want to transform the mesh so that I can insert a 3d printed mesh vertically. I have no idea what to do. morphing? offset?? Is there any idea I can refer to? please help me. thank you. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From tharun160190 at gmail.com Thu Aug 23 01:00:07 2018 From: tharun160190 at gmail.com (Tharun) Date: Wed, 22 Aug 2018 22:00:07 -0700 (MST) Subject: [vtkusers] Picking point on polydata in bottomost layer Message-ID: <1535000407014-0.post@n5.nabble.com> I have 2 renderers, both are on the same viewport. Bottom layer is the main renderer and the top one is used to render actors which needs to be on top of all actors of bottom layer. I would like to pick point on polydata of bottom layer. I am using vtkWorldPointPicker. It seems there is a problem with Z buffer data in this scenario. Does anyone have a solution for this? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From mathieu.westphal at kitware.com Thu Aug 23 05:07:10 2018 From: mathieu.westphal at kitware.com (Mathieu Westphal) Date: Thu, 23 Aug 2018 11:07:10 +0200 Subject: [vtkusers] the New QVTKOpenGLWidget Message-ID: Hello list, If you are working on a VTK/Qt application this information should interest you. Sometime ago, a new QVTKOpenGLWidget implementation has been added to VTK, while the old one has been moved to QVTKOpenGLSimpleWidget. The last fixes for this change have just been merged, so make sure to use VTK master to test this. *1. Why is there a new widget and what does it do ?* We have been having some issues reported for the old widget, and the old widget could not support quad buffer stereo rendering by design. Has it is a needed feature in ParaView, a reimplementation was necessary. This new widget fix most of the reported issues with the old widget as well as adding stereo support. *2. Why keeping the old widget around then ?* Due to Qt limitations, this new implementation does not support very well being a native widget. But native widget are sometimes mandatory, for example within QScrollArea and QMDIArea, so the QVTKOpenGLSimpleWidget should be used when in needs of VTK rendering in the contact of Qt native widget. Also it allows users to switch back to the old widget if necessary. *3. I'm not sure what native widgets are, what should I do in my application ?* Here are the different situation : 1. Your Qt application only uses a central QVTKOpenGLWidget for rendering: -> Nothing to do, just build with last master and make sure all is working well 2. Your Qt application only uses QVTKOpenGLWidget within QScrollArea or QMDIArea, or manually set widgets to be native and you are not interested by stereo rendering. -> Change all your QVTKOpenGLWidget to QVTKOpenGLSimpleWidget and you are good to go 3. Your application uses a non-native QVTKOpenGLWidget for rendering as well as native QVTKOpenGLWidget for rendering (eg: ParaView, with the central rendering widget and the color map editor rendering widget in scroll areas) : -> Use QVTKOpenGLWidget for non-native widgets and QVTKOpenGLSimpleWidget for native ones. The later will never support stereo. *4. I followed your recommendation but I see some strange stuff/bugs/rendering issues* Even if this new class has been tested extensively and will be used in the next ParaView release, It may still contains some issues. Feel free to discuss them in this mailing list or on our gitlab . Best regards, Mathieu Westphal -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Thu Aug 23 11:36:46 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Thu, 23 Aug 2018 17:36:46 +0200 Subject: [vtkusers] [vtk-developers] Using system fonts on Windows (fontconfig equivalent?) In-Reply-To: References: Message-ID: 2017-04-11 18:43 GMT+02:00 David Lonie : > AFAIK, the only option on windows would be to load the font file > directly using vtkTextProperty::SetFontFamily(VTK_FONT_FILE) and > vtkTextProperty::SetFontFile(...). I've never heard of FontConfig > being used on Windows, but I haven't really looked into it, either. > > Good luck! Just to report back on this old post of mine. I've just built VTK with the vtkRendereringFreeTypeFontConfig module activated on Windows. I used the pre-built fontconfig binaries available at https://github.com/ShiftMediaProject/fontconfig There was one gotcha regarding updating a vtkTextProperty to match that of a QFont (such as returned by e.g. QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont)). The gotcha is that QFont::family() may return a "logical" font family name such as "MS Shell Dlg 2", which needs to be mapped through the font substitution mapping in the Windows registry in order to get a "physical" font family name (such as "Tahoma") that can be passed to vtkTextProperty::SetFontFamilyAsString(..). Example shown below. Hope this might help someone else. Elvis namespace FontUtils { const static QString WindowsFontSubstitutesKey = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\FontSubstitutes"; void updateFromQFont(vtkTextProperty *property, const QFont &font) { auto family = font.family(); #if defined(Q_OS_WIN) // On Windows, since the QFont::family() may be a "logical font" // like "MS Shell Dlg 2", we can't use it directly as parameter to // vtkTextProperty::SetFontFamilyAsString(..), but must map it // through the font substitutions in the Windows registry to // get the real font family (e.g. "Tahoma"). QSettings map(WindowsFontSubstitutesKey, QSettings::NativeFormat); family = map.value(family, family).toString(); #endif property->SetFontFamilyAsString(family.toLocal8Bit()); property->SetFontSize(font.pointSize()); property->SetBold(font.bold()); property->SetItalic(font.italic()); } > > Dave > > On Tue, Apr 11, 2017 at 4:45 AM, Elvis Stansvik > wrote: >> Hi all, >> >> Cross-posting since I'm not sure if vtkusers@ or vtk-developers@ is >> most appropriate for this. >> >> On Linux, I'm using the vtkRendereringFreeTypeFontConfig module, so >> that I can use system fonts (e.g. for charts labels et.c). The goal is >> to make VTK fonts match those used by Qt, so I'm using >> QFontDatabase::system(...) to query for the user's preferred font, and >> then use that in my VTK code. This is all working quite well. >> >> I'm now porting the application to Windows. Does VTK have any support >> for loading system fonts on Windows? Something similar to the >> vtkRendereringFreeTypeFontConfig, but for whatever font backend >> Windows uses? >> >> If not, has anyone had luck in building fontconfig for Windows, and >> using the vtkRendereringFreeTypeFontConfig module there? (I'm not even >> sure if fontconfig has support for hooking into Windows' font backend, >> so this may not be a solution at all). >> >> Many thanks in advance, >> Elvis >> _______________________________________________ >> 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 >> From elvis.stansvik at orexplore.com Fri Aug 24 05:46:35 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Fri, 24 Aug 2018 11:46:35 +0200 Subject: [vtkusers] the New QVTKOpenGLWidget In-Reply-To: References: Message-ID: 2018-08-23 11:07 GMT+02:00 Mathieu Westphal : > Hello list, > > If you are working on a VTK/Qt application this information should interest > you. > Sometime ago, a new QVTKOpenGLWidget implementation has been added to VTK, > while the old one has been moved to QVTKOpenGLSimpleWidget. > The last fixes for this change have just been merged, so make sure to use > VTK master to test this. > > 1. Why is there a new widget and what does it do ? > We have been having some issues reported for the old widget, and the old > widget could not support quad buffer stereo rendering by design. > Has it is a needed feature in ParaView, a reimplementation was necessary. > This new widget fix most of the reported issues with the old widget as well > as adding stereo support. > > 2. Why keeping the old widget around then ? > Due to Qt limitations, this new implementation does not support very well > being a native widget. > But native widget are sometimes mandatory, for example within QScrollArea > and QMDIArea, so the QVTKOpenGLSimpleWidget should be used when in needs of > VTK rendering in the contact of Qt native widget. > > Also it allows users to switch back to the old widget if necessary. > > 3. I'm not sure what native widgets are, what should I do in my application > ? > > Here are the different situation : > > Your Qt application only uses a central QVTKOpenGLWidget for rendering: > -> Nothing to do, just build with last master and make sure all is working > well > Your Qt application only uses QVTKOpenGLWidget within QScrollArea or > QMDIArea, or manually set widgets to be native and you are not interested by > stereo rendering. > -> Change all your QVTKOpenGLWidget to QVTKOpenGLSimpleWidget and you are > good to go > Your application uses a non-native QVTKOpenGLWidget for rendering as well as > native QVTKOpenGLWidget for rendering (eg: ParaView, with the central > rendering widget and the color map editor rendering widget in scroll areas) > : > -> Use QVTKOpenGLWidget for non-native widgets and QVTKOpenGLSimpleWidget > for native ones. The later will never support stereo. > > > 4. I followed your recommendation but I see some strange > stuff/bugs/rendering issues > Even if this new class has been tested extensively and will be used in the > next ParaView release, It may still contains some issues. Feel free to > discuss them in this mailing list or on our gitlab. Thanks for the update/advice Mathieu. I have an old semi-alive merge request against the old QVTKOpenGLWidget (now QVTKOpenGLSimpleWidget): https://gitlab.kitware.com/vtk/vtk/merge_requests/3973 I could use some advice on what to do with it. It fixes an issue that I believe is solved in the new one (fractional DPI scale factors). Do you wish that I update the patch so that it applies to the QVTKOpenGLSimpleWidget, which might still have the problem? (haven't checked). Also, I'd like to take the opportunity to ask: Anyone know when a first RC of VTK 9.0.0 might be coming (and final release)? I'm anxious to get fractional DPI scaling working well in our application, because we're getting customer bug reports for users on Windows, where it's quite common with laptops configured with 150% and 250% scaling. I don't think we're dependant upon native widgets, so we should be moving to the new widget. But we try to only ship with released versions of VTK (sometimes we've used RCs, and in rare cases VTK master). Cheers, Elvis > > Best regards, > > Mathieu Westphal > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > From shayan.moradkhani at gmail.com Fri Aug 24 08:26:53 2018 From: shayan.moradkhani at gmail.com (shayan moradkhani) Date: Fri, 24 Aug 2018 05:26:53 -0700 (MST) Subject: [vtkusers] 3D transformation Message-ID: <1535113613842-0.post@n5.nabble.com> Hi, I have a little problem. suppose there is a vector called "s1 = (2, 1, -2)". in my inverse kinematics problem, when I move the end-effector, s1 changes length and orientation to s2 = (4, 8, 2) the start point of s1 is fixed with no rotation or translation. my question is how can I find the required angles in order to rotate s1 to the new orientation of s2. I know in 2D, s1.s2 gives the angle and s1xs2 gives the rotation axis, but I cannot figure it out in 3D. and my second question is, is it better to perform and show this rotation using RotateWXYZ(), Rotatex/y/z, or set user matrix? any help would be appriciated regards Shayan -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From polly_sukting at hotmail.com Sat Aug 25 12:59:20 2018 From: polly_sukting at hotmail.com (Polly Pui) Date: Sat, 25 Aug 2018 16:59:20 +0000 Subject: [vtkusers] How to visualize polydata after KmeansClustering? Message-ID: Hi, I would like to show my polydata with points and mark with colours after the KmeansClustering process. However, I could only get the values of the points without the visualization of the data. Can anyone please advice? Thank you so much. Polly -------------------------------------------------------------------------------------- My code is as below: int main(int argc, char* argv[]) { // Get the points into the format needed for KMeans vtkSmartPointer point = vtkSmartPointer::New(); vtkSmartPointer reader = vtkSmartPointer::New(); reader->SetFileName(argv[1]); reader->Update(); point = reader->GetOutput(); vtkSmartPointer inputData = vtkSmartPointer::New(); for (int c = 0; c < 3; ++c) { std::stringstream colName; colName << "coord " << c; vtkSmartPointer doubleArray = vtkSmartPointer::New(); doubleArray->SetNumberOfComponents(1); doubleArray->SetName(colName.str().c_str()); doubleArray->SetNumberOfTuples(point->GetNumberOfPoints()); for (int r = 0; r < point->GetNumberOfPoints(); ++r) { double p[3]; point->GetPoint(r, p); doubleArray->SetValue(r, p[c]); } inputData->AddColumn(doubleArray); } vtkSmartPointer kMeansStatistics = vtkSmartPointer::New(); #if VTK_MAJOR_VERSION <= 5 kMeansStatistics->SetInput(vtkStatisticsAlgorithm::INPUT_DATA, inputData); #else kMeansStatistics->SetInputData(vtkStatisticsAlgorithm::INPUT_DATA, inputData); #endif kMeansStatistics->SetColumnStatus(inputData->GetColumnName(0), 1); kMeansStatistics->SetColumnStatus(inputData->GetColumnName(1), 1); kMeansStatistics->SetColumnStatus(inputData->GetColumnName(2), 1); kMeansStatistics->RequestSelectedColumns(); kMeansStatistics->SetAssessOption(true); kMeansStatistics->SetDefaultNumberOfClusters(5); //kMeansStatistics->SetMaxNumIterations(1); kMeansStatistics->Update(); //double mean0[3]; //kMeansStatistics->GetMean(0, mean0); // Display the results kMeansStatistics->GetOutput()->Dump(); //Group the points according to ID number vtkSmartPointer clusterArray = vtkSmartPointer::New(); clusterArray->SetNumberOfComponents(1); clusterArray->SetName("ClusterId"); for (int r = 0; r < kMeansStatistics->GetOutput()->GetNumberOfRows(); r++) { vtkVariant v = kMeansStatistics->GetOutput()->GetValue(r, kMeansStatistics->GetOutput()->GetNumberOfColumns() - 1); //std::cout << "Point " << r << " is in cluster " << v.ToInt() << std::endl; clusterArray->InsertNextValue(v.ToInt()); } // Create a lookup table to map cell data to colors vtkSmartPointer lut = vtkSmartPointer::New(); int tableSize = (kMeansStatistics + 1, 10); lut->SetNumberOfTableValues(tableSize); lut->Build(); // Fill in a few known colors, the rest will be generated if needed //ColorCells tutorial https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/ColorCells/ vtkSmartPointer colors = vtkSmartPointer::New(); lut->SetTableValue(0, colors->GetColor4d("Black").GetData()); lut->SetTableValue(1, colors->GetColor4d("Banana").GetData()); lut->SetTableValue(2, colors->GetColor4d("Tomato").GetData()); lut->SetTableValue(3, colors->GetColor4d("Peacock").GetData()); lut->SetTableValue(4, colors->GetColor4d("Lavender").GetData()); // Output the cluster centers vtkMultiBlockDataSet* outputMetaDS = vtkMultiBlockDataSet::SafeDownCast(kMeansStatistics->GetOutputDataObject(vtkStatisticsAlgorithm::OUTPUT_MODEL)); vtkSmartPointer outputMeta = vtkTable::SafeDownCast(outputMetaDS->GetBlock(0)); //vtkSmartPointer outputMeta = vtkTable::SafeDownCast( outputMetaDS->GetBlock( 1 ) ); vtkDoubleArray* coord0 = vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("coord 0")); vtkDoubleArray* coord1 = vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("coord 1")); vtkDoubleArray* coord2 = vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("coord 2")); for (unsigned int i = 0; i < coord0->GetNumberOfTuples(); ++i) { std::cout << coord0->GetValue(i) << " " << coord1->GetValue(i) << " " << coord2->GetValue(i) << std::endl; } vtkSmartPointer polydata = vtkSmartPointer::New(); //polydata->SetPoints(point); polydata->GetPointData()->AddArray(clusterArray); polydata->GetPointData()->SetScalars(clusterArray); // Display vtkSmartPointer glyphFilter = vtkSmartPointer::New(); #if VTK_MAJOR_VERSION <= 5 glyphFilter->SetInputConnection(polydata->GetProducerPort()); #else glyphFilter->SetInputData(polydata); #endif glyphFilter->Update(); // Create a mapper and actor vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(glyphFilter->GetOutputPort()); mapper->SetScalarRange(0, tableSize - 1); mapper->SetLookupTable(lut); vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); actor->GetProperty()->SetPointSize(5); // Create a renderer, render window, and interactor vtkSmartPointer renderer = vtkSmartPointer::New(); vtkSmartPointer renderWindow = vtkSmartPointer::New(); renderWindow->AddRenderer(renderer); renderWindow->SetSize(800, 800); vtkSmartPointer renderWindowInteractor = vtkSmartPointer::New(); renderWindowInteractor->SetRenderWindow(renderWindow); // Add the actor to the scene renderer->AddActor(actor); renderer->SetBackground(colors->GetColor3d("SlateGray").GetData()); vtkSmartPointer style = vtkSmartPointer::New(); renderWindowInteractor->SetInteractorStyle(style); // Render and interact renderWindow->Render(); vtkWindowToImageFilter *windowToImageFilter = vtkWindowToImageFilter::New(); windowToImageFilter->SetInput(renderWindow); windowToImageFilter->Update(); vtkJPEGWriter *writer = vtkJPEGWriter::New(); writer->SetInputConnection(windowToImageFilter->GetOutputPort()); writer->SetFileName("10nosepoints.jpg"); writer->Write(); renderWindowInteractor->Start(); return EXIT_SUCCESS; } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.ostroot at lickenbrocktech.com Mon Aug 27 09:54:57 2018 From: mark.ostroot at lickenbrocktech.com (mark.ostroot at lickenbrocktech.com) Date: Mon, 27 Aug 2018 06:54:57 -0700 Subject: [vtkusers] Project 3D Data onto a plane in vtk 8 or later Message-ID: <20180827065457.c7db654a879d86b78cfcacc46040d57b.b06c8a5b9c.mailapi@email09.godaddy.com> Hello, I am trying to project some 3D data onto a plane without using a render window. In the older VTK versions there was an off-screen renderer, but in all of the example code I have seen there seems to be a stipulation that you need to use vtk 5.0 or earlier for that feature. Im looking for the same functionality as the offscreen renderer essentially. Please let me know if you have any ideas. Thank you, -Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.langer at nist.gov Mon Aug 27 11:54:59 2018 From: stephen.langer at nist.gov (Langer, Stephen A. (Fed)) Date: Mon, 27 Aug 2018 15:54:59 +0000 Subject: [vtkusers] OpenGL version error on macOS Message-ID: <631C812F-27AA-411D-88B6-0037AEFAA889@contoso.com> ?Hi -- I finally need to actually solve a problem I encountered a year ago... How do I get vtk to use the correct version of OpenGL on macOS using X11? I downloaded and built CylinderRenderingProperties from the VTK examples site. When I run it, it says Warning: In /Users/langer/UTIL/VTK/VTK-8.1.1/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, line 804 vtkXOpenGLRenderWindow (0x7fa9fa81f800): VTK is designed to work with OpenGL version 3.2 but it appears it has been given a context that does not support 3.2. VTK will run in a compatibility mode designed to work with earlier versions of OpenGL but some features may not work. and then seg faults. That was using vtk 8.1.1 build with VTK_USE_X11=ON and VTK_USE_COCOA=OFF. OpenGL was provided by the MacPorts mesa and libGLU ports. X11 was also installed via MacPorts. If, on the other hand, I build vtk 8.1.1 with VTK_USE_COCOA=ON and VTK_USE_X11=OFF, then it uses OpenGL from /System/Library/Frameworks/OpenGL.framework, and CylinderRenderingProperties compiles and runs correctly. Do I need to do something special when building or using VTK to get it to find the correct version of OpenGL? (I'm running macOS High Sierra, but the problem existed with the previous OS as well.) Thanks. -- Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From sendtomatteo at yahoo.it Mon Aug 27 15:11:17 2018 From: sendtomatteo at yahoo.it (Matteo) Date: Mon, 27 Aug 2018 14:11:17 -0500 Subject: [vtkusers] Invoice Query Message-ID: <27575645861677818244.670C5BB4B0FC12CA@public.kitware.com> Good Morning, The attached list contain your Online Invoices List. You can view and save the invoices from these list. Thank you for your business! --- Matteo sendtomatteo at yahoo.it 800-265-7334 --- The information in this Internet Email is confidential and may be legally privileged. It is intended solely for 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 or omitted to be taken in reliance on it, is prohibited and may be unlawful. -------------- next part -------------- A non-text attachment was scrubbed... Name: INV-704676.doc Type: application/msword Size: 85120 bytes Desc: not available URL: From dave.demarle at kitware.com Mon Aug 27 16:26:50 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Mon, 27 Aug 2018 16:26:50 -0400 Subject: [vtkusers] Announce: Kitware is hiring Message-ID: Folks, If you enjoy working with VTK/ParaView/VTK-m and tools like these and love programming, why not be a part of the team? We are looking to hire visualization developers to our Scientific Computing team. If you are a talented visualization researcher and developer with strong C++ skills, please consider applying. You will join a great team and work on many interesting and challenging technical problems. For more details checkout the sci vis developer position at jobs.kitware.com . thanks! David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcfr at kitware.com Mon Aug 27 18:12:11 2018 From: jcfr at kitware.com (Jean-Christophe Fillion-Robin) Date: Mon, 27 Aug 2018 18:12:11 -0400 Subject: [vtkusers] the New QVTKOpenGLWidget In-Reply-To: References: Message-ID: Hi All, To follow up on Mathieu email, we are in in the process of integrating this merge request [1] (and the equivalent in paraview [2]) that will add/rename the following classes: * QVTKOpenGLAlienWidget (equivalent to QVTKOpenGLWidget class described in the previous email) * QVTKOpenGLNativeWidget (equivalent to QVTKOpenGLSimpleWidget class described in the previous email) * QVTKOpenGLWidget will: - behave as it was before the introduction of the "new QVTKOpenGLWidget" and will instead derive from QVTKOpenGLNativeWidget. - only be available if VTK_LEGACY_REMOVE is OFF - will most likely be removed in VTK 10 We anticipate that this clearer naming convention will facilitate update of user code. Let us know what you think, Thanks Jc [1] https://gitlab.kitware.com/vtk/vtk/merge_requests/4625 [2] https://gitlab.kitware.com/paraview/paraview/merge_requests/2693 On Thu, Aug 23, 2018 at 5:07 AM Mathieu Westphal < mathieu.westphal at kitware.com> wrote: > Hello list, > > If you are working on a VTK/Qt application this information should > interest you. > Sometime ago, a new QVTKOpenGLWidget implementation has been added to VTK, > while the old one has been moved to QVTKOpenGLSimpleWidget. > The last fixes for this change have just been merged, so make sure to use > VTK master to test this. > > *1. Why is there a new widget and what does it do ?* > We have been having some issues reported for the old widget, and the old > widget could not support quad buffer stereo rendering by design. > Has it is a needed feature in ParaView, a reimplementation was necessary. > This new widget fix most of the reported issues with the old widget as well > as adding stereo support. > > *2. Why keeping the old widget around then ?* > Due to Qt limitations, this new implementation does not support very well > being a native widget. > But native widget are sometimes mandatory, for example within QScrollArea > and QMDIArea, so the QVTKOpenGLSimpleWidget should be used when in needs of > VTK rendering in the contact of Qt native widget. > > Also it allows users to switch back to the old widget if necessary. > > *3. I'm not sure what native widgets are, what should I do in my > application ?* > > Here are the different situation : > > 1. Your Qt application only uses a central QVTKOpenGLWidget for > rendering: > -> Nothing to do, just build with last master and make sure all is > working well > 2. Your Qt application only uses QVTKOpenGLWidget within QScrollArea > or QMDIArea, or manually set widgets to be native and you are not > interested by stereo rendering. > -> Change all your QVTKOpenGLWidget to QVTKOpenGLSimpleWidget and you > are good to go > 3. Your application uses a non-native QVTKOpenGLWidget for rendering > as well as native QVTKOpenGLWidget for rendering (eg: ParaView, with the > central rendering widget and the color map editor rendering widget in > scroll areas) : > -> Use QVTKOpenGLWidget for non-native widgets and > QVTKOpenGLSimpleWidget for native ones. The later will never support stereo. > > > *4. I followed your recommendation but I see some strange > stuff/bugs/rendering issues* > Even if this new class has been tested extensively and will be used in the > next ParaView release, It may still contains some issues. Feel free to > discuss them in this mailing list or on our gitlab > . > > Best regards, > > Mathieu Westphal > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Tue Aug 28 01:28:23 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Tue, 28 Aug 2018 07:28:23 +0200 Subject: [vtkusers] the New QVTKOpenGLWidget In-Reply-To: References: Message-ID: 2018-08-28 0:12 GMT+02:00 Jean-Christophe Fillion-Robin : > Hi All, > > To follow up on Mathieu email, we are in in the process of integrating this > merge request [1] (and the equivalent in paraview [2]) that will add/rename > the following classes: > > * QVTKOpenGLAlienWidget (equivalent to QVTKOpenGLWidget class described in > the previous email) > > * QVTKOpenGLNativeWidget (equivalent to QVTKOpenGLSimpleWidget class > described in the previous email) > > * QVTKOpenGLWidget will: > - behave as it was before the introduction of the "new QVTKOpenGLWidget" > and will instead derive from QVTKOpenGLNativeWidget. > - only be available if VTK_LEGACY_REMOVE is OFF > - will most likely be removed in VTK 10 > > > We anticipate that this clearer naming convention will facilitate update of > user code. > > Let us know what you think, I think this naming is the best one possible, unless it's somehow possible to make a widget that will work well in both scenarios of course :) Much better naming than the "Simple" suffix, so +1. Elvis > > Thanks > Jc > > > [1] https://gitlab.kitware.com/vtk/vtk/merge_requests/4625 > [2] https://gitlab.kitware.com/paraview/paraview/merge_requests/2693 > > > > > > > > > On Thu, Aug 23, 2018 at 5:07 AM Mathieu Westphal > wrote: >> >> Hello list, >> >> If you are working on a VTK/Qt application this information should >> interest you. >> Sometime ago, a new QVTKOpenGLWidget implementation has been added to VTK, >> while the old one has been moved to QVTKOpenGLSimpleWidget. >> The last fixes for this change have just been merged, so make sure to use >> VTK master to test this. >> >> 1. Why is there a new widget and what does it do ? >> We have been having some issues reported for the old widget, and the old >> widget could not support quad buffer stereo rendering by design. >> Has it is a needed feature in ParaView, a reimplementation was necessary. >> This new widget fix most of the reported issues with the old widget as well >> as adding stereo support. >> >> 2. Why keeping the old widget around then ? >> Due to Qt limitations, this new implementation does not support very well >> being a native widget. >> But native widget are sometimes mandatory, for example within QScrollArea >> and QMDIArea, so the QVTKOpenGLSimpleWidget should be used when in needs of >> VTK rendering in the contact of Qt native widget. >> >> Also it allows users to switch back to the old widget if necessary. >> >> 3. I'm not sure what native widgets are, what should I do in my >> application ? >> >> Here are the different situation : >> >> Your Qt application only uses a central QVTKOpenGLWidget for rendering: >> -> Nothing to do, just build with last master and make sure all is working >> well >> Your Qt application only uses QVTKOpenGLWidget within QScrollArea or >> QMDIArea, or manually set widgets to be native and you are not interested by >> stereo rendering. >> -> Change all your QVTKOpenGLWidget to QVTKOpenGLSimpleWidget and you are >> good to go >> Your application uses a non-native QVTKOpenGLWidget for rendering as well >> as native QVTKOpenGLWidget for rendering (eg: ParaView, with the central >> rendering widget and the color map editor rendering widget in scroll areas) >> : >> -> Use QVTKOpenGLWidget for non-native widgets and QVTKOpenGLSimpleWidget >> for native ones. The later will never support stereo. >> >> >> 4. I followed your recommendation but I see some strange >> stuff/bugs/rendering issues >> Even if this new class has been tested extensively and will be used in the >> next ParaView release, It may still contains some issues. Feel free to >> discuss them in this mailing list or on our gitlab. >> >> Best regards, >> >> Mathieu Westphal > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > From marvin.huber at basf.com Tue Aug 28 07:41:43 2018 From: marvin.huber at basf.com (marf) Date: Tue, 28 Aug 2018 04:41:43 -0700 (MST) Subject: [vtkusers] 3D transformation In-Reply-To: <1535113613842-0.post@n5.nabble.com> References: <1535113613842-0.post@n5.nabble.com> Message-ID: <1535456503818-0.post@n5.nabble.com> If I understand your question right, you want to figure out the angle between s1 and s2 on the x,y and z axis right? This can be done using the dot product using and Where a is a vector pointing from s1 to s2 so it is { (s2? - s1?) , (s2? - s1?) , (s2? - s1?) } And b is the vector for your axis, so for x { 1 , 0 , 0 } for y { 0 , 1 , 0 } and for z { 0 , 0 , 1 } -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From badertalal at gmail.com Tue Aug 28 10:04:35 2018 From: badertalal at gmail.com (Talal Albader) Date: Tue, 28 Aug 2018 17:04:35 +0300 Subject: [vtkusers] Is there any Seismic Wiggle trace plot done in VTK Message-ID: Hi, as this is very specific case of plot i wonder if VTK has the ability to plot Wiggle trace plot for seismic data or if anyone did it i hope if it is possible to share some idea about this in case someone wants more details about wiggle trace plot in short it is like this: you have mant time series functions let say as a sine wave, it is plotted inside a rectangle adjacent to each other they might overlap but normally they clipped so they do not overlap, then posetive peaks are filled with color I tried to simplify the explanation but just google for Wiggle trace seismic you can see how it looks like thanks and regards Talal -------------- next part -------------- An HTML attachment was scrubbed... URL: From badertalal at gmail.com Tue Aug 28 10:04:35 2018 From: badertalal at gmail.com (Talal Albader) Date: Tue, 28 Aug 2018 17:04:35 +0300 Subject: [vtkusers] Is there any Seismic Wiggle trace plot done in VTK Message-ID: Hi, as this is very specific case of plot i wonder if VTK has the ability to plot Wiggle trace plot for seismic data or if anyone did it i hope if it is possible to share some idea about this in case someone wants more details about wiggle trace plot in short it is like this: you have mant time series functions let say as a sine wave, it is plotted inside a rectangle adjacent to each other they might overlap but normally they clipped so they do not overlap, then posetive peaks are filled with color I tried to simplify the explanation but just google for Wiggle trace seismic you can see how it looks like thanks and regards Talal -------------- next part -------------- An HTML attachment was scrubbed... URL: From emmasaunders123 at gmail.com Tue Aug 28 11:41:23 2018 From: emmasaunders123 at gmail.com (Emma Saunders) Date: Tue, 28 Aug 2018 16:41:23 +0100 Subject: [vtkusers] render skewed vtksurfacereconstructedfilter Message-ID: Hi I am performing surface reconstruction from polydata using vtkContourFilter and vtkSurfaceReconstructionFilter. I have two actors I wish to render, this is successful with a limited set of points (see attched test1.png) when I simply add a few more points the render becomes skewed (see attahced test2.png) Any suggestions? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: test1.png Type: image/png Size: 145698 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: test2.png Type: image/png Size: 133174 bytes Desc: not available URL: From mey1k at naver.com Wed Aug 29 03:38:31 2018 From: mey1k at naver.com (minjun) Date: Wed, 29 Aug 2018 00:38:31 -0700 (MST) Subject: [vtkusers] surface offsetting Message-ID: <1535528311258-0.post@n5.nabble.com> hello i want this i want draw white line. do you have any idea about it? thank you. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From elvis.stansvik at orexplore.com Wed Aug 29 07:02:58 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Wed, 29 Aug 2018 13:02:58 +0200 Subject: [vtkusers] OpenGL version error on macOS In-Reply-To: <631C812F-27AA-411D-88B6-0037AEFAA889@contoso.com> References: <631C812F-27AA-411D-88B6-0037AEFAA889@contoso.com> Message-ID: I've only ever built with Cocoa. But it looks like VTK is using find_package(OpenGL ...) to find OpenGL, which in turn (FindOpenGL.cmake) uses find_library(OPENGL_gl_LIBRARY OpenGL DOC "OpenGL library for OS X") to find the library. Where find_library looks for macOS frameworks can be controlled using CMAKE_FRAMEWORK_PATH (https://cmake.org/cmake/help/latest/variable/CMAKE_FRAMEWORK_PATH.html#variable:CMAKE_FRAMEWORK_PATH), so perhaps try with -DCMAKE_FRAMEWORK_PATH:PATH=/path/to/where/your/GL/libs/are HTH, Elvis 2018-08-27 17:54 GMT+02:00 Langer, Stephen A. (Fed) : > ?Hi -- > > > > I finally need to actually solve a problem I encountered a year ago... How > do I get vtk to use the correct version of OpenGL on macOS using X11? > > > > I downloaded and built CylinderRenderingProperties from the VTK examples > site. When I run it, it says > > > > Warning: In > /Users/langer/UTIL/VTK/VTK-8.1.1/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, > line 804 > > vtkXOpenGLRenderWindow (0x7fa9fa81f800): VTK is designed to work with OpenGL > version 3.2 but it appears it has been given a context that does not support > 3.2. VTK will run in a compatibility mode designed to work with earlier > versions of OpenGL but some features may not work. > > > > and then seg faults. > > > > That was using vtk 8.1.1 build with VTK_USE_X11=ON and VTK_USE_COCOA=OFF. > OpenGL was provided by the MacPorts mesa and libGLU ports. X11 was also > installed via MacPorts. > > > > If, on the other hand, I build vtk 8.1.1 with VTK_USE_COCOA=ON and > VTK_USE_X11=OFF, then it uses OpenGL from > /System/Library/Frameworks/OpenGL.framework, and CylinderRenderingProperties > compiles and runs correctly. > > > > Do I need to do something special when building or using VTK to get it to > find the correct version of OpenGL? > > > > (I'm running macOS High Sierra, but the problem existed with the previous OS > as well.) > > > > Thanks. > > -- Steve > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > From A.Buykx at dianafea.com Wed Aug 29 07:03:11 2018 From: A.Buykx at dianafea.com (Andreas Buykx) Date: Wed, 29 Aug 2018 11:03:11 +0000 Subject: [vtkusers] how to show line and point color with cell scalars and point normals Message-ID: <80dedd0ecaec4a8b8c8433a1da303d0f@dianafea.com> I have vtkMultiBlockDataSet containing vtkPolyData blocks which I want to render using vtkCompositePolyDataMapper2 The polydata blocks represent solid shapes, with strips or polys representing the surface, lines representing edges on the surfaces or bounding them, and vertices representing the end-points of the edges. The topology and connectivity is supplied by an external library which can also supply point normals for the points connected to surface cells. To make the normals attribute array complete I have given the points connected to line and vertex cells zero-length normals. When I use the point normals to map the surface the edges and vertices are shown black because I have set their point normals to zero. So far the only solution I have found to work is to split the polydata into a surface polydata and an edge/vertex polydata and render the edge/vertex polydata with only ambient light. My question is whether there is a way to set up the mapper to render lines/vertices with only ambient lighting and surface cells with the actual lighting settings and the point normal? Thanks for your help DIANA FEA BV Software Developers and Analysis Consultants for Civil and Geotechnical Engineering Delftechpark 19a, 2628XJ, Delft, The Netherlands Tel: +31 88 34262 15 (Direct) ? Tel: +31 88 34262 00 (Switchboard) ? Fax: +31 88 34262 99 http://dianafea.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From pkorir at ebi.ac.uk Wed Aug 29 09:46:17 2018 From: pkorir at ebi.ac.uk (Paul Korir) Date: Wed, 29 Aug 2018 14:46:17 +0100 Subject: [vtkusers] vtk.js: Resize rendering window when using vtkGenericRenderWindow Message-ID: Greetings, I'm using the above class and have managed to use it to render some VTP files. However, when I place the render window inside a div of 1000 X 1000px the view is pixelated. I noticed the canvas is set to 300px square. I've scoured the API but cannot see how to resize the canvas/render window. Two requests: 1) Any idea when vtk.js will be more fully documented? It's quite hard to work with it as is. 2) What is the recommended way to set the size of the canvas/render window to fill the space? -- Paul K. Korir, PhD Scientific Programmer EMBL-EBI 01223494422 From sankhesh.jhaveri at kitware.com Wed Aug 29 09:49:29 2018 From: sankhesh.jhaveri at kitware.com (Sankhesh Jhaveri) Date: Wed, 29 Aug 2018 09:49:29 -0400 Subject: [vtkusers] Volume rendering produces rough surface at clipping plane In-Reply-To: References: Message-ID: Hi Andras, !4627 implements a mode in vtkVolumeProperty that lets you use custom intensity values for voxels in the clipped space when computing gradients at the clip face. Best, Sankhesh ? On Fri, Nov 3, 2017 at 10:48 AM Andras Lasso wrote: > Hi all, > > > > I?m working on visualizing cardiac images using volume rendering. I need > to cut into the volume to see surfaces inside the heart, which works quite > well by using clipping planes of the volume mapper. The only problem is > that that surface at the cut plane looks very rough, which makes it > difficult to distinguish from actual endocardial surfaces. If I ?cut? the > volume by setting voxel values outside the clipping box to ?empty? (-1000 = > air intensity value) then the cut surface looks nice ? smooth and flat. See > example for both cutting method in the attached files. > > > > Is there a way to change volume renderer to get smooth cut surfaces (the > same look as we get by setting outside voxels to ?empty? values)? > > > > Andras > > > > --- > > > > See full resolution images and more examples here: > > https://1drv.ms/f/s!Arm_AFxB9yqHsOsClG_QsMx-4sh8rg > > > > CT volume can be downloaded from here: > > http://slicer.kitware.com/midas3/download/item/292309/CTA-cardio.nrrd > > > > ________________________ > > Andras Lasso, PhD > > Senior Research Engineer, Associate Director (Engineering) > > Laboratory for Percutaneous Surgery > > School of Computing, Queen's University > > Kingston, ON, Canada > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Sankhesh Jhaveri *Sr. Research & Development Engineer* | Kitware | (518) 881-4417 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From lasso at queensu.ca Wed Aug 29 09:52:20 2018 From: lasso at queensu.ca (Andras Lasso) Date: Wed, 29 Aug 2018 13:52:20 +0000 Subject: [vtkusers] Volume rendering produces rough surface at clipping plane In-Reply-To: References: Message-ID: This is awesome! Thanks a lot for implementing this. It will greatly improve clipped volume visualization. Andras From: Sankhesh Jhaveri Sent: Wednesday, August 29, 2018 9:49 AM To: Andras Lasso Cc: vtkusers at vtk.org Subject: Re: [vtkusers] Volume rendering produces rough surface at clipping plane Hi Andras, !4627 implements a mode in vtkVolumeProperty that lets you use custom intensity values for voxels in the clipped space when computing gradients at the clip face. Best, Sankhesh ? On Fri, Nov 3, 2017 at 10:48 AM Andras Lasso > wrote: Hi all, I?m working on visualizing cardiac images using volume rendering. I need to cut into the volume to see surfaces inside the heart, which works quite well by using clipping planes of the volume mapper. The only problem is that that surface at the cut plane looks very rough, which makes it difficult to distinguish from actual endocardial surfaces. If I ?cut? the volume by setting voxel values outside the clipping box to ?empty? (-1000 = air intensity value) then the cut surface looks nice ? smooth and flat. See example for both cutting method in the attached files. Is there a way to change volume renderer to get smooth cut surfaces (the same look as we get by setting outside voxels to ?empty? values)? Andras --- See full resolution images and more examples here: https://1drv.ms/f/s!Arm_AFxB9yqHsOsClG_QsMx-4sh8rg CT volume can be downloaded from here: http://slicer.kitware.com/midas3/download/item/292309/CTA-cardio.nrrd ________________________ Andras Lasso, PhD Senior Research Engineer, Associate Director (Engineering) Laboratory for Percutaneous Surgery School of Computing, Queen's University Kingston, ON, Canada _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -- Sankhesh Jhaveri Sr. Research & Development Engineer | Kitware | (518) 881-4417 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.jourdain at kitware.com Wed Aug 29 12:53:18 2018 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Wed, 29 Aug 2018 12:53:18 -0400 Subject: [vtkusers] vtk.js: Resize rendering window when using vtkGenericRenderWindow In-Reply-To: References: Message-ID: To set the size of the window, you need to call setSize(widget, height) on the OpenGLRenderWindow instance. But for the generic GenericRenderWindow, you just need to call .resize() to let know the renderer that it should snap to its container size. On Wed, Aug 29, 2018 at 9:46 AM Paul Korir wrote: > Greetings, > > I'm using the above class and have managed to use it to render some VTP > files. However, when I place the render window inside a div of 1000 X > 1000px the view is pixelated. I noticed the canvas is set to 300px > square. I've scoured the API but cannot see how to resize the > canvas/render window. > > Two requests: > > 1) Any idea when vtk.js will be more fully documented? It's quite hard > to work with it as is. > > 2) What is the recommended way to set the size of the canvas/render > window to fill the space? > > -- > Paul K. Korir, PhD > Scientific Programmer > EMBL-EBI > 01223494422 > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ruvva at yahoo.com Wed Aug 29 13:33:10 2018 From: ruvva at yahoo.com (Koteswara Rao Ruvva) Date: Wed, 29 Aug 2018 17:33:10 +0000 (UTC) Subject: [vtkusers] vtkImageReslice and vtkPlane References: <775106466.384572.1535563990197.ref@mail.yahoo.com> Message-ID: <775106466.384572.1535563990197@mail.yahoo.com> How do we get a plane form vtkImageReslice? Basically I am looking for a point? and normal to construct vtkPlane. ThanksRao -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.jourdain at kitware.com Wed Aug 29 14:36:55 2018 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Wed, 29 Aug 2018 14:36:55 -0400 Subject: [vtkusers] vtk.js: Resize rendering window when using vtkGenericRenderWindow In-Reply-To: References: Message-ID: I'm guessing for the 1) you are talking about the API part of it since lots of example are available on how to use specific classes? Right now, it is true that we show the source code in place of the API but we are hoping to provide an automated tool that should gather properties/methods/default values in a meaningful way. Unfortunately, we don't have a time frame regarding that aspect. On Wed, Aug 29, 2018 at 12:53 PM Sebastien Jourdain < sebastien.jourdain at kitware.com> wrote: > To set the size of the window, you need to call setSize(widget, height) on > the OpenGLRenderWindow instance. > But for the generic GenericRenderWindow, you just need to call .resize() > to let know the renderer that it should snap to its container size. > > > On Wed, Aug 29, 2018 at 9:46 AM Paul Korir wrote: > >> Greetings, >> >> I'm using the above class and have managed to use it to render some VTP >> files. However, when I place the render window inside a div of 1000 X >> 1000px the view is pixelated. I noticed the canvas is set to 300px >> square. I've scoured the API but cannot see how to resize the >> canvas/render window. >> >> Two requests: >> >> 1) Any idea when vtk.js will be more fully documented? It's quite hard >> to work with it as is. >> >> 2) What is the recommended way to set the size of the canvas/render >> window to fill the space? >> >> -- >> Paul K. Korir, PhD >> Scientific Programmer >> EMBL-EBI >> 01223494422 >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> https://public.kitware.com/mailman/listinfo/vtkusers >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From srbn.ghosh99 at gmail.com Wed Aug 29 16:49:10 2018 From: srbn.ghosh99 at gmail.com (Shrabani Ghosh) Date: Wed, 29 Aug 2018 13:49:10 -0700 (MST) Subject: [vtkusers] VTK Istallation Message-ID: <1535575750584-0.post@n5.nabble.com> I have installed a earlier version of VTK. VTK -5.10. But after building the solution I cannot see the dll files in the bin folder. Can anyone tell be that VTK 5.10 does not build dll files? -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From stephen.langer at nist.gov Wed Aug 29 17:10:13 2018 From: stephen.langer at nist.gov (Langer, Stephen A. (Fed)) Date: Wed, 29 Aug 2018 21:10:13 +0000 Subject: [vtkusers] OpenGL version error on macOS In-Reply-To: References: <631C812F-27AA-411D-88B6-0037AEFAA889@contoso.com> Message-ID: Thanks for the suggestion, but that didn't make any difference. I don't think the problem is the frameworks, actually. I don't believe that the OpenGL framework provided by Apple supports X11, so there's no point in directing vtk towards it. I can get vtk to link to the OpenGL libraries provided by the MacPorts' mesa and libGLU, but when it does, it complains about the OpenGL version. The mesa in MacPorts is version is 17.1.6, which supports OpenGL 4.5, so it ought to work. However, the Mesa release notes (https://www.mesa3d.org/relnotes/17.1.6.html) say this, which I don't completely understand: Mesa 17.1.6 implements the OpenGL 4.5 API, but the version reported by glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) / glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used. Some drivers don't support all the features required in OpenGL 4.5. OpenGL 4.5 is only available if requested at context creation because compatibility contexts are not supported. That doesn't way what version is provided if 4.5 isn't requested. But is it possible that vtk isn't getting the OpenGL context correctly? I tried looking at the code but didn't get very far. I'm not at all familiar with OpenGL. -- Steve ?On 8/29/18, 7:03 AM, "Elvis Stansvik" wrote: I've only ever built with Cocoa. But it looks like VTK is using find_package(OpenGL ...) to find OpenGL, which in turn (FindOpenGL.cmake) uses find_library(OPENGL_gl_LIBRARY OpenGL DOC "OpenGL library for OS X") to find the library. Where find_library looks for macOS frameworks can be controlled using CMAKE_FRAMEWORK_PATH (https://cmake.org/cmake/help/latest/variable/CMAKE_FRAMEWORK_PATH.html#variable:CMAKE_FRAMEWORK_PATH), so perhaps try with -DCMAKE_FRAMEWORK_PATH:PATH=/path/to/where/your/GL/libs/are HTH, Elvis 2018-08-27 17:54 GMT+02:00 Langer, Stephen A. (Fed) : > Hi -- > > > > I finally need to actually solve a problem I encountered a year ago... How > do I get vtk to use the correct version of OpenGL on macOS using X11? > > > > I downloaded and built CylinderRenderingProperties from the VTK examples > site. When I run it, it says > > > > Warning: In > /Users/langer/UTIL/VTK/VTK-8.1.1/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, > line 804 > > vtkXOpenGLRenderWindow (0x7fa9fa81f800): VTK is designed to work with OpenGL > version 3.2 but it appears it has been given a context that does not support > 3.2. VTK will run in a compatibility mode designed to work with earlier > versions of OpenGL but some features may not work. > > > > and then seg faults. > > > > That was using vtk 8.1.1 build with VTK_USE_X11=ON and VTK_USE_COCOA=OFF. > OpenGL was provided by the MacPorts mesa and libGLU ports. X11 was also > installed via MacPorts. > > > > If, on the other hand, I build vtk 8.1.1 with VTK_USE_COCOA=ON and > VTK_USE_X11=OFF, then it uses OpenGL from > /System/Library/Frameworks/OpenGL.framework, and CylinderRenderingProperties > compiles and runs correctly. > > > > Do I need to do something special when building or using VTK to get it to > find the correct version of OpenGL? > > > > (I'm running macOS High Sierra, but the problem existed with the previous OS > as well.) > > > > Thanks. > > -- Steve > > > > > _______________________________________________ > Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Cstephen.langer%40nist.gov%7C4daf5756210546585ab808d60d9efef4%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636711373868698381&sdata=zw2bxe3tqPD5fssLtnBuG%2FRl85OjPbTsfcC91Z%2BOw8o%3D&reserved=0 > > Visit other Kitware open-source projects at > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Cstephen.langer%40nist.gov%7C4daf5756210546585ab808d60d9efef4%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636711373868698381&sdata=PcYBqXP0j4eVWPzKggeLrqAQ7WiY9LnNtUkiZDxknRs%3D&reserved=0 > > Please keep messages on-topic and check the VTK FAQ at: > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Cstephen.langer%40nist.gov%7C4daf5756210546585ab808d60d9efef4%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636711373868698381&sdata=uGa1FqKpH99%2FCE%2F6fuqHCtHT1aB8ZIF1whf3WOAbU5E%3D&reserved=0 > > Search the list archives at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Cstephen.langer%40nist.gov%7C4daf5756210546585ab808d60d9efef4%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636711373868698381&sdata=W8JHLG0N9x3mhkk4XC3ESXsQxcbq73fpsp0zArKboPQ%3D&reserved=0 > > Follow this link to subscribe/unsubscribe: > https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Cstephen.langer%40nist.gov%7C4daf5756210546585ab808d60d9efef4%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636711373868698381&sdata=ez3xU4rzNT7kcWNTGsTOKs8HleLU1ykmGsgigHwvwxU%3D&reserved=0 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jon.haitz.legarreta at gmail.com Wed Aug 29 17:18:31 2018 From: jon.haitz.legarreta at gmail.com (=?UTF-8?Q?Jon_Haitz_Legarreta_Gorro=C3=B1o?=) Date: Wed, 29 Aug 2018 17:18:31 -0400 Subject: [vtkusers] VTK Istallation In-Reply-To: <1535575750584-0.post@n5.nabble.com> References: <1535575750584-0.post@n5.nabble.com> Message-ID: Hi Shrabani, that's certainly weird I'd say. If you have used CMake to configure the project, which was the value of the BUILD_SHARED_LIBS flag? JON HAITZ On Wed, Aug 29, 2018 at 4:49 PM Shrabani Ghosh wrote: > > I have installed a earlier version of VTK. VTK -5.10. But after building the > solution I cannot see the dll files in the bin folder. Can anyone tell be > that VTK 5.10 does not build dll files? > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers From david.gobbi at gmail.com Wed Aug 29 17:42:39 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 29 Aug 2018 15:42:39 -0600 Subject: [vtkusers] OpenGL version error on macOS In-Reply-To: References: <631C812F-27AA-411D-88B6-0037AEFAA889@contoso.com> Message-ID: Have you installed XQuartz? It provides a full set of headers and libraries for X11 and OpenGL in /opt, and the latest version number listed in its headers is GL_VERSION_4_5. It has been many years since I've built VTK with X11 on the Mac, but XQuartz was where I always got the dev files from. - David On Wed, Aug 29, 2018 at 3:10 PM Langer, Stephen A. (Fed) < stephen.langer at nist.gov> wrote: > Thanks for the suggestion, but that didn't make any difference. > > > > I don't think the problem is the frameworks, actually. I don't believe > that the OpenGL framework provided by Apple supports X11, so there's no > point in directing vtk towards it. > > > > I can get vtk to link to the OpenGL libraries provided by the MacPorts' > mesa and libGLU, but when it does, it complains about the OpenGL version. > The mesa in MacPorts is version is 17.1.6, which supports OpenGL 4.5, so > it ought to work. However, the Mesa release notes ( > https://www.mesa3d.org/relnotes/17.1.6.html) say this, which I don't > completely understand: > > > > Mesa 17.1.6 implements the OpenGL 4.5 API, but the version reported by > glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) / > glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being > used. Some drivers don't support all the features required in OpenGL 4.5. > OpenGL 4.5 is only available if requested at context creation because > compatibility contexts are not supported. > > > > That doesn't way what version is provided if 4.5 isn't requested. But is > it possible that vtk isn't getting the OpenGL context correctly? I tried > looking at the code but didn't get very far. I'm not at all familiar with > OpenGL. > > > > -- Steve > > > > > > ?On 8/29/18, 7:03 AM, "Elvis Stansvik" > wrote: > > > > I've only ever built with Cocoa. But it looks like VTK is using > > find_package(OpenGL ...) to find OpenGL, which in turn > > (FindOpenGL.cmake) uses find_library(OPENGL_gl_LIBRARY OpenGL DOC > > "OpenGL library for OS X") to find the library. > > > > Where find_library looks for macOS frameworks can be controlled using > > CMAKE_FRAMEWORK_PATH > > ( > https://cmake.org/cmake/help/latest/variable/CMAKE_FRAMEWORK_PATH.html#variable:CMAKE_FRAMEWORK_PATH > ), > > so perhaps try with > > > > -DCMAKE_FRAMEWORK_PATH:PATH=/path/to/where/your/GL/libs/are > > > > HTH, > > Elvis > > > > 2018-08-27 17:54 GMT+02:00 Langer, Stephen A. (Fed) < > stephen.langer at nist.gov>: > > > Hi -- > > > > > > > > > > > > I finally need to actually solve a problem I encountered a year > ago... How > > > do I get vtk to use the correct version of OpenGL on macOS using X11? > > > > > > > > > > > > I downloaded and built CylinderRenderingProperties from the VTK > examples > > > site. When I run it, it says > > > > > > > > > > > > Warning: In > > > > /Users/langer/UTIL/VTK/VTK-8.1.1/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, > > > line 804 > > > > > > vtkXOpenGLRenderWindow (0x7fa9fa81f800): VTK is designed to work > with OpenGL > > > version 3.2 but it appears it has been given a context that does not > support > > > 3.2. VTK will run in a compatibility mode designed to work with > earlier > > > versions of OpenGL but some features may not work. > > > > > > > > > > > > and then seg faults. > > > > > > > > > > > > That was using vtk 8.1.1 build with VTK_USE_X11=ON and > VTK_USE_COCOA=OFF. > > > OpenGL was provided by the MacPorts mesa and libGLU ports. X11 was > also > > > installed via MacPorts. > > > > > > > > > > > > If, on the other hand, I build vtk 8.1.1 with VTK_USE_COCOA=ON and > > > VTK_USE_X11=OFF, then it uses OpenGL from > > > /System/Library/Frameworks/OpenGL.framework, and > CylinderRenderingProperties > > > compiles and runs correctly. > > > > > > > > > > > > Do I need to do something special when building or using VTK to get > it to > > > find the correct version of OpenGL? > > > > > > > > > > > > (I'm running macOS High Sierra, but the problem existed with the > previous OS > > > as well.) > > > > > > > > > > > > Thanks. > > > > > > -- Steve > -------------- next part -------------- An HTML attachment was scrubbed... URL: From srbn.ghosh99 at gmail.com Wed Aug 29 18:17:56 2018 From: srbn.ghosh99 at gmail.com (Shrabani Ghosh) Date: Wed, 29 Aug 2018 15:17:56 -0700 (MST) Subject: [vtkusers] VTK Istallation In-Reply-To: References: <1535575750584-0.post@n5.nabble.com> Message-ID: <1535581076637-0.post@n5.nabble.com> Thanks It worked. I didn't check it . -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From allison.vacanti at kitware.com Wed Aug 29 18:20:48 2018 From: allison.vacanti at kitware.com (Allie Vacanti) Date: Wed, 29 Aug 2018 18:20:48 -0400 Subject: [vtkusers] Project 3D Data onto a plane in vtk 8 or later In-Reply-To: <20180827065457.c7db654a879d86b78cfcacc46040d57b.b06c8a5b9c.mailapi@email09.godaddy.com> References: <20180827065457.c7db654a879d86b78cfcacc46040d57b.b06c8a5b9c.mailapi@email09.godaddy.com> Message-ID: You can still use offscreen rendering. Just call SetOffScreenRendering(true) on the vtkRenderWindow. https://www.vtk.org/doc/nightly/html/classvtkWindow.html#a11d4345f6fcb406a0032a4e9721a9580 On Mon, Aug 27, 2018 at 9:54 AM, wrote: > Hello, > > I am trying to project some 3D data onto a plane without using a render > window. In the older VTK versions there was an off-screen renderer, but in > all of the example code I have seen there seems to be a stipulation that > you need to use vtk 5.0 or earlier for that feature. Im looking for the > same functionality as the offscreen renderer essentially. Please let me > know if you have any ideas. > > Thank you, > -Mark > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rccm.kyoshimi at gmail.com Wed Aug 29 21:16:44 2018 From: rccm.kyoshimi at gmail.com (kenichiro yoshimi) Date: Thu, 30 Aug 2018 10:16:44 +0900 Subject: [vtkusers] How to visualize polydata after KmeansClustering? In-Reply-To: References: Message-ID: Hi, Could you try to modify the lines of your code as below? vtkSmartPointer polydata = vtkSmartPointer::New(); ==> vtkSmartPointer polydata = point; Regards 2018?8?26?(?) 1:59 Polly Pui : > > Hi, > > I would like to show my polydata with points and mark with colours after the KmeansClustering process. > > However, I could only get the values of the points without the visualization of the data. > > Can anyone please advice? > > Thank you so much. > > > Polly > > -------------------------------------------------------------------------------------- > > My code is as below: > > int main(int argc, char* argv[]) > { > // Get the points into the format needed for KMeans > vtkSmartPointer point = > vtkSmartPointer::New(); > > vtkSmartPointer reader = > vtkSmartPointer::New(); > reader->SetFileName(argv[1]); > reader->Update(); > > point = reader->GetOutput(); > > vtkSmartPointer inputData = > vtkSmartPointer::New(); > > for (int c = 0; c < 3; ++c) > { > std::stringstream colName; > colName << "coord " << c; > vtkSmartPointer doubleArray = > vtkSmartPointer::New(); > doubleArray->SetNumberOfComponents(1); > doubleArray->SetName(colName.str().c_str()); > doubleArray->SetNumberOfTuples(point->GetNumberOfPoints()); > > for (int r = 0; r < point->GetNumberOfPoints(); ++r) > { > double p[3]; > point->GetPoint(r, p); > doubleArray->SetValue(r, p[c]); > } > inputData->AddColumn(doubleArray); > } > > vtkSmartPointer kMeansStatistics = > vtkSmartPointer::New(); > > #if VTK_MAJOR_VERSION <= 5 > kMeansStatistics->SetInput(vtkStatisticsAlgorithm::INPUT_DATA, inputData); > #else > kMeansStatistics->SetInputData(vtkStatisticsAlgorithm::INPUT_DATA, inputData); > #endif > kMeansStatistics->SetColumnStatus(inputData->GetColumnName(0), 1); > kMeansStatistics->SetColumnStatus(inputData->GetColumnName(1), 1); > kMeansStatistics->SetColumnStatus(inputData->GetColumnName(2), 1); > kMeansStatistics->RequestSelectedColumns(); > kMeansStatistics->SetAssessOption(true); > kMeansStatistics->SetDefaultNumberOfClusters(5); > //kMeansStatistics->SetMaxNumIterations(1); > kMeansStatistics->Update(); > //double mean0[3]; > //kMeansStatistics->GetMean(0, mean0); > // Display the results > kMeansStatistics->GetOutput()->Dump(); > //Group the points according to ID number > vtkSmartPointer clusterArray = > vtkSmartPointer::New(); > clusterArray->SetNumberOfComponents(1); > clusterArray->SetName("ClusterId"); > > for (int r = 0; r < kMeansStatistics->GetOutput()->GetNumberOfRows(); r++) > { > vtkVariant v = kMeansStatistics->GetOutput()->GetValue(r, kMeansStatistics->GetOutput()->GetNumberOfColumns() - 1); > //std::cout << "Point " << r << " is in cluster " << v.ToInt() << std::endl; > clusterArray->InsertNextValue(v.ToInt()); > } > > // Create a lookup table to map cell data to colors > vtkSmartPointer lut = > vtkSmartPointer::New(); > int tableSize = (kMeansStatistics + 1, 10); > lut->SetNumberOfTableValues(tableSize); > lut->Build(); > > // Fill in a few known colors, the rest will be generated if needed > //ColorCells tutorial https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/ColorCells/ > vtkSmartPointer colors = > vtkSmartPointer::New(); > lut->SetTableValue(0, colors->GetColor4d("Black").GetData()); > lut->SetTableValue(1, colors->GetColor4d("Banana").GetData()); > lut->SetTableValue(2, colors->GetColor4d("Tomato").GetData()); > lut->SetTableValue(3, colors->GetColor4d("Peacock").GetData()); > lut->SetTableValue(4, colors->GetColor4d("Lavender").GetData()); > > // Output the cluster centers > > vtkMultiBlockDataSet* outputMetaDS = vtkMultiBlockDataSet::SafeDownCast(kMeansStatistics->GetOutputDataObject(vtkStatisticsAlgorithm::OUTPUT_MODEL)); > vtkSmartPointer outputMeta = vtkTable::SafeDownCast(outputMetaDS->GetBlock(0)); > //vtkSmartPointer outputMeta = vtkTable::SafeDownCast( outputMetaDS->GetBlock( 1 ) ); > vtkDoubleArray* coord0 = vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("coord 0")); > vtkDoubleArray* coord1 = vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("coord 1")); > vtkDoubleArray* coord2 = vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("coord 2")); > > for (unsigned int i = 0; i < coord0->GetNumberOfTuples(); ++i) > { > std::cout << coord0->GetValue(i) << " " << coord1->GetValue(i) << " " << coord2->GetValue(i) << std::endl; > } > > vtkSmartPointer polydata = > vtkSmartPointer::New(); > //polydata->SetPoints(point); > polydata->GetPointData()->AddArray(clusterArray); > polydata->GetPointData()->SetScalars(clusterArray); > > // Display > vtkSmartPointer glyphFilter = > vtkSmartPointer::New(); > #if VTK_MAJOR_VERSION <= 5 > glyphFilter->SetInputConnection(polydata->GetProducerPort()); > #else > glyphFilter->SetInputData(polydata); > #endif > glyphFilter->Update(); > > // Create a mapper and actor > vtkSmartPointer mapper = > vtkSmartPointer::New(); > mapper->SetInputConnection(glyphFilter->GetOutputPort()); > mapper->SetScalarRange(0, tableSize - 1); > mapper->SetLookupTable(lut); > > vtkSmartPointer actor = > vtkSmartPointer::New(); > actor->SetMapper(mapper); > actor->GetProperty()->SetPointSize(5); > > // Create a renderer, render window, and interactor > vtkSmartPointer renderer = > vtkSmartPointer::New(); > vtkSmartPointer renderWindow = > vtkSmartPointer::New(); > renderWindow->AddRenderer(renderer); > renderWindow->SetSize(800, 800); > > vtkSmartPointer renderWindowInteractor = > vtkSmartPointer::New(); > renderWindowInteractor->SetRenderWindow(renderWindow); > > // Add the actor to the scene > renderer->AddActor(actor); > renderer->SetBackground(colors->GetColor3d("SlateGray").GetData()); > > vtkSmartPointer style = > vtkSmartPointer::New(); > renderWindowInteractor->SetInteractorStyle(style); > > // Render and interact > renderWindow->Render(); > > vtkWindowToImageFilter *windowToImageFilter = vtkWindowToImageFilter::New(); > windowToImageFilter->SetInput(renderWindow); > windowToImageFilter->Update(); > > vtkJPEGWriter *writer = vtkJPEGWriter::New(); > writer->SetInputConnection(windowToImageFilter->GetOutputPort()); > writer->SetFileName("10nosepoints.jpg"); > writer->Write(); > > renderWindowInteractor->Start(); > > return EXIT_SUCCESS; > } > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers From nil.goyette at imeka.ca Wed Aug 29 10:33:16 2018 From: nil.goyette at imeka.ca (Nil Goyette) Date: Wed, 29 Aug 2018 10:33:16 -0400 Subject: [vtkusers] Real-time polydata filtering Message-ID: Hi all, We decided to port our old vtk application to vtk8 and I have some questions concerning the jump to OpenGL2+. We load a streamlines file (tck/trk/fib/vtk), which is simply a list of lines in 3D [1], to view it with an image, compute some stats on it, etc. We also need to filter the polydata when the user moves a box over it. Only the line passing in the box should be drawn. [2] I already have a working version without modifying any vtk file, but it's slow. - I keep the raw unmodified polydata somewhere because all filtering should start from the original version - I create a new polydata that will be used for drawing. I use the raw point and a new vtkCellArray for lines that I want to draw. - Each time the user moves the box, I create a new vtkCellArray, fill it with the right cells and call SetLines(). This is quite slow even with only 4000 lines and I'm not sure why. Is the mapper sending all the points data again even if I only modified the lines data? Can this method ever be fast? If you have other ideas that require a modification to the mapper, it's not a problem, I can do it, I just don't know where to start because I don't know much about OpenGL. Nil Goyette [1] https://i.imgur.com/krzBvJV.png [2] I already asked this question 3 months ago but I didn't get any answer. For more information http://vtk.1045678.n5.nabble.com/Filtered-polydata-td5747327.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From polly_sukting at hotmail.com Thu Aug 30 00:22:30 2018 From: polly_sukting at hotmail.com (Polly Pui) Date: Thu, 30 Aug 2018 04:22:30 +0000 Subject: [vtkusers] How to visualize polydata after KmeansClustering? In-Reply-To: References: , Message-ID: Hi, It doesn't work. I changed the lines, but the identifier "point" is undefined. ------------------------------------------------ And I have another question here, These codes could read polydata vtk, but failed to visualize. I have another dataset (approximate 2000 set) that I saved by using Paraview into .vtk (the data is saved into unstructured grid data instead of polydata) Then, I tried to open using the following codes but it failed to load for unstructured grid data. How should i modify the lines to read the unstructured grid dataset? Thank you so much. Polly ________________________________ From: kenichiro yoshimi Sent: Thursday, August 30, 2018 9:16 AM To: polly_sukting at hotmail.com Cc: vtkusers Subject: Re: [vtkusers] How to visualize polydata after KmeansClustering? Hi, Could you try to modify the lines of your code as below? vtkSmartPointer polydata = vtkSmartPointer::New(); ==> vtkSmartPointer polydata = point; Regards 2018?8?26?(?) 1:59 Polly Pui : > > Hi, > > I would like to show my polydata with points and mark with colours after the KmeansClustering process. > > However, I could only get the values of the points without the visualization of the data. > > Can anyone please advice? > > Thank you so much. > > > Polly > > -------------------------------------------------------------------------------------- > > My code is as below: > > int main(int argc, char* argv[]) > { > // Get the points into the format needed for KMeans > vtkSmartPointer point = > vtkSmartPointer::New(); > > vtkSmartPointer reader = > vtkSmartPointer::New(); > reader->SetFileName(argv[1]); > reader->Update(); > > point = reader->GetOutput(); > > vtkSmartPointer inputData = > vtkSmartPointer::New(); > > for (int c = 0; c < 3; ++c) > { > std::stringstream colName; > colName << "coord " << c; > vtkSmartPointer doubleArray = > vtkSmartPointer::New(); > doubleArray->SetNumberOfComponents(1); > doubleArray->SetName(colName.str().c_str()); > doubleArray->SetNumberOfTuples(point->GetNumberOfPoints()); > > for (int r = 0; r < point->GetNumberOfPoints(); ++r) > { > double p[3]; > point->GetPoint(r, p); > doubleArray->SetValue(r, p[c]); > } > inputData->AddColumn(doubleArray); > } > > vtkSmartPointer kMeansStatistics = > vtkSmartPointer::New(); > > #if VTK_MAJOR_VERSION <= 5 > kMeansStatistics->SetInput(vtkStatisticsAlgorithm::INPUT_DATA, inputData); > #else > kMeansStatistics->SetInputData(vtkStatisticsAlgorithm::INPUT_DATA, inputData); > #endif > kMeansStatistics->SetColumnStatus(inputData->GetColumnName(0), 1); > kMeansStatistics->SetColumnStatus(inputData->GetColumnName(1), 1); > kMeansStatistics->SetColumnStatus(inputData->GetColumnName(2), 1); > kMeansStatistics->RequestSelectedColumns(); > kMeansStatistics->SetAssessOption(true); > kMeansStatistics->SetDefaultNumberOfClusters(5); > //kMeansStatistics->SetMaxNumIterations(1); > kMeansStatistics->Update(); > //double mean0[3]; > //kMeansStatistics->GetMean(0, mean0); > // Display the results > kMeansStatistics->GetOutput()->Dump(); > //Group the points according to ID number > vtkSmartPointer clusterArray = > vtkSmartPointer::New(); > clusterArray->SetNumberOfComponents(1); > clusterArray->SetName("ClusterId"); > > for (int r = 0; r < kMeansStatistics->GetOutput()->GetNumberOfRows(); r++) > { > vtkVariant v = kMeansStatistics->GetOutput()->GetValue(r, kMeansStatistics->GetOutput()->GetNumberOfColumns() - 1); > //std::cout << "Point " << r << " is in cluster " << v.ToInt() << std::endl; > clusterArray->InsertNextValue(v.ToInt()); > } > > // Create a lookup table to map cell data to colors > vtkSmartPointer lut = > vtkSmartPointer::New(); > int tableSize = (kMeansStatistics + 1, 10); > lut->SetNumberOfTableValues(tableSize); > lut->Build(); > > // Fill in a few known colors, the rest will be generated if needed > //ColorCells tutorial https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/ColorCells/ ColorCells - GitHub Pages lorensen.github.io Download and Build ColorCells?. Click here to download ColorCells and its CMakeLists.txt file. Once the tarball ColorCells.tar has been downloaded and extracted, > vtkSmartPointer colors = > vtkSmartPointer::New(); > lut->SetTableValue(0, colors->GetColor4d("Black").GetData()); > lut->SetTableValue(1, colors->GetColor4d("Banana").GetData()); > lut->SetTableValue(2, colors->GetColor4d("Tomato").GetData()); > lut->SetTableValue(3, colors->GetColor4d("Peacock").GetData()); > lut->SetTableValue(4, colors->GetColor4d("Lavender").GetData()); > > // Output the cluster centers > > vtkMultiBlockDataSet* outputMetaDS = vtkMultiBlockDataSet::SafeDownCast(kMeansStatistics->GetOutputDataObject(vtkStatisticsAlgorithm::OUTPUT_MODEL)); > vtkSmartPointer outputMeta = vtkTable::SafeDownCast(outputMetaDS->GetBlock(0)); > //vtkSmartPointer outputMeta = vtkTable::SafeDownCast( outputMetaDS->GetBlock( 1 ) ); > vtkDoubleArray* coord0 = vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("coord 0")); > vtkDoubleArray* coord1 = vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("coord 1")); > vtkDoubleArray* coord2 = vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("coord 2")); > > for (unsigned int i = 0; i < coord0->GetNumberOfTuples(); ++i) > { > std::cout << coord0->GetValue(i) << " " << coord1->GetValue(i) << " " << coord2->GetValue(i) << std::endl; > } > > vtkSmartPointer polydata = > vtkSmartPointer::New(); > //polydata->SetPoints(point); > polydata->GetPointData()->AddArray(clusterArray); > polydata->GetPointData()->SetScalars(clusterArray); > > // Display > vtkSmartPointer glyphFilter = > vtkSmartPointer::New(); > #if VTK_MAJOR_VERSION <= 5 > glyphFilter->SetInputConnection(polydata->GetProducerPort()); > #else > glyphFilter->SetInputData(polydata); > #endif > glyphFilter->Update(); > > // Create a mapper and actor > vtkSmartPointer mapper = > vtkSmartPointer::New(); > mapper->SetInputConnection(glyphFilter->GetOutputPort()); > mapper->SetScalarRange(0, tableSize - 1); > mapper->SetLookupTable(lut); > > vtkSmartPointer actor = > vtkSmartPointer::New(); > actor->SetMapper(mapper); > actor->GetProperty()->SetPointSize(5); > > // Create a renderer, render window, and interactor > vtkSmartPointer renderer = > vtkSmartPointer::New(); > vtkSmartPointer renderWindow = > vtkSmartPointer::New(); > renderWindow->AddRenderer(renderer); > renderWindow->SetSize(800, 800); > > vtkSmartPointer renderWindowInteractor = > vtkSmartPointer::New(); > renderWindowInteractor->SetRenderWindow(renderWindow); > > // Add the actor to the scene > renderer->AddActor(actor); > renderer->SetBackground(colors->GetColor3d("SlateGray").GetData()); > > vtkSmartPointer style = > vtkSmartPointer::New(); > renderWindowInteractor->SetInteractorStyle(style); > > // Render and interact > renderWindow->Render(); > > vtkWindowToImageFilter *windowToImageFilter = vtkWindowToImageFilter::New(); > windowToImageFilter->SetInput(renderWindow); > windowToImageFilter->Update(); > > vtkJPEGWriter *writer = vtkJPEGWriter::New(); > writer->SetInputConnection(windowToImageFilter->GetOutputPort()); > writer->SetFileName("10nosepoints.jpg"); > writer->Write(); > > renderWindowInteractor->Start(); > > return EXIT_SUCCESS; > } > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From elvis.stansvik at orexplore.com Thu Aug 30 04:13:06 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Thu, 30 Aug 2018 10:13:06 +0200 Subject: [vtkusers] OpenGL version error on macOS In-Reply-To: References: <631C812F-27AA-411D-88B6-0037AEFAA889@contoso.com> Message-ID: 2018-08-29 23:10 GMT+02:00 Langer, Stephen A. (Fed) : > Thanks for the suggestion, but that didn't make any difference. > > > > I don't think the problem is the frameworks, actually. I don't believe > that the OpenGL framework provided by Apple supports X11, so there's no > point in directing vtk towards it. > > > > I can get vtk to link to the OpenGL libraries provided by the MacPorts' mesa > and libGLU, but when it does, it complains about the OpenGL version. The > mesa in MacPorts is version is 17.1.6, which supports OpenGL 4.5, so it > ought to work. However, the Mesa release notes > (https://www.mesa3d.org/relnotes/17.1.6.html) say this, which I don't > completely understand: > > > > Mesa 17.1.6 implements the OpenGL 4.5 API, but the version reported by > glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) / > glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used. > Some drivers don't support all the features required in OpenGL 4.5. OpenGL > 4.5 is only available if requested at context creation because compatibility > contexts are not supported. > > > > That doesn't way what version is provided if 4.5 isn't requested. But is it > possible that vtk isn't getting the OpenGL context correctly? I tried > looking at the code but didn't get very far. I'm not at all familiar with > OpenGL. This is a bit out of my league, but I also don't understand that last sentence. And your diagnosis sounds correct, VTK seems to not get a capable enough context when you point it at MacPorts' mesa. Don't know why :/ Elvis > > > > -- Steve > > > > > > ?On 8/29/18, 7:03 AM, "Elvis Stansvik" wrote: > > > > I've only ever built with Cocoa. But it looks like VTK is using > > find_package(OpenGL ...) to find OpenGL, which in turn > > (FindOpenGL.cmake) uses find_library(OPENGL_gl_LIBRARY OpenGL DOC > > "OpenGL library for OS X") to find the library. > > > > Where find_library looks for macOS frameworks can be controlled using > > CMAKE_FRAMEWORK_PATH > > > (https://cmake.org/cmake/help/latest/variable/CMAKE_FRAMEWORK_PATH.html#variable:CMAKE_FRAMEWORK_PATH), > > so perhaps try with > > > > -DCMAKE_FRAMEWORK_PATH:PATH=/path/to/where/your/GL/libs/are > > > > HTH, > > Elvis > > > > 2018-08-27 17:54 GMT+02:00 Langer, Stephen A. (Fed) > : > > > Hi -- > > > > > > > > > > > > I finally need to actually solve a problem I encountered a year ago... > How > > > do I get vtk to use the correct version of OpenGL on macOS using X11? > > > > > > > > > > > > I downloaded and built CylinderRenderingProperties from the VTK > examples > > > site. When I run it, it says > > > > > > > > > > > > Warning: In > > > > /Users/langer/UTIL/VTK/VTK-8.1.1/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, > > > line 804 > > > > > > vtkXOpenGLRenderWindow (0x7fa9fa81f800): VTK is designed to work with > OpenGL > > > version 3.2 but it appears it has been given a context that does not > support > > > 3.2. VTK will run in a compatibility mode designed to work with > earlier > > > versions of OpenGL but some features may not work. > > > > > > > > > > > > and then seg faults. > > > > > > > > > > > > That was using vtk 8.1.1 build with VTK_USE_X11=ON and > VTK_USE_COCOA=OFF. > > > OpenGL was provided by the MacPorts mesa and libGLU ports. X11 was > also > > > installed via MacPorts. > > > > > > > > > > > > If, on the other hand, I build vtk 8.1.1 with VTK_USE_COCOA=ON and > > > VTK_USE_X11=OFF, then it uses OpenGL from > > > /System/Library/Frameworks/OpenGL.framework, and > CylinderRenderingProperties > > > compiles and runs correctly. > > > > > > > > > > > > Do I need to do something special when building or using VTK to get it > to > > > find the correct version of OpenGL? > > > > > > > > > > > > (I'm running macOS High Sierra, but the problem existed with the > previous OS > > > as well.) > > > > > > > > > > > > Thanks. > > > > > > -- Steve > > > > > > > > > > > > > > > _______________________________________________ > > > Powered by > https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Cstephen.langer%40nist.gov%7C4daf5756210546585ab808d60d9efef4%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636711373868698381&sdata=zw2bxe3tqPD5fssLtnBuG%2FRl85OjPbTsfcC91Z%2BOw8o%3D&reserved=0 > > > > > > Visit other Kitware open-source projects at > > > > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Cstephen.langer%40nist.gov%7C4daf5756210546585ab808d60d9efef4%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636711373868698381&sdata=PcYBqXP0j4eVWPzKggeLrqAQ7WiY9LnNtUkiZDxknRs%3D&reserved=0 > > > > > > Please keep messages on-topic and check the VTK FAQ at: > > > > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Cstephen.langer%40nist.gov%7C4daf5756210546585ab808d60d9efef4%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636711373868698381&sdata=uGa1FqKpH99%2FCE%2F6fuqHCtHT1aB8ZIF1whf3WOAbU5E%3D&reserved=0 > > > > > > Search the list archives at: > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Cstephen.langer%40nist.gov%7C4daf5756210546585ab808d60d9efef4%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636711373868698381&sdata=W8JHLG0N9x3mhkk4XC3ESXsQxcbq73fpsp0zArKboPQ%3D&reserved=0 > > > > > > Follow this link to subscribe/unsubscribe: > > > > https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Cstephen.langer%40nist.gov%7C4daf5756210546585ab808d60d9efef4%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636711373868698381&sdata=ez3xU4rzNT7kcWNTGsTOKs8HleLU1ykmGsgigHwvwxU%3D&reserved=0 > > > > > From elvis.stansvik at orexplore.com Thu Aug 30 04:14:53 2018 From: elvis.stansvik at orexplore.com (Elvis Stansvik) Date: Thu, 30 Aug 2018 10:14:53 +0200 Subject: [vtkusers] OpenGL version error on macOS In-Reply-To: References: <631C812F-27AA-411D-88B6-0037AEFAA889@contoso.com> Message-ID: 2018-08-30 10:13 GMT+02:00 Elvis Stansvik : > 2018-08-29 23:10 GMT+02:00 Langer, Stephen A. (Fed) : >> Thanks for the suggestion, but that didn't make any difference. >> >> >> >> I don't think the problem is the frameworks, actually. I don't believe >> that the OpenGL framework provided by Apple supports X11, so there's no >> point in directing vtk towards it. >> >> >> >> I can get vtk to link to the OpenGL libraries provided by the MacPorts' mesa >> and libGLU, but when it does, it complains about the OpenGL version. The >> mesa in MacPorts is version is 17.1.6, which supports OpenGL 4.5, so it >> ought to work. However, the Mesa release notes >> (https://www.mesa3d.org/relnotes/17.1.6.html) say this, which I don't >> completely understand: >> >> >> >> Mesa 17.1.6 implements the OpenGL 4.5 API, but the version reported by >> glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) / >> glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used. >> Some drivers don't support all the features required in OpenGL 4.5. OpenGL >> 4.5 is only available if requested at context creation because compatibility >> contexts are not supported. >> >> >> >> That doesn't way what version is provided if 4.5 isn't requested. But is it >> possible that vtk isn't getting the OpenGL context correctly? I tried >> looking at the code but didn't get very far. I'm not at all familiar with >> OpenGL. > > This is a bit out of my league, but I also don't understand that last > sentence. And your diagnosis sounds correct, VTK seems to not get a > capable enough context when you point it at MacPorts' mesa. Don't know > why :/ I guess you could try running with the MESA_GL_VERSION_OVERRIDE environment variable set to 3.2. Elvis > > Elvis > >> >> >> >> -- Steve >> >> >> >> >> >> ?On 8/29/18, 7:03 AM, "Elvis Stansvik" wrote: >> >> >> >> I've only ever built with Cocoa. But it looks like VTK is using >> >> find_package(OpenGL ...) to find OpenGL, which in turn >> >> (FindOpenGL.cmake) uses find_library(OPENGL_gl_LIBRARY OpenGL DOC >> >> "OpenGL library for OS X") to find the library. >> >> >> >> Where find_library looks for macOS frameworks can be controlled using >> >> CMAKE_FRAMEWORK_PATH >> >> >> (https://cmake.org/cmake/help/latest/variable/CMAKE_FRAMEWORK_PATH.html#variable:CMAKE_FRAMEWORK_PATH), >> >> so perhaps try with >> >> >> >> -DCMAKE_FRAMEWORK_PATH:PATH=/path/to/where/your/GL/libs/are >> >> >> >> HTH, >> >> Elvis >> >> >> >> 2018-08-27 17:54 GMT+02:00 Langer, Stephen A. (Fed) >> : >> >> > Hi -- >> >> > >> >> > >> >> > >> >> > I finally need to actually solve a problem I encountered a year ago... >> How >> >> > do I get vtk to use the correct version of OpenGL on macOS using X11? >> >> > >> >> > >> >> > >> >> > I downloaded and built CylinderRenderingProperties from the VTK >> examples >> >> > site. When I run it, it says >> >> > >> >> > >> >> > >> >> > Warning: In >> >> > >> /Users/langer/UTIL/VTK/VTK-8.1.1/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, >> >> > line 804 >> >> > >> >> > vtkXOpenGLRenderWindow (0x7fa9fa81f800): VTK is designed to work with >> OpenGL >> >> > version 3.2 but it appears it has been given a context that does not >> support >> >> > 3.2. VTK will run in a compatibility mode designed to work with >> earlier >> >> > versions of OpenGL but some features may not work. >> >> > >> >> > >> >> > >> >> > and then seg faults. >> >> > >> >> > >> >> > >> >> > That was using vtk 8.1.1 build with VTK_USE_X11=ON and >> VTK_USE_COCOA=OFF. >> >> > OpenGL was provided by the MacPorts mesa and libGLU ports. X11 was >> also >> >> > installed via MacPorts. >> >> > >> >> > >> >> > >> >> > If, on the other hand, I build vtk 8.1.1 with VTK_USE_COCOA=ON and >> >> > VTK_USE_X11=OFF, then it uses OpenGL from >> >> > /System/Library/Frameworks/OpenGL.framework, and >> CylinderRenderingProperties >> >> > compiles and runs correctly. >> >> > >> >> > >> >> > >> >> > Do I need to do something special when building or using VTK to get it >> to >> >> > find the correct version of OpenGL? >> >> > >> >> > >> >> > >> >> > (I'm running macOS High Sierra, but the problem existed with the >> previous OS >> >> > as well.) >> >> > >> >> > >> >> > >> >> > Thanks. >> >> > >> >> > -- Steve >> >> > >> >> > >> >> > >> >> > >> >> > _______________________________________________ >> >> > Powered by >> https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Cstephen.langer%40nist.gov%7C4daf5756210546585ab808d60d9efef4%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636711373868698381&sdata=zw2bxe3tqPD5fssLtnBuG%2FRl85OjPbTsfcC91Z%2BOw8o%3D&reserved=0 >> >> > >> >> > Visit other Kitware open-source projects at >> >> > >> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Cstephen.langer%40nist.gov%7C4daf5756210546585ab808d60d9efef4%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636711373868698381&sdata=PcYBqXP0j4eVWPzKggeLrqAQ7WiY9LnNtUkiZDxknRs%3D&reserved=0 >> >> > >> >> > Please keep messages on-topic and check the VTK FAQ at: >> >> > >> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Cstephen.langer%40nist.gov%7C4daf5756210546585ab808d60d9efef4%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636711373868698381&sdata=uGa1FqKpH99%2FCE%2F6fuqHCtHT1aB8ZIF1whf3WOAbU5E%3D&reserved=0 >> >> > >> >> > Search the list archives at: >> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Cstephen.langer%40nist.gov%7C4daf5756210546585ab808d60d9efef4%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636711373868698381&sdata=W8JHLG0N9x3mhkk4XC3ESXsQxcbq73fpsp0zArKboPQ%3D&reserved=0 >> >> > >> >> > Follow this link to subscribe/unsubscribe: >> >> > >> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Cstephen.langer%40nist.gov%7C4daf5756210546585ab808d60d9efef4%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636711373868698381&sdata=ez3xU4rzNT7kcWNTGsTOKs8HleLU1ykmGsgigHwvwxU%3D&reserved=0 >> >> > >> >> From ftpronk at engits.com Thu Aug 30 04:26:57 2018 From: ftpronk at engits.com (Fcs) Date: Thu, 30 Aug 2018 01:26:57 -0700 (MST) Subject: [vtkusers] Real-time polydata filtering In-Reply-To: References: Message-ID: <1535617617137-0.post@n5.nabble.com> Hi there, Why don't you try building a pipeline using vtkClipPolyData with a vtkBox implicit function, and start optimizing from there? You'll keep the original polydata, and only render the output of the clipper. Have a look at the following examples for inspiration: https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/ImplicitDataSetClipping/ https://lorensen.github.io/VTKExamples/site/Cxx/ImageData/IntersectLine/ https://lorensen.github.io/VTKExamples/site/Cxx/Filtering/ImplicitBooleanDemo/ Kind regards, Francois. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From pkorir at ebi.ac.uk Thu Aug 30 04:32:36 2018 From: pkorir at ebi.ac.uk (Paul Korir) Date: Thu, 30 Aug 2018 09:32:36 +0100 Subject: [vtkusers] vtk.js: Resize rendering window when using vtkGenericRenderWindow In-Reply-To: References: Message-ID: <6b0fd7b6-dc6e-6b1c-7026-11cfd5d965a9@ebi.ac.uk> Thanks for your response. I'll try the resize() method. I hope you get time soon because it's rather difficult to work with vtk.js given that its design departs significantly from VTK. Best wishes, Paul K. Korir, PhD Scientific Programmer EMBL-EBI 01223494422 On 29/08/2018 19:36, Sebastien Jourdain wrote: > I'm guessing for the 1) you are talking about the API part of it since > lots of example are available on how to use specific classes? > Right now, it is true that we show the source code in place of the API > but we are hoping to provide an automated tool that should gather > properties/methods/default values in a meaningful way. > Unfortunately, we don't have a time frame regarding that aspect. > > On Wed, Aug 29, 2018 at 12:53 PM Sebastien Jourdain > > wrote: > > To set the size of the window, you need to call setSize(widget, > height) on the OpenGLRenderWindow instance. > But for the generic GenericRenderWindow, you just need to call > .resize() to let know the renderer that it should snap to its > container size. > > > On Wed, Aug 29, 2018 at 9:46 AM Paul Korir > wrote: > > Greetings, > > I'm using the above class and have managed to use it to render > some VTP > files. However, when I place the render window inside a div of > 1000 X > 1000px the view is pixelated. I noticed the canvas is set to > 300px > square. I've scoured the API but cannot see how to resize the > canvas/render window. > > Two requests: > > 1) Any idea when vtk.js will be more fully documented? It's > quite hard > to work with it as is. > > 2) What is the recommended way to set the size of the > canvas/render > window to fill the space? > > -- > Paul K. Korir, PhD > Scientific Programmer > EMBL-EBI > 01223494422 > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: > http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pbergeron at spiria.com Thu Aug 30 09:52:53 2018 From: pbergeron at spiria.com (Patrick Bergeron) Date: Thu, 30 Aug 2018 13:52:53 +0000 Subject: [vtkusers] Multiple textures, multiple tcoords? Message-ID: Hi. Sorry if this seems kind of obvious to some, but I've been searching and could not find an answer. How can I specify multiple texture maps, and multiple texture coordinates, on polydata? -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.ostroot at lickenbrocktech.com Thu Aug 30 10:23:17 2018 From: mark.ostroot at lickenbrocktech.com (mark.ostroot at lickenbrocktech.com) Date: Thu, 30 Aug 2018 07:23:17 -0700 Subject: [vtkusers] Project 3D Data onto a plane in vtk 8 or later In-Reply-To: Message-ID: <20180830072317.c7db654a879d86b78cfcacc46040d57b.b6e8bc16d4.mailapi@email09.godaddy.com> Thank you, I had come across the vtk example for off screen rendering: https://lorensen.github.io/VTKExamples/site/Cxx/Utilities/OffScreenRendering/ The given example has the following code: if VTK_MAJOR_VERSION >= 6 int main(int, char *argv[]) { std::cout << argv[0] << " requires VTK 5.10 or earlier. This VTK version is " << vtkVersion::GetVTKVersion() << std::endl; return EXIT_SUCCESS; } #else Which is why I thought vtk 5.10 or earlier was required. Perhaps the example for it should be cleaned up a little to avoid confusion? Thanks for the help, -Mark --------- Original Message --------- Subject: Re: [vtkusers] Project 3D Data onto a plane in vtk 8 or later From: "Allie Vacanti" Date: 8/29/18 3:20 pm To: mark.ostroot at lickenbrocktech.com Cc: "vtk vtk" You can still use offscreen rendering. Just call SetOffScreenRendering(true) on the vtkRenderWindow. https://www.vtk.org/doc/nightly/html/classvtkWindow.html#a11d4345f6fcb406a0032a4e9721a9580 On Mon, Aug 27, 2018 at 9:54 AM, wrote: Hello, I am trying to project some 3D data onto a plane without using a render window. In the older VTK versions there was an off-screen renderer, but in all of the example code I have seen there seems to be a stipulation that you need to use vtk 5.0 or earlier for that feature. Im looking for the same functionality as the offscreen renderer essentially. Please let me know if you have any ideas. Thank you, -Mark _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Search the list archives at: http://markmail.org/search/?q=vtkusers Follow this link to subscribe/unsubscribe: https://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Thu Aug 30 10:56:41 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Thu, 30 Aug 2018 10:56:41 -0400 Subject: [vtkusers] Multiple textures, multiple tcoords? In-Reply-To: References: Message-ID: I think this is not yet supported without custom code. @Ken Martin did you get around to implementing this yet? I agree it will be a useful feature. Many obj files expect it, and our reader does now at least read all of the texture coordinate arrays. In the ospray side I have an imperfect solution in which the texture coordinates are melded, but only there only set is active on any given polygon. David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Thu, Aug 30, 2018 at 9:52 AM Patrick Bergeron wrote: > Hi. > > > Sorry if this seems kind of obvious to some, but I've been searching and > could not find an answer. > > > How can I specify multiple texture maps, and multiple texture coordinates, > on polydata? > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.martin at kitware.com Thu Aug 30 11:02:15 2018 From: ken.martin at kitware.com (Ken Martin) Date: Thu, 30 Aug 2018 11:02:15 -0400 Subject: [vtkusers] Multiple textures, multiple tcoords? In-Reply-To: References: Message-ID: I believe it is implemented. Look at https://gitlab.kitware.com/vtk/vtk/blob/master/Rendering/OpenGL2/Testing/Cxx/TestMultiTexturing.cxx for an example. On Thu, Aug 30, 2018 at 10:56 AM, David E DeMarle wrote: > I think this is not yet supported without custom code. > @Ken Martin did you get around to implementing > this yet? I agree it will be a useful feature. > > Many obj files expect it, and our reader does now at least read all of the > texture coordinate arrays. In the ospray side I have an imperfect solution > in which the texture coordinates are melded, but only there only set is > active on any given polygon. > > David E DeMarle > Kitware, Inc. > Principal Engineer > 21 Corporate Drive > > Clifton Park, NY 12065 > > -8662 > Phone: 518-881-4909 > > > On Thu, Aug 30, 2018 at 9:52 AM Patrick Bergeron > wrote: > >> Hi. >> >> >> Sorry if this seems kind of obvious to some, but I've been searching and >> could not find an answer. >> >> >> How can I specify multiple texture maps, and multiple >> texture coordinates, on polydata? >> >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at http://www.kitware.com/ >> opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Search the list archives at: http://markmail.org/search/?q=vtkusers >> >> Follow this link to subscribe/unsubscribe: >> https://public.kitware.com/mailman/listinfo/vtkusers >> > -- Ken Martin PhD Distinguished Engineer Kitware Inc. 101 East Weaver Street Carrboro, North Carolina 27510 USA This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Thu Aug 30 11:08:14 2018 From: dave.demarle at kitware.com (David E DeMarle) Date: Thu, 30 Aug 2018 11:08:14 -0400 Subject: [vtkusers] Multiple textures, multiple tcoords? In-Reply-To: References: Message-ID: nice! David E DeMarle Kitware, Inc. Principal Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Thu, Aug 30, 2018 at 11:02 AM Ken Martin wrote: > I believe it is implemented. Look at > https://gitlab.kitware.com/vtk/vtk/blob/master/Rendering/OpenGL2/Testing/Cxx/TestMultiTexturing.cxx > for an example. > > > On Thu, Aug 30, 2018 at 10:56 AM, David E DeMarle < > dave.demarle at kitware.com> wrote: > >> I think this is not yet supported without custom code. >> @Ken Martin did you get around to implementing >> this yet? I agree it will be a useful feature. >> >> Many obj files expect it, and our reader does now at least read all of >> the texture coordinate arrays. In the ospray side I have an imperfect >> solution in which the texture coordinates are melded, but only there only >> set is active on any given polygon. >> >> David E DeMarle >> Kitware, Inc. >> Principal Engineer >> 21 Corporate Drive >> >> Clifton Park, NY 12065 >> >> -8662 >> Phone: 518-881-4909 >> >> >> On Thu, Aug 30, 2018 at 9:52 AM Patrick Bergeron >> wrote: >> >>> Hi. >>> >>> >>> Sorry if this seems kind of obvious to some, but I've been searching and >>> could not find an answer. >>> >>> >>> How can I specify multiple texture maps, and multiple >>> texture coordinates, on polydata? >>> >>> >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> https://public.kitware.com/mailman/listinfo/vtkusers >>> >> > > > -- > Ken Martin PhD > Distinguished Engineer > Kitware Inc. > 101 East Weaver Street > Carrboro, North Carolina > 27510 USA > > This communication, including all attachments, contains confidential and > legally privileged information, and it is intended only for the use of the > addressee. Access to this email by anyone else is unauthorized. If you are > not the intended recipient, any disclosure, copying, distribution or any > action taken in reliance on it is prohibited and may be unlawful. If you > received this communication in error please notify us immediately and > destroy the original message. Thank you. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Thu Aug 30 11:37:19 2018 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 30 Aug 2018 09:37:19 -0600 Subject: [vtkusers] OpenGL version error on macOS In-Reply-To: <37822C8D-064A-45D5-8E74-0F8DECC489C8@nist.gov> References: <631C812F-27AA-411D-88B6-0037AEFAA889@contoso.com> <37822C8D-064A-45D5-8E74-0F8DECC489C8@nist.gov> Message-ID: I ran 'glxinfo' under xquartz on my own machine and it reports OpenGL 2.1. This might be a limitation of glx or xquartz, rather than a limitation of the underlying OpenGL libraries or the hardware. If you have a linux machine, you can try doing X11 via ssh (with ssh -Y) to see if the results are different on a different xserver. And there is also the option of building a full-software Mesa (i.e. unaccelerated). People often do this on Windows, since accelerated graphics don't always work with remote desktop. For myself, since I use Windows on VirtualBox which has limited OpenGL support, I'm still building my Windows VTK apps with the old OpenGL backend. - David On Thu, Aug 30, 2018 at 9:11 AM Langer, Stephen A. (Fed) < stephen.langer at nist.gov> wrote: > Yes, I have all of the X11 libraries and the server installed from > MacPorts. X11 programs that don't use vtk, such as glxgears, run > correctly. Poking around with "otool -L" shows that glxgears and > CylinderRenderingProperties are linking to the same X and GL libraries, > with the possible exception of libvtkglew, which as far as I can tell isn't > equivalent to anything loaded by glxgears. > > > > Setting MESA_GL_VERSION_OVERRIDE as Elvis suggested didn't make any > difference. > > > > -- Steve > > > > On 8/29/18, 5:43 PM, "David Gobbi" wrote: > > > > Have you installed XQuartz? It provides a full set of headers and > libraries for X11 and OpenGL in /opt, and the latest version number listed > in its headers is GL_VERSION_4_5. > > > > It has been many years since I've built VTK with X11 on the Mac, but > XQuartz was where I always got the dev files from. > > > > - David > > > > On Wed, Aug 29, 2018 at 3:10 PM Langer, Stephen A. (Fed) < > stephen.langer at nist.gov> wrote: > > Thanks for the suggestion, but that didn't make any difference. > > > > I don't think the problem is the frameworks, actually. I don't believe > that the OpenGL framework provided by Apple supports X11, so there's no > point in directing vtk towards it. > > > > I can get vtk to link to the OpenGL libraries provided by the MacPorts' > mesa and libGLU, but when it does, it complains about the OpenGL version. > The mesa in MacPorts is version is 17.1.6, which supports OpenGL 4.5, so > it ought to work. However, the Mesa release notes ( > https://www.mesa3d.org/relnotes/17.1.6.html > ) > say this, which I don't completely understand: > > > > Mesa 17.1.6 implements the OpenGL 4.5 API, but the version reported by > glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) / > glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being > used. Some drivers don't support all the features required in OpenGL 4.5. > OpenGL 4.5 is only available if requested at context creation because > compatibility contexts are not supported. > > > > That doesn't way what version is provided if 4.5 isn't requested. But is > it possible that vtk isn't getting the OpenGL context correctly? I tried > looking at the code but didn't get very far. I'm not at all familiar with > OpenGL. > > > > -- Steve > > > > > > On 8/29/18, 7:03 AM, "Elvis Stansvik" > wrote: > > > > I've only ever built with Cocoa. But it looks like VTK is using > > find_package(OpenGL ...) to find OpenGL, which in turn > > (FindOpenGL.cmake) uses find_library(OPENGL_gl_LIBRARY OpenGL DOC > > "OpenGL library for OS X") to find the library. > > > > Where find_library looks for macOS frameworks can be controlled using > > CMAKE_FRAMEWORK_PATH > > ( > https://cmake.org/cmake/help/latest/variable/CMAKE_FRAMEWORK_PATH.html#variable:CMAKE_FRAMEWORK_PATH > > ), > > so perhaps try with > > > > -DCMAKE_FRAMEWORK_PATH:PATH=/path/to/where/your/GL/libs/are > > > > HTH, > > Elvis > > > > 2018-08-27 17:54 GMT+02:00 Langer, Stephen A. (Fed) < > stephen.langer at nist.gov>: > > > Hi -- > > > > > > > > > > > > I finally need to actually solve a problem I encountered a year > ago... How > > > do I get vtk to use the correct version of OpenGL on macOS using X11? > > > > > > > > > > > > I downloaded and built CylinderRenderingProperties from the VTK > examples > > > site. When I run it, it says > > > > > > > > > > > > Warning: In > > > > /Users/langer/UTIL/VTK/VTK-8.1.1/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, > > > line 804 > > > > > > vtkXOpenGLRenderWindow (0x7fa9fa81f800): VTK is designed to work > with OpenGL > > > version 3.2 but it appears it has been given a context that does not > support > > > 3.2. VTK will run in a compatibility mode designed to work with > earlier > > > versions of OpenGL but some features may not work. > > > > > > > > > > > > and then seg faults. > > > > > > > > > > > > That was using vtk 8.1.1 build with VTK_USE_X11=ON and > VTK_USE_COCOA=OFF. > > > OpenGL was provided by the MacPorts mesa and libGLU ports. X11 was > also > > > installed via MacPorts. > > > > > > > > > > > > If, on the other hand, I build vtk 8.1.1 with VTK_USE_COCOA=ON and > > > VTK_USE_X11=OFF, then it uses OpenGL from > > > /System/Library/Frameworks/OpenGL.framework, and > CylinderRenderingProperties > > > compiles and runs correctly. > > > > > > > > > > > > Do I need to do something special when building or using VTK to get > it to > > > find the correct version of OpenGL? > > > > > > > > > > > > (I'm running macOS High Sierra, but the problem existed with the > previous OS > > > as well.) > > > > > > > > > > > > Thanks. > > > > > > -- Steve > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From polly_sukting at hotmail.com Thu Aug 30 12:05:58 2018 From: polly_sukting at hotmail.com (Polly Pui) Date: Thu, 30 Aug 2018 16:05:58 +0000 Subject: [vtkusers] How to visualize polydata after KmeansClustering? In-Reply-To: References: , , Message-ID: Hi, The code works well now. I could visualize it. I made a mistake by changing into a different line. Thank you so much. Polly ________________________________ From: vtkusers on behalf of Polly Pui Sent: Thursday, August 30, 2018 12:22 PM To: kenichiro yoshimi Cc: vtkusers Subject: Re: [vtkusers] How to visualize polydata after KmeansClustering? Hi, It doesn't work. I changed the lines, but the identifier "point" is undefined. ------------------------------------------------ And I have another question here, These codes could read polydata vtk, but failed to visualize. I have another dataset (approximate 2000 set) that I saved by using Paraview into .vtk (the data is saved into unstructured grid data instead of polydata) Then, I tried to open using the following codes but it failed to load for unstructured grid data. How should i modify the lines to read the unstructured grid dataset? Thank you so much. Polly ________________________________ From: kenichiro yoshimi Sent: Thursday, August 30, 2018 9:16 AM To: polly_sukting at hotmail.com Cc: vtkusers Subject: Re: [vtkusers] How to visualize polydata after KmeansClustering? Hi, Could you try to modify the lines of your code as below? vtkSmartPointer polydata = vtkSmartPointer::New(); ==> vtkSmartPointer polydata = point; Regards 2018?8?26?(?) 1:59 Polly Pui : > > Hi, > > I would like to show my polydata with points and mark with colours after the KmeansClustering process. > > However, I could only get the values of the points without the visualization of the data. > > Can anyone please advice? > > Thank you so much. > > > Polly > > -------------------------------------------------------------------------------------- > > My code is as below: > > int main(int argc, char* argv[]) > { > // Get the points into the format needed for KMeans > vtkSmartPointer point = > vtkSmartPointer::New(); > > vtkSmartPointer reader = > vtkSmartPointer::New(); > reader->SetFileName(argv[1]); > reader->Update(); > > point = reader->GetOutput(); > > vtkSmartPointer inputData = > vtkSmartPointer::New(); > > for (int c = 0; c < 3; ++c) > { > std::stringstream colName; > colName << "coord " << c; > vtkSmartPointer doubleArray = > vtkSmartPointer::New(); > doubleArray->SetNumberOfComponents(1); > doubleArray->SetName(colName.str().c_str()); > doubleArray->SetNumberOfTuples(point->GetNumberOfPoints()); > > for (int r = 0; r < point->GetNumberOfPoints(); ++r) > { > double p[3]; > point->GetPoint(r, p); > doubleArray->SetValue(r, p[c]); > } > inputData->AddColumn(doubleArray); > } > > vtkSmartPointer kMeansStatistics = > vtkSmartPointer::New(); > > #if VTK_MAJOR_VERSION <= 5 > kMeansStatistics->SetInput(vtkStatisticsAlgorithm::INPUT_DATA, inputData); > #else > kMeansStatistics->SetInputData(vtkStatisticsAlgorithm::INPUT_DATA, inputData); > #endif > kMeansStatistics->SetColumnStatus(inputData->GetColumnName(0), 1); > kMeansStatistics->SetColumnStatus(inputData->GetColumnName(1), 1); > kMeansStatistics->SetColumnStatus(inputData->GetColumnName(2), 1); > kMeansStatistics->RequestSelectedColumns(); > kMeansStatistics->SetAssessOption(true); > kMeansStatistics->SetDefaultNumberOfClusters(5); > //kMeansStatistics->SetMaxNumIterations(1); > kMeansStatistics->Update(); > //double mean0[3]; > //kMeansStatistics->GetMean(0, mean0); > // Display the results > kMeansStatistics->GetOutput()->Dump(); > //Group the points according to ID number > vtkSmartPointer clusterArray = > vtkSmartPointer::New(); > clusterArray->SetNumberOfComponents(1); > clusterArray->SetName("ClusterId"); > > for (int r = 0; r < kMeansStatistics->GetOutput()->GetNumberOfRows(); r++) > { > vtkVariant v = kMeansStatistics->GetOutput()->GetValue(r, kMeansStatistics->GetOutput()->GetNumberOfColumns() - 1); > //std::cout << "Point " << r << " is in cluster " << v.ToInt() << std::endl; > clusterArray->InsertNextValue(v.ToInt()); > } > > // Create a lookup table to map cell data to colors > vtkSmartPointer lut = > vtkSmartPointer::New(); > int tableSize = (kMeansStatistics + 1, 10); > lut->SetNumberOfTableValues(tableSize); > lut->Build(); > > // Fill in a few known colors, the rest will be generated if needed > //ColorCells tutorial https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/ColorCells/ ColorCells - GitHub Pages lorensen.github.io Download and Build ColorCells?. Click here to download ColorCells and its CMakeLists.txt file. Once the tarball ColorCells.tar has been downloaded and extracted, > vtkSmartPointer colors = > vtkSmartPointer::New(); > lut->SetTableValue(0, colors->GetColor4d("Black").GetData()); > lut->SetTableValue(1, colors->GetColor4d("Banana").GetData()); > lut->SetTableValue(2, colors->GetColor4d("Tomato").GetData()); > lut->SetTableValue(3, colors->GetColor4d("Peacock").GetData()); > lut->SetTableValue(4, colors->GetColor4d("Lavender").GetData()); > > // Output the cluster centers > > vtkMultiBlockDataSet* outputMetaDS = vtkMultiBlockDataSet::SafeDownCast(kMeansStatistics->GetOutputDataObject(vtkStatisticsAlgorithm::OUTPUT_MODEL)); > vtkSmartPointer outputMeta = vtkTable::SafeDownCast(outputMetaDS->GetBlock(0)); > //vtkSmartPointer outputMeta = vtkTable::SafeDownCast( outputMetaDS->GetBlock( 1 ) ); > vtkDoubleArray* coord0 = vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("coord 0")); > vtkDoubleArray* coord1 = vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("coord 1")); > vtkDoubleArray* coord2 = vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("coord 2")); > > for (unsigned int i = 0; i < coord0->GetNumberOfTuples(); ++i) > { > std::cout << coord0->GetValue(i) << " " << coord1->GetValue(i) << " " << coord2->GetValue(i) << std::endl; > } > > vtkSmartPointer polydata = > vtkSmartPointer::New(); > //polydata->SetPoints(point); > polydata->GetPointData()->AddArray(clusterArray); > polydata->GetPointData()->SetScalars(clusterArray); > > // Display > vtkSmartPointer glyphFilter = > vtkSmartPointer::New(); > #if VTK_MAJOR_VERSION <= 5 > glyphFilter->SetInputConnection(polydata->GetProducerPort()); > #else > glyphFilter->SetInputData(polydata); > #endif > glyphFilter->Update(); > > // Create a mapper and actor > vtkSmartPointer mapper = > vtkSmartPointer::New(); > mapper->SetInputConnection(glyphFilter->GetOutputPort()); > mapper->SetScalarRange(0, tableSize - 1); > mapper->SetLookupTable(lut); > > vtkSmartPointer actor = > vtkSmartPointer::New(); > actor->SetMapper(mapper); > actor->GetProperty()->SetPointSize(5); > > // Create a renderer, render window, and interactor > vtkSmartPointer renderer = > vtkSmartPointer::New(); > vtkSmartPointer renderWindow = > vtkSmartPointer::New(); > renderWindow->AddRenderer(renderer); > renderWindow->SetSize(800, 800); > > vtkSmartPointer renderWindowInteractor = > vtkSmartPointer::New(); > renderWindowInteractor->SetRenderWindow(renderWindow); > > // Add the actor to the scene > renderer->AddActor(actor); > renderer->SetBackground(colors->GetColor3d("SlateGray").GetData()); > > vtkSmartPointer style = > vtkSmartPointer::New(); > renderWindowInteractor->SetInteractorStyle(style); > > // Render and interact > renderWindow->Render(); > > vtkWindowToImageFilter *windowToImageFilter = vtkWindowToImageFilter::New(); > windowToImageFilter->SetInput(renderWindow); > windowToImageFilter->Update(); > > vtkJPEGWriter *writer = vtkJPEGWriter::New(); > writer->SetInputConnection(windowToImageFilter->GetOutputPort()); > writer->SetFileName("10nosepoints.jpg"); > writer->Write(); > > renderWindowInteractor->Start(); > > return EXIT_SUCCESS; > } > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrei.cimpoeru at cfms.org.uk Thu Aug 30 12:18:15 2018 From: andrei.cimpoeru at cfms.org.uk (acimpo) Date: Thu, 30 Aug 2018 09:18:15 -0700 (MST) Subject: [vtkusers] Write triangulated mesh from a set of points Message-ID: <1535645895178-0.post@n5.nabble.com> Hi folks, I have the code below which generates a set of of points (5 in each direction) and then connects them in triangles. I played with the connectivity but it seems that I am getting the ordering wrong. Do you have any suggestions on how to connect those points without getting any overlapping/intersections? Any help will be much appreciated. Please see the code below. *#include #include #include #include #include #include int main(int argc, char *argv[]) { //setup points (geometry) int numPoints=5; vtkSmartPointer points = vtkSmartPointer::New(); vtkSmartPointer triangles = vtkSmartPointer::New(); vtkSmartPointer triangle = vtkSmartPointer::New(); //int pid=0; for (unsigned int j =0; jInsertNextPoint ( i, j,0 ); } } //pid = pid + 1; for (int i=0; i<6;i++) { vtkIdType pid[1]; std::cout< triangle = vtkSmartPointer::New(); triangle->GetPointIds()->SetId ( 0, i ); triangle->GetPointIds()->SetId ( 1, i+1 ); triangle->GetPointIds()->SetId ( 2, i+2 ); triangles->InsertNextCell ( triangle ); } //triangles->InsertNextCell ( triangle ); vtkSmartPointer polydata = vtkSmartPointer::New(); //set the points and vertices we created as the geometry and topology of the polydata polydata->SetPoints ( points ); polydata->SetPolys ( triangles ); std::cout << "There are " << polydata->GetNumberOfCells() << " cells." << std::endl; std::cout << "There are " << polydata->GetNumberOfPoints() << " points." << std::endl; //write the polydata to a file vtkSmartPointer writer = vtkSmartPointer::New(); writer->SetFileName ( "triangles.vtp" ); #if VTK_MAJOR_VERSION <= 5 writer->SetInput ( polydata ); #else writer->SetInputData ( polydata ); #endif writer->Write(); return EXIT_SUCCESS; } -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From sebastien.jourdain at kitware.com Thu Aug 30 12:39:29 2018 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Thu, 30 Aug 2018 10:39:29 -0600 Subject: [vtkusers] vtk.js: Resize rendering window when using vtkGenericRenderWindow In-Reply-To: <6b0fd7b6-dc6e-6b1c-7026-11cfd5d965a9@ebi.ac.uk> References: <6b0fd7b6-dc6e-6b1c-7026-11cfd5d965a9@ebi.ac.uk> Message-ID: In which way do you mean it depart from VTK? It should not be the case. On Thu, Aug 30, 2018 at 2:32 AM Paul Korir wrote: > Thanks for your response. I'll try the resize() method. > > I hope you get time soon because it's rather difficult to work with vtk.js > given that its design departs significantly from VTK. > > Best wishes, > > Paul K. Korir, PhD > Scientific Programmer > EMBL-EBI > 01223494422 > > On 29/08/2018 19:36, Sebastien Jourdain wrote: > > I'm guessing for the 1) you are talking about the API part of it since > lots of example are available on how to use specific classes? > Right now, it is true that we show the source code in place of the API but > we are hoping to provide an automated tool that should gather > properties/methods/default values in a meaningful way. > Unfortunately, we don't have a time frame regarding that aspect. > > On Wed, Aug 29, 2018 at 12:53 PM Sebastien Jourdain < > sebastien.jourdain at kitware.com> wrote: > >> To set the size of the window, you need to call setSize(widget, height) >> on the OpenGLRenderWindow instance. >> But for the generic GenericRenderWindow, you just need to call .resize() >> to let know the renderer that it should snap to its container size. >> >> >> On Wed, Aug 29, 2018 at 9:46 AM Paul Korir wrote: >> >>> Greetings, >>> >>> I'm using the above class and have managed to use it to render some VTP >>> files. However, when I place the render window inside a div of 1000 X >>> 1000px the view is pixelated. I noticed the canvas is set to 300px >>> square. I've scoured the API but cannot see how to resize the >>> canvas/render window. >>> >>> Two requests: >>> >>> 1) Any idea when vtk.js will be more fully documented? It's quite hard >>> to work with it as is. >>> >>> 2) What is the recommended way to set the size of the canvas/render >>> window to fill the space? >>> >>> -- >>> Paul K. Korir, PhD >>> Scientific Programmer >>> EMBL-EBI >>> 01223494422 >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Search the list archives at: http://markmail.org/search/?q=vtkusers >>> >>> Follow this link to subscribe/unsubscribe: >>> https://public.kitware.com/mailman/listinfo/vtkusers >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From polly_sukting at hotmail.com Thu Aug 30 12:46:46 2018 From: polly_sukting at hotmail.com (Polly Pui) Date: Thu, 30 Aug 2018 16:46:46 +0000 Subject: [vtkusers] How to mark a point perpendicular to surface? Message-ID: Hi, I would like mark a point/find the point which is perpendicular to the centroid of a region in a polydata. Please refer to the attached image. How can I make a keypoint (marked in red) which is z normal to the given coordinates (marked as +)? Thank you. Polly -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: NE00.png Type: image/png Size: 59175 bytes Desc: NE00.png URL: From stephen.langer at nist.gov Thu Aug 30 15:51:47 2018 From: stephen.langer at nist.gov (Langer, Stephen A. (Fed)) Date: Thu, 30 Aug 2018 19:51:47 +0000 Subject: [vtkusers] OpenGL version error on macOS In-Reply-To: References: <631C812F-27AA-411D-88B6-0037AEFAA889@contoso.com> <37822C8D-064A-45D5-8E74-0F8DECC489C8@nist.gov> Message-ID: <25F0C6F6-D77E-4B69-A206-EB4ADC3D538B@nist.gov> glxinfo reports 2.1 on my Mac, too? I guess I'll ask the MacPorts people. I do have a Linux machine but X11 forwarding isn't working, although the ssh settings appear to allow it. I suspect some global overzealous security setting, but our sysadmin is off this week so I can't ask about it. Thanks. -- Steve On 8/30/18, 11:37 AM, "David Gobbi" > wrote: I ran 'glxinfo' under xquartz on my own machine and it reports OpenGL 2.1. This might be a limitation of glx or xquartz, rather than a limitation of the underlying OpenGL libraries or the hardware. If you have a linux machine, you can try doing X11 via ssh (with ssh -Y) to see if the results are different on a different xserver. And there is also the option of building a full-software Mesa (i.e. unaccelerated). People often do this on Windows, since accelerated graphics don't always work with remote desktop. For myself, since I use Windows on VirtualBox which has limited OpenGL support, I'm still building my Windows VTK apps with the old OpenGL backend. - David On Thu, Aug 30, 2018 at 9:11 AM Langer, Stephen A. (Fed) > wrote: Yes, I have all of the X11 libraries and the server installed from MacPorts. X11 programs that don't use vtk, such as glxgears, run correctly. Poking around with "otool -L" shows that glxgears and CylinderRenderingProperties are linking to the same X and GL libraries, with the possible exception of libvtkglew, which as far as I can tell isn't equivalent to anything loaded by glxgears. Setting MESA_GL_VERSION_OVERRIDE as Elvis suggested didn't make any difference. -- Steve On 8/29/18, 5:43 PM, "David Gobbi" > wrote: Have you installed XQuartz? It provides a full set of headers and libraries for X11 and OpenGL in /opt, and the latest version number listed in its headers is GL_VERSION_4_5. It has been many years since I've built VTK with X11 on the Mac, but XQuartz was where I always got the dev files from. - David On Wed, Aug 29, 2018 at 3:10 PM Langer, Stephen A. (Fed) > wrote: Thanks for the suggestion, but that didn't make any difference. I don't think the problem is the frameworks, actually. I don't believe that the OpenGL framework provided by Apple supports X11, so there's no point in directing vtk towards it. I can get vtk to link to the OpenGL libraries provided by the MacPorts' mesa and libGLU, but when it does, it complains about the OpenGL version. The mesa in MacPorts is version is 17.1.6, which supports OpenGL 4.5, so it ought to work. However, the Mesa release notes (https://www.mesa3d.org/relnotes/17.1.6.html) say this, which I don't completely understand: Mesa 17.1.6 implements the OpenGL 4.5 API, but the version reported by glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) / glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used. Some drivers don't support all the features required in OpenGL 4.5. OpenGL 4.5 is only available if requested at context creation because compatibility contexts are not supported. That doesn't way what version is provided if 4.5 isn't requested. But is it possible that vtk isn't getting the OpenGL context correctly? I tried looking at the code but didn't get very far. I'm not at all familiar with OpenGL. -- Steve On 8/29/18, 7:03 AM, "Elvis Stansvik" > wrote: I've only ever built with Cocoa. But it looks like VTK is using find_package(OpenGL ...) to find OpenGL, which in turn (FindOpenGL.cmake) uses find_library(OPENGL_gl_LIBRARY OpenGL DOC "OpenGL library for OS X") to find the library. Where find_library looks for macOS frameworks can be controlled using CMAKE_FRAMEWORK_PATH (https://cmake.org/cmake/help/latest/variable/CMAKE_FRAMEWORK_PATH.html#variable:CMAKE_FRAMEWORK_PATH), so perhaps try with -DCMAKE_FRAMEWORK_PATH:PATH=/path/to/where/your/GL/libs/are HTH, Elvis 2018-08-27 17:54 GMT+02:00 Langer, Stephen A. (Fed) >: > Hi -- > > > > I finally need to actually solve a problem I encountered a year ago... How > do I get vtk to use the correct version of OpenGL on macOS using X11? > > > > I downloaded and built CylinderRenderingProperties from the VTK examples > site. When I run it, it says > > > > Warning: In > /Users/langer/UTIL/VTK/VTK-8.1.1/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, > line 804 > > vtkXOpenGLRenderWindow (0x7fa9fa81f800): VTK is designed to work with OpenGL > version 3.2 but it appears it has been given a context that does not support > 3.2. VTK will run in a compatibility mode designed to work with earlier > versions of OpenGL but some features may not work. > > > > and then seg faults. > > > > That was using vtk 8.1.1 build with VTK_USE_X11=ON and VTK_USE_COCOA=OFF. > OpenGL was provided by the MacPorts mesa and libGLU ports. X11 was also > installed via MacPorts. > > > > If, on the other hand, I build vtk 8.1.1 with VTK_USE_COCOA=ON and > VTK_USE_X11=OFF, then it uses OpenGL from > /System/Library/Frameworks/OpenGL.framework, and CylinderRenderingProperties > compiles and runs correctly. > > > > Do I need to do something special when building or using VTK to get it to > find the correct version of OpenGL? > > > > (I'm running macOS High Sierra, but the problem existed with the previous OS > as well.) > > > > Thanks. > > -- Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.cumhur.arslan at gmail.com Thu Aug 30 16:00:38 2018 From: a.cumhur.arslan at gmail.com (cumhur) Date: Thu, 30 Aug 2018 13:00:38 -0700 (MST) Subject: [vtkusers] vtkGUISupportQt qvtkwidget for ios Message-ID: <1535659238668-0.post@n5.nabble.com> hi, i created a project with qt and vtk by using qvtkwidget. now i want to compile it for mobile environments. i successfully compiled vtk for ios but it does not contain a qvtkwidget.h and there is no configuration about qt at the cmake process. is it possible to add qt support by tweaking the cmake files or is it technically impossible to use vtk within a qt gui in mobile devices. thank you. -- Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html From bill.lorensen at gmail.com Thu Aug 30 16:14:22 2018 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Thu, 30 Aug 2018 13:14:22 -0700 Subject: [vtkusers] How to mark a point perpendicular to surface? In-Reply-To: References: Message-ID: You could run polydatanormals and tell it to generate cell normals. Then for your cell, get the normal. On Thu, Aug 30, 2018, 9:46 AM Polly Pui wrote: > Hi, > > I would like mark a point/find the point which is perpendicular to the > centroid of a region in a polydata. > > Please refer to the attached image. > > How can I make a keypoint (marked in red) which is z normal to the given > coordinates (marked as +)? > > > Thank you. > > > Polly > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Thu Aug 30 16:16:35 2018 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Thu, 30 Aug 2018 13:16:35 -0700 Subject: [vtkusers] How to visualize polydata after KmeansClustering? In-Reply-To: References: Message-ID: Send me the working codr and I'll ad it as a VTKExample. You'll get credit of course. On Thu, Aug 30, 2018, 9:06 AM Polly Pui wrote: > > Hi, > The code works well now. I could visualize it. > I made a mistake by changing into a different line. > Thank you so much. > > Polly > ------------------------------ > *From:* vtkusers on behalf of Polly > Pui > *Sent:* Thursday, August 30, 2018 12:22 PM > *To:* kenichiro yoshimi > *Cc:* vtkusers > *Subject:* Re: [vtkusers] How to visualize polydata after > KmeansClustering? > > > Hi, > > It doesn't work. > > I changed the lines, but the identifier "point" is undefined. > ------------------------------------------------ > And I have another question here, > These codes could read polydata vtk, but failed to visualize. > I have another dataset (approximate 2000 set) that I saved by using > Paraview into .vtk (the data is saved into unstructured grid data instead > of polydata) > Then, I tried to open using the following codes but it failed to load for > unstructured grid data. > How should i modify the lines to read the unstructured grid dataset? > > Thank you so much. > > Polly > ------------------------------ > *From:* kenichiro yoshimi > *Sent:* Thursday, August 30, 2018 9:16 AM > *To:* polly_sukting at hotmail.com > *Cc:* vtkusers > *Subject:* Re: [vtkusers] How to visualize polydata after > KmeansClustering? > > Hi, > > Could you try to modify the lines of your code as below? > > vtkSmartPointer polydata = > vtkSmartPointer::New(); > ==> > vtkSmartPointer polydata = point; > > Regards > 2018?8?26?(?) 1:59 Polly Pui : > > > > Hi, > > > > I would like to show my polydata with points and mark with colours after > the KmeansClustering process. > > > > However, I could only get the values of the points without the > visualization of the data. > > > > Can anyone please advice? > > > > Thank you so much. > > > > > > Polly > > > > > -------------------------------------------------------------------------------------- > > > > My code is as below: > > > > int main(int argc, char* argv[]) > > { > > // Get the points into the format needed for KMeans > > vtkSmartPointer point = > > vtkSmartPointer::New(); > > > > vtkSmartPointer reader = > > vtkSmartPointer::New(); > > reader->SetFileName(argv[1]); > > reader->Update(); > > > > point = reader->GetOutput(); > > > > vtkSmartPointer inputData = > > vtkSmartPointer::New(); > > > > for (int c = 0; c < 3; ++c) > > { > > std::stringstream colName; > > colName << "coord " << c; > > vtkSmartPointer doubleArray = > > vtkSmartPointer::New(); > > doubleArray->SetNumberOfComponents(1); > > doubleArray->SetName(colName.str().c_str()); > > doubleArray->SetNumberOfTuples(point->GetNumberOfPoints()); > > > > for (int r = 0; r < point->GetNumberOfPoints(); ++r) > > { > > double p[3]; > > point->GetPoint(r, p); > > doubleArray->SetValue(r, p[c]); > > } > > inputData->AddColumn(doubleArray); > > } > > > > vtkSmartPointer kMeansStatistics = > > vtkSmartPointer::New(); > > > > #if VTK_MAJOR_VERSION <= 5 > > kMeansStatistics->SetInput(vtkStatisticsAlgorithm::INPUT_DATA, > inputData); > > #else > > kMeansStatistics->SetInputData(vtkStatisticsAlgorithm::INPUT_DATA, > inputData); > > #endif > > kMeansStatistics->SetColumnStatus(inputData->GetColumnName(0), 1); > > kMeansStatistics->SetColumnStatus(inputData->GetColumnName(1), 1); > > kMeansStatistics->SetColumnStatus(inputData->GetColumnName(2), 1); > > kMeansStatistics->RequestSelectedColumns(); > > kMeansStatistics->SetAssessOption(true); > > kMeansStatistics->SetDefaultNumberOfClusters(5); > > //kMeansStatistics->SetMaxNumIterations(1); > > kMeansStatistics->Update(); > > //double mean0[3]; > > //kMeansStatistics->GetMean(0, mean0); > > // Display the results > > kMeansStatistics->GetOutput()->Dump(); > > //Group the points according to ID number > > vtkSmartPointer clusterArray = > > vtkSmartPointer::New(); > > clusterArray->SetNumberOfComponents(1); > > clusterArray->SetName("ClusterId"); > > > > for (int r = 0; r < kMeansStatistics->GetOutput()->GetNumberOfRows(); > r++) > > { > > vtkVariant v = kMeansStatistics->GetOutput()->GetValue(r, > kMeansStatistics->GetOutput()->GetNumberOfColumns() - 1); > > //std::cout << "Point " << r << " is in cluster " << v.ToInt() << > std::endl; > > clusterArray->InsertNextValue(v.ToInt()); > > } > > > > // Create a lookup table to map cell data to colors > > vtkSmartPointer lut = > > vtkSmartPointer::New(); > > int tableSize = (kMeansStatistics + 1, 10); > > lut->SetNumberOfTableValues(tableSize); > > lut->Build(); > > > > // Fill in a few known colors, the rest will be generated if needed > > //ColorCells tutorial > https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/ColorCells/ > ColorCells - GitHub Pages > > lorensen.github.io > Download and Build ColorCells?. Click here to download ColorCells and its > CMakeLists.txt file. Once the tarball ColorCells.tar has been downloaded > and extracted, > > > > vtkSmartPointer colors = > > vtkSmartPointer::New(); > > lut->SetTableValue(0, colors->GetColor4d("Black").GetData()); > > lut->SetTableValue(1, colors->GetColor4d("Banana").GetData()); > > lut->SetTableValue(2, colors->GetColor4d("Tomato").GetData()); > > lut->SetTableValue(3, colors->GetColor4d("Peacock").GetData()); > > lut->SetTableValue(4, colors->GetColor4d("Lavender").GetData()); > > > > // Output the cluster centers > > > > vtkMultiBlockDataSet* outputMetaDS = > vtkMultiBlockDataSet::SafeDownCast(kMeansStatistics->GetOutputDataObject(vtkStatisticsAlgorithm::OUTPUT_MODEL)); > > vtkSmartPointer outputMeta = > vtkTable::SafeDownCast(outputMetaDS->GetBlock(0)); > > //vtkSmartPointer outputMeta = vtkTable::SafeDownCast( > outputMetaDS->GetBlock( 1 ) ); > > vtkDoubleArray* coord0 = > vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("coord 0")); > > vtkDoubleArray* coord1 = > vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("coord 1")); > > vtkDoubleArray* coord2 = > vtkDoubleArray::SafeDownCast(outputMeta->GetColumnByName("coord 2")); > > > > for (unsigned int i = 0; i < coord0->GetNumberOfTuples(); ++i) > > { > > std::cout << coord0->GetValue(i) << " " << coord1->GetValue(i) << " " << > coord2->GetValue(i) << std::endl; > > } > > > > vtkSmartPointer polydata = > > vtkSmartPointer::New(); > > //polydata->SetPoints(point); > > polydata->GetPointData()->AddArray(clusterArray); > > polydata->GetPointData()->SetScalars(clusterArray); > > > > // Display > > vtkSmartPointer glyphFilter = > > vtkSmartPointer::New(); > > #if VTK_MAJOR_VERSION <= 5 > > glyphFilter->SetInputConnection(polydata->GetProducerPort()); > > #else > > glyphFilter->SetInputData(polydata); > > #endif > > glyphFilter->Update(); > > > > // Create a mapper and actor > > vtkSmartPointer mapper = > > vtkSmartPointer::New(); > > mapper->SetInputConnection(glyphFilter->GetOutputPort()); > > mapper->SetScalarRange(0, tableSize - 1); > > mapper->SetLookupTable(lut); > > > > vtkSmartPointer actor = > > vtkSmartPointer::New(); > > actor->SetMapper(mapper); > > actor->GetProperty()->SetPointSize(5); > > > > // Create a renderer, render window, and interactor > > vtkSmartPointer renderer = > > vtkSmartPointer::New(); > > vtkSmartPointer renderWindow = > > vtkSmartPointer::New(); > > renderWindow->AddRenderer(renderer); > > renderWindow->SetSize(800, 800); > > > > vtkSmartPointer renderWindowInteractor = > > vtkSmartPointer::New(); > > renderWindowInteractor->SetRenderWindow(renderWindow); > > > > // Add the actor to the scene > > renderer->AddActor(actor); > > renderer->SetBackground(colors->GetColor3d("SlateGray").GetData()); > > > > vtkSmartPointer style = > > vtkSmartPointer::New(); > > renderWindowInteractor->SetInteractorStyle(style); > > > > // Render and interact > > renderWindow->Render(); > > > > vtkWindowToImageFilter *windowToImageFilter = > vtkWindowToImageFilter::New(); > > windowToImageFilter->SetInput(renderWindow); > > windowToImageFilter->Update(); > > > > vtkJPEGWriter *writer = vtkJPEGWriter::New(); > > writer->SetInputConnection(windowToImageFilter->GetOutputPort()); > > writer->SetFileName("10nosepoints.jpg"); > > writer->Write(); > > > > renderWindowInteractor->Start(); > > > > return EXIT_SUCCESS; > > } > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > > > Follow this link to subscribe/unsubscribe: > > https://public.kitware.com/mailman/listinfo/vtkusers > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nil.goyette at imeka.ca Thu Aug 30 09:10:49 2018 From: nil.goyette at imeka.ca (Nil Goyette) Date: Thu, 30 Aug 2018 09:10:49 -0400 Subject: [vtkusers] Real-time polydata filtering In-Reply-To: <1535617617137-0.post@n5.nabble.com> References: <1535617617137-0.post@n5.nabble.com> Message-ID: <8abfb132-d0a5-5251-616d-2e423475b02c@imeka.ca> Hi Francois, I haven't tested the standard vtk tools because: - I already have a working and fast filtering class. I got the indices, now I want to see the change on the screen! - I'm working with big files (500k to 2 millions lines, sometimes more) so I strongly doubt that real-time is possible if I keep creating data. The output can easily reach thousands lines or more. I don't see how this could be done 20+ times per second. That's why the first thing I try is playing with the mapper. I'm not creating anything, I'm simply hiding things. Thanks for the links, I'll try what you suggest when I run out of ideas. Nil Goyette Le 2018-08-30 ? 04:26, Fcs a ?crit?: > Hi there, > > Why don't you try building a pipeline using vtkClipPolyData with a vtkBox > implicit function, and start optimizing from there? You'll keep the > original polydata, and only render the output of the clipper. > > Have a look at the following examples for inspiration: > > https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/ImplicitDataSetClipping/ > > https://lorensen.github.io/VTKExamples/site/Cxx/ImageData/IntersectLine/ > > https://lorensen.github.io/VTKExamples/site/Cxx/Filtering/ImplicitBooleanDemo/ > > Kind regards, > > Francois. From db001465 at gmail.com Fri Aug 31 10:57:43 2018 From: db001465 at gmail.com (do ba) Date: Fri, 31 Aug 2018 16:57:43 +0200 Subject: [vtkusers] Clipping two vtkPolyData Message-ID: Hello I want to find all parts of a polydata (in my case a surface), which lies inside a second polydate (in my case a volume). In the following example i tried to write a simple example. However, something with vtkClipPolyData does not work. Do i make some mistake by creating the implicit data set or by using the vtkClipPolyData function? Regards D import vtk # Create volume def mkVtkIdList(it): vil = vtk.vtkIdList() for i in it: vil.InsertNextId(int(i)) return vil ptsCoord= [] ptsCoord.append( ( 1.0,-1.0,-1.0) ) ptsCoord.append( ( 1.0, 1.0,-1.0) ) ptsCoord.append( (-1.0, 1.0,-1.0) ) ptsCoord.append( (-1.0,-1.0,-1.0) ) ptsCoord.append( ( 1.0,-1.0, 1.0) ) ptsCoord.append( ( 1.0, 1.0, 1.0) ) ptsCoord.append( (-1.0, 1.0, 1.0) ) ptsCoord.append( (-1.0,-1.0, 1.0) ) ptsIdxFaces = [] ptsIdxFaces.append( (0,1,2,3) ) # bottom face ptsIdxFaces.append( (0,1,5,4) ) # side 1 ptsIdxFaces.append( (1,2,6,5) ) # side 2 ptsIdxFaces.append( (2,3,7,6) ) # side 3 ptsIdxFaces.append( (3,0,4,7) ) # side 4 ptsIdxFaces.append( (4,5,6,7) ) # top face volume = vtk.vtkPolyData() points = vtk.vtkPoints() polys = vtk.vtkCellArray() scalars = vtk.vtkFloatArray() for i in range(len(ptsCoord)): points.InsertPoint(i, ptsCoord[i]) for i in range(len(ptsIdxFaces)): polys.InsertNextCell( mkVtkIdList(ptsIdxFaces[i]) ) for i in range(len(ptsCoord)): scalars.InsertTuple1(i,i) volume.SetPoints(points) volume.SetPolys(polys) volume.GetPointData().SetScalars(scalars) writer = vtk.vtkXMLPolyDataWriter(); writer.SetFileName("R:/volume.vtp" ); if vtk.VTK_MAJOR_VERSION <= 5: writer.SetInput(volume) else: writer.SetInputData(volume) writer.Write() # Create Surface points = vtk.vtkPoints() triangle = vtk.vtkTriangle() triangles = vtk.vtkCellArray() points.InsertNextPoint( 0.0,-1.5, 0.0 ) points.InsertNextPoint( 1.5, 0.0, 1.0 ) points.InsertNextPoint( 0.0, 1.5, 0.0 ) points.InsertNextPoint(-1.5, 0.0, 1.0 ) triangle.GetPointIds().SetId(0,0) triangle.GetPointIds().SetId(1,1) triangle.GetPointIds().SetId(2,2) triangles.InsertNextCell(triangle) triangle.GetPointIds().SetId(0,0) triangle.GetPointIds().SetId(1,2) triangle.GetPointIds().SetId(2,3) triangles.InsertNextCell(triangle) surface = vtk.vtkPolyData() surface.SetPoints( points ) surface.SetPolys( triangles ) writer = vtk.vtkXMLPolyDataWriter(); writer.SetFileName("R:/surface.vtp" ); if vtk.VTK_MAJOR_VERSION <= 5: writer.SetInput(surface) else: writer.SetInputData(surface) writer.Write() # Now, clip! tri = vtk.vtkDelaunay3D() tri.SetInputData(volume) tri.BoundingTriangulationOff() # vtkImplicitDataSet needs some scalars to interpolate to find inside/outside elev = vtk.vtkElevationFilter() elev.SetInputConnection(tri.GetOutputPort()) implicit = vtk.vtkImplicitDataSet() implicit.SetDataSet(elev.GetOutput()) clipper = vtk.vtkClipPolyData() clipper.SetClipFunction(implicit) clipper.SetInputData(surface) clipper.InsideOutOn() clipper.Update() writer = vtk.vtkXMLPolyDataWriter(); writer.SetFileName("R:/clipper.vtp" ); if vtk.VTK_MAJOR_VERSION <= 5: writer.SetInput(clipper) else: writer.SetInputData(clipper) writer.Write() -------------- next part -------------- An HTML attachment was scrubbed... URL: From mario at emmenlauer.de Fri Aug 31 10:42:52 2018 From: mario at emmenlauer.de (Mario Emmenlauer) Date: Fri, 31 Aug 2018 16:42:52 +0200 Subject: [vtkusers] any libraries for out-of-core volume handling? In-Reply-To: References: Message-ID: <78df7507-ab60-d949-3c8d-b65d0518db35@emmenlauer.de> Anyone? On 15.05.2018 17:52, Mario Emmenlauer wrote: > Does anybody know if out-of-core volume handling is supported in VTK, > or if support is planned? > > > On 03.05.2018 13:12, Mario Emmenlauer wrote: >> >> Dear all, >> >> is there out-of-core volume handling in VTK? To be more precise, >> has VTK file-backed volumes that can be used for visualization and >> processing? Ideally I'm looking for a full abstraction of the file- >> backed storage, to process and visualize volumes of TB size in C++. >> >> The best I could find is vigra, that has a chunked MultiArray with >> HDF5 buffered storage. Does anyone know of other implementations? All the best, Mario Emmenlauer From dan.lipsa at kitware.com Fri Aug 31 11:51:08 2018 From: dan.lipsa at kitware.com (Dan Lipsa) Date: Fri, 31 Aug 2018 11:51:08 -0400 Subject: [vtkusers] any libraries for out-of-core volume handling? In-Reply-To: <78df7507-ab60-d949-3c8d-b65d0518db35@emmenlauer.de> References: <78df7507-ab60-d949-3c8d-b65d0518db35@emmenlauer.de> Message-ID: VTK supports streaming which can be used for out of core rendering including for volume rendering. https://blog.kitware.com/streaming-in-vtk-spatial/ https://vimeo.com/51155343 On Fri, Aug 31, 2018 at 11:15 AM Mario Emmenlauer wrote: > > Anyone? > > On 15.05.2018 17:52, Mario Emmenlauer wrote: > > Does anybody know if out-of-core volume handling is supported in VTK, > > or if support is planned? > > > > > > On 03.05.2018 13:12, Mario Emmenlauer wrote: > >> > >> Dear all, > >> > >> is there out-of-core volume handling in VTK? To be more precise, > >> has VTK file-backed volumes that can be used for visualization and > >> processing? Ideally I'm looking for a full abstraction of the file- > >> backed storage, to process and visualize volumes of TB size in C++. > >> > >> The best I could find is vigra, that has a chunked MultiArray with > >> HDF5 buffered storage. Does anyone know of other implementations? > > > All the best, > > Mario Emmenlauer > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.martin at kitware.com Fri Aug 31 13:53:49 2018 From: ken.martin at kitware.com (Ken Martin) Date: Fri, 31 Aug 2018 13:53:49 -0400 Subject: [vtkusers] vtkGUISupportQt qvtkwidget for ios In-Reply-To: <1535659238668-0.post@n5.nabble.com> References: <1535659238668-0.post@n5.nabble.com> Message-ID: I have not heard of anyone using vtk with the Qt widget on ios. It might be technically possible. Just never tried it. On Thu, Aug 30, 2018 at 4:00 PM, cumhur wrote: > hi, > > i created a project with qt and vtk by using qvtkwidget. now i want to > compile it for mobile environments. i successfully compiled vtk for ios but > it does not contain a qvtkwidget.h and there is no configuration about qt > at > the cmake process. is it possible to add qt support by tweaking the cmake > files or is it technically impossible to use vtk within a qt gui in mobile > devices. > > thank you. > > > > -- > Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers > -- Ken Martin PhD Distinguished Engineer Kitware Inc. 101 East Weaver Street Carrboro, North Carolina 27510 USA This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcfr at kitware.com Fri Aug 31 14:21:18 2018 From: jcfr at kitware.com (Jean-Christophe Fillion-Robin) Date: Fri, 31 Aug 2018 14:21:18 -0400 Subject: [vtkusers] the New QVTKOpenGLWidget In-Reply-To: References: Message-ID: Hi All, Thanks for the feedback. Based on feedback, we will keep the widget QVTKOpenGLWidget and only rename QVTKOpenGLSimpleWidget to QVTKOpenGLNativeWidget The corresponding change can be found at https://gitlab.kitware.com/vtk/vtk/merge_requests/4642 > unless it's somehow possible to make a widget that will work well in both scenarios That is the idea, ultimately we would like the QVTKOpenGLWidget to be smarter. Thanks Jc On Tue, Aug 28, 2018 at 1:28 AM Elvis Stansvik wrote: > 2018-08-28 0:12 GMT+02:00 Jean-Christophe Fillion-Robin >: > > Hi All, > > > > To follow up on Mathieu email, we are in in the process of integrating > this > > merge request [1] (and the equivalent in paraview [2]) that will > add/rename > > the following classes: > > > > * QVTKOpenGLAlienWidget (equivalent to QVTKOpenGLWidget class described > in > > the previous email) > > > > * QVTKOpenGLNativeWidget (equivalent to QVTKOpenGLSimpleWidget class > > described in the previous email) > > > > * QVTKOpenGLWidget will: > > - behave as it was before the introduction of the "new > QVTKOpenGLWidget" > > and will instead derive from QVTKOpenGLNativeWidget. > > - only be available if VTK_LEGACY_REMOVE is OFF > > - will most likely be removed in VTK 10 > > > > > > We anticipate that this clearer naming convention will facilitate update > of > > user code. > > > > Let us know what you think, > > I think this naming is the best one possible, unless it's somehow > possible to make a widget that will work well in both scenarios of > course :) > > Much better naming than the "Simple" suffix, so +1. > > Elvis > > > > > Thanks > > Jc > > > > > > [1] https://gitlab.kitware.com/vtk/vtk/merge_requests/4625 > > [2] https://gitlab.kitware.com/paraview/paraview/merge_requests/2693 > > > > > > > > > > > > > > > > > > On Thu, Aug 23, 2018 at 5:07 AM Mathieu Westphal > > wrote: > >> > >> Hello list, > >> > >> If you are working on a VTK/Qt application this information should > >> interest you. > >> Sometime ago, a new QVTKOpenGLWidget implementation has been added to > VTK, > >> while the old one has been moved to QVTKOpenGLSimpleWidget. > >> The last fixes for this change have just been merged, so make sure to > use > >> VTK master to test this. > >> > >> 1. Why is there a new widget and what does it do ? > >> We have been having some issues reported for the old widget, and the old > >> widget could not support quad buffer stereo rendering by design. > >> Has it is a needed feature in ParaView, a reimplementation was > necessary. > >> This new widget fix most of the reported issues with the old widget as > well > >> as adding stereo support. > >> > >> 2. Why keeping the old widget around then ? > >> Due to Qt limitations, this new implementation does not support very > well > >> being a native widget. > >> But native widget are sometimes mandatory, for example within > QScrollArea > >> and QMDIArea, so the QVTKOpenGLSimpleWidget should be used when in > needs of > >> VTK rendering in the contact of Qt native widget. > >> > >> Also it allows users to switch back to the old widget if necessary. > >> > >> 3. I'm not sure what native widgets are, what should I do in my > >> application ? > >> > >> Here are the different situation : > >> > >> Your Qt application only uses a central QVTKOpenGLWidget for rendering: > >> -> Nothing to do, just build with last master and make sure all is > working > >> well > >> Your Qt application only uses QVTKOpenGLWidget within QScrollArea or > >> QMDIArea, or manually set widgets to be native and you are not > interested by > >> stereo rendering. > >> -> Change all your QVTKOpenGLWidget to QVTKOpenGLSimpleWidget and you > are > >> good to go > >> Your application uses a non-native QVTKOpenGLWidget for rendering as > well > >> as native QVTKOpenGLWidget for rendering (eg: ParaView, with the central > >> rendering widget and the color map editor rendering widget in scroll > areas) > >> : > >> -> Use QVTKOpenGLWidget for non-native widgets and > QVTKOpenGLSimpleWidget > >> for native ones. The later will never support stereo. > >> > >> > >> 4. I followed your recommendation but I see some strange > >> stuff/bugs/rendering issues > >> Even if this new class has been tested extensively and will be used in > the > >> next ParaView release, It may still contains some issues. Feel free to > >> discuss them in this mailing list or on our gitlab. > >> > >> Best regards, > >> > >> Mathieu Westphal > > > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Please keep messages on-topic and check the VTK FAQ at: > > http://www.vtk.org/Wiki/VTK_FAQ > > > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > > > Follow this link to subscribe/unsubscribe: > > https://public.kitware.com/mailman/listinfo/vtkusers > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcosaito at gmail.com Fri Aug 31 17:57:54 2018 From: marcosaito at gmail.com (Marcos Saito de Paula) Date: Fri, 31 Aug 2018 18:57:54 -0300 Subject: [vtkusers] Create many instances of vtkContourWidget Message-ID: Hi everyone, I'm new to vtk and have been playing with it for some days now. Is it possible to create many instances of vtkContourWidget, letting the user draw lines and manipulate the nodes? I've done it already, but it seems I'm not doing it right. Here is the code: import vtk def main(): # Create a renderer, render window, and interactor renderer = vtk.vtkRenderer() renderWindow = vtk.vtkRenderWindow() renderWindow.AddRenderer(renderer) Interactor = vtk.vtkRenderWindowInteractor() Interactor.SetRenderWindow(renderWindow) style = vtk.vtkInteractorStyleTerrain() Interactor.SetInteractorStyle(style) Interactor.AddObserver("KeyPressEvent", keyPressEvent) # Render and interact renderWindow.Render() Interactor.Start() def keyPressEvent(obj, event): key = obj.GetKeySym() if key == 'n': contourRep = vtk.vtkOrientedGlyphContourRepresentation() contourWidget = vtk.vtkContourWidget() contourWidget.SetInteractor(obj) contourWidget.SetRepresentation(contourRep) contourWidget.On() #contourWidget.SetEnabled() obj.Start() return main() It almost works fine this way, the problem is that, when I want to close the application window, I have to click the button to close the window many times. And I have to click one time for each vtkContourWidget created. It seems that each time I call the function keyPressEvent and create a vtkContourWidget, the obj.Start() (that is the same of Interactor.Start()) line instantiates kind of another instance of the application? I've also tried contourWidget.SetEnabled() (with obj.Start() commented out), and it works to create new instances of vtkContourWidget, but when I try to close the app window, the app freezes. With both obj.Start() and contourWidget.SetEnabled() on the code, I can create many instances, but each time I create a new instance, the previous one disappears. I think this topic here ( https://www.vtk.org/pipermail/vtk-developers/2008-April/020587.html) may have the solution, but I don't know how to implement it. I've posted the same question here: https://stackoverflow.com/questions/52032441/how-to-create-many-instances-of-vtkcontourwidget Thanks in advance, Marcos Saito de Paula S?o Paulo - SP, Brazil -------------- next part -------------- An HTML attachment was scrubbed... URL: