From lorenzo.cesario at softeco.it Tue Jul 1 04:52:58 2014 From: lorenzo.cesario at softeco.it (lorenzo.cesario at softeco.it) Date: Tue, 1 Jul 2014 10:52:58 +0200 Subject: [vtkusers] Migration problem vtk 5.8 - vtk 6.1 Message-ID: <6E9F1E5019D94267897964726438712A.MAI@softeco.it> Hi, my application has an executable and some dlls. Among them, there is one dll that used vtk 5.8 and now I'm doing the migration to the vtk 6.1. I'm using Visual Studio 2010 and my appliation is MFC-based. In the properties of the dll using vtk, I obviously included the "Additional Include Directories" and "Additional Library" for the vtk header files and .lib files. Moreover I added in the "Preprocessor definition" field of the C/C++ Property of the same dll, this value: vtkRenderingCore_INCLUDE="InitVtkObjFactory.h" and I added the file InitVtkObjFactory.h with this code: #include VTK_MODULE_INIT(vtkRenderingOpenGL); VTK_MODULE_INIT(vtkInteractionStyle); VTK_MODULE_INIT(vtkRenderingFreeType); VTK_MODULE_INIT(vtkRenderingFreeTypeOpenGL); When I close the application it crashes and in the call stack there is the last call on vtkCommonCore-6.1.dll. Then, I removed the line inside the file InitVtkObjFactory.h related to the InteractionStyle as follows: #include VTK_MODULE_INIT(vtkRenderingOpenGL); VTK_MODULE_INIT(vtkRenderingFreeType); VTK_MODULE_INIT(vtkRenderingFreeTypeOpenGL); and in this case, when the application starts, it shows a "warning" window from vtk in which is written: Warning: In ..\..\..\..\..\src\Vtk\Rendering\Core\vtkInteractorStyleSwitchBase.cxx, line 43 vtkInteractorStyleSwitchBase (07EC7FB8): Warning: Link to vtkInteractionStyle for default style selection. but when I close the application, this time it has no error or crashes. I'm using a vtkInteractorStyleTrackballCamera for my RenderWindow. Any ideas? Is there anything wrong in the migration related to the new modules initialization? Tks, Lorenzo From cjayjones at gmail.com Tue Jul 1 08:19:24 2014 From: cjayjones at gmail.com (Cory Jones) Date: Tue, 1 Jul 2014 06:19:24 -0600 Subject: [vtkusers] Volume Rendering with Voxel Specific Color In-Reply-To: References: Message-ID: The opacity function in the previous email is the only one I am creating. Is there an error in that code then? Thanks. On Mon, Jun 30, 2014 at 8:09 PM, Lisa Avila wrote: > Cory, > > Note that if you are using non-independent components, you'd only use the > first scalar opacity function, not the fourth. That is, there is only one > scalar opacity function (because there is only one channel being used to > control opacity - it just happens to be either the 2nd or the 4th component > depending on whether you are rendering IA or RGBA data). So likely your > issue now is that you are using whatever default opacity function is > created for you if you try to render without one already created. :-) > > Lisa > > > > On Mon, Jun 30, 2014 at 4:08 PM, Cory Jones wrote: > >> Thank you for the feedback. That fixed the color problem. I am not sure I >> understand the use of component 4 though. I am trying to use it to set the >> opacity of the volume using the volume property SetScalarOpacity with a >> vtkPiecewiseFunction. The code I am using is: >> >> vtkSmartPointer compositeOpacity = >> vtkSmartPointer::New(); >> compositeOpacity->AddPoint(0.0,0.0); >> compositeOpacity->AddPoint(1.0,0.25); >> compositeOpacity->AddPoint(255.0,0.25); >> volumeProperty->SetScalarOpacity(3,compositeOpacity); >> >> I set the portions of the volume I want to have not visible to 0 on the >> fourth channel of the volume (component 3) and then am trying to set the >> opacity to 0 for those positions using the code above. I am not getting a >> change in the opacity using this. Is there another way to accomplish this, >> or have I just made an error in the above? >> >> Thanks. >> >> >> On Thu, Jun 26, 2014 at 12:42 PM, Lisa Avila >> wrote: >> >>> Hello Cory, >>> >>> In the volume property you'll need to indicate that you don't have >>> independent components. That is, by default this is set to true and >>> therefore VTK assumes you are representing separate properties which each >>> of the scalar components (for example pressure and density). In that case, >>> each scalar is passed through its own lookup tables for color and opacity >>> and the resulting values are merged based on the weightings of the >>> components. >>> >>> VTK also supports IA (intensity / alpha) and RGBA data. This must be 2 >>> or 4 component unsigned char data. Once you set it so that your components >>> are not independent, the last component will be considered a scalar lookup >>> into your opacity transfer function, and the first one or three components >>> will be used to represent your color. In the case of 2 component data (IA), >>> that first component will be passed through the color transfer function. In >>> the case of 4 component data (RGBA) those first three components will be >>> directly considered the RGB color of that voxel. >>> >>> Note that if you have 3 component RGB data you'll need to do something >>> to create a 4th component (otherwise you have no concept of alpha and you >>> just have a solid block of color). Typical methods of generating that >>> fourth component include assigning it to be the hue or intensity of the RGB >>> value. For example, with the visible human data we usually assign the >>> fourth component to be hue since the body was encased in a blue gel (we can >>> then set the opacity of the blue hue to be zero, thereby seeing the human >>> inside the cube). >>> >>> Hope this helps. >>> >>> Lisa >>> >>> >>> >>> On Wed, Jun 25, 2014 at 1:49 PM, Cory Jones wrote: >>> >>>> I am trying to render a volume from 3D ImageData and I want to be able >>>> to control the color of each voxel independently using the color channels. >>>> I am able to set the number of scalar components in my ImageData to 3 and >>>> set each channel separately. I am rendering using vtkSmartVolumeMapper. Is >>>> there a way to set the vtkVolumeProperty so that the image renders the 3 >>>> channels as RGB? I have tried using the vtkColorTransferFunction >>>> SetColorSpaceToRGB(), but this does not work. Again, I don't want to do >>>> scalar color mapping. My current code is: >>>> >>>> >>>> vtkSmartPointer volumeMapper = >>>> vtkSmartPointer::New(); >>>> volumeMapper->SetBlendModeToComposite(); >>>> volumeMapper->SetInputConnection(outputImageData->GetProducerPort()); >>>> >>>> vtkSmartPointer volumeProperty = >>>> vtkSmartPointer::New(); >>>> volumeProperty->ShadeOff(); >>>> volumeProperty->SetInterpolationType(VTK_LINEAR_INTERPOLATION); >>>> >>>> vtkSmartPointer color = >>>> vtkSmartPointer::New(); >>>> color->SetColorSpaceToRGB(); >>>> volumeProperty->SetColor(color); >>>> >>>> vtkSmartPointer volume = >>>> vtkSmartPointer::New(); >>>> volume->SetMapper(volumeMapper); >>>> volume->SetProperty(volumeProperty); >>>> >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ at: >>>> http://www.vtk.org/Wiki/VTK_FAQ >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://public.kitware.com/mailman/listinfo/vtkusers >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cjayjones at gmail.com Tue Jul 1 08:41:23 2014 From: cjayjones at gmail.com (Cory Jones) Date: Tue, 1 Jul 2014 06:41:23 -0600 Subject: [vtkusers] Volume Rendering with Voxel Specific Color In-Reply-To: References: Message-ID: Also, I forgot to mention this, but if my code is modified to remove the component on the opacity function so that it is: vtkSmartPointer compositeOpacity = vtkSmartPointer::New(); compositeOpacity->AddPoint(0.0,0.0); compositeOpacity->AddPoint(1.0,1.0); compositeOpacity->AddPoint(255.0,1.0); volumeProperty->SetScalarOpacity(compositeOpacity); Then the entire volume becomes not visible. On Tue, Jul 1, 2014 at 6:19 AM, Cory Jones wrote: > The opacity function in the previous email is the only one I am creating. > Is there an error in that code then? > > Thanks. > > > On Mon, Jun 30, 2014 at 8:09 PM, Lisa Avila > wrote: > >> Cory, >> >> Note that if you are using non-independent components, you'd only use the >> first scalar opacity function, not the fourth. That is, there is only one >> scalar opacity function (because there is only one channel being used to >> control opacity - it just happens to be either the 2nd or the 4th component >> depending on whether you are rendering IA or RGBA data). So likely your >> issue now is that you are using whatever default opacity function is >> created for you if you try to render without one already created. :-) >> >> Lisa >> >> >> >> On Mon, Jun 30, 2014 at 4:08 PM, Cory Jones wrote: >> >>> Thank you for the feedback. That fixed the color problem. I am not sure >>> I understand the use of component 4 though. I am trying to use it to set >>> the opacity of the volume using the volume property SetScalarOpacity with a >>> vtkPiecewiseFunction. The code I am using is: >>> >>> vtkSmartPointer compositeOpacity = >>> vtkSmartPointer::New(); >>> compositeOpacity->AddPoint(0.0,0.0); >>> compositeOpacity->AddPoint(1.0,0.25); >>> compositeOpacity->AddPoint(255.0,0.25); >>> volumeProperty->SetScalarOpacity(3,compositeOpacity); >>> >>> I set the portions of the volume I want to have not visible to 0 on the >>> fourth channel of the volume (component 3) and then am trying to set the >>> opacity to 0 for those positions using the code above. I am not getting a >>> change in the opacity using this. Is there another way to accomplish this, >>> or have I just made an error in the above? >>> >>> Thanks. >>> >>> >>> On Thu, Jun 26, 2014 at 12:42 PM, Lisa Avila >>> wrote: >>> >>>> Hello Cory, >>>> >>>> In the volume property you'll need to indicate that you don't have >>>> independent components. That is, by default this is set to true and >>>> therefore VTK assumes you are representing separate properties which each >>>> of the scalar components (for example pressure and density). In that case, >>>> each scalar is passed through its own lookup tables for color and opacity >>>> and the resulting values are merged based on the weightings of the >>>> components. >>>> >>>> VTK also supports IA (intensity / alpha) and RGBA data. This must be 2 >>>> or 4 component unsigned char data. Once you set it so that your components >>>> are not independent, the last component will be considered a scalar lookup >>>> into your opacity transfer function, and the first one or three components >>>> will be used to represent your color. In the case of 2 component data (IA), >>>> that first component will be passed through the color transfer function. In >>>> the case of 4 component data (RGBA) those first three components will be >>>> directly considered the RGB color of that voxel. >>>> >>>> Note that if you have 3 component RGB data you'll need to do something >>>> to create a 4th component (otherwise you have no concept of alpha and you >>>> just have a solid block of color). Typical methods of generating that >>>> fourth component include assigning it to be the hue or intensity of the RGB >>>> value. For example, with the visible human data we usually assign the >>>> fourth component to be hue since the body was encased in a blue gel (we can >>>> then set the opacity of the blue hue to be zero, thereby seeing the human >>>> inside the cube). >>>> >>>> Hope this helps. >>>> >>>> Lisa >>>> >>>> >>>> >>>> On Wed, Jun 25, 2014 at 1:49 PM, Cory Jones >>>> wrote: >>>> >>>>> I am trying to render a volume from 3D ImageData and I want to be able >>>>> to control the color of each voxel independently using the color channels. >>>>> I am able to set the number of scalar components in my ImageData to 3 and >>>>> set each channel separately. I am rendering using vtkSmartVolumeMapper. Is >>>>> there a way to set the vtkVolumeProperty so that the image renders the 3 >>>>> channels as RGB? I have tried using the vtkColorTransferFunction >>>>> SetColorSpaceToRGB(), but this does not work. Again, I don't want to do >>>>> scalar color mapping. My current code is: >>>>> >>>>> >>>>> vtkSmartPointer volumeMapper = >>>>> vtkSmartPointer::New(); >>>>> volumeMapper->SetBlendModeToComposite(); >>>>> volumeMapper->SetInputConnection(outputImageData->GetProducerPort()); >>>>> >>>>> vtkSmartPointer volumeProperty = >>>>> vtkSmartPointer::New(); >>>>> volumeProperty->ShadeOff(); >>>>> volumeProperty->SetInterpolationType(VTK_LINEAR_INTERPOLATION); >>>>> >>>>> vtkSmartPointer color = >>>>> vtkSmartPointer::New(); >>>>> color->SetColorSpaceToRGB(); >>>>> volumeProperty->SetColor(color); >>>>> >>>>> vtkSmartPointer volume = >>>>> vtkSmartPointer::New(); >>>>> volume->SetMapper(volumeMapper); >>>>> volume->SetProperty(volumeProperty); >>>>> >>>>> _______________________________________________ >>>>> Powered by www.kitware.com >>>>> >>>>> Visit other Kitware open-source projects at >>>>> http://www.kitware.com/opensource/opensource.html >>>>> >>>>> Please keep messages on-topic and check the VTK FAQ at: >>>>> http://www.vtk.org/Wiki/VTK_FAQ >>>>> >>>>> Follow this link to subscribe/unsubscribe: >>>>> http://public.kitware.com/mailman/listinfo/vtkusers >>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From drescherjm at gmail.com Tue Jul 1 09:16:17 2014 From: drescherjm at gmail.com (John Drescher) Date: Tue, 1 Jul 2014 09:16:17 -0400 Subject: [vtkusers] Migration problem vtk 5.8 - vtk 6.1 In-Reply-To: <6E9F1E5019D94267897964726438712A.MAI@softeco.it> References: <6E9F1E5019D94267897964726438712A.MAI@softeco.it> Message-ID: On Tue, Jul 1, 2014 at 4:52 AM, wrote: > Hi, > my application has an executable and some dlls. Among them, there is one dll that used vtk 5.8 and now I'm doing the migration to the vtk 6.1. > I'm using Visual Studio 2010 and my appliation is MFC-based. > > In the properties of the dll using vtk, I obviously included the "Additional Include Directories" and "Additional Library" for the vtk header files and .lib files. > Moreover I added in the "Preprocessor definition" field of the C/C++ Property of the same dll, this value: vtkRenderingCore_INCLUDE="InitVtkObjFactory.h" and I added the file InitVtkObjFactory.h with this code: > > #include > VTK_MODULE_INIT(vtkRenderingOpenGL); > VTK_MODULE_INIT(vtkInteractionStyle); > VTK_MODULE_INIT(vtkRenderingFreeType); > VTK_MODULE_INIT(vtkRenderingFreeTypeOpenGL); > > When I close the application it crashes and in the call stack there is the last call on vtkCommonCore-6.1.dll. > > Then, I removed the line inside the file InitVtkObjFactory.h related to the InteractionStyle as follows: > > #include > VTK_MODULE_INIT(vtkRenderingOpenGL); > VTK_MODULE_INIT(vtkRenderingFreeType); > VTK_MODULE_INIT(vtkRenderingFreeTypeOpenGL); > > and in this case, when the application starts, it shows a "warning" window from vtk in which is written: > > Warning: In ..\..\..\..\..\src\Vtk\Rendering\Core\vtkInteractorStyleSwitchBase.cxx, line 43 > vtkInteractorStyleSwitchBase (07EC7FB8): Warning: Link to vtkInteractionStyle for default style selection. > > but when I close the application, this time it has no error or crashes. I'm using a vtkInteractorStyleTrackballCamera for my RenderWindow. > > Any ideas? Is there anything wrong in the migration related to the new modules initialization? > I see you are using vtk dlls. Were they built from the same compiler as you use and the same configuration. You can't safely mix compilers or use Releaase dlls in a debug application or debug dlls in a release application. John From dina.youakim at gmail.com Tue Jul 1 09:23:04 2014 From: dina.youakim at gmail.com (Dina Youakim) Date: Tue, 1 Jul 2014 15:23:04 +0200 Subject: [vtkusers] Extract pixel values inside a contour Message-ID: Hello all, I have been working with border widget and I was able using the borderrepresentation to extract the lower left and upper right points and this was able to loop in the points covering the rectangle and extract their pixel value using vtkImageData. Now I have a contour widget where the user will pick an area ( can be a circle or not) in a 2D slice, and I need to extract the pixel values of pixels inside the contour. Any idea how to do it ? so far I was able to extract the contour points but I don't know how to loop on these points to get pixel values inside the contour points. Thanks, Dina. From lorenzo.cesario at softeco.it Tue Jul 1 09:39:24 2014 From: lorenzo.cesario at softeco.it (Lorenzo Cesario) Date: Tue, 1 Jul 2014 15:39:24 +0200 Subject: [vtkusers] Migration problem vtk 5.8 - vtk 6.1 In-Reply-To: References: <6E9F1E5019D94267897964726438712A.MAI@softeco.it> Message-ID: <53B7EB81ED15461A9DDFECC654231110@PClorenzo> Hi John, tks for your answer. Yes I used the same compiler (VS2010) and I compiled vtk libraries as dlls. Of course I included debug compiled vtk dlls in my application (debug mode) and release compiled vtk dlls in my release application. It seems like it has problem to cleaning up the vtkInteractionStyleObjectFactory during the method "UnregisterAllFactories()" of the class "vtkCleanupObjectFactory". Why it has this problem with the vtkInteractionStyle module? Any ideas? Tks, Lorenzo ----- Original Message ----- From: "John Drescher" To: Cc: Sent: Tuesday, July 01, 2014 3:16 PM Subject: Re: [vtkusers] Migration problem vtk 5.8 - vtk 6.1 > On Tue, Jul 1, 2014 at 4:52 AM, wrote: >> Hi, >> my application has an executable and some dlls. Among them, there is one >> dll that used vtk 5.8 and now I'm doing the migration to the vtk 6.1. >> I'm using Visual Studio 2010 and my appliation is MFC-based. >> >> In the properties of the dll using vtk, I obviously included the >> "Additional Include Directories" and "Additional Library" for the vtk >> header files and .lib files. >> Moreover I added in the "Preprocessor definition" field of the C/C++ >> Property of the same dll, this value: >> vtkRenderingCore_INCLUDE="InitVtkObjFactory.h" and I added the file >> InitVtkObjFactory.h with this code: >> >> #include >> VTK_MODULE_INIT(vtkRenderingOpenGL); >> VTK_MODULE_INIT(vtkInteractionStyle); >> VTK_MODULE_INIT(vtkRenderingFreeType); >> VTK_MODULE_INIT(vtkRenderingFreeTypeOpenGL); >> >> When I close the application it crashes and in the call stack there is >> the last call on vtkCommonCore-6.1.dll. >> >> Then, I removed the line inside the file InitVtkObjFactory.h related to >> the InteractionStyle as follows: >> >> #include >> VTK_MODULE_INIT(vtkRenderingOpenGL); >> VTK_MODULE_INIT(vtkRenderingFreeType); >> VTK_MODULE_INIT(vtkRenderingFreeTypeOpenGL); >> >> and in this case, when the application starts, it shows a "warning" >> window from vtk in which is written: >> >> Warning: In >> ..\..\..\..\..\src\Vtk\Rendering\Core\vtkInteractorStyleSwitchBase.cxx, >> line 43 >> vtkInteractorStyleSwitchBase (07EC7FB8): Warning: Link to >> vtkInteractionStyle for default style selection. >> >> but when I close the application, this time it has no error or crashes. >> I'm using a vtkInteractorStyleTrackballCamera for my RenderWindow. >> >> Any ideas? Is there anything wrong in the migration related to the new >> modules initialization? >> > > I see you are using vtk dlls. Were they built from the same compiler > as you use and the same configuration. You can't safely mix compilers > or use Releaase dlls in a debug application or debug dlls in a release > application. > > John > > From dave.demarle at kitware.com Tue Jul 1 10:48:59 2014 From: dave.demarle at kitware.com (David E DeMarle) Date: Tue, 1 Jul 2014 10:48:59 -0400 Subject: [vtkusers] Regaring installation of vtk-BGL in parallel mode. In-Reply-To: <1404171862566.2025@uwyo.edu> References: <1404171862566.2025@uwyo.edu> Message-ID: I would either: 1) turn off the optional InfovisParallel module. - it has seen little use in the last couple of years and hasn't been kept up to date. This it is marked for deprecation now and will be removed after the next release. 2) go back to boost 1_48 - I had that working on a vtk dashboard a year or so back David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Mon, Jun 30, 2014 at 7:44 PM, Masakazu Gesho wrote: > Dear: > > > I am trying to build VTK-BGL on my computer. > > Currently, I am using VTK 6.2 and Boost Graph Library 1-55-0 with > Boost-mpi. > > > I could build cmake, however, when I "make" there is linking errors. > > i.e: > > /usr/local/include/boost/graph/distributed/breadth_first_search.hpp:111:7: > error: ?struct boost::detail::error_property_not_found? has no member named > ?ref? > > > I wonder if I have to use certain version of boost-graph library to use > vtk. > > If so can you let me know which version of BGL is required? > > > Thank you for your help. > > > Masakazu Gesho > University of Wyoming > PhD Petroleum & Chemical Engineering > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcus.hanwell at kitware.com Tue Jul 1 13:52:41 2014 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Tue, 1 Jul 2014 13:52:41 -0400 Subject: [vtkusers] Migration problem vtk 5.8 - vtk 6.1 In-Reply-To: <6E9F1E5019D94267897964726438712A.MAI@softeco.it> References: <6E9F1E5019D94267897964726438712A.MAI@softeco.it> Message-ID: On Tue, Jul 1, 2014 at 4:52 AM, wrote: > Hi, > my application has an executable and some dlls. Among them, there is one dll that used vtk 5.8 and now I'm doing the migration to the vtk 6.1. > I'm using Visual Studio 2010 and my appliation is MFC-based. > > In the properties of the dll using vtk, I obviously included the "Additional Include Directories" and "Additional Library" for the vtk header files and .lib files. > Moreover I added in the "Preprocessor definition" field of the C/C++ Property of the same dll, this value: vtkRenderingCore_INCLUDE="InitVtkObjFactory.h" and I added the file InitVtkObjFactory.h with this code: > > #include > VTK_MODULE_INIT(vtkRenderingOpenGL); > VTK_MODULE_INIT(vtkInteractionStyle); > VTK_MODULE_INIT(vtkRenderingFreeType); > VTK_MODULE_INIT(vtkRenderingFreeTypeOpenGL); > > When I close the application it crashes and in the call stack there is the last call on vtkCommonCore-6.1.dll. I have never tested the code in a scenario like this, although nothing jumps out as an issue. Do you have header guards around this init header to ensure it is just called once? It should be safe to call many times, but it is possible something odd is happening there. > > Then, I removed the line inside the file InitVtkObjFactory.h related to the InteractionStyle as follows: > > #include > VTK_MODULE_INIT(vtkRenderingOpenGL); > VTK_MODULE_INIT(vtkRenderingFreeType); > VTK_MODULE_INIT(vtkRenderingFreeTypeOpenGL); > > and in this case, when the application starts, it shows a "warning" window from vtk in which is written: > > Warning: In ..\..\..\..\..\src\Vtk\Rendering\Core\vtkInteractorStyleSwitchBase.cxx, line 43 > vtkInteractorStyleSwitchBase (07EC7FB8): Warning: Link to vtkInteractionStyle for default style selection. This is there to warn that no default interaction style will be used, many old applications relied upon this being present and we wanted a warning. It is just a warning, but it could be quite frustrating to track down. It is unlikely to cause other side effects if you chose to ignore it, but there is no way of silencing the warning. > > but when I close the application, this time it has no error or crashes. I'm using a vtkInteractorStyleTrackballCamera for my RenderWindow. If you set a style then all will work as expected. This looks like a bug in the factory destruction, but I have not seen this in my testing (I have also not built any VTK-based applications without using CMake). > > Any ideas? Is there anything wrong in the migration related to the new modules initialization? > It is odd that it would break on such a simple module, with only a single override. If you select a style you do not need that override, but it would be nice to figure out what is going wrong here. I am not aware of similar issues, do you have any more information on how/why it is crashing? Is the object factory NULL for example? Thanks, Marcus From dbpvusrlist at hotmail.co.uk Tue Jul 1 15:33:31 2014 From: dbpvusrlist at hotmail.co.uk (Dan) Date: Tue, 1 Jul 2014 19:33:31 +0000 Subject: [vtkusers] CMake/Linking Issues VTK 6.1.0 Message-ID: Hi All, I have been using VTK (version 5) for some time. I downloaded and built the source as detailed on the website, and then I was able to link to the libraries and include the header files manually as I usually do for third party libraries. Everything worked fine. I'm now on a new system so I downloaded, configured and built VTK 6.1.0. It built fine and I installed it to the specified directory. However, I then found it impossible to manually link my VS project to the libraries. To get around this I tried using CMake to generate a Visual Studio project but nothing I try seems to work. A number of permutations each seem to give different errors, either include errors or linking errors. Some won't even configure with CMake! Could someone please explain, in clear steps how one goes about building and linking to VTK? Thanks very much, Dan (I'm not a novice but after three days trying to sort this out I'm out of ideas!) -------------- next part -------------- An HTML attachment was scrubbed... URL: From christopher.mullins at kitware.com Tue Jul 1 15:43:36 2014 From: christopher.mullins at kitware.com (Christopher Mullins) Date: Tue, 1 Jul 2014 15:43:36 -0400 Subject: [vtkusers] CMake/Linking Issues VTK 6.1.0 In-Reply-To: References: Message-ID: Have you checked out the wiki page for configuring and building [1] ? It was written for VTK 6.1.0. Could you post which step you're trying to accomplish, and the errors you receive? I think this will help us diagnose what's happening. [1] http://www.vtk.org/Wiki/VTK/Configure_and_Build On Tue, Jul 1, 2014 at 3:33 PM, Dan wrote: > Hi All, > > I have been using VTK (version 5) for some time. I downloaded and built > the source as detailed on the website, and then I was able to link to the > libraries and include the header files manually as I usually do for third > party libraries. Everything worked fine. > > I'm now on a new system so I downloaded, configured and built VTK 6.1.0. > It built fine and I installed it to the specified directory. However, I > then found it impossible to manually link my VS project to the libraries. > To get around this I tried using CMake to generate a Visual Studio project > but nothing I try seems to work. A number of permutations each seem to give > different errors, either include errors or linking errors. Some won't even > configure with CMake! > > Could someone please explain, in clear steps how one goes about building > and linking to VTK? > > Thanks very much, > Dan > > (I'm not a novice but after three days trying to sort this out I'm out of > ideas!) > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -- Christopher Mullins R&D Engineer Kitware Inc., 919.869.8871 -------------- next part -------------- An HTML attachment was scrubbed... URL: From christopher.mullins at kitware.com Tue Jul 1 15:59:59 2014 From: christopher.mullins at kitware.com (Christopher Mullins) Date: Tue, 1 Jul 2014 15:59:59 -0400 Subject: [vtkusers] CMake/Linking Issues VTK 6.1.0 In-Reply-To: References: Message-ID: > > Also, even though I specified my VTK_DIR in the CMake it keeps showing the > wrong directory in the CMake GUI and even if I change it, it swaps back > when I click on configure. I suspect this is causing the problem. Could you take it out of the CMakeLists.txt file and just provide it at configure time via cmake-gui? On Tue, Jul 1, 2014 at 3:56 PM, Dan wrote: > Hi Christopher, > > Yes I have seen and read that page. The problem I am having is not > building VTK itself, rather, building my own application which uses VTK. I > have cobbled together a CMake file from scouring the VTK documentation / > Google. It reads > > cmake_minimum_required(VERSION 2.8.7) > project(Test) > set(VTK_DIR "C:/VTK-6.1.0/install") > find_package(VTK 6.1 REQUIRED NO_MODULE) > if(VTK_FOUND) > message("found VTK. Version:" ${VTK_VERSION}. VTK_DIR: ${VTK_DIR}) > endif() > include(${VTK_USE_FILE}) > add_executable(Test test.cpp) > target_link_libraries(Test ${VTK_LIBRARIES}) > > > It configures fine and generates a Visual Studio solution I can open, but > when I try and build this it throws a linker error saying > > "cannot open input file 'vtkalglib.lib'" > > Interesting to note is that in my install folder (specified while building > VTK) there is a .lib called 'vtkalglib-6.1.lib' but no 'vtkalglib.lib'. > Also, even though I specified my VTK_DIR in the CMake it keeps showing the > wrong directory in the CMake GUI and even if I change it, it swaps back > when I click on configure. > > Regards, > Dan > > > ------------------------------ > Date: Tue, 1 Jul 2014 15:43:36 -0400 > Subject: Re: [vtkusers] CMake/Linking Issues VTK 6.1.0 > From: christopher.mullins at kitware.com > To: dbpvusrlist at hotmail.co.uk > CC: vtkusers at vtk.org > > > Have you checked out the wiki page for configuring and building [1] ? It > was written for VTK 6.1.0. > > Could you post which step you're trying to accomplish, and the errors you > receive? I think this will help us diagnose what's happening. > > > [1] http://www.vtk.org/Wiki/VTK/Configure_and_Build > > > On Tue, Jul 1, 2014 at 3:33 PM, Dan wrote: > > Hi All, > > I have been using VTK (version 5) for some time. I downloaded and built > the source as detailed on the website, and then I was able to link to the > libraries and include the header files manually as I usually do for third > party libraries. Everything worked fine. > > I'm now on a new system so I downloaded, configured and built VTK 6.1.0. > It built fine and I installed it to the specified directory. However, I > then found it impossible to manually link my VS project to the libraries. > To get around this I tried using CMake to generate a Visual Studio project > but nothing I try seems to work. A number of permutations each seem to give > different errors, either include errors or linking errors. Some won't even > configure with CMake! > > Could someone please explain, in clear steps how one goes about building > and linking to VTK? > > Thanks very much, > Dan > > (I'm not a novice but after three days trying to sort this out I'm out of > ideas!) > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > > > > -- > Christopher Mullins > R&D Engineer > Kitware Inc., > 919.869.8871 > -- Christopher Mullins R&D Engineer Kitware Inc., 919.869.8871 -------------- next part -------------- An HTML attachment was scrubbed... URL: From dbpvusrlist at hotmail.co.uk Tue Jul 1 15:56:32 2014 From: dbpvusrlist at hotmail.co.uk (Dan) Date: Tue, 1 Jul 2014 19:56:32 +0000 Subject: [vtkusers] CMake/Linking Issues VTK 6.1.0 In-Reply-To: References: , Message-ID: Hi Christopher, Yes I have seen and read that page. The problem I am having is not building VTK itself, rather, building my own application which uses VTK. I have cobbled together a CMake file from scouring the VTK documentation / Google. It reads cmake_minimum_required(VERSION 2.8.7) project(Test) set(VTK_DIR "C:/VTK-6.1.0/install") find_package(VTK 6.1 REQUIRED NO_MODULE) if(VTK_FOUND) message("found VTK. Version:" ${VTK_VERSION}. VTK_DIR: ${VTK_DIR}) endif() include(${VTK_USE_FILE}) add_executable(Test test.cpp) target_link_libraries(Test ${VTK_LIBRARIES}) It configures fine and generates a Visual Studio solution I can open, but when I try and build this it throws a linker error saying "cannot open input file 'vtkalglib.lib'" Interesting to note is that in my install folder (specified while building VTK) there is a .lib called 'vtkalglib-6.1.lib' but no 'vtkalglib.lib'. Also, even though I specified my VTK_DIR in the CMake it keeps showing the wrong directory in the CMake GUI and even if I change it, it swaps back when I click on configure. Regards, Dan Date: Tue, 1 Jul 2014 15:43:36 -0400 Subject: Re: [vtkusers] CMake/Linking Issues VTK 6.1.0 From: christopher.mullins at kitware.com To: dbpvusrlist at hotmail.co.uk CC: vtkusers at vtk.org Have you checked out the wiki page for configuring and building [1] ? It was written for VTK 6.1.0. Could you post which step you're trying to accomplish, and the errors you receive? I think this will help us diagnose what's happening. [1] http://www.vtk.org/Wiki/VTK/Configure_and_Build On Tue, Jul 1, 2014 at 3:33 PM, Dan wrote: Hi All, I have been using VTK (version 5) for some time. I downloaded and built the source as detailed on the website, and then I was able to link to the libraries and include the header files manually as I usually do for third party libraries. Everything worked fine. I'm now on a new system so I downloaded, configured and built VTK 6.1.0. It built fine and I installed it to the specified directory. However, I then found it impossible to manually link my VS project to the libraries. To get around this I tried using CMake to generate a Visual Studio project but nothing I try seems to work. A number of permutations each seem to give different errors, either include errors or linking errors. Some won't even configure with CMake! Could someone please explain, in clear steps how one goes about building and linking to VTK? Thanks very much, Dan (I'm not a novice but after three days trying to sort this out I'm out of ideas!) _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -- Christopher MullinsR&D EngineerKitware Inc.,919.869.8871 -------------- next part -------------- An HTML attachment was scrubbed... URL: From dbpvusrlist at hotmail.co.uk Tue Jul 1 16:16:12 2014 From: dbpvusrlist at hotmail.co.uk (Dan) Date: Tue, 1 Jul 2014 20:16:12 +0000 Subject: [vtkusers] CMake/Linking Issues VTK 6.1.0 In-Reply-To: References: , , , Message-ID: Hmm, just tried removing it. It doesn't make a difference. If I type the correct install directory into the GUI it just resets when I press 'configure'. If I type it an they just click 'generate' it still gives the error about 'vtkalglib.lib'. Dan Date: Tue, 1 Jul 2014 15:59:59 -0400 Subject: Re: [vtkusers] CMake/Linking Issues VTK 6.1.0 From: christopher.mullins at kitware.com To: dbpvusrlist at hotmail.co.uk CC: vtkusers at vtk.org Also, even though I specified my VTK_DIR in the CMake it keeps showing the wrong directory in the CMake GUI and even if I change it, it swaps back when I click on configure. I suspect this is causing the problem. Could you take it out of the CMakeLists.txt file and just provide it at configure time via cmake-gui? On Tue, Jul 1, 2014 at 3:56 PM, Dan wrote: Hi Christopher, Yes I have seen and read that page. The problem I am having is not building VTK itself, rather, building my own application which uses VTK. I have cobbled together a CMake file from scouring the VTK documentation / Google. It reads cmake_minimum_required(VERSION 2.8.7) project(Test) set(VTK_DIR "C:/VTK-6.1.0/install") find_package(VTK 6.1 REQUIRED NO_MODULE) if(VTK_FOUND) message("found VTK. Version:" ${VTK_VERSION}. VTK_DIR: ${VTK_DIR}) endif() include(${VTK_USE_FILE}) add_executable(Test test.cpp) target_link_libraries(Test ${VTK_LIBRARIES}) It configures fine and generates a Visual Studio solution I can open, but when I try and build this it throws a linker error saying "cannot open input file 'vtkalglib.lib'" Interesting to note is that in my install folder (specified while building VTK) there is a .lib called 'vtkalglib-6.1.lib' but no 'vtkalglib.lib'. Also, even though I specified my VTK_DIR in the CMake it keeps showing the wrong directory in the CMake GUI and even if I change it, it swaps back when I click on configure. Regards, Dan Date: Tue, 1 Jul 2014 15:43:36 -0400 Subject: Re: [vtkusers] CMake/Linking Issues VTK 6.1.0 From: christopher.mullins at kitware.com To: dbpvusrlist at hotmail.co.uk CC: vtkusers at vtk.org Have you checked out the wiki page for configuring and building [1] ? It was written for VTK 6.1.0. Could you post which step you're trying to accomplish, and the errors you receive? I think this will help us diagnose what's happening. [1] http://www.vtk.org/Wiki/VTK/Configure_and_Build On Tue, Jul 1, 2014 at 3:33 PM, Dan wrote: Hi All, I have been using VTK (version 5) for some time. I downloaded and built the source as detailed on the website, and then I was able to link to the libraries and include the header files manually as I usually do for third party libraries. Everything worked fine. I'm now on a new system so I downloaded, configured and built VTK 6.1.0. It built fine and I installed it to the specified directory. However, I then found it impossible to manually link my VS project to the libraries. To get around this I tried using CMake to generate a Visual Studio project but nothing I try seems to work. A number of permutations each seem to give different errors, either include errors or linking errors. Some won't even configure with CMake! Could someone please explain, in clear steps how one goes about building and linking to VTK? Thanks very much, Dan (I'm not a novice but after three days trying to sort this out I'm out of ideas!) _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -- Christopher MullinsR&D EngineerKitware Inc.,919.869.8871 -- Christopher MullinsR&D EngineerKitware Inc.,919.869.8871 -------------- next part -------------- An HTML attachment was scrubbed... URL: From christopher.mullins at kitware.com Tue Jul 1 16:22:05 2014 From: christopher.mullins at kitware.com (Christopher Mullins) Date: Tue, 1 Jul 2014 16:22:05 -0400 Subject: [vtkusers] CMake/Linking Issues VTK 6.1.0 In-Reply-To: References: Message-ID: Interesting. Are you able to build any of the VTK examples [1] against your current install? Also, have you tried with a clean build tree of your application? It sounds like something is getting cached when it shouldn't be. It might help if I could have a look at your CMakeCache.txt, or if you could take a screenshot of your cmake-gui before the "configure" step. [1] http://www.vtk.org/Wiki/VTK/Examples/Cxx On Tue, Jul 1, 2014 at 4:16 PM, Dan wrote: > Hmm, just tried removing it. It doesn't make a difference. If I type the > correct install directory into the GUI it just resets when I press > 'configure'. If I type it an they just click 'generate' it still gives the > error about 'vtkalglib.lib'. > > Dan > > ------------------------------ > Date: Tue, 1 Jul 2014 15:59:59 -0400 > > Subject: Re: [vtkusers] CMake/Linking Issues VTK 6.1.0 > From: christopher.mullins at kitware.com > To: dbpvusrlist at hotmail.co.uk > CC: vtkusers at vtk.org > > Also, even though I specified my VTK_DIR in the CMake it keeps showing the > wrong directory in the CMake GUI and even if I change it, it swaps back > when I click on configure. > > > I suspect this is causing the problem. Could you take it out of the > CMakeLists.txt file and just provide it at configure time via cmake-gui? > > > On Tue, Jul 1, 2014 at 3:56 PM, Dan wrote: > > Hi Christopher, > > Yes I have seen and read that page. The problem I am having is not > building VTK itself, rather, building my own application which uses VTK. I > have cobbled together a CMake file from scouring the VTK documentation / > Google. It reads > > cmake_minimum_required(VERSION 2.8.7) > project(Test) > set(VTK_DIR "C:/VTK-6.1.0/install") > find_package(VTK 6.1 REQUIRED NO_MODULE) > if(VTK_FOUND) > message("found VTK. Version:" ${VTK_VERSION}. VTK_DIR: ${VTK_DIR}) > endif() > include(${VTK_USE_FILE}) > add_executable(Test test.cpp) > target_link_libraries(Test ${VTK_LIBRARIES}) > > > It configures fine and generates a Visual Studio solution I can open, but > when I try and build this it throws a linker error saying > > "cannot open input file 'vtkalglib.lib'" > > Interesting to note is that in my install folder (specified while building > VTK) there is a .lib called 'vtkalglib-6.1.lib' but no 'vtkalglib.lib'. > Also, even though I specified my VTK_DIR in the CMake it keeps showing the > wrong directory in the CMake GUI and even if I change it, it swaps back > when I click on configure. > > Regards, > Dan > > > ------------------------------ > Date: Tue, 1 Jul 2014 15:43:36 -0400 > Subject: Re: [vtkusers] CMake/Linking Issues VTK 6.1.0 > From: christopher.mullins at kitware.com > To: dbpvusrlist at hotmail.co.uk > CC: vtkusers at vtk.org > > > Have you checked out the wiki page for configuring and building [1] ? It > was written for VTK 6.1.0. > > Could you post which step you're trying to accomplish, and the errors you > receive? I think this will help us diagnose what's happening. > > > [1] http://www.vtk.org/Wiki/VTK/Configure_and_Build > > > On Tue, Jul 1, 2014 at 3:33 PM, Dan wrote: > > Hi All, > > I have been using VTK (version 5) for some time. I downloaded and built > the source as detailed on the website, and then I was able to link to the > libraries and include the header files manually as I usually do for third > party libraries. Everything worked fine. > > I'm now on a new system so I downloaded, configured and built VTK 6.1.0. > It built fine and I installed it to the specified directory. However, I > then found it impossible to manually link my VS project to the libraries. > To get around this I tried using CMake to generate a Visual Studio project > but nothing I try seems to work. A number of permutations each seem to give > different errors, either include errors or linking errors. Some won't even > configure with CMake! > > Could someone please explain, in clear steps how one goes about building > and linking to VTK? > > Thanks very much, > Dan > > (I'm not a novice but after three days trying to sort this out I'm out of > ideas!) > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > > > > -- > Christopher Mullins > R&D Engineer > Kitware Inc., > 919.869.8871 > > > > > -- > Christopher Mullins > R&D Engineer > Kitware Inc., > 919.869.8871 > -- Christopher Mullins R&D Engineer Kitware Inc., 919.869.8871 -------------- next part -------------- An HTML attachment was scrubbed... URL: From dbpvusrlist at hotmail.co.uk Tue Jul 1 17:02:55 2014 From: dbpvusrlist at hotmail.co.uk (Dan) Date: Tue, 1 Jul 2014 21:02:55 +0000 Subject: [vtkusers] CMake/Linking Issues VTK 6.1.0 In-Reply-To: References: , , , , , Message-ID: I tried building the example ReadImageData (http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/ReadImageData) since I want to use vtkImageData in my own app. Using the CMakeLists.txt from the page gives me an include error Error 1 error C1083: Cannot open include file: 'vtkImageViewer2.h': No such file or directory C:\Users\Dan\Documents\Visual Studio 2013\Projects\VTK_test\ReadImageData.cpp 5 1 ReadImageData I have attached the CMakeCache.txt below. I notice it still says "/build" and not "/install" even though I changed it in the GUI / CMakeLists.txt. Regards, Dan # This is the CMakeCache file. # For build in directory: c:/Users/Dan/Documents/Visual Studio 2013/Projects/VTK_test/build # It was generated by CMake: C:/Program Files (x86)/CMake/bin/cmake.exe # You can edit this file to change values found and used by cmake. # If you do not want to change any of the values, simply exit the editor. # If you do want to change a value, simply edit, save, and exit the editor. # The syntax for the file is as follows: # KEY:TYPE=VALUE # KEY is the name of a variable in the cache. # TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. # VALUE is the current value for the KEY. ######################## # EXTERNAL cache entries ######################## //Semicolon separated list of supported configuration types, only // supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything // else will be ignored. CMAKE_CONFIGURATION_TYPES:STRING=Debug;Release;MinSizeRel;RelWithDebInfo //Flags used by the compiler during all build types. CMAKE_CXX_FLAGS:STRING= /DWIN32 /D_WINDOWS /W3 /GR /EHsc //Flags used by the compiler during debug builds. CMAKE_CXX_FLAGS_DEBUG:STRING=/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 //Flags used by the compiler during release builds for minimum // size. CMAKE_CXX_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /D NDEBUG //Flags used by the compiler during release builds. CMAKE_CXX_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /D NDEBUG //Flags used by the compiler during release builds with debug info. CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=/MD /Zi /O2 /Ob1 /D NDEBUG //Libraries linked by default with all C++ applications. CMAKE_CXX_STANDARD_LIBRARIES:STRING=kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib //Flags used by the compiler during all build types. CMAKE_C_FLAGS:STRING= /DWIN32 /D_WINDOWS /W3 //Flags used by the compiler during debug builds. CMAKE_C_FLAGS_DEBUG:STRING=/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 //Flags used by the compiler during release builds for minimum // size. CMAKE_C_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /D NDEBUG //Flags used by the compiler during release builds. CMAKE_C_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /D NDEBUG //Flags used by the compiler during release builds with debug info. CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=/MD /Zi /O2 /Ob1 /D NDEBUG //Libraries linked by default with all C applications. CMAKE_C_STANDARD_LIBRARIES:STRING=kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib //Flags used by the linker. CMAKE_EXE_LINKER_FLAGS:STRING=' /machine:x64 ' //Flags used by the linker during debug builds. CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL //Flags used by the linker during release minsize builds. CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO //Flags used by the linker during release builds. CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO //Flags used by the linker during Release with Debug Info builds. CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL //Install path prefix, prepended onto install directories. CMAKE_INSTALL_PREFIX:PATH=C:/Program Files/ReadImageData //Path to a program. CMAKE_LINKER:FILEPATH=C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/x86_amd64/link.exe //Flags used by the linker during the creation of modules. CMAKE_MODULE_LINKER_FLAGS:STRING=' /machine:x64 ' //Flags used by the linker during debug builds. CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL //Flags used by the linker during release minsize builds. CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO //Flags used by the linker during release builds. CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO //Flags used by the linker during Release with Debug Info builds. CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL //Value Computed by CMake CMAKE_PROJECT_NAME:STATIC=ReadImageData //RC compiler CMAKE_RC_COMPILER:FILEPATH=rc //Flags for Windows Resource Compiler. CMAKE_RC_FLAGS:STRING=' ' //Flags used by the linker during the creation of dll's. CMAKE_SHARED_LINKER_FLAGS:STRING=' /machine:x64 ' //Flags used by the linker during debug builds. CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL //Flags used by the linker during release minsize builds. CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO //Flags used by the linker during release builds. CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO //Flags used by the linker during Release with Debug Info builds. CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL //If set, runtime paths are not added when installing shared libraries, // but are added when building. CMAKE_SKIP_INSTALL_RPATH:BOOL=OFF //If set, runtime paths are not added when using shared libraries. CMAKE_SKIP_RPATH:BOOL=OFF //Flags used by the linker during the creation of static libraries. CMAKE_STATIC_LINKER_FLAGS:STRING= //Flags used by the linker during debug builds. CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= //Flags used by the linker during release minsize builds. CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= //Flags used by the linker during release builds. CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= //Flags used by the linker during Release with Debug Info builds. CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= //If true, cmake will use relative paths in makefiles and projects. CMAKE_USE_RELATIVE_PATHS:BOOL=OFF //If this value is on, makefiles will be generated without the // .SILENT directive, and all commands will be echoed to the console // during the make. This is useful for debugging only. With Visual // Studio IDE projects all commands are done without /nologo. CMAKE_VERBOSE_MAKEFILE:BOOL=OFF //Value Computed by CMake ReadImageData_BINARY_DIR:STATIC=C:/Users/Dan/Documents/Visual Studio 2013/Projects/VTK_test/build //Value Computed by CMake ReadImageData_SOURCE_DIR:STATIC=C:/Users/Dan/Documents/Visual Studio 2013/Projects/VTK_test //The directory containing a CMake configuration file for VTK. VTK_DIR:PATH=C:/VTK-6.1.0/build ######################## # INTERNAL cache entries ######################## //Stored GUID ALL_BUILD_GUID_CMAKE:INTERNAL=3BBDABD8-5086-4206-839A-E664E7B5EF7A //This is the directory where this CMakeCache.txt was created CMAKE_CACHEFILE_DIR:INTERNAL=c:/Users/Dan/Documents/Visual Studio 2013/Projects/VTK_test/build //Major version of cmake used to create the current loaded cache CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 //Minor version of cmake used to create the current loaded cache CMAKE_CACHE_MINOR_VERSION:INTERNAL=0 //Patch version of cmake used to create the current loaded cache CMAKE_CACHE_PATCH_VERSION:INTERNAL=0 //Path to CMake executable. CMAKE_COMMAND:INTERNAL=C:/Program Files (x86)/CMake/bin/cmake.exe //Path to cpack program executable. CMAKE_CPACK_COMMAND:INTERNAL=C:/Program Files (x86)/CMake/bin/cpack.exe //Path to ctest program executable. CMAKE_CTEST_COMMAND:INTERNAL=C:/Program Files (x86)/CMake/bin/ctest.exe //ADVANCED property for variable: CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_CXX_STANDARD_LIBRARIES CMAKE_CXX_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_C_FLAGS CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_C_STANDARD_LIBRARIES CMAKE_C_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1 //Executable file format CMAKE_EXECUTABLE_FORMAT:INTERNAL=Unknown //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 //Name of generator. CMAKE_GENERATOR:INTERNAL=Visual Studio 12 2013 Win64 //Name of generator toolset. CMAKE_GENERATOR_TOOLSET:INTERNAL= //Start directory with the top level CMakeLists.txt file for this // project CMAKE_HOME_DIRECTORY:INTERNAL=C:/Users/Dan/Documents/Visual Studio 2013/Projects/VTK_test //ADVANCED property for variable: CMAKE_LINKER CMAKE_LINKER-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 //number of local generators CMAKE_NUMBER_OF_LOCAL_GENERATORS:INTERNAL=1 //ADVANCED property for variable: CMAKE_RC_COMPILER CMAKE_RC_COMPILER-ADVANCED:INTERNAL=1 CMAKE_RC_COMPILER_WORKS:INTERNAL=1 //ADVANCED property for variable: CMAKE_RC_FLAGS CMAKE_RC_FLAGS-ADVANCED:INTERNAL=1 //Path to CMake installation. CMAKE_ROOT:INTERNAL=C:/Program Files (x86)/CMake/share/cmake-3.0 //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_SKIP_RPATH CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 //Suppress Warnings that are meant for the author of the CMakeLists.txt // files. CMAKE_SUPPRESS_DEVELOPER_WARNINGS:INTERNAL=FALSE //ADVANCED property for variable: CMAKE_USE_RELATIVE_PATHS CMAKE_USE_RELATIVE_PATHS-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 //Stored GUID ReadImageData_GUID_CMAKE:INTERNAL=1A034F39-05B9-431A-9126-3953C0660729 //Stored GUID SG_Filter_CMake Rules_GUID_CMAKE:INTERNAL=159E609E-BA6C-4D08-A708-93D06E02CB55 //Stored GUID SG_Filter_Header Files_GUID_CMAKE:INTERNAL=C25EDD65-569F-47DD-84C4-1A4DC95E848F //Stored GUID SG_Filter_Object Files_GUID_CMAKE:INTERNAL=49682549-146C-495A-A05E-4717E9235FE3 //Stored GUID SG_Filter_Resources_GUID_CMAKE:INTERNAL=805E7B31-FCFB-4FEC-8C70-8462336B3109 //Stored GUID SG_Filter_Source Files_GUID_CMAKE:INTERNAL=618C9595-6DBD-4D3C-AAAE-B898B7AD7622 //Stored GUID ZERO_CHECK_GUID_CMAKE:INTERNAL=CF1D2DF2-CBDF-4351-ABD8-055BE091763A Date: Tue, 1 Jul 2014 16:22:05 -0400 Subject: Re: [vtkusers] CMake/Linking Issues VTK 6.1.0 From: christopher.mullins at kitware.com To: dbpvusrlist at hotmail.co.uk CC: vtkusers at vtk.org Interesting. Are you able to build any of the VTK examples [1] against your current install? Also, have you tried with a clean build tree of your application? It sounds like something is getting cached when it shouldn't be. It might help if I could have a look at your CMakeCache.txt, or if you could take a screenshot of your cmake-gui before the "configure" step. [1] http://www.vtk.org/Wiki/VTK/Examples/Cxx On Tue, Jul 1, 2014 at 4:16 PM, Dan wrote: Hmm, just tried removing it. It doesn't make a difference. If I type the correct install directory into the GUI it just resets when I press 'configure'. If I type it an they just click 'generate' it still gives the error about 'vtkalglib.lib'. Dan Date: Tue, 1 Jul 2014 15:59:59 -0400 Subject: Re: [vtkusers] CMake/Linking Issues VTK 6.1.0 From: christopher.mullins at kitware.com To: dbpvusrlist at hotmail.co.uk CC: vtkusers at vtk.org Also, even though I specified my VTK_DIR in the CMake it keeps showing the wrong directory in the CMake GUI and even if I change it, it swaps back when I click on configure. I suspect this is causing the problem. Could you take it out of the CMakeLists.txt file and just provide it at configure time via cmake-gui? On Tue, Jul 1, 2014 at 3:56 PM, Dan wrote: Hi Christopher, Yes I have seen and read that page. The problem I am having is not building VTK itself, rather, building my own application which uses VTK. I have cobbled together a CMake file from scouring the VTK documentation / Google. It reads cmake_minimum_required(VERSION 2.8.7) project(Test) set(VTK_DIR "C:/VTK-6.1.0/install") find_package(VTK 6.1 REQUIRED NO_MODULE) if(VTK_FOUND) message("found VTK. Version:" ${VTK_VERSION}. VTK_DIR: ${VTK_DIR}) endif() include(${VTK_USE_FILE}) add_executable(Test test.cpp) target_link_libraries(Test ${VTK_LIBRARIES}) It configures fine and generates a Visual Studio solution I can open, but when I try and build this it throws a linker error saying "cannot open input file 'vtkalglib.lib'" Interesting to note is that in my install folder (specified while building VTK) there is a .lib called 'vtkalglib-6.1.lib' but no 'vtkalglib.lib'. Also, even though I specified my VTK_DIR in the CMake it keeps showing the wrong directory in the CMake GUI and even if I change it, it swaps back when I click on configure. Regards, Dan Date: Tue, 1 Jul 2014 15:43:36 -0400 Subject: Re: [vtkusers] CMake/Linking Issues VTK 6.1.0 From: christopher.mullins at kitware.com To: dbpvusrlist at hotmail.co.uk CC: vtkusers at vtk.org Have you checked out the wiki page for configuring and building [1] ? It was written for VTK 6.1.0. Could you post which step you're trying to accomplish, and the errors you receive? I think this will help us diagnose what's happening. [1] http://www.vtk.org/Wiki/VTK/Configure_and_Build On Tue, Jul 1, 2014 at 3:33 PM, Dan wrote: Hi All, I have been using VTK (version 5) for some time. I downloaded and built the source as detailed on the website, and then I was able to link to the libraries and include the header files manually as I usually do for third party libraries. Everything worked fine. I'm now on a new system so I downloaded, configured and built VTK 6.1.0. It built fine and I installed it to the specified directory. However, I then found it impossible to manually link my VS project to the libraries. To get around this I tried using CMake to generate a Visual Studio project but nothing I try seems to work. A number of permutations each seem to give different errors, either include errors or linking errors. Some won't even configure with CMake! Could someone please explain, in clear steps how one goes about building and linking to VTK? Thanks very much, Dan (I'm not a novice but after three days trying to sort this out I'm out of ideas!) _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -- Christopher MullinsR&D EngineerKitware Inc.,919.869.8871 -- Christopher MullinsR&D EngineerKitware Inc.,919.869.8871 -- Christopher MullinsR&D EngineerKitware Inc.,919.869.8871 -------------- next part -------------- An HTML attachment was scrubbed... URL: From christopher.mullins at kitware.com Tue Jul 1 17:56:47 2014 From: christopher.mullins at kitware.com (Christopher Mullins) Date: Tue, 1 Jul 2014 17:56:47 -0400 Subject: [vtkusers] CMake/Linking Issues VTK 6.1.0 In-Reply-To: References: Message-ID: > > //Value Computed by CMake > ReadImageData_SOURCE_DIR:STATIC=C:/Users/Dan/Documents/Visual Studio > 2013/Projects/VTK_test This should be set to the example source directory, which I would expect to be named ReadImageData. When building the example, there should be no need to edit any CMakeLists.txt files. Once you set up an empty, clean build directory, you should open up cmake-gui. "Where is the source code:" should point to the ReadImageData example source code that you downloaded. "Where to build the binaries:" should point to the clean, empty directory you have made. Then set VTK_DIR to point to your VTK-6.1-install/lib/cmake/vtk-6.1 or build directory (whichever contains VTKConfig.cmake), where you have built VTK. On Tue, Jul 1, 2014 at 5:02 PM, Dan wrote: > I tried building the example ReadImageData ( > http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/ReadImageData) since I want > to use vtkImageData in my own app. Using the CMakeLists.txt from the page > gives me an include error > > Error 1 error C1083: Cannot open include file: 'vtkImageViewer2.h': > No such file or directory C:\Users\Dan\Documents\Visual Studio > 2013\Projects\VTK_test\ReadImageData.cpp 5 1 ReadImageData > > I have attached the CMakeCache.txt below. I notice it still says "/build" > and not "/install" even though I changed it in the GUI / CMakeLists.txt. > > Regards, > Dan > > # This is the CMakeCache file. > # For build in directory: c:/Users/Dan/Documents/Visual Studio > 2013/Projects/VTK_test/build > # It was generated by CMake: C:/Program Files (x86)/CMake/bin/cmake.exe > # You can edit this file to change values found and used by cmake. > # If you do not want to change any of the values, simply exit the editor. > # If you do want to change a value, simply edit, save, and exit the editor. > # The syntax for the file is as follows: > # KEY:TYPE=VALUE > # KEY is the name of a variable in the cache. > # TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. > # VALUE is the current value for the KEY. > > ######################## > # EXTERNAL cache entries > ######################## > > //Semicolon separated list of supported configuration types, only > // supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything > // else will be ignored. > CMAKE_CONFIGURATION_TYPES:STRING=Debug;Release;MinSizeRel;RelWithDebInfo > > //Flags used by the compiler during all build types. > CMAKE_CXX_FLAGS:STRING= /DWIN32 /D_WINDOWS /W3 /GR /EHsc > > //Flags used by the compiler during debug builds. > CMAKE_CXX_FLAGS_DEBUG:STRING=/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 > > //Flags used by the compiler during release builds for minimum > // size. > CMAKE_CXX_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /D NDEBUG > > //Flags used by the compiler during release builds. > CMAKE_CXX_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /D NDEBUG > > //Flags used by the compiler during release builds with debug info. > CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=/MD /Zi /O2 /Ob1 /D NDEBUG > > //Libraries linked by default with all C++ applications. > CMAKE_CXX_STANDARD_LIBRARIES:STRING=kernel32.lib user32.lib gdi32.lib > winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib > advapi32.lib > > //Flags used by the compiler during all build types. > CMAKE_C_FLAGS:STRING= /DWIN32 /D_WINDOWS /W3 > > //Flags used by the compiler during debug builds. > CMAKE_C_FLAGS_DEBUG:STRING=/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 > > //Flags used by the compiler during release builds for minimum > // size. > CMAKE_C_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /D NDEBUG > > //Flags used by the compiler during release builds. > CMAKE_C_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /D NDEBUG > > //Flags used by the compiler during release builds with debug info. > CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=/MD /Zi /O2 /Ob1 /D NDEBUG > > //Libraries linked by default with all C applications. > CMAKE_C_STANDARD_LIBRARIES:STRING=kernel32.lib user32.lib gdi32.lib > winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib > advapi32.lib > > //Flags used by the linker. > CMAKE_EXE_LINKER_FLAGS:STRING=' /machine:x64 ' > > //Flags used by the linker during debug builds. > CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL > > //Flags used by the linker during release minsize builds. > CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO > > //Flags used by the linker during release builds. > CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO > > //Flags used by the linker during Release with Debug Info builds. > CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL > > //Install path prefix, prepended onto install directories. > CMAKE_INSTALL_PREFIX:PATH=C:/Program Files/ReadImageData > > //Path to a program. > CMAKE_LINKER:FILEPATH=C:/Program Files (x86)/Microsoft Visual Studio > 12.0/VC/bin/x86_amd64/link.exe > > //Flags used by the linker during the creation of modules. > CMAKE_MODULE_LINKER_FLAGS:STRING=' /machine:x64 ' > > //Flags used by the linker during debug builds. > CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL > > //Flags used by the linker during release minsize builds. > CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO > > //Flags used by the linker during release builds. > CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO > > //Flags used by the linker during Release with Debug Info builds. > CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL > > //Value Computed by CMake > CMAKE_PROJECT_NAME:STATIC=ReadImageData > > //RC compiler > CMAKE_RC_COMPILER:FILEPATH=rc > > //Flags for Windows Resource Compiler. > CMAKE_RC_FLAGS:STRING=' ' > > //Flags used by the linker during the creation of dll's. > CMAKE_SHARED_LINKER_FLAGS:STRING=' /machine:x64 ' > > //Flags used by the linker during debug builds. > CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL > > //Flags used by the linker during release minsize builds. > CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO > > //Flags used by the linker during release builds. > CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO > > //Flags used by the linker during Release with Debug Info builds. > CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL > > //If set, runtime paths are not added when installing shared libraries, > // but are added when building. > CMAKE_SKIP_INSTALL_RPATH:BOOL=OFF > > //If set, runtime paths are not added when using shared libraries. > CMAKE_SKIP_RPATH:BOOL=OFF > > //Flags used by the linker during the creation of static libraries. > CMAKE_STATIC_LINKER_FLAGS:STRING= > > //Flags used by the linker during debug builds. > CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= > > //Flags used by the linker during release minsize builds. > CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= > > //Flags used by the linker during release builds. > CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= > > //Flags used by the linker during Release with Debug Info builds. > CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= > > //If true, cmake will use relative paths in makefiles and projects. > CMAKE_USE_RELATIVE_PATHS:BOOL=OFF > > //If this value is on, makefiles will be generated without the > // .SILENT directive, and all commands will be echoed to the console > // during the make. This is useful for debugging only. With Visual > // Studio IDE projects all commands are done without /nologo. > CMAKE_VERBOSE_MAKEFILE:BOOL=OFF > > //Value Computed by CMake > ReadImageData_BINARY_DIR:STATIC=C:/Users/Dan/Documents/Visual Studio > 2013/Projects/VTK_test/build > > //Value Computed by CMake > ReadImageData_SOURCE_DIR:STATIC=C:/Users/Dan/Documents/Visual Studio > 2013/Projects/VTK_test > > //The directory containing a CMake configuration file for VTK. > VTK_DIR:PATH=C:/VTK-6.1.0/build > > > ######################## > # INTERNAL cache entries > ######################## > > //Stored GUID > ALL_BUILD_GUID_CMAKE:INTERNAL=3BBDABD8-5086-4206-839A-E664E7B5EF7A > //This is the directory where this CMakeCache.txt was created > CMAKE_CACHEFILE_DIR:INTERNAL=c:/Users/Dan/Documents/Visual Studio > 2013/Projects/VTK_test/build > //Major version of cmake used to create the current loaded cache > CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 > //Minor version of cmake used to create the current loaded cache > CMAKE_CACHE_MINOR_VERSION:INTERNAL=0 > //Patch version of cmake used to create the current loaded cache > CMAKE_CACHE_PATCH_VERSION:INTERNAL=0 > //Path to CMake executable. > CMAKE_COMMAND:INTERNAL=C:/Program Files (x86)/CMake/bin/cmake.exe > //Path to cpack program executable. > CMAKE_CPACK_COMMAND:INTERNAL=C:/Program Files (x86)/CMake/bin/cpack.exe > //Path to ctest program executable. > CMAKE_CTEST_COMMAND:INTERNAL=C:/Program Files (x86)/CMake/bin/ctest.exe > //ADVANCED property for variable: CMAKE_CXX_FLAGS > CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG > CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL > CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE > CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO > CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_CXX_STANDARD_LIBRARIES > CMAKE_CXX_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_C_FLAGS > CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG > CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL > CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE > CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO > CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_C_STANDARD_LIBRARIES > CMAKE_C_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1 > //Executable file format > CMAKE_EXECUTABLE_FORMAT:INTERNAL=Unknown > //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS > CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG > CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL > CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE > CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO > CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 > //Name of generator. > CMAKE_GENERATOR:INTERNAL=Visual Studio 12 2013 Win64 > //Name of generator toolset. > CMAKE_GENERATOR_TOOLSET:INTERNAL= > //Start directory with the top level CMakeLists.txt file for this > // project > CMAKE_HOME_DIRECTORY:INTERNAL=C:/Users/Dan/Documents/Visual Studio > 2013/Projects/VTK_test > //ADVANCED property for variable: CMAKE_LINKER > CMAKE_LINKER-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS > CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG > CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL > CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE > CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO > CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 > //number of local generators > CMAKE_NUMBER_OF_LOCAL_GENERATORS:INTERNAL=1 > //ADVANCED property for variable: CMAKE_RC_COMPILER > CMAKE_RC_COMPILER-ADVANCED:INTERNAL=1 > CMAKE_RC_COMPILER_WORKS:INTERNAL=1 > //ADVANCED property for variable: CMAKE_RC_FLAGS > CMAKE_RC_FLAGS-ADVANCED:INTERNAL=1 > //Path to CMake installation. > CMAKE_ROOT:INTERNAL=C:/Program Files (x86)/CMake/share/cmake-3.0 > //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS > CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG > CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL > CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE > CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO > CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH > CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_SKIP_RPATH > CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS > CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG > CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL > CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE > CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO > CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 > //Suppress Warnings that are meant for the author of the CMakeLists.txt > // files. > CMAKE_SUPPRESS_DEVELOPER_WARNINGS:INTERNAL=FALSE > //ADVANCED property for variable: CMAKE_USE_RELATIVE_PATHS > CMAKE_USE_RELATIVE_PATHS-ADVANCED:INTERNAL=1 > //ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE > CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 > //Stored GUID > ReadImageData_GUID_CMAKE:INTERNAL=1A034F39-05B9-431A-9126-3953C0660729 > //Stored GUID > SG_Filter_CMake > Rules_GUID_CMAKE:INTERNAL=159E609E-BA6C-4D08-A708-93D06E02CB55 > //Stored GUID > SG_Filter_Header > Files_GUID_CMAKE:INTERNAL=C25EDD65-569F-47DD-84C4-1A4DC95E848F > //Stored GUID > SG_Filter_Object > Files_GUID_CMAKE:INTERNAL=49682549-146C-495A-A05E-4717E9235FE3 > //Stored GUID > > SG_Filter_Resources_GUID_CMAKE:INTERNAL=805E7B31-FCFB-4FEC-8C70-8462336B3109 > //Stored GUID > SG_Filter_Source > Files_GUID_CMAKE:INTERNAL=618C9595-6DBD-4D3C-AAAE-B898B7AD7622 > //Stored GUID > ZERO_CHECK_GUID_CMAKE:INTERNAL=CF1D2DF2-CBDF-4351-ABD8-055BE091763A > > > > > ------------------------------ > Date: Tue, 1 Jul 2014 16:22:05 -0400 > > Subject: Re: [vtkusers] CMake/Linking Issues VTK 6.1.0 > From: christopher.mullins at kitware.com > To: dbpvusrlist at hotmail.co.uk > CC: vtkusers at vtk.org > > Interesting. Are you able to build any of the VTK examples [1] against > your current install? Also, have you tried with a clean build tree of your > application? It sounds like something is getting cached when it shouldn't > be. > > It might help if I could have a look at your CMakeCache.txt, or if you > could take a screenshot of your cmake-gui before the "configure" step. > > [1] http://www.vtk.org/Wiki/VTK/Examples/Cxx > > > On Tue, Jul 1, 2014 at 4:16 PM, Dan wrote: > > Hmm, just tried removing it. It doesn't make a difference. If I type the > correct install directory into the GUI it just resets when I press > 'configure'. If I type it an they just click 'generate' it still gives the > error about 'vtkalglib.lib'. > > Dan > > ------------------------------ > Date: Tue, 1 Jul 2014 15:59:59 -0400 > > Subject: Re: [vtkusers] CMake/Linking Issues VTK 6.1.0 > From: christopher.mullins at kitware.com > To: dbpvusrlist at hotmail.co.uk > CC: vtkusers at vtk.org > > Also, even though I specified my VTK_DIR in the CMake it keeps showing the > wrong directory in the CMake GUI and even if I change it, it swaps back > when I click on configure. > > > I suspect this is causing the problem. Could you take it out of the > CMakeLists.txt file and just provide it at configure time via cmake-gui? > > > On Tue, Jul 1, 2014 at 3:56 PM, Dan wrote: > > Hi Christopher, > > Yes I have seen and read that page. The problem I am having is not > building VTK itself, rather, building my own application which uses VTK. I > have cobbled together a CMake file from scouring the VTK documentation / > Google. It reads > > cmake_minimum_required(VERSION 2.8.7) > project(Test) > set(VTK_DIR "C:/VTK-6.1.0/install") > find_package(VTK 6.1 REQUIRED NO_MODULE) > if(VTK_FOUND) > message("found VTK. Version:" ${VTK_VERSION}. VTK_DIR: ${VTK_DIR}) > endif() > include(${VTK_USE_FILE}) > add_executable(Test test.cpp) > target_link_libraries(Test ${VTK_LIBRARIES}) > > > It configures fine and generates a Visual Studio solution I can open, but > when I try and build this it throws a linker error saying > > "cannot open input file 'vtkalglib.lib'" > > Interesting to note is that in my install folder (specified while building > VTK) there is a .lib called 'vtkalglib-6.1.lib' but no 'vtkalglib.lib'. > Also, even though I specified my VTK_DIR in the CMake it keeps showing the > wrong directory in the CMake GUI and even if I change it, it swaps back > when I click on configure. > > Regards, > Dan > > > ------------------------------ > Date: Tue, 1 Jul 2014 15:43:36 -0400 > Subject: Re: [vtkusers] CMake/Linking Issues VTK 6.1.0 > From: christopher.mullins at kitware.com > To: dbpvusrlist at hotmail.co.uk > CC: vtkusers at vtk.org > > > Have you checked out the wiki page for configuring and building [1] ? It > was written for VTK 6.1.0. > > Could you post which step you're trying to accomplish, and the errors you > receive? I think this will help us diagnose what's happening. > > > [1] http://www.vtk.org/Wiki/VTK/Configure_and_Build > > > On Tue, Jul 1, 2014 at 3:33 PM, Dan wrote: > > Hi All, > > I have been using VTK (version 5) for some time. I downloaded and built > the source as detailed on the website, and then I was able to link to the > libraries and include the header files manually as I usually do for third > party libraries. Everything worked fine. > > I'm now on a new system so I downloaded, configured and built VTK 6.1.0. > It built fine and I installed it to the specified directory. However, I > then found it impossible to manually link my VS project to the libraries. > To get around this I tried using CMake to generate a Visual Studio project > but nothing I try seems to work. A number of permutations each seem to give > different errors, either include errors or linking errors. Some won't even > configure with CMake! > > Could someone please explain, in clear steps how one goes about building > and linking to VTK? > > Thanks very much, > Dan > > (I'm not a novice but after three days trying to sort this out I'm out of > ideas!) > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > > > > -- > Christopher Mullins > R&D Engineer > Kitware Inc., > 919.869.8871 > > > > > -- > Christopher Mullins > R&D Engineer > Kitware Inc., > 919.869.8871 > > > > > -- > Christopher Mullins > R&D Engineer > Kitware Inc., > 919.869.8871 > -- Christopher Mullins R&D Engineer Kitware Inc., 919.869.8871 -------------- next part -------------- An HTML attachment was scrubbed... URL: From dbpvusrlist at hotmail.co.uk Tue Jul 1 18:50:06 2014 From: dbpvusrlist at hotmail.co.uk (Dan) Date: Tue, 1 Jul 2014 22:50:06 +0000 Subject: [vtkusers] CMake/Linking Issues VTK 6.1.0 In-Reply-To: References: , , , , , , , Message-ID: VTK-6.1-install/lib/cmake/vtk-6.1 was the key! I set VTK_DIR to this subdirectory of my install folder (rather than the top level install folder) and it worked fine! The help is much appreciated. Dan Date: Tue, 1 Jul 2014 17:56:47 -0400 Subject: Re: [vtkusers] CMake/Linking Issues VTK 6.1.0 From: christopher.mullins at kitware.com To: dbpvusrlist at hotmail.co.uk CC: vtkusers at vtk.org //Value Computed by CMake ReadImageData_SOURCE_DIR:STATIC=C:/Users/Dan/Documents/Visual Studio 2013/Projects/VTK_test This should be set to the example source directory, which I would expect to be named ReadImageData. When building the example, there should be no need to edit any CMakeLists.txt files. Once you set up an empty, clean build directory, you should open up cmake-gui. "Where is the source code:" should point to the ReadImageData example source code that you downloaded. "Where to build the binaries:" should point to the clean, empty directory you have made. Then set VTK_DIR to point to your VTK-6.1-install/lib/cmake/vtk-6.1 or build directory (whichever contains VTKConfig.cmake), where you have built VTK. On Tue, Jul 1, 2014 at 5:02 PM, Dan wrote: I tried building the example ReadImageData (http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/ReadImageData) since I want to use vtkImageData in my own app. Using the CMakeLists.txt from the page gives me an include error Error 1 error C1083: Cannot open include file: 'vtkImageViewer2.h': No such file or directory C:\Users\Dan\Documents\Visual Studio 2013\Projects\VTK_test\ReadImageData.cpp 5 1 ReadImageData I have attached the CMakeCache.txt below. I notice it still says "/build" and not "/install" even though I changed it in the GUI / CMakeLists.txt. Regards, Dan # This is the CMakeCache file. # For build in directory: c:/Users/Dan/Documents/Visual Studio 2013/Projects/VTK_test/build # It was generated by CMake: C:/Program Files (x86)/CMake/bin/cmake.exe # You can edit this file to change values found and used by cmake. # If you do not want to change any of the values, simply exit the editor. # If you do want to change a value, simply edit, save, and exit the editor. # The syntax for the file is as follows: # KEY:TYPE=VALUE # KEY is the name of a variable in the cache. # TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. # VALUE is the current value for the KEY. ######################## # EXTERNAL cache entries ######################## //Semicolon separated list of supported configuration types, only // supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything // else will be ignored. CMAKE_CONFIGURATION_TYPES:STRING=Debug;Release;MinSizeRel;RelWithDebInfo //Flags used by the compiler during all build types. CMAKE_CXX_FLAGS:STRING= /DWIN32 /D_WINDOWS /W3 /GR /EHsc //Flags used by the compiler during debug builds. CMAKE_CXX_FLAGS_DEBUG:STRING=/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 //Flags used by the compiler during release builds for minimum // size. CMAKE_CXX_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /D NDEBUG //Flags used by the compiler during release builds. CMAKE_CXX_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /D NDEBUG //Flags used by the compiler during release builds with debug info. CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=/MD /Zi /O2 /Ob1 /D NDEBUG //Libraries linked by default with all C++ applications. CMAKE_CXX_STANDARD_LIBRARIES:STRING=kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib //Flags used by the compiler during all build types. CMAKE_C_FLAGS:STRING= /DWIN32 /D_WINDOWS /W3 //Flags used by the compiler during debug builds. CMAKE_C_FLAGS_DEBUG:STRING=/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 //Flags used by the compiler during release builds for minimum // size. CMAKE_C_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /D NDEBUG //Flags used by the compiler during release builds. CMAKE_C_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /D NDEBUG //Flags used by the compiler during release builds with debug info. CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=/MD /Zi /O2 /Ob1 /D NDEBUG //Libraries linked by default with all C applications. CMAKE_C_STANDARD_LIBRARIES:STRING=kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib //Flags used by the linker. CMAKE_EXE_LINKER_FLAGS:STRING=' /machine:x64 ' //Flags used by the linker during debug builds. CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL //Flags used by the linker during release minsize builds. CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO //Flags used by the linker during release builds. CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO //Flags used by the linker during Release with Debug Info builds. CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL //Install path prefix, prepended onto install directories. CMAKE_INSTALL_PREFIX:PATH=C:/Program Files/ReadImageData //Path to a program. CMAKE_LINKER:FILEPATH=C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/x86_amd64/link.exe //Flags used by the linker during the creation of modules. CMAKE_MODULE_LINKER_FLAGS:STRING=' /machine:x64 ' //Flags used by the linker during debug builds. CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL //Flags used by the linker during release minsize builds. CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO //Flags used by the linker during release builds. CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO //Flags used by the linker during Release with Debug Info builds. CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL //Value Computed by CMake CMAKE_PROJECT_NAME:STATIC=ReadImageData //RC compiler CMAKE_RC_COMPILER:FILEPATH=rc //Flags for Windows Resource Compiler. CMAKE_RC_FLAGS:STRING=' ' //Flags used by the linker during the creation of dll's. CMAKE_SHARED_LINKER_FLAGS:STRING=' /machine:x64 ' //Flags used by the linker during debug builds. CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL //Flags used by the linker during release minsize builds. CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO //Flags used by the linker during release builds. CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO //Flags used by the linker during Release with Debug Info builds. CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL //If set, runtime paths are not added when installing shared libraries, // but are added when building. CMAKE_SKIP_INSTALL_RPATH:BOOL=OFF //If set, runtime paths are not added when using shared libraries. CMAKE_SKIP_RPATH:BOOL=OFF //Flags used by the linker during the creation of static libraries. CMAKE_STATIC_LINKER_FLAGS:STRING= //Flags used by the linker during debug builds. CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= //Flags used by the linker during release minsize builds. CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= //Flags used by the linker during release builds. CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= //Flags used by the linker during Release with Debug Info builds. CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= //If true, cmake will use relative paths in makefiles and projects. CMAKE_USE_RELATIVE_PATHS:BOOL=OFF //If this value is on, makefiles will be generated without the // .SILENT directive, and all commands will be echoed to the console // during the make. This is useful for debugging only. With Visual // Studio IDE projects all commands are done without /nologo. CMAKE_VERBOSE_MAKEFILE:BOOL=OFF //Value Computed by CMake ReadImageData_BINARY_DIR:STATIC=C:/Users/Dan/Documents/Visual Studio 2013/Projects/VTK_test/build //Value Computed by CMake ReadImageData_SOURCE_DIR:STATIC=C:/Users/Dan/Documents/Visual Studio 2013/Projects/VTK_test //The directory containing a CMake configuration file for VTK. VTK_DIR:PATH=C:/VTK-6.1.0/build ######################## # INTERNAL cache entries ######################## //Stored GUID ALL_BUILD_GUID_CMAKE:INTERNAL=3BBDABD8-5086-4206-839A-E664E7B5EF7A //This is the directory where this CMakeCache.txt was created CMAKE_CACHEFILE_DIR:INTERNAL=c:/Users/Dan/Documents/Visual Studio 2013/Projects/VTK_test/build //Major version of cmake used to create the current loaded cache CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 //Minor version of cmake used to create the current loaded cache CMAKE_CACHE_MINOR_VERSION:INTERNAL=0 //Patch version of cmake used to create the current loaded cache CMAKE_CACHE_PATCH_VERSION:INTERNAL=0 //Path to CMake executable. CMAKE_COMMAND:INTERNAL=C:/Program Files (x86)/CMake/bin/cmake.exe //Path to cpack program executable. CMAKE_CPACK_COMMAND:INTERNAL=C:/Program Files (x86)/CMake/bin/cpack.exe //Path to ctest program executable. CMAKE_CTEST_COMMAND:INTERNAL=C:/Program Files (x86)/CMake/bin/ctest.exe //ADVANCED property for variable: CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_CXX_STANDARD_LIBRARIES CMAKE_CXX_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_C_FLAGS CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_C_STANDARD_LIBRARIES CMAKE_C_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1 //Executable file format CMAKE_EXECUTABLE_FORMAT:INTERNAL=Unknown //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 //Name of generator. CMAKE_GENERATOR:INTERNAL=Visual Studio 12 2013 Win64 //Name of generator toolset. CMAKE_GENERATOR_TOOLSET:INTERNAL= //Start directory with the top level CMakeLists.txt file for this // project CMAKE_HOME_DIRECTORY:INTERNAL=C:/Users/Dan/Documents/Visual Studio 2013/Projects/VTK_test //ADVANCED property for variable: CMAKE_LINKER CMAKE_LINKER-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 //number of local generators CMAKE_NUMBER_OF_LOCAL_GENERATORS:INTERNAL=1 //ADVANCED property for variable: CMAKE_RC_COMPILER CMAKE_RC_COMPILER-ADVANCED:INTERNAL=1 CMAKE_RC_COMPILER_WORKS:INTERNAL=1 //ADVANCED property for variable: CMAKE_RC_FLAGS CMAKE_RC_FLAGS-ADVANCED:INTERNAL=1 //Path to CMake installation. CMAKE_ROOT:INTERNAL=C:/Program Files (x86)/CMake/share/cmake-3.0 //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_SKIP_RPATH CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 //Suppress Warnings that are meant for the author of the CMakeLists.txt // files. CMAKE_SUPPRESS_DEVELOPER_WARNINGS:INTERNAL=FALSE //ADVANCED property for variable: CMAKE_USE_RELATIVE_PATHS CMAKE_USE_RELATIVE_PATHS-ADVANCED:INTERNAL=1 //ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 //Stored GUID ReadImageData_GUID_CMAKE:INTERNAL=1A034F39-05B9-431A-9126-3953C0660729 //Stored GUID SG_Filter_CMake Rules_GUID_CMAKE:INTERNAL=159E609E-BA6C-4D08-A708-93D06E02CB55 //Stored GUID SG_Filter_Header Files_GUID_CMAKE:INTERNAL=C25EDD65-569F-47DD-84C4-1A4DC95E848F //Stored GUID SG_Filter_Object Files_GUID_CMAKE:INTERNAL=49682549-146C-495A-A05E-4717E9235FE3 //Stored GUID SG_Filter_Resources_GUID_CMAKE:INTERNAL=805E7B31-FCFB-4FEC-8C70-8462336B3109 //Stored GUID SG_Filter_Source Files_GUID_CMAKE:INTERNAL=618C9595-6DBD-4D3C-AAAE-B898B7AD7622 //Stored GUID ZERO_CHECK_GUID_CMAKE:INTERNAL=CF1D2DF2-CBDF-4351-ABD8-055BE091763A Date: Tue, 1 Jul 2014 16:22:05 -0400 Subject: Re: [vtkusers] CMake/Linking Issues VTK 6.1.0 From: christopher.mullins at kitware.com To: dbpvusrlist at hotmail.co.uk CC: vtkusers at vtk.org Interesting. Are you able to build any of the VTK examples [1] against your current install? Also, have you tried with a clean build tree of your application? It sounds like something is getting cached when it shouldn't be. It might help if I could have a look at your CMakeCache.txt, or if you could take a screenshot of your cmake-gui before the "configure" step. [1] http://www.vtk.org/Wiki/VTK/Examples/Cxx On Tue, Jul 1, 2014 at 4:16 PM, Dan wrote: Hmm, just tried removing it. It doesn't make a difference. If I type the correct install directory into the GUI it just resets when I press 'configure'. If I type it an they just click 'generate' it still gives the error about 'vtkalglib.lib'. Dan Date: Tue, 1 Jul 2014 15:59:59 -0400 Subject: Re: [vtkusers] CMake/Linking Issues VTK 6.1.0 From: christopher.mullins at kitware.com To: dbpvusrlist at hotmail.co.uk CC: vtkusers at vtk.org Also, even though I specified my VTK_DIR in the CMake it keeps showing the wrong directory in the CMake GUI and even if I change it, it swaps back when I click on configure. I suspect this is causing the problem. Could you take it out of the CMakeLists.txt file and just provide it at configure time via cmake-gui? On Tue, Jul 1, 2014 at 3:56 PM, Dan wrote: Hi Christopher, Yes I have seen and read that page. The problem I am having is not building VTK itself, rather, building my own application which uses VTK. I have cobbled together a CMake file from scouring the VTK documentation / Google. It reads cmake_minimum_required(VERSION 2.8.7) project(Test) set(VTK_DIR "C:/VTK-6.1.0/install") find_package(VTK 6.1 REQUIRED NO_MODULE) if(VTK_FOUND) message("found VTK. Version:" ${VTK_VERSION}. VTK_DIR: ${VTK_DIR}) endif() include(${VTK_USE_FILE}) add_executable(Test test.cpp) target_link_libraries(Test ${VTK_LIBRARIES}) It configures fine and generates a Visual Studio solution I can open, but when I try and build this it throws a linker error saying "cannot open input file 'vtkalglib.lib'" Interesting to note is that in my install folder (specified while building VTK) there is a .lib called 'vtkalglib-6.1.lib' but no 'vtkalglib.lib'. Also, even though I specified my VTK_DIR in the CMake it keeps showing the wrong directory in the CMake GUI and even if I change it, it swaps back when I click on configure. Regards, Dan Date: Tue, 1 Jul 2014 15:43:36 -0400 Subject: Re: [vtkusers] CMake/Linking Issues VTK 6.1.0 From: christopher.mullins at kitware.com To: dbpvusrlist at hotmail.co.uk CC: vtkusers at vtk.org Have you checked out the wiki page for configuring and building [1] ? It was written for VTK 6.1.0. Could you post which step you're trying to accomplish, and the errors you receive? I think this will help us diagnose what's happening. [1] http://www.vtk.org/Wiki/VTK/Configure_and_Build On Tue, Jul 1, 2014 at 3:33 PM, Dan wrote: Hi All, I have been using VTK (version 5) for some time. I downloaded and built the source as detailed on the website, and then I was able to link to the libraries and include the header files manually as I usually do for third party libraries. Everything worked fine. I'm now on a new system so I downloaded, configured and built VTK 6.1.0. It built fine and I installed it to the specified directory. However, I then found it impossible to manually link my VS project to the libraries. To get around this I tried using CMake to generate a Visual Studio project but nothing I try seems to work. A number of permutations each seem to give different errors, either include errors or linking errors. Some won't even configure with CMake! Could someone please explain, in clear steps how one goes about building and linking to VTK? Thanks very much, Dan (I'm not a novice but after three days trying to sort this out I'm out of ideas!) _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -- Christopher MullinsR&D EngineerKitware Inc.,919.869.8871 -- Christopher MullinsR&D EngineerKitware Inc.,919.869.8871 -- Christopher MullinsR&D EngineerKitware Inc.,919.869.8871 -- Christopher MullinsR&D EngineerKitware Inc.,919.869.8871 -------------- next part -------------- An HTML attachment was scrubbed... URL: From bigvision82 at yahoo.com Tue Jul 1 20:04:49 2014 From: bigvision82 at yahoo.com (kwayeke) Date: Tue, 1 Jul 2014 17:04:49 -0700 (PDT) Subject: [vtkusers] VTK_USE_MATLAB_MEX VTK6 Message-ID: <1404259489077-5727707.post@n5.nabble.com> Has anyone successfully compile VTK6 with matlab using VTK_USE_MATLAB_MEX. It seems to be that VTK_USE_MATLAB_MEX option is no longer in cmake. I want to use the vtk matlab interface described here : http://www.kitware.com/media/html/MATLABAndGNURIntegrationWithVTK.html and here http://www.kitware.com/media/html/MATLABAndGNURIntegrationWithVTKNowAvailable.html Regards, -- View this message in context: http://vtk.1045678.n5.nabble.com/VTK-USE-MATLAB-MEX-VTK6-tp5727707.html Sent from the VTK - Users mailing list archive at Nabble.com. From waynezw0618 at gmail.com Wed Jul 2 00:08:27 2014 From: waynezw0618 at gmail.com (Zhang Wei) Date: Wed, 2 Jul 2014 12:08:27 +0800 Subject: [vtkusers] how to write several scalars or vectors in ImageData Message-ID: <23F07C37-B9EA-4984-8955-EDA3178170D6@gmail.com> Hi all I noticed that in vtk one need to active a scalar/vector for the following filers. but I don?t know it works for output. I am using python for output my fields with several scalars as following: image=vtkImageData() image.SetDimensions(N1,N2,N3) image.SetNumberOfScalarComponets(3) image.GetPointData().AddArray(scalar1) image.GetPointData().AddArray(scalar2) image.GetPointData().AddArray(scalar3) write=vtk.vtkXMLImageDataWriter() writer.SetFileName(?test?) writer.SetInput(image) writer.Update() but when I check the file with paraview, there are three scalars but the last two are over wrote by the first one. can any one tell me how to write several datas? cheers ---------------------------------------------- Zhang Wei waynezw0618 at gmail.com From john.anaia at gmail.com Wed Jul 2 02:47:35 2014 From: john.anaia at gmail.com (John Anaia) Date: Tue, 1 Jul 2014 23:47:35 -0700 Subject: [vtkusers] Border line color of vtkTextWidget Message-ID: I followed this example to add a vtkTextWidget: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Widgets/TextWidget Everything worked fine. However, the rectangular border lines are white by default. However, my render window has a white background color. So the white textWidget border is not visible. I tried to change the border line color into black with this statement: textWidget->GetBorderRepresentation()->GetBorderProperty()->SetColor(0., 0., 0.); But I kept getting this error message: error C2039: 'GetBorderRepresentation' : is not a member of 'vtkTextWidget' FYI, I am using vtk 5.8 and included the proper headers such as: #include #include #include #include #include I'd like to have your assistance to change the color of vtkTextWidget border lines. Thank you for your help, John -------------- next part -------------- An HTML attachment was scrubbed... URL: From safna.royal10 at gmail.com Wed Jul 2 03:45:10 2014 From: safna.royal10 at gmail.com (Safna Ressel) Date: Wed, 2 Jul 2014 13:15:10 +0530 Subject: [vtkusers] How to get vtkCutter output using spline Message-ID: Hai Vtk users I have cut an objcet with vtkcutter->vtkstripper->this stripper output i am giving to to a vtkspline filter with vtkKochanekSpline and i need to get points with regular intervals on the object but am not getting it correctly. Did Anyone knows What is the correct way to generate points on object with Regular intervals using Any Spline. -- Thank You Safna -------------- next part -------------- An HTML attachment was scrubbed... URL: From goodwin.lawlor.lists at gmail.com Wed Jul 2 06:38:58 2014 From: goodwin.lawlor.lists at gmail.com (Goodwin Lawlor) Date: Wed, 2 Jul 2014 11:38:58 +0100 Subject: [vtkusers] Extent / Pipeline Problem with vtk 6.1 In-Reply-To: <758150D667C235458DE231BB50B9A2B319908F8E99@de01ex07.GLOBAL.JHCN.NET> References: <758150D667C235458DE231BB50B9A2B319908F8E99@de01ex07.GLOBAL.JHCN.NET> Message-ID: Hi Daniel, On quick inspection this looks like a bug in vtkImageMapToColors not handling the output info. You could file a bug here: http://vtk.org/Bug hth Goodwin On Mon, Jun 30, 2014 at 2:23 PM, Frese Daniel Dr. wrote: > Hi everybody, > > > > After porting a working application from vtk 5.x to vtk 6.1, I ran into > some problems that I can?t solve by myself. Based on the error messages, I > think though, it originates in the modified pipeline behavior of vtk 6.1 > (admittedly I use an already aged snapshot from November 2013). > > > > I tried to assemble a more or less minimal example to illustrate the > problem. Basically I use the pipeline > > vtkImageCanvasSource2D -> vtkImageMapToColors -> vtkImageViewer2. > > If I visualize the canvas, without passing through the vtkImageMapToColors > filter, everything works fine. If I pass through the vtkImageMapToColors > filter, I get a blank render window and the error message : > > ?vtkTrivialProducer (00F15A08) : This data object does not contain the > requested extent.? > > > > I printed out the vtkInformation objects of the canvas? output port and > the the vtkImageMapToColors? input port, and both outputs showed the > correct extents for WHOLE_EXTENT and UPDATE_EXTENT, but wrong values for > COMBINED_UPDATE_EXTENT. Moreover, canvas->GetOutput()->Print() gives also > the right extents, whereas the output of the the vtkImageMapToColors shows > that basically no meta information has been transmitted. > > > > The complete code is below. Does anybody have a clue, what I am missing > here ? > > > > Thank you, > > Daniel > > > > > > #include > > VTK_MODULE_INIT(vtkInteractionStyle); > > VTK_MODULE_INIT(vtkRenderingOpenGL); > > > > #include > > #include > > #include > > #include > > #include > > #include > > #include > > #include > > #include > > > > void main() { > > // Creation of canvas drawing > > vtkSmartPointer canvas = > vtkSmartPointer::New(); > > canvas->SetScalarTypeToUnsignedChar(); > > canvas->SetExtent(0, 99, 0, 99, 0, 0); > > canvas->SetDrawColor(255); > > canvas->DrawSegment(10, 10, 90, 90); > > canvas->Update(); > > // canvas->GetOutputInformation(0)->Print(cout); // debug output > shows : correct WHOLE_EXTENT / UPDATE_EXTENT > > > > // Map colors > > vtkSmartPointer lut = > vtkSmartPointer::New(); > > lut->SetNumberOfColors(256); > > lut->SetTableRange(0, 255); > > lut->SetValueRange(0, 255); > > lut->Build(); > > for (int i=0; i<256; i++) lut->SetTableValue(i, i/255.0, 0, 0, 1); > > > > vtkSmartPointer color = > vtkSmartPointer::New(); > > color->SetLookupTable(lut); > > color->SetInputConnection(canvas->GetOutputPort()); > > // color->GetInputInformation()->Print(cout); // debug output shows > : correct WHOLE_EXTENT / UPDATE_EXTENT > > // color->GetOutput()->Print(cout); // debug output shows : Extent > wrong ! > > > > // Display the result > > vtkSmartPointer renderWindowInteractor = > vtkSmartPointer::New(); > > vtkSmartPointer imageViewer = > vtkSmartPointer::New(); > > > > imageViewer->SetInputData(canvas->GetOutput()); // using this > line, I get sensible output > > //imageViewer->SetInputData(color->GetOutput()); // using this > line, I get an empty viewer and an error message > > > > imageViewer->SetupInteractor(renderWindowInteractor); > > imageViewer->GetRenderer()->ResetCamera(); > > > > renderWindowInteractor->Initialize(); > > renderWindowInteractor->Start(); > > } > > > > > > ------------------------------------------------------------------------------------------------------ > > Registergericht: Traunstein / Registry Court: HRB 275 - Sitz / Head > Office: Traunreut > Aufsichtsratsvorsitzender / Chairman of Supervisory Board: Rainer Burkhard > Gesch?ftsf?hrung / Management Board: Thomas Sesselmann (Vorsitzender / > Chairman), > Michael Grimm, Matthias Fauser, Sebastian Tondorf > > E-Mail Haftungsausschluss / E-Mail Disclaimer: > http://www.heidenhain.de/disclaimer > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From frese at heidenhain.de Wed Jul 2 08:01:20 2014 From: frese at heidenhain.de (Frese Daniel Dr.) Date: Wed, 2 Jul 2014 14:01:20 +0200 Subject: [vtkusers] Extent / Pipeline Problem with vtk 6.1 In-Reply-To: References: <758150D667C235458DE231BB50B9A2B319908F8E99@de01ex07.GLOBAL.JHCN.NET> Message-ID: <758150D667C235458DE231BB50B9A2B31990F6191F@de01ex07.GLOBAL.JHCN.NET> Hi Goodwin, thank you for your feedback. I?ll try again with a more recent snapshot, and if the problem persists, I?ll file a bug. Daniel Von: Goodwin Lawlor [mailto:goodwin.lawlor.lists at gmail.com] Gesendet: Mittwoch, 2. Juli 2014 12:39 An: Frese Daniel Dr. Cc: vtkusers at vtk.org Betreff: Re: [vtkusers] Extent / Pipeline Problem with vtk 6.1 Hi Daniel, On quick inspection this looks like a bug in vtkImageMapToColors not handling the output info. You could file a bug here: http://vtk.org/Bug hth Goodwin On Mon, Jun 30, 2014 at 2:23 PM, Frese Daniel Dr. > wrote: Hi everybody, After porting a working application from vtk 5.x to vtk 6.1, I ran into some problems that I can?t solve by myself. Based on the error messages, I think though, it originates in the modified pipeline behavior of vtk 6.1 (admittedly I use an already aged snapshot from November 2013). I tried to assemble a more or less minimal example to illustrate the problem. Basically I use the pipeline vtkImageCanvasSource2D -> vtkImageMapToColors -> vtkImageViewer2. If I visualize the canvas, without passing through the vtkImageMapToColors filter, everything works fine. If I pass through the vtkImageMapToColors filter, I get a blank render window and the error message : ?vtkTrivialProducer (00F15A08) : This data object does not contain the requested extent.? I printed out the vtkInformation objects of the canvas? output port and the the vtkImageMapToColors? input port, and both outputs showed the correct extents for WHOLE_EXTENT and UPDATE_EXTENT, but wrong values for COMBINED_UPDATE_EXTENT. Moreover, canvas->GetOutput()->Print() gives also the right extents, whereas the output of the the vtkImageMapToColors shows that basically no meta information has been transmitted. The complete code is below. Does anybody have a clue, what I am missing here ? Thank you, Daniel #include VTK_MODULE_INIT(vtkInteractionStyle); VTK_MODULE_INIT(vtkRenderingOpenGL); #include #include #include #include #include #include #include #include #include void main() { // Creation of canvas drawing vtkSmartPointer canvas = vtkSmartPointer::New(); canvas->SetScalarTypeToUnsignedChar(); canvas->SetExtent(0, 99, 0, 99, 0, 0); canvas->SetDrawColor(255); canvas->DrawSegment(10, 10, 90, 90); canvas->Update(); // canvas->GetOutputInformation(0)->Print(cout); // debug output shows : correct WHOLE_EXTENT / UPDATE_EXTENT // Map colors vtkSmartPointer lut = vtkSmartPointer::New(); lut->SetNumberOfColors(256); lut->SetTableRange(0, 255); lut->SetValueRange(0, 255); lut->Build(); for (int i=0; i<256; i++) lut->SetTableValue(i, i/255.0, 0, 0, 1); vtkSmartPointer color = vtkSmartPointer::New(); color->SetLookupTable(lut); color->SetInputConnection(canvas->GetOutputPort()); // color->GetInputInformation()->Print(cout); // debug output shows : correct WHOLE_EXTENT / UPDATE_EXTENT // color->GetOutput()->Print(cout); // debug output shows : Extent wrong ! // Display the result vtkSmartPointer renderWindowInteractor = vtkSmartPointer::New(); vtkSmartPointer imageViewer = vtkSmartPointer::New(); imageViewer->SetInputData(canvas->GetOutput()); // using this line, I get sensible output //imageViewer->SetInputData(color->GetOutput()); // using this line, I get an empty viewer and an error message imageViewer->SetupInteractor(renderWindowInteractor); imageViewer->GetRenderer()->ResetCamera(); renderWindowInteractor->Initialize(); renderWindowInteractor->Start(); } ------------------------------------------------------------------------------------------------------ Registergericht: Traunstein / Registry Court: HRB 275 - Sitz / Head Office: Traunreut Aufsichtsratsvorsitzender / Chairman of Supervisory Board: Rainer Burkhard Gesch?ftsf?hrung / Management Board: Thomas Sesselmann (Vorsitzender / Chairman), Michael Grimm, Matthias Fauser, Sebastian Tondorf E-Mail Haftungsausschluss / E-Mail Disclaimer: http://www.heidenhain.de/disclaimer _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From lorenzo.cesario at softeco.it Wed Jul 2 08:05:50 2014 From: lorenzo.cesario at softeco.it (Lorenzo Cesario) Date: Wed, 2 Jul 2014 14:05:50 +0200 Subject: [vtkusers] Migration problem vtk 5.8 - vtk 6.1 In-Reply-To: References: <6E9F1E5019D94267897964726438712A.MAI@softeco.it> Message-ID: Hi Marcus, tks for your answer. Yes, I used the #pragma once directive inside my InitVtkObjFactory.h, so the file has the following code: #pragma once #include VTK_MODULE_INIT(vtkInteractionStyle); VTK_MODULE_INIT(vtkRenderingFreeType); VTK_MODULE_INIT(vtkRenderingFreeTypeOpenGL); VTK_MODULE_INIT(vtkRenderingOpenGL); Debugging the code, during the factories creation I can see that the RegisteredFactories object defined in the file vtkObjectFactory.cxx, contains all the 4 factories. Looking inside the items value of that object I can see in the debug tooltip that each one is the related "factory" object. So for the InteractionStyleObjectFactory I can see the class name and the "mother" class vtkObjectBase. Instead, during the exit of my appliation, when the UnRegisterAllFactories() method is called, I can't see anymore this value on the item related to the vtkInteractionStyleObjectFactory (I see only the vtkObjectBase), while for the remaining object factories I continue to see the class name. At last, I fixed this behaviour for the debug 64bit version of my application calling the static method vtkObjectFactory::UnRegisterAllFactories(); just before calling the FreeLibrary of my dll. In this way, when this method is called by the vtkClenaupObjectFactory, the RegisteredFactories is already NULL. It doesn't crash anymore in Debug 32/64 bit and Release 32 bit. It continues crashing in Release 64bit in the vtkCommonCore-6.1.dll. I don't think that this could be a solution, could be a bug in the vtkObjectFactory? Tks, Lorenzo ----- Original Message ----- From: "Marcus D. Hanwell" To: Cc: "VTK Users" Sent: Tuesday, July 01, 2014 7:52 PM Subject: Re: [vtkusers] Migration problem vtk 5.8 - vtk 6.1 > On Tue, Jul 1, 2014 at 4:52 AM, wrote: >> Hi, >> my application has an executable and some dlls. Among them, there is one >> dll that used vtk 5.8 and now I'm doing the migration to the vtk 6.1. >> I'm using Visual Studio 2010 and my appliation is MFC-based. >> >> In the properties of the dll using vtk, I obviously included the >> "Additional Include Directories" and "Additional Library" for the vtk >> header files and .lib files. >> Moreover I added in the "Preprocessor definition" field of the C/C++ >> Property of the same dll, this value: >> vtkRenderingCore_INCLUDE="InitVtkObjFactory.h" and I added the file >> InitVtkObjFactory.h with this code: >> >> #include >> VTK_MODULE_INIT(vtkRenderingOpenGL); >> VTK_MODULE_INIT(vtkInteractionStyle); >> VTK_MODULE_INIT(vtkRenderingFreeType); >> VTK_MODULE_INIT(vtkRenderingFreeTypeOpenGL); >> >> When I close the application it crashes and in the call stack there is >> the last call on vtkCommonCore-6.1.dll. > > I have never tested the code in a scenario like this, although nothing > jumps out as an issue. Do you have header guards around this init > header to ensure it is just called once? It should be safe to call > many times, but it is possible something odd is happening there. >> >> Then, I removed the line inside the file InitVtkObjFactory.h related to >> the InteractionStyle as follows: >> >> #include >> VTK_MODULE_INIT(vtkRenderingOpenGL); >> VTK_MODULE_INIT(vtkRenderingFreeType); >> VTK_MODULE_INIT(vtkRenderingFreeTypeOpenGL); >> >> and in this case, when the application starts, it shows a "warning" >> window from vtk in which is written: >> >> Warning: In >> ..\..\..\..\..\src\Vtk\Rendering\Core\vtkInteractorStyleSwitchBase.cxx, >> line 43 >> vtkInteractorStyleSwitchBase (07EC7FB8): Warning: Link to >> vtkInteractionStyle for default style selection. > > This is there to warn that no default interaction style will be used, > many old applications relied upon this being present and we wanted a > warning. It is just a warning, but it could be quite frustrating to > track down. It is unlikely to cause other side effects if you chose to > ignore it, but there is no way of silencing the warning. >> >> but when I close the application, this time it has no error or crashes. >> I'm using a vtkInteractorStyleTrackballCamera for my RenderWindow. > > If you set a style then all will work as expected. This looks like a > bug in the factory destruction, but I have not seen this in my testing > (I have also not built any VTK-based applications without using > CMake). >> >> Any ideas? Is there anything wrong in the migration related to the new >> modules initialization? >> > It is odd that it would break on such a simple module, with only a > single override. If you select a style you do not need that override, > but it would be nice to figure out what is going wrong here. I am not > aware of similar issues, do you have any more information on how/why > it is crashing? Is the object factory NULL for example? > > Thanks, > > Marcus > > From dave.demarle at kitware.com Wed Jul 2 09:15:07 2014 From: dave.demarle at kitware.com (David E DeMarle) Date: Wed, 2 Jul 2014 09:15:07 -0400 Subject: [vtkusers] VTK_USE_MATLAB_MEX VTK6 In-Reply-To: <1404259489077-5727707.post@n5.nabble.com> References: <1404259489077-5727707.post@n5.nabble.com> Message-ID: The matlab interface was not updated during modularization for some reason I do now know. Filters/Matlab needs, for starters, a module.cmake to tell the VTK's cmakescript about it. With that you will turn it on by turning on the Module_vtkFiltersMatlab advanced cmake. David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Tue, Jul 1, 2014 at 8:04 PM, kwayeke via vtkusers wrote: > Has anyone successfully compile VTK6 with matlab using VTK_USE_MATLAB_MEX. > It seems to be that VTK_USE_MATLAB_MEX option is no longer in cmake. > > I want to use the vtk matlab interface described here : > > http://www.kitware.com/media/html/MATLABAndGNURIntegrationWithVTK.html > > and here > > > http://www.kitware.com/media/html/MATLABAndGNURIntegrationWithVTKNowAvailable.html > > Regards, > > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/VTK-USE-MATLAB-MEX-VTK6-tp5727707.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Wed Jul 2 10:01:18 2014 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Wed, 2 Jul 2014 10:01:18 -0400 Subject: [vtkusers] How to get vtkCutter output using spline In-Reply-To: References: Message-ID: This example may help: http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/FitSplineToCutterOutput On Wed, Jul 2, 2014 at 3:45 AM, Safna Ressel wrote: > > Hai Vtk users > > I have cut an objcet with vtkcutter->vtkstripper->this stripper output i am > giving to to a vtkspline filter with vtkKochanekSpline and i need to get > points with regular intervals on the object but am not getting it correctly. > > Did Anyone knows What is the correct way to generate points on object with > Regular intervals using Any Spline. > > > > -- > Thank You > > Safna > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Unpaid intern in BillsBasement at noware dot com From meysam.torabi at gmail.com Wed Jul 2 10:15:22 2014 From: meysam.torabi at gmail.com (Meysam Torabi) Date: Wed, 2 Jul 2014 09:15:22 -0500 Subject: [vtkusers] Extracting shell from unorganized points Message-ID: Hello, Is there a class in vtk to extract a shell (external boundary) from some unorganized points? The attached image explains the problem. Thanks, Meysam ? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ExtractingShell.jpg Type: image/jpeg Size: 100360 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ExtractingShell.jpg Type: image/jpeg Size: 100360 bytes Desc: not available URL: From daviddoria at gmail.com Wed Jul 2 10:23:24 2014 From: daviddoria at gmail.com (David Doria) Date: Wed, 2 Jul 2014 10:23:24 -0400 Subject: [vtkusers] Extracting shell from unorganized points In-Reply-To: References: Message-ID: On Wed, Jul 2, 2014 at 10:15 AM, Meysam Torabi wrote: > Hello, > > Is there a class in vtk to extract a shell (external boundary) from some > unorganized points? The attached image explains the problem. > > Thanks, > Meysam > > > > ? > > I don't believe there is anything like this built into VTK, but I wrote some code for this as part of a project one time. You can read about the technique here: https://github.com/daviddoria/BoundingPolygon/blob/master/VTKJournal/BoundingPolygon.pdf (click "view raw" to download) And the code is here: https://github.com/daviddoria/BoundingPolygon/blob/master/FindBoundaryPoints.cxx (the root of the repository is https://github.com/daviddoria/BoundingPolygon ) Good luck, David -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ExtractingShell.jpg Type: image/jpeg Size: 100360 bytes Desc: not available URL: From roman_glu at mail.ru Wed Jul 2 10:51:26 2014 From: roman_glu at mail.ru (=?UTF-8?B?0KDQvtC80LDQvSDQk9C70YPRhdC+0LLRgdC60LjQuQ==?=) Date: Wed, 02 Jul 2014 18:51:26 +0400 Subject: [vtkusers] =?utf-8?q?FourPaneViewer_don=27t_work=2E_Error=3A_Inva?= =?utf-8?q?lid_Y/X_extent_and_Bad_plane_coordinate_system?= Message-ID: <1404312686.825415127@f303.i.mail.ru> Hi all,? i try to use the FourPaneViewer from VTK-example http://vtk.org/gitweb?p=VTK.git;a=tree;f=Examples/GUI/Qt/FourPaneViewer I build it without errors, but when I run the example, i get several errors: - ERROR: In /home/joe/Programme/VTK6.0.0/Interaction/Widgets/vtkImagePlaneWidget.cxx, line 1688 vtkImagePlaneWidget (0x88f8ef8): Invalid X extent: 2.14748e+09 - ERROR: In /home/joe/Programme/VTK6.0.0/Interaction/Widgets/vtkImagePlaneWidget.cxx, line 1706 vtkImagePlaneWidget (0x88f8ef8): Invalid Y extent: 2.14748e+09 - ERROR: In /home/joe/Programme/VTK6.0.0/Filters/Sources/vtkPlaneSource.cxx, line 102 vtkPlaneSource (0x88f2be0): Bad plane coordinate system - ERROR: In /home/joe/Programme/VTK6.0.0/Common/ExecutionModel/vtkExecutive.cxx, line 754 vtkCompositeDataPipeline (0x8925160): Algorithm vtkPlaneSource(0x88f2be0) returned failure for request: vtkInformation (0x8920700) ? Debug: Off ? Modified Time: 14726 ? Reference Count: 1 ? Registered Events: (none) ? Request: REQUEST_DATA ? ALGORITHM_AFTER_FORWARD: 1 ? FROM_OUTPUT_PORT: 0 ? FORWARD_DIRECTION: 0 Can somebody help me, tell why i get this errors? Thank everybody for help Roman -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcus.hanwell at kitware.com Wed Jul 2 12:56:35 2014 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Wed, 2 Jul 2014 12:56:35 -0400 Subject: [vtkusers] VTK_USE_MATLAB_MEX VTK6 In-Reply-To: <1404259489077-5727707.post@n5.nabble.com> References: <1404259489077-5727707.post@n5.nabble.com> Message-ID: On Tue, Jul 1, 2014 at 8:04 PM, kwayeke via vtkusers wrote: > Has anyone successfully compile VTK6 with matlab using VTK_USE_MATLAB_MEX. > It seems to be that VTK_USE_MATLAB_MEX option is no longer in cmake. > > I want to use the vtk matlab interface described here : > > http://www.kitware.com/media/html/MATLABAndGNURIntegrationWithVTK.html > > and here > > http://www.kitware.com/media/html/MATLABAndGNURIntegrationWithVTKNowAvailable.html > We kept the code but at the time had no way to build/verify and so a new module was not created. This was contributed, it would be great to bring it back. As Dave said we would need a module.cmake, and someone with Matlab to build/test. This is one of the harder ones as it requires a license for something we don't have generally available. It may just work if you add a module.cmake with the appropriate dependencies. Marucus From marcus.hanwell at kitware.com Wed Jul 2 13:05:24 2014 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Wed, 2 Jul 2014 13:05:24 -0400 Subject: [vtkusers] Migration problem vtk 5.8 - vtk 6.1 In-Reply-To: References: <6E9F1E5019D94267897964726438712A.MAI@softeco.it> Message-ID: Hi Lorenzo, On Wed, Jul 2, 2014 at 8:05 AM, Lorenzo Cesario wrote: > Hi Marcus, > tks for your answer. Yes, I used the #pragma once directive inside my > InitVtkObjFactory.h, so the file has the following code: > > #pragma once > > #include > VTK_MODULE_INIT(vtkInteractionStyle); > VTK_MODULE_INIT(vtkRenderingFreeType); > VTK_MODULE_INIT(vtkRenderingFreeTypeOpenGL); > VTK_MODULE_INIT(vtkRenderingOpenGL); > > Debugging the code, during the factories creation I can see that the > RegisteredFactories object defined in the file vtkObjectFactory.cxx, > contains all the 4 factories. Looking inside the items value of that object > I can see in the debug tooltip that each one is the related "factory" > object. So for the InteractionStyleObjectFactory I can see the class name > and the "mother" class vtkObjectBase. > Instead, during the exit of my appliation, when the UnRegisterAllFactories() > method is called, I can't see anymore this value on the item related to the > vtkInteractionStyleObjectFactory (I see only the vtkObjectBase), while for > the remaining object factories I continue to see the class name. > At last, I fixed this behaviour for the debug 64bit version of my > application calling the static method > vtkObjectFactory::UnRegisterAllFactories(); just before calling the > FreeLibrary of my dll. In this way, when this method is called by the > vtkClenaupObjectFactory, the RegisteredFactories is already NULL. > It doesn't crash anymore in Debug 32/64 bit and Release 32 bit. It continues > crashing in Release 64bit in the vtkCommonCore-6.1.dll. > I don't think that this could be a solution, could be a bug in the > vtkObjectFactory? > It certainly sounds odd, Visual Studio 2010 is pretty well tested. I am not sure, but it sounds like an issue with the object factory or a compiler issue. It is odd that you have a architecture/build specific issue (32/64 bit on the same system) when calling it directly. Sorry I can't be more help, I will see if I can reproduce this. I also recently cleaned up a lot of the object factory code for implementation modules a few weeks ago to ensure it is more consistent across modules. Did you try a clean build (sounds like you probably did with this level of experimentation). Marcus From bryan at radialogica.com Wed Jul 2 15:18:14 2014 From: bryan at radialogica.com (Bryan Cool) Date: Wed, 2 Jul 2014 14:18:14 -0500 Subject: [vtkusers] Inclusiveness of Rasterization Message-ID: <01c401cf962a$6120b500$23621f00$@radialogica.com> Hi everyone, I noticed that vtkImageStencilRaster has code like the following in InsertLine and FillStencilData, for both the x and y directions: if (x1 >= xmin) { r1 = vtkMath::Floor(x1) + 1; } if (x2 < xmax) { r2 = vtkMath::Floor(x2); } Correct me if I'm wrong, but it looks like the lower side is exclusive, while the upper end is inclusive. The upshot of this is that the only way to stencil the first pixel is to have a line intersect the row on the negative side of the first pixel (in the extents). On the other hand, to stencil the last pixel a line only need intersect anywhere past the second-to-last pixel (in the extents). Assuming that's true, it seems a bit asymmetric. Is there any way to have exclusive behavior on both ends? Thanks, Bryan From jmerkow at gmail.com Wed Jul 2 15:35:59 2014 From: jmerkow at gmail.com (jmerkow) Date: Wed, 2 Jul 2014 12:35:59 -0700 (PDT) Subject: [vtkusers] VTK_USE_MATLAB_MEX VTK6 In-Reply-To: References: <1404259489077-5727707.post@n5.nabble.com> Message-ID: <1404329759347-5727723.post@n5.nabble.com> I have a working copy of matlab, and an interest in using this myself. So, I'll take a crack at it... Is anyone aware of the last commit that this feature worked? Any other tips, or some examples are very welcome as well. -Jameson -- View this message in context: http://vtk.1045678.n5.nabble.com/VTK-USE-MATLAB-MEX-VTK6-tp5727707p5727723.html Sent from the VTK - Users mailing list archive at Nabble.com. From david.gobbi at gmail.com Wed Jul 2 15:50:25 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 2 Jul 2014 13:50:25 -0600 Subject: [vtkusers] Inclusiveness of Rasterization In-Reply-To: <01c401cf962a$6120b500$23621f00$@radialogica.com> References: <01c401cf962a$6120b500$23621f00$@radialogica.com> Message-ID: Hi Bryan, Do you mean inclusive on both ends? Exclusive on both ends would just make it worse... The behavior of the rasterization is 100% intentional. In order for rasterization to work when there are adjacent areas that are being rasterized, it must be exclusive on one end and inclusive on the other end. Otherwise, adjacent areas could end up with either a gap between them or with an overlap. The exclusitivity can be compensated for by subtracting a small tolerance at the lower end or by using other tricks. What is your use case? - David On Wed, Jul 2, 2014 at 1:18 PM, Bryan Cool wrote: > Hi everyone, > > I noticed that vtkImageStencilRaster has code like the following in > InsertLine and FillStencilData, for both the x and y directions: > > if (x1 >= xmin) > { > r1 = vtkMath::Floor(x1) + 1; > } > if (x2 < xmax) > { > r2 = vtkMath::Floor(x2); > } > > Correct me if I'm wrong, but it looks like the lower side is exclusive, > while the upper end is inclusive. The upshot of this is that the only way > to stencil the first pixel is to have a line intersect the row on the > negative side of the first pixel (in the extents). On the other hand, to > stencil the last pixel a line only need intersect anywhere past the > second-to-last pixel (in the extents). > > Assuming that's true, it seems a bit asymmetric. Is there any way to have > exclusive behavior on both ends? > > Thanks, > Bryan > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bryan at radialogica.com Wed Jul 2 16:46:09 2014 From: bryan at radialogica.com (Bryan Cool) Date: Wed, 2 Jul 2014 15:46:09 -0500 Subject: [vtkusers] Inclusiveness of Rasterization In-Reply-To: References: <01c401cf962a$6120b500$23621f00$@radialogica.com> Message-ID: <003b01cf9636$a82e4a00$f88ade00$@radialogica.com> Thanks for the quick reply, David. You're right: I'm in need of inclusivity on both ends. I'm voxelizing contours using vtkPolyDataToImageStencil and I want to ensure that the resulting stencil fully encapsulates the contours. Are there any tricks to compensate that wouldn't require me to modify my points directly? I guess I could just dilate my result, but it would be nice to have it as tight around the contours as possible. Thanks, Bryan From: David Gobbi [mailto:david.gobbi at gmail.com] Sent: Wednesday, July 2, 2014 2:50 PM To: Bryan Cool Cc: VTK Users Subject: Re: [vtkusers] Inclusiveness of Rasterization Hi Bryan, Do you mean inclusive on both ends? Exclusive on both ends would just make it worse... The behavior of the rasterization is 100% intentional. In order for rasterization to work when there are adjacent areas that are being rasterized, it must be exclusive on one end and inclusive on the other end. Otherwise, adjacent areas could end up with either a gap between them or with an overlap. The exclusitivity can be compensated for by subtracting a small tolerance at the lower end or by using other tricks. What is your use case? - David On Wed, Jul 2, 2014 at 1:18 PM, Bryan Cool > wrote: Hi everyone, I noticed that vtkImageStencilRaster has code like the following in InsertLine and FillStencilData, for both the x and y directions: if (x1 >= xmin) { r1 = vtkMath::Floor(x1) + 1; } if (x2 < xmax) { r2 = vtkMath::Floor(x2); } Correct me if I'm wrong, but it looks like the lower side is exclusive, while the upper end is inclusive. The upshot of this is that the only way to stencil the first pixel is to have a line intersect the row on the negative side of the first pixel (in the extents). On the other hand, to stencil the last pixel a line only need intersect anywhere past the second-to-last pixel (in the extents). Assuming that's true, it seems a bit asymmetric. Is there any way to have exclusive behavior on both ends? Thanks, Bryan -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Wed Jul 2 17:16:38 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 2 Jul 2014 15:16:38 -0600 Subject: [vtkusers] Inclusiveness of Rasterization In-Reply-To: <003b01cf9636$a82e4a00$f88ade00$@radialogica.com> References: <01c401cf962a$6120b500$23621f00$@radialogica.com> <003b01cf9636$a82e4a00$f88ade00$@radialogica.com> Message-ID: Have you tried adjusting the Tolerance on vtkPolyDataToImageStencil? You can try setting it to a large value like 0.5, which gives half a pixel in tolerance. That should guarantee that the contour is fully inside of the result. David On Wed, Jul 2, 2014 at 2:46 PM, Bryan Cool wrote: > Thanks for the quick reply, David. You're right: I'm in need of > inclusivity on both ends. I'm voxelizing contours using > vtkPolyDataToImageStencil and I want to ensure that the resulting stencil > fully encapsulates the contours. Are there any tricks to compensate that > wouldn't require me to modify my points directly? I guess I could just > dilate my result, but it would be nice to have it as tight around the > contours as possible. > > > > Thanks, > > Bryan > > > > *From:* David Gobbi [mailto:david.gobbi at gmail.com] > *Sent:* Wednesday, July 2, 2014 2:50 PM > *To:* Bryan Cool > *Cc:* VTK Users > *Subject:* Re: [vtkusers] Inclusiveness of Rasterization > > > > Hi Bryan, > > > > Do you mean inclusive on both ends? Exclusive on both ends would > > just make it worse... > > > > The behavior of the rasterization is 100% intentional. In order for > > rasterization to work when there are adjacent areas that are being > > rasterized, it must be exclusive on one end and inclusive on the > > other end. Otherwise, adjacent areas could end up with either a > > gap between them or with an overlap. > > > > The exclusitivity can be compensated for by subtracting a small > > tolerance at the lower end or by using other tricks. > > > > What is your use case? > > > > - David > > > > > > On Wed, Jul 2, 2014 at 1:18 PM, Bryan Cool wrote: > > Hi everyone, > > I noticed that vtkImageStencilRaster has code like the following in > InsertLine and FillStencilData, for both the x and y directions: > > if (x1 >= xmin) > { > r1 = vtkMath::Floor(x1) + 1; > } > if (x2 < xmax) > { > r2 = vtkMath::Floor(x2); > } > > Correct me if I'm wrong, but it looks like the lower side is exclusive, > while the upper end is inclusive. The upshot of this is that the only way > to stencil the first pixel is to have a line intersect the row on the > negative side of the first pixel (in the extents). On the other hand, to > stencil the last pixel a line only need intersect anywhere past the > second-to-last pixel (in the extents). > > Assuming that's true, it seems a bit asymmetric. Is there any way to have > exclusive behavior on both ends? > > Thanks, > Bryan > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmerkow at gmail.com Wed Jul 2 21:06:26 2014 From: jmerkow at gmail.com (jmerkow) Date: Wed, 2 Jul 2014 18:06:26 -0700 (PDT) Subject: [vtkusers] VTK_USE_MATLAB_MEX VTK6 In-Reply-To: <1404329759347-5727723.post@n5.nabble.com> References: <1404259489077-5727707.post@n5.nabble.com> <1404329759347-5727723.post@n5.nabble.com> Message-ID: <1404349586808-5727727.post@n5.nabble.com> All, Ok, I got the adapter and engine compiling for matlab, and the vtk matlab mex working. I've successfully used it on kubuntu 14.04, Matlab 8.3. I have not tested it on windows. There were a few changes to the cxx code for the vtk 6.0 pipeline, but the rest was CMake. I'd like to contribute it. -Jameson -- View this message in context: http://vtk.1045678.n5.nabble.com/VTK-USE-MATLAB-MEX-VTK6-tp5727707p5727727.html Sent from the VTK - Users mailing list archive at Nabble.com. From dave.demarle at kitware.com Wed Jul 2 21:38:16 2014 From: dave.demarle at kitware.com (David E DeMarle) Date: Wed, 2 Jul 2014 21:38:16 -0400 Subject: [vtkusers] VTK_USE_MATLAB_MEX VTK6 In-Reply-To: <1404349586808-5727727.post@n5.nabble.com> References: <1404259489077-5727707.post@n5.nabble.com> <1404329759347-5727723.post@n5.nabble.com> <1404349586808-5727727.post@n5.nabble.com> Message-ID: Sounds great. We appreciate it! Please follow along with: http://www.vtk.org/Wiki/VTK/Git/Develop and we will review and accept your changes. If you have problems ask and we can help guide you through it. thanks! David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Wed, Jul 2, 2014 at 9:06 PM, jmerkow wrote: > All, > Ok, I got the adapter and engine compiling for matlab, and the vtk matlab > mex working. I've successfully used it on kubuntu 14.04, Matlab 8.3. I have > not tested it on windows. There were a few changes to the cxx code for the > vtk 6.0 pipeline, but the rest was CMake. > I'd like to contribute it. > > -Jameson > > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/VTK-USE-MATLAB-MEX-VTK6-tp5727707p5727727.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bigvision82 at yahoo.com Wed Jul 2 22:57:02 2014 From: bigvision82 at yahoo.com (kwayeke) Date: Wed, 2 Jul 2014 19:57:02 -0700 (PDT) Subject: [vtkusers] VTK_USE_MATLAB_MEX VTK6 In-Reply-To: <1404349586808-5727727.post@n5.nabble.com> References: <1404259489077-5727707.post@n5.nabble.com> <1404329759347-5727723.post@n5.nabble.com> <1404349586808-5727727.post@n5.nabble.com> Message-ID: <1404356222108-5727729.post@n5.nabble.com> Thanks Marcus and David. Jameson can you please help me with the cxx and cmake file you used ? I am using matlab 8.3 on macbook pro. I tried reading : http://www.vtk.org/Wiki/VTK/Module_Development to help me create the module.cmake file Marcus and David wrote about, but I am not exactly sure how to go about with it. nya -- View this message in context: http://vtk.1045678.n5.nabble.com/VTK-USE-MATLAB-MEX-VTK6-tp5727707p5727729.html Sent from the VTK - Users mailing list archive at Nabble.com. From safna.royal10 at gmail.com Thu Jul 3 00:16:11 2014 From: safna.royal10 at gmail.com (safna) Date: Wed, 2 Jul 2014 21:16:11 -0700 (PDT) Subject: [vtkusers] How to get vtkCutter output using spline In-Reply-To: References: Message-ID: <1404360971199-5727730.post@n5.nabble.com> Thanks. .I got the solution already. i used the Spline filter output again to another spline filter then my points are equally distributed. . -- View this message in context: http://vtk.1045678.n5.nabble.com/How-to-get-vtkCutter-output-using-spline-tp5727710p5727730.html Sent from the VTK - Users mailing list archive at Nabble.com. From frese at heidenhain.de Thu Jul 3 03:57:37 2014 From: frese at heidenhain.de (Frese Daniel Dr.) Date: Thu, 3 Jul 2014 09:57:37 +0200 Subject: [vtkusers] Extent / Pipeline Problem with vtk 6.1 In-Reply-To: References: <758150D667C235458DE231BB50B9A2B319908F8E99@de01ex07.GLOBAL.JHCN.NET> Message-ID: <758150D667C235458DE231BB50B9A2B31990F62170@de01ex07.GLOBAL.JHCN.NET> I rechecked the behavior with a more recent git snapshot as of yesterday; the behavior remains the same. So I filed a bug report with ID 0014838. Daniel Von: Goodwin Lawlor [mailto:goodwin.lawlor.lists at gmail.com] Gesendet: Mittwoch, 2. Juli 2014 12:39 An: Frese Daniel Dr. Cc: vtkusers at vtk.org Betreff: Re: [vtkusers] Extent / Pipeline Problem with vtk 6.1 Hi Daniel, On quick inspection this looks like a bug in vtkImageMapToColors not handling the output info. You could file a bug here: http://vtk.org/Bug hth Goodwin On Mon, Jun 30, 2014 at 2:23 PM, Frese Daniel Dr. > wrote: Hi everybody, After porting a working application from vtk 5.x to vtk 6.1, I ran into some problems that I can?t solve by myself. Based on the error messages, I think though, it originates in the modified pipeline behavior of vtk 6.1 (admittedly I use an already aged snapshot from November 2013). I tried to assemble a more or less minimal example to illustrate the problem. Basically I use the pipeline vtkImageCanvasSource2D -> vtkImageMapToColors -> vtkImageViewer2. If I visualize the canvas, without passing through the vtkImageMapToColors filter, everything works fine. If I pass through the vtkImageMapToColors filter, I get a blank render window and the error message : ?vtkTrivialProducer (00F15A08) : This data object does not contain the requested extent.? I printed out the vtkInformation objects of the canvas? output port and the the vtkImageMapToColors? input port, and both outputs showed the correct extents for WHOLE_EXTENT and UPDATE_EXTENT, but wrong values for COMBINED_UPDATE_EXTENT. Moreover, canvas->GetOutput()->Print() gives also the right extents, whereas the output of the the vtkImageMapToColors shows that basically no meta information has been transmitted. The complete code is below. Does anybody have a clue, what I am missing here ? Thank you, Daniel #include VTK_MODULE_INIT(vtkInteractionStyle); VTK_MODULE_INIT(vtkRenderingOpenGL); #include #include #include #include #include #include #include #include #include void main() { // Creation of canvas drawing vtkSmartPointer canvas = vtkSmartPointer::New(); canvas->SetScalarTypeToUnsignedChar(); canvas->SetExtent(0, 99, 0, 99, 0, 0); canvas->SetDrawColor(255); canvas->DrawSegment(10, 10, 90, 90); canvas->Update(); // canvas->GetOutputInformation(0)->Print(cout); // debug output shows : correct WHOLE_EXTENT / UPDATE_EXTENT // Map colors vtkSmartPointer lut = vtkSmartPointer::New(); lut->SetNumberOfColors(256); lut->SetTableRange(0, 255); lut->SetValueRange(0, 255); lut->Build(); for (int i=0; i<256; i++) lut->SetTableValue(i, i/255.0, 0, 0, 1); vtkSmartPointer color = vtkSmartPointer::New(); color->SetLookupTable(lut); color->SetInputConnection(canvas->GetOutputPort()); // color->GetInputInformation()->Print(cout); // debug output shows : correct WHOLE_EXTENT / UPDATE_EXTENT // color->GetOutput()->Print(cout); // debug output shows : Extent wrong ! // Display the result vtkSmartPointer renderWindowInteractor = vtkSmartPointer::New(); vtkSmartPointer imageViewer = vtkSmartPointer::New(); imageViewer->SetInputData(canvas->GetOutput()); // using this line, I get sensible output //imageViewer->SetInputData(color->GetOutput()); // using this line, I get an empty viewer and an error message imageViewer->SetupInteractor(renderWindowInteractor); imageViewer->GetRenderer()->ResetCamera(); renderWindowInteractor->Initialize(); renderWindowInteractor->Start(); } ------------------------------------------------------------------------------------------------------ Registergericht: Traunstein / Registry Court: HRB 275 - Sitz / Head Office: Traunreut Aufsichtsratsvorsitzender / Chairman of Supervisory Board: Rainer Burkhard Gesch?ftsf?hrung / Management Board: Thomas Sesselmann (Vorsitzender / Chairman), Michael Grimm, Matthias Fauser, Sebastian Tondorf E-Mail Haftungsausschluss / E-Mail Disclaimer: http://www.heidenhain.de/disclaimer _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From lorenzo.cesario at softeco.it Thu Jul 3 07:40:56 2014 From: lorenzo.cesario at softeco.it (Lorenzo Cesario) Date: Thu, 3 Jul 2014 13:40:56 +0200 Subject: [vtkusers] R: Migration problem vtk 5.8 - vtk 6.1 Message-ID: Hi Marcus, yes of course I tried a clean build. Anyway, I think that the problem is that I could fix it (although not in all the configurations/architecture) calling the vtkObjectFactory::UnRegisterAllFactories(); that it should be done by ?vtk itself?. My application is a single-document MFC executable, that uses for the visualization in its main CWnd another dll including vtk libraries. As I think it isn?t correct to call that method, could be a bug in vtk? or in any properties of my visual studio projects? Tks, Lorenzo -----Messaggio originale----- Da: Marcus D. Hanwell [mailto:marcus.hanwell at kitware.com] Inviato: mercoled? 2 luglio 2014 19:05 A: Lorenzo Cesario Cc: VTK Users Oggetto: Re: [vtkusers] Migration problem vtk 5.8 - vtk 6.1 Hi Lorenzo, On Wed, Jul 2, 2014 at 8:05 AM, Lorenzo Cesario wrote: > Hi Marcus, > tks for your answer. Yes, I used the #pragma once directive inside my > InitVtkObjFactory.h, so the file has the following code: > > #pragma once > > #include > VTK_MODULE_INIT(vtkInteractionStyle); > VTK_MODULE_INIT(vtkRenderingFreeType); > VTK_MODULE_INIT(vtkRenderingFreeTypeOpenGL); > VTK_MODULE_INIT(vtkRenderingOpenGL); > > Debugging the code, during the factories creation I can see that the > RegisteredFactories object defined in the file vtkObjectFactory.cxx, > contains all the 4 factories. Looking inside the items value of that > object I can see in the debug tooltip that each one is the related "factory" > object. So for the InteractionStyleObjectFactory I can see the class > name and the "mother" class vtkObjectBase. > Instead, during the exit of my appliation, when the > UnRegisterAllFactories() method is called, I can't see anymore this > value on the item related to the vtkInteractionStyleObjectFactory (I > see only the vtkObjectBase), while for the remaining object factories I continue to see the class name. > At last, I fixed this behaviour for the debug 64bit version of my > application calling the static method > vtkObjectFactory::UnRegisterAllFactories(); just before calling the > FreeLibrary of my dll. In this way, when this method is called by the > vtkClenaupObjectFactory, the RegisteredFactories is already NULL. > It doesn't crash anymore in Debug 32/64 bit and Release 32 bit. It > continues crashing in Release 64bit in the vtkCommonCore-6.1.dll. > I don't think that this could be a solution, could be a bug in the > vtkObjectFactory? > It certainly sounds odd, Visual Studio 2010 is pretty well tested. I am not sure, but it sounds like an issue with the object factory or a compiler issue. It is odd that you have a architecture/build specific issue (32/64 bit on the same system) when calling it directly. Sorry I can't be more help, I will see if I can reproduce this. I also recently cleaned up a lot of the object factory code for implementation modules a few weeks ago to ensure it is more consistent across modules. Did you try a clean build (sounds like you probably did with this level of experimentation). Marcus -------------- next part -------------- An HTML attachment was scrubbed... URL: From lakeat at gmail.com Thu Jul 3 10:37:04 2014 From: lakeat at gmail.com (Daniel WEI) Date: Thu, 3 Jul 2014 10:37:04 -0400 Subject: [vtkusers] How to offscreen-render a specific field in VTK? Message-ID: Dear List, I have a .VTK file, having UnstructuredGrid data, containing velocity field and a scalar pressure field. Now I want to do the offscreen rendering. Following the reader->mapper->actor->renderer pattern, I am able to render the grid and export it to an image (using SetRepresentationToWireframe). (I am using C++.) Now I want to render, say the pressure field (p), google shows me that I should use vtkLookupTable, and then SetLookupTable in the mapper. (Please correct me if I am wrong.) But I have no success, the result image is white blank. My questions are: 1. Which reader should I use? Should I continue to use the vtkUnstructuredGridReader? 2. How to get the specific scalar/vector variable in lookuptable? Here is the part of the code related to my question. // ------------// Create a reader: Read the file// ------------ vtkSmartPointer reader = vtkSmartPointer::New();// vtkSmartPointer reader =// vtkSmartPointer::New();// vtkSmartPointer reader =// vtkSmartPointer::New(); reader->SetFileName(inputFilename.c_str()); reader->Update(); vtkSmartPointer lut = vtkSmartPointer::New(); lut->SetNumberOfTableValues(1); lut->Build(); // ------------// Create a mapper// ------------// vtkSmartPointer mapper = // vtkSmartPointer::New(); vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInputConnection(reader->GetOutputPort());// mapper->SetScalarRange(scalarRange[0], scalarRange[1]); mapper->SetScalarModeToUseCellData(); mapper->SetLookupTable(lut); // ------------// Create a actor// ------------ vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); actor->GetProperty()->SetColor(0,0,0); actor->GetProperty()->SetRepresentationToWireframe();// actor->GetProperty()->SetRepresentationToSurface(); PS: Any insight from python or TCL is also welcome. Thanks ?Daniel Wei ---------------------- *University of Notre Dame* -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcus.hanwell at kitware.com Thu Jul 3 11:27:57 2014 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Thu, 3 Jul 2014 11:27:57 -0400 Subject: [vtkusers] R: Migration problem vtk 5.8 - vtk 6.1 In-Reply-To: References: Message-ID: Hi Lorenzo, On Thu, Jul 3, 2014 at 7:40 AM, Lorenzo Cesario wrote: > > Anyway, I think that the problem is that I could fix it (although not in all > the configurations/architecture) calling the > vtkObjectFactory::UnRegisterAllFactories(); that it should be done by ?vtk > itself?. To be totally clear I agree, I still need a minimal example I can reproduce in order to fix it. > > My application is a single-document MFC executable, that uses for the > visualization in its main CWnd another dll including vtk libraries. > > As I think it isn?t correct to call that method, could be a bug in vtk? or > in any properties of my visual studio projects? > Yes, and figuring out which one is the challenge. If you try removing the init from the Visual Studio properties, and simply include it in your application code does this help? I have not seen this method of injecting code, it should work but I am not aware of others using it. I never work with Visual Studio projects without using CMake to generate them, but the object factory code is pretty robust. To be clear this is not expected behavior, but it is unclear to me if it is an issue with your Visual Studio build files or in VTK's C++ code. Marcus From roman_glu at mail.ru Thu Jul 3 11:38:33 2014 From: roman_glu at mail.ru (=?UTF-8?B?0KDQvtC80LDQvSDQk9C70YPRhdC+0LLRgdC60LjQuQ==?=) Date: Thu, 03 Jul 2014 19:38:33 +0400 Subject: [vtkusers] =?utf-8?q?error_when_install_vtk6=2E0_on_windows_7?= Message-ID: <1404401913.669373635@f195.i.mail.ru> Hallo, i try to build and install vtk 6.0 on windows with Microsoft Visual Studio 2010, but i get the following error: 1>? CMake Error at Utilities/KWSys/vtksys/cmake_install.cmake:220 (file): 1>??? file INSTALL cannot find "C:/MyProjects/vtk-bin/bin/Debug/vtksys-6.0.dll". 1>? Call Stack (most recent call first): 1>??? Utilities/KWSys/cmake_install.cmake:36 (include) 1>??? cmake_install.cmake:94 (include) 1> ? 1> ? 1>? -- Up-to-date: C:/Program Files/VTK/include/vtk-6.0/vtksys/System.h 1>? -- Up-to-date: C:/Program Files/VTK/include/vtk-6.0/vtksys/Configure.hxx 1>? -- Up-to-date: C:/Program Files/VTK/include/vtk-6.0/vtksys/String.hxx 1>? -- Up-to-date: C:/Program Files/VTK/include/vtk-6.0/vtksys/hashtable.hxx 1>? -- Up-to-date: C:/Program Files/VTK/include/vtk-6.0/vtksys/hash_fun.hxx 1>? -- Up-to-date: C:/Program Files/VTK/include/vtk-6.0/vtksys/hash_map.hxx 1>? -- Up-to-date: C:/Program Files/VTK/include/vtk-6.0/vtksys/hash_set.hxx 1>? -- Up-to-date: C:/Program Files/VTK/include/vtk-6.0/vtksys/auto_ptr.hxx 1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: Der Befehl "setlocal 1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: "C:\Program Files\CMake\bin\cmake.exe" -DBUILD_TYPE=Debug -P cmake_install.cmake 1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd 1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: :cmEnd 1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone 1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: :cmErrorLevel 1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: exit /b %1 1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: :cmDone 1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd 1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: :VCEnd" wurde mit dem Code 1 beendet. What i do wrong??? Thanks all Roman -- ????? ?????????? -------------- next part -------------- An HTML attachment was scrubbed... URL: From berk.geveci at kitware.com Thu Jul 3 13:10:46 2014 From: berk.geveci at kitware.com (Berk Geveci) Date: Thu, 3 Jul 2014 13:10:46 -0400 Subject: [vtkusers] Extent / Pipeline Problem with vtk 6.1 In-Reply-To: <758150D667C235458DE231BB50B9A2B31990F62170@de01ex07.GLOBAL.JHCN.NET> References: <758150D667C235458DE231BB50B9A2B319908F8E99@de01ex07.GLOBAL.JHCN.NET> <758150D667C235458DE231BB50B9A2B31990F62170@de01ex07.GLOBAL.JHCN.NET> Message-ID: Hi Daniel, I am happy to report that this is not a bug in VTK. It is a bug in the example instead. I am happy because I don't have to fix a bug in my code :-) Take a look at this document: http://www.vtk.org/Wiki/VTK/VTK_6_Migration/Replacement_of_SetInput It explains that SetInputData() does not set a pipeline connection. When you use it, you need to make sure that the pipeline that produce the data is manually updated. So adding a color->Update(); before rendering happens will fix the issue. If your intention is to setup a pipeline connection such that any change in filter parameters are automatically reflected in the viewer, use this instead: imageViewer->SetInputConnection(color->GetOutputPort()); Best, -berk On Thu, Jul 3, 2014 at 3:57 AM, Frese Daniel Dr. wrote: > I rechecked the behavior with a more recent git snapshot as of yesterday; > the behavior remains the same. So I filed a bug report with ID 0014838 > . > > > > Daniel > > > > > > *Von:* Goodwin Lawlor [mailto:goodwin.lawlor.lists at gmail.com] > *Gesendet:* Mittwoch, 2. Juli 2014 12:39 > *An:* Frese Daniel Dr. > *Cc:* vtkusers at vtk.org > *Betreff:* Re: [vtkusers] Extent / Pipeline Problem with vtk 6.1 > > > > Hi Daniel, > > > > On quick inspection this looks like a bug in vtkImageMapToColors not > handling the output info. You could file a bug here: http://vtk.org/Bug > > > > hth > > > > Goodwin > > > > On Mon, Jun 30, 2014 at 2:23 PM, Frese Daniel Dr. > wrote: > > Hi everybody, > > > > After porting a working application from vtk 5.x to vtk 6.1, I ran into > some problems that I can?t solve by myself. Based on the error messages, I > think though, it originates in the modified pipeline behavior of vtk 6.1 > (admittedly I use an already aged snapshot from November 2013). > > > > I tried to assemble a more or less minimal example to illustrate the > problem. Basically I use the pipeline > > vtkImageCanvasSource2D -> vtkImageMapToColors -> vtkImageViewer2. > > If I visualize the canvas, without passing through the vtkImageMapToColors > filter, everything works fine. If I pass through the vtkImageMapToColors > filter, I get a blank render window and the error message : > > ?vtkTrivialProducer (00F15A08) : This data object does not contain the > requested extent.? > > > > I printed out the vtkInformation objects of the canvas? output port and > the the vtkImageMapToColors? input port, and both outputs showed the > correct extents for WHOLE_EXTENT and UPDATE_EXTENT, but wrong values for > COMBINED_UPDATE_EXTENT. Moreover, canvas->GetOutput()->Print() gives also > the right extents, whereas the output of the the vtkImageMapToColors shows > that basically no meta information has been transmitted. > > > > The complete code is below. Does anybody have a clue, what I am missing > here ? > > > > Thank you, > > Daniel > > > > > > #include > > VTK_MODULE_INIT(vtkInteractionStyle); > > VTK_MODULE_INIT(vtkRenderingOpenGL); > > > > #include > > #include > > #include > > #include > > #include > > #include > > #include > > #include > > #include > > > > void main() { > > // Creation of canvas drawing > > vtkSmartPointer canvas = > vtkSmartPointer::New(); > > canvas->SetScalarTypeToUnsignedChar(); > > canvas->SetExtent(0, 99, 0, 99, 0, 0); > > canvas->SetDrawColor(255); > > canvas->DrawSegment(10, 10, 90, 90); > > canvas->Update(); > > // canvas->GetOutputInformation(0)->Print(cout); // debug output > shows : correct WHOLE_EXTENT / UPDATE_EXTENT > > > > // Map colors > > vtkSmartPointer lut = > vtkSmartPointer::New(); > > lut->SetNumberOfColors(256); > > lut->SetTableRange(0, 255); > > lut->SetValueRange(0, 255); > > lut->Build(); > > for (int i=0; i<256; i++) lut->SetTableValue(i, i/255.0, 0, 0, 1); > > > > vtkSmartPointer color = > vtkSmartPointer::New(); > > color->SetLookupTable(lut); > > color->SetInputConnection(canvas->GetOutputPort()); > > // color->GetInputInformation()->Print(cout); // debug output shows > : correct WHOLE_EXTENT / UPDATE_EXTENT > > // color->GetOutput()->Print(cout); // debug output shows : Extent > wrong ! > > > > // Display the result > > vtkSmartPointer renderWindowInteractor = > vtkSmartPointer::New(); > > vtkSmartPointer imageViewer = > vtkSmartPointer::New(); > > > > imageViewer->SetInputData(canvas->GetOutput()); // using this > line, I get sensible output > > //imageViewer->SetInputData(color->GetOutput()); // using this > line, I get an empty viewer and an error message > > > > imageViewer->SetupInteractor(renderWindowInteractor); > > imageViewer->GetRenderer()->ResetCamera(); > > > > renderWindowInteractor->Initialize(); > > renderWindowInteractor->Start(); > > } > > > > > > ------------------------------------------------------------------------------------------------------ > > Registergericht: Traunstein / Registry Court: HRB 275 - Sitz / Head > Office: Traunreut > Aufsichtsratsvorsitzender / Chairman of Supervisory Board: Rainer Burkhard > Gesch?ftsf?hrung / Management Board: Thomas Sesselmann (Vorsitzender / > Chairman), > Michael Grimm, Matthias Fauser, Sebastian Tondorf > > E-Mail Haftungsausschluss / E-Mail Disclaimer: > http://www.heidenhain.de/disclaimer > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mgesho at uwyo.edu Thu Jul 3 13:21:14 2014 From: mgesho at uwyo.edu (Masakazu Gesho) Date: Thu, 3 Jul 2014 17:21:14 +0000 Subject: [vtkusers] VTK 6.2 with BGL -> "VTK_USE_BOOST" issue. Message-ID: <1404408073823.4791@uwyo.edu> Dear: I have wrote a simulator using BGL. Now, I wish to write it to VTK-PGBL mode. Using VTK 6.2, I have difficulty to turn on "VTK_USE_BOOST". How should I proceed this? Thank you for advices. Masa University of Wyoming PhD Petroleum & Chemical Engineering -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Thu Jul 3 14:13:47 2014 From: dave.demarle at kitware.com (David E DeMarle) Date: Thu, 3 Jul 2014 14:13:47 -0400 Subject: [vtkusers] announce: Kitware is hiring - now with more web! Message-ID: Howdy, If you are talented researcher and developer with strong C++ and/or web services development skills, please consider applying to Kitware. We are particularly interested now in developers who have significant web service development talent to help us expand the frontiers of visualization and analytics delivered over the web. At Kitware you will join a fun and talented team and work on many interesting and challenging technical problems - always aiming to deliver robust and widely used software solutions. Specifically, the scientific visualization and medical groups at Kitware is looking for these people: * Scientific Visualization Web Developer (see below) * GUI and Application Software Developer * Informatics Researcher * Informatics Software Developer * HPC Visualization and Data Analysis Software Developer * Scientific Visualization Developer * Research and Development Involving Machine Learning and Medical Image Analysis * Technical Lead in Biomedical Image Analysis and Visualization * Biomechanical Modeling and Surgical Simulation Software Developer Go to http://jobs.kitware.com/opportunities.html for more details and to apply. SCIENTIFIC VISUALIZATION WEB DEVELOPER Job Description: By joining our team you will participate in a dynamic work environment with exceptionally talented coworkers who are committed to high-quality development practices. You will collaborate with esteemed researchers from around the world to create next-generation, open-source software for web applications for data management, analysis, and visualization; design and produce full-featured, modern web interfaces for cutting-edge applications; and will deploy software applications and infrastructure that are used by people, every day, around the world, to improve the world. Work will be performed in the context of an open-source and highly collaborative development model. Qualifications: An ideal candidate should have at least four years of experience in HTML, CSS, and JavaScript, with an undergraduate or higher degree in Computer Science or a related field. Strong software development skills are a must, and familiarity with website UI/UX aesthetics and design as well as JavaScript libraries such as JQuery, Underscore, Backbone, and/or Angular is highly desirable. Candidates should be familiar with tools for good software practice such as git and web testing frameworks. Also desirable is experience with server scripting languages like Python, and server components such as Apache, Node.js, Django, and CherryPy. Strong candidates will also have experience with web visualization libraries such as D3, WebGL, and HTML5 Canvas. C++ experience is a plus. thanks and good luck! David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmerkow at gmail.com Thu Jul 3 16:26:42 2014 From: jmerkow at gmail.com (jmerkow) Date: Thu, 3 Jul 2014 13:26:42 -0700 (PDT) Subject: [vtkusers] VTK_USE_MATLAB_MEX VTK6 In-Reply-To: References: <1404259489077-5727707.post@n5.nabble.com> <1404329759347-5727723.post@n5.nabble.com> <1404349586808-5727727.post@n5.nabble.com> Message-ID: <1404419202291-5727744.post@n5.nabble.com> Does anyone have the files Thomas used in his examples in [1]? In those examples, he shows two renders from VTK, but the code he has posted doesn't include any render windows. I made my own renderwindows, etc to display the data that's passed to the vtkmatlabadapter, the data is displayed correctly, but when I close the window it also exits matlab (cleanly). I was hopping he had some code he used to prevent this... -Jameson [1] http://www.kitware.com/media/html/MATLABAndGNURIntegrationWithVTK.html -- View this message in context: http://vtk.1045678.n5.nabble.com/VTK-USE-MATLAB-MEX-VTK6-tp5727707p5727744.html Sent from the VTK - Users mailing list archive at Nabble.com. From saeed.mazrouei at gmail.com Thu Jul 3 16:32:52 2014 From: saeed.mazrouei at gmail.com (Saeed Mazrouei) Date: Thu, 3 Jul 2014 16:32:52 -0400 Subject: [vtkusers] vtk file for cylindrical Message-ID: Hi Does anyone has a vtk file in cylindrical coordinate. I have data and I need to write them in vtk file for cylindrical coordinate. I just started to learn. please help me -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmerkow at gmail.com Thu Jul 3 17:48:27 2014 From: jmerkow at gmail.com (jmerkow) Date: Thu, 3 Jul 2014 14:48:27 -0700 (PDT) Subject: [vtkusers] VTK_USE_MATLAB_MEX VTK6 In-Reply-To: <1404419202291-5727744.post@n5.nabble.com> References: <1404259489077-5727707.post@n5.nabble.com> <1404329759347-5727723.post@n5.nabble.com> <1404349586808-5727727.post@n5.nabble.com> <1404419202291-5727744.post@n5.nabble.com> Message-ID: <1404424107673-5727746.post@n5.nabble.com> Ok, Im ready to push. I didn't add testing, I can't get figure out how to make tests not require a png. -Jameson -- View this message in context: http://vtk.1045678.n5.nabble.com/VTK-USE-MATLAB-MEX-VTK6-tp5727707p5727746.html Sent from the VTK - Users mailing list archive at Nabble.com. From frese at heidenhain.de Fri Jul 4 02:18:42 2014 From: frese at heidenhain.de (Frese Daniel Dr.) Date: Fri, 4 Jul 2014 08:18:42 +0200 Subject: [vtkusers] Extent / Pipeline Problem with vtk 6.1 In-Reply-To: References: <758150D667C235458DE231BB50B9A2B319908F8E99@de01ex07.GLOBAL.JHCN.NET> <758150D667C235458DE231BB50B9A2B31990F62170@de01ex07.GLOBAL.JHCN.NET> Message-ID: <758150D667C235458DE231BB50B9A2B319910B39EC@de01ex07.GLOBAL.JHCN.NET> Hi Berk, thanks a lot ? it works now. Although I did read that document before, I still did it wrong somehow? Daniel Von: Berk Geveci [mailto:berk.geveci at kitware.com] Gesendet: Donnerstag, 3. Juli 2014 19:11 An: Frese Daniel Dr. Cc: vtkusers at vtk.org Betreff: Re: [vtkusers] Extent / Pipeline Problem with vtk 6.1 Hi Daniel, I am happy to report that this is not a bug in VTK. It is a bug in the example instead. I am happy because I don't have to fix a bug in my code :-) Take a look at this document: http://www.vtk.org/Wiki/VTK/VTK_6_Migration/Replacement_of_SetInput It explains that SetInputData() does not set a pipeline connection. When you use it, you need to make sure that the pipeline that produce the data is manually updated. So adding a color->Update(); before rendering happens will fix the issue. If your intention is to setup a pipeline connection such that any change in filter parameters are automatically reflected in the viewer, use this instead: imageViewer->SetInputConnection(color->GetOutputPort()); Best, -berk On Thu, Jul 3, 2014 at 3:57 AM, Frese Daniel Dr. > wrote: I rechecked the behavior with a more recent git snapshot as of yesterday; the behavior remains the same. So I filed a bug report with ID 0014838. Daniel Von: Goodwin Lawlor [mailto:goodwin.lawlor.lists at gmail.com] Gesendet: Mittwoch, 2. Juli 2014 12:39 An: Frese Daniel Dr. Cc: vtkusers at vtk.org Betreff: Re: [vtkusers] Extent / Pipeline Problem with vtk 6.1 Hi Daniel, On quick inspection this looks like a bug in vtkImageMapToColors not handling the output info. You could file a bug here: http://vtk.org/Bug hth Goodwin On Mon, Jun 30, 2014 at 2:23 PM, Frese Daniel Dr. > wrote: Hi everybody, After porting a working application from vtk 5.x to vtk 6.1, I ran into some problems that I can?t solve by myself. Based on the error messages, I think though, it originates in the modified pipeline behavior of vtk 6.1 (admittedly I use an already aged snapshot from November 2013). I tried to assemble a more or less minimal example to illustrate the problem. Basically I use the pipeline vtkImageCanvasSource2D -> vtkImageMapToColors -> vtkImageViewer2. If I visualize the canvas, without passing through the vtkImageMapToColors filter, everything works fine. If I pass through the vtkImageMapToColors filter, I get a blank render window and the error message : ?vtkTrivialProducer (00F15A08) : This data object does not contain the requested extent.? I printed out the vtkInformation objects of the canvas? output port and the the vtkImageMapToColors? input port, and both outputs showed the correct extents for WHOLE_EXTENT and UPDATE_EXTENT, but wrong values for COMBINED_UPDATE_EXTENT. Moreover, canvas->GetOutput()->Print() gives also the right extents, whereas the output of the the vtkImageMapToColors shows that basically no meta information has been transmitted. The complete code is below. Does anybody have a clue, what I am missing here ? Thank you, Daniel #include VTK_MODULE_INIT(vtkInteractionStyle); VTK_MODULE_INIT(vtkRenderingOpenGL); #include #include #include #include #include #include #include #include #include void main() { // Creation of canvas drawing vtkSmartPointer canvas = vtkSmartPointer::New(); canvas->SetScalarTypeToUnsignedChar(); canvas->SetExtent(0, 99, 0, 99, 0, 0); canvas->SetDrawColor(255); canvas->DrawSegment(10, 10, 90, 90); canvas->Update(); // canvas->GetOutputInformation(0)->Print(cout); // debug output shows : correct WHOLE_EXTENT / UPDATE_EXTENT // Map colors vtkSmartPointer lut = vtkSmartPointer::New(); lut->SetNumberOfColors(256); lut->SetTableRange(0, 255); lut->SetValueRange(0, 255); lut->Build(); for (int i=0; i<256; i++) lut->SetTableValue(i, i/255.0, 0, 0, 1); vtkSmartPointer color = vtkSmartPointer::New(); color->SetLookupTable(lut); color->SetInputConnection(canvas->GetOutputPort()); // color->GetInputInformation()->Print(cout); // debug output shows : correct WHOLE_EXTENT / UPDATE_EXTENT // color->GetOutput()->Print(cout); // debug output shows : Extent wrong ! // Display the result vtkSmartPointer renderWindowInteractor = vtkSmartPointer::New(); vtkSmartPointer imageViewer = vtkSmartPointer::New(); imageViewer->SetInputData(canvas->GetOutput()); // using this line, I get sensible output //imageViewer->SetInputData(color->GetOutput()); // using this line, I get an empty viewer and an error message imageViewer->SetupInteractor(renderWindowInteractor); imageViewer->GetRenderer()->ResetCamera(); renderWindowInteractor->Initialize(); renderWindowInteractor->Start(); } ------------------------------------------------------------------------------------------------------ Registergericht: Traunstein / Registry Court: HRB 275 - Sitz / Head Office: Traunreut Aufsichtsratsvorsitzender / Chairman of Supervisory Board: Rainer Burkhard Gesch?ftsf?hrung / Management Board: Thomas Sesselmann (Vorsitzender / Chairman), Michael Grimm, Matthias Fauser, Sebastian Tondorf E-Mail Haftungsausschluss / E-Mail Disclaimer: http://www.heidenhain.de/disclaimer _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmerkow at gmail.com Fri Jul 4 12:20:47 2014 From: jmerkow at gmail.com (jmerkow) Date: Fri, 4 Jul 2014 09:20:47 -0700 (PDT) Subject: [vtkusers] VTK_USE_MATLAB_MEX VTK6 In-Reply-To: <1404356222108-5727729.post@n5.nabble.com> References: <1404259489077-5727707.post@n5.nabble.com> <1404329759347-5727723.post@n5.nabble.com> <1404349586808-5727727.post@n5.nabble.com> <1404356222108-5727729.post@n5.nabble.com> Message-ID: <1404490847718-5727750.post@n5.nabble.com> Nya, The code is being reviewed, you can take a look at it on gerrit. Here is the topic link: http://review.source.kitware.com/#/t/4367/ Jameson -- View this message in context: http://vtk.1045678.n5.nabble.com/VTK-USE-MATLAB-MEX-VTK6-tp5727707p5727750.html Sent from the VTK - Users mailing list archive at Nabble.com. From bigvision82 at yahoo.com Fri Jul 4 13:56:02 2014 From: bigvision82 at yahoo.com (kwayeke) Date: Fri, 4 Jul 2014 10:56:02 -0700 (PDT) Subject: [vtkusers] VTK_USE_MATLAB_MEX VTK6 In-Reply-To: <1404490847718-5727750.post@n5.nabble.com> References: <1404259489077-5727707.post@n5.nabble.com> <1404329759347-5727723.post@n5.nabble.com> <1404349586808-5727727.post@n5.nabble.com> <1404356222108-5727729.post@n5.nabble.com> <1404490847718-5727750.post@n5.nabble.com> Message-ID: <1404496562621-5727751.post@n5.nabble.com> Thanks Jameson. I will take a look. I have manage to compile it somehow Were you able to run the example below from http://www.kitware.com/media/html/MATLABAndGNURIntegrationWithVTK.html ? I am getting this output with nothing shown in the rendering window: ALGORITHM_AFTER_FORWARD: 1 FORWARD_DIRECTION: 0 FROM_OUTPUT_PORT: 0 I believe the "Normals" in ef->PutArray("Normals", "N") might be passing 0 to the function. #include ?vtkMatlabEngineFilter.h? #include ?vtkSphereSource.h? #include ?vtkWarpVector.h? int main() { vtkSmartPointer ss = vtkSmartPointer::New(); vtkSmartPointer ef =vtkSmartPointer::New(); vtkSmartPointer wv = vtkSmartPointer::New(); ss->SetThetaResolution(100); ss->SetPhiResolution(100); ef->SetInputConnection(ss->GetOutputPort()); vtkSmartPointer polydata = vtkSmartPointer::New(); ef->PutArray("Normals", "N"); ef->SetMatlabScript( "rv = randi([-1,1],size(N,1),1);\ N(:,1) = N(:,1).*rv;\ N(:,2) = N(:,2).*rv;\ N(:,3) = N(:,3).*rv;"); ef->GetArray("N", "N"); wv->SetInputData(ef->GetOutput()); wv->Update(); vtkSmartPointer Mapper = vtkSmartPointer::New(); Mapper->SetInputData(wv->GetPolyDataOutput()); vtkSmartPointer Actor = vtkSmartPointer::New(); Actor->SetMapper(Mapper); } -- View this message in context: http://vtk.1045678.n5.nabble.com/VTK-USE-MATLAB-MEX-VTK6-tp5727707p5727751.html Sent from the VTK - Users mailing list archive at Nabble.com. From saeed.mazrouei at gmail.com Fri Jul 4 20:05:30 2014 From: saeed.mazrouei at gmail.com (Saeed Mazrouei) Date: Fri, 4 Jul 2014 19:05:30 -0500 Subject: [vtkusers] (no subject) Message-ID: Hi Does anyone has a vtk file in cylindrical coordinate. I have data and I need to write them in vtk file for cylindrical coordinate. I just started to learn. please help me -------------- next part -------------- An HTML attachment was scrubbed... URL: From qifl2008 at gmail.com Fri Jul 4 23:12:30 2014 From: qifl2008 at gmail.com (fenglei qi) Date: Fri, 4 Jul 2014 22:12:30 -0500 Subject: [vtkusers] OpenGL requirement for VTK-5.8 Message-ID: Dear everyone, I'm trying to install VTK-5.8 in Redhat 6.5. I got an error. It seems that I didn't install openGL on this system. I wonder which version should I install for VTK-5.8? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From rccm.kyoshimi at gmail.com Sat Jul 5 05:52:06 2014 From: rccm.kyoshimi at gmail.com (kenichiro yoshimi) Date: Sat, 5 Jul 2014 18:52:06 +0900 Subject: [vtkusers] (no subject) In-Reply-To: References: Message-ID: Hi, Unfortunately there may be not the form for cylindrical coordinate system in vtk file format. But you can load your cylindrical data as vtkRectilinearDataSet or vtkStructuredGrid data set and then transform them to Cartecian coordinate system using vtkCylindricalTransform. Thanks, Yoshimi -------------- next part -------------- An HTML attachment was scrubbed... URL: From isimtic at gmail.com Sat Jul 5 11:34:01 2014 From: isimtic at gmail.com (=?UTF-8?B?QWhtZXQgRG/En2Fu?=) Date: Sat, 05 Jul 2014 18:34:01 +0300 Subject: [vtkusers] Vtk Camera Postion Event In-Reply-To: References: Message-ID: <53B81AE9.7090509@gmail.com> Hi I need a vtkCommand which can emit signal when camera or focal point position change is there any vtkCommand like I need. Thank you From bill.lorensen at gmail.com Sat Jul 5 12:02:51 2014 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Sat, 5 Jul 2014 12:02:51 -0400 Subject: [vtkusers] Vtk Camera Postion Event In-Reply-To: <53B81AE9.7090509@gmail.com> References: <53B81AE9.7090509@gmail.com> Message-ID: Not just for those changes, but you can get the modified event. Here is an example: On Sat, Jul 5, 2014 at 11:34 AM, Ahmet Do?an wrote: > Hi I need a vtkCommand which can emit signal when camera or focal point > position change > is there any vtkCommand like I need. > > Thank you > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -- Unpaid intern in BillsBasement at noware dot com -------------- next part -------------- A non-text attachment was scrubbed... Name: CameraModifiedEvent.cxx Type: text/x-c++src Size: 2491 bytes Desc: not available URL: From frid.hou at gmail.com Sun Jul 6 11:39:17 2014 From: frid.hou at gmail.com (frid hou) Date: Sun, 6 Jul 2014 08:39:17 -0700 (PDT) Subject: [vtkusers] Need suggestions about choosing suitable pipeline and data type Message-ID: <1404661157218-5727762.post@n5.nabble.com> Hi, I am writing a application to manipulate some VOIs. VTK 6.1.0 is used and compiled by cmake under VS2012. The application is developed under python. The procedure of this application is : 1. read DICOM files 2. extract some volume of interest 3. pick one of VOI and move in renderer to suitable position 4. mirror VOI 5. perform boolean operation on two of VOIs The current progress is that I can read DICOM files (vtkDICOMReader) into vtkImageData. VOI can be selected and extracted by vtkBoxWidget2 and vtkExtractVOI. The result vtkImageData is tranform to vtkPolyData by vtkMarchingCubes. The mirror VOI function is completed by vtkReflectionFilter. The problem is met when performing boolean operation on two VOIs by using vtkBooleanOperationPolyDataFilter, it crushed when Update() is called. After reading some posts in this maillist. I think this problem maybe caused by something wrong on the constructed PolyData. Then I am trying not to transform vtkImageData to vtkPolyData but using volume rendering directly. By now, it works fine in display and extract VOI. But when moving actor in renderer by vtkInteractorStyleTrackballActor. Once I moved an VOI to another position. After I change back to vtkInteractorStyleTrackballCamera and change cameras position, the VOIs behavior is not the same as PolyData actor. It seems rotate to each rotation center. Any suggestion about how to processing these data? Thanks -- View this message in context: http://vtk.1045678.n5.nabble.com/Need-suggestions-about-choosing-suitable-pipeline-and-data-type-tp5727762.html Sent from the VTK - Users mailing list archive at Nabble.com. From saadkkhan64 at gmail.com Sun Jul 6 18:32:36 2014 From: saadkkhan64 at gmail.com (Saad Khan) Date: Sun, 6 Jul 2014 15:32:36 -0700 (PDT) Subject: [vtkusers] Unable to run BFS on graph! Message-ID: <1404685956336-5727763.post@n5.nabble.com> Hey guys I have been stuck with this for a while now! . 1) I converted polydata to graph using https://github.com/daviddoria/VTK-GraphConversions 2) I have displayed(visualised) the graph and converted it back to mesh again and it is just fine 3) However, I am trying to run Breadth First Search on a chosen vertex in the resulting graph(to find a closed path along the polydata, for segmentation purposes) but it only traverses through 10-15 vertices after which it stops. Heres my code for the traversal, can someone PLEASE! let me know what mistake i have made( or any other solution) : vtkIdType root =0; vtkSmartPointer bfsTree = vtkSmartPointer::New(); bfsTree->SetOriginVertex(root); bfsTree->SetInput(polyDataToGraphFilter->GetOutput()); bfsTree->Update(); vtkSmartPointer bfs = vtkSmartPointer::New(); bfs->SetOriginVertex(root); bfs->SetInput(polyDataToGraphFilter->GetOutput()); bfs->Update(); vtkSmartPointer bfsIterator = vtkSmartPointer::New(); bfsIterator->SetStartVertex(root); bfsIterator->SetTree(bfsTree->GetOutput()); //traverse the tree in a breadth first fashion while(bfsIterator->HasNext()) { vtkIdType nextVertex = bfsIterator->Next(); std::cout << "Next vertex: " << nextVertex < References: Message-ID: Hi Saeed, Please keep the discussion on the mailing list because I am not a VTK specialist. I think cylindrical transformation will do if you confirm that your input coordinate sequence is (r,theta,z) and write code similar to the following: // Get all data from the file vtkSmartPointer reader = vtkSmartPointer::New(); reader->SetFileName(inputFilename.c_str()); reader->Update(); // convert cylindrical to Cartesian coordinate system vtkSmartPointer cylTrans = vtkSmartPointer::New(); vtkSmartPointer cylTransFilter = vtkSmartPointer::New(); cylTransFilter->SetInputData(reader->GetOutput()); cylTransFilter->SetTransform(cylTrans); cylTransFilter->Update(); However there is a possibility that the transformed results will have a lack of the resolution in the circumferential direction. In that case, you may need to subdivide in theta direction on input data preliminarily. Regards, yoshimi 2014-07-06 0:19 GMT+09:00 Saeed Mazrouei : > Hi, > > Thanks for your reply. > > I can read my data and make vtk structured grid but I do not know > How can I transform data to Cartesian coordinate system using > vtkCylindricalTransform. > Iwould appreciate if you tell me. > Regards > Saeed > > > On Sat, Jul 5, 2014 at 4:52 AM, kenichiro yoshimi > wrote: > >> Hi, >> >> Unfortunately there may be not the form for cylindrical coordinate >> system in vtk file format. But you can load your cylindrical data as >> vtkRectilinearDataSet or vtkStructuredGrid data set and then transform >> them to Cartecian coordinate system using vtkCylindricalTransform. >> >> Thanks, >> Yoshimi >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From xpelaox at gmail.com Sun Jul 6 22:50:37 2014 From: xpelaox at gmail.com (ferluduena) Date: Sun, 6 Jul 2014 19:50:37 -0700 (PDT) Subject: [vtkusers] Generate Volume from set of 3D points Message-ID: <1404701437295-5727767.post@n5.nabble.com> i'm learning how to use VTK. So i got this example code : http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/EmbedPointsIntoVolume Which generates a volume from a set of points stored in a .vti file. I'm trying to make this work with a set of points i imput manually in code, just to see how this works... but the program ALWAYS just generates a cube... am i missing something? Thanks a lot in advance! Here is my code: -- View this message in context: http://vtk.1045678.n5.nabble.com/Generate-Volume-from-set-of-3D-points-tp5727767.html Sent from the VTK - Users mailing list archive at Nabble.com. From hectordejea at gmail.com Mon Jul 7 05:35:08 2014 From: hectordejea at gmail.com (Hector Dejea) Date: Mon, 7 Jul 2014 11:35:08 +0200 Subject: [vtkusers] Computing distance using distance widget with previously set points Message-ID: Dear all, I am trying to implement a distance widget with a previously set representation (I want to give the points programatically and not by clicking on the screen). I tried the following code and the distance computed is correct, but the widget shows a line joining two points that are not the ones I typed in the code. In the attached image, the blue lines joins the correct points, the green one corresponds to the widget. Thanks, Hector vtkSmartPointer distanceWidget = vtkSmartPointer::New(); distanceWidget->SetInteractor(renderWindowInteractor); distanceWidget->CreateDefaultRepresentation(); vtkDistanceRepresentation * distRep = distanceWidget->GetDistanceRepresentation(); distRep->SetPoint1WorldPosition(PointInit); distRep->SetPoint2WorldPosition(PointEnd); distanceWidget->SetWidgetStateToManipulate(); -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screenshot from 2014-07-07 11:34:10.png Type: image/png Size: 38177 bytes Desc: not available URL: From lorenzo.cesario at softeco.it Mon Jul 7 10:33:25 2014 From: lorenzo.cesario at softeco.it (Lorenzo Cesario) Date: Mon, 7 Jul 2014 16:33:25 +0200 Subject: [vtkusers] R: Migration problem vtk 5.8 - vtk 6.1 In-Reply-To: References: Message-ID: Hi Marcus, please find attached a simple test project I made extracting and simplifying as much as I could my original software application. Inside the file Test_VtkMFC.zip there is a README.txt file explaining how to build and reproduce the bug. It is a templated MFC-based application from VS2010 (single doc and Office 2007 Ribbon style). Let me know if it crashes in Release 64 bit and if you can see where it is the problem (e.g. in one of my project settings). Tks, Lorenzo -----Messaggio originale----- From: Marcus D. Hanwell Sent: Thursday, July 03, 2014 5:27 PM To: Lorenzo Cesario Cc: markus.hanwell at kitware.com ; VTK Users Subject: Re: [vtkusers] R: Migration problem vtk 5.8 - vtk 6.1 Hi Lorenzo, On Thu, Jul 3, 2014 at 7:40 AM, Lorenzo Cesario wrote: > > Anyway, I think that the problem is that I could fix it (although not in > all > the configurations/architecture) calling the > vtkObjectFactory::UnRegisterAllFactories(); that it should be done by ?vtk > itself?. To be totally clear I agree, I still need a minimal example I can reproduce in order to fix it. > > My application is a single-document MFC executable, that uses for the > visualization in its main CWnd another dll including vtk libraries. > > As I think it isn?t correct to call that method, could be a bug in vtk? or > in any properties of my visual studio projects? > Yes, and figuring out which one is the challenge. If you try removing the init from the Visual Studio properties, and simply include it in your application code does this help? I have not seen this method of injecting code, it should work but I am not aware of others using it. I never work with Visual Studio projects without using CMake to generate them, but the object factory code is pretty robust. To be clear this is not expected behavior, but it is unclear to me if it is an issue with your Visual Studio build files or in VTK's C++ code. Marcus -------------- next part -------------- A non-text attachment was scrubbed... Name: Test_VtkMFC.zip Type: application/x-zip-compressed Size: 176467 bytes Desc: not available URL: From amb2189 at rit.edu Mon Jul 7 12:16:07 2014 From: amb2189 at rit.edu (Citizen Snips) Date: Mon, 7 Jul 2014 09:16:07 -0700 (PDT) Subject: [vtkusers] Update position of multiple render windows Message-ID: <1404749767214-5727775.post@n5.nabble.com> (I'm copy/pasting this from my StackOverflow post since it's pretty well-developed so far. Forgive me if that's an offense) I'm running into a bit of a problem when trying to run multiple render windows in a Python VTK application I'm writing. The application is an attempt to render a 3D model in two separate views for a stereo application (i.e. Left render and right render), but I'm having an issue with updating the cameras of each window simultaneously. I currently have two nearly identical pipelines set up, each with its own vtkCamera, vtkRenderWindow, vtkRenderer, and vtkRenderWindowInteractor, the only difference being that the right camera is positionally shifted 30 units along the X axis. Each of the render window interactors is being updated via the vtkRenderWindowInteractor.AddObserver() method that calls a simple function to reset the cameras to their original positions and orientations. The biggest issue is that this only seems to occur on one window at a time, specifically the window in focus at the time. It's as if the interactor's timer just shuts off once the interactor loses focus. In addition, when I hold down the mouse (And thus move the camera around), the rendered image begins to 'drift', resetting to a less and less correct position even though I have hardcoded the coordinates into the function. Obviously I'm very new to VTK, and much of what goes on is fairly confusing as so much is hidden in the backend, so it would be amazing to acquire some assistance on the matter. My code is below. Thanks guys! from vtk import* from parse import * import os import time, signal, threading def ParseSIG(signum, stack): print signum return class vtkGyroCallback(): def __init__(self): pass def execute(self, obj, event): #Modified segment to accept input for leftCam position gyro = (raw_input()) xyz = parse("{} {} {}", gyro) #This still prints every 100ms, but camera doesn't update! print xyz #These arguments are updated and the call is made. self.leftCam.SetPosition(float(xyz[0]), float(xyz[1]), float(xyz[2])) self.leftCam.SetFocalPoint(0,0,0) self.leftCam.SetViewUp(0,1,0) self.leftCam.OrthogonalizeViewUp() self.rightCam.SetPosition(10, 40, 100) self.rightCam.SetFocalPoint(0,0,0) self.rightCam.SetViewUp(0,1,0) self.rightCam.OrthogonalizeViewUp() #Just a guess obj.Update() return def main(): # create two cameras cameraR = vtkCamera() cameraR.SetPosition(0,0,200) cameraR.SetFocalPoint(0,0,0) cameraL = vtkCamera() cameraL.SetPosition(40,0,200) cameraL.SetFocalPoint(0,0,0) # create a rendering window and renderer renR = vtkRenderer() renR.SetActiveCamera(cameraR) renL = vtkRenderer() renL.SetActiveCamera(cameraL) # create source reader = vtkPolyDataReader() path = "/home/compilezone/Documents/3DSlicer/SlicerScenes/LegoModel-6_25/Model_5_blood.vtk" reader.SetFileName(path) reader.Update() # create render window renWinR = vtkRenderWindow() renWinR.AddRenderer(renR) renWinR.SetWindowName("Right") renWinL = vtkRenderWindow() renWinL.AddRenderer(renL) renWinL.SetWindowName("Left") # create a render window interactor irenR = vtkRenderWindowInteractor() irenR.SetRenderWindow(renWinR) irenL = vtkRenderWindowInteractor() irenL.SetRenderWindow(renWinL) # mapper mapper = vtkPolyDataMapper() mapper.SetInput(reader.GetOutput()) # actor actor = vtkActor() actor.SetMapper(mapper) # assign actor to the renderer renR.AddActor(actor) renL.AddActor(actor) # enable user interface interactor renWinR.Render() renWinL.Render() irenR.Initialize() irenL.Initialize() #Create callback object for camera manipulation cb = vtkGyroCallback() cb.rightCam = cameraR cb.leftCam = cameraL renWinR.AddObserver('InteractionEvent', cb.execute) renWinL.AddObserver('InteractionEvent', cb.execute) irenR.AddObserver('TimerEvent', cb.execute) irenL.AddObserver('TimerEvent', cb.execute) timerIDR = irenR.CreateRepeatingTimer(100) timerIDL = irenL.CreateRepeatingTimer(100) irenR.Start() irenL.Start() if __name__ == '__main__': main() EDIT 1: I modified the code to accept user input for the self.leftCam.SetPosition() call within the vtkGyroCallback.execute() method (Thus replacing the hardcoded "10, 40, 100" parameters with three input variables) then piped the output of a script that simply displayed three random values into my main program. What this should have accomplished was having a render window that would constantly change position. Instead, nothing happens until I click on the screen, at which point the expected functionality begins. The whole time, timer events are still firing and inputs are still being accepted, yet the cameras refuse to update until a mouse event occurs within the scope of their window. What is the deal? EDIT 2 I've dug around some more and found that within the vtkObject::InvokeEvent() method that is called within every interaction event there is a focus loop that overrides all observers that do not pertain to the object in focus. I'm going to investigate if there is a way to remove focus so that it will instead bypass this focus loop and go to the unfocused loop that handles non focused objects. -- View this message in context: http://vtk.1045678.n5.nabble.com/Update-position-of-multiple-render-windows-tp5727775.html Sent from the VTK - Users mailing list archive at Nabble.com. From carlinhosmp87 at gmail.com Mon Jul 7 12:18:04 2014 From: carlinhosmp87 at gmail.com (carlinhos) Date: Mon, 7 Jul 2014 09:18:04 -0700 (PDT) Subject: [vtkusers] GLSL Shader on a vtkActor (VTK 6.1 and Qt 5.2.1) Message-ID: <1404749884394-5727776.post@n5.nabble.com> Hi all, I have an assembly with different actors into a vtkRenderWindow. I load a shader with the class vtkShader2, and create the program with vtkShaderProgram2, all ok with this. After that, i wanted to attach the shader to the actors (i'm going to use different shaders, depending on the actors). The problem is i didn't find examples or documentation to do this and i'm not capable to use the classes for the shaders correctly. I searched into the class vtkOpenGLProperty to set the vtkShaderProgram2 with the method "SetPropProgram" and i set the property of the actors with that one, but vtk shows me a warning window with a conflict between the default shaders and mine (total 4 shaders, 2 vertex and 2 fragment). Can someone help me? Thanks in advance!! -- View this message in context: http://vtk.1045678.n5.nabble.com/GLSL-Shader-on-a-vtkActor-VTK-6-1-and-Qt-5-2-1-tp5727776.html Sent from the VTK - Users mailing list archive at Nabble.com. From saeed.mazrouei at gmail.com Mon Jul 7 12:41:50 2014 From: saeed.mazrouei at gmail.com (Saeed Mazrouei) Date: Mon, 7 Jul 2014 11:41:50 -0500 Subject: [vtkusers] (no subject) In-Reply-To: References: Message-ID: Hi all, thanks to Yoshimi that gave me some ideas about transferring data from cylindrical Cartesian. I am pretty new in paraview and specially in scripting in it. this is the script that he gave me: // Get all data from the file vtkSmartPointer reader = vtkSmartPointer::New(); reader->SetFileName(inputFilename.c_str()); reader->Update(); // convert cylindrical to Cartesian coordinate system vtkSmartPointer cylTrans = vtkSmartPointer::New(); vtkSmartPointer cylTransFilter = vtkSmartPointer::New(); cylTransFilter->SetInputData(reader->GetOutput()); cylTransFilter->SetTransform(cylTrans); cylTransFilter->Update(); I would appreciate if somebody help me to understand this script better because I have some errors when I put it in paraviewfilterring . Regards, Saeed On Sun, Jul 6, 2014 at 7:35 PM, kenichiro yoshimi wrote: > Hi Saeed, > > Please keep the discussion on the mailing list because I am not a VTK > specialist. > > I think cylindrical transformation will do if you confirm that your input > coordinate sequence is (r,theta,z) and write code similar to the following: > > // Get all data from the file > vtkSmartPointer reader = > vtkSmartPointer::New(); > reader->SetFileName(inputFilename.c_str()); > reader->Update(); > > // convert cylindrical to Cartesian coordinate system > vtkSmartPointer cylTrans = > vtkSmartPointer::New(); > > vtkSmartPointer cylTransFilter = > vtkSmartPointer::New(); > cylTransFilter->SetInputData(reader->GetOutput()); > cylTransFilter->SetTransform(cylTrans); > cylTransFilter->Update(); > > However there is a possibility that the transformed results will have a > lack of the resolution in the circumferential direction. In that case, you > may need to subdivide in theta direction on input data preliminarily. > > Regards, > yoshimi > > > 2014-07-06 0:19 GMT+09:00 Saeed Mazrouei : > > Hi, >> >> Thanks for your reply. >> >> I can read my data and make vtk structured grid but I do not know >> How can I transform data to Cartesian coordinate system using >> vtkCylindricalTransform. >> Iwould appreciate if you tell me. >> Regards >> Saeed >> >> >> On Sat, Jul 5, 2014 at 4:52 AM, kenichiro yoshimi < >> rccm.kyoshimi at gmail.com> wrote: >> >>> Hi, >>> >>> Unfortunately there may be not the form for cylindrical coordinate >>> system in vtk file format. But you can load your cylindrical data as >>> vtkRectilinearDataSet or vtkStructuredGrid data set and then transform >>> them to Cartecian coordinate system using vtkCylindricalTransform. >>> >>> Thanks, >>> Yoshimi >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdrahos at robodoc.com Mon Jul 7 13:37:14 2014 From: mdrahos at robodoc.com (Miro Drahos) Date: Mon, 7 Jul 2014 10:37:14 -0700 Subject: [vtkusers] OpenGL requirement for VTK-5.8 In-Reply-To: References: Message-ID: <53BADACA.3050508@robodoc.com> Try to install package mesa-libGL-devel and its dependencies. HTH, Miro On 07/04/2014 08:12 PM, fenglei qi wrote: > Dear everyone, > > I'm trying to install VTK-5.8 in Redhat 6.5. I got an error. It seems > that I didn't install openGL on this system. I wonder which version > should I install for VTK-5.8? Thanks From john.mangeri at uconn.edu Mon Jul 7 13:39:08 2014 From: john.mangeri at uconn.edu (John Mangeri) Date: Mon, 7 Jul 2014 13:39:08 -0400 Subject: [vtkusers] Issue with ParaView 4.1.0 Message-ID: Apologies if this is going to the wrong forum. I'm currently trying to compare two different mesh solution output files in ParaView 4.1.0 Linux64bit(Ubuntu 12.04 LTS). I'm getting an strange error that doesn't make much sense and I think may have something to do with my settings. I have a data range for the following variables to be rendered. File_1: disp_Magnitude: [0,.100] disp_x: [-0.001,0.001] disp_y: [-2e-5, 2e-5] disp_z: [-0.10, 2e-6] File_2: disp_Magnitude: [0,.100] disp_x: [-0.002,0.002] disp_y: [-8e-6,0.001] disp_z: [-0.10,0.0110] File_2 seems to be able to be rendered fine in ParaView but File_1 is giving me troubles. It says "Data range too small to render" in the corner Mapping Data section. I have another program(a simple gui with my solver) that can open these types of files(Exodus II .e format) and all is fine(no errors, the data is there) for both File_1 and File_2. Does anyone know what might be going on here? A couple things I've tried -For File_1 I tried to set a log scale for the color map transfer function and got this error: " Warning: Range [0,0.100038] invalid for log scaling. Changing to [0.0100038,0.100038]." So I know that the program sees the correct data range or does it? -I've also looked in the information tab for my exodus object in ParaView. It says my data ranges for all of the variables are type double [0,0] but this is absolutely wrong since I can open the same file in my gui and view the mesh with the correct data ranges for each of these variables. I also think the error for log scale conflicts this statement. Why does the information tab say [0,0] but log scale reads a range of [0,0.1]? -If I open File_1 and then open File_2 in this order I get the same error for File_2 that I get for File_1. Then if I change my disp_Mag variable to disp_X the problem ceases for File_2 Also I'm sure all of my settings are set to DEFAULT since I haven't changed them at all. Thanks for the help John M -------------- next part -------------- An HTML attachment was scrubbed... URL: From bamb.bakang at gmail.com Mon Jul 7 16:21:57 2014 From: bamb.bakang at gmail.com (Leeloo) Date: Mon, 7 Jul 2014 13:21:57 -0700 (PDT) Subject: [vtkusers] Get homogeneous matrix of a vtkImageSlice Message-ID: <1404764517501-5727786.post@n5.nabble.com> Hi ! I am trying to get a 4x4 transform Matrix in order to use it on contours made on a vtkImageSlice. I used two orientation vectors, calculate a third on with a cross operation, then made a matrix with them . v1x,v2x,vx,0 v1y,v2y,vy,0 v1z,v2z,vz,0 0,0,0,1 Did I thought well or ? -- View this message in context: http://vtk.1045678.n5.nabble.com/Get-homogeneous-matrix-of-a-vtkImageSlice-tp5727786.html Sent from the VTK - Users mailing list archive at Nabble.com. From simon.esneault at gmail.com Tue Jul 8 05:41:01 2014 From: simon.esneault at gmail.com (Simon ESNEAULT) Date: Tue, 8 Jul 2014 11:41:01 +0200 Subject: [vtkusers] About vtkImageReslice interpolation Message-ID: Hi All, We use vtkImageResample/vtkImageReslice (from vtk 5.8.1) quite a lot here, and I've noticed a strange behavior. If we down sample a volume by a factor of 2 in all 3 directions, the output image will be the exact same if we use a nearest neighborhood, linear or cubic interpolation. There seems to be no interpolation at all if the reduction factor is a power of two. If the reduction factor is set to 2.00001, the interpolation is performed correctly when asked for linear or cubic. Is this an intended behavior ? After some debugging : In the file vtkImageReslice.cxx, method vtkTricubicInterpCoeffs (line 1503) with a power of 2 factor we always fall back to the part with the comment // no interpolation (line 1510), but I don't understand why. And last question : there is a new vtkImageResize that was introduced in vtk 5.10, will the behavior be the same ? Thanks for your help -Simon -- ------------------------------------------------------------------ Simon Esneault 13 rue Vasselot 35000 Rennes, France Tel : 06 64 61 30 94 Mail : simon.esneault at gmail.com ------------------------------------------------------------------ -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Tue Jul 8 08:08:46 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 8 Jul 2014 06:08:46 -0600 Subject: [vtkusers] [vtk-developers] About vtkImageReslice interpolation In-Reply-To: References: Message-ID: Hi Simon, If you are downsampling the image by simply changing the output spacing, without introducing a shift in the positions of the samples, then downsampling is a decimation operation (i.e. downsampling by a factor of three is the same as taking every 3rd voxel). This is true whether you use linear, cubic, or NN interpolation. The code optimizes such decimations by turning off the interpolation. In VTK, the Origin is at the center of the first voxel, so a straightforward downsampling places centers each output voxel at exactly the position of one of the input voxels, which is why downsampling becomes decimation. To avoid this, you must shift the output Origin relative to the input Origin. The new vtkImageResize filter has BorderOn()/BorderOff() methods to control this behavior. If Border is Off (the default) the behavior is like vtkImageReslice. If Border in On, then the output origin is automatically shifted relative to the input origin so that the shrink factors are applied relative to the outer corner of the first voxel, rather than relative to the center of the first voxel. I'm not sure if that was a clear explanation, so let me know if you still have questions. - David On Tue, Jul 8, 2014 at 3:41 AM, Simon ESNEAULT wrote: > Hi All, > > We use vtkImageResample/vtkImageReslice (from vtk 5.8.1) quite a lot here, > and I've noticed a strange behavior. > > If we down sample a volume by a factor of 2 in all 3 directions, the output > image will be the exact same if we use a nearest neighborhood, linear or > cubic interpolation. There seems to be no interpolation at all if the > reduction factor is a power of two. > If the reduction factor is set to 2.00001, the interpolation is performed > correctly when asked for linear or cubic. > > Is this an intended behavior ? > > After some debugging : > In the file vtkImageReslice.cxx, method vtkTricubicInterpCoeffs (line 1503) > with a power of 2 factor we always fall back to the part with the comment // > no interpolation (line 1510), but I don't understand why. > > And last question : there is a new vtkImageResize that was introduced in vtk > 5.10, will the behavior be the same ? > > Thanks for your help > > -Simon From matimontg at gmail.com Tue Jul 8 08:24:36 2014 From: matimontg at gmail.com (Matias Montroull) Date: Tue, 8 Jul 2014 09:24:36 -0300 Subject: [vtkusers] Generate Volume from set of 3D points In-Reply-To: <1404701437295-5727767.post@n5.nabble.com> References: <1404701437295-5727767.post@n5.nabble.com> Message-ID: I don't see your code... is it C++? On Sun, Jul 6, 2014 at 11:50 PM, ferluduena wrote: > i'm learning how to use VTK. So i got this example code : > > http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/EmbedPointsIntoVolume > > Which generates a volume from a set of points stored in a .vti file. > > I'm trying to make this work with a set of points i imput manually in code, > just to see how this works... but the program ALWAYS just generates a > cube... am i missing something? > > Thanks a lot in advance! > > Here is my code: > > > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Generate-Volume-from-set-of-3D-points-tp5727767.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.esneault at gmail.com Tue Jul 8 08:56:31 2014 From: simon.esneault at gmail.com (Simon ESNEAULT) Date: Tue, 8 Jul 2014 14:56:31 +0200 Subject: [vtkusers] [vtk-developers] About vtkImageReslice interpolation In-Reply-To: References: Message-ID: Hi David, Thanks for your explanation, very clear as usual ! However, this look like a bug to me, at least from the user point of view. When the linear or cubic interpolation is activated, the user expect to get an interpolation even for simple case where is could be assimilated to a decimation. Will try out your new vtkImageResize that seems promising ! Thanks Simon 2014-07-08 14:08 GMT+02:00 David Gobbi : > Hi Simon, > > If you are downsampling the image by simply changing the output > spacing, without introducing a shift in the positions of the samples, > then downsampling is a decimation operation (i.e. downsampling > by a factor of three is the same as taking every 3rd voxel). This is > true whether you use linear, cubic, or NN interpolation. The code > optimizes such decimations by turning off the interpolation. > > In VTK, the Origin is at the center of the first voxel, so a > straightforward > downsampling places centers each output voxel at exactly the position > of one of the input voxels, which is why downsampling becomes > decimation. To avoid this, you must shift the output Origin relative to > the input Origin. > > The new vtkImageResize filter has BorderOn()/BorderOff() methods > to control this behavior. If Border is Off (the default) the behavior is > like vtkImageReslice. If Border in On, then the output origin is > automatically shifted relative to the input origin so that the shrink > factors are applied relative to the outer corner of the first voxel, > rather than relative to the center of the first voxel. > > I'm not sure if that was a clear explanation, so let me know if you > still have questions. > > - David > > > On Tue, Jul 8, 2014 at 3:41 AM, Simon ESNEAULT > wrote: > > Hi All, > > > > We use vtkImageResample/vtkImageReslice (from vtk 5.8.1) quite a lot > here, > > and I've noticed a strange behavior. > > > > If we down sample a volume by a factor of 2 in all 3 directions, the > output > > image will be the exact same if we use a nearest neighborhood, linear or > > cubic interpolation. There seems to be no interpolation at all if the > > reduction factor is a power of two. > > If the reduction factor is set to 2.00001, the interpolation is performed > > correctly when asked for linear or cubic. > > > > Is this an intended behavior ? > > > > After some debugging : > > In the file vtkImageReslice.cxx, method vtkTricubicInterpCoeffs (line > 1503) > > with a power of 2 factor we always fall back to the part with the > comment // > > no interpolation (line 1510), but I don't understand why. > > > > And last question : there is a new vtkImageResize that was introduced in > vtk > > 5.10, will the behavior be the same ? > > > > Thanks for your help > > > > -Simon > -- ------------------------------------------------------------------ Simon Esneault 13 rue Vasselot 35000 Rennes, France Tel : 06 64 61 30 94 Mail : simon.esneault at gmail.com ------------------------------------------------------------------ -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Tue Jul 8 09:31:53 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 8 Jul 2014 07:31:53 -0600 Subject: [vtkusers] [vtk-developers] About vtkImageReslice interpolation In-Reply-To: References: Message-ID: On Tue, Jul 8, 2014 at 6:56 AM, Simon ESNEAULT wrote: > Hi David, > > Thanks for your explanation, very clear as usual ! > However, this look like a bug to me, at least from the user point of view. > When the linear or cubic interpolation is activated, the user expect to get > an interpolation even for simple case where is could be assimilated to a > decimation. How would the user even know? We're talking about cases where the output would be exactly the same whether or not interpolation is performed. - David From amb2189 at rit.edu Tue Jul 8 12:06:52 2014 From: amb2189 at rit.edu (Alex) Date: Tue, 8 Jul 2014 16:06:52 +0000 (UTC) Subject: [vtkusers] Warp Lens References: <1322487598720-5028881.post@n5.nabble.com> <1322500362572-5029451.post@n5.nabble.com> Message-ID: Mark Cachia hotmail.com> writes: > > Thanks for the reply Jothy. I don't suppose there is a C++ example of using > vtkWarpLens? That is what I am programming in. In the example you provided > the lens is only being applied to a PNG file. Is it possible to apply the > lens directly to the vtkCamera as opposed to individual actors? > > Thanks! > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/Warp-Lens-tp5028881p5029451.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > Hi Mark, I know it's much later, but is there any chance you ever figured this out? I am also looking to apply the vtkWarpLens to a vtkCamera, specifically to perform a barrel distortion. If there's any way you can help, that would be great. Thanks, Alex From alexander.zawadzki at gmail.com Tue Jul 8 12:55:06 2014 From: alexander.zawadzki at gmail.com (zadacka) Date: Tue, 8 Jul 2014 09:55:06 -0700 (PDT) Subject: [vtkusers] Defining OpenGL shader with VTK 6.1 and Python 2.7 Message-ID: <1404838506315-5727797.post@n5.nabble.com> I am trying to use OpenGL shaders to apply a barrel deformation to a VTK actor. The end goal is to adapt febret's shaders for the Oculus Rift. The documentation states that this should be done using vtkShader2, since XML and cg shaders have been depricated in VTK 6.1. However, I am finding it difficult to do this with using Python 2.7. Specifically, transposing the VTK test code into Python hits a snag because vtkShader2 does not appear to be available in the vtk module. I've spent a few days trying to brute-force my way through this, but haven't gotten anywhere, and would really appreciate any advice. Questions: - Can vtkShader2 be accessed via a Python wrapper? - Is is possible to use user-defined OpenGL shaders in VTK 6.1 via Python? In advance, thank you for your help. Alex -- View this message in context: http://vtk.1045678.n5.nabble.com/Defining-OpenGL-shader-with-VTK-6-1-and-Python-2-7-tp5727797.html Sent from the VTK - Users mailing list archive at Nabble.com. From qifl2008 at gmail.com Tue Jul 8 17:19:51 2014 From: qifl2008 at gmail.com (fenglei qi) Date: Tue, 8 Jul 2014 16:19:51 -0500 Subject: [vtkusers] Issue with libvtkRendering.so Message-ID: Hi all, I'm trying to install vtk-5.8 on Redhat Enterprice Linux 6.5. Here is the errors: Linking CXX executable ../../../bin/GraphicsCxxTests ../../../bin/libvtkRendering.so.5.8.0: undefined reference to `glXMakeCurrent' ../../../bin/libvtkRendering.so.5.8.0: undefined reference to `glXGetConfig' ../../../bin/libvtkRendering.so.5.8.0: undefined reference to `glXGetCurrentDisplay' ../../../bin/libvtkRendering.so.5.8.0: undefined reference to `glXGetCurrentContext' ../../../bin/libvtkRendering.so.5.8.0: undefined reference to `glXQueryExtensionsString' ../../../bin/libvtkRendering.so.5.8.0: undefined reference to `glXQueryServerString' ../../../bin/libvtkRendering.so.5.8.0: undefined reference to `glXSwapBuffers' ../../../bin/libvtkRendering.so.5.8.0: undefined reference to `glXDestroyGLXPixmap' ../../../bin/libvtkRendering.so.5.8.0: undefined reference to `glXGetProcAddressARB' ../../../bin/libvtkRendering.so.5.8.0: undefined reference to `glXIsDirect' ../../../bin/libvtkRendering.so.5.8.0: undefined reference to `glXChooseVisual' ../../../bin/libvtkRendering.so.5.8.0: undefined reference to `glXCreateContext' ../../../bin/libvtkRendering.so.5.8.0: undefined reference to `glXDestroyContext' ../../../bin/libvtkRendering.so.5.8.0: undefined reference to `glXQueryExtension' ../../../bin/libvtkRendering.so.5.8.0: undefined reference to `glXGetClientString' collect2: ld returned 1 exit status make[2]: *** [bin/GraphicsCxxTests] Error 1 make[1]: *** [Graphics/Testing/Cxx/CMakeFiles/GraphicsCxxTests.dir/all] Error 2 make: *** [all] Error 2 I have installed libOSMesa.so.* and libGL.so.* from Mesa-10.2.2 sources. The installation dir is $HOME/vtk. Besides, I set up OpenGL_INCLUDE_DIR and OpenGL_gl_LIBRARY to /usr/local/inlcude/GL and /usr/local/lib sperately. I found this problem has been asked before but it's not addressed. Here is the link. http://www.vtk.org/pipermail/vtkusers/2012-April/073885.html Hope someone can give me a hint. Thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: From julien.jomier at kitware.com Wed Jul 9 09:40:32 2014 From: julien.jomier at kitware.com (Julien Jomier) Date: Wed, 09 Jul 2014 15:40:32 +0200 Subject: [vtkusers] ANN: CMake Course - September 29 in Lyon, France Message-ID: <53BD4650.6070909@kitware.com> Kitware will be holding a CMake training course on September 29, 2014 at Kitware's office in Lyon, France. This one-day course will cover CMake, CTest, CPack and CDash. Visit our website for more information and registration details (early registration and student discounts available): http://training.kitware.fr/browse/46 Note that the course will be taught in English. If you have any questions, please contact us at training at kitware.fr. We are looking forward to seeing you in Lyon, Julien -- Kitware SAS 26 rue Louis Gu?rin 69100 Villeurbanne, France http://www.kitware.eu From rippalka at gmail.com Wed Jul 9 12:19:26 2014 From: rippalka at gmail.com (Guillaume Dumont) Date: Wed, 9 Jul 2014 12:19:26 -0400 Subject: [vtkusers] Raw pointer returned as a string in Python Message-ID: Hi all, I am having a little issue concerning a function in Python that returns what seems like a pointer as a string. >> visPts = vtk.vtkSelectVisiblePoints() >> visPts.SetInputData(polyData) >> visPts.SetRenderer(ren) >> zbuff = visPts.Initialize(True) >> print zbuff >> print type(zbuff) and it prints: _000000000dc90040_void_p ?I understand that `vtkSelectVisiblePoints::vtInitialize(bool)'? returns a raw pointer (float*) which I believe cannot directly be exposed to Python, but is there a way to pass it to `vtkSelectVisiblePoints::IsPointOccluded(const double[3], connst float* zBuffer)' in Python somehow? Or is it just a limitation of the Python interface? Thanks a lot for your help! ?Guillaume? -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Wed Jul 9 13:03:42 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 9 Jul 2014 11:03:42 -0600 Subject: [vtkusers] Raw pointer returned as a string in Python In-Reply-To: References: Message-ID: Hi Guillaume, I'm surprised that the "float *Initialize()" method is even wrapped. Generally, such methods only return a "_xxxx_void_p" string if they return "void *". Anyway, in VTK 6.2, the IsPointOccluded() method is wrapped and you will be able to call it after you turn the "zBuffer" into a python container of some sort. I'd recommend using a numpy array as the container for the sake of efficiency. So, what you will have to do is find a way of creating a numpy float array from the hexadecimal address in the string. I have no idea how to do it, but I'm sure there is a way. Note, however, that the docs for vtkSelectVisiblePoints::Initialize() say that it returns a new pointer that must be deleted. In other words, you will also have to find some way of deleting the pointer from Python or else you will end up with a memory leak. - David On Wed, Jul 9, 2014 at 10:19 AM, Guillaume Dumont wrote: > Hi all, > > I am having a little issue concerning a function in Python that returns what > seems like a pointer as a string. > >>> visPts = vtk.vtkSelectVisiblePoints() >>> visPts.SetInputData(polyData) >>> visPts.SetRenderer(ren) >>> zbuff = visPts.Initialize(True) >>> print zbuff >>> print type(zbuff) > > and it prints: > _000000000dc90040_void_p > > > I understand that `vtkSelectVisiblePoints::vtInitialize(bool)' returns a raw > pointer (float*) which I believe cannot directly be exposed to Python, but > is there a way to pass it to `vtkSelectVisiblePoints::IsPointOccluded(const > double[3], connst float* zBuffer)' in Python somehow? Or is it just a > limitation of the Python interface? > > Thanks a lot for your help! > > Guillaume From rippalka at gmail.com Wed Jul 9 15:32:22 2014 From: rippalka at gmail.com (Guillaume Dumont) Date: Wed, 9 Jul 2014 15:32:22 -0400 Subject: [vtkusers] Raw pointer returned as a string in Python In-Reply-To: References: Message-ID: Thanks a lot David for your directions. I managed to accomplish what you said by doing: >> zbuff_str = visPts.Initialize(True) >> address = int(zbuff_str[1:17], 16) >> w, h = renderWin.GetSize() >> size = w*h >> FLOATP = ctypes.c_float * size >> zbuff_buff = FLOATP.from_address(address) >> # will do a copy here, `np.frombuffer(zbuff_buff)' would be more adequat >> zbuff = np.fromiter(zbuff_buff, dtype=np.float, count=size) >> ... >> visPts.IsPointOccluded(point, zbuff) By using numpy.frombuffer I get a crash in `IsPointOccluded'. I didn't get deeper into why this would happen, but this is ok for my use to copy the whole thing. It is a simple prototype so I don't mind the leak for now :) Thanks again, Guillaume On Wed, Jul 9, 2014 at 1:03 PM, David Gobbi wrote: > Hi Guillaume, > > I'm surprised that the "float *Initialize()" method is even wrapped. > Generally, such methods only return a "_xxxx_void_p" string if > they return "void *". > > Anyway, in VTK 6.2, the IsPointOccluded() method is wrapped and > you will be able to call it after you turn the "zBuffer" into a python > container of some sort. I'd recommend using a numpy array as the > container for the sake of efficiency. > > So, what you will have to do is find a way of creating a numpy float > array from the hexadecimal address in the string. I have no idea > how to do it, but I'm sure there is a way. > > Note, however, that the docs for vtkSelectVisiblePoints::Initialize() > say that it returns a new pointer that must be deleted. In other words, > you will also have to find some way of deleting the pointer from > Python or else you will end up with a memory leak. > > - David > > On Wed, Jul 9, 2014 at 10:19 AM, Guillaume Dumont > wrote: > > Hi all, > > > > I am having a little issue concerning a function in Python that returns > what > > seems like a pointer as a string. > > > >>> visPts = vtk.vtkSelectVisiblePoints() > >>> visPts.SetInputData(polyData) > >>> visPts.SetRenderer(ren) > >>> zbuff = visPts.Initialize(True) > >>> print zbuff > >>> print type(zbuff) > > > > and it prints: > > _000000000dc90040_void_p > > > > > > I understand that `vtkSelectVisiblePoints::vtInitialize(bool)' returns a > raw > > pointer (float*) which I believe cannot directly be exposed to Python, > but > > is there a way to pass it to > `vtkSelectVisiblePoints::IsPointOccluded(const > > double[3], connst float* zBuffer)' in Python somehow? Or is it just a > > limitation of the Python interface? > > > > Thanks a lot for your help! > > > > Guillaume > -- Guillaume Dumont Kremlin-Bic?tre, France Email: me at guillaumedumont.com EPITA SCIA 2013 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tongxin829 at gmail.com Wed Jul 9 17:47:37 2014 From: tongxin829 at gmail.com (Xin Tong) Date: Wed, 9 Jul 2014 17:47:37 -0400 Subject: [vtkusers] How to rotate the outline of the vtkImplicitPlaneWidget2 ? Message-ID: Hi, I am designing an interactive visualization program, in which users can interactively rotate the volumetric data. The users are supposed to rotate the data directly, instead of changing the camera position to simulate the rotation. In this program, I have three things so far: a box outline of the volumetric data, a direct volume rendering of the data, and a vtkImplicitPlaneWidget2 to clip the data. To implement the rotation, I apply a transformation by calling the "SetUserTransform()" function of the vtkActor and vtkVolume to transform the data outline and the volume rendering, respectively. However, I could not find such an option of "SetUserTransform()" for vtkImplicitPlaneWidget2 or vtkImplicitPlaneRepresentation. Is there a method I can use to rotate the outline of the vtkImplicitPlaneWidget2 and make it consistent with the rotation of my data ouline? or I should have transformed the data outline and volume rendering in a different way? Thanks in advance, Xin -------------- next part -------------- An HTML attachment was scrubbed... URL: From MEEHANBT at nv.doe.gov Wed Jul 9 20:14:43 2014 From: MEEHANBT at nv.doe.gov (Meehan, Bernard) Date: Thu, 10 Jul 2014 00:14:43 +0000 Subject: [vtkusers] vtkEarthSource colors ... Message-ID: Is there a way to change the foreground/background colors on the vtkEarthSource? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aashish.chaudhary at kitware.com Wed Jul 9 23:19:34 2014 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Wed, 9 Jul 2014 23:19:34 -0400 Subject: [vtkusers] vtkEarthSource colors ... In-Reply-To: <20140710002419.B74FD3B5DB@public.kitware.com> References: <20140710002419.B74FD3B5DB@public.kitware.com> Message-ID: vtkEarthSource creates a polydata, so you should be able to set the color like this: actor->GetProperty()->SetColor(1.0, 0.0, 0.0); //(R,G,B) - Aashsih On Wed, Jul 9, 2014 at 8:14 PM, Meehan, Bernard wrote: > > Is there a way to change the foreground/background colors on the vtkEarthSource? > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- | Aashish Chaudhary | Technical Leader | Kitware Inc. | http://www.kitware.com/company/team/chaudhary.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From lorenzo.cesario at softeco.it Thu Jul 10 02:54:36 2014 From: lorenzo.cesario at softeco.it (Lorenzo Cesario) Date: Thu, 10 Jul 2014 08:54:36 +0200 Subject: [vtkusers] R: Migration problem vtk 5.8 - vtk 6.1 Message-ID: Hi Marcus, I tried to semplify the code I sent in my last mail. Now the class exported by my .dll doesn't do anything. I left only the "auto init" of the modules inside the file initVtkObjFactory.h. Now it gives memory leaks in all the debug architectures, but still crashes only in Release x64 when I close the application. I hope this example code can be clear for you. Tks, Lorenzo -----Messaggio originale----- From: Lorenzo Cesario Sent: Monday, July 07, 2014 4:33 PM To: Marcus D. Hanwell Cc: VTK Users Subject: Re: [vtkusers] R: Migration problem vtk 5.8 - vtk 6.1 Hi Marcus, please find attached a simple test project I made extracting and simplifying as much as I could my original software application. Inside the file Test_VtkMFC.zip there is a README.txt file explaining how to build and reproduce the bug. It is a templated MFC-based application from VS2010 (single doc and Office 2007 Ribbon style). Let me know if it crashes in Release 64 bit and if you can see where it is the problem (e.g. in one of my project settings). Tks, Lorenzo -----Messaggio originale----- From: Marcus D. Hanwell Sent: Thursday, July 03, 2014 5:27 PM To: Lorenzo Cesario Cc: markus.hanwell at kitware.com ; VTK Users Subject: Re: [vtkusers] R: Migration problem vtk 5.8 - vtk 6.1 Hi Lorenzo, On Thu, Jul 3, 2014 at 7:40 AM, Lorenzo Cesario wrote: > > Anyway, I think that the problem is that I could fix it (although not in > all > the configurations/architecture) calling the > vtkObjectFactory::UnRegisterAllFactories(); that it should be done by ?vtk > itself?. To be totally clear I agree, I still need a minimal example I can reproduce in order to fix it. > > My application is a single-document MFC executable, that uses for the > visualization in its main CWnd another dll including vtk libraries. > > As I think it isn?t correct to call that method, could be a bug in vtk? or > in any properties of my visual studio projects? > Yes, and figuring out which one is the challenge. If you try removing the init from the Visual Studio properties, and simply include it in your application code does this help? I have not seen this method of injecting code, it should work but I am not aware of others using it. I never work with Visual Studio projects without using CMake to generate them, but the object factory code is pretty robust. To be clear this is not expected behavior, but it is unclear to me if it is an issue with your Visual Studio build files or in VTK's C++ code. Marcus -------------- next part -------------- A non-text attachment was scrubbed... Name: Test_VtkMFC.zip Type: application/x-zip-compressed Size: 166434 bytes Desc: not available URL: From joachim.pouderoux at kitware.com Thu Jul 10 04:00:15 2014 From: joachim.pouderoux at kitware.com (Joachim Pouderoux) Date: Thu, 10 Jul 2014 10:00:15 +0200 Subject: [vtkusers] ANN: VTK/ParaView Training Course in Lyon, France, September 30th & October 1st, 2014 Message-ID: Kitware will be holding a 2-day VTK and ParaView course on September 30th and October 1st, 2014 in Lyon, France. Please visit our web site for more information and registration details at either: http://training.kitware.fr/browse/24 (in English) or http://formations.kitware.fr/browse/24 (in French) Note that the course will be taught in English. If you have any question, please contact us at formations at http://www.kitware.fr Thank you, *Joachim Pouderoux* *PhD, Technical Expert* *Kitware SAS * -------------- next part -------------- An HTML attachment was scrubbed... URL: From safna.royal10 at gmail.com Thu Jul 10 06:28:24 2014 From: safna.royal10 at gmail.com (safna) Date: Thu, 10 Jul 2014 03:28:24 -0700 (PDT) Subject: [vtkusers] Find Out the Cell ID In-Reply-To: References: Message-ID: <1404988104911-5727814.post@n5.nabble.com> vtkcutter will give me the points that cut. i need to find out the normal of that point ..For that i will find the cell in which the point is located using vtkcelllocator. from that i will get the cell id. i can able to find the normal of that cell using vtkpolydatanormals.so i can assign the normal of the point as the cell id normal. The thing is that some times if i pass the points the cellid is getting -1(that means no cell found) Do Anybody have the better solution for my problem to find out the normal of a point in vtk ..... -- View this message in context: http://vtk.1045678.n5.nabble.com/Find-Out-the-Cell-ID-tp5727233p5727814.html Sent from the VTK - Users mailing list archive at Nabble.com. From lorenzo.cesario at softeco.it Thu Jul 10 07:59:27 2014 From: lorenzo.cesario at softeco.it (Lorenzo Cesario) Date: Thu, 10 Jul 2014 13:59:27 +0200 Subject: [vtkusers] R: Migration problem vtk 5.8 - vtk 6.1 Message-ID: Hi Marcus, I modified the code I gave you last time, moving the call to the file initVtkObjFactory.h from the Display3d.dll to the .exe project. In this case it doesn't crash anymore, but I can't use the object factory in the Display3d.dll. Is this information of help? Bye, Lorenzo -----Messaggio originale----- From: Lorenzo Cesario Sent: Thursday, July 10, 2014 8:54 AM To: Marcus D. Hanwell Cc: VTK Users Subject: Re: [vtkusers] R: Migration problem vtk 5.8 - vtk 6.1 Hi Marcus, I tried to semplify the code I sent in my last mail. Now the class exported by my .dll doesn't do anything. I left only the "auto init" of the modules inside the file initVtkObjFactory.h. Now it gives memory leaks in all the debug architectures, but still crashes only in Release x64 when I close the application. I hope this example code can be clear for you. Tks, Lorenzo -----Messaggio originale----- From: Lorenzo Cesario Sent: Monday, July 07, 2014 4:33 PM To: Marcus D. Hanwell Cc: VTK Users Subject: Re: [vtkusers] R: Migration problem vtk 5.8 - vtk 6.1 Hi Marcus, please find attached a simple test project I made extracting and simplifying as much as I could my original software application. Inside the file Test_VtkMFC.zip there is a README.txt file explaining how to build and reproduce the bug. It is a templated MFC-based application from VS2010 (single doc and Office 2007 Ribbon style). Let me know if it crashes in Release 64 bit and if you can see where it is the problem (e.g. in one of my project settings). Tks, Lorenzo -----Messaggio originale----- From: Marcus D. Hanwell Sent: Thursday, July 03, 2014 5:27 PM To: Lorenzo Cesario Cc: markus.hanwell at kitware.com ; VTK Users Subject: Re: [vtkusers] R: Migration problem vtk 5.8 - vtk 6.1 Hi Lorenzo, On Thu, Jul 3, 2014 at 7:40 AM, Lorenzo Cesario wrote: > > Anyway, I think that the problem is that I could fix it (although not in > all > the configurations/architecture) calling the > vtkObjectFactory::UnRegisterAllFactories(); that it should be done by ?vtk > itself?. To be totally clear I agree, I still need a minimal example I can reproduce in order to fix it. > > My application is a single-document MFC executable, that uses for the > visualization in its main CWnd another dll including vtk libraries. > > As I think it isn?t correct to call that method, could be a bug in vtk? or > in any properties of my visual studio projects? > Yes, and figuring out which one is the challenge. If you try removing the init from the Visual Studio properties, and simply include it in your application code does this help? I have not seen this method of injecting code, it should work but I am not aware of others using it. I never work with Visual Studio projects without using CMake to generate them, but the object factory code is pretty robust. To be clear this is not expected behavior, but it is unclear to me if it is an issue with your Visual Studio build files or in VTK's C++ code. Marcus From pip010 at gmail.com Thu Jul 10 08:42:31 2014 From: pip010 at gmail.com (Petar Petrov) Date: Thu, 10 Jul 2014 14:42:31 +0200 Subject: [vtkusers] vtk books Message-ID: Hello dear VTK user, just wondering, does anyone have a clear idea how up to date are the VTK book: http://kitware.stores.yahoo.net/vtkteusgucm.html mostly considering changes effective vtk 6.0 and above ? regards, Petar From ahmed at mufradat.com Thu Jul 10 09:33:05 2014 From: ahmed at mufradat.com (ahmed at mufradat.com) Date: Thu, 10 Jul 2014 15:33:05 +0200 Subject: [vtkusers] VTK shows blank screen when compiled in Release mode Message-ID: Hello Everyone, I am using vtkImageReslice in connection with vtkImageViewer2 to view 2D slice of a 3d Dicomm image. Everything works great, Also when I try to change the slice thickness by doing : m_reslice->SetOutputDimensionality(2); m_reslice->SetBackgroundLevel(-1000); m_reslice->SetInterpolationModeToCubic(); m_reslice->SetSlabModeToMean(); m_reslice->SetSlabNumberOfSlices(m_thickness); the code can be found here: https://github.com/CardiacImagingCharite/CardiacPerfusion/blob/directions/vtkwidgets/multiplanarreformatwidget.cpp Everything is working as expected. The only problem I face appears when I compile VTK (5.10.1) in release mode. In release mode, the program works fine, until i use a GUI slicer to change the value of m_thickness at this point i get a black screen in the viewer widget which does not happen if VTK was compiled in Debug mode. Please help me as I have been fighting with this for several weeks now and I have ran out of ideas after played a lot with VTK cmake flags and even installed a graphic card (Nvidia). Best Regards, Ahmed From marcus.hanwell at kitware.com Thu Jul 10 10:31:41 2014 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Thu, 10 Jul 2014 10:31:41 -0400 Subject: [vtkusers] R: Migration problem vtk 5.8 - vtk 6.1 In-Reply-To: References: Message-ID: Lorenzo, Apologies, really busy right now. Why don't you think you can use the object factory in Display3d.dll if you move the init to the .exe? The intended use of the macro was to be compiled into the application executable, the object factory initialization is process wide we just need the object factories to be initialized before any objects are created in a given process. I will try to find some time to look at why it is failing in the dll init method, but I would advise you to initialize the object factories from the executable code if you possibly can. Marcus On Thu, Jul 10, 2014 at 7:59 AM, Lorenzo Cesario wrote: > Hi Marcus, > I modified the code I gave you last time, moving the call to the file > initVtkObjFactory.h from the Display3d.dll to the .exe project. > In this case it doesn't crash anymore, but I can't use the object factory in > the Display3d.dll. > Is this information of help? > > Bye, > > Lorenzo > > > -----Messaggio originale----- From: Lorenzo Cesario > Sent: Thursday, July 10, 2014 8:54 AM > > To: Marcus D. Hanwell > Cc: VTK Users > Subject: Re: [vtkusers] R: Migration problem vtk 5.8 - vtk 6.1 > > Hi Marcus, > I tried to semplify the code I sent in my last mail. > Now the class exported by my .dll doesn't do anything. I left only the "auto > init" of the modules inside the file initVtkObjFactory.h. > Now it gives memory leaks in all the debug architectures, but still crashes > only in Release x64 when I close the application. > I hope this example code can be clear for you. > Tks, > Lorenzo > > > -----Messaggio originale----- From: Lorenzo Cesario > Sent: Monday, July 07, 2014 4:33 PM > To: Marcus D. Hanwell > Cc: VTK Users > Subject: Re: [vtkusers] R: Migration problem vtk 5.8 - vtk 6.1 > > > Hi Marcus, > please find attached a simple test project I made extracting and simplifying > as much as I could my original software application. > Inside the file Test_VtkMFC.zip there is a README.txt file explaining how to > build and reproduce the bug. > It is a templated MFC-based application from VS2010 (single doc and Office > 2007 Ribbon style). > Let me know if it crashes in Release 64 bit and if you can see where it is > the problem (e.g. in one of my project settings). > Tks, > > Lorenzo > > -----Messaggio originale----- From: Marcus D. Hanwell > Sent: Thursday, July 03, 2014 5:27 PM > To: Lorenzo Cesario > Cc: markus.hanwell at kitware.com ; VTK Users > Subject: Re: [vtkusers] R: Migration problem vtk 5.8 - vtk 6.1 > > Hi Lorenzo, > > On Thu, Jul 3, 2014 at 7:40 AM, Lorenzo Cesario > wrote: >> >> >> Anyway, I think that the problem is that I could fix it (although not in >> all >> the configurations/architecture) calling the >> vtkObjectFactory::UnRegisterAllFactories(); that it should be done by ?vtk >> itself?. > > > To be totally clear I agree, I still need a minimal example I can > reproduce in order to fix it. >> >> >> My application is a single-document MFC executable, that uses for the >> visualization in its main CWnd another dll including vtk libraries. >> >> As I think it isn?t correct to call that method, could be a bug in vtk? or >> in any properties of my visual studio projects? >> > Yes, and figuring out which one is the challenge. If you try removing > the init from the Visual Studio properties, and simply include it in > your application code does this help? I have not seen this method of > injecting code, it should work but I am not aware of others using it. > I never work with Visual Studio projects without using CMake to > generate them, but the object factory code is pretty robust. > > To be clear this is not expected behavior, but it is unclear to me if > it is an issue with your Visual Studio build files or in VTK's C++ > code. > > Marcus > > From arun.retheesan at gmail.com Thu Jul 10 23:02:22 2014 From: arun.retheesan at gmail.com (Arun Retheesan) Date: Fri, 11 Jul 2014 08:32:22 +0530 Subject: [vtkusers] VTK shows blank screen when compiled in Release mode In-Reply-To: References: Message-ID: On Thursday, July 10, 2014, wrote: > Hello Everyone, > I am using vtkImageReslice in connection with vtkImageViewer2 to view 2D > slice of a 3d Dicomm image. Everything works great, Also when I try to > change the slice thickness by doing : > m_reslice->SetOutputDimensionality(2); > m_reslice->SetBackgroundLevel(-1000); > m_reslice->SetInterpolationModeToCubic(); > m_reslice->SetSlabModeToMean(); > m_reslice->SetSlabNumberOfSlices(m_thickness); > the code can be found here: > https://github.com/CardiacImagingCharite/CardiacPerfusion/blob/ > directions/vtkwidgets/multiplanarreformatwidget.cpp > > Everything is working as expected. The only problem I face appears when I > compile VTK (5.10.1) in release mode. > > In release mode, the program works fine, until i use a GUI slicer to > change the value of m_thickness at this point i get a black screen in the > viewer widget which does not happen if VTK was compiled in Debug mode. > > Please help me as I have been fighting with this for several weeks now and > I have ran out of ideas after played a lot with VTK cmake flags and even > installed a graphic card (Nvidia). > > > Best Regards, > Ahmed > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lorenzo.cesario at softeco.it Fri Jul 11 03:59:32 2014 From: lorenzo.cesario at softeco.it (Lorenzo Cesario) Date: Fri, 11 Jul 2014 09:59:32 +0200 Subject: [vtkusers] R: Migration problem vtk 5.8 - vtk 6.1 In-Reply-To: References: Message-ID: Hi Marcus, great news I fixed it! :) I moved the initVtkObjFactory.h from my .dll to my executable project as I already told you, but instead of calling it using the preprocessor properties (in this way the ::New() inside my .dll returns always NULL), I included that file in the "stdafx.h" of the .exe project. In this way it doesn't crash anymore and I can use without problems the vtk objects in my dll. The reason because I didn't use untile now the vtk init in my .exe project was that I didn't want to include vtk libraries dependencies in this project, but only in the project (dll) that uses them. In this way, a user is quite "forced" to add vtk dependencies in the .exe project even if it doesn't really need them. However, tks a lot for your support. Regards, Lorenzo -----Messaggio originale----- From: Marcus D. Hanwell Sent: Thursday, July 10, 2014 4:31 PM To: Lorenzo Cesario Cc: VTK Users Subject: Re: [vtkusers] R: Migration problem vtk 5.8 - vtk 6.1 Lorenzo, Apologies, really busy right now. Why don't you think you can use the object factory in Display3d.dll if you move the init to the .exe? The intended use of the macro was to be compiled into the application executable, the object factory initialization is process wide we just need the object factories to be initialized before any objects are created in a given process. I will try to find some time to look at why it is failing in the dll init method, but I would advise you to initialize the object factories from the executable code if you possibly can. Marcus On Thu, Jul 10, 2014 at 7:59 AM, Lorenzo Cesario wrote: > Hi Marcus, > I modified the code I gave you last time, moving the call to the file > initVtkObjFactory.h from the Display3d.dll to the .exe project. > In this case it doesn't crash anymore, but I can't use the object factory > in > the Display3d.dll. > Is this information of help? > > Bye, > > Lorenzo > > > -----Messaggio originale----- From: Lorenzo Cesario > Sent: Thursday, July 10, 2014 8:54 AM > > To: Marcus D. Hanwell > Cc: VTK Users > Subject: Re: [vtkusers] R: Migration problem vtk 5.8 - vtk 6.1 > > Hi Marcus, > I tried to semplify the code I sent in my last mail. > Now the class exported by my .dll doesn't do anything. I left only the > "auto > init" of the modules inside the file initVtkObjFactory.h. > Now it gives memory leaks in all the debug architectures, but still > crashes > only in Release x64 when I close the application. > I hope this example code can be clear for you. > Tks, > Lorenzo > > > -----Messaggio originale----- From: Lorenzo Cesario > Sent: Monday, July 07, 2014 4:33 PM > To: Marcus D. Hanwell > Cc: VTK Users > Subject: Re: [vtkusers] R: Migration problem vtk 5.8 - vtk 6.1 > > > Hi Marcus, > please find attached a simple test project I made extracting and > simplifying > as much as I could my original software application. > Inside the file Test_VtkMFC.zip there is a README.txt file explaining how > to > build and reproduce the bug. > It is a templated MFC-based application from VS2010 (single doc and Office > 2007 Ribbon style). > Let me know if it crashes in Release 64 bit and if you can see where it is > the problem (e.g. in one of my project settings). > Tks, > > Lorenzo > > -----Messaggio originale----- From: Marcus D. Hanwell > Sent: Thursday, July 03, 2014 5:27 PM > To: Lorenzo Cesario > Cc: markus.hanwell at kitware.com ; VTK Users > Subject: Re: [vtkusers] R: Migration problem vtk 5.8 - vtk 6.1 > > Hi Lorenzo, > > On Thu, Jul 3, 2014 at 7:40 AM, Lorenzo Cesario > wrote: >> >> >> Anyway, I think that the problem is that I could fix it (although not in >> all >> the configurations/architecture) calling the >> vtkObjectFactory::UnRegisterAllFactories(); that it should be done by >> ?vtk >> itself?. > > > To be totally clear I agree, I still need a minimal example I can > reproduce in order to fix it. >> >> >> My application is a single-document MFC executable, that uses for the >> visualization in its main CWnd another dll including vtk libraries. >> >> As I think it isn?t correct to call that method, could be a bug in vtk? >> or >> in any properties of my visual studio projects? >> > Yes, and figuring out which one is the challenge. If you try removing > the init from the Visual Studio properties, and simply include it in > your application code does this help? I have not seen this method of > injecting code, it should work but I am not aware of others using it. > I never work with Visual Studio projects without using CMake to > generate them, but the object factory code is pretty robust. > > To be clear this is not expected behavior, but it is unclear to me if > it is an issue with your Visual Studio build files or in VTK's C++ > code. > > Marcus > > From davis.vigneault at gmail.com Fri Jul 11 09:38:29 2014 From: davis.vigneault at gmail.com (DVigneault) Date: Fri, 11 Jul 2014 06:38:29 -0700 (PDT) Subject: [vtkusers] Pass value from vtkInteractorStyle to local variable? Message-ID: <1405085909122-5727826.post@n5.nabble.com> All-- I'd like to understand the best practice for passing a variable obtained in an interactor to a local variable, such that it can be used after the render window is closed (in my case: open a window, obtain pixel coordinates from mouse click, close window, then use the pixel coordinates later on in the program). I can get the functionality I want by creating a InteractorStyle class (inheriting from vtkInteractorStyleImage, pasted at the bottom of this e-mail) that saves the pixel coordinates to a global variable pointPosition OnLeftButtonUp, then closes the window OnRightButtonUp. However, I'm nervous that coding a global variable name into a class is not very maintainable, and thought there was likely a better way to do it. What is the best practice in this case? Sorry if this is more of a c++ question and less of a VTK question--I've been learning c++/vtk/itk in tandem with one another, and am sometimes unclear when one ends and the other begins. Best, and thanks, --Davis // Create a class inheriting from vtkInteractorStyleImage class dvInteractorStyleSelectPoint : public vtkInteractorStyleImage { public: static dvInteractorStyleSelectPoint* New(); vtkTypeMacro(dvInteractorStyleSelectPoint, vtkInteractorStyleImage); // OnLeftButtonUp, save the pixel coordinates to the global variable pointPosition virtual void OnLeftButtonUp() { std::cout << "Picking pixel: " << this->Interactor->GetEventPosition()[0] << " " << this->Interactor->GetEventPosition()[1] << std::endl; this->Interactor->GetPicker()->Pick(this->Interactor->GetEventPosition()[0], this->Interactor->GetEventPosition()[1], 0, // always zero. this->Interactor->GetRenderWindow()->GetRenderers()->GetFirstRenderer()); this->Interactor->GetPicker()->GetPickPosition(pointPosition); std::cout << "Picked value: " << pointPosition[0] << " " << pointPosition[1] << std::endl; vtkInteractorStyleImage::OnLeftButtonUp(); } // OnRightButtonUp, close the window virtual void OnRightButtonUp() { this->GetInteractor()->GetRenderWindow()->Finalize(); std::cout << "Closing window..." << std::endl; vtkInteractorStyleImage::OnRightButtonUp(); } }; -- View this message in context: http://vtk.1045678.n5.nabble.com/Pass-value-from-vtkInteractorStyle-to-local-variable-tp5727826.html Sent from the VTK - Users mailing list archive at Nabble.com. From allen at sci.utah.edu Fri Jul 11 16:29:49 2014 From: allen at sci.utah.edu (Allen Sanderson) Date: Fri, 11 Jul 2014 14:29:49 -0600 Subject: [vtkusers] vtkPolyData to a vtkUnstructuredGrid Message-ID: <338CF46B-CDD6-43EE-AE51-62718D0D8FC8@sci.utah.edu> Hello, I have a vtkPolyData structure that contains vtkPolyLines or vertex(s). In the course of the coding the vtkPolyData needs to be converted to a vtkUnstructuredGrid. I have used the example here using the append filter: http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PolyDataToUnstructuredGrid However, no lines come across only points. I have also iterated through each cell and moved the point id list over with the same results, no lines As such, I am wondering why lines might not be moved over. Cheers, Allen Allen Sanderson SCI Institute University of Utah www.sci.utah.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: From burlen.loring at gmail.com Fri Jul 11 18:08:42 2014 From: burlen.loring at gmail.com (Burlen Loring) Date: Fri, 11 Jul 2014 15:08:42 -0700 Subject: [vtkusers] vtkPolyData to a vtkUnstructuredGrid In-Reply-To: <338CF46B-CDD6-43EE-AE51-62718D0D8FC8@sci.utah.edu> References: <338CF46B-CDD6-43EE-AE51-62718D0D8FC8@sci.utah.edu> Message-ID: <53C0606A.7020207@gmail.com> It would help if you post an example with some data so that we can see exactly what you're doing. On 07/11/2014 01:29 PM, Allen Sanderson wrote: > > Hello, > > I have a vtkPolyData structure that contains vtkPolyLines or > vertex(s). In the course of the coding the vtkPolyData needs to be > converted to a vtkUnstructuredGrid. I have used the example here using > the append filter: > > http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PolyDataToUnstructuredGrid > > However, no lines come across only points. I have also iterated > through each cell and moved the point id list over with the same > results, no lines > > As such, I am wondering why lines might not be moved over. > > Cheers, > > Allen > > > Allen Sanderson > SCI Institute > University of Utah > www.sci.utah.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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.bogle at auckland.ac.nz Sat Jul 12 04:56:22 2014 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Sat, 12 Jul 2014 08:56:22 +0000 Subject: [vtkusers] TensorGlyph Message-ID: Hi, I tried to build this example: http://www.vtk.org/Wiki/VTK/Examples/Visualization/TensorGlyph but I get two errors: class "vtkTensorGlyph" has no member "SetInputData" class "vtkPolyDataMapper" has no member "SetInputData" I am using VTK-5.10 Regards Gib -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.bogle at auckland.ac.nz Sat Jul 12 06:00:56 2014 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Sat, 12 Jul 2014 10:00:56 +0000 Subject: [vtkusers] TensorGlyph In-Reply-To: References: Message-ID: I got a clue from the Glyph3D example, which shows the check for VTK_MAJOR_VERSION <= 5 I then replaced these lines // tensorGlyph->SetInputData(polyData); // tensorGlyph->SetSourceConnection(cubeSource->GetOutputPort()); tensorGlyph->SetSource(cubeSource->GetOutput()); tensorGlyph->SetInput(polyData); and this one // mapper->SetInputData(tensorGlyph->GetOutput()); mapper->SetInputConnection(tensorGlyph->GetOutputPort()); and now it builds and runs :) ________________________________ From: vtkusers [vtkusers-bounces at vtk.org] on behalf of Gib Bogle [g.bogle at auckland.ac.nz] Sent: Saturday, 12 July 2014 8:56 p.m. To: vtkusers at vtk.org Subject: [vtkusers] TensorGlyph Hi, I tried to build this example: http://www.vtk.org/Wiki/VTK/Examples/Visualization/TensorGlyph but I get two errors: class "vtkTensorGlyph" has no member "SetInputData" class "vtkPolyDataMapper" has no member "SetInputData" I am using VTK-5.10 Regards Gib -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Sat Jul 12 08:19:02 2014 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Sat, 12 Jul 2014 08:19:02 -0400 Subject: [vtkusers] TensorGlyph In-Reply-To: References: Message-ID: I'll fix the example on the wiki so it works for both vtk5 and vtk6. Normally the night builds would catch this, but the example was in the wring location. On Sat, Jul 12, 2014 at 6:00 AM, Gib Bogle wrote: > I got a clue from the Glyph3D example, which shows the check for > VTK_MAJOR_VERSION <= 5 > I then replaced these lines > // tensorGlyph->SetInputData(polyData); > // tensorGlyph->SetSourceConnection(cubeSource->GetOutputPort()); > tensorGlyph->SetSource(cubeSource->GetOutput()); > tensorGlyph->SetInput(polyData); > and this one > // mapper->SetInputData(tensorGlyph->GetOutput()); > mapper->SetInputConnection(tensorGlyph->GetOutputPort()); > and now it builds and runs :) > > ________________________________ > From: vtkusers [vtkusers-bounces at vtk.org] on behalf of Gib Bogle > [g.bogle at auckland.ac.nz] > Sent: Saturday, 12 July 2014 8:56 p.m. > To: vtkusers at vtk.org > Subject: [vtkusers] TensorGlyph > > Hi, > I tried to build this example: > http://www.vtk.org/Wiki/VTK/Examples/Visualization/TensorGlyph > but I get two errors: > class "vtkTensorGlyph" has no member "SetInputData" > class "vtkPolyDataMapper" has no member "SetInputData" > I am using VTK-5.10 > > Regards > Gib > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Unpaid intern in BillsBasement at noware dot com From matimontg at gmail.com Sat Jul 12 09:04:30 2014 From: matimontg at gmail.com (Matias Montroull) Date: Sat, 12 Jul 2014 10:04:30 -0300 Subject: [vtkusers] Image Interpolation or Reslice Message-ID: Hi, I need to convert a set of non uniform slice separation images to another set of images with uniform Z separation. How can I do this? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From matimontg at gmail.com Sat Jul 12 09:07:49 2014 From: matimontg at gmail.com (Matias Montroull) Date: Sat, 12 Jul 2014 10:07:49 -0300 Subject: [vtkusers] Convert set of rectangular images to a set of square image set Message-ID: Hi, I have a set of rectangular images (example: 256X200) and I need to convert this set to 256X256 or square images. Is there a function for this? Thanks, -------------- next part -------------- An HTML attachment was scrubbed... URL: From matimontg at gmail.com Sat Jul 12 09:09:01 2014 From: matimontg at gmail.com (Matias Montroull) Date: Sat, 12 Jul 2014 10:09:01 -0300 Subject: [vtkusers] Convert tilt image set to a pure axial image set Message-ID: Hi, I need to convert Tilt images to pure Axial, in other words, my imagesn have tilt different to 0 and I need to convert to Tilt=0. Is there a method to do this? Thanks, -------------- next part -------------- An HTML attachment was scrubbed... URL: From weixuegong at gmail.com Sun Jul 13 10:00:28 2014 From: weixuegong at gmail.com (=?UTF-8?B?5YWs57u05a2m?=) Date: Sun, 13 Jul 2014 22:00:28 +0800 Subject: [vtkusers] (no subject) Message-ID: Now I have an vtkDataSet object from a reader.I had tried to change the color of the output of vtkDataSetReader(not set the color of actor), but had no idea. The reason is that I want to write the dataset back to hard disk with the new color. I could get the number of cells in this dataset, and when I tried to get the scalars and modify the scalars(it holds the color, am I right), it crushed. this->reader->Update(); vtkDataSet* ds = reader->GetOutput(); vtkCellData* cellData = ds->GetCellData(); vtkDataArray* scalars = cellData->GetScalars(); int size = scalars->GetSize();//equals to the number of cells in dataset? //then we can modify scalars... I am not sure if it is the right way, and I googled it, but found nothing helpful, The vtk file was converted from vrml.and it has about 332 points, 110 lines, 102 polygons,and I found in this file there were: POINT_DATA 332 COLOR_SCALARS VRMLColor 3 So, could any one give me some tips? Any advice would be appreciated! -------------- next part -------------- An HTML attachment was scrubbed... URL: From weixuegong at gmail.com Sun Jul 13 10:03:41 2014 From: weixuegong at gmail.com (=?UTF-8?B?5YWs57u05a2m?=) Date: Sun, 13 Jul 2014 22:03:41 +0800 Subject: [vtkusers] Can not change the color of dataset. Message-ID: Now I have an vtkDataSet object from a reader.I had tried to change the color of the output of vtkDataSetReader(not set the color of actor), but had no idea. The reason is that I want to write the dataset back to hard disk with the new color. I could get the number of cells in this dataset, and when I tried to get the scalars and modify the scalars(it holds the color, am I right), it crushed. this->reader->Update(); vtkDataSet* ds = reader->GetOutput(); vtkCellData* cellData = ds->GetCellData(); vtkDataArray* scalars = cellData->GetScalars(); int size = scalars->GetSize();//equals to the number of cells in dataset? //then we can modify scalars... I am not sure if it is the right way, and I googled it, but found nothing helpful, The vtk file was converted from vrml.and it has about 332 points, 110 lines, 102 polygons,and I found in this file there were: POINT_DATA 332 COLOR_SCALARS VRMLColor 3 So, could any one give me some tips? Any advice would be appreciated! -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.jourdain at kitware.com Sun Jul 13 10:49:53 2014 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Sun, 13 Jul 2014 08:49:53 -0600 Subject: [vtkusers] (no subject) In-Reply-To: References: Message-ID: POINT_DATA means that you should call ->GetPointData() instead of ->GetCellData(). On Sun, Jul 13, 2014 at 8:00 AM, ??? wrote: > Now I have an vtkDataSet object from a reader.I had tried to change the > color of the output of vtkDataSetReader(not set the color of actor), but > had no idea. > > The reason is that I want to write the dataset back to hard disk with the > new color. > > I could get the number of cells in this dataset, and when I tried to get > the scalars and modify the scalars(it holds the color, am I right), it > crushed. > this->reader->Update(); > vtkDataSet* ds = reader->GetOutput(); > vtkCellData* cellData = ds->GetCellData(); > vtkDataArray* scalars = cellData->GetScalars(); > int size = scalars->GetSize();//equals to the number of cells in > dataset? > //then we can modify scalars... > > > I am not sure if it is the right way, and I googled it, but found nothing > helpful, > > The vtk file was converted from vrml.and it has about 332 points, 110 > lines, 102 polygons,and I found in this file there were: > POINT_DATA 332 > COLOR_SCALARS VRMLColor 3 > > So, could any one give me some tips? > Any advice would be appreciated! > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.bogle at auckland.ac.nz Sun Jul 13 18:05:17 2014 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Sun, 13 Jul 2014 22:05:17 +0000 Subject: [vtkusers] TensorGlyph In-Reply-To: References: , Message-ID: I am trying to get a better understanding of what I can do with this method of creating a scene using glyphs. What I want to be able to do is (a) change the position/shape/orientation of a glyph, and (b) add new glyphs. I am assuming that for performance reasons (I expect to have tens of thousands of glyphs) it will be better to modify an existing actor rather than delete it a create it afresh each time step. If this is an incorrect assumption please tell me so. My ideas about this have so far been unsuccessful. For example, I thought that I could do this in the TensorGlyph example: after the line renderer->AddActor(actor); add tensors->SetNumberOfTuples(3); points->InsertNextPoint(0.0, 5.0, 0.0); tensors->InsertTuple9(2,1,0,0,0,1,0,0,0,1); tensorGlyph->Update(); mapper->Update(); but this still displays two glyphs. Is there a way to do what I'm trying to do, or is this misguided? Thanks Gib ________________________________________ From: Bill Lorensen [bill.lorensen at gmail.com] Sent: Sunday, 13 July 2014 12:19 a.m. To: Gib Bogle Cc: vtkusers at vtk.org Subject: Re: [vtkusers] TensorGlyph I'll fix the example on the wiki so it works for both vtk5 and vtk6. Normally the night builds would catch this, but the example was in the wring location. On Sat, Jul 12, 2014 at 6:00 AM, Gib Bogle wrote: > I got a clue from the Glyph3D example, which shows the check for > VTK_MAJOR_VERSION <= 5 > I then replaced these lines > // tensorGlyph->SetInputData(polyData); > // tensorGlyph->SetSourceConnection(cubeSource->GetOutputPort()); > tensorGlyph->SetSource(cubeSource->GetOutput()); > tensorGlyph->SetInput(polyData); > and this one > // mapper->SetInputData(tensorGlyph->GetOutput()); > mapper->SetInputConnection(tensorGlyph->GetOutputPort()); > and now it builds and runs :) > > ________________________________ > From: vtkusers [vtkusers-bounces at vtk.org] on behalf of Gib Bogle > [g.bogle at auckland.ac.nz] > Sent: Saturday, 12 July 2014 8:56 p.m. > To: vtkusers at vtk.org > Subject: [vtkusers] TensorGlyph > > Hi, > I tried to build this example: > http://www.vtk.org/Wiki/VTK/Examples/Visualization/TensorGlyph > but I get two errors: > class "vtkTensorGlyph" has no member "SetInputData" > class "vtkPolyDataMapper" has no member "SetInputData" > I am using VTK-5.10 > > Regards > Gib > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Unpaid intern in BillsBasement at noware dot com From g.bogle at auckland.ac.nz Sun Jul 13 19:29:31 2014 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Sun, 13 Jul 2014 23:29:31 +0000 Subject: [vtkusers] TensorGlyph In-Reply-To: References: , , Message-ID: I find that my modification works if I comment out the first tensorGlyph->Update(); (after defining the first two glyphs). It seems that Update() fixes the mapper's glyph list. ________________________________________ From: vtkusers [vtkusers-bounces at vtk.org] on behalf of Gib Bogle [g.bogle at auckland.ac.nz] Sent: Monday, 14 July 2014 10:05 a.m. To: Bill Lorensen Cc: vtkusers at vtk.org Subject: Re: [vtkusers] TensorGlyph I am trying to get a better understanding of what I can do with this method of creating a scene using glyphs. What I want to be able to do is (a) change the position/shape/orientation of a glyph, and (b) add new glyphs. I am assuming that for performance reasons (I expect to have tens of thousands of glyphs) it will be better to modify an existing actor rather than delete it a create it afresh each time step. If this is an incorrect assumption please tell me so. My ideas about this have so far been unsuccessful. For example, I thought that I could do this in the TensorGlyph example: after the line renderer->AddActor(actor); add tensors->SetNumberOfTuples(3); points->InsertNextPoint(0.0, 5.0, 0.0); tensors->InsertTuple9(2,1,0,0,0,1,0,0,0,1); tensorGlyph->Update(); mapper->Update(); but this still displays two glyphs. Is there a way to do what I'm trying to do, or is this misguided? Thanks Gib ________________________________________ From: Bill Lorensen [bill.lorensen at gmail.com] Sent: Sunday, 13 July 2014 12:19 a.m. To: Gib Bogle Cc: vtkusers at vtk.org Subject: Re: [vtkusers] TensorGlyph I'll fix the example on the wiki so it works for both vtk5 and vtk6. Normally the night builds would catch this, but the example was in the wring location. On Sat, Jul 12, 2014 at 6:00 AM, Gib Bogle wrote: > I got a clue from the Glyph3D example, which shows the check for > VTK_MAJOR_VERSION <= 5 > I then replaced these lines > // tensorGlyph->SetInputData(polyData); > // tensorGlyph->SetSourceConnection(cubeSource->GetOutputPort()); > tensorGlyph->SetSource(cubeSource->GetOutput()); > tensorGlyph->SetInput(polyData); > and this one > // mapper->SetInputData(tensorGlyph->GetOutput()); > mapper->SetInputConnection(tensorGlyph->GetOutputPort()); > and now it builds and runs :) > > ________________________________ > From: vtkusers [vtkusers-bounces at vtk.org] on behalf of Gib Bogle > [g.bogle at auckland.ac.nz] > Sent: Saturday, 12 July 2014 8:56 p.m. > To: vtkusers at vtk.org > Subject: [vtkusers] TensorGlyph > > Hi, > I tried to build this example: > http://www.vtk.org/Wiki/VTK/Examples/Visualization/TensorGlyph > but I get two errors: > class "vtkTensorGlyph" has no member "SetInputData" > class "vtkPolyDataMapper" has no member "SetInputData" > I am using VTK-5.10 > > Regards > Gib > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Unpaid intern in BillsBasement at noware dot com _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers From tiagoalexp at hotmail.com Sun Jul 13 20:35:16 2014 From: tiagoalexp at hotmail.com (Atwa) Date: Sun, 13 Jul 2014 17:35:16 -0700 (PDT) Subject: [vtkusers] Remove Outer Wall from an Open Surface Mesh Message-ID: <1405298116749-5727840.post@n5.nabble.com> Greetings, Im a newbie on VTK. I'm working on an 3D Interface that lets the user manipulates the mesh after its loaded. The problem is that many of the models (STL files) that are going to be opened are cabins with an inner wall (or inner points, if you prefer) and an outer wall, separeted by ~10cm. I wish to remove the outer wall points and keep the inner ones. I've searched through classes like vtkSelectEnclosedPoints or vtkPolyDataSilhouette but i cannot really find any answer. Is it possible to it do or do i have to convert it to a 2D model and work it from there? Thanks for any help. Regards -- View this message in context: http://vtk.1045678.n5.nabble.com/Remove-Outer-Wall-from-an-Open-Surface-Mesh-tp5727840.html Sent from the VTK - Users mailing list archive at Nabble.com. From weixuegong at gmail.com Sun Jul 13 21:19:54 2014 From: weixuegong at gmail.com (weixue gong) Date: Mon, 14 Jul 2014 09:19:54 +0800 Subject: [vtkusers] (no subject) In-Reply-To: References: Message-ID: I got the data of points. Then : vtkDataArray* scalars = reader->getOutput()->getPointData()-> getScalars(); scalars->setTuple3(i, r, g, b); data->setScalars(scalars); reader->Update(); but the color didn't changed, is there any step I did wrong? 2014-07-13 22:49 GMT+08:00 Sebastien Jourdain < sebastien.jourdain at kitware.com>: > POINT_DATA means that you should call ->GetPointData() instead of > ->GetCellData(). > > > On Sun, Jul 13, 2014 at 8:00 AM, ??? wrote: > >> Now I have an vtkDataSet object from a reader.I had tried to change the >> color of the output of vtkDataSetReader(not set the color of actor), but >> had no idea. >> >> The reason is that I want to write the dataset back to hard disk with the >> new color. >> >> I could get the number of cells in this dataset, and when I tried to get >> the scalars and modify the scalars(it holds the color, am I right), it >> crushed. >> this->reader->Update(); >> vtkDataSet* ds = reader->GetOutput(); >> vtkCellData* cellData = ds->GetCellData(); >> vtkDataArray* scalars = cellData->GetScalars(); >> int size = scalars->GetSize();//equals to the number of cells in >> dataset? >> //then we can modify scalars... >> >> >> I am not sure if it is the right way, and I googled it, but found nothing >> helpful, >> >> The vtk file was converted from vrml.and it has about 332 points, 110 >> lines, 102 polygons,and I found in this file there were: >> POINT_DATA 332 >> COLOR_SCALARS VRMLColor 3 >> >> So, could any one give me some tips? >> Any advice would be appreciated! >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.jourdain at kitware.com Sun Jul 13 21:43:34 2014 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Sun, 13 Jul 2014 19:43:34 -0600 Subject: [vtkusers] (no subject) In-Reply-To: References: Message-ID: Then is the setup of the mapper that is wrong. Moreover, do you know if the data array is an unsigned char one? On Sun, Jul 13, 2014 at 7:19 PM, weixue gong wrote: > I got the data of points. Then : > vtkDataArray* scalars = reader->getOutput()->getPointData()-> getScalars(); > scalars->setTuple3(i, r, g, b); > data->setScalars(scalars); > reader->Update(); > > but the color didn't changed, is there any step I did wrong? > > > > 2014-07-13 22:49 GMT+08:00 Sebastien Jourdain < > sebastien.jourdain at kitware.com>: > > POINT_DATA means that you should call ->GetPointData() instead of >> ->GetCellData(). >> >> >> On Sun, Jul 13, 2014 at 8:00 AM, ??? wrote: >> >>> Now I have an vtkDataSet object from a reader.I had tried to change the >>> color of the output of vtkDataSetReader(not set the color of actor), but >>> had no idea. >>> >>> The reason is that I want to write the dataset back to hard disk with >>> the new color. >>> >>> I could get the number of cells in this dataset, and when I tried to get >>> the scalars and modify the scalars(it holds the color, am I right), it >>> crushed. >>> this->reader->Update(); >>> vtkDataSet* ds = reader->GetOutput(); >>> vtkCellData* cellData = ds->GetCellData(); >>> vtkDataArray* scalars = cellData->GetScalars(); >>> int size = scalars->GetSize();//equals to the number of cells in >>> dataset? >>> //then we can modify scalars... >>> >>> >>> I am not sure if it is the right way, and I googled it, but found >>> nothing helpful, >>> >>> The vtk file was converted from vrml.and it has about 332 points, 110 >>> lines, 102 polygons,and I found in this file there were: >>> POINT_DATA 332 >>> COLOR_SCALARS VRMLColor 3 >>> >>> So, could any one give me some tips? >>> Any advice would be appreciated! >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/vtkusers >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From weixuegong at gmail.com Sun Jul 13 22:08:11 2014 From: weixuegong at gmail.com (weixuegong) Date: Mon, 14 Jul 2014 10:08:11 +0800 Subject: [vtkusers] (no subject) In-Reply-To: References: Message-ID: <53C33B8B.5050208@gmail.com> The mapper is vtkDataSetMapper, and I use the default setting. It is sure that the values of params of setTuple3() is 0~255. Should I not use the setup of the mapper by default? I removed "reader->Update()" in case of reloading the data on disk, but it didn't work. > Then is the setup of the mapper that is wrong. > Moreover, do you know if the data array is an unsigned char one? > > > > > On Sun, Jul 13, 2014 at 7:19 PM, weixue gong > wrote: > > I got the data of points. Then : > vtkDataArray* scalars = reader->getOutput()->getPointData()-> > getScalars(); > scalars->setTuple3(i, r, g, b); > data->setScalars(scalars); > reader->Update(); > > but the color didn't changed, is there any step I did wrong? > > > > 2014-07-13 22:49 GMT+08:00 Sebastien Jourdain > >: > > POINT_DATA means that you should call ->GetPointData() instead > of ->GetCellData(). > > > On Sun, Jul 13, 2014 at 8:00 AM, ??? > wrote: > > Now I have an vtkDataSet object from a reader.I had tried > to change the color of the output of vtkDataSetReader(not > set the color of actor), but had no idea. > > The reason is that I want to write the dataset back to > hard disk with the new color. > I could get the number of cells in this dataset, and when > I tried to get the scalars and modify the scalars(it holds > the color, am I right), it crushed. > this->reader->Update(); > vtkDataSet* ds = reader->GetOutput(); > vtkCellData* cellData = ds->GetCellData(); > vtkDataArray* scalars = cellData->GetScalars(); > int size = scalars->GetSize();//equals to the number > of cells in dataset? > //then we can modify scalars... > I am not sure if it is the right way, and I googled it, > but found nothing helpful, > The vtk file was converted from vrml.and it has about 332 > points, 110 lines, 102 polygons,and I found in this file > there were: > POINT_DATA 332 > COLOR_SCALARS VRMLColor 3 > So, could any one give me some tips? > > > Any advice would be appreciated! > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.bogle at auckland.ac.nz Mon Jul 14 00:55:05 2014 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Mon, 14 Jul 2014 04:55:05 +0000 Subject: [vtkusers] TensorGlyph In-Reply-To: References: , , , Message-ID: I think the answer to the question of how to have the actor reflect changes in the polyData is to include these two lines after making changes to points and tensors: tensorGlyph->RemoveAllInputs(); tensorGlyph->SetInput(polyData); ________________________________________ From: vtkusers [vtkusers-bounces at vtk.org] on behalf of Gib Bogle [g.bogle at auckland.ac.nz] Sent: Monday, 14 July 2014 11:29 a.m. To: Bill Lorensen Cc: vtkusers at vtk.org Subject: Re: [vtkusers] TensorGlyph I find that my modification works if I comment out the first tensorGlyph->Update(); (after defining the first two glyphs). It seems that Update() fixes the mapper's glyph list. ________________________________________ From: vtkusers [vtkusers-bounces at vtk.org] on behalf of Gib Bogle [g.bogle at auckland.ac.nz] Sent: Monday, 14 July 2014 10:05 a.m. To: Bill Lorensen Cc: vtkusers at vtk.org Subject: Re: [vtkusers] TensorGlyph I am trying to get a better understanding of what I can do with this method of creating a scene using glyphs. What I want to be able to do is (a) change the position/shape/orientation of a glyph, and (b) add new glyphs. I am assuming that for performance reasons (I expect to have tens of thousands of glyphs) it will be better to modify an existing actor rather than delete it a create it afresh each time step. If this is an incorrect assumption please tell me so. My ideas about this have so far been unsuccessful. For example, I thought that I could do this in the TensorGlyph example: after the line renderer->AddActor(actor); add tensors->SetNumberOfTuples(3); points->InsertNextPoint(0.0, 5.0, 0.0); tensors->InsertTuple9(2,1,0,0,0,1,0,0,0,1); tensorGlyph->Update(); mapper->Update(); but this still displays two glyphs. Is there a way to do what I'm trying to do, or is this misguided? Thanks Gib ________________________________________ From: Bill Lorensen [bill.lorensen at gmail.com] Sent: Sunday, 13 July 2014 12:19 a.m. To: Gib Bogle Cc: vtkusers at vtk.org Subject: Re: [vtkusers] TensorGlyph I'll fix the example on the wiki so it works for both vtk5 and vtk6. Normally the night builds would catch this, but the example was in the wring location. On Sat, Jul 12, 2014 at 6:00 AM, Gib Bogle wrote: > I got a clue from the Glyph3D example, which shows the check for > VTK_MAJOR_VERSION <= 5 > I then replaced these lines > // tensorGlyph->SetInputData(polyData); > // tensorGlyph->SetSourceConnection(cubeSource->GetOutputPort()); > tensorGlyph->SetSource(cubeSource->GetOutput()); > tensorGlyph->SetInput(polyData); > and this one > // mapper->SetInputData(tensorGlyph->GetOutput()); > mapper->SetInputConnection(tensorGlyph->GetOutputPort()); > and now it builds and runs :) > > ________________________________ > From: vtkusers [vtkusers-bounces at vtk.org] on behalf of Gib Bogle > [g.bogle at auckland.ac.nz] > Sent: Saturday, 12 July 2014 8:56 p.m. > To: vtkusers at vtk.org > Subject: [vtkusers] TensorGlyph > > Hi, > I tried to build this example: > http://www.vtk.org/Wiki/VTK/Examples/Visualization/TensorGlyph > but I get two errors: > class "vtkTensorGlyph" has no member "SetInputData" > class "vtkPolyDataMapper" has no member "SetInputData" > I am using VTK-5.10 > > Regards > Gib > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Unpaid intern in BillsBasement at noware dot com _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/vtkusers From safna.royal10 at gmail.com Mon Jul 14 00:56:06 2014 From: safna.royal10 at gmail.com (safna) Date: Sun, 13 Jul 2014 21:56:06 -0700 (PDT) Subject: [vtkusers] Border line color of vtkTextWidget In-Reply-To: References: Message-ID: <1405313766463-5727845.post@n5.nabble.com> Try to Set Color to vtktextactor not to vtktextwidget. textActor->GetTextProperty()->SetColor( 0.0, 1.0, 0.0 ); -- View this message in context: http://vtk.1045678.n5.nabble.com/Border-line-color-of-vtkTextWidget-tp5727709p5727845.html Sent from the VTK - Users mailing list archive at Nabble.com. From zhaokang.cn at gmail.com Mon Jul 14 01:50:39 2014 From: zhaokang.cn at gmail.com (Kang Zhao) Date: Mon, 14 Jul 2014 13:50:39 +0800 Subject: [vtkusers] How to implement selection with wxPython Message-ID: <53C36FAF.6040807@gmail.com> Hi all, I am a wxpython user and pretty new to VTK. I need to do (1) embed VTK window into my wxPython frame and (2)implement selection(bubber band). I managed to do (1) by using following two classes: https://github.com/Kitware/VTK/blob/master/Wrapping/Python/vtk/wx/wxVTKRenderWindow.py https://github.com/Kitware/VTK/blob/master/Wrapping/Python/vtk/wx/wxVTKRenderWindowInteractor.py For (2), by my study, *classvtkInteractorStyleRubberBandPick* can be used, but I haven't figured out how to use it with my wxVTKRenderWindow. Could anyone share some clue? Thanks in advance. Kang -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.jourdain at kitware.com Mon Jul 14 10:15:35 2014 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Mon, 14 Jul 2014 08:15:35 -0600 Subject: [vtkusers] (no subject) In-Reply-To: <53C33B8B.5050208@gmail.com> References: <53C33B8B.5050208@gmail.com> Message-ID: Make sure you call that on the mapper. Moreover, you should make sure that the data array that contains the color if of type vtkUnsignedCharArray void vtkMapper::SetColorModeToDefault() On Sun, Jul 13, 2014 at 8:08 PM, weixuegong wrote: > The mapper is vtkDataSetMapper, and I use the default setting. > It is sure that the values of params of setTuple3() is 0~255. > Should I not use the setup of the mapper by default? > > I removed "reader->Update()" in case of reloading the data on disk, but it > didn't work. > > > > Then is the setup of the mapper that is wrong. > Moreover, do you know if the data array is an unsigned char one? > > > > > On Sun, Jul 13, 2014 at 7:19 PM, weixue gong > wrote: > >> I got the data of points. Then : >> vtkDataArray* scalars = reader->getOutput()->getPointData()-> >> getScalars(); >> scalars->setTuple3(i, r, g, b); >> data->setScalars(scalars); >> reader->Update(); >> >> but the color didn't changed, is there any step I did wrong? >> >> >> >> 2014-07-13 22:49 GMT+08:00 Sebastien Jourdain < >> sebastien.jourdain at kitware.com>: >> >> POINT_DATA means that you should call ->GetPointData() instead of >>> ->GetCellData(). >>> >>> >>> On Sun, Jul 13, 2014 at 8:00 AM, ??? wrote: >>> >>>> Now I have an vtkDataSet object from a reader.I had tried to change >>>> the color of the output of vtkDataSetReader(not set the color of actor), >>>> but had no idea. >>>> >>>> The reason is that I want to write the dataset back to hard disk with >>>> the new color. >>>> >>>> I could get the number of cells in this dataset, and when I tried to >>>> get the scalars and modify the scalars(it holds the color, am I right), it >>>> crushed. >>>> this->reader->Update(); >>>> vtkDataSet* ds = reader->GetOutput(); >>>> vtkCellData* cellData = ds->GetCellData(); >>>> vtkDataArray* scalars = cellData->GetScalars(); >>>> int size = scalars->GetSize();//equals to the number of cells in >>>> dataset? >>>> //then we can modify scalars... >>>> >>>> >>>> I am not sure if it is the right way, and I googled it, but found >>>> nothing helpful, >>>> >>>> The vtk file was converted from vrml.and it has about 332 points, 110 >>>> lines, 102 polygons,and I found in this file there were: >>>> POINT_DATA 332 >>>> COLOR_SCALARS VRMLColor 3 >>>> >>>> So, could any one give me some tips? >>>> Any advice would be appreciated! >>>> >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ at: >>>> http://www.vtk.org/Wiki/VTK_FAQ >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://public.kitware.com/mailman/listinfo/vtkusers >>>> >>>> >>> >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bmerrell at aquaveo.com Mon Jul 14 14:45:02 2014 From: bmerrell at aquaveo.com (Blair Merrell) Date: Mon, 14 Jul 2014 12:45:02 -0600 Subject: [vtkusers] Initializing vtkHyperTreeGridSuperCursor Message-ID: Hi all, Given a cell at any level and location in a vtkHyperTreeGrid what is the best way to initialize a vtkHyperTreeGridSuperCursor with it as its center vtkHyperTreeSimpleCursor? Thanks, BAM -------------- next part -------------- An HTML attachment was scrubbed... URL: From bryan at radialogica.com Mon Jul 14 16:15:14 2014 From: bryan at radialogica.com (Bryan Cool) Date: Mon, 14 Jul 2014 15:15:14 -0500 Subject: [vtkusers] Inclusiveness of Rasterization In-Reply-To: References: <01c401cf962a$6120b500$23621f00$@radialogica.com> <003b01cf9636$a82e4a00$f88ade00$@radialogica.com> Message-ID: <090701cf9fa0$55fd96a0$01f8c3e0$@radialogica.com> Thanks for the suggestion and apologies for the delay, David. Are you sure that a tolerance of 0.5 should be enough? Wouldn't a lower end contour intersecting a pixel .75 of the way across still be missed with 0.5, since {floor(.75 - .5) + 1} is 1? I tried tolerance values of 0.5 and 1.0 but unfortunately got the infamous streaking artifacts with both, so now I'm keeping the default tolerance and instead piping the output stencil image data through vtkImageContinuousDilate3D with a kernel size of (3,3,1). That seems to give me the coverage I'm looking for without any artifacts. Thanks again, Bryan From: David Gobbi [mailto:david.gobbi at gmail.com] Sent: Wednesday, July 2, 2014 4:17 PM To: Bryan Cool Cc: VTK Users Subject: Re: [vtkusers] Inclusiveness of Rasterization Have you tried adjusting the Tolerance on vtkPolyDataToImageStencil? You can try setting it to a large value like 0.5, which gives half a pixel in tolerance. That should guarantee that the contour is fully inside of the result. David On Wed, Jul 2, 2014 at 2:46 PM, Bryan Cool > wrote: Thanks for the quick reply, David. You're right: I'm in need of inclusivity on both ends. I'm voxelizing contours using vtkPolyDataToImageStencil and I want to ensure that the resulting stencil fully encapsulates the contours. Are there any tricks to compensate that wouldn't require me to modify my points directly? I guess I could just dilate my result, but it would be nice to have it as tight around the contours as possible. Thanks, Bryan From: David Gobbi [mailto:david.gobbi at gmail.com ] Sent: Wednesday, July 2, 2014 2:50 PM To: Bryan Cool Cc: VTK Users Subject: Re: [vtkusers] Inclusiveness of Rasterization Hi Bryan, Do you mean inclusive on both ends? Exclusive on both ends would just make it worse... The behavior of the rasterization is 100% intentional. In order for rasterization to work when there are adjacent areas that are being rasterized, it must be exclusive on one end and inclusive on the other end. Otherwise, adjacent areas could end up with either a gap between them or with an overlap. The exclusitivity can be compensated for by subtracting a small tolerance at the lower end or by using other tricks. What is your use case? - David On Wed, Jul 2, 2014 at 1:18 PM, Bryan Cool > wrote: Hi everyone, I noticed that vtkImageStencilRaster has code like the following in InsertLine and FillStencilData, for both the x and y directions: if (x1 >= xmin) { r1 = vtkMath::Floor(x1) + 1; } if (x2 < xmax) { r2 = vtkMath::Floor(x2); } Correct me if I'm wrong, but it looks like the lower side is exclusive, while the upper end is inclusive. The upshot of this is that the only way to stencil the first pixel is to have a line intersect the row on the negative side of the first pixel (in the extents). On the other hand, to stencil the last pixel a line only need intersect anywhere past the second-to-last pixel (in the extents). Assuming that's true, it seems a bit asymmetric. Is there any way to have exclusive behavior on both ends? Thanks, Bryan -------------- next part -------------- An HTML attachment was scrubbed... URL: From xpelaox at gmail.com Mon Jul 14 16:23:52 2014 From: xpelaox at gmail.com (ferluduena) Date: Mon, 14 Jul 2014 13:23:52 -0700 (PDT) Subject: [vtkusers] Creating a .dll with VTK. Message-ID: <1405369431926-5727853.post@n5.nabble.com> Hi! I've been making some progress with VTK, and my idea is to build a .dll in Visual studio, where I use VTK, and then, use it on a C# application. I have my VTK project, which i made using CMake, which is a console application, and looks like this: //---------------------------------------------------------------------------// #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void recon(int x, int y, int z); void recondemo(void); int main(int argc, char *argv[]) { int key = 0; cout << "Ingresar 1 Para reconstruir imagenes a partir de archivos, o 0 para demo" << endl; cin >> key; if (key == 1) { int x, y, z; x = y = z = 0; recon(x, y, z); } else { recondemo(); } return EXIT_SUCCESS; } void recon(int x=0, int y=0, int z=0){} void recondemo(void){} //----------------------------------------------------------------------------// So what i tried to do is going to the project's configuration in VS and change Type of configuration from .exe to .dll. after compiling i tried calling the .dll from a C# application, but when i run it i get an error saying the format is incorrect. This is how i call the function in c#: //------------------------------------------------------------------------------------// class PlatformInvokeTest { [DllImport("EmbedPointsIntoVolume.dll")] public static extern int recodemo(); [DllImport("EmbedPointsIntoVolume.dll")] internal static extern int _flushall(); //------------------------------------------------------------------------------------// } So, i'm pretty sure this can be done... but can someone give me an idea on how? I've read about different ways of calling a .dll ... but i'm pretty sure i'm not building the .dll right, to begin with. Hope someone can help me! Thanks in advance! -- View this message in context: http://vtk.1045678.n5.nabble.com/Creating-a-dll-with-VTK-tp5727853.html Sent from the VTK - Users mailing list archive at Nabble.com. From matimontg at gmail.com Mon Jul 14 17:21:34 2014 From: matimontg at gmail.com (Matias Montroull) Date: Mon, 14 Jul 2014 18:21:34 -0300 Subject: [vtkusers] Creating a .dll with VTK. In-Reply-To: <1405369431926-5727853.post@n5.nabble.com> References: <1405369431926-5727853.post@n5.nabble.com> Message-ID: I'km using Kitware VTK which is in C# On Mon, Jul 14, 2014 at 5:23 PM, ferluduena wrote: > Hi! I've been making some progress with VTK, and my idea is to build a .dll > in Visual studio, where I use VTK, and then, use it on a C# application. > > I have my VTK project, which i made using CMake, which is a console > application, and looks like this: > > > //---------------------------------------------------------------------------// > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > > void recon(int x, int y, int z); > void recondemo(void); > > int main(int argc, char *argv[]) > { > int key = 0; > cout << "Ingresar 1 Para reconstruir imagenes a partir de > archivos, o 0 > para demo" << endl; > cin >> key; > if (key == 1) > { > int x, y, z; > x = y = z = 0; > recon(x, y, z); > } > else > { > recondemo(); > } > return EXIT_SUCCESS; > > } > > void recon(int x=0, int y=0, int z=0){} > > void recondemo(void){} > > > //----------------------------------------------------------------------------// > > So what i tried to do is going to the project's configuration in VS and > change Type of configuration from .exe to .dll. > > after compiling i tried calling the .dll from a C# application, but when i > run it i get an error saying the format is incorrect. > > This is how i call the function in c#: > > > > //------------------------------------------------------------------------------------// > class PlatformInvokeTest > { > [DllImport("EmbedPointsIntoVolume.dll")] > public static extern int recodemo(); > [DllImport("EmbedPointsIntoVolume.dll")] > internal static extern int _flushall(); > > //------------------------------------------------------------------------------------// > } > > So, i'm pretty sure this can be done... but can someone give me an idea on > how? I've read about different ways of calling a .dll ... but i'm pretty > sure i'm not building the .dll right, to begin with. > > Hope someone can help me! > > Thanks in advance! > > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Creating-a-dll-with-VTK-tp5727853.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Mon Jul 14 17:54:24 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 14 Jul 2014 15:54:24 -0600 Subject: [vtkusers] Inclusiveness of Rasterization In-Reply-To: <090701cf9fa0$55fd96a0$01f8c3e0$@radialogica.com> References: <01c401cf962a$6120b500$23621f00$@radialogica.com> <003b01cf9636$a82e4a00$f88ade00$@radialogica.com> <090701cf9fa0$55fd96a0$01f8c3e0$@radialogica.com> Message-ID: Hi Bryan, Thanks for the follow-up. Actually, I looked through the code and the tolerance is only properly applied in the X direction. But as for whether 0.5 would be enough (assuming that it was applied uniformly in all directions), it should be because you just have to be sure that the _center_ of the voxel is within the contour, so if the contour is e.g. a square contour with its corners at exact pixel locations, even a very small tolerance should be enough to make sure that the centers of all voxels are within the stencil. About the streaking, in fact I know how to change the algorithm to fix that, and I've been trying to find time to further develop my segmentation tools, of which vtkPolyDataToImageStencil is a part. Unfortunately, I doubt that I'll be able to get started on it until the fall. - David On Mon, Jul 14, 2014 at 2:15 PM, Bryan Cool wrote: > Thanks for the suggestion and apologies for the delay, David. Are you sure > that a tolerance of 0.5 should be enough? Wouldn't a lower end contour > intersecting a pixel .75 of the way across still be missed with 0.5, since > {floor(.75 - .5) + 1} is 1? > > > > I tried tolerance values of 0.5 and 1.0 but unfortunately got the infamous > streaking artifacts with both, so now I'm keeping the default tolerance and > instead piping the output stencil image data through > vtkImageContinuousDilate3D with a kernel size of (3,3,1). That seems to > give me the coverage I'm looking for without any artifacts. > > > > Thanks again, > > Bryan > > > > From: David Gobbi [mailto:david.gobbi at gmail.com] > Sent: Wednesday, July 2, 2014 4:17 PM > > > To: Bryan Cool > Cc: VTK Users > Subject: Re: [vtkusers] Inclusiveness of Rasterization > > > > Have you tried adjusting the Tolerance on vtkPolyDataToImageStencil? > > You can try setting it to a large value like 0.5, which gives half a pixel > > in tolerance. That should guarantee that the contour is fully inside of > > the result. > > > > David > > > > On Wed, Jul 2, 2014 at 2:46 PM, Bryan Cool wrote: > > Thanks for the quick reply, David. You're right: I'm in need of inclusivity > on both ends. I'm voxelizing contours using vtkPolyDataToImageStencil and I > want to ensure that the resulting stencil fully encapsulates the contours. > Are there any tricks to compensate that wouldn't require me to modify my > points directly? I guess I could just dilate my result, but it would be > nice to have it as tight around the contours as possible. > > > > Thanks, > > Bryan > > > > From: David Gobbi [mailto:david.gobbi at gmail.com] > Sent: Wednesday, July 2, 2014 2:50 PM > To: Bryan Cool > Cc: VTK Users > Subject: Re: [vtkusers] Inclusiveness of Rasterization > > > > Hi Bryan, > > > > Do you mean inclusive on both ends? Exclusive on both ends would > > just make it worse... > > > > The behavior of the rasterization is 100% intentional. In order for > > rasterization to work when there are adjacent areas that are being > > rasterized, it must be exclusive on one end and inclusive on the > > other end. Otherwise, adjacent areas could end up with either a > > gap between them or with an overlap. > > > > The exclusitivity can be compensated for by subtracting a small > > tolerance at the lower end or by using other tricks. > > > > What is your use case? > > > > - David > > > > > > On Wed, Jul 2, 2014 at 1:18 PM, Bryan Cool wrote: > > Hi everyone, > > I noticed that vtkImageStencilRaster has code like the following in > InsertLine and FillStencilData, for both the x and y directions: > > if (x1 >= xmin) > { > r1 = vtkMath::Floor(x1) + 1; > } > if (x2 < xmax) > { > r2 = vtkMath::Floor(x2); > } > > Correct me if I'm wrong, but it looks like the lower side is exclusive, > while the upper end is inclusive. The upshot of this is that the only way > to stencil the first pixel is to have a line intersect the row on the > negative side of the first pixel (in the extents). On the other hand, to > stencil the last pixel a line only need intersect anywhere past the > second-to-last pixel (in the extents). > > Assuming that's true, it seems a bit asymmetric. Is there any way to have > exclusive behavior on both ends? > > Thanks, > Bryan > > From xpelaox at gmail.com Mon Jul 14 18:01:16 2014 From: xpelaox at gmail.com (ferluduena) Date: Mon, 14 Jul 2014 15:01:16 -0700 (PDT) Subject: [vtkusers] Creating a .dll with VTK. In-Reply-To: References: <1405369431926-5727853.post@n5.nabble.com> Message-ID: <1405375276065-5727856.post@n5.nabble.com> I first tired activiz, but i had no luck making it work in Windows 8 64 bits. In what S.O are you using it? If you have any link that might help me, i would highly appreciate it. -- View this message in context: http://vtk.1045678.n5.nabble.com/Creating-a-dll-with-VTK-tp5727853p5727856.html Sent from the VTK - Users mailing list archive at Nabble.com. From matimontg at gmail.com Mon Jul 14 19:08:52 2014 From: matimontg at gmail.com (Matias Montroull) Date: Mon, 14 Jul 2014 20:08:52 -0300 Subject: [vtkusers] Creating a .dll with VTK. In-Reply-To: <1405375276065-5727856.post@n5.nabble.com> References: <1405369431926-5727853.post@n5.nabble.com> <1405375276065-5727856.post@n5.nabble.com> Message-ID: I'm using Windows 7 64 Bits On Mon, Jul 14, 2014 at 7:01 PM, ferluduena wrote: > I first tired activiz, but i had no luck making it work in Windows 8 64 > bits. > > In what S.O are you using it? If you have any link that might help me, i > would highly appreciate it. > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Creating-a-dll-with-VTK-tp5727853p5727856.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From xpelaox at gmail.com Mon Jul 14 19:46:11 2014 From: xpelaox at gmail.com (ferluduena) Date: Mon, 14 Jul 2014 16:46:11 -0700 (PDT) Subject: [vtkusers] Creating a .dll with VTK. In-Reply-To: References: <1405369431926-5727853.post@n5.nabble.com> <1405375276065-5727856.post@n5.nabble.com> Message-ID: <1405381571482-5727858.post@n5.nabble.com> And what version of Visual Studio? -- View this message in context: http://vtk.1045678.n5.nabble.com/Creating-a-dll-with-VTK-tp5727853p5727858.html Sent from the VTK - Users mailing list archive at Nabble.com. From julien.jomier at kitware.com Tue Jul 15 02:21:36 2014 From: julien.jomier at kitware.com (Julien Jomier) Date: Tue, 15 Jul 2014 08:21:36 +0200 Subject: [vtkusers] Creating a .dll with VTK. In-Reply-To: <1405381571482-5727858.post@n5.nabble.com> References: <1405369431926-5727853.post@n5.nabble.com> <1405375276065-5727856.post@n5.nabble.com> <1405381571482-5727858.post@n5.nabble.com> Message-ID: <53C4C870.4000301@kitware.com> Did you make sure that the ActiViz version is matching your compiler (and your compiling option): 64 vs 32bits? Julien On 15/07/2014 01:46, ferluduena wrote: > And what version of Visual Studio? > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/Creating-a-dll-with-VTK-tp5727853p5727858.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > From matimontg at gmail.com Tue Jul 15 09:05:55 2014 From: matimontg at gmail.com (Matias Montroull) Date: Tue, 15 Jul 2014 10:05:55 -0300 Subject: [vtkusers] Creating a .dll with VTK. In-Reply-To: <53C4C870.4000301@kitware.com> References: <1405369431926-5727853.post@n5.nabble.com> <1405375276065-5727856.post@n5.nabble.com> <1405381571482-5727858.post@n5.nabble.com> <53C4C870.4000301@kitware.com> Message-ID: I'm using Visual Studio 2012 and 2013 both work On Tue, Jul 15, 2014 at 3:21 AM, Julien Jomier wrote: > Did you make sure that the ActiViz version is matching your compiler (and > your compiling option): 64 vs 32bits? > > Julien > > > On 15/07/2014 01:46, ferluduena wrote: > >> And what version of Visual Studio? >> >> >> >> -- >> View this message in context: http://vtk.1045678.n5.nabble. >> com/Creating-a-dll-with-VTK-tp5727853p5727858.html >> Sent from the VTK - Users mailing list archive at Nabble.com. >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at http://www.kitware.com/ >> opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From xpelaox at gmail.com Tue Jul 15 10:03:41 2014 From: xpelaox at gmail.com (ferluduena) Date: Tue, 15 Jul 2014 07:03:41 -0700 (PDT) Subject: [vtkusers] Creating a .dll with VTK. In-Reply-To: References: <1405369431926-5727853.post@n5.nabble.com> <1405375276065-5727856.post@n5.nabble.com> <1405381571482-5727858.post@n5.nabble.com> <53C4C870.4000301@kitware.com> Message-ID: <1405433021154-5727863.post@n5.nabble.com> Thanks a lot, i finally got it working. The only way of making it work was installing the 32 bits version, and setting everything to 32 bits. I guess it shouldn't be a problem, -- View this message in context: http://vtk.1045678.n5.nabble.com/Creating-a-dll-with-VTK-tp5727853p5727863.html Sent from the VTK - Users mailing list archive at Nabble.com. From matimontg at gmail.com Tue Jul 15 10:10:00 2014 From: matimontg at gmail.com (Matias Montroull) Date: Tue, 15 Jul 2014 11:10:00 -0300 Subject: [vtkusers] Creating a .dll with VTK. In-Reply-To: <1405433021154-5727863.post@n5.nabble.com> References: <1405369431926-5727853.post@n5.nabble.com> <1405375276065-5727856.post@n5.nabble.com> <1405381571482-5727858.post@n5.nabble.com> <53C4C870.4000301@kitware.com> <1405433021154-5727863.post@n5.nabble.com> Message-ID: Oh yes, I'm using the 32 bits version, you're right, now I see my dll is 32 bits. Sorry I didn't notice before On Tue, Jul 15, 2014 at 11:03 AM, ferluduena wrote: > Thanks a lot, i finally got it working. The only way of making it work was > installing the 32 bits version, and setting everything to 32 bits. I guess > it shouldn't be a problem, > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Creating-a-dll-with-VTK-tp5727853p5727863.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Tue Jul 15 10:20:14 2014 From: dave.demarle at kitware.com (David E DeMarle) Date: Tue, 15 Jul 2014 10:20:14 -0400 Subject: [vtkusers] vtkPolyData to a vtkUnstructuredGrid In-Reply-To: <53C0606A.7020207@gmail.com> References: <338CF46B-CDD6-43EE-AE51-62718D0D8FC8@sci.utah.edu> <53C0606A.7020207@gmail.com> Message-ID: Hey Allen! Probably a bug in the append filter, it must not be converting with polylines type cells correctly for some reason. As Burlen said it would help if you could post a small example data set. That will make it trivial to replicate the problem and fix it. Otherwise, try using a different filter to do the conversion (as a side effect, like append does). Threshold is my habitual choice for * to unstructured conversion. David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Fri, Jul 11, 2014 at 6:08 PM, Burlen Loring wrote: > It would help if you post an example with some data so that we can see > exactly what you're doing. > > > On 07/11/2014 01:29 PM, Allen Sanderson wrote: > > > Hello, > > I have a vtkPolyData structure that contains vtkPolyLines or vertex(s). > In the course of the coding the vtkPolyData needs to be converted to a > vtkUnstructuredGrid. I have used the example here using the append filter: > > > http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PolyDataToUnstructuredGrid > > However, no lines come across only points. I have also iterated through > each cell and moved the point id list over with the same results, no lines > > As such, I am wondering why lines might not be moved over. > > Cheers, > > Allen > > > Allen Sanderson > SCI Institute > University of Utah > www.sci.utah.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 > > Follow this link to subscribe/unsubscribe:http://public.kitware.com/mailman/listinfo/vtkusers > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From julien.finet at kitware.com Tue Jul 15 10:30:16 2014 From: julien.finet at kitware.com (Julien Finet) Date: Tue, 15 Jul 2014 10:30:16 -0400 Subject: [vtkusers] display 3Dglyph with VTK6 In-Reply-To: <793E0EF657618A4CBAA7E28877543989267F0D12@ITS-MSXMBS5F.ad.unc.edu> References: <793E0EF657618A4CBAA7E28877543989267F0D12@ITS-MSXMBS5F.ad.unc.edu> Message-ID: Hi Alexis, In your example, you should use SetInputConnection() instead of SetInputData() for your vtkGlyph3D and vtkPolyDataMapper filters. Hth, Julien. On Thu, May 15, 2014 at 5:31 PM, Girault, Alexis wrote: > I am working on ShapePopulationViewer, a NITRC tool and also a module in > Slicer4. > > When trying to go from VTK5 to VTK6 I ran into multiple problems, here is > the first : > > I used to display surfaces with point attributes, that could be scalar or > vectors. > Scalar attributes would be displayed as a color for the mesh point, and > vector attributes as 3D arrow glyph. > 1. scalars only : > http://www.nitrc.org/project/screenshot.php?group_id=759&screenshot_id=705 > 2. with vectors : > http://www.nitrc.org/project/screenshot.php?group_id=759&screenshot_id=706 > > We updated the code following the two first lines of the VTK6 Migration > Guide : > http://www.vtk.org/Wiki/VTK/VTK_6_Migration_Guidee > > Here is the example that includes most of the code updated related to the > 3dglyph : > https://gist.github.com/agirault/aabbf6ccb96518509683 > > The issue : with VTK5, the glyphs are displayed, with VTK6, they are not. > Any ideas? I am doing something wrong when setting the inputs for the data > to read? > > Thanks. > Alexis > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Tue Jul 15 10:38:59 2014 From: dave.demarle at kitware.com (David E DeMarle) Date: Tue, 15 Jul 2014 10:38:59 -0400 Subject: [vtkusers] vtk books In-Reply-To: References: Message-ID: The code examples in the book have not been updated to cover the changes to the library. However, the changes between 5 and 6 are mostly relatively minor syntactical changes ( http://www.vtk.org/Wiki/VTK/VTK_6_Migration/Overview), the overall behavior and theme of VTK remains the same. So I think you are better off buying now rather than waiting until the next editions come out. I have no information yet about when the next books will come out. cheers, David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Thu, Jul 10, 2014 at 8:42 AM, Petar Petrov wrote: > Hello dear VTK user, > just wondering, does anyone have a clear idea how up to date are the > VTK book: http://kitware.stores.yahoo.net/vtkteusgucm.html > mostly considering changes effective vtk 6.0 and above ? > > regards, > Petar > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From guillaume.jacquenot at gmail.com Tue Jul 15 10:51:35 2014 From: guillaume.jacquenot at gmail.com (Guillaume Jacquenot) Date: Tue, 15 Jul 2014 16:51:35 +0200 Subject: [vtkusers] Use of vtkAlgorithmOutput and vtkSmartPointer Message-ID: Dear VTK users, I am facing a memory issue with the vtkSmartPointer and vtkAlgorithmOutput. I want to create a function that returns a vtkSmartPointer for a vtkAlgorithmOutput, on a source object (like a vtkSTLReader instance). When I return such a pointer, it seems to me that my source object goes out of scope, and makes my program crash when I use it (like the input of SetInputConnection for a vtkTransformPolyDataFilter object). >From my tries, I guess I have to keep two vtkSmartPointer alive (one for the source and one for the vtkAlgorithmOutput) I was hoping that having a vtkSmartPointer on the GetOuputPort() of my source object would keep it alive. Am I missing something? Below is a source file that shows 3 test cases 1) everything is done in the same function, everything works, and memory is 2) I use a function to generate my vtkSmartPointer and a manual allocation for my source. It works but creates a memory leak 3) I use a function to generate my vtkSmartPointer and a vtkSmartPointer to handle my source. It does not work at all. What is the best solution? Should I create a class to store all these smartpointer Best regards Guillaume Jacquenot #include #include #include #include #include // Test case 1 // Everything is in the same scope, everything works. // The use vtkSmartPointer allows not to free manually memory. void foo_OK() { char const * const inputFilename= "airFoil2D.stl"; vtkSmartPointer reader = vtkSmartPointer::New(); reader->SetFileName(inputFilename); reader->Update(); vtkSmartPointer tr1 = vtkSmartPointer::New(); vtkSmartPointer tf1 = vtkSmartPointer::New(); tr1->Translate(1.0,0.0,0.0); tr1->Update(); tf1->SetTransform(tr1); tf1->SetInputConnection(reader->GetOutputPort()); } // Test case 2 // Use of a function to get the outputport from a source file (vtkGetOutputPortBar_with_memory_leak). // vtkSTLReader memory is manually is handled, and needs to be freed. // If no delete command is present, a memory leak is present. (this is the case here) vtkSmartPointer vtkGetOutputPortBar_with_memory_leak(char const * const filename) { vtkSmartPointer sm = vtkSmartPointer::New(); vtkSTLReader* reader = vtkSTLReader::New(); // -> Works but creates a memory leak reader->SetFileName(filename); reader->Update(); sm.TakeReference(reader->GetOutputPort()); return sm; } void foo_OK_but_with_memory_leak() { char const * const inputFilename= "airFoil2D.stl"; vtkSmartPointer tr1 = vtkSmartPointer::New(); vtkSmartPointer tf1 = vtkSmartPointer::New(); tr1->Translate(1.0,0.0,0.0); tr1->Update(); tf1->SetTransform(tr1); tf1->SetInputConnection(0,vtkGetOutputPortBar_with_memory_leak(inputFilename)); tf1->Update(); } // Test case 3 // Use of a function to get the outputport from a source file (vtkGetOutputPortBar). // Data seems to go out of scope, and calling function (foo_NOK) crashes. vtkSmartPointer vtkGetOutputPortBar(char const * const filename) { vtkSmartPointer sm = vtkSmartPointer::New(); vtkSmartPointer reader = vtkSmartPointer::New(); // -> Does not work reader->SetFileName(filename); reader->Update(); sm.TakeReference(reader->GetOutputPort()); return sm; } void foo_NOK() { char const * const inputFilename= "airFoil2D.stl"; vtkSmartPointer tr1 = vtkSmartPointer::New(); vtkSmartPointer tf1 = vtkSmartPointer::New(); tr1->Translate(1.0,0.0,0.0); tr1->Update(); tf1->SetTransform(tr1); tf1->SetInputConnection(0,vtkGetOutputPortBar(inputFilename)); tf1->Update(); tf1->GetOutputPort()->Print(std::cout); } int main() { std::cout<<"test case 1 -- Ok but everything the same function (same scope)"< From berk.geveci at kitware.com Tue Jul 15 11:57:11 2014 From: berk.geveci at kitware.com (Berk Geveci) Date: Tue, 15 Jul 2014 11:57:11 -0400 Subject: [vtkusers] Use of vtkAlgorithmOutput and vtkSmartPointer In-Reply-To: References: Message-ID: Hi Guillaume, Your observation is accurate. vtkAlgorithmOutput does not store a reference to its owner and is meant to be used temporarily to connect pipeline objects. I'd recommend storing the algorithm and the output port index - a struct of vtkSmartPointer and int for example - and calling GetOutputPort() when needed. Best, -berk On Tue, Jul 15, 2014 at 10:51 AM, Guillaume Jacquenot < guillaume.jacquenot at gmail.com> wrote: > Dear VTK users, > > I am facing a memory issue with the vtkSmartPointer and vtkAlgorithmOutput. > > I want to create a function that returns a > vtkSmartPointer for a vtkAlgorithmOutput, on a source object (like a > vtkSTLReader instance). > When I return such a pointer, it seems to me that my source object goes > out of scope, and makes my program crash when I use it (like the input of > SetInputConnection for a vtkTransformPolyDataFilter object). > From my tries, I guess I have to keep two > vtkSmartPointer alive (one for the source and one for the > vtkAlgorithmOutput) > > I was hoping that having a vtkSmartPointer on the > GetOuputPort() of my source object would keep it alive. > Am I missing something? > > > Below is a source file that shows 3 test cases > 1) everything is done in the same function, everything works, and memory > is > 2) I use a function to generate my vtkSmartPointer and > a manual allocation for my source. It works but creates a memory leak > 3) > I use a function to generate my vtkSmartPointer and a > vtkSmartPointer to handle my source. It does not work at all. > > What is the best solution? > Should I create a class to store all these smartpointer > > > Best regards > Guillaume Jacquenot > > #include > #include > #include > #include > #include > > // Test case 1 > // Everything is in the same scope, everything works. > // The use vtkSmartPointer allows not to free manually memory. > void foo_OK() > { > char const * const inputFilename= "airFoil2D.stl"; > vtkSmartPointer reader = > vtkSmartPointer::New(); > reader->SetFileName(inputFilename); > reader->Update(); > vtkSmartPointer tr1 = > vtkSmartPointer::New(); > vtkSmartPointer tf1 = > vtkSmartPointer::New(); > tr1->Translate(1.0,0.0,0.0); > tr1->Update(); > tf1->SetTransform(tr1); > tf1->SetInputConnection(reader->GetOutputPort()); > } > > // Test case 2 > // Use of a function to get the outputport from a source file > (vtkGetOutputPortBar_with_memory_leak). > // vtkSTLReader memory is manually is handled, and needs to be freed. > // If no delete command is present, a memory leak is present. (this is the > case here) > vtkSmartPointer > vtkGetOutputPortBar_with_memory_leak(char const * const filename) > { > vtkSmartPointer sm = > vtkSmartPointer::New(); > vtkSTLReader* reader = vtkSTLReader::New(); // -> Works but creates a > memory leak > reader->SetFileName(filename); > reader->Update(); > sm.TakeReference(reader->GetOutputPort()); > return sm; > } > void foo_OK_but_with_memory_leak() > { > char const * const inputFilename= "airFoil2D.stl"; > vtkSmartPointer tr1 = > vtkSmartPointer::New(); > vtkSmartPointer tf1 = > vtkSmartPointer::New(); > tr1->Translate(1.0,0.0,0.0); > tr1->Update(); > tf1->SetTransform(tr1); > > tf1->SetInputConnection(0,vtkGetOutputPortBar_with_memory_leak(inputFilename)); > tf1->Update(); > } > > // Test case 3 > // Use of a function to get the outputport from a source file > (vtkGetOutputPortBar). > // Data seems to go out of scope, and calling function (foo_NOK) crashes. > vtkSmartPointer vtkGetOutputPortBar(char const * const > filename) > { > vtkSmartPointer sm = > vtkSmartPointer::New(); > vtkSmartPointer reader = > vtkSmartPointer::New(); // -> Does not work > reader->SetFileName(filename); > reader->Update(); > sm.TakeReference(reader->GetOutputPort()); > return sm; > } > void foo_NOK() > { > char const * const inputFilename= "airFoil2D.stl"; > vtkSmartPointer tr1 = > vtkSmartPointer::New(); > vtkSmartPointer tf1 = > vtkSmartPointer::New(); > tr1->Translate(1.0,0.0,0.0); > tr1->Update(); > tf1->SetTransform(tr1); > tf1->SetInputConnection(0,vtkGetOutputPortBar(inputFilename)); > tf1->Update(); > tf1->GetOutputPort()->Print(std::cout); > } > int main() > { > std::cout<<"test case 1 -- Ok but everything the same function (same > scope)"< foo_OK(); > std::cout<<"test case 2 -- Works but all memory is not > freed"< foo_OK_but_with_memory_leak(); > std::cout<<"test case 3 -- Works but all memory is not > freed"< foo_NOK(); > return 0; > } > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From xpelaox at gmail.com Tue Jul 15 18:33:02 2014 From: xpelaox at gmail.com (ferluduena) Date: Tue, 15 Jul 2014 15:33:02 -0700 (PDT) Subject: [vtkusers] Creating a .dll with VTK. In-Reply-To: References: <1405369431926-5727853.post@n5.nabble.com> <1405375276065-5727856.post@n5.nabble.com> <1405381571482-5727858.post@n5.nabble.com> <53C4C870.4000301@kitware.com> <1405433021154-5727863.post@n5.nabble.com> Message-ID: <1405463582364-5727870.post@n5.nabble.com> Never mind, thanks a lot! I got a simple sphere example working, but i'm having issues with the code that was working on c++, i translated it so it compiles, but i get a run time error saying it's trying to access (0,0,0) which is out of bounds. Is there something i should know about the transition between c++ and c#? this is my code.... i'm sure it must be something silly. vtkPoints points = vtkPoints.New(); points.InsertNextPoint(p0[0],p0[1],p0[2]); points.InsertNextPoint(p1[0],p1[1],p1[2]); points.InsertNextPoint(p2[0],p2[1],p2[2]); points.InsertNextPoint(p3[0],p3[1],p3[2]); points.InsertNextPoint(p4[0],p4[1],p4[2]); points.InsertNextPoint(p5[0],p5[1],p5[2]); points.InsertNextPoint(p6[0],p6[1],p6[2]); points.InsertNextPoint(p7[0],p7[1],p7[2]); vtkPolyData polydata = vtkPolyData.New(); polydata.SetPoints(points); // Construct the surface and create isosurface. vtkSurfaceReconstructionFilter surf = vtkSurfaceReconstructionFilter.New(); surf.SetInput(polydata); vtkContourFilter cf = vtkContourFilter.New(); cf.SetInputConnection(surf.GetOutputPort()); cf.SetValue(0, 0.0); // Sometimes the contouring algorithm can create a volume whose gradient // vector and ordering of polygon (using the right hand rule) are // inconsistent. vtkReverseSense cures this problem. vtkReverseSense reverse = vtkReverseSense.New(); reverse.SetInputConnection(cf.GetOutputPort()); reverse.ReverseCellsOn(); reverse.ReverseNormalsOn(); vtkPolyDataMapper map =vtkPolyDataMapper.New(); map.SetInputConnection(reverse.GetOutputPort()); map.ScalarVisibilityOff(); vtkActor surfaceActor = vtkActor.New(); surfaceActor.SetMapper(map); vtkRenderWindow RenderWindow = renderWindowControl1.RenderWindow; // get a reference to the renderer vtkRenderer Renderer = RenderWindow.GetRenderers().GetFirstRenderer(); // set background color Renderer.SetBackground(0.2, 0.3, 0.4); // add actor to the renderer Renderer.AddActor(surfaceActor); // ensure all actors are visible (in this example not necessarely needed, // but in case more than one actor needs to be shown it might be a good idea) Renderer.ResetCamera(); -- View this message in context: http://vtk.1045678.n5.nabble.com/Creating-a-dll-with-VTK-tp5727853p5727870.html Sent from the VTK - Users mailing list archive at Nabble.com. From allen at sci.utah.edu Tue Jul 15 19:47:05 2014 From: allen at sci.utah.edu (Allen Sanderson) Date: Tue, 15 Jul 2014 17:47:05 -0600 Subject: [vtkusers] vtkPolyData to a vtkUnstructuredGrid In-Reply-To: References: <338CF46B-CDD6-43EE-AE51-62718D0D8FC8@sci.utah.edu> <53C0606A.7020207@gmail.com> Message-ID: <069418E0-7E91-4257-A18E-07E80D93C622@sci.utah.edu> Hi Dave, Thanks for the reply. I dug into the issue a bit more and found the conversion was working fine but a later operation seemed to not return any cell points thus I was thinking the conversion was not working. I just did some more digging and found the issue. In a nut shell an assumption was made that the unstructured grid would contain only polygonal cells (tris, hex, tets, etc) thus a max of eight vertices. A polyline does not fit that assumption. Thus memory got stomped on but did not cause a seg fault. Thus the classic chasing ones tail was the issue. So no bug but some bad code on our part. Cheers, Allen Allen Sanderson SCI Institute University of Utah www.sci.utah.edu On Jul 15, 2014, at 8:20 AM, David E DeMarle wrote: > Hey Allen! > > Probably a bug in the append filter, it must not be converting with polylines type cells correctly for some reason. > > As Burlen said it would help if you could post a small example data set. That will make it trivial to replicate the problem and fix it. > > Otherwise, try using a different filter to do the conversion (as a side effect, like append does). Threshold is my habitual choice for * to unstructured conversion. > > > > > David E DeMarle > Kitware, Inc. > R&D Engineer > 21 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-881-4909 > > > On Fri, Jul 11, 2014 at 6:08 PM, Burlen Loring wrote: > It would help if you post an example with some data so that we can see exactly what you're doing. > > > On 07/11/2014 01:29 PM, Allen Sanderson wrote: >> >> Hello, >> >> I have a vtkPolyData structure that contains vtkPolyLines or vertex(s). In the course of the coding the vtkPolyData needs to be converted to a vtkUnstructuredGrid. I have used the example here using the append filter: >> >> http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PolyDataToUnstructuredGrid >> >> However, no lines come across only points. I have also iterated through each cell and moved the point id list over with the same results, no lines >> >> As such, I am wondering why lines might not be moved over. >> >> Cheers, >> >> Allen >> >> >> Allen Sanderson >> SCI Institute >> University of Utah >> www.sci.utah.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 >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.schussman at gmail.com Tue Jul 15 20:35:48 2014 From: greg.schussman at gmail.com (Greg Schussman) Date: Tue, 15 Jul 2014 17:35:48 -0700 Subject: [vtkusers] Connecting to arrays in a reader Message-ID: Hi. I've been reading the visualization toolkit book and user's guide, googling a fair bit, and digging through the vtk websites. I'm not sure how things are meant to connect. I'm working in python. I'm trying to build and use a reader. Many examples seem to assume there's only a single field that can be made active. But in my case, the reader is where I keep all information, and there is no sense (at least in my mind) of an "active" field, because several may be used at ones (scalar for surface coloring, one vector field for one set of cone glyphs, and another vector field for a different set of cone glyphs, all to be displayed at the same time). I create the each field this way (where my_voltages is just a python list that I parsed from a file): voltage = vtkDoubleArray() voltage.SetName('voltage') voltage.SetNumberOfComponents(1) for v in my_voltages: voltage.InsertNextValue(v) And I did the same thing for the 3D fields, except using 3 for the number of components. Then, I add these fields to my reader (derived from vtkProgrammableSource) this way: # 1D fields: self.GetPolyDataOutput().GetCellData().AddArray(voltage) self.GetPolyDataOutput().GetCellData().AddArray(charge) # 3D fields: self.GetPolyDataOutput().GetCellData().AddArray(current_density_real) self.GetPolyDataOutput().GetCellData().AddArray(current_density_imag) I'm able to iterate through those and print out the correct values and some of my early scalar visualization with colormaps and such seem to be working. So, first question is: does what I have done so far seem reasonable or is there a more vtk-ish way of doing this? Second question is how to connect to the reader. I'm trying to use it this way: cone = vtkConeSource() cone.SetRadius(0.1) cone.SetHeight(0.5) cone.SetResolution(8) glyph = vtkGlyph3D() glyph.SetInputConnection( WHAT GOES HERE??? ) glyph.SetSourceConnection(self.cone.GetOutputPort()) glyph.SetScaleModeToDataScalingOff() glyph.SetScaleFactor(1.0e-3) glyph.SetVectorModeToUseVector() glyph.OrientOn() So the "what goes here" is this question. Because I used a named array, I'd hope for something like: glyph.SetInputConnection(reader.GetOutputPort('current_density_real')) But that doesn't work, and I've seen nothing to suggest that it would. When I try this as the argument, reader.GetPolyDataOutput().GetCellData().GetArray('current_density_real') I get: TypeError: argument 1: method requires a vtkAlgorithmOutput, a vtkDoubleArray was provided. Switching from SetInputConnection() to just SetInput() gives this error instead TypeError: argument 1: method requires a vtkDataObject, a vtkDoubleArray was provided. Is this a matter of converting an array to an algorithm output? It seems (probably quite wrongly) to me that algorithms can produce many different kinds of output, and that a vtkArray would reasonably be one of them. Or, when using the SetInput(), why wouldn't a vtkArray be a vtkDataObject? Of course, the easy answer is "that's not how the inheritance diagrams are drawn", but that doesn't really get me closer to groking the intended grand scheme of things. I'm not complaining; I'm just confused. How to I get the glyph to use the vector data (in the vtkArray) as its input? (or if that's the wrong way to think about this, then what's the right way?) Many thanks in advance for any help/enlightenment. Greg -------------- next part -------------- An HTML attachment was scrubbed... URL: From isimtic at gmail.com Tue Jul 15 21:06:15 2014 From: isimtic at gmail.com (=?UTF-8?B?QWhtZXQgRG/En2Fu?=) Date: Wed, 16 Jul 2014 04:06:15 +0300 Subject: [vtkusers] center of rotation Message-ID: <53C5D007.5070308@gmail.com> hi everyone, I have looked vtk user guide also webpages up but i cant find any information how we can set the center of the rotation when we rotate with mouse because after we pan the object or the model center isnt on the initial rotation center it starts to rotate differently. Thank you for any trick From frid.hou at gmail.com Tue Jul 15 23:01:03 2014 From: frid.hou at gmail.com (frid hou) Date: Tue, 15 Jul 2014 20:01:03 -0700 (PDT) Subject: [vtkusers] center of rotation In-Reply-To: <53C5D007.5070308@gmail.com> References: <53C5D007.5070308@gmail.com> Message-ID: <1405479663902-5727874.post@n5.nabble.com> I think void vtkProp3D::SetOrigin() is what you are looking for. -- View this message in context: http://vtk.1045678.n5.nabble.com/center-of-rotation-tp5727873p5727874.html Sent from the VTK - Users mailing list archive at Nabble.com. From hectordejea at gmail.com Wed Jul 16 03:03:33 2014 From: hectordejea at gmail.com (Hector Dejea) Date: Wed, 16 Jul 2014 09:03:33 +0200 Subject: [vtkusers] Fwd: Move distance widget on a plane In-Reply-To: References: Message-ID: Hi all, I'm trying to get a distance widget moving on a certain plane. The widget measures the distance between two points which I want the user to be able to modify. As the image is in 3D, when I move a point it doesn't stay in the current plane and goes somewhere far away to other plane. How can I force the widget to move on a desired plane? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From hectordejea at gmail.com Wed Jul 16 05:18:23 2014 From: hectordejea at gmail.com (Hector Dejea) Date: Wed, 16 Jul 2014 11:18:23 +0200 Subject: [vtkusers] Extract field from .vtu file Message-ID: Hi all, I am trying to visualize a field contained in a .vtu file but all I got is a solid colored image. Does anybody know how to visualize the field on the geometry? Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From ChristianA at gmx.ch Wed Jul 16 05:22:56 2014 From: ChristianA at gmx.ch (Christian Arens) Date: Wed, 16 Jul 2014 11:22:56 +0200 Subject: [vtkusers] Convert vtkPolyData to vtkImageData - wrong values at points where objects intersects Message-ID: An HTML attachment was scrubbed... URL: From safna.royal10 at gmail.com Wed Jul 16 08:16:11 2014 From: safna.royal10 at gmail.com (safna) Date: Wed, 16 Jul 2014 05:16:11 -0700 (PDT) Subject: [vtkusers] Find Out the Cell ID In-Reply-To: <1404988104911-5727814.post@n5.nabble.com> References: <1404988104911-5727814.post@n5.nabble.com> Message-ID: <1405512971255-5727878.post@n5.nabble.com> Some times the Cell locator is giving wrong cell id also. Do Any one have better solution to find the cell id of a 3D point correctly.i need to find the normal of that point through that cell id. -- View this message in context: http://vtk.1045678.n5.nabble.com/Find-Out-the-Cell-ID-tp5727233p5727878.html Sent from the VTK - Users mailing list archive at Nabble.com. From kekko84 at gmail.com Wed Jul 16 09:08:32 2014 From: kekko84 at gmail.com (Francesco Argese) Date: Wed, 16 Jul 2014 15:08:32 +0200 Subject: [vtkusers] Automatically configure scalar range for mappers Message-ID: Hello, I'm new to vtk and I'm having a problem already asked on this forum but that has never received a response. The previous related posts are the folowing: - http://www.vtk.org/pipermail/vtkusers/2012-June/074840.html - http://public.kitware.com/pipermail/vtkusers/2002-January/009488.html In my case I have a lsdyna fem analysis loaded correctly through Vtk that I like to color selecting a particular property (for example velocity or acceleration) specified in it. At the moment I'm able to show something similar to what ParaView display for the model except for the range. If I set statically the range that I have found with ParaView on a specified model I see the same colours but I don't know how to calculate the range for a generic model. I have tried the following: - using actor->GetMapper()->GetInput()->GetPointData()->GetArray(id) to retrieve parameters related to a property (I think it could be right because GetName on the array give me the right property name): I calculated a range but the max is different from that calculated in ParaView and colours are not so useful. Could it be possible that the array I'm using is wrong? Or is there some other scaling operation on those parameters? - Getting range through GetRange() function but it also don't do me the same results of ParaView. Considering that in ParaView there is something similar I think it could be possible to do so. Have someone any suggestion to try resolving? Thanks in advance, Francesco Argese From MEEHANBT at nv.doe.gov Wed Jul 16 12:37:14 2014 From: MEEHANBT at nv.doe.gov (Meehan, Bernard) Date: Wed, 16 Jul 2014 16:37:14 +0000 Subject: [vtkusers] Extract field from .vtu file In-Reply-To: <7FD89C2023W71245-01@EMF_nv.doe.gov> References: <7FD89C2023W71245-01@EMF_nv.doe.gov> Message-ID: Hi Hector - I'm far from an expert, and usually use ParaView for anything complex. I wasn't able to figure out anything as good as the slice tool in paraview for instance, but this might get you going in the right direction. I have a file with one vector stored in an XML unstructured grid that I did a few things with: import vtk reader = vtk.vtkXMLUnstructuredGridReader() reader.SetFileName("waveguide_h000022.vtu") reader.SetPointArrayStatus("H", 1) #------------------------# # outline of the dataset # #------------------------# get_polydata = vtk.vtkGeometryFilter() get_polydata.SetInputConnection(reader.GetOutputPort()) outline = vtk.vtkExtractEdges() outline.SetInputConnection(get_polydata.GetOutputPort()) outline_mapper = vtk.vtkPolyDataMapper() outline_mapper.SetInputConnection(outline.GetOutputPort()) outline_actor = vtk.vtkActor() outline_actor.SetMapper(outline_mapper) outline_actor.GetProperty().SetColor(0.5, 1.0, 0.5) outline_actor.GetProperty().SetOpacity(0.25) #---------------------------------------# # clip with plane normal to z at origin # #---------------------------------------# plane = vtk.vtkPlane() plane.SetOrigin(0.0, 0.0, 0.0) plane.SetNormal(1.0, 0.0, 1.0) # re-use the polydata created above clipper = vtk.vtkClipPolyData() clipper.SetInputConnection(get_polydata.GetOutputPort()) clipper.SetClipFunction(plane) clipper.GenerateClipScalarsOn() clipper.GenerateClippedOutputOn() clipper.SetValue(0.0) clip_mapper = vtk.vtkPolyDataMapper() clip_mapper.SetInputConnection(clipper.GetOutputPort()) clip_actor = vtk.vtkActor() clip_actor.SetMapper(clip_mapper) #----------------------# # vectors in the field # #----------------------# arrow = vtk.vtkArrowSource() glyph_filter = vtk.vtkGlyph3D() glyph_filter.SetSourceConnection(arrow.GetOutputPort()) glyph_filter.SetInputConnection(reader.GetOutputPort()) glyph_filter.SetScaleModeToScaleByVector() glyph_filter.SetScaleFactor(0.0007) glyph_filter.Update() glyph_mapper = vtk.vtkDataSetMapper() glyph_mapper.SetInputConnection(glyph_filter.GetOutputPort()) glyph_actor = vtk.vtkActor() glyph_actor.SetMapper(glyph_mapper) # --- # ren = vtk.vtkRenderer() ren.AddActor(outline_actor) ren.AddActor(clip_actor) ren.AddActor(glyph_actor) ren.SetBackground(1.0, 1.0, 1.0) renw = vtk.vtkRenderWindow() renw.AddRenderer(ren) renw.SetSize(640, 480) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renw) renw.Render() iren.Start() From: Hector Dejea Date: Wednesday, July 16, 2014 2:18 AM To: "vtkusers at vtk.org" Subject: [vtkusers] Extract field from .vtu file Hi all, I am trying to visualize a field contained in a .vtu file but all I got is a solid colored image. Does anybody know how to visualize the field on the geometry? Thank you From kekko84 at gmail.com Thu Jul 17 05:04:01 2014 From: kekko84 at gmail.com (Francesco Argese) Date: Thu, 17 Jul 2014 11:04:01 +0200 Subject: [vtkusers] Automatically configure scalar range for mappers In-Reply-To: References: Message-ID: Hello all, I have solved using method one. I was doing an error loping on Size rather than GetNumberOfTuples() of the array in GetPointData and it was giving me some errors not so clear: in fact it was not a buffer overflow but only strange values appearing. Probably I must study in deep vtkDataArray data structure to understand the reason. Below a sample code extracted hoping that it could be useful for others. In the code firstFrame is a vector of actors from lsDynaReader. Hello, Francesco Here is my code: for(unsigned int i = 0; i < firstFrame.size(); i++) { vtkActor *actor = firstFrame.at(i); // get polyData from vtkActor vtkPolyData *polyData = (vtkPolyData *) actor->GetMapper()->GetInput(); if(polyData) { if(polyData->GetPointData()) { int arrayNum = 3; // Acceleration std::cout << polyData->GetPointData()->GetArray(arrayNum)->GetName() << std::endl; vtkDataArray *scalars = polyData->GetPointData()->GetArray(arrayNum); for(unsigned int i = 0; i < polyData->GetPointData()->GetArray(arrayNum)->GetNumberOfTuples(); i++) { double magnitude = 0; for(unsigned int j = 0; j < polyData->GetPointData()->GetArray(arrayNum)->GetNumberOfComponents(); j++) { double value = polyData->GetPointData()->GetArray(arrayNum)->GetComponent(i, j); magnitude += pow(value, 2); } magnitude = sqrt(magnitude); min = std::min(min, magnitude); max = std::max(max, magnitude); std::cout << magnitude << std::endl; } } } } std::cout << "Min found: " << min << std::endl; std::cout << "Max found: " << max << std::endl; 2014-07-16 15:08 GMT+02:00 Francesco Argese : > Hello, > > I'm new to vtk and I'm having a problem already asked on this forum > but that has never received a response. The previous related posts are > the folowing: > - http://www.vtk.org/pipermail/vtkusers/2012-June/074840.html > - http://public.kitware.com/pipermail/vtkusers/2002-January/009488.html > > In my case I have a lsdyna fem analysis loaded correctly through Vtk > that I like to color selecting a particular property (for example > velocity or acceleration) specified in it. > > At the moment I'm able to show something similar to what ParaView > display for the model except for the range. If I set statically the > range that I have found with ParaView on a specified model I see the > same colours but I don't know how to calculate the range for a generic > model. > > I have tried the following: > - using actor->GetMapper()->GetInput()->GetPointData()->GetArray(id) > to retrieve parameters related to a property (I think it could be > right because GetName on the array give me the right property name): I > calculated a range but the max is different from that calculated in > ParaView and colours are not so useful. Could it be possible that the > array I'm using is wrong? Or is there some other scaling operation on > those parameters? > - Getting range through GetRange() function but it also don't do me > the same results of ParaView. > > Considering that in ParaView there is something similar I think it > could be possible to do so. > > Have someone any suggestion to try resolving? > > Thanks in advance, > Francesco Argese From hectordejea at gmail.com Thu Jul 17 06:16:44 2014 From: hectordejea at gmail.com (Hector Dejea) Date: Thu, 17 Jul 2014 12:16:44 +0200 Subject: [vtkusers] GeometryIds extraction Message-ID: Hi all, I generated a .vtu file with Elmer that contains several bodies within it, each one represented by GeometryIds. I know how to extract the bodies in Paraview using Selection Query but I'd like to get it by using VTK. Does anyone know how can I extract the diferent bodies using GeometryIds in VTK? Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From grothausmann.roman at mh-hannover.de Thu Jul 17 06:36:16 2014 From: grothausmann.roman at mh-hannover.de (Dr. Roman Grothausmann) Date: Thu, 17 Jul 2014 12:36:16 +0200 Subject: [vtkusers] special field-data annotation filter or similar functionality Message-ID: <53C7A720.3070701@mh-hannover.de> Dear mailing list members, Is there a filter in paraview that allows one to display specific field-data (e.g. of points or cells) at the 3D position of the corresponding point/cell in such a way that the annotation is hidden if some mesh or voxel object is in front? Or if the objects in front have some transparency the annotations are only visible as much as the transparency of the objects in front dictates? I know about the possibility of displaying selection labels via the Find-Dialog. However these annotations are - always in front, - cannot be made partially transparent (as I think was possible in older paraview versions than 4.1.0 when vtkVectorText was used) and - only the active selection can be annotated, ie not multiple datasets. I found this example in which the text is not always rendered in front of the axes: https://github.com/Kitware/VTK/blob/master/Examples/Annotation/Python/textOrigin.py However it uses vtkVectorText (which is not exportable as text into e.g. SVGs however vtkTextActor3D is). I now wonder if only vtkVectorText allows being hidden by other objects or if some settings of vtkTextActor3D are not offered for adjustment in the Find-Dialog? In any case a paraview filter that would offer all 3 features mentioned above would be really helpful. Are there any reasons that such a filter cannot be implemented in paraview at the present state? Can such functionality be implemented in general with the current state of VTK? Any help or hints are very much appreciated Roman -- Dr. Roman Grothausmann Tomographie und Digitale Bildverarbeitung Tomography and Digital Image Analysis Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 Medizinische Hochschule Hannover Carl-Neuberg-Str. 1 D-30625 Hannover Tel. +49 511 532-9574 From samantrv at mail.uc.edu Thu Jul 17 08:26:58 2014 From: samantrv at mail.uc.edu (Samant, Rutuja (samantrv)) Date: Thu, 17 Jul 2014 12:26:58 +0000 Subject: [vtkusers] VTK Linking Error Message-ID: <1405600013375.84028@mail.uc.edu> Hello, I am using the vtk library for the first time. I am trying to run a simple example from the vtk examples available online using VS 2010. However I am making some mistake in linking the required vtk lib and directories. I keep getting the following error: error LNK2019: unresolved external symbol "__declspec(dllimport) public: static double __cdecl vtkLine::DistanceToLine(double * const,double * const,double * const,double &,double * const)" (__imp_?DistanceToLine at vtkLine@@SANQAN00AAN0 at Z) referenced in function _main I have built vtk using cmake and also added the vtk directory to additional directories and included the vtk library to my project. Could you help me figure out whether I am missing any step in the linking process? Regards, Rutuja ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From ahmed at mufradat.com Thu Jul 17 08:50:06 2014 From: ahmed at mufradat.com (ahmed at mufradat.com) Date: Thu, 17 Jul 2014 14:50:06 +0200 Subject: [vtkusers] Cannot translate an image using vtkImageReslice Message-ID: Hello Everyone, Can somebody please tell me what am I doing wrong in the following code? using vtkImageReslice I can rotate or scale the image but whatever parameters I use to translate the image the output image stays identical to the input one. I was expecting the Mandelbrot to be shifted along the x,y but that never happens. Best Regards, Ahmed FYI the following code was adapted from http://www.vtk.org/Wiki/VTK/Examples/Cxx/ImageData/ExtractVOI #include #include #include #include #include #include #include #include #include #include #include #include #include #include int main(int, char *[]) { // Create an image vtkSmartPointer source = vtkSmartPointer::New(); source->Update(); int* inputDims = source->GetOutput()->GetDimensions(); std::cout << "Dims: " << " x: " << inputDims[0] << " y: " << inputDims[1] << " z: " << inputDims[2] << std::endl; std::cout << "Number of points: " << source->GetOutput()->GetNumberOfPoints() << std::endl; std::cout << "Number of cells: " << source->GetOutput()->GetNumberOfCells() << std::endl; vtkTransform *transform3= vtkTransform::New(); transform3->Translate(10, 10,0); //transform3->Scale(0.05,0.05,0.05); //transform3->RotateZ(90); vtkImageReslice *thickReslice = vtkImageReslice::New(); thickReslice->SetInputConnection(source->GetOutputPort()); thickReslice->SetInterpolationModeToLinear(); thickReslice->SetOutputDimensionality(2); thickReslice->SetBackgroundLevel(-1000); thickReslice->SetOutputExtent(0,1000,0,1000,0,0); thickReslice->SetResliceAxes(transform3->GetMatrix()); thickReslice->Update(); vtkImageData* extracted = thickReslice->GetOutput(); int* extractedDims = extracted->GetDimensions(); std::cout << "Dims: " << " x: " << extractedDims[0] << " y: " << extractedDims[1] << " z: " << extractedDims[2] << std::endl; std::cout << "Number of points: " << extracted->GetNumberOfPoints() << std::endl; std::cout << "Number of cells: " << extracted->GetNumberOfCells() << std::endl; vtkSmartPointer inputCastFilter = vtkSmartPointer::New(); inputCastFilter->SetInputConnection(source->GetOutputPort()); inputCastFilter->SetOutputScalarTypeToUnsignedChar(); inputCastFilter->Update(); vtkSmartPointer extractedCastFilter = vtkSmartPointer::New(); #if VTK_MAJOR_VERSION <= 5 extractedCastFilter->SetInputConnection(extracted->GetProducerPort()); #else extractedCastFilter->SetInputData(extracted); #endif extractedCastFilter->SetOutputScalarTypeToUnsignedChar(); extractedCastFilter->Update(); // Create actors vtkSmartPointer inputActor = vtkSmartPointer::New(); inputActor->GetMapper()->SetInputConnection( inputCastFilter->GetOutputPort()); vtkSmartPointer extractedActor = vtkSmartPointer::New(); extractedActor->GetMapper()->SetInputConnection( extractedCastFilter->GetOutputPort()); // There will be one render window vtkSmartPointer renderWindow = vtkSmartPointer::New(); renderWindow->SetSize(600, 300); // And one interactor vtkSmartPointer interactor = vtkSmartPointer::New(); interactor->SetRenderWindow(renderWindow); // Define viewport ranges // (xmin, ymin, xmax, ymax) double leftViewport[4] = {0.0, 0.0, 0.5, 1.0}; double rightViewport[4] = {0.5, 0.0, 1.0, 1.0}; // Setup both renderers vtkSmartPointer leftRenderer = vtkSmartPointer::New(); renderWindow->AddRenderer(leftRenderer); leftRenderer->SetViewport(leftViewport); leftRenderer->SetBackground(.6, .5, .4); vtkSmartPointer rightRenderer = vtkSmartPointer::New(); renderWindow->AddRenderer(rightRenderer); rightRenderer->SetViewport(rightViewport); rightRenderer->SetBackground(.4, .5, .6); leftRenderer->AddActor(inputActor); rightRenderer->AddActor(extractedActor); leftRenderer->ResetCamera(); rightRenderer->ResetCamera(); renderWindow->Render(); interactor->Start(); return EXIT_SUCCESS; } From david.gobbi at gmail.com Thu Jul 17 09:49:17 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 17 Jul 2014 07:49:17 -0600 Subject: [vtkusers] Cannot translate an image using vtkImageReslice In-Reply-To: References: Message-ID: You must also call thickReslice->SetOutputOrigin(...); Set the output origin to be the same as the origin of the original mandelbrot. On Thu, Jul 17, 2014 at 6:50 AM, wrote: > Hello Everyone, > > Can somebody please tell me what am I doing wrong in the following code? > using vtkImageReslice I can rotate or scale the image but whatever > parameters I use to translate the image the output image stays identical to > the input one. I was expecting the Mandelbrot to be shifted along the x,y > but that never happens. > > > Best Regards, > Ahmed > > > FYI the following code was adapted from > http://www.vtk.org/Wiki/VTK/Examples/Cxx/ImageData/ExtractVOI > > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > int main(int, char *[]) > { > // Create an image > vtkSmartPointer source = > vtkSmartPointer::New(); > source->Update(); > > int* inputDims = source->GetOutput()->GetDimensions(); > std::cout << "Dims: " << " x: " << inputDims[0] > << " y: " << inputDims[1] > << " z: " << inputDims[2] << std::endl; > std::cout << "Number of points: " << > source->GetOutput()->GetNumberOfPoints() << std::endl; > std::cout << "Number of cells: " << > source->GetOutput()->GetNumberOfCells() << std::endl; > > vtkTransform *transform3= vtkTransform::New(); > transform3->Translate(10, 10,0); > //transform3->Scale(0.05,0.05,0.05); > //transform3->RotateZ(90); > > vtkImageReslice *thickReslice = vtkImageReslice::New(); > thickReslice->SetInputConnection(source->GetOutputPort()); > thickReslice->SetInterpolationModeToLinear(); > thickReslice->SetOutputDimensionality(2); > thickReslice->SetBackgroundLevel(-1000); > thickReslice->SetOutputExtent(0,1000,0,1000,0,0); > thickReslice->SetResliceAxes(transform3->GetMatrix()); > thickReslice->Update(); > > vtkImageData* extracted = thickReslice->GetOutput(); > > int* extractedDims = extracted->GetDimensions(); > std::cout << "Dims: " << " x: " << extractedDims[0] > << " y: " << extractedDims[1] > << " z: " << extractedDims[2] << std::endl; > std::cout << "Number of points: " << extracted->GetNumberOfPoints() << > std::endl; > std::cout << "Number of cells: " << extracted->GetNumberOfCells() << > std::endl; > > vtkSmartPointer inputCastFilter = > vtkSmartPointer::New(); > inputCastFilter->SetInputConnection(source->GetOutputPort()); > inputCastFilter->SetOutputScalarTypeToUnsignedChar(); > inputCastFilter->Update(); > > vtkSmartPointer extractedCastFilter = > vtkSmartPointer::New(); > #if VTK_MAJOR_VERSION <= 5 > extractedCastFilter->SetInputConnection(extracted->GetProducerPort()); > #else > extractedCastFilter->SetInputData(extracted); > #endif > extractedCastFilter->SetOutputScalarTypeToUnsignedChar(); > extractedCastFilter->Update(); > > // Create actors > vtkSmartPointer inputActor = > vtkSmartPointer::New(); > inputActor->GetMapper()->SetInputConnection( > inputCastFilter->GetOutputPort()); > > vtkSmartPointer extractedActor = > vtkSmartPointer::New(); > extractedActor->GetMapper()->SetInputConnection( > extractedCastFilter->GetOutputPort()); > > // There will be one render window > vtkSmartPointer renderWindow = > vtkSmartPointer::New(); > renderWindow->SetSize(600, 300); > > // And one interactor > vtkSmartPointer interactor = > vtkSmartPointer::New(); > interactor->SetRenderWindow(renderWindow); > > // Define viewport ranges > // (xmin, ymin, xmax, ymax) > double leftViewport[4] = {0.0, 0.0, 0.5, 1.0}; > double rightViewport[4] = {0.5, 0.0, 1.0, 1.0}; > > // Setup both renderers > vtkSmartPointer leftRenderer = > vtkSmartPointer::New(); > renderWindow->AddRenderer(leftRenderer); > leftRenderer->SetViewport(leftViewport); > leftRenderer->SetBackground(.6, .5, .4); > > vtkSmartPointer rightRenderer = > vtkSmartPointer::New(); > renderWindow->AddRenderer(rightRenderer); > rightRenderer->SetViewport(rightViewport); > rightRenderer->SetBackground(.4, .5, .6); > > leftRenderer->AddActor(inputActor); > rightRenderer->AddActor(extractedActor); > > leftRenderer->ResetCamera(); > > rightRenderer->ResetCamera(); > > renderWindow->Render(); > interactor->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 > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers From dave.demarle at kitware.com Thu Jul 17 11:12:20 2014 From: dave.demarle at kitware.com (David E DeMarle) Date: Thu, 17 Jul 2014 11:12:20 -0400 Subject: [vtkusers] Connecting to arrays in a reader In-Reply-To: References: Message-ID: Howdy. On Tue, Jul 15, 2014 at 8:35 PM, Greg Schussman wrote: > Hi. > > I'm not sure how things are meant to connect. I'm working in python. I'm > trying to build and use a reader. Many examples seem to assume there's > only a single field that can be made active. But in my case, the reader is > where I keep all information, and there is no sense (at least in my mind) > of an "active" field, because several may be used at ones (scalar for > surface coloring, one vector field for one set of cone glyphs, and another > vector field for a different set of cone glyphs, all to be displayed at the > same time). > > The "Active" concept in VTK is mostly an artifact of days of yore. The modern way to tell a filter what array to operate on is with vtkAlgorithm::SetInputArrayToProcess ( http://www.vtk.org/doc/nightly/html/classvtkAlgorithm.html#a42a55ca2c277aecc909ad592d12978aa). Most but not all filters respect that. I create the each field this way (where my_voltages is just a python list > that I parsed from a file): > > voltage = vtkDoubleArray() > voltage.SetName('voltage') > voltage.SetNumberOfComponents(1) > for v in my_voltages: > voltage.InsertNextValue(v) > > And I did the same thing for the 3D fields, except using 3 for the number > of components. > Then, I add these fields to my reader (derived from vtkProgrammableSource) > this way: > > # 1D fields: > self.GetPolyDataOutput().GetCellData().AddArray(voltage) > self.GetPolyDataOutput().GetCellData().AddArray(charge) > > # 3D fields: > self.GetPolyDataOutput().GetCellData().AddArray(current_density_real) > self.GetPolyDataOutput().GetCellData().AddArray(current_density_imag) > > I'm able to iterate through those and print out the correct values and > some of my early scalar visualization with colormaps and such seem to be > working. > > So, first question is: does what I have done so far seem reasonable or is > there a more vtk-ish way of doing this? > > You are doing it just right. > Second question is how to connect to the reader. I'm trying to use it > this way: > > cone = vtkConeSource() > cone.SetRadius(0.1) > cone.SetHeight(0.5) > cone.SetResolution(8) > > glyph = vtkGlyph3D() > glyph.SetInputConnection( WHAT GOES HERE??? ) > > reader.GetOutputPort() glyph.SetSourceConnection(self.cone.GetOutputPort()) > glyph.SetScaleModeToDataScalingOff() > glyph.SetScaleFactor(1.0e-3) > glyph.SetVectorModeToUseVector() > glyph.OrientOn() > > So the "what goes here" is this question. Because I used a named array, > I'd hope for something like: > > glyph.SetInputConnection(reader.GetOutputPort('current_density_real')) > > But that doesn't work, and I've seen nothing to suggest that it would. > When I try this as the argument, > > > reader.GetPolyDataOutput().GetCellData().GetArray('current_density_real') > > > Is this a matter of converting an array to an algorithm output? It seems > (probably quite wrongly) to me that algorithms can produce many different > kinds of output, and that a vtkArray would reasonably be one of them. > Close but no cigar. Algorithms produce vtkDataObjects, which contain any number of vtkArrays. Use SetArrayToProcess to tell the filter which of the arrays you want it to process. > Or, when using the SetInput(), why wouldn't a vtkArray be a > vtkDataObject? Of course, the easy answer is "that's not how the > inheritance diagrams are drawn", but that doesn't really get me closer to > groking the intended grand scheme of things. I'm not complaining; I'm > just confused. > You are not the first. > How to I get the glyph to use the vector data (in the vtkArray) as its > input? (or if that's the wrong way to think about this, then what's the > right way?) > > glyph.SetInputArrayToProcess(0,0,0,"vtkDataObject::FIELD_ASSOCIATION_CELLS", "thickness0") > Many thanks in advance for any help/enlightenment. > > Greg > > David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.demarle at kitware.com Thu Jul 17 11:13:59 2014 From: dave.demarle at kitware.com (David E DeMarle) Date: Thu, 17 Jul 2014 11:13:59 -0400 Subject: [vtkusers] vtkPolyData to a vtkUnstructuredGrid In-Reply-To: <069418E0-7E91-4257-A18E-07E80D93C622@sci.utah.edu> References: <338CF46B-CDD6-43EE-AE51-62718D0D8FC8@sci.utah.edu> <53C0606A.7020207@gmail.com> <069418E0-7E91-4257-A18E-07E80D93C622@sci.utah.edu> Message-ID: Cool, glad you got it sorted out. David E DeMarle Kitware, Inc. R&D Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Tue, Jul 15, 2014 at 7:47 PM, Allen Sanderson wrote: > Hi Dave, > > Thanks for the reply. I dug into the issue a bit more and found the > conversion was working fine but a later operation seemed to not return any > cell points thus I was thinking the conversion was not working. I just did > some more digging and found the issue. In a nut shell an assumption was > made that the unstructured grid would contain only polygonal cells (tris, > hex, tets, etc) thus a max of eight vertices. A polyline does not fit that > assumption. Thus memory got stomped on but did not cause a seg fault. Thus > the classic chasing ones tail was the issue. So no bug but some bad code on > our part. > > Cheers, > > > Allen > > > > Allen Sanderson > > SCI Institute > > University of Utah > > www.sci.utah.edu > > > > On Jul 15, 2014, at 8:20 AM, David E DeMarle > wrote: > > Hey Allen! > > Probably a bug in the append filter, it must not be converting with > polylines type cells correctly for some reason. > > As Burlen said it would help if you could post a small example data set. > That will make it trivial to replicate the problem and fix it. > > Otherwise, try using a different filter to do the conversion (as a side > effect, like append does). Threshold is my habitual choice for * to > unstructured conversion. > > > > > David E DeMarle > Kitware, Inc. > R&D Engineer > 21 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-881-4909 > > > On Fri, Jul 11, 2014 at 6:08 PM, Burlen Loring > wrote: > >> It would help if you post an example with some data so that we can see >> exactly what you're doing. >> >> >> On 07/11/2014 01:29 PM, Allen Sanderson wrote: >> >> >> Hello, >> >> I have a vtkPolyData structure that contains vtkPolyLines or vertex(s). >> In the course of the coding the vtkPolyData needs to be converted to a >> vtkUnstructuredGrid. I have used the example here using the append filter: >> >> >> http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PolyDataToUnstructuredGrid >> >> However, no lines come across only points. I have also iterated through >> each cell and moved the point id list over with the same results, no lines >> >> As such, I am wondering why lines might not be moved over. >> >> Cheers, >> >> Allen >> >> >> Allen Sanderson >> SCI Institute >> University of Utah >> www.sci.utah.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 >> >> Follow this link to subscribe/unsubscribe:http://public.kitware.com/mailman/listinfo/vtkusers >> >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Thu Jul 17 12:51:05 2014 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Thu, 17 Jul 2014 12:51:05 -0400 Subject: [vtkusers] VTK Linking Error In-Reply-To: <1405600013375.84028@mail.uc.edu> References: <1405600013375.84028@mail.uc.edu> Message-ID: Are you configuring your example program with cmake? On Thu, Jul 17, 2014 at 8:26 AM, Samant, Rutuja (samantrv) wrote: > Hello, > > > I am using the vtk library for the first time. I am trying to run a simple > example from the vtk examples available online using VS 2010. However I am > making some mistake in linking the required vtk lib and directories. I keep > getting the following error: > > > error LNK2019: unresolved external symbol "__declspec(dllimport) public: > static double __cdecl vtkLine::DistanceToLine(double * const,double * > const,double * const,double &,double * const)" > (__imp_?DistanceToLine at vtkLine@@SANQAN00AAN0 at Z) referenced in function _main > > > I have built vtk using cmake and also added the vtk directory to additional > directories and included the vtk library to my project. Could you help me > figure out whether I am missing any step in the linking process? > > > > Regards, > Rutuja > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Unpaid intern in BillsBasement at noware dot com From bill.lorensen at gmail.com Thu Jul 17 14:16:55 2014 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Thu, 17 Jul 2014 14:16:55 -0400 Subject: [vtkusers] VTK Linking Error In-Reply-To: <1jx0609uptjptywre21h563a.1405617287517@email.android.com> References: <1jx0609uptjptywre21h563a.1405617287517@email.android.com> Message-ID: If you use cmake to configure your project you will be much happier. There are over 600 vtk examples with corresponding cmake files here: http://www.vtk.org/Wiki/VTK/Examples/Cxx Enjoy, Bill On Thu, Jul 17, 2014 at 1:14 PM, Rutuja Samant wrote: > No I did dont.....I just copied the text of the sample code into a new > project in VS > > > Sent from my T-Mobile 4G LTE Device > > > -------- Original message -------- > From: Bill Lorensen > Date:07/17/2014 12:51 PM (GMT-05:00) > To: "Samant, Rutuja (samantrv)" > Cc: vtkusers at vtk.org > Subject: Re: [vtkusers] VTK Linking Error > > Are you configuring your example program with cmake? > > > On Thu, Jul 17, 2014 at 8:26 AM, Samant, Rutuja (samantrv) > wrote: >> Hello, >> >> >> I am using the vtk library for the first time. I am trying to run a simple >> example from the vtk examples available online using VS 2010. However I am >> making some mistake in linking the required vtk lib and directories. I >> keep >> getting the following error: >> >> >> error LNK2019: unresolved external symbol "__declspec(dllimport) public: >> static double __cdecl vtkLine::DistanceToLine(double * const,double * >> const,double * const,double &,double * const)" >> (__imp_?DistanceToLine at vtkLine@@SANQAN00AAN0 at Z) referenced in function >> _main >> >> >> I have built vtk using cmake and also added the vtk directory to >> additional >> directories and included the vtk library to my project. Could you help me >> figure out whether I am missing any step in the linking process? >> >> >> >> Regards, >> Rutuja >> >> >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> > > > > -- > Unpaid intern in BillsBasement at noware dot com -- Unpaid intern in BillsBasement at noware dot com From greg.schussman at gmail.com Thu Jul 17 16:59:45 2014 From: greg.schussman at gmail.com (Greg Schussman) Date: Thu, 17 Jul 2014 13:59:45 -0700 Subject: [vtkusers] Connecting to arrays in a reader In-Reply-To: References: Message-ID: Hi, David. Huge thanks for the explanation. That makes sense and is now working well for me. Greg On Thu, Jul 17, 2014 at 8:12 AM, David E DeMarle wrote: > Howdy. > > On Tue, Jul 15, 2014 at 8:35 PM, Greg Schussman > wrote: > >> Hi. >> > > >> I'm not sure how things are meant to connect. I'm working in python. >> I'm trying to build and use a reader. Many examples seem to assume there's >> only a single field that can be made active. But in my case, the reader is >> where I keep all information, and there is no sense (at least in my mind) >> of an "active" field, because several may be used at ones (scalar for >> surface coloring, one vector field for one set of cone glyphs, and another >> vector field for a different set of cone glyphs, all to be displayed at the >> same time). >> >> > The "Active" concept in VTK is mostly an artifact of days of yore. The > modern way to tell a filter what array to operate on is with > vtkAlgorithm::SetInputArrayToProcess ( > http://www.vtk.org/doc/nightly/html/classvtkAlgorithm.html#a42a55ca2c277aecc909ad592d12978aa). > Most but not all filters respect that. > > I create the each field this way (where my_voltages is just a python list >> that I parsed from a file): >> >> voltage = vtkDoubleArray() >> voltage.SetName('voltage') >> voltage.SetNumberOfComponents(1) >> for v in my_voltages: >> voltage.InsertNextValue(v) >> >> And I did the same thing for the 3D fields, except using 3 for the number >> of components. >> Then, I add these fields to my reader (derived from >> vtkProgrammableSource) this way: >> >> # 1D fields: >> self.GetPolyDataOutput().GetCellData().AddArray(voltage) >> self.GetPolyDataOutput().GetCellData().AddArray(charge) >> >> # 3D fields: >> self.GetPolyDataOutput().GetCellData().AddArray(current_density_real) >> self.GetPolyDataOutput().GetCellData().AddArray(current_density_imag) >> >> I'm able to iterate through those and print out the correct values and >> some of my early scalar visualization with colormaps and such seem to be >> working. >> >> So, first question is: does what I have done so far seem reasonable or is >> there a more vtk-ish way of doing this? >> >> > You are doing it just right. > > >> Second question is how to connect to the reader. I'm trying to use it >> this way: >> >> cone = vtkConeSource() >> cone.SetRadius(0.1) >> cone.SetHeight(0.5) >> cone.SetResolution(8) >> >> glyph = vtkGlyph3D() >> glyph.SetInputConnection( WHAT GOES HERE??? ) >> >> > reader.GetOutputPort() > > > glyph.SetSourceConnection(self.cone.GetOutputPort()) >> glyph.SetScaleModeToDataScalingOff() >> glyph.SetScaleFactor(1.0e-3) >> glyph.SetVectorModeToUseVector() >> glyph.OrientOn() >> >> So the "what goes here" is this question. Because I used a named array, >> I'd hope for something like: >> >> glyph.SetInputConnection(reader.GetOutputPort('current_density_real')) >> >> But that doesn't work, and I've seen nothing to suggest that it would. >> When I try this as the argument, >> >> >> reader.GetPolyDataOutput().GetCellData().GetArray('current_density_real') >> >> > >> Is this a matter of converting an array to an algorithm output? It >> seems (probably quite wrongly) to me that algorithms can produce many >> different kinds of output, and that a vtkArray would reasonably be one of >> them. >> > > Close but no cigar. Algorithms produce vtkDataObjects, which contain any > number of vtkArrays. Use SetArrayToProcess to tell the filter which of the > arrays you want it to process. > > >> Or, when using the SetInput(), why wouldn't a vtkArray be a >> vtkDataObject? Of course, the easy answer is "that's not how the >> inheritance diagrams are drawn", but that doesn't really get me closer to >> groking the intended grand scheme of things. I'm not complaining; I'm >> just confused. >> > > You are not the first. > > >> How to I get the glyph to use the vector data (in the vtkArray) as its >> input? (or if that's the wrong way to think about this, then what's the >> right way?) >> >> > glyph.SetInputArrayToProcess(0,0,0,"vtkDataObject::FIELD_ASSOCIATION_CELLS", > "thickness0") > > >> Many thanks in advance for any help/enlightenment. >> >> Greg >> >> > David E DeMarle > Kitware, Inc. > R&D Engineer > 21 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-881-4909 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From xpelaox at gmail.com Thu Jul 17 23:14:30 2014 From: xpelaox at gmail.com (ferluduena) Date: Thu, 17 Jul 2014 20:14:30 -0700 (PDT) Subject: [vtkusers] [ActiViz] Attempted to read or write protected memory. Hold Reference? Message-ID: <1405653270199-5727902.post@n5.nabble.com> Hi! I'm trying to port my working code on c++ to C#, but i cant get it to work. It compiles but i get this error :"Attempted to read or write protected memory. This is often an indication that other memory is corrupt." VTK is trying to acces an out of bounds array location. I've been reading a lot, and the most logical explanation i got was that as C# is managed, it might be that C# is deleting something that VTK will need to use later. Some people talk about "Holding Managed references" and also the importance of sometimes using the Dispose() function. I tried a lot of things, but i just cant figure it out. Hope someone can help! and Thanks in advance! This is my code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using Kitware.VTK; namespace Prueba3D { public partial class Form1 : Form { vtkPolyData polydata; vtkPoints points; vtkSurfaceReconstructionFilter surf; vtkPolyDataMapper Mapper; vtkContourFilter cf; vtkActor Actor; vtkRenderWindow RenderWindow; vtkRenderer Renderer; public Form1() { InitializeComponent(); } private void renderWindowControl1_Load(object sender, EventArgs e) { //Generate some points //Z=0 double[] p0 = new double[] { 4, 4, 0 }; double[] p1 = new double[] { 3, 3, 0 }; double[] p2 = new double[] { 3, 4, 0 }; double[] p3 = new double[] { 3, 5, 0 }; double[] p4 = new double[] { 4, 3, 0 }; double[] p5 = new double[] { 4, 5, 0 }; double[] p6 = new double[] { 5, 3, 0 }; double[] p7 = new double[] { 5, 4, 0 }; // Create a vtkPoints object and store the points in it points = vtkPoints.New(); points.InsertNextPoint(p0[0], p0[1], p0[2]); points.InsertNextPoint(p1[0], p1[1], p1[2]); points.InsertNextPoint(p2[0], p2[1], p2[2]); points.InsertNextPoint(p3[0], p3[1], p3[2]); points.InsertNextPoint(p4[0], p4[1], p4[2]); points.InsertNextPoint(p5[0], p5[1], p5[2]); points.InsertNextPoint(p6[0], p6[1], p6[2]); points.InsertNextPoint(p7[0], p7[1], p7[2]); polydata = vtkPolyData.New(); polydata.SetPoints(points); surf = vtkSurfaceReconstructionFilter.New(); surf.SetInput(polydata); // mapper Mapper = vtkPolyDataMapper.New(); Mapper.ScalarVisibilityOff(); cf = vtkContourFilter.New(); cf.SetInputConnection(surf.GetOutputPort()); cf.SetValue(0, 0.0); Mapper.SetInputConnection(cf.GetOutputPort()); // actor Actor = vtkActor.New(); Actor.SetMapper(Mapper); // get a reference to the renderwindow of our renderWindowControl1 RenderWindow = renderWindowControl1.RenderWindow; // get a reference to the renderer Renderer = RenderWindow.GetRenderers().GetFirstRenderer(); // set background color Renderer.SetBackground(0.2, 0.3, 0.4); // add actor to the renderer Renderer.AddActor(Actor); // ensure all actors are visible (in this example not necessarely needed, // but in case more than one actor needs to be shown it might be a good idea) Renderer.ResetCamera(); } } } -- View this message in context: http://vtk.1045678.n5.nabble.com/ActiViz-Attempted-to-read-or-write-protected-memory-Hold-Reference-tp5727902.html Sent from the VTK - Users mailing list archive at Nabble.com. From julien.jomier at kitware.com Fri Jul 18 04:00:06 2014 From: julien.jomier at kitware.com (Julien Jomier) Date: Fri, 18 Jul 2014 10:00:06 +0200 Subject: [vtkusers] [ActiViz] Attempted to read or write protected memory. Hold Reference? In-Reply-To: <1405653270199-5727902.post@n5.nabble.com> References: <1405653270199-5727902.post@n5.nabble.com> Message-ID: <53C8D406.5060506@kitware.com> This is not an ActiViz problem. Your sample code doesn't work in C++ either. The main reason is that your points are coplanar and the vtkSurfaceReconstructionFilter fails to return a surface. If you change your first line from: double[] p0 = new double[] { 4, 4, 0 }; to double[] p0 = new double[] { 4, 4, 1 }; then it should work. Julien On 18/07/2014 05:14, ferluduena wrote: > Hi! I'm trying to port my working code on c++ to C#, but i cant get it to > work. > > It compiles but i get this error :"Attempted to read or write protected > memory. This is often an indication that other memory is corrupt." > > VTK is trying to acces an out of bounds array location. > > I've been reading a lot, and the most logical explanation i got was that as > C# is managed, it might be that C# is deleting something that VTK will need > to use later. Some people talk about "Holding Managed references" and also > the importance of sometimes using the Dispose() function. > > I tried a lot of things, but i just cant figure it out. > > Hope someone can help! and Thanks in advance! > > This is my code: > > using System; > using System.Collections.Generic; > using System.ComponentModel; > using System.Data; > using System.Drawing; > using System.Linq; > using System.Text; > using System.Threading.Tasks; > using System.Windows.Forms; > using Kitware.VTK; > > namespace Prueba3D > { > public partial class Form1 : Form > { > vtkPolyData polydata; > vtkPoints points; > vtkSurfaceReconstructionFilter surf; > vtkPolyDataMapper Mapper; > vtkContourFilter cf; > vtkActor Actor; > vtkRenderWindow RenderWindow; > vtkRenderer Renderer; > public Form1() > { > InitializeComponent(); > } > > private void renderWindowControl1_Load(object sender, EventArgs e) > { > //Generate some points > //Z=0 > double[] p0 = new double[] { 4, 4, 0 }; > double[] p1 = new double[] { 3, 3, 0 }; > double[] p2 = new double[] { 3, 4, 0 }; > double[] p3 = new double[] { 3, 5, 0 }; > double[] p4 = new double[] { 4, 3, 0 }; > double[] p5 = new double[] { 4, 5, 0 }; > double[] p6 = new double[] { 5, 3, 0 }; > double[] p7 = new double[] { 5, 4, 0 }; > > // Create a vtkPoints object and store the points in it > points = vtkPoints.New(); > points.InsertNextPoint(p0[0], p0[1], p0[2]); > points.InsertNextPoint(p1[0], p1[1], p1[2]); > points.InsertNextPoint(p2[0], p2[1], p2[2]); > points.InsertNextPoint(p3[0], p3[1], p3[2]); > points.InsertNextPoint(p4[0], p4[1], p4[2]); > points.InsertNextPoint(p5[0], p5[1], p5[2]); > points.InsertNextPoint(p6[0], p6[1], p6[2]); > points.InsertNextPoint(p7[0], p7[1], p7[2]); > > polydata = vtkPolyData.New(); > polydata.SetPoints(points); > > > surf = vtkSurfaceReconstructionFilter.New(); > surf.SetInput(polydata); > > > // mapper > Mapper = vtkPolyDataMapper.New(); > Mapper.ScalarVisibilityOff(); > cf = vtkContourFilter.New(); > cf.SetInputConnection(surf.GetOutputPort()); > cf.SetValue(0, 0.0); > Mapper.SetInputConnection(cf.GetOutputPort()); > // actor > Actor = vtkActor.New(); > Actor.SetMapper(Mapper); > // get a reference to the renderwindow of our > renderWindowControl1 > > RenderWindow = renderWindowControl1.RenderWindow; > // get a reference to the renderer > Renderer = RenderWindow.GetRenderers().GetFirstRenderer(); > // set background color > Renderer.SetBackground(0.2, 0.3, 0.4); > // add actor to the renderer > Renderer.AddActor(Actor); > > // ensure all actors are visible (in this example not > necessarely needed, > // but in case more than one actor needs to be shown it might be > a good idea) > > Renderer.ResetCamera(); > } > } > } > > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/ActiViz-Attempted-to-read-or-write-protected-memory-Hold-Reference-tp5727902.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > From jonathan.lafite at rtech.fr Fri Jul 18 04:19:43 2014 From: jonathan.lafite at rtech.fr (Jonathan Lafite) Date: Fri, 18 Jul 2014 10:19:43 +0200 Subject: [vtkusers] Fail to execute DisplayCoordinateAxes example Message-ID: Hello, I've got some trouble with this example : http://www.cmake.org/Wiki/VTK/Examples/Cxx/Visualization/DisplayCoordinateAx es All compile fine but when executing one the line : vtkSmartPointer axes = vtkSmartPointer::New(); I get a vtk messagebox that display : ERROR: In vtkTextActor.cxx, line 112 vtkTextActor (000000000045A570): Failed getting the TextRenderer instance! ERROR: In vtkTextActor.cxx, line 112 vtkTextActor (0000000002429040): Failed getting the TextRenderer instance! ERROR: In vtkTextActor.cxx, line 112 vtkTextActor (00000000024636B0): Failed getting the TextRenderer instance! My configuration is : - Window 7 x64 - QtCreator 3.2.1 based on Qt 5.3.1 (MSVC 2013 64bit) - Vtk 6.1.0 (compiled with MSVC 2012 (CMAKE 2.8.12.2)) Thanks by advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 9238 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: M Jonathan Lafite.vcf Type: text/x-vcard Size: 19113 bytes Desc: not available URL: From julien.jomier at kitware.com Fri Jul 18 08:22:45 2014 From: julien.jomier at kitware.com (Julien Jomier) Date: Fri, 18 Jul 2014 14:22:45 +0200 Subject: [vtkusers] Fail to execute DisplayCoordinateAxes example In-Reply-To: References: Message-ID: <53C91195.3020800@kitware.com> Are you compiling VTK with the Module_vtkRenderingFreeTypeFontConfig turned ON? This thread might help as well: http://www.vtk.org/pipermail/vtkusers/2013-June/080176.html Also can you make sure that you link with all the available libraries: target_link_libraries(DisplayCoordinateAxes ${VTK_LIBRARIES}) Julien -- Kitware SAS 26 rue Louis Gu?rin 69100 Villeurbanne, France F: +33 (0)4.37.45.04.15 http://www.kitware.eu On 18/07/2014 10:19, Jonathan Lafite wrote: > Hello, > > I?ve got some trouble with this example : > http://www.cmake.org/Wiki/VTK/Examples/Cxx/Visualization/DisplayCoordinateAxes > > All compile fine but when executing one the line : > > vtkSmartPointeraxes= > > vtkSmartPointer::New(); > > I get a vtk messagebox that display : > > ERROR: In vtkTextActor.cxx, line 112 > > vtkTextActor (000000000045A570): Failed getting the TextRenderer instance! > > ERROR: In vtkTextActor.cxx, line 112 > > vtkTextActor (0000000002429040): Failed getting the TextRenderer instance! > > ERROR: In vtkTextActor.cxx, line 112 > > vtkTextActor (00000000024636B0): Failed getting the TextRenderer instance! > > My configuration is : > > -Window 7 x64 > > -QtCreator 3.2.1 based on Qt 5.3.1 (MSVC 2013 64bit) > > -Vtk 6.1.0 (compiled with MSVC 2012 (CMAKE 2.8.12.2)) > > Thanks by advance. > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > From bill.lorensen at gmail.com Fri Jul 18 09:18:36 2014 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Fri, 18 Jul 2014 09:18:36 -0400 Subject: [vtkusers] Fail to execute DisplayCoordinateAxes example In-Reply-To: References: Message-ID: Are you building the example with CMake? On Jul 18, 2014 7:55 AM, "Jonathan Lafite" wrote: > Hello, > > I?ve got some trouble with this example : > http://www.cmake.org/Wiki/VTK/Examples/Cxx/Visualization/DisplayCoordinateAxes > > All compile fine but when executing one the line : > > > > vtkSmartPointer axes = > > vtkSmartPointer::New(); > > > > > > I get a vtk messagebox that display : > > ERROR: In vtkTextActor.cxx, line 112 > > vtkTextActor (000000000045A570): Failed getting the TextRenderer instance! > > > > ERROR: In vtkTextActor.cxx, line 112 > > vtkTextActor (0000000002429040): Failed getting the TextRenderer instance! > > > > ERROR: In vtkTextActor.cxx, line 112 > > vtkTextActor (00000000024636B0): Failed getting the TextRenderer instance! > > > > > > > > My configuration is : > > - Window 7 x64 > > - QtCreator 3.2.1 based on Qt 5.3.1 (MSVC 2013 64bit) > > - Vtk 6.1.0 (compiled with MSVC 2012 (CMAKE 2.8.12.2)) > > > > Thanks by advance. > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 9238 bytes Desc: not available URL: From xpelaox at gmail.com Fri Jul 18 09:24:05 2014 From: xpelaox at gmail.com (ferluduena) Date: Fri, 18 Jul 2014 06:24:05 -0700 (PDT) Subject: [vtkusers] [ActiViz] Attempted to read or write protected memory. Hold Reference? In-Reply-To: <53C8D406.5060506@kitware.com> References: <1405653270199-5727902.post@n5.nabble.com> <53C8D406.5060506@kitware.com> Message-ID: <1405689845132-5727909.post@n5.nabble.com> Ohh, Thanks a lot! I was over complicating myself... Now this works. P.s: Somehow i got this working on c++.... -- View this message in context: http://vtk.1045678.n5.nabble.com/ActiViz-Attempted-to-read-or-write-protected-memory-Hold-Reference-tp5727902p5727909.html Sent from the VTK - Users mailing list archive at Nabble.com. From pablo.hernandez.cerdan at outlook.com Sun Jul 20 12:12:01 2014 From: pablo.hernandez.cerdan at outlook.com (=?iso-8859-1?B?UGFibG8gSGVybuFuZGV6?=) Date: Sun, 20 Jul 2014 18:12:01 +0200 Subject: [vtkusers] Problem with QVtkWidget not rendering vktChartXY in visual studio 2013 Message-ID: Hey there, I am developing in Linux using gcc 4.8, but this weekend I tried to compile in Windows7 using visual studio 2013 (v120). The code use QT with the QVtkWidget. The code works properly in my Linux setup, but it does not render one of the two qtvtkwidget I have. Basically I get a white background where the widget should be, and it corrupts a little bit when resizing. This widget shows 3 vtkChartXY in the same scene of a qvtkWidget. I got three warning/errors but no crashing. And I can interact and render the other QtVtkWidget. First: "Generic Warning: In D:\Software\VTK\source.git\Rendering\Context2D\vtkContextDevice2D.cxx, line 27 Error: no override found for 'vtkContextDevice2D'." I have no idea if this one is relevant to be honest. Second: "First-chance exception at 0x01E07B28 in VTKNodesEdgesEXE.exe: 0xC0000005: Access violation reading location 0x00000000." Debugging this, it points to the render pipeline of the qtvtkWidget, specifically: vtkContextActor.cxx // Renders an actor2D's property and then it's mapper. int vtkContextActor::RenderOverlay(vtkViewport* viewport) // Pass the viewport details onto the context device. int size[2]; size[0] = view_viewport_pixels.width(); size[1] = view_viewport_pixels.height(); vtkRecti viewportRect(actual_viewport_pixels.x() - view_viewport_pixels.x(), actual_viewport_pixels.y() - view_viewport_pixels.y(), actual_viewport_pixels.width(), actual_viewport_pixels.height()); //(Breakpoint here:) this->Context->GetDevice()->SetViewportSize(vtkVector2i(size)); And I also get: "QWidget::repaint: Recursive repaint detected" I write down my code where the errors are happening, just in case... It compiles all right in gcc, so not sure if there is something wrong with it, or I am just messing up the setup in Windows. Any hint or point to a direction to solve this is really appreciated. Or even any suggestion to improve my question being more specific is welcome. Cheers, Pablo CODE: MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); //First qtvtkwidget setup: ... ... ... // Multiple histogram in same qvtkWidget: histoView = vtkSmartPointer::New(); histoView->SetInteractor(ui->widgetHisto->GetInteractor()); ui->widgetHisto->SetRenderWindow(histoView->GetRenderWindow()); histoView->GetRenderer()->SetBackground(0.0,0.0,0.0); //ui->widgetHisto->resize(550,720); // for (int i=0 ; i<1 ; i++){ int i = 0; // For simplicity. auto histoChart = vtkSmartPointer::New(); histoView->GetScene()->AddItem(histoChart); //Create table for chart. vtkNew table; vtkNew xArray ; table->AddColumn(xArray.GetPointer()); vtkNew yArray; table->AddColumn(yArray.GetPointer()); std::string histo_str ; std::vector histo_data; //int xRenwinSize = ui->widgetHisto->size().width(); //int yRenwinSize = ui->widgetHisto->size().height(); xArray->SetName("Leng-Axis"); yArray->SetName("Distance btwn Nodes"); histo_str = file_root + ".hdis"; histo_data = graph.readHistogram(histo_str); histoData.push_back(histo_data); histoChart->SetAutoSize(true); //histoChart->SetSize(vtkRectf(0.0, 2.0*yRenwinSize/3.0, xRenwinSize, yRenwinSize/3.0)); size_t histo_size = histoData[i].size(); table->SetNumberOfRows(histo_size); for (std::size_t j = 0; j < histo_size; j++){ yArray->SetValue(j,histoData[i][j]); xArray->SetValue(j,j); } histoChart->GetAxis(vtkAxis::BOTTOM)->SetRange(0, histo_size); auto plot = histoChart->AddPlot(vtkChart::LINE) ; plot->SetInputData(table.GetPointer(), 0 , 1); ui->widgetHisto->GetInteractor()->Initialize();} And the main: int main (int argc, char **argv) { QApplication app(argc, argv); app.setApplicationName("VTK-QT Graph"); MainWindow mainWin; mainWin.show(); app.exec(); } -------------- next part -------------- An HTML attachment was scrubbed... URL: From pablo.hernandez.cerdan at outlook.com Mon Jul 21 04:45:31 2014 From: pablo.hernandez.cerdan at outlook.com (=?iso-8859-1?B?UGFibG8gSGVybuFuZGV6?=) Date: Mon, 21 Jul 2014 10:45:31 +0200 Subject: [vtkusers] Problem with QVtkWidget not rendering vktChartXY in visual studio 2013 In-Reply-To: References: Message-ID: Update. It seems that the first error I was getting in Windows is in fact relevant: "Generic Warning: In D:\Software\VTK\source.git\Rendering\Context2D\vtkContextDevice2D.cxx, line 27 Error: no override found for 'vtkContextDevice2D'." I went back to my Linux/Ubuntu machine at work, and installed the latest VTK from 'origin/nightly-master'. And now I am getting the pointed error, and a core dump error in exactly the same code. I still have the working vtk version though. I installed it a couple of months ago max. It is 6.2, but I don't know how to check minor versions, or the commit from where I installed it. I use cmake to build, and change the vtk directory (particular_build/lib/cmake/vtk-6.2) seems clean, but I have heard that it is not recommended to have multiple vtk versions installed. Cheers, Pablo From: pablo.hernandez.cerdan at outlook.com To: vtkusers at vtk.org Subject: Problem with QVtkWidget not rendering vktChartXY in visual studio 2013 Date: Sun, 20 Jul 2014 18:12:01 +0200 Hey there, I am developing in Linux using gcc 4.8, but this weekend I tried to compile in Windows7 using visual studio 2013 (v120). The code use QT with the QVtkWidget. The code works properly in my Linux setup, but it does not render one of the two qtvtkwidget I have. Basically I get a white background where the widget should be, and it corrupts a little bit when resizing. This widget shows 3 vtkChartXY in the same scene of a qvtkWidget. I got three warning/errors but no crashing. And I can interact and render the other QtVtkWidget. First: "Generic Warning: In D:\Software\VTK\source.git\Rendering\Context2D\vtkContextDevice2D.cxx, line 27 Error: no override found for 'vtkContextDevice2D'." I have no idea if this one is relevant to be honest. Second: "First-chance exception at 0x01E07B28 in VTKNodesEdgesEXE.exe: 0xC0000005: Access violation reading location 0x00000000." Debugging this, it points to the render pipeline of the qtvtkWidget, specifically: vtkContextActor.cxx // Renders an actor2D's property and then it's mapper. int vtkContextActor::RenderOverlay(vtkViewport* viewport) // Pass the viewport details onto the context device. int size[2]; size[0] = view_viewport_pixels.width(); size[1] = view_viewport_pixels.height(); vtkRecti viewportRect(actual_viewport_pixels.x() - view_viewport_pixels.x(), actual_viewport_pixels.y() - view_viewport_pixels.y(), actual_viewport_pixels.width(), actual_viewport_pixels.height()); //(Breakpoint here:) this->Context->GetDevice()->SetViewportSize(vtkVector2i(size)); And I also get: "QWidget::repaint: Recursive repaint detected" I write down my code where the errors are happening, just in case... It compiles all right in gcc, so not sure if there is something wrong with it, or I am just messing up the setup in Windows. Any hint or point to a direction to solve this is really appreciated. Or even any suggestion to improve my question being more specific is welcome. Cheers, Pablo CODE: MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); //First qtvtkwidget setup: ... ... ... // Multiple histogram in same qvtkWidget: histoView = vtkSmartPointer::New(); histoView->SetInteractor(ui->widgetHisto->GetInteractor()); ui->widgetHisto->SetRenderWindow(histoView->GetRenderWindow()); histoView->GetRenderer()->SetBackground(0.0,0.0,0.0); //ui->widgetHisto->resize(550,720); // for (int i=0 ; i<1 ; i++){ int i = 0; // For simplicity. auto histoChart = vtkSmartPointer::New(); histoView->GetScene()->AddItem(histoChart); //Create table for chart. vtkNew table; vtkNew xArray ; table->AddColumn(xArray.GetPointer()); vtkNew yArray; table->AddColumn(yArray.GetPointer()); std::string histo_str ; std::vector histo_data; //int xRenwinSize = ui->widgetHisto->size().width(); //int yRenwinSize = ui->widgetHisto->size().height(); xArray->SetName("Leng-Axis"); yArray->SetName("Distance btwn Nodes"); histo_str = file_root + ".hdis"; histo_data = graph.readHistogram(histo_str); histoData.push_back(histo_data); histoChart->SetAutoSize(true); //histoChart->SetSize(vtkRectf(0.0, 2.0*yRenwinSize/3.0, xRenwinSize, yRenwinSize/3.0)); size_t histo_size = histoData[i].size(); table->SetNumberOfRows(histo_size); for (std::size_t j = 0; j < histo_size; j++){ yArray->SetValue(j,histoData[i][j]); xArray->SetValue(j,j); } histoChart->GetAxis(vtkAxis::BOTTOM)->SetRange(0, histo_size); auto plot = histoChart->AddPlot(vtkChart::LINE) ; plot->SetInputData(table.GetPointer(), 0 , 1); ui->widgetHisto->GetInteractor()->Initialize();} And the main: int main (int argc, char **argv) { QApplication app(argc, argv); app.setApplicationName("VTK-QT Graph"); MainWindow mainWin; mainWin.show(); app.exec(); } -------------- next part -------------- An HTML attachment was scrubbed... URL: From pablo.hernandez.cerdan at outlook.com Mon Jul 21 04:45:33 2014 From: pablo.hernandez.cerdan at outlook.com (=?iso-8859-1?B?UGFibG8gSGVybuFuZGV6?=) Date: Mon, 21 Jul 2014 10:45:33 +0200 Subject: [vtkusers] Problem with QVtkWidget not rendering vktChartXY in visual studio 2013 In-Reply-To: References: Message-ID: Update. It seems that the first error I was getting in Windows is in fact relevant: "Generic Warning: In D:\Software\VTK\source.git\Rendering\Context2D\vtkContextDevice2D.cxx, line 27 Error: no override found for 'vtkContextDevice2D'." I went back to my Linux/Ubuntu machine at work, and installed the latest VTK from 'origin/nightly-master'. And now I am getting the pointed error, and a core dump error in exactly the same code. I still have the working vtk version though. I installed it a couple of months ago max. It is 6.2, but I don't know how to check minor versions, or the commit from where I installed it. I use cmake to build, and change the vtk directory (particular_build/lib/cmake/vtk-6.2) seems clean, but I have heard that it is not recommended to have multiple vtk versions installed. Cheers, Pablo From: pablo.hernandez.cerdan at outlook.com To: vtkusers at vtk.org Subject: Problem with QVtkWidget not rendering vktChartXY in visual studio 2013 Date: Sun, 20 Jul 2014 18:12:01 +0200 Hey there, I am developing in Linux using gcc 4.8, but this weekend I tried to compile in Windows7 using visual studio 2013 (v120). The code use QT with the QVtkWidget. The code works properly in my Linux setup, but it does not render one of the two qtvtkwidget I have. Basically I get a white background where the widget should be, and it corrupts a little bit when resizing. This widget shows 3 vtkChartXY in the same scene of a qvtkWidget. I got three warning/errors but no crashing. And I can interact and render the other QtVtkWidget. First: "Generic Warning: In D:\Software\VTK\source.git\Rendering\Context2D\vtkContextDevice2D.cxx, line 27 Error: no override found for 'vtkContextDevice2D'." I have no idea if this one is relevant to be honest. Second: "First-chance exception at 0x01E07B28 in VTKNodesEdgesEXE.exe: 0xC0000005: Access violation reading location 0x00000000." Debugging this, it points to the render pipeline of the qtvtkWidget, specifically: vtkContextActor.cxx // Renders an actor2D's property and then it's mapper. int vtkContextActor::RenderOverlay(vtkViewport* viewport) // Pass the viewport details onto the context device. int size[2]; size[0] = view_viewport_pixels.width(); size[1] = view_viewport_pixels.height(); vtkRecti viewportRect(actual_viewport_pixels.x() - view_viewport_pixels.x(), actual_viewport_pixels.y() - view_viewport_pixels.y(), actual_viewport_pixels.width(), actual_viewport_pixels.height()); //(Breakpoint here:) this->Context->GetDevice()->SetViewportSize(vtkVector2i(size)); And I also get: "QWidget::repaint: Recursive repaint detected" I write down my code where the errors are happening, just in case... It compiles all right in gcc, so not sure if there is something wrong with it, or I am just messing up the setup in Windows. Any hint or point to a direction to solve this is really appreciated. Or even any suggestion to improve my question being more specific is welcome. Cheers, Pablo CODE: MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); //First qtvtkwidget setup: ... ... ... // Multiple histogram in same qvtkWidget: histoView = vtkSmartPointer::New(); histoView->SetInteractor(ui->widgetHisto->GetInteractor()); ui->widgetHisto->SetRenderWindow(histoView->GetRenderWindow()); histoView->GetRenderer()->SetBackground(0.0,0.0,0.0); //ui->widgetHisto->resize(550,720); // for (int i=0 ; i<1 ; i++){ int i = 0; // For simplicity. auto histoChart = vtkSmartPointer::New(); histoView->GetScene()->AddItem(histoChart); //Create table for chart. vtkNew table; vtkNew xArray ; table->AddColumn(xArray.GetPointer()); vtkNew yArray; table->AddColumn(yArray.GetPointer()); std::string histo_str ; std::vector histo_data; //int xRenwinSize = ui->widgetHisto->size().width(); //int yRenwinSize = ui->widgetHisto->size().height(); xArray->SetName("Leng-Axis"); yArray->SetName("Distance btwn Nodes"); histo_str = file_root + ".hdis"; histo_data = graph.readHistogram(histo_str); histoData.push_back(histo_data); histoChart->SetAutoSize(true); //histoChart->SetSize(vtkRectf(0.0, 2.0*yRenwinSize/3.0, xRenwinSize, yRenwinSize/3.0)); size_t histo_size = histoData[i].size(); table->SetNumberOfRows(histo_size); for (std::size_t j = 0; j < histo_size; j++){ yArray->SetValue(j,histoData[i][j]); xArray->SetValue(j,j); } histoChart->GetAxis(vtkAxis::BOTTOM)->SetRange(0, histo_size); auto plot = histoChart->AddPlot(vtkChart::LINE) ; plot->SetInputData(table.GetPointer(), 0 , 1); ui->widgetHisto->GetInteractor()->Initialize();} And the main: int main (int argc, char **argv) { QApplication app(argc, argv); app.setApplicationName("VTK-QT Graph"); MainWindow mainWin; mainWin.show(); app.exec(); } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.hervagault at gmail.com Mon Jul 21 05:47:35 2014 From: mark.hervagault at gmail.com (Mark Hervagault) Date: Mon, 21 Jul 2014 02:47:35 -0700 (PDT) Subject: [vtkusers] vtkCellLocator to detect a collision between a line and a vtkActor Message-ID: <1405936055567-5727918.post@n5.nabble.com> Hi guys, I wonder if my line (it's a vtkActor) touches my other vtkActor. I can not use vtkCollisionDetectionFilter because I'm on java. But I can use vtkCellLocator, so I would like to know how to use it to make a small condition if (line touches my vtkActor) { ......... } Help me please Thank you very much. Mark. -- View this message in context: http://vtk.1045678.n5.nabble.com/vtkCellLocator-to-detect-a-collision-between-a-line-and-a-vtkActor-tp5727918.html Sent from the VTK - Users mailing list archive at Nabble.com. From pablo.hernandez.cerdan at outlook.com Mon Jul 21 06:18:14 2014 From: pablo.hernandez.cerdan at outlook.com (=?iso-8859-1?B?UGFibG8gSGVybuFuZGV6?=) Date: Mon, 21 Jul 2014 12:18:14 +0200 Subject: [vtkusers] Problem with QVtkWidget not rendering vktChartXY in visual studio 2013 In-Reply-To: References: , Message-ID: In linux it is solved if I add to the main CMakeLists.txt: include(${VTK_USE_FILE}) It seems like a crucial dependency, but I was able to compile with no errors in old VTK version. I will test it in Windows soon... and hopefully end this helpful monologue. Cheers, Pablo From: pablo.hernandez.cerdan at outlook.com To: vtkusers at vtk.org Subject: RE: Problem with QVtkWidget not rendering vktChartXY in visual studio 2013 Date: Mon, 21 Jul 2014 10:45:33 +0200 Update. It seems that the first error I was getting in Windows is in fact relevant: "Generic Warning: In D:\Software\VTK\source.git\Rendering\Context2D\vtkContextDevice2D.cxx, line 27 Error: no override found for 'vtkContextDevice2D'." I went back to my Linux/Ubuntu machine at work, and installed the latest VTK from 'origin/nightly-master'. And now I am getting the pointed error, and a core dump error in exactly the same code. I still have the working vtk version though. I installed it a couple of months ago max. It is 6.2, but I don't know how to check minor versions, or the commit from where I installed it. I use cmake to build, and change the vtk directory (particular_build/lib/cmake/vtk-6.2) seems clean, but I have heard that it is not recommended to have multiple vtk versions installed. Cheers, Pablo From: pablo.hernandez.cerdan at outlook.com To: vtkusers at vtk.org Subject: Problem with QVtkWidget not rendering vktChartXY in visual studio 2013 Date: Sun, 20 Jul 2014 18:12:01 +0200 Hey there, I am developing in Linux using gcc 4.8, but this weekend I tried to compile in Windows7 using visual studio 2013 (v120). The code use QT with the QVtkWidget. The code works properly in my Linux setup, but it does not render one of the two qtvtkwidget I have. Basically I get a white background where the widget should be, and it corrupts a little bit when resizing. This widget shows 3 vtkChartXY in the same scene of a qvtkWidget. I got three warning/errors but no crashing. And I can interact and render the other QtVtkWidget. First: "Generic Warning: In D:\Software\VTK\source.git\Rendering\Context2D\vtkContextDevice2D.cxx, line 27 Error: no override found for 'vtkContextDevice2D'." I have no idea if this one is relevant to be honest. Second: "First-chance exception at 0x01E07B28 in VTKNodesEdgesEXE.exe: 0xC0000005: Access violation reading location 0x00000000." Debugging this, it points to the render pipeline of the qtvtkWidget, specifically: vtkContextActor.cxx // Renders an actor2D's property and then it's mapper. int vtkContextActor::RenderOverlay(vtkViewport* viewport) // Pass the viewport details onto the context device. int size[2]; size[0] = view_viewport_pixels.width(); size[1] = view_viewport_pixels.height(); vtkRecti viewportRect(actual_viewport_pixels.x() - view_viewport_pixels.x(), actual_viewport_pixels.y() - view_viewport_pixels.y(), actual_viewport_pixels.width(), actual_viewport_pixels.height()); //(Breakpoint here:) this->Context->GetDevice()->SetViewportSize(vtkVector2i(size)); And I also get: "QWidget::repaint: Recursive repaint detected" I write down my code where the errors are happening, just in case... It compiles all right in gcc, so not sure if there is something wrong with it, or I am just messing up the setup in Windows. Any hint or point to a direction to solve this is really appreciated. Or even any suggestion to improve my question being more specific is welcome. Cheers, Pablo CODE: MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); //First qtvtkwidget setup: ... ... ... // Multiple histogram in same qvtkWidget: histoView = vtkSmartPointer::New(); histoView->SetInteractor(ui->widgetHisto->GetInteractor()); ui->widgetHisto->SetRenderWindow(histoView->GetRenderWindow()); histoView->GetRenderer()->SetBackground(0.0,0.0,0.0); //ui->widgetHisto->resize(550,720); // for (int i=0 ; i<1 ; i++){ int i = 0; // For simplicity. auto histoChart = vtkSmartPointer::New(); histoView->GetScene()->AddItem(histoChart); //Create table for chart. vtkNew table; vtkNew xArray ; table->AddColumn(xArray.GetPointer()); vtkNew yArray; table->AddColumn(yArray.GetPointer()); std::string histo_str ; std::vector histo_data; //int xRenwinSize = ui->widgetHisto->size().width(); //int yRenwinSize = ui->widgetHisto->size().height(); xArray->SetName("Leng-Axis"); yArray->SetName("Distance btwn Nodes"); histo_str = file_root + ".hdis"; histo_data = graph.readHistogram(histo_str); histoData.push_back(histo_data); histoChart->SetAutoSize(true); //histoChart->SetSize(vtkRectf(0.0, 2.0*yRenwinSize/3.0, xRenwinSize, yRenwinSize/3.0)); size_t histo_size = histoData[i].size(); table->SetNumberOfRows(histo_size); for (std::size_t j = 0; j < histo_size; j++){ yArray->SetValue(j,histoData[i][j]); xArray->SetValue(j,j); } histoChart->GetAxis(vtkAxis::BOTTOM)->SetRange(0, histo_size); auto plot = histoChart->AddPlot(vtkChart::LINE) ; plot->SetInputData(table.GetPointer(), 0 , 1); ui->widgetHisto->GetInteractor()->Initialize();} And the main: int main (int argc, char **argv) { QApplication app(argc, argv); app.setApplicationName("VTK-QT Graph"); MainWindow mainWin; mainWin.show(); app.exec(); } -------------- next part -------------- An HTML attachment was scrubbed... URL: From nil.goyette at imeka.ca Mon Jul 21 14:37:44 2014 From: nil.goyette at imeka.ca (Nil Goyette) Date: Mon, 21 Jul 2014 14:37:44 -0400 Subject: [vtkusers] Python vtk extend mapper Message-ID: <53CD5DF8.3040202@imeka.ca> Hi all, Is it possible to extend a mapper in Python VTK? I did a simple test, extending vtkPolyDataMapper, overriding RenderPiece with a "1/0" statement and a call to the real RenderPiece, and replacing in my code the real mapper with this fake mapper. It did nothing. It still draws what it was drawing before my test without failing. I did the same in a C++ project and it's working perfectly. I also tested extending vtkOpenGLPolyDataMapper, just in case. Still nothing. So, is there any restrictions to overriding vtk classes in Python VTK? Thanks for your time. -- Logo Imeka Nil Goyette, M.Sc. www.imeka.ca -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Imeka.png Type: image/png Size: 6630 bytes Desc: not available URL: From david.gobbi at gmail.com Mon Jul 21 15:05:42 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 21 Jul 2014 13:05:42 -0600 Subject: [vtkusers] Python vtk extend mapper In-Reply-To: <53CD5DF8.3040202@imeka.ca> References: <53CD5DF8.3040202@imeka.ca> Message-ID: Hi Nil, Overriding virtual C++ methods in Python doesn't work. See the "Subclassing a VTK class" section of the following: http://vtk.org/gitweb?p=VTK.git;a=blob;f=Wrapping/Python/README_WRAP.txt Extending filters, mappers, and sources via python requires the use of special "programmable" base classes like the vtkProgrammableSource and vtkProgrammableFilter. There is no "vtkProgrammableMapper" base class, however. - David On Mon, Jul 21, 2014 at 12:37 PM, Nil Goyette wrote: > Hi all, Is it possible to extend a mapper in Python VTK? I did a simple > test, extending vtkPolyDataMapper, overriding RenderPiece with a "1/0" > statement and a call to the real RenderPiece, and replacing in my code the > real mapper with this fake mapper. It did nothing. It still draws what it > was drawing before my test without failing. I did the same in a C++ project > and it's working perfectly. I also tested extending > vtkOpenGLPolyDataMapper, just in case. Still nothing. > > So, is there any restrictions to overriding vtk classes in Python VTK? > Thanks for your time. > > -- > [image: Logo Imeka] Nil Goyette, M.Sc. > www.imeka.ca > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Imeka.png Type: image/png Size: 6630 bytes Desc: not available URL: From nil.goyette at imeka.ca Mon Jul 21 16:44:15 2014 From: nil.goyette at imeka.ca (Nil Goyette) Date: Mon, 21 Jul 2014 16:44:15 -0400 Subject: [vtkusers] Adding light for specific actor In-Reply-To: <1399063660484-5726968.post@n5.nabble.com> References: <1397074610024-5726725.post@n5.nabble.com> <1397131734305.b44e19eb@Nodemailer> <1399063660484-5726968.post@n5.nabble.com> Message-ID: <53CD7B9F.3000307@imeka.ca> If you are still here Jas, would you mind telling the mailing list how you did ? I'm also searching how to apply a shader to a single actor and I had no luck so far. It seems a shader collection can only be applied to a render window. Le 2014-05-02 16:47, jas a ?crit : > Hey Aashish > > Thax for you reply btw. It did point me towards right direction. Sorry > forget to thax. > > So thax > > Jas > -- Logo Imeka Nil Goyette, M.Sc. www.imeka.ca -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Imeka.png Type: image/png Size: 6630 bytes Desc: not available URL: From ich_daniel at habmalnefrage.de Tue Jul 22 05:53:13 2014 From: ich_daniel at habmalnefrage.de (-Daniel-) Date: Tue, 22 Jul 2014 02:53:13 -0700 (PDT) Subject: [vtkusers] Crash/Error by using vtkVRMLImporter with VTK6.1 Message-ID: <1406022793793-5727927.post@n5.nabble.com> Hi there, in my application I can import one VRML-object. But my program crashes, when I load the next VRML-dataobject (with VTK6.1). With VTK 6.0 it runs fine. here my (JAVA-)code for loading a new VRML-object: / //***** VRML import ****** vtkVRMLImporter importer = new vtkVRMLImporter(); importer.SetFileName(file); importer.Read(); importer.Update(); vtkActorCollection coll = importer.GetRenderer().GetActors(); coll.InitTraversal(); vtkActor actor = coll.GetLastActor(); //***************************** / It crashes in the third line ( importer.Read() ). Is it a bug in 6.1 ? -- View this message in context: http://vtk.1045678.n5.nabble.com/Crash-Error-by-using-vtkVRMLImporter-with-VTK6-1-tp5727927.html Sent from the VTK - Users mailing list archive at Nabble.com. From grothausmann.roman at mh-hannover.de Tue Jul 22 07:02:58 2014 From: grothausmann.roman at mh-hannover.de (Dr. Roman Grothausmann) Date: Tue, 22 Jul 2014 13:02:58 +0200 Subject: [vtkusers] Convert vtkPolyData to vtkImageData - wrong values at points where objects intersects In-Reply-To: References: Message-ID: <53CE44E2.5090605@mh-hannover.de> Hi Chris, It is likely not vtkAppendPolyData but vtkPolyDataToImageStencil. I'm not sure how vtkPolyDataToImageStencil evaluates within intersections. Instead You could either use a boolean union instead of vtkAppendPolyData, which however is likely to be slow. A possibly faster way could be to OR together output images of each individual polydata object. What in the end actually is faster depends on the complexity of the polydata, the number of objects and the needed image resolution. If both methods are too slow, modifying the code of vtkPolyDataToImageStencil might be best. Hope this helps Roman On 16/07/14 11:22, Christian Arens wrote: > Hi there, > > i want to convert several vtkpolydata objects into one imagedata object, because > i want to read along every voxel (x,y,z). I using vtkAppendPolyData to append > several polydataobjets like spheres. This output is used in this algorithm: > http://www.paraview.org/Wiki/VTK/Examples/Cxx/PolyData/PolyDataToImageData > > My next step is: > > int* dims = imgstenc->GetOutput()->GetDimensions(); > > |for (int x=0; x { > > for (int y=0; y { > int teiler = 0; > for (int z=0; z { > double voxel = imgstenc->GetOutput()->GetScalarComponentAsDouble(x,y,z,0); //Pixelwerte > if (voxel > 0) > { > teiler++; > } > } > outputFile << teiler <<","; > > } > > outputFile << endl; > } > | > > So i want to count every voxel that has the objectvalue of 255. > > It works great, but if a polydata objects intersects another, at the > intersection a voxelvalue of 0 is count, not 255 and i dont know why. Maybe > there is a problem with the vtkAppendPolyData filter ? > > http://www.pic-upload.de/view-23915628/berechneteWerte2.jpg.html > > Best regards Chris > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- Dr. Roman Grothausmann Tomographie und Digitale Bildverarbeitung Tomography and Digital Image Analysis Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 Medizinische Hochschule Hannover Carl-Neuberg-Str. 1 D-30625 Hannover Tel. +49 511 532-9574 From luis.vieira at vektore.com Tue Jul 22 08:26:44 2014 From: luis.vieira at vektore.com (Luis Vieira) Date: Tue, 22 Jul 2014 09:26:44 -0300 Subject: [vtkusers] CMake problem (VTK 6.1 - Qt 5.3) In-Reply-To: References: Message-ID: <53CE5884.2080505@vektore.com> Hello, We hope this email find you well. *We have the follow CMake - VTK - Visual Studio 2013 Configuration:* ?Visual Studio 2013 opengl +64; ?CMake 3.0; ?VTK-6.1.0. *CMake configurated the following paths:* ?C:\Program Files\VTK (Debug); ?C:\Program Files\VTK (Release); ?C:\VTK\build; ?C:\VTK\Data. The environment stated above works very well. However, we need to provide/enable the same configuration between*VTK* and *QT Enterprise Creator 5.3*. We used CMake 3.0 to configure the linkage between *QT 5.3 and VTK - 6.1.0*. The following variables were configured in CMake: ?*VTK_Group_Qt:BOOL=ON;* *?QT_QMAKE_EXECUTABLE:FILEPATH=C:/Qt/Qt5.3.1/5.3/msvc2013_64_opengl/bin/qmake.exe. * Despite of the above configuration, CMake presents this error message: CMake Warning at C:/Program Files (x86)/CMake/share/cmake-3.0/Modules/FindQt4.cmake:616 (message): C:/Qt/Qt5.3.1/5.3/msvc2013_64_opengl/bin/qmake.exe reported QT_INSTALL_LIBS as "C:/Qt/Qt5.3.1/5.3/msvc2013_64_opengl/lib" but QtCore could not be found there. Qt is NOT installed correctly for the target build environment. Call Stack (most recent call first): GUISupport/Qt/CMakeLists.txt:68 (find_package) CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.0/Modules/FindQt4.cmake:621 (message): Could NOT find QtCore. Check C:/VTK/bin/msvc2013_64_opengl/CMakeFiles/CMakeError.log for more details. Call Stack (most recent call first): GUISupport/Qt/CMakeLists.txt:68 (find_package) Could you guys please advise me on how to properly set up the programming environment in which CMake will build the bridge amongst the VSC++ OpenGL +64, VTK 6.1.0 and QT 5.3? What are our options to direct CMake to recognize QT5.3? The way it is now it only recognizes QT4.0. Thank you so much. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ggdedbeb.png Type: image/png Size: 81504 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: eecdhiai.png Type: image/png Size: 124093 bytes Desc: not available URL: From christopher.mullins at kitware.com Tue Jul 22 10:07:54 2014 From: christopher.mullins at kitware.com (Christopher Mullins) Date: Tue, 22 Jul 2014 10:07:54 -0400 Subject: [vtkusers] CMake problem (VTK 6.1 - Qt 5.3) In-Reply-To: <53CE5884.2080505@vektore.com> References: <53CE5884.2080505@vektore.com> Message-ID: This page might have what you're looking for [1]. If not please feel free to update it once this is resolved! You might want to try setting CMAKE_PREFIX_PATH to the directory containing the "lib/cmake" directories, which is usually installed with qt in "C:/path/to/qt-5.3-install/5.3/ " which in your case is "C:/Qt/Qt5.3.1/5.3/msvc2013_64_opengl". Note also that it looks like you have set CMAKE_INSTALL_PREFIX to this value, which tells cmake where your current project will be installed [2] - probably not what you want. If all else fails you could try manually pointing QT_QTCORE_LIBRARY_* variables to those libraries. This shouldn't be necessary if CMake correctly finds qt but occasionally helps diagnose the problem nonetheless. [1] http://vtk.org/Wiki/VTK/Configure_and_Build#Qt5..2A [2] http://www.cmake.org/cmake/help/v3.0/variable/CMAKE_INSTALL_PREFIX.html On Tue, Jul 22, 2014 at 8:26 AM, Luis Vieira wrote: > > Hello, We hope this email find you well. > > *We have the follow CMake - VTK - Visual Studio 2013 Configuration:* > > ? Visual Studio 2013 opengl +64; > > ? CMake 3.0; > > ? VTK-6.1.0. > > *CMake configurated the following paths:* > > ? C:\Program Files\VTK (Debug); > > ? C:\Program Files\VTK (Release); > > ? C:\VTK\build; > > ? C:\VTK\Data. > > The environment stated above works very well. However, we need to > provide/enable the same configuration between* VTK* and *QT Enterprise > Creator 5.3*. We used CMake 3.0 to configure the linkage between *QT 5.3 > and VTK - 6.1.0*. > > The following variables were configured in CMake: > > ? *VTK_Group_Qt:BOOL=ON;* > > *? > QT_QMAKE_EXECUTABLE:FILEPATH=C:/Qt/Qt5.3.1/5.3/msvc2013_64_opengl/bin/qmake.exe. * > > > > > Despite of the above configuration, CMake presents this error message: > > CMake Warning at C:/Program Files > (x86)/CMake/share/cmake-3.0/Modules/FindQt4.cmake:616 > (message): C:/Qt/Qt5.3.1/5.3/msvc2013_64_opengl/bin/qmake.exe > reported QT_INSTALL_LIBS as > "C:/Qt/Qt5.3.1/5.3/msvc2013_64_opengl/lib" but QtCore could not > be found there. Qt is NOT installed correctly for the target > build environment. Call Stack (most recent call first): > GUISupport/Qt/CMakeLists.txt:68 (find_package) > > CMake Error at C:/Program Files > (x86)/CMake/share/cmake-3.0/Modules/FindQt4.cmake:621 > (message): Could NOT find QtCore. Check > C:/VTK/bin/msvc2013_64_opengl/CMakeFiles/CMakeError.log for > more details. Call Stack (most recent call first): > GUISupport/Qt/CMakeLists.txt:68 (find_package) > > Could you guys please advise me on how to properly set up the programming > environment in which CMake will build the bridge amongst the VSC++ OpenGL > +64, VTK 6.1.0 and QT 5.3? What are our options to direct CMake to > recognize QT5.3? The way it is now it only recognizes QT4.0. > > > Thank you so much. > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -- Christopher Mullins R&D Engineer Kitware Inc., 919.869.8871 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ggdedbeb.png Type: image/png Size: 81504 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: eecdhiai.png Type: image/png Size: 124093 bytes Desc: not available URL: From jaspreet.punjab at gmail.com Tue Jul 22 10:38:10 2014 From: jaspreet.punjab at gmail.com (jas) Date: Tue, 22 Jul 2014 07:38:10 -0700 (PDT) Subject: [vtkusers] Adding light for specific actor In-Reply-To: <53CD7B9F.3000307@imeka.ca> References: <1397074610024-5726725.post@n5.nabble.com> <1397131734305.b44e19eb@Nodemailer> <1399063660484-5726968.post@n5.nabble.com> <53CD7B9F.3000307@imeka.ca> Message-ID: <1406039890404-5727931.post@n5.nabble.com> Hey Nil Search for adding material which will be a xml file containing paths to shaders and declarations of variables. This method was removed in 6.2 I think, so search forum for solution of this. Will send you my email in private message, add me on hangouts if further help is required. -- View this message in context: http://vtk.1045678.n5.nabble.com/Adding-light-for-specific-actor-tp5726725p5727931.html Sent from the VTK - Users mailing list archive at Nabble.com. From sean at rogue-research.com Tue Jul 22 11:56:52 2014 From: sean at rogue-research.com (Sean McBride) Date: Tue, 22 Jul 2014 11:56:52 -0400 Subject: [vtkusers] Crash/Error by using vtkVRMLImporter with VTK6.1 In-Reply-To: <1406022793793-5727927.post@n5.nabble.com> References: <1406022793793-5727927.post@n5.nabble.com> Message-ID: <20140722155652.1653548454@mail.rogue-research.com> On Tue, 22 Jul 2014 02:53:13 -0700, -Daniel- said: >in my application I can import one VRML-object. But my program crashes, when >I load the next VRML-dataobject (with VTK6.1). >With VTK 6.0 it runs fine. > >here my (JAVA-)code for loading a new VRML-object: >/ >//***** VRML import ****** >vtkVRMLImporter importer = new vtkVRMLImporter(); >importer.SetFileName(file); >importer.Read(); >importer.Update(); > >vtkActorCollection coll = importer.GetRenderer().GetActors(); >coll.InitTraversal(); > >vtkActor actor = coll.GetLastActor(); >//***************************** >/ > >It crashes in the third line ( importer.Read() ). > >Is it a bug in 6.1 ? You don't really give enough information for anyone to help you. Have you run your code in a debugger? Stepping into the VTK library code? Where does it crash exactly? Cheers, -- ____________________________________________________________ Sean McBride, B. Eng sean at rogue-research.com Rogue Research www.rogue-research.com Mac Software Developer Montr?al, Qu?bec, Canada From waldo.valenzuela at hotmail.com Tue Jul 22 13:34:43 2014 From: waldo.valenzuela at hotmail.com (Waldo Valenzuela) Date: Tue, 22 Jul 2014 19:34:43 +0200 Subject: [vtkusers] CMake problem (VTK 6.1 - Qt 5.3) In-Reply-To: <53CE5884.2080505@vektore.com> References: <53CE5884.2080505@vektore.com> Message-ID: Hi Luis, to compile qt 5 or superior with vtk 6, you need to set as well VTK_QT_VERSION = 5, in cmake. Cheers, Waldo. On 22 Jul 2014, at 14:26, Luis Vieira wrote: > > Hello, We hope this email find you well. > > We have the follow CMake - VTK - Visual Studio 2013 Configuration: > > ? Visual Studio 2013 opengl +64; > > ? CMake 3.0; > > ? VTK-6.1.0. > > CMake configurated the following paths: > > ? C:\Program Files\VTK (Debug); > > ? C:\Program Files\VTK (Release); > > ? C:\VTK\build; > > ? C:\VTK\Data. > > The environment stated above works very well. However, we need to provide/enable the same configuration between VTK and QT Enterprise Creator 5.3. We used CMake 3.0 to configure the linkage between QT 5.3 and VTK - 6.1.0. > > The following variables were configured in CMake: > > ? VTK_Group_Qt:BOOL=ON; > > ? QT_QMAKE_EXECUTABLE:FILEPATH=C:/Qt/Qt5.3.1/5.3/msvc2013_64_opengl/bin/qmake.exe. > > > > > > Despite of the above configuration, CMake presents this error message: > > CMake Warning at C:/Program Files (x86)/CMake/share/cmake-3.0/Modules/FindQt4.cmake:616 (message): C:/Qt/Qt5.3.1/5.3/msvc2013_64_opengl/bin/qmake.exe reported QT_INSTALL_LIBS as "C:/Qt/Qt5.3.1/5.3/msvc2013_64_opengl/lib" but QtCore could not be found there. Qt is NOT installed correctly for the target build environment. Call Stack (most recent call first): GUISupport/Qt/CMakeLists.txt:68 (find_package) > > CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.0/Modules/FindQt4.cmake:621 (message): Could NOT find QtCore. Check C:/VTK/bin/msvc2013_64_opengl/CMakeFiles/CMakeError.log for more details. Call Stack (most recent call first): GUISupport/Qt/CMakeLists.txt:68 (find_package) > Could you guys please advise me on how to properly set up the programming environment in which CMake will build the bridge amongst the VSC++ OpenGL +64, VTK 6.1.0 and QT 5.3? What are our options to direct CMake to recognize QT5.3? The way it is now it only recognizes QT4.0. > > Thank you so much. > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From tfmoraes at cti.gov.br Tue Jul 22 14:43:44 2014 From: tfmoraes at cti.gov.br (Thiago Franco de Moraes) Date: Tue, 22 Jul 2014 15:43:44 -0300 (BRT) Subject: [vtkusers] =?utf-8?q?Research_position_in_the_Brazilian_Research_?= =?utf-8?q?Institute_for_Science_and_Neurotechnology_=E2=80=93_BRAINN?= Message-ID: <754270755.2282723.1406054624320.JavaMail.zimbra@cti.gov.br> Research position in the Brazilian Research Institute for Science and Neurotechnology ? BRAINN Postdoc researcher to work with software development for medical imaging The Brazilian Research Institute for Neuroscience and Neurotechnology (BRAINN) (www.brainn.org.br) focuses on the investigation of basic mechanisms leading to epilepsy and stroke, and the injury mechanisms that follow disease onset and progression. This research has important applications related to prevention, diagnosis, treatment and rehabilitation and will serve as a model for better understanding normal and abnormal brain function. The BRAINN Institute is composed of 10 institutions from Brazil and abroad and hosted by State University of Campinas (UNICAMP). Among the associated institutions is Renato Archer Information Technology Center (CTI) that has a specialized team in open-source software development for medical imaging (www.cti.gov.br/invesalius) and 3D printing applications for healthcare. CTI is located close the UNICAMP in the city of Campinas, State of S?o Paulo in a very technological region of Brazil and is looking for a postdoc researcher to work with software development for medical imaging related to the imaging analysis, diagnosis and treatment of brain diseases. The postdoc position is for two years with the possibility of being renovated for more two years. Education - PhD in computer science, computer engineering, mathematics, physics or related. Requirements - Digital image processing (Medical imaging) - Computer graphics (basic) Benefits 6.143,40 Reais per month free of taxes (about US$ 2.800,00); 15% technical reserve for conferences participation and specific materials acquisition; Interested Send curriculum to: jorge.silva at cti.gov.br with subject ?Postdoc position? Applications reviews will begin August 1, 2014 and continue until the position is filled. From matimontg at gmail.com Tue Jul 22 15:38:34 2014 From: matimontg at gmail.com (Matias Montroull) Date: Tue, 22 Jul 2014 16:38:34 -0300 Subject: [vtkusers] Resize Dicom Image | Kitware Message-ID: Hi, I have a directory with 10 Dicom Images. The images are 512(rows) X 384(columns). Is there a function to convert the 512X384 images into 512X512? Thanks, Matias. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lchauvin at bwh.harvard.edu Tue Jul 22 17:55:06 2014 From: lchauvin at bwh.harvard.edu (Laurent Chauvin) Date: Tue, 22 Jul 2014 17:55:06 -0400 Subject: [vtkusers] SetInputData migration VTK 6 Message-ID: Hello, I created a pipeline with a vtkSplineFilter, with a polydata as input. However, now that I try to make it compatible with VTK 6, it's not working anymore. I replaced SetInput by SetInputData, and I read that SetInputData doesn't create the pipeline. That's probably why now, when I update my polydata, it's not updating the spline. But I was wondering then how should I do to keep creating the pipeline then ? I read to use SetInputConnection, but I think SetInputConnection take as argument the OutputPort of another filter, but the spline is the 'entry point' of my pipeline, taking a polydata as input, and applying some filters on it. How could I do to update the pipeline when modifying the polydata ? Thank you. -Laurent -- Laurent Chauvin, MS Surgical Navigation and Robotics Laboratory, Radiology Department Brigham And Women's Hospital, Harvard Medical School http://wiki.ncigt.org/index.php/User:Lchauvin -------------- next part -------------- An HTML attachment was scrubbed... URL: From sbalderrama at eagle.org Tue Jul 22 17:49:12 2014 From: sbalderrama at eagle.org (Steve Balderrama) Date: Tue, 22 Jul 2014 21:49:12 +0000 Subject: [vtkusers] vtkAxesActor and rubberbanding in C#... Message-ID: I'm using Activiz on Windows 7 with an HD4600 graphics processor. For some reason when I have a vtkAxesActor in my scene, it messes up rubberbanding with the rubberband3d interactor. The rubberbands will not draw over any background space, although they do draw over 3d objects in the scene. It doesn't seem to matter whether the axesActor is placed directly in the RenderWindow or in a vtkOrientationMarkerWidget. Any idea what might cause this behavior? This is how I'm putting the axesActor in the scene currently. vtkAxesActor axes = vtkAxesActor.New(); axes.SetCylinderRadius(.08); axes.SetConeRadius(.7); axes.SetScale(3); axes.SetPosition(-1, -1, 0); axes.PickableOff(); axes.DragableOff(); axes.SetShaftTypeToCylinder(); widget = vtkOrientationMarkerWidget.New(); widget.SetOutlineColor(0.9300, 0.5700, 0.1300); widget.SetOrientationMarker(axes); vtkRenderWindowInteractor vr = viz.RenderWindow.GetInteractor(); widget.SetInteractor(vr); widget.SetEnabled(1); -------------- next part -------------- An HTML attachment was scrubbed... URL: From rabysam28 at gmail.com Tue Jul 22 19:02:11 2014 From: rabysam28 at gmail.com (Sam Raby) Date: Tue, 22 Jul 2014 18:02:11 -0500 Subject: [vtkusers] SetInputData migration VTK 6 In-Reply-To: References: Message-ID: Hi Laurent, After feeding the vtkPolyData into the vtkSplineFilter by SetInputData and setting the parameters of the filter, did you try to manually update the vtkSplineFilter? On Tue, Jul 22, 2014 at 4:55 PM, Laurent Chauvin wrote: > Hello, > > I created a pipeline with a vtkSplineFilter, with a polydata as input. > However, now that I try to make it compatible with VTK 6, it's not working > anymore. > > I replaced SetInput by SetInputData, and I read that SetInputData doesn't > create the pipeline. That's probably why now, when I update my polydata, > it's not updating the spline. > But I was wondering then how should I do to keep creating the pipeline > then ? > > I read to use SetInputConnection, but I think SetInputConnection take as > argument the OutputPort of another filter, but the spline is the 'entry > point' of my pipeline, taking a polydata as input, and applying some > filters on it. > > How could I do to update the pipeline when modifying the polydata ? > > Thank you. > -Laurent > > -- > Laurent Chauvin, MS > Surgical Navigation and Robotics Laboratory, Radiology Department > Brigham And Women's Hospital, Harvard Medical School > http://wiki.ncigt.org/index.php/User:Lchauvin > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lchauvin at bwh.harvard.edu Tue Jul 22 19:07:35 2014 From: lchauvin at bwh.harvard.edu (Laurent Chauvin) Date: Tue, 22 Jul 2014 19:07:35 -0400 Subject: [vtkusers] SetInputData migration VTK 6 In-Reply-To: References: Message-ID: Hi Sam, Thank you for your answer. Here is my pipeline (just an overview): vtkSplineFilter->SetInputData(polydata) vtkTubeFilter->SetInputConnection(vtkSplineFilter->GetOutputPort()) vtkMRMLModelNode->SetAndObservePolyData(vtkTubeFilter->GetOutput()) I would like to have one vtkMRMLModelNode with one polydata. The problem if I do what you suggested, is all my vtkMRMLModelNodes are gonna observe TubeFilter. So when I will modify my polydata and call vtkSplineFilter->Update() and vtkTubeFilter->Update(), all my vtkMRMLModelNodes will be updated, but I only want the last one to be. Should I do a copy of the output of vtkTubeFilter instead ? to avoid they all change when I update the TubeFilter ? Thank you. -Laurent On Tue, Jul 22, 2014 at 7:02 PM, Sam Raby wrote: > Hi Laurent, > > After feeding the vtkPolyData into the vtkSplineFilter by SetInputData and > setting the parameters of the filter, did you try to manually update the > vtkSplineFilter? > > > > > On Tue, Jul 22, 2014 at 4:55 PM, Laurent Chauvin > wrote: > >> Hello, >> >> I created a pipeline with a vtkSplineFilter, with a polydata as input. >> However, now that I try to make it compatible with VTK 6, it's not >> working anymore. >> >> I replaced SetInput by SetInputData, and I read that SetInputData doesn't >> create the pipeline. That's probably why now, when I update my polydata, >> it's not updating the spline. >> But I was wondering then how should I do to keep creating the pipeline >> then ? >> >> I read to use SetInputConnection, but I think SetInputConnection take as >> argument the OutputPort of another filter, but the spline is the 'entry >> point' of my pipeline, taking a polydata as input, and applying some >> filters on it. >> >> How could I do to update the pipeline when modifying the polydata ? >> >> Thank you. >> -Laurent >> >> -- >> Laurent Chauvin, MS >> Surgical Navigation and Robotics Laboratory, Radiology Department >> Brigham And Women's Hospital, Harvard Medical School >> http://wiki.ncigt.org/index.php/User:Lchauvin >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> > The information in this e-mail is intended only for the person to whom > it is > addressed. If you believe this e-mail was sent to you in error and the > e-mail > contains patient information, please contact the Partners Compliance > HelpLine at > http://www.partners.org/complianceline . If the e-mail was sent to you in > error > but does not contain patient information, please contact the sender and > properly > dispose of the e-mail. > -- Laurent Chauvin, MS Surgical Navigation and Robotics Laboratory, Radiology Department Brigham And Women's Hospital, Harvard Medical School http://wiki.ncigt.org/index.php/User:Lchauvin -------------- next part -------------- An HTML attachment was scrubbed... URL: From matimontg at gmail.com Tue Jul 22 19:37:44 2014 From: matimontg at gmail.com (Matias Montroull) Date: Tue, 22 Jul 2014 20:37:44 -0300 Subject: [vtkusers] Save Dicom Image | Kitware Message-ID: Hi, Is there a method in ActiViz that would save a Dicom Image? I've found this one: vtkImageWriter but the Dicom writer is not there for some reason. Thanks, -------------- next part -------------- An HTML attachment was scrubbed... URL: From berk.geveci at kitware.com Tue Jul 22 20:10:39 2014 From: berk.geveci at kitware.com (Berk Geveci) Date: Tue, 22 Jul 2014 20:10:39 -0400 Subject: [vtkusers] SetInputData migration VTK 6 In-Reply-To: References: Message-ID: It is correct that SetInputData() does not connect the pipeline. To be more specific, consider 2 examples: 1) polydata = someFilter->GetOutput(); anotherFilter->SetInputData(polydata) anotherFilter->Update(); someFilter->Modified(); anotherFilter->Update(); Update() would not propagate a pipeline request to someFilter. So the output of anotherFilter will not change between the 2 Update() calls. 2) polydata = giveMePolyData(); anotherFilter->SetInputData(polydata) anotherFilter->Update(); // modify the polydata somehow polydata->Modified(); anotherFilter->Update(); In this case, because the polydata changed, the second Update() will actually have an effect and the output of anotherFilter will change after the 2nd Update. So the change to your code will depend on the nature of "polydata". Is it still the output of a filter? Then you must use SetInputConnection(). Unfortunately, this sometimes means that you need to change function signatures to pass an (algorithm, port index) pair around instead of a data object. If polydata is a stand-alone data object that is modified directly by some code and as a result its mtime is updated, you can use SetInputData(). Keep in mind that the producer of the data object is now completely out of the pipeline and will not see any pipeline updates. I don't know the details of how data is stored in MRML. If you add a polydata to a MRML node and expect it to represent the output port of a filter such that you can do this: vtkMRMLModelNode->SetAndObservePolyData(vtkTubeFilter->GetOutput()) vtkTubeFilter->SetSomething(); polydata = get_MRML_node_somehow(); polydata->Update(); // should cause vtkTubeFilter to re-execute The MRML code will have to change to store the algorithm and output port index instead. There is no longer any way to get from a data object to its producer. In fact, vtkDataObject is now in a module (library) that doesn't know anything about algorithms or pipelines. Best, -berk On Tue, Jul 22, 2014 at 7:07 PM, Laurent Chauvin wrote: > Hi Sam, > > Thank you for your answer. > > Here is my pipeline (just an overview): > > vtkSplineFilter->SetInputData(polydata) > > vtkTubeFilter->SetInputConnection(vtkSplineFilter->GetOutputPort()) > > vtkMRMLModelNode->SetAndObservePolyData(vtkTubeFilter->GetOutput()) > > I would like to have one vtkMRMLModelNode with one polydata. > The problem if I do what you suggested, is all my vtkMRMLModelNodes are > gonna observe TubeFilter. So when I will modify my polydata and call > vtkSplineFilter->Update() and vtkTubeFilter->Update(), all my > vtkMRMLModelNodes will be updated, but I only want the last one to be. > Should I do a copy of the output of vtkTubeFilter instead ? to avoid they > all change when I update the TubeFilter ? > > Thank you. > -Laurent > > > > On Tue, Jul 22, 2014 at 7:02 PM, Sam Raby wrote: > >> Hi Laurent, >> >> After feeding the vtkPolyData into the vtkSplineFilter by SetInputData >> and setting the parameters of the filter, did you try to manually update >> the vtkSplineFilter? >> >> >> >> >> On Tue, Jul 22, 2014 at 4:55 PM, Laurent Chauvin < >> lchauvin at bwh.harvard.edu> wrote: >> >>> Hello, >>> >>> I created a pipeline with a vtkSplineFilter, with a polydata as input. >>> However, now that I try to make it compatible with VTK 6, it's not >>> working anymore. >>> >>> I replaced SetInput by SetInputData, and I read that SetInputData >>> doesn't create the pipeline. That's probably why now, when I update my >>> polydata, it's not updating the spline. >>> But I was wondering then how should I do to keep creating the pipeline >>> then ? >>> >>> I read to use SetInputConnection, but I think SetInputConnection take as >>> argument the OutputPort of another filter, but the spline is the 'entry >>> point' of my pipeline, taking a polydata as input, and applying some >>> filters on it. >>> >>> How could I do to update the pipeline when modifying the polydata ? >>> >>> Thank you. >>> -Laurent >>> >>> -- >>> Laurent Chauvin, MS >>> Surgical Navigation and Robotics Laboratory, Radiology Department >>> Brigham And Women's Hospital, Harvard Medical School >>> http://wiki.ncigt.org/index.php/User:Lchauvin >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/vtkusers >>> >>> >> The information in this e-mail is intended only for the person to whom >> it is >> addressed. If you believe this e-mail was sent to you in error and the >> e-mail >> contains patient information, please contact the Partners Compliance >> HelpLine at >> http://www.partners.org/complianceline . If the e-mail was sent to you >> in error >> but does not contain patient information, please contact the sender and >> properly >> dispose of the e-mail. >> > > > > -- > Laurent Chauvin, MS > Surgical Navigation and Robotics Laboratory, Radiology Department > Brigham And Women's Hospital, Harvard Medical School > http://wiki.ncigt.org/index.php/User:Lchauvin > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lchauvin at bwh.harvard.edu Tue Jul 22 20:40:00 2014 From: lchauvin at bwh.harvard.edu (Laurent Chauvin) Date: Tue, 22 Jul 2014 20:40:00 -0400 Subject: [vtkusers] SetInputData migration VTK 6 In-Reply-To: References: Message-ID: Thank you Berk for your answer. My polydata is not an output of a filter, it's a stand-alone object, that I modify myself directly. So what would happen if I had something like this: polydata = vtk.vtkPolyData() splineFilter->SetInputData(polydata) tubeFilter->SetInputConnection(splineFilter->GetOutputPort()) mrmlNode1->SetAndObservePolyData(tubeFilter->GetOutput()) //modify polydata splineFilter->Update() tubeFilter->Update() (I don't know if this one is necessary of if Updating splineFilter will automatically trigger an update of tubeFilter) mrmlNode2->SetAndObservePolyData(tubeFilter->GetOuput()) My understanding was as splineFilter has been updated after getting the output of tube filter for mrmlNode1, mrmlNode1 and mrmlNode2 should be different. However, it seems that it's not the case. As they both observe the output of tubeFilter, when I update tubeFilter, it modifies polydata of mrmlNode1 and mrmlNode2. Is it correct ? Thank you very much. -Laurent On Tue, Jul 22, 2014 at 8:10 PM, Berk Geveci wrote: > It is correct that SetInputData() does not connect the pipeline. To be > more specific, consider 2 examples: > > 1) > > polydata = someFilter->GetOutput(); > > anotherFilter->SetInputData(polydata) > anotherFilter->Update(); > > someFilter->Modified(); > anotherFilter->Update(); > > Update() would not propagate a pipeline request to someFilter. So the > output of anotherFilter will not change between the 2 Update() calls. > > 2) > > polydata = giveMePolyData(); > > anotherFilter->SetInputData(polydata) > anotherFilter->Update(); > > // modify the polydata somehow > polydata->Modified(); > > anotherFilter->Update(); > > In this case, because the polydata changed, the second Update() will > actually have an effect and the output of anotherFilter will change after > the 2nd Update. > > > So the change to your code will depend on the nature of "polydata". Is it > still the output of a filter? Then you must use SetInputConnection(). > Unfortunately, this sometimes means that you need to change function > signatures to pass an (algorithm, port index) pair around instead of a data > object. > > If polydata is a stand-alone data object that is modified directly by some > code and as a result its mtime is updated, you can use SetInputData(). Keep > in mind that the producer of the data object is now completely out of the > pipeline and will not see any pipeline updates. > > I don't know the details of how data is stored in MRML. If you add a > polydata to a MRML node and expect it to represent the output port of a > filter such that you can do this: > > vtkMRMLModelNode->SetAndObservePolyData(vtkTubeFilter->GetOutput()) > > vtkTubeFilter->SetSomething(); > > polydata = get_MRML_node_somehow(); > polydata->Update(); // should cause vtkTubeFilter to re-execute > > The MRML code will have to change to store the algorithm and output port > index instead. There is no longer any way to get from a data object to its > producer. In fact, vtkDataObject is now in a module (library) that doesn't > know anything about algorithms or pipelines. > > Best, > -berk > > > > > > > On Tue, Jul 22, 2014 at 7:07 PM, Laurent Chauvin > wrote: > >> Hi Sam, >> >> Thank you for your answer. >> >> Here is my pipeline (just an overview): >> >> vtkSplineFilter->SetInputData(polydata) >> >> vtkTubeFilter->SetInputConnection(vtkSplineFilter->GetOutputPort()) >> >> vtkMRMLModelNode->SetAndObservePolyData(vtkTubeFilter->GetOutput()) >> >> I would like to have one vtkMRMLModelNode with one polydata. >> The problem if I do what you suggested, is all my vtkMRMLModelNodes are >> gonna observe TubeFilter. So when I will modify my polydata and call >> vtkSplineFilter->Update() and vtkTubeFilter->Update(), all my >> vtkMRMLModelNodes will be updated, but I only want the last one to be. >> Should I do a copy of the output of vtkTubeFilter instead ? to avoid they >> all change when I update the TubeFilter ? >> >> Thank you. >> -Laurent >> >> >> >> On Tue, Jul 22, 2014 at 7:02 PM, Sam Raby wrote: >> >>> Hi Laurent, >>> >>> After feeding the vtkPolyData into the vtkSplineFilter by SetInputData >>> and setting the parameters of the filter, did you try to manually update >>> the vtkSplineFilter? >>> >>> >>> >>> >>> On Tue, Jul 22, 2014 at 4:55 PM, Laurent Chauvin < >>> lchauvin at bwh.harvard.edu> wrote: >>> >>>> Hello, >>>> >>>> I created a pipeline with a vtkSplineFilter, with a polydata as input. >>>> However, now that I try to make it compatible with VTK 6, it's not >>>> working anymore. >>>> >>>> I replaced SetInput by SetInputData, and I read that SetInputData >>>> doesn't create the pipeline. That's probably why now, when I update my >>>> polydata, it's not updating the spline. >>>> But I was wondering then how should I do to keep creating the pipeline >>>> then ? >>>> >>>> I read to use SetInputConnection, but I think SetInputConnection take >>>> as argument the OutputPort of another filter, but the spline is the 'entry >>>> point' of my pipeline, taking a polydata as input, and applying some >>>> filters on it. >>>> >>>> How could I do to update the pipeline when modifying the polydata ? >>>> >>>> Thank you. >>>> -Laurent >>>> >>>> -- >>>> Laurent Chauvin, MS >>>> Surgical Navigation and Robotics Laboratory, Radiology Department >>>> Brigham And Women's Hospital, Harvard Medical School >>>> http://wiki.ncigt.org/index.php/User:Lchauvin >>>> >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ at: >>>> http://www.vtk.org/Wiki/VTK_FAQ >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://public.kitware.com/mailman/listinfo/vtkusers >>>> >>>> >>> The information in this e-mail is intended only for the person to whom >>> it is >>> addressed. If you believe this e-mail was sent to you in error and the >>> e-mail >>> contains patient information, please contact the Partners Compliance >>> HelpLine at >>> http://www.partners.org/complianceline . If the e-mail was sent to you >>> in error >>> but does not contain patient information, please contact the sender and >>> properly >>> dispose of the e-mail. >>> >> >> >> >> -- >> Laurent Chauvin, MS >> Surgical Navigation and Robotics Laboratory, Radiology Department >> Brigham And Women's Hospital, Harvard Medical School >> http://wiki.ncigt.org/index.php/User:Lchauvin >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: >> http://www.vtk.org/Wiki/VTK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> > -- Laurent Chauvin, MS Surgical Navigation and Robotics Laboratory, Radiology Department Brigham And Women's Hospital, Harvard Medical School http://wiki.ncigt.org/index.php/User:Lchauvin -------------- next part -------------- An HTML attachment was scrubbed... URL: From berk.geveci at kitware.com Tue Jul 22 20:50:22 2014 From: berk.geveci at kitware.com (Berk Geveci) Date: Tue, 22 Jul 2014 20:50:22 -0400 Subject: [vtkusers] SetInputData migration VTK 6 In-Reply-To: References: Message-ID: Ah, this is a bug but would have been in the old pipeline too. The key is that tubeFilter->GetOutput() will always return the same object (there are some exception but they require low level manipulation of tubeFilter). So during the Update(), the mrmlNode1 polydata will be modified. Furthermore, mrmlNode2 will always point to the same object. If you want to preserve the output of a filter even after it executes, you need to copy it to another object. Something like this: splineFilter->SetInputData(polydata) tubeFilter->SetInputConnection(splineFilter->GetOutputPort()) vtkPolyData* pd = vtkPolyData::New(); pd->ShallowCopy(tubeFilter->GetOutput()) mrmlNode1->SetAndObservePolyData(pd) Best, -berk On Tue, Jul 22, 2014 at 8:40 PM, Laurent Chauvin wrote: > Thank you Berk for your answer. > > My polydata is not an output of a filter, it's a stand-alone object, that > I modify myself directly. > > So what would happen if I had something like this: > > polydata = vtk.vtkPolyData() > > splineFilter->SetInputData(polydata) > tubeFilter->SetInputConnection(splineFilter->GetOutputPort()) > > mrmlNode1->SetAndObservePolyData(tubeFilter->GetOutput()) > > //modify polydata > splineFilter->Update() > tubeFilter->Update() (I don't know if this one is necessary of if Updating > splineFilter will automatically trigger an update of tubeFilter) > > mrmlNode2->SetAndObservePolyData(tubeFilter->GetOuput()) > > > My understanding was as splineFilter has been updated after getting the > output of tube filter for mrmlNode1, mrmlNode1 and mrmlNode2 should be > different. > However, it seems that it's not the case. As they both observe the output > of tubeFilter, when I update tubeFilter, it modifies polydata of mrmlNode1 > and mrmlNode2. > > Is it correct ? > > Thank you very much. > -Laurent > > > > > On Tue, Jul 22, 2014 at 8:10 PM, Berk Geveci > wrote: > >> It is correct that SetInputData() does not connect the pipeline. To be >> more specific, consider 2 examples: >> >> 1) >> >> polydata = someFilter->GetOutput(); >> >> anotherFilter->SetInputData(polydata) >> anotherFilter->Update(); >> >> someFilter->Modified(); >> anotherFilter->Update(); >> >> Update() would not propagate a pipeline request to someFilter. So the >> output of anotherFilter will not change between the 2 Update() calls. >> >> 2) >> >> polydata = giveMePolyData(); >> >> anotherFilter->SetInputData(polydata) >> anotherFilter->Update(); >> >> // modify the polydata somehow >> polydata->Modified(); >> >> anotherFilter->Update(); >> >> In this case, because the polydata changed, the second Update() will >> actually have an effect and the output of anotherFilter will change after >> the 2nd Update. >> >> >> So the change to your code will depend on the nature of "polydata". Is it >> still the output of a filter? Then you must use SetInputConnection(). >> Unfortunately, this sometimes means that you need to change function >> signatures to pass an (algorithm, port index) pair around instead of a data >> object. >> >> If polydata is a stand-alone data object that is modified directly by >> some code and as a result its mtime is updated, you can use SetInputData(). >> Keep in mind that the producer of the data object is now completely out of >> the pipeline and will not see any pipeline updates. >> >> I don't know the details of how data is stored in MRML. If you add a >> polydata to a MRML node and expect it to represent the output port of a >> filter such that you can do this: >> >> vtkMRMLModelNode->SetAndObservePolyData(vtkTubeFilter->GetOutput()) >> >> vtkTubeFilter->SetSomething(); >> >> polydata = get_MRML_node_somehow(); >> polydata->Update(); // should cause vtkTubeFilter to re-execute >> >> The MRML code will have to change to store the algorithm and output port >> index instead. There is no longer any way to get from a data object to its >> producer. In fact, vtkDataObject is now in a module (library) that doesn't >> know anything about algorithms or pipelines. >> >> Best, >> -berk >> >> >> >> >> >> >> On Tue, Jul 22, 2014 at 7:07 PM, Laurent Chauvin < >> lchauvin at bwh.harvard.edu> wrote: >> >>> Hi Sam, >>> >>> Thank you for your answer. >>> >>> Here is my pipeline (just an overview): >>> >>> vtkSplineFilter->SetInputData(polydata) >>> >>> vtkTubeFilter->SetInputConnection(vtkSplineFilter->GetOutputPort()) >>> >>> vtkMRMLModelNode->SetAndObservePolyData(vtkTubeFilter->GetOutput()) >>> >>> I would like to have one vtkMRMLModelNode with one polydata. >>> The problem if I do what you suggested, is all my vtkMRMLModelNodes are >>> gonna observe TubeFilter. So when I will modify my polydata and call >>> vtkSplineFilter->Update() and vtkTubeFilter->Update(), all my >>> vtkMRMLModelNodes will be updated, but I only want the last one to be. >>> Should I do a copy of the output of vtkTubeFilter instead ? to avoid >>> they all change when I update the TubeFilter ? >>> >>> Thank you. >>> -Laurent >>> >>> >>> >>> On Tue, Jul 22, 2014 at 7:02 PM, Sam Raby wrote: >>> >>>> Hi Laurent, >>>> >>>> After feeding the vtkPolyData into the vtkSplineFilter by SetInputData >>>> and setting the parameters of the filter, did you try to manually update >>>> the vtkSplineFilter? >>>> >>>> >>>> >>>> >>>> On Tue, Jul 22, 2014 at 4:55 PM, Laurent Chauvin < >>>> lchauvin at bwh.harvard.edu> wrote: >>>> >>>>> Hello, >>>>> >>>>> I created a pipeline with a vtkSplineFilter, with a polydata as input. >>>>> However, now that I try to make it compatible with VTK 6, it's not >>>>> working anymore. >>>>> >>>>> I replaced SetInput by SetInputData, and I read that SetInputData >>>>> doesn't create the pipeline. That's probably why now, when I update my >>>>> polydata, it's not updating the spline. >>>>> But I was wondering then how should I do to keep creating the pipeline >>>>> then ? >>>>> >>>>> I read to use SetInputConnection, but I think SetInputConnection take >>>>> as argument the OutputPort of another filter, but the spline is the 'entry >>>>> point' of my pipeline, taking a polydata as input, and applying some >>>>> filters on it. >>>>> >>>>> How could I do to update the pipeline when modifying the polydata ? >>>>> >>>>> Thank you. >>>>> -Laurent >>>>> >>>>> -- >>>>> Laurent Chauvin, MS >>>>> Surgical Navigation and Robotics Laboratory, Radiology Department >>>>> Brigham And Women's Hospital, Harvard Medical School >>>>> http://wiki.ncigt.org/index.php/User:Lchauvin >>>>> >>>>> _______________________________________________ >>>>> Powered by www.kitware.com >>>>> >>>>> Visit other Kitware open-source projects at >>>>> http://www.kitware.com/opensource/opensource.html >>>>> >>>>> Please keep messages on-topic and check the VTK FAQ at: >>>>> http://www.vtk.org/Wiki/VTK_FAQ >>>>> >>>>> Follow this link to subscribe/unsubscribe: >>>>> http://public.kitware.com/mailman/listinfo/vtkusers >>>>> >>>>> >>>> The information in this e-mail is intended only for the person to >>>> whom it is >>>> addressed. If you believe this e-mail was sent to you in error and the >>>> e-mail >>>> contains patient information, please contact the Partners Compliance >>>> HelpLine at >>>> http://www.partners.org/complianceline . If the e-mail was sent to you >>>> in error >>>> but does not contain patient information, please contact the sender and >>>> properly >>>> dispose of the e-mail. >>>> >>> >>> >>> >>> -- >>> Laurent Chauvin, MS >>> Surgical Navigation and Robotics Laboratory, Radiology Department >>> Brigham And Women's Hospital, Harvard Medical School >>> http://wiki.ncigt.org/index.php/User:Lchauvin >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: >>> http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/vtkusers >>> >>> >> > > > -- > Laurent Chauvin, MS > Surgical Navigation and Robotics Laboratory, Radiology Department > Brigham And Women's Hospital, Harvard Medical School > http://wiki.ncigt.org/index.php/User:Lchauvin > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lchauvin at bwh.harvard.edu Tue Jul 22 21:08:48 2014 From: lchauvin at bwh.harvard.edu (Laurent Chauvin) Date: Tue, 22 Jul 2014 21:08:48 -0400 Subject: [vtkusers] SetInputData migration VTK 6 In-Reply-To: References: Message-ID: Oh okay, this is what I tought. Thank you very much for your explanations. -Laurent On Tue, Jul 22, 2014 at 8:50 PM, Berk Geveci wrote: > Ah, this is a bug but would have been in the old pipeline too. The key is > that tubeFilter->GetOutput() will always return the same object (there are > some exception but they require low level manipulation of tubeFilter). So > during the Update(), the mrmlNode1 polydata will be modified. > Furthermore, mrmlNode2 will always point to the same object. If you want > to preserve the output of a filter even after it executes, you need to copy > it to another object. Something like this: > > splineFilter->SetInputData(polydata) > tubeFilter->SetInputConnection(splineFilter->GetOutputPort()) > > vtkPolyData* pd = vtkPolyData::New(); > pd->ShallowCopy(tubeFilter->GetOutput()) > mrmlNode1->SetAndObservePolyData(pd) > > Best, > -berk > > > On Tue, Jul 22, 2014 at 8:40 PM, Laurent Chauvin > wrote: > >> Thank you Berk for your answer. >> >> My polydata is not an output of a filter, it's a stand-alone object, that >> I modify myself directly. >> >> So what would happen if I had something like this: >> >> polydata = vtk.vtkPolyData() >> >> splineFilter->SetInputData(polydata) >> tubeFilter->SetInputConnection(splineFilter->GetOutputPort()) >> >> mrmlNode1->SetAndObservePolyData(tubeFilter->GetOutput()) >> >> //modify polydata >> splineFilter->Update() >> tubeFilter->Update() (I don't know if this one is necessary of if >> Updating splineFilter will automatically trigger an update of tubeFilter) >> >> mrmlNode2->SetAndObservePolyData(tubeFilter->GetOuput()) >> >> >> My understanding was as splineFilter has been updated after getting the >> output of tube filter for mrmlNode1, mrmlNode1 and mrmlNode2 should be >> different. >> However, it seems that it's not the case. As they both observe the output >> of tubeFilter, when I update tubeFilter, it modifies polydata of mrmlNode1 >> and mrmlNode2. >> >> Is it correct ? >> >> Thank you very much. >> -Laurent >> >> >> >> >> On Tue, Jul 22, 2014 at 8:10 PM, Berk Geveci >> wrote: >> >>> It is correct that SetInputData() does not connect the pipeline. To be >>> more specific, consider 2 examples: >>> >>> 1) >>> >>> polydata = someFilter->GetOutput(); >>> >>> anotherFilter->SetInputData(polydata) >>> anotherFilter->Update(); >>> >>> someFilter->Modified(); >>> anotherFilter->Update(); >>> >>> Update() would not propagate a pipeline request to someFilter. So the >>> output of anotherFilter will not change between the 2 Update() calls. >>> >>> 2) >>> >>> polydata = giveMePolyData(); >>> >>> anotherFilter->SetInputData(polydata) >>> anotherFilter->Update(); >>> >>> // modify the polydata somehow >>> polydata->Modified(); >>> >>> anotherFilter->Update(); >>> >>> In this case, because the polydata changed, the second Update() will >>> actually have an effect and the output of anotherFilter will change after >>> the 2nd Update. >>> >>> >>> So the change to your code will depend on the nature of "polydata". Is >>> it still the output of a filter? Then you must use SetInputConnection(). >>> Unfortunately, this sometimes means that you need to change function >>> signatures to pass an (algorithm, port index) pair around instead of a data >>> object. >>> >>> If polydata is a stand-alone data object that is modified directly by >>> some code and as a result its mtime is updated, you can use SetInputData(). >>> Keep in mind that the producer of the data object is now completely out of >>> the pipeline and will not see any pipeline updates. >>> >>> I don't know the details of how data is stored in MRML. If you add a >>> polydata to a MRML node and expect it to represent the output port of a >>> filter such that you can do this: >>> >>> vtkMRMLModelNode->SetAndObservePolyData(vtkTubeFilter->GetOutput()) >>> >>> vtkTubeFilter->SetSomething(); >>> >>> polydata = get_MRML_node_somehow(); >>> polydata->Update(); // should cause vtkTubeFilter to re-execute >>> >>> The MRML code will have to change to store the algorithm and output port >>> index instead. There is no longer any way to get from a data object to its >>> producer. In fact, vtkDataObject is now in a module (library) that doesn't >>> know anything about algorithms or pipelines. >>> >>> Best, >>> -berk >>> >>> >>> >>> >>> >>> >>> On Tue, Jul 22, 2014 at 7:07 PM, Laurent Chauvin < >>> lchauvin at bwh.harvard.edu> wrote: >>> >>>> Hi Sam, >>>> >>>> Thank you for your answer. >>>> >>>> Here is my pipeline (just an overview): >>>> >>>> vtkSplineFilter->SetInputData(polydata) >>>> >>>> vtkTubeFilter->SetInputConnection(vtkSplineFilter->GetOutputPort()) >>>> >>>> vtkMRMLModelNode->SetAndObservePolyData(vtkTubeFilter->GetOutput()) >>>> >>>> I would like to have one vtkMRMLModelNode with one polydata. >>>> The problem if I do what you suggested, is all my vtkMRMLModelNodes are >>>> gonna observe TubeFilter. So when I will modify my polydata and call >>>> vtkSplineFilter->Update() and vtkTubeFilter->Update(), all my >>>> vtkMRMLModelNodes will be updated, but I only want the last one to be. >>>> Should I do a copy of the output of vtkTubeFilter instead ? to avoid >>>> they all change when I update the TubeFilter ? >>>> >>>> Thank you. >>>> -Laurent >>>> >>>> >>>> >>>> On Tue, Jul 22, 2014 at 7:02 PM, Sam Raby wrote: >>>> >>>>> Hi Laurent, >>>>> >>>>> After feeding the vtkPolyData into the vtkSplineFilter by SetInputData >>>>> and setting the parameters of the filter, did you try to manually update >>>>> the vtkSplineFilter? >>>>> >>>>> >>>>> >>>>> >>>>> On Tue, Jul 22, 2014 at 4:55 PM, Laurent Chauvin < >>>>> lchauvin at bwh.harvard.edu> wrote: >>>>> >>>>>> Hello, >>>>>> >>>>>> I created a pipeline with a vtkSplineFilter, with a polydata as input. >>>>>> However, now that I try to make it compatible with VTK 6, it's not >>>>>> working anymore. >>>>>> >>>>>> I replaced SetInput by SetInputData, and I read that SetInputData >>>>>> doesn't create the pipeline. That's probably why now, when I update my >>>>>> polydata, it's not updating the spline. >>>>>> But I was wondering then how should I do to keep creating the >>>>>> pipeline then ? >>>>>> >>>>>> I read to use SetInputConnection, but I think SetInputConnection take >>>>>> as argument the OutputPort of another filter, but the spline is the 'entry >>>>>> point' of my pipeline, taking a polydata as input, and applying some >>>>>> filters on it. >>>>>> >>>>>> How could I do to update the pipeline when modifying the polydata ? >>>>>> >>>>>> Thank you. >>>>>> -Laurent >>>>>> >>>>>> -- >>>>>> Laurent Chauvin, MS >>>>>> Surgical Navigation and Robotics Laboratory, Radiology Department >>>>>> Brigham And Women's Hospital, Harvard Medical School >>>>>> http://wiki.ncigt.org/index.php/User:Lchauvin >>>>>> >>>>>> _______________________________________________ >>>>>> Powered by www.kitware.com >>>>>> >>>>>> Visit other Kitware open-source projects at >>>>>> http://www.kitware.com/opensource/opensource.html >>>>>> >>>>>> Please keep messages on-topic and check the VTK FAQ at: >>>>>> http://www.vtk.org/Wiki/VTK_FAQ >>>>>> >>>>>> Follow this link to subscribe/unsubscribe: >>>>>> http://public.kitware.com/mailman/listinfo/vtkusers >>>>>> >>>>>> >>>>> The information in this e-mail is intended only for the person to >>>>> whom it is >>>>> addressed. If you believe this e-mail was sent to you in error and the >>>>> e-mail >>>>> contains patient information, please contact the Partners Compliance >>>>> HelpLine at >>>>> http://www.partners.org/complianceline . If the e-mail was sent to >>>>> you in error >>>>> but does not contain patient information, please contact the sender >>>>> and properly >>>>> dispose of the e-mail. >>>>> >>>> >>>> >>>> >>>> -- >>>> Laurent Chauvin, MS >>>> Surgical Navigation and Robotics Laboratory, Radiology Department >>>> Brigham And Women's Hospital, Harvard Medical School >>>> http://wiki.ncigt.org/index.php/User:Lchauvin >>>> >>>> _______________________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Please keep messages on-topic and check the VTK FAQ at: >>>> http://www.vtk.org/Wiki/VTK_FAQ >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://public.kitware.com/mailman/listinfo/vtkusers >>>> >>>> >>> >> >> >> -- >> Laurent Chauvin, MS >> Surgical Navigation and Robotics Laboratory, Radiology Department >> Brigham And Women's Hospital, Harvard Medical School >> http://wiki.ncigt.org/index.php/User:Lchauvin >> > > -- Laurent Chauvin, MS Surgical Navigation and Robotics Laboratory, Radiology Department Brigham And Women's Hospital, Harvard Medical School http://wiki.ncigt.org/index.php/User:Lchauvin -------------- next part -------------- An HTML attachment was scrubbed... URL: From ich_daniel at habmalnefrage.de Wed Jul 23 03:02:47 2014 From: ich_daniel at habmalnefrage.de (-Daniel-) Date: Wed, 23 Jul 2014 00:02:47 -0700 (PDT) Subject: [vtkusers] Crash/Error by using vtkVRMLImporter with VTK6.1 In-Reply-To: <20140722155652.1653548454@mail.rogue-research.com> References: <1406022793793-5727927.post@n5.nabble.com> <20140722155652.1653548454@mail.rogue-research.com> Message-ID: <1406098967026-5727945.post@n5.nabble.com> I run my code in a debugger. My program crashes in class /vtk.vtkImporter/ in the following method / public void Read() { Read_5(); } / More can't see. -- View this message in context: http://vtk.1045678.n5.nabble.com/Crash-Error-by-using-vtkVRMLImporter-with-VTK6-1-tp5727927p5727945.html Sent from the VTK - Users mailing list archive at Nabble.com. From zhaokang.cn at gmail.com Wed Jul 23 04:34:12 2014 From: zhaokang.cn at gmail.com (Kang Zhao) Date: Wed, 23 Jul 2014 16:34:12 +0800 Subject: [vtkusers] Failed to update polydata - wxVTKRenderWindow.py Message-ID: <53CF7384.1050708@gmail.com> Hello, I wanted to update polydata after Render(). In my test, I made some changes to the original wxVTKRenderWindow.py (shipped with VTK python release), by adding a Keydown event ('x'), which calls updatePolydata() to update the polydata (wxVTKRenderWindow.srcdata). The function looks as follows. def updatePolydata(self): self.srcdata = vtk.vtkConeSource() self.srcdata.SetResolution(32) self.srcdata.Modified() self.srcdata.Update() self.Render() I expected the new "Cone" will be drawn to the screen, but it didn't happen. Did I misunderstand anything about how to update the polydata and piplines? Here is my testing environment: OS: Windows 7 (64-bit) Python: 2.7.7 (32 bit) wxPython: wxPython2.8-win32-unicode-2.8.12.1-py27.exe VTK: vtkpython-6.1.0-Windows-32bit.exe My testing script is attached. Thanks for your help in advance. Kang -------------- next part -------------- """ A simple VTK widget for wxPython. Find wxPython info at http://wxPython.org Created by David Gobbi, December 2001 Based on vtkTkRenderWindget.py Updated to new wx namespace and some cleaning by Andrea Gavana, December 2006 """ """ Please see the example at the end of this file. ---------------------------------------- Creation: wxVTKRenderWindow(parent, ID, stereo=0, [wx keywords]): You should create a wx.PySimpleApp() or some other wx**App before creating the window. ---------------------------------------- Methods: Render() AddRenderer(ren) GetRenderers() GetRenderWindow() ---------------------------------------- Methods to override (all take a wx.Event): OnButtonDown(event) default: propagate event to Left, Right, Middle OnLeftDown(event) default: set _Mode to 'Rotate' OnRightDown(event) default: set _Mode to 'Zoom' OnMiddleDown(event) default: set _Mode to 'Pan' OnButtonUp(event) default: propagate event to L, R, M and unset _Mode OnLeftUp(event) OnRightUp(event) OnMiddleUp(event) OnMotion(event) default: call appropriate handler for _Mode OnEnterWindow(event) default: set focus to this window OnLeaveWindow(event) default: release focus OnKeyDown(event) default: [R]eset, [W]irefreme, [S]olid, [P]ick OnKeyUp(event) OnChar(event) OnSetFocus(event) OnKillFocus(event) OnSize(event) OnMove(event) OnPaint(event) default: Render() ---------------------------------------- Protected Members: _Mode: Current mode: 'Rotate', 'Zoom', 'Pan' _LastX, _LastY: The (x,y) coordinates of the previous event _CurrentRenderer: The renderer that was most recently clicked in _CurrentCamera: The camera for the current renderer ---------------------------------------- Private Members: __Handle: Handle to the window containing the vtkRenderWindow """ # import usual libraries import math, os, sys import wx import vtk # a few configuration items, see what works best on your system # Use GLCanvas as base class instead of wx.Window. # This is sometimes necessary under wxGTK or the image is blank. # (in wxWindows 2.3.1 and earlier, the GLCanvas had scroll bars) baseClass = wx.Window if wx.Platform == "__WXGTK__": import wx.glcanvas baseClass = wx.glcanvas.GLCanvas # Keep capturing mouse after mouse is dragged out of window # (in wxGTK 2.3.2 there is a bug that keeps this from working, # but it is only relevant in wxGTK if there are multiple windows) _useCapture = (wx.Platform == "__WXMSW__") # end of configuration items class wxVTKRenderWindow(baseClass): """ A wxRenderWindow for wxPython. Use GetRenderWindow() to get the vtkRenderWindow. Create with the keyword stereo=1 in order to generate a stereo-capable window. """ def __init__(self, parent, ID, *args, **kw): """Default class constructor. @param parent: parent window @param ID: window id @param **kw: wxPython keywords (position, size, style) plus the 'stereo' keyword """ # miscellaneous protected variables self._CurrentRenderer = None self._CurrentCamera = None self._CurrentZoom = 1.0 self._CurrentLight = None self._ViewportCenterX = 0 self._ViewportCenterY = 0 self._Picker = vtk.vtkCellPicker() self._PickedActor = None self._PickedProperty = vtk.vtkProperty() self._PickedProperty.SetColor(1,0,0) self._PrePickedProperty = None # these record the previous mouse position self._LastX = 0 self._LastY = 0 # the current interaction mode (Rotate, Pan, Zoom, etc) self._Mode = None self._ActiveButton = None # private attributes self.__OldFocus = None # used by the LOD actors self._DesiredUpdateRate = 15 self._StillUpdateRate = 0.0001 # First do special handling of some keywords: # stereo, position, size, width, height, style stereo = 0 self.srcdata = None if kw.has_key('stereo'): if kw['stereo']: stereo = 1 del kw['stereo'] position = wx.DefaultPosition if kw.has_key('position'): position = kw['position'] del kw['position'] try: size = parent.GetSize() except AttributeError: size = wx.DefaultSize if kw.has_key('size'): size = kw['size'] del kw['size'] # wx.WANTS_CHARS says to give us e.g. TAB # wx.NO_FULL_REPAINT_ON_RESIZE cuts down resize flicker under GTK style = wx.WANTS_CHARS | wx.NO_FULL_REPAINT_ON_RESIZE if kw.has_key('style'): style = style | kw['style'] del kw['style'] # the enclosing frame must be shown under GTK or the windows # don't connect together properly l = [] p = parent while p: # make a list of all parents l.append(p) p = p.GetParent() l.reverse() # sort list into descending order for p in l: p.Show(1) # initialize the wx.Window if baseClass.__name__ == 'GLCanvas': # Set the doublebuffer attribute of the GL canvas. baseClass.__init__(self, parent, ID, position, size, style, attribList=[wx.glcanvas.WX_GL_DOUBLEBUFFER]) else: baseClass.__init__(self, parent, ID, position, size, style) # create the RenderWindow and initialize it self._RenderWindow = vtk.vtkRenderWindow() self._RenderWindow.SetSize(size.width, size.height) if stereo: self._RenderWindow.StereoCapableWindowOn() self._RenderWindow.SetStereoTypeToCrystalEyes() self.__handle = None # refresh window by doing a Render self.Bind(wx.EVT_PAINT, self.OnPaint) # turn off background erase to reduce flicker self.Bind(wx.EVT_ERASE_BACKGROUND, lambda e: None) # Bind the events to the event converters self.Bind(wx.EVT_RIGHT_DOWN, self._OnButtonDown) self.Bind(wx.EVT_LEFT_DOWN, self._OnButtonDown) self.Bind(wx.EVT_MIDDLE_DOWN, self._OnButtonDown) self.Bind(wx.EVT_RIGHT_UP, self._OnButtonUp) self.Bind(wx.EVT_LEFT_UP, self._OnButtonUp) self.Bind(wx.EVT_MIDDLE_UP, self._OnButtonUp) self.Bind(wx.EVT_MOTION, self.OnMotion) self.Bind(wx.EVT_ENTER_WINDOW, self._OnEnterWindow) self.Bind(wx.EVT_LEAVE_WINDOW, self._OnLeaveWindow) self.Bind(wx.EVT_CHAR, self.OnChar) # If we use EVT_KEY_DOWN instead of EVT_CHAR, capital versions # of all characters are always returned. EVT_CHAR also performs # other necessary keyboard-dependent translations. self.Bind(wx.EVT_CHAR, self.OnKeyDown) self.Bind(wx.EVT_KEY_UP, self.OnKeyUp) self.Bind(wx.EVT_SIZE, self._OnSize) self.Bind(wx.EVT_MOVE, self.OnMove) self.Bind(wx.EVT_SET_FOCUS, self.OnSetFocus) self.Bind(wx.EVT_KILL_FOCUS, self.OnKillFocus) def SetDesiredUpdateRate(self, rate): """Mirrors the method with the same name in vtkRenderWindowInteractor. """ self._DesiredUpdateRate = rate def GetDesiredUpdateRate(self): """Mirrors the method with the same name in vtkRenderWindowInteractor. """ return self._DesiredUpdateRate def SetStillUpdateRate(self, rate): """Mirrors the method with the same name in vtkRenderWindowInteractor. """ self._StillUpdateRate = rate def GetStillUpdateRate(self): """Mirrors the method with the same name in vtkRenderWindowInteractor. """ return self._StillUpdateRate def OnPaint(self, event): """Handles the wx.EVT_PAINT event for wxVTKRenderWindow. """ dc = wx.PaintDC(self) self.Render() def _OnSize(self, event): """Handles the wx.EVT_SIZE event for wxVTKRenderWindow. """ if wx.Platform != '__WXMSW__': width, height = event.GetSize() self._RenderWindow.SetSize(width, height) self.OnSize(event) self.Render() def OnSize(self, event): """Overridable event. """ pass def OnMove(self, event): """Overridable event. """ pass def _OnEnterWindow(self, event): """Handles the wx.EVT_ENTER_WINDOW event for wxVTKRenderWindow. """ self.UpdateRenderer(event) self.OnEnterWindow(event) def OnEnterWindow(self, event): """Overridable event. """ if self.__OldFocus == None: self.__OldFocus = wx.Window.FindFocus() self.SetFocus() def _OnLeaveWindow(self, event): """Handles the wx.EVT_LEAVE_WINDOW event for wxVTKRenderWindow. """ self.OnLeaveWindow(event) def OnLeaveWindow(self, event): """Overridable event. """ if self.__OldFocus: self.__OldFocus.SetFocus() self.__OldFocus = None def OnSetFocus(self, event): """Overridable event. """ pass def OnKillFocus(self, event): """Overridable event. """ pass def _OnButtonDown(self, event): """Handles the wx.EVT_LEFT/RIGHT/MIDDLE_DOWN events for wxVTKRenderWindow. """ # helper function for capturing mouse until button released self._RenderWindow.SetDesiredUpdateRate(self._DesiredUpdateRate) if event.RightDown(): button = "Right" elif event.LeftDown(): button = "Left" elif event.MiddleDown(): button = "Middle" else: button = None # save the button and capture mouse until the button is released if button and not self._ActiveButton: self._ActiveButton = button if _useCapture: self.CaptureMouse() self.OnButtonDown(event) def OnButtonDown(self, event): """Overridable event. """ if not self._Mode: # figure out what renderer the mouse is over self.UpdateRenderer(event) if event.LeftDown(): self.OnLeftDown(event) elif event.RightDown(): self.OnRightDown(event) elif event.MiddleDown(): self.OnMiddleDown(event) def OnLeftDown(self, event): """Overridable event. """ if not self._Mode: if event.ControlDown(): self._Mode = "Zoom" elif event.ShiftDown(): self._Mode = "Pan" else: self._Mode = "Rotate" def OnRightDown(self, event): """Overridable event. """ if not self._Mode: self._Mode = "Zoom" def OnMiddleDown(self, event): """Overridable event. """ if not self._Mode: self._Mode = "Pan" def _OnButtonUp(self, event): """Handles the wx.EVT_LEFT/RIGHT/MIDDLE_UP events for wxVTKRenderWindow. """ # helper function for releasing mouse capture self._RenderWindow.SetDesiredUpdateRate(self._StillUpdateRate) if event.RightUp(): button = "Right" elif event.LeftUp(): button = "Left" elif event.MiddleUp(): button = "Middle" else: button = None # if the ActiveButton is realeased, then release mouse capture if self._ActiveButton and button == self._ActiveButton: if _useCapture: self.ReleaseMouse() self._ActiveButton = None self.OnButtonUp(event) def OnButtonUp(self, event): """Overridable event. """ if event.LeftUp(): self.OnLeftUp(event) elif event.RightUp(): self.OnRightUp(event) elif event.MiddleUp(): self.OnMiddleUp(event) # if not interacting, then do nothing more if self._Mode: if self._CurrentRenderer: self.Render() self._Mode = None def OnLeftUp(self, event): """Overridable event. """ pass def OnRightUp(self, event): """Overridable event. """ pass def OnMiddleUp(self, event): """Overridable event. """ pass def OnMotion(self, event): """Overridable event. """ if self._Mode == "Pan": self.Pan(event) elif self._Mode == "Rotate": self.Rotate(event) elif self._Mode == "Zoom": self.Zoom(event) def OnChar(self, event): """Overridable event. """ pass def OnKeyDown(self, event): """Handles the wx.EVT_KEY_DOWN events for wxVTKRenderWindow. """ if event.GetKeyCode() == ord('r'): self.Reset(event) if event.GetKeyCode() == ord('w'): self.Wireframe() if event.GetKeyCode() == ord('s'): self.Surface() if event.GetKeyCode() == ord('p'): self.PickActor(event) if event.GetKeyCode() == ord('x'): self.updatePolydata() if event.GetKeyCode() < 256: self.OnChar(event) def OnKeyUp(self, event): """Overridable event. """ pass def GetZoomFactor(self): """Returns the current zoom factor. """ return self._CurrentZoom def GetRenderWindow(self): """Returns the render window (vtkRenderWindow). """ return self._RenderWindow def GetPicker(self): """Returns the current picker (vtkCellPicker). """ return self._Picker def Render(self): """Actually renders the VTK scene on screen. """ if self._CurrentLight: light = self._CurrentLight light.SetPosition(self._CurrentCamera.GetPosition()) light.SetFocalPoint(self._CurrentCamera.GetFocalPoint()) if not self.GetUpdateRegion().IsEmpty() or self.__handle: if self.__handle and self.__handle == self.GetHandle(): self._RenderWindow.Render() elif self.GetHandle(): # this means the user has reparented us # let's adapt to the new situation by doing the WindowRemap # dance self._RenderWindow.SetNextWindowInfo(str(self.GetHandle())) self._RenderWindow.WindowRemap() # store the new situation self.__handle = self.GetHandle() self._RenderWindow.Render() def UpdateRenderer(self, event): """ UpdateRenderer will identify the renderer under the mouse and set up _CurrentRenderer, _CurrentCamera, and _CurrentLight. """ x = event.GetX() y = event.GetY() windowX, windowY = self._RenderWindow.GetSize() renderers = self._RenderWindow.GetRenderers() numRenderers = renderers.GetNumberOfItems() self._CurrentRenderer = None renderers.InitTraversal() for i in range(0,numRenderers): renderer = renderers.GetNextItem() vx,vy = (0,0) if (windowX > 1): vx = float(x)/(windowX-1) if (windowY > 1): vy = (windowY-float(y)-1)/(windowY-1) (vpxmin,vpymin,vpxmax,vpymax) = renderer.GetViewport() if (vx >= vpxmin and vx <= vpxmax and vy >= vpymin and vy <= vpymax): self._CurrentRenderer = renderer self._ViewportCenterX = float(windowX)*(vpxmax-vpxmin)/2.0\ +vpxmin self._ViewportCenterY = float(windowY)*(vpymax-vpymin)/2.0\ +vpymin self._CurrentCamera = self._CurrentRenderer.GetActiveCamera() lights = self._CurrentRenderer.GetLights() lights.InitTraversal() self._CurrentLight = lights.GetNextItem() break self._LastX = x self._LastY = y def GetCurrentRenderer(self): """Returns the current renderer. """ return self._CurrentRenderer def Rotate(self, event): """Rotates the scene (camera). """ if self._CurrentRenderer: x = event.GetX() y = event.GetY() self._CurrentCamera.Azimuth(self._LastX - x) self._CurrentCamera.Elevation(y - self._LastY) self._CurrentCamera.OrthogonalizeViewUp() self._LastX = x self._LastY = y self._CurrentRenderer.ResetCameraClippingRange() self.Render() def Pan(self, event): """Pans the scene (camera). """ if self._CurrentRenderer: x = event.GetX() y = event.GetY() renderer = self._CurrentRenderer camera = self._CurrentCamera (pPoint0,pPoint1,pPoint2) = camera.GetPosition() (fPoint0,fPoint1,fPoint2) = camera.GetFocalPoint() if camera.GetParallelProjection(): renderer.SetWorldPoint(fPoint0,fPoint1,fPoint2,1.0) renderer.WorldToDisplay() fx,fy,fz = renderer.GetDisplayPoint() renderer.SetDisplayPoint(fx-x+self._LastX, fy+y-self._LastY, fz) renderer.DisplayToWorld() fx,fy,fz,fw = renderer.GetWorldPoint() camera.SetFocalPoint(fx,fy,fz) renderer.SetWorldPoint(pPoint0,pPoint1,pPoint2,1.0) renderer.WorldToDisplay() fx,fy,fz = renderer.GetDisplayPoint() renderer.SetDisplayPoint(fx-x+self._LastX, fy+y-self._LastY, fz) renderer.DisplayToWorld() fx,fy,fz,fw = renderer.GetWorldPoint() camera.SetPosition(fx,fy,fz) else: (fPoint0,fPoint1,fPoint2) = camera.GetFocalPoint() # Specify a point location in world coordinates renderer.SetWorldPoint(fPoint0,fPoint1,fPoint2,1.0) renderer.WorldToDisplay() # Convert world point coordinates to display coordinates dPoint = renderer.GetDisplayPoint() focalDepth = dPoint[2] aPoint0 = self._ViewportCenterX + (x - self._LastX) aPoint1 = self._ViewportCenterY - (y - self._LastY) renderer.SetDisplayPoint(aPoint0,aPoint1,focalDepth) renderer.DisplayToWorld() (rPoint0,rPoint1,rPoint2,rPoint3) = renderer.GetWorldPoint() if (rPoint3 != 0.0): rPoint0 = rPoint0/rPoint3 rPoint1 = rPoint1/rPoint3 rPoint2 = rPoint2/rPoint3 camera.SetFocalPoint((fPoint0 - rPoint0) + fPoint0, (fPoint1 - rPoint1) + fPoint1, (fPoint2 - rPoint2) + fPoint2) camera.SetPosition((fPoint0 - rPoint0) + pPoint0, (fPoint1 - rPoint1) + pPoint1, (fPoint2 - rPoint2) + pPoint2) self._LastX = x self._LastY = y self.Render() def Zoom(self, event): """Zooms the scene (camera). """ if self._CurrentRenderer: x = event.GetX() y = event.GetY() renderer = self._CurrentRenderer camera = self._CurrentCamera zoomFactor = math.pow(1.02,(0.5*(self._LastY - y))) self._CurrentZoom = self._CurrentZoom * zoomFactor if camera.GetParallelProjection(): parallelScale = camera.GetParallelScale()/zoomFactor camera.SetParallelScale(parallelScale) else: camera.Dolly(zoomFactor) renderer.ResetCameraClippingRange() self._LastX = x self._LastY = y self.Render() def Reset(self, event=None): """Resets the camera. """ if self._CurrentRenderer: self._CurrentRenderer.ResetCamera() self.Render() def Wireframe(self): """Sets the current actor representation as wireframe. """ actors = self._CurrentRenderer.GetActors() numActors = actors.GetNumberOfItems() actors.InitTraversal() for i in range(0,numActors): actor = actors.GetNextItem() actor.GetProperty().SetRepresentationToWireframe() self.Render() def Surface(self): """Sets the current actor representation as surface. """ actors = self._CurrentRenderer.GetActors() numActors = actors.GetNumberOfItems() actors.InitTraversal() for i in range(0,numActors): actor = actors.GetNextItem() actor.GetProperty().SetRepresentationToSurface() self.Render() def PickActor(self, event): """Picks an actor. """ if self._CurrentRenderer: x = event.GetX() y = event.GetY() renderer = self._CurrentRenderer picker = self._Picker windowX, windowY = self._RenderWindow.GetSize() picker.Pick(x,(windowY - y - 1),0.0,renderer) actor = picker.GetActor() if (self._PickedActor != None and self._PrePickedProperty != None): self._PickedActor.SetProperty(self._PrePickedProperty) # release hold of the property self._PrePickedProperty.UnRegister(self._PrePickedProperty) self._PrePickedProperty = None if (actor != None): self._PickedActor = actor self._PrePickedProperty = self._PickedActor.GetProperty() # hold onto the property self._PrePickedProperty.Register(self._PrePickedProperty) self._PickedActor.SetProperty(self._PickedProperty) self.Render() def updatePolydata(self): self.srcdata = vtk.vtkConeSource() self.srcdata.SetResolution(32) self.srcdata.Modified() self.srcdata.Update() self.Render() #---------------------------------------------------------------------------- def wxVTKRenderWindowConeExample(): """Like it says, just a simple example. """ # every wx app needs an app app = wx.PySimpleApp() # create the widget frame = wx.Frame(None, -1, "wxVTKRenderWindow", size=(400,400)) widget = wxVTKRenderWindow(frame, -1) ren = vtk.vtkRenderer() widget.GetRenderWindow().AddRenderer(ren) widget.srcdata = vtk.vtkConeSource() widget.srcdata.SetResolution(8) coneMapper = vtk.vtkPolyDataMapper() coneMapper.SetInputConnection(widget.srcdata.GetOutputPort()) coneActor = vtk.vtkActor() coneActor.SetMapper(coneMapper) ren.AddActor(coneActor) # show the window frame.Show() app.MainLoop() if __name__ == "__main__": wxVTKRenderWindowConeExample() From grothausmann.roman at mh-hannover.de Wed Jul 23 04:37:30 2014 From: grothausmann.roman at mh-hannover.de (Dr. Roman Grothausmann) Date: Wed, 23 Jul 2014 10:37:30 +0200 Subject: [vtkusers] special field-data annotation filter or similar functionality In-Reply-To: <53C7A720.3070701@mh-hannover.de> References: <53C7A720.3070701@mh-hannover.de> Message-ID: <53CF744A.5020002@mh-hannover.de> Dear mailing list members, Is there already a filter as described below that I've missed to find? If not, any recommendation how to start implementing such filter? Kind regards Roman On 17/07/14 12:36, Dr. Roman Grothausmann wrote: > Dear mailing list members, > > > Is there a filter in paraview that allows one to display specific field-data > (e.g. of points or cells) at the 3D position of the corresponding point/cell in > such a way that the annotation is hidden if some mesh or voxel object is in > front? Or if the objects in front have some transparency the annotations are > only visible as much as the transparency of the objects in front dictates? > I know about the possibility of displaying selection labels via the Find-Dialog. > However these annotations are > - always in front, > - cannot be made partially transparent (as I think was possible in older > paraview versions than 4.1.0 when vtkVectorText was used) and > - only the active selection can be annotated, ie not multiple datasets. > > I found this example in which the text is not always rendered in front of the axes: > https://github.com/Kitware/VTK/blob/master/Examples/Annotation/Python/textOrigin.py > However it uses vtkVectorText (which is not exportable as text into e.g. SVGs > however vtkTextActor3D is). > I now wonder if only vtkVectorText allows being hidden by other objects or if > some settings of vtkTextActor3D are not offered for adjustment in the Find-Dialog? > In any case a paraview filter that would offer all 3 features mentioned above > would be really helpful. Are there any reasons that such a filter cannot be > implemented in paraview at the present state? > Can such functionality be implemented in general with the current state of VTK? > > Any help or hints are very much appreciated > Roman > -- Dr. Roman Grothausmann Tomographie und Digitale Bildverarbeitung Tomography and Digital Image Analysis Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 Medizinische Hochschule Hannover Carl-Neuberg-Str. 1 D-30625 Hannover Tel. +49 511 532-9574 From sebastien.jourdain at kitware.com Wed Jul 23 09:34:23 2014 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Wed, 23 Jul 2014 07:34:23 -0600 Subject: [vtkusers] Crash/Error by using vtkVRMLImporter with VTK6.1 In-Reply-To: <1406098967026-5727945.post@n5.nabble.com> References: <1406022793793-5727927.post@n5.nabble.com> <20140722155652.1653548454@mail.rogue-research.com> <1406098967026-5727945.post@n5.nabble.com> Message-ID: is it a valid file? On Wed, Jul 23, 2014 at 1:02 AM, -Daniel- wrote: > I run my code in a debugger. My program crashes in class /vtk.vtkImporter/ > in > the following method > / > public void Read() > { Read_5(); } > / > More can't see. > > > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Crash-Error-by-using-vtkVRMLImporter-with-VTK6-1-tp5727927p5727945.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ich_daniel at habmalnefrage.de Wed Jul 23 10:19:23 2014 From: ich_daniel at habmalnefrage.de (-Daniel-) Date: Wed, 23 Jul 2014 07:19:23 -0700 (PDT) Subject: [vtkusers] Crash/Error by using vtkVRMLImporter with VTK6.1 In-Reply-To: References: <1406022793793-5727927.post@n5.nabble.com> <20140722155652.1653548454@mail.rogue-research.com> <1406098967026-5727945.post@n5.nabble.com> Message-ID: <1406125163222-5727950.post@n5.nabble.com> The vrml-files? yes. This files work with vtk 6.0 without crashes. The vtk-files for using with java was created by cmake and visual studio. -- View this message in context: http://vtk.1045678.n5.nabble.com/Crash-Error-by-using-vtkVRMLImporter-with-VTK6-1-tp5727927p5727950.html Sent from the VTK - Users mailing list archive at Nabble.com. From vtk at a-cunningham.com Wed Jul 23 19:45:23 2014 From: vtk at a-cunningham.com (ACU) Date: Wed, 23 Jul 2014 16:45:23 -0700 (PDT) Subject: [vtkusers] vtk6.1/vtkChartXYZ mixing with 3D and OpenGL errors Message-ID: <1406159123745-5727951.post@n5.nabble.com> I am trying to mix vtkChartXYZ into a "3D" scene. I use as an example this test case that uses vtkChartXY https://github.com/Kitware/VTK/blob/master/Charts/Core/Testing/Cxx/TestChartsOn3D.cxx This test case works fine. When I replace vtkChartXY in the above test example with a vtkChartXYZ (filled with meaningful data), I get the OpenGL error vtkOpenGL2ContextDevice2D (0000000001D8B1C0): failed after PopMatrix 1 OpenGL errors detected 0 : (1284) Stack underflow You may ask why I am trying to do this. I am trying to create a spectrogram plot using a vtkChartXYZ with a ScalarBarActor in the scene. -- View this message in context: http://vtk.1045678.n5.nabble.com/vtk6-1-vtkChartXYZ-mixing-with-3D-and-OpenGL-errors-tp5727951.html Sent from the VTK - Users mailing list archive at Nabble.com. From vtk at a-cunningham.com Wed Jul 23 21:01:31 2014 From: vtk at a-cunningham.com (ACU) Date: Wed, 23 Jul 2014 18:01:31 -0700 (PDT) Subject: [vtkusers] vtk6.1/vtkChartXYZ mixing with 3D and OpenGL errors In-Reply-To: <1406159123745-5727951.post@n5.nabble.com> References: <1406159123745-5727951.post@n5.nabble.com> Message-ID: <1406163691083-5727952.post@n5.nabble.com> Regarding this issue... By inspection this appears to be an issue in vtkChartXYZ::DrawTickMarks The PopMatrix() calls below is not matched by a a PushMatrix() under certain conditions. The code is just not robust. void vtkChartXYZ::DrawTickMarks(vtkContext2D *painter) { vtkContext3D *context = painter->GetContext3D(); float bounds[4]; // draw points instead of lines context->ApplyPen(this->Pen.GetPointer()); // treat each axis separately for (int axis = 0; axis < 3; ++axis) { // pop matrix since we'll be drawing text in 2D before we draw the // actual tick marks context->PopMatrix(); .... if (tickSpacing == -1) { continue; } -- View this message in context: http://vtk.1045678.n5.nabble.com/vtk6-1-vtkChartXYZ-mixing-with-3D-and-OpenGL-errors-tp5727951p5727952.html Sent from the VTK - Users mailing list archive at Nabble.com. From vtk at a-cunningham.com Wed Jul 23 22:02:06 2014 From: vtk at a-cunningham.com (ACU) Date: Wed, 23 Jul 2014 19:02:06 -0700 (PDT) Subject: [vtkusers] vtk6.1/vtkChartXYZ mixing with 3D and OpenGL errors In-Reply-To: <1406163691083-5727952.post@n5.nabble.com> References: <1406159123745-5727951.post@n5.nabble.com> <1406163691083-5727952.post@n5.nabble.com> Message-ID: <1406167326951-5727953.post@n5.nabble.com> Further on this issue. The fix is make sure the Pop/Push is balanced correctly. tickSpacing==-1 is not actually an error condition. if (tickSpacing == -1) { context->PushMatrix(); continue; } -- View this message in context: http://vtk.1045678.n5.nabble.com/vtk6-1-vtkChartXYZ-mixing-with-3D-and-OpenGL-errors-tp5727951p5727953.html Sent from the VTK - Users mailing list archive at Nabble.com. From tottek at gmail.com Thu Jul 24 04:04:08 2014 From: tottek at gmail.com (Totte Karlsson) Date: Thu, 24 Jul 2014 01:04:08 -0700 (PDT) Subject: [vtkusers] 5.10 and maverick ? Message-ID: <1406189048777-5727954.post@n5.nabble.com> Hi, I have tried to use vtk 5.10 working in OSX maverick, but are having problems. I can get the libraries compiling and linking and installing. However, when I try to open a vtk window, I get a blank white window and two messages. Running an example, the 'Cube' for example give the output 2014-07-24 00:59:53:326 Cube[24232:507] invalid pixel format 2014-07-24 00:59:53:326 Cube[24232:507] invalid context I have looked at some threads mentioning maverick problems with 5.10, but can't find the fix. -totte -- View this message in context: http://vtk.1045678.n5.nabble.com/5-10-and-maverick-tp5727954.html Sent from the VTK - Users mailing list archive at Nabble.com. From vpai at g.clemson.edu Thu Jul 24 11:53:50 2014 From: vpai at g.clemson.edu (vipulraikar) Date: Thu, 24 Jul 2014 08:53:50 -0700 (PDT) Subject: [vtkusers] Issues with using vtkSmartVolumeMapper. Message-ID: <1406217230762-5727955.post@n5.nabble.com> Hello Everybody, I am currently working on some volume rendering and using vtk.6.1.0. I am aware that since vtk 6.0 the need to init factories for modules. I have done the same. I am having issues when I am trying to create a new instance of vtkSmartVolumeMapper. It returns the following error: Generic Warning: In V:\Research\code\libsrc\VTK-6.1.0\Rendering\Volume\vtkRayCastImageDisplayHelper.cxx, line 20 Error: no override found for 'vtkRayCastImageDisplayHelper' On further investigation I gather that this call is returning a NULL. this->ImageDisplayHelper = vtkRayCastImageDisplayHelper::New(); (in vtkFixedPointVolumeRayCastMapper.cxx, Ln 716) Am I missing something? Is there any other module that needs to be initialized? (other than the following) VTK_MODULE_INIT(vtkRenderingOpenGL); VTK_MODULE_INIT(vtkInteractionStyle); VTK_MODULE_INIT(vtkRenderingFreeType); VTK_MODULE_INIT(vtkRenderingFreeTypeOpenGL); Any help/direction/thoughts would be greatly appreciated. :) best regards, Vipul -- View this message in context: http://vtk.1045678.n5.nabble.com/Issues-with-using-vtkSmartVolumeMapper-tp5727955.html Sent from the VTK - Users mailing list archive at Nabble.com. From bill.lorensen at gmail.com Thu Jul 24 12:05:10 2014 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Thu, 24 Jul 2014 12:05:10 -0400 Subject: [vtkusers] Issues with using vtkSmartVolumeMapper. In-Reply-To: <1406217230762-5727955.post@n5.nabble.com> References: <1406217230762-5727955.post@n5.nabble.com> Message-ID: Maybe you need: VTK_MODULE_INIT(vtkRenderingVolumeOpenGL); On Thu, Jul 24, 2014 at 11:53 AM, vipulraikar wrote: > Hello Everybody, > > I am currently working on some volume rendering and using vtk.6.1.0. I am > aware that since vtk 6.0 the need to init factories for modules. I have done > the same. > I am having issues when I am trying to create a new instance of > vtkSmartVolumeMapper. It returns the following error: > > Generic Warning: In > V:\Research\code\libsrc\VTK-6.1.0\Rendering\Volume\vtkRayCastImageDisplayHelper.cxx, > line 20 > Error: no override found for 'vtkRayCastImageDisplayHelper' > > On further investigation I gather that this call is returning a NULL. > > this->ImageDisplayHelper = vtkRayCastImageDisplayHelper::New(); (in > vtkFixedPointVolumeRayCastMapper.cxx, Ln 716) > > Am I missing something? Is there any other module that needs to be > initialized? (other than the following) > > VTK_MODULE_INIT(vtkRenderingOpenGL); > VTK_MODULE_INIT(vtkInteractionStyle); > VTK_MODULE_INIT(vtkRenderingFreeType); > VTK_MODULE_INIT(vtkRenderingFreeTypeOpenGL); > > Any help/direction/thoughts would be greatly appreciated. :) > > best regards, > > Vipul > > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/Issues-with-using-vtkSmartVolumeMapper-tp5727955.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -- Unpaid intern in BillsBasement at noware dot com From vpai at g.clemson.edu Thu Jul 24 12:13:58 2014 From: vpai at g.clemson.edu (vipulraikar) Date: Thu, 24 Jul 2014 09:13:58 -0700 (PDT) Subject: [vtkusers] Issues with using vtkSmartVolumeMapper. In-Reply-To: References: <1406217230762-5727955.post@n5.nabble.com> Message-ID: <1406218438851-5727957.post@n5.nabble.com> Hi Bill, Thanks for the quick reply. I actually had tried that, with no success. Infact it throws a linker error. (error LNK2019: unresolved external symbol "void __cdecl vtkRenderingVolumeOpenGL_AutoInit_Construct(void)" (?vtkRenderingVolumeOpenGL_AutoInit_Construct@@YAXXZ) referenced in function "public: __thiscall vtkRenderingVolumeOpenGL_ModuleInit::vtkRenderingVolumeOpenGL_ModuleInit(void)" (??0vtkRenderingVolumeOpenGL_ModuleInit@@QAE at XZ)) Just to be clearer (I should have mentioned earlier, if its not obvious already), I am working in VS2012. -- View this message in context: http://vtk.1045678.n5.nabble.com/Issues-with-using-vtkSmartVolumeMapper-tp5727955p5727957.html Sent from the VTK - Users mailing list archive at Nabble.com. From bill.lorensen at gmail.com Thu Jul 24 12:40:24 2014 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Thu, 24 Jul 2014 12:40:24 -0400 Subject: [vtkusers] Issues with using vtkSmartVolumeMapper. In-Reply-To: <1406218438851-5727957.post@n5.nabble.com> References: <1406217230762-5727955.post@n5.nabble.com> <1406218438851-5727957.post@n5.nabble.com> Message-ID: You will need to include the vtkRenderingVolumeOpenGL library when you build your app. If you use cmake to configure your project, you will avoid all of these issues. Bill On Thu, Jul 24, 2014 at 12:13 PM, vipulraikar wrote: > Hi Bill, > > Thanks for the quick reply. I actually had tried that, with no success. > Infact it throws a linker error. > > (error LNK2019: unresolved external symbol "void __cdecl > vtkRenderingVolumeOpenGL_AutoInit_Construct(void)" > (?vtkRenderingVolumeOpenGL_AutoInit_Construct@@YAXXZ) referenced in function > "public: __thiscall > vtkRenderingVolumeOpenGL_ModuleInit::vtkRenderingVolumeOpenGL_ModuleInit(void)" > (??0vtkRenderingVolumeOpenGL_ModuleInit@@QAE at XZ)) > > Just to be clearer (I should have mentioned earlier, if its not obvious > already), I am working in VS2012. > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/Issues-with-using-vtkSmartVolumeMapper-tp5727955p5727957.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -- Unpaid intern in BillsBasement at noware dot com From vpai at g.clemson.edu Thu Jul 24 12:48:22 2014 From: vpai at g.clemson.edu (vipulraikar) Date: Thu, 24 Jul 2014 09:48:22 -0700 (PDT) Subject: [vtkusers] Issues with using vtkSmartVolumeMapper. In-Reply-To: References: <1406217230762-5727955.post@n5.nabble.com> <1406218438851-5727957.post@n5.nabble.com> Message-ID: <1406220502036-5727959.post@n5.nabble.com> Aah, thank you so much Bill. Interestingly for some reason when I built vtk and then installed it to the destination folder, the library for vtkVolumeRenderOpenGL was never installed. I was assuming all my .libs were in order in the Linker additional dependencies. (Assumptions are bad). Thank you again. Regards, Vipul -- View this message in context: http://vtk.1045678.n5.nabble.com/Issues-with-using-vtkSmartVolumeMapper-tp5727955p5727959.html Sent from the VTK - Users mailing list archive at Nabble.com. From aashish.chaudhary at kitware.com Thu Jul 24 13:14:09 2014 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Thu, 24 Jul 2014 13:14:09 -0400 Subject: [vtkusers] Issues with using vtkSmartVolumeMapper. In-Reply-To: <1406220502036-5727959.post@n5.nabble.com> References: <1406217230762-5727955.post@n5.nabble.com> <1406218438851-5727957.post@n5.nabble.com> <1406220502036-5727959.post@n5.nabble.com> Message-ID: It is possible that install rules are broken for volume opengl since most of the time we do testing using the build tree. I will have a look at it if no one else volunteers for it. - Aashish On Thu, Jul 24, 2014 at 12:48 PM, vipulraikar wrote: > Aah, thank you so much Bill. Interestingly for some reason when I built vtk > and then installed it to the destination folder, the library for > vtkVolumeRenderOpenGL was never installed. I was assuming all my .libs were > in order in the Linker additional dependencies. (Assumptions are bad). > > Thank you again. > > Regards, > > Vipul > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/Issues-with-using-vtkSmartVolumeMapper-tp5727955p5727959.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -- *| Aashish Chaudhary | Technical Leader | Kitware Inc. * *| http://www.kitware.com/company/team/chaudhary.html * -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.bogle at auckland.ac.nz Fri Jul 25 01:58:20 2014 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Fri, 25 Jul 2014 05:58:20 +0000 Subject: [vtkusers] Animation problem Message-ID: Hi, I'm trying to implement an animation program, basing it closely (I think) on this example: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/Animation Apparently I'm missing something because my program renders my actor correctly in the main program, but the code in the timer callback does not change what is being rendered. The main program and the callback function are shown below. The relevant part of the callback code that does not lead to a modified actor being rendered is this: strips->Initialize(); MakeTube(nd, nstrips, dtheta, points, strips); polydata->Reset(); polydata->SetPoints(points); polydata->SetStrips(strips); mapper->RemoveAllInputs(); mapper->SetInput(polydata); actor->SetMapper(mapper); mapper->Update(); vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::SafeDownCast(caller); iren->GetRenderWindow()->Render(); As you can see, I have been flailing around, trying various likely possibilities, revealing my obvious lack of understanding. Initially I thought it would be sufficient to just change 'points' and 'strips', then I thought I should repopulate polydata, then... class vtkTimerCallback2 : public vtkCommand { public: static vtkTimerCallback2 *New() { vtkTimerCallback2 *cb = new vtkTimerCallback2; cb->TimerCount = 0; return cb; } virtual void Execute(vtkObject *caller, unsigned long eventId, void * vtkNotUsed(callData)) { if (vtkCommand::TimerEvent == eventId) { ++this->TimerCount; } std::cout << this->TimerCount << std::endl; // actor->SetPosition(this->TimerCount/10., this->TimerCount/10.,0.); dtheta = new double[nstrips]; for (int i=0; iInitialize(); MakeTube(nd, nstrips, dtheta, points, strips); polydata->Reset(); polydata->SetPoints(points); polydata->SetStrips(strips); mapper->RemoveAllInputs(); mapper->SetInput(polydata); actor->SetMapper(mapper); mapper->Update(); vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::SafeDownCast(caller); iren->GetRenderWindow()->Render(); } private: int TimerCount; double *dtheta; public: int nd; int nstrips; vtkPolyData *polydata; vtkCellArray *strips; vtkPoints *points; vtkDataSetMapper *mapper; vtkActor* actor; }; int main(int argc, char *argv[]) { int nd = 20; int nstrips = 4; double *dtheta; PI = 4*atan(1.0); vtkSmartPointer polydata = vtkSmartPointer::New(); vtkSmartPointer strips = vtkSmartPointer::New(); vtkSmartPointer points = vtkSmartPointer::New(); // we want just one big array of points points->SetNumberOfPoints(nd*(nstrips+1)); strips->SetNumberOfCells(nstrips); dtheta = new double[nstrips]; dthetafinal = new double[nstrips]; for (int i=0; iSetPoints(points); polydata->SetStrips(strips); // Create an actor and mapper vtkSmartPointer mapper = vtkSmartPointer::New(); #if VTK_MAJOR_VERSION <= 5 mapper->SetInput(polydata); #else mapper->SetInputData(polydata); #endif vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); // Create a renderer, render window, and interactor vtkSmartPointer renderer = vtkSmartPointer::New(); vtkSmartPointer renderWindow = vtkSmartPointer::New(); renderWindow->AddRenderer(renderer); vtkSmartPointer renderWindowInteractor = vtkSmartPointer::New(); renderWindowInteractor->SetRenderWindow(renderWindow); renderer->AddActor(actor); renderWindow->Render(); // Initialize must be called prior to creating timer events. renderWindowInteractor->Initialize(); // Sign up to receive TimerEvent vtkSmartPointer cb = vtkSmartPointer::New(); cb->actor = actor; cb->nd = nd; cb->nstrips = nstrips; cb->points = points; cb->strips = strips; cb->polydata = polydata; cb->mapper = mapper; renderWindowInteractor->AddObserver(vtkCommand::TimerEvent, cb); int timerId = renderWindowInteractor->CreateRepeatingTimer(1000); std::cout << "timerId: " << timerId << std::endl; renderWindowInteractor->Start(); return EXIT_SUCCESS; } -------------- next part -------------- An HTML attachment was scrubbed... URL: From Mike.Taverne at bristol.ac.uk Fri Jul 25 12:59:59 2014 From: Mike.Taverne at bristol.ac.uk (Mike Taverne) Date: Fri, 25 Jul 2014 17:59:59 +0100 Subject: [vtkusers] Unable to change the color of a contoursurface made from sampling an implicit sphere function Message-ID: <53D28D0F.4060200@bristol.ac.uk> Hi, I have some strange VTK rendering problems. The attached code should create one blue sphere via: vtkSphereSource -> vtkPolyDataMapper And one green sphere via: vtkSphere -> vtkSampleFunction -> vtkContourFilter -> vtkPolyDataMapper But for some reason, the second sphere, created via a contour filter, always renders completely in black on the outside and red on the inside. How can I get the second sphere to be colored? I originally noticed that problem while trying out the iceCream.py example and have the same issue with C++ versions of the code. Version info: -Python 2.7.6 -vtk version 6.1.0 OS: -Ubuntu 14.04.1 LTS Also attaching glxinfo output. Regards, Mike -------------- next part -------------- A non-text attachment was scrubbed... Name: color_bug3.png Type: image/png Size: 24632 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: color_bug.py Type: text/x-python Size: 2190 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: glxinfo.log Type: text/x-log Size: 39290 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 884 bytes Desc: OpenPGP digital signature URL: From Mike.Taverne at bristol.ac.uk Fri Jul 25 14:37:40 2014 From: Mike.Taverne at bristol.ac.uk (Mike Taverne) Date: Fri, 25 Jul 2014 19:37:40 +0100 Subject: [vtkusers] Unable to change the color of a contoursurface made from sampling an implicit sphere function In-Reply-To: <53D28D0F.4060200@bristol.ac.uk> References: <53D28D0F.4060200@bristol.ac.uk> Message-ID: Ok, I have partially solved my problem. Running the same script on another computer, I get a completely red sphere (inside and outside). And by adding "sphere_mapper.ScalarVisibilityOff()", I now get the expected green sphere. I will try on the previous computer again as soon as I can, but I suspect it won't work or I will only get a green inside (since I had tried changing the scalar visibility setting before without success). So it seems to be some sort of graphics driver issue, although I don't understand why normal polydata objects render without issues, but one created via contouring/sampling does not. Any tips on solving the rendering issue would still be appreciated... Are there maybe any rendering/shading settings I can use to work around it? 2014-07-25 17:59 GMT+01:00 Mike Taverne : > Hi, > > I have some strange VTK rendering problems. > > The attached code should create one blue sphere via: > vtkSphereSource -> vtkPolyDataMapper > > And one green sphere via: > vtkSphere -> vtkSampleFunction -> vtkContourFilter -> vtkPolyDataMapper > > But for some reason, the second sphere, created via a contour filter, > always renders completely in black on the outside and red on the inside. > > > How can I get the second sphere to be colored? > > I originally noticed that problem while trying out the iceCream.py > example and have the same issue with C++ versions of the code. > > > Version info: > -Python 2.7.6 > -vtk version 6.1.0 > > OS: > -Ubuntu 14.04.1 LTS > > Also attaching glxinfo output. > > > Regards, > Mike > -------------- next part -------------- An HTML attachment was scrubbed... URL: From waldo.valenzuela at hotmail.com Fri Jul 25 15:17:59 2014 From: waldo.valenzuela at hotmail.com (Waldo Valenzuela) Date: Fri, 25 Jul 2014 21:17:59 +0200 Subject: [vtkusers] CMake problem (VTK 6.1 - Qt 5.3) In-Reply-To: <53D265C7.6010209@vektore.com> References: <53CE5884.2080505@vektore.com> <53D265C7.6010209@vektore.com> Message-ID: Hi Luis, That is unusual, anyway, do you compiled qt?, In my case I compiled QT 5.3.1 and after VTK 6.1 and I had not problem, with visual studio 2010. The first thing that have the first time that compile vtk with qt module is that I have to change the flag to qt 5 and erase the flags of qt 4, and then I configure again, and is ready. if you want, send me a screenshot of cmake. Cheers, Waldo On 25 Jul 2014, at 16:12, Luis Vieira wrote: > Tks. I did. However, CMake still try to find QT 4 as follow erro message: > > CMake Error at C:/Program Files > (x86)/CMake/share/cmake-3.0/Modules/FindQt4.cmake:621 (message): > > Could NOT find QtCore. Check > > C:/VTK/bin/msvc2013_64_opengl/CMakeFiles/CMakeError.log for more > details. > > Call Stack (most recent call first): > > GUISupport/Qt/CMakeLists.txt:68 (find_package) > > > On 7/22/14 2:34 PM, Waldo Valenzuela wrote: >> Hi Luis, >> >> to compile qt 5 or superior with vtk 6, you need to set as well VTK_QT_VERSION = 5, in cmake. >> >> Cheers, >> >> Waldo. >> >> >> >> On 22 Jul 2014, at 14:26, Luis Vieira wrote: >> >>> >>> Hello, We hope this email find you well. >>> >>> We have the >>> follow CMake - VTK - Visual Studio 2013 >>> Configuration: >>> >>> ? Visual >>> Studio 2013 opengl +64; >>> >>> ? CMake >>> 3.0; >>> >>> ? VTK-6.1.0. >>> >>> CMake >>> configurated the following paths: >>> >>> ? C:\Program >>> >>> Files\VTK (Debug); >>> >>> ? C:\Program >>> >>> Files\VTK (Release); >>> >>> ? C:\VTK\build; >>> >>> ? C:\VTK\Data. >>> >>> >>> >>> >>> >>> The environment >>> stated above works very well. However, we >>> need to provide/enable the same >>> configuration between VTK and QT >>> Enterprise Creator 5.3. We used >>> CMake 3.0 to configure the linkage between >>> QT 5.3 and VTK - 6.1.0. >>> >>> The following >>> variables were configured in CMake: >>> >>> ? VTK_Group_Qt:BOOL=ON; >>> >>> ? QT_QMAKE_EXECUTABLE:FILEPATH=C:/Qt/Qt5.3.1/5.3/msvc2013_64_opengl/bin/qmake.exe. >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> Despite of the above >>> configuration, CMake presents this error >>> message: >>> >>> >>> >>> CMake Warning >>> at C:/Program Files >>> (x86)/CMake/share/cmake-3.0/Modules/FindQt4.cmake:616 >>> (message): >>> C:/Qt/Qt5.3.1/5.3/msvc2013_64_opengl/bin/qmake.exe >>> reported QT_INSTALL_LIBS as >>> >>> "C:/Qt/Qt5.3.1/5.3/msvc2013_64_opengl/lib" >>> but QtCore could not be found >>> there. Qt is NOT installed >>> correctly for the target build >>> environment. Call Stack (most >>> recent call first): >>> GUISupport/Qt/CMakeLists.txt:68 >>> (find_package) >>> >>> >>> CMake Error at >>> C:/Program Files >>> (x86)/CMake/share/cmake-3.0/Modules/FindQt4.cmake:621 >>> (message): Could >>> NOT find QtCore. Check >>> C:/VTK/bin/msvc2013_64_opengl/CMakeFiles/CMakeError.log >>> for more details. >>> Call Stack (most recent call first): >>> GUISupport/Qt/CMakeLists.txt:68 >>> (find_package) >>> >>> >>> >>> >>> Could you guys please advise me on how to properly set up the programming environment in which CMake will build the bridge amongst the VSC++ OpenGL +64, VTK 6.1.0 and QT 5.3? What are our options to direct CMake to recognize QT5.3? The way it is now it only recognizes QT4.0. >>> >>> >>> Thank you so much. >>> >>> >>> >>> >>> >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >>> >>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/vtkusers >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.bogle at auckland.ac.nz Fri Jul 25 20:29:47 2014 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Sat, 26 Jul 2014 00:29:47 +0000 Subject: [vtkusers] Animation problem In-Reply-To: References: Message-ID: I have narrowed down my problem somewhat, and discovered that it is not strictly related to the time callback. The following code fragment illustrates the point. I create a shape in polydata and render it, then change the shape and try to render it again. With this code I see only the first shape. If I comment out the first renderWindow->Render() then I see the second shape. Using the timer callback does effectively what this code does, successively modifying and re-rendering the shape, i.e. repeating the three lines of code concerning the second shape. What do I need to do to ensure that both renders have effect? (Of course with this piece of code I will not see the first render unless I insert a delay.) // This creates the first shape (straight) MakeTube(nd, nstrips, dtheta1, points, strips); polydata->SetPoints(points); polydata->SetStrips(strips); // Create an actor and mapper vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInput(polydata); vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); renderer->AddActor(actor); renderWindow->Render(); // <<< remove this and the second shape is rendered // This creates the second shape (curved) strips->Initialize(); MakeTube(nd, nstrips, dtheta2, points, strips); renderWindow->Render(); renderWindowInteractor->Start(); ________________________________ From: vtkusers [vtkusers-bounces at vtk.org] on behalf of Gib Bogle [g.bogle at auckland.ac.nz] Sent: Friday, 25 July 2014 5:58 p.m. To: vtkusers at vtk.org Subject: [vtkusers] Animation problem Hi, I'm trying to implement an animation program, basing it closely (I think) on this example: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/Animation Apparently I'm missing something because my program renders my actor correctly in the main program, but the code in the timer callback does not change what is being rendered. The main program and the callback function are shown below. The relevant part of the callback code that does not lead to a modified actor being rendered is this: strips->Initialize(); MakeTube(nd, nstrips, dtheta, points, strips); polydata->Reset(); polydata->SetPoints(points); polydata->SetStrips(strips); mapper->RemoveAllInputs(); mapper->SetInput(polydata); actor->SetMapper(mapper); mapper->Update(); vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::SafeDownCast(caller); iren->GetRenderWindow()->Render(); As you can see, I have been flailing around, trying various likely possibilities, revealing my obvious lack of understanding. Initially I thought it would be sufficient to just change 'points' and 'strips', then I thought I should repopulate polydata, then... class vtkTimerCallback2 : public vtkCommand { public: static vtkTimerCallback2 *New() { vtkTimerCallback2 *cb = new vtkTimerCallback2; cb->TimerCount = 0; return cb; } virtual void Execute(vtkObject *caller, unsigned long eventId, void * vtkNotUsed(callData)) { if (vtkCommand::TimerEvent == eventId) { ++this->TimerCount; } std::cout << this->TimerCount << std::endl; // actor->SetPosition(this->TimerCount/10., this->TimerCount/10.,0.); dtheta = new double[nstrips]; for (int i=0; iInitialize(); MakeTube(nd, nstrips, dtheta, points, strips); polydata->Reset(); polydata->SetPoints(points); polydata->SetStrips(strips); mapper->RemoveAllInputs(); mapper->SetInput(polydata); actor->SetMapper(mapper); mapper->Update(); vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::SafeDownCast(caller); iren->GetRenderWindow()->Render(); } private: int TimerCount; double *dtheta; public: int nd; int nstrips; vtkPolyData *polydata; vtkCellArray *strips; vtkPoints *points; vtkDataSetMapper *mapper; vtkActor* actor; }; int main(int argc, char *argv[]) { int nd = 20; int nstrips = 4; double *dtheta; PI = 4*atan(1.0); vtkSmartPointer polydata = vtkSmartPointer::New(); vtkSmartPointer strips = vtkSmartPointer::New(); vtkSmartPointer points = vtkSmartPointer::New(); // we want just one big array of points points->SetNumberOfPoints(nd*(nstrips+1)); strips->SetNumberOfCells(nstrips); dtheta = new double[nstrips]; dthetafinal = new double[nstrips]; for (int i=0; iSetPoints(points); polydata->SetStrips(strips); // Create an actor and mapper vtkSmartPointer mapper = vtkSmartPointer::New(); #if VTK_MAJOR_VERSION <= 5 mapper->SetInput(polydata); #else mapper->SetInputData(polydata); #endif vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); // Create a renderer, render window, and interactor vtkSmartPointer renderer = vtkSmartPointer::New(); vtkSmartPointer renderWindow = vtkSmartPointer::New(); renderWindow->AddRenderer(renderer); vtkSmartPointer renderWindowInteractor = vtkSmartPointer::New(); renderWindowInteractor->SetRenderWindow(renderWindow); renderer->AddActor(actor); renderWindow->Render(); // Initialize must be called prior to creating timer events. renderWindowInteractor->Initialize(); // Sign up to receive TimerEvent vtkSmartPointer cb = vtkSmartPointer::New(); cb->actor = actor; cb->nd = nd; cb->nstrips = nstrips; cb->points = points; cb->strips = strips; cb->polydata = polydata; cb->mapper = mapper; renderWindowInteractor->AddObserver(vtkCommand::TimerEvent, cb); int timerId = renderWindowInteractor->CreateRepeatingTimer(1000); std::cout << "timerId: " << timerId << std::endl; renderWindowInteractor->Start(); return EXIT_SUCCESS; } -------------- next part -------------- An HTML attachment was scrubbed... URL: From kim.rosenbohm at posteo.de Sat Jul 26 07:38:16 2014 From: kim.rosenbohm at posteo.de (Kim Rosenbohm) Date: Sat, 26 Jul 2014 13:38:16 +0200 Subject: [vtkusers] Display only ONE GridPoly per axis in a CubeAxesActor Message-ID: <53D39328.7020309@posteo.de> Hi All. I want to display the axes to a plot in a fashion so that the scales are always behind/below the plot (so far so good, works) and shows ONE filled plane for X-Y-Z there. I tried a lot of options, but found no combination that allows that. I always get all grid polys shown... I don't need this to work in the same CubeAxesActor. If I need to use a second one that would be fine with me. Any Ideas or do I need to roll my own class?! Best Regards, Kim From shermanw at indiana.edu Sat Jul 26 19:37:43 2014 From: shermanw at indiana.edu (Bill Sherman) Date: Sat, 26 Jul 2014 19:37:43 -0400 Subject: [vtkusers] GetNumberOfScalarsInFile method fails with Binary VTK data Message-ID: <53D43BC7.7020102@indiana.edu> Hello, This is something I noticed a long time ago, but wasn't sufficiently motivated to report it, but today I am motivated. I just tried again with VTK version 6.1.0 (as it comes with ParaView 4.1.0), and it still exhibits the same behavior. Specifically, this is a problem when reading legacy VTK files (using the TCL or Python interface) that are stored in Binary format. When stored in ASCII format, there is no problem. For instance, the "blow.vtk" file is an example of an ASCII legacy VTK file with 10 scalars and 10 vectors. So I can query (with for example vtkpython): >>> dr = vtk.vtkDataSetReader() >>> dr.SetFileName("blow.vtk") >>> dr.Update() >>> dr.GetFileType() 1 >>> dr.GetNumberOfScalarsInFile() 10 >>> dr.GetNumberOfVectorsInFile() 10 >>> dr.GetNumberOfFieldDataInFile() 0 But if I try the same for a Binary formatted legacy VTK file, then it will report either 0 or 1 scalar or 0 or 1 vector. As a secondary question -- I was trying to convert the ASCII blow.vtk file to a Binary VTK file to provide as an example for demonstrating the issue abvoe, but I'm having trouble doing an ASCII to Binary conversion using the VTK scripting interface in a way that keeps the scalars in the scalar list. I can get them all read, but then writing them causes most of them to be shifted down as "FieldData" rather than Scalars. So my other question is: A) How to read a file and write it back out in the same structure? (perhaps switching only the ASCII flag to Binary) and/or B) How to write multiple scalar entries using VTK scripting. Of course, I can create these files with an AWK script, but I'd like to be able to do it completely within the VTK scripting environment. (Binary file with multiple scalars available upon request.) Thanks, Bill -- Bill Sherman Sr. Technology Advisor Advanced Visualization Lab Pervasive Technology Inst Indiana University shermanw at iu.edu From g.bogle at auckland.ac.nz Sun Jul 27 03:59:05 2014 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Sun, 27 Jul 2014 07:59:05 +0000 Subject: [vtkusers] Animation problem In-Reply-To: References: , Message-ID: In case anyone is interested, I found the simple solution. renderer->RemoveActor(actor); renderer->AddActor(actor); :) ________________________________ From: vtkusers [vtkusers-bounces at vtk.org] on behalf of Gib Bogle [g.bogle at auckland.ac.nz] Sent: Saturday, 26 July 2014 12:29 p.m. To: vtkusers at vtk.org Subject: Re: [vtkusers] Animation problem I have narrowed down my problem somewhat, and discovered that it is not strictly related to the time callback. The following code fragment illustrates the point. I create a shape in polydata and render it, then change the shape and try to render it again. With this code I see only the first shape. If I comment out the first renderWindow->Render() then I see the second shape. Using the timer callback does effectively what this code does, successively modifying and re-rendering the shape, i.e. repeating the three lines of code concerning the second shape. What do I need to do to ensure that both renders have effect? (Of course with this piece of code I will not see the first render unless I insert a delay.) // This creates the first shape (straight) MakeTube(nd, nstrips, dtheta1, points, strips); polydata->SetPoints(points); polydata->SetStrips(strips); // Create an actor and mapper vtkSmartPointer mapper = vtkSmartPointer::New(); mapper->SetInput(polydata); vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); renderer->AddActor(actor); renderWindow->Render(); // <<< remove this and the second shape is rendered // This creates the second shape (curved) strips->Initialize(); MakeTube(nd, nstrips, dtheta2, points, strips); renderWindow->Render(); renderWindowInteractor->Start(); ________________________________ From: vtkusers [vtkusers-bounces at vtk.org] on behalf of Gib Bogle [g.bogle at auckland.ac.nz] Sent: Friday, 25 July 2014 5:58 p.m. To: vtkusers at vtk.org Subject: [vtkusers] Animation problem Hi, I'm trying to implement an animation program, basing it closely (I think) on this example: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/Animation Apparently I'm missing something because my program renders my actor correctly in the main program, but the code in the timer callback does not change what is being rendered. The main program and the callback function are shown below. The relevant part of the callback code that does not lead to a modified actor being rendered is this: strips->Initialize(); MakeTube(nd, nstrips, dtheta, points, strips); polydata->Reset(); polydata->SetPoints(points); polydata->SetStrips(strips); mapper->RemoveAllInputs(); mapper->SetInput(polydata); actor->SetMapper(mapper); mapper->Update(); vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::SafeDownCast(caller); iren->GetRenderWindow()->Render(); As you can see, I have been flailing around, trying various likely possibilities, revealing my obvious lack of understanding. Initially I thought it would be sufficient to just change 'points' and 'strips', then I thought I should repopulate polydata, then... class vtkTimerCallback2 : public vtkCommand { public: static vtkTimerCallback2 *New() { vtkTimerCallback2 *cb = new vtkTimerCallback2; cb->TimerCount = 0; return cb; } virtual void Execute(vtkObject *caller, unsigned long eventId, void * vtkNotUsed(callData)) { if (vtkCommand::TimerEvent == eventId) { ++this->TimerCount; } std::cout << this->TimerCount << std::endl; // actor->SetPosition(this->TimerCount/10., this->TimerCount/10.,0.); dtheta = new double[nstrips]; for (int i=0; iInitialize(); MakeTube(nd, nstrips, dtheta, points, strips); polydata->Reset(); polydata->SetPoints(points); polydata->SetStrips(strips); mapper->RemoveAllInputs(); mapper->SetInput(polydata); actor->SetMapper(mapper); mapper->Update(); vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::SafeDownCast(caller); iren->GetRenderWindow()->Render(); } private: int TimerCount; double *dtheta; public: int nd; int nstrips; vtkPolyData *polydata; vtkCellArray *strips; vtkPoints *points; vtkDataSetMapper *mapper; vtkActor* actor; }; int main(int argc, char *argv[]) { int nd = 20; int nstrips = 4; double *dtheta; PI = 4*atan(1.0); vtkSmartPointer polydata = vtkSmartPointer::New(); vtkSmartPointer strips = vtkSmartPointer::New(); vtkSmartPointer points = vtkSmartPointer::New(); // we want just one big array of points points->SetNumberOfPoints(nd*(nstrips+1)); strips->SetNumberOfCells(nstrips); dtheta = new double[nstrips]; dthetafinal = new double[nstrips]; for (int i=0; iSetPoints(points); polydata->SetStrips(strips); // Create an actor and mapper vtkSmartPointer mapper = vtkSmartPointer::New(); #if VTK_MAJOR_VERSION <= 5 mapper->SetInput(polydata); #else mapper->SetInputData(polydata); #endif vtkSmartPointer actor = vtkSmartPointer::New(); actor->SetMapper(mapper); // Create a renderer, render window, and interactor vtkSmartPointer renderer = vtkSmartPointer::New(); vtkSmartPointer renderWindow = vtkSmartPointer::New(); renderWindow->AddRenderer(renderer); vtkSmartPointer renderWindowInteractor = vtkSmartPointer::New(); renderWindowInteractor->SetRenderWindow(renderWindow); renderer->AddActor(actor); renderWindow->Render(); // Initialize must be called prior to creating timer events. renderWindowInteractor->Initialize(); // Sign up to receive TimerEvent vtkSmartPointer cb = vtkSmartPointer::New(); cb->actor = actor; cb->nd = nd; cb->nstrips = nstrips; cb->points = points; cb->strips = strips; cb->polydata = polydata; cb->mapper = mapper; renderWindowInteractor->AddObserver(vtkCommand::TimerEvent, cb); int timerId = renderWindowInteractor->CreateRepeatingTimer(1000); std::cout << "timerId: " << timerId << std::endl; renderWindowInteractor->Start(); return EXIT_SUCCESS; } -------------- next part -------------- An HTML attachment was scrubbed... URL: From amb2189 at rit.edu Sun Jul 27 18:17:45 2014 From: amb2189 at rit.edu (Citizen Snips) Date: Sun, 27 Jul 2014 15:17:45 -0700 (PDT) Subject: [vtkusers] Oculus Rift: vtkLensWarp - failure for request: vtkInformation Message-ID: <1406499465421-5727984.post@n5.nabble.com> Hey there guys. I'm currently working on an augmented reality stereo display for the Oculus Rift, which requires a barrel distortion on each eye. For this, I have four renderers (two for each eye) in a single render window. I'm trying to get the output of the vtkImageImport objects that process cam data for the background of each eye distorted using a vtkWarpLens. However, I am constantly running into a blank display and an error that states: vtkStreamingDemandDrivenPipeline (0x3002f80): Algorithm vtkWarpLens(0x3002320) returned failure for request: vtkInformation (0x3004560) Debug: Off Modified Time: 1836 Reference Count: 1 Registered Events: (none) Request: REQUEST_DATA_OBJECT FROM_OUTPUT_PORT: 0 ALGORITHM_AFTER_FORWARD: 1 FORWARD_DIRECTION: 0 I don't really know what to make of this. I assume it's because I'm passing vtkWarpLens a vtkImageData object instead of a vtkAlgorithmOutput or whatever it is, but because I'm working in Python, it's a little unclear as to what's going on. The only example of vtkWarpLens usage I could find was a test file, as there are no examples. Can anyone help me out? -- View this message in context: http://vtk.1045678.n5.nabble.com/Oculus-Rift-vtkLensWarp-failure-for-request-vtkInformation-tp5727984.html Sent from the VTK - Users mailing list archive at Nabble.com. From amb2189 at rit.edu Sun Jul 27 18:21:34 2014 From: amb2189 at rit.edu (Citizen Snips) Date: Sun, 27 Jul 2014 15:21:34 -0700 (PDT) Subject: [vtkusers] Oculus Rift: vtkLensWarp - failure for request: vtkInformation In-Reply-To: <1406499465421-5727984.post@n5.nabble.com> References: <1406499465421-5727984.post@n5.nabble.com> Message-ID: <1406499694750-5727985.post@n5.nabble.com> Here is the code segment in question (Not full file, but the rest is just setting up renderers, actors, etc. Citizen Snips wrote > # Set up webcam feed for background video > cb.webcam = cv2.VideoCapture(0) > ret, tmp = cb.webcam.read() > cv2.cvtColor(tmp, cv2.COLOR_BGR2RGB) > > width = cb.webcam.get(3) > height = cb.webcam.get(4) > > # image converter for openCV frame to vtkImageData > cb.imgPort = vtkImageImport() > cb.imgPort.SetDataSpacing(1,1,1) > cb.imgPort.SetDataOrigin(0,0,0) > cb.imgPort.SetWholeExtent(0, width-1,0,height-1,0,0) > cb.imgPort.SetDataExtentToWholeExtent() > cb.imgPort.SetDataScalarTypeToUnsignedChar() > cb.imgPort.SetNumberOfScalarComponents(3) > cb.imgPort.SetImportVoidPointer(tmp) > cb.imgPort.Update() > > > #Warp image > cb.wl = vtk.vtkWarpLens() > cb.wl.SetInputConnection(cb.imgPort.GetOutputPort()) > cb.wl.SetPrincipalPoint(2.4507, 1.7733) > cb.wl.SetFormatWidth(4.792) > cb.wl.SetFormatHeight(3.6) > cb.wl.SetImageWidth(width) > cb.wl.SetImageHeight(height) > cb.wl.SetK1(0.01307) > cb.wl.SetK2(0.0003102) > cb.wl.SetP1(1.953e-005) > cb.wl.SetP2(-9.655e-005) -- View this message in context: http://vtk.1045678.n5.nabble.com/Oculus-Rift-vtkLensWarp-failure-for-request-vtkInformation-tp5727984p5727985.html Sent from the VTK - Users mailing list archive at Nabble.com. From zhaokang.cn at gmail.com Sun Jul 27 20:53:23 2014 From: zhaokang.cn at gmail.com (Kang Zhao) Date: Mon, 28 Jul 2014 08:53:23 +0800 Subject: [vtkusers] Why Axis Labels (X,Y,Z) do not show (Axes.py)? Message-ID: <53D59F03.3090809@gmail.com> Hello, When I ran the attached Python script, the axis lables (X,Y,Z) didn't show up. I also tried playing with axes.GetXAxisCaptionActor2D().GetCaptionTextProperty.SetColor(1,0,0) and SetXAxisLabelText(), but no success. PS, the script could be found at: http://www.cmake.org/Wiki/VTK/Examples/Python/GeometricObjects/Display/Axes. Could anyone help to share some clue? My environment: OS: Windows 7 (64-bit) Python: 2.7.7 (32 bit) wxPython: wxPython2.8-win32-unicode-2.8.12.1-py27.exe VTK: vtkpython-6.1.0-Windows-32bit.exe Thanks for your help in advance. Kang -------------- next part -------------- import vtk #create a Sphere sphereSource = vtk.vtkSphereSource() sphereSource.SetCenter(0.0, 0.0, 0.0) sphereSource.SetRadius(0.5) #create a mapper sphereMapper = vtk.vtkPolyDataMapper() sphereMapper.SetInputConnection(sphereSource.GetOutputPort()) #create an actor sphereActor = vtk.vtkActor() sphereActor.SetMapper(sphereMapper) #a renderer and render window renderer = vtk.vtkRenderer() renderWindow = vtk.vtkRenderWindow() renderWindow.AddRenderer(renderer) #an interactor renderWindowInteractor = vtk.vtkRenderWindowInteractor() renderWindowInteractor.SetRenderWindow(renderWindow) #add the actors to the scene renderer.AddActor(sphereActor) renderer.SetBackground(.1,.2,.3) # Background dark blue transform = vtk.vtkTransform() transform.Translate(1.0, 0.0, 0.0) axes = vtk.vtkAxesActor() # The axes are positioned with a user transform axes.SetUserTransform(transform) # properties of the axes labels can be set as follows # this sets the x axis label to red # axes->GetXAxisCaptionActor2D()->GetCaptionTextProperty()->SetColor(1,0,0); # the actual text of the axis label can be changed: # axes->SetXAxisLabelText("test"); renderer.AddActor(axes) renderer.ResetCamera() renderWindow.Render() # begin mouse interaction renderWindowInteractor.Start() -------------- next part -------------- A non-text attachment was scrubbed... Name: Axes.png Type: image/png Size: 39038 bytes Desc: not available URL: From scott.miller at psu.edu Sun Jul 27 21:28:45 2014 From: scott.miller at psu.edu (Scott T. Miller) Date: Sun, 27 Jul 2014 21:28:45 -0400 Subject: [vtkusers] Boundary set information in VTU file Message-ID: Hi, I would like to associate an integer value with mesh boundaries in a *.vtu file. I cannot find any syntax for doing this, but I assume it is possible. I have in mind visualizing something like side sets/node sets in exodusII files. Can anyone provide me with a small text.vtu file to show me how to do this? Thanks. -Scott From Mike.Taverne at bristol.ac.uk Mon Jul 28 06:59:31 2014 From: Mike.Taverne at bristol.ac.uk (Mike Taverne) Date: Mon, 28 Jul 2014 11:59:31 +0100 Subject: [vtkusers] Why Axis Labels (X,Y,Z) do not show (Axes.py)? In-Reply-To: <53D59F03.3090809@gmail.com> References: <53D59F03.3090809@gmail.com> Message-ID: <53D62D13.9030904@bristol.ac.uk> I see the labels when running your script. Both with VTK 5.8.0 and VTK 6.1.0. Changing the text and its color also works. Maybe it is a rendering issue similar to the one I have with colors on surfaces creates from sampled implicit functions. I'm using python 2.7.6, but I don't think that's where the problem comes from. OS: Ubuntu 14.04.1 LTS (64bit) Python: 2.7.6 (64bit as well I guess, distro package) VTK: 5.8.0 from the ubuntu repositories and 6.1.0 compiled from source On 28/07/14 01:53, Kang Zhao wrote: > Hello, > > When I ran the attached Python script, the axis lables (X,Y,Z) didn't > show up. I also tried playing with > axes.GetXAxisCaptionActor2D().GetCaptionTextProperty.SetColor(1,0,0) and > SetXAxisLabelText(), but no success. > > PS, the script could be found at: > http://www.cmake.org/Wiki/VTK/Examples/Python/GeometricObjects/Display/Axes. > > Could anyone help to share some clue? > > My environment: > > OS: Windows 7 (64-bit) > Python: 2.7.7 (32 bit) > wxPython: wxPython2.8-win32-unicode-2.8.12.1-py27.exe > VTK: vtkpython-6.1.0-Windows-32bit.exe > > Thanks for your help in advance. > > Kang > > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- A non-text attachment was scrubbed... Name: Axes.py Type: text/x-python Size: 1479 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Axes_VTK6.1.0.png Type: image/png Size: 14147 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Axes_VTK5.8.0.png Type: image/png Size: 14516 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 884 bytes Desc: OpenPGP digital signature URL: From kim.rosenbohm at posteo.de Mon Jul 28 07:48:03 2014 From: kim.rosenbohm at posteo.de (Kim Rosenbohm) Date: Mon, 28 Jul 2014 13:48:03 +0200 Subject: [vtkusers] Display only ONE GridPoly per axis in a CubeAxesActor In-Reply-To: <53D39328.7020309@posteo.de> References: <53D39328.7020309@posteo.de> Message-ID: <917bfdc631362936999e992a77a655a4@posteo.de> I'm a VTK-noobs, so I hope someone has an idea. This is my code to create the axes: double axesColor[3] = {0, 0, 0}; m_axesActor->SetVisibility(1); m_axesActor->SetCamera(m_renderer->GetActiveCamera()); m_axesActor->SetBounds(m_surfaceMapper->GetBounds()); m_axesActor->SetTickLocationToOutside(); m_axesActor->SetFlyMode(VTK_FLY_OUTER_EDGES); m_axesActor->SetGridLineLocation(VTK_GRID_LINES_FURTHEST); //setup x axis m_axesActor->DrawXGridlinesOn(); m_axesActor->GetXAxesLinesProperty()->SetColor(axesColor); m_axesActor->GetXAxesGridlinesProperty()->SetColor(axesColor); m_axesActor->GetXAxesGridpolysProperty()->SetColor(axesColor); m_axesActor->GetXAxesInnerGridlinesProperty()->SetColor(axesColor); m_axesActor->XAxisMinorTickVisibilityOff(); m_axesActor->SetXAxisLabelVisibility(1); m_axesActor->GetTitleTextProperty(0)->SetColor(axesColor); m_axesActor->GetLabelTextProperty(0)->SetColor(axesColor); //setup y axis m_axesActor->DrawYGridlinesOn(); m_axesActor->GetYAxesLinesProperty()->SetColor(axesColor); m_axesActor->GetYAxesGridlinesProperty()->SetColor(axesColor); m_axesActor->GetYAxesGridpolysProperty()->SetColor(axesColor); m_axesActor->GetYAxesInnerGridlinesProperty()->SetColor(axesColor); m_axesActor->YAxisMinorTickVisibilityOff(); m_axesActor->SetYAxisLabelVisibility(1); m_axesActor->GetTitleTextProperty(1)->SetColor(axesColor); m_axesActor->GetLabelTextProperty(1)->SetColor(axesColor); //setup z axis m_axesActor->DrawZGridlinesOn(); m_axesActor->GetZAxesLinesProperty()->SetColor(axesColor); m_axesActor->GetZAxesGridlinesProperty()->SetColor(axesColor); m_axesActor->GetZAxesGridpolysProperty()->SetColor(axesColor); m_axesActor->GetZAxesInnerGridlinesProperty()->SetColor(axesColor); m_axesActor->ZAxisMinorTickVisibilityOff(); m_axesActor->ZAxisLabelVisibilityOn(); m_axesActor->GetTitleTextProperty(2)->SetColor(axesColor); m_axesActor->GetLabelTextProperty(2)->SetColor(axesColor); m_axesActor->GetLabelTextProperty(2)->SetOrientation(-90.0); //setup unit strings m_axesActor->SetXUnits(""); m_axesActor->SetYUnits(""); m_axesActor->SetZUnits(""); //add to scene m_renderer->AddActor(m_axesActor); Now, if I enable grid polys: "m_axesActor->DrawXGridlPolysOn()" I get a grid of polys (which the name states, obviously), but I want just ONE poly in the same plane where axes are... (Sort of like this: http://cloud.originlab.com/www/resources/graph_gallery/images_galleries/graph_gallery_3dxyywalls_500px.gif [5]) If there's a different way/class I need to use to achieve this, please feel free to tell me. Best Regards, Kim Am 26.07.2014 13:38 schrieb Kim Rosenbohm: > Hi All. > > I want to display the axes to a plot in a fashion so that the scales are > always behind/below the plot (so far so good, works) and shows ONE > filled plane for X-Y-Z there. > I tried a lot of options, but found no combination that allows that. I > always get all grid polys shown... I don't need this to work in the same > CubeAxesActor. If I need to use a second one that would be fine with me. > > Any Ideas or do I need to roll my own class?! > > Best Regards, > > Kim > _______________________________________________ > Powered by www.kitware.com [1] > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html [2] > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ [3] > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers [4] Links: ------ [1] http://www.kitware.com [2] http://www.kitware.com/opensource/opensource.html [3] http://www.vtk.org/Wiki/VTK_FAQ [4] http://public.kitware.com/mailman/listinfo/vtkusers [5] http://cloud.originlab.com/www/resources/graph_gallery/images_galleries/graph_gallery_3dxyywalls_500px.gif -------------- next part -------------- An HTML attachment was scrubbed... URL: From nawijn at gmail.com Mon Jul 28 08:23:08 2014 From: nawijn at gmail.com (Marco Nawijn) Date: Mon, 28 Jul 2014 14:23:08 +0200 Subject: [vtkusers] Status of VTK Python 3 wrapper support Message-ID: Dear all, Is there any news on the VTK Python 3 wrapper support? Are there specific problems with building the wrapper (other than time constraints)? Kind regards, Marco -------------- next part -------------- An HTML attachment was scrubbed... URL: From grothausmann.roman at mh-hannover.de Mon Jul 28 10:23:20 2014 From: grothausmann.roman at mh-hannover.de (Dr. Roman Grothausmann) Date: Mon, 28 Jul 2014 16:23:20 +0200 Subject: [vtkusers] Extensions to the MetaImage (MHDs) IO-plugin to support compression and MHAs Message-ID: <53D65CD8.4080305@mh-hannover.de> Dear mailing list members, I've extended the MetaImage (used by e.g. ITK/VTK) IO-plugin from Kang Li (http://www.kangli.org/code/MetaImage_Reader_Writer.html) to also support compression and local data storage, i.e. MHAs. The MetaImage Reader/Writer from (http://ij-plugins.sourceforge.net/plugins/3d-io/) seems not to support this either. Reading and writing in Fiji was tested with MHDs and MHAs created/read by ITK-4.5.1. While the plugin handles files bigger than 4GB correctly, (for unknown reasons my) ITK seems to have problems with MHDs/MHAs bigger than 4GB (in general). The plugin does not check whether the size of the compressed data is correct, ITK however does. If the header lacks an entry of CompressedDataSize, ITK throws an error when reading/loading such a file. If the size specified with CompressedDataSize is too big, ITK just issues a warning. This was used as a workaround because I did not find an easy way in Java to put the correct value for CompressedDataSize without using extra temporary files (which might be quite big). Attached are the modified files (java-files, plugins.config and a repacked IO_-2.0.0-SNAPSHOT.jar). A modified HandleExtraFileTypes.java (based on: https://github.com/fiji/IO/blob/master/src/main/java/HandleExtraFileTypes.java) is also included. Togehter with the modified Plugin it allows opening MHDs and MHAs directly. The repacked IO_-2.0.0-SNAPSHOT.jar was generated with: javac -cp /opt/fiji/Fiji.app/jars/ij-1.48a.jar:. MetaImage_Reader.java javac -cp /opt/fiji/Fiji.app/jars/ij-1.48a.jar:. MetaImage_Writer.java javac -cp /opt/fiji/Fiji.app/jars/ij-1.48a.jar:. MetaImage_CWriter.java javac -cp /opt/fiji/Fiji.app/jars/ij-1.48a.jar:. HandleExtraFileTypes.java The compiled Class-files were moved to a subfolder named io/: ExtendedFileOpener.class MetaImage_CWriter.class MetaImage_Writer.class ExtendedFileSaver.class MetaImage_Reader.class ReplacingInputStream.class And then included/replaced with zip: zip -r IO_-2.0.0-SNAPSHOT.jar plugins.config HandleExtraFileTypes.class io/ Feel free to add these extensions to the Plugin-Page or the ImageJ/Fiji repository. Any suggestions concerning improvements are very welcome. Many thanks for ImageJ/Fiji and the initial Metaimage IO-plugin. Roman -- Dr. Roman Grothausmann Tomographie und Digitale Bildverarbeitung Tomography and Digital Image Analysis Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 Medizinische Hochschule Hannover Carl-Neuberg-Str. 1 D-30625 Hannover Tel. +49 511 532-9574 -------------- next part -------------- A non-text attachment was scrubbed... Name: HandleExtraFileTypes.java Type: text/x-java Size: 16846 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: MetaImage_CWriter.java Type: text/x-java Size: 11063 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: MetaImage_Reader.java Type: text/x-java Size: 17777 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: MetaImage_Writer.java Type: text/x-java Size: 6219 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: MetaImageIO.patch Type: text/x-patch Size: 17205 bytes Desc: not available URL: -------------- next part -------------- # Author: Roman Grothausmann File>Save As, "MHD/MHA ...", io.MetaImage_Writer File>Save As, "MHD/MHA compressed ...", io.MetaImage_CWriter File>Import, "MHD/MHA...", io.MetaImage_Reader # Author: Stephan Saalfeld File>Save As, "DF3 ...", io.Save_DF3 File>Import, "DF3...", io.Open_DF3 # Author: Stephan Preibisch File>Import, "FIB-SEM ...", io.FIBSEM_Reader # by Albert Cardona: File>Import, "MRC Leginon ...", io.Open_MRC_Leginon File>Import, "PDF ...", io.PDF_Viewer File>Import, "Extract Images From PDF...", io.Extract_Images_From_PDF File>Import, "DAT EMMENU ...", io.Open_DAT_EMMENU # by Greg Jefferis File>Import, "DM3 Reader...", io.DM3_Reader File>Import, "TorstenRaw GZ Reader...", io.TorstenRaw_GZ_Reader File>Import, "Nrrd ...", io.Nrrd_Reader File>Save As, "Nrrd ... ", io.Nrrd_Writer # by Johannes Schindelin File>Import, "ICO...", io.ICO_Reader File>Save As, "ICO ...", io.ICO_Writer File>Import, "Icns...", io.Icns_Reader File>Save As, "Icns ...", io.Icns_Writer File>Import, "SVG...", io.SVG_Reader File>Save As, "XPM ...", io.XPM_Writer File>Import, "LSS16...", io.LSS16_Reader File>Save As, "LSS16 ...", io.LSS16_Writer # others: File>Import, "IPLab Reader...", io.IPLab_Reader File>Save As, "PDF ... ", io.PDF_Writer File>Import, "Animated Gif...", io.Animated_Gif_Reader File>Save As, "Animated Gif ... ", io.Gif_Stack_Writer File>Save As, "EPS ...", io.Export_EPS -------------- next part -------------- A non-text attachment was scrubbed... Name: IO_-2.0.0-SNAPSHOT.jar Type: application/x-java-archive Size: 149064 bytes Desc: not available URL: From kubalagwa at gmail.com Mon Jul 28 12:47:36 2014 From: kubalagwa at gmail.com (=?UTF-8?B?SmFrdWIgxYHEhWd3YQ==?=) Date: Mon, 28 Jul 2014 18:47:36 +0200 Subject: [vtkusers] Problem with volume rendering inside of Qt application Message-ID: Hello, I have a strange problem with showing VTK volume in QVTKWidget. I can compile example such as as: http://vtk.org/gitweb?p=VTK.git;a=blob;f=Examples/Medical/Cxx/Medical4.cxx and it work fine. But when I want to use exactly the same code in my sample Qt application (let's say - render only after user press a button) nothing is shown in QVTKWidget (I tried also with QVTKInteractor instead of the one from example). I have this problem only when I want to use vtkVolume and than add the volume to renderer with AddVolume. If I make other 3D visualisation for example with vtkContourFilter and than I add it to renderer with AddActor method - everything works fine. I was trying to solve this problem for a couple of days but I found some things that I can't understand in any way. If I take, for example, Medical4.cxx file and add there #include and than QApplication a(argc, argv); as a first instruction in main - nothing is rendered. But if I move this line after iren->Start() - it renders well again. So my question is - is it some kind of known issue that I have to make some part of VTK pipeline initialization before Qt application could start? Or maybe I am doing somthing totaly wrong? Thanks in advance if someone could help me, I would also apreciate if someone could check the behaviour with this QApplication a(argc, argv); instruction inside (for example) Medical4.cxx - if nobody will be able to reproduce it, maybe I will try to build on other OS. Currently I am working on Ubuntu 12.04 with VTK 5.8 and Qt 4.8.1. Best regards, Jakub -------------- next part -------------- An HTML attachment was scrubbed... URL: From tottek at gmail.com Mon Jul 28 18:03:55 2014 From: tottek at gmail.com (Totte Karlsson) Date: Mon, 28 Jul 2014 15:03:55 -0700 (PDT) Subject: [vtkusers] invalid drawable ; Mac OSX Mavericks and vtk 6.1 Message-ID: <1406585035759-5727997.post@n5.nabble.com> Hello, I have some vtk code that works fine under windows and linux. I have tried to port this code to the Mac. Originally I used vtk 5.10 and the first problem I detected was a 'invalid drawable' error occurring. Googling around, many people have observed the 'invalid drawable' problem. I thought it would be a problem fixed in vtk 6.1, so I updated my code to use 6.1. However, I now see the problem is still present in 6.1. I have code that allow the user to do some window interaction, and press 'e', for exit, and then, 'restart' the interaction mode. This seem to trigger the 'invalid drawable' error. For me this is a show stopper and I have not yet seen any solution to this problem. There are suggestions on the vtk wiki to 'restructure the code' to 'make the window visible' prior to rendering. http://www.vtk.org/Wiki/VTK/OpenGL_Errors) . But there is no explanation on that page what that means? Anyone knowing? The other two bullets on that page are to no help either I am afraid. I can't ignore the error by the cmake variable. There seem not to be any need to detect the 'invalid drawable' condition, since I don't know what to do at that point to make it valid. What seem to be needed is to create a state of 'valid drawable'. Question is how to do that. Any help appreciated. I suppose this must bite many mac people. tk -- View this message in context: http://vtk.1045678.n5.nabble.com/invalid-drawable-Mac-OSX-Mavericks-and-vtk-6-1-tp5727997.html Sent from the VTK - Users mailing list archive at Nabble.com. From sbalderrama at eagle.org Mon Jul 28 18:34:21 2014 From: sbalderrama at eagle.org (Steve Balderrama) Date: Mon, 28 Jul 2014 22:34:21 +0000 Subject: [vtkusers] FE display points, lines, etc Message-ID: Hi. I have Finite Element data that contains 0D, 1D, and 2D elements. For displaying the mesh I need the options of displaying all these cell types together or any of the above on their own. I'm having a bit of a difficult time figuring out the most efficient way to set this up. Is there a way to set this up with everything contained in a single polyData or would it be better to use a separate polydata for each type? I currently have everything in one vtkPolyData but I don't see an obvious set of extractors or mappers to just retrieve certain cell types. Thanks for any suggestions! -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Mon Jul 28 18:56:04 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Mon, 28 Jul 2014 16:56:04 -0600 Subject: [vtkusers] invalid drawable ; Mac OSX Mavericks and vtk 6.1 In-Reply-To: <1406585035759-5727997.post@n5.nabble.com> References: <1406585035759-5727997.post@n5.nabble.com> Message-ID: Hi Totte, This error occurs when you call Render() on a vtkRenderWindow when the window has not yet been mapped to the screen. The most common case is when VTK is used with Qt and the render window is inside a Qt widget that is not yet visible. The way that I avoid 'invalid drawable' is by doing a "widget->isVisible()" check on my Qt widget before every call to "renderwindow->Render()": if (widget->isVisible()) { renderwindow->Render(); } At the very least, you need some kind of check to make sure that Render() is never called before the widget becomes visible. - David On Mon, Jul 28, 2014 at 4:03 PM, Totte Karlsson wrote: > Hello, > I have some vtk code that works fine under windows and linux. I have tried > to port this code to the Mac. Originally I used vtk 5.10 and the first > problem I detected was a 'invalid drawable' error occurring. > > Googling around, many people have observed the 'invalid drawable' problem. I > thought it would be a problem fixed in vtk 6.1, so I updated my code to use > 6.1. However, I now see the problem is still present in 6.1. > > I have code that allow the user to do some window interaction, and press > 'e', for exit, and then, 'restart' the interaction mode. This seem to > trigger the 'invalid drawable' error. > > For me this is a show stopper and I have not yet seen any solution to this > problem. > > There are suggestions on the vtk wiki to 'restructure the code' to 'make the > window visible' prior to rendering. > http://www.vtk.org/Wiki/VTK/OpenGL_Errors) . But there is no explanation on > that page what that means? Anyone knowing? > > The other two bullets on that page are to no help either I am afraid. I > can't ignore the error by the cmake variable. There seem not to be any need > to detect the 'invalid drawable' condition, since I don't know what to do at > that point to make it valid. > > What seem to be needed is to create a state of 'valid drawable'. Question is > how to do that. > > Any help appreciated. I suppose this must bite many mac people. > > tk From zhaokang.cn at gmail.com Mon Jul 28 21:52:20 2014 From: zhaokang.cn at gmail.com (Kang Zhao) Date: Tue, 29 Jul 2014 09:52:20 +0800 Subject: [vtkusers] Why Axis Labels (X,Y,Z) do not show (Axes.py)? In-Reply-To: <53D62D13.9030904@bristol.ac.uk> References: <53D59F03.3090809@gmail.com> <53D62D13.9030904@bristol.ac.uk> Message-ID: <53D6FE54.40108@gmail.com> Hi Mike, Thanks a lot for your reply. I did some further investigation and here are the findings: - Upgrading PyOpenGL to 3.1.0 didn't help; - The attached simple vtkTextActor example didn't work either ("Hello World!" didn't show up). I also tested on another machine (WinXP 32-bit, Python 2.7.5, VTK-Python 6.1.0), and it worked fine. It seems something broken with my win7 machine. Will come back to share if I get any new findings... Thanks again. Kang ? 2014/7/28 18:59, Mike Taverne ??: > I see the labels when running your script. > Both with VTK 5.8.0 and VTK 6.1.0. > > Changing the text and its color also works. > > Maybe it is a rendering issue similar to the one I have with colors on > surfaces creates from sampled implicit functions. > > I'm using python 2.7.6, but I don't think that's where the problem comes > from. > > OS: Ubuntu 14.04.1 LTS (64bit) > Python: 2.7.6 (64bit as well I guess, distro package) > VTK: 5.8.0 from the ubuntu repositories and 6.1.0 compiled from source > > On 28/07/14 01:53, Kang Zhao wrote: >> Hello, >> >> When I ran the attached Python script, the axis lables (X,Y,Z) didn't >> show up. I also tried playing with >> axes.GetXAxisCaptionActor2D().GetCaptionTextProperty.SetColor(1,0,0) and >> SetXAxisLabelText(), but no success. >> >> PS, the script could be found at: >> http://www.cmake.org/Wiki/VTK/Examples/Python/GeometricObjects/Display/Axes. >> >> Could anyone help to share some clue? >> >> My environment: >> >> OS: Windows 7 (64-bit) >> Python: 2.7.7 (32 bit) >> wxPython: wxPython2.8-win32-unicode-2.8.12.1-py27.exe >> VTK: vtkpython-6.1.0-Windows-32bit.exe >> >> Thanks for your help in advance. >> >> Kang >> >> >> >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers >> -------------- next part -------------- import vtk # create a rendering window and renderer ren = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren) # create a renderwindowinteractor iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) # create a text actor txt = vtk.vtkTextActor() txt.SetInput("Hello World!") txtprop=txt.GetTextProperty() txtprop.SetFontFamilyToArial() txtprop.SetFontSize(18) txtprop.SetColor(1,1,1) txt.SetDisplayPosition(20,30) # assign actor to the renderer ren.AddActor(txt) # enable user interface interactor iren.Initialize() renWin.Render() iren.Start() From floria at tju.edu.cn Tue Jul 29 01:42:45 2014 From: floria at tju.edu.cn (=?UTF-8?B?5p2O6I+y6I+y?=) Date: Tue, 29 Jul 2014 13:42:45 +0800 (GMT+08:00) Subject: [vtkusers] =?utf-8?q?How_to_read_and_visulize_Netcdf_file_with_VT?= =?utf-8?q?K?= Message-ID: An HTML attachment was scrubbed... URL: -------------- next part -------------- Dear Maillist Members: I'm trying to visualize a marine data of NetCDF format. I've read in the data with vtkNetCDFReader, and find that there are five parameters, which are longitude, latitude, altitude(the value is constant), time (the value is constant), and the temperature of sea surface. I want to know how to read out the specific value of each parameter respectively, then to visualize it. Thank you. From Floria Lee @NSCC-TJ From kim.rosenbohm at posteo.de Tue Jul 29 03:51:30 2014 From: kim.rosenbohm at posteo.de (Kim Rosenbohm) Date: Tue, 29 Jul 2014 09:51:30 +0200 Subject: [vtkusers] invalid drawable ; Mac OSX Mavericks and vtk 6.1 In-Reply-To: <1406585035759-5727997.post@n5.nabble.com> References: <1406585035759-5727997.post@n5.nabble.com> Message-ID: Hi. I do this (using Windows and Qt) by deriving from QVTKWidget2, overwriting the ShowEvent() in that class and sending a signal from that event function. Then, In the slot that is called, do your setup, e.g. AddRenderer and initializing the interactors... Hope that helps, Kim Am 29.07.2014 00:03 schrieb Totte Karlsson: > Hello, > I have some vtk code that works fine under windows and linux. I have tried > to port this code to the Mac. Originally I used vtk 5.10 and the first > problem I detected was a 'invalid drawable' error occurring. > > Googling around, many people have observed the 'invalid drawable' problem. I > thought it would be a problem fixed in vtk 6.1, so I updated my code to use > 6.1. However, I now see the problem is still present in 6.1. > > I have code that allow the user to do some window interaction, and press > 'e', for exit, and then, 'restart' the interaction mode. This seem to > trigger the 'invalid drawable' error. > > For me this is a show stopper and I have not yet seen any solution to this > problem. > > There are suggestions on the vtk wiki to 'restructure the code' to 'make the > window visible' prior to rendering. > http://www.vtk.org/Wiki/VTK/OpenGL_Errors [1]) . But there is no explanation on > that page what that means? Anyone knowing? > > The other two bullets on that page are to no help either I am afraid. I > can't ignore the error by the cmake variable. There seem not to be any need > to detect the 'invalid drawable' condition, since I don't know what to do at > that point to make it valid. > > What seem to be needed is to create a state of 'valid drawable'. Question is > how to do that. > > Any help appreciated. I suppose this must bite many mac people. > > tk > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/invalid-drawable-Mac-OSX-Mavericks-and-vtk-6-1-tp5727997.html [2] > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com [3] > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html [4] > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ [5] > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers [6] -- Kim Rosenbohm, Barf??erstr. 7, 37073 G?ttingen, 0163/8723172 Links: ------ [1] http://www.vtk.org/Wiki/VTK/OpenGL_Errors [2] http://vtk.1045678.n5.nabble.com/invalid-drawable-Mac-OSX-Mavericks-and-vtk-6-1-tp5727997.html [3] http://www.kitware.com [4] http://www.kitware.com/opensource/opensource.html [5] http://www.vtk.org/Wiki/VTK_FAQ [6] http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From tottek at gmail.com Tue Jul 29 13:20:42 2014 From: tottek at gmail.com (Totte Karlsson) Date: Tue, 29 Jul 2014 10:20:42 -0700 (PDT) Subject: [vtkusers] invalid drawable ; Mac OSX Mavericks and vtk 6.1 In-Reply-To: <1406585035759-5727997.post@n5.nabble.com> References: <1406585035759-5727997.post@n5.nabble.com> Message-ID: <1406654442538-5728005.post@n5.nabble.com> Hello Kiro and David, Thanks very much for response. I can see you have a solution for this problem when you are using qtwidgets. I do believe I'm not using those widgets, but I'm not sure cause I'm new to the mac. Does perhaps the simplest vtk example create a widget? Anyway, I did created a very simple example demonstrating my problem, which happens when trying to 'reuse' a vtkInteracactor, i.e. main() { // setup vtkwindow, renderer and interactor // Render and interact renderWindow->Render(); renderWindow->SetWindowName("First Window"); //Interact until user presses 'e' renderWindowInteractor->Start(); std::cout << "Window 1 closed..." << std::endl; //Now do some changes to the 'scene'.. and then start interaction again.. //Hoops this does not work.. :( renderWindowInteractor->Start(); //<-- Actually, here I don't even see a window } Question is, how to rewrite the above code (for the mac) so I can provide the user with 'two passes' of interaction? Currently, code like this is called in python scripts. The user sets up a 'scene' and interacts with it. When 'e' is pressed, the code moves on and some things are changed in the scene, and then a subsequent interaction session is to be opened. As you can see, this code is not designed with a UI, but is just meant to work with the simple 'interaction' tools that the vtk interactor provides Perhaps I need to create a completely new renderwindow and interactor? tk -- View this message in context: http://vtk.1045678.n5.nabble.com/invalid-drawable-Mac-OSX-Mavericks-and-vtk-6-1-tp5727997p5728005.html Sent from the VTK - Users mailing list archive at Nabble.com. From luis.vieira at vektore.com Tue Jul 29 13:28:57 2014 From: luis.vieira at vektore.com (Luis Vieira) Date: Tue, 29 Jul 2014 13:28:57 -0400 Subject: [vtkusers] CMake problem (VTK 6.1 - Qt 5.3) In-Reply-To: <53D58E81.8070309@vektore.com> References: <53D58E81.8070309@vektore.com> Message-ID: <53D7D9D9.1050909@vektore.com> Hi. I am beginner with Qt and VTK. Then, I will let you how I have doing. I have been working with Qt 5.3.1 and VS2013 perfectly. Last week I tried to set up VTK 6.1 with VS2013 through CMake 3.0 and works perfectly. As well you could see below. Now, I am try to enable VTK with Qt 5.3.1 through CMake. However, whatever I do to set VT_QT options my CMake only found Qt4 through this file FindQt4.cmake in my C:\Program Files (x86)\CMake\share\cmake-3.0\Modules. I am pretty sure that it's the problem. *CMAKE_INSTALL_PREFIX : C:/Program Files/VTK/buildQt** **CMAKE_PREFIX_PATH: C:/Qt/Qt5.3.1/5.3/msvc2013_64_opengl/bin* *VTK_Group_Qt:BOOL=ON;** QT_QMAKE_EXECUTABLE:FILEPATH=C:/Qt/Qt5.3.1/5.3/msvc2013_64_opengl/bin/qmake.exe. * Where I could change that? "The first thing that have the first time that compile vtk with qt module is that I have to change the flag to qt 5 and erase the flags of qt 4, and then I configure again, and is ready." Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/png Size: 66844 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/png Size: 75255 bytes Desc: not available URL: From david.gobbi at gmail.com Tue Jul 29 14:20:02 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Tue, 29 Jul 2014 12:20:02 -0600 Subject: [vtkusers] invalid drawable ; Mac OSX Mavericks and vtk 6.1 In-Reply-To: <1406654442538-5728005.post@n5.nabble.com> References: <1406585035759-5727997.post@n5.nabble.com> <1406654442538-5728005.post@n5.nabble.com> Message-ID: Hi Totte, I'm not sure, but it might work if you call Initialize() before Start(): renderWindowInteractor->Initialize(); renderWindowInteractor->Start(); - David On Tue, Jul 29, 2014 at 11:20 AM, Totte Karlsson wrote: > Hello Kiro and David, > Thanks very much for response. I can see you have a solution for this > problem when you are using qtwidgets. I do believe I'm not using those > widgets, but I'm not sure cause I'm new to the mac. Does perhaps the > simplest vtk example create a widget? > > Anyway, I did created a very simple example demonstrating my problem, which > happens when trying to 'reuse' a vtkInteracactor, i.e. > > main() > { > // setup vtkwindow, renderer and interactor > > // Render and interact > renderWindow->Render(); > renderWindow->SetWindowName("First Window"); > > //Interact until user presses 'e' > renderWindowInteractor->Start(); > > std::cout << "Window 1 closed..." << std::endl; > //Now do some changes to the 'scene'.. and then start interaction again.. > > //Hoops this does not work.. :( > renderWindowInteractor->Start(); //<-- Actually, here I don't even see a > window > } > > Question is, how to rewrite the above code (for the mac) so I can provide > the user with 'two passes' of interaction? > > Currently, code like this is called in python scripts. The user sets up a > 'scene' and interacts with it. When 'e' is pressed, the code moves on and > some things are changed in the scene, and then a subsequent interaction > session is to be opened. > > As you can see, this code is not designed with a UI, but is just meant to > work with the simple 'interaction' tools that the vtk interactor provides > > Perhaps I need to create a completely new renderwindow and interactor? > tk > > > > -- > View this message in context: http://vtk.1045678.n5.nabble.com/invalid-drawable-Mac-OSX-Mavericks-and-vtk-6-1-tp5727997p5728005.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers From tottek at gmail.com Tue Jul 29 14:25:10 2014 From: tottek at gmail.com (Totte Karlsson) Date: Tue, 29 Jul 2014 11:25:10 -0700 (PDT) Subject: [vtkusers] invalid drawable ; Mac OSX Mavericks and vtk 6.1 In-Reply-To: References: <1406585035759-5727997.post@n5.nabble.com> <1406654442538-5728005.post@n5.nabble.com> Message-ID: <1406658310175-5728008.post@n5.nabble.com> Hi David, I tried the Initialize() call, but that did not make a difference. tk -- View this message in context: http://vtk.1045678.n5.nabble.com/invalid-drawable-Mac-OSX-Mavericks-and-vtk-6-1-tp5727997p5728008.html Sent from the VTK - Users mailing list archive at Nabble.com. From kim.rosenbohm at posteo.de Tue Jul 29 17:56:55 2014 From: kim.rosenbohm at posteo.de (Kim Rosenbohm) Date: Tue, 29 Jul 2014 23:56:55 +0200 Subject: [vtkusers] CMake problem (VTK 6.1 - Qt 5.3) In-Reply-To: <53D7D9D9.1050909@vektore.com> References: <53D58E81.8070309@vektore.com> <53D7D9D9.1050909@vektore.com> Message-ID: <53D818A7.5050508@posteo.de> Hi Luis. Try toggling "Advanced" in the CMake GUI. There is a Qt4/Qt5 switch hidden there somewhere... I have successfuly compiled VTK 6.1.0 with Qt 5.2.1, so 5.3 should work, but I have never tried it with CMake 3... Best Regards, Kim Am 29.07.2014 19:28, schrieb Luis Vieira: > > Hi. I am beginner with Qt and VTK. Then, I will let you how I have > doing. I have been working with Qt 5.3.1 and VS2013 perfectly. Last > week I tried to set up VTK 6.1 with VS2013 through CMake 3.0 and works > perfectly. As well you could see below. Now, I am try to enable VTK > with Qt 5.3.1 through CMake. However, whatever I do to set VT_QT > options my CMake only found Qt4 through this file FindQt4.cmake in my > C:\Program Files (x86)\CMake\share\cmake-3.0\Modules. I am pretty sure > that it's the problem. > > > > *CMAKE_INSTALL_PREFIX : C:/Program Files/VTK/buildQt** > **CMAKE_PREFIX_PATH: C:/Qt/Qt5.3.1/5.3/msvc2013_64_opengl/bin* > *VTK_Group_Qt:BOOL=ON;** > QT_QMAKE_EXECUTABLE:FILEPATH=C:/Qt/Qt5.3.1/5.3/msvc2013_64_opengl/bin/qmake.exe. > > * > > > > > > Where I could change that? > "The first thing that have the first time that compile vtk with qt > module is that I have to change the flag to qt 5 and erase the flags > of qt 4, and then I configure again, and is ready." > > Thank you. > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/png Size: 66844 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/png Size: 75255 bytes Desc: not available URL: From andrew.amaclean at gmail.com Tue Jul 29 19:01:04 2014 From: andrew.amaclean at gmail.com (Andrew Maclean) Date: Wed, 30 Jul 2014 09:01:04 +1000 Subject: [vtkusers] CMake problem (VTK 6.1 - Qt 5.3) Message-ID: Luis, you should have no problems building VTK 6.1+ with QT5.3 and VS2013 I have attached the instructions I use. There is a link you also might like to look at: http://www.vtk.org/Wiki/VTK/Configure_and_Build#Qt5..2A However my instructions do differ from those there. Regards Andrew > > ---------- Forwarded message ---------- > From: Luis Vieira > To: vtkusers at vtk.org > Cc: > Date: Tue, 29 Jul 2014 13:28:57 -0400 > Subject: [vtkusers] CMake problem (VTK 6.1 - Qt 5.3) > > Hi. I am beginner with Qt and VTK. Then, I will let you how I have > doing. I have been working with Qt 5.3.1 and VS2013 perfectly. Last week I > tried to set up VTK 6.1 with VS2013 through CMake 3.0 and works perfectly. > As well you could see below. Now, I am try to enable VTK with Qt 5.3.1 > through CMake. However, whatever I do to set VT_QT options my CMake only > found Qt4 through this file FindQt4.cmake in my C:\Program Files > (x86)\CMake\share\cmake-3.0\Modules. I am pretty sure that it's the problem. > > > > *CMAKE_INSTALL_PREFIX : C:/Program Files/VTK/buildQt* > * CMAKE_PREFIX_PATH: C:/Qt/Qt5.3.1/5.3/msvc2013_64_opengl/bin* > *VTK_Group_Qt:BOOL=ON;* > > * > QT_QMAKE_EXECUTABLE:FILEPATH=C:/Qt/Qt5.3.1/5.3/msvc2013_64_opengl/bin/qmake.exe. > * > > > > > > Where I could change that? > "The first thing that have the first time that compile vtk with qt module > is that I have to change the flag to qt 5 and erase the flags of qt 4, and > then I configure again, and is ready." > > Thank you. > > > _______________________________________________ > vtkusers mailing list > vtkusers at vtk.org > http://public.kitware.com/mailman/listinfo/vtkusers > > -- ___________________________________________ Andrew J. P. Maclean ___________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/png Size: 75255 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/png Size: 66844 bytes Desc: not available URL: -------------- next part -------------- Allow VTK to build against Qt5 Since VTK build system has been updated to make use of CMake macros specific to Qt5, the support has to explicitly enable configuring VTK with -DVTK_QT_VERSION:STRING="5" Additionally, in case Qt5 is not installed in a standard location, a custom prefix for "find_package" should be passed. You should set these environment variables: On Mac OS X Mavericks: export QTDIR=~/Qt/5.3/clang_64 PATH=$QTDIR/bin/:$PATH export PATH On Linux (if you have installed Qt): export QTDIR=~/Qt/5.3/gcc_64 PATH=$QTDIR/bin/:$PATH export PATH On Windows: QTDIR=C:\Qt\Qt5.3\msvc2012_64_opengl CMAKE_PREFIX_PATH:STRING=C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um/x64 PATH=%QTDIR%\bin:%PATH% For VS2013 set: QTDIR=C:\Qt\Qt5.3\msvc2013_64_opengl CMAKE_PREFIX_PATH:STRING=C:/Program Files (x86)/Windows Kits/8.1/Lib/winv6.3/um/x64 PATH=%QTDIR%\bin:%PATH% In the case of Windows and Mac OSX Mavericks: If QTDIR is set and %QTDIR%\bin is added to the system path you do not need to set CMAKE_PREFIX_PATH for the QT directory. However in the case of Windows you can set CMAKE_PREFIX_PATH to where the OpenGL libraries are stored, thus removing the need to manually set it each time a new CMake file is generated. On Windows: If you are using OpenGL: For VS2012: -DCMAKE_PREFIX_PATH:STRING=C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um/x64 For VS2013: -DCMAKE_PREFIX_PATH:STRING=C:/Program Files (x86)/Windows Kits/8.1/Lib/winv6.3/um/x64 See: https://github.com/Kitware/VTK/commit/384636ec9f442db83c8b827d7eabc7ada9ef8d35 and: http://scriptogr.am/davidok8/post/building-and-using-qt-5-with-cmake When using Windows, you may need to Eliminate a warning when building in Windows that relates to static linking of Qt executables to qtmain.lib. This policy was introduced in CMake version 2.8.11. CMake version 2.8.11.2 warns when the policy is not set and uses OLD behavior. Just do this: if(POLICY CMP0020) cmake_policy(SET CMP0020 NEW) endif() From luis.vieira at vektore.com Tue Jul 29 19:21:07 2014 From: luis.vieira at vektore.com (Luis Vieira) Date: Tue, 29 Jul 2014 19:21:07 -0400 Subject: [vtkusers] CMake problem (VTK 6.1 - Qt 5.3) In-Reply-To: <53D818A7.5050508@posteo.de> References: <53D58E81.8070309@vektore.com> <53D7D9D9.1050909@vektore.com> <53D818A7.5050508@posteo.de> Message-ID: <53D82C63.4080600@vektore.com> Thank you so much. I gotta with Qt 5.3 toggling "Advanced" and "Group" checking VTK_QT_VERSION to "5" and change VTK /CMake /*vtkQt.cmake with * set(VTK_QT_VERSION "*5*" CACHE STRING "Expected Qt version") mark_as_advanced(VTK_QT_VERSION) set_property(CACHE VTK_QT_VERSION PROPERTY STRINGS 4 5) if(NOT (VTK_QT_VERSION VERSION_EQUAL "4" OR VTK_QT_VERSION VERSION_EQUAL "5")) message(FATAL_ERROR "Expected value for VTK_QT_VERSION is either '4' or '5'") endif() * * On 7/29/14 5:56 PM, Kim Rosenbohm wrote: > Hi Luis. > > Try toggling "Advanced" in the CMake GUI. There is a Qt4/Qt5 switch > hidden there somewhere... > I have successfuly compiled VTK 6.1.0 with Qt 5.2.1, so 5.3 should > work, but I have never tried it with CMake 3... > > Best Regards, > > Kim > > Am 29.07.2014 19:28, schrieb Luis Vieira: >> >> Hi. I am beginner with Qt and VTK. Then, I will let you how I have >> doing. I have been working with Qt 5.3.1 and VS2013 perfectly. Last >> week I tried to set up VTK 6.1 with VS2013 through CMake 3.0 and >> works perfectly. As well you could see below. Now, I am try to >> enable VTK with Qt 5.3.1 through CMake. However, whatever I do to set >> VT_QT options my CMake only found Qt4 through this file FindQt4.cmake >> in my C:\Program Files (x86)\CMake\share\cmake-3.0\Modules. I am >> pretty sure that it's the problem. >> >> >> >> *CMAKE_INSTALL_PREFIX : C:/Program Files/VTK/buildQt** >> **CMAKE_PREFIX_PATH: C:/Qt/Qt5.3.1/5.3/msvc2013_64_opengl/bin* >> *VTK_Group_Qt:BOOL=ON;** >> QT_QMAKE_EXECUTABLE:FILEPATH=C:/Qt/Qt5.3.1/5.3/msvc2013_64_opengl/bin/qmake.exe. >> >> * >> >> >> >> >> >> Where I could change that? >> "The first thing that have the first time that compile vtk with qt >> module is that I have to change the flag to qt 5 and erase the flags >> of qt 4, and then I configure again, and is ready." >> >> Thank you. >> >> >> >> _______________________________________________ >> Powered bywww.kitware.com >> >> Visit other Kitware open-source projects athttp://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the VTK FAQ at:http://www.vtk.org/Wiki/VTK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/vtkusers > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/png Size: 66844 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/png Size: 75255 bytes Desc: not available URL: From andrew.amaclean at gmail.com Tue Jul 29 19:34:23 2014 From: andrew.amaclean at gmail.com (Andrew Maclean) Date: Wed, 30 Jul 2014 09:34:23 +1000 Subject: [vtkusers] CMake problem (VTK 6.1 - Qt 5.3) In-Reply-To: <53D82C89.5010608@vektore.com> References: <53D82C89.5010608@vektore.com> Message-ID: It is better not to change the CMake file because if you update VTK this file will be overwritten. When you first start cmake you can always use Add Entry, type in the name: VTK_QT_VERSION set the Type to String and type in 5 for the value. Andrew On Wed, Jul 30, 2014 at 9:21 AM, Luis Vieira wrote: > Thank you so much. I gotta with Qt 5.3 toggling "Advanced" and "Group" > checking VTK_QT_VERSION to "5" and change VTK > / CMake > / > > *vtkQt.cmake with * > > set(VTK_QT_VERSION "*5*" > CACHE STRING "Expected Qt version") > mark_as_advanced(VTK_QT_VERSION) > set_property(CACHE VTK_QT_VERSION PROPERTY STRINGS 4 5) > if(NOT (VTK_QT_VERSION VERSION_EQUAL "4" OR VTK_QT_VERSION VERSION_EQUAL "5")) > message(FATAL_ERROR "Expected value for VTK_QT_VERSION is either '4' or '5'") > endif() > > > > On 7/29/14 7:01 PM, Andrew Maclean wrote: > > Luis, you should have no problems building VTK 6.1+ with QT5.3 and VS2013 > I have attached the instructions I use. > There is a link you also might like to look at: > http://www.vtk.org/Wiki/VTK/Configure_and_Build#Qt5..2A > > However my instructions do differ from those there. > > Regards > Andrew > > > >> >> ---------- Forwarded message ---------- >> From: Luis Vieira >> To: vtkusers at vtk.org >> Cc: >> Date: Tue, 29 Jul 2014 13:28:57 -0400 >> Subject: [vtkusers] CMake problem (VTK 6.1 - Qt 5.3) >> >> Hi. I am beginner with Qt and VTK. Then, I will let you how I have >> doing. I have been working with Qt 5.3.1 and VS2013 perfectly. Last week I >> tried to set up VTK 6.1 with VS2013 through CMake 3.0 and works perfectly. >> As well you could see below. Now, I am try to enable VTK with Qt 5.3.1 >> through CMake. However, whatever I do to set VT_QT options my CMake only >> found Qt4 through this file FindQt4.cmake in my C:\Program Files >> (x86)\CMake\share\cmake-3.0\Modules. I am pretty sure that it's the problem. >> >> >> >> *CMAKE_INSTALL_PREFIX : C:/Program Files/VTK/buildQt* >> * CMAKE_PREFIX_PATH: C:/Qt/Qt5.3.1/5.3/msvc2013_64_opengl/bin* >> *VTK_Group_Qt:BOOL=ON;* >> >> * >> QT_QMAKE_EXECUTABLE:FILEPATH=C:/Qt/Qt5.3.1/5.3/msvc2013_64_opengl/bin/qmake.exe. >> * >> >> >> >> >> >> Where I could change that? >> "The first thing that have the first time that compile vtk with qt module >> is that I have to change the flag to qt 5 and erase the flags of qt 4, and >> then I configure again, and is ready." >> >> Thank you. >> >> >> _______________________________________________ >> vtkusers mailing list >> vtkusers at vtk.org >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> > > > -- > ___________________________________________ > Andrew J. P. Maclean > > ___________________________________________ > > > -- ___________________________________________ Andrew J. P. Maclean ___________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/png Size: 75255 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/png Size: 66844 bytes Desc: not available URL: From luis.vieira at vektore.com Tue Jul 29 19:35:30 2014 From: luis.vieira at vektore.com (Luis Vieira) Date: Tue, 29 Jul 2014 19:35:30 -0400 Subject: [vtkusers] CMake problem (VTK 6.1 - Qt 5.3) In-Reply-To: References: <53D82C89.5010608@vektore.com> Message-ID: <53D82FC2.40103@vektore.com> Thank you. On 7/29/14 7:34 PM, Andrew Maclean wrote: > It is better not to change the CMake file because if you update VTK > this file will be overwritten. > > When you first start cmake you can always use Add Entry, type in the > name: VTK_QT_VERSION set the Type to String and type in 5 for the value. > > Andrew > > > On Wed, Jul 30, 2014 at 9:21 AM, Luis Vieira > wrote: > > Thank you so much. I gotta with Qt 5.3 toggling "Advanced" and > "Group" checking VTK_QT_VERSION to "5" and change VTK > /CMake > /*vtkQt.cmake with > > * > > set(VTK_QT_VERSION "*5*" CACHE STRING "Expected Qt version") > mark_as_advanced(VTK_QT_VERSION) > > set_property(CACHE VTK_QT_VERSION PROPERTY STRINGS 4 5) > > if(NOT (VTK_QT_VERSION VERSION_EQUAL "4" OR VTK_QT_VERSION > VERSION_EQUAL "5")) > > message(FATAL_ERROR "Expected value for VTK_QT_VERSION is either > '4' or '5'") > > endif() > > > > On 7/29/14 7:01 PM, Andrew Maclean wrote: >> Luis, you should have no problems building VTK 6.1+ with QT5.3 >> and VS2013 I have attached the instructions I use. >> There is a link you also might like to look at: >> http://www.vtk.org/Wiki/VTK/Configure_and_Build#Qt5..2A >> >> However my instructions do differ from those there. >> >> Regards >> Andrew >> >> >> >> >> ---------- Forwarded message ---------- >> From: Luis Vieira > > >> To: vtkusers at vtk.org >> Cc: >> Date: Tue, 29 Jul 2014 13:28:57 -0400 >> Subject: [vtkusers] CMake problem (VTK 6.1 - Qt 5.3) >> >> Hi. I am beginner with Qt and VTK. Then, I will let you how >> I have doing. I have been working with Qt 5.3.1 and VS2013 >> perfectly. Last week I tried to set up VTK 6.1 with VS2013 >> through CMake 3.0 and works perfectly. As well you could see >> below. Now, I am try to enable VTK with Qt 5.3.1 through >> CMake. However, whatever I do to set VT_QT options my CMake >> only found Qt4 through this file FindQt4.cmake in my >> C:\Program Files (x86)\CMake\share\cmake-3.0\Modules. I am >> pretty sure that it's the problem. >> >> >> >> *CMAKE_INSTALL_PREFIX : C:/Program Files/VTK/buildQt** >> **CMAKE_PREFIX_PATH: C:/Qt/Qt5.3.1/5.3/msvc2013_64_opengl/bin* >> *VTK_Group_Qt:BOOL=ON;** >> QT_QMAKE_EXECUTABLE:FILEPATH=C:/Qt/Qt5.3.1/5.3/msvc2013_64_opengl/bin/qmake.exe. >> >> * >> >> >> >> >> >> Where I could change that? >> "The first thing that have the first time that compile vtk >> with qt module is that I have to change the flag to qt 5 and >> erase the flags of qt 4, and then I configure again, and is >> ready." >> >> Thank you. >> >> >> _______________________________________________ >> vtkusers mailing list >> vtkusers at vtk.org >> http://public.kitware.com/mailman/listinfo/vtkusers >> >> >> >> >> -- >> ___________________________________________ >> Andrew J. P. Maclean >> >> ___________________________________________ > > > > > -- > ___________________________________________ > Andrew J. P. Maclean > > ___________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/png Size: 66844 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/png Size: 75255 bytes Desc: not available URL: From jmalsoaz at yahoo.fr Wed Jul 30 05:34:39 2014 From: jmalsoaz at yahoo.fr (Malsoaz James) Date: Wed, 30 Jul 2014 10:34:39 +0100 Subject: [vtkusers] Rendering problem using Qt5 In-Reply-To: References: Message-ID: <1406712879.52468.YahooMailNeo@web171506.mail.ir2.yahoo.com> Same problem here. I'm using Qt 5.3.0 with VTK 6.1.0.? I have a problem with the depth (zbuffer) on my QVTKWidget. The problem appears only on Linux with specific graphical cards (ati or intel chipsets). Is there a solution to this problem ? Best. Le Mercredi 16 avril 2014 19h12, Luca Tersi a ?crit : Hi all, I've managed to compile VTK and my project against Qt5, unfortunately on my Linux environment I get a weird rendering problem when using QVTKWidget. It seems that it cannot understand properly the order of the actors (zbuffer?) displaying sometimes also the actors backfaces. If I use a regular vtk rendering pipeline, I'm not getting any trouble. I compiled it also on a Mac and it is working correctly. Do you have any hint on how to solve the issue? Thanks a lot Luca --- _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://www.vtk.org/mailman/listinfo/vtkusers -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tim.Eade at ccfe.ac.uk Wed Jul 30 11:02:53 2014 From: Tim.Eade at ccfe.ac.uk (Eade, Tim) Date: Wed, 30 Jul 2014 15:02:53 +0000 Subject: [vtkusers] Quadratic Pentahedrons Message-ID: <86720CEB7DB11A42AB0DEDBA5AD2A48709ED9FDC@MSRV-EXCH01.ccfepc.ccfe.ac.uk> Does anybody know if there is a way to use quadratic pentahedral (wedges and pyramids) elements in a VTK file with an unstructured grid. I have had a look in the VTK File Formats document and it only lists cell types for quadratic hexahedral and tetrahedral 3D elements. Thanks, Tim Eade Culham Centre for Fusion Energy Culham Science Centre Abingdon OX14 3DB Tel: +44(0)1235 466911 Email: tim.eade at ccfe.ac.uk Web: www.ccfe.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.thompson at kitware.com Wed Jul 30 15:29:21 2014 From: david.thompson at kitware.com (David Thompson) Date: Wed, 30 Jul 2014 15:29:21 -0400 Subject: [vtkusers] Quadratic Pentahedrons In-Reply-To: <86720CEB7DB11A42AB0DEDBA5AD2A48709ED9FDC@MSRV-EXCH01.ccfepc.ccfe.ac.uk> References: <86720CEB7DB11A42AB0DEDBA5AD2A48709ED9FDC@MSRV-EXCH01.ccfepc.ccfe.ac.uk> Message-ID: <5CACD29C-D11E-4561-8A2E-7C4F00EC270E@kitware.com> Hi Tim, There are vtkQuadraticPyramid and vtkQuadraticWedge classes in VTK/Common/DataModel. As far as how the nodes are ordered, you are probably best off creating some simple elements with a python script, saving the result and examining the resulting file. You might also see if there are any tests that use those classes listed in the doxygen documentation. David On Jul 30, 2014, at 11:02 AM, Eade, Tim wrote: > Does anybody know if there is a way to use quadratic pentahedral (wedges and pyramids) elements in a VTK file with an unstructured grid. I have had a look in the VTK File Formats document and it only lists cell types for quadratic hexahedral and tetrahedral 3D elements. > > Thanks, > > Tim Eade > > Culham Centre for Fusion Energy > Culham Science Centre > Abingdon > OX14 3DB > > Tel: +44(0)1235 466911 > Email: tim.eade at ccfe.ac.uk > Web: www.ccfe.ac.uk > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers From aur.marsan at gmail.com Wed Jul 30 15:45:51 2014 From: aur.marsan at gmail.com (=?UTF-8?Q?Aur=C3=A9lien_Marsan?=) Date: Wed, 30 Jul 2014 15:45:51 -0400 Subject: [vtkusers] vtkPolydata vs. vtkUnstructuredGrid Message-ID: Dear Paraview users, and VTK users I want to build a vtkUnstructuredGrid from several numpy arrays, which contains the points coordinates, the cells, cells locations, cells types etc... So : I have all informations that are needed. vtkPolyData seems a lot easier to define through a python script. But : what is the fundamental difference between vtkPolyData and vtkUnstructuredGrid ? What should be the criterion in order to choose on of these two types ? Many thanks in advance, Regards, Aur?lien -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.thompson at kitware.com Wed Jul 30 16:06:39 2014 From: david.thompson at kitware.com (David Thompson) Date: Wed, 30 Jul 2014 16:06:39 -0400 Subject: [vtkusers] [Paraview] vtkPolydata vs. vtkUnstructuredGrid In-Reply-To: References: Message-ID: Hi Aur?lien, The conceptual difference between the two is that unstructured grids can have volumetric cells while polydata cannot. David PS. Eliminating paraview list from reply... please don't mail both lists. On Jul 30, 2014, at 3:45 PM, Aur?lien Marsan wrote: > Dear Paraview users, and VTK users > > I want to build a vtkUnstructuredGrid from several numpy arrays, which contains the points coordinates, the cells, cells locations, cells types etc... > So : I have all informations that are needed. > > vtkPolyData seems a lot easier to define through a python script. > > But : what is the fundamental difference between vtkPolyData and vtkUnstructuredGrid ? > What should be the criterion in order to choose on of these two types ? > > Many thanks in advance, > Regards, > > Aur?lien > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/paraview From aur.marsan at gmail.com Wed Jul 30 16:08:27 2014 From: aur.marsan at gmail.com (=?UTF-8?Q?Aur=C3=A9lien_Marsan?=) Date: Wed, 30 Jul 2014 16:08:27 -0400 Subject: [vtkusers] [Paraview] vtkPolydata vs. vtkUnstructuredGrid In-Reply-To: References: Message-ID: Hi David, Ok, Thank you ! So in my case, I need a vtkUnstructuredGrid. Sorry for the lists. Regards, Aur?lien 2014-07-30 16:06 GMT-04:00 David Thompson : > Hi Aur?lien, > > The conceptual difference between the two is that unstructured grids can > have volumetric cells while polydata cannot. > > David > > PS. Eliminating paraview list from reply... please don't mail both lists. > > On Jul 30, 2014, at 3:45 PM, Aur?lien Marsan wrote: > > > Dear Paraview users, and VTK users > > > > I want to build a vtkUnstructuredGrid from several numpy arrays, which > contains the points coordinates, the cells, cells locations, cells types > etc... > > So : I have all informations that are needed. > > > > vtkPolyData seems a lot easier to define through a python script. > > > > But : what is the fundamental difference between vtkPolyData and > vtkUnstructuredGrid ? > > What should be the criterion in order to choose on of these two types ? > > > > Many thanks in advance, > > Regards, > > > > Aur?lien > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > > > Please keep messages on-topic and check the ParaView Wiki at: > http://paraview.org/Wiki/ParaView > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/paraview > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aur.marsan at gmail.com Wed Jul 30 17:07:46 2014 From: aur.marsan at gmail.com (=?UTF-8?Q?Aur=C3=A9lien_Marsan?=) Date: Wed, 30 Jul 2014 17:07:46 -0400 Subject: [vtkusers] Python-VTK : Defining the cells of a vtkUnstructuredGrid Message-ID: Hi all, I am still facing some issues in order to build a vtkUnstructuredGrid from numpy arrays. I have read the example, that shows how to build a vtkUnstructuredGrid cell by cell : http://vtk.org/gitweb?p=VTK.git;a=blob;f=Examples/DataManipulation/Python/pointToCellData.py But in my case, I have large numpy arrays which contains - the points coordinates - the cell types - the definition of cells (npts,p0,p1,...p(npts-1) and I would like to avoid any loops in the python code. Then, I tried the following code, where - contains the definition of the cells (npts,p0,p1,...p(npts-1) - contains the index of the cells in the array - is an array of integer that describes the types of the cells bloc = vtk.vtkUnstructuredGrid() > > > vtkArray = numpy_support.numpy_to_vtk(numpy.ascontiguousarray(coords), > deep = 1) > points = vtk.vtkPoints() > points.SetData(vtkArray) > > bloc.SetPoints(points) > > vtkCells = vtk.vtkCellArray() > vtkCells.SetCells(number_of_cells, numpy_support.numpy_to_vtk(cells, > deep = 1, array_type = vtk.vtkIdTypeArray().GetDataType())) bloc.SetCells( > numpy_support.numpy_to_vtk(cellslocations, deep = 1, array_type = > vtk.vtkUnsignedCharArray().GetDataType()), > numpy_support.numpy_to_vtk(cellstypes, deep = 1, array_type = > vtk.vtkIdTypeArray().GetDataType()), > vtkCells > ) > bloc.Update() > bloc.UpdateData() > print bloc > return bloc > This code works. But when I am trying to cut the resulting block using a VTKCutter, I have the following error message: > Generic Warning: In > /home/builder/pisi/tmp/VTK-5.6.0-2/work/VTK/Graphics/vtkContourGrid.cxx, > line 195 > Unknown cell type 171 > It is obvious that I do something wrong.... But I can not find where. Do you have some advice ? is it really possible to define an unstructured grid like this, avoiding any python loop ? Many thanks in advance, Regards, Aur?lien -------------- next part -------------- An HTML attachment was scrubbed... URL: From aur.marsan at gmail.com Wed Jul 30 17:29:51 2014 From: aur.marsan at gmail.com (=?UTF-8?Q?Aur=C3=A9lien_Marsan?=) Date: Wed, 30 Jul 2014 17:29:51 -0400 Subject: [vtkusers] Python-VTK : Defining the cells of a vtkUnstructuredGrid In-Reply-To: References: Message-ID: Ok, found it. It was not a big issue... ! Just had to take a look on the help. I had to switch to lines in the SetCells method, according to the description in the help. bloc.SetCells( > numpy_support.numpy_to_vtk(cellslocations, deep = 1, array_type = > vtk.vtkUnsignedCharArray().GetDataType()), > numpy_support.numpy_to_vtk(cellstypes, deep = 1, array_type = > vtk.vtkIdTypeArray().GetDataType()), > vtkCells > ) becomes : bloc.SetCells( > numpy_support.numpy_to_vtk(cellstypes, deep = 1, array_type = > vtk.vtkUnsignedCharArray().GetDataType()), > numpy_support.numpy_to_vtk(cellslocations, deep = 1, array_type = > vtk.vtkIdTypeArray().GetDataType()), > vtkCells > ) > (note the switch between cellstypes and cellslocations in the method) All is working well now. Sorry for the email. (but an example of defining an UnstructuredGrid from numpy arrays is now online) Regards, Aur?lien 2014-07-30 17:07 GMT-04:00 Aur?lien Marsan : > Hi all, > > I am still facing some issues in order to build a vtkUnstructuredGrid from > numpy arrays. > > I have read the example, that shows how to build a vtkUnstructuredGrid > cell by cell : > > http://vtk.org/gitweb?p=VTK.git;a=blob;f=Examples/DataManipulation/Python/pointToCellData.py > > But in my case, I have large numpy arrays which contains > - the points coordinates > - the cell types > - the definition of cells (npts,p0,p1,...p(npts-1) > > and I would like to avoid any loops in the python code. > > Then, I tried the following code, where > > - contains the definition of the cells (npts,p0,p1,...p(npts-1) > - contains the index of the cells in the array > - is an array of integer that describes the types of the > cells > > bloc = vtk.vtkUnstructuredGrid() >> >> >> vtkArray = >> numpy_support.numpy_to_vtk(numpy.ascontiguousarray(coords), deep = 1) >> points = vtk.vtkPoints() >> points.SetData(vtkArray) >> >> bloc.SetPoints(points) >> >> vtkCells = vtk.vtkCellArray() >> vtkCells.SetCells(number_of_cells, numpy_support.numpy_to_vtk(cells, >> deep = 1, array_type = vtk.vtkIdTypeArray().GetDataType())) > > bloc.SetCells( >> numpy_support.numpy_to_vtk(cellslocations, deep = 1, array_type = >> vtk.vtkUnsignedCharArray().GetDataType()), >> numpy_support.numpy_to_vtk(cellstypes, deep = 1, array_type = >> vtk.vtkIdTypeArray().GetDataType()), >> vtkCells >> ) >> bloc.Update() >> bloc.UpdateData() >> print bloc >> return bloc >> > > This code works. But when I am trying to cut the resulting block using a > VTKCutter, I have the following error message: > >> Generic Warning: In >> /home/builder/pisi/tmp/VTK-5.6.0-2/work/VTK/Graphics/vtkContourGrid.cxx, >> line 195 >> Unknown cell type 171 >> > > It is obvious that I do something wrong.... But I can not find where. > Do you have some advice ? > is it really possible to define an unstructured grid like this, avoiding > any python loop ? > > Many thanks in advance, > > Regards, > > Aur?lien > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amb2189 at rit.edu Wed Jul 30 19:02:06 2014 From: amb2189 at rit.edu (Citizen Snips) Date: Wed, 30 Jul 2014 16:02:06 -0700 (PDT) Subject: [vtkusers] Urgent: vtkImageActor not rendering Message-ID: <1406761326125-5728031.post@n5.nabble.com> I'm currently stuck upon an issue with a deadline in a week and I could really use some assistance. I implemented, initially in Python now ported to C++, a program to display two side-by-side renders of a model overlayed on two webcam feeds. In Python, this was working wonderfully. The video filled the entire viewport on each side and the models rendered perfectly. However, now that I'm in C++, the videos do not render and I cannot figure out why. To first detail my class structure, I have written a vtk3DRender class that utilizes a vtkCallbackCommand to call a non-member function TimerCallback. The trigger for this callback is a timer attached to the vtkRenderWindowInteractor I'm using. All render elements are private members of the vtk3DRender object. All configuration of render elements is done in the constructor. I'm acquiring the video using OpenCV to obtain a cv::Mat in TimerCallback which I then use as the c array to pass to a vtkImageImport. This vtkImageImport then passes its output to my vtkImageActor through a vtkImageFlip. In Python this worked great. However, now I'm just getting black in the background where there should be my webcam feed. Here's the relevant code: TimerCallback function: void TimerCallback(vtkObject* caller, long unsigned int eventId, void* clientData, void* callData) { // Set up reference to vtk3DRender object vtk3DRender* v3DR = reinterpret_cast(clientData); // Configure frame acquisition Mat frameL; v3DR->webcamL.read(frameL); if (frameL.empty()) return; //cvtColor(frameL, frameL, CV_BGR2RGB); // Pass frame data to pipeline and set modification flag v3DR->imgPort->SetImportVoidPointer(frameL.data); v3DR->imgPort->Modified(); v3DR->imgPort->Update(); // Set and print output positions of cams v3DR->camR->SetPosition(xyz[cur], xyz[cur+1], xyz[cur+2]); v3DR->camL->SetPosition(xyz[cur]+40, xyz[cur+1], xyz[cur+2]); cur+=3; // Rerender v3DR->iren->Render(); } Related code within initializer (Anything with suffix ___BGL is related to left webcam renderer and ___BGR is to right): { ... //Initialize left webcam (Right not yet implemented) webcamL = VideoCapture(0); Mat tmp; webcamL.read(tmp); // Initialize image importer for conversion from OpenCV format to VTK imgPort = vtkSmartPointer::New(); imgPort->SetDataSpacing(1,1,1); imgPort->SetDataOrigin(0,0,0); imgPort->SetWholeExtent(0, tmp.size().width-1, 0, tmp.size().height-1, 0, 0); imgPort->SetDataExtentToWholeExtent(); imgPort->SetDataScalarTypeToUnsignedChar(); imgPort->SetNumberOfScalarComponents(tmp.channels()); imgPort->SetImportVoidPointer(tmp.data); imgPort->Update(); // Initialize camera image inverter imgFlip = vtkSmartPointer::New(); imgFlip->SetInputData(imgPort->GetOutput()); imgFlip->SetFilteredAxis(1); // Assign updated camera data to background actors actorBGL->SetInputData(imgFlip->GetOutput()); actorBGR->SetInputData(imgFlip->GetOutput()); // Set image to fill screen double* origin = imgPort->GetOutput()->GetOrigin(); double* spacing = imgPort->GetOutput()->GetSpacing(); int* extent = imgPort->GetOutput()->GetExtent(); double xc = origin[0] + 0.5*(extent[0] + extent[1])*spacing[0]; double yc = origin[1] + 0.5*(extent[2] + extent[3])*spacing[1]; double xd = (extent[1] - extent[0] + 1)*spacing[0]; double yd = (extent[3] - extent[2] + 1)*spacing[1]; double d = camBGL->GetDistance(); camBGL->SetParallelScale(0.5*yd); camBGL->SetFocalPoint(xc,yc,0.0); camBGL->SetPosition(xc,yc,d); camBGR->SetParallelScale(0.5*yd); camBGR->SetFocalPoint(xc,yc,0.0); camBGR->SetPosition(xc,yc,d); // Begin rendering renWin->Render(); iren->Initialize(); cbc = vtkSmartPointer::New(); functiontype func = &TimerCallback; cbc->SetCallback(func); cbc->SetClientData(this); iren->AddObserver(vtkCommand::TimerEvent, cbc); iren->CreateRepeatingTimer(50); iren->Start(); } Any ideas? I would be incredibly thankful as this deadline is really pushing me hard and I've spent a day on this problem already. -- View this message in context: http://vtk.1045678.n5.nabble.com/Urgent-vtkImageActor-not-rendering-tp5728031.html Sent from the VTK - Users mailing list archive at Nabble.com. From david.gobbi at gmail.com Wed Jul 30 22:33:43 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Wed, 30 Jul 2014 20:33:43 -0600 Subject: [vtkusers] Urgent: vtkImageActor not rendering In-Reply-To: <1406761326125-5728031.post@n5.nabble.com> References: <1406761326125-5728031.post@n5.nabble.com> Message-ID: Did you forget imgFlip->Update()? On Wed, Jul 30, 2014 at 5:02 PM, Citizen Snips wrote: > I'm currently stuck upon an issue with a deadline in a week and I could > really use some assistance. I implemented, initially in Python now ported to > C++, a program to display two side-by-side renders of a model overlayed on > two webcam feeds. In Python, this was working wonderfully. The video filled > the entire viewport on each side and the models rendered perfectly. However, > now that I'm in C++, the videos do not render and I cannot figure out why. > > To first detail my class structure, I have written a vtk3DRender class that > utilizes a vtkCallbackCommand to call a non-member function TimerCallback. > The trigger for this callback is a timer attached to the > vtkRenderWindowInteractor I'm using. All render elements are private members > of the vtk3DRender object. All configuration of render elements is done in > the constructor. > > I'm acquiring the video using OpenCV to obtain a cv::Mat in TimerCallback > which I then use as the c array to pass to a vtkImageImport. This > vtkImageImport then passes its output to my vtkImageActor through a > vtkImageFlip. In Python this worked great. However, now I'm just getting > black in the background where there should be my webcam feed. > > Here's the relevant code: > > TimerCallback function: > > void TimerCallback(vtkObject* caller, long unsigned int eventId, void* > clientData, void* callData) > { > // Set up reference to vtk3DRender object > vtk3DRender* v3DR = > reinterpret_cast(clientData); > > // Configure frame acquisition > Mat frameL; > v3DR->webcamL.read(frameL); > if (frameL.empty()) > return; > //cvtColor(frameL, frameL, CV_BGR2RGB); > > // Pass frame data to pipeline and set modification flag > v3DR->imgPort->SetImportVoidPointer(frameL.data); > v3DR->imgPort->Modified(); > v3DR->imgPort->Update(); > > // Set and print output positions of cams > v3DR->camR->SetPosition(xyz[cur], xyz[cur+1], xyz[cur+2]); > v3DR->camL->SetPosition(xyz[cur]+40, xyz[cur+1], xyz[cur+2]); > cur+=3; > > // Rerender > v3DR->iren->Render(); > } > > > Related code within initializer (Anything with suffix ___BGL is related to > left webcam renderer and ___BGR is to right): > { > ... > //Initialize left webcam (Right not yet implemented) > webcamL = VideoCapture(0); > Mat tmp; > webcamL.read(tmp); > > // Initialize image importer for conversion from OpenCV format to > VTK > imgPort = vtkSmartPointer::New(); > imgPort->SetDataSpacing(1,1,1); > imgPort->SetDataOrigin(0,0,0); > imgPort->SetWholeExtent(0, tmp.size().width-1, 0, > tmp.size().height-1, 0, 0); > imgPort->SetDataExtentToWholeExtent(); > imgPort->SetDataScalarTypeToUnsignedChar(); > imgPort->SetNumberOfScalarComponents(tmp.channels()); > imgPort->SetImportVoidPointer(tmp.data); > imgPort->Update(); > > // Initialize camera image inverter > imgFlip = vtkSmartPointer::New(); > imgFlip->SetInputData(imgPort->GetOutput()); > imgFlip->SetFilteredAxis(1); > > // Assign updated camera data to background actors > actorBGL->SetInputData(imgFlip->GetOutput()); > actorBGR->SetInputData(imgFlip->GetOutput()); > > // Set image to fill screen > double* origin = imgPort->GetOutput()->GetOrigin(); > double* spacing = imgPort->GetOutput()->GetSpacing(); > int* extent = imgPort->GetOutput()->GetExtent(); > > double xc = origin[0] + 0.5*(extent[0] + > extent[1])*spacing[0]; > double yc = origin[1] + 0.5*(extent[2] + > extent[3])*spacing[1]; > double xd = (extent[1] - extent[0] + 1)*spacing[0]; > double yd = (extent[3] - extent[2] + 1)*spacing[1]; > double d = camBGL->GetDistance(); > camBGL->SetParallelScale(0.5*yd); > camBGL->SetFocalPoint(xc,yc,0.0); > camBGL->SetPosition(xc,yc,d); > camBGR->SetParallelScale(0.5*yd); > camBGR->SetFocalPoint(xc,yc,0.0); > camBGR->SetPosition(xc,yc,d); > > // Begin rendering > renWin->Render(); > iren->Initialize(); > > cbc = vtkSmartPointer::New(); > functiontype func = &TimerCallback; > cbc->SetCallback(func); > cbc->SetClientData(this); > iren->AddObserver(vtkCommand::TimerEvent, cbc); > iren->CreateRepeatingTimer(50); > iren->Start(); > } > > > Any ideas? I would be incredibly thankful as this deadline is really pushing > me hard and I've spent a day on this problem already. From hectordejea at gmail.com Thu Jul 31 05:30:14 2014 From: hectordejea at gmail.com (Hector Dejea) Date: Thu, 31 Jul 2014 11:30:14 +0200 Subject: [vtkusers] Select attribute (using vtkassignattribute?) to streamline Message-ID: Hi all, I have an unstructured grid with some features in it. It contains potential, joule heating and volume current in point data and geometryids in cell data (see some part of the print below). I am trying to represent volume current in my unstructured grid with the code below, but it returns an error, does anybody know if what I am missing or what is wrong? Thank you ERROR: In /home/hector/LOCAL/VTK-6.1.0/Filters/FlowPaths/vtkStreamer.cxx, line 502 vtkStreamLine (0x2441040): No vector data defined! vtkUnstructuredGrid (0x2429400) Data Released: False Global Release Data: Off Field Data: Debug: Off Modified Time: 258 Reference Count: 1 Registered Events: (none) Number Of Arrays: 0 Number Of Components: 0 Number Of Tuples: 0 Number Of Points: 5626103 Number Of Cells: 31639134 Cell Data: Number Of Arrays: 1 Array 0 name = GeometryIds Number Of Components: 1 Number Of Tuples: 31639134 Scalars: (none) Vectors: (none) Point Data: Number Of Arrays: 3 Array 0 name = potential Array 1 name = joule heating Array 2 name = volume current Number Of Components: 5 Number Of Tuples: 5626103 Scalars: Name: potential Data type: double Size: 5626103 MaxId: 5626102 NumberOfComponents: 1 Name: potential Number Of Components: 1 Number Of Tuples: 5626103 Vectors: Name: volume current Data type: double Size: 16878309 MaxId: 16878308 NumberOfComponents: 3 Name: volume current Number Of Components: 3 Number Of Tuples: 5626103 vtkRungeKutta4 *integ = vtkRungeKutta4::New(); vtkAssignAttribute* aa = vtkAssignAttribute::New(); aa->SetInputData(ugrid); aa->Assign("volume current", vtkDataSetAttributes::VECTORS, vtkAssignAttribute::POINT_DATA); vtkSmartPointer streamLine = vtkSmartPointer::New(); #if VTK_MAJOR_VERSION <= 5 streamLine->SetInputConnection(aa->GetOutputPort()); streamLine->SetSource(seeds->GetOutput()); #else reader->Update(); streamLine->SetInputData(aa->GetOutput()); streamLine->SetSourceData(seeds->GetOutput()); #endif streamLine->SetIntegrator(integ); streamLine->SetMaximumPropagationTime(200); streamLine->SetIntegrationStepLength(.2); streamLine->SetStepLength(.001); streamLine->SetNumberOfThreads(1); streamLine->SetIntegrationDirectionToIntegrateBothDirections(); streamLine->VorticityOn(); streamLine->Update(); vtkSmartPointer streamLineMapper = vtkSmartPointer::New(); streamLineMapper->SetInputConnection(streamLine->GetOutputPort()); vtkSmartPointer streamLineActor = vtkSmartPointer::New(); streamLineActor->SetMapper(streamLineMapper); streamLineActor->VisibilityOn(); -------------- next part -------------- An HTML attachment was scrubbed... URL: From da.angulo39 at uniandes.edu.co Thu Jul 31 08:44:42 2014 From: da.angulo39 at uniandes.edu.co (diego0020) Date: Thu, 31 Jul 2014 05:44:42 -0700 (PDT) Subject: [vtkusers] Status of VTK Python 3 wrapper support In-Reply-To: References: Message-ID: <1406810682351-5728034.post@n5.nabble.com> This is the last I read about this http://vtk.1045678.n5.nabble.com/Python-3-x-support-td5723643.html But I am also looking forward to this. Is there anything we could do to push support for python 3 forward? -- View this message in context: http://vtk.1045678.n5.nabble.com/Status-of-VTK-Python-3-wrapper-support-tp5727990p5728034.html Sent from the VTK - Users mailing list archive at Nabble.com. From amb2189 at rit.edu Thu Jul 31 10:53:31 2014 From: amb2189 at rit.edu (Alex Bensch) Date: Thu, 31 Jul 2014 07:53:31 -0700 (PDT) Subject: [vtkusers] Urgent: vtkImageActor not rendering In-Reply-To: References: <1406761326125-5728031.post@n5.nabble.com> Message-ID: <1406818411811-5728035.post@n5.nabble.com> Wow, that actually worked. I didn't need to do that in the Python version at all. This whole pipeline thing throws me off so badly. Thanks a bunch! -- View this message in context: http://vtk.1045678.n5.nabble.com/Urgent-vtkImageActor-not-rendering-tp5728031p5728035.html Sent from the VTK - Users mailing list archive at Nabble.com. From mark.hammons at inaf.cnrs-gif.fr Thu Jul 31 11:39:55 2014 From: mark.hammons at inaf.cnrs-gif.fr (MarkHammons) Date: Thu, 31 Jul 2014 08:39:55 -0700 (PDT) Subject: [vtkusers] VtkPanel in java vtk bindings not being collected? Message-ID: <1406821194530-5728036.post@n5.nabble.com> Here's my code (in scala): http://pastie.org/9434555 The class above creates a simple viewing window for structuredpoints data it's initialized with. When switching images, my program currently unhooks the ImageViewer and disposes of any references to it. It also calls the end() method that you see in the code. The result is the ImageViewer and a large number of the vtk objects are cleaned up by the garbage collector EXCEPT the opengl lights, the renderer and renderwindow, and most confusingly of all, the vtkpane. According to visualvm's heap dump inspection, when vtkPanel is not being collected by the garbage collector, there is no references to it on the java side to keep it alive. Even the parent class ImageViewer is collected. Am I missing some special command I need to call to get VtkPanel to deallocate properly? -- View this message in context: http://vtk.1045678.n5.nabble.com/VtkPanel-in-java-vtk-bindings-not-being-collected-tp5728036.html Sent from the VTK - Users mailing list archive at Nabble.com. From sebastien.jourdain at kitware.com Thu Jul 31 11:46:15 2014 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Thu, 31 Jul 2014 09:46:15 -0600 Subject: [vtkusers] VtkPanel in java vtk bindings not being collected? In-Reply-To: <1406821194530-5728036.post@n5.nabble.com> References: <1406821194530-5728036.post@n5.nabble.com> Message-ID: There is a Delete() method on it. But on Linux, vtkPanel leak to prevent a crash. public void Delete() { if(rendering) { return; } rendering = true; // We prevent any further rendering if (this.getParent() != null) { this.getParent().remove(this); } // Free internal VTK objects ren = null; cam = null; lgt = null; // On linux we prefer to have a memory leak instead of a crash if(!rw.GetClassName().equals("vtkXOpenGLRenderWindow")) { rw = null; } else { System.out.println("The renderwindow has been kept arount to prevent a crash"); } } On Thu, Jul 31, 2014 at 9:39 AM, MarkHammons wrote: > Here's my code (in scala): http://pastie.org/9434555 > > The class above creates a simple viewing window for structuredpoints data > it's initialized with. When switching images, my program currently unhooks > the ImageViewer and disposes of any references to it. It also calls the > end() method that you see in the code. The result is the ImageViewer and a > large number of the vtk objects are cleaned up by the garbage collector > EXCEPT the opengl lights, the renderer and renderwindow, and most > confusingly of all, the vtkpane. According to visualvm's heap dump > inspection, when vtkPanel is not being collected by the garbage collector, > there is no references to it on the java side to keep it alive. Even the > parent class ImageViewer is collected. > > Am I missing some special command I need to call to get VtkPanel to > deallocate properly? > > > > > -- > View this message in context: > http://vtk.1045678.n5.nabble.com/VtkPanel-in-java-vtk-bindings-not-being-collected-tp5728036.html > Sent from the VTK - Users mailing list archive at Nabble.com. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/vtkusers > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastien.jourdain at kitware.com Thu Jul 31 11:57:17 2014 From: sebastien.jourdain at kitware.com (Sebastien Jourdain) Date: Thu, 31 Jul 2014 09:57:17 -0600 Subject: [vtkusers] VtkPanel in java vtk bindings not being collected? In-Reply-To: <23846354.WBJ58AdeWG@localhost.localdomain> References: <1406821194530-5728036.post@n5.nabble.com> <23846354.WBJ58AdeWG@localhost.localdomain> Message-ID: If you remove the panel from its parent and call Delete(), that might solve your premature exit of the delete method. Seb PS: Put the list back in the loop. On Thu, Jul 31, 2014 at 9:51 AM, Mark Edgar Hammons II < mark.hammons at inaf.cnrs-gif.fr> wrote: > On Thursday, July 31, 2014 09:46:15 AM you wrote: > > There is a Delete() method on it. But on Linux, vtkPanel leak to prevent > a > > crash. > > > See, I'd been looking into that, but the print statement is never executed > on > my machine, which suggests to me that it escapes at `if(rendering) return;` > always when I call Delete. Is there a way to force the panel to enter a > state > where at least its children (the renderer, renderwindow, etc) can be > collected? They aren't at all unless I intentionally go through and > manually > delete them all, and even then I still have 4 or 5 objects leaked per panel > created. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.hammons at inaf.cnrs-gif.fr Thu Jul 31 12:33:50 2014 From: mark.hammons at inaf.cnrs-gif.fr (Mark Edgar Hammons II) Date: Thu, 31 Jul 2014 18:33:50 +0200 Subject: [vtkusers] VtkPanel in java vtk bindings not being collected? In-Reply-To: References: <1406821194530-5728036.post@n5.nabble.com> <2101652.Rah5g3kh51@localhost.localdomain> Message-ID: <2452829.XtvyDjhH1V@localhost.localdomain> On Thursday, July 31, 2014 10:19:23 AM you wrote: > How do you run the VTK garbage collector? Right now I have it set to automated mode with this: vtk.vtkObject.JAVA_OBJECT_MANAGER.getAutoGarbageCollector().SetAutoGarbageCollection(true) vtk.vtkObject.JAVA_OBJECT_MANAGER.getAutoGarbageCollector().SetScheduleTime(1, TimeUnit.SECONDS) vtk.vtkObject.JAVA_OBJECT_MANAGER.getAutoGarbageCollector().SetDebug(true) but I've tried with manually invoking the vtk GC, and I get the same results. From mark.hammons at inaf.cnrs-gif.fr Thu Jul 31 12:33:23 2014 From: mark.hammons at inaf.cnrs-gif.fr (Mark Edgar Hammons II) Date: Thu, 31 Jul 2014 18:33:23 +0200 Subject: [vtkusers] VtkPanel in java vtk bindings not being collected? In-Reply-To: References: <1406821194530-5728036.post@n5.nabble.com> Message-ID: <8905867.PFbTUNXLZk@localhost.localdomain> On Thursday, July 31, 2014 09:46:15 AM you wrote: > There is a Delete() method on it. But on Linux, vtkPanel leak to prevent a > crash. See, I'd been looking into that, but the print statement is never executed on my machine, which suggests to me that it escapes at `if(rendering) return;` always when I call Delete. Is there a way to force the panel to enter a state where at least its children (the renderer, renderwindow, etc) can be collected? They aren't at all unless I intentionally go through and manually delete them all, and even then I still have 4 or 5 objects leaked per panel created. From mark.hammons at inaf.cnrs-gif.fr Thu Jul 31 12:33:39 2014 From: mark.hammons at inaf.cnrs-gif.fr (Mark Edgar Hammons II) Date: Thu, 31 Jul 2014 18:33:39 +0200 Subject: [vtkusers] VtkPanel in java vtk bindings not being collected? In-Reply-To: References: <1406821194530-5728036.post@n5.nabble.com> <23846354.WBJ58AdeWG@localhost.localdomain> Message-ID: <2000246.DN1tVGzaQn@localhost.localdomain> I do and it doesn't. I've also tried setting the pane to invisible to halt rendering, and nothing. You can see what I try in the end() method of the ImageViewer class I linked. On Thursday, July 31, 2014 09:57:17 AM you wrote: > If you remove the panel from its parent and call Delete(), that might solve > your premature exit of the delete method. > > Seb > > PS: Put the list back in the loop. > > > On Thu, Jul 31, 2014 at 9:51 AM, Mark Edgar Hammons II < > > mark.hammons at inaf.cnrs-gif.fr> wrote: > > On Thursday, July 31, 2014 09:46:15 AM you wrote: > > > There is a Delete() method on it. But on Linux, vtkPanel leak to prevent > > > > a > > > > > crash. > > > > See, I'd been looking into that, but the print statement is never executed > > on > > my machine, which suggests to me that it escapes at `if(rendering) > > return;` > > always when I call Delete. Is there a way to force the panel to enter a > > state > > where at least its children (the renderer, renderwindow, etc) can be > > collected? They aren't at all unless I intentionally go through and > > manually > > delete them all, and even then I still have 4 or 5 objects leaked per > > panel > > created. From amb2189 at rit.edu Thu Jul 31 13:36:59 2014 From: amb2189 at rit.edu (ALEXANDER BENSCH (RIT Student)) Date: Thu, 31 Jul 2014 13:36:59 -0400 Subject: [vtkusers] Urgent: vtkImageActor not rendering In-Reply-To: References: <1406761326125-5728031.post@n5.nabble.com> <1406818411811-5728035.post@n5.nabble.com> Message-ID: Don't worry, I'll CC the group here and hopefully the reply chain will get included On Thu, Jul 31, 2014 at 12:45 PM, David Gobbi wrote: > Oops, I meant to send that to the whole list! Oh well... > > On Thu, Jul 31, 2014 at 9:50 AM, ALEXANDER BENSCH (RIT Student) > wrote: > > Oh, interesting. I didn't realize that, but it's really useful to know. > > Thanks again. > > > > > > On Thu, Jul 31, 2014 at 11:08 AM, David Gobbi > wrote: > >> > >> On Thu, Jul 31, 2014 at 8:53 AM, Alex Bensch wrote: >> > > Did you forget imgFlip->Update()? >> > Wow, that actually worked. I didn't need to do that in the Python > version at > >> > all. This whole pipeline thing throws me off so badly. Thanks a bunch! > >> > >> In VTK 6, if you want a real pipeline connection, you need to call > >> SetInputConnection() instead of SetInputData(). > >> > >> The major change with the pipeline in VTK 6 is that GetOutput() > >> no longer gives you a pipeline connection. You _must_ call > >> GetOutputPort() if you want a pipeline connection. This allows > >> you to choose whether to use VTK in imperative mode (where > >> you use GetOutput() but must call Update() yourself), or whether > >> to use VTK in pipeline mode (where you use GetOutputPort() and > >> upstream updates occur automatically). > >> > >> - David > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From the.1.lily at hotmail.com Thu Jul 31 15:47:25 2014 From: the.1.lily at hotmail.com (the lily) Date: Thu, 31 Jul 2014 22:47:25 +0300 Subject: [vtkusers] vtk headers displays: file not found Message-ID: Hi, I'm using mac osx 10.9 " Mavericks", Im trying to run a code that include the following headers, #include "vtkConeSource.h"#include "vtkCylinderSource.h" #include "vtkPolyData.h"#include "vtkPolyDataMapper.h"#include "vtkRenderWindow.h"#include "vtkCamera.h"#include "vtkActor.h"#include "vtkRenderer.h"#include "vtkRenderWindowInteractor.h"#include "vtkProperty.h"#include "vtkCallbackCommand.h"#include "vtkCommand.h"#include "vtkRendererCollection.h"#include "vtkFloatArray.h"#include "vtkCellArray.h" When I try to run the code it displays the following mpicxx -c -g -Wno-deprecated -I../../../include -I/Users/lab/software/VTK/include/vtk-5.8 d3.cpp d3.cpp:20:10: fatal error: 'vtkCylinderSource.h' file not found #include "vtkCylinderSource.h" ^ 1 error generated. make: *** [d3.o] Error 1 I installed vtk by following the steps in this link http://www.developers-life.com/configuring-and-compiling-vtk-6-1-on-mac-os-x-simple-example-of-vtk-usage.html I do not know what is going wrong and I was not lucky to find any solution online. I hope someone can help me. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.gobbi at gmail.com Thu Jul 31 16:15:27 2014 From: david.gobbi at gmail.com (David Gobbi) Date: Thu, 31 Jul 2014 14:15:27 -0600 Subject: [vtkusers] Status of VTK Python 3 wrapper support In-Reply-To: <1406810682351-5728034.post@n5.nabble.com> References: <1406810682351-5728034.post@n5.nabble.com> Message-ID: On Thu, Jul 31, 2014 at 6:44 AM, diego0020 wrote: > > But I am also looking forward to this. Is there anything we could do to push > support for python 3 forward? There has been some discussion about converting all of the python tests and examples, which is a part of the process where extra manpower would be a big asset. I imagine that the conversion will go something like this: 1) Someone will run 2to3 on all the python code, and then make sure that it can be byte-compiled with python3 (it will be too early at this stage to actually run the code, but making sure that it byte-compiles will be a good first step). 2) Lots of people will then pick through the code to fix conversion errors and to make sure that the code actually looks like good python3 code. 3) Finally, someone will add some CMake magic to VTK so that if VTK is built against python2, cmake will run 3to2 on all of these new python3 files and put the equivalent python2 code into the VTK build directory. This is the magic that is needed to make sure that VTK will be able to support both python2 and python3. So any assistance with the above process would be a big help. In particular, it would be very useful if someone could verify that item (3) is even feasible: in the end it might be necessary to have hand- written python2 and python3 exist side-by-side instead of using automatic conversion. It _should_ be feasible, since the VTK tests used automated tcl-to-python conversion for many years, and python3 to python2 should be much easier than tcl to python. - David From MEEHANBT at nv.doe.gov Thu Jul 31 16:49:39 2014 From: MEEHANBT at nv.doe.gov (Meehan, Bernard) Date: Thu, 31 Jul 2014 20:49:39 +0000 Subject: [vtkusers] vtk headers displays: file not found In-Reply-To: <7FC4411223W820884-01@EMF_nv.doe.gov> References: <7FC4411223W820884-01@EMF_nv.doe.gov> Message-ID: It sounds like you don't have your environment set up correctly. I run OS X Lion, and I have VTK installed in "~/VTK" and I do both C++ and Python development using VTK. My ".bash_profile" is: export VTK=~/VTK export PATH=$PATH:$VTK/bin export PYTHONPATH=$PYTHONPATH:$VTK/lib/python2.7/site-packages export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$VTK/lib export PATH=$PATH:/Applications/CMake.app/Contents/bin export MANPATH=$MANPATH:/Applications/CMake.app/Contents/man If that doesn't work, let us see your environment setup, and where you put VTK at. I tried to load your link and couldn't get to the page. It is VERY likely that the problem is on my end. From: the lily > Date: Thursday, July 31, 2014 12:47 PM To: "vtkusers at vtk.org" > Subject: [vtkusers] vtk headers displays: file not found Hi, I'm using mac osx 10.9 " Mavericks", Im trying to run a code that include the following headers, #include "vtkConeSource.h" #include "vtkCylinderSource.h" #include "vtkPolyData.h" #include "vtkPolyDataMapper.h" #include "vtkRenderWindow.h" #include "vtkCamera.h" #include "vtkActor.h" #include "vtkRenderer.h" #include "vtkRenderWindowInteractor.h" #include "vtkProperty.h" #include "vtkCallbackCommand.h" #include "vtkCommand.h" #include "vtkRendererCollection.h" #include "vtkFloatArray.h" #include "vtkCellArray.h" When I try to run the code it displays the following mpicxx -c -g -Wno-deprecated -I../../../include -I/Users/lab/software/VTK/include/vtk-5.8 d3.cpp d3.cpp:20:10: fatal error: 'vtkCylinderSource.h' file not found #include "vtkCylinderSource.h" ^ 1 error generated. make: *** [d3.o] Error 1 I installed vtk by following the steps in this link http://www.developers-life.com/configuring-and-compiling-vtk-6-1-on-mac-os-x-simple-example-of-vtk-usage.html I do not know what is going wrong and I was not lucky to find any solution online. I hope someone can help me. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From MEEHANBT at nv.doe.gov Thu Jul 31 17:06:30 2014 From: MEEHANBT at nv.doe.gov (Meehan, Bernard) Date: Thu, 31 Jul 2014 21:06:30 +0000 Subject: [vtkusers] vtk headers displays: file not found In-Reply-To: <7FC4411223W820884-01@EMF_nv.doe.gov> References: <7FC4411223W820884-01@EMF_nv.doe.gov> Message-ID: Ok - I'm not proficient at MPI development, but I tried to hack together a CMakeLists.txt file that worked on my system. I used the CMakeLists.txt here as an example: http://www.cmake.org/pipermail/cmake/2011-June/045037.html I then tried to get an example to compile (http://www.vtk.org/Wiki/VTK/Examples/Cxx/Filtering/Delaunay2D) I used this as a CMakeLists.txt, and when I ran it with mpiexec, I got 8 copies of the tutorial: cmake_minimum_required(VERSION 2.8) project(Delaunay2D) find_package(MPI REQUIRED) find_package(VTK REQUIRED) include_directories(${MPI_INCLUDE_PATH}) include(${VTK_USE_FILE}) add_executable(Delaunay2D MACOSX_BUNDLE Delaunay2D) target_link_libraries(Delaunay2D ${MPI_LIBRARIES}) if(MPI_COMPILE_FLAGS) set_target_properties(Delaunay2D PROPERTIES COMPILE_FLAGS "${MPI_COMPILE_FLAGS}") endif() if(MPI_LINK_FLAGS) set_target_properties(Delaunay2D PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}") endif() if(VTK_LIBRARIES) target_link_libraries(Delaunay2D ${VTK_LIBRARIES}) else() target_link_libraries(Delaunay2D vtkHybrid vtkWidgets) endif() From: the lily > Date: Thursday, July 31, 2014 12:47 PM To: "vtkusers at vtk.org" > Subject: [vtkusers] vtk headers displays: file not found Hi, I'm using mac osx 10.9 " Mavericks", Im trying to run a code that include the following headers, #include "vtkConeSource.h" #include "vtkCylinderSource.h" #include "vtkPolyData.h" #include "vtkPolyDataMapper.h" #include "vtkRenderWindow.h" #include "vtkCamera.h" #include "vtkActor.h" #include "vtkRenderer.h" #include "vtkRenderWindowInteractor.h" #include "vtkProperty.h" #include "vtkCallbackCommand.h" #include "vtkCommand.h" #include "vtkRendererCollection.h" #include "vtkFloatArray.h" #include "vtkCellArray.h" When I try to run the code it displays the following mpicxx -c -g -Wno-deprecated -I../../../include -I/Users/lab/software/VTK/include/vtk-5.8 d3.cpp d3.cpp:20:10: fatal error: 'vtkCylinderSource.h' file not found #include "vtkCylinderSource.h" ^ 1 error generated. make: *** [d3.o] Error 1 I installed vtk by following the steps in this link http://www.developers-life.com/configuring-and-compiling-vtk-6-1-on-mac-os-x-simple-example-of-vtk-usage.html I do not know what is going wrong and I was not lucky to find any solution online. I hope someone can help me. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From the.1.lily at hotmail.com Thu Jul 31 18:53:28 2014 From: the.1.lily at hotmail.com (the lily) Date: Fri, 1 Aug 2014 01:53:28 +0300 Subject: [vtkusers] vtk headers displays: file not found In-Reply-To: References: <7FC4411223W820884-01@EMF_nv.doe.gov>, Message-ID: Hi, How can I know that I installed vtk right?I'm typing which vtk and I'm not getting anything back. this is how I installed vtk ccmake . -G "UNIX Makefiles" -DVTK_USE_QVTK:BOOL=ON -DVTK_USE_COCOA:BOOL=ON -DVTK_USE_CARBON:BOOL=OFF -DCMAKE_OSX_ARCHITECTURES:STRING=x86_64 -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=OFF I installed version 6.1 Thanks From: MEEHANBT at nv.doe.gov To: the.1.lily at hotmail.com; vtkusers at vtk.org Subject: Re: [vtkusers] vtk headers displays: file not found Date: Thu, 31 Jul 2014 20:49:39 +0000 It sounds like you don't have your environment set up correctly. I run OS X Lion, and I have VTK installed in "~/VTK" and I do both C++ and Python development using VTK. My ".bash_profile" is: export VTK=~/VTK export PATH=$PATH:$VTK/bin export PYTHONPATH=$PYTHONPATH:$VTK/lib/python2.7/site-packages export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$VTK/lib export PATH=$PATH:/Applications/CMake.app/Contents/bin export MANPATH=$MANPATH:/Applications/CMake.app/Contents/man If that doesn't work, let us see your environment setup, and where you put VTK at. I tried to load your link and couldn't get to the page. It is VERY likely that the problem is on my end. From: the lily Date: Thursday, July 31, 2014 12:47 PM To: "vtkusers at vtk.org" Subject: [vtkusers] vtk headers displays: file not found Hi, I'm using mac osx 10.9 " Mavericks", Im trying to run a code that include the following headers, #include "vtkConeSource.h" #include "vtkCylinderSource.h" #include "vtkPolyData.h" #include "vtkPolyDataMapper.h" #include "vtkRenderWindow.h" #include "vtkCamera.h" #include "vtkActor.h" #include "vtkRenderer.h" #include "vtkRenderWindowInteractor.h" #include "vtkProperty.h" #include "vtkCallbackCommand.h" #include "vtkCommand.h" #include "vtkRendererCollection.h" #include "vtkFloatArray.h" #include "vtkCellArray.h" When I try to run the code it displays the following mpicxx -c -g -Wno-deprecated -I../../../include -I/Users/lab/software/VTK/include/vtk-5.8 d3.cpp d3.cpp:20:10: fatal error: 'vtkCylinderSource.h' file not found #include "vtkCylinderSource.h" ^ 1 error generated. make: *** [d3.o] Error 1 I installed vtk by following the steps in this link http://www.developers-life.com/configuring-and-compiling-vtk-6-1-on-mac-os-x-simple-example-of-vtk-usage.html I do not know what is going wrong and I was not lucky to find any solution online. I hope someone can help me. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From MEEHANBT at nv.doe.gov Thu Jul 31 19:09:45 2014 From: MEEHANBT at nv.doe.gov (Meehan, Bernard) Date: Thu, 31 Jul 2014 23:09:45 +0000 Subject: [vtkusers] vtk headers displays: file not found In-Reply-To: <7FC4177C23W833154-01@EMF_nv.doe.gov> References: <7FC4411223W820884-01@EMF_nv.doe.gov> <7FC4177C23W833154-01@EMF_nv.doe.gov> Message-ID: I'm not sure that anyone gets anything back when they type: `which vtk` - you might get something for `which vtkpython` if you built the Python wrappers though. I believe that the only issue I had with Mavericks was that there was an advanced option that I had to remove from an option. This is discussed here: http://public.kitware.com/pipermail/vtkusers/2014-March/083368.html. If you don't remove the -fobjc-gc from VTK_REQUIRED_OBJCXX_FLAGS, you'll have another confusing problem. For what it's worth, my ccmake line was something like this: ccmake .. -Wno_dev -DCMAKE_INSTALL_PREFIX=~/VTK (and then I changed some stuff in the interface, mentioned in the link above) The ccmake line you used doesn't look like there is anything wrong with it, but I didn't personally try it. Probably the best way to check out if you're set up correctly is to download one of the example programs from the VTK wiki, such as: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Meshes/SolidClip and just follow the directions. They're pretty painless to download and try, and it is probably the best way to start learning it. If you're very new - like me - I would also recommend the User's Guide. A few dollars spent now is probably worth many many many frustrating hours staring at your terminal. http://www.vtk.org/VTK/help/book.html From: the lily > Date: Thursday, July 31, 2014 3:53 PM To: Tim Meehan >, "vtkusers at vtk.org" > Subject: RE: [vtkusers] vtk headers displays: file not found Hi, How can I know that I installed vtk right? I'm typing which vtk and I'm not getting anything back. this is how I installed vtk ccmake . -G "UNIX Makefiles" -DVTK_USE_QVTK:BOOL=ON -DVTK_USE_COCOA:BOOL=ON -DVTK_USE_CARBON:BOOL=OFF -DCMAKE_OSX_ARCHITECTURES:STRING=x86_64 -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=OFF I installed version 6.1 Thanks ________________________________ From: MEEHANBT at nv.doe.gov To: the.1.lily at hotmail.com; vtkusers at vtk.org Subject: Re: [vtkusers] vtk headers displays: file not found Date: Thu, 31 Jul 2014 20:49:39 +0000 It sounds like you don't have your environment set up correctly. I run OS X Lion, and I have VTK installed in "~/VTK" and I do both C++ and Python development using VTK. My ".bash_profile" is: export VTK=~/VTK export PATH=$PATH:$VTK/bin export PYTHONPATH=$PYTHONPATH:$VTK/lib/python2.7/site-packages export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$VTK/lib export PATH=$PATH:/Applications/CMake.app/Contents/bin export MANPATH=$MANPATH:/Applications/CMake.app/Contents/man If that doesn't work, let us see your environment setup, and where you put VTK at. I tried to load your link and couldn't get to the page. It is VERY likely that the problem is on my end. From: the lily > Date: Thursday, July 31, 2014 12:47 PM To: "vtkusers at vtk.org" > Subject: [vtkusers] vtk headers displays: file not found Hi, I'm using mac osx 10.9 " Mavericks", Im trying to run a code that include the following headers, #include "vtkConeSource.h" #include "vtkCylinderSource.h" #include "vtkPolyData.h" #include "vtkPolyDataMapper.h" #include "vtkRenderWindow.h" #include "vtkCamera.h" #include "vtkActor.h" #include "vtkRenderer.h" #include "vtkRenderWindowInteractor.h" #include "vtkProperty.h" #include "vtkCallbackCommand.h" #include "vtkCommand.h" #include "vtkRendererCollection.h" #include "vtkFloatArray.h" #include "vtkCellArray.h" When I try to run the code it displays the following mpicxx -c -g -Wno-deprecated -I../../../include -I/Users/lab/software/VTK/include/vtk-5.8 d3.cpp d3.cpp:20:10: fatal error: 'vtkCylinderSource.h' file not found #include "vtkCylinderSource.h" ^ 1 error generated. make: *** [d3.o] Error 1 I installed vtk by following the steps in this link http://www.developers-life.com/configuring-and-compiling-vtk-6-1-on-mac-os-x-simple-example-of-vtk-usage.html I do not know what is going wrong and I was not lucky to find any solution online. I hope someone can help me. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: